/* Order Printer shipping label (#911).
   Global, not scoped: the same rules style the on-screen preview AND the print iframe the label is
   copied into, which has no Blazor scope attributes. Everything is pure black on white because the
   pharmacy prints on a thermal printer, which turns grey into speckle.
   The label is designed at A7 (74 x 105 mm). Other paper sizes zoom the same label to fit.
   Sizes and positions are measured off the final design PDF (NowExpress-ShipLabel-A7.pdf), so keep
   them in mm/pt and check changes against that file. */

.nxop-sheet {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nxop-label {
    box-sizing: border-box;
    width: 74mm;
    height: 105mm;
    padding: 4mm;
    background: #fff;
    color: #000;
    font-family: Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.37;
}
.nxop-label *, .nxop-label *::before, .nxop-label *::after { box-sizing: border-box; }

.nxop-top { flex: none; height: 6.1mm; display: flex; justify-content: space-between; align-items: center; }
.nxop-logo { width: 36mm; height: auto; display: block; }
.nxop-order { font-size: 11.5pt; font-weight: 700; white-space: nowrap; }

/* The card takes whatever height is left; everything below it is fixed. */
.nxop-card { flex: 1; min-height: 0; margin-top: 0.9mm; border: 0.28mm solid #000; padding: 1.4mm 2.2mm; }
.nxop-row + .nxop-row { margin-top: var(--nxop-gap, 2.1mm); }
.nxop-lab { font-size: 7.5pt; text-transform: uppercase; }
.nxop-val { font-size: var(--nxop-fit, 10.5pt); font-weight: 700; overflow-wrap: anywhere; margin-top: 0.2mm; }
.nxop-rem { margin-top: 1.6mm !important; }
.nxop-rem .nxop-val { font-weight: 400; line-height: 1.17; margin-top: 0; white-space: pre-line; }

/* Map-pin QR, top right of the card; recipient and mobile wrap beside it. */
.nxop-map { float: right; width: 16mm; margin: 0.6mm 0 0.6mm 2mm; text-align: center; }
.nxop-qr-code, .nxop-qr-code img, .nxop-qr-code canvas { width: 16mm !important; height: 16mm !important; display: block; }
.nxop-qr-code canvas { display: none !important; }
.nxop-map span { display: block; font-size: 5.5pt; font-weight: 700; text-transform: uppercase; margin-top: 0.3mm; white-space: nowrap; }

/* Recipient, mobile, address and remarks share one size: 10.5pt, shrunk only as far as this label's
   text needs to stay on one A7 sticker (fitLabels in OrderPrinterModal.razor.js sets --nxop-fit/--nxop-gap). */

.nxop-delivery { flex: none; height: 6mm; margin-top: 2mm; border: 0.32mm solid #000; display: flex; align-items: center; justify-content: center; font-size: 9.5pt; font-weight: 700; text-transform: uppercase; }
.nxop-barcode { flex: none; display: block; width: 54mm; height: 8mm; margin: 2mm auto 0; }
.nxop-barcode rect { fill: #000; }

.nxop-handling { flex: none; height: 8.5mm; margin-top: 2mm; background: #000; color: #fff; display: flex; align-items: center; gap: 3mm; padding-left: 3mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.nxop-handling svg { width: 5mm; height: 5mm; flex: none; }
.nxop-handling-main { font-size: 9.5pt; font-weight: 700; text-transform: uppercase; white-space: pre; line-height: 1.2; }
.nxop-handling-cold .nxop-handling-main { font-size: 9pt; }
.nxop-handling-sub { font-size: 6.8pt; font-weight: 700; text-transform: uppercase; white-space: pre; line-height: 1.2; margin-top: 0.4mm; }
.nxop-handling-cold svg { width: 6mm; height: 6mm; }

/* ---------- Packing slip (#990) ----------
   Goes INSIDE the box: the packer's checklist. Same A7 sheet, logo row and black-only rules as the
   label above (it reuses .nxop-label / .nxop-top). No patient name, address or prices.
   fitSlips in OrderPrinterModal.razor.js sets --nxps-k (text scale, floor 0.6) and --nxps-pad. */
.nxps-title { flex: none; display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1.6mm; padding-bottom: 1.2mm; border-bottom: 0.45mm solid #000; }
.nxps-title b { font-size: 12pt; letter-spacing: 0.02em; text-transform: uppercase; }
.nxps-title span { font-size: 7pt; }
.nxps-head, .nxps-row { display: grid; grid-template-columns: 4.4mm 10.5mm 1fr; gap: 0 1.6mm; }
.nxps-head { flex: none; font-size: 6pt; font-weight: 700; text-transform: uppercase; padding: 1mm 0 0.6mm; }
.nxps-list { flex: 1; min-height: 0; overflow: hidden; }
.nxps-row { align-items: start; padding: var(--nxps-pad, 1.3mm) 0; border-top: 0.2mm dashed #000; }
.nxps-row:first-child { border-top: 0.28mm solid #000; }
.nxps-chk { width: calc(4.4mm * var(--nxps-k, 1)); height: calc(4.4mm * var(--nxps-k, 1)); border: 0.4mm solid #000; margin-top: 0.3mm; }
.nxps-qty { font-size: calc(14pt * var(--nxps-k, 1)); font-weight: 900; line-height: 1; white-space: nowrap; }
.nxps-qty i { font-style: normal; font-size: 0.62em; font-weight: 700; margin-right: 0.2mm; }
.nxps-name { font-size: calc(8.6pt * var(--nxps-k, 1)); font-weight: 700; line-height: 1.18; overflow-wrap: anywhere; }
.nxps-var { font-size: calc(7.4pt * var(--nxps-k, 1)); line-height: 1.2; margin-top: 0.3mm; overflow-wrap: anywhere; }
.nxps-sku { font-family: "Courier New", monospace; font-size: calc(6.4pt * var(--nxps-k, 1)); }
.nxps-empty { font-size: 8pt; padding-top: 2mm; border-top: 0.28mm solid #000; }
.nxps-total { flex: none; margin-top: 1.6mm; border: 0.4mm solid #000; height: 7mm; display: flex; align-items: center; justify-content: space-between; gap: 1.5mm; padding: 0 2.2mm; }
.nxps-total b { font-size: 9.5pt; text-transform: uppercase; white-space: nowrap; }
.nxps-total span { font-size: 6.4pt; line-height: 1.15; text-align: right; }
.nxps-band { flex: none; margin-top: 1.6mm; height: 7.5mm; background: #000; color: #fff; display: flex; align-items: center; gap: 2mm; padding: 0 2.4mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.nxps-band .nxps-chk { width: 4mm; height: 4mm; border-color: #fff; margin: 0; }
.nxps-band b { font-size: 8.6pt; text-transform: uppercase; }
.nxps-band span { margin-left: auto; font-size: 6.4pt; font-weight: 700; text-transform: uppercase; }
.nxps-foot { flex: none; margin-top: 2mm; display: flex; gap: 3mm; font-size: 7.5pt; }
.nxps-foot div { flex: 1; display: flex; align-items: flex-end; gap: 1mm; white-space: nowrap; }
.nxps-foot div::after { content: ""; flex: 1; height: 3.6mm; border-bottom: 0.3mm solid #000; }
