/* ============================================================
   CashCount — Print Styles
   print.css
   ============================================================ */

@media print {
  /* ── Reset for print ──────────────────────────────────── */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
    box-sizing: border-box;
  }

  html, body {
    background: white;
    color: #111827;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 11pt;
    margin: 0;
    padding: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden !important; /* Forces single page print */
  }

  /* ── Hide everything except the print summary ─────────── */
  body > *:not(#print-summary) {
    display: none !important;
  }

  /* ── Print summary (injected by JS) ───────────────────── */
  #print-summary {
    display: block !important;
    padding: 1.5cm;
    max-width: 800px;
    margin: 0 auto;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  .print-report-wrapper {
    display: flex;
    flex-direction: column;
    page-break-inside: avoid;
  }

  .print-report-title {
    font-size: 24pt;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
    margin: 0 0 4pt 0;
    line-height: 1.1;
  }

  .print-report-date {
    font-size: 9.5pt;
    color: #6B7280;
    margin-bottom: 24pt;
  }

  /* ── Table style ──────────────────────────────────────── */
  .print-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12pt;
    border-bottom: 3px solid #111827;
    page-break-inside: avoid;
  }

  .print-report-table th {
    background: #F9FAFB;
    padding: 8pt 10pt;
    font-size: 8.5pt;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4B5563;
    border-top: 1.5px solid #E5E7EB;
    border-bottom: 1.5px solid #E5E7EB;
  }

  .print-report-table td {
    padding: 10pt 10pt;
    border-bottom: 1px solid #E5E7EB;
    color: #111827;
    font-size: 10pt;
  }

  .print-report-table tr:last-child td {
    border-bottom: none;
  }

  .print-cell-type {
    font-weight: 500;
  }

  .print-cell-denom {
    font-weight: 600;
  }

  .print-cell-qty {
    font-variant-numeric: tabular-nums;
  }

  .print-cell-subtotal {
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  /* Right align subtotal header and cell */
  .print-report-table th:last-child,
  .print-report-table td:last-child {
    text-align: right;
  }

  /* ── Total summary footer ─────────────────────────────── */
  .print-report-footer-total {
    margin-top: 16pt;
    display: flex;
    flex-direction: column;
    gap: 4pt;
    page-break-inside: avoid;
  }

  .print-report-total {
    font-size: 14pt;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
  }

  .print-report-pieces-breakdown {
    font-size: 10pt;
    color: #4B5563;
    font-weight: 500;
  }
}
