/* Plant ERP · WMS — web console design system
   Inter (self-hosted), navy sidebar, white surfaces on a cool grey canvas, one blue accent,
   status colours only for meaning (ok / warn / bad). Works from 360 px phones to 1920 px screens. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); }

:root {
  --ink: #0B1220; --ink2: #344054; --muted: #667085; --faint: #98A2B3;
  --line: #E4E7EC; --line2: #EEF0F4; --canvas: #F4F6FA; --card: #FFFFFF; --hover: #F7F8FB;
  --navy: #0B1526; --navy2: #13213A; --navy3: #1B2C4A; --navytext: #AEB9CC; --navyhead: #6E7E99;
  --blue: #2563EB; --blue2: #1D4ED8; --bluebg: #EEF4FF; --bluetext: #1E40AF; --ring: rgba(37, 99, 235, .22);
  --ok: #067647; --okbg: #ECFDF3; --okline: #ABEFC6; --warn: #B54708; --warnbg: #FFFAEB; --warnline: #FEDF89;
  --bad: #B42318; --badbg: #FEF3F2; --badline: #FECDCA; --violet: #6941C6; --violetbg: #F4F3FF; --teal: #0E7490; --tealbg: #ECFDFF;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05); --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --r: 12px; --r-sm: 8px; --side: 260px; --top: 64px;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: "cv11", "ss01", "tnum"; color: var(--ink); background: var(--canvas);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; } a:hover { color: var(--blue2); text-decoration: underline; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .95em; }
.muted { color: var(--muted); font-size: 13px; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
h1 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
h2 { margin: 0; font-size: 15px; font-weight: 620; letter-spacing: -.005em; }
h3 { margin: 0; font-size: 14px; font-weight: 620; }
.sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 1px; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--navy) 0%, #0D1A30 100%); color: var(--navytext);
  display: flex; flex-direction: column; padding: 14px 12px 12px; gap: 6px; scrollbar-width: thin; scrollbar-color: var(--navy3) transparent; z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; color: #fff; }
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; color: #fff;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%); box-shadow: 0 4px 12px -2px rgba(37, 99, 235, .55), inset 0 1px 0 rgba(255, 255, 255, .25); flex: none; }
.brand .t1 { font-weight: 650; font-size: 15px; line-height: 1.2; }
.brand .t2 { font-size: 12px; color: var(--navyhead); }
.navgroup { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; }
.navgroup + .navgroup { border-top: 1px solid rgba(255, 255, 255, .05); }
.navgroup h4 { margin: 4px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--navyhead); display: flex; justify-content: space-between; }
.navgroup h4 em { font-style: normal; font-family: var(--mono); letter-spacing: 0; color: #4F5E78; }
.navgroup a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--navytext); font-size: 13.5px; font-weight: 500; text-decoration: none; transition: background .12s, color .12s; }
.navgroup a svg.i { width: 17px; height: 17px; opacity: .75; }
.navgroup a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.navgroup a.on { background: var(--navy3); color: #fff; font-weight: 600; }
.navgroup a.on svg.i { opacity: 1; color: #7DA6FF; }
.navgroup a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #5B8CFF; }
.navgroup a .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #E5484D; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.side .me .n { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.25; }
.side .me .r { font-size: 12px; color: var(--navyhead); }
.side .me button { margin-left: auto; background: none; border: 0; color: var(--navytext); cursor: pointer; padding: 6px; border-radius: 6px; display: grid; place-items: center; }
.side .me button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none;
  background: linear-gradient(135deg, #6366F1, #2563EB); }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 clamp(14px, 2.4vw, 28px);
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--line); }
.top .menu { display: none; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; min-width: 0; }
.crumb b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumb svg.i { width: 14px; height: 14px; color: var(--faint); }
.search { flex: 1 1 auto; max-width: 440px; margin-left: auto; position: relative; display: flex; align-items: center; }
.search svg.i { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 38px; padding-right: 44px; min-height: 40px; background: var(--canvas); border-color: transparent; font-family: inherit; font-weight: 500; }
.search input:focus { background: #fff; border-color: var(--blue); }
.search kbd { position: absolute; right: 10px; font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: #fff; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink2); display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; }
.iconbtn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.iconbtn .badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E5484D; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.netq { display: none; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 16px; background: var(--warnbg); color: var(--warn); font-size: 12px; font-weight: 600; border: 1px solid var(--warnline); }
.netq.on { display: inline-flex; }
.netq.off { background: var(--badbg); color: var(--bad); border-color: var(--badline); }
.userchip { display: flex; align-items: center; gap: 10px; padding: 3px 4px 3px 3px; border-radius: 22px; }
.userchip .n { font-size: 13px; font-weight: 600; line-height: 1.2; }
.userchip .r { font-size: 12px; color: var(--muted); }
.content { padding: 24px clamp(14px, 2.4vw, 32px) 56px; display: flex; flex-direction: column; gap: 18px; max-width: 1480px; width: 100%; margin: 0 auto; }

/* page header */
.ph { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; justify-content: space-between; }
.ph .eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------ surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow-xs); }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.card.flush > .card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h .muted { font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.row > .card { flex: 1 1 360px; }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.kpi-card .lbl { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.chip-i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.chip-i svg.i { width: 18px; height: 18px; }
.c-blue { background: var(--bluebg); color: var(--blue); } .c-ok { background: var(--okbg); color: var(--ok); } .c-warn { background: var(--warnbg); color: var(--warn); }
.c-bad { background: var(--badbg); color: var(--bad); } .c-violet { background: var(--violetbg); color: var(--violet); } .c-teal { background: var(--tealbg); color: var(--teal); }
.kpi { font-size: 28px; font-weight: 680; letter-spacing: -.025em; line-height: 1.15; margin-top: 6px; }
.kpi small { font-size: 14px; font-weight: 550; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.delta.up { background: var(--okbg); color: var(--ok); } .delta.down { background: var(--badbg); color: var(--bad); } .delta.flat { background: var(--line2); color: var(--ink2); }
.bar { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; } .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3B82F6, #2563EB); transition: width .5s ease; }
.bar.ok i { background: linear-gradient(90deg, #12B76A, #039855); } .bar.warn i { background: linear-gradient(90deg, #FDB022, #F79009); } .bar.bad i { background: linear-gradient(90deg, #F97066, #D92D20); }
.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line2); gap: 2px; }
.stackbar i { display: block; height: 100%; min-width: 3px; }
.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.legend .lg { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--hover); border: 1px solid var(--line2); }
.legend .lg span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.legend .lg span i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend .lg b { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.machines { display: flex; flex-direction: column; }
.mrow { display: grid; grid-template-columns: 120px 1fr 120px 70px; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line2); font-size: 13.5px; }
.mrow:first-child { border-top: 0; }
.mrow .num { text-align: right; font-variant-numeric: tabular-nums; }
.mname { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.mname i { width: 8px; height: 8px; border-radius: 50%; background: #12B76A; box-shadow: 0 0 0 3px #D1FADF; }
.mname i.idle { background: var(--faint); box-shadow: 0 0 0 3px var(--line2); }
.donut { display: flex; align-items: center; gap: 18px; }
.donut svg { flex: none; }
.spark { display: block; width: 100%; height: 44px; }

/* ------------------------------------------------------------ tables */
.tbl { overflow: auto; max-height: min(70vh, 760px); border-radius: 0 0 var(--r) var(--r); }
.card:not(.flush) .tbl { margin: 0 -18px -18px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
thead th { position: sticky; top: 0; z-index: 1; background: #F9FAFB; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); text-transform: capitalize; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.code { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
td .kv { font-size: 12.5px; }
.tbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.tbar .filter { position: relative; flex: 0 1 300px; display: flex; align-items: center; }
.tbar .filter svg.i { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--faint); }
.tbar .filter input { min-height: 36px; padding-left: 34px; font-size: 13.5px; }
.tbar .cnt { margin-left: auto; color: var(--muted); font-size: 13px; }
.tbl-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bluebg); color: var(--bluetext); white-space: nowrap; border: 1px solid #D1E0FF; line-height: 18px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.plain::before, .pill.grey.plain::before { display: none; }
.pill.ok { background: var(--okbg); color: var(--ok); border-color: var(--okline); } .pill.warn { background: var(--warnbg); color: var(--warn); border-color: var(--warnline); }
.pill.bad { background: var(--badbg); color: var(--bad); border-color: var(--badline); } .pill.grey { background: #F2F4F7; color: #475467; border-color: var(--line); }
.pill.sop { background: var(--navy); color: #C7D2FE; border-color: var(--navy); font-family: var(--mono); font-size: 11.5px; } .pill.sop::before { display: none; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 34px 16px; color: var(--muted); }
.empty .chip-i { width: 46px; height: 46px; border-radius: 12px; background: var(--line2); color: var(--faint); }
.empty .chip-i svg.i { width: 22px; height: 22px; }
.empty b { color: var(--ink2); font-size: 14px; }

/* ------------------------------------------------------------ forms */
form { display: flex; flex-direction: column; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 18px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink2); min-width: 0; }
label.f.wide { grid-column: 1 / -1; }
label.f span.req { color: var(--bad); }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); border: 1px solid #D0D5DD; border-radius: var(--r-sm); padding: 0 12px; min-height: 42px; background: #fff; width: 100%;
  box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #B4BCC8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--ring); }
input[readonly] { background: var(--hover); }
input.scan { font-family: var(--mono); font-weight: 650; letter-spacing: .01em; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2398A2B3' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M3 6V4a1 1 0 0 1 1-1h2M12 3h2a1 1 0 0 1 1 1v2M15 12v2a1 1 0 0 1-1 1h-2M6 15H4a1 1 0 0 1-1-1v-2M6 6v6M9 6v6M12 6v6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
label.chk { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; min-height: 42px; cursor: pointer; }
label.chk input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--blue); box-shadow: none; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--hover); overflow: hidden; }
.rows .r { display: grid; grid-template-columns: 30px repeat(auto-fit, minmax(140px, 1fr)) 40px; gap: 10px; align-items: end; padding: 12px; border-bottom: 1px solid var(--line); background: #fff; counter-increment: rr; }
.rows { counter-reset: rr; }
.rows .r::before { content: counter(rr); align-self: center; justify-self: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line2); color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 600; margin-top: 20px; }
.rows .r label.f { font-size: 12px; }
.rows > [data-add] { margin: 10px; align-self: flex-start; }
.btn { font: inherit; font-size: 13.5px; font-weight: 600; min-height: 40px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid #D0D5DD; background: #fff; color: var(--ink2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; }
.btn svg.i { width: 16px; height: 16px; }
.btn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--blue2); border-color: var(--blue2); color: #fff; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; } .btn.dark:hover { background: var(--navy3); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; } .btn.ghost:hover { background: var(--line2); }
.btn.danger { color: var(--bad); border-color: var(--badline); } .btn.danger:hover { background: var(--badbg); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { width: 32px; padding: 0; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn:not(.primary).busy::after { border-color: var(--line); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }
.formfoot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 -18px -18px; padding: 14px 18px; border-top: 1px solid var(--line); background: #FCFCFD; border-radius: 0 0 var(--r) var(--r); }
.formfoot .muted { margin-left: auto; }
.linklist { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.linklist a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; color: var(--ink2); font-weight: 500; }
.linklist a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.linklist a svg.i:last-child { margin-left: auto; width: 16px; height: 16px; color: var(--faint); }

/* ------------------------------------------------------------ results, alerts, toasts */
.result { border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; border: 1px solid; }
.result.ok { background: var(--okbg); color: #054F31; border-color: var(--okline); } .result.err { background: var(--badbg); color: #7A271A; border-color: var(--badline); }
.result.warn { background: var(--warnbg); color: #7A2E0E; border-color: var(--warnline); }
.result h3 { margin: 0; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.result .mono { font-size: 12px; opacity: .8; }
.result .tbl { margin: 0; max-height: 360px; border: 1px solid rgba(0, 0, 0, .06); border-radius: 8px; background: #fff; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; } .kv dt { color: inherit; opacity: .72; text-transform: capitalize; } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.alert { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line2); align-items: flex-start; }
.alert:first-child { border-top: 0; padding-top: 0; }
.alert .chip-i { width: 30px; height: 30px; border-radius: 8px; background: var(--warnbg); color: var(--warn); }
.alert .chip-i svg.i { width: 16px; height: 16px; }
.alert.CRITICAL .chip-i { background: var(--badbg); color: var(--bad); }
.alert b { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.alert .t { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 12px 14px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: tin .22s ease; }
.toast svg.i { color: #6CE9A6; } .toast.bad svg.i { color: #FDA29B; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
.skel { border-radius: 8px; background: linear-gradient(90deg, #EEF0F4 0%, #F7F8FA 50%, #EEF0F4 100%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); background: #fff; }
.login .art { position: relative; overflow: hidden; color: #fff; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(1000px 500px at 110% -10%, rgba(59, 130, 246, .38), transparent 60%), radial-gradient(700px 400px at -10% 110%, rgba(99, 102, 241, .25), transparent 60%), linear-gradient(160deg, #0B1526, #0F2142); }
.login .art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(180deg, #000, transparent 85%); pointer-events: none; }
.login .art > * { position: relative; z-index: 1; }
.login .art h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; max-width: 560px; }
.login .art p { color: #AEB9CC; font-size: 15px; max-width: 520px; margin: 14px 0 0; }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; max-width: 640px; }
.feat { display: flex; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.feat .chip-i { background: rgba(91, 140, 255, .16); color: #93B4FF; }
.feat b { display: block; font-size: 13.5px; } .feat span { font-size: 12.5px; color: #93A1B8; }
.login .pane { display: grid; place-items: center; padding: 32px 20px; }
.login form { width: min(400px, 100%); gap: 18px; }
.login form h1 { font-size: 26px; }
.login .foot { font-size: 12px; color: var(--faint); text-align: center; }

/* ------------------------------------------------------------ packing station */
.station { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.weigh { background: linear-gradient(180deg, #0B1526, #13213A); color: #fff; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }
.weigh label.f { color: #AEB9CC; }
.weigh input { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.weigh select { background-color: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.weigh select option { color: var(--ink); }
.weight { font-family: var(--mono); font-size: clamp(56px, 9vw, 104px); font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.weight small { font-size: .35em; color: #7E8CA5; margin-left: 6px; letter-spacing: 0; }
.verdict { border-radius: 12px; padding: 14px 18px; font-size: 28px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 12px; }
.verdict.OK { background: rgba(18, 183, 106, .16); color: #6CE9A6; border: 1px solid rgba(18, 183, 106, .35); }
.verdict.REJECT { background: rgba(240, 68, 56, .16); color: #FDA29B; border: 1px solid rgba(240, 68, 56, .4); }
.dots { display: flex; gap: 8px; } .dots i { flex: 1; height: 34px; border-radius: 8px; background: rgba(255, 255, 255, .08); transition: background .2s; } .dots i.on { background: #12B76A; box-shadow: 0 0 18px -4px #12B76A; }

/* ------------------------------------------------------------ help */
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: s; }
.steps li { display: flex; gap: 14px; counter-increment: s; line-height: 1.6; font-size: 14.5px; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--bluebg); color: var(--blue); border: 1px solid #D1E0FF; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.note { background: var(--warnbg); border: 1px solid var(--warnline); border-radius: 10px; padding: 12px 14px; color: #7A2E0E; }
.helpcard { text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; gap: 8px; }
.helpcard:hover { border-color: #B2CCFF; box-shadow: var(--shadow-sm); text-decoration: none; transform: translateY(-1px); color: inherit; }
.repcard { gap: 10px; } .repcard .actions { margin-top: auto; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) { .split, .station { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .shell.open .side { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(11, 18, 32, .45); z-index: 25; }
  .top .menu { display: grid; }
  .userchip .txt, .search kbd { display: none; }
  .login { grid-template-columns: 1fr; } .login .art { padding: 28px 22px; } .login .feats { display: none; }
}
@media (max-width: 640px) {
  .top { gap: 8px; } .crumb { display: none; } .search { max-width: none; }
  .content { padding-top: 18px; gap: 14px; }
  h1 { font-size: 20px; } .kpi { font-size: 24px; }
  .mrow { grid-template-columns: 90px 1fr 64px; } .mrow .rej { display: none; }
  .rows .r { grid-template-columns: 1fr 1fr 36px; } .rows .r::before { display: none; }
  .card { padding: 14px; } .card:not(.flush) .tbl { margin: 0 -14px -14px; } .formfoot { margin: 0 -14px -14px; padding: 12px 14px; }
}
@media print { .side, .top, .formfoot, .tbar { display: none !important; } .shell { display: block; } .card { box-shadow: none; } body { background: #fff; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* polish */
form.search { flex-direction: row; gap: 0; }
.search svg.i, .search kbd { top: 50%; transform: translateY(-50%); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
.rows .r { display: flex; flex-wrap: wrap; }
.rows .r > label.f { flex: 1 1 110px; min-width: 0; }
.rows .r::before { margin-top: 26px; flex: none; }
.rows .r > [data-del] { align-self: flex-end; margin-bottom: 4px; }
