/* Handstone app — mobile-first styles (same layout as the Newton Finishing app, green brand). Brand colours are the first two lines of :root. */
:root {
  --brand: #2E6B4A;
  --brand-dark: #1F4D34;
  --ground: #F5F2EC;
  --surface: #FFFFFF;
  --ink: #1E1B18;
  --ink-2: #3D3833;
  --muted: #5F5852;
  --line: #E4DED4;
  --chip: #F5F2EC;
  --warn-bg: #FCEFD9;
  --warn-ink: #6B4210;
  --ok-bg: #E6F0E7;
  --ok-line: #B9D3BD;
  --ok-ink: #24572E;
  --radius: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--ground); }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.screen { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.screen.no-nav { padding-bottom: 0; }
.wrap { width: 100%; max-width: 720px; margin: 0 auto; }
main.content { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.topbar { background: var(--brand); color: #fff; padding: calc(10px + var(--safe-t)) 12px 14px; position: sticky; top: 0; z-index: 5; }
.topbar .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.topbar .tb-side { display: flex; gap: 4px; flex: none; min-width: 92px; }
.topbar .tb-side.right { justify-content: flex-end; }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; text-align: center; }
.topbar .hello { display: flex; flex-direction: column; gap: 2px; }
.topbar .hello small { font-size: 13px; opacity: .9; }
.topbar .hello strong { font-size: 22px; letter-spacing: -0.01em; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; text-decoration: none; }
.icon-btn:active { background: rgba(255,255,255,.15); }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; border: 0; }

.summary { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.summary .big { font-size: 28px; font-weight: 700; }
.summary .big small { font-size: 14px; font-weight: 500; }
.summary .between { display: flex; justify-content: space-between; align-items: baseline; }
.bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.3); overflow: hidden; }
.bar > div { height: 8px; background: #fff; }
.bar.light { background: #EAE4DA; }
.bar.light > div { background: var(--brand); }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(30,27,24,.08); }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-label { margin: 6px 4px 0; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--chip); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 26px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 14px; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); text-decoration: none; font-weight: 600; box-shadow: 0 1px 2px rgba(30,27,24,.08); }
.tile svg { color: var(--brand); }
.tile small { font-weight: 500; color: var(--muted); }
.notes { white-space: pre-line; font-size: 14px; line-height: 1.45; margin: 0; }

.colour-head { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--radius); padding: 10px 12px; }
.colour-head .swatch { width: 12px; height: 28px; border-radius: 4px; background: var(--brand); }
.colour-head div { display: flex; flex-direction: column; }
.colour-head small { font-size: 11px; color: var(--muted); font-weight: 500; }
.colour-head strong { font-size: 15px; }
.colour-head .pts { margin-left: auto; font-size: 13px; font-weight: 700; }

.order { transition: opacity .2s; }
.order.is-done { opacity: .6; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; color: var(--ink); text-decoration: none; }
.order-head .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.order-head .who strong { font-size: 15px; }
.order-head .who span { font-size: 13px; color: var(--brand); font-weight: 700; }
.pill { flex: none; font-size: 13px; font-weight: 700; background: var(--chip); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.warn { background: #FBEBD0; color: #7A4A00; }
.pickup-row { align-items: flex-start; }
.pickup-row input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--brand); flex: none; margin-top: 2px; }
.pill.brand { background: #E1ECF1; color: var(--brand-dark); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

.note { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 500; line-height: 1.35; }
.note svg { flex: none; margin-top: 1px; }

.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: flex; gap: 10px; align-items: flex-start; }
.qty { flex: none; min-width: 34px; height: 26px; border-radius: 8px; background: var(--chip); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.line-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.line-top { display: flex; justify-content: space-between; gap: 8px; }
.code { font-size: 13px; font-weight: 700; color: var(--brand); }
.line-pts { font-size: 12px; color: var(--muted); white-space: nowrap; }
.desc { font-size: 13px; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; }

.actions { display: flex; gap: 8px; }
.btn { min-height: 44px; border-radius: 10px; border: 1px solid #D9D1C4; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.done { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.wide { flex: 1; }
.btn.block { width: 100%; }
.btn.big { min-height: 52px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: default; }

.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-radius: 12px; color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px rgba(30,27,24,.06); }
.list-item .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.list-item .who strong { font-size: 15px; overflow-wrap: anywhere; }
.list-item .who span { font-size: 13px; color: var(--muted); }
.list-item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.search { display: flex; gap: 8px; }
.search input { flex: 1; min-height: 48px; border-radius: 12px; border: 1px solid #D9D1C4; padding: 0 14px; font-size: 16px; background: var(--surface); color: var(--ink); }
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 15px; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); z-index: 10; }
.nav .wrap { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.nav a { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 700; }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; background: var(--brand); color: #fff; }
.signin .logo { width: 84px; height: 84px; border-radius: 20px; background: #fff; color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 32px; }
.signin h1 { margin: 0; font-size: 26px; }
.signin p { margin: 0; max-width: 320px; line-height: 1.45; opacity: .95; }
.google-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 12px; border: 0; background: #fff; color: #1f1f1f; font-weight: 600; font-size: 16px; }

/* ---------- misc ---------- */
.splash { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #E4DED4; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 12px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
#toast.error { background: #8E1F1F; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--surface);
  border: 1px solid #D9D1C4; border-radius: 10px; min-height: 46px; padding: 8px 12px; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.danger { color: #8E1F1F; border-color: #E8C3C3; }
.btn.small { min-height: 36px; padding: 0 10px; font-size: 13px; }

/* ---------- menu groups on Home ---------- */
.menu-group { display: flex; flex-direction: column; gap: 8px; }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.menu-grid a { background: var(--surface); border-radius: 12px; padding: 12px; min-height: 52px; display: flex; align-items: center;
  gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; box-shadow: 0 1px 2px rgba(30,27,24,.06); }
.menu-grid a svg { color: var(--brand); flex: none; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- tables (reports, invoices) ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(30,27,24,.08); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #EFEAE2; white-space: nowrap; }
table.data th { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.bar-cell { min-width: 90px; }
.hbar { height: 8px; border-radius: 4px; background: var(--brand); }

/* ---------- segmented filter ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.seg a { flex: none; padding: 8px 12px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; border: 1px solid #E4DED4; }
.seg a[aria-current="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }

.tick-row { display: flex; gap: 8px; align-items: stretch; }
.tick-row > :first-child { flex: 1; min-width: 0; }
.tick-row.pickup-row > :first-child { flex: none; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 15px; }
.totals .grand { font-size: 18px; font-weight: 800; }
.inline-num { width: 84px; min-height: 40px; border: 1px solid #D9D1C4; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 15px; text-align: right; }
/* hidden but still usable (iPhone won't open a display:none file picker) */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
label.btn { position: relative; }

/* ---------- product labels: DYMO 30252 / 30320, driver paper 89 x 28 mm ----------
   The LabelWriter doesn't print the last ~6 mm on the right (measured on a real label:
   printing stopped ~83 mm from the left edge), so text stays inside the first 77 mm. */
.plabel { width: 88.5mm; height: 27.4mm; box-sizing: border-box; padding: 1.2mm 11.5mm 1.1mm 1.5mm; display: flex; gap: 1.8mm;
  background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; overflow: hidden; }
.clabel { display: block; padding: 1.5mm 4mm; }
.clabel-name { font-size: 17pt; font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.clabel-step { font-size: 10pt; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clabel-step.stain { font-weight: 700; }
.plabel-qr { flex: none; width: 25mm; height: 25mm; }
.plabel-qr svg { width: 100%; height: 100%; display: block; }
.plabel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.plabel-po { font-size: 12.5pt; font-weight: 800; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plabel-item { display: flex; justify-content: space-between; gap: 6px; font-size: 10pt; font-weight: 700; line-height: 1.1; }
.plabel-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plabel-of { flex: none; border: 1.2px solid #000; border-radius: 3px; padding: 0 3px; font-size: 9pt; }
.plabel-desc { font-size: 7pt; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.plabel-foot { display: flex; justify-content: space-between; gap: 4px; font-size: 7pt; font-weight: 700; line-height: 1.1; }
.plabel-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plabel-foot span:first-child { flex: none; max-width: 55%; }
.label-pick { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.label-pick input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.label-preview { border: 1px dashed #B9B0A2; border-radius: 6px; overflow: hidden; flex: none; }
.label-preview .plabel { transform-origin: top left; }
.order-flag { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; background: #FBE3E3; color: #8A1C1C; border: 1px solid #E8B4B4; border-radius: 6px; padding: 2px 8px; font-size: 13px; font-weight: 800; margin: 2px 6px 2px 0; }
.list-item .who .order-flag { color: #8A1C1C; font-weight: 800; font-size: 13px; white-space: nowrap; margin: 3px 0; }
.line-flag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; align-self: flex-start; background: var(--warn-bg); color: var(--warn-ink); border-radius: 6px; padding: 2px 8px; font-size: 13px; font-weight: 700; }
.line-print { flex: none; width: 40px; height: 40px; margin: -6px -6px -6px 0; color: var(--brand); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.line-print:active { background: var(--chip); }
.line-print.busy { opacity: .4; pointer-events: none; }
#print-root { display: none; }
@media print {
  html.printing-labels body > *:not(#print-root) { display: none !important; }
  html.printing-labels, html.printing-labels body { background: #fff; margin: 0; padding: 0; height: auto !important; min-height: 0 !important; }
  html.printing-labels #print-root { display: block; }
  html.printing-labels .plabel { page-break-after: always; break-after: page; }
  html.printing-labels .plabel:last-child { page-break-after: auto; break-after: auto; }
}

/* ---------- Create shipment: totals, more orders ---------- */
.ship-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ship-totals div { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.ship-totals b { display: block; font-size: 22px; }
.ship-totals span { font-size: 13px; color: var(--muted); }
.ship-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ship-btns .btn { width: 100%; }
.ship-btns .full { grid-column: 1 / -1; }
details.more-orders > summary { list-style: none; cursor: pointer; }
details.more-orders > summary::-webkit-details-marker { display: none; }
details.more-orders[open] > summary { margin-bottom: 8px; }
.section-title { margin: 14px 4px 6px; font-size: 15px; }

/* ---------- Ready to Ship List / Shipping Slip (printed on letter paper) ---------- */
.slip { font-family: "Segoe UI", Calibri, Arial, sans-serif; color: #1E1B18; font-size: 10pt; line-height: 1.35; }
.slip-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 2.5px solid var(--brand); }
.slip-co { color: #6b645d; font-size: 9pt; }
.slip-co-name { font-size: 16pt; font-weight: 700; color: #1E1B18; margin-bottom: 2px; }
.slip-small { font-size: 8.5pt; }
.slip-title { text-align: right; }
.slip-title-text { font-size: 20pt; font-weight: 800; color: var(--brand); letter-spacing: -0.2px; }
.slip-meta { margin: 6px 0 0; }
.slip-meta > div { display: flex; justify-content: flex-end; gap: 10px; align-items: baseline; }
.slip-meta dt { font-size: 7.5pt; font-weight: 700; color: #6b645d; text-transform: uppercase; letter-spacing: .5px; }
.slip-meta dd { margin: 0; font-weight: 700; min-width: 24mm; }
.slip-cap { font-size: 7.5pt; font-weight: 700; color: #6b645d; text-transform: uppercase; letter-spacing: .5px; }
.slip-muted { color: #6b645d; }
.slip-addr { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 14px 0 16px; }
.slip-cust { font-size: 12.5pt; font-weight: 700; margin-top: 2px; }
.slip-via-line { border-bottom: 1px solid #D9D2C6; height: 16px; }
.slip-cols { display: grid; grid-template-columns: 10mm 31mm 1fr; padding: 0 0 3px; font-size: 7.5pt; font-weight: 700; color: #6b645d; text-transform: uppercase; letter-spacing: .5px; }
.slip-cols span:first-child { text-align: right; padding-right: 3mm; }
.slip-order { padding: 0 0 6px; margin-bottom: 6px; border-bottom: 0.5pt solid #D9D2C6; break-inside: avoid; page-break-inside: avoid; }
.slip-po { display: flex; justify-content: space-between; gap: 12px; background: #F3EFE8; padding: 3px 8px; border-radius: 4px; margin-bottom: 3px;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.slip-po b { font-size: 10.5pt; }
.slip-po span:last-child b { color: var(--brand); }
.slip-line { display: grid; grid-template-columns: 10mm 31mm 1fr; padding: 1px 0; }
.slip-line .q { text-align: right; padding-right: 3mm; font-weight: 700; }
.slip-line .c { font-weight: 700; overflow-wrap: anywhere; padding-right: 2mm; }
.slip-totals { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; break-inside: avoid; }
.slip-tot { background: #F3EFE8; border-radius: 6px; padding: 6px 12px; min-width: 42mm; display: flex; flex-direction: column;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.slip-tot span { font-size: 7.5pt; font-weight: 700; color: #6b645d; text-transform: uppercase; letter-spacing: .5px; }
.slip-tot b { font-size: 15pt; }
.slip-notes { margin-top: 14px; }
.slip-notes > div:last-child { margin-top: 3px; }
.slip-sign { display: flex; justify-content: space-between; gap: 30px; margin-top: 34px; font-size: 8.5pt; color: #6b645d; break-inside: avoid; }
.slip-sign > div { flex: 1; } .slip-sign > div:last-child { flex: 0 0 55mm; }
.slip-sign span { display: block; border-top: 1px solid #888; margin-bottom: 3px; }
@media print {
  html.printing-doc body > *:not(#print-root) { display: none !important; }
  html.printing-doc, html.printing-doc body { background: #fff; margin: 0; padding: 0; height: auto !important; min-height: 0 !important; }
  html.printing-doc #print-root { display: block; }
  /* keep clear of the printer's edges even if Chrome's Margins is set to None:
     the page margin (0.3in) plus this padding, repeated on every page */
  html.printing-doc #print-root { padding: 0.25in; box-sizing: border-box; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
}

/* ---------- Shipped, to invoice: pricing per line (like Access) ---------- */
.inv-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.inv-meta strong { color: var(--ink); }
.inv-lines { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-lines th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; padding: 2px 4px; border-bottom: 1px solid #EFEAE2; white-space: nowrap; }
.inv-lines td { text-align: right; padding: 5px 4px; vertical-align: top; white-space: nowrap; border-bottom: 1px solid #F4F0E9; }
.inv-lines .l { text-align: left; white-space: normal; }
.inv-lines tr.item td { border-bottom: 0; padding-bottom: 1px; }
.inv-lines tr.desc td { color: var(--muted); font-size: 12px; padding-top: 0; }
.inv-lines .narrow { display: none; }
@media (max-width: 560px) { .inv-lines .wide { display: none; } .inv-lines .narrow { display: inline; } .inv-lines { font-size: 12.5px; } .inv-lines td, .inv-lines th { padding-left: 3px; padding-right: 3px; } }
.inv-lines .qty { display: inline-block; background: var(--chip); border-radius: 6px; padding: 0 6px; font-weight: 700; }
.inv-lines tfoot td { border-bottom: 0; padding-top: 4px; }
.inv-lines tfoot .tot td { font-weight: 800; font-size: 14px; border-top: 1.5px solid #333; }
.inv-scroll { overflow-x: auto; margin: 0 -4px; }

.prep-avg { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; background: var(--chip); border-radius: 12px; padding: 10px 12px; }
.prep-avg span { font-size: 13px; color: var(--muted); }
.prep-avg strong { font-size: 20px; }
.prep-avg small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.prep-avg small.ok { color: var(--ok-ink); font-weight: 700; }

/* ---------- Big screens (computers): use the width ----------
   Phones are unchanged. From 1000px wide the page grows to 1400px and repeated items
   (order cards, list rows) sit side by side in columns; headings, forms, summaries and
   buttons stay full width. Shipped, to invoice gets wider columns for its price table. */
@media (min-width: 1000px) {
  /* every screen the same width on a computer, one column */
  .wrap { max-width: 1480px; }
  .nav .wrap { max-width: 760px; }
  main.content { padding: 18px 24px; }
  main.content > form.card, main.content > .form { width: 100%; max-width: 820px; justify-self: center; margin: 0 auto; }
  .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* Edit forms (inventory items, suppliers, customers...): 3 columns, shorter boxes, so the whole form fits the screen */
  main.content > form.edit-grid { max-width: 1240px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; align-items: end; }
  form.edit-grid > .field:first-child { grid-column: span 2; }
  form.edit-grid > .field:has(textarea), form.edit-grid > button[type=submit] { grid-column: 1 / -1; }
  form.edit-grid input:not([type=checkbox]), form.edit-grid select { min-height: 0; height: 40px; padding-top: 6px; padding-bottom: 6px; }
  form.edit-grid > .check { min-height: 40px; align-self: end; }
  #toast { bottom: calc(var(--nav-h) + 24px); }
}
@media (min-width: 1400px) { .menu-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.stain-head .stain-cols { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.colour-sub { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px 0; font-weight: 700; color: var(--brand); border-bottom: 1.5px solid #E8DFD2; }

/* ---------- Prep list reordering: ▲ ▼ arrows on phones, drag and drop on computers ---------- */
.move-arrows { display: inline-flex; gap: 4px; flex: none; }
.move-arrows .mv { width: 34px; height: 34px; border-radius: 8px; border: 1px solid #D9D1C4; background: var(--surface); color: var(--brand); font-size: 13px; line-height: 1; cursor: pointer; }
.move-arrows .mv:disabled { opacity: .3; cursor: default; }
.order .actions:has(.move-arrows) { display: flex; gap: 8px; align-items: center; }
.order .actions:has(.move-arrows) > .btn { flex: 1; }
.colour-sub { gap: 8px; align-items: center; }
.colour-sub > span:first-child { flex: 1; }
.colour-sub .add-colour { min-height: 28px; padding: 3px 10px; font-size: 12.5px; margin: 0 0 4px; }
.stain-head .move-arrows { margin-left: 6px; }
[draggable="true"].dragging { opacity: .45; }
.drop-before { box-shadow: 0 -4px 0 0 var(--brand) !important; }
.drop-after { box-shadow: 0 4px 0 0 var(--brand) !important; }
.order.drop-before, .order.drop-after { outline: 2px dashed var(--brand); outline-offset: 2px; }
/* computers (mouse): drag instead of arrows */
@media (hover: hover) and (pointer: fine) and (min-width: 700px) {
  .move-arrows { display: none; }
  [data-drag] { cursor: grab; }
  [data-drag]:active { cursor: grabbing; }
  [data-drag] .btn, [data-drag] a { cursor: pointer; }
}

.line-flag.need-price, .order-flag.need-price { background: #FBE3E3; color: #8A1C1C; }
.inv-lines tr.need-price-row td { background: #FFF6F6; }
.inv-lines .line-flag { margin-left: 6px; text-decoration: none; }

.age { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.order-head .right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }

/* Add to prep list: what's on the prep list now, and a quick way there (stays in view) */
.card.prep-bar { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
  border: 1.5px solid var(--brand); padding: 10px 12px; }
.prep-bar small { display: block; font-size: 12px; color: var(--muted); }
.prep-bar strong { display: block; font-size: 16px; }
.prep-bar .btn { flex: none; min-height: 40px; padding: 0 14px; font-size: 14px; }
@media (min-width: 700px) { .card.prep-bar { position: sticky; top: calc(76px + var(--safe-t)); z-index: 4; } }

/* ---------- Compact order cards (Add to prep list): least height per order ---------- */
.order.compact { gap: 6px; padding: 10px 12px; }
.order.compact > .order-meta { display: none; }
.order.compact .lines { gap: 3px; }
.order.compact .line { gap: 8px; align-items: baseline; }
.order.compact .line .qty { min-width: 30px; padding: 0 5px; font-size: 13px; }
.order.compact .line-body { display: block; font-size: 13px; line-height: 1.35; }
.order.compact .line-top { display: inline; }
.order.compact .line-top .code { margin-right: 6px; }
.order.compact .line-body .desc { display: inline; }
.order.compact .line-flag { margin: 2px 0 0 6px; padding: 0 6px; font-size: 12px; }
.order.compact .line-print { width: 30px; height: 26px; margin: -4px 0; }
.order.compact .line-print svg { width: 16px; height: 16px; }
.order.compact .note { padding: 6px 10px; font-size: 13px; }
.order.compact .actions { gap: 6px; }
.order.compact .actions .btn { min-height: 38px; font-size: 14px; }
@media (min-width: 700px) {
  /* one order per row: who | item lines | buttons */
  main.content:has(> .order.compact) { display: flex !important; flex-direction: column; align-items: stretch; }
  .order.compact { display: grid; grid-template-columns: 270px minmax(0, 1fr) 210px; column-gap: 18px; row-gap: 0; align-items: start; }
  .order.compact > .order-colour { grid-column: 1; grid-row: 1; margin: 0 0 3px !important; }
  .order.compact > .order-head { grid-column: 1; grid-row: 2; }
  .order.compact > .order-head .right { display: none; }
  /* item lines: qty | description | (pts & weeks) | printer icon */
  .order.compact .line { display: grid; grid-template-columns: 30px minmax(0, 1fr) 90px 30px; column-gap: 8px; }
  .order.compact .line > .line-print { grid-column: 4; }
  .order.compact > .order-meta { display: flex; grid-column: 2; grid-row: 1 / span 2; justify-self: end; width: 90px; margin-right: 38px;
    flex-direction: column; align-items: flex-end; gap: 2px; z-index: 1; }
  .order.compact > :not(.order-head, .lines, .actions, .order-meta) { grid-column: 1; margin-top: 5px; }
  .order.compact > .lines { grid-column: 2; grid-row: 1 / span 8; }
  .order.compact > .actions { grid-column: 3; grid-row: 1 / span 8; flex-direction: row; gap: 6px; }
  .order.compact > .actions .btn { width: 100%; min-height: 32px; padding: 0 10px; font-size: 13px; }
  .order.compact .order-head .who strong { font-size: 14px; }
  .order.compact .order-head .who > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.order .actions .remove-prep { flex: none; padding: 0 12px; color: var(--muted); }
.order.compact > .actions .remove-prep { width: auto; }
.order.compact > .actions .btn.wide { white-space: nowrap; }

/* ---------- Edit order on a computer (like the Access Sales Order Entry form) ---------- */
.oe { display: flex; flex-direction: column; gap: 12px; }
.oe-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #2B2622; color: #fff; padding: 10px 12px; border-radius: 12px; }
.oe-bar .btn { min-height: 38px; }
.oe-rec { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #CFE8C9; }
.oe-size { margin-left: auto; font-size: 15px; }
.oe-head { display: grid; grid-template-columns: 2.2fr 2fr 1.4fr .8fr 1.4fr 1.4fr .8fr .8fr 1fr; gap: 10px 12px; align-items: end; }
.oe-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
.oe-f input, .oe-f select, .oe-f textarea { font: inherit; font-size: 15px; font-weight: 500; color: var(--ink, #222); padding: 7px 8px;
  border: 1px solid #D9D1C4; border-radius: 8px; background: #fff; width: 100%; min-width: 0; box-sizing: border-box; }
.oe-f input[readonly] { background: #F4F0EA; }
.oe-notes { grid-column: 1 / -1; }
.oe-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.oe-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 6px; border-bottom: 1.5px solid #E8DFD2; white-space: nowrap; }
.oe-table td { padding: 5px 6px; border-bottom: 1px solid #EFEAE2; vertical-align: top; }
.oe-table td.num { text-align: right; white-space: nowrap; padding-top: 11px; }
.oe-table th:nth-last-child(-n+4) { text-align: right; }
.oe-table input, .oe-table textarea { font: inherit; padding: 6px 7px; border: 1px solid #D9D1C4; border-radius: 6px; background: #fff; box-sizing: border-box; }
.oe-table textarea { width: 100%; min-width: 260px; resize: vertical; line-height: 1.3; }
.oe-code { font-weight: 700; white-space: nowrap; padding-top: 11px !important; }
.oe-fin { max-width: 260px; padding-top: 11px !important; }
.oe-x { border: 0; background: none; color: #B4442C; font-size: 16px; cursor: pointer; padding: 6px 4px; }
.oe-new td { background: #FBF8F3; border-bottom: 0; }
.oe-results { margin-top: 10px; }
.oe-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 12px; }
.oe-totals { border-collapse: collapse; min-width: 280px; font-size: 15px; }
.oe-totals th { text-align: left; font-weight: 500; color: var(--muted); padding: 3px 14px 3px 0; }
.oe-totals td { text-align: right; padding: 3px 0; font-variant-numeric: tabular-nums; }
.oe-totals .grand th, .oe-totals .grand td { font-weight: 800; color: var(--ink, #222); border-top: 1.5px solid #E8DFD2; padding-top: 6px; }

/* pickup list / order list PDF screens: 3 columns of POs on a computer */
@media (min-width: 1000px) {
  .pl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .pl-grid > .pickup-row { background: var(--card, #fff); border-radius: 12px; padding: 10px 12px; height: 100%; box-sizing: border-box; }
}

/* home: the prep list and received cards side by side on a computer */
.home-pair { display: contents; }
@media (min-width: 1000px) {
  .home-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
  .home-pair > .card { margin: 0; }
}

.readonly-val { padding: 10px 12px; border-radius: 10px; background: #F4F0EA; font-weight: 600; }
.oe-table td[data-price] { padding-top: 11px; }
.pl-section { grid-column: 1 / -1; margin: 10px 4px 0; padding-bottom: 4px; border-bottom: 1.5px solid #E8DFD2; color: var(--brand); }
.pl-section small { color: var(--muted); font-weight: 600; margin-right: 4px; }
.rule-custs { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rule-custs > span { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--muted); }
.rule-custs .check { min-height: 34px; font-size: 14px; }

/* prep list: what was just moved flashes green, then fades back */
@keyframes landed { 0%, 35% { background-color: #CFEFD2; box-shadow: 0 0 0 2px #5DB36A; } 100% { background-color: transparent; box-shadow: 0 0 0 2px transparent; } }
@keyframes landed-card { 0%, 35% { background-color: #CFEFD2; box-shadow: 0 0 0 2px #5DB36A; } 100% { background-color: var(--card, #fff); } }
.order.landed { animation: landed-card 2.4s ease-out; }
.colour-sub.landed, .stain-head.landed { animation: landed 2.4s ease-out; border-radius: 8px; }

/* prep list: "stain done, next stain" notice */
.notice-overlay { position: fixed; inset: 0; background: rgba(30,27,24,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.notice-box { background: #fff; border-radius: 16px; padding: 22px 22px 18px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.notice-box h2 { margin: 6px 0 10px; font-size: 20px; }
.notice-box p { margin: 6px 0; }
.notice-next { font-size: 22px; font-weight: 800; color: var(--brand); }
.notice-ok { display: inline-flex; width: 48px; height: 48px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-ink); align-items: center; justify-content: center; }
.notice-box .btn { margin-top: 14px; }

/* prep list: colour label printer on stain and colour rows */
.cl-print { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 4px 6px; display: inline-flex; align-items: center; }
.cl-print:hover { background: var(--chip); border-radius: 8px; }
.notice-box .notice-print { margin-top: 14px; }
.notice-box .notice-print + .notice-close { margin-top: 8px; }

/* prep list: while a stain or colour heading is dragged, the orders fold away so all headings fit */
html.prep-folded main .order[data-drag=order], html.prep-colours main .order[data-drag=order] { display: none; }
html.prep-folded main .colour-sub, html.prep-colours main .colour-sub { margin-top: 2px; }
.col-count { display: none; }
html.prep-folded .col-count, html.prep-colours .col-count { display: inline; }
.prep-view { display: inline-flex; align-items: center; }
.prep-today { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border-radius: 10px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); }
.prep-today strong { font-size: 1.35rem; }
.prep-head-left { display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar .prep-view .btn:not(.primary) { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.topbar .prep-view .btn.primary { background: #fff; color: var(--brand); }
.prep-view .btn { display: inline-flex; align-items: center; gap: 6px; }

/* colour headings carry their stain (no separate stain block); a gap where a new stain starts */
.colour-sub .col-name { font-size: 17px; font-weight: 800; color: var(--brand); }
.colour-sub .col-stain { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 10px; white-space: nowrap; }
.colour-sub.stain-first { margin-top: 18px; }
main > .colour-sub.stain-first:first-child, main > .stain-first:first-of-type { margin-top: 4px; }
.colour-sub .add-colour { white-space: nowrap; }
@media (max-width: 699px) {
  .colour-sub .col-stain { display: block; margin-left: 0; font-size: 12px; white-space: normal; }
  .colour-sub > .col-name { min-width: 0; }
  .colour-sub .col-name { font-size: 16px; }
}

/* Shipped, to invoice: all customers */
.inv-cust { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; scroll-margin-top: 80px; }
.inv-cust-head { display: flex; align-items: baseline; gap: 10px; margin: 8px 4px 0; border-bottom: 2px solid var(--brand); padding-bottom: 4px; }
.inv-cust-head h2 { margin: 0; font-size: 19px; color: var(--brand); flex: none; }
.inv-cust-head .btn { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 5px 11px; border-radius: 999px; background: #fff; border: 1px solid #E4DED4; font-size: 13px; font-weight: 600; color: var(--ink, #222); text-decoration: none; }
.inv-head { align-items: flex-start; gap: 14px; }
.inv-head .who { flex: 0 1 auto; }
.inv-head { align-items: center; }
.inv-head .inv-who { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.inv-head .inv-meta { margin: 0 0 0 auto; justify-content: flex-end; }
.inv-head .pill { margin-left: 4px; }
@media (max-width: 699px) { .inv-head { flex-wrap: wrap; } .inv-head .inv-meta { order: 3; flex-basis: 100%; } }
.inv-dialog { text-align: left; }
.inv-dialog h2, .inv-dialog > p { text-align: center; }
.inv-email-opt { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; padding: 10px 12px; background: var(--chip, #F5F2EC); border-radius: 10px; }
.inv-email-opt input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.inv-dialog .btn + .btn { margin-top: 8px; }

/* QuickBooks status */
.qb-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #EFEAE2; color: var(--muted); white-space: nowrap; }
.qb-pill.qb-sent { background: var(--ok-bg); color: var(--ok-ink); }
.qb-pill.qb-error { background: #FBE3DE; color: #2E6B4A; }
.qb-pill.qb-waiting, .qb-pill.qb-sending { background: #FCEFD9; color: #6B4210; }
.qb-state { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 14px; }
.qb-settings { background: var(--chip, #F5F2EC); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.qb-settings p { margin: 0; }

/* PDF lists: click to choose, or drag the PDF and drop it */
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; padding: 20px;
  border: 2px dashed var(--line, #d8cfc4); border-radius: 16px; background: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.drop-zone .btn { pointer-events: none; }
.drop-zone .btn.paste-btn { pointer-events: auto; }
.drop-zone { position: relative; }
.drop-zone.reading > :not(.drop-reading) { visibility: hidden; }
.drop-reading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 10px;
  border-radius: inherit; background: #fbeeee; color: var(--brand); text-align: left; }
.drop-reading .spinner { flex: none; }
.drop-zone.small-zone { min-height: 0; flex-direction: row; padding: 10px; }
.drop-hint { color: var(--muted); font-size: 14px; }
html.file-over .drop-zone { border-color: var(--brand); background: #fbeeee; }
html.file-over .drop-zone .drop-hint { color: var(--brand); font-weight: 700; }
@media (max-width: 700px) { .drop-zone { min-height: 0; } .drop-hint { display: none; } }

/* Flagged orders (Access screenshots) */
.flag-pick select { max-width: 100%; }
.flag-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.flag-row { display: grid; grid-template-columns: 22px minmax(150px, 1.2fr) minmax(150px, 1.4fr) minmax(140px, 1fr) auto; gap: 12px; align-items: center;
  background: #fff; border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.flag-row small { display: block; color: var(--muted); font-size: 12.5px; }
.flag-row .fr-po a { font-weight: 800; color: var(--brand); }
.flag-row .fr-flag { font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.flag-row.has, .flag-row.shipped { opacity: .6; }
.mono { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
@media (max-width: 700px) { .flag-row { grid-template-columns: 22px 1fr; } .flag-row > :nth-child(n+3) { grid-column: 2; } }

/* sign-in with a user name; Users & computers */
.pw-signin { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; margin-top: 18px; }
.pw-signin input { padding: 12px; border: 1px solid var(--line, #d8cfc4); border-radius: 10px; font: inherit; }
.comp-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #eee); }
.comp-row > span:first-child { flex: 1; }
.comp-row small { display: block; color: var(--muted); }
.user-card .check { align-self: end; padding-bottom: 10px; }

/* Darker background (per person, Users & computers): for bright or washed-out shop screens */
html.darker { --ground: #DDD5C8; --chip: #E8E1D6; --line: #BFB4A4; --muted: #4F4842; }
html.darker .card, html.darker .tile, html.darker .list-item, html.darker .menu-grid a, html.darker .table-wrap,
html.darker .order, html.darker .flag-row, html.darker .colour-head { border: 1px solid #C9BEAE; }

.paste-zone { cursor: default; text-align: center; }
.paste-zone .btn { pointer-events: auto; }
.linkish { color: var(--brand); text-decoration: underline; cursor: pointer; }

/* Newton / Powell partner order (PF / NF lines) */
.order-flag.partner-here { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.order-flag.partner-shipped { background: var(--chip); color: var(--ink-2); border-color: var(--line); }
.order-flag a { color: inherit; font-weight: 700; }
.oe-notes .clear-notes { margin-left: 10px; padding: 2px 10px; min-height: 0; font-size: 12.5px; }
/* Shipment just shipped: clear "it's done" message */
.ship-done { background: var(--ok-bg); border: 1px solid var(--ok-line); }
.ship-done-row { display: flex; gap: 14px; align-items: flex-start; color: var(--ok-ink); }
.ship-done h2 { margin: 0 0 4px; color: var(--ok-ink); }
.tick-row .ship-pill { white-space: nowrap; align-self: center; height: auto; flex: none; }
.tick-row .undo-ship { align-self: center; flex: none; }
.undo-ship { background: none; border: 0; padding: 4px 8px; }

/* Prep list and Orders Rec'd: the colour heading floats at the top while scrolling through its orders */
main.sticky-colours > .colour-sub { position: sticky; top: var(--colour-sticky-top, 70px); z-index: 3; background: var(--ground);
  box-shadow: 0 -10px 0 var(--ground), 0 6px 6px -6px rgba(0,0,0,.18); padding-top: 6px; padding-bottom: 6px; }

/* Order supplies (test) */
.sup-line, .sup-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sup-items { background: var(--surface); border-radius: 14px; padding: 0 14px; }
.sup-items .sup-item:first-child { border-top: 0; }
.sup-name { flex: 1; min-width: 0; }
.sup-name small { display: block; color: var(--muted); font-size: 12.5px; }
.sup-step { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.sup-step strong { min-width: 2ch; text-align: center; font-size: 17px; }
.sup-step .btn { min-width: 44px; justify-content: center; }
.sup-free { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sup-free input[name=qty] { width: 70px; }
.sup-free input[name=text] { flex: 1; min-width: 200px; }
.sup-free input { padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.sup-search { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; margin: 4px 0 10px; }
.sup-past p { margin: 6px 0 0; }

.sup-edit { color: inherit; text-decoration: none; }
.sup-edit:hover strong { text-decoration: underline; color: var(--brand); }

/* Back: a real button with a word, easy to hit */
.back-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 96px; height: 42px; padding: 0 14px 0 8px;
  border-radius: 12px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45); color: #fff; font-weight: 700; font-size: 16px;
  text-decoration: none; white-space: nowrap; }
.back-btn:hover { background: rgba(255,255,255,.26); }
.back-btn:active { background: rgba(255,255,255,.34); }
@media (max-width: 420px) { .back-btn { min-width: 80px; padding: 0 10px 0 6px; font-size: 15px; } }

.sub-label { margin: 14px 4px 6px; font-size: 15px; font-weight: 800; color: var(--brand); }

/* ================================================================ upholstery additions */
.shop-name { font-size: 13px; opacity: .9; }
.stage-row { display: flex; flex-wrap: wrap; gap: 4px; }
.stage { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 7px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.stage.on { background: var(--ok-bg); color: var(--ok-ink); }
.stage.wait { background: #E1ECF1; color: var(--brand-dark); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: 0 1px 2px rgba(30,27,24,.06); }
.tabs a[aria-current="page"] { background: var(--brand); color: #fff; }
.tabs a .count { margin-left: 6px; font-size: 12px; opacity: .85; }
.sel-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sel-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px; border-bottom: 1.5px solid #E8DFD2; white-space: nowrap; }
.sel-table td { padding: 7px 6px; border-bottom: 1px solid #EFEAE2; vertical-align: top; }
.sel-table td.num, .sel-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sel-table tr.group td { background: var(--chip); font-weight: 700; }
.sel-table a { color: var(--ink); }
.sel-table .muted { color: var(--muted); font-size: 13px; }
.lines-edit { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines-edit th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 4px; border-bottom: 1.5px solid #E8DFD2; white-space: nowrap; }
.lines-edit td { padding: 6px 4px; border-bottom: 1px solid #EFEAE2; vertical-align: top; }
.lines-edit input, .lines-edit select, .lines-edit textarea { font: inherit; padding: 6px 7px; border: 1px solid #D9D1C4; border-radius: 6px; background: #fff; width: 100%; box-sizing: border-box; }
.lines-edit input[type=number] { max-width: 90px; }
.lines-edit textarea { min-width: 200px; resize: vertical; }
.lines-edit .checks { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.lines-edit .checks label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.totals { display: grid; grid-template-columns: auto auto; gap: 2px 18px; justify-content: end; font-size: 15px; }
.totals .num { text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 800; border-top: 1.5px solid var(--line); padding-top: 4px; }
.order-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 1000px) {
  .order-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; }
  .order-grid .span2 { grid-column: span 2; }
  .order-grid .full { grid-column: 1 / -1; }
}
.mobile-only { display: none; }
@media (max-width: 999px) {
  .lines-edit thead { display: none; }
  .lines-edit, .lines-edit tbody, .lines-edit tr, .lines-edit td { display: block; width: 100%; }
  .lines-edit tr { border-bottom: 2px solid var(--line); padding: 8px 0; }
  .lines-edit td { border: 0; padding: 3px 0; }
  .lines-edit td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
}

/* ---------- printable documents (work order, POs, shipping slip, invoice) ---------- */
.doc { background: #fff; color: #000; padding: 28px; border-radius: var(--radius); font-size: 13px; }
.doc h2 { margin: 0; font-size: 22px; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 12px; }
.doc .doc-head .co { font-size: 13px; line-height: 1.4; }
.doc .doc-head .title { text-align: right; }
.doc .doc-head .title .big { font-size: 22px; font-weight: 800; }
.doc .parties { display: flex; gap: 30px; margin-bottom: 12px; }
.doc .parties div { flex: 1; line-height: 1.4; }
.doc .parties b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.doc th { text-align: left; font-size: 11px; text-transform: uppercase; border-bottom: 1.5px solid #000; padding: 4px; }
.doc td { padding: 5px 4px; border-bottom: 1px solid #ccc; vertical-align: top; }
.doc td.num, .doc th.num { text-align: right; white-space: nowrap; }
.doc .sec { margin-top: 18px; }
.doc .sign { margin-top: 30px; display: flex; gap: 40px; }
.doc .sign div { flex: 1; border-top: 1px solid #000; padding-top: 4px; font-size: 11px; }
.doc .page-break { break-after: page; }
@media print {
  .topbar, .nav, .no-print, #toast { display: none !important; }
  .screen { padding: 0 !important; }
  main.content { padding: 0 !important; }
  body, :root { background: #fff !important; }
  .doc { box-shadow: none; border-radius: 0; padding: 0; }
}
@media (min-width: 1000px) { main.content > form.order-form { max-width: none; } }

/* ---------- import screen ---------- */
.import-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.import-table th, .import-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.import-table td.num, .import-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.import-table tr.bad td { background: var(--warn-bg); color: var(--warn-ink); }
.progress { height: 10px; border-radius: 6px; background: var(--chip); overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.drop-zone { display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; background: var(--surface); cursor: pointer; }
.drop-zone.over { border-color: var(--brand); background: var(--ok-bg); }
.drop-zone input { display: block; margin: 10px auto 0; }

/* ---------- order / quote form ---------- */
.oq-in { min-height: 38px; border: 1px solid #D9D1C4; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 15px; background: #fff; max-width: 100%; }
.oq-in.n { width: 86px; text-align: right; }
.oq-in.wide { width: 100%; min-width: 220px; }
.oq-in:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
/* hours and finish code don't need to stand out: no box until you click in them */
.oq-in.quiet { border-color: transparent; background: transparent; color: var(--muted); width: 64px; }
.oq-in.quiet:hover { border-color: #E6DFD3; }
table.oq-lines th.oq-desc, table.oq-lines td.oq-desc { width: auto; }
table.oq-lines td.oq-desc .oq-in { min-width: 300px; width: 100%; }
table.oq-lines th.oq-code, table.data.oq-lines td.code-cell.oq-code { width: 1%; min-width: 0; padding-right: 16px; white-space: nowrap; }
section.card.oq-items { padding-top: 6px; padding-bottom: 10px; }
section.card.oq-items table.oq-lines td { padding-top: 4px; padding-bottom: 4px; }
table.oq-lines th.num:not(.oq-qty):not(.oq-small), table.oq-lines td.num:not(.oq-qty):not(.oq-small), table.oq-lines .oq-gap { width: 1%; white-space: nowrap; }
table.oq-lines th.oq-qty, table.oq-lines td.oq-qty { text-align: center; }
table.oq-lines .oq-in.n.q { text-align: center; }
[data-results] ~ * .kb-on, .kb-on { background: #E4EFE8 !important; outline: 2px solid var(--brand); outline-offset: -2px; }
table.oq-lines th.oq-gap, table.oq-lines td.oq-gap { padding-left: 16px; }
/* Qty small and to the left, item code on one line, hours / finish code small at the right (owner, Nov 2026) */
table.oq-lines th.oq-qty, table.oq-lines td.oq-qty { padding-left: 4px; padding-right: 4px; width: 1%; }
table.oq-lines .oq-in.n.q { width: 48px; }
table.oq-lines .oq-code { white-space: nowrap; }
table.oq-lines .oq-code .ic, table.oq-lines .oq-code span { white-space: nowrap; }
table.oq-lines td .oq-in.n { width: 76px; }
table.oq-lines th.oq-small, table.oq-lines td.oq-small { width: 1%; font-size: 12px; padding-left: 2px; padding-right: 2px; }
table.oq-lines td.oq-small .oq-in.quiet { width: 44px; font-size: 13px; padding: 2px 4px; min-height: 30px; }
table.oq-lines td.oq-gap select.oq-in { font-size: 14px; max-width: 130px; }
.oq-freight-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.oq-freight-row label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.oq-freight-row select.oq-in { font-size: 14px; min-height: 34px; max-width: 220px; }
.oq-freight-row .oq-in.n { min-height: 34px; width: 90px; }
table.oq-lines td { padding: 5px 6px; vertical-align: middle; }
.oq-bottom { display: grid; gap: 16px; }
.oq-amt { font-variant-numeric: tabular-nums; margin-left: 8px; }
.oq-ticks { align-items: center; }
@media (min-width: 1000px) {
  .oq-bottom { grid-template-columns: 1fr auto; grid-template-areas: "f t" "a t"; align-items: start; }
  .oq-bottom > .oq-freight-row { grid-area: f; }
  .oq-bottom > .totals { grid-area: t; }
  .oq-bottom > .oq-actions { grid-area: a; align-self: end; }
  .oq-head textarea { min-height: 0; }
}
section.oq-head { align-self: stretch; max-width: none; width: 100%; }
/* like the Access Sales Order Entry form: the boxes in pairs (Customer | PO, Finish | Metal, Drawer | Door, Fabric A | B), notes under
   them about 3 lines high; on the right, smaller, what rarely changes: Sales rep, Discount, Commission, Finisher, Ship to, the ticks (owner, Nov 2026) */
.oq-pairs { display: grid; gap: 8px 16px; align-items: end; }
.oq-side { display: flex; flex-direction: column; gap: 8px; }
.oq-notes textarea { min-height: 0; resize: vertical; }
@media (min-width: 700px) {
  .oq-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oq-pairs .oq-notes { grid-column: 1 / -1; }
}
@media (min-width: 1000px) {
  section.oq-head { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); gap: 8px 28px; align-items: start; }
  .oq-side { font-size: 13px; padding-left: 20px; border-left: 1px solid #EFEAE2; }
  .oq-side .field > span { font-size: 12px; }
  .oq-side input:not([type=checkbox]), .oq-side select { font-size: 13px; }
  section.oq-head .oq-side input:not([type=checkbox]), section.oq-head .oq-side select { height: 32px; padding-top: 3px; padding-bottom: 3px; }
  .oq-side .oq-ticks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin-top: 4px; }
  .oq-side .oq-ticks label { font-size: 13px; min-height: 34px; padding: 0; }
  section.oq-head input:not([type=checkbox]), section.oq-head select { min-height: 0; height: 40px; padding-top: 6px; padding-bottom: 6px; }
  /* labels in a shaded green box straight left of each box, one slim row per pair (owner, Nov 2026) */
  section.oq-head { padding-top: 14px; padding-bottom: 14px; }
  section.oq-head .oq-pairs { gap: 6px 14px; }
  section.oq-head .oq-side { gap: 5px; }
  section.oq-head .field { flex-direction: row; align-items: stretch; gap: 0; }
  section.oq-head .field > span { flex: 0 0 142px; white-space: nowrap; display: flex; align-items: center; padding: 0 10px; background: #E4EFE8; color: var(--brand-dark);
    font-size: 12.5px; font-weight: 600; line-height: 1.15; border: 1px solid #C7DDCF; border-right: 0; border-radius: 8px 0 0 8px; }
  section.oq-head .oq-side .field > span { flex-basis: 108px; font-size: 12px; padding: 0 8px; }
  section.oq-head .oq-side .field > span small { display: none; }
  section.oq-head .field > input, section.oq-head .field > select, section.oq-head .field > textarea { flex: 1 1 auto; min-width: 0; border-radius: 0 8px 8px 0; }
  section.oq-head .oq-pairs input:not([type=checkbox]), section.oq-head .oq-pairs select { height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: 15px; }
  section.oq-head .oq-side input:not([type=checkbox]), section.oq-head .oq-side select { height: 30px; }
  section.oq-head .oq-notes > span { align-items: flex-start; padding-top: 8px; }
  section.oq-head .oq-notes textarea { height: 64px; padding-top: 6px; }
  section.oq-head .oq-side .oq-ticks label { min-height: 28px; }
}

/* ---------- builders ---------- */
.pill.brand { background: #DCEBE2; color: var(--brand-dark); }
table.bl-table td { white-space: normal; vertical-align: top; }
table.bl-table td.bl-desc { min-width: 220px; }
table.bl-table td.num, table.bl-table td:first-child { white-space: nowrap; }
.list-item .right.btn-row { flex-wrap: wrap; justify-content: flex-end; }
table.bl-table td .btn, table.bl-table td:nth-last-child(2) { white-space: nowrap; }

/* ---------- finishers ---------- */
table.bl-table tr.fin-order td { background: #F1F5F2; border-top: 2px solid var(--line); padding: 7px 10px; }
.fin-head { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.fin-head .btn-row { flex: none; }

/* ---------- shipping ---------- */
.ship-group { gap: 4px; }
.ship-order { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 7px 2px; border-top: 1px solid #EFEAE2; font-size: 15px; }
.ship-order .btn-row { flex: none; align-items: center; }

/* ---------- wide screens and item codes ---------- */
.code-model, .code-wood { white-space: nowrap; }            /* an item code breaks only between the model and the wood */
table.data td.code-cell, table.bl-table td.code-cell { white-space: normal; min-width: 0; }
.list-item .who > span:first-child .code-model, .list-item .who > span:first-child .code-wood { font-size: 16px; color: var(--ink); }
@media (min-width: 1000px) {
  .wrap { max-width: 1840px; }                               /* big monitors: use the room, the tables need it */
  .nav .wrap { max-width: 760px; }
}

/* Builders list: one line per builder, the three counts in their own columns beside the name */
.b-table { padding: 4px 14px; }
.b-row { display: grid; grid-template-columns: minmax(110px, 200px) 84px 84px 84px 70px minmax(0, 1fr); gap: 4px 10px; align-items: center; padding: 4px 0; border-top: 1px solid #EFEAE2; }
.b-row:first-child { border-top: 0; }
.b-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.b-head span:nth-child(n+2):nth-child(-n+5), .b-hours { text-align: center; }
.b-name { color: var(--ink); text-decoration: none; font-size: 15px; overflow-wrap: anywhere; }
.b-num { text-align: center; font-weight: 700; font-size: 14px; border-radius: 999px; padding: 4px 0; text-decoration: none; background: var(--chip); color: var(--ink); }
.b-num.brand { background: #DCEBE2; color: var(--brand-dark); } .b-num.warn { background: #FBEBD0; color: #7A4A00; } .b-num.zero { background: none; color: #B5ADA2; font-weight: 400; }
.b-co { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .b-row { grid-template-columns: minmax(80px, 1fr) 56px 56px 56px 50px; } .b-co, .b-head span:last-child { display: none; } }
/* Order lists: by customer, one card per order (like the finishing app's prep list): colour + PO on the left, the item lines
   in the middle with where each stands, order status and amount on the right */
.all-group { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.all-cust { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 6px 2px; border-bottom: 2px solid #E4DED4; }
/* the customer (dealer) name stays at the top while its orders scroll under it */
.all-group > .all-cust { position: sticky; top: var(--topbar-h, 70px); z-index: 3; background: var(--ground); padding-top: 8px; }
.all-cust strong { font-size: 18px; color: var(--brand-dark); }
.o-card { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) auto; gap: 6px 18px; align-items: start; padding: 9px 14px; background: var(--surface); border-radius: 12px; box-shadow: 0 1px 2px rgba(30,27,24,.06); color: var(--ink); text-decoration: none; }
.o-card:hover { box-shadow: 0 1px 2px rgba(30,27,24,.06), 0 0 0 2px #DCEBE2; }
.o-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.o-po { color: var(--brand); font-weight: 700; font-size: 13px; }
.o-lines { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.o-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 14px; }
.o-right .pill { font-size: 11px; padding: 2px 8px; }
.all-line { display: grid; grid-template-columns: 34px minmax(110px, 220px) minmax(0, 1fr) 84px 170px; gap: 8px; align-items: center; font-size: 13.5px; }
.all-line .q { text-align: center; font-weight: 700; background: var(--chip); border-radius: 6px; padding: 1px 0; }
.all-line .code strong { color: var(--brand); }
.all-line .desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-line .bld { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-line .pill { font-size: 11px; padding: 2px 8px; text-align: center; white-space: normal; line-height: 1.25; }   /* long ones ("waiting for pickup – Tri-Coat") wrap inside the column */
@media (max-width: 760px) { .o-card { grid-template-columns: minmax(0, 1fr) auto; } .o-lines { grid-column: 1 / -1; grid-row: 2; } .all-line { grid-template-columns: 30px minmax(0, 1fr) auto; } .all-line .desc, .all-line .bld { display: none; } }

/* Receiving from a shipping slip PDF: the drop zone (one line) and the list of what was read */
.drop-zone.pdf-zone { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; min-height: 0; padding: 12px 14px; position: relative; font-size: 14px; }
.pdf-zone input[type=file] { display: none; }
.pdf-zone .btn { pointer-events: none; } .pdf-zone .btn.paste-btn { pointer-events: auto; }
.pdf-zone.reading > :not(.drop-reading) { visibility: hidden; }
.pdf-zone .drop-reading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; }
html.file-over .drop-zone.pdf-zone { border-color: var(--brand); background: var(--ok-bg); }
.slip-review { padding: 10px 14px; border: 2px solid #DCEBE2; }
.slip-row { display: grid; grid-template-columns: 22px 40px minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 3px 0; border-top: 1px solid #EFEAE2; font-size: 13.5px; cursor: pointer; }
.slip-row .q { font-weight: 700; text-align: center; background: var(--chip); border-radius: 6px; }
.slip-row .t, .slip-row .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip-row.none { color: var(--muted); cursor: default; }
.slip-row .pill { font-size: 11px; padding: 2px 8px; }
@media (max-width: 700px) { .slip-row { grid-template-columns: 22px 36px minmax(0, 1fr) auto; } .slip-row .small { display: none; } }

/* Order cards on the builder, finishing, shipping and delivery screens (same card as the order lists) */
.c-line { grid-template-columns: 34px minmax(110px, 220px) minmax(0, 1fr) auto; }
.c-end { display: flex; gap: 8px; align-items: center; justify-content: flex-end; white-space: nowrap; }
.c-end:empty { display: none; }
.c-end .btn.small, .o-right .btn.small { padding: 3px 10px; min-height: 0; font-size: 12.5px; }
.o-card.ship-order, .o-card.fin-card, .o-card.bl-card { border-top: 0; font-size: 14px; }
.o-card.bl-card { grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); }
.o-right.btn-row { flex-direction: column; align-items: flex-end; gap: 4px; }
.o-who a { color: inherit; font-weight: 700; }
#fin-rows, #bl-rows, #ship-rows { display: flex; flex-direction: column; gap: 6px; }
.fin-head.all-cust { align-items: center; }
@media (max-width: 760px) { .c-line { grid-template-columns: 30px minmax(0, 1fr) auto; } .o-right.btn-row { flex-direction: row; flex-wrap: wrap; } }

/* Order cards on phones: customer / PO / colour across the top, then the order's buttons, then one line per item
   (quantity, item code, and the line's button; its details sit small above the button). */
@media (max-width: 760px) {
  .o-card, .o-card.bl-card { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 12px; }
  .o-who { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; }
  .o-who > strong:first-child { flex-basis: 100%; font-size: 15px; }
  .o-lines { grid-column: auto; grid-row: auto; gap: 6px; }
  .o-right, .o-right.btn-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px; }
  .o-right:empty { display: none; }
  .all-line, .c-line { grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; }
  .all-line .desc, .all-line .bld { display: none; }
  .all-line .code { min-width: 0; overflow-wrap: anywhere; }
  .all-line .code .code-model, .all-line .code .code-wood { white-space: normal; }
  .c-end { flex-direction: column; align-items: flex-end; gap: 2px; }
  .c-end .small { font-size: 11px; }
  .all-cust { flex-wrap: wrap; }
}

/* Phones: the item description goes under the item code, small, on its own row */
@media (max-width: 760px) {
  .all-line { row-gap: 0; }
  .all-line > .q { grid-area: 1 / 1; } .all-line > .code { grid-area: 1 / 2; } .all-line > :last-child { grid-area: 1 / 3; }
  .all-line .desc { display: block; grid-area: 2 / 2 / 3 / 4; white-space: normal; overflow: visible; font-size: 12.5px; color: var(--muted); line-height: 1.25; }
}

/* The builder of an item on the finishing screens (where the finisher picks it up) */
.c-bld { font-size: 12px; font-weight: 700; color: var(--ink); background: var(--chip); border-radius: 6px; padding: 1px 7px; }
@media (max-width: 760px) { .c-bld { font-size: 11px; } }

/* The PO on an order card opens the order */
a.o-po { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a.o-po:hover { color: var(--brand-dark); }
.o-who a.o-po { color: var(--brand); font-weight: 700; }

/* Labels: printer buttons beside items, the print-on-receive tick, and the print window (one label picture per page) */
.lbl-btn { width: 30px; height: 30px; min-height: 0; padding: 0; }
.nowrap { white-space: nowrap; }
.print-tick { display: inline-flex; gap: 8px; align-items: center; margin: 0 4px; font-size: 13.5px; color: var(--muted); }
@media print {
  html.printing-labels .limg { page-break-after: always; break-after: page; overflow: hidden; }
  html.printing-labels .limg:last-child { page-break-after: auto; break-after: auto; }
  html.printing-labels .limg.big { width: 4in; height: 4in; }
  html.printing-labels .limg.big img { width: 4in; height: 4in; display: block; }
  html.printing-labels .limg.small { width: 89mm; height: 28mm; box-sizing: border-box; padding: 0.4mm 0 0 5.6mm; }
  html.printing-labels .limg.small img { width: 78mm; height: 23mm; display: block; }
}

/* "Mark received" buttons: an action, not a status – white with a green outline and a tick, so they never look like the
   soft green status pills ("in", "fully received") */
.btn.mark { background: #fff; border: 1.5px solid var(--brand); color: var(--brand-dark); }
.btn.mark:hover { background: var(--brand); color: #fff; }
.btn.mark svg { flex: none; }

.o-card.bl-card.with-right { grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) auto; }
@media (max-width: 760px) { .o-card.bl-card.with-right { grid-template-columns: minmax(0, 1fr); } }

/* The magnifying glass beside the screen's own buttons */
.topbar .tb-side.right { gap: 4px; display: flex; align-items: center; }

/* Reports */
.rp-seg { flex-wrap: wrap; }
.rp-form { padding: 12px 14px; }
.rp-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.rp-controls .field { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: 13px; }
.rp-controls .field > span { font-weight: 600; color: var(--muted); font-size: 12px; }
.rp-controls .rp-wide { flex-basis: 100%; }
.rp-controls .rp-wide input { max-width: 520px; }
.rp-reps { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.rp-docs { margin: 8px 4px; }
.rp-note { margin: 4px 4px 8px; }
.rp-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.rp-tile { background: var(--surface); border-radius: 12px; padding: 10px 16px; min-width: 150px; box-shadow: 0 1px 2px rgba(30,27,24,.06); display: flex; flex-direction: column; }
.rp-tile span { font-size: 12px; color: var(--muted); font-weight: 600; } .rp-tile strong { font-size: 22px; color: var(--brand-dark); }
.rp-h { margin: 14px 4px 4px; font-size: 15px; }
.rp-table td.num, .rp-table th.num { text-align: right; white-space: nowrap; }
.rp-table td:has(> .rp-bar), .rp-table td:has(> .rp-bars) { width: 22%; min-width: 80px; }
.rp-bar { display: block; height: 10px; border-radius: 5px; background: var(--brand); }
.rp-bars { display: flex; flex-direction: column; gap: 2px; } .rp-bar.new { background: #9CC5AE; }
.rp-key { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--brand); vertical-align: middle; margin-left: 10px; } .rp-key.new { background: #9CC5AE; }
.rp-desc { display: inline-block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.rp-item { display: inline-flex; gap: 6px; align-items: center; margin: 1px 10px 1px 0; white-space: nowrap; font-size: 13px; }
.rp-item .pill { font-size: 11px; padding: 1px 7px; }

/* QuickBooks screen */
.qb-card h2 { margin: 0 0 6px; font-size: 17px; }
.qb-state.on strong { color: var(--brand-dark); } .qb-state.off strong { color: #8a5a00; }
.qb-counts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 14px; }
.qb-steps { margin: 4px 0 8px 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qb-pw { font-size: 15px; padding: 2px 6px; background: var(--chip); border-radius: 6px; user-select: all; }
.qb-seen { background: #FBEBD0; padding: 8px 10px; border-radius: 8px; }
.qb-problem { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid #EFEAE2; }
.pill.bad { background: #F7DADA; color: #8a1f1f; }

/* Open orders by rep: one line per rep */
.rp-replist { padding: 4px 14px; }
.rp-reprow { display: grid; grid-template-columns: minmax(180px, 1fr) 90px 110px auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid #EFEAE2; }
.rp-reprow:first-child { border-top: 0; }
.rp-repnum { text-align: right; font-variant-numeric: tabular-nums; }
.rp-repbtns { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
@media (max-width: 640px) { .rp-reprow { grid-template-columns: 1fr auto; } .rp-repbtns { grid-column: 1 / -1; justify-content: flex-start; } }

/* a list row with buttons beside it (Customers: Open orders / Order history) */
.list-row { display: flex; align-items: stretch; gap: 8px; }
.list-row > .list-item { flex: 1; min-width: 0; }
.row-links { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
@media (max-width: 640px) { .list-row { flex-direction: column; gap: 4px; } .row-links { padding: 0 4px 6px; } }
.cust-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 4px 8px; }

/* part lines (Parts list) under their main item */
.oq-lines tr.oq-part td { background: #FAF8F3; }
.oq-lines tr.oq-part .code-cell { padding-left: 18px; }
.oq-part-mark { color: var(--muted, #888); margin-right: 4px; }

/* Parts list */
.pt-card { padding: 8px 14px; margin: 8px 0; }
.pt-model { margin: 2px 0 4px; font-size: 16px; }
.pt-row { display: grid; grid-template-columns: minmax(220px, 1fr) 90px 200px auto 40px; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid #EFEAE2; }
.pt-part { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pt-f { display: flex; flex-direction: column; font-size: 12px; color: var(--muted, #777); }
.pt-f input { font-size: 14px; padding: 4px 6px; }
.pt-addrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.pt-addrow .field { flex: 1; min-width: 140px; }
@media (max-width: 760px) { .pt-row { grid-template-columns: 1fr 80px 40px; } .pt-skip, .pt-metal { grid-column: 1 / -1; } }

/* New order from a purchase order: compact, laid out like the order form */
.po-zone { display: flex; gap: 12px; align-items: center; padding: 16px; }
.po-head { padding: 12px 14px; max-width: none; }
.po-from { margin: 0 0 6px; font-size: 14px; }
.po-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px 18px; align-items: start; margin-bottom: 10px; }
.po-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.po-f { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.po-f select, .po-f input, .po-f textarea { font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); background: var(--surface, #fff);
  border: 1px solid #D9D1C4; border-radius: 10px; padding: 7px 10px; min-height: 40px; }
.po-f select:focus, .po-f input:focus, .po-f textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.po-notes textarea { height: 100%; min-height: 150px; resize: vertical; line-height: 1.4; font-family: inherit; }
.po-miss select, .po-miss input { outline: 2px solid #E8B44A; background: #FFF8E6; }
.po-warn { background: #FBEBD0; margin: 4px 0 8px; }
.po-lines td { padding: 6px 8px; vertical-align: middle; font-size: 14px; }
.po-lines tr.po-off td { opacity: .45; }
.po-lines tr.po-part td { background: #FAF8F3; font-size: 12.5px; }
.po-item { width: 230px; min-height: 38px; border: 1px solid #D9D1C4; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 14.5px; background: #fff; }
.po-qty, .po-price { min-height: 38px; border: 1px solid #D9D1C4; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 14.5px; background: #fff; text-align: right; }
.po-qty { width: 64px; }
.po-price { width: 90px; }
.po-item:focus, .po-qty:focus, .po-price:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.po-desc { min-width: 260px; }
@media (max-width: 900px) { .po-form { grid-template-columns: 1fr; } }

.po-custom { margin-top: 4px; font-size: 13px; color: #7a4a00; }
.po-price { width: 90px; }
.po-manual { color: #8a5a00; }

/* order made from a PO, not checked yet */
.po-check { border: 2px solid #E8B44A; background: #FFF8E6; padding: 10px 14px; }
.po-check-head { display: flex; gap: 8px; align-items: center; }
.po-check ul { margin: 6px 0 10px 20px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.field.po-miss select, .field.po-miss input { outline: 2px solid #E8B44A; background: #FFF8E6; }

/* ---------- POs: several at once, the shared folder ---------- */
.po-batch { padding: 12px 14px; max-width: none; margin-bottom: 10px; }
.po-batch-list { margin: 8px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.po-folder { display: flex; gap: 8px; align-items: flex-start; margin: 2px 4px 10px; }
.po-sub { font-size: 16px; margin: 14px 4px 6px; }
.po-left { align-items: center; gap: 12px; }
.po-left-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.po-left-cust { max-width: 240px; min-height: 34px; border: 1px solid #D9D1C4; border-radius: 8px; padding: 2px 6px; font: inherit; font-size: 14px; }

/* Wood parts (#/wood-parts, #/wood-batch/ID) */
.wp-tick { font-size: 12.5px; gap: 4px; }
.wp-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.wp-cut, .wp-edit, .wp-model { padding: 10px 14px; margin: 10px 0; }
.wp-cut-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wp-cut-head h2, .wp-edit h3, .wp-model h3 { margin: 0 0 6px; font-size: 16px; }
.wp-scroll { overflow-x: auto; }
.wp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.wp-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.wp-table td { padding: 4px 6px; border-bottom: 1px solid #EFEAE2; vertical-align: top; }
.wp-table .num { text-align: right; white-space: nowrap; }
.wp-table .wp-size { white-space: nowrap; font-weight: 600; }
.wp-table tr.wp-grp td { background: var(--chip); font-weight: 700; font-size: 12.5px; padding-top: 6px; }
.wp-table tr.wp-custom td { background: var(--warn-bg); }
.wp-table tr.wp-removed td { color: var(--muted); text-decoration: line-through; }
.wp-in { width: 82px; padding: 4px 6px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
.wp-in.wide { width: 170px; }
.wp-edit-table td { vertical-align: middle; }
.wp-rule { display: grid; grid-template-columns: minmax(220px, 1fr) 90px minmax(150px, 240px) minmax(150px, 220px) 40px; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid #EFEAE2; }
.wp-addrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 8px; border-top: 1px solid #EFEAE2; }
.wp-addrow .wp-in { width: 190px; }
.wp-part { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 8px 0; border-top: 1px solid #EFEAE2; }
.wp-part:first-child { border-top: 0; }
.wp-newpart { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.wp-newpart .field { max-width: 170px; margin: 0; }
@media (max-width: 760px) { .wp-rule { grid-template-columns: minmax(0, 1fr) 80px; } .wp-rule .pt-f:nth-of-type(2), .wp-rule .pt-f:nth-of-type(3) { grid-column: 1 / -1; } }

.wp-in.wp-grp-sel { width: auto; min-width: 150px; }
.wp-sub { margin: 10px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.wp-add { margin-top: 8px; }
.wp-add > summary { list-style: none; display: inline-flex; cursor: pointer; }
.wp-add > summary::-webkit-details-marker { display: none; }
.wp-add[open] > summary { margin-bottom: 6px; }
.wp-newpart .field.wp-pick { max-width: 300px; min-width: 240px; }
.check.wp-le-check { gap: 6px; min-height: 0; font-size: 13px; font-weight: 500; white-space: nowrap; }
.check.wp-le-check input { width: 15px; height: 15px; }

/* ---------- slips received from in the last week (under the slip drop zone) ---------- */
.slip-history { padding: 8px 14px; margin: 0 0 10px; max-width: none; }
.slip-history > summary { cursor: pointer; }
.slip-hist-none { margin: -4px 6px 8px; }
.pl-hist { border-top: 1px solid #EEE7DC; padding: 6px 0; }
.pl-hist summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 14px; }
.pl-hist-when { font-weight: 600; min-width: 140px; }
.pl-hist-what { flex: 1; min-width: 200px; }
.pl-hist-orders { margin: 4px 0 2px 18px; padding: 0; columns: 2 260px; font-size: 13.5px; }
.pl-hist-who { font-size: 13.5px; white-space: nowrap; }

/* ---------- order cards: one grey line for the parts, italic notes ---------- */
.all-line.parts-line { grid-template-columns: 34px minmax(0, 1fr) 170px; color: var(--muted); font-size: 12.5px; }
.all-line.parts-line .q { background: none; display: flex; justify-content: center; color: var(--muted); }
.all-line.parts-line .parts-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.all-line.parts-line.missing .parts-text { color: #8A5A00; }
.pill.parts-in { background: #EFECE6; color: #6B665C; }
.all-line.note-line { display: block; font-style: italic; color: var(--muted); font-size: 12.5px; padding-left: 42px; }
@media (max-width: 760px) { .all-line.parts-line { grid-template-columns: 30px minmax(0, 1fr) auto; } .all-line.parts-line .parts-text { white-space: normal; } .all-line.note-line { padding-left: 38px; } }

/* ---------- orders on hold ---------- */
.pill.hold { background: #EFECE6; color: #6B665C; }
.hold-strip { display: flex; gap: 6px; align-items: flex-start; background: #FAEEDA; color: #633806; border-radius: 8px; padding: 5px 9px; font-size: 12.5px; margin-bottom: 2px; }
.hold-strip svg { flex: none; margin-top: 2px; }

/* order age in weeks on the order cards, like the finishing app */
.o-right .age { font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
/* phones: the weeks sit top right, above the first item's status pill */
@media (max-width: 760px) {
  .o-card { position: relative; }
  .o-right .age { position: absolute; top: 12px; right: 12px; }
  .o-card .o-who > strong:first-child { padding-right: 76px; }
}
/* Home: monthly reports still to email (from the 10th) */
.due-reminder { display: flex; gap: 10px; align-items: center; background: #FFF4DC; border: 1px solid #F0C870; color: inherit; text-decoration: none; }
.rp-monthly .rp-saved small { line-height: 1.5; }
/* No up/down arrows on number boxes: amounts are typed in (owner, Nov 2026) */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- icon bar along the top (computers, 1000px+; owner, Nov 2026) ---------- */
.top-stack { position: sticky; top: 0; z-index: 6; }
.top-stack .topbar { position: static; }
.iconbar-wrap { display: none; }
@media (min-width: 1000px) {
  .nav { display: none; }
  .screen { padding-bottom: 24px; }
  .iconbar-wrap { display: block; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
  .iconbar { display: flex; align-items: center; gap: 2px; padding: 5px 12px; }
  .iconbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 70px; padding-left: 6px; padding-right: 6px; box-sizing: border-box; height: 56px;
    border-radius: 10px; border: 1px solid transparent; color: var(--brand-dark); text-decoration: none; flex: none; }
  .iconbar a:hover { background: var(--chip); }
  .iconbar a[aria-current="page"] { background: var(--ok-bg); border-color: var(--ok-line); }
  .iconbar a[aria-current="page"] .ib-label { font-weight: 700; }
  .ib-label { font-size: 12px; font-weight: 500; white-space: nowrap; }
  .ib-count { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
    background: #B45309; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
  .ib-sep { width: 1px; align-self: stretch; margin: 8px 4px; background: var(--line); flex: none; }
  .ib-fold { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; }
  .ib-fold:hover { background: var(--chip); }
  html.bar-folded .ib-fold svg { transform: rotate(180deg); }
  .recent-bar { display: flex; align-items: center; gap: 6px; padding: 4px 12px 6px; overflow: hidden; }
  .recent-bar .rb-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
  .recent-bar a { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--chip); border: 1px solid var(--line);
    color: var(--ink); font-size: 12px; text-decoration: none; white-space: nowrap; flex: none; }
  .recent-bar a strong { color: var(--brand); }
  .recent-bar a[aria-current="page"] { background: var(--ok-bg); border-color: var(--ok-line); }
}
/* icons only: folded by hand, or when the words do not fit */
@media (min-width: 1000px) and (max-width: 1499px) { .iconbar a { width: 46px; min-width: 46px; padding: 0; height: 44px; } .ib-label { display: none; } }
@media (min-width: 1000px) { html.bar-folded .iconbar a { width: 46px; min-width: 46px; padding: 0; height: 44px; } html.bar-folded .ib-label { display: none; } }

/* ---------- split screen: POs to check beside the order (1200px+; owner, Nov 2026) ---------- */
.po-window { margin-left: auto; flex: none; display: none; align-items: center; gap: 6px; }
.po-split-list { display: none; }
@media (min-width: 1000px) { .po-window { display: inline-flex; } }
@media (min-width: 1200px) {
  .po-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
  .po-split-list { display: flex; flex-direction: column; gap: 6px; position: sticky; top: calc(var(--topbar-h, 120px) + 12px);
    max-height: calc(100vh - var(--topbar-h, 120px) - 24px); overflow-y: auto; padding-right: 2px; }
  .po-split-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 4px; font-size: 15px; }
  .po-split-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
    color: var(--ink); text-decoration: none; font-size: 13px; }
  .po-split-item:hover { border-color: var(--ok-line); }
  .po-split-item[aria-current="page"] { background: var(--ok-bg); border-color: var(--ok-line); }
  .po-split-item .psi-top { display: flex; justify-content: space-between; gap: 8px; }
  .po-split-item .psi-id { color: var(--brand); font-weight: 700; }
  .po-split-item .psi-sub { color: var(--muted); }
  .po-split-item .pill { align-self: flex-start; }
  .po-split-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
}

/* ---------- Confirmations to send: the full order card as a last check (owner, Nov 2026) ---------- */
.cf-list { display: flex; flex-direction: column; gap: 10px; }
.cf-card { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 1000px) { .o-card.cf-card { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) auto; } }
.cf-card .o-who { display: flex; flex-direction: column; gap: 2px; }
.cf-card .o-who a { color: inherit; text-decoration: none; }
.cf-card .o-po { color: var(--brand); font-weight: 700; }
.cf-noemail { color: #9A3412; font-weight: 600; }
.cf-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cf-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cf-spec { display: flex; flex-direction: column; padding: 5px 9px; border-radius: 8px; background: var(--chip); border: 1px solid var(--line); min-width: 0; }
.cf-spec small { font-size: 11px; color: var(--muted); font-weight: 600; }
.cf-spec strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-spec.na { background: transparent; }
.cf-spec.na strong { color: var(--muted); font-weight: 500; }
.cf-notes { font-size: 13px; padding: 6px 9px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); white-space: pre-wrap; }
.cf-notes small { font-weight: 700; margin-right: 4px; }
.cf-lines { display: flex; flex-direction: column; gap: 4px; }
.cf-line { display: grid; grid-template-columns: 40px minmax(150px, auto) minmax(0, 1fr) 90px; gap: 10px; align-items: baseline; font-size: 13px; }
.cf-line.cf-part { color: var(--muted); }
.cf-line .q { font-weight: 700; background: var(--chip); border-radius: 6px; text-align: center; }
.cf-line .d { min-width: 0; }
.cf-line .p { text-align: right; font-variant-numeric: tabular-nums; }
.cf-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cf-total { font-size: 16px; }
@media (min-width: 1000px) {
  .cf-card { grid-template-columns: 220px minmax(0, 1fr) 190px; gap: 16px; }
  .cf-right .btn-row { justify-content: flex-end; }
}
/* Finishing list: one line per finisher like Builders (owner, Nov 2026) */
.f-row { grid-template-columns: minmax(110px, 200px) 84px 84px 84px 84px 70px minmax(0, 1fr); }
.f-row.b-head span:nth-child(n+2):nth-child(-n+6) { text-align: center; }
@media (max-width: 640px) { .f-row { grid-template-columns: minmax(70px, 1fr) 46px 46px 46px 46px; } .f-row .b-hours, .f-row.b-head span:nth-child(6) { display: none; } }
/* Rep commissions list: orders, sales, commission, then Open / Email */
.rp-reprow.rp-comm { grid-template-columns: minmax(180px, 1fr) 90px 110px 110px auto; }
@media (max-width: 640px) { .rp-reprow.rp-comm { grid-template-columns: 1fr auto auto; } .rp-comm .rp-repnum:nth-child(3) { display: none; } }
.cf-line .c { color: var(--brand); min-width: 0; }
.cf-card .o-who .small { overflow-wrap: anywhere; }
.cf-line { grid-template-columns: 40px minmax(140px, max-content) minmax(0, 1fr) 90px; }
.po-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 4px 6px; }
/* Invoicing (owner, Nov 2026): one block per order – number, PO, colour, shipment and total on one line, the items under it
   with their amounts lined up under the order total, then Items / Discount / Freight / Tax */
.inv-group { gap: 0; }
.inv-group > .fin-head { padding-bottom: 8px; border-bottom: 2px solid var(--brand); margin-bottom: 2px; }
.inv-cname { font-size: 18px; color: var(--brand); }
.inv-order { border-top: 1px solid #EFEAE2; padding: 10px 2px 8px; }
.inv-group > .fin-head + .inv-order, .inv-cnotes + .inv-order { border-top: 0; }
.inv-cnotes { margin: 8px 0 2px; padding: 7px 12px; background: #FFF4D6; border: 1px solid #F0D58A; border-radius: 8px; font-size: 14px; }
.inv-ohead.ship-order { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 0; border-top: 0; justify-content: flex-start; cursor: default; }
label.inv-ohead { cursor: pointer; }
.inv-ohead input { width: 18px; height: 18px; margin: 0; flex: none; }
.inv-no { font-weight: 800; color: var(--brand); }
.inv-po { font-weight: 700; }
.inv-colour { background: var(--chip); border-radius: 6px; padding: 1px 8px; font-size: 13px; font-weight: 600; }
.inv-ship { font-size: 12.5px; color: var(--muted); }
.inv-total { margin-left: auto; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.inv-lines.cf-lines { width: auto; margin: 8px 0 0 30px; padding: 0; border-left: 0; gap: 3px; }
.inv-lines .cf-line { grid-template-columns: 34px minmax(150px, max-content) minmax(0, 1fr) 100px; }
.inv-lines .cf-line .p { color: var(--muted); }
.inv-sums { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 22px; margin-top: 6px; padding-top: 5px; border-top: 1px dashed #E4DED3; font-size: 12.5px; color: var(--muted); }
.inv-sum { display: inline-flex; gap: 6px; align-items: baseline; }
.inv-sum strong { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.inv-sum.disc strong { color: #B4231B; }
.inv-sum.freight strong { color: var(--brand); }
@media (max-width: 640px) { .inv-lines.cf-lines { margin-left: 0; } .inv-lines .cf-line { grid-template-columns: 30px minmax(0, max-content) 1fr 80px; } .inv-lines .cf-line .d { grid-column: 2 / 5; grid-row: 2; } .inv-sums { justify-content: flex-start; } }
/* builder page: By order / By item code and the ordered-date filter (owner, Nov 2026) */
.bl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 6px; }
.bl-tools .seg { margin: 0; }
.bl-day { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.bl-day select { min-height: 36px; font-size: 14px; }
.bl-list { margin-top: 4px; }
.bl-table { font-size: 13px; }
.bl-table td, .bl-table th { padding: 5px 7px; vertical-align: middle; }
.bl-table tr.bl-first td { border-top: 2px solid var(--line, #d8d2c6); }
.bl-table td.bl-item-code { white-space: nowrap; font-weight: 700; }
.bl-table td { white-space: nowrap; }
.bl-table td.bl-desc { white-space: normal; min-width: 340px; width: 34%; }
.bl-table td.bl-cut { white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; min-width: 190px; max-width: 260px; }
.bl-table a.bl-sort { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.bl-table a.bl-sort.on { color: var(--brand); border-bottom-style: solid; }
.bl-table td.bl-cut { max-width: 190px; }
.bl-table .btn.small { min-height: 28px; padding: 2px 9px; font-size: 12.5px; }
.bl-table .nowrap { white-space: nowrap; }
.bl-table .ms-btns { display: inline-flex; gap: 4px; align-items: center; }
.bl-age { padding: 1px 6px; border-radius: 4px; }
.bl-age.due { background: #FDECA6; }
.bl-age.old { background: #F4B5AE; }
.bl-layout { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.bl-layout select { min-height: 36px; font-size: 14px; }

/* Add an item: the quantity box first, then the item search (owner, Nov 2026) */
.oq-add { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: end; }
.oq-add .oq-add-qty input { width: 100%; text-align: center; min-height: 44px; }
.oq-add .field { margin: 0; }

/* a finisher's work orders checked against our orders (Approve tab) */
.wo-row { display: grid; grid-template-columns: minmax(180px, 260px) minmax(120px, 200px) minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid #EFEAE2; font-size: 13.5px; }
.wo-row .wo-po { display: flex; flex-direction: column; }
.wo-row .wo-res { display: flex; flex-direction: column; gap: 2px; }
.wo-prob { display: flex; gap: 5px; align-items: center; color: #9A3412; font-weight: 600; }
.wo-missing { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; padding: 6px 9px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }

/* Search orders (#/search): filters with green labels like the order form, one card per order */
.so-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; padding: 12px; max-width: none !important; width: 100%; box-sizing: border-box; margin: 0; }
.so-f { display: flex; align-items: stretch; margin: 0; }
.so-f > span { flex: 0 0 120px; display: flex; align-items: center; padding: 0 9px; background: #E4EFE8; color: var(--brand-dark); font-size: 12.5px; font-weight: 600;
  border: 1px solid #C7DDCF; border-right: 0; border-radius: 8px 0 0 8px; white-space: nowrap; }
.so-f > input, .so-f > select { flex: 1 1 auto; min-width: 0; height: 34px; min-height: 0; border-radius: 0 8px 8px 0; padding-top: 4px; padding-bottom: 4px; font-size: 14px; }
.so-f.so-item { grid-column: span 2; }
.so-f .so-two { display: flex; flex: 1 1 auto; background: none; border: 0; padding: 0; gap: 4px; }
.so-f .so-two input { flex: 1; min-width: 0; height: 34px; min-height: 0; border-radius: 0 8px 8px 0; font-size: 13px; }
.so-status { display: flex; align-items: center; gap: 6px; grid-column: span 2; margin: 0; }
.so-status label { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line, #d8d2c6); font-size: 13px; cursor: pointer; }
.so-status label.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.so-status input { display: none; }
.so-clear { margin-left: auto; font-size: 13px; }
.so-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 4px 6px; color: var(--muted); font-size: 13px; }
.so-sum-r { display: flex; gap: 8px; align-items: center; }
.so-sum-r strong { color: var(--ink, #222); font-size: 15px; }
.so-card .all-line.so-hit .code { background: #FDECA6; border-radius: 4px; padding: 0 4px; }
.so-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.so-tags span { font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: #F1EEE8; color: var(--muted); }
@media (max-width: 999px) { .so-filters { grid-template-columns: 1fr; } .so-f.so-item, .so-status { grid-column: auto; } .so-f > span { flex-basis: 104px; } }

.wo-anyway { display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:600; white-space:nowrap; cursor:pointer; padding:5px 10px; border:1px solid #d9a441; border-radius:8px; background:#fff8e6; }
.wo-anyway input { width:16px; height:16px; }

.wp-overview { width: 100%; font-size: 13px; }
.wp-overview td, .wp-overview th { padding: 3px 8px; vertical-align: top; }
.wp-overview tr.wp-ov-first td { border-top: 2px solid var(--line, #cfd6cf); }
.wp-overview td.num, .wp-overview th.num { text-align: right; }
.wp-overview a { text-decoration: none; }

.wp-model h3 { font-size: 18px; }
.wp-rule .wp-rule-name { font-size: 14px; font-weight: 400; }

.wp-newpart .field[hidden] { display: none; }
.wp-newpart .field.wide { max-width: 320px; min-width: 240px; }
/* Send back to the finisher (order form) */
.btn.tiny { padding: 2px 8px; font-size: 12px; min-height: 0; margin-right: 4px; }
.oq-lines tr.oq-note td .oq-in { font-style: normal; font-weight: 700; color: #a15c00; }
.oq-lines tr.oq-note td.code-cell { color: #a15c00; font-weight: 700; }
.oq-sendback-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: #fff8e6; border: 1px solid #e6c46a; border-radius: 8px; }
.oq-sendback-box .oq-in.wide { flex: 1 1 260px; min-width: 220px; }

/* Delivery lists: To add / On list / Delivered in columns left of the area name (owner, Nov 2026) */
.dl-row { display: grid; grid-template-columns: 78px 78px 78px minmax(0, 1fr); gap: 10px; align-items: center; justify-content: start; padding: 10px 14px; }
.dl-row + .dl-row { margin-top: 6px; }
.dl-head { padding: 2px 14px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.dl-head span:not(:last-child) { text-align: center; }
.dl-n { text-align: center; font-weight: 800; font-size: 15px; border-radius: 8px; padding: 4px 0; background: var(--chip); }
.dl-n.zero { background: transparent; color: #B9B2A6; font-weight: 600; }
.dl-n.add { background: #DDEFE3; color: var(--brand); }
.dl-n.list { background: #FCE8C8; color: #8A5A00; }
.dl-n.sent { background: var(--chip); color: var(--ink); }
@media (max-width: 560px) { .dl-row { grid-template-columns: 46px 46px 46px minmax(0, 1fr); gap: 6px; padding: 10px; } .dl-head { font-size: 10px; } }

/* Finisher Ready for pickup: "fully received" / "N of M in" right under the Add to pickup list button (owner, Nov 2026) */
.o-right.fin-right { flex-direction: column; align-items: flex-end; gap: 6px; }

/* Quote from a pasted email (New quote; owner, Nov 2026) */
.qe-box textarea { width: 100%; min-height: 110px; font: inherit; font-size: 14px; margin-top: 6px; resize: vertical; }
.qe-email summary { cursor: pointer; font-size: 13px; color: var(--muted); margin: 6px 0; }
.qe-email pre { white-space: pre-wrap; font: inherit; font-size: 13px; background: #fff; border: 1px solid #EEE6D2; border-radius: 8px; padding: 8px 10px; max-height: 260px; overflow: auto; }
/* small popup (poentry.pickWood: which wood for a quote email) */
.hs-modal { position: fixed; inset: 0; background: rgba(20, 30, 25, .45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.hs-modal-card { width: min(460px, 100%); padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.hs-modal-card h2 { margin: 0 0 6px; font-size: 19px; color: var(--brand); }
.hs-modal-card p { margin: 0 0 12px; }

/* item sent back to the finisher: the reason, above the item (finishers.js returnNote) */
.ret-note { display: block; margin: 4px 0 2px; padding: 3px 8px; background: #fff4d6; border: 1px solid #e8c15a; border-radius: 6px; color: #8a4b00; font-weight: 600; font-size: .9em; }
.oq-sb-qty { white-space: nowrap; font-weight: 600; } .oq-sb-qty input { width: 4em; margin: 0 4px; }
.pill.try-xmas { background: #fff1e0; color: #a14d00; border: 1px dashed #e0954a; }
.pill.ra { background: #efe6fb; color: #5b2d91; border: 1px solid #cdb6ee; }
.all-line.note-line.ret-line { color: #a15c00; font-weight: 700; font-style: normal; }
/* RAs screen cards (returns.js): links without underline, the RA# a small tag, descriptions wrap */
.ra-card .o-who a { text-decoration: none; color: inherit; }
.ra-card .o-who a.o-po { color: var(--brand, #2d6a4f); }
.ra-card .o-who .pill.ra { display: inline-block; width: auto; margin-top: 4px; }
.ra-card .all-line .desc { white-space: normal; overflow: visible; text-overflow: clip; }
.ra-card .all-line .pill, .all-line .pill.ra { white-space: nowrap; }
.ra-card .o-right { gap: 6px; }
.ra-card.late { border-left: 4px solid #b42318; }
/* Delivery: an order just added to the delivery list stays on the screen, light green (shipping.js del-add) */
.o-card.dl-added { background: #e6f4ea; border-color: #b7dfc4; }
.btn.dl-on { background: #d3eedc; color: #1e6b3a; border-color: #9fd3b0; }
/* Credit notes (credits.js) */
.cr-reason { margin: 2px 0 6px; }
.cr-table tr.cr-on td { background: #eef7f0; }
.cr-table td .oq-in.n { width: 7em; }
.cr-table td .oq-in.q { width: 4.5em; }
.cr-total .inv-sums { margin-bottom: 10px; }

/* screenshots of a quote-request email pasted on New quote */
.qe-shots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.qe-shots:empty { display: none; }
.qe-shot { position: relative; display: inline-block; }
.qe-shot img { height: 80px; border: 1px solid var(--line, #ddd); border-radius: 6px; display: block; }
.qe-shot .btn { position: absolute; top: 2px; right: 2px; padding: 0 6px; min-height: 0; background: #fff; }

/* Reading test */
.rt-table { border-collapse: collapse; font-size: 14px; }
.rt-table th, .rt-table td { padding: 5px 10px; border-bottom: 1px solid var(--line, #e5e0d8); text-align: left; vertical-align: top; }
.rt-po { background: var(--card, #fff); border-radius: 10px; margin: 6px 0; padding: 8px 12px; }
.rt-po summary { cursor: pointer; }
.rt-lines { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.rt-lines td, .rt-lines th { padding: 4px 6px; border-top: 1px solid var(--line, #eee); vertical-align: top; text-align: left; }
.rt-lines tr.bad td:first-child { color: #b3261e; font-weight: 700; }
.rt-lines tr.ok td:first-child { color: #2e6b4a; font-weight: 700; }
.warn-text { color: #a15c00; }

/* a line marked received without redrawing the screen (finisher At finisher) */
.slip-row.rcv-done, .c-line.rcv-done { background: #dff1e4; }
.btn.rcv-btn { background: #2e6b4a; color: #fff; border-color: #2e6b4a; }
/* lines / rows marked done without redrawing (ui.markDone) */
.c-line.dl-added, .bl-trow.dl-added, .slip-row.dl-added, .inv-group.dl-added { background: #e6f4ea; }
.ship-notes { display: flex; flex-direction: column; gap: 2px; margin: 6px 4px 4px; }
#ship-rows > .ship-group + .ship-group { margin-top: 26px; }
.ship-notes textarea { width: 100%; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line, #ccd); border-radius: 8px; resize: vertical; background: #fffdf3; }
/* Delivery notices list (#/notices) */
.nt-card { padding: 0; overflow-x: auto; }
.nt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.nt-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted, #667); padding: 8px 10px; border-bottom: 2px solid var(--line, #dde); white-space: nowrap; }
.nt-table td { padding: 8px 10px; border-bottom: 1px solid var(--line, #e4e4ea); vertical-align: top; }
.nt-table .num { text-align: right; }
.nt-table tr.dl-added td { background: #e6f4ea; }
.nt-btns { white-space: nowrap; }
.nt-btns .btn { margin: 0 2px 2px 0; }
/* copy icon beside a PO# (ui.copyPo) */
.copy-po { display: inline-flex; align-items: center; justify-content: center; vertical-align: -2px; width: 22px; height: 22px; margin: -4px 0 -4px 4px; border-radius: 6px; color: var(--muted, #888); cursor: pointer; text-decoration: none; }
.copy-po:hover { color: var(--brand, #2e6b4a); background: rgba(0,0,0,.06); }
.copy-po.copied { color: #1a7f37; }
/* wood parts batch: S / ↑ copy buttons beside the size boxes */
.wp-cell { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.wp-cpb { font: 600 11px/1 inherit; width: 20px; height: 26px; padding: 0; border: 1px solid var(--line, #ccd); border-radius: 4px; background: #fff; color: var(--muted, #667); cursor: pointer; }
.wp-cpb:hover { background: var(--brand, #2e6b4a); color: #fff; border-color: var(--brand, #2e6b4a); }
/* TBD orders (waiting for a choice from the customer) */
.tbd-box { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tbd-miss { color: #b3261e; font-weight: 700; font-size: 12.5px; text-align: right; }
.btn.tbd-ask { border-color: #b3261e; color: #b3261e; background: #fff; }
.btn.tbd-ask:hover { background: #b3261e; color: #fff; }
.tbd-form { border-color: #e6b3ad; background: #fdf0ee; align-items: center; }
.tbd-form strong { color: #8a1f17; }
.tbd-form .btn { margin-left: auto; flex: none; }
/* finisher page: the tabs with the Finishing hours button at the right */
.fin-tabs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fin-tabs .seg { flex: 1 1 auto; }
/* finisher workload box (js/workload.js) */
.workload { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 6px 12px; margin: 8px 0; background: var(--card, #fff); }
.workload summary { cursor: pointer; padding: 2px 0; }
.wl-rows { display: grid; gap: 4px; padding: 4px 0 2px; }
.wl-row { display: grid; grid-template-columns: 150px 170px 1fr; gap: 10px; align-items: baseline; }
@media (max-width: 700px) { .wl-row { grid-template-columns: 1fr 1fr; } .wl-row .muted { grid-column: 1 / -1; } }
/* Shipping: freight quote / skid label next to the customer's name; See shipment under a customer's orders, right edge lined up with the card buttons */
.ship-name-btns { display: inline-flex; gap: 6px; margin-left: 14px; vertical-align: middle; }
.ship-bottom { justify-content: flex-end; padding: 4px 14px 10px; }
