/* Gone. Storeroom - staff page. Gone identity: monochrome, ink #231f20, square geometry.
   Amber/red/green are functional scan and status signals only. No external fonts (CSP). */
:root {
  --ground: #f4f3f1; --surface: #ffffff; --surface-2: #faf9f8; --sunk: #eceae7;
  --ink: #231f20; --ink-2: #57534f; --ink-3: #8a8580;
  --line: #dedbd7; --line-2: #c2beb9;
  --accent: #231f20; --accent-soft: #eceae7; --on-accent: #ffffff;
  --warn: #96650f; --warn-soft: #f6eddb;
  --crit: #a82f24; --crit-soft: #f8e5e2;
  --ok: #2f6b3a; --ok-soft: #e1efe2; /* scan accepted: functional signal only */
  --r: 3px;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "IBM Plex Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121110; --surface: #1b1a18; --surface-2: #201f1c; --sunk: #171614;
    --ink: #f2f0ee; --ink-2: #b3aea8; --ink-3: #857f79;
    --line: #2e2c29; --line-2: #423f3b;
    --accent: #f2f0ee; --accent-soft: #2a2825; --on-accent: #1b1a18;
    --warn: #dfa855; --warn-soft: #332813;
    --crit: #e88a7e; --crit-soft: #3a1c18;
    --ok: #8fd19a; --ok-soft: #17301b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #121110; --surface: #1b1a18; --surface-2: #201f1c; --sunk: #171614;
  --ink: #f2f0ee; --ink-2: #b3aea8; --ink-3: #857f79;
  --line: #2e2c29; --line-2: #423f3b;
  --accent: #f2f0ee; --accent-soft: #2a2825; --on-accent: #1b1a18;
  --warn: #dfa855; --warn-soft: #332813;
  --crit: #e88a7e; --crit-soft: #3a1c18;
  --ok: #8fd19a; --ok-soft: #17301b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 16px/1.45 var(--sans); overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 16px 16px 48px; outline: none; }

/* Header lockup: mark | hairline | name */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.logo { height: 28px; width: auto; flex: none; }
.rule { width: 1px; height: 24px; background: var(--line-2); flex: none; }
.title, .display { font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.title { font-size: 14px; white-space: nowrap; }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.user { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { max-width: 1040px; margin: 0 auto; padding: 0 8px; display: flex; overflow-x: auto; }
.nav a {
  flex: 1 0 auto; text-align: center; padding: 12px 10px; text-decoration: none; color: var(--ink-2);
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 3px solid transparent; min-height: 44px;
}
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
@media (max-width: 420px) {
  .bar .rule, .bar .title { display: none; }
  .logo { height: 24px; }
  .nav a { padding: 12px 5px; font-size: 12px; letter-spacing: .03em; } /* five items fit at 375 px */
}
.netbar { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn); padding: 8px 16px; font-size: 14px; text-align: center; }

h1, h2 { font-weight: 800; text-transform: uppercase; letter-spacing: .07em; line-height: 1.2; }
h1 { font-size: 20px; margin: 8px 0 4px; }
h2 { font-size: 15px; margin: 24px 0 8px; }
.eyebrow { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin: 0 0 12px; }
.section { border-top: 1px solid var(--line-2); padding-top: 4px; margin-top: 16px; }

/* Controls: square, large tap targets */
button, input, select { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r); cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--accent); color: var(--on-accent);
  font-weight: 700; text-transform: uppercase; letter-spacing: .07em; font-size: 14px; white-space: nowrap;
}
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .nav a:focus-visible, input:focus-visible, summary:focus-visible, .pickrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 160px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: 4px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line-2);
  border-radius: var(--r); background: var(--surface); font-size: 16px;
}
.input:focus { border-color: var(--ink); outline: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.narrow { max-width: 420px; margin: 24px auto; }

/* Messages */
.msg { border: 1.5px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; margin: 12px 0; background: var(--surface-2); }
.msg.err { border-color: var(--crit); background: var(--crit-soft); color: var(--crit); }
.msg.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.msg.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.banner-stale { background: var(--crit); color: #fff; font-weight: 700; padding: 12px 14px; border-radius: var(--r); margin: 12px 0; }
.tag { display: inline-block; border: 1.5px solid currentColor; padding: 0 5px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; border-radius: 2px; }

/* Scan box */
.scanbox { border: 2px solid var(--ink); border-radius: var(--r); background: var(--surface); padding: 12px; transition: background-color .15s; }
.scanbox .input { font-family: var(--mono); font-size: 20px; letter-spacing: .04em; border-color: var(--ink); }
.scanbox.flash-ok { background: var(--ok-soft); border-color: var(--ok); }
.scanbox.flash-err { background: var(--crit-soft); border-color: var(--crit); }
.scanbox.flash-warn { background: var(--warn-soft); border-color: var(--warn); }
.scanstatus { min-height: 22px; margin: 8px 0 0; font-size: 14px; }
.qtyfield { margin: 10px 0 0; }
.qtyfield .input { width: 120px; font-family: var(--mono); font-size: 20px; }
.qtyerr { color: var(--crit); margin: 4px 0 0; }
.qtyerr:empty { display: none; }
.cam { margin-top: 12px; width: 100%; max-width: 480px; }
.cam video { width: 100% !important; height: auto !important; }

/* Pick / search results */
.picklist { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.pickrow {
  display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  padding: 12px 8px; min-height: 52px; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
}
.pickrow:hover { background: var(--surface-2); }
.pickrow .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

/* Batch lines */
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line .what { flex: 1 1 auto; min-width: 0; }
.line .name { font-weight: 700; overflow-wrap: anywhere; }
.line .sub { font-size: 13px; color: var(--ink-2); }
.qty { display: flex; align-items: center; gap: 4px; flex: none; }
.qty .n { min-width: 36px; text-align: center; font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; }
.qty .btn { min-width: 44px; min-height: 44px; padding: 0; font-size: 20px; }
.totals { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0; flex-wrap: wrap; }
.big { font-weight: 900; font-size: 28px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Checklist */
.check { list-style: none; margin: 0; padding: 0; }
.check li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.check li.done { color: var(--ink-3); text-decoration: line-through; }
.check .count { font-family: var(--mono); white-space: nowrap; }
details > summary { cursor: pointer; padding: 10px 0; min-height: 44px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; font-size: 14px; }

/* Tables: a table on wide screens, stacked cards on phones */
.tblwrap { width: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { font-family: var(--mono); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); text-align: left; padding: 8px 6px; border-bottom: 1.5px solid var(--ink); vertical-align: bottom; }
.tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .num { text-align: right; }
.tbl td.key { font-weight: 900; }
.tbl tr.zero td { color: var(--ink-3); }
@media screen and (max-width: 700px) {
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl td { border: 0; padding: 2px 0; min-width: 0; overflow-wrap: anywhere; }
  .tbl .s6 { grid-column: span 6; font-weight: 700; }
  .tbl .s3 { grid-column: span 3; color: var(--ink-2); }
  .tbl .s2 { grid-column: span 2; }
  .tbl .s1 { grid-column: span 1; }
  .tbl .num { text-align: left; }
  .tbl td.s1::before, .tbl td.s2::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Admin */
a.btn { text-decoration: none; }
.scanbox + .row { margin-top: 8px; }
.subnav { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 8px; border-bottom: 1px solid var(--line); }
.subnav a {
  flex: 0 0 auto; padding: 10px 10px; min-height: 44px; text-decoration: none; color: var(--ink-2);
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 2px solid transparent;
}
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.btn.danger { background: var(--crit); border-color: var(--crit); color: var(--on-accent); }
.btn.ghost.danger { background: transparent; color: var(--crit); }
.tag.warn { color: var(--warn); }
.tag.crit { color: var(--crit); margin-left: 6px; }
.warntext { color: var(--warn); }
.radio { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.radio input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--ink); border-radius: var(--r); padding: 2px 2px 2px 10px; background: var(--surface); max-width: 100%; overflow-wrap: anywhere; }
.chipx { min-width: 36px; min-height: 36px; border: 0; background: transparent; cursor: pointer; font-size: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.filters { margin-bottom: 8px; }
.batch { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 12px; margin: 10px 0; }
.batch.is-reversed { background: var(--surface-2); }
.batchhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.batchhead .push { margin-left: auto; }
.tbl tr.diff, .tbl tr.diff td { background: var(--warn-soft); }
/* moved during the count: a left bar - on the row in the phone grid, on its first cell in a real table */
@media screen and (max-width: 700px) { .tbl tr.moved { box-shadow: inset 4px 0 0 var(--warn); padding-left: 10px; } }
@media not screen and (max-width: 700px) { .tbl tr.moved td:first-child { box-shadow: inset 4px 0 0 var(--warn); padding-left: 10px; } }
.errlist { margin: 6px 0 0; padding-left: 20px; }
.errlist li { margin: 2px 0; overflow-wrap: anywhere; }
.pw { font-size: 22px; font-weight: 700; letter-spacing: .06em; margin: 8px 0; overflow-wrap: anywhere; user-select: all; }
.actions { margin: 16px 0; }
.dlg { border: 2px solid var(--ink); border-radius: var(--r); background: var(--surface); color: var(--ink); padding: 16px; width: min(440px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 0, 0, .45); }
.dlg h2 { margin-top: 0; }
.dlg-actions { margin-top: 16px; }
input[type="file"].input { padding: 10px; }

.print-only { display: none; }

@media print {
  @page { size: A4; margin: 12mm; }
  :root { --ink: #000; --ink-2: #333; --line: #999; --line-2: #000; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .top, .netbar, .no-print, .btn { display: none !important; }
  .print-only { display: block; }
  .wrap { padding: 0; max-width: none; }
  .banner-stale { border: 2px solid #000; color: #000; background: #fff; }
  .tbl th, .tbl td { border: 1px solid #000; padding: 3pt 5pt; }
  .tbl tr { page-break-inside: avoid; }
  details > summary { list-style: none; }
}
