/* Phantom look: Geist and Geist Mono, near-black and white, one accent.
   Big type and big targets for gloves; status always carries a word and a glyph. */

:root {
  --ink: #0b0b0c;
  --paper: #ffffff;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --line: #e3e3df;
  --text: #0b0b0c;
  --dim: #6b6b70;
  --accent: #e2603b;
  --accent-ink: #ffffff;
  --ok: #1f8a55;
  --warn: #a86a00;
  --bad: #c2382c;
  --wait: #4a5bd4;
  --radius: 10px;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.floor {
  --bg: #0a0a0b;
  --surface: #151517;
  --surface-2: #1d1d20;
  --line: #2b2b30;
  --text: #f4f4f5;
  --dim: #a1a1a8;
  --ok: #3fbf7f;
  --warn: #f2b134;
  --bad: #ff6a5c;
  --wait: #8c9bff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
a { color: inherit; }
.mono, code, .pn { font-family: var(--mono); letter-spacing: -0.01em; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.right { text-align: right; }
.hidden { display: none !important; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: 30px; }
h2 { font-size: 20px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); font-weight: 600; margin-top: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.brand { font-weight: 700; letter-spacing: .32em; font-size: 13px; }
.brand i { font-style: normal; color: var(--accent); }

/* ---------- buttons and inputs ---------- */
.btn, button.btn, input[type=submit].btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 600 16px var(--sans); text-decoration: none; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.floor .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn-big { min-height: 72px; font-size: 22px; padding: 0 22px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  font: 16px var(--sans); padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--dim); margin: 12px 0 4px; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: 15px; }
label.check input { width: 22px; height: 22px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ---------- badges: glyph + word, never colour alone ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.badge b { font-family: var(--mono); }
.b-ok { color: var(--ok); } .b-warn { color: var(--warn); } .b-bad { color: var(--bad); } .b-wait { color: var(--wait); } .b-info { color: var(--dim); }

.flash { padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; border: 1px solid var(--line); background: var(--surface); }
.flash.alert { border-color: var(--bad); }
.flash.alert::before { content: "✕ "; color: var(--bad); font-weight: 700; }
.flash.notice::before { content: "✓ "; color: var(--ok); font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.grid { display: grid; gap: 14px; }

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

/* =================== CONSOLE =================== */
.console { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #e9e9ea; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { color: #fff; padding: 4px 8px 18px; display: block; text-decoration: none; }
.side a { display: flex; justify-content: space-between; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: #cfcfd2; font-size: 15px; }
.side a:hover, .side a.on { background: #1f1f22; color: #fff; }
.side .count { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.side .soon { opacity: .5; }
.side .who { margin-top: 18px; padding: 10px; font-size: 13px; color: #9a9aa1; border-top: 1px solid #222; }
.side .who button { background: none; border: 0; color: #cfcfd2; padding: 0; text-decoration: underline; cursor: pointer; font: inherit; }
.main { padding: 28px 32px 60px; max-width: 1180px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; display: block; }
.stat .n { font-family: var(--mono); font-size: 34px; line-height: 1; letter-spacing: -.03em; }
.stat .l { color: var(--dim); font-size: 13px; margin-top: 6px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters input, .filters select { width: 160px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.login { max-width: 400px; margin: 12vh auto; padding: 0 16px; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photos img { width: 160px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.code-big { font-family: var(--mono); font-size: 54px; letter-spacing: .12em; }

@media (max-width: 820px) {
  .console { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 2px; padding: 10px; }
  .side .brand { width: 100%; padding-bottom: 6px; }
  .side a { padding: 6px 9px; font-size: 14px; }
  .side .who { width: 100%; }
  .main { padding: 18px 16px 40px; }
  .two { grid-template-columns: 1fr; }
  table.t { font-size: 13px; }
}

/* =================== FLOOR (hub + handheld) =================== */
body.floor { font-size: 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: #000; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .where { font-weight: 600; }
.topbar .clock { font-family: var(--mono); font-size: 18px; }
.netbadge { font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--warn); color: var(--warn); }
.netbadge:empty { display: none; }
.wrap { padding: 18px 22px 40px; }
.floor a.back { display: inline-block; color: var(--dim); text-decoration: none; margin-bottom: 10px; font-size: 18px; }

.hub-home { display: grid; grid-template-columns: 1fr 340px; gap: 18px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 132px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.tile .tt { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.tile .ts { color: var(--dim); font-size: 16px; }
.tile.soon { opacity: .55; }
.tile.soon .ts::after { content: " · Coming soon"; color: var(--warn); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.panel h3 { margin-top: 0; }
.panel .row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.panel .row:last-child { border-bottom: 0; }
.note { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: #2a1810; border: 1px solid var(--accent); border-radius: 14px; padding: 14px 18px; margin-top: 16px; font-size: 20px; }
.note b { color: var(--accent); letter-spacing: .1em; font-size: 14px; }

.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.four .k { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.four .v { font-family: var(--mono); font-size: 44px; line-height: 1.05; letter-spacing: -.03em; }
.four .v.neg { color: var(--bad); }
.four .v.neg::before { content: "! "; font-size: 26px; }
.part-title .pn { font-size: 40px; }
.part-title .nm { font-size: 22px; color: var(--dim); }
.result-list a { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: baseline; padding: 14px 6px; border-bottom: 1px solid var(--line); text-decoration: none; }
.result-list .pn { font-size: 20px; }
.stockgrid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.stockgrid img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }

.t5 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.mode small { font-size: 18px; color: var(--dim); font-weight: 500; }
.feed .line { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 18px; align-items: center; }
.feed .line .tm { font-family: var(--mono); color: var(--dim); font-size: 15px; }
.lastmsg { font-size: 26px; font-weight: 600; min-height: 3.2em; }
.lastmsg.saved { color: var(--ok); } .lastmsg.flagged { color: var(--warn); } .lastmsg.refused { color: var(--bad); } .lastmsg.waiting { color: var(--wait); }
.lastmsg::before { font-family: var(--mono); margin-right: 8px; }
.lastmsg.saved::before { content: "✓"; } .lastmsg.flagged::before { content: "!"; } .lastmsg.refused::before { content: "✕"; } .lastmsg.waiting::before { content: "…"; }
.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal .box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(460px, 94vw); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.keypad button { min-height: 72px; font: 600 30px var(--mono); border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.keypad button.wide { font: 600 18px var(--sans); }
.pinshow { font-family: var(--mono); font-size: 44px; letter-spacing: .3em; text-align: center; min-height: 58px; border-bottom: 2px solid var(--line); }
.modal .msg { min-height: 1.4em; margin-top: 8px; color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 20px; font-size: 20px; z-index: 60; max-width: 92vw; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.soundgate { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; z-index: 70; font-size: 28px; font-weight: 700; text-align: center; padding: 20px; cursor: pointer; }

/* handheld: portrait, about 5.5" */
.hh { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.hh .topbar { padding: 10px 14px; }
.hh .screen { flex: 1; padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 12px; }
.hh .big-n { font-family: var(--mono); font-size: 72px; line-height: 1; letter-spacing: -.04em; }
.hh .big-n.neg { color: var(--bad); }
.hh .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hh .acts .btn { min-height: 66px; font-size: 20px; }
.hh .prompt { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.hh .scanhint { margin-top: auto; text-align: center; color: var(--dim); font-size: 15px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; }
.hh .binrow { display: flex; justify-content: space-between; gap: 10px; padding: 14px 8px; border-bottom: 1px solid var(--line); font-size: 18px; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--text); text-align: left; cursor: pointer; }
.hh .binrow.on { outline: 2px solid var(--accent); border-radius: 8px; }
.hh .qtyshow { font-family: var(--mono); font-size: 56px; text-align: center; border-bottom: 2px solid var(--line); min-height: 70px; }
.hh .resultbox { border-radius: 16px; padding: 18px; border: 2px solid var(--line); }
.hh .resultbox.saved { border-color: var(--ok); } .hh .resultbox.flagged { border-color: var(--warn); } .hh .resultbox.refused { border-color: var(--bad); }
.hh .resultbox.recount, .hh .resultbox.review, .hh .resultbox.waiting_approval, .hh .resultbox.queued { border-color: var(--wait); }
.hh .resultbox .h { font-size: 28px; font-weight: 700; }
.hh .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hh .chip { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 16px var(--sans); cursor: pointer; }
.hh .chip.on { border-color: var(--accent); color: var(--accent); }
.hh .countrow { display: flex; justify-content: space-between; gap: 10px; padding: 14px 6px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }

@media (max-width: 900px) {
  .hub-home, .t5, .stockgrid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .four .v { font-size: 32px; }
}

/* =================== PRINT =================== */
body.print { background: #fff; color: #000; }
.print .noprint { padding: 12px 16px; background: #f2f2f0; border-bottom: 1px solid #ddd; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sheet { width: 8.5in; margin: 0 auto; padding: .4in; }
.sheet h1 { font-size: 22px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: .12in; }
.acard { border: 2px solid #000; border-radius: .1in; padding: .1in; text-align: center; height: 2.3in; display: flex; flex-direction: column; align-items: center; justify-content: space-between; break-inside: avoid; }
.acard .t { font-weight: 800; font-size: 17px; letter-spacing: -.01em; line-height: 1.05; }
.acard .s { font-size: 10px; color: #333; min-height: 12px; }
.acard .c { font-family: var(--mono); font-size: 8px; color: #555; }
.slabels { display: grid; grid-template-columns: repeat(2, 1fr); gap: .15in; }
.slabel { border: 1.5px solid #000; border-radius: .08in; padding: .12in; display: flex; gap: .12in; align-items: center; break-inside: avoid; }
.slabel .t { font-weight: 800; font-size: 22px; line-height: 1.1; }
.plabel { width: 4in; height: 2in; border: 1px dashed #999; display: flex; gap: .1in; padding: .1in; align-items: center; break-inside: avoid; margin: 0 0 .1in; overflow: hidden; }
.plabel.li { width: 17cm; }
.plabel .pn { font-family: var(--mono); font-weight: 700; font-size: 24px; }
.plabel .nm { font-size: 12px; line-height: 1.2; margin-top: 4px; }
.plabel .ids { font-family: var(--mono); font-size: 10px; margin-top: 6px; color: #222; }
.badgecard { width: 3.375in; height: 2.125in; border: 1.5px solid #000; border-radius: .12in; padding: .14in; display: flex; gap: .14in; align-items: center; break-inside: avoid; }
.badges { display: grid; grid-template-columns: repeat(2, 3.375in); gap: .2in; }
@media print {
  .noprint { display: none !important; }
  .sheet { padding: 0; width: auto; }
  @page { size: letter; margin: .4in; }
  .plabel { border-color: transparent; }
}

/* =================== POLISH (global) =================== */
/* Button variants must beat `input[type=submit].btn`. */
.btn.btn-primary, input[type=submit].btn.btn-primary, button.btn.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.floor .btn.btn-primary, .floor input[type=submit].btn.btn-primary, .floor button.btn.btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.btn-accent, input[type=submit].btn.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.btn-danger, button.btn.btn-danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn { transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { border-color: var(--dim); }
.btn.btn-primary:hover { filter: brightness(1.15); }
.floor .btn { background: var(--surface-2); }
.side form.inline button { all: unset; cursor: pointer; text-decoration: underline; color: #cfcfd2; }

/* Radios and checkboxes: large, accent-coloured, glove-friendly. */
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 24px; height: 24px; flex: none; margin: 0; }
.floor label.check.card { cursor: pointer; padding: 16px 18px; }
.floor label.check.card:has(input:checked) { border-color: var(--accent); background: #1f1512; }

/* Cards and surfaces */
.card, .stat { box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.04); border-radius: 14px; }
.floor .card, .floor .panel, .floor .tile { box-shadow: none; }
.stat:hover { border-color: var(--dim); }
.main h1 { font-size: 28px; letter-spacing: -.03em; }
.page-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
table.t th { background: var(--surface-2); }
table.t tr:last-child td { border-bottom: 0; }
table.t a { text-decoration: none; font-weight: 600; }
table.t a:hover { text-decoration: underline; }

/* Console sidebar: clear active item */
.side a.on { box-shadow: inset 3px 0 0 var(--accent); }
.side .brand { font-size: 12px; }

/* Login */
.login .btn-block { margin-top: 8px; min-height: 52px; }

/* Floor tiles: built tiles stand out, upcoming ones recede */
.tile.live { border-color: #3a3a40; background: linear-gradient(180deg, #1b1b1f, #151517); }
.tile.live::after { content: "›"; align-self: flex-end; font-size: 28px; color: var(--accent); line-height: 1; margin-top: -24px; }
.tile:active { transform: translateY(1px); }
.tile.soon { opacity: .45; }
.topbar .brand { font-size: 12px; }
.floor input[type=text], .floor input[type=search], .floor input[type=number], .floor select { background: var(--surface-2); min-height: 56px; font-size: 20px; }
.floor label { font-size: 15px; }
.keypad button:active { background: var(--accent); color: #fff; }
.hh .acts .btn:first-child { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* Phase 1 */
.sortrow { display: grid; grid-template-columns: 54px 54px 1.4fr 1.2fr 140px 110px 150px; gap: 10px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sortrow .handle { touch-action: none; cursor: grab; font-size: 26px; color: var(--dim); text-align: center; user-select: none; }
.sortrow.dragging { outline: 2px solid var(--accent); position: relative; z-index: 2; }
.sortrow [data-pri] { font-family: var(--mono); font-size: 26px; font-weight: 700; }
.steps { display: flex; gap: 4px; }
.steps span { flex: 1; height: 10px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--ok); } .steps span.running { background: var(--accent); } .steps span.paused { background: var(--warn); }
.queue .step { padding: 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: var(--surface); }
.queue .step.running { border-color: var(--accent); }
.msg { padding: 10px 0; border-bottom: 1px solid var(--line); }
.msg .who { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--dim); }
.msg.admin .who { color: var(--accent); }
.big-number { font-family: var(--mono); font-size: 48px; line-height: 1; }
@media (max-width: 900px) { .sortrow { grid-template-columns: 44px 40px 1fr 1fr; } .sortrow .hide-sm { display: none; } }
