/* print-match.css: Print / Save as PDF shows ONLY the document, exactly as previewed.
   Used by invoice.php, waybill.php and purchaseorder.php (loaded with media="print").
   print-match.js marks everything outside the document .pm-hide and its containers .pm-anc. */
@page { margin: 0; }
html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; min-height: 0 !important; height: auto !important; }

/* Everything that isn't the document: site header/banner, page intro, form, footer, cursor, toasts, widgets. */
.pm-hide { display: none !important; }
/* Containers of the document: no spacing, no width limits, no effects, so the page starts at the paper's top-left. */
.pm-anc {
  display: block !important; position: static !important; margin: 0 !important; padding: 0 !important; border: 0 !important;
  width: auto !important; max-width: none !important; min-width: 0 !important; height: auto !important; min-height: 0 !important;
  transform: none !important; overflow: visible !important; box-shadow: none !important; background: #fff !important; gap: 0 !important;
}
/* Fallback if the browser doesn't fire beforeprint (named elements only). */
#cursor-dot, #cursor-ring, .c9-banner, .seo-intro, .controls, header, footer, .f-footer, nav, .c-drawer,
#mobile-preview-toggle, #toast-message, .toast, .sync-indicator, .recent-invoices, .recent-waybills, .recent-pos { display: none !important; }

/* Same page box as the preview: fixed paper width, full-page height, same padding, flex column
   so bottom-anchored sections (totals, signatures, footer) stay where the preview shows them. */
#invoice-page.a4-page, #waybill-page.a4-page, #po-page.a4-page {
  display: flex !important; flex-direction: column !important; box-sizing: border-box !important;
  width: 210mm !important; min-height: 296mm !important; padding: 15mm !important;
  margin: 0 !important; max-width: none !important; position: relative !important;
  transform: none !important; box-shadow: none !important; overflow: visible !important;
  page-break-inside: auto !important; break-inside: auto !important; page-break-after: auto !important;
}
/* Print backgrounds and colours exactly as previewed (browsers drop them by default). */
#invoice-page, #invoice-page *, #waybill-page, #waybill-page *, #po-page, #po-page * {
  -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important;
}
/* No text caret or selection highlight in the output. */
#invoice-page *, #waybill-page *, #po-page * { caret-color: transparent !important; }
::selection { background: transparent !important; }
