/* Palletspire · warehouse inventory
   Order: tokens, base, shell, components, map, screens, documents, phone, print.
   Spacing is a 4 px scale (4 8 12 16 20 24 32 40 48). Radius: 3 / 5 / 8. Shadows only on floating layers. */

:root {
  --steel: #2F4A63; --steel-h: #263E54; --steel-d: #1E3244; --steel-ink: #2F4A63;
  --pale: #CFE0F0; --pale-2: #E6EEF6;
  --orange: #FF7A1A; --orange-ink: #A94700; --orange-soft: #FFE8D6; --on-orange: #1A1206;
  --bg: #ECECEA; --s1: #F6F6F4; --s2: #FFFFFF; --s3: #E5E5E1; --s4: #D9D9D4;
  --line: #D6D6D0; --line-2: #BCBCB5; --ink: #18222C; --ink-2: #3D4955; --ink-3: #56616C; --ink-4: #868D94;
  --ok: #22704A; --ok-bg: #DBEDE1; --ok-m: #3C9A68;
  --warn: #7E5A00; --warn-bg: #F5E8BC; --warn-m: #D3A112;
  --bad: #AD2719; --bad-bg: #F8DCD7; --bad-m: #D4483A;
  --info: #2F4A63; --info-bg: #DCE6F0;
  --f0: #F2F2EF; --f1: #CFE0F0; --f2: #92B2CF; --f3: #55799B; --f4: #2F4A63;
  --bar: #1B2B3A; --bar-2: #263A4D; --bar-ink: #EAF0F5; --bar-ink-2: #A8B8C7;
  --floor: #F4F4F1; --floor-grid: #E6E6E1; --wall: #3D4955;
  --focus: #2A6AAE;
  --r1: 3px; --r2: 5px; --r3: 8px;
  --sh-pop: 0 14px 36px rgba(18, 30, 42, .22), 0 2px 6px rgba(18, 30, 42, .10);
  --f: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fc: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --t: 160ms cubic-bezier(.2, .7, .3, 1);
  --bar-h: 56px;
  color-scheme: light;
}
[data-theme="dark"] {
  --steel: #4A7096; --steel-h: #557CA3; --steel-d: #3C5F82; --steel-ink: #9DC1E3;
  --pale: #22374B; --pale-2: #1A2B3B;
  --orange: #FF7A1A; --orange-ink: #FF9E57; --orange-soft: #3B2515;
  --bg: #0F1418; --s1: #141A20; --s2: #192128; --s3: #212B34; --s4: #29343F;
  --line: #29333E; --line-2: #394553; --ink: #E4EAEF; --ink-2: #BAC5CF; --ink-3: #95A2AE; --ink-4: #6A7682;
  --ok: #72C89A; --ok-bg: #15301F; --ok-m: #3C9A68;
  --warn: #E5C054; --warn-bg: #322A0E; --warn-m: #C99A12;
  --bad: #F28E82; --bad-bg: #3A1A16; --bad-m: #D4483A;
  --info: #9DC1E3; --info-bg: #1B2E40;
  --f0: #1A222A; --f1: #233A50; --f2: #2F5476; --f3: #4675A0; --f4: #79A6D0;
  --bar: #0A0F13; --bar-2: #18232D; --bar-ink: #E4EAEF; --bar-ink-2: #93A3B2;
  --floor: #141B21; --floor-grid: #1C252D; --wall: #7E8C99;
  --focus: #86B6E6;
  --sh-pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/20px var(--f); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font: 600 28px/32px var(--fc); letter-spacing: .005em; }
h2 { font: 600 20px/26px var(--fc); }
h3 { font: 600 16px/22px var(--f); }
a { color: var(--steel-ink); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::placeholder { color: var(--ink-4); opacity: 1; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r1); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--s2); padding: 8px 12px; border-radius: var(--r2); }
.skip:focus { top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 22px; height: 22px; }
.tn, .n, .num { font-variant-numeric: tabular-nums lining-nums; }
.c { font-family: var(--fc); }
.muted { color: var(--ink-3); }
.small { font-size: 12px; line-height: 16px; }
.nowrap { white-space: nowrap; }
.noscript { padding: 40px; font-size: 16px; }
kbd, .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: var(--r1); background: var(--s2); font: 600 11px/1 var(--f); color: var(--ink-2); }
.demo-note { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.demo-note .i { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }

/* ---------- shell ---------- */
.app { min-height: 100vh; }
.bar { position: sticky; top: 0; z-index: 30; height: var(--bar-h); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid #0B141C; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex: none; }
.brand svg { width: 28px; height: 28px; }
.brand-n { font: 700 20px/1 var(--fc); letter-spacing: .02em; text-transform: uppercase; }
.site { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--bar-2); border-radius: var(--r1); background: transparent; color: var(--bar-ink-2); font: 600 13px/1 var(--fc); letter-spacing: .06em; text-transform: uppercase; flex: none; }
.site:hover { color: var(--bar-ink); border-color: #3B5268; }
.site b { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-m); }
.tabs { display: flex; align-items: stretch; height: 100%; margin-left: 4px; min-width: 0; }
.tabs a { position: relative; display: flex; align-items: center; gap: 6px; padding: 0 11px; color: var(--bar-ink-2); text-decoration: none; font: 600 15px/1 var(--fc); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.tabs a:hover { color: var(--bar-ink); }
.tabs a.on { color: #fff; }
.tabs a.on::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 0; height: 3px; background: #CFE0F0; }
.tabs .ct { font: 600 11px/16px var(--f); padding: 0 5px; border-radius: 8px; background: var(--bar-2); color: var(--bar-ink); }
.bar-r { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.find { display: flex; align-items: center; gap: 8px; height: 34px; width: 270px; padding: 0 8px 0 10px; border: 1px solid var(--bar-2); border-radius: var(--r1); background: #22354A; color: var(--bar-ink-2); text-align: left; }
[data-theme="dark"] .find { background: var(--bar-2); }
.find span { flex: 1; font-size: 13px; }
.find kbd { background: transparent; border-color: #445A70; color: var(--bar-ink-2); }
.find:hover { border-color: #46607A; color: var(--bar-ink); }
.ib { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: var(--r1); background: transparent; color: inherit; }
.bar .ib { color: var(--bar-ink-2); }
.bar .ib:hover { color: var(--bar-ink); background: var(--bar-2); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #3B5268; background: var(--bar-2); color: var(--bar-ink); font: 600 13px/1 var(--fc); letter-spacing: .04em; }
.bar-title { display: none; }
.ph-only { display: none !important; }
.ct:empty { display: none; }
.main { display: block; outline: none; }
.page { max-width: 1680px; margin: 0 auto; padding: 24px 28px 48px; }
.page.flush { padding-bottom: 24px; }
.tabbar { display: none; }

/* ---------- page head ---------- */
.ph { display: flex; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.ph-t { flex: 1 1 420px; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--ink-3); font: 600 12px/16px var(--fc); letter-spacing: .1em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--steel); }
.ph-sub { margin-top: 6px; color: var(--ink-2); }
.ph-a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.metrics { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 10px; }
.metric { display: flex; align-items: baseline; gap: 6px; color: var(--ink-3); font-size: 13px; }
.metric b { color: var(--ink); font: 600 22px/26px var(--fc); font-variant-numeric: tabular-nums; }
.metric.warn b { color: var(--warn); } .metric.bad b { color: var(--bad); }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.subtabs a, .subtabs button { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink-3); font: 600 15px/20px var(--fc); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.subtabs a:hover, .subtabs button:hover { color: var(--ink); }
.subtabs .on { color: var(--ink); border-bottom-color: var(--steel); }
.ct { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--s3); color: var(--ink-2); font: 600 12px/18px var(--f); text-align: center; letter-spacing: 0; }
.on > .ct, .ct.hot { background: var(--steel); color: #fff; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }

/* ---------- buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r1); font: 600 14px/1 var(--f); white-space: nowrap; text-decoration: none; transition: background var(--t), border-color var(--t), color var(--t); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.btn-p { background: var(--steel); color: #fff; }
.btn-p:hover:not(:disabled) { background: var(--steel-h); }
.btn-s { background: var(--s2); border-color: var(--line-2); color: var(--ink); }
.btn-s:hover:not(:disabled) { background: var(--s1); border-color: var(--ink-3); }
.btn-q { background: transparent; color: var(--ink-2); padding: 0 10px; }
.btn-q:hover:not(:disabled) { background: var(--s3); color: var(--ink); }
.btn-d { background: var(--s2); border-color: var(--bad-m); color: var(--bad); }
.btn-d:hover:not(:disabled) { background: var(--bad-bg); }
.btn-dd { background: var(--bad); color: #fff; }
[data-theme="dark"] .btn-dd { background: #B3352A; }
.btn-o { background: var(--orange); color: var(--on-orange); }
.btn-o:hover:not(:disabled) { background: #FF8B37; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 16px; }
.btn-xl { height: 64px; padding: 0 24px; font: 700 22px/1 var(--fc); letter-spacing: .03em; text-transform: uppercase; }
.btn-block { width: 100%; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin .7s linear infinite; }
.btn-s.is-loading::after, .btn-q.is-loading::after { border-color: var(--ink-2) var(--ink-2) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkish { border: 0; background: none; padding: 0; color: var(--steel-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.why { display: block; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.why .i { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }

/* ---------- form ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl-t { font: 600 13px/18px var(--f); color: var(--ink-2); }
.field .opt { font-weight: 400; color: var(--ink-3); }
.inp, .sel, textarea.inp { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--s2); color: var(--ink); font-size: 14px; transition: border-color var(--t), box-shadow var(--t); }
textarea.inp { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 20px; }
.sel { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.inp:hover, .sel:hover { border-color: var(--ink-3); }
.inp:focus, .sel:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.inp.bad, .sel.bad { border-color: var(--bad-m); background: color-mix(in srgb, var(--bad-bg) 45%, var(--s2)); }
.inp.sm, .sel.sm { height: 32px; font-size: 13px; }
.inp.n { text-align: right; }
.help { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.err { display: flex; gap: 6px; font-size: 12.5px; line-height: 17px; color: var(--bad); }
.err .i { width: 15px; height: 15px; margin-top: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.search { position: relative; display: flex; align-items: center; min-width: 220px; }
.search .i { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.search .inp { padding-left: 34px; }
.search .clear { position: absolute; right: 4px; width: 30px; height: 30px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; border-radius: var(--r1); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--steel); margin: 0; }
.switch { position: relative; width: 40px; height: 22px; flex: none; border-radius: 11px; border: 0; background: var(--s4); transition: background var(--t); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform var(--t); }
.switch[aria-checked="true"] { background: var(--steel); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.field > .stepper, .field > .bigstep { align-self: flex-start; }
.stepper { display: inline-flex; align-items: stretch; height: 38px; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--s2); overflow: hidden; }
.stepper button { width: 36px; border: 0; background: var(--s1); color: var(--ink-2); display: grid; place-items: center; }
.stepper button:hover { background: var(--s3); color: var(--ink); }
.stepper input { width: 64px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; text-align: center; font: 600 16px/1 var(--fc); font-variant-numeric: tabular-nums; }
.stepper input:focus { outline: none; background: var(--pale-2); }
.stepper.sm { height: 32px; } .stepper.sm button { width: 30px; } .stepper.sm input { width: 52px; font-size: 15px; }

/* ---------- chips, segmented, tags, plates ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--s2); color: var(--ink-2); font: 500 13px/1 var(--f); white-space: nowrap; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--steel); border-color: var(--steel); color: #fff; }
.chip.on .ct { background: rgba(255,255,255,.2); color: #fff; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r2); background: var(--s1); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: var(--r1); background: none; color: var(--ink-3); font: 600 13px/1 var(--fc); letter-spacing: .06em; text-transform: uppercase; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--s2); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2), var(--sh1, 0 1px 2px rgba(0,0,0,.08)); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; border-radius: 2px; background: var(--s3); color: var(--ink-2); font: 600 12px/1 var(--fc); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; opacity: .85; }
.tag.plain::before { display: none; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.orange { background: var(--orange-soft); color: var(--orange-ink); }
.tag.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.plate { display: inline-flex; align-items: stretch; height: 22px; border: 1px solid var(--ink-2); border-radius: 2px; background: var(--s2); color: var(--ink); font: 700 13px/20px var(--fc); letter-spacing: .05em; white-space: nowrap; overflow: hidden; vertical-align: middle; text-decoration: none; }
.plate > span { padding: 0 5px; }
.plate .lv { background: var(--ink-2); color: var(--s2); padding: 0 5px; }
.plate.stage { border-style: dashed; }
.plate.stage .lv { display: none; }
a.plate:hover, button.plate:hover { border-color: var(--steel-ink); }
button.plate { padding: 0; cursor: pointer; }
.plate.hl { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-soft); }
.plate.lg { height: 34px; font-size: 22px; line-height: 32px; } .plate.lg > span { padding: 0 9px; }
.plate.xl { height: 72px; border-width: 2px; font-size: 56px; line-height: 68px; } .plate.xl > span { padding: 0 14px; }
.code { font: 600 14px/1 var(--fc); letter-spacing: .05em; color: var(--ink-2); white-space: nowrap; }
.code.lg { font-size: 18px; }

/* ---------- panels, tables, lists ---------- */
.panel { background: var(--s2); border: 1px solid var(--line); border-radius: var(--r2); min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.panel-h h2, .panel-h h3 { flex: 1; font: 600 15px/20px var(--fc); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.panel-b { padding: 16px; }
.panel-f { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.sheet-t { font: 600 15px/20px var(--fc); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.tbl-wrap { background: var(--s2); border: 1px solid var(--line); border-radius: var(--r2); overflow: clip; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 18px; }
.tbl th { position: sticky; top: var(--bar-h); z-index: 2; height: 36px; padding: 0 12px; background: var(--s1); border-bottom: 1px solid var(--line-2); color: var(--ink-3); font: 600 12.5px/1 var(--fc); letter-spacing: .08em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.tbl.in-panel th { position: static; }
.tbl td { height: 42px; padding: 6px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl th.n { text-align: right; }
.tbl .w0 { width: 1%; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--s1); }
.tbl tr.sel td { background: var(--pale-2); }
.tbl tfoot td { position: sticky; bottom: 0; background: var(--s1); border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 600; }
.t-name { font-weight: 500; color: var(--ink); }
.t-sub { display: block; color: var(--ink-3); font-size: 12px; line-height: 16px; }
.tbl.compact td { height: 36px; padding: 4px 10px; }
.tbl.compact th { padding: 0 10px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.rows > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 48px; }
.li-main { flex: 1; min-width: 0; }
.li-t, .li-s { display: block; }
.li-t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-s { color: var(--ink-3); font-size: 12.5px; line-height: 17px; }
button.li, a.li { width: 100%; border: 0; background: none; text-align: left; color: inherit; text-decoration: none; }
button.li:hover, a.li:hover { background: var(--s1); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; text-align: right; font-weight: 500; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--s1); color: var(--ink-3); font-size: 13px; }
.pager .btns { display: flex; gap: 6px; }
.meter { position: relative; height: 6px; border-radius: 1px; background: var(--s3); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--steel); }
.meter.warn i { background: var(--warn-m); } .meter.bad i { background: var(--bad-m); } .meter.ok i { background: var(--ok-m); }
.meter.lg { height: 10px; }
.gauge { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; height: 14px; }
.gauge i { background: var(--s3); }
.gauge i.on { background: var(--f3); }
.gauge.hot i.on { background: var(--warn-m); }

/* ---------- empty, skeleton, error ---------- */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 32px; max-width: 520px; }
.empty svg.art { width: 120px; height: 72px; margin-bottom: 4px; color: var(--ink-4); }
.empty h3 { font: 600 18px/24px var(--fc); letter-spacing: .02em; }
.empty p { color: var(--ink-3); }
.empty .btn { margin-top: 8px; }
.center-empty { align-items: center; text-align: center; margin: 0 auto; }
.sk { display: block; height: 12px; border-radius: 2px; background: var(--s3); animation: pulse 1.1s ease-in-out infinite; }
.sk-row { display: flex; gap: 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
@keyframes pulse { 50% { opacity: .45; } }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-left: 4px solid var(--steel); border-radius: var(--r1); background: var(--s2); }
.alert.bad { border-left-color: var(--bad-m); background: color-mix(in srgb, var(--bad-bg) 55%, var(--s2)); }
.alert.warn { border-left-color: var(--warn-m); background: color-mix(in srgb, var(--warn-bg) 55%, var(--s2)); }
.alert.ok { border-left-color: var(--ok-m); }
.alert b { display: block; }
.alert p { color: var(--ink-2); font-size: 13px; }
.alert .acts { margin-left: auto; display: flex; gap: 8px; flex: none; }

/* ---------- tooltips (short labels for icon buttons and terse tags) ---------- */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 90; padding: 5px 8px; border-radius: var(--r1); background: #16232F; color: #EEF3F7; font: 500 12px/16px var(--f); letter-spacing: 0; text-transform: none; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--t); }
[data-theme="dark"] [data-tip]::after { background: #E4EAEF; color: #12202C; }
[data-tip].tip-l::after { left: auto; right: 0; transform: none; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transition-delay: .35s; }
@media (hover: none) { [data-tip]::after { display: none; } }

/* ---------- floating: modal, sheet, menu, toast, palette ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(12, 20, 28, .48); animation: fade .14s ease-out; }
.modal { display: flex; flex-direction: column; width: 560px; max-width: 100%; max-height: calc(100vh - 48px); background: var(--s2); border-radius: var(--r3); box-shadow: var(--sh-pop); animation: rise .18s cubic-bezier(.2,.7,.3,1); overflow: hidden; }
.modal.wide { width: 860px; } .modal.xwide { width: 1080px; } .modal.narrow { width: 440px; }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-h h2 { flex: 1; font-size: 22px; line-height: 28px; }
.modal-h .sub { display: block; margin-top: 2px; font: 400 13px/18px var(--f); color: var(--ink-3); }
.modal-b { padding: 20px; overflow-y: auto; overflow-x: hidden; }
.modal-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--s1); flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }
.grab { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.pop { position: fixed; z-index: 70; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: var(--sh-pop); animation: fade .12s ease-out; }
.pop .mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: var(--r1); background: none; text-align: left; color: var(--ink); text-decoration: none; }
.pop .mi:hover, .pop .mi:focus-visible { background: var(--s3); }
.pop .mi[disabled] { color: var(--ink-4); cursor: not-allowed; }
.pop .mh { padding: 8px 10px 6px; font: 600 12px/16px var(--fc); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
#toasts { position: fixed; left: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 480px; padding: 12px 14px; border-radius: var(--r2); background: #16232F; color: #EEF3F7; box-shadow: var(--sh-pop); pointer-events: auto; animation: rise .16s ease-out; font-size: 14px; }
[data-theme="dark"] .toast { background: #E4EAEF; color: #12202C; }
.toast .i { color: #8FD3AE; } [data-theme="dark"] .toast .i { color: var(--ok); }
.toast.bad .i { color: #F2A196; }
.toast span { flex: 1; }
.toast button { border: 0; background: none; color: var(--pale); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 4px; }
[data-theme="dark"] .toast button { color: #1E4A73; }
.pal { width: 640px; }
.pal-back { place-items: start center; padding-top: 12vh; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in input { flex: 1; border: 0; background: none; font-size: 17px; outline: none; }
.pal-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.pal-g { padding: 10px 10px 4px; font: 600 12px/16px var(--fc); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pal-i { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: var(--r1); background: none; text-align: left; }
.pal-i .li-s { margin-left: auto; text-align: right; }
.pal-i.on { background: var(--pale-2); box-shadow: inset 3px 0 0 var(--steel); }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; background: var(--s1); }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 32px; }
.keys h4 { grid-column: 1 / -1; margin: 12px 0 4px; font: 600 13px/18px var(--fc); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.keys h4:first-child { margin-top: 0; }
.keys div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.keys span:last-child { display: flex; gap: 4px; }

/* ---------- map ---------- */
.map-card { position: relative; background: var(--floor); border: 1px solid var(--line-2); border-radius: var(--r2); overflow: hidden; }
.map-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--s2); }
.map-tools .search { flex: 1 1 280px; max-width: 420px; }
svg.map { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.map .m-grid { stroke: var(--floor-grid); stroke-width: 1; }
.map .m-wall { fill: none; stroke: var(--wall); stroke-width: 3; }
.map .m-zone { fill: var(--s2); stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 4 3; }
.map .m-zone.qa { fill: url(#hatch); }
.map .m-zone.hit { stroke: var(--orange); stroke-width: 2; stroke-dasharray: none; fill: var(--orange-soft); }
.map .m-zt { fill: var(--ink-3); font: 600 12px var(--fc); letter-spacing: .08em; text-transform: uppercase; }
.map .m-zs { fill: var(--ink-3); font: 500 11px var(--f); }
.map .m-dock { fill: var(--s3); stroke: var(--wall); stroke-width: 1.5; }
.map .m-dock.busy { fill: var(--pale); }
.map .m-dt { fill: var(--ink-2); font: 700 12px var(--fc); letter-spacing: .04em; }
.map .m-rowl { fill: var(--ink); font: 700 18px var(--fc); }
.map .m-rowz { fill: var(--ink-3); font: 600 10.5px var(--fc); letter-spacing: .08em; text-transform: uppercase; }
.map .m-bayn { fill: var(--ink-3); font: 600 11px var(--fc); text-anchor: middle; }
.map .m-bay { fill: var(--s2); stroke: var(--line-2); stroke-width: 1; }
.map .m-slot { cursor: pointer; }
.map .m-slot rect.b { fill: var(--f0); stroke: var(--line-2); stroke-width: .8; transition: opacity var(--t); }
.map .m-slot rect.f { transition: opacity var(--t); }
.map .m-slot:hover rect.b { stroke: var(--ink); stroke-width: 1.4; }
.map .lv0 { fill: var(--f0); } .map .lv1 { fill: var(--f1); } .map .lv2 { fill: var(--f2); } .map .lv3 { fill: var(--f3); } .map .lv4 { fill: var(--f4); }
.map .ag1 { fill: var(--f1); } .map .ag2 { fill: var(--f2); } .map .ag3 { fill: var(--warn-m); } .map .ag4 { fill: var(--bad-m); }
.map .ht1 { fill: var(--f1); } .map .ht2 { fill: var(--f2); } .map .ht3 { fill: var(--f3); } .map .ht4 { fill: var(--f4); }
.map .m-slot.blk rect.b { fill: url(#hatch-bad); }
.map.dim .m-slot:not(.hit) rect { opacity: .22; }
.map.dim .m-slot:not(.hit) rect.b { opacity: .5; }
.map .m-slot.hit rect.b { stroke: var(--orange); stroke-width: 2; }
.map .m-slot.hit rect.f { fill: var(--orange); }
.map .m-slot.src rect.b { stroke: var(--steel-ink); stroke-width: 2.2; }
.map .m-slot.sel rect.b { stroke: var(--ink); stroke-width: 2.6; }
.map .m-tick rect { fill: var(--orange); }
.map .m-tick text { fill: var(--on-orange); font: 700 11px var(--fc); text-anchor: middle; letter-spacing: .03em; }
.map .m-call rect { fill: var(--ink); } .map .m-call text { fill: var(--s2); font: 700 12px var(--fc); text-anchor: middle; letter-spacing: .04em; }
.map .m-aisle { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 10 8; }
.map .m-path { fill: none; stroke: var(--steel-ink); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.map .m-path.done { stroke: var(--ink-4); stroke-dasharray: 2 6; }
.map .m-move { fill: none; stroke: var(--orange); stroke-width: 3; stroke-dasharray: 7 5; }
.map .m-stop circle { fill: var(--s2); stroke: var(--steel-ink); stroke-width: 2; }
.map .m-stop text { fill: var(--steel-ink); font: 700 11px var(--fc); text-anchor: middle; }
.map .m-stop.done circle { fill: var(--steel-ink); } .map .m-stop.done text { fill: var(--s2); }
.map .m-stop.short circle { fill: var(--bad-m); stroke: var(--bad-m); } .map .m-stop.short text { fill: #fff; }
.map .m-stop.cur circle { fill: var(--orange); stroke: var(--on-orange); stroke-width: 2; }
.map .m-stop.cur text { fill: var(--on-orange); }
.map .m-start { fill: var(--ink); }
.map .m-bulk rect.b { fill: var(--f0); stroke: var(--line-2); }
.map .m-truck { fill: var(--steel-ink); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--s2); color: var(--ink-3); font-size: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px; border: 1px solid var(--line-2); }
.legend .sw0 { background: var(--f0); } .legend .sw1 { background: var(--f1); } .legend .sw2 { background: var(--f2); } .legend .sw3 { background: var(--f3); } .legend .sw4 { background: var(--f4); }
.legend .swa3 { background: var(--warn-m); } .legend .swa4 { background: var(--bad-m); } .legend .swo { background: var(--orange); border-color: var(--orange); }
.legend .swb { background: repeating-linear-gradient(45deg, var(--bad-m) 0 2px, transparent 2px 5px); }
.legend .sp { margin-left: auto; }
/* rack faces (elevation view) */
.faces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px; }
.face { min-width: 0; }
.face-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.face-h b { font: 700 18px/1 var(--fc); }
.face-h span { color: var(--ink-3); font: 600 12px/1 var(--fc); letter-spacing: .08em; text-transform: uppercase; }
.face-h em { margin-left: auto; font-style: normal; color: var(--ink-3); font-size: 12px; }
.face-g { display: grid; grid-template-columns: 16px repeat(12, minmax(0, 1fr)); gap: 3px; }
.face-g .ll { display: grid; place-items: center; color: var(--ink-3); font: 600 11px/1 var(--fc); }
.cell { position: relative; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 1px; background: var(--f0); overflow: hidden; }
.cell i { position: absolute; left: 0; right: 0; bottom: 0; }
.cell.blk { background: repeating-linear-gradient(45deg, var(--bad-m) 0 2px, transparent 2px 6px); }
.cell:hover { border-color: var(--ink); }
.faces.dim .cell:not(.hit) { opacity: .3; }
.cell.hit { border: 2px solid var(--orange); } .cell.hit i { background: var(--orange) !important; }
.cell.sel { border: 2px solid var(--ink); }
.cell .lv1 { background: var(--f1); } .cell .lv2 { background: var(--f2); } .cell .lv3 { background: var(--f3); } .cell .lv4 { background: var(--f4); }
.cell .ag1 { background: var(--f1); } .cell .ag2 { background: var(--f2); } .cell .ag3 { background: var(--warn-m); } .cell .ag4 { background: var(--bad-m); }
.cell .ht1 { background: var(--f1); } .cell .ht2 { background: var(--f2); } .cell .ht3 { background: var(--f3); } .cell .ht4 { background: var(--f4); }
.face-bays { display: grid; grid-template-columns: 16px repeat(12, minmax(0, 1fr)); gap: 3px; margin-top: 4px; color: var(--ink-3); font: 600 10.5px/1 var(--fc); text-align: center; }

/* ---------- floor screen ---------- */
.floor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.insp { position: sticky; top: calc(var(--bar-h) + 16px); max-height: calc(100vh - var(--bar-h) - 32px); overflow-y: auto; }
.insp-h { padding: 16px; border-bottom: 1px solid var(--line); }
.insp-h .where { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.insp-sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.insp-sec:last-child { border-bottom: 0; }
.insp-sec > h3 { margin-bottom: 10px; font: 600 13px/18px var(--fc); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.insp-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fillrow { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.fillrow b { font: 600 28px/1 var(--fc); }
.bucket { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; }
.bucket .meter i { background: var(--f3); }
.bucket .n { text-align: right; color: var(--ink-2); }
.find-res { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; margin-top: 4px; max-height: 340px; overflow-y: auto; padding: 4px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: var(--sh-pop); }
.find-res button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: var(--r1); background: none; text-align: left; }
.find-res button:hover, .find-res button.on { background: var(--pale-2); }
.hitbar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--orange-soft); color: var(--ink); font-size: 13px; }
.hitbar .dot { width: 10px; height: 10px; background: var(--orange); flex: none; }
.hitbar .btn { margin-left: auto; }

/* ---------- generic layouts ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.split.wide-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.split.l { grid-template-columns: 400px minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.sticky-r { position: sticky; top: calc(var(--bar-h) + 16px); }
.hstack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.actbar { position: sticky; bottom: 16px; z-index: 10; display: flex; align-items: center; gap: 16px; margin-top: 12px; padding: 10px 12px 10px 16px; border-radius: var(--r2); background: var(--bar); color: var(--bar-ink); box-shadow: var(--sh-pop); animation: rise .16s ease-out; }
.actbar .btn-s { background: transparent; color: var(--bar-ink); border-color: #4A6178; }
.actbar .btn-p { background: #CFE0F0; color: #14232F; }
.actbar .btn-p:hover:not(:disabled) { background: #E6EEF6; }
.actbar b { font-weight: 600; }
.actbar.quiet { background: var(--s2); color: var(--ink-2); box-shadow: none; border: 1px solid var(--line); animation: none; }
.actbar.quiet .btn-s { color: var(--ink-2); border-color: var(--line-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 14px 20px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; background: var(--s4); border: 1px solid var(--line-2); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--steel); border-color: var(--steel); }
.timeline li.now::before { background: var(--orange); border-color: var(--orange); }
.timeline .when { margin-left: auto; color: var(--ink-3); white-space: nowrap; }
.chart { display: block; width: 100%; height: auto; }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart .axt { fill: var(--ink-3); font: 500 11px var(--f); }
.chart .ln { fill: none; stroke: var(--steel-ink); stroke-width: 2; }
.chart .ar { fill: var(--pale); opacity: .55; }
.chart .rp { stroke: var(--bad-m); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .rpt { fill: var(--bad); font: 600 11px var(--fc); letter-spacing: .04em; }
.chart .dot { fill: var(--steel-ink); }

/* ---------- inbound / GRN ---------- */
.prog { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.prog .meter { flex: 1; }
.prog span { width: 36px; text-align: right; color: var(--ink-3); font-size: 12px; }
.docks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.dock { text-decoration: none; min-width: 0; display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--s2); border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--r1); text-align: left; color: inherit; }
.dock.busy { border-left-color: var(--steel); }
.dock.late { border-left-color: var(--bad-m); }
.dock .dn { font: 700 26px/1 var(--fc); width: 34px; color: var(--ink-2); }
.dock .li-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grn-meta { display: grid; grid-template-columns: 110px repeat(2, minmax(0, 1.3fr)) 150px minmax(0, 1fr); gap: 16px; padding: 16px; }
.grn .tbl td { height: 56px; }
.grn .tbl .inp.sm { min-width: 0; }
.grn-total { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 12px 16px; border-top: 1px solid var(--line-2); background: var(--s1); }
.grn-total .metric { white-space: nowrap; }
.grn-total .metric b { font-size: 20px; }
.saved { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; }
.saved .i { width: 14px; height: 14px; color: var(--ok); }
.sugg { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.reason { color: var(--ink-3); font-size: 12px; line-height: 16px; }

/* ---------- picking ---------- */
.stops .li { align-items: center; }
.stop-n { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border: 2px solid var(--steel-ink); border-radius: 50%; color: var(--steel-ink); font: 700 13px/1 var(--fc); }
.stop-n.done { background: var(--steel-ink); color: var(--s2); }
.stop-n.short { background: var(--bad-m); border-color: var(--bad-m); color: #fff; }
.stop-n.cur { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.li.cur { background: var(--orange-soft); }
.hh-wrap { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 24px; align-items: start; }
.hh { background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r3); overflow: hidden; }
.hh-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bar); color: var(--bar-ink); }
.hh-top .meter { flex: 1; background: var(--bar-2); }
.hh-top .meter i { background: #CFE0F0; }
.hh-top b { font: 700 16px/1 var(--fc); letter-spacing: .04em; white-space: nowrap; }
.hh-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.hh-go { color: var(--ink-3); font: 600 13px/18px var(--fc); letter-spacing: .1em; text-transform: uppercase; }
.hh-bin { display: flex; align-items: center; gap: 16px; }
.lvlpic { width: 56px; height: 72px; flex: none; }
.lvlpic rect { fill: var(--s3); stroke: var(--line-2); }
.lvlpic rect.on { fill: var(--orange); stroke: var(--orange-ink); }
.lvlpic line { stroke: var(--ink-3); stroke-width: 2; }
.hh-where { color: var(--ink-2); font-size: 14px; }
.hh-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--s1); }
.hh-item .t { font-weight: 600; font-size: 16px; line-height: 22px; }
.hh-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hh-qty .need { font: 600 13px/1 var(--fc); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.hh-qty .need b { display: block; margin-top: 4px; color: var(--ink); font-size: 44px; line-height: 44px; letter-spacing: 0; }
.bigstep { display: grid; grid-template-columns: 64px 1fr 64px; height: 64px; border: 1px solid var(--line-2); border-radius: var(--r2); overflow: hidden; }
.bigstep button { border: 0; background: var(--s1); color: var(--ink); display: grid; place-items: center; }
.bigstep button:hover { background: var(--s3); }
.bigstep input { border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: 700 32px/1 var(--fc); background: var(--s2); min-width: 0; width: 100%; font-variant-numeric: tabular-nums; }
.bigstep input:focus { outline: none; background: var(--pale-2); }
.hh-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hh-acts .btn-o { grid-column: 1 / -1; }
.scan { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 14px; border: 1px dashed var(--line-2); border-radius: var(--r2); background: var(--s1); color: var(--ink-2); font-weight: 600; text-align: left; }
.scan.ok { border-style: solid; border-color: var(--ok-m); background: var(--ok-bg); color: var(--ok); }
.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reasons .chip { height: 44px; justify-content: center; }
.done-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.done-sum div { padding: 12px; background: var(--s2); }
.done-sum b { display: block; font: 600 28px/1 var(--fc); }
.done-sum span { color: var(--ink-3); font-size: 12px; }

/* ---------- pack & dispatch ---------- */
.pack { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.qcard { display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: var(--r1); background: var(--s2); text-align: left; color: inherit; }
.qcard + .qcard { margin-top: 8px; }
.qcard:hover { border-color: var(--line-2); }
.qcard.on { border-left-color: var(--steel); background: var(--pale-2); }
.qcard .row { display: flex; justify-content: space-between; gap: 8px; }
.verify { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r1); background: var(--s2); text-align: left; color: inherit; }
.verify + .verify { margin-top: 6px; }
.verify .box { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border: 1.5px solid var(--line-2); border-radius: 2px; color: transparent; }
.verify[aria-pressed="true"] { border-color: var(--ok-m); background: color-mix(in srgb, var(--ok-bg) 60%, var(--s2)); }
.verify[aria-pressed="true"] .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.cartons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ctn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--s2); text-align: left; color: inherit; }
.ctn b { font: 700 16px/1 var(--fc); letter-spacing: .04em; }
.ctn span { color: var(--ink-3); font-size: 12px; }
.ctn.on { border: 2px solid var(--steel); padding: 9px; background: var(--pale-2); }
.veh { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.veh:last-child { border-bottom: 0; }
.veh-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

/* ---------- counts ---------- */
.var-bar { position: relative; width: 140px; height: 14px; background: linear-gradient(var(--line-2), var(--line-2)) center / 1px 100% no-repeat; }
.var-bar i { position: absolute; top: 3px; height: 8px; }
.var-bar i.neg { right: 50%; background: var(--bad-m); }
.var-bar i.pos { left: 50%; background: var(--ok-m); }
.countline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.countline:last-child { border-bottom: 0; }
.tol { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12.5px; }

/* ---------- health ---------- */
.agebar { display: flex; height: 36px; border-radius: var(--r1); overflow: hidden; border: 1px solid var(--line); }
.agebar div { display: flex; align-items: center; padding: 0 10px; color: #fff; font: 600 13px/1 var(--fc); letter-spacing: .03em; white-space: nowrap; overflow: hidden; min-width: 0; }
.agebar .a1 { background: var(--f2); color: #11202C; } .agebar .a2 { background: var(--f3); } .agebar .a3 { background: var(--warn-m); color: #2A1E00; } .agebar .a4 { background: var(--bad-m); }
[data-theme="dark"] .agebar .a1 { color: #E4EAEF; }
.agekey { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.agekey div { border-top: 3px solid; padding-top: 6px; }
.agekey b { display: block; font: 600 20px/24px var(--fc); }
.agekey span { color: var(--ink-3); font-size: 12px; }
.cover { display: inline-flex; align-items: center; gap: 6px; }
.cover .meter { width: 60px; }

/* ---------- labels & documents ---------- */
.sheet-prev { padding: 24px; background: var(--s3); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.paper { width: 100%; max-width: 760px; margin: 0 auto; padding: 28px; background: #fff; color: #14202B; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08); }
.lblgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lblgrid.s { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lbl { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1.5px solid #14202B; border-radius: 2px; background: #fff; color: #14202B; min-width: 0; break-inside: avoid; }
.lbl .lt { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lbl .big { font: 700 34px/1 var(--fc); letter-spacing: .03em; }
.lbl .lvarrow { font: 700 13px/1 var(--fc); letter-spacing: .06em; padding: 3px 6px; background: #14202B; color: #fff; }
.lbl .meta { font: 500 11px/14px var(--f); color: #3D4955; }
.lbl svg.bc { width: 100%; height: 44px; display: block; }
.lbl .hr { font: 600 11px/1 var(--fc); letter-spacing: .2em; text-align: center; }
.lblgrid.s .lbl .big { font-size: 22px; } .lblgrid.s .lbl svg.bc { height: 34px; }
.doc { font: 400 12.5px/17px var(--f); color: #14202B; }
.doc h2 { font: 700 22px/26px var(--fc); letter-spacing: .02em; }
.doc .dh { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 2px solid #14202B; margin-bottom: 14px; }
.doc .dh .r { text-align: right; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc th { text-align: left; font: 700 11.5px/1 var(--fc); letter-spacing: .08em; text-transform: uppercase; padding: 6px; border-bottom: 1px solid #14202B; }
.doc td { padding: 6px; border-bottom: 1px solid #D5D9DD; vertical-align: top; }
.doc .n { text-align: right; }
.doc .tot td { border-bottom: 0; font-weight: 700; }
.doc .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc .lab { font: 700 11px/1 var(--fc); letter-spacing: .1em; text-transform: uppercase; color: #56616C; margin-bottom: 4px; }
.doc .fine { margin-top: 16px; padding-top: 10px; border-top: 1px dashed #A0A7AE; color: #56616C; font-size: 11px; }
.doc .sig { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-top: 36px; }
.doc .sig div { border-top: 1px solid #14202B; padding-top: 4px; font-size: 11px; color: #56616C; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100vh; }
.login-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; background: var(--bar); color: var(--bar-ink); overflow: hidden; }
.login-art .brand-n { font-size: 24px; }
.login-art h1 { max-width: 560px; font: 600 44px/48px var(--fc); letter-spacing: .005em; color: #fff; }
.login-art p { max-width: 520px; margin-top: 12px; color: var(--bar-ink-2); font-size: 16px; line-height: 24px; }
.login-art svg.plan { width: 100%; max-width: 720px; height: auto; margin: 24px 0; }
.login-art .foot { display: flex; gap: 24px; color: var(--bar-ink-2); font: 600 13px/1 var(--fc); letter-spacing: .08em; text-transform: uppercase; }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; background: var(--s2); }
.login-form form { width: 100%; max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-size: 28px; line-height: 32px; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r1); background: var(--s2); text-align: left; color: inherit; }
.role b { font: 600 15px/18px var(--fc); letter-spacing: .03em; }
.role span { color: var(--ink-3); font-size: 11.5px; line-height: 15px; }
.role.on { border: 2px solid var(--steel); padding: 9px; background: var(--pale-2); }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- settings ---------- */
.set { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 32px; }
.set-sec { padding: 20px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.set-sec:first-child { border-top: 0; padding-top: 0; }
.set-sec h2 { font-size: 18px; line-height: 24px; }
.set-sec .help { margin-top: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
.set-row + .set-row { border-top: 1px dashed var(--line); }

/* ---------- responsive ---------- */
@media (max-width: 1360px) {
  .find { width: 40px; padding: 0; justify-content: center; } .find span, .find kbd { display: none; }
  .tabs a { padding: 0 8px; font-size: 14px; }
  .tabs a.on::after { left: 8px; right: 8px; }
  .pack { grid-template-columns: 260px minmax(0, 1fr); } .pack > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .site { display: none; }
  .floor, .split, .split.l, .split.wide-r, .hh-wrap { grid-template-columns: minmax(0, 1fr); }
  .insp, .sticky-r { position: static; max-height: none; }
  .grn-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1000px) { .tabs .ct { display: none; } .tabs a { padding: 0 6px; letter-spacing: .02em; } .brand-n { display: none; } }
@media (max-width: 760px) {
  :root { --bar-h: 52px; }
  body { font-size: 15px; line-height: 21px; }
  .bar { gap: 10px; padding: 0 12px; }
  .tabs, .site, .find { display: none; }
  .ph-only { display: inline-grid !important; }
  .brand-n { display: none; }
  .bar-title { display: block; flex: 1; min-width: 0; font: 600 19px/1 var(--fc); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar .ib, .avatar { width: 40px; height: 40px; }
  .page { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--s2); border-top: 1px solid var(--line-2); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: none; color: var(--ink-3); text-decoration: none; font: 600 12px/1 var(--fc); letter-spacing: .06em; text-transform: uppercase; }
  .tabbar .i { width: 24px; height: 24px; }
  .tabbar .on { color: var(--steel-ink); }
  .tabbar .on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--steel-ink); }
  .tabbar .ct { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; padding: 0 4px; font-size: 11px; line-height: 16px; background: var(--steel); color: #fff; }
  h1 { font-size: 26px; line-height: 30px; }
  .ph { margin-bottom: 16px; align-items: stretch; }
  .ph-t { flex-basis: 100%; }
  .ph-a { width: 100%; } .ph-a .btn { flex: 1 1 auto; }
  .ph-a .btn.ph-keep { flex: 0 0 auto; }
  .metrics { gap: 4px 20px; } .metric b { font-size: 20px; }
  .subtabs { margin: 0 -16px 16px; padding: 0 8px; } .subtabs a, .subtabs button { flex: 1; justify-content: center; padding: 12px 6px; font-size: 14px; }
  .btn { height: 44px; } .btn-sm { height: 38px; } .btn-lg { height: 52px; } .btn-xl { height: 64px; }
  .inp, .sel { height: 44px; font-size: 16px; } .inp.sm, .sel.sm { height: 40px; font-size: 16px; }
  .stepper { height: 44px; } .stepper button { width: 44px; } .stepper input { font-size: 18px; }
  .chip { height: 38px; }
  .seg button { height: 34px; }
  .toolbar .search { flex: 1 1 100%; min-width: 0; }
  .grid2, .grid3, .grn-meta { grid-template-columns: minmax(0, 1fr); }
  .modal-back { place-items: end stretch; padding: 0; }
  .modal, .modal.wide, .modal.xwide, .modal.narrow, .pal { width: 100%; max-height: 90vh; border-radius: 14px 14px 0 0; animation: sheet .2s cubic-bezier(.2,.7,.3,1); }
  .grab { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--line-2); flex: none; }
  .modal-h { padding: 12px 16px; } .modal-b { padding: 16px; } .modal-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1 1 auto; } .modal-f .left { flex-basis: 100%; margin: 0 0 4px; }
  #toasts { left: 12px; right: 12px; top: calc(var(--bar-h) + 8px); bottom: auto; }
  .toast { min-width: 0; max-width: none; }
  .tbl th { top: var(--bar-h); }
  .cards > * + * { margin-top: 8px; }
  .card { display: block; width: 100%; padding: 14px; background: var(--s2); border: 1px solid var(--line); border-radius: var(--r2); text-align: left; color: inherit; text-decoration: none; }
  .card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .card .row + .row { margin-top: 6px; }
  .card .big { font: 600 24px/1 var(--fc); }
  .faces { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 18px; }
  .cell { height: 34px; }
  .map-tools { padding: 10px; } .map-tools .search { flex-basis: 100%; max-width: none; }
  .legend .sp { margin-left: 0; }
  .docks { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .grn-total { flex-wrap: wrap; gap: 8px 16px; bottom: calc(64px + env(safe-area-inset-bottom)); margin: 0 -16px; padding: 12px 16px; }
  .grn-total .btn { flex: 1 1 100%; }
  .pack { grid-template-columns: minmax(0, 1fr); }
  .cartons { grid-template-columns: repeat(2, 1fr); }
  .hh { border-radius: var(--r2); }
  .hh-body { padding: 16px; }
  .plate.xl { height: 64px; font-size: 48px; line-height: 60px; }
  .actbar { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .actbar .btn { flex: 1; }
  .page:has(.actbar) { padding-bottom: 200px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: 24px 20px; min-height: 0; }
  .login-art .brand-n { display: inline; }
  .login-art h1 { font-size: 30px; line-height: 34px; }
  .login-art p { font-size: 14px; line-height: 20px; }
  .login-art svg.plan { margin: 16px 0 0; }
  .login-art .foot { display: none; }
  .login-form { padding: 24px 20px 40px; }
  .roles { grid-template-columns: minmax(0, 1fr); } .role { flex-direction: row; align-items: baseline; gap: 8px; }
  .set, .set-sec { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .set > nav { display: none; }
  .keys { grid-template-columns: minmax(0, 1fr); }
  .agekey { grid-template-columns: 1fr 1fr; }
  .paper { padding: 14px; }
  .sheet-prev { padding: 10px; }
  .lblgrid, .lblgrid.s { grid-template-columns: minmax(0, 1fr); }
  .empty { padding: 24px 8px; }
  .kv { font-size: 14px; }
  .done-sum b { font-size: 24px; }
  .ph-hide { display: none; }
  .scan .demo { display: none; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }

/* ---------- print: only the document in #print-root ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root .paper { box-shadow: none; max-width: none; padding: 0; }
  #print-root .lbl { border-color: #000; }
}
