/* Тендерная витрина — дизайн-система.
   Макет: боковое меню 248px + рабочая область; таблицы плотные, акцент один (сдержанный синий),
   цвет статусов несёт смысл (в работе / внимание / проблема / завершено). */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f2f4f7;
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --accent: #3b5bdb;
  --accent-h: #2f4ac4;
  --accent-soft: #eef2ff;
  --accent-ink: #2f4ac4;
  --ok: #067647;  --ok-soft: #ecfdf3;  --ok-line: #abefc6;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89;
  --bad: #b42318;  --bad-soft: #fef3f2;  --bad-line: #fecdca;
  --info: #175cd3; --info-soft: #eff8ff; --info-line: #b2ddff;
  --violet: #5925dc; --violet-soft: #f4f3ff; --violet-line: #d9d6fe;
  --teal: #0e7090; --teal-soft: #f0f9ff; --teal-line: #b9e6fe;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --radius: 10px;
  --radius-sm: 7px;
  --side-w: 248px;
  --f-ui: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e12; --surface: #14171c; --surface-2: #181c22; --surface-3: #1e232b;
    --line: #262b34; --line-2: #343b46; --ink: #eceef2; --ink-2: #c5cad3; --muted: #8b93a1; --faint: #636b78;
    --accent: #5470e8; --accent-h: #6681f2; --accent-soft: #1c2340; --accent-ink: #a8b8fa;
    --ok: #47cd89; --ok-soft: #0f2a1d; --ok-line: #1f5138;
    --warn: #f5b041; --warn-soft: #2d2410; --warn-line: #5a4517;
    --bad: #f97066; --bad-soft: #2f1513; --bad-line: #5c2622;
    --info: #6aa8f5; --info-soft: #11243d; --info-line: #1f3f66;
    --violet: #a48afb; --violet-soft: #221c3d; --violet-line: #3d3270;
    --teal: #5cc4e6; --teal-soft: #0f2630; --teal-line: #1d4a5c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e12; --surface: #14171c; --surface-2: #181c22; --surface-3: #1e232b;
  --line: #262b34; --line-2: #343b46; --ink: #eceef2; --ink-2: #c5cad3; --muted: #8b93a1; --faint: #636b78;
  --accent: #5470e8; --accent-h: #6681f2; --accent-soft: #1c2340; --accent-ink: #a8b8fa;
  --ok: #47cd89; --ok-soft: #0f2a1d; --ok-line: #1f5138;
  --warn: #f5b041; --warn-soft: #2d2410; --warn-line: #5a4517;
  --bad: #f97066; --bad-soft: #2f1513; --bad-line: #5c2622;
  --info: #6aa8f5; --info-soft: #11243d; --info-line: #1f3f66;
  --violet: #a48afb; --violet-soft: #221c3d; --violet-line: #3d3270;
  --teal: #5cc4e6; --teal-soft: #0f2630; --teal-line: #1d4a5c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
h2 { font-size: 15px; font-weight: 650; margin: 0 0 12px; }
p { margin: 0 0 10px; }
.dim { color: var(--muted); }
.red { color: var(--bad); }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--surface);
  display: grid; place-items: center; font: 700 12px/1 var(--f-ui); letter-spacing: .02em; flex: none; }
.brand-name { font-weight: 650; font-size: 14px; line-height: 1.2; }
.brand-org { color: var(--muted); font-size: 12px; }
.side .new { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 4px 10px;
  padding: 9px 12px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-weight: 600; }
.side .new:hover { background: var(--accent-h); text-decoration: none; }
.navgroup { display: flex; flex-direction: column; gap: 1px; margin-bottom: 10px; }
.navlabel { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 4px; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; }
.navlink:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.navlink.on { background: var(--accent-soft); color: var(--accent-ink); }
.navlink .ico { color: var(--muted); }
.navlink.on .ico { color: var(--accent-ink); }
.navlink .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); }
.me:hover { background: var(--surface-3); text-decoration: none; }
.me.on { background: var(--accent-soft); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--ink-2); flex: none; }
.me-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.me-role { color: var(--muted); font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 32px 0; }
.content { padding: 18px 32px 48px; max-width: 1320px; width: 100%; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
footer.demo-note { padding: 0 32px 24px; color: var(--faint); font-size: 12px; }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
  .topbar { padding: 12px 16px 0; }
  .content { padding: 14px 16px 40px; }
  footer.demo-note { padding: 0 16px 20px; }
}

/* ---------- базовые элементы ---------- */
section, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 500 13.5px/1.3 var(--f-ui);
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.danger { background: var(--surface); border-color: var(--bad-line); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { box-shadow: none; }
.btn.big { padding: 10px 18px; font-size: 14.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.chip:hover { border-color: var(--line-2); text-decoration: none; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.badge.big { font-size: 13px; padding: 3px 11px; }
.urgent { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bad);
  background: var(--bad-soft); border: 1px solid var(--bad-line); padding: 1px 7px; border-radius: 999px; }
.flash { background: var(--ok-soft); border: 1px solid var(--ok-line); color: var(--ink); border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 14px; }
.flash.err { background: var(--bad-soft); border-color: var(--bad-line); }
.flash.info { background: var(--info-soft); border-color: var(--info-line); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 8px 11px; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; padding: 0; }
label { color: var(--ink-2); }

/* таблицы */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
section table, .panel table { box-shadow: none; }

/* ---------- статусы: точка + мягкий фон ---------- */
.eis-status, .badge.st { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.eis-status::before, .badge.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-early { background: var(--surface-3); border-color: var(--line); color: var(--ink-2); }
.st-coord { background: var(--violet-soft); border-color: var(--violet-line); color: var(--violet); }
.st-ana { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.st-tender { background: var(--accent-soft); border-color: var(--line); color: var(--accent-ink); }
.st-ship { background: var(--teal-soft); border-color: var(--teal-line); color: var(--teal); }
.st-done { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.st-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.st-bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.over { background: var(--bad); } .dot.done { background: var(--line-2); }
.me-badge { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); font-size: 11.5px; }
.kind-badge { font-size: 11.5px; }
.ok-badge { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); font-size: 12px; }
.warn-badge { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); font-size: 12px; }

/* ---------- показатели ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px;
  background: none; border: 0; padding: 0; box-shadow: none; }
.kpi { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; }
.kpi b { display: block; font-size: 22px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi.bad b { color: var(--bad); } .kpi.warn b { color: var(--warn); }
a.kpi:hover { border-color: var(--line-2); text-decoration: none; }
.kpi-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kpi-reset b { color: var(--muted); }

/* ---------- реестр ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg a { padding: 5px 11px; border-radius: 5px; color: var(--ink-2); font-weight: 500; font-size: 13px; text-decoration: none; white-space: nowrap; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.filters { display: flex; gap: 8px; margin: 0; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.filters input[name=q] { min-width: 240px; flex: 0 1 320px; }
.reg td { vertical-align: middle; }
.reg tr.row { cursor: pointer; }
.reg tr.row:hover td { background: var(--surface-2); }
.reg .c-num { font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.reg .c-subj a { color: var(--ink); font-weight: 600; }
.reg .c-path { color: var(--muted); font-size: 12px; margin-top: 2px; }
.reg .c-next { font-size: 12.5px; color: var(--ink-2); max-width: 280px; }
.reg .c-next .who { color: var(--muted); }
.reg .c-sla { white-space: nowrap; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.reg .c-sum { text-align: right; white-space: nowrap; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.reg .c-date { white-space: nowrap; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.b2b-head { margin: 0 0 16px; background: var(--surface); }
.b2b-head h1 { margin-bottom: 8px; }
.b2b-note { color: var(--ink-2); font-size: 13.5px; }
.minebar { display: none; }

/* ---------- карточка закупки ---------- */
.eis-card { display: grid; grid-template-columns: minmax(0, 1fr) 300px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; }
.eis-left { padding: 20px 22px; }
.eis-right { padding: 20px 22px; border-left: 1px solid var(--line); background: var(--surface-2); }
.eis-path { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.eis-numline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.eis-num { font-size: 20px; font-weight: 650; color: var(--ink); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.eis-lbl { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.eis-val { font-size: 15px; margin-bottom: 12px; color: var(--ink); }
.eis-val a { color: var(--ink); }
.eis-customer { font-size: 13.5px; color: var(--ink-2); }
.eis-price { font-size: 20px; font-weight: 650; margin-bottom: 14px; font-variant-numeric: tabular-nums; color: var(--ink); }
.eis-dl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.eis-dl .eis-lbl { margin: 0; }
.sla-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.nextbox { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; background: var(--accent-soft);
  border-color: var(--accent-soft); color: var(--ink); padding: 12px 16px; box-shadow: none; }
.actions-panel h2 .dim { font-weight: 500; }
.genrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.genrow form { margin: 0; }
.movef { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 0 0 12px;
  padding: 0 0 12px; border-bottom: 1px solid var(--line); align-items: start; }
.movef:last-of-type { border-bottom: 0; padding-bottom: 0; }
.movef textarea { grid-column: 1 / -1; }
.movef button { justify-content: center; }
.pausebox { margin-top: 12px; }
.pausebox summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.eis-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 0; flex-wrap: wrap; }
.tabbtn { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 12px;
  font: 500 13.5px var(--f-ui); color: var(--muted); cursor: pointer; }
.tabbtn:hover { color: var(--ink); }
.tabbtn.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabpane { display: none; border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.tabpane.on { display: block; }
.zhead { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 0 0 10px; background: none; text-align: left; max-width: none !important; border-radius: 0 !important; }
/* «ключ — значение» */
dl { display: grid; grid-template-columns: 260px minmax(0, 1fr); margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
dl > dt { padding: 9px 14px; font-size: 13px; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line); margin: 0; }
dl > dd { padding: 9px 14px; margin: 0; border-top: 1px solid var(--line); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
dl > dt:first-of-type, dl > dt:first-of-type + dd { border-top: 0; }
@media (max-width: 760px) { .eis-card { grid-template-columns: 1fr; } .eis-right { border-left: 0; border-top: 1px solid var(--line); }
  dl { grid-template-columns: 1fr; } dl > dd { border-top: 0; padding-top: 0; } }
.doclist { margin: 0 0 12px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); }
.doclist li { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.doclist li:first-child { border-top: 0; }
.upload { display: flex; gap: 8px; margin: 8px 0 10px; align-items: center; flex-wrap: wrap; }
.checklist td { padding: 8px 12px; font-size: 13.5px; vertical-align: middle; }
.chk { width: 44px; }
.chkbtn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; width: 26px; height: 26px; cursor: pointer;
  font-size: 13px; color: var(--ink-2); display: grid; place-items: center; padding: 0; }
.chkbtn.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chkbtn.na { background: var(--surface-3); color: var(--muted); border-style: dashed; font-size: 10px; }
.req-to { font-size: 11.5px; color: var(--faint); display: block; }
.route td, .route th { padding: 8px 12px; font-size: 13.5px; }
.route .cur td { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.hist td { font-size: 13px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; margin-bottom: 8px; }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--ink); }
.faq-item p { margin: 6px 0 10px; font-size: 13.5px; color: var(--ink-2); }
.cardhead { margin-bottom: 14px; }
.hold { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.offer { background: var(--info-soft); border: 1px solid var(--info-line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }

/* ---------- формы ---------- */
.cardform { max-width: 860px; display: flex; flex-direction: column; gap: 12px; }
.cardform label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.ztable { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.ztable .zhead { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.zrow { display: grid; grid-template-columns: 300px minmax(0, 1fr); border-top: 1px solid var(--line); }
.zhead + .zrow { border-top: 0; }
.zl { padding: 12px 18px; font-weight: 500; font-size: 13px; color: var(--ink-2); background: var(--surface-2); }
.zr { padding: 9px 12px; }
.zr input, .zr select, .zr textarea { width: 100%; }
.zpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zpair3, .dims3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.zform .check { display: flex; align-items: center; gap: 8px; }
.zform .check input { width: auto; }
@media (max-width: 720px) { .zrow { grid-template-columns: 1fr; } .zl { padding-bottom: 4px; } }
.cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.cols > section { margin: 0; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.form-grid { display: grid; gap: 12px; max-width: 520px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hint { color: var(--muted); font-size: 12.5px; }
.chk { }
label.chk, .chk.line { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
label.chk > span { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--ink); }
.ok { color: var(--ok); font-weight: 600; font-size: 13px; }
ul.plain { margin: 0; padding-left: 18px; line-height: 1.8; color: var(--ink-2); }
pre.msg { white-space: pre-wrap; font: 12.5px/1.45 var(--f-ui); margin: 0; max-width: 520px; color: var(--ink-2); }
.badge.st-sent { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.badge.st-failed { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.badge.st-queued, .badge.st-dry-run { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.badge.st-skipped { color: var(--muted); }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-card { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 500; }
.radio-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.secret { font-family: var(--f-mono); font-size: 16px; padding: 10px 14px; background: var(--surface-2); border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm); display: inline-block; user-select: all; }

/* ---------- аналитика ---------- */
.legend { font-size: 12.5px; color: var(--muted); margin: -6px 0 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sw { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.sw.bar { background: var(--accent); }
.sw.norm { width: 2px; height: 12px; background: var(--ink); }
table.an td, table.an th { padding: 8px 10px; font-size: 13px; }
table.an .num { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.track { position: relative; height: 10px; background: var(--surface-3); border-radius: 5px; min-width: 160px; margin-top: 4px; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 5px; opacity: .85; }
.track .fill.over { background: var(--warn); }
.track .tick { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.track.box { background: transparent; }
.track.box .whisk { position: absolute; top: 4px; height: 2px; background: var(--line-2); }
.track.box .iqr { position: absolute; top: 0; height: 10px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 3px; opacity: .9; }
.track.box .med { position: absolute; top: -3px; height: 16px; width: 3px; background: var(--accent-ink); border-radius: 2px; }
.score { display: inline-block; min-width: 36px; text-align: center; padding: 2px 8px; border-radius: 999px; font-weight: 650;
  font-variant-numeric: tabular-nums; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.score.good { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.score.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }

/* ---------- вход ---------- */
.loginbg { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.loginbox { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 32px; box-shadow: var(--shadow); }
.loginbox .brand { padding: 0 0 18px; }
.loginbox h1 { font-size: 20px; margin: 0 0 4px; }
.loginbox form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.loginbox input { padding: 10px 12px; }
.loginbox .btn { justify-content: center; }
.demo-logins { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.demo-logins code { font-family: var(--f-mono); color: var(--ink-2); }

/* ---------- заголовки страниц, кабинет, пользователи ---------- */
.topbar { display: none; }
@media (max-width: 900px) { .topbar { display: flex; } }
.page-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1 { margin: 0 0 4px; }
.page-title p { margin: 0; max-width: 720px; }
.page-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.page-head h1 { margin: 0 0 2px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.acc { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1000px; }
.acc-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.acc-nav a { padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.acc-nav a:hover { background: var(--surface-3); text-decoration: none; }
@media (max-width: 760px) { .acc { grid-template-columns: 1fr; } .acc-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.setting { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 22px 24px; scroll-margin-top: 20px; }
.setting-h h2 { margin: 0 0 4px; }
.setting-h .hint { margin: 0; max-width: 560px; }
.form-grid.wide { max-width: 640px; }
.form-grid input[disabled] { background: var(--surface-2); color: var(--muted); }
.channel { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ch-l { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px !important; cursor: pointer; }
.ch-l > span { display: flex; flex-direction: column; }
.ch-l b { color: var(--ink); font-weight: 600; }
.sub-h { font-size: 13px; font-weight: 600; color: var(--muted); margin: 8px 0 0; }
.swatch { width: 26px; height: 18px; border-radius: 4px; border: 1px solid var(--line-2); flex: none; }
.sw-light { background: #fff; }
.sw-dark { background: #14171c; }
.sw-auto { background: linear-gradient(135deg, #fff 50%, #14171c 50%); }
.form-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.form-inline label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.new-user { margin-bottom: 16px; }
.new-user:not([open]) { display: none; }
form.inline { display: inline; margin: 0; }
.users td { vertical-align: middle; }
.users tr.off td { opacity: .55; }
.users select { padding: 5px 8px; font-size: 13px; }
.u-cell { display: flex; gap: 10px; align-items: center; }
.u-cell b { color: var(--ink); font-weight: 600; }
.ch-dots { white-space: nowrap; }
.ch-dots span { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; margin-right: 3px;
  color: var(--faint); border: 1px solid var(--line); }
.ch-dots span.on { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.acts { text-align: right; white-space: nowrap; }
.acts .btn { padding: 5px 10px; font-size: 12.5px; }
.copyline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.copyline input { flex: 1 1 360px; font-family: var(--f-mono); font-size: 13px; }
ol.steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.seg .dim { font-size: 12px; margin-left: 2px; }
.filters input[type=search] { min-width: 220px; }

/* реестр: ширины колонок */
.reg .c-subj { min-width: 300px; }
.reg .c-subj a { line-height: 1.35; }
.reg .c-next { width: 230px; min-width: 200px; }
.reg .c-num .c-path { font-family: var(--f-ui); }
.reg td:nth-child(3) { width: 1%; }
.filters select { max-width: 210px; }
.kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.kpi { padding: 12px 14px 11px; }
.kpi span { display: block; line-height: 1.3; }
.movef > button { grid-column: 1 / -1; justify-self: start; max-width: 100%; text-align: left; white-space: normal; }
.movef > .btn { padding: 8px 16px; }
table.an td, table.an th { padding: 8px 8px; }
table.an .track { min-width: 110px; }
table.an { border: 0; border-radius: 0; }
table.an th { background: none; border-bottom: 1px solid var(--line-2); }

/* ---------- телефон ---------- */
@media (max-width: 700px) {
  h1 { font-size: 20px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .kpi { padding: 8px 10px; }
  .kpi b { font-size: 18px; }
  .kpi span { font-size: 11.5px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { justify-content: stretch; }
  .filters select, .filters input[type=search], .filters input[name=q] { flex: 1 1 100%; max-width: none; min-width: 0; }
  .seg { overflow-x: auto; }
  .page-title .btn.primary { display: none; }
  .table-wrap:has(.reg) { box-shadow: none; overflow: visible; }
  table.reg, .reg tbody { display: block; border: 0; background: none; }
  .reg thead { display: none; }
  .reg tr.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
  .reg tr.row td { display: block; padding: 0; border: 0; background: none !important; }
  .reg .c-subj { grid-column: 1 / -1; order: -1; min-width: 0; }
  .reg .c-num { order: 0; } .reg .c-num .c-path { display: none; }
  .reg td:nth-child(3) { width: auto; grid-column: 1 / -1; }
  .reg .c-next { grid-column: 1 / -1; width: auto; min-width: 0; max-width: none; }
  .reg .c-sum { text-align: left; }
}
/* реестр помещается по ширине без горизонтальной прокрутки */
.reg { table-layout: auto; }
.reg td:nth-child(3) { width: auto; }
.reg .eis-status { white-space: normal; max-width: 220px; line-height: 1.3; align-items: flex-start; }
.reg .eis-status::before { margin-top: 5px; }
.reg .c-subj { min-width: 220px; }
.reg .c-next { width: 210px; min-width: 170px; }
.reg .c-sla { white-space: nowrap; }
.reg th, .reg td { padding-left: 10px; padding-right: 10px; }
.reg .c-sum { padding-right: 16px; }
.reg .c-st { min-width: 160px; }
.reg .eis-status { border-radius: 8px; padding: 3px 9px; }
