/* ANMACK MineOS — printed forms.
   The workspace is dark and dense; paper is neither. These rules take over the page entirely
   when printing, so what comes out of the printer is the form, not a screenshot of the app. */

.printonly{display:none}

@media print {
  @page { size: A4 portrait; margin: 14mm 12mm; }

  /* Hide everything the browser would otherwise lay out and print only the form.
     Hiding the application piece by piece was not enough: #app keeps its min-height of
     100vh, which printed as an empty first page, and anything inside it that the rules
     missed printed as a block of the dark interface. Hiding every direct child of <body>
     and re-showing only the print box leaves nothing to leak through. */
  body > * { display: none !important; }
  body > #printbox { display: block !important; }
  html, body { background: #fff !important; color: #000 !important;
               height: auto !important; min-height: 0 !important; margin: 0 !important; }

  .printonly { display: block !important; }
  .printonly * { color: #000 !important; }

  .psheet { font-family: Arial, Helvetica, sans-serif; font-size: 11px; line-height: 1.35; }
  .psheet h1 { font-size: 15px; text-align: center; margin: 0; letter-spacing: .3px; }
  .psheet h2 { font-size: 12px; text-align: center; margin: 2px 0 0; font-weight: 700; }
  .psheet h3 { font-size: 13px; text-align: center; margin: 14px 0 16px; font-weight: 700; }
  .pref { text-align: right; font-weight: 700; font-size: 12px; margin: -14px 0 6px; }

  /* The boxed label-and-value rows of ANMACK's form. */
  .prow { display: flex; align-items: stretch; margin-bottom: 5px; gap: 8px; }
  .prow .lbl { width: 128px; flex: none; text-align: right; font-weight: 700; padding-top: 4px; }
  .prow .val { border: 1px solid #000; padding: 4px 7px; min-height: 20px; flex: 1; }
  .prow .val.short { flex: none; width: 168px; }
  .prow .val.mid { flex: none; width: 250px; }
  .prow.split { justify-content: space-between; }

  .pmethods { display: flex; gap: 10px; margin: 12px 0 16px; flex-wrap: wrap; }
  .pmethod { display: flex; align-items: stretch; gap: 5px; }
  .pmethod .lbl { font-weight: 700; padding-top: 4px; font-size: 10px; }
  .pmethod .box { border: 1px solid #000; width: 82px; min-height: 20px; padding: 3px 5px; text-align: right; }
  .pmethod.on .box { font-weight: 700; }

  table.pgrid2 { width: 100%; border-collapse: collapse; margin: 10px 0 14px; }
  table.pgrid2 th, table.pgrid2 td { border: 1px solid #000; padding: 5px 7px; font-size: 11px; }
  /* The screen styles give a table head a dark background, which on paper prints as a bar of
     ink with black text on it. On a form it should read as a heading, not a highlight. */
  table.pgrid2 th { text-align: center; font-weight: 700;
                    background: #e9e9e9 !important; color: #000 !important;
                    text-transform: none; letter-spacing: 0; }
  table.pgrid2 td.amt { text-align: right; width: 110px; }
  table.pgrid2 td.dt { width: 92px; }
  table.pgrid2 tr.blank td { height: 19px; }
  table.pgrid2 tr.tot td { font-weight: 700; }

  /* Signatures come from record_approvals, so an unsigned line prints empty. */
  .psigs { margin-top: 26px; }
  .psig { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 17px; font-size: 11px; }
  .psig .role { width: 118px; flex: none; font-weight: 700; }
  .psig .title { width: 150px; flex: none; font-weight: 700; text-align: right; }
  .psig .line { flex: 1; border-bottom: 1px solid #000; min-height: 15px; padding: 0 6px 1px; }
  .psig .dlabel { width: 36px; flex: none; font-weight: 700; text-align: right; }
  .psig .dline { width: 118px; flex: none; border-bottom: 1px solid #000; min-height: 15px; padding: 0 6px 1px; }

  /* The requisition's items. Narrow columns are fixed so the description gets the room. */
  table.pitems { margin: 12px 0 14px; }
  table.pitems th { font-size: 10px; }
  table.pitems td.ln { width: 22px; text-align: center; }
  table.pitems td.sku, table.pitems th.sku { width: 86px; }
  table.pitems td.qty, table.pitems th.qty { width: 76px; text-align: right; }
  table.pitems th.ln { width: 22px; }
  table.pitems .sub { font-size: 9px; font-style: italic; }
  table.pitems tr.tot td { font-weight: 700; text-align: right; }
  table.pitems tr.tot td.amt { text-align: right; }

  .pfootnote { margin-top: 20px; font-size: 9px; text-align: center; }
  .ppage { page-break-after: always; }
  .ppage:last-child { page-break-after: auto; }
}
