/* Barlow Semi Condensed for board codes (self-hosted, SIL OFL — /fonts/OFL.txt) */
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url(/fonts/barlow-semi-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 800 900; font-display: swap; src: url(/fonts/barlow-semi-condensed-800.woff2) format("woff2"); }
/* Gorilla Inventory — phone and desktop portal.
   Built for the shop floor: big tap targets (56px+), high contrast, one column on phones. */

:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #ecebe5;
  --ink: #1b1d1a;
  --ink-2: #4c524a;
  --line: #d6d4cc;
  --brand: #1f2a1f;
  --accent: #f2b632;
  --accent-ink: #1b1d1a;
  --go: #1f7a3a;
  --go-ink: #ffffff;
  --amber: #b86e00;
  --amber-ink: #7a4a00; /* amber text on amber-bg: 5.7:1 (design review 2.1) */
  --amber-bg: #fff1d6;
  --ok-bg: #dff1e3;
  --ok-ink: #1d5e2e;
  --lane-1: #2f6fb8; --lane-2: #5f7f8c; --lane-3: #0f8a7a; --lane-4: #6f747a; --lane-5: #2f8a2a;
  --red: #b3261e;
  --red-bg: #fde4e1;
  --hold: #6b3fa0;
  --hold-bg: #efe6fa;
  --focus: #1a5fd0;
  --radius: 12px;
  --tap: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121411; --surface: #1c1f1b; --surface-2: #262a25; --ink: #eef0ea; --ink-2: #b4baae;
    --line: #353a33; --brand: #0d110d; --amber: #f0a637; --amber-bg: #3a2a0c; --red: #ff8a80; --red-bg: #3d1513;
    --hold: #c9a7f2; --hold-bg: #2c1f3d; --go: #2f9e52; --focus: #7fb0ff; color-scheme: dark;
    --amber-ink: #f0a637; --ok-bg: #173822; --ok-ink: #8fd6a2;
    --lane-1: #5aa9f0; --lane-2: #9ec3d3; --lane-3: #2fd4bd; --lane-4: #b4baae; --lane-5: #8ee05a;
  }
}
:root[data-theme="dark"] {
  --bg: #121411; --surface: #1c1f1b; --surface-2: #262a25; --ink: #eef0ea; --ink-2: #b4baae;
  --line: #353a33; --brand: #0d110d; --amber: #f0a637; --amber-bg: #3a2a0c; --red: #ff8a80; --red-bg: #3d1513;
  --hold: #c9a7f2; --hold-bg: #2c1f3d; --go: #2f9e52; --focus: #7fb0ff; color-scheme: dark;
  --amber-ink: #f0a637; --ok-bg: #173822; --ok-ink: #8fd6a2;
  --lane-1: #5aa9f0; --lane-2: #9ec3d3; --lane-3: #2fd4bd; --lane-4: #b4baae; --lane-5: #8ee05a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; margin-top: 1.5rem; }
h3 { font-size: 1.05rem; }
p { margin: .4rem 0; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.pad { padding: 16px; }
.small { font-size: .88rem; }
.big { font-size: 1.3rem; }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.form-top { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 8px 0 10px; border-bottom: 1px solid var(--line); }
.view .form-top { top: 56px; }
.sheet .form-top { top: -18px; margin-top: -18px; padding-top: 18px; }
.form-top h1, .form-top h2 { margin-bottom: 8px; }
.order-actions { padding: 10px; background: var(--surface-2); border-radius: var(--radius); }
/* Breadcrumbs: up a level without the Back button */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .95rem; margin-bottom: -4px; }
.crumbs a { padding: 6px 2px; font-weight: 700; }
.crumbs .sep { color: var(--ink-2); }
.crumbs .here { color: var(--ink-2); }
/* Order page title: the company, big */
.cust-title { font-size: 2rem; line-height: 1.15; margin: 0; }
.cust-type { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.order-sub { margin: 0; color: var(--ink-2); font-weight: 600; }
/* Shipping + HOT + optional due date in one row */
.ship-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.ship-row > label:first-child { flex: 1 1 18em; }
.hot-mini { gap: 8px; align-items: center; padding: 8px 12px; border: 2px solid var(--red); border-radius: 10px; color: var(--red); font-weight: 800; min-height: 44px; }
.due-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.due-box label { gap: 8px; align-items: center; font-weight: 700; min-height: 44px; }
.due-box input[type=date]:disabled { opacity: .4; }
/* Edit order: compact company line */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-weight: 600; }
.cust-line { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; }
.cust-name { flex: 1; font-weight: 800; }
.cust-picker[hidden] { display: none; }
.hot-toggle { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--red); border-radius: 10px; color: var(--red); }
button.pick { justify-content: flex-start; text-align: left; gap: 12px; min-height: 64px; font-weight: 400; }
button.pick .tick { width: 32px; height: 32px; border: 2px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; flex-shrink: 0; }
button.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--amber-bg); }
button.pick[aria-pressed="true"] .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.actionbar { position: sticky; bottom: 8px; z-index: 5; background: var(--surface); border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px; box-shadow: 0 6px 24px #0004; }
.dims { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 6px; align-items: center; font-weight: 400; }
.dims span { color: var(--ink-2); }
.code { font-family: "Barlow Semi Condensed", "Bahnschrift SemiCondensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif; font-weight: 800; letter-spacing: .02em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.big-code { font-size: 1.8rem; display: inline-block; padding: 2px 10px; }
.code-preview { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 1.05rem; }
.code-preview strong { font-family: "Barlow Semi Condensed", "Bahnschrift SemiCondensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif; font-size: 1.3rem; }
.line-pick { flex-direction: column; align-items: flex-start; text-align: left; padding: 10px 16px; }
.line-pick .sub { font-weight: 400; font-size: .9rem; color: var(--ink-2); }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--brand); color: #fff;
}
.brand { font-weight: 800; letter-spacing: .08em; text-decoration: none; font-size: 1.1rem; }
.brand span { font-weight: 500; letter-spacing: 0; color: var(--accent); margin-left: 6px; }
.who { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.who button { min-height: 40px; padding: 0 12px; background: transparent; color: #fff; border: 1px solid #ffffff55; border-radius: 8px; font: inherit; }

.view { max-width: 760px; margin: 0 auto; padding: 16px; }
.view.wide { max-width: 1100px; }

/* buttons */
button, .btn {
  -webkit-appearance: none; appearance: none; font: inherit; font-weight: 600; cursor: pointer;
  min-height: var(--tap); padding: 0 18px; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; text-decoration: none; touch-action: manipulation; text-align: center;
}
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.primary { background: var(--go); color: var(--go-ink); border-color: var(--go); }
/* Yellow means "selected" only (design review 3.1): .accent buttons are ordinary buttons now. */
.accent { background: var(--surface); color: var(--ink); border-color: var(--line); }
.danger { color: var(--red); border-color: var(--red); }
.quiet { border-color: transparent; background: transparent; text-decoration: underline; font-weight: 500; min-height: 44px; }
.block { width: 100%; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tiles .btn, .tiles button { min-height: 96px; flex-direction: column; font-size: 1.1rem; padding: 12px; }
.tiles .sub { font-weight: 400; font-size: .85rem; color: var(--ink-2); }
.tiles .primary .sub, .tiles .accent .sub { color: inherit; opacity: .85; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }

/* stage buttons on the ticket screen */
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stage-grid button { min-height: 72px; font-size: 1.05rem; line-height: 1.2; padding: 8px; flex-direction: column; gap: 2px; }
.stage-grid button.current { background: var(--surface-2); color: var(--ink); border: 3px solid var(--ink); opacity: 1; }
.stage-grid button .sub { display: block; font-size: .8rem; font-weight: 400; opacity: .8; }
@media (min-width: 700px) { .stage-grid { grid-template-columns: repeat(3, 1fr); } }

/* cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card + .card { margin-top: 10px; }
a.card { display: block; text-decoration: none; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list > a, .list > .item {
  display: flex; gap: 12px; justify-content: space-between; align-items: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-height: var(--tap);
}
.list > a, .list > .item { border-left: 8px solid var(--line); }
.list .title { font-weight: 700; }
.list .meta { color: var(--ink-2); font-size: .9rem; }
.lvl-amber { border-left: 8px solid var(--amber) !important; }
.lvl-red { border-left: 8px solid var(--red) !important; }
.lvl-hold { border-left: 8px solid var(--hold) !important; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.amber { background: var(--amber-bg); color: var(--amber-ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.hot { background: var(--red); color: #fff; font-weight: 800; letter-spacing: .04em; }
.chip.hold { background: var(--hold-bg); color: var(--hold); }
.chip.go { background: var(--go); color: #fff; }

.ticket-head .num { font-size: 2.2rem; font-weight: 800; letter-spacing: .02em; }
.ticket-head .piece { font-size: 1.1rem; font-weight: 700; color: var(--ink-2); }
.ticket-head .cust { font-size: 1.3rem; font-weight: 700; }
.where { font-size: 1.15rem; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.where strong { font-size: 1.3rem; }

.banner { padding: 14px 16px; border-radius: var(--radius); font-weight: 600; }
.banner.hold { background: var(--hold-bg); color: var(--hold); border: 2px solid var(--hold); }
.banner.red { background: var(--red-bg); color: var(--red); }
.banner.info { background: var(--surface-2); }

.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-stepper button { width: var(--tap); padding: 0; font-size: 1.6rem; }
.qty-stepper output { min-width: 3ch; text-align: center; font-size: 1.6rem; font-weight: 800; }

/* forms */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label .hint { font-weight: 400; color: var(--ink-2); font-size: .85rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line);
  border-radius: 10px; min-height: var(--tap); padding: 10px 12px;
}
textarea { min-height: 90px; }
input[type="checkbox"] { width: 28px; min-height: 28px; height: 28px; }
.pin-input { font-size: 2rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { min-height: 48px; font-weight: 600; padding: 0 14px; }
.choices button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two label { margin-top: 14px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px 14px; margin: 16px 0 0; }
legend { font-weight: 700; padding: 0 6px; }
.err { color: var(--red); font-weight: 600; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--ink-2); }
td input, td select { min-height: 44px; padding: 6px 8px; }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.tabs button { min-height: 44px; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.history .when { color: var(--ink-2); font-size: .85rem; }

.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.secret { word-break: break-all; font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 12px; border-radius: 8px; user-select: all; }

/* toast + bottom sheet */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 14px 20px; border-radius: 12px; font-weight: 600;
  max-width: calc(100% - 32px); z-index: 50; box-shadow: 0 6px 24px #0005;
}
.toast.bad { background: var(--red); color: #fff; }
.toast.good { background: var(--go); color: #fff; }
.sheet-backdrop { position: fixed; inset: 0; background: #0008; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 18px; } }

.truckbar { position: sticky; bottom: 0; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: var(--radius); font-weight: 700; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.truckbar a { min-height: 44px; display: inline-flex; align-items: center; }
/* Item form: Other's text beside the buttons; legs row with Add details */
.kind-row, .leg-row { gap: 8px; align-items: center; flex-wrap: wrap; }
.kind-row input { flex: 1; min-width: 12em; }
/* Edit order screen */
.chip.unsaved { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 800; }
.edit-line-row { gap: 10px; align-items: center; flex-wrap: wrap; }
input.qty { width: 5em; min-height: 44px; font-size: 1.15rem; font-weight: 800; text-align: center; }
.edit-line.removing { opacity: .6; border-color: var(--red, #d33); }
.edit-line.removing .title { text-decoration: line-through; }
.edit-line:not(.removing) .remove-note { display: none; }
.edit-line .line-actions { gap: 8px; flex-wrap: wrap; }
.edit-line .line-actions button { min-height: 40px; }
.edit-line.split-line { border-color: var(--accent); border-style: dashed; }
.item-details fieldset { margin: 0; }
.bulk-finish summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }
/* Stand page: Build details, plain text until Edit */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.details dt { color: var(--ink-2); font-weight: 600; }
.details dd { margin: 0; font-weight: 700; }
.details-card.editing { border: 2px solid var(--accent); }
/* Order page: move all or part of an order at once */
.quick-picks { gap: 6px; flex-wrap: wrap; }
.quick-picks button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.move-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.move-row input[type=checkbox] { width: 28px; height: 28px; flex-shrink: 0; }
/* Order page: sheet numbers ("4 of 14") for every piece on one screen */
.sheetno-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.sheetno-box { display: flex; align-items: center; flex-shrink: 0; font-weight: 700; }
input.sheetno { width: 4.5em; min-height: 48px; font-size: 1.2rem; font-weight: 800; text-align: center; }
input.sheetno.bad { border-color: var(--red, #d33); outline: 2px solid var(--red, #d33); }
.red-text { color: var(--red, #d33); }
/* Palletize planner: one row per piece with a button per pallet */
.plan-row { flex-direction: column; align-items: stretch; gap: 8px; }
.choices.dest { gap: 6px; }
.choices.dest button { min-height: 48px; min-width: 48px; padding: 0 10px; font-size: 1.05rem; font-weight: 800; }
.choices.dest button.newdest { border-style: dashed; }
.planbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.planbar button { flex-shrink: 0; }

/* Test copy of the system (SITE_LABEL): a loud strip on every screen */
.site-banner { background: #b3261e; color: #fff; padding: 8px 16px; font-weight: 600; text-align: center; font-size: .95rem; }
.site-banner strong { letter-spacing: .08em; }
