/* Дизайн-система WMS.
 *
 * Извлечена из disign/index.html (этап 2, docs/migration/README.md) — там она жила
 * инлайновым <style>, а не в styles.css рядом. Подключается только к новому
 * интерфейсу: Razor-страницы продолжают работать на Bootstrap, пока не переведены.
 *
 * Перед каждым color-mix() стоит запасной цвет: браузер без поддержки возьмёт его
 * и получит рабочий, пусть и менее точный вид, вместо прозрачного или чёрного.
 */
:root {
  /* accent (tweakable) */
  --accent: #2D6FDB;
  --accent-weak: rgba(45, 111, 219, .12);
  --accent-weak: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-ink: #24599f;
  --accent-ink: color-mix(in oklab, var(--accent) 80%, black 20%);

  /* semantic */
  --ok: #3FA34D;
  --warn: #E08A1E;
  --bad: #D4453B;
  --purple: #8E44C4;

  /* light theme surfaces */
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --sidebar: #15181e;
  --sidebar-ink: #c5cad3;
  --sidebar-ink-dim: #828a98;
  --ink: #1a1d23;
  --ink-2: #4a525e;
  --ink-3: #79828f;
  --line: #e4e7ec;
  --line-2: #eef1f4;
  --shadow: 0 1px 2px rgba(16,22,34,.06), 0 1px 3px rgba(16,22,34,.04);
  --shadow-lg: 0 6px 24px rgba(16,22,34,.10);

  --radius: 9px;
  --radius-sm: 6px;
  --row-h: 38px;
  --pad: 20px;
  --gap: 16px;
}
[data-theme="dark"] {
  --bg: #0c0e12;
  --panel: #15181e;
  --panel-2: #1a1e25;
  --sidebar: #0a0c10;
  --sidebar-ink: #c5cad3;
  --sidebar-ink-dim: #6b7280;
  --ink: #e8ebf0;
  --ink-2: #aab2bf;
  --ink-3: #79828f;
  --line: #262b33;
  --line-2: #20242b;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
  --accent-weak: rgba(45, 111, 219, .22);
  --accent-weak: color-mix(in oklab, var(--accent) 22%, transparent);
}
[data-density="compact"] { --row-h: 32px; --pad: 14px; --gap: 12px; }

* { box-sizing: border-box; }
/* Прокрутка — документом: каркас нового интерфейса (.shell в shell.css) написан под
   обычную страницу — сайдбар прилипает, контент наращивает высоту. Высоты 100% и
   overflow:hidden здесь ломали это: всё ниже первого экрана оказывалось недостижимо
   на страницах без собственной прокрутки таблиц. */
html, body { min-height: 100%; margin: 0; }
body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-feature-settings: "tnum"; }
.num  { font-family: "IBM Plex Mono", ui-monospace, monospace; font-feature-settings: "tnum"; }
::selection { background: var(--accent-weak); }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(121, 130, 143, .4); background: color-mix(in oklab, var(--ink-3) 40%, transparent); border-radius: 8px; border: 2px solid var(--panel); }
::-webkit-scrollbar-track { background: transparent; }

#root { min-height: 100vh; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: auto 1fr; height: 100vh; }

/* Sidebar */
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; width: 232px; transition: width .18s ease; }
.sidebar.collapsed { width: 64px; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 16px 16px; }
.sb-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; color: #fff; font-weight: 700; }
.sb-brand-txt { overflow: hidden; white-space: nowrap; }
.sb-brand-txt b { display: block; font-size: 14px; color: #fff; letter-spacing: .2px; }
.sb-brand-txt span { font-size: 11.5px; color: var(--sidebar-ink-dim); }
.sb-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.sb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-color: transparent; }
.sb-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--sidebar-ink-dim); padding: 14px 10px 6px; }
.collapsed .sb-group-label { opacity: 0; height: 8px; padding: 0; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; color: var(--sidebar-ink); cursor: pointer; white-space: nowrap; position: relative; user-select: none; }
.sb-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-item.active { background: rgba(255,255,255,.10); color: #fff; }
.sb-item.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sb-item svg { flex: none; width: 18px; height: 18px; opacity: .9; }
.sb-item .lbl { overflow: hidden; }
.sb-item .badge-n { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.12); color: #fff; padding: 1px 7px; border-radius: 20px; }
.collapsed .sb-item .lbl, .collapsed .sb-item .badge-n, .collapsed .sb-brand-txt { display: none; }
.collapsed .sb-brand { justify-content: center; padding: 16px 0; }
.sb-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 12px; display: flex; align-items: center; gap: 10px; }
.sb-ava { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg,#5b8def,#9b5bef); flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; }
.sb-foot-txt { overflow: hidden; white-space: nowrap; line-height: 1.25; }
.sb-foot-txt b { font-size: 12.5px; color: #fff; display: block; }
.sb-foot-txt span { font-size: 11px; color: var(--sidebar-ink-dim); }
.collapsed .sb-foot-txt { display: none; }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { height: 58px; flex: none; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 20px; }
.tb-collapse { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.tb-collapse:hover { background: var(--panel-2); }
.tb-title { display: flex; flex-direction: column; line-height: 1.15; }
.tb-title b { font-size: 15px; font-weight: 600; }
.tb-title span { font-size: 12px; color: var(--ink-3); }
.tb-search { flex: 1; max-width: 380px; margin: 0 8px; position: relative; }
.tb-search input { width: 100%; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); padding: 0 12px 0 34px; font: inherit; font-size: 13px; color: var(--ink); }
.tb-search input:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.tb-search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--ink-3); }
.tb-spacer { flex: 1; }
.tb-pill { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; color: var(--ink-2); }
.tb-icon { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); display: grid; place-items: center; position: relative; }
.tb-icon:hover { background: var(--panel-2); }
.tb-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); border: 1.5px solid var(--panel); }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 0 rgba(63, 163, 77, .6); box-shadow: 0 0 0 0 color-mix(in oklab, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(63, 163, 77, .55);} 70%{box-shadow:0 0 0 6px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }

.content { flex: 1; overflow-y: auto; padding: var(--pad); }
.page { max-width: 100%; margin: 0 auto; }
@media (min-width: 2200px) { .content { padding: var(--pad) max(var(--pad), 3vw); } }

/* ---------- Primitives ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.card-h .sub { font-size: 12px; color: var(--ink-3); }
.card-b { padding: 16px; }
.grid { display: grid; gap: var(--gap); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
h2.page-title { font-size: 19px; font-weight: 600; margin: 0 0 2px; }

.btn { height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; flex: none; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; color: var(--ink-2); }
.chip.active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-weak); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* tables */
.tbl-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: max(240px, calc(100vh - 290px));
  overscroll-behavior: contain;
  /* Таблица сама восстанавливает прокрутку после правки (ui/Table):
     anchoring браузера сдвигает позицию, когда над списком оседает разметка. */
  overflow-anchor: none;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); padding: 6px 14px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; background: var(--panel); vertical-align: bottom; box-shadow: inset 0 -1px 0 var(--line); }
/* border-collapse не «приклеивает» нижнюю границу липкой шапки: при прокрутке строка уходила под
   шапку без разделителя и выглядела наложением. Внутренняя тень рисует линию вместе с фоном. */
.tbl td { padding: 0 14px; height: var(--row-h); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl tbody tr.sel { background: var(--accent-weak); }
.tbl .r { text-align: right; }
.tbl .clickable { cursor: pointer; }

.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--ink-2); height: 28px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; font-weight: 500; }
.seg button.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; gap: 5px; }
.field > label .req { color: var(--bad); }
.inp, .ta, .selbox { width: 100%; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; font: inherit; font-size: 13px; color: var(--ink); }
.inp { height: 38px; padding: 0 12px; }
.inp.mono, .selbox.mono { font-family: "IBM Plex Mono", monospace; }
.ta { min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.inp:focus, .ta:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px var(--accent-weak); }
.inp:disabled { color: var(--ink-3); background: var(--line-2); }
.selwrap { position: relative; }
.selwrap select { -webkit-appearance: none; appearance: none; height: 38px; padding: 0 34px 0 12px; cursor: pointer; }
.selwrap > svg { position: absolute; right: 11px; top: 11px; pointer-events: none; color: var(--ink-3); }
.selwrap select:focus { outline: none; border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 3px var(--accent-weak); }

.tabsbar { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tabsbar button { border: none; background: transparent; color: var(--ink-3); height: 40px; padding: 0 16px; font: inherit; font-size: 13.5px; font-weight: 500; position: relative; }
.tabsbar button:hover { color: var(--ink); }
.tabsbar button.active { color: var(--accent-ink); }
.tabsbar button.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }

.editor-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: calc(-1 * var(--pad)); z-index: 5; margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) var(--pad); }
.toggle { width: 38px; height: 22px; border-radius: 20px; background: var(--line); border: none; position: relative; flex: none; cursor: pointer; transition: background .15s; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle.on::after { left: 18px; }
.sect-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 600; margin: 4px 0 0; }

/* ---------- Context menu + toasts ---------- */
.ctxmenu { position: fixed; z-index: 200; min-width: 214px; max-width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; animation: ctxin .12s ease; }
@keyframes ctxin { from { opacity: 0; transform: scale(.97) translateY(-2px); } to { opacity: 1; transform: none; } }
.ctxitem { display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px; border-radius: 7px; font-size: 13px; color: var(--ink); cursor: pointer; white-space: nowrap; user-select: none; }
.ctxitem:hover { background: var(--accent-weak); color: var(--accent-ink); }
.ctxitem.danger { color: var(--bad); }
.ctxitem.danger:hover { background: rgba(212, 69, 59, .12); background: color-mix(in oklab, var(--bad) 12%, transparent); color: var(--bad); }
.ctxitem.disabled { color: var(--ink-3); pointer-events: none; opacity: .5; }
.ctxitem svg { flex: none; opacity: .85; }
.ctxitem .key { margin-left: auto; font-size: 11px; color: var(--ink-3); font-family: "IBM Plex Mono", monospace; }
.ctxsep { height: 1px; background: var(--line-2); margin: 5px 6px; }
.ctxhdr { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); padding: 7px 10px 4px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toastwrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--sidebar); color: #fff; border-radius: 9px; padding: 10px 15px; font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: toastin .2s ease; }
.toast svg { color: var(--ok); flex: none; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal / windows ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 250; background: rgba(12,16,24,.42); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; overflow-y: auto; animation: mfade .15s ease; }
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,.6); }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px rgba(16,22,34,.28); width: 100%; max-width: 560px; animation: mpop .18s ease; overflow: hidden; }
@keyframes mpop { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-h .sub { font-size: 12px; color: var(--ink-3); }
.modal-b { padding: 20px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--panel-2); }

/* ---------- Nomenclature tree + column filters ---------- */
.tree-node { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--ink); user-select: none; }
.tree-node:hover { background: var(--panel-2); }
.tree-node.active { background: var(--accent-weak); color: var(--accent-ink); font-weight: 600; }
.tree-caret { display: inline-flex; flex: none; width: 16px; color: var(--ink-3); transition: transform .12s; }
.tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-count { font-family: var(--mono, monospace); font-size: 11px; color: var(--ink-3); background: var(--panel-2); border-radius: 20px; padding: 1px 7px; flex: none; }
.tree-node.active .tree-count { background: rgba(45, 111, 219, .18); background: color-mix(in oklab, var(--accent) 18%, transparent); color: var(--accent-ink); }
.nom-tbl thead tr:first-child th { vertical-align: middle; }
.nom-tbl thead .filter-row th { padding: 4px 8px 8px; background: var(--panel); vertical-align: middle; }
input.colf { width: 100%; box-sizing: border-box; height: 30px; padding: 0 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--ink); display: block; }
input.colf:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.colf-sel { height: 30px; display: block; width: 100%; }
.colf-sel .selbox { height: 30px; box-sizing: border-box; width: 100%; font-size: 12px; padding: 0 22px 0 8px; background: var(--panel-2); }

/* ---------- Chat ---------- */
.chat-section { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); padding: 6px 8px 4px; }
.chat-row { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 9px; cursor: pointer; }
.chat-row:hover { background: var(--panel-2); }
.chat-row.active { background: var(--accent-weak); }

/* ---------- Stepper ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.stepper button { width: 34px; height: 34px; border: none; background: transparent; color: var(--ink); font-size: 17px; cursor: pointer; }
.stepper button:hover { background: var(--line-2); }
.stepper span { min-width: 44px; text-align: center; font-weight: 600; font-size: 14px; }

/* ---------- Business process builder ---------- */
.bp-node { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; }
.bp-num { width: 22px; height: 22px; border-radius: "50%"; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; font-weight: 700; font-family: var(--mono, monospace); color: var(--ink-3); flex: none; }
.bp-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bp-conn { width: 2px; height: 16px; background: var(--line); margin-left: 28px; }
.bp-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-2); color: var(--accent-ink); font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; }
.bp-add:hover { border-color: var(--accent); background: var(--accent-weak); }

/* ---------- Print (paper fallback) ---------- */
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
  .no-print { display: none !important; }
}
.paper { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 8px; padding: 22px 24px; }
.paper table { width: 100%; border-collapse: collapse; font-size: 12px; }
.paper th, .paper td { border: 1px solid #aaa; padding: 5px 7px; text-align: left; color: #111; }
.paper th { background: #f0f0f0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.paper .bc { font-family: monospace; letter-spacing: -1px; font-size: 26px; line-height: 1; }

/* ---------- Column manager ---------- */
.cols-bar { display: flex; justify-content: flex-end; padding: 6px 14px 0; }
.cols-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
.cols-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.cols-menu { position: fixed; z-index: 300; width: 234px; max-height: 360px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; animation: ctxin .12s ease; }
.cols-menu-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); padding: 6px 8px 4px; }
.cols-menu-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 6px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.cols-menu-item:hover { background: var(--panel-2); }
.cols-menu-item input { accent-color: var(--accent); width: 14px; height: 14px; flex: none; }
.cols-menu-foot { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 4px; }
.cols-menu-foot button { width: 100%; height: 30px; border: none; background: transparent; color: var(--accent-ink); font: inherit; font-size: 12.5px; font-weight: 500; border-radius: 6px; cursor: pointer; }

/* ---------- Sortable headers ---------- */
.tbl th[data-sortable] { cursor: pointer; user-select: none; }
.tbl th[data-sortable]:hover { color: var(--accent-ink); }
.tbl th[aria-sort='ascending']::after { content: ' ↑'; color: var(--accent-ink); }
.tbl th[aria-sort='descending']::after { content: ' ↓'; color: var(--accent-ink); }

/* Фильтр по столбцу: воронка справа от подписи, при редактировании — поле ввода. */
.tbl .th-label { pointer-events: none; }
.tbl .th-filter {
  margin-left: 5px; padding: 1px 3px; line-height: 0;
  background: none; border: 0; border-radius: 4px; color: var(--ink-3);
  cursor: pointer; vertical-align: middle;
}
.tbl .th-filter:hover { color: var(--accent-ink); background: var(--panel-2); }
.tbl .th-filter.active { color: var(--accent-ink); }
.tbl th.filtering { cursor: default; }
.tbl .th-filter-input {
  display: block; width: 100%; margin-top: 4px; padding: 3px 7px;
  font: inherit; font-size: 12.5px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--accent); border-radius: 6px; outline: none;
}
.cols-menu-foot button:hover { background: var(--accent-weak); }
.colf-sel svg { right: 7px; }



/* tweaks panel */
#tweaks-root { position: fixed; right: 16px; bottom: 16px; z-index: 60; }

.fade-in { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* Единая точка входа в справочники вместо длинного перечня ссылок в меню. */
.directory-page { align-content: start; }
/* Плитки показателей (аналитика, отчёты процессов, график отгрузок) — та же сетка, что у справочников. */
.directory-grid, .kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.directory-tile {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--ink);
  text-decoration: none;
}
.directory-tile:hover { border-color: var(--accent); background: var(--accent-weak); }
.directory-tile strong { font-size: 14px; }
.directory-tile span { color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }
