/* ============================================================================================
   PRINT — the four Forged Brands documents

   window.print() was already wired up in one place before this file existed, with no print
   stylesheet behind it, so it printed the sidebar, the topbar and the sandbox banner onto the
   customer's invoice. Everything here exists to make the page that reaches paper contain the
   document and nothing else.

   TWO RULES THAT LOOK LIKE DETAILS AND ARE NOT:

   1. A DOCUMENT IS NOT THEMED. It prints identically in light mode, in dark mode and on paper,
      because it is a legal and financial record that leaves the building — a customer must never
      receive an invoice whose readability depended on a UI preference. So the documents set
      literal colors in their own markup and this file forces a white ground with black ink,
      overriding whatever the app theme is.
   2. print-color-adjust:exact keeps the header bar, the table header shading and the past-due
      notice. Browsers strip backgrounds by default to save toner, which would erase exactly the
      structure that makes these readable.
   ============================================================================================ */

@page{ size:letter; margin:0.45in; }

/* ONE THING ON PAPER (2026-10-01). Kyle, on the school report's Download / Print PDF: "it seems to try to download or
   print the entire page and not just the report." licensing.printReport puts a copy of the report in #printOnly and
   sets body.print-one for the length of the print; everything else on the page stays off the paper. */
#printOnly{ display:none; }
@media print{
  body.print-one > *:not(#printOnly){ display:none !important; }
  body.print-one #printOnly{ display:block !important; }
}

@media print{
  /* the app disappears; only the document survives */
  .sidebar, .topbar, .sxbanner, .no-print, .toast, .modal, .drawer{ display:none !important; }
  .app{ display:block !important; min-height:0 !important; }
  .main{ display:block !important; }
  .content{ padding:0 !important; max-width:none !important; width:100% !important; }

  html, body{
    background:#FFFFFF !important; color:#1A1C1E !important;
    height:auto !important; margin:0 !important; padding:0 !important;
    -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important;
  }
  *{ -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important;
     box-shadow:none !important; }

  /* the on-screen preview frame is chrome, not document */
  .docwrap{ background:none !important; padding:0 !important; }
  .doc{ border:0 !important; border-radius:0 !important; margin:0 !important;
        width:auto !important; max-width:none !important; padding:0 !important; }

  /* PAGE BREAKS. A page break inside a table row splits a line item's numbers across two sheets,
     which is how a receiving clerk miscounts a carton. */
  thead{ display:table-header-group; }
  tfoot{ display:table-footer-group; }
  tr, .docblock, .docparty, .doctotals, .doccarton{ break-inside:avoid; page-break-inside:avoid; }
  .docpage{ break-after:page; page-break-after:always; }
  .docpage:last-child{ break-after:auto; page-break-after:auto; }
  .docpage{ padding:0 !important; }

  a{ color:#1A1C1E !important; text-decoration:none !important; }
  /* Screen tables scroll; paper tables cannot. Undo the scroll container so a wide table lays
     out at its natural width and the print scaler fits it to the sheet. */
  .tablewrap, .tablescroll{ overflow:visible !important; }
  /* A running footer per sheet is not possible without paged media, so the document's own
     footer is placed once per .docpage instead. */
}

/* ---- on-screen preview: a sheet of paper on a desk ----
   A letter sheet is 8.5in, which is wider than the content column on a narrow window. The frame
   scrolls sideways so the SHEET keeps its true proportions — squeezing it to fit would show a
   layout that isn't the one that prints, which defeats the point of a preview. */
/* `display:block` + `margin:0 auto` and NOT flex+justify-content:center. A centered flex child
   that is wider than its container overflows in BOTH directions, and the part that runs off the
   left is unreachable — no amount of scrolling brings it back. Auto margins collapse to zero
   once the sheet no longer fits, so it centers when it can and scrolls from the left when it
   can't. */
.docwrap{ background:var(--surface-3); padding:22px; overflow-x:auto; max-width:100%; }
.doc{
  width:8.5in; margin:0 auto; background:#FFFFFF; color:#1A1C1E;
  border:1px solid var(--line); border-radius:2px;
  box-shadow:0 2px 6px rgba(0,0,0,.10), 0 12px 34px rgba(0,0,0,.10);
  font-family:"Montserrat",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
.docpage{ padding:0.45in; }
.docpage + .docpage{ border-top:1px dashed var(--line-2); }
