/* FiltraMont WMS - pracovné rozhranie skladu.
   Neutrálny podklad, tmavé menu, jeden modrý akcent pre akcie a oranžová/červená len tam, kde treba konať.
   Skladové operácie (príjem, presun, inventúra) majú veľké polia pre dotyk a ručný skener. */
:root {
    --bg: #f3f4f2;
    --panel: #ffffff;
    --panel-2: #f8f9f8;
    --text: #1b2026;
    --muted: #5f6873;
    --faint: #8a929b;
    --line: #e2e5e8;
    --line-strong: #cbd0d6;
    --accent: #1e3a5c;
    --accent-2: #2b5486;
    --accent-weak: #e7eef6;
    --nav: #17212c;
    --nav-2: #213040;
    --nav-text: #b9c4cf;
    --signal: #f0a12b;
    --warn: #a8530a;
    --warn-bg: #fdf1e3;
    --danger: #b42318;
    --danger-bg: #fdecea;
    --ok: #2f7550;
    --ok-bg: #e8f4ed;
    --info-bg: #e7eef6;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 32, .05);
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --top-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--sans); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------------------------------------------------------------- rozloženie */
.shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; }
.top { grid-column: 2; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { grid-row: 1; grid-column: 1; display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--nav);
    color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .01em; border-bottom: 1px solid #0f1720; }
.brand small { color: var(--nav-text); font-weight: 400; margin-left: 2px; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--signal); color: #1b1300;
    font: 700 13px/1 var(--mono); letter-spacing: -.02em; }
.logo.lg { width: 44px; height: 44px; font-size: 18px; border-radius: 8px; }

.search { flex: 0 1 460px; position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 40px 0 36px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel-2); }
.search input:focus { background: var(--panel); }
.search kbd { position: absolute; right: 9px; font: 11px/16px var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 5px; background: var(--panel); }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.who > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.who strong { font-weight: 600; }
.who small { color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-weak); color: var(--accent); font-weight: 600; font-size: 13px; }

.nav { grid-row: 2; grid-column: 1; background: var(--nav); color: var(--nav-text); overflow-y: auto; padding: 10px 10px 20px; }
.nav h6 { margin: 16px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #6f7d8b; }
.nav h6:first-child { margin-top: 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin: 1px 0; color: var(--nav-text);
    text-decoration: none; border-radius: var(--radius); }
.nav a:hover { background: var(--nav-2); color: #fff; }
.nav a.active { background: var(--nav-2); color: #fff; font-weight: 500; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--signal); }
.nav .badge { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 10px; background: var(--signal); color: #1b1300;
    font: 600 12px/20px var(--mono); text-align: center; }
main { grid-row: 2; grid-column: 2; overflow: auto; padding: 22px 28px 48px; min-width: 0; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 8px 0; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- stránka */
.head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { font-size: 22px; line-height: 1.2; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.head .sub { color: var(--muted); padding-bottom: 2px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 15px; font-weight: 600; margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid2 > .card { margin-top: 0; }
.pad { padding: 16px 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: stretch; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back:hover { color: var(--accent-2); }

/* KPI dlaždice */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; text-align: left; background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); border-top: 3px solid var(--line-strong); }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kpi strong { font: 600 26px/1.15 var(--sans); font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.kpi.warn { border-top-color: var(--signal); } .kpi.warn strong { color: var(--warn); }
.kpi.danger { border-top-color: var(--danger); } .kpi.danger strong { color: var(--danger); }
.kpi.ok { border-top-color: var(--ok); }
.kpi.info { border-top-color: var(--accent-2); }
button.kpi { cursor: pointer; font: inherit; }
button.kpi:hover { border-color: var(--line-strong); }
button.kpi.on { outline: 2px solid var(--signal); outline-offset: -1px; }

/* ---------------------------------------------------------------- tabuľky */
.tbl { width: 100%; border-collapse: collapse; background: var(--panel); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.tbl th, .tbl td { height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl th { height: 38px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel-2); position: sticky; top: 0; z-index: 1;
    text-transform: uppercase; letter-spacing: .04em; }
.tbl th[data-k] { cursor: pointer; user-select: none; }
.tbl th[data-k]:hover { color: var(--text); }
.tbl th .sort { font-size: 10px; margin-left: 4px; color: var(--accent-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.wrap { white-space: normal; padding-top: 8px; padding-bottom: 8px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f6f8fa; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.sel { background: var(--accent-weak); }
.tbl tbody tr.alert td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.tbl tbody tr.detail, .tbl tbody tr.detail:hover { background: var(--panel-2); }
.tbl tbody tr.detail > td { padding: 12px 12px 14px; white-space: normal; }
.tbl tfoot td { font-weight: 500; background: var(--panel-2); border-bottom: 0; color: var(--muted); font-size: 13px; }
.tbl .strong { font-weight: 600; }
.tbl .sub2 { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.chev { display: inline-block; width: 14px; color: var(--faint); transition: transform .15s; }
tr.open .chev { transform: rotate(90deg); }

/* lokácie ako čipy */
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 4px; background: #eef0f2; color: #39424c;
    font: 12px/1 var(--mono); white-space: nowrap; }
.chip.more { background: transparent; color: var(--muted); font-family: var(--sans); }
.chip.lg { height: 28px; padding: 0 10px; font-size: 13px; }

/* ukazovateľ zásoby voči minimu: plný pruh = 3× minimum, ryska = minimum */
.meter { position: relative; width: 120px; height: 6px; border-radius: 3px; background: #e8ebee; display: inline-block; vertical-align: middle; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--ok); }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #59636e; border-radius: 1px; }
.meter.warn i { background: var(--signal); }
.meter.danger i { background: var(--danger); }
.meter.sm { width: 64px; }
.meter + small { margin-left: 8px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.meter.info i { background: var(--accent-2); }

/* detail položky (rozbalený riadok) */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.loc { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 16px; width: 100%; max-width: 480px;
    padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; }
.loc-info { min-width: 0; }
.loc .loc-code { display: block; white-space: nowrap; font-weight: 500; line-height: 1.4; }
.loc .loc-warehouse { display: block; margin-top: 4px; font-size: 13px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.loc .loc-quantity { display: block; font-size: 20px; line-height: 1.4; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.loc .acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }


/* ---------------------------------------------------------------- stav: pilulka s bodkou */
.st { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: #eef0f2; color: #4a535d;
    font-size: 13px; font-weight: 500; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa3ad; }
.st.ok { background: var(--ok-bg); color: var(--ok); } .st.ok::before { background: var(--ok); }
.st.warn { background: var(--warn-bg); color: var(--warn); } .st.warn::before { background: var(--signal); }
.st.danger { background: var(--danger-bg); color: var(--danger); } .st.danger::before { background: var(--danger); }
.st.info { background: var(--info-bg); color: var(--accent); } .st.info::before { background: var(--accent-2); }
.head .sub .st, h2 .st { font-size: 12px; height: 22px; }

/* ---------------------------------------------------------------- ovládacie prvky */
form.f { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 14px; align-items: end; }
form.f .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--muted); }
input, select, textarea { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel);
    font-size: 14px; color: var(--text); font-weight: 400; min-width: 0; }
select { padding-right: 28px; }
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: -1px; border-color: var(--accent-2); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
input:disabled { background: var(--panel-2); color: var(--muted); }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong);
    border-radius: var(--radius); background: var(--panel); color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 500; text-decoration: none; }
.btn:hover { background: var(--panel-2); border-color: #b9c0c8; }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #162d48; }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.icon { width: 36px; padding: 0; }
.btn.dashed { border-style: dashed; color: var(--muted); background: transparent; }
.btn.dashed:hover { color: var(--accent-2); border-color: var(--accent-2); }
.btn.lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
a.btn { color: var(--text); }
a.btn.primary { color: #fff; }
.toolbar { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.search-in { position: relative; flex-direction: row; align-items: center; }
.search-in .ic { position: absolute; left: 10px; color: var(--faint); width: 16px; height: 16px; pointer-events: none; }
.search-in input { padding-left: 34px; width: 280px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { height: 16px; width: 16px; }

/* segmentové prepínače a záložky */
.seg, .tabs { display: inline-flex; padding: 3px; gap: 2px; background: #e6e9ec; border-radius: 8px; flex-wrap: wrap; }
.seg button, .tabs button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; white-space: nowrap; }
.seg button:hover, .tabs button:hover { color: var(--text); }
.seg button.on, .tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 32, .12); }
.tabs button b { margin-left: 6px; font: 500 12px var(--mono); color: var(--faint); }
.tabs button.on b { color: var(--accent-2); }

/* hlásenia */
.msg { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); display: flex; gap: 8px; }
.msg.err { border-color: #f1c8c3; background: var(--danger-bg); color: var(--danger); }
.msg.warn { border-color: #f3d7b5; background: var(--warn-bg); color: var(--warn); }
.msg.ok { border-color: #c7e1d1; background: var(--ok-bg); color: var(--ok); }
.msg.info { border-color: #cbd9ea; background: var(--info-bg); color: var(--accent); }
.msg:empty { display: none; }
.msg.flash { animation: flash .6s ease-out; }
@keyframes flash { from { transform: translateY(-3px); opacity: .3; } }

/* ---------------------------------------------------------------- skladové operácie (dotyk + skener) */
.ops-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.ops { padding: 18px 20px 20px; }
.ops input, .ops select { height: 44px; font-size: 15px; }
.ops label { font-size: 13px; }
.scan { position: relative; display: flex; align-items: center; margin-bottom: 18px; }
.scan .scan-ic { position: absolute; left: 12px; color: var(--accent-2); display: flex; }
.scan .scan-ic .ic { width: 22px; height: 22px; }
.scan input { width: 100%; height: 52px; padding: 0 70px 0 46px; font: 500 16px var(--mono); border: 2px solid #c3d2e3; background: #f6f9fc; }
.scan input::placeholder { font-family: var(--sans); font-weight: 400; color: var(--faint); }
.scan input:focus { border-color: var(--accent-2); background: #fff; outline: 3px solid rgba(43, 84, 134, .15); }
.scan .scan-hint { position: absolute; right: 12px; font: 11px/18px var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 6px; background: #fff; }
.unit-in { position: relative; display: flex; align-items: center; }
.unit-in input { width: 100%; padding-right: 46px; }
.unit-in em { position: absolute; right: 12px; font-style: normal; color: var(--muted); font-size: 14px; pointer-events: none; }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); min-height: 16px; }
.hint .mono { font-size: 12px; }
.ops-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ops-foot > :first-child { flex: 1; }

/* riadky príjmu */
.lines { counter-reset: riadok; }
.lines-head, .line { display: grid; grid-template-columns: 30px minmax(0, 2.2fr) minmax(120px, .8fr) minmax(0, 1.2fr) 36px; gap: 12px; align-items: start; }
.lines-head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 0 6px; }
.line { padding: 12px 0; border-top: 1px solid var(--line); }
.line .lbl { display: none; }
.line-no { counter-increment: riadok; display: grid; place-items: center; width: 28px; height: 28px; margin-top: 8px; border-radius: 50%; background: #eef0f2;
    font: 600 12px var(--mono); color: var(--muted); }
.line-no::before { content: counter(riadok); }
.line.filled .line-no { background: var(--accent); color: #fff; }
.line .btn.icon { margin-top: 4px; }
.btn.add { margin-top: 10px; width: 100%; height: 42px; }

/* kroky presunu */
.step { display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.scan + .step { border-top: 0; padding-top: 0; }
.step-no { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #eef0f2; font: 600 12px var(--mono); color: var(--muted); margin-top: 22px; }
.step.done .step-no { background: var(--accent); color: #fff; }
.lbl-top { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(140px, 1fr) auto; gap: 12px; align-items: end; }
.row2 .btn { height: 44px; }
.row2.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.tile { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--panel); cursor: pointer; color: var(--text); font-size: 14px; }
.tile:hover { border-color: var(--accent-2); }
.tile input { position: absolute; opacity: 0; pointer-events: none; height: auto; }
.tile .mono { font-size: 14px; font-weight: 500; }
.tile strong { grid-row: span 2; align-self: center; font-variant-numeric: tabular-nums; font-size: 16px; }
.tile small { color: var(--muted); font-weight: 400; }
.tile:has(input:checked) { border-color: var(--accent-2); background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--accent-2); }
.tile:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel-2);
    border: 1px dashed var(--line-strong); color: var(--muted); }
.preview:empty { display: none; }
.preview .arrow { color: var(--accent-2); font-size: 18px; }
.preview strong { color: var(--text); }

/* počítanie pri inventúre */
.count { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.count-box { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 104px; padding: 14px 16px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--panel-2); }
.count-box > span, .count-box > label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.count-box strong { font: 600 30px/1.1 var(--sans); font-variant-numeric: tabular-nums; }
.count-box small { color: var(--muted); }
.count-box.in { background: #f6f9fc; border-color: #c3d2e3; }
.count-box .unit-in input { height: 54px; font: 600 26px var(--sans); }
.count-box.ok { background: var(--ok-bg); border-color: #c7e1d1; } .count-box.ok strong, .count-box.ok small { color: var(--ok); }
.count-box.warn { background: var(--warn-bg); border-color: #f3d7b5; } .count-box.warn strong, .count-box.warn small { color: var(--warn); }
.count-box.danger { background: var(--danger-bg); border-color: #f1c8c3; } .count-box.danger strong, .count-box.danger small { color: var(--danger); }

/* bočné karty: história relácie, tipy */
.side { display: grid; gap: 12px; }
.log, .tip { padding: 14px 16px; }
.log ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.log li { display: grid; grid-template-columns: 42px 1fr; gap: 8px; font-size: 13px; }
.log time { color: var(--faint); font: 12px/1.5 var(--mono); }
.tip { background: var(--panel-2); box-shadow: none; }
.tip p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.tip p:last-child { margin: 0; }
.tip kbd { font: 11px var(--mono); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; background: #fff; }

/* ---------------------------------------------------------------- zákazky */
.stepper { display: flex; list-style: none; margin: 0 0 18px; padding: 0; counter-reset: krok; overflow-x: auto; }
.stepper li { flex: 1; min-width: 110px; position: relative; padding: 26px 6px 0; text-align: center; font-size: 12px; color: var(--faint); counter-increment: krok; }
.stepper li::before { content: counter(krok); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1; width: 20px; height: 20px; border-radius: 50%;
    background: var(--panel); border: 2px solid var(--line-strong); font: 600 10px/16px var(--mono); color: var(--faint); }
.stepper li::after { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line-strong); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--muted); }
.stepper li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper li.done::after, .stepper li.now::after { background: var(--ok); }
.stepper li.now { color: var(--text); font-weight: 600; }
.stepper li.now::before { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-weak); }
.prog { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.prog strong { font: 600 26px/1 var(--sans); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: #e8ebee; overflow: hidden; margin: 6px 0 12px; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.due { display: block; font-size: 12px; line-height: 1.2; color: var(--muted); }
.due.warn { color: var(--warn); font-weight: 500; }
.due.danger { color: var(--danger); font-weight: 600; }

/* ---------------------------------------------------------------- prihlásenie */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: linear-gradient(rgba(23, 33, 44, .94), rgba(23, 33, 44, .94)), repeating-linear-gradient(135deg, #f0a12b 0 14px, #17212c 14px 28px); }
.login .card { width: 380px; max-width: 100%; padding: 30px 30px 26px; border: 0; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.login .logo { margin-bottom: 16px; }
.login h1 { font-size: 22px; margin: 0 0 4px; }
.login p { margin: 0 0 22px; color: var(--muted); }
.login form { display: grid; gap: 14px; }
.login input { height: 44px; font-size: 15px; }
.login .btn { width: 100%; height: 46px; font-size: 15px; margin-top: 4px; }
.login .msg { margin: 0; }

/* ---------------------------------------------------------------- menšie obrazovky a ručný skener */
@media (max-width: 1100px) {
    .ops-grid { grid-template-columns: 1fr; }
    .side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: auto 1fr; grid-template-rows: var(--top-h) auto 1fr; height: 100vh; }
    .brand { padding: 0 14px; border-bottom: 0; }
    .top { padding: 0 12px; gap: 8px; border-bottom: 0; background: var(--nav); color: #fff; }
    .top .search { display: none; }
    .who small, .who > span:last-child { display: none; }
    .top .btn.ghost { color: var(--nav-text); }
    .top .btn.ghost span { display: none; }
    .nav { grid-row: 2; grid-column: 1 / -1; display: flex; gap: 4px; padding: 6px 8px; overflow-x: auto; border-top: 1px solid #0f1720; }
    .nav h6 { display: none; }
    .nav a { flex: none; padding: 8px 12px; }
    .nav a.active::before { left: 10px; right: 10px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
    main { grid-row: 3; grid-column: 1 / -1; padding: 16px 14px 90px; }
    .head h1 { font-size: 20px; }
    .head .actions { margin-left: 0; width: 100%; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .kpi { padding: 10px 12px; }
    .kpi strong { font-size: 22px; }
    .search-in, .search-in input { width: 100%; }
    .toolbar > * { max-width: 100%; }
    .seg, .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }

    /* tabuľky ako karty */
    .tbl-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; }
    .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; background: transparent; }
    .tbl thead { display: none; }
    .tbl tbody tr { position: relative; margin-bottom: 8px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
    .tbl tbody tr.detail { margin-top: -10px; border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
    .tbl td { height: auto; min-height: 28px; padding: 4px 0; border: 0; white-space: normal; text-align: right; }
    .tbl td.num { text-align: right; }
    .tbl td[data-l]::before { content: attr(data-l); float: left; margin-right: 12px; font-size: 12px; line-height: 20px; color: var(--muted); text-align: left; text-transform: none; font-family: var(--sans); font-weight: 400; }
    .tbl td .chips { display: inline-flex; justify-content: flex-end; }
    .tbl td.go { position: absolute; top: 12px; right: 10px; width: auto; padding: 0; }
    .tbl td:first-child { text-align: left; font-weight: 600; font-size: 15px; padding-right: 30px; }
    .tbl td:first-child::before { display: none; }
    .tbl tbody tr.alert td:first-child { box-shadow: none; }
    .tbl tbody tr.alert { border-left: 3px solid var(--signal); }
    .tbl tbody tr.detail > td { padding: 6px 0 0; }
    .tbl tbody tr.detail > td::before { display: none; }
    .tbl tfoot { display: block; }
    .tbl tfoot tr, .tbl tfoot td { display: block; background: transparent; }
    .meter { width: 90px; }

    .ops { padding: 14px; }
    .lines-head { display: none; }
    .line { grid-template-columns: 30px minmax(0, 1fr) 40px; grid-template-areas: "n . x" "p p p" "q q q" "l l l"; gap: 8px; }
    .line .line-no { margin-top: 0; }
    .line .line-no { grid-area: n; }
    .line > label:nth-of-type(1) { grid-area: p; }
    .line > label:nth-of-type(2) { grid-area: q; }
    .line > label:nth-of-type(3) { grid-area: l; }
    .line .btn.icon { grid-area: x; }
    .line .lbl { display: block; }
    .row2, .row2.two { grid-template-columns: 1fr; }
    .step { grid-template-columns: 1fr; gap: 6px; }
    .step-no { margin-top: 0; }
    .count { grid-template-columns: 1fr 1fr; }
    .count-box.in { grid-column: 1 / -1; order: -1; }
    .count-box { min-height: 84px; }
    .ops-foot { position: sticky; bottom: 0; margin: 18px -14px -14px; padding: 12px 14px; background: var(--panel); box-shadow: 0 -4px 12px rgba(16, 24, 32, .06); border-radius: 0 0 var(--radius) var(--radius); }
    .ops-foot .btn.lg { flex: 1; }
    .ops-foot > span:first-child { flex: none; }
}
@media (pointer: coarse) {
    .btn { min-height: 44px; }
    .btn.sm { min-height: 36px; }
    input, select { min-height: 44px; font-size: 16px; }
}

/* ---------------------------------------------------------------- mapa skladu */
/* Obrázky v img/ (podlaha, regál, krabica) vygeneroval ChatGPT; rozmiestnenie a obsah sa kreslí z dát. */
.m-prepinac { display: inline-flex; padding: 3px; gap: 2px; background: #e6e9ec; border-radius: 8px; }
.m-prepinac button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 14px; height: 30px; cursor: pointer; font-weight: 500; }
.m-prepinac button:hover { color: var(--text); }
.m-prepinac button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 32, .12); }

.m-okno { position: relative; height: calc(100vh - 200px); min-height: 480px; overflow: hidden; border: 1px solid var(--line);
    border-radius: var(--radius); background: #cfd1cc url(img/podlaha.webp) center / cover no-repeat; box-shadow: var(--shadow); }
/* kamera: okno má perspektívu, kamera sa nakláňa (rotateX), plocha sa posúva, otáča a zväčšuje */
.m-okno { perspective: 1100px; perspective-origin: 50% 55%; }
.m-kamera { position: absolute; inset: 0; transform-style: preserve-3d; }
.m-plocha { position: absolute; inset: 0; }
/* čelo regálu stojí kolmo na podlahe na hrane regálu (zhora ho nevidno), kamera ho otočí k nám */
.m-stena { position: absolute; display: none; align-items: flex-end; transform-origin: 50% 100%; transform: rotateX(-90deg); }
.m-stena.aktivna { display: flex; }
/* pozadie čelného pohľadu: obrázok od ChatGPT (ak existuje), inak zadná stena skladu v CSS */
.m-pozadie { position: absolute; inset: 0; opacity: 0; transition: opacity .9s; pointer-events: none;
    background:
        url(img/pozadie-spredu.webp) center bottom / cover no-repeat,
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0 118px, rgba(0, 0, 0, .05) 118px 120px) top / 100% 76% no-repeat,
        linear-gradient(to bottom, #e4e6e9 0, #d3d6da 76%, transparent 76%); }
.m-pozadie.zobraz { opacity: 1; }
.m-plocha.pribl .m-regal:not(.vybrany) { opacity: .2; transition: opacity .6s; }

/* pôdorys: ľavý rad | hlavná ulička | pravý rad; regály dlhou stranou pozdĺž uličky, od vstupu (dole) dozadu */
.m-podorys { position: absolute; inset: 24px 32px 52px; display: grid; grid-template-columns: 1fr 130px 1fr; gap: 0 18px; }
.m-rad { display: flex; flex-direction: column-reverse; gap: 28px; }
.m-rad.vlavo { align-items: flex-end; }
.m-rad.vpravo { align-items: flex-start; }
.m-ulicka { position: relative; background: rgba(255, 255, 255, .18); border-left: 5px solid #e3c344; border-right: 5px solid #e3c344; }
.m-ulicka::after { content: ""; position: absolute; left: 50%; top: 12px; bottom: 12px;
    border-left: 3px dashed rgba(255, 255, 255, .7); }
.m-ulicka span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-90deg); white-space: nowrap; z-index: 1;
    font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: #5d625a; background: #d9dbd6; padding: 3px 10px; border-radius: 2px; }
.m-vstup { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 12px; color: #3f443c;
    background: #f2f3ef; border: 1px solid #b9bcb4; border-radius: 3px; padding: 3px 12px; }

.m-regal { position: relative; flex: 1; display: flex; align-items: stretch; gap: 12px; border: 0; padding: 0; background: none;
    cursor: pointer; text-align: left; transition: opacity .4s, transform .15s; }
.m-regal:hover { transform: translateY(-2px); }
.m-regal:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.m-rad.vlavo .m-regal { flex-direction: row-reverse; text-align: right; }
.m-regal-telo { display: flex; flex-direction: column-reverse; width: 88px; padding: 2% 0;
    background: url(img/regal-zhora.webp) center / 100% 100% no-repeat; filter: drop-shadow(3px 4px 4px rgba(0, 0, 0, .35)); }
.m-pole { flex: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 2px; padding: 6px 14px; }
.m-kocka { width: 20px; height: 20px; background: url(img/krabica-zhora.webp) center / contain no-repeat; }
.m-kocka.pod { filter: drop-shadow(0 0 2px #e0731c) drop-shadow(0 0 2px #e0731c); }
.m-regal-popis { display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: 12px; color: #2f342c;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.m-regal-popis strong { font-size: 15px; color: #111827; }
.m-regal-popis .st { text-shadow: none; align-self: flex-start; }
.m-rad.vlavo .m-regal-popis .st { align-self: flex-end; }

/* priblížený regál: čelný pohľad, polia vedľa seba (obrázok regal-spredu = 1 pole s 3 policami) */
.m-detail { position: absolute; inset: 0; padding: 16px 18px; pointer-events: none; opacity: 0; transition: opacity .4s; }
.m-detail.zobraz { opacity: 1; }
.m-detail.zobraz .m-detail-hlava, .m-detail.zobraz .m-info { pointer-events: auto; }
.m-detail .m-info { position: absolute; top: 16px; right: 18px; width: 280px; }
.m-detail-hlava { display: inline-flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .85); padding: 6px 10px; border-radius: var(--radius); }
.m-detail-hlava h2 { margin: 0; font-size: 18px; }
.m-celo { position: relative; flex: 1; display: flex; justify-content: center; align-items: flex-end; min-height: 0; }
.m-stlpec { position: relative; flex: none; background: url(img/regal-spredu.webp) center / 100% 100% no-repeat; }
.m-stlpec-kod { position: absolute; left: 50%; bottom: -2px; transform: translate(-50%, 100%); font: 11px var(--mono); color: var(--muted); }
.m-bunka { position: absolute; left: 12%; right: 12%; display: flex; align-items: flex-end; justify-content: center; gap: 4%; }
.m-bunka.prazdna::after { content: "voľné"; align-self: center; font-size: 11px; color: rgba(60, 60, 60, .45); }
.m-bunka-kod { position: absolute; left: 0; top: 2px; font: 10px var(--mono); color: #3d423a; background: rgba(255, 255, 255, .75);
    padding: 0 4px; border-radius: 2px; }
.m-krabica { position: relative; flex: none; width: var(--box-w, 110px); aspect-ratio: 360 / 244; padding: 0; border: 0; cursor: pointer;
    background: url(img/krabica-spredu.webp) center / 100% 100% no-repeat; filter: drop-shadow(2px 3px 3px rgba(0, 0, 0, .3));
    transition: transform .12s; }
.m-krabica:hover { transform: translateY(-4px); }
.m-krabica.pod { filter: drop-shadow(0 0 3px #e0731c) drop-shadow(0 0 3px #e0731c); }
.m-krabica.vybrana { filter: drop-shadow(0 0 3px #1f3b5c) drop-shadow(0 0 3px #1f3b5c); }
/* text na bielom štítku krabice (štítok je 26,5–73,5 % na šírku a 33–73 % na výšku obrázka) */
.m-stitok { position: absolute; left: 27%; right: 27%; top: 34%; bottom: 28%; display: flex; flex-direction: column;
    justify-content: center; align-items: center; overflow: hidden; color: #1f2933; line-height: 1.15;
    font-size: max(9px, calc(var(--box-w, 110px) * .08)); }
.m-stitok b { font: 600 1em var(--mono); white-space: nowrap; }
.m-stitok span { font-weight: 600; white-space: nowrap; }
.m-pod-znak { position: absolute; right: 2%; top: -6%; width: 18px; height: 18px; border-radius: 50%; background: #e0731c; color: #fff;
    font: 700 12px/18px var(--sans); text-align: center; }

.m-info { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: start; box-shadow: 0 6px 20px rgba(16, 24, 32, .12); }
.m-info h3 { margin: 0 0 8px; font-size: 15px; }
.m-info .toolbar { margin: 12px 0 0; }
.m-legenda { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 10px; }
.m-legenda .m-kocka { display: inline-block; width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }

@media (prefers-reduced-motion: reduce) {
    .m-plocha, .m-detail, .m-regal, .m-krabica, .spin, .msg.flash { transition: none; animation: none; }
}
.m-krabica[draggable="true"] { cursor: grab; }
.m-krabica.tahana { opacity: .35; }
.m-bunka.ciel { background: rgba(31, 59, 92, .14); outline: 2px dashed #1f3b5c; outline-offset: -2px; border-radius: 3px; }
.m-bunka.ciel.prazdna::after { content: "pustiť sem"; color: #1f3b5c; font-weight: 600; }
.m-info .presun-potvrd { display: grid; gap: 8px; }
.m-info .presun-potvrd input { width: 120px; }
@media (max-width: 860px) {
    .m-okno { height: calc(100vh - 230px); }
    .m-detail .m-info { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; }
}

/* 3D mapa (08-mapa3d.js): plátno three.js */
.m3-okno canvas { display: block; position: absolute; inset: 0; touch-action: none; }

/* popisky k tovaru (voľný text) */
.popisok { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); font-style: italic; white-space: pre-line; overflow-wrap: anywhere; }
.popisok-pole { display: grid; gap: 4px; margin-top: 12px; }
.popisok-pole textarea, .m-info textarea { width: 100%; resize: vertical; min-height: 56px; }
.m-info .popisok-blok { margin-top: 10px; display: grid; gap: 6px; }
