/* Склад · веб-кабинет. Светлый, спокойный, без лишнего. */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #11161D;
  --muted: #5B6573;
  --faint: #8A939F;
  --line: #E2E6EB;
  --line-soft: #EEF1F4;
  --field: #E9EDF1;
  --accent: #1F4FD8;
  --accent-ink: #163BA6;
  --accent-bg: #EEF2FD;
  --ok: #146C34;
  --ok-dot: #1E9E4A;
  --ok-bg: #E3F4E8;
  --warn: #7A4F00;
  --warn-bg: #FFF1D1;
  --bad: #A3211A;
  --bad-bg: #FCE4E2;
  --extra: #5B2BB5;
  --extra-bg: #EFE7FD;
  --radius: 18px;
  --radius-s: 12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Onest, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 1px 2px rgba(17, 22, 29, .06), 0 8px 24px rgba(17, 22, 29, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- шапка ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); display: grid; place-items: center; }
.nav { display: flex; gap: 20px; font-size: 14px; font-weight: 500; height: 100%; }
.nav a { color: var(--muted); display: flex; align-items: center; border-bottom: 2px solid transparent; }
.nav a.on, .nav a:hover { color: var(--ink); }
.nav a.on { border-bottom-color: var(--ink); }
.me { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.me form { margin: 0; }
.linkbtn { border: 0; background: none; color: var(--muted); padding: 0; font-size: 14px; }
.linkbtn:hover { color: var(--ink); }

.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 24px; }

/* ---------- заголовки ---------- */
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sub { font-size: 14px; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- кнопки и поля ---------- */
.btn { height: 44px; padding: 0 18px; border-radius: var(--radius-s); border: 1px solid #D3D9E0; background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: #B9C1CB; color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #262E39; }
.btn.blue { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.blue:hover { background: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--field); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.small { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.btn.icon { width: 44px; padding: 0; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.input, select.input { height: 44px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid #D3D9E0; background: var(--surface); font-size: 15px; color: var(--ink); width: 100%; min-width: 0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--field); flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 12px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17, 22, 29, .12); }
.seg .cnt { color: var(--faint); font-weight: 500; margin-left: 4px; }
.seg button.on .cnt { color: var(--muted); }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px 22px; }
.card-head { padding: 16px 20px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.pill.open { background: var(--accent-bg); color: var(--accent); }
.pill.closed { background: var(--field); color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--ink); color: #fff; white-space: nowrap; vertical-align: 1px; }
.tag.soft { background: var(--field); color: var(--muted); }
.tag.extra { background: var(--extra-bg); color: var(--extra); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }

.banner { padding: 12px 16px; border-radius: var(--radius-s); background: var(--warn-bg); color: var(--warn); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.banner.info { background: var(--accent-bg); color: var(--accent-ink); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.error { background: var(--bad-bg); color: var(--bad); }

.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.bar.done > i { background: var(--ok-dot); }
.bar.thin { height: 6px; }

/* ---------- список поставок ---------- */
.dlist { display: flex; flex-direction: column; }
.drow { display: grid; grid-template-columns: minmax(0, 1fr) 220px 120px 110px; gap: 24px; align-items: center; padding: 16px 22px; border-top: 1px solid var(--line-soft); color: var(--ink); }
.drow:first-child { border-top: 0; }
.drow:hover { background: #FAFBFC; color: var(--ink); }
.drow .t { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .m { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .prog { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.drow .diff { font-size: 13px; color: var(--muted); text-align: right; }
.drow .diff b { font-size: 15px; color: var(--warn); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty b { color: var(--ink); font-size: 17px; }

.drop { border: 1.5px dashed #C5CDD6; border-radius: var(--radius); padding: 28px; display: flex; align-items: center; gap: 18px; background: #FBFCFD; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-bg); }
.drop input { display: none; }
.drop-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.drop b { display: block; font-size: 15px; }
.drop span { font-size: 13px; color: var(--muted); }

/* ---------- поставка ---------- */
.summary { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.summary-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.big { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.big b { font-size: 36px; font-weight: 700; letter-spacing: -.02em; }
.big .pct { margin-left: auto; font-size: 16px; font-weight: 600; color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(64px, auto)); gap: 28px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: 22px; font-weight: 600; }
.c-ok { color: var(--ok); } .c-warn { color: var(--warn); } .c-bad { color: var(--bad); } .c-extra { color: var(--extra); } .c-muted { color: var(--muted); }

.split { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.split-main { flex: 999 1 640px; min-width: 0; overflow: hidden; }
.split-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.search { position: relative; margin-left: auto; }
.search input { height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); padding: 0 12px 0 32px; font-size: 13px; width: 220px; }
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.search svg { position: absolute; left: 10px; top: 9px; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 12px; white-space: nowrap; }
.tbl td { padding: 13px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .r { text-align: right; }
.tbl tbody tr { cursor: pointer; transition: background .2s; }
.tbl tbody tr:hover { background: #FAFBFC; }
.tbl td.code { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.tbl td.shelf { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.tbl .nm { max-width: 360px; }
.tbl tr.flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { background: #FFF6D6; } 100% { background: transparent; } }
.st { width: 10px; padding-right: 0 !important; }
.st i { display: block; width: 8px; height: 8px; border-radius: 999px; background: #D3D9E0; }
.st-partial i { background: #E8A317; } .st-done i { background: var(--ok-dot); } .st-over i { background: #D93A2F; } .st-extra i { background: #7B4AE0; }

.delta { display: inline-block; padding: 3px 8px; border-radius: 999px; font-weight: 600; min-width: 36px; text-align: center; }
.delta.neg { background: var(--warn-bg); color: var(--warn); }
.delta.pos { background: var(--bad-bg); color: var(--bad); }
.delta.zero { color: var(--ok); }
.delta.ext { background: var(--extra-bg); color: var(--extra); }

.scn { display: flex; align-items: center; gap: 12px; }
.scn .dot { width: 9px; height: 9px; border-radius: 999px; background: #C5CDD6; flex: none; }
.scn .dot.live { background: var(--ok-dot); box-shadow: 0 0 0 4px rgba(30, 158, 74, .14); }
.scn .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.scn .who b { font-size: 15px; font-weight: 600; }
.scn .who span { font-size: 13px; color: var(--muted); }
.scn .q { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.ord { padding: 12px 14px; border-radius: var(--radius-s); background: var(--bg); display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.ord:hover { background: var(--line-soft); }
.ord b { font-size: 13px; }
.ord .s { font-size: 13px; }

/* ---------- боковая панель строки ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(17, 22, 29, .28); z-index: 40; opacity: 0; transition: opacity .2s; }
.drawer-bg.on { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); z-index: 41; box-shadow: -12px 0 40px rgba(17, 22, 29, .15);
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer-body { padding: 18px 22px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.log { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.log-row .q { width: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }
.log-row .w { flex: 1; min-width: 0; }
.log-row .w span { display: block; font-size: 12px; color: var(--muted); }
.log-row.undone { opacity: .45; }
.log-row.undone .q { text-decoration: line-through; }

/* ---------- настройки ---------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 24px; align-items: start; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow span { display: block; font-size: 13px; color: var(--muted); }
.list-row.off { opacity: .5; }
.pair { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.tsd-app { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: var(--line-soft); }
.tsd-app a { word-break: break-all; }
.pr-dot { width: 10px; height: 10px; margin: 0 4px; border-radius: 999px; background: #C5CDD6; flex: none; }
.pr-dot.live { background: var(--ok-dot); box-shadow: 0 0 0 4px rgba(30, 158, 74, .14); }
.qr-sm { width: 96px; height: 96px; flex: none; padding: 6px; background: #fff; border-radius: 10px; }
.qr-sm svg { width: 100%; height: 100%; display: block; }
.pair .qr { width: 200px; height: 200px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.pair .qr img, .pair .qr canvas, .pair .qr svg { width: 100% !important; height: 100% !important; }
.token { font-family: var(--mono); font-size: 13px; background: var(--bg); border-radius: 8px; padding: 8px 10px; word-break: break-all; user-select: all; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 14px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }

/* ---------- вход и установка ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.auth-card.wide { width: min(560px, 100%); }
.auth-card h1 { font-size: 24px; }
.auth-card pre { font-size: 12px; background: var(--bg); padding: 12px; border-radius: 10px; overflow: auto; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: all .2s; z-index: 60; pointer-events: none; box-shadow: var(--shadow); }
.toast.on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 760px) {
  .top-in { padding: 0 16px; gap: 16px; }
  .page { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
  .drow { grid-template-columns: 1fr; gap: 10px; padding: 14px 16px; }
  .drow .diff { text-align: left; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .tbl .hide-s { display: none; }
  .me .nm-me { display: none; }
}

/* ---------- сканер в браузере ---------- */
.sc { min-height: 100vh; display: flex; flex-direction: column; }
.sc-top { height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px; position: sticky; top: 0; z-index: 10; }
.sc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-title span { font-size: 13px; color: var(--muted); }
.sc-box { height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sc-box.on { background: var(--ink); border-color: var(--ink); color: #fff; font-family: var(--mono); }
.sc-net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sc-net i { width: 8px; height: 8px; border-radius: 999px; background: var(--ok-dot); }
.sc-net.off i { background: #D93A2F; }
.sc-net.off { color: var(--bad); }
.sc-body { flex: 1; display: flex; gap: 20px; padding: 20px; max-width: 1400px; width: 100%; margin: 0 auto; align-items: flex-start; }
.sc-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sc-side { flex: 0 0 380px; position: sticky; top: 84px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; overflow: hidden; }
.sc-input { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 16px; transition: border-color .15s, box-shadow .15s; }
.sc-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-bg); }
.sc-input #scan { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 22px; height: 48px; text-transform: uppercase; }
.sc-input #scan::placeholder { text-transform: none; font-family: var(--sans); font-size: 17px; color: var(--faint); }
.sc-qty { width: 72px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); text-align: center; font-size: 17px; font-weight: 600; }

.sc-result { border-radius: 22px; padding: 26px 28px; background: var(--surface); border: 1px solid var(--line); min-height: 250px; display: flex; flex-direction: column; gap: 14px; transition: background .2s, border-color .2s; }
.sc-result.idle { align-items: center; justify-content: center; }
.sc-idle { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); max-width: 420px; }
.sc-idle b { color: var(--ink); font-size: 18px; }
.sc-result.ok { background: #F0FAF3; border-color: #BDE5C9; }
.sc-result.done { background: #E3F4E8; border-color: #9FD7B0; }
.sc-result.over { background: #FDF0EF; border-color: #F2B8B3; }
.sc-result.order { background: #11161D; border-color: #11161D; color: #fff; }
.sc-result.err { background: #FDF0EF; border-color: #F2B8B3; }
.sc-result.extra { background: var(--extra-bg); border-color: #D2C0F7; }
.sc-result.box { background: var(--accent-bg); border-color: #C6D3F7; }
.sc-status { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sc-result.ok .sc-status, .sc-result.done .sc-status { color: var(--ok); }
.sc-result.over .sc-status, .sc-result.err .sc-status { color: var(--bad); }
.sc-result.extra .sc-status { color: var(--extra); }
.sc-result.box .sc-status { color: var(--accent-ink); }
.sc-result.order .sc-status { color: #FFD666; }
.sc-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: end; }
.sc-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; font-weight: 600; }
.sc-code { font-family: var(--mono); font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; word-break: break-all; }
.sc-shelf { font-family: var(--mono); font-size: 40px; font-weight: 600; padding: 4px 16px; border-radius: 14px; border: 2px solid currentColor; line-height: 1.15; white-space: nowrap; }
.sc-name { font-size: 18px; }
.sc-count { font-size: 18px; font-variant-numeric: tabular-nums; }
.sc-count b { font-size: 30px; }
.sc-order { font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.sc-note { font-size: 13px; opacity: .75; }
.sc-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.sc-result.order .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.sc-mode i { width: 30px; height: 18px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; }
.sc-mode i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 999px; background: #fff; transition: transform .15s; }
.sc-mode.on { background: var(--accent-bg); border-color: #C6D3F7; color: var(--accent-ink); font-family: inherit; }
.sc-mode.on i { background: var(--accent); }
.sc-mode.on i::after { transform: translateX(12px); }
.lb-thumb { padding: 0; border: 0; background: #fff; border-radius: 6px; cursor: zoom-in; line-height: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.18); transition: transform .12s; }
.lb-thumb:hover { transform: scale(1.04); }
.lb-thumb img { width: 96px; height: 64px; border-radius: 6px; image-rendering: auto; }
.dk-part { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dk-part .lb-thumb img { width: 120px; height: 80px; }
.orders-up { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; }
.lb-samples { display: flex; gap: 16px; flex-wrap: wrap; }
.lb-samples figure { margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 240px; }
.lb-samples img { width: 240px; height: auto; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 2px 10px rgba(0,0,0,.08); }
.lb-samples figcaption { font-size: 13px; color: var(--muted); }
.lb-big { background: #EEF0F3; border-radius: 14px; padding: 18px; display: flex; justify-content: center; }
.lb-big img { width: 100%; max-width: 480px; aspect-ratio: 3 / 2; background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.dk-orders { display: flex; flex-direction: column; gap: 8px; }
.dk-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); }
.dk-row b { font-size: 24px; letter-spacing: -.01em; }
.dk-row .q { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dk-row .s { font-size: 13px; opacity: .75; }
.dk-row .warn { color: #FFB4AA; opacity: 1; font-weight: 600; }
.dk-info { font-size: 14px; opacity: .85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.dk-dl dt { color: var(--muted); }
.dk-dl dd { margin: 0; font-weight: 500; }
.dk-shelf { display: flex; align-items: baseline; gap: 10px; font-size: 18px; padding-top: 4px; }
.dk-shelf b { font-size: 24px; font-variant-numeric: tabular-nums; }

.sc-hist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.sc-hist-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.hrow { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.hrow:first-child { border-top: 0; }
.hrow .t { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.hrow .w { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .w .mono { margin-right: 8px; }
.hrow .q { font-weight: 600; font-variant-numeric: tabular-nums; }
.hrow.undone { opacity: .4; }
.hrow.undone .q { text-decoration: line-through; }
.hrow.pending .t::after { content: ' ⋯'; }
.hrow.bad .q { color: var(--bad); }

.sc-list { overflow-y: auto; padding: 4px 8px 12px; }
.li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.li:hover { background: var(--bg); }
.li .d { width: 8px; height: 8px; border-radius: 999px; background: #D3D9E0; }
.li.partial .d { background: #E8A317; } .li.done .d { background: var(--ok-dot); } .li.over .d { background: #D93A2F; } .li.extra .d { background: #7B4AE0; }
.li .nm { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .cd { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.li .ct { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.li.hit { background: var(--accent-bg); }

.dlg { border: 0; border-radius: 22px; padding: 0; width: min(460px, calc(100% - 32px)); box-shadow: 0 24px 64px rgba(17,22,29,.25); color: var(--ink); }
.dlg::backdrop { background: rgba(17, 22, 29, .35); }
.dlg-in { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dlg-in h2 { font-size: 20px; }
.dlg-in .actions { justify-content: flex-end; }

@media (max-width: 960px) {
  .sc-body { flex-direction: column; padding: 12px; }
  .sc-side { position: static; flex: none; width: 100%; max-height: none; }
  .sc-code, .sc-shelf { font-size: 30px; }
  .sc-net span { display: none; }
}

.list-row { position: relative; }
.list-row details.more > div { top: 44px; right: 0 !important; }

.drawer { visibility: hidden; }
.drawer.on { visibility: visible; }
@media (max-width: 960px) {
  .sc-main { width: 100%; }
  .sc-top { gap: 8px; padding: 0 8px; }
  .sc-box { padding: 0 10px; font-size: 13px; }
  .sc-input { padding-left: 12px; gap: 6px; }
  .sc-input > svg { display: none; }
  .sc-input #scan { font-size: 18px; }
  .sc-qty { width: 52px; }
  .sc-input .btn { padding: 0 12px; }
  .sc-result { padding: 20px; min-height: 0; }
  .sc-grid { grid-template-columns: 1fr; gap: 12px; }
  .sc-shelf { justify-self: start; }
  .hrow { grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px; }
}
@media (max-width: 600px) {
  .dk-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dk-row .btn { grid-column: 1 / -1; justify-self: start; }
  /* на телефоне переключатели — второй строкой, название поставки не сжимается */
  .sc-top { flex-wrap: wrap; row-gap: 8px; height: auto; padding: 10px 16px; }
  .sc-title { flex: 1 1 calc(100% - 160px); }
  .sc-mode { order: 5; flex: 1 1 0; justify-content: center; }
  #boxChip { order: 6; flex: 1 1 100%; justify-content: center; }
  .sc-mode span { font-size: 12px; }
}
