/**
 * Print styles: one A5 template for every document (UI-030…033). The page is built in #print-root
 * (js/print.js); everything else is hidden while printing. Black and white, Western digits (NFR-008).
 */
@page { size: A5 portrait; margin: 10mm; }

.print-root { display: none; }

@media print {
  body.is-printing > :not(.print-root) { display: none !important; }
  body.is-printing .print-root { display: block; }
  .topbar, .nav, .updatebar, .toasts, .no-print { display: none !important; }
  html, body { background: #fff; color: #000; font-size: 11pt; }
  .screen { padding: 0; max-inline-size: none; }

  .doc { color: #000; }
  .doc__head { display: flex; align-items: center; gap: 4mm; border-block-end: 0.6mm solid #000; padding-block-end: 3mm; margin-block-end: 4mm; }
  .doc__logo { inline-size: 12mm; block-size: 12mm; border: 0.5mm solid #000; border-radius: 2mm; display: grid; place-items: center; font-weight: 700; font-size: 16pt; }
  .doc__company { font-weight: 700; font-size: 14pt; }
  .doc__title { font-size: 15pt; text-align: center; margin: 2mm 0 4mm; }
  .doc__facts { display: grid; grid-template-columns: max-content 1fr; gap: 1mm 5mm; margin: 0 0 4mm; }
  .doc__facts dt { font-weight: 700; }
  .doc__facts dd { margin: 0; }
  .doc .rx-grid { inline-size: 100%; }
  .doc .rx-grid th, .doc .rx-grid td { border: 0.3mm solid #000; padding: 1.5mm; background: none !important; color: #000 !important; }
  .doc .rx-cell--changed { text-decoration: none; font-weight: 400; }
  .doc .rx-view { display: block; }
  .doc__notes { margin-block-start: 3mm; }
  .doc__foot { margin-block-start: 6mm; font-size: 8pt; border-block-start: 0.3mm solid #000; padding-block-start: 2mm; }
}

/* Invoice and test page (UI-020, UI-025, UI-030) */
@media print {
  .doc__phones { font-size: 9pt; }
  .doc__number { font-size: 18pt; letter-spacing: 0.5pt; }
  .doc__mark { border: 0.6mm solid #000; text-align: center; font-weight: 700; font-size: 14pt; padding: 1mm; margin-block-end: 2mm; }
  .doc__mark--void { font-size: 22pt; letter-spacing: 4pt; }
  .doc__table { inline-size: 100%; border-collapse: collapse; margin-block-end: 3mm; font-size: 10pt; }
  .doc__table th, .doc__table td { border: 0.3mm solid #000; padding: 1.2mm 1.5mm; text-align: start; vertical-align: top; }
  .doc__table td:not(:first-child), .doc__table th:not(:first-child) { white-space: nowrap; }
  .doc__small { font-size: 8.5pt; }
  .doc__totals { display: grid; grid-template-columns: 1fr max-content; gap: 0.8mm 5mm; margin: 0 0 3mm; }
  .doc__totals dd { margin: 0; text-align: end; }
  .doc__grand { font-weight: 700; font-size: 13pt; }
  .doc__terms { font-size: 8.5pt; border-block-start: 0.3mm dashed #000; padding-block-start: 2mm; }
  .doc__frame { border: 0.8mm solid #000; block-size: 40mm; display: grid; place-items: center; font-size: 28pt; font-weight: 700; margin-block-start: 4mm; }
}

/* Job-order documents (UI-021…023, FR-086): the order number large; receipt and lab card on separate pages */
@media print {
  .doc + .doc { break-before: page; }
  .doc__number--big { font-size: 26pt; font-weight: 700; margin-block-start: 1mm; }
  .doc__notice { border: 0.5mm solid #000; padding: 2mm; font-weight: 700; text-align: center; }
  .doc__list { margin: 2mm 0 3mm; padding-inline-start: 5mm; font-size: 10pt; }
  .doc__list li { margin-block-end: 1mm; }
}

/* Closing report (UI-024) */
@media print {
  .doc__signatures { display: flex; justify-content: space-between; gap: 6mm; margin-block-start: 12mm; }
}
