/* =====================================================================
   Perpetual Inventory — interface styles
   Refined "clinical lab" dark theme: layered green-slate surfaces,
   an emerald accent, measured typography and spacing.
   ===================================================================== */
:root {
    /* grounds & surfaces (green-biased neutrals, deliberately chosen) */
    --bg: #0c1210;
    --panel: #121a16;            /* legacy name kept: primary surface */
    --panel-2: #18211d;          /* legacy name kept: raised surface  */
    --surface-3: #1f2a24;        /* hover / inset                     */
    --line: #222d27;             /* hairline                          */
    --line-2: #2c3a32;           /* stronger divider                  */

    /* ink */
    --text: #e9efeb;
    --ink-dim: #c2cdc6;
    --muted: #82938a;

    /* accent + semantics */
    --accent: #3fae78;
    --accent-bright: #52c68d;
    --accent-weak: rgba(63,174,120,.13);
    --accent-line: rgba(63,174,120,.34);
    --accent-2: #5bb4d4;         /* links / info */
    --warn: #d7a63f;
    --danger: #dd7d7d;

    /* type */
    --font: "Inter","Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
    --mono: "Cascadia Code","JetBrains Mono",ui-monospace,Consolas,monospace;

    /* shape & depth */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-1: 0 1px 2px rgba(0,0,0,.28);
    --shadow-2: 0 1px 2px rgba(0,0,0,.30), 0 10px 30px -12px rgba(0,0,0,.55);
    --ring: 0 0 0 3px var(--accent-weak);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background:
        radial-gradient(1200px 600px at 78% -8%, rgba(63,174,120,.06), transparent 60%),
        var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02","cv03","ss01";
}
::selection { background: rgba(63,174,120,.28); }
a { color: var(--accent-2); }

/* focus visibility for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* scrollbars */
/* 2026-12-01: full-width, easy-to-grab scrollbars (the 'thin' setting overrode the width) */
* { scrollbar-width: auto; scrollbar-color: #5b6f63 rgba(255,255,255,.05); }
*::-webkit-scrollbar { width: 16px; height: 16px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,.05); }
*::-webkit-scrollbar-thumb { background: #5b6f63; border-radius: 9px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #3a4a41; }

.layout { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------- Sidebar */
.sidebar {
    width: 244px;
    background: linear-gradient(180deg, #101713, #0e140f);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(150deg, var(--accent-bright), #2b8a5e 70%);
    color: #06120c; display: grid; place-items: center;
    font-size: 20px; font-weight: 800;
    box-shadow: 0 4px 14px -4px rgba(63,174,120,.55), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-title { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }

.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 11px; border-radius: 9px;
    color: var(--ink-dim); text-decoration: none; font-size: 13px; font-weight: 500;
    position: relative; transition: background .13s ease, color .13s ease;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
    background: var(--accent-weak); color: #eafff4; font-weight: 600;
}
.nav-item.active::before {
    content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-bright);
}
.nav-item.disabled { color: #556158; cursor: default; }
.nav-item.disabled:hover { background: transparent; }
.nav-icon { width: 17px; text-align: center; opacity: .85; font-size: 13px; }
.nav-label { flex: 1; }
.soon {
    font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px;
}
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.foot-co { color: var(--ink-dim); font-weight: 600; font-size: 11.5px; margin-bottom: 3px; letter-spacing: .01em; }
.foot-meta { color: var(--muted); font-size: 10px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; box-shadow: 0 0 0 3px var(--accent-weak); }

/* ---------------------------------------------------------------- Content */
.content { flex: 1; padding: 30px 38px 60px; max-width: 1160px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.co-eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-bright); }
h1 { margin: 0 0 5px; font-size: 23px; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
h2 { margin: 0 0 6px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
/* material groups (2026-11-30): one colour per group, everywhere */
.g-raw { --gc: #4fd18b; } .g-pack { --gc: #6aa8ff; } .g-pallet { --gc: #f0b44c; } .g-ppe { --gc: #4fd0dc; }
.g-wh { --gc: #b994ff; } .g-office { --gc: #ff8fc0; } .g-other { --gc: #9aa5a0; }
.g-prod { --gc: #f0d24c; } .g-clean { --gc: #a3e635; } .g-lab { --gc: #8f9bff; } .g-maint { --gc: #ff9a55; } .g-pantry { --gc: #d9a777; }
/* house style (2026-11-30): headings, table headings and buttons in CAPITALS */
h1, h2, h3, h4, table.grid thead th, .btn { text-transform: uppercase; }
h1 { letter-spacing: .01em; } h2, h3, h4 { letter-spacing: .03em; }
.muted { color: var(--muted); margin: 0; }
.badge-ok {
    color: var(--accent-bright); font-size: 12px; font-weight: 600;
    background: var(--accent-weak); border: 1px solid var(--accent-line);
    padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}

/* ---------------------------------------------------------------- Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 13px; margin-bottom: 26px; }
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 17px; box-shadow: var(--shadow-1);
    transition: border-color .15s ease;
}
.stat-card:hover { border-color: var(--line-2); }
.stat-num { font-size: 27px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.stat-card.danger { border-color: rgba(221,125,125,.45); }
.stat-card.warn { border-color: rgba(215,166,63,.45); }

/* ---------------------------------------------------------------- Panels */
.panel {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow-1);
}
.roadmap { list-style: none; padding: 0; margin: 12px 0 0; }
.roadmap li { padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.roadmap li.done { color: var(--ink-dim); }
.roadmap li:last-child { border-bottom: none; }
.tick { display: inline-block; width: 22px; color: var(--accent); font-weight: 700; }

.schema-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.schema-chip {
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
    padding: 6px 12px; font-size: 12px; font-family: var(--mono); color: var(--ink-dim);
}
.schema-chip.strong { border-color: var(--accent-line); color: #eafff4; background: var(--accent-weak); }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
    font-size: 13px; font-weight: 550; font-family: inherit; cursor: pointer;
    text-decoration: none; white-space: nowrap;
    transition: background .13s ease, border-color .13s ease, transform .08s ease;
}
.btn:hover { background: var(--surface-3); border-color: #3a4a41; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(180deg, var(--accent-bright), var(--accent));
    border-color: transparent; color: #06130c; font-weight: 650;
    box-shadow: 0 2px 10px -3px rgba(63,174,120,.5);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, var(--accent-bright), var(--accent)); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line); }

/* ---------------------------------------------------------------- Filters */
.filters { display: flex; gap: 9px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.filters input[type=search], .filters select {
    padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
    background: var(--panel); color: var(--text); font-size: 13px; font-family: inherit;
}
.filters input[type=search] { min-width: 240px; }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-1); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid.compact th, table.grid.compact td { padding: 8px 12px; }
table.grid thead th {
    background: #0f1613; color: var(--muted); font-weight: 600; font-size: 10.5px;
    text-transform: uppercase; letter-spacing: .07em; position: sticky; top: 0; z-index: 1;
    border-bottom: 1px solid var(--line-2);
}
table.grid tbody tr { transition: background .1s ease; }
table.grid tbody tr:hover { background: var(--accent-weak); }
table.grid tr:last-child td { border-bottom: none; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tfoot td { background: var(--panel-2); border-top: 1px solid var(--line-2); }
.strong { font-weight: 650; color: #fff; }
.mono { font-family: var(--mono); font-size: 12px; }
.nowrap { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 30px 12px; }
.row-actions a { color: var(--accent-2); text-decoration: none; font-weight: 550; }
.row-actions a:hover { text-decoration: underline; }
.count { margin-top: 11px; font-size: 12px; color: var(--muted); }
.sub { color: var(--muted); font-size: 11.5px; }
td.pos { color: var(--accent-bright); } td.neg { color: var(--danger); }

/* ---------------------------------------------------------------- Tags & chips */
.tag {
    font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px;
    border: 1px solid var(--line-2); background: var(--panel-2); white-space: nowrap; letter-spacing: .01em;
}
.tag-raw_material { color: #8fd6a9; } .tag-packaging { color: #d3bd93; }
.tag-wip { color: #8fc2dd; } .tag-finished { color: #bfa2e0; }
.tag-released { color: #8fd6a9; border-color: rgba(143,214,169,.36); background: rgba(143,214,169,.08); }
.tag-quarantine { color: #e0b45a; border-color: rgba(224,180,90,.36); background: rgba(224,180,90,.08); }
.tag-rejected { color: #e08a8a; border-color: rgba(224,138,138,.36); background: rgba(224,138,138,.08); }
.tag-on_hold { color: #e0b45a; } .tag-expired { color: #e08a8a; } .tag-consumed { color: var(--muted); }
.chip {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
    border: 1px solid var(--line-2); color: var(--muted); background: var(--panel-2);
    margin-right: 3px; display: inline-block; letter-spacing: .02em;
}
.chip-off { color: var(--danger); border-color: rgba(221,125,125,.3); }
.chip-warn { color: var(--warn); border-color: rgba(215,166,63,.36); }
.flags { line-height: 2; }

/* ---------------------------------------------------------------- Forms */
.card-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 20px; box-shadow: var(--shadow-1); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
/* a unit (kg, L, ea) printed inside the right end of a quantity field */
.input-unit { position: relative; display: flex; }
.input-unit input { flex: 1; padding-right: 54px; }
.input-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
                    font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted);
                    pointer-events: none; text-transform: none; }
.input-unit .unit:empty { display: none; }
/* receiving: currency dropdown beside the unit-cost box */
.cost-row { display: flex; gap: 6px; }
.cost-row .ccy { flex: 0 0 86px; }
.cost-row .input-unit { flex: 1; }
/* reorder table row tints */
tr.ro-out td:first-child { border-left: 3px solid var(--danger); }
tr.ro-below td:first-child { border-left: 3px solid #d98f2b; }
/* sidebar group headings */
.nav-group { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
             color: var(--muted); padding: 14px 14px 4px; }
.nav-group:first-child { padding-top: 4px; }
.field.field-wide { margin-top: 16px; }
.field label { font-size: 12px; color: var(--ink-dim); font-weight: 600; letter-spacing: .01em; }
.field input, .field select, .field textarea {
    padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
    background: #0f1613; color: var(--text); font-size: 13.5px; font-family: inherit;
    transition: border-color .13s ease, box-shadow .13s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.field input::placeholder, .field textarea::placeholder { color: #5b675f; }
.field input.locked { opacity: .5; }
.field .hint { font-size: 11px; color: var(--muted); }
.req { color: var(--danger); }
.check-row { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 18px; }
.field-check { flex-direction: row; align-items: center; }
label.check { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 500; cursor: pointer; font-size: 13px; }
label.check input { width: 16px; height: 16px; accent-color: var(--accent); }
fieldset.roles, fieldset.newitem { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 16px 16px; margin: 18px 0 0; }
fieldset.roles legend, fieldset.newitem legend { color: var(--muted); font-size: 12px; padding: 0 6px; }
fieldset.newitem { border-style: dashed; margin: 14px 0; }
fieldset.newitem.hidden { display: none; }
.hint.ok { color: var(--accent-bright); }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.preview-meta { margin-top: 16px; font-size: 13px; }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 6px; align-items: center; }
.tab { padding: 7px 14px; border-radius: var(--radius-sm); text-decoration: none; color: var(--muted); border: 1px solid transparent; font-size: 13px; font-weight: 550; transition: background .12s ease, color .12s ease; }
.tab.active { color: #eafff4; background: var(--accent-weak); border-color: var(--accent-line); }
.tab:hover:not(.active) { color: var(--text); background: var(--surface-3); }

/* ---------------------------------------------------------------- Flash */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px; border: 1px solid transparent; display: flex; align-items: center; gap: 9px; }
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.flash-ok { background: var(--accent-weak); border-color: var(--accent-line); color: #a6e3c3; }
.flash-err { background: rgba(221,125,125,.10); border-color: rgba(221,125,125,.4); color: #eaa2a2; }
.flash-warn { background: rgba(215,166,63,.10); border-color: rgba(215,166,63,.4); color: #e6c884; }

/* ---------------------------------------------------------------- Import/Export */
.ie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ie-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-1); transition: border-color .15s ease, transform .12s ease; }
.ie-card:hover { border-color: var(--line-2); }
.ie-card h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 650; }
.ie-card .desc { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; min-height: 34px; }
.ie-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ie-actions form { display: inline; }
.file-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
input[type=file] { font-size: 12px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-size: 12px; padding: 6px 11px; margin-right: 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--surface-3); }
.import-report { width: 100%; }
.import-report .err-row td { color: #eaa2a2; }
.sectlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 28px 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; font-weight: 600; }

/* ---------------------------------------------------------------- Disposition */
.disp-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.disp-form select, .disp-form input[type=text] { padding: 7px 10px; border-radius: 7px; border: 1px solid var(--line-2); background: #0f1613; color: var(--text); font-size: 12.5px; font-family: inherit; }
.disp-form select:focus, .disp-form input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.disp-form input[type=text] { min-width: 190px; }
.disp-form.vertical { flex-direction: column; align-items: stretch; }
.disp-form.vertical .k { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------------------------------------------------------------- Lot detail */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 14px 22px; margin-top: 12px; }
.kv-grid > div { display: flex; flex-direction: column; gap: 3px; }
.kv-grid .k { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kv-grid .v { font-size: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Help */
.help-layout { display: grid; grid-template-columns: 210px 1fr; gap: 26px; align-items: start; }
@media (max-width: 820px) { .help-layout { grid-template-columns: 1fr; } .help-toc { position: static !important; } }
.help-toc { position: sticky; top: 22px; display: flex; flex-direction: column; gap: 1px; }
.help-toc .toc-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.help-toc a { color: var(--muted); text-decoration: none; padding: 6px 11px; border-radius: 8px; font-size: 13px; transition: background .12s ease, color .12s ease; }
.help-toc a:hover { color: var(--text); background: var(--surface-3); }
.help-body .panel { scroll-margin-top: 22px; }
.help-body h2 { margin-bottom: 10px; }
.help-list { margin: 8px 0 0; padding-left: 18px; line-height: 1.85; }
.help-list li { margin-bottom: 6px; }
.help-list b { color: #fff; }

.linkbtn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; font-family: inherit; }
.linkbtn:hover { filter: brightness(1.15); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* small screens: collapse sidebar to a strip is out of scope; allow scroll */
@media (max-width: 720px) {
    .content { padding: 22px 18px 48px; }
    .sidebar { width: 210px; }
}

/* =====================================================================
   WMS — rack map, bin labels, scan console                    (schema v3)
   ===================================================================== */

.head-actions { display: flex; gap: 9px; flex-shrink: 0; }
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1080px) { .split { grid-template-columns: 1fr; } }

.filter-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar input[type=search], .filter-bar select, .filter-bar input[type=text] {
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: var(--radius-sm); padding: 8px 11px; font: inherit; font-size: 13px;
}
.filter-bar input[type=search] { min-width: 210px; }
.inline-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.inline-form input[type=text] {
    flex: 1; min-width: 190px; background: var(--panel-2); border: 1px solid var(--line);
    color: var(--text); border-radius: var(--radius-sm); padding: 8px 11px; font: inherit; font-size: 13px;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- legend ---------------------------------------------------------- */
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; border: 1px solid var(--line-2); }
.sw-empty      { background: var(--panel-2); }
.sw-occupied   { background: rgba(63,174,120,.45); border-color: var(--accent-line); }
.sw-quarantine { background: rgba(215,166,63,.42); border-color: rgba(215,166,63,.55); }
.sw-hold       { background: rgba(221,125,125,.42); border-color: rgba(221,125,125,.55); }
.sw-blocked    { background: repeating-linear-gradient(45deg, #2a3630, #2a3630 3px, #1a2420 3px, #1a2420 6px); }
.sw-gap        { background: transparent; border-style: dashed; }

/* --- rack elevation drawing ------------------------------------------ */
.rack-panel { margin-bottom: 26px; }
.rack-title { font-size: 15px; margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rack-hint { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-left: auto; }
/* wide racks scroll inside their own panel; the page never scrolls sideways */
.rack-scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line);
               border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-1); }
.rack-svg { display: block; }
.rack-cap { fill: var(--muted); font-family: var(--font); font-size: 10px;
            text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* A bay is the unit people are actually sent to ("go to B06"), so it is
   framed as its own column and captioned in bold. The positions inside it
   are the quieter detail - read the bay first, then the pallet. */
.bay-frame { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.bay-band  { fill: var(--surface-3); stroke: var(--line-2); stroke-width: 1.5; }
.bay-cap   { fill: var(--text); font-family: var(--font); font-size: 13.5px;
             font-weight: 800; letter-spacing: .12em; }
.bay-walk .bay-frame, .bay-walk .bay-band { stroke: var(--warn); }
.bay-walk .bay-cap { fill: var(--warn); }

.cell { stroke: var(--line-2); stroke-width: 1; transition: filter .12s ease; }
.cell-empty      { fill: var(--panel-2); }
.cell-occupied   { fill: rgba(63,174,120,.34); stroke: var(--accent-line); }
.cell-quarantine { fill: rgba(215,166,63,.32); stroke: rgba(215,166,63,.5); }
.cell-hold       { fill: rgba(221,125,125,.32); stroke: rgba(221,125,125,.5); }
.cell-blocked    { fill: #223029; stroke: #35473d; stroke-dasharray: 3 2; }
.cell-overwalk   { stroke-width: 2; stroke-dasharray: 5 3; }
.rack-svg a:hover .cell { filter: brightness(1.5); }
.rack-svg a { cursor: pointer; }

.cell-label { fill: var(--ink-dim); font-family: var(--mono); font-size: 9.5px; }
.cell-sku   { fill: var(--text); font-family: var(--font); font-size: 9.5px; font-weight: 600; }
.cell-qty   { fill: var(--muted); font-family: var(--mono); font-size: 9px; }
.cell-gap   { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 4 3; }
.gap-text   { fill: var(--muted); font-family: var(--font); font-size: 9px;
              letter-spacing: .1em; opacity: .75; }

/* --- bin labels: two per A4 LANDSCAPE sticker sheet --------------------- */
/* A4 landscape cut across the middle: each beam label is a 297 x 105 mm strip.
   Laid out to the industry beam-label convention (high-visibility yellow,
   one captioned field per part of the code, barcode on a white panel):
     | arrow | RACK   BAY   LEVEL POSITION|  |||barcode|||    |
     |  tab  |  01    01      0      01   |  W2-R01-B01-L0-P01 |
     |(level)|         yellow             |   logo   (white)   |
   Sized in mm for the printed page; the on-screen preview is zoomed down.
   Scoped to .label-sheet: the bin/plate detail pages reuse .lbl-* for a small
   on-screen preview that must not grow. */
.label-sheet { display: flex; flex-direction: column; align-items: flex-start; gap: 6mm; }
.label-sheet .label {
    width: 297mm; height: 104.9mm;      /* 2 x 104.9 < 210, so rounding cannot spill a blank page */
    box-sizing: border-box; padding: 5mm;   /* keeps the box clear of the printer's dead edge */
    background: #fff; color: #000; overflow: hidden;
    outline: 1px dashed #bbb; outline-offset: -1px;   /* screen only: the sheet's cut line */
    break-inside: avoid; page-break-inside: avoid;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.label-sheet .lbl-box {
    height: 100%; box-sizing: border-box; display: flex;
    /* the field area takes the LEVEL colour (user's call, 2026-10-05) - the
       .lvl-N class on the box sets --lvl / --lvl-fg; yellow is only the
       fallback for a bin with no level */
    background: var(--lvl, #ffd200); color: var(--lvl-fg, #000);
    border: .8mm solid #000; border-radius: 3mm; overflow: hidden;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}
/* Arrow tab. The arrow says which side of the label the pallet is on (L0's
   label shares the bottom beam with L1's); the tab colour codes the level so a
   driver finds the right beam from a distance. The words carry the meaning on
   their own, so a mono printout still works.
   (The tab used to take the level colour from .lvl-N; it is yellow now.) */
.label-sheet .lbl-tab {
    flex: 0 0 23mm; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    gap: 3mm; text-align: center; border-right: .8mm solid #fff; position: relative;
    /* yellow tab, black mark/arrow/words (user asked, 2026-10-05) - this
       outranks the .lvl-N class the template still puts on the tab, so the
       level colour shows only on the field area beside it */
    background: #ffd200; color: #000;
    /* top clears the hexagon mark; flex-start so the arrow sits at the same
       height on every label whatever the words below it measure */
    padding: 23mm 0 3mm; box-sizing: border-box;
}
/* The hexagon mark, top of the tab (the label's top-left corner), in the
   tab's own colour like the arrow. Taken out of the flex flow; the tab's top
   padding (3 + 16 mm mark + 2) keeps the arrow and its words below it. The
   logo SVG is a mask (see BRAND below), so background-color is what prints. */
.label-sheet .lbl-mark {
    position: absolute; top: 3mm; left: 50%; transform: translateX(-50%);
    width: 16mm; height: 16mm; background-color: currentColor;
    -webkit-mask: url(/static/mark.svg) no-repeat center / contain;
            mask: url(/static/mark.svg) no-repeat center / contain;
}
.label-sheet .lbl-arrow { display: block; width: 18mm; height: 20.7mm; }   /* 40:46 viewBox */
/* The arrow is always in the same place - under the mark, above the words -
   only its direction changes: down for A (floor pallet below the beam). */
.label-sheet .lbl-tab-down .lbl-arrow { transform: rotate(180deg); }
/* The words run vertically, read bottom to top (head tilted left), one word
   per column, the columns left to right ("PALLET" left, "BELOW" right) -
   large enough to read from the aisle. vertical-rl turned 180deg does both
   (it is what writing-mode: sideways-lr means, without needing new browsers).
   Budget: ~69 mm under the mark = 20.7 arrow + 3 gap + ~40 words (6 bold
   caps ~4.1 em x 9.5 mm); two 1.05 lines = 20 mm of the tab's ~22 mm width. */
.label-sheet .lbl-tab-t { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 9.5mm; font-weight: 800;
                          letter-spacing: .04em; line-height: 1.05; white-space: nowrap; }
.label-sheet .lbl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center;
                         gap: 3mm; padding: 3mm 2.5mm; }
/* One field per part of the code, caption above value, in code order. */
/* Each field is its own column with a rule between, so "01 01 0 01" can never
   run together into one number. */
.label-sheet .lbl-fields { display: flex; justify-content: space-between; align-items: stretch; }
.label-sheet .lbl-field  { flex: 1 1 auto; text-align: center; padding: 0 2mm; }
.label-sheet .lbl-field + .lbl-field { border-left: .6mm solid currentColor; }
/* All four fields sit on the label yellow (a coloured LEVEL block and grey
   RACK/BAY were tried on 2026-10-05 and reverted the same day); the level
   colour lives on the arrow tab only. */
/* One rule runs under the caption row from left to right (user's call,
   2026-10-05): each caption draws its own bottom border and the negative
   side margins cancel the field padding, so the pieces meet at the vertical
   rules and read as a single line. */
.label-sheet .lbl-cap { font-size: 7mm; font-weight: 800; letter-spacing: .04em; line-height: 1;
                        display: block; margin: 0 -2mm; padding-bottom: .6mm; border-bottom: .6mm solid currentColor; }
/* Classic widths: "01" in bold Arial is ~1.11 em wide, so beside the barcode
   panel 4 x (33.3 + 4 mm padding) + rules = ~151 of the ~152 mm the yellow area
   has at 30 mm. Bigger clips the POSITION field. All four values are
   the same size (user's call, 2026-10-05).
   line-height .8: caps and digits have no descenders and sit ~0.72 em tall,
   so the box can be trimmed to .8 em with the glyphs still inside it - that
   is what lets POSITION grow without pushing the barcode panel down. */
.label-sheet .lbl-val { font-size: 30mm; font-weight: 800; line-height: .8; letter-spacing: 0;
                        font-variant-numeric: tabular-nums; margin-top: 1.5mm; white-space: nowrap; }
/* white edge so the black badge still shows on the black level-A background */
.label-sheet .lbl-warn { background: #000; color: #fff; border: .5mm solid #fff; border-radius: 1.5mm; text-align: center;
            font-size: 4.5mm; font-weight: 800; letter-spacing: .06em; padding: 1.2mm; }
/* Barcode on its own white panel - the quiet zone scanners need, and the
   convention on every beam label. The full code sits under the bars. */
.label-sheet .lbl-panel {
    /* yellow panel (user asked, 2026-10-05); the barcode and QR SVGs paint
       their own white quiet zones, so scanning is unaffected */
    flex: none; background: #ffd200; border-left: .8mm solid #000; padding: 4mm 3mm 3mm;
    /* barcode centred in the panel (the brand mark lives in the arrow tab) */
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3mm;
}
.label-sheet .lbl-bc svg { display: block; }
/* BIG-CODE STRIP (.sheet-big): same 297 x 105 mm label, stacked instead of
   side by side so the code can run (nearly) the full width:
     | hex + |  RACK      BAY      LEVEL    POSITION   (yellow)      |
     | arrow |   01       01        A         01                     |
     |(level)|-------------------------------------------------------|
     |       | ||||||barcode||||||  [walkway]              [QR]   |
     |       |   R01-B01-A-P01 (~9.8mm)                     [QR]   |
   Height budget (93.3 mm inside the border): yellow 1.6 padding + 6.2
   underlined caption + .5 + 33.6 (value box) = 41.9, rule .8, white 7 (5 padding
   + 2 gap) + 31 bars + 12 code = 92.9. Change one, rebalance the rest.
   The QR is 43 mm square (the white panel's inner height) at the far right;
   the barcode is at the left with the code as fit-to-width SVG text
   (svg_fit_text) on a 12 mm strip under it, as wide as the barcode (122.8
   mm); 122.8 x 12 mm is the aspect the router passes - change together.
   The bar height (31 mm) and the router's svg_barcode height=95 together
   set the barcode's width. */
.sheet-big .lbl-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sheet-big .lbl-main  { flex: none; padding: 0 3mm; gap: 0; border-bottom: .8mm solid #000; }
.sheet-big .lbl-field { padding: .8mm 2mm; }
.sheet-big .lbl-cap   { font-size: 5mm; }
.sheet-big .lbl-val   { font-size: 42mm; margin-top: .5mm; }   /* box 33.6 mm at line-height .8 */
.sheet-big .lbl-panel { flex: 1; min-height: 0; border-left: none; padding: 2.5mm 3mm;
                        flex-direction: row; align-items: stretch; justify-content: flex-start; gap: 3mm; }
.sheet-big .lbl-qr    { flex: 0 0 43mm; display: flex; align-items: center; }
/* no frame (removed 2026-10-05); the 4-module quiet zone is inside the SVG */
.sheet-big .lbl-qr svg { display: block; width: 43mm; height: 43mm; }
.sheet-big .lbl-pcol  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2mm; }
.sheet-big .lbl-bcrow { flex: none; height: 31mm; display: flex; align-items: flex-end; gap: 3mm; justify-content: flex-start; }
.sheet-big .lbl-bcrow .lbl-bc { flex: none; display: flex; align-items: flex-end; }
/* No frame on the barcode (tried 2026-09-30, removed 2026-10-05 on request);
   the quiet zones are inside the SVG (10 modules ~6 mm each side). */
.sheet-big .lbl-bcrow .lbl-bc svg { height: 31mm; width: auto; max-width: 100%; }
/* whatever is left between the barcode and the QR (~38 mm): the walkway
   warning, centred both ways */
.sheet-big .lbl-side  { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
.sheet-big .lbl-side .lbl-warn { font-size: 5.5mm; line-height: 1.1; padding: 1.2mm 1.5mm; white-space: nowrap; letter-spacing: .02em; }   /* 4 lines ~26 mm in the 31 mm row */
/* the code strip is exactly as wide as the barcode (122.8 mm, see
   svg_barcode height=95 above) so the code sits centred under the bars */
.sheet-big .lbl-hr    { flex: 0 0 12mm; width: 122.8mm; }
.sheet-big .lbl-hr svg { display: block; width: 100%; height: 100%; }
@media screen {
    /* full-size mm boxes are too big to browse - preview them scaled down */
    .label-sheet { zoom: .5; }
}
/* --lvl / --lvl-fg are read by .lbl-box, which has the higher specificity */
.lvl-0 { --lvl: #111;    --lvl-fg: #fff; background: #111;    color: #fff; }
.lvl-1 { --lvl: #1d5fbf; --lvl-fg: #fff; background: #1d5fbf; color: #fff; }
.lvl-2 { --lvl: #1e7d3a; --lvl-fg: #fff; background: #1e7d3a; color: #fff; }
.lvl-3 { --lvl: #c2410c; --lvl-fg: #fff; background: #c2410c; color: #fff; }
.lvl-x { --lvl: #6b21a8; --lvl-fg: #fff; background: #6b21a8; color: #fff; }
.lbl-bay  { font-family: var(--mono); font-size: 40px; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
/* The level/position line is what a picker reads at arm's length to know WHICH
   pallet slot they are at - it was set smaller than the bay line and too small
   to read from a forklift. Sized to match the bay line. */
.lbl-slot { font-family: var(--mono); font-size: 40px; font-weight: 700;
            line-height: 1.1; letter-spacing: -.01em; margin-bottom: 6px; }
.lbl-bc svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.lbl-code { font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em; margin-top: 2px; }
.lbl-warn { font-size: 11px; font-weight: 800; letter-spacing: .05em; margin-top: 3px; }

/* --- pallet position labels: "P05" only, two per A4 landscape ----------- */
/* Four signs per A4 landscape sheet (2 x 2, 148.5 x 104.9 mm each - the
   .9 keeps rounding from spilling a blank page), same yellow box as the beam
   labels, the bay above the number. Mono for the slashed zero, so P0 never
   reads as PO. */
.pos-sheet { display: flex; flex-wrap: wrap; width: 297mm; gap: 0; }
.pos-label {
    width: 148.5mm; height: 104.9mm; box-sizing: border-box; padding: 5mm;
    background: #fff; color: #000; overflow: hidden; position: relative;
    outline: 1px dashed #bbb; outline-offset: -1px;       /* screen only: the sheet's cut lines */
    break-inside: avoid; page-break-inside: avoid;
}
.pos-box {
    height: 100%; box-sizing: border-box; border: .8mm solid #000; border-radius: 3mm;
    background: #ffd200; color: #000;                    /* same high-visibility yellow as the beam labels */
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2mm 4mm 3mm;
}
.pos-bay  { font-family: Arial, Helvetica, sans-serif; font-weight: 800; font-size: 13mm; line-height: 1;
            letter-spacing: .04em; white-space: nowrap; border-bottom: .8mm solid #000; padding-bottom: 2mm;
            margin-bottom: 2mm; width: 100%; text-align: center; }
.pos-rack { font-size: 6.5mm; font-weight: 700; letter-spacing: .06em; }
.pos-num  { font-family: var(--mono); font-weight: 800; font-size: 66mm; line-height: 1; letter-spacing: .02em;
            padding-top: 3mm; }                           /* optical centring: digits sit high in the em box */
@media screen { .pos-sheet { zoom: .5; } }

/* --- thermal beam labels: TSC TE244, one per 100 x 150 mm sticker --------
   The sticker feeds 100 mm across x 150 mm along the roll, so the page is
   100 x 150 portrait and the 150 x 100 label is turned 90 degrees onto it
   (rotate about the top-left, then shift right by the label's height).
   Black on white: the printer has no colour, so the level tab is black and
   the LEVEL field is inverted to stand out. Code 128 box is exactly 74.25
   x 40 mm (0.375 mm = 3-dot modules at 203 dpi); the router's height=203
   matches that aspect. On screen the sticker is shown unrotated, at half
   size, the way it reads on the beam. */
.tl-sheet { display: flex; flex-direction: column; gap: 6mm; align-items: flex-start; }
.tl-page  { width: 100mm; height: 150mm; overflow: hidden; background: #fff; position: relative;
            break-inside: avoid; page-break-inside: avoid;
            -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tl-rot   { width: 150mm; height: 100mm; position: absolute; top: 0; left: 0;
            transform: translateX(100mm) rotate(90deg); transform-origin: top left; }
.tl-box   { width: 100%; height: 100%; box-sizing: border-box; padding: 3mm;
            display: flex; gap: 2mm; color: #000; font-family: Arial, Helvetica, sans-serif; }
.tl-tab   { flex: 0 0 18mm; background: #000; color: #fff; border-radius: 2mm;
            display: flex; flex-direction: column; align-items: center; gap: 2mm; padding: 2.5mm 0 2mm; }
/* the .label-sheet mark/arrow rules do not reach in here, so restate them */
.tl-tab .lbl-mark { display: block; width: 11mm; height: 11mm; background-color: currentColor;
                    -webkit-mask: url(/static/mark.svg) no-repeat center / contain;
                            mask: url(/static/mark.svg) no-repeat center / contain; }
.tl-tab .lbl-arrow { display: block; width: 12mm; height: 13.8mm; }
.tl-tab .lbl-arrow.tl-down { transform: rotate(180deg); }
.tl-tab-t { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 6.4mm; font-weight: 800;
            line-height: 1.05; letter-spacing: .04em; white-space: nowrap; margin-top: auto; }
.tl-body  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2mm; }
/* fields: four across in ~124 mm; "01" in 22 mm bold Arial is ~24 mm wide */
.tl-fields { display: flex; border: .6mm solid #000; border-radius: 2mm; overflow: hidden; }
.tl-field  { flex: 1 1 auto; text-align: center; padding: 1mm 1.5mm 1.5mm; }
.tl-field + .tl-field { border-left: .6mm solid #000; }
.tl-field-lvl { background: #000; color: #fff; }
.tl-cap   { font-size: 3.6mm; font-weight: 800; letter-spacing: .06em; line-height: 1; }
.tl-val   { font-size: 22mm; font-weight: 800; line-height: .8; margin-top: 1.4mm;
            font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-panel { flex: 1; display: flex; gap: 3mm; align-items: flex-end; }
.tl-bccol { flex: none; width: 74.25mm; display: flex; flex-direction: column; gap: 1.5mm; }
.tl-bc svg { display: block; width: 74.25mm; height: 40mm; }
.tl-hr    { height: 9mm; }
.tl-hr svg { display: block; width: 100%; height: 100%; }
.tl-qr    { flex: none; margin-left: auto; }
.tl-qr svg { display: block; width: 34mm; height: 34mm; }
.tl-warn  { flex: none; background: #000; color: #fff; text-align: center; border-radius: 1.5mm;
            font-size: 4.2mm; font-weight: 800; letter-spacing: .06em; padding: 1mm; }
@media screen {
    .tl-sheet { zoom: .5; }
    /* preview: show the label the way it reads, not turned on the sticker */
    .tl-page { width: 150mm; height: 100mm; outline: 1px dashed #bbb; outline-offset: -1px; }
    .tl-rot  { transform: none; }
}

/* --- bay placards (A4, one per bay, eye height on the upright) ---------- */
.placard-sheet { display: grid; gap: 18px; }
/* Same high-visibility yellow and black box as the beam labels. Text only -
   the barcodes came off on 2026-10-07 (the beam label has the same one). */
.placard {
    background: #ffd200; color: #000; border: .8mm solid #000; border-radius: 3mm;
    padding: 7mm; max-width: 190mm; box-sizing: border-box;
    display: flex; flex-direction: column;       /* level stack stretches to fill the page */
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
/* bp- prefix, NOT pl-: the pallet-plate thermal labels own .pl-*, and sharing
   the prefix let each sheet's rules leak into the other. */
.bp-top  { display: flex; justify-content: space-between; align-items: center;
           font-size: 20px; font-weight: 800; letter-spacing: .08em; }
.bp-walk { border: 3px solid #000; padding: 2px 8px; }
.bp-top-r { display: flex; align-items: center; gap: 4mm; }
/* same black masked logo as the beam labels (the SVG carries the company name) */
.bp-logo { display: block; flex: none; width: 62mm; height: 18mm; background-color: #000;
           -webkit-mask: url(/static/logo.svg) no-repeat left center / contain;
                   mask: url(/static/logo.svg) no-repeat left center / contain; }
.bp-bay  { font-family: var(--font); font-size: 150px; font-weight: 900; line-height: 1;
           text-align: center; letter-spacing: -.02em; margin: 4mm 0 2mm; }
.bp-nav  { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700;
           border-top: 2px solid #000; border-bottom: 2px solid #000; padding: 2mm 0; margin-bottom: 4mm; }
/* The stack is drawn as the rack itself (user's call, 2026-10-07): the
   level blocks stand clear on the left; to their right the slot area has a
   thick black upright down each side (continuous because the rows touch),
   a black beam along the bottom of every level, and each position sits on
   its beam as a white pallet cell. Rows stretch to fill the page. */
.bp-stack { flex: 1; display: grid; gap: 0; align-content: stretch; }
.bp-row  { display: flex; align-items: stretch; gap: 3mm; min-height: 30mm; }
.bp-row:first-child .bp-slots, .bp-row:first-child .bp-gap { border-top: 4mm solid #000; }
.bp-lvl  { flex: 0 0 24mm; display: flex; flex-direction: column; align-items: center; justify-content: center;
           margin: 1.5mm 0; }
.bp-lvl-n { font-family: var(--mono); font-size: 40px; font-weight: 800; line-height: 1; }
.bp-lvl-t { font-size: 11px; font-weight: 800; letter-spacing: .08em; margin-top: 2px; }
/* uprights + beam: the slot area's own borders */
.bp-slots { flex: 1; display: flex; justify-content: space-evenly; align-items: flex-end; gap: 3mm;
            padding: 3mm 3mm 0; border-left: 5mm solid #000; border-right: 5mm solid #000; border-bottom: 4mm solid #000; }
/* the pallet cell: the position code (A-P01) is what a picker reads from the
   floor, so it is the biggest thing in the row: ~19 mm caps, two per row
   (~62 mm each incl. padding) fit in the ~140 mm between the uprights */
.bp-slot  { font-family: var(--mono); font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.02em; white-space: nowrap;
            background: #fff; border: 1mm solid #000; border-bottom: none; padding: 3mm 3mm 2.5mm; }
/* keep-clear rows: yellow/black hazard stripes, the standard floor marking
   for a space nothing may be put in; the wording sits on a solid black patch */
.bp-gap   { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
            border-left: 5mm solid #000; border-right: 5mm solid #000; border-bottom: 4mm solid #000;
            background: repeating-linear-gradient(45deg, #ffd200 0 5mm, #000 5mm 10mm); }
.bp-gap span { background: #000; color: #ffd200; font-size: 20px; font-weight: 800;
               letter-spacing: .06em; padding: 2mm 4mm; border-radius: 1.5mm; }
.bp-foot  { font-size: 12px; margin-top: 4mm; line-height: 1.4; }
.label-preview { background: #fff; color: #000; border-radius: 6px; padding: 14px; text-align: center; margin-bottom: 18px; }
.label-preview .lbl-code { margin-top: 4px; }
.print-tip { margin: -6px 0 16px; font-size: 12px; }

@media print {
    /* the sheet is the whole page when printing: drop the app chrome so the
       labels land at true size on the sticker stock */
    /* !important throughout: an A4 page is ~794px wide, so the tablet rules
       (max-width: 1180px) further down ALSO match when printing. They showed
       the tablet top bar on page 1 and padded .content by 20px - enough to
       push the second half-sheet label off its page. */
    .sidebar, .no-print, .page-head, .topbar, .navscrim { display: none !important; }
    .layout, .content { display: block !important; padding: 0 !important; margin: 0 !important;
                        max-width: none !important; background: #fff; }
    body { background: #fff; padding: 0 !important; }
    /* Each printout names its own page box. An unnamed @page here would apply
       to EVERY printout in the app - which is how the 100x50 mm thermal size
       once leaked onto the A4 bin-label sheet. */
    /* two labels per A4 landscape: top half, bottom half, then a new sheet.
       No page margin - each label carries its own 5 mm inset, which keeps the
       boxed border clear of the printer's unprintable edge. */
    .label-sheet { page: binlabels; display: block; gap: 0; }
    .label-sheet .label { outline: none; margin: 0; position: relative; }
    .label-sheet .label:nth-child(2n) { break-after: page; page-break-after: always; }
    .label-sheet .label:last-child { break-after: auto; page-break-after: auto; }
    /* Cut guide: the two labels halve the sheet exactly, so the one cut is
       along the top edge of the lower label. A dashed grey BORDER prints
       there (borders always print; a background gradient is dropped unless
       the print dialog's "background graphics" is on) with a scissors mark
       at the left. The label is border-box, so its height is unchanged. */
    .label-sheet .label:nth-child(2n) { border-top: .4mm dashed #888; }
    .label-sheet .label:nth-child(2n)::before {
        content: "✂  cut here"; position: absolute; top: .6mm; left: 10mm;
        font: 700 3mm/1 "Segoe UI Symbol", Arial, sans-serif; color: #888; letter-spacing: .05em;
        background: #fff; padding: 0 1.5mm;
    }
    /* position signs, 2 x 2: a horizontal cut along the top of the lower
       row (signs 3 and 4 of each sheet) and a vertical cut down the left of
       the right-hand column (signs 2 and 4), each as a dashed grey line in
       the sign's 5 mm inset; the scissors sit where the two cuts cross */
    .pos-sheet { page: binlabels; display: flex; flex-wrap: wrap; gap: 0; }
    .pos-label { outline: none; margin: 0; position: relative; }
    .pos-label:nth-child(4n+3), .pos-label:nth-child(4n) { border-top: .4mm dashed #888; }
    .pos-label:nth-child(2n) { border-left: .4mm dashed #888; }
    /* "cut here" on each line, like the beam labels: along the horizontal
       cut at the left edge of sign 3, and down the vertical cut at the top
       of sign 2 (rotated to run with the line) */
    .pos-label:nth-child(4n+3)::before {
        content: "✂  cut here"; position: absolute; top: .6mm; left: 10mm;
        font: 700 3mm/1 "Segoe UI Symbol", Arial, sans-serif; color: #888; letter-spacing: .05em;
        background: #fff; padding: 0 1.5mm;
    }
    .pos-label:nth-child(4n+2)::before {
        content: "✂  cut here"; position: absolute; top: 10mm; left: .6mm;
        font: 700 3mm/1 "Segoe UI Symbol", Arial, sans-serif; color: #888; letter-spacing: .05em;
        background: #fff; padding: 1.5mm 0; writing-mode: vertical-rl;
        /* padding runs along the line here, not across it: the mark is 3 mm
           wide and stays inside the 5 mm inset, clear of the sign's box */
    }
    .pos-label:nth-child(4n) { break-after: page; page-break-after: always; }
    .pos-label:last-child { break-after: auto; page-break-after: auto; }
    /* thermal: one sticker per page; the page size comes from the template */
    .tl-sheet { display: block; gap: 0; }
    .tl-page  { break-after: page; page-break-after: always; margin: 0; }
    .tl-page:last-child { break-after: auto; page-break-after: auto; }
    .placard-sheet { page: placard; display: block; }
    /* the yellow panel fills the printable page (A4 less the 10 mm margin) */
    .placard { max-width: none; min-height: 276mm; break-after: page; page-break-after: always; }
    .placard:last-child { break-after: auto; page-break-after: auto; }
}
@page binlabels { size: A4 landscape; margin: 0; }
@page placard   { size: A4 portrait; margin: 10mm; }

/* --- scan console ----------------------------------------------------- */
.scan-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.scan-bar label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.scan-bar input {
    flex: 1; max-width: 460px; background: var(--panel-2); border: 1px solid var(--accent-line);
    color: var(--text); border-radius: var(--radius-sm); padding: 11px 13px;
    font-family: var(--mono); font-size: 15px; letter-spacing: .03em;
}
.scan-bar input:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.scan-hint { font-size: 12px; margin-bottom: 20px; }
.inline-form.tight { margin-top: 0; gap: 5px; }
.inline-form.tight input[type=text] { min-width: 150px; padding: 6px 9px; font-size: 12px; font-family: var(--mono); }
.inline-form.tight input[type=number] {
    width: 76px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: var(--radius-sm); padding: 6px 9px; font: inherit; font-size: 12px;
}
.flash-err { border-color: rgba(221,125,125,.45); color: var(--danger); }

/* --- license plates ---------------------------------------------------- */
.lp-panel { border-color: var(--accent-line); }
.lp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.lp-head h2 { margin-bottom: 4px; }
.lp-qty { text-align: right; flex-shrink: 0; }
.lp-qty-n { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent-bright); }
.lp-qty-u { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-top: 5px; }
.lp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; margin-top: 16px; }
.lp-form .field { display: flex; flex-direction: column; gap: 5px; }
.lp-form label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.lp-form input, .lp-form select {
    background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
    border-radius: var(--radius-sm); padding: 9px 11px; font: inherit; font-size: 13px;
}
.lp-form .hint { color: var(--muted); font-size: 11px; }

/* --- 100 x 50 mm thermal labels --------------------------------------- */
.thermal-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.thermal {
    background: #fff; color: #000; border: 1px solid #999; border-radius: 3px;
    width: 100mm; height: 50mm; padding: 3mm 4mm; box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: space-between;
    break-inside: avoid; page-break-inside: avoid; overflow: hidden;
}
.th-sku  { font-family: var(--mono); font-size: 19px; font-weight: 700; line-height: 1.1; }
.th-name { font-size: 10px; line-height: 1.2; margin-top: 1px; }
.th-row  { display: flex; gap: 12px; font-size: 10.5px; margin-top: 2px; }
.th-qty  { font-family: var(--mono); font-size: 17px; font-weight: 700; }
.th-bc   { margin-top: 1px; }
.th-bc svg { display: block; width: 100%; height: auto; max-height: 13mm; }
.th-code { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-align: center; }

@page thermal { size: 100mm 50mm; margin: 0; }
@page thermaltag { size: 104mm 150mm; margin: 0; }   /* 104 wide = TE244 driver USER stock; the 100 mm label sits 3.2 mm in via the driver offset */
@media print {
    /* one label per page so a thermal printer feeds correctly. A NAMED page,
       so the 100x50 mm size only applies to this sheet. */
    .thermal-sheet { page: thermal; display: block; }
    .thermal { width: 100mm; height: 50mm; border: none; border-radius: 0;
               page-break-after: always; margin: 0; }
    .thermal:last-child { page-break-after: auto; }
    /* the 100 x 150 stock tag for the TE244 */
    .thermal-sheet.sheet-tag-big { page: thermaltag; }
    .thermal.big { width: 100mm; height: 150mm; }
}

/* --- top-down floor plan ---------------------------------------------- */
.plan-scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--line);
               border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); }
.plan-svg { display: block; width: 100%; min-width: 760px; height: auto; }

.plan-wall { fill: var(--bg); stroke: var(--line-2); stroke-width: 6; }
.plan-rack-outline { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 8 5; }

.plan-cell { stroke: var(--line-2); stroke-width: 3; transition: filter .12s ease; }
.plan-empty   { fill: var(--panel-2); }
.plan-part    { fill: rgba(63,174,120,.30); stroke: var(--accent-line); }
.plan-full    { fill: rgba(63,174,120,.62); stroke: var(--accent-bright); }
.plan-blocked { fill: #223029; stroke: #35473d; stroke-dasharray: 6 4; }
.plan-walk    { stroke: var(--warn); stroke-width: 4; stroke-dasharray: 10 6; }
.plan-svg a { cursor: pointer; }
.plan-svg a:hover .plan-cell { filter: brightness(1.45); }

.plan-btext { fill: var(--text); font-family: var(--mono); font-size: 38px;
              font-weight: 800; letter-spacing: .04em; }
.plan-bsub  { fill: var(--muted); font-family: var(--mono); font-size: 26px; }
.plan-rlabel { fill: var(--ink-dim); font-family: var(--font); font-size: 34px;
               font-weight: 700; letter-spacing: .1em; }
.plan-arrow { fill: var(--muted); font-family: var(--font); font-size: 24px; letter-spacing: .06em; }

.plan-feature { fill: var(--surface-3); stroke: var(--line-2); stroke-width: 2; }
.plan-door      { fill: rgba(91,180,212,.22); stroke: var(--accent-2); }
.plan-mezzanine { fill: rgba(130,147,138,.12); stroke: var(--line-2); stroke-dasharray: 12 8; }
.plan-ftext { fill: var(--muted); font-family: var(--font); font-size: 26px; letter-spacing: .06em; }
/* New Warehouse plan features (W2): shutters as thick lines on the wall, stair, underground tank */
.plan-shutter  { fill: none; stroke: var(--accent-2); stroke-width: 22; stroke-linecap: butt; }
.plan-stair    { fill: rgba(130,147,138,.22); stroke: var(--line-2); stroke-width: 2; }
.plan-tank     { fill: rgba(212,160,60,.10); stroke: #b8862e; stroke-width: 3; stroke-dasharray: 14 9; }
.plan-manhole  { fill: var(--line-2); stroke: none; }

.plan-scale line { stroke: var(--muted); stroke-width: 3; }
.plan-scale text { fill: var(--muted); font-family: var(--font); font-size: 30px; }

.sw-part { background: rgba(63,174,120,.30); border-color: var(--accent-line); }
.sw-full { background: rgba(63,174,120,.62); border-color: var(--accent-bright); }
.sw-walk { background: transparent; border: 2px dashed var(--warn); }
.flash-warn { border-color: rgba(215,166,63,.45); color: var(--warn); }

/* --- sign in ----------------------------------------------------------- */
.content-bare { max-width: none; padding: 0; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
              border-radius: var(--radius); padding: 30px 28px; box-shadow: var(--shadow-2); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.login-form label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.login-form input { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
                    border-radius: var(--radius-sm); padding: 12px 13px; font: inherit; font-size: 15px; }
.login-form input:focus { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.login-foot { color: var(--muted); font-size: 11px; text-align: center; margin-top: 20px; }

/* signed-in identity in the sidebar foot */
.who { display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
       padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.who-name { font-size: 13px; font-weight: 600; color: var(--text); }
.who-role { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.btn-sm { padding: 4px 9px; font-size: 11.5px; }

/* =====================================================================
   RESPONSIVE — phone, tablet (iPad) and desktop
   ---------------------------------------------------------------------
   Breakpoints:
     <=  760px  phone      sidebar becomes a drawer, tables become cards
     <= 1180px  iPad       drawer nav, but tables stay tabular (room for it)
      > 1180px  desktop    unchanged
   ===================================================================== */

/* iOS: keep the page clear of the notch and the home indicator */
body { padding: env(safe-area-inset-top) env(safe-area-inset-right)
               env(safe-area-inset-bottom) env(safe-area-inset-left); }

.navtoggle, .topbar, .navscrim, .navbtn { display: none; }

@media (max-width: 1180px) {
    .layout { display: block; }

    .topbar {
        display: flex; align-items: center; gap: 12px;
        position: sticky; top: 0; z-index: 40;
        padding: 10px 14px; background: var(--panel);
        border-bottom: 1px solid var(--line);
        padding-top: calc(10px + env(safe-area-inset-top));
    }
    .topbar-title { font-weight: 600; font-size: 15px; flex: 1;
                    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-scan {
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; border-radius: var(--radius-sm);
        background: var(--accent); color: #06130d; font-size: 20px;
        text-decoration: none; flex: none;
    }
    /* 44px is the minimum comfortable touch target on iOS */
    .navbtn { display: flex; flex-direction: column; justify-content: center; gap: 4px;
              width: 44px; height: 44px; padding: 10px; cursor: pointer; flex: none;
              border-radius: var(--radius-sm); }
    .navbtn span { display: block; height: 2px; background: var(--text); border-radius: 2px; }
    .navbtn:active { background: var(--surface-3); }

    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 270px; z-index: 60;
        transform: translateX(-100%); transition: transform .22s ease;
        overflow-y: auto; padding-top: env(safe-area-inset-top);
        box-shadow: var(--shadow-2);
    }
    .navtoggle:checked ~ .sidebar { transform: translateX(0); }
    .navscrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50;
                opacity: 0; pointer-events: none; transition: opacity .22s ease; }
    .navtoggle:checked ~ .navscrim { display: block; opacity: 1; pointer-events: auto; }

    .content { padding: 20px 16px 60px; max-width: none; }
    .content-bare { padding: 0; }
    .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .head-actions { flex-wrap: wrap; }
    .stat-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }

    /* stop iOS zooming the page when a field takes focus (needs >= 16px) */
    input, select, textarea { font-size: 16px !important; }
    .btn, .nav-item { min-height: 42px; display: inline-flex; align-items: center; }
    .nav-item { min-height: 46px; }
    .filter-bar { gap: 8px; }
    .filter-bar input[type=search] { min-width: 0; flex: 1 1 100%; }
}

/* Phones: tables cannot stay tabular, so each row becomes a card whose cells
   are labelled from the header via data-label. */
@media (max-width: 760px) {
    .table-wrap { border: none; background: none; box-shadow: none; overflow: visible; }
    table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
    table.grid thead { display: none; }
    table.grid tr {
        background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--radius); margin-bottom: 10px; padding: 6px 4px;
    }
    table.grid td {
        display: flex; justify-content: space-between; gap: 14px;
        padding: 7px 12px; border: none; text-align: right;
    }
    table.grid td::before {
        content: attr(data-label); color: var(--muted); font-size: 11px;
        text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
        text-align: left; flex: none;
    }
    table.grid td:empty { display: none; }
    table.grid td.row-actions { justify-content: flex-end; }
    table.grid td.row-actions::before { content: ""; }

    .split { grid-template-columns: 1fr; }
    .lp-head { flex-direction: column; }
    .lp-qty { text-align: left; }
    .scan-bar { flex-wrap: wrap; }
    .scan-bar input { max-width: none; flex: 1 1 100%; font-size: 17px !important; padding: 14px; }
    .scan-bar .btn { flex: 1; justify-content: center; }
    .inline-form.tight { flex-wrap: wrap; }
    .inline-form.tight input[type=text] { flex: 1 1 100%; }
    .thermal { width: 100%; height: auto; min-height: 42mm; }
    .thermal.big { min-height: 120mm; }
    .rack-scroll, .plan-scroll { padding: 8px; }
    h1 { font-size: 21px; }
}

/* iPad portrait: two-up forms are cramped, one column reads better */
@media (min-width: 761px) and (max-width: 1180px) {
    .split { grid-template-columns: 1fr; }
}

/* Fine-pointer devices keep hover affordances; touch devices should not, or
   the first tap is consumed showing a hover state. */
@media (hover: none) {
    .rack-svg a:hover .cell, .plan-svg a:hover .plan-cell { filter: none; }
    .rack-svg a:active .cell, .plan-svg a:active .plan-cell { filter: brightness(1.5); }
}

@media print { .topbar, .navscrim, .navbtn { display: none !important; } }

/* Columns whose value is already implied elsewhere in the row. Kept on wide
   screens where space is free; dropped on a phone, where every row costs a
   screenful. */
@media (max-width: 760px) {
    table.grid td.sec { display: none; }
    table.grid td { padding: 6px 12px; }
    table.grid tr { padding: 4px 4px; }
}

/* =====================================================================
   BRAND — the mark from the 2026 letterhead
   `logo.svg` / `mark.svg` are a single path with fill="currentColor", so
   colour comes from CSS and there is no per-colour variant to keep in sync.
   ===================================================================== */
.brand { display: block; text-decoration: none; }
.brand-logo { display: block; width: 168px; height: auto; color: var(--accent); }
.brand-sub { color: var(--muted); font-size: 10.5px; text-transform: uppercase;
             letter-spacing: .14em; font-weight: 600; margin-top: 7px; }
.brand:hover .brand-logo { color: var(--accent-bright); }

.login-brand { display: block; text-align: center; margin-bottom: 26px; }
.login-logo { display: inline-block; width: 232px; height: auto; color: var(--accent); }
.login-brand .brand-sub { margin-top: 9px; }

.topbar-mark { width: 26px; height: 26px; color: var(--accent); flex: none; }

@media (max-width: 760px) {
    .brand-logo { width: 150px; }
    .login-logo { width: 196px; }
}

/* Masked rather than <img>: an SVG loaded through <img> is an isolated
   document, so fill="currentColor" inside it cannot see this page's colour and
   would render black. Masking paints the CSS colour through the shape, so one
   file serves every context and still recolours. */
.brand-logo, .login-logo, .topbar-mark {
    display: block;
    background-color: var(--accent);
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center;  mask-position: center;
    -webkit-mask-size: contain;     mask-size: contain;
}
.brand-logo, .login-logo {
    -webkit-mask-image: url(/static/logo.svg); mask-image: url(/static/logo.svg);
}
.topbar-mark {
    -webkit-mask-image: url(/static/mark.svg); mask-image: url(/static/mark.svg);
}
.brand-logo { width: 168px; height: 50px; }
.login-logo { width: 232px; height: 70px; margin: 0 auto; }
.topbar-mark { width: 26px; height: 26px; flex: none; }
.brand:hover .brand-logo { background-color: var(--accent-bright); }

@media (max-width: 760px) {
    .brand-logo { width: 150px; height: 45px; }
    .login-logo { width: 196px; height: 59px; }
}

/* --- camera scanning --------------------------------------------------- */
.scanbtn {
    flex: none; width: 46px; height: 46px; border-radius: var(--radius-sm);
    background: var(--panel-2); border: 1px solid var(--accent-line);
    color: var(--accent); font-size: 19px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.scanbtn:hover { background: var(--surface-3); }
.scanbtn:active { transform: translateY(1px); }
.inline-form.tight .scanbtn { width: 36px; height: 34px; font-size: 15px; }
.scanbtn-inline { color: var(--accent); font-family: var(--mono); }

body.scan-open { overflow: hidden; }
.scanov { position: fixed; inset: 0; z-index: 200; background: #000;
          display: flex; align-items: center; justify-content: center; }
.scanov-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* a window the operator aims through - decoding still uses the whole frame,
   this is only to steady the aim */
.scanov-frame { position: relative; width: min(78vw, 420px); height: min(42vw, 220px);
                border: 2px solid rgba(255,255,255,.9); border-radius: 12px;
                box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); overflow: hidden; }
.scanov-line { position: absolute; left: 0; right: 0; top: 0; height: 2px;
               background: var(--accent-bright); animation: scanline 1.8s ease-in-out infinite; }
@keyframes scanline { 0%,100% { top: 4%; } 50% { top: 96%; } }
@media (prefers-reduced-motion: reduce) { .scanov-line { animation: none; top: 50%; } }
.scanov-msg { position: absolute; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom));
              text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px #000; padding: 0 20px; }
.scanov-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px;
              justify-content: center; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.scanov-bar .btn { min-width: 118px; justify-content: center; font-size: 15px; padding: 12px 18px; }

/* --- read-a-label (OCR) + attachments ---------------------------------- */
.field-scan { position: relative; }
.field-scan input { padding-right: 4px; }
.ocrbtn { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.field-scan .scanbtn { position: absolute; right: 4px; bottom: 4px; width: 38px; height: 34px; }
.field-scan .ocrbtn { right: 46px; }

.ocrov { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.72);
         display: flex; align-items: center; justify-content: center; padding: 16px; }
.ocrov-card { background: var(--panel); border: 1px solid var(--line);
              border-radius: var(--radius); width: 100%; max-width: 520px;
              max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-2); }
.ocrov-head { display: flex; align-items: center; justify-content: space-between;
              gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ocrov-body { padding: 14px 16px; overflow-y: auto; }
.ocrov-img { display: block; width: 100%; max-height: 190px; object-fit: contain;
             border-radius: var(--radius-sm); background: #000; margin-bottom: 12px; }
.ocrov-status { font-size: 13px; margin-bottom: 10px; }
.ocrov-lines { display: flex; flex-direction: column; gap: 7px; }
.ocrline { text-align: left; background: var(--panel-2); border: 1px solid var(--line);
           color: var(--text); border-radius: var(--radius-sm); padding: 11px 13px;
           font-family: var(--mono); font-size: 14px; cursor: pointer; min-height: 44px; }
.ocrline:hover { border-color: var(--accent-line); background: var(--surface-3); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
              gap: 12px; margin: 14px 0 18px; }
.photo { margin: 0; background: var(--panel-2); border: 1px solid var(--line);
         border-radius: var(--radius-sm); overflow: hidden; }
.photo img { display: block; width: 100%; height: 128px; object-fit: cover; background: #000; }
.photo figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.photo-note { color: var(--ink-dim); }
input[type=file] { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
                   border-radius: var(--radius-sm); padding: 9px 11px; font: inherit; font-size: 13px; }

/* --- dispense label: one per LDPE bag issued to production, 100 x 50 mm --- */
.dlabel { padding: 2.5mm 3.5mm 2mm; justify-content: flex-start; gap: 0; }
.dl-top  { display: flex; justify-content: space-between; align-items: center;
           font-size: 8px; font-weight: 800; letter-spacing: .08em; color: #000;
           border-bottom: .4mm solid #000; padding-bottom: .8mm; }
.dl-bag  { background: #000; color: #fff; padding: .4mm 1.6mm; border-radius: 2px; }
.dl-sku  { font-family: var(--mono); font-size: 17px; font-weight: 700; line-height: 1.1; margin-top: 1.2mm; }
.dl-name { font-size: 8.5px; line-height: 1.2; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6mm 3mm; margin-top: 1.4mm; font-size: 12.5px; line-height: 1.15; }
.dl-grid b { font-weight: 700; }
.dl-cap  { display: inline-block; width: 9mm; font-size: 7.5px; font-weight: 800; letter-spacing: .06em; color: #333; }
.dl-foot { display: flex; align-items: flex-end; gap: 3mm; margin-top: auto; }
.dl-bc   { flex: none; }
.dl-bc svg { display: block; width: 46mm; height: auto; max-height: 10mm; }
.dl-meta { flex: 1; min-width: 0; font-size: 7.5px; line-height: 1.3; color: #000; text-align: right; }
.dl-meta b { font-weight: 700; }
.dl-status { display: inline-block; margin-top: .6mm; border: .4mm solid #000; padding: 0 1.2mm;
             font-size: 7px; font-weight: 800; letter-spacing: .08em; }

/* --- infographic product label ----------------------------------------- */
.plabel { padding: 0; display: flex; flex-direction: column; }
.pl-band { display: flex; align-items: center; gap: 5px; padding: 2mm 3mm;
           background: var(--cat); color: #fff; }
.pl-cat-icon { display: flex; }
.pl-cat-icon svg { display: block; }
.pl-cat { font-size: 11px; font-weight: 800; letter-spacing: .06em; flex: 1; }
.pl-status { display: flex; align-items: center; gap: 4px; background: #fff; color: var(--st);
             border-radius: 3px; padding: 1px 5px 1px 3px; font-size: 9.5px; font-weight: 800;
             letter-spacing: .04em; }
.pl-status svg { display: block; }

.pl-main { display: flex; gap: 3mm; padding: 1.6mm 3mm 0; color: #000; }
.pl-left { flex: 1; min-width: 0; }
.pl-sku { font-family: var(--mono); font-size: 17px; font-weight: 700; line-height: 1.1; }
.pl-name { font-size: 9px; line-height: 1.2; margin-top: .5mm; }
.pl-row { display: flex; gap: 3mm; font-size: 9.5px; margin-top: .8mm; }
.pl-right { text-align: right; flex: none; }
.pl-qty { font-family: var(--mono); font-size: 16px; font-weight: 700; line-height: 1; }
.pl-dest { font-family: var(--mono); font-size: 9px; font-weight: 700; margin-top: 1mm;
           border: 1.2px solid #000; border-radius: 3px; padding: .6mm 1.2mm; }

.pl-handling { display: flex; align-items: center; gap: 2mm; padding: 1mm 3mm 0; color: #000; }
.pl-handling svg { display: block; }
.pl-unit { margin-left: auto; font-size: 8px; text-transform: uppercase;
           letter-spacing: .08em; color: #444; }

.pl-bc { padding: 0 3mm; margin-top: auto; }
.pl-bc svg { display: block; width: 100%; height: auto; max-height: 11mm; }
.pl-code { font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
           text-align: center; color: #000; padding-bottom: 1.4mm; }

/* 100 x 150 mm stock tag (TSC TE244): the same label, everything bigger.
   Code 128 box 77 x 30 mm = 0.5 mm (4-dot) modules; svg_barcode height=114
   in plates.py matches that aspect. */
.thermal.big { width: 100mm; height: 150mm; }
.plabel.big .pl-band { padding: 4mm 5mm; gap: 3mm; }
.plabel.big .pl-cat { font-size: 20px; }
.plabel.big .pl-status { font-size: 15px; padding: 2px 8px 2px 5px; border-radius: 5px; gap: 6px; }
.plabel.big .pl-main { padding: 4mm 5mm 0; gap: 4mm; flex-direction: column; }
.plabel.big .pl-sku { font-size: 34px; }
.plabel.big .pl-name { font-size: 15px; margin-top: 1.5mm; }
.plabel.big .pl-row { flex-direction: column; gap: 1.5mm; font-size: 15px; margin-top: 3mm; }
.plabel.big .pl-row b { font-family: var(--mono); font-size: 24px; }
.plabel.big .pl-right { text-align: left; display: flex; align-items: center; gap: 4mm; }
.plabel.big .pl-qty { font-size: 34px; }
.plabel.big .pl-dest { font-size: 17px; margin: 0; padding: 1.5mm 3mm; border-width: .5mm; }
.plabel.big .pl-handling { padding: 3mm 5mm 0; gap: 4mm; }
.plabel.big .pl-unit { font-size: 13px; }
.plabel.big .pl-bc { padding: 0 5mm; }
.plabel.big .pl-bc svg { width: 77mm; height: 30mm; max-height: none; margin: 0 auto; }
.plabel.big .pl-code { font-size: 20px; padding-bottom: 4mm; letter-spacing: .1em; }
/* "just received" lot on the Label Stock page */
.lp-focus { border-color: var(--accent); box-shadow: var(--ring); }
.lp-focus-tag { display: inline-block; background: var(--accent); color: #0b130f; font-size: 11px;
                font-weight: 800; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }

.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
               gap: 12px; font-size: 13px; color: var(--ink-dim); }

/* =====================================================================
   DASHBOARD
   Colour does two jobs here and no others: MAGNITUDE (one hue, varied by
   length) and STATUS (the reserved steps, always beside a glyph and a word).
   Identity is never carried by hue - four categorical hues were validated and
   rejected, so categories live on the axis label instead.
   ===================================================================== */
.dash-hero { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: 20px;
             background: var(--panel); border: 1px solid var(--line);
             border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px;
             box-shadow: var(--shadow-1); align-items: center; }
.hero-num { font-size: 62px; font-weight: 700; line-height: .95; letter-spacing: -.03em;
            color: var(--accent-bright); }
.hero-unit { font-size: 26px; font-weight: 600; margin-left: 3px; color: var(--accent); }
.hero-cap { color: var(--muted); font-size: 11px; text-transform: uppercase;
            letter-spacing: .09em; font-weight: 600; margin-top: 8px; }
.hero-sub { color: var(--ink-dim); font-size: 13px; margin-top: 10px; }
.hero-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px;
               font-size: 11.5px; color: var(--muted); }
.hero-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.dot-used { background: var(--accent); }
.dot-free { background: var(--surface-3); border: 1px solid var(--line-2); }
.dot-blocked { background: repeating-linear-gradient(45deg,#3a4a41,#3a4a41 2px,#1f2a24 2px,#1f2a24 4px); }

/* one cell per pallet position, walk order left-to-right */
.binfield { display: flex; flex-wrap: wrap; gap: 3px; align-content: flex-start; }
.bc { width: 13px; height: 13px; border-radius: 2.5px; display: block; }
.bc-free    { background: var(--surface-3); border: 1px solid var(--line-2); }
.bc-used    { background: var(--accent); }
.bc-blocked { background: repeating-linear-gradient(45deg,#3a4a41,#3a4a41 2px,#1f2a24 2px,#1f2a24 4px);
              border: 1px solid var(--line-2); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
             gap: 16px; margin-bottom: 18px; }
.dash-grid .card-form { margin-bottom: 0; }

/* meters */
.meter { margin-bottom: 14px; }
.meter-head { display: flex; justify-content: space-between; font-size: 12.5px;
              color: var(--ink-dim); margin-bottom: 6px; }
.meter-track { height: 10px; background: var(--panel-2); border-radius: 5px;
               border: 1px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 5px 0 0 5px; }

/* bar list - label, track, value; the label carries identity, not the hue */
.barlist { display: flex; flex-direction: column; gap: 10px; }
.barrow { display: grid; grid-template-columns: minmax(96px, 30%) 1fr auto; gap: 10px;
          align-items: center; }
.barlab { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-dim); }
.barglyph { font-weight: 700; font-size: 13px; width: 12px; text-align: center; }
.bartrack { height: 12px; background: var(--panel-2); border: 1px solid var(--line);
            border-radius: 6px; overflow: hidden; }
.barfill { height: 100%; border-radius: 6px 0 0 6px; min-width: 2px; }
.barval { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums;
          color: var(--text); min-width: 52px; text-align: right; }
.small { font-size: 11.5px; }

.emptystate { text-align: center; padding: 18px 10px 6px; }
.emptystate-icon { font-size: 34px; color: var(--muted); line-height: 1; margin-bottom: 10px; }
.emptystate p { margin-bottom: 8px; }
.emptystate .btn { margin-top: 10px; }

a.stat-card { text-decoration: none; display: block; }
a.stat-card:hover { border-color: var(--accent-line); }

@media (max-width: 1180px) {
    .dash-hero { grid-template-columns: 1fr; }
    .hero-num { font-size: 52px; }
    .bc { width: 11px; height: 11px; }
}
@media (max-width: 760px) {
    .bc { width: 9px; height: 9px; gap: 2px; }
    .barrow { grid-template-columns: minmax(78px, 34%) 1fr auto; }
    .barval { min-width: 44px; font-size: 11.5px; }
}

/* "Forgot password?" under the sign-in button */
.login-forgot { text-align: center; margin: 14px 0 0; font-size: 14px; }
