/* ------------------------------------------------------------------
   Print layouts — receipts, KOTs, reports
   Sizes: 58mm thermal, 80mm thermal, A4
   ------------------------------------------------------------------ */

@media print {
  /* Hide everything except print area */
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    background: #fff;
    color: #000;
    padding: 0;
    margin: 0;
  }

  /* Remove shadows & backgrounds */
  * { box-shadow: none !important; background: transparent !important; }

  /* Default receipt styling */
  .receipt {
    font-family: var(--font-mono, "Courier New", monospace);
    font-size: 12px;
    line-height: 1.35;
    color: #000;
    max-width: 80mm;
    margin: 0 auto;
    padding: 4mm;
  }
  .receipt h1, .receipt h2, .receipt h3 {
    text-align: center;
    color: #000;
    margin: 0 0 2mm;
    font-weight: 700;
  }
  .receipt h1 { font-size: 14px; }
  .receipt h2 { font-size: 12px; }
  .receipt .divider {
    border-top: 1px dashed #000;
    margin: 2mm 0;
  }
  .receipt table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
  }
  .receipt th, .receipt td {
    padding: 1mm 0;
    text-align: left;
    vertical-align: top;
  }
  .receipt .text-right { text-align: right; }
  .receipt .text-center { text-align: center; }
  .receipt .bold { font-weight: 700; }
  .receipt .lg { font-size: 13px; }
  .receipt .sm { font-size: 10px; }
  .receipt .total-row {
    font-weight: 700;
    font-size: 13px;
    border-top: 1px solid #000;
    padding-top: 1.5mm;
  }

  /* KOT specific */
  .kot {
    font-size: 13px;
    line-height: 1.4;
  }
  .kot .kot-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 2mm;
    margin-bottom: 2mm;
  }
  .kot .kot-order-id {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin: 2mm 0;
  }
  .kot .kot-item {
    border-bottom: 1px dashed #000;
    padding: 2mm 0;
    font-size: 14px;
  }
  .kot .kot-qty {
    font-weight: 700;
    font-size: 16px;
    display: inline-block;
    min-width: 32px;
  }
  .kot .kot-note {
    font-style: italic;
    font-size: 12px;
    padding-left: 6mm;
  }

  /* 58mm narrow */
  @page size-58 { size: 58mm auto; }
  .receipt-58mm, .kot-58mm { max-width: 58mm; font-size: 11px; }

  /* 80mm */
  @page size-80 { size: 80mm auto; }
  .receipt-80mm, .kot-80mm { max-width: 80mm; font-size: 12px; }

  /* A4 report */
  .report-a4 {
    font-family: var(--font-sans);
    font-size: 11px;
    max-width: none;
    padding: 12mm;
  }
  .report-a4 h1 { text-align: left; font-size: 20px; }
  .report-a4 table { width: 100%; border-collapse: collapse; }
  .report-a4 th, .report-a4 td {
    border: 1px solid #000;
    padding: 3mm;
    text-align: left;
  }
  .report-a4 th { background: #f3f4f6 !important; }

  /* Hide non-print controls */
  .no-print { display: none !important; }
  button, .btn, .icon-btn, nav, header, footer { display: none !important; }
}