:root {
  --navy: #14213d;
  --navy-2: #22335c;
  --amber: #fca311;
  --amber-soft: #fff4dd;
  --bg: #f2f3f6;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #8a93a3;
  --line: #e3e6ec;
  --blue: #2563eb;
  --blue-soft: #e6eefe;
  --green: #15803d;
  --green-soft: #e3f6e9;
  --red: #c62828;
  --red-soft: #fde8e8;
  --slate-soft: #eceef3;
  --radius: 14px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, 'Roboto Mono', monospace;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.mono { font-family: var(--mono); letter-spacing: .01em; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { width: 34px; height: 34px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: var(--amber); font-weight: 700; letter-spacing: .12em; font-size: 11px; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.role-badge { background: var(--navy-2); padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.sync-pill {
  border: 0; border-radius: 999px; padding: 5px 11px; font-size: 13px; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; display: inline-flex; align-items: center; gap: 6px;
}
.sync-pill::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.sync-pill.off::before { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.25); }
.sync-pill.pending::before { background: var(--amber); }
.lang { display: inline-flex; background: rgba(255,255,255,.1); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: none; color: #cbd5e1; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; }
.lang button.on { background: #fff; color: var(--navy); }

main { padding: 16px max(16px, env(safe-area-inset-left)) 48px; max-width: 1400px; margin: 0 auto; }

/* ---------- generic ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card > h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 16px; align-items: start; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 140px; }
.spacer { flex: 1; }
.fld { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 12px; }
select, input[type=text], input[type=password], input[type=number], input[type=date], input[type=search] {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 16px; color: var(--ink);
}
select:focus, input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 16px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 650; font-size: 15px; white-space: nowrap;
}
.btn:hover { border-color: #c9ced8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.go { background: var(--green); border-color: var(--green); color: #fff; }
.btn.warn { background: var(--amber); border-color: var(--amber); color: var(--navy); }
.btn.danger { color: var(--red); border-color: #f3c5c5; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.xl { min-height: 64px; font-size: 18px; padding: 14px 22px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 18px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); }
.icon-btn:hover { background: var(--slate-soft); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--slate-soft); color: var(--ink-2); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: #9a5b00; }
.chip.navy { background: var(--navy); color: #fff; }
.empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.kbd { font-family: var(--mono); font-size: 12px; background: var(--slate-soft); padding: 2px 6px; border-radius: 5px; color: var(--ink-2); }

/* ---------- home ---------- */
.home { max-width: 820px; margin: 5vh auto 0; text-align: center; }
.home h1 { font-size: 26px; margin-bottom: 22px; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 32px 20px;
  border-radius: 18px; border: 2px solid var(--line); background: #fff; cursor: pointer; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .08s, border-color .1s;
}
.role-card:hover, .role-card:focus { border-color: var(--navy); transform: translateY(-2px); outline: none; }
.role-card .ico { font-size: 44px; }
.role-card b { font-size: 22px; }
.role-card span { color: var(--ink-2); }
.role-card code { font-family: var(--mono); background: var(--slate-soft); padding: 2px 8px; border-radius: 6px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; }
.tabs a {
  padding: 10px 16px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 650; white-space: nowrap;
  background: #fff; border: 1.5px solid var(--line);
}
.tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs .badge { background: var(--amber); color: var(--navy); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 6px; }

/* ---------- scan inputs ---------- */
.scan-row { display: flex; gap: 8px; }
.scan-row input { flex: 1; }
input.scan { font-family: var(--mono); font-size: 19px; min-height: 56px; border-width: 2px; text-transform: uppercase; }
input.scan.huge { font-size: 24px; min-height: 68px; }
input.scan::placeholder { text-transform: none; font-family: system-ui, sans-serif; font-size: 16px; }
.cam-btn { min-width: 56px; font-size: 22px; }
.flash-ok { animation: flashok .5s; }
.flash-err { animation: flasherr .5s; }
@keyframes flashok { 0% { box-shadow: 0 0 0 6px rgba(21,128,61,.45); } 100% { box-shadow: none; } }
@keyframes flasherr { 0%, 60% { box-shadow: 0 0 0 6px rgba(198,40,40,.5); background: var(--red-soft); } 100% { box-shadow: none; } }

/* ---------- dispatch ---------- */
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; width: 100%; }
.seg button { flex: 1; min-height: 46px; border: 0; background: #fff; cursor: pointer; font-weight: 700; }
.seg button.on { background: var(--navy); color: #fff; }
.binlist { list-style: none; margin: 12px 0 0; padding: 0; max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; counter-reset: n; }
.binlist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); counter-increment: n; }
.binlist li:last-child { border-bottom: 0; }
.binlist li::before { content: counter(n); width: 26px; color: var(--ink-3); font-size: 12px; text-align: right; }
.binlist li .code { font-family: var(--mono); font-weight: 650; font-size: 16px; }
.binlist li.new { animation: flashok .6s; }
.binlist li .warn { color: #9a5b00; font-size: 12px; }
.dispatch-foot { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.dispatch-foot .btn.primary { flex: 1; }
.count-big { font-size: 13px; background: var(--navy); color: #fff; padding: 2px 10px; border-radius: 999px; }

/* ---------- live board ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filters { display: inline-flex; gap: 6px; }
.filters button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 650; }
.filters button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.cart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.cart-card {
  background: #fff; border: 1.5px solid var(--line); border-left: 6px solid var(--ink-3); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; box-shadow: var(--shadow); text-align: left; width: 100%;
}
.cart-card:hover { border-color: #c5cbd6; }
.cart-card.s-in_progress { border-left-color: var(--blue); }
.cart-card.s-done { border-left-color: var(--green); }
.cart-card.s-cancelled { border-left-color: #bbb; opacity: .7; }
.cart-card.stale { border-left-color: var(--amber); background: linear-gradient(0deg, #fff, var(--amber-soft)); }
.cc-top { display: flex; align-items: center; gap: 8px; }
.cc-top .who { font-size: 18px; font-weight: 750; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-sub { color: var(--ink-2); font-size: 13px; margin: 2px 0 10px; }
.bar { height: 10px; background: var(--slate-soft); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 999px; transition: width .4s; }
.s-done .bar i { background: var(--green); }
.cc-prog { display: flex; justify-content: space-between; font-size: 13px; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.cc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; }
.cc-meta div span { color: var(--ink-3); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.cc-meta div b { font-variant-numeric: tabular-nums; }
.cc-aisles { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.stale-note { margin-top: 8px; font-size: 12px; font-weight: 700; color: #9a5b00; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; background: #fafbfc; position: sticky; top: 0; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f7f9fc; }
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 60vh; }
.section-gap { margin-top: 18px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; width: min(480px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .btn { flex: 1 1 140px; }
video.cam { width: 100%; border-radius: 12px; background: #000; max-height: 60vh; }
.detail-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.detail-head div { background: #f7f8fa; border-radius: 10px; padding: 8px 10px; }
.detail-head > div > span { display: block; font-size: 11px; text-transform: uppercase; color: var(--ink-3); font-weight: 700; letter-spacing: .04em; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.detail-actions select { width: auto; min-width: 180px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 650; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: opacity .3s, transform .3s; }
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
.toast.warn { background: var(--amber); color: var(--navy); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.plist { list-style: none; padding: 0; margin: 10px 0 0; }
.plist li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plist li b { flex: 1; }
.plist li.off b { color: var(--ink-3); text-decoration: line-through; }
.loc-example { font-family: var(--mono); background: var(--slate-soft); padding: 8px 10px; border-radius: 8px; margin-top: 4px; }

/* ---------- operator ---------- */
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.name-grid button { min-height: 72px; font-size: 19px; font-weight: 750; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.name-grid button:hover, .name-grid button:focus { border-color: var(--navy); outline: none; }
.op-hello { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.op-hello h1 { font-size: 22px; }
.op-cart {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 2px solid var(--line);
  width: 100%; text-align: left; cursor: pointer; margin-bottom: 10px; box-shadow: var(--shadow);
}
.op-cart:hover { border-color: var(--navy); }
.op-cart .big { font-size: 20px; font-weight: 800; }
.op-cart .grow { flex: 1; min-width: 0; }
.op-cart .pct { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

.work-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 14px;
}
.work-head .btn { min-height: 40px; }
.work-head .t1 { font-size: 20px; font-weight: 800; }
.work-head .t2 { color: #cbd5e1; font-size: 13px; }
.work-head .prog { margin-left: auto; text-align: right; }
.work-head .prog b { font-size: 26px; font-variant-numeric: tabular-nums; }
.work-head .bar { background: rgba(255,255,255,.18); width: 180px; margin-top: 4px; }
.work-head .bar i { background: #4ade80; }
.start-banner { text-align: center; padding: 22px; margin-bottom: 14px; border: 2px dashed var(--amber); background: var(--amber-soft); border-radius: 14px; }
.prompt { font-size: 18px; font-weight: 750; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prompt .step { background: var(--navy); color: #fff; border-radius: 999px; width: 28px; height: 28px; display: inline-grid; place-items: center; font-size: 14px; }
.prompt.loc .step { background: var(--amber); color: var(--navy); }
.prompt .code { font-family: var(--mono); background: var(--amber-soft); padding: 2px 8px; border-radius: 6px; }
.quick-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quick-row .btn { flex: 1 1 200px; justify-content: flex-start; font-weight: 600; }
.quick-row .btn .mono { font-weight: 750; }
.picker { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.picker h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.pk-label { font-size: 12px; font-weight: 700; color: var(--ink-3); margin: 10px 0 5px; text-transform: uppercase; letter-spacing: .04em; }
.pk-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-btns button { min-width: 52px; min-height: 44px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-family: var(--mono); font-weight: 750; cursor: pointer; font-size: 15px; }
.pk-btns button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pk-btns.upper button.on { background: #6b21a8; border-color: #6b21a8; }
.stepper { display: flex; gap: 6px; align-items: stretch; max-width: 320px; }
.stepper button { min-width: 52px; font-size: 20px; font-weight: 800; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.stepper input { text-align: center; font-family: var(--mono); font-size: 22px; font-weight: 800; }
.pk-preview { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pk-preview .mono { font-size: 22px; font-weight: 800; background: var(--slate-soft); padding: 8px 12px; border-radius: 10px; flex: 1 1 260px; text-align: center; }
.op-bins { position: relative; list-style: none; padding: 0; margin: 0; max-height: 70vh; overflow: auto; }
.op-bins li {
  flex-wrap: wrap; row-gap: 2px;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: #fff;
}
.op-bins li .code { font-family: var(--mono); font-weight: 750; font-size: 16px; white-space: nowrap; }
.op-bins li .loc { margin-left: auto; white-space: nowrap; font-family: var(--mono); font-size: 13px; color: var(--green); font-weight: 700; text-align: right; }
.op-bins li.placed { background: var(--green-soft); border-color: #bfe5cb; }
.op-bins li.issue { background: var(--red-soft); border-color: #f3c5c5; }
.op-bins li.issue .loc { color: var(--red); }
.op-bins li.sel { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(252,163,17,.35); }
.op-bins li .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-3); flex: none; }
.op-bins li.placed .dot { background: var(--green); border-color: var(--green); }
.op-bins li.issue .dot { background: var(--red); border-color: var(--red); }
.finish-bar { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.finish-bar .btn.xl { flex: 1 1 260px; }

.grid-oplist { grid-template-columns: 1fr minmax(260px, 360px); }
.grid-work { grid-template-columns: minmax(300px, 1.2fr) minmax(260px, 1fr); }

/* operator home (scan to open cart) */
.op-home { max-width: 760px; margin: 2vh auto 0; }
.scan-hero { text-align: center; padding: 28px 20px; border: 2px solid var(--navy); }
.scan-hero .hero-ico { font-size: 52px; line-height: 1; }
.scan-hero h1 { font-size: 24px; margin: 10px 0 6px; }
.scan-hero p { margin: 0 auto 16px; max-width: 520px; }
.own-cart { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.own-cart > div { flex: 1 1 260px; }
.own-cart h2 { font-size: 16px; margin-bottom: 4px; }

/* PIN pad */
.login { max-width: 420px; margin: 4vh auto 0; text-align: center; }
.login h1 { font-size: 22px; margin: 8px 0 4px; }
.login .lock { font-size: 44px; }
.pin { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pin-dots { display: flex; gap: 16px; margin: 8px 0 2px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--navy); transition: background .1s; }
.pin-dots i.on { background: var(--navy); }
.pin-msg { min-height: 1.3em; color: var(--red); font-weight: 700; }
.pin-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pin-keys button { height: 64px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 24px; font-weight: 750; cursor: pointer; }
.pin-keys button:active { background: var(--slate-soft); }
.pin-keys .pin-aux { font-size: 18px; color: var(--ink-2); }
.pin.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-warn { margin: 0 0 12px; padding: 10px 12px; background: var(--red-soft); color: var(--red); border-radius: 10px; font-weight: 650; }
.mgr-bar { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.mgr-bar .who { font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tabs-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs-row .tabs { margin-bottom: 0; }
.tbl td.chk, .tbl th.chk { width: 36px; }
.tbl input[type=checkbox] { width: 20px; height: 20px; }

@media (max-width: 860px) {
  .grid2, .grid-oplist, .grid-work { grid-template-columns: 1fr; }
  .work-head .prog { margin-left: 0; text-align: left; width: 100%; }
  .work-head .bar { width: 100%; }
  .brand small { display: none; }
}
@media (max-width: 520px) {
  .role-badge { display: none; }
  .brand b { font-size: 14px; }
}
.plist li { flex-wrap: wrap; }
#s-mg-list li b { flex: 1 1 100%; }
#s-mg-list li .btn { flex: 1 1 auto; }
.login-alt { max-width: 420px; margin: 14px auto 0; }
a.btn { text-decoration: none; color: var(--ink); }

/* =====================================================================
   Returns NYC1 — additions on top of the Putaway Tracker stylesheet
   ===================================================================== */
.home-ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.home-ico:hover { background: rgba(255,255,255,.2); }
.home-ico svg { width: 20px; height: 20px; }
.tabs a.ext { border-style: dashed; }
.chip.purple { background: #f1e8fb; color: #6b21a8; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.pause { background: #f1e8fb; border-color: #dcc6f3; color: #6b21a8; }
.warnbox { padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: #7a4a00; font-weight: 650; margin: 0 0 12px; }
.infobox { padding: 10px 12px; border-radius: 10px; background: var(--blue-soft); color: #1e40af; font-weight: 600; margin: 0 0 12px; }
.errbox { padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 650; margin: 0 0 12px; }

/* ---------- live board: alerts ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  box-shadow: var(--shadow); cursor: pointer; text-align: left; width: 100%; font-weight: 600; }
.alert .ai { font-size: 20px; flex: none; }
.alert .at { flex: 1; min-width: 0; }
.alert .at small { display: block; color: var(--ink-3); font-weight: 600; }
.alert .aw { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.alert.stale { border-color: #f5c46b; background: var(--amber-soft); }
.alert.break { border-color: #dcc6f3; background: #f8f2fe; }
.alert.late { border-color: #f3c5c5; background: var(--red-soft); }
.alert.done { border-color: #bfe5cb; background: var(--green-soft); }
.alert.wait { border-color: #c9d8fb; background: var(--blue-soft); }
.alerts-none { color: var(--ink-3); font-weight: 600; padding: 4px 2px 12px; }
.cart-card.s-paused { border-left-color: #8b5cf6; }
.cart-card.brk { background: linear-gradient(0deg, #fff, #f8f2fe); }
.pause-note { margin-top: 8px; font-size: 12px; font-weight: 700; color: #6b21a8; }
.cc-skus { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.cc-skus .chip { font-family: var(--mono); font-weight: 650; }
.tbl tr.click td:first-child b { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.dot-st { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--ink-3); }
.dot-st.on { background: var(--green); } .dot-st.brk { background: #8b5cf6; } .dot-st.stale { background: var(--amber); }
textarea.batch { width: 100%; min-height: 150px; font-family: var(--mono); font-size: 13px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; resize: vertical; }

/* ---------- assign ---------- */
.draft-list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; max-height: 46vh; overflow: auto; }
.draft-list li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.draft-list li:last-child { border-bottom: 0; }
.draft-list li .grow { flex: 1; min-width: 0; }
.draft-list li .code { font-family: var(--mono); font-weight: 700; }
.draft-list li .sub { font-size: 13px; color: var(--ink-2); }
.draft-list li .warn { color: #9a5b00; font-size: 12px; font-weight: 700; }
.draft-list li.new { animation: flashok .6s; }
.stops-preview { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.stops-preview .mono { font-weight: 700; color: var(--ink); }
.seg.wrap { flex-wrap: wrap; }
.sku-table td .btn { min-height: 34px; padding: 4px 10px; }

/* ---------- operator: SKU Finder ---------- */
.stop-card { border: 3px solid var(--navy); }
.stop-card .lbl { font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.stop-card .where { font-family: var(--mono); font-size: 30px; font-weight: 850; line-height: 1.15; margin: 4px 0; word-break: break-all; }
.stop-card .pal { font-family: var(--mono); font-size: 22px; font-weight: 800; color: #1e40af; word-break: break-all; }
.stop-card.locked { border-color: var(--green); }
.stop-lines { list-style: none; margin: 12px 0 0; padding: 0; }
.stop-lines li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.stop-lines li .grow { flex: 1; min-width: 0; }
.stop-lines li .code { font-family: var(--mono); font-weight: 800; font-size: 16px; word-break: break-all; }
.stop-lines li .nm { font-size: 13px; color: var(--ink-2); }
.stop-lines li .cnt { font-size: 22px; font-weight: 850; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stop-lines li.ok { background: var(--green-soft); border-color: #bfe5cb; }
.stop-lines li.over { background: var(--amber-soft); border-color: #f5c46b; }
.result { border-radius: 14px; padding: 16px; margin: 12px 0; font-weight: 750; }
.result .big { font-size: 26px; font-weight: 900; letter-spacing: .02em; }
.result.ok { background: var(--green); color: #fff; }
.result.bad { background: var(--red); color: #fff; }
.result.warn { background: var(--amber); color: var(--navy); }
.result .mono { font-size: 18px; }
.op-stops { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; }
.op-stops li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: #fff; }
.op-stops li .grow { flex: 1; min-width: 0; }
.op-stops li .loc { font-family: var(--mono); font-weight: 800; }
.op-stops li .pl { font-family: var(--mono); font-size: 13px; color: var(--ink-2); word-break: break-all; }
.op-stops li .cnt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.op-stops li.done { background: var(--green-soft); border-color: #bfe5cb; }
.op-stops li.part { background: var(--amber-soft); border-color: #f5c46b; }
.op-stops li.sel { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,33,61,.25); }
.op-stops li .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-3); flex: none; }
.op-stops li.done .dot { background: var(--green); border-color: var(--green); }
.op-stops li.part .dot { background: var(--amber); border-color: var(--amber); }
.paused-banner { text-align: center; padding: 26px 18px; margin-bottom: 14px; border: 2px dashed #8b5cf6; background: #f8f2fe; border-radius: 14px; }
.paused-banner .big { font-size: 24px; font-weight: 850; color: #6b21a8; margin-bottom: 6px; }
.op-hello b { font-size: 22px; }
.task-tile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: #fff; border: 2px solid var(--line);
  width: 100%; text-align: left; cursor: pointer; margin-bottom: 10px; box-shadow: var(--shadow); }
.task-tile:hover { border-color: var(--navy); }
.task-tile .grow { flex: 1; min-width: 0; }
.task-tile .big { font-size: 20px; font-weight: 850; }
.task-tile .pct { font-size: 24px; font-weight: 850; font-variant-numeric: tabular-nums; }
.task-tile.paused { border-color: #dcc6f3; background: #fbf8ff; }
.tmp-loc { display: inline-block; font-family: var(--mono); background: rgba(255,255,255,.2); padding: 2px 8px; border-radius: 6px; }

/* ---------- data upload ---------- */
.upl { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; background: #fafbfc; }
.upl.drag { border-color: var(--blue); background: var(--blue-soft); }
.upl input[type=file] { display: none; }
.progress { height: 10px; background: var(--slate-soft); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin: 8px 0; }
.kv span { color: var(--ink-3); font-weight: 650; }
.kv b { font-variant-numeric: tabular-nums; }

/* ---------- route builder + aisle audit (ported from v1) ---------- */
.tool-ops { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-ops button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 650; text-align: left; }
.tool-ops button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tool-ops button .vz { display: block; font-size: 12px; opacity: .75; }
.nota { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.vel { display: inline-block; font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--line); margin-left: 6px; }
.vel.A { background: #1e7a3e; color: #fff; border-color: #1e7a3e; }
.vel.B { background: var(--amber); color: #0e1116; border-color: var(--amber); }
.vel.C { background: #fff; color: var(--blue); }
.gfila { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.gfila:last-child { border-bottom: 0; }
.gfila .gn { flex: 1; min-width: 0; }
.gfila .gs { font-family: var(--mono); font-size: 13px; color: #5b6472; }
.sitio { font-size: 13px; color: #5b6472; margin-top: 2px; }
.sitio b { color: var(--ink); }
.tool-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tool-tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); padding: 6px 8px; border-bottom: 1.5px solid var(--line); }
.tool-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.viz { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; }
.viz .fila { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; margin: 0 0 10px; }
.viz .et { font-family: var(--mono); font-size: 14px; font-weight: 800; }
.viz .barra { display: flex; height: 26px; border-radius: 4px; overflow: hidden; background: var(--line); }
.viz .seg2 { height: 100%; font-size: 11px; font-weight: 800; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px #fff inset; }
.viz .seg2 + .seg2 { margin-left: 2px; }
.viz .s1 { background: var(--s1); } .viz .s2 { background: var(--s2); } .viz .s3 { background: var(--s3); }
.viz .leyenda { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 16px; font-size: 13px; }
.viz .leyenda span { display: flex; align-items: center; gap: 6px; }
.viz .pt { width: 12px; height: 12px; border-radius: 3px; flex: none; display: inline-block; }
.viz .tot { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.viz table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.viz th, .viz td { border-bottom: 1px solid var(--line); padding: 6px 8px; font-size: 13px; text-align: right; }
.viz th:first-child, .viz td:first-child { text-align: left; font-family: var(--mono); }
.print-sheets { display: none; }
.print-sheets h2 { margin: 18px 0 6px; font-size: 18px; }
.print-sheets table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.print-sheets th, .print-sheets td { border: 1px solid #999; padding: 5px 7px; font-size: 13px; text-align: left; }
.print-sheets th { background: #eee; color: #000; font-size: 11px; text-transform: uppercase; }
.print-sheets td.n { text-align: center; font-weight: 800; }
.print-sheets .mono { font-family: var(--mono); }
.print-sheets .hoja { page-break-after: always; }
.print-sheets .hoja:last-child { page-break-after: auto; }
.print-sheets .cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; border-bottom: 3px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
.print-sheets .tal { font-size: 26px; font-weight: 800; }
.print-sheets .avi { border: 2px solid #000; padding: 8px; margin: 10px 0; font-weight: 700; }
.print-sheets .pie { font-size: 11px; color: #444; margin-top: 8px; border-top: 1px solid #999; padding-top: 4px; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body.printing > *:not(main) { display: none !important; }
  body.printing main > *:not(#print-root) { display: none !important; }
  body.printing main { padding: 0; max-width: none; }
  body.printing #print-root, body.printing #print-root .print-sheets { display: block !important; }
  .print-sheets th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-sheets thead { display: table-header-group; }
  .print-sheets tr { page-break-inside: avoid; }
}
@media (max-width: 520px) {
  .stop-card .where { font-size: 24px; }
  .stop-card .pal { font-size: 18px; }
  .home-ico { width: 32px; height: 32px; }
}
/* Batch Move per operator */
.bop { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.bop-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.bop-head b { font-size: 16px; }
.bop details { margin-top: 6px; }
.bop summary { cursor: pointer; font-size: 13px; font-weight: 650; }
.bop textarea.batch { min-height: 110px; margin-top: 6px; }

.kbd-btn { opacity: .55; }
.kbd-btn.on { opacity: 1; background: var(--amber-soft); border-color: var(--amber); }
.bop-skus { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.bop-skus .chip.mono { font-family: var(--mono); font-weight: 650; }
/* Alerts fold to one line */
.alerts-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 0; margin: 0 0 8px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 750; color: var(--ink); text-align: left; }
.alerts-toggle .al-sum { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alerts-toggle .spacer { flex: 1; }
.alerts-toggle .caret { font-size: 14px; color: var(--ink-2); }
.alerts-more { background: none; border: 1.5px dashed var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 650; color: var(--ink-2); text-align: left; }
/* "B" = the task's pairs were already moved in Providence */
.cart-card { position: relative; }
.b-badge { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.b-badge.part { background: #fff; color: var(--red); border: 2px solid var(--red); }
/* Armar cajas */
.cajas-tile { width: 100%; border-color: #2f6fd6; background: #f2f7ff; }

/* v2.27 — SKU Finder on a handheld scanner: the scan box (prompt, field, last result, buttons) sticks at the top,
   so the result of every scan is always in view; the stop to go to and the routes scroll underneath.
   Laptop / tablet layout is untouched. */
#w-ruta-box.locked #w-ruta { opacity: .45; }
@media (max-width: 860px) {
  .work-sku .work-left { display: contents; }
  .work-sku #w-scan-card { order: -1; position: sticky; top: var(--topbar-h, 56px); z-index: 15; margin-top: 0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .18); padding: 10px 12px; }
  .work-sku #w-scan-card .prompt { font-size: 15px; margin-bottom: 6px; }
  .work-sku #w-scan-card .scan.huge { font-size: 20px; min-height: 48px; }
  .work-sku #w-scan-card .result { margin: 8px 0 4px; padding: 10px 12px; font-size: 14px; max-height: 32vh; overflow: auto; }
  .work-sku #w-scan-card .result .big { font-size: 19px; }
  .work-sku #w-scan-card .quick-row { margin-top: 6px; gap: 6px; }
  .work-sku #w-scan-card .quick-row .btn { flex: 1 1 calc(50% - 6px); min-height: 38px; font-size: 13px; padding: 6px 8px; }
  .work-sku #w-stop { margin-top: 12px; }
  .work-sku > .card, .work-sku #w-ruta-box { margin-top: 12px; }
}

/* v2.32: delivered to the aisles (green) above picked (blue) */
.bar.deliv { margin-bottom: 4px; }
.bar.deliv i, .s-done .bar.deliv i { background: var(--green); }
.cc-prog.deliv { margin: 0 0 6px; color: var(--green); }

/* v2.33: productivity report */
#rp-kind { display: inline-flex; gap: 4px; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-bar { display: inline-block; width: 90px; height: 8px; background: var(--slate-soft); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.rp-bar i { display: block; height: 100%; background: var(--blue); }
.rp-stack { display: flex; height: 10px; background: var(--slate-soft); border-radius: 999px; overflow: hidden; }
.rp-stack i { display: block; height: 100%; background: var(--green); }
.rp-stack i.asn, .rp-dot.asn { background: var(--blue); }
.rp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--green); vertical-align: middle; }
.rp-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-ctl > * { flex: 0 0 auto; width: auto; }
.rp-ctl .spacer { flex: 1 1 auto; }
.rp-ctl input[type=date] { min-height: 40px; }
.kpi.warn { border-color: #fecaca; background: #fff7f7; }
.kpi.warn b { color: var(--red); }
tr.muted td { opacity: .55; }
.tbl td .rp-stack { display: inline-flex; width: 80px; vertical-align: middle; }

/* v2.35: return loose pairs to the returns area */
.ret-list li { display: flex; align-items: center; gap: 10px; }
.ret-q { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ret-q input { width: 56px; text-align: center; font-size: 18px; min-height: 40px; }

/* v2.36: verified in Providence */
.b-badge.v { background: #eab308; color: #422006; border: 2px solid #ca8a04; }
.b-badge.bad { background: var(--red); color: #fff; }
.b-badge.second { right: 18px; }
.chip.verified { background: #fef9c3; color: #854d0e; border: 1px solid #eab308; font-weight: 700; }
/* v2.39: audit tasks */
.aud-line.sel { outline: 3px solid var(--blue, #2563eb); }
.aud-line.ok { border-left: 6px solid var(--green, #16a34a); }
.aud-line.no { border-left: 6px solid var(--red, #dc2626); }
#l-bc tr.sel td { background: #fef9c3; }

/* v2.43: audit count against Providence */
.aud-pv { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--slate-soft); font-size: 14px; }

/* v2.44: 🎓 demo copy (returns-demo.pages.dev) */
.demo-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 16px; background: #fef3c7; color: #78350f;
  border-bottom: 2px solid #f59e0b; font-size: 14px; position: sticky; top: var(--topbar-h, 56px); z-index: 20; }
.demo-bar span { flex: 1 1 260px; }
