/* Оформление qisap.
   Палитра — тема заказчика (прислана 19.11.2026: набор переменных в духе shadcn/ui, нейтральные серые «zinc» и акцент
   «rose»): серое рабочее поле, белые блоки с тонкой рамкой и тенью — блок «парит» над фоном; тёмная левая панель
   (значения — из тёмной части той же палитры), акцент — у главных действий, выбранного раздела и рамки ввода.
   Значения записаны как в палитре (oklch); рядом с каждым — её имя. Шрифт и облик — раздел 13.
   Акцент «rose» и «опасное» приглушены (замечание заказчика 20.11.2026: «красный чересчур насыщенный, сделай немного
   пастельным»): тон и светлота ступеней палитры прежние, насыщенность — около двух третей исходной. */
:root {
  --font: "Nunito Sans", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --stretch: 87%;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* поверхности и текст: фон — muted, блок — card, рамка — border, поле ввода — input */
  --bg: oklch(0.967 0.001 286.375); --surface: oklch(1 0 0); --surface-2: oklch(0.967 0.001 286.375);
  --border: oklch(0.92 0.004 286.32); --border-strong: oklch(0.871 0.006 286.286); --border-subtle: oklch(0.967 0.001 286.375);
  --input: oklch(0.92 0.004 286.32);
  /* текст: foreground; второй тон — та же серая шкала на ступень светлее; третий — muted-foreground */
  --text: oklch(0.141 0.005 285.823); --text-2: oklch(0.442 0.017 285.786); --text-3: oklch(0.552 0.016 285.938);

  /* акцент палитры (rose): 50 — primary-foreground, 300 — chart-1, 400 — ring, 500 — chart-2, 600 — primary,
     700 — chart-4, 800 — chart-5, 900 — ring тёмной части; 100 и 200 — промежуточные ступени той же шкалы */
  --rose-50: oklch(0.972 0.011 12.4); --rose-100: oklch(0.946 0.021 12.6); --rose-200: oklch(0.9 0.04 11);
  --rose-300: oklch(0.825 0.075 12); --rose-400: oklch(0.735 0.115 13.5); --rose-500: oklch(0.66 0.15 15);
  --rose-600: oklch(0.585 0.16 15.5); --rose-700: oklch(0.51 0.145 15); --rose-800: oklch(0.45 0.12 14);
  --rose-900: oklch(0.405 0.1 11);
  --brand: var(--rose-600); --brand-hover: var(--rose-700); --brand-active: var(--rose-800); --brand-tint: var(--rose-50);
  /* текст на акценте — белый: с primary-foreground палитры (rose-50) контраст 4,1, с белым — 4,4 */
  --on-brand: #fff;
  /* ссылка — ступень акцента темнее главной: мелкий текст ссылки читается и на белом блоке, и на сером */
  --link: var(--rose-700);
  /* рамка ввода и её ореол (ring) */
  --ring: var(--rose-400); --ring-halo: oklch(0.735 0.115 13.5 / 28%);
  /* нейтральная подсветка (accent палитры): наведение, выбранная строка, включённый переключатель, справочное уведомление.
     Акцентом она не красится: розово-красная подсветка строки читалась бы как ошибка */
  --accent: oklch(0.967 0.001 286.375); --accent-fg: oklch(0.21 0.006 285.885);

  /* прежние имена фиолетовой шкалы — на них опираются страницы. Светлые ступени были подсветкой и стали нейтральными,
     400 — рамка ввода, 600 — акцент, 700 и 900 — текст на подсветке */
  --violet-50: var(--accent); --violet-100: var(--border); --violet-200: var(--border-strong); --violet-300: var(--rose-300);
  --violet-400: var(--ring); --violet-500: var(--rose-500); --violet-600: var(--brand); --violet-700: var(--accent-fg);
  --violet-900: var(--text);

  /* состояния. В палитре есть только «опасное» (destructive); успех и предупреждение — прежние, сервиса.
     Опасное от акцента отличает вид, а не оттенок: акцент — сплошная заливка действия, опасное — светлая плашка
     с тёмно-красным текстом и рамкой */
  --success: #1f9d6b; --success-text: #17694a; --success-tint: #e6f5ee;
  --warn: #c98a1b; --warn-text: #8a5a12; --warn-tint: #fbf2df;
  --danger: oklch(0.6 0.18 25); --danger-text: oklch(0.5 0.17 25); --danger-tint: oklch(0.971 0.013 17.38);
  --info-text: var(--accent-fg); --info-tint: var(--accent);

  /* прежние имена — на них опираются страницы */
  --bg-work: var(--bg); --bg-subtle: var(--surface-2);
  --sb-bg: var(--surface); --sb-border: var(--border); --sb-hover: var(--surface-2); --sb-active: var(--accent); --sb-text: var(--text-2); --sb-muted: var(--text-3);

  /* скругление палитры (radius 0.65rem); у полей и кнопок — на ступень меньше */
  --r-card: 0.65rem; --r-el: calc(0.65rem - 2px);
  /* каждый блок приподнят над фоном (указание заказчика): тень мягкая, нейтральная; наведение — чуть выше */
  --shade: 0.141 0.005 285.823;
  --shadow: 0 1px 2px oklch(var(--shade) / 7%), 0 4px 12px oklch(var(--shade) / 8%);
  --shadow-hover: 0 2px 4px oklch(var(--shade) / 9%), 0 10px 24px oklch(var(--shade) / 13%);
  --shadow-pop: 0 12px 32px oklch(var(--shade) / 20%);
  /* левая панель — тёмная, иконки и подписи белые (указание заказчика); цвета — sidebar тёмной части палитры */
  --side-bg: oklch(0.21 0.006 285.885); --side-text: oklch(0.985 0 0); --side-hover: oklch(0.274 0.006 286.033);
  --side-active: var(--rose-600); --side-on-active: #fff; --side-line: oklch(1 0 0 / 10%);
  /* графики: шкала одного тона от светлого к тёмному (chart-1, chart-2, chart-4 и самая тёмная ступень акцента) */
  --chart-a: var(--rose-500); --chart-b: var(--rose-900);
  --chart-1: var(--rose-300); --chart-2: var(--rose-500); --chart-3: var(--rose-700); --chart-4: var(--rose-900);
  --chart-other: oklch(0.705 0.015 286.067); --chart-grid: var(--border-subtle); --chart-axis: var(--border-strong); --chart-band: var(--accent);
  /* левая панель: раскрытая — иконка с подписью в строку, сложенная — полоса иконок */
  --rail-open: 240px; --rail-closed: 60px;
  --rail-w: var(--rail-open); --top-h: 58px; --monitor-w: clamp(340px, 25vw, 420px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-stretch: var(--stretch); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; font-stretch: normal; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.icon { display: block; flex-shrink: 0; }

/* ——— каркас: узкая панель слева, шапка, рабочее поле ——— */
#nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 7px 16px; }

/* виден программам чтения с экрана, на странице места не занимает */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* выбор организации (в шлюзе — клиента): контурная «пилюля» */
.gw { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: var(--text-2); white-space: nowrap; cursor: help; }
.gw i { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); display: inline-block; }
.gw.ok i { background: var(--success); box-shadow: 0 0 0 3px var(--success-tint); }
.gw.off i { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
/* рабочая область: раздел и монитор сотрудника рядом */
.monitor { flex: 0 0 var(--monitor-w); width: var(--monitor-w); position: sticky; top: calc(var(--top-h) + 1px); height: calc(100vh - var(--top-h) - 1px); display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -2px 0 14px oklch(var(--shade) / 6%); z-index: 4; }
.monitor[hidden] { display: none; }
.monitor-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.monitor-tabs { flex: 1; min-width: 0; display: flex; }
.monitor-tabs button { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 6px; font-size: 13px; }
.monitor-tabs button > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.monitor-count { background: var(--brand); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 16px; padding: 0 6px; flex-shrink: 0; }
.monitor-count.err { background: var(--danger); }
.monitor-count.warn { background: var(--warn); }
.icon-btn { font: inherit; border: 1px solid transparent; background: none; border-radius: 9px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-3); cursor: pointer; flex-shrink: 0; padding: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.monitor-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.monitor-body > .seg { align-self: flex-start; }
.monitor-body .empty { padding: 18px 8px; }
/* задачи в мониторе */
.mon-add { display: flex; gap: 6px; }
.mon-add input[type="text"] { flex: 1; min-width: 0; }
.mon-task { border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; display: grid; gap: 5px; background: var(--surface); box-shadow: var(--shadow); }
.mon-task.overdue { border-color: var(--danger); }
.mon-task-title { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.mon-task-title:hover { color: var(--violet-700); }
.mon-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--text-3); font-size: 12.5px; }
.mon-task select { padding: 3px 24px 3px 8px; font-size: 12.5px; width: auto; }
/* риск-монитор */
.mon-risk { border: 1px solid var(--border); border-left: 4px solid var(--text-3); border-radius: 10px; padding: 9px 11px; display: grid; gap: 3px; background: var(--surface); box-shadow: var(--shadow); }
.mon-risk.high { border-left-color: var(--danger); }
.mon-risk.medium { border-left-color: var(--warn); }
.mon-risk.low { border-left-color: var(--border-strong); }
.mon-risk b { overflow-wrap: anywhere; }
.mon-risk p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.4; }
.mon-risk-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--text-3); }
.mon-ok { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: grid; gap: 3px; }
/* переписка в мониторе */
.mon-feed { flex: 1; min-height: 160px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; padding: 2px; }
.mon-feed .msg-b { max-width: 88%; }
.mon-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.mon-send { display: flex; gap: 6px; align-items: flex-end; flex-shrink: 0; }
.mon-send textarea { flex: 1; min-width: 0; resize: none; }
.mon-send .btn { width: 44px; height: 40px; padding: 0; display: grid; place-items: center; flex-shrink: 0; }
.mon-list { display: flex; flex-direction: column; gap: 2px; }
/* экран уже 1200 точек: монитор не теснит раздел, а выезжает поверх по кнопке */
@media (max-width: 1200px) {
  .monitor { position: fixed; top: 0; right: 0; bottom: 0; height: auto; width: min(420px, 100vw); z-index: 30; box-shadow: var(--shadow-pop); }
}

/* ——— карточки, плитки, сетки ——— */
.grid { display: grid; gap: 14px; }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--shadow); }
/* блок внутри блока второй тени не получает */
.card .card, .card .table-wrap, .card .stat, .card .op { box-shadow: none; }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.card p { margin: 4px 0 0; color: var(--text-2); line-height: 1.45; }
.card.link { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.card.link:hover { border-color: var(--violet-400); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
/* тем, кто просил систему убрать движение, блоки при наведении не сдвигаются */
@media (prefers-reduced-motion: reduce) { .card.link:hover, a.stat:hover { transform: none; } }
.card.soft { background: var(--surface-2); }
.card + .card { margin-top: 14px; }
.grid > .card, .dash > .card { margin-top: 0; }
.card h3 + .form-grid, .card h3 + .table-wrap { margin-top: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 15px 18px 14px; color: inherit; min-width: 0; box-shadow: var(--shadow); }
a.stat { transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
a.stat:hover { text-decoration: none; border-color: var(--violet-400); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.stat-icon { display: block; color: var(--text-3); margin-bottom: 9px; }
.stat-label { color: var(--text-2); font-size: 14px; font-weight: 600; }
.stat-value { font-size: 25px; font-weight: 800; letter-spacing: -0.012em; line-height: 1.15; margin-top: 3px; overflow-wrap: anywhere; }
.stat-sub { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.stat.neg .stat-value { color: var(--danger-text); }
.stat.warn .stat-icon { color: var(--warn); }
.section-title { font-size: 16px; font-weight: 700; margin: 26px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title:first-child { margin-top: 0; }
.bar { height: 6px; background: var(--border-subtle); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar > span { display: block; height: 100%; background: var(--violet-400); border-radius: 999px; }
.empty-state h3 { font-size: 17px; }

/* ——— полоса отбора, поля, кнопки ——— */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer, .actions .spacer { flex: 1; }
/* ——— список документов: отбор, период, флажки, массовые действия (web/list.js) ——— */
.doclist > * > .toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 9px 12px; box-shadow: var(--shadow); }
.period, .range { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.period input[type="date"] { width: 142px; }
.range input { width: 110px; flex: 1 1 90px; }
.filter-toggle.on { background: var(--violet-50); border-color: var(--violet-200); color: var(--violet-700); }
.filter-panel { margin: -6px 0 14px; padding: 14px 16px 6px; }
.filter-panel .period, .filter-panel .range { display: flex; }
.filter-group { grid-column: 1 / -1; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-3); margin: 6px 0 2px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.filter-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.filter-panel .form-grid > .span2 { grid-column: span 2; }
@media (max-width: 560px) { .filter-panel .form-grid > .span2 { grid-column: auto; } }
.filter-panel .period select { flex: 1 1 140px; }
.filter-panel .period input[type="date"] { flex: 1 1 130px; width: auto; }
th.sel, td.sel { width: 38px; padding-right: 0; }
td.sel { cursor: default; }
td.sel input, th.sel input { width: 16px; height: 16px; display: block; margin: 2px 0 0; }
tr.picked td, tr.click.picked:hover td { background: var(--violet-50); }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding: 8px 12px; background: var(--violet-50); border: 1px solid var(--violet-200); border-radius: var(--r-card); position: sticky; top: calc(var(--top-h) + 6px); z-index: 4; box-shadow: var(--shadow); }
.bulk-bar .spacer { flex: 1; }
.bulk-count { color: var(--violet-700); margin-right: 4px; white-space: nowrap; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 13.5px; }
.pager .spacer { flex: 1; }
.outcome-list { margin: 6px 0 0; padding-left: 20px; max-height: 46vh; overflow-y: auto; line-height: 1.45; }
.outcome-list li { margin-bottom: 4px; overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .bulk-bar { top: 6px; }
  .doclist > * > .toolbar > input[type="text"], .doclist > * > .toolbar > .combo { flex: 1 1 100%; width: auto !important; }
  .period { flex: 1 1 100%; }
  .period select { flex: 1 1 100%; }
  .period input[type="date"] { flex: 1 1 120px; width: auto; }
}
.toolbar-label { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 2px 0 4px; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--border-strong); border-radius: var(--r-el); padding: 7px 10px; background: var(--surface); min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
/* поле, которое нельзя изменить (сведения из документа-основания): видно, что оно только для чтения */
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--text-2); opacity: 1; cursor: not-allowed; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-halo); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
textarea { width: 100%; min-height: 110px; font-family: var(--mono); font-size: 12.5px; font-stretch: normal; resize: vertical; }
textarea.plain { font-family: inherit; font-size: inherit; font-stretch: inherit; min-height: 64px; }
input.invalid, input.invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.num-input { text-align: right; font-variant-numeric: tabular-nums; }
.btn { font: inherit; font-weight: 650; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-el); padding: 7px 14px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger-text); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-fill:hover { background: var(--danger-text); }
.btn.small { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 4px 6px; }
.btn.link:hover { background: var(--violet-50); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* переключатель вкладок: чипы на светлой подложке */
.seg { display: inline-flex; gap: 2px; border: 1px solid var(--border); border-radius: 10px; padding: 3px; background: var(--surface-2); max-width: 100%; }
.seg.wrap { flex-wrap: wrap; }
.seg button { font: inherit; font-weight: 600; border: 0; background: transparent; padding: 5px 12px; cursor: pointer; color: var(--text-2); border-radius: 7px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--violet-700); font-weight: 700; box-shadow: 0 0 0 1px var(--border), 0 1px 2px oklch(var(--shade) / 8%); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--violet-50); color: var(--violet-700); border: 1px solid var(--violet-100); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 650; }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; font: inherit; padding: 0 2px; }

/* ——— таблицы ——— */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-card); overflow: auto; background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--text-3); letter-spacing: 0.01em; padding: 10px 14px; background: var(--surface-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--violet-50); }
td.num, th.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; }
.empty { padding: 36px 20px; text-align: center; color: var(--text-3); }
tr.muted-row td { opacity: 0.55; }

/* ——— бейджи, заметки ——— */
.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; background: var(--border-subtle); color: var(--text-2); }
.badge.ok { background: var(--success-tint); color: var(--success-text); }
.badge.warn { background: var(--warn-tint); color: var(--warn-text); }
.badge.err { background: var(--danger-tint); color: var(--danger-text); }
.badge.info { background: var(--violet-100); color: var(--violet-700); }
.dir { font-weight: 650; }
.dir.in { color: var(--success-text); }
.dir.out { color: var(--violet-700); }
.note { border-radius: var(--r-el); padding: 10px 14px; background: var(--warn-tint); color: var(--warn-text); line-height: 1.45; margin: 10px 0; }
.note.ok { background: var(--success-tint); color: var(--success-text); }
.note.err { background: var(--danger-tint); color: var(--danger-text); }
.note.info { background: var(--violet-50); color: var(--violet-700); }
.note ul { margin: 6px 0 0; padding-left: 20px; }
/* доступы организации к госсистемам */
.access-row { padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.access-row:first-child { border-top: 0; padding-top: 4px; }
.access-row .hint { margin: 4px 0 8px; }
.access-row .row-inline input, .access-row .row-inline textarea { flex: 1 1 260px; min-width: 0; max-width: 460px; }
.access-key { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 8px; }
.access-key .btn { flex: 0 0 auto; }
.access-key .hint, .access-key .problem { flex: 1 1 240px; margin: 0; font-size: 13px; }
.access-check .hint.warn { color: var(--warn-text); }
.access-check .note { margin: 10px 0 0; max-width: 640px; }
.access-check .note div { margin-top: 2px; }
/* вход в ИС ЭСФ там, где он понадобился: кнопка под пояснением, ход и отказ — под кнопкой */
.note > .login-inline { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.note > .login-inline + div:not(:empty) { margin-top: 6px; }
.access-check .access-when { margin-top: 6px; font-size: 12.5px; opacity: 0.8; }
/* интеграции организации: карточка на систему, внутри — части со своим состоянием */
.integ-lead { color: var(--text-2); margin: 0 0 14px; max-width: 780px; line-height: 1.45; }
.integ-groups { margin: 0 0 14px; }
.integ-head { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.integ-head h3 { margin: 0; }
.integ > p, .integ-part p { max-width: 780px; }
.integ-part { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.integ-part p { margin-top: 6px; }
.integ .access { margin-top: 10px; }
.integ .note { margin: 10px 0 0; max-width: 780px; }
.integ p.integ-link { margin-top: 10px; font-weight: 650; }
.integ-foot { margin: 14px 2px 0; max-width: 780px; }
/* шаги подписи ЭЦП */
.steps { margin: 0 0 10px; padding-left: 22px; line-height: 1.5; color: var(--text-2); }
.steps li { margin: 0 0 6px; padding-left: 2px; }
.steps li::marker { color: var(--violet-700); font-weight: 700; }
.hint { color: var(--text-3); font-size: 13px; line-height: 1.45; margin: 6px 0 12px; }
.problem { color: var(--danger-text); font-size: 12.5px; margin-top: 4px; }
.neg, .abnormal { color: var(--danger-text); }
.checks { list-style: none; margin: 8px 0 0; padding: 0; }
.checks li { padding: 5px 0; display: flex; gap: 8px; }
.checks .mark { width: 18px; flex-shrink: 0; font-weight: 700; }

/* ——— операции шлюза ——— */
.op { border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; background: var(--surface); box-shadow: var(--shadow); }
.op + .op { margin-top: 8px; }
.op-title { font-weight: 700; }
.op-desc { color: var(--text-2); margin-top: 3px; line-height: 1.4; font-size: 13.5px; }
.op-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ——— окна ——— */
.drawer { position: fixed; inset: 0; z-index: 30; background: oklch(var(--shade) / 22%); display: flex; justify-content: flex-end; }
.drawer-panel { width: min(760px, 96vw); background: var(--surface); height: 100%; overflow-y: auto; box-shadow: var(--shadow-pop); padding: 22px 26px 40px; }
.drawer-panel.wide { width: min(1100px, 98vw); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.drawer-head h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.modal { position: fixed; inset: 0; z-index: 40; background: oklch(var(--shade) / 26%); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; }
#confirm { z-index: 50; }
.modal-panel { width: min(560px, 100%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 22px 24px; }
.modal-panel.small { width: min(440px, 100%); }
.modal-panel h2 { margin: 0 0 14px; font-size: 19px; }
.confirm-text { margin: 0; line-height: 1.5; font-size: 15.5px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field small { color: var(--text-3); line-height: 1.35; }
.field .req { color: var(--danger-text); }
.field input[type="text"], .field input[type="date"], .field select, .field textarea { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 0; }
/* отступы браузера у флажка убраны: с ними строка флажка была 38, а не --ctl-h, и флажок стоял правее края поля */
.check input { width: 16px; height: 16px; flex: none; margin: 0; }
.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline > :first-child { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 7px 14px; margin: 0 0 12px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
pre.code { background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-el); padding: 12px 14px; overflow: auto; max-height: 420px; font-family: var(--mono); font-size: 12.5px; font-stretch: normal; line-height: 1.5; margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
details { margin-top: 12px; }
details > summary { cursor: pointer; font-weight: 650; color: var(--text-2); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--violet-900); color: #fff; border-radius: var(--r-el); padding: 10px 14px; box-shadow: var(--shadow-pop); max-width: 420px; line-height: 1.4; }
.toast.err { background: var(--danger-text); }

/* ——— документ ——— */
.back { display: inline-block; margin-bottom: 10px; color: var(--text-2); font-weight: 600; }
.doc-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 14px; align-items: start; }
.form-grid .span2 { grid-column: span 2; }
.combo { position: relative; display: block; min-width: 0; }
.combo input { width: 100%; }
.combo-list { position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); overflow-y: auto; max-width: 94vw; padding: 4px; font-size: 14.5px; }
.combo-opt { padding: 7px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; line-height: 1.35; }
.combo-opt:hover, .combo-opt.hi { background: var(--violet-50); }
.combo-opt.sel { font-weight: 700; }
.combo-opt .sub { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.combo-empty { padding: 8px 10px; color: var(--text-3); }
.combo-create { border-top: 1px solid var(--border-subtle); border-radius: 0 0 7px 7px; color: var(--violet-700); font-weight: 700; }
.lines { min-width: 840px; }
.lines th, .lines td { padding: 8px 8px; }
.lines td { vertical-align: top; }
.lines input, .lines select { width: 100%; padding: 6px 8px; }
.lines .col-n { width: 34px; color: var(--text-3); padding-top: 15px; }
.lines .col-num { width: 130px; }
.lines .col-qty { width: 100px; }
.lines .col-vat { width: 110px; }
.lines .col-acc { width: 120px; }
.lines .col-x { width: 40px; }
.lines .line-name { margin-top: 4px; }
.sub-analytics { display: grid; gap: 4px; margin-top: 4px; }
.sub-analytics:empty { display: none; }
.totals { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 22px; padding: 12px 4px 0; color: var(--text-2); }
.totals b { color: var(--text); font-variant-numeric: tabular-nums; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.doc-actions .spacer { flex: 1; }
.kind-list { display: grid; gap: 8px; }
.kind-list .btn { justify-content: flex-start; }
.kind-group { font-size: 12.5px; font-weight: 700; color: var(--text-3); margin: 10px 0 2px; }
.kind-group:first-child { margin-top: 0; }

/* ——— отчёты ——— */
.report td.num, .report th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.report th.center { text-align: center; }
.report tr.group td { font-weight: 700; background: var(--surface-3); }
.report tfoot td, .report tr.total td { font-weight: 800; border-top: 2px solid var(--border); background: var(--surface-3); }
.report td.lvl1 { padding-left: 30px; }
.report td.lvl2 { padding-left: 46px; }
.report td.lvl3 { padding-left: 62px; }
/* годовая финансовая отчётность */
.report th.wrap { white-space: normal; min-width: 96px; }
.report.fin td:first-child { min-width: 280px; }
.report.fin-wide { font-size: 13px; }
.report.fin-wide td, .report.fin-wide th { padding: 8px 10px; }
.report td.fin-manual { background: var(--violet-50); font-weight: 700; }
.fin-h { font-size: 15px; margin: 20px 0 8px; }
/* форма на двух языках: русский текст, знак «/», английский курсивом — одно значение на разных языках */
.fin-en { font-style: italic; color: var(--text-2); }
.fin-sep { color: var(--violet-700); font-weight: 800; }
.fin-dot { color: var(--danger-text); font-size: 10px; }

/* ——— выписка банка ——— */
table.bank td { vertical-align: top; }
table.bank .hint { margin: 2px 0 0; }
.bank-purpose { max-width: 340px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.bank-decide { min-width: 250px; }
.bank-decide select, .bank-decide .combo { width: 100%; }
.bank-extra { margin-top: 6px; }
.bank-extra:empty { display: none; }
.money-in { color: var(--success-text); font-weight: 700; }
.money-out { color: var(--text); }

/* ——— сообщения: список чатов слева, лента и ответ справа ——— */
.msg-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }
.msg-controls input[type="search"] { flex: 1 1 200px; max-width: 320px; }
.msg-controls select { max-width: 260px; }
.msg { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
.msg > .card { margin-top: 0; }
.msg-side { padding: 8px; }
.msg-list { max-height: calc(100vh - 244px); min-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.msg-item { font: inherit; color: inherit; text-align: left; border: 0; background: none; border-radius: 9px; padding: 9px 10px; cursor: pointer; display: grid; gap: 2px; min-width: 0; }
.msg-item:hover { background: var(--surface-2); }
.msg-item.on { background: var(--violet-50); }
.msg-item-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg-item-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item-text { color: var(--text-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item-meta, .msg-time { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-unread { background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 17px; flex-shrink: 0; }
.msg-main { padding: 14px 16px; min-width: 0; }
.msg-head { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border-subtle); display: grid; gap: 8px; }
.msg-head-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; overflow-wrap: anywhere; }
.msg-head-tools { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font-size: 13.5px; }
.msg-head-tools .spacer { flex: 1; }
.msg-org { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.msg-org select { padding: 4px 8px; max-width: 280px; }
.msg-back { display: none; justify-self: start; }
/* высота ленты подобрана так, чтобы заголовок чата, лента и поле ответа помещались на экране без прокрутки страницы */
.msg-feed { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 496px); min-height: 240px; overflow-y: auto; padding: 4px 2px; }
.msg-earlier { text-align: center; }
.msg-b { max-width: min(640px, 86%); border-radius: 12px; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border-subtle); align-self: flex-start; min-width: 0; }
.msg-b.out { align-self: flex-end; background: var(--violet-50); border-color: var(--violet-100); }
.msg-b.gone { opacity: 0.7; }
.msg-who { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.msg-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; text-align: right; }
.msg-file { margin-top: 5px; max-width: 100%; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.msg-reply { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.msg-reply .hint { margin: 0 0 8px; }
.msg-reply .note { margin: 0; }
.msg-reply-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.msg-reply-actions .spacer { flex: 1; }
.msg-key { font-size: 12px; }
.msg-attach .chip { max-width: 320px; overflow-wrap: anywhere; }
.msg-steps { margin-top: 10px; max-width: 980px; }
.msg-steps ul { margin: 6px 0 0; padding-left: 20px; }
.msg-steps ul li { margin-bottom: 6px; }
.msg-connect { margin-top: 6px; max-width: 760px; }
@media (max-width: 860px) {
  /* отбор — на всю ширину под вкладками; когда открыт чат, он не нужен и уступает место ленте */
  .msg-controls { flex: 1 1 100%; }
  .msg-controls input[type="search"] { flex: 1 1 100%; max-width: none; }
  .msg-controls select { flex: 1 1 0; max-width: none; }
  .msg-root.chat-open .msg-controls { display: none; }
  .msg { grid-template-columns: minmax(0, 1fr); }
  .msg.open .msg-side, .msg:not(.open) .msg-main { display: none; }
  .msg-back { display: inline-flex; }
  .msg-list { max-height: none; }
  .msg-feed { max-height: 56vh; }
  .msg-key { display: none; }
}

/* ——— сводка: сетка и графики ——— */
.dash { display: grid; gap: 14px; grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1.5fr) minmax(0, 1.5fr); align-items: stretch; }
.chart-card { padding: 15px 18px 16px; min-width: 0; display: flex; flex-direction: column; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.chart-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.chart-head p { margin: 1px 0 0; color: var(--text-3); font-size: 12.5px; }
.chart-toggle { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; color: var(--text-3); cursor: pointer; flex-shrink: 0; padding: 0; }
.chart-toggle:hover { color: var(--text); background: var(--surface-2); }
.chart-toggle.on { background: var(--violet-50); color: var(--violet-700); border-color: var(--violet-200); }
.chart-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.chart-box { width: 100%; min-width: 0; }
.chart-box svg { display: block; }
.chart-tick { font-size: 11.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.chart-unit { font-size: 11px; fill: var(--text-3); }
.chart-value { font-size: 12px; font-weight: 700; fill: var(--text); }
.chart-hit { outline: none; }
.chart-hit:focus-visible { stroke: var(--violet-600); stroke-width: 1.5; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin: 0 0 4px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-empty { color: var(--text-3); padding: 30px 10px; text-align: center; font-size: 13.5px; }
.chart-table { max-height: 300px; overflow: auto; border: 1px solid var(--border-subtle); border-radius: 9px; }
.chart-table th, .chart-table td { padding: 6px 10px; font-size: 13px; }
.chart-tip { position: fixed; z-index: 80; background: var(--violet-900); color: #fff; border-radius: 9px; padding: 8px 11px; font-size: 12.5px; line-height: 1.45; pointer-events: none; box-shadow: var(--shadow-pop); max-width: 300px; }
.chart-tip-title { font-weight: 700; opacity: 0.78; margin-bottom: 2px; }
.chart-tip-row { display: flex; gap: 7px; align-items: center; }
.chart-tip-row i { width: 10px; height: 3px; border-radius: 2px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.chart-tip-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-tip-row span { opacity: 0.78; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donut { flex-shrink: 0; }
.donut-total { font-size: 17px; font-weight: 800; fill: var(--text); }
.donut-list { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 7px; font-size: 13px; }
.donut-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.donut-list i { width: 10px; height: 10px; border-radius: 3px; }
.donut-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.donut-share { color: var(--text-3); font-variant-numeric: tabular-nums; }
.donut-list b { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.hbars { display: grid; gap: 13px; }
.hbar-name { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.hbar-line { display: flex; align-items: center; gap: 8px; }
.hbar-fill { height: 10px; background: var(--chart-a); border-radius: 0 4px 4px 0; flex: 0 0 auto; width: calc((100% - 104px) * var(--r, 0)); min-width: 3px; }
.hbar-line b { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ——— вход, регистрация, фирма: отдельный экран до рабочего места ——— */
.boot { margin: 0; padding: 22vh 20px 0; text-align: center; color: var(--text-3); }
.gate { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 48px; }
.gate-box { width: min(440px, 100%); }
.gate-brand { display: flex; align-items: center; gap: 12px; margin: 0 4px 18px; }
.gate-brand b { display: block; font-size: 24px; font-weight: 800; color: var(--violet-700); letter-spacing: -0.01em; line-height: 1.1; }
.gate-brand small { display: block; color: var(--text-3); font-size: 13px; font-weight: 600; margin-top: 2px; }
.gate-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px 26px 20px; box-shadow: var(--shadow); }
.gate-card h1 { margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -0.012em; }
.gate-lead { margin: 0 0 16px; color: var(--text-2); line-height: 1.5; }
.gate-form { display: block; }
.gate-form input { width: 100%; padding: 9px 12px; }
.gate-form input[readonly] { background: var(--surface-2); color: var(--text-2); }
.gate-form .row-inline .btn { flex: 0 0 auto; min-width: 92px; justify-content: center; }
.gate-form .note { margin: 4px 0 12px; }
.gate-submit { width: 100%; justify-content: center; padding: 10px 14px; font-size: 15.5px; margin-top: 4px; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gate-foot { margin: 14px 0 0; color: var(--text-3); font-size: 13.5px; line-height: 1.5; }
.gate-foot .btn.link { padding: 1px 4px; font-size: inherit; }
.gate-list { display: grid; gap: 8px; }
.gate-pick { font: inherit; text-align: left; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-el); padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--text); }
.gate-pick:hover { border-color: var(--violet-400); background: var(--violet-50); }
.gate-pick b { font-weight: 700; overflow-wrap: anywhere; }
.gate-pick small { color: var(--text-3); white-space: nowrap; }
.field input[type="email"], .field input[type="password"] { width: 100%; }

/* ——— шапка: фирма и пользователь ——— */
.account { position: relative; flex-shrink: 0; min-width: 0; }
.account-btn { font: inherit; display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: none; border-radius: 999px; padding: 3px 8px 3px 3px; cursor: pointer; color: var(--text-3); max-width: 250px; }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 290px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; }
.account-head { padding: 9px 10px 10px; display: grid; gap: 2px; }
.account-head b { overflow-wrap: anywhere; }
.account-head small { color: var(--text-3); font-size: 12.5px; overflow-wrap: anywhere; }
.account-label { padding: 6px 10px 3px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.account-sep { height: 1px; background: var(--border-subtle); margin: 5px 4px; }
.account-item { font: inherit; width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--text); text-align: left; font-weight: 600; }
.account-item .icon { color: var(--text-3); }
.account-item:hover { background: var(--violet-50); color: var(--violet-700); }
.account-item:hover .icon { color: var(--violet-600); }
.gw.wait i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-tint); }

/* пункт, прижатый к самому низу панели («Интеграции»): панель разделов занимает всю высоту, отступ над прижатым
   блоком забирает свободное место. Если разделов больше, чем помещается по высоте, блок остаётся на виду у нижнего
   края, а список прокручивается за ним — фон у блока сплошной, поэтому пункты не накладываются друг на друга */
#nav { flex: 1 0 auto; padding-bottom: 0; }
/* невысокий экран: пункты панели плотнее, чтобы все разделы помещались без прокрутки */
@media (max-height: 860px) {
  #nav { gap: 1px; padding-top: 6px; }
    }
/* с прижатым пунктом панель стала длиннее: на широком экране она уплотняется раньше, а на невысоком (ноутбук) — сильнее,
   чтобы разделы и прижатый пункт помещались без прокрутки. Узкого экрана (панель внизу) это не касается */
@media (min-width: 861px) and (max-height: 1070px) {
  #nav { gap: 1px; padding-top: 6px; }
    }
@media (min-width: 861px) and (max-height: 890px) {
  #nav { gap: 0; padding-top: 4px; }
        }
.soon-card { max-width: 720px; padding: 24px 26px; }
.soon-card h3 { font-size: 19px; margin-bottom: 8px; }
.soon-card p { margin-top: 8px; }
.soon-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--violet-50); color: var(--violet-600); margin-bottom: 14px; }

/* ——— команда ——— */
.card h4 { margin: 18px 0 8px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.invite-form { margin-top: 12px; grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) auto; align-items: end; }
.invite-link { margin-top: 8px; }
.invite-link input { background: var(--surface); }
td select { padding: 4px 8px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ——— средняя ширина ——— */
@media (max-width: 1320px) {
  .gw span { display: none; }
  .account-btn { padding: 3px; }
}
@media (max-width: 1240px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ——— узкий экран: панель разделов уходит вниз ——— */
@media (max-width: 860px) {
      #nav { flex-direction: row; padding: 4px 6px; gap: 2px; }
                                .account-btn { padding: 3px; }
  .invite-form { grid-template-columns: minmax(0, 1fr); }
  .gate { padding-top: 5vh; }
  .gate-card { padding: 20px 18px 16px; }
    .dash { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
  .stat-value { font-size: 21px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .form-grid .span2 { grid-column: auto; }
  .totals { justify-content: flex-start; }
  .toasts { bottom: 80px; right: 12px; left: 12px; }
  .drawer-panel { padding: 16px 14px 90px; }
  .modal { padding: 4vh 10px 90px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   БЛОЧНАЯ СХЕМА (аудит интерфейса, указание заказчика 18.11.2026)
   Правила, по которым выстроена каждая страница:
     1. каждый объект страницы — отдельный блок (белая плашка с рамкой и тенью); текста «на фоне» нет;
     2. блоки стоят в один столбец с одним и тем же промежутком (--gap);
     3. элементы управления одной высоты (--ctl-h, мелкие — --ctl-h-sm) и в ряду стоят на одной линии по центру.
   Размеры берутся только из переменных; новый элемент управления или блок не задаёт своих высот и отступов.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
:root { --ctl-h: 36px; --ctl-h-sm: 30px; --gap: 12px; --gap-sm: 8px; --pad: 16px; --surface-3: oklch(0.985 0 0); }
/* полоса прокрутки не сдвигает страницу: правый край блоков одинаков на всех страницах */
html { scrollbar-gutter: stable; }

/* ——— 1. столбец блоков: страница и безымянные обёртки внутри неё; промежуток один ——— */
#view > * > *, #view > * > div:not([class]) > *, #view .doclist > * { margin-bottom: 0; }
#view > * > * + *, #view > * > div:not([class]) > * + *, #view .doclist > * + * { margin-top: var(--gap); }
#view > * > :first-child, #view > * > div:not([class]) > :first-child, #view .doclist > :first-child { margin-top: 0; }
.card + .card { margin-top: var(--gap); }
.tiles { gap: var(--gap); margin-bottom: var(--gap); }
.dash { gap: var(--gap); }

/* ——— 2. каждый объект — блок ——— */
.card { padding: var(--pad); }
.card h3 { margin: 0 0 6px; }
/* подсказка, вводный текст и «пусто» на уровне страницы — тоже блок, а не текст на фоне */
#view > * > p, #view > * > div:not([class]) > p, #view .doclist > p,
#view > * > .hint, #view > * > div:not([class]) > .hint,
#view > * > .empty, #view > * > div:not([class]) > .empty,
#view > * > div:not([class]) > div:not([class]) > p, #view > * > div:not([class]) > div:not([class]) > .hint, #view > * > div:not([class]) > div:not([class]) > .empty {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 16px; box-shadow: var(--shadow);
  color: var(--text-2); font-size: 13.5px; line-height: 1.45; max-width: none;
}
/* уведомление — блок со своей рамкой по тону; на уровне страницы приподнято, как остальные блоки */
.note { border: 1px solid #f0dfb6; margin: var(--gap-sm) 0; }
.note.ok { border-color: #cfe9dc; }
.note.err { border-color: #f3cfcc; }
.note.info { border-color: var(--violet-100); }
#view > * > .note, #view > * > div:not([class]) > .note, #view > * > div:not([class]) > div:not([class]) > .note, #view .doclist > .note { box-shadow: var(--shadow); border-radius: var(--r-card); padding: 12px 16px; }
/* панель действий — блок на уровне страницы и внутри обёрток (в отчётах строка настроек лежит во второй безымянной
   обёртке); внутри карточки она рядом, без второй рамки */
.toolbar { gap: var(--gap-sm); align-items: center; margin-bottom: var(--gap); }
#view > * > .toolbar, #view > * > div:not([class]) > .toolbar, #view > * > div:not([class]) > div:not([class]) > .toolbar,
#view .doclist > .toolbar, #view .doclist > * > .toolbar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 14px; box-shadow: var(--shadow);
  min-height: calc(var(--ctl-h) + 22px); box-sizing: border-box;
}
.card .toolbar { background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; }
/* отбор корреспонденций: растягивается строка поиска, счётчик стоит у правого края и не падает на отдельную строку */
.corr-filters > input { flex: 1 1 180px; }
.corr-filters > .toolbar-label { margin-left: auto; }

/* ——— 3. элементы управления: одна высота ——— */
.btn { height: var(--ctl-h); padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; line-height: 1.2; box-sizing: border-box; vertical-align: middle; }
.btn.small { height: var(--ctl-h-sm); padding: 0 10px; }
.btn.link { height: var(--ctl-h-sm); padding: 0 8px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]), select {
  height: var(--ctl-h); padding-top: 0; padding-bottom: 0; box-sizing: border-box; vertical-align: middle;
}
td select, .mon-task select { height: var(--ctl-h-sm); }
.seg { height: var(--ctl-h); box-sizing: border-box; align-items: stretch; vertical-align: middle; }
.seg button { padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; }
.seg.wrap { height: auto; }
.seg.wrap button { height: calc(var(--ctl-h) - 8px); }
.chart-toggle, .icon-btn { width: 34px; height: 34px; }

/* ——— 4. ряды: элементы на одной линии, по центру; поля формы — по верхней линии, кнопка без подписи — на линии полей ——— */
.actions, .row-inline, .row-actions { align-items: center; gap: var(--gap-sm); }
.actions { margin-top: var(--gap); }
.chart-head { align-items: center; }
.form-grid { gap: 0 var(--gap); }
.field { margin-bottom: 14px; }
/* подпись поля — 13px × 1,4 + зазор 5px: кнопка в ячейке без подписи опускается на ту же линию, что и поля */
.form-grid > .field > .btn:only-child, .form-grid > div > .btn:only-child { margin-top: 23px; align-self: flex-start; }
/* строки таблиц: текст и кнопки в строке — по одной средней линии; выписка банка с многострочными ячейками — по верху */
td { vertical-align: middle; }
table.bank td, td.top { vertical-align: top; }
th { background: var(--surface-3); }

/* ——— 5. доводка отдельных мест после замера ——— */
/* заголовок внутри ряда «название + значок» не тянет за собой нижний отступ: значок стоит по центру названия */
.integ-head h3, .chart-head h3, .monitor-head h3 { margin: 0; }
/* заголовок раздела страницы (например, «Загруженные выписки») — отдельный блок-шапка, а не текст на фоне */
#view > * > .section-title, #view > * > div:not([class]) > .section-title {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 16px; box-shadow: var(--shadow); min-height: calc(var(--ctl-h) + 22px); box-sizing: border-box;
}
/* подвал списка (сколько показано, листание) — блок той же высоты, что и панель действий */
.pager { display: flex; align-items: center; justify-content: flex-start; gap: var(--gap-sm); flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 14px; box-shadow: var(--shadow); min-height: calc(var(--ctl-h) + 22px); box-sizing: border-box; }
/* форма приглашения: поля по верхней линии, как во всех формах (раньше ряд выравнивался по низу и подсказка сдвигала поле) */
.invite-form { align-items: start; grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(220px, 1.5fr) auto; }
@media (max-width: 1100px) { .invite-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .invite-form { grid-template-columns: minmax(0, 1fr); } .form-grid > .field > .btn:only-child, .form-grid > div > .btn:only-child { margin-top: 0; } }
/* шапка документа: ссылка «к списку» и название с состоянием — блоки, как всё на странице */
#view > * > .back, #view > * > div:not([class]) > .back { display: inline-flex; align-items: center; height: var(--ctl-h-sm); padding: 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); font-size: 13.5px; }
#view > * > .back:hover { background: var(--surface-2); text-decoration: none; }
#view > * > .doc-title, #view > * > div:not([class]) > .doc-title { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 16px; box-shadow: var(--shadow); min-height: calc(var(--ctl-h) + 22px); box-sizing: border-box; }
/* строки документа: все поля строки одной высоты; номер строки — на линии первого поля */
.lines select, tr:has(input:not([type="checkbox"]):not([type="radio"])) td select { height: var(--ctl-h); }
.lines input, .lines select { padding-top: 0; padding-bottom: 0; }
.lines .col-n { padding-top: 17px; }
/* заглушка на месте поля («—», «выберите операцию») — на той же линии, что номер строки и поля */
.lines td > span.muted:only-child { display: inline-block; margin-top: 9px; }

/* ——— 6. формы: подписи, поля и подсказки соседних ячеек стоят на общих линиях ———
   Ряд формы — три линии: подпись, поле, подсказка. Ячейка занимает все три и раскладывает своё содержимое по ним,
   поэтому длинная подпись в две строки или подсказка под одним полем не сдвигают соседние поля. */
@supports (grid-template-rows: subgrid) {
  .form-grid { row-gap: 0; }
  .form-grid > * { grid-row: span 3; display: grid; grid-template-rows: subgrid; row-gap: 5px; margin-bottom: 14px; min-width: 0; }
  .form-grid > * > .field { grid-row: 1 / -1; display: grid; grid-template-rows: subgrid; row-gap: 5px; margin-bottom: 0; min-width: 0; }
  .form-grid .field > span:first-child { grid-row: 1; align-self: end; }
  .form-grid .field > small { grid-row: 3; }
  .form-grid .field > :not(small):not(span:first-child) { grid-row: 2; align-self: center; min-width: 0; }
  /* ячейка без подписи (кнопка, флажок) встаёт на линию полей */
  .form-grid > :not(.field):not(:has(> .field)) > * { grid-row: 2; align-self: center; }
  .form-grid > .field > .btn:only-child, .form-grid > div > .btn:only-child { margin-top: 0; align-self: center; justify-self: start; }
}


/* монитор — отдельный блок, а не колонка у края; от блоков раздела его отличает тёмная шапка в цвет левой панели */
.monitor { top: calc(var(--top-h) + 1px + var(--gap)); height: calc(100vh - var(--top-h) - 1px - 2 * var(--gap)); border: 1px solid var(--violet-200); border-radius: var(--r-card); overflow: hidden;
  box-shadow: 0 2px 6px oklch(var(--shade) / 8%), 0 12px 30px oklch(var(--shade) / 14%); }
.monitor-head { background: var(--side-bg); border-bottom: 0; padding: 10px 8px 10px 10px; }
.monitor-tabs { background: rgba(255, 255, 255, 0.09); border-color: transparent; }
.monitor-tabs button { color: rgba(255, 255, 255, 0.84); }
.monitor-tabs button:hover { color: #fff; }
.monitor-tabs button.on { background: var(--violet-600); color: #fff; box-shadow: none; }
.monitor-tabs .monitor-count { background: #fff; color: var(--on-white); }
.monitor-tabs .monitor-count.err { background: #ffd9d6; color: #a3312c; }
.monitor-tabs .monitor-count.warn { background: #fde9c2; color: #8a5a12; }
.monitor-head .icon-btn { color: rgba(255, 255, 255, 0.8); }
.monitor-head .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: transparent; }
/* экран уже 1200 точек: монитор по-прежнему выезжает поверх раздела во всю высоту */
@media (max-width: 1200px) {
  .monitor { top: 0; height: auto; border-radius: 0; border-width: 0 0 0 1px; }
}

/* ——— 8. панель списка: две ровные линии, каждая заканчивается кнопкой у правого края ——— */
.list-toolbar .row-break { flex: 0 0 100%; height: 0; margin-top: calc(-1 * var(--gap-sm)); }
.list-toolbar .toolbar-search { flex: 1 1 240px; min-width: 200px; width: auto; }
/* пустая заготовка в начале страницы (место под уведомление) не отодвигает первый блок вниз */
#view > * > :empty:first-child + *, #view > * > div:not([class]) > :empty:first-child + *, #view .doclist > :empty:first-child + * { margin-top: 0; }

/* ——— 9. разделы портала ИС ЭСФ и склад: содержание документа портала и ответ службы ——— */
.portal-tree details { margin: 8px 0 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-el); }
.portal-tree details > summary { cursor: pointer; font-weight: 600; }
.portal-tree details > .portal-tree { margin-top: 8px; }
.portal-raw { margin: 0; padding: 12px; max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-el); background: var(--surface-2);
  font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   10. ПЕРЕРИСОВКА ПО ПАЛИТРЕ ЗАКАЗЧИКА (указания 19.11.2026)
     — расстояние между блоками и от левой и верхней панели до блоков небольшое и одно: --gap (12);
     — рабочая зона из двух частей: слева раздел, справа монитор (экран шире 1200 точек);
     — каждый блок приподнят над серым полем (рамка и тень);
     — левая панель раскрывается и складывается (web/side.js): раскрытая — иконка с подписью в строку,
       сложенная — полоса иконок. На экране уже 860 точек панель по-прежнему уходит вниз, и эти правила её не касаются.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* верхняя полоса: высота --top-h, поля сверху и снизу равные */

@media (min-width: 861px) {
            #nav { gap: 2px; padding: 8px 8px 0; }
              /* невысокий экран: строки панели ниже, чтобы разделы и настройки помещались без прокрутки */
  @media (max-height: 720px) {
    #nav { gap: 1px; padding-top: 4px; }
  }
            }

/* поля и кнопки: рамка — input палитры, у основания лёгкая тень; главное действие — сплошной акцент */
input, select, textarea { border-color: var(--input); box-shadow: 0 1px 2px oklch(var(--shade) / 5%); }
input[type="checkbox"], input[type="radio"], input[type="range"], input[type="file"] { box-shadow: none; }
.btn { border-color: var(--input); box-shadow: 0 1px 2px oklch(var(--shade) / 5%); font-weight: 600; }
.btn:hover { background: var(--accent); }
.btn.primary { border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.primary:active { background: var(--brand-active); border-color: var(--brand-active); }
.btn.danger { border-color: oklch(0.6 0.18 25 / 35%); }
.btn.danger:hover { background: var(--danger-tint); }
.btn.danger-fill:hover { background: var(--danger-text); border-color: var(--danger-text); }
.btn.link { box-shadow: none; }
.btn.link:hover { background: var(--accent); }
/* переключатель вкладок: серая подложка без рамки, выбранная вкладка — белая плашка */
.seg { border-color: transparent; border-radius: var(--r-el); background: var(--accent); }
.seg button { border-radius: calc(var(--r-el) - 3px); }
.seg button.on { color: var(--text); box-shadow: 0 1px 2px oklch(var(--shade) / 10%), 0 0 0 1px oklch(var(--shade) / 4%); }
/* таблицы: шапка — приглушённый текст, строка под указателем — нейтральная подсветка */
th { color: var(--text-3); font-weight: 650; }
tr.picked td, tr.click.picked:hover td { background: var(--picked); }
.account-item:hover { color: var(--text); }
.gate-brand b { color: var(--text); }
.monitor { border-color: var(--border); box-shadow: var(--shadow); }
/* вкладки монитора стоят на тёмной шапке: подложка и выбранная вкладка у них свои */
.monitor-head .monitor-tabs { background: oklch(1 0 0 / 9%); }
.monitor-head .monitor-tabs button.on { background: var(--side-active); color: var(--side-on-active); box-shadow: none; }
/* верхняя полоса уплотняется по своей ширине, а не по ширине окна: раскрытая левая панель и её сложенный вид дают
   полосе разное место. Пороги — прежние пороги окна за вычетом прежней панели */
@container topbar (max-width: 1240px) { .gw span { display: none; } .account-btn { padding: 3px; }  }
/* сумма в таблице не переносится на вторую строку: тесной таблице помогает прокрутка её блока */
td.num { white-space: nowrap; }
/* вкладки монитора помещаются целиком и в узком мониторе */
.monitor-head .monitor-tabs button { padding: 0 8px; gap: 4px; font-size: 12.5px; }
/* безымянная обёртка внутри безымянной обёртки (банк: очереди «не проведено» и «проверьте») — тот же столбец блоков
   с тем же промежутком; заголовок очереди — блок-шапка, а не текст на фоне */
#view > * > div:not([class]) > div:not([class]) > * { margin-bottom: 0; }
#view > * > div:not([class]) > div:not([class]) > * + * { margin-top: var(--gap); }
#view > * > div:not([class]) > div:not([class]) > :first-child { margin-top: 0; }
#view > * > div:not([class]) > div:not([class]) > .section-title {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 16px; box-shadow: var(--shadow); min-height: calc(var(--ctl-h) + 22px); box-sizing: border-box;
}
/* панель действий с подписанными полями: поля стоят по верхней линии, кнопка опущена на линию полей (подпись 13px × 1,4 + зазор 5px) */
.toolbar:has(> .field) { align-items: flex-start; }
.toolbar:has(> .field) > .field { margin-bottom: 0; }
.toolbar:has(> .field) > .btn, .toolbar:has(> .field) > .seg, .toolbar:has(> .field) > select, .toolbar:has(> .field) > input { margin-top: 23px; }
/* ссылки и приглушённый блок: текст читается и на сером (контраст не ниже 4,5) */
a, .btn.link { color: var(--link); }
.card.soft { background: var(--surface-3); }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   11. СВЕТЛАЯ И ТЁМНАЯ ТЕМА (указание заказчика 19.11.2026)
   Человек выбирает тему в меню пользователя (web/theme.js ставит data-theme="dark" на <html>, выбор помнится
   в браузере; по умолчанию — светлая). Тёмная тема — вторая часть той же палитры (.dark): она только переопределяет
   переменные. Правило на будущее: цвет в правилах берётся из переменных, и у новой переменной есть значение в обеих
   темах; вписанный в правило цвет в тёмной теме останется светлым.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  /* выбранная флажком строка; тёмный текст на белом счётчике тёмной панели; фон поля и обычной кнопки;
     выбранная вкладка переключателя; затемнение под окном; рамки уведомлений по тону */
  --picked: var(--rose-50); --on-white: oklch(0.21 0.006 285.885); --field-bg: var(--surface); --seg-on: var(--surface);
  --scrim: oklch(0.141 0.005 285.823 / 26%);
  --warn-line: #f0dfb6; --success-line: #cfe9dc; --danger-line: #f3cfcc;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* background, card, muted; шапка таблицы — между card и muted; рамка — border, поле — input */
  --bg: oklch(0.141 0.005 285.823); --surface: oklch(0.21 0.006 285.885); --surface-2: oklch(0.274 0.006 286.033); --surface-3: oklch(0.242 0.006 285.96);
  --border: oklch(1 0 0 / 10%); --border-strong: oklch(1 0 0 / 18%); --border-subtle: oklch(1 0 0 / 6%);
  --input: oklch(1 0 0 / 15%);
  /* foreground; второй тон — ступень серой шкалы; третий — muted-foreground */
  --text: oklch(0.985 0 0); --text-2: oklch(0.871 0.006 286.286); --text-3: oklch(0.705 0.015 286.067);
  /* акцент у действий — та же ступень, что в светлой теме: на primary тёмной части палитры (rose-500) белый текст
     кнопки читается хуже (контраст 3,6 против 4,5). Ссылка и рамка ввода — светлее: они стоят на тёмном */
  --brand-tint: oklch(0.66 0.15 15 / 16%); --link: var(--rose-400);
  --ring: var(--rose-500); --ring-halo: oklch(0.66 0.15 15 / 32%);
  /* accent и accent-foreground */
  --accent: oklch(0.274 0.006 286.033); --accent-fg: oklch(0.985 0 0);
  /* всплывающая строка и подсказка графика — приподнятая тёмная плашка с белым текстом */
  --violet-900: oklch(0.32 0.007 286);
  /* опасное: текст — destructive тёмной части палитры, заливка под белый текст — destructive светлой.
     Успех и предупреждение — цвета сервиса, осветлённые для тёмного фона */
  --success: #2aa878; --success-text: oklch(0.82 0.13 160); --success-tint: oklch(0.7 0.14 160 / 15%);
  --warn: #d39a2c; --warn-text: oklch(0.86 0.12 85); --warn-tint: oklch(0.78 0.14 80 / 15%);
  --danger-text: oklch(0.73 0.14 22); --danger-tint: oklch(0.73 0.14 22 / 15%);
  --warn-line: oklch(0.78 0.14 80 / 30%); --success-line: oklch(0.7 0.14 160 / 30%); --danger-line: oklch(0.73 0.14 22 / 32%);
  /* на тёмном блок отделяют рамка и более светлая плашка; тень глубже */
  --shade: 0 0 0;
  --shadow: 0 1px 2px oklch(0 0 0 / 40%), 0 4px 12px oklch(0 0 0 / 32%);
  --shadow-hover: 0 2px 4px oklch(0 0 0 / 45%), 0 10px 24px oklch(0 0 0 / 40%);
  --shadow-pop: 0 12px 32px oklch(0 0 0 / 60%);
  /* графики: та же шкала одного тона, на тёмном — ступени светлее */
  --chart-a: var(--rose-500); --chart-b: var(--rose-200);
  --chart-1: var(--rose-200); --chart-2: var(--rose-400); --chart-3: var(--rose-600); --chart-4: var(--rose-800);
  --chart-other: oklch(0.552 0.016 285.938); --chart-grid: oklch(1 0 0 / 7%); --chart-axis: oklch(1 0 0 / 22%); --chart-band: oklch(1 0 0 / 5%);
  --picked: oklch(0.66 0.15 15 / 14%); --field-bg: oklch(1 0 0 / 4.5%); --seg-on: oklch(1 0 0 / 14%);
  --scrim: oklch(0 0 0 / 60%);
}
/* правила, читающие эти переменные (в светлой теме вид прежний) */
input, select, textarea { background-color: var(--field-bg); }
.btn { background-color: var(--field-bg); }
.seg button.on { background: var(--seg-on); }
.drawer, .modal { background-color: var(--scrim); }
.note { border-color: var(--warn-line); }
.note.ok { border-color: var(--success-line); }
.note.err { border-color: var(--danger-line); }
/* тёмная тема: левая панель того же тона, что блоки, — её отделяет линия; список выбора — тёмный */
:root[data-theme="dark"] select option, :root[data-theme="dark"] select optgroup { background: oklch(0.21 0.006 285.885); color: oklch(0.985 0 0); }
/* переключатель темы в меню пользователя */
.account-theme { display: flex; margin: 2px 6px 6px; }
.account-theme button { flex: 1 1 0; gap: 6px; }
/* подпись под названием на экране входа стоит на сером поле: тон текста на ступень темнее */
.gate-brand small { color: var(--text-2); }
/* плитка показателя: сумма остаётся одной строкой — размер числа следует за шириной плитки, тиыны мельче целой части,
   знак «₸» не отрывается от числа (web/charts.js: statTile). Очень длинная сумма переносится по разрядам, а не посреди числа */
.stat { container-type: inline-size; }
.stat .stat-value { font-size: clamp(16px, 13cqi, 25px); overflow-wrap: normal; }
.stat-value .tiyn { font-size: 0.68em; font-weight: 700; }
/* строка возврата в приложении на телефоне (.m-crumb) — ряд, а не столбец блоков: общий промежуток столбца
   её содержимому не положен (он сдвигал название раздела ниже ссылки «назад») */
#view > .m-crumb > * { margin-top: 0; margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   12. ЛЕВАЯ ПАНЕЛЬ: СВОЙ КАРКАС И ПОИСК ФУНКЦИЙ (замечание заказчика 20.11.2026: панель по разделам 1С вышла
   копией 1С и спрятала лицо сервиса). В панели — страницы сервиса по ходу работы (web/sidemenu.js: NAV_GROUPS),
   одним щелчком; у раздела, где сервис работает сам, — метка «авто», у раздела, где что-то ждёт человека, —
   счётчик из риск-монитора. Соответствие 1С — в поиске функций («Найти функцию»), а не в структуре панели.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* окно поиска функций: блок поверх рабочей области, от левой панели и верхней полосы — на общий промежуток; выше
   монитора, когда тот выезжает поверх раздела (30), ниже окон и подтверждений (40) */
.side-menu {
  position: fixed; z-index: 32; top: calc(var(--top-h) + var(--gap)); left: calc(var(--rail-w) + var(--gap));
  width: min(960px, calc(100vw - var(--rail-w) - 2 * var(--gap))); max-height: calc(100vh - var(--top-h) - 2 * var(--gap));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-card); box-shadow: var(--shadow-pop); overflow: hidden; container: sidemenu / inline-size;
}
.side-menu:focus { outline: none; }
.side-menu-head { display: flex; align-items: center; gap: var(--gap-sm); padding: 10px 10px 10px var(--pad); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.side-menu-head > .icon { flex-shrink: 0; color: var(--text-3); }
.side-menu-search { flex: 1 1 auto; min-width: 0; border-color: transparent; background: transparent; box-shadow: none; font-size: 15px; padding-left: 4px; }
.side-menu-search:hover:not(:focus), .side-menu-search:focus { border-color: transparent; box-shadow: none; }
/* группы пунктов — колонки; длинная группа занимает две колонки и делит список пополам */
.side-menu-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 4px 28px; align-items: start; padding: 14px var(--pad) 12px; overflow-y: auto; }
.side-menu-group { min-width: 0; margin-bottom: 8px; }
.side-menu-group h3, .side-menu-intro h3 { margin: 0 0 2px; font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.side-menu .fm-item { break-inside: avoid; }
/* куда в сервисе ведёт пункт 1С */
.fm-dest { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--text-2); font-size: 11px; font-weight: 600; line-height: 18px; vertical-align: 1px; white-space: nowrap; }
@container sidemenu (min-width: 700px) {
  .side-menu-group.wide { grid-column: span 2; }
  .side-menu-group.wide .fm-list { columns: 2; column-gap: 28px; }
  /* во второй колонке списка первая строка осталась бы с линией сверху — линии здесь не нужны, хватает отступов */
  .side-menu-group.wide .fm-item { border-top-color: transparent; }
}
.side-menu-intro, .side-menu-back, .side-menu-empty { grid-column: 1 / -1; }
.side-menu-intro p { margin: 0 0 14px; color: var(--text-2); line-height: 1.5; max-width: 720px; }
.side-menu-intro h3 { margin-bottom: 8px; }
.side-menu-chips { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-bottom: 6px; }
.side-menu-chips .btn { gap: 6px; }
.side-menu-back { display: flex; align-items: center; gap: var(--gap); margin-bottom: 10px; }
.side-menu-back .btn { gap: 4px; }
.side-menu-empty { margin: 6px 0 10px; color: var(--text-2); }
.side-menu-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); padding: 6px 10px 6px 8px; border-top: 1px solid var(--border); background: var(--surface-3); font-size: 12.5px; color: var(--text-3); flex-shrink: 0; }
/* узкий экран: панель внизу — окно поиска раскрывается над ней на всю ширину */
@media (max-width: 860px) {
  .side-menu { top: auto; left: var(--gap); right: var(--gap); bottom: calc(58px + var(--gap)); width: auto; max-height: calc(100vh - 58px - 2 * var(--gap)); }
}

/* ——— блоки первого экрана (web/pulse.js): сводка организации — «Ждёт вас», «Сервис сделал сам», «У контрагентов»;
   страница организаций — «Сегодня по всем клиентам». Ряд переносится сам: блок, оставшийся в строке один, занимает её всю ——— */
.pulse { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: stretch; }
.pulse > .card { flex: 1 1 320px; min-width: 0; }
.pulse.three > .card { flex-basis: 290px; }
.pulse.four > .card { flex-basis: 250px; }
.pulse-title .muted { font-size: 13px; font-weight: 500; }
.pulse .card + .card { margin-top: 0; }
.pulse-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pulse-head h3 { margin: 0; }
.pulse-count { font-size: 12px; font-weight: 650; line-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--warn-tint); color: var(--warn-text); white-space: nowrap; }
.pulse-count.high { background: var(--danger-tint); color: var(--danger-text); }
.pulse-count.ok { background: var(--success-tint); color: var(--success-text); font-weight: 600; }
.pulse-list { display: grid; }
.pulse-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border-subtle); color: inherit; }
button.pulse-row { appearance: none; width: 100%; border: 0; border-top: 1px solid var(--border-subtle); background: none; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.pulse-row:first-child { border-top: 0; }
button.pulse-row:hover b { color: var(--link); }
a.pulse-row:hover { text-decoration: none; }
a.pulse-row:hover b { color: var(--link); }
.pulse-row > .icon { flex-shrink: 0; margin-top: 2px; color: var(--text-3); }
/* значок на месте отметки занимает те же 18 точек, что точка и галочка: названия строк стоят на одной линии */
.pulse-row > .icon:first-child { margin-left: 1px; margin-right: 1px; }
/* под блоком входа по ЭЦП, вставшим на место строки, разделительной линии нет: блок отделяет сам */
.pulse-list > .note + .pulse-row { border-top: 0; }
.pulse-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pulse-text b { font-weight: 600; line-height: 1.35; }
/* пояснение — не длиннее двух строк: полный текст замечания — в риск-мониторе и в самом разделе */
.pulse-text small { color: var(--text-2); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
/* блок, где строка — итог и причина, а не пересказ замечания (утренняя загрузка ЭСФ): текст не обрезается */
.pulse-card.pulse-full .pulse-text small { display: block; overflow: visible; }
.pulse-dot { flex-shrink: 0; width: 8px; height: 8px; margin: 6px 5px 0; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px var(--warn-tint); }
.pulse-dot.high { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.pulse-ok { flex-shrink: 0; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--success-tint); color: var(--success-text); }
.pulse-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin: 4px 0 -6px -8px; font-size: 12.5px; }
.pulse-foot > .muted { margin-left: 8px; }
.pulse-card .empty { padding: 16px 8px; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   13. НОВЫЙ ОБЛИК (указание заказчика 20.11.2026: «нужно ультрасовременное решение по дизайну, пересмотри всё,
   перерисуй красиво» — прежняя перерисовка была сменой цветов)
   Что стало другим, а не перекрашенным:
     — окно — тёмная рамка, рабочая область — большая скруглённая панель внутри неё; левая панель — часть рамки;
     — верхняя полоса — «стекло»: содержимое прокручивается под ней и размывается;
     — шрифт Inter (коды и номера — IBM Plex Mono, как в документах; в обоих есть казахские буквы — проверено
       отрисовкой, у JetBrains Mono их нет), цифры одной ширины;
     — глубина: тонкие полупрозрачные линии и мягкая многослойная тень вместо сплошных рамок;
     — главное действие и выбранный раздел — градиент акцента со свечением; инструменты верхней полосы — «пилюли»;
     — плавные переходы наведения и раскрытия (выключаются настройкой «меньше движения»).
   Что сохранено из указаний заказчика: палитра (серые + rose, скругление 0.65rem — у блоков оно на ступень
   больше, как «xl» той же палитры), рабочая зона из двух частей, малые промежутки, блоки «парят», левая панель
   тёмная, складывается, светлая и тёмная тема. Размеры блочной схемы (--gap, --ctl-h) не менялись.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --stretch: 100%;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* рамка окна: отступ рабочей панели от краёв и её скругление */
  --chrome: 10px; --r-frame: 22px;
  /* рамка и левая панель — мягкий графит, а не чёрный (замечание заказчика 20.11.2026: панель чересчур тёмная) */
  --frame: oklch(0.33 0.026 288);
  --rail-open: 252px; --rail-closed: 72px; --top-h: 56px;
  --r-card: calc(0.65rem + 5px); --r-el: 0.65rem;
  --bg: oklch(0.972 0.002 286.4); --surface-2: oklch(0.962 0.002 286.4);
  /* линии — полупрозрачные: на белом блоке и на сером поле они одинаково тонкие */
  --border: oklch(0.21 0.006 285.885 / 9%); --border-strong: oklch(0.21 0.006 285.885 / 17%);
  --border-subtle: oklch(0.21 0.006 285.885 / 6%); --input: oklch(0.21 0.006 285.885 / 15%);
  --shadow: 0 0 0 0.5px oklch(var(--shade) / 5%), 0 1px 2px oklch(var(--shade) / 5%), 0 10px 26px -12px oklch(var(--shade) / 16%);
  --shadow-hover: 0 0 0 0.5px oklch(var(--shade) / 6%), 0 2px 4px oklch(var(--shade) / 6%), 0 18px 38px -14px oklch(var(--shade) / 24%);
  --shadow-pop: 0 0 0 0.5px oklch(var(--shade) / 8%), 0 10px 24px -8px oklch(var(--shade) / 16%), 0 32px 64px -24px oklch(var(--shade) / 34%);
  /* свечение фона рабочей панели: тёплое пятно акцента справа сверху, холодное — слева снизу */
  --aurora: radial-gradient(960px 540px at 100% -8%, oklch(0.735 0.115 13.5 / 11%), transparent 62%), radial-gradient(820px 560px at -8% 108%, oklch(0.62 0.17 285 / 8%), transparent 62%);
  /* главное действие и выбранный раздел: градиент акцента (не светлее rose-600 — белый текст читается) и его свечение */
  --brand-grad: linear-gradient(180deg, oklch(0.59 0.16 15.5), oklch(0.548 0.155 15));
  --brand-glow: 0 1px 2px oklch(0.45 0.12 14 / 40%), 0 8px 18px -8px oklch(0.585 0.16 15.5 / 70%);
  --glass: color-mix(in oklch, var(--bg) 74%, transparent);
  --ink-pill: var(--text); --on-ink-pill: var(--bg);
  --side-bg: var(--frame); --side-hover: oklch(1 0 0 / 8%); --side-line: oklch(1 0 0 / 9%);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
:root[data-theme="dark"] {
  --frame: oklch(0.135 0.008 287);
  --bg: oklch(0.16 0.006 285.9); --surface: oklch(0.205 0.007 285.9); --surface-2: oklch(0.255 0.007 286); --surface-3: oklch(0.232 0.007 286);
  --border: oklch(1 0 0 / 9%); --border-strong: oklch(1 0 0 / 17%); --border-subtle: oklch(1 0 0 / 6%); --input: oklch(1 0 0 / 15%);
  /* у тёмного блока сверху тонкий блик: край читается без рамки потолще */
  --shadow: inset 0 1px 0 oklch(1 0 0 / 5%), 0 1px 2px oklch(0 0 0 / 30%), 0 12px 28px -12px oklch(0 0 0 / 60%);
  --shadow-hover: inset 0 1px 0 oklch(1 0 0 / 7%), 0 2px 4px oklch(0 0 0 / 34%), 0 20px 40px -14px oklch(0 0 0 / 70%);
  --shadow-pop: inset 0 1px 0 oklch(1 0 0 / 7%), 0 12px 28px -8px oklch(0 0 0 / 55%), 0 36px 70px -24px oklch(0 0 0 / 80%);
  --aurora: radial-gradient(960px 540px at 100% -8%, oklch(0.66 0.15 15 / 15%), transparent 62%), radial-gradient(820px 560px at -8% 108%, oklch(0.55 0.2 285 / 13%), transparent 62%);
  --ink-pill: oklch(0.985 0 0); --on-ink-pill: oklch(0.141 0.005 285.823);
}

/* ——— основа: шрифт и фон ——— */
body { font-size: 14px; line-height: 1.45; letter-spacing: -0.006em; font-feature-settings: "cv11", "calt"; font-optical-sizing: auto; background: var(--aurora), var(--bg); background-attachment: fixed; }
.tnum, td.num, .stat-value, .mono { font-variant-numeric: tabular-nums; }
.mono { font-size: 12.5px; letter-spacing: 0; }
h1, h2, h3 { letter-spacing: -0.018em; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
::selection { background: oklch(0.735 0.115 13.5 / 26%); }

/* ——— рамка окна и рабочая панель (экран с левой панелью) ——— */
@media (min-width: 861px) {
          /* знак и название стоят на одной линии с верхней полосой рабочей панели */
      #nav { padding: 6px 10px 0; gap: 2px; }
                  /* монитор и меню раздела считают высоту от рабочей панели, а не от окна */
  .side-menu { top: calc(var(--chrome) + var(--top-h) + var(--gap)); max-height: calc(100vh - 2 * var(--chrome) - var(--top-h) - 2 * var(--gap)); }
  .msg-list { max-height: calc(100vh - 264px); }
  .msg-feed { max-height: calc(100vh - 516px); }
}
@media (min-width: 1201px) {
  .monitor { top: calc(var(--top-h) + var(--gap)); height: calc(100vh - 2 * var(--chrome) - var(--top-h) - 2 * var(--gap)); }
}
@media (min-width: 861px) and (max-width: 1200px) {
  /* монитор выезжает поверх раздела отдельной скруглённой панелью, а не полосой во всю высоту окна */
  .monitor { top: var(--chrome); right: var(--chrome); bottom: var(--chrome); border-radius: var(--r-frame); border-width: 1px; }
}

/* ——— верхняя полоса: организация, инструменты-«пилюли», пользователь ——— */
.gw { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
/* место в полосе (инструменты с подписями шире прежних): сначала уходит подпись «Организация», потом сжимается правая
   часть (состояние госсервисов, монитор, пользователь — до значков), последними — подписи инструментов */
@container topbar (max-width: 1440px) { .gw span { display: none; } .account-btn { padding: 3px; } }

/* ——— блоки ——— */
.card, .stat, .table-wrap, .pager { border-color: var(--border); }
.card { padding: 18px; }
.card h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.014em; }
.card p { line-height: 1.5; }
.card.link, a.stat, a.card { transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease), border-color 0.18s var(--ease); }
.card.link:hover, a.stat:hover, a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.section-title { font-size: 15px; font-weight: 650; letter-spacing: -0.014em; }
.toolbar-label { font-weight: 600; color: var(--text-2); }
/* плитка показателя: значок на подложке, крупное число, свет в углу */
.stat { position: relative; overflow: hidden; padding: 16px 18px 15px; background-image: radial-gradient(130% 110% at 100% 0%, oklch(0.735 0.115 13.5 / 7%), transparent 52%); }
:root[data-theme="dark"] .stat { background-image: radial-gradient(130% 110% at 100% 0%, oklch(0.66 0.15 15 / 12%), transparent 52%); }
.stat-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; background: var(--accent); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.stat-icon .icon { width: 18px; height: 18px; }
.stat-label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.stat .stat-value { font-size: clamp(16px, 11.5cqi, 27px); font-weight: 650; letter-spacing: -0.035em; line-height: 1.12; margin-top: 4px; }
.stat-value .tiyn { font-weight: 600; letter-spacing: -0.02em; }
.stat-sub { font-size: 12.5px; margin-top: 6px; }

/* ——— таблицы: шапка без заливки, тонкие линии, строка отзывается на наведение ——— */
th { background: transparent; font-size: 11.5px; font-weight: 600; letter-spacing: 0; color: var(--text-3); padding: 11px 12px 9px; border-bottom: 1px solid var(--border); }
td { font-size: 13px; padding: 9px 12px; border-bottom-color: var(--border-subtle); transition: background-color 0.12s var(--ease); }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tr.click:hover td { background: var(--accent); }
.rep-table tr.rep-account.rep-group > td, .rep-chess-side, .rep-chess td.rep-chess-total { background: var(--surface-3); }
/* ведомости: шесть столбцов сумм рядом — поля между ними уже, названию счёта остаётся место */
.rep-table th.num, .rep-table td.num { padding-left: 8px; padding-right: 8px; }
.rep-table th.num:last-child, .rep-table td.num:last-child { padding-right: 16px; }

/* ——— поля и кнопки ——— */
input, select, textarea { border-color: var(--input); border-radius: var(--r-el); transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease); }
/* размер текста в полях — только на большом экране: на телефоне поле не мельче 16 (иначе айфон увеличивает страницу), это правило mobile.css */
@media (min-width: 641px) { input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]), select { font-size: 13.5px; } }
input:hover:not(:focus):not([type="checkbox"]):not([type="radio"]), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--border-strong); }
.btn { border-color: var(--input); border-radius: var(--r-el); font-size: 13.5px; font-weight: 600; letter-spacing: -0.008em; box-shadow: 0 1px 2px oklch(var(--shade) / 6%); transition: background-color 0.14s var(--ease), border-color 0.14s var(--ease), box-shadow 0.14s var(--ease), transform 0.1s var(--ease); }
.btn:hover { background-color: var(--accent); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: translateY(0.5px) scale(0.985); }
.btn.small { border-radius: calc(var(--r-el) - 2px); font-size: 12.5px; }
.btn.primary { background: var(--brand-grad); background-color: var(--brand); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 oklch(1 0 0 / 22%), var(--brand-glow); }
.btn.primary:hover { background: var(--brand-grad); background-color: var(--brand); border-color: transparent; filter: brightness(1.07) saturate(1.05); box-shadow: inset 0 1px 0 oklch(1 0 0 / 26%), 0 1px 2px oklch(0.45 0.12 14 / 44%), 0 12px 22px -8px oklch(0.585 0.16 15.5 / 80%); }
.btn.link { box-shadow: none; }
.btn.link:hover { background: var(--accent); }
.icon-btn { border-radius: 10px; transition: background-color 0.14s var(--ease), color 0.14s var(--ease); }
/* переключатель: дорожка-«пилюля», выбранное — приподнятая плашка */
.seg { border: 0; border-radius: 12px; padding: 3px; background: oklch(var(--shade) / 6%); }
:root[data-theme="dark"] .seg { background: oklch(1 0 0 / 7%); }
/* дорожка без рамки: кнопки на 2 выше прежних, высота переключателя — та же --ctl-h */
.seg.wrap button { height: calc(var(--ctl-h) - 6px); }
.seg button { border-radius: 9px; font-size: 13px; font-weight: 550; transition: background-color 0.14s var(--ease), color 0.14s var(--ease), box-shadow 0.14s var(--ease); }
.seg button.on { color: var(--text); font-weight: 600; box-shadow: 0 0 0 0.5px oklch(var(--shade) / 8%), 0 1px 2px oklch(var(--shade) / 12%), 0 3px 8px -3px oklch(var(--shade) / 18%); }
/* переключатель, стоящий прямо на поле страницы (вкладки раздела), — блок: белая плашка с тенью, выбранное — тёмная «пилюля» */
#view > * > .seg, #view > * > div:not([class]) > .seg { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: var(--r-card); padding: 5px; }
#view > * > .seg button.on, #view > * > div:not([class]) > .seg button.on { background: var(--ink-pill); color: var(--on-ink-pill); box-shadow: none; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; letter-spacing: 0; }
.field > span { font-weight: 600; font-size: 12.5px; }
/* приглашение в команду: ширина раздела зависит от панели и монитора, а не только от окна — поля сами встают в ряд по месту */
@media (min-width: 861px) { .invite-form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.note { border-radius: var(--r-el); }

/* ——— всплывающее: меню, окна, подсказки — скруглённые, с глубокой тенью, раскрываются плавно ——— */
.account-menu, .rep-menu, .combo-list, .side-menu { border-color: var(--border); border-radius: 14px; }
.account-item, .rep-menu-item, .combo-opt { border-radius: 9px; }
.account-item:hover, .combo-opt:hover, .combo-opt.hi { background: var(--accent); color: var(--text); }
.account-item:hover .icon { color: var(--text-2); }
.side-menu { border-radius: 18px; }
.modal { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.drawer { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-panel { border-radius: 20px; border: 1px solid var(--border); padding: 24px; }
.modal-panel h2, .drawer-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.drawer-panel { margin: var(--chrome); height: calc(100% - 2 * var(--chrome)); border-radius: var(--r-frame); border: 1px solid var(--border); }
.toast { border-radius: 999px; padding: 10px 18px; background: var(--ink-pill); color: var(--on-ink-pill); font-weight: 550; font-size: 13.5px; }
.toast.err { background: var(--danger-text); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  /* заполнение только «до начала»: после появления у элемента не остаётся следа анимации — иначе он стал бы точкой
     отсчёта для закреплённых на экране вложенных элементов (выпадающие списки, подсказки) */
  .account-menu:not([hidden]), .rep-menu, .side-menu, .combo-list { animation: pop-in 0.16s var(--ease) backwards; }
  .modal-panel { animation: rise-in 0.2s var(--ease) backwards; }
  .toast { animation: rise-in 0.2s var(--ease) backwards; }
  #view > * { animation: fade-in 0.22s var(--ease) backwards; }
}
/* замер и снимки (scripts/ui-audit.js, scripts/ui-contrast.js) ставят на <html> data-motion="off": переходы и
   появление не должны попадать в измерения — скрытая вкладка их не доигрывает */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation: none !important; transition: none !important; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ——— монитор: шапка в цвет рамки, вкладки-«пилюли» ——— */
.monitor { border-color: var(--border); box-shadow: var(--shadow); }
.monitor-head { background: radial-gradient(260px 120px at 0% 0%, oklch(0.585 0.16 15.5 / 22%), transparent 70%), var(--frame); padding: 10px 8px 10px 10px; }
.monitor-head .monitor-tabs { border-radius: 999px; background: oklch(1 0 0 / 9%); }
.monitor-head .monitor-tabs button { border-radius: 999px; }
.monitor-head .monitor-tabs button.on { background: var(--brand-grad); background-color: var(--brand); color: #fff; box-shadow: inset 0 1px 0 oklch(1 0 0 / 20%), var(--brand-glow); }

/* ——— экран входа: стекло на фоне свечения ——— */
.gate { background: radial-gradient(900px 520px at 85% -10%, oklch(0.735 0.115 13.5 / 18%), transparent 62%), radial-gradient(760px 520px at 0% 100%, oklch(0.62 0.17 285 / 13%), transparent 62%); }
.gate-brand b { font-weight: 700; letter-spacing: -0.035em; color: var(--text); }
.gate-card { border-radius: 22px; border-color: var(--border); padding: 28px 28px 22px; box-shadow: var(--shadow-pop); background: color-mix(in oklch, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); }
.gate-card h1 { font-size: 21px; font-weight: 650; letter-spacing: -0.025em; }
.gate-submit { font-size: 14.5px; height: 42px; }

/* ——— узкий экран (панель внизу): панель — парящая скруглённая полоса ——— */
@media (min-width: 641px) and (max-width: 860px) {
        .side-menu { left: var(--chrome); right: var(--chrome); bottom: calc(58px + 2 * var(--chrome)); max-height: calc(100vh - 58px - 3 * var(--chrome)); }
}

/* ——— высота строк левой панели (стоит после правил облика: они задают общие 36 и 40) ——— */
/* невысокий экран: строки и названия групп плотнее, чтобы вся панель помещалась без прокрутки */
@media (min-width: 861px) and (max-height: 880px) {
  #nav { gap: 1px; }
          }
@media (min-width: 861px) and (max-height: 790px) {
  #nav { gap: 0; }
      }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   14. МИНИМУМ ТЕКСТА И АНИМАЦИЯ ПРОЦЕССОВ (указание заказчика 20.11.2026: «слишком много уточняющего текста, нужен
   минимализм: только кнопки, краткие наименования; к блоку — пошаговый статус производимого действия; современная
   красивая анимация процесса — загрузка выписки, считывание, проведение, завершён успешно или с ошибками»)
     — пояснения скрыты, пока человек не включит их кнопкой «?» (web/quiet.js): длинный поясняющий текст получает
       data-q="long" и не показывается; короткие строки состояния и уведомления остаются;
     — блок процесса (web/process.js): шаги, полоса хода, сцена с документом, лучом чтения и книгой учёта, кольцо итога;
     — кнопка любого действия (busy в web/ui.js) крутит кольцо, пока действие идёт, и отмечает итог.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* ——— минимум текста ——— */
:root:not([data-hints="on"]) [data-q="long"] { display: none !important; }
/* первый блок страницы скрыт — следующий за ним встаёт на его место без лишнего промежутка */
:root:not([data-hints="on"]) #view > * > [data-q="long"]:first-child + *, :root:not([data-hints="on"]) #view > * > div:not([class]) > [data-q="long"]:first-child + * { margin-top: 0; }
:root[data-hints="on"] [data-q="long"] { animation: fade-in 0.2s var(--ease) backwards; }
.account-hints { display: flex; margin: 2px 6px 6px; }
.account-hints button { flex: 1 1 0; }

/* ——— кнопка действия: кольцо хода, отметка итога ——— */
.btn.is-busy { position: relative; cursor: progress; opacity: 1; }
.btn.is-busy::before { content: ''; width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: 0.85; animation: spin 0.7s linear infinite; }
.btn.is-done::before { content: ''; width: 6px; height: 11px; flex: none; margin: -3px 4px 0 3px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); animation: tick-in 0.3s var(--ease) both; }
.btn.is-fail { animation: shake 0.36s var(--ease); border-color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tick-in { from { opacity: 0; transform: rotate(45deg) scale(0.4); } to { opacity: 1; transform: rotate(45deg) scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ——— блок процесса ——— */
.proc { display: flex; align-items: center; gap: var(--pad); padding: 14px var(--pad); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface-3); min-width: 0; --proc-tone: var(--brand); }
.proc[data-state="ok"] { --proc-tone: var(--success); }
.proc[data-state="warn"] { --proc-tone: var(--warn); }
.proc[data-state="err"] { --proc-tone: var(--danger); }
.proc-main { flex: 1; min-width: 0; display: grid; gap: 9px; }
.proc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.proc-head h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.014em; }
.proc-status { font-size: 13px; font-weight: 550; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 19px; }
.proc[data-state="ok"] .proc-status { color: var(--success-text); }
.proc[data-state="warn"] .proc-status { color: var(--warn-text); }
.proc[data-state="err"] .proc-status { color: var(--danger-text); }
/* шаги: кружок с номером, название, линия к следующему шагу */
.proc-steps { list-style: none; display: flex; align-items: center; margin: 0; padding: 0; min-width: 0; }
.proc-step { display: flex; align-items: center; gap: 7px; flex: 1 1 auto; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.proc-step:last-child { flex: 0 0 auto; }
.proc-step b { font-weight: 600; white-space: nowrap; }
.proc-step:not(:last-child)::after { content: ''; flex: 1; min-width: 10px; height: 2px; margin: 0 8px 0 2px; border-radius: 2px; background: var(--border-strong); transition: background-color 0.3s var(--ease); }
.proc-dot { position: relative; display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 11px; font-weight: 650; color: var(--text-3); transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease); }
.proc-dot .icon { display: none; stroke-width: 2.4; }
.proc-step[data-s="now"] { color: var(--text); }
.proc-step[data-s="now"] .proc-dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.proc-step[data-s="done"] { color: var(--text-2); }
.proc-step[data-s="done"] .proc-dot { border-color: var(--success); background: var(--success); color: #fff; }
.proc-step[data-s="done"]::after { background: var(--success); }
.proc-step[data-s="done"] .proc-num, .proc-step[data-s="warn"] .proc-num, .proc-step[data-s="err"] .proc-num { display: none; }
.proc-step[data-s="done"] .proc-dot .icon { display: block; }
.proc-step[data-s="warn"] .proc-dot { border-color: var(--warn); background: var(--warn); color: #fff; }
.proc-step[data-s="warn"] .proc-dot::before { content: '!'; font-weight: 700; }
.proc-step[data-s="err"] { color: var(--danger-text); }
.proc-step[data-s="err"] .proc-dot { border-color: var(--danger); background: var(--danger); color: #fff; }
.proc-step[data-s="err"] .proc-dot::before { content: '×'; font-size: 14px; font-weight: 600; line-height: 1; }
/* полоса хода: доля сделанного; когда числа неизвестны — бегущая полоса */
.proc-bar { height: 4px; border-radius: 4px; background: oklch(var(--shade) / 8%); overflow: hidden; }
:root[data-theme="dark"] .proc-bar { background: oklch(1 0 0 / 10%); }
.proc-bar > i { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--proc-tone); transition: width 0.35s var(--ease), background-color 0.3s var(--ease); }
.proc[data-state="idle"] .proc-bar { visibility: hidden; }
.proc-bar.flow > i { width: 38%; }
/* числа итога */
/* по линии текста: показатель без числа («сегодня, 06:00–06:47») стоит на строке подписей, а не выше неё */
.proc-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.proc-stats:empty { display: none; }
.proc-stat { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.proc-stat b { font-size: 20px; font-weight: 650; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.proc-stat.ok b { color: var(--success-text); }
.proc-stat.warn b { color: var(--warn-text); }
.proc-stat.err b { color: var(--danger-text); }
/* сцена: документ, луч чтения, операции летят в книгу учёта, кольцо итога */
.proc-scene { position: relative; flex: none; width: 152px; height: 88px; border-radius: 14px; overflow: hidden; background: radial-gradient(120% 130% at 0% 0%, oklch(0.735 0.115 13.5 / 13%), transparent 62%), var(--accent); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.proc-sheet { position: absolute; left: 20px; top: 14px; width: 44px; height: 60px; padding: 20px 7px 0; display: grid; align-content: start; gap: 5px; border-radius: 8px; background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong), 0 6px 14px -6px oklch(var(--shade) / 30%); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.proc-sheet-icon { position: absolute; left: 6px; top: 5px; color: var(--text-3); }
.proc-sheet > i { height: 4px; border-radius: 2px; background: var(--border-strong); }
.proc-sheet > i:nth-of-type(2) { width: 78%; }
.proc-sheet > i:nth-of-type(3) { width: 90%; }
.proc-sheet > i:nth-of-type(4) { width: 56%; }
.proc-beam { position: absolute; left: -5px; right: -5px; top: 16px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--rose-500) 30%, var(--rose-500) 70%, transparent); box-shadow: 0 0 10px 2px oklch(0.66 0.15 15 / 45%); opacity: 0; }
.proc-flow { position: absolute; left: 68px; top: 40px; width: 40px; height: 8px; }
.proc-flow > i { position: absolute; left: 0; top: 1px; width: 6px; height: 6px; border-radius: 50%; background: var(--rose-500); opacity: 0; }
.proc-book { position: absolute; right: 16px; top: 23px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--surface); color: var(--text-2); box-shadow: 0 0 0 1px var(--border-strong), 0 6px 14px -6px oklch(var(--shade) / 30%); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.proc-ring { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(0.8); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.proc-ring-circle { stroke: var(--proc-tone); stroke-width: 3; stroke-dasharray: 139; stroke-dashoffset: 139; transform: rotate(-90deg); transform-origin: 28px 28px; }
.proc-mark { stroke: var(--proc-tone); stroke-width: 3.2; stroke-dasharray: 40; stroke-dashoffset: 40; opacity: 0; }
.proc:is([data-state="ok"], [data-state="warn"], [data-state="err"]) .proc-sheet, .proc:is([data-state="ok"], [data-state="warn"], [data-state="err"]) .proc-book { opacity: 0.16; transform: scale(0.94); }
.proc:is([data-state="ok"], [data-state="warn"], [data-state="err"]) .proc-ring { opacity: 1; transform: none; }
.proc:is([data-state="ok"], [data-state="warn"], [data-state="err"]) .proc-ring-circle { stroke-dashoffset: 0; }
.proc[data-state="ok"] .proc-mark-ok, .proc[data-state="warn"] .proc-mark-warn, .proc[data-state="err"] .proc-mark-err { opacity: 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .proc[data-phase="take"] .proc-sheet { animation: proc-take 0.65s var(--ease) both; }
  .proc[data-state="run"][data-phase="read"] .proc-beam { animation: proc-beam 1.25s ease-in-out infinite; }
  .proc[data-state="run"][data-phase="read"] .proc-sheet > i { animation: proc-line 1.25s ease-in-out infinite; }
  .proc[data-state="run"][data-phase="read"] .proc-sheet > i:nth-of-type(2) { animation-delay: 0.14s; }
  .proc[data-state="run"][data-phase="read"] .proc-sheet > i:nth-of-type(3) { animation-delay: 0.28s; }
  .proc[data-state="run"][data-phase="read"] .proc-sheet > i:nth-of-type(4) { animation-delay: 0.42s; }
  .proc[data-state="run"][data-phase="post"] .proc-flow > i { animation: proc-dot 0.96s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
  .proc[data-state="run"][data-phase="post"] .proc-flow > i:nth-child(2) { animation-delay: 0.32s; }
  .proc[data-state="run"][data-phase="post"] .proc-flow > i:nth-child(3) { animation-delay: 0.64s; }
  .proc[data-state="run"][data-phase="post"] .proc-book { animation: proc-bump 0.96s var(--ease) infinite; }
  .proc[data-state="run"][data-phase="post"] .proc-sheet > i { animation: proc-fade 1.9s ease-in-out infinite; }
  .proc[data-state="run"] .proc-step[data-s="now"] .proc-dot { animation: proc-pulse 1.4s ease-out infinite; }
  .proc-step[data-s="done"] .proc-dot { animation: proc-pop 0.3s var(--ease); }
  .proc-bar.flow > i { animation: proc-flow 1.15s ease-in-out infinite; }
  .proc:is([data-state="ok"], [data-state="warn"], [data-state="err"]) .proc-ring-circle { transition: stroke-dashoffset 0.6s var(--ease) 0.1s; }
  .proc:is([data-state="ok"], [data-state="warn"], [data-state="err"]) .proc-mark { transition: stroke-dashoffset 0.32s var(--ease) 0.55s, opacity 0.1s linear 0.55s; }
  .proc[data-state="ok"] .proc-ring svg { animation: proc-glow 0.9s var(--ease) 0.7s; border-radius: 50%; }
  .proc[data-state="err"] .proc-ring svg { animation: shake 0.4s var(--ease) 0.75s; }
  .proc-stat { animation: fade-in 0.3s var(--ease) backwards; }
  .proc-stat:nth-child(2) { animation-delay: 0.08s; } .proc-stat:nth-child(3) { animation-delay: 0.16s; } .proc-stat:nth-child(4) { animation-delay: 0.24s; }
}
@keyframes proc-take { from { opacity: 0; transform: translate(-34px, 8px) rotate(-10deg); } 60% { opacity: 1; transform: translate(2px, -2px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
@keyframes proc-beam { 0%, 100% { top: 16px; opacity: 0; } 12%, 88% { opacity: 1; } 50% { top: 54px; opacity: 1; } }
@keyframes proc-line { 0%, 100% { background: var(--border-strong); } 35% { background: var(--rose-400); } }
@keyframes proc-dot { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 18% { opacity: 1; } 55% { transform: translate(22px, -9px) scale(1); } 86% { opacity: 1; } 100% { opacity: 0; transform: translate(42px, 0) scale(0.5); } }
@keyframes proc-bump { 0%, 70%, 100% { transform: scale(1); } 84% { transform: scale(1.07); } }
@keyframes proc-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes proc-pulse { 0% { box-shadow: 0 0 0 0 oklch(0.66 0.15 15 / 45%); } 100% { box-shadow: 0 0 0 9px oklch(0.66 0.15 15 / 0%); } }
@keyframes proc-pop { from { transform: scale(0.6); } 70% { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes proc-flow { from { transform: translateX(-110%); } to { transform: translateX(290%); } }
@keyframes proc-glow { from { box-shadow: 0 0 0 0 color-mix(in oklch, var(--success) 45%, transparent); } to { box-shadow: 0 0 0 16px transparent; } }
@media (max-width: 560px) {
  .proc { flex-direction: column; align-items: stretch; gap: 12px; }
  .proc-scene { width: 100%; height: 76px; }
  .proc-sheet { left: calc(50% - 66px); top: 8px; }
  .proc-flow { left: calc(50% - 18px); top: 34px; }
  .proc-book { right: calc(50% - 68px); top: 17px; }
  /* на телефоне шаг — столбик: кружок, под ним название, без соединительных линий. В ряд названия помещались только
     в широком блоке; в узком (карточка в боковом окне) их перекрывал кружок следующего шага */
  .proc-steps { align-items: flex-start; gap: 2px; }
  .proc-step, .proc-step:last-child { flex: 1 1 0; flex-direction: column; gap: 4px; text-align: center; }
  .proc-step b { font-size: 11px; }
  .proc-step:not(:last-child)::after { display: none; }
  .proc-dot { width: 20px; height: 20px; }
}
/* «Сервис сделал сам» по всем клиентам (web/pulse.js): заголовок с периодом, числа итога, организации, где что-то ждёт */
.auto-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; padding: 14px var(--pad); background-image: radial-gradient(60% 160% at 100% 0%, oklch(0.735 0.115 13.5 / 9%), transparent 60%); }
.auto-strip[hidden] { display: none; }
.auto-head { display: flex; align-items: baseline; gap: 10px; }
.auto-head h3 { margin: 0; }
.auto-head .muted { font-size: 12.5px; }
.auto-strip .proc-stats { flex: 1 1 auto; }
.auto-where { display: flex; flex-wrap: wrap; gap: var(--gap-sm); }
/* кнопки блока первого экрана отделены от строк и пояснения над ними: без отступа пояснение стояло вплотную */
.pulse-card .auto-where { margin-top: var(--gap-sm); }
.auto-strip > .hint { flex: 1 1 100%; margin: 0; }
/* под блоком процесса: кнопки и строка о том, что обработано */
.card > .proc + .actions { margin-top: var(--gap); }
.card > .proc-note { margin: 8px 2px 0; font-size: 12.5px; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════
   15. НОВЫЙ ДИЗАЙН РАБОЧЕГО МЕСТА (макет заказчика 26.11.2026: «пересобери по новому дизайну»)
   Источник — макеты заказчика (24 экрана и три общие панели) и их токены:
     — акцент синий #2F5BEA, тёмный синий текст на подложке #1E3A8A / #EEF2FF; состояния — зелёный, оранжевый, красный;
     — фон #F5F6FA с точечной сеткой 20 px; блок — белый, рамка #E5E7EB, скругление 12, тень «парения»;
     — шрифт Roboto Condensed 400/500/600, цифры — табличные; выделение — 500, заголовки — 600;
     — промежуток между блоками 8, внутри блока 12;
     — сверху полоса на всю ширину (знак, организация, инструменты фирмы, поиск, монитор, пользователь) и под ней ряд
       открытых окон; слева — светлая панель разделов с градиентом (64 сложенная, 216 раскрытая), у раздела —
       выпадающее меню; справа — монитор 320;
     — страница: заголовок с отметками состояния и главным действием справа, вкладки-«пилюли», плитки, блок со списком.
   Каркас размечен новыми классами (.shell, .top, .rail, .stage): правила прежнего каркаса (.app, .sidebar, .topbar,
   .main, .work) к нему не относятся. Тёмная тема — те же роли, значения выведены из светлых (в макете её нет).
   Прежние имена ступеней акцента (--rose-*, --violet-*) оставлены для страниц и указывают на синюю шкалу.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  --font: "Roboto Condensed", "Arial Narrow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; --stretch: 100%;
  /* синяя шкала макета: 50 — подложка акцента, 600 — акцент, 800 — тёмный текст на подложке */
  --blue-50: #EEF2FF; --blue-100: #DCE6FF; --blue-200: #B4C6FF; --blue-300: #8FA9FF; --blue-400: #6F8DF5; --blue-500: #4A74F0;
  --blue-600: #2F5BEA; --blue-700: #1E40AF; --blue-800: #1E3A8A; --blue-900: #172554;
  --rose-50: var(--blue-50); --rose-100: var(--blue-100); --rose-200: var(--blue-200); --rose-300: var(--blue-300); --rose-400: var(--blue-400);
  --rose-500: var(--blue-500); --rose-600: var(--blue-600); --rose-700: var(--blue-700); --rose-800: var(--blue-800); --rose-900: var(--blue-900);
  --brand: #2F5BEA; --brand-hover: #264CCB; --brand-active: #1E40AF; --brand-tint: #EEF2FF; --on-brand: #fff; --link: #2F5BEA; --link-hover: #1E40AF;
  --ring: #6F8DF5; --ring-halo: rgba(47, 91, 234, 0.18);
  /* подсветка: наведение на строку, выбранное в списке, подложка отметки «авто» */
  --accent: #F5F7FF; --accent-fg: #1E3A8A; --row-hover: #F8FAFF;
  --violet-50: var(--blue-50); --violet-100: #DCE3F5; --violet-200: #C7D2FE; --violet-300: var(--blue-300); --violet-400: var(--ring);
  --violet-500: var(--blue-500); --violet-600: var(--brand); --violet-700: var(--blue-800); --violet-900: #111827;
  /* поверхности и текст */
  --bg: #F5F6FA; --dot: #D9DDE8; --surface: #FFFFFF; --surface-2: #F5F6FA; --surface-3: #FAFAFC;
  --border: #E5E7EB; --border-strong: #D1D5DB; --border-subtle: #F1F2F6; --input: #E5E7EB;
  --text: #111827; --text-2: #374151; --text-3: #6B7280; --text-4: #9CA3AF;
  /* состояния: в порядке, проверить, ошибка */
  --success: #10B981; --success-text: #047857; --success-tint: #ECFDF5; --success-line: #A7F3D0;
  --warn: #F59E0B; --warn-text: #9A3412; --warn-tint: #FFF7ED; --warn-line: #FED7AA;
  --danger: #EF4444; --danger-text: #B91C1C; --danger-tint: #FEF2F2; --danger-line: #FECACA;
  --info-text: #1E3A8A; --info-tint: #EEF2FF;
  --picked: #EEF2FF; --field-bg: #fff; --seg-on: #fff; --scrim: rgba(17, 24, 39, 0.28); --on-white: #111827;
  /* форма: скругление блока 12, поля и кнопки 10; тень «парения» */
  --r-card: 12px; --r-el: 10px; --shade: 0.2 0.03 265;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 28px -8px rgba(30, 58, 138, 0.16);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 18px 36px -10px rgba(30, 58, 138, 0.24);
  --shadow-pop: 0 2px 6px rgba(16, 24, 40, 0.06), 0 24px 60px rgba(30, 58, 138, 0.18);
  --shadow-top: 0 6px 20px -10px rgba(30, 58, 138, 0.18);
  /* размеры блочной схемы по макету: между блоками 8, внутри блока 12 */
  --gap: 8px; --gap-sm: 6px; --pad: 12px; --ctl-h: 36px; --ctl-h-sm: 30px;
  /* каркас: верхняя полоса 56 + ряд открытых окон 36; панель разделов 64 / 216; монитор 320 */
  --top-row: 56px; --tabs-row: 36px; --top-h: 92px; --rail-closed: 64px; --rail-open: 216px; --monitor-w: 320px;
  --rail-grad: linear-gradient(185deg, #FFFFFF 0%, #F2F6FF 28%, #DCE6FF 58%, #B4C6FF 82%, #8FA9FF 100%); --rail-border: #DCE3F5;
  --rail-text: #374151; --rail-hover: rgba(255, 255, 255, 0.72); --rail-line: rgba(17, 24, 39, 0.08); --rail-dash: #6F8DF5; --rail-dash-text: #1E40AF;
  --glass: rgba(255, 255, 255, 0.92); --ink-pill: #111827; --on-ink-pill: #fff; --tip-bg: #111827; --tip-text: #fff; --seg-text: #5B6370;
  --aurora: none; --brand-grad: none; --brand-glow: none;
  /* телефон: нижние вкладки — светлая полоса */
  --side-bg: #FFFFFF; --side-text: #374151; --side-hover: #EEF2FF; --side-active: #2F5BEA; --side-on-active: #fff; --side-line: #E5E7EB;
  /* графики: шкала одного синего тона */
  --chart-a: #2F5BEA; --chart-b: #1E3A8A; --chart-1: #B4C6FF; --chart-2: #6F8DF5; --chart-3: #2F5BEA; --chart-4: #1E3A8A;
  --chart-other: #9CA3AF; --chart-grid: #F1F2F6; --chart-axis: #D1D5DB; --chart-band: #F5F7FF;
}
:root[data-theme="dark"] {
  --brand-tint: rgba(91, 140, 255, 0.16); --link: #8FA9FF; --link-hover: #B4C6FF; --ring: #6F8DF5; --ring-halo: rgba(111, 141, 245, 0.3);
  --accent: rgba(91, 140, 255, 0.1); --accent-fg: #C7D5FF; --row-hover: rgba(91, 140, 255, 0.07);
  --violet-50: rgba(91, 140, 255, 0.14); --violet-100: rgba(255, 255, 255, 0.1); --violet-200: rgba(143, 169, 255, 0.34); --violet-700: #C7D5FF; --violet-900: #2A3246;
  --bg: #0F1420; --dot: rgba(255, 255, 255, 0.07); --surface: #171D2B; --surface-2: #1F2637; --surface-3: #1B2232;
  --border: rgba(255, 255, 255, 0.1); --border-strong: rgba(255, 255, 255, 0.2); --border-subtle: rgba(255, 255, 255, 0.06); --input: rgba(255, 255, 255, 0.15);
  --text: #F3F4F6; --text-2: #CBD0DA; --text-3: #A3ABBA; --text-4: #8891A1;
  --success: #34D399; --success-text: #6EE7B7; --success-tint: rgba(16, 185, 129, 0.14); --success-line: rgba(16, 185, 129, 0.32);
  --warn: #FBBF24; --warn-text: #FDBA74; --warn-tint: rgba(245, 158, 11, 0.14); --warn-line: rgba(245, 158, 11, 0.32);
  --danger: #EF4444; --danger-text: #FCA5A5; --danger-tint: rgba(239, 68, 68, 0.14); --danger-line: rgba(239, 68, 68, 0.34);
  --info-text: #C7D5FF; --info-tint: rgba(91, 140, 255, 0.16);
  --picked: rgba(91, 140, 255, 0.16); --field-bg: rgba(255, 255, 255, 0.045); --seg-on: rgba(255, 255, 255, 0.14); --scrim: rgba(0, 0, 0, 0.6); --on-white: #111827;
  --shade: 0 0 0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px -8px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.45), 0 18px 36px -10px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, 0.45), 0 24px 60px rgba(0, 0, 0, 0.7);
  --shadow-top: 0 6px 20px -10px rgba(0, 0, 0, 0.7);
  --rail-grad: linear-gradient(185deg, #1B2233 0%, #1A2440 34%, #1B2B5C 68%, #213887 100%); --rail-border: rgba(255, 255, 255, 0.1);
  --rail-text: #D5DBE8; --rail-hover: rgba(255, 255, 255, 0.09); --rail-line: rgba(255, 255, 255, 0.1); --rail-dash: #6F8DF5; --rail-dash-text: #C7D5FF;
  --glass: rgba(18, 23, 35, 0.92); --ink-pill: #F3F4F6; --on-ink-pill: #111827; --tip-bg: #F3F4F6; --tip-text: #111827; --seg-text: #A3ABBA;
  --side-bg: #171D2B; --side-text: #CBD0DA; --side-hover: rgba(91, 140, 255, 0.14); --side-line: rgba(255, 255, 255, 0.1);
  --chart-a: #6F8DF5; --chart-b: #B4C6FF; --chart-1: #B4C6FF; --chart-2: #8FA9FF; --chart-3: #4A74F0; --chart-4: #2F5BEA;
  --chart-other: #6F7888; --chart-grid: rgba(255, 255, 255, 0.07); --chart-axis: rgba(255, 255, 255, 0.22); --chart-band: rgba(255, 255, 255, 0.05);
}

/* ——— основа ——— */
body { font-size: 14px; line-height: 1.4; letter-spacing: 0; font-feature-settings: normal; font-variant-numeric: tabular-nums; color: var(--text);
  background: var(--bg) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 20px 20px; background-attachment: fixed; }
b, strong { font-weight: 500; }
h1, h2, h3 { letter-spacing: 0; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
::selection { background: rgba(47, 91, 234, 0.2); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.mono { font-size: 12.5px; }
/* подсказка-пузырёк у значков каркаса (панель разделов, кнопки верхней полосы): название — аккуратной плашкой */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:not([data-tip=""]):hover::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); background: var(--tip-bg); color: var(--tip-text);
    font-size: 12px; font-weight: 500; line-height: 1.2; padding: 6px 9px; border-radius: 8px; white-space: nowrap; z-index: 70; pointer-events: none; box-shadow: var(--shadow); }
  .rail [data-tip]:not([data-tip=""]):hover::after { left: calc(100% + 10px); top: 50%; transform: translateY(-50%); }
  .top-right [data-tip]:not([data-tip=""]):hover::after { left: auto; right: 0; transform: none; }
}

/* ——— каркас: полоса сверху, под ней панель разделов, раздел и монитор ——— */
.shell { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: 100dvh; min-width: 0; }
.top { position: relative; z-index: 20; display: grid; grid-template-columns: var(--rail-closed) minmax(0, 1fr) auto; grid-template-rows: var(--top-row) var(--tabs-row); column-gap: var(--gap); align-items: center;
  padding: 0 var(--gap); background: var(--glass); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-top); container: top / inline-size; }
.top-logo { justify-self: center; width: 36px; height: 36px; display: block; border-radius: 9px; }
.top-logo svg { display: block; width: 100%; height: 100%; }
.top-mid { display: flex; align-items: center; gap: var(--gap); min-width: 0; }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: var(--gap); min-width: 0; }
@media (min-width: 1201px) { .top-right { width: var(--monitor-w); } }
/* организация: плашка с названием и БИН, список браузера лежит поверх неё невидимым */
.org-pick { position: relative; flex: 0 1 300px; min-width: 150px; display: flex; align-items: center; height: var(--ctl-h); border: 1px solid var(--border); border-radius: var(--r-el); background: var(--surface); cursor: pointer; }
.org-pick-face { flex: 1; min-width: 0; padding: 0 30px 0 12px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.org-pick-face b { font-weight: 500; }
.org-pick-face span { color: var(--text-3); }
.org-pick::after { content: ''; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border: solid var(--text-3); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); pointer-events: none; }
.org-pick select { position: absolute; inset: 0; width: 100%; height: 100% !important; opacity: 0; cursor: pointer; border: 0; padding: 0 12px; font-size: 14px; }
.org-pick:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-halo); }
.org-pick:hover { border-color: var(--border-strong); }
/* инструменты фирмы */
.top-tools { display: flex; align-items: center; gap: 2px; min-width: 0; }
.top-tool { position: relative; height: var(--ctl-h); padding: 0 10px; border-radius: 9px; display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.top-tool .icon { width: 16px; height: 16px; color: var(--text-3); }
.top-tool:hover { background: var(--brand-tint); color: var(--accent-fg); text-decoration: none; }
.top-tool.active { background: var(--brand-tint); color: var(--accent-fg); }
.top-tool.active .icon, .top-tool:hover .icon { color: currentColor; }
.top-tool.off { opacity: 0.45; }
.top-tool.soon { opacity: 0.6; }
.top-count { font-size: 11px; font-weight: 600; color: var(--link); }
.top-count.err { color: var(--danger-text); }
/* поиск функций, монитор, пользователь */
.top-find { font: inherit; flex: 1 1 auto; min-width: 0; height: var(--ctl-h); display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-el); background: var(--surface); color: var(--text-3); font-size: 13px; cursor: pointer; text-align: left; }
.top-find:hover { border-color: var(--border-strong); color: var(--text-2); }
.top-find .icon { width: 16px; height: 16px; flex: none; }
.top-find span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-find kbd { font: inherit; font-size: 12px; color: var(--text-3); flex: none; }
.top-btn { position: relative; font: inherit; flex: none; width: var(--ctl-h); height: var(--ctl-h); border-radius: var(--r-el); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; display: grid; place-items: center; padding: 0; }
.top-btn:hover { border-color: var(--border-strong); background: var(--accent); }
.top-btn[aria-expanded="true"] { background: var(--brand-tint); border-color: var(--violet-200); color: var(--accent-fg); }
.top-btn .icon { width: 17px; height: 17px; }
.top-btn .monitor-count { position: absolute; top: -5px; right: -5px; }
.gw { flex: none; gap: 6px; font-size: 12px; font-weight: 500; }
.gw.ok { display: none; }
.account { position: relative; flex: none; }
.account-btn { font: inherit; width: var(--ctl-h); height: var(--ctl-h); padding: 0; border: 0; border-radius: var(--r-el); background: var(--ink-pill); color: var(--on-ink-pill); font-size: 13px; font-weight: 500; cursor: pointer; display: grid; place-items: center; }
.account-btn:hover { filter: brightness(1.25); }
:root[data-theme="dark"] .account-btn:hover { filter: brightness(0.9); }
.account-menu { top: calc(100% + 8px); right: 0; }
/* ряд открытых окон */
.wtabs { grid-column: 2 / 3; grid-row: 2; align-self: start; display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.wtab { flex: 0 1 auto; min-width: 0; height: var(--ctl-h-sm); padding: 0 6px 0 12px; border-radius: 8px; display: flex; align-items: center; gap: 2px; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.wtab > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wtab.fixed { padding-right: 12px; flex: none; }
.wtab:hover { background: var(--accent); color: var(--text); text-decoration: none; }
.wtab.active { background: var(--brand-tint); color: var(--accent-fg); }
.wtab-x { font: inherit; flex: none; width: 20px; height: 20px; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; display: grid; place-items: center; padding: 0; font-size: 14px; line-height: 1; }
.wtab-x:hover { background: rgba(17, 24, 39, 0.08); color: var(--text); }
:root[data-theme="dark"] .wtab-x:hover { background: rgba(255, 255, 255, 0.12); }
/* место в полосе: подписи инструментов уходят раньше, чем сжимается организация */
@container top (max-width: 1180px) { .top-tool { padding: 0 9px; } .top-tool > span:not(.top-count) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); } }
@container top (max-width: 1199px) { .top-find { flex: none; width: var(--ctl-h); padding: 0; justify-content: center; } .top-find span, .top-find kbd { display: none; } }
@container top (max-width: 760px) { .org-pick { flex-basis: 220px; } .gw span { display: none; } }

.body { display: flex; align-items: stretch; gap: var(--gap); padding: var(--gap); min-height: 0; min-width: 0; }
.rail { flex: none; width: var(--rail-closed); height: 100%; box-sizing: border-box; overflow: hidden auto; scrollbar-width: none; background: var(--rail-grad); border: 1px solid var(--rail-border); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 8px; transition: width 0.2s var(--ease); z-index: 12; }
.rail::-webkit-scrollbar { display: none; }
.rail-open .rail { width: var(--rail-open); }
#nav { display: flex; flex-direction: column; gap: 3px; padding: 0; }
.rail-toggle { font: inherit; height: var(--ctl-h-sm); flex: none; border: 0; border-radius: 9px; background: var(--rail-hover); color: var(--rail-text); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; font-size: 12px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; }
.rail-open .rail-toggle { justify-content: flex-start; }
.rail-toggle:hover { background: var(--surface); }
.rail-sep { height: 1px; flex: none; background: var(--rail-line); margin: 4px 8px; }
.rail-item { position: relative; font: inherit; height: 38px; flex: none; border: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 12px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; background: transparent; color: var(--rail-text); text-align: left; }
.rail-open .rail-item { justify-content: flex-start; }
.rail-item .icon { width: 20px; height: 20px; flex: none; }
.rail-item > span.rail-label { display: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.rail-open .rail-item > span.rail-label, .rail-open .rail-toggle > span { display: block; }
.rail-toggle > span { display: none; }
.rail-item:hover { background: var(--brand-tint); }
.rail-item.active, .rail-item.open { background: var(--brand); color: #fff; }
.rail-item.off { opacity: 0.45; }
.rail-item.dashed { border: 1.5px dashed var(--rail-dash); color: var(--rail-dash-text); }
.rail-item.dashed.open { border-style: solid; border-color: var(--brand); color: #fff; }
.rail-item:focus-visible { outline-offset: 1px; }
/* счётчик «ждёт вас» из риск-монитора: точка с числом в углу значка */
.rail-count { position: absolute; top: 3px; right: 5px; min-width: 15px; box-sizing: border-box; padding: 0 4px; border-radius: 999px; background: #FBBF24; color: #111827; font-size: 10px; font-weight: 600; line-height: 15px; text-align: center; }
.rail-count.high { background: #DC2626; color: #fff; }
.rail-open .rail-count { position: static; flex: none; }
.rail-item.active .rail-count, .rail-item.open .rail-count { box-shadow: 0 0 0 1.5px var(--brand); }
/* невысокий экран: шестнадцать значков плотнее, панель остаётся без прокрутки */
@media (max-height: 860px) { .rail-item { height: 34px; } #nav { gap: 2px; } .rail-sep { margin: 3px 8px; } }
@media (max-height: 760px) { .rail-item { height: 30px; } .rail-item .icon { width: 18px; height: 18px; } .rail-toggle { height: 26px; margin-bottom: 2px; } .rail-sep { margin: 2px 8px; } .rail { padding: 6px 8px; } }
@media (max-height: 660px) { .rail-item { height: 27px; } #nav { gap: 1px; } }

/* меню раздела: колонки ссылок рядом с панелью */
.rail-menu { position: fixed; z-index: 60; box-sizing: border-box; width: min(760px, calc(100vw - 2 * var(--gap) - var(--rail-closed) - var(--gap))); max-height: calc(100vh - 2 * var(--gap)); overflow: auto; background: var(--surface); border: 1px solid var(--rail-border); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 14px 16px 16px; }
.rail-menu:focus { outline: none; }
.rail-menu-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rail-menu-head b { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; }
.rail-menu-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 32px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; background: var(--field-bg); color: var(--text-3); }
.rail-menu-search:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-halo); }
.rail-menu-search .icon { width: 14px; height: 14px; flex: none; }
.rail-menu-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; box-shadow: none !important; background: transparent; height: 30px !important; padding: 0 !important; font-size: 13px !important; color: var(--text); }
.rail-menu-close { font: inherit; flex: none; width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 16px; line-height: 1; display: grid; place-items: center; padding: 0; }
.rail-menu-close:hover { background: var(--border); }
.rail-menu-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rail-menu-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rail-menu-cap { font-size: 11px; font-weight: 600; color: var(--brand); letter-spacing: 0.06em; text-transform: uppercase; padding: 0 8px 6px; }
:root[data-theme="dark"] .rail-menu-cap { color: var(--link); }
.rail-menu-link { font: inherit; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font-size: 13px; line-height: 1.3; text-decoration: none; color: var(--text); text-align: left; cursor: pointer; }
.rail-menu-link:hover { background: var(--row-hover); color: var(--text); text-decoration: none; }
.rail-menu-link.lead { font-weight: 500; }
.rail-menu-link.off { color: var(--text-4); cursor: default; }
.rail-menu-link .zap { color: var(--link); font-size: 11px; flex: none; }
.rail-menu-link .rail-count { position: static; flex: none; }
.rail-menu-link .ext { color: var(--text-3); font-size: 11px; flex: none; }
.rail-menu-empty { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; padding: 4px 8px; }
@media (max-width: 900px) { .rail-menu-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* раздел: прокручивается он, а не окно; поля по краям — место для тени блоков */
.stage { flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden auto; margin: calc(-1 * var(--gap)); padding: var(--gap) var(--gap) 40px; scrollbar-width: thin; scrollbar-color: rgba(30, 58, 138, 0.22) transparent; }
:root[data-theme="dark"] .stage { scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
#view { min-width: 0; }
html { scrollbar-gutter: auto; }
@media print { .shell, .body, .stage { display: block !important; height: auto !important; overflow: visible !important; margin: 0 !important; padding: 0 !important; } .top, .rail, .tabbar, #monitor { display: none !important; } body { background: #fff !important; } }

/* ——— монитор: блок справа; вкладки — дорожка, строки — точка, название, отметка ——— */
.monitor { position: relative; top: auto; flex: 0 0 var(--monitor-w); width: var(--monitor-w); height: 100%; box-sizing: border-box; display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; z-index: 4; }
.monitor-head { background: none; border-bottom: 0; padding: 8px 8px 0; display: flex; align-items: center; gap: 6px; }
.monitor-head .monitor-tabs, .monitor-tabs { flex: 1; min-width: 0; display: flex; gap: 4px; height: auto; padding: 4px; border: 0; border-radius: 10px; background: var(--surface-2); }
.monitor-head .monitor-tabs button, .monitor-tabs button { flex: 1 1 0; min-width: 0; height: 32px; padding: 0 6px; border: 0; border-radius: 9px; background: transparent; color: var(--seg-text); font-size: 13px; font-weight: 500; gap: 5px; box-shadow: none; }
.monitor-tabs button:hover { color: var(--text); }
.monitor-head .monitor-tabs button.on, .monitor-tabs button.on { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06); }
.monitor-tabs .monitor-count, .monitor-count { background: none; color: inherit; padding: 0; font-size: 13px; font-weight: 500; line-height: inherit; }
.monitor-tabs .monitor-count.err { background: none; color: var(--danger-text); }
.monitor-tabs .monitor-count.warn { background: none; color: var(--warn-text); }
.top-btn .monitor-count { min-width: 16px; box-sizing: border-box; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
.top-btn .monitor-count.err { background: var(--danger); color: #fff; }
.monitor-head .icon-btn { display: none; color: var(--text-3); width: 32px; height: 32px; }
.monitor-head .icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.monitor-body { padding: 8px; gap: 6px; }
.monitor-body > .hint { font-size: 12px; color: var(--text-3); padding: 0 2px; }
.mon-risk { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 10px; border: 1px solid var(--border-subtle); border-left-width: 1px; border-radius: 12px; background: none; box-shadow: none; color: var(--text); text-decoration: none; }
a.mon-risk:hover { background: var(--row-hover); color: var(--text); text-decoration: none; }
.mon-risk > i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex: none; }
.mon-risk.high > i { background: var(--danger); }
.mon-risk.medium > i { background: var(--warn); }
.mon-risk > b { flex: 1; min-width: 0; font-size: 13px; font-weight: 400; }
.mon-risk > small { font-size: 12px; color: var(--text-3); flex: none; }
.mon-risk > p { flex: 0 0 100%; margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-3); line-height: 1.35; }
.mon-task { border-color: var(--border-subtle); border-radius: 12px; box-shadow: none; padding: 10px; }
.mon-task-title { font-weight: 500; font-size: 13px; }
.mon-ok { font-size: 12.5px; }
.monitor-body details > summary { font-size: 12.5px; color: var(--text-3); cursor: pointer; padding: 2px; }
@media (max-width: 1200px) {
  .monitor { position: fixed; top: var(--gap); right: var(--gap); bottom: var(--gap); height: auto; width: min(360px, calc(100vw - 2 * var(--gap))); z-index: 40; box-shadow: var(--shadow-pop); border-radius: var(--r-card); border-width: 1px; }
  .monitor-head .icon-btn { display: grid; }
}

/* ——— страница: заголовок, отметки состояния, главное действие, вкладки ——— */
.page-head { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; min-height: var(--ctl-h); }
.page-head h1 { margin: 0 6px 0 0; font-size: 21px; font-weight: 600; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.page-head .back-btn { flex: none; width: var(--ctl-h); height: var(--ctl-h); border-radius: var(--r-el); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; box-shadow: var(--shadow); }
.page-head .back-btn:hover { background: var(--accent); text-decoration: none; }
.page-chips { display: flex; align-items: center; gap: var(--gap-sm); flex-wrap: wrap; min-width: 0; }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: var(--gap-sm); flex-wrap: wrap; justify-content: flex-end; }
.page-actions .btn { height: 34px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; border: 0; text-decoration: none; }
.tag.plain { background: none; padding: 0 2px; color: var(--text-2); }
.tag.ok { background: var(--success-tint); color: var(--success-text); }
.tag.warn { background: var(--warn-tint); color: var(--warn-text); }
.tag.err { background: var(--danger-tint); color: var(--danger-text); }
.tag.info, .tag.auto { background: var(--info-tint); color: var(--info-text); }
.tag.auto::before { content: '⚡'; font-size: 11px; }
a.tag:hover { filter: brightness(0.97); text-decoration: none; }
/* крупные отметки под плитками сводки: что сервис сделал сам и что проверить */
.tags-row { display: flex; gap: var(--gap); flex-wrap: wrap; }
.tags-row .tag { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
/* вкладки раздела: ряд «пилюль» прямо на поле страницы; выбранная — тёмная */
.page-tabs { display: flex; gap: var(--gap-sm); flex-wrap: wrap; align-items: center; }
#view .page-tabs > .seg, #view > * > .seg, #view > * > div:not([class]) > .seg { display: flex; flex-wrap: wrap; gap: var(--gap-sm); height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; max-width: 100%; }
#view .page-tabs > .seg button, #view > * > .seg button, #view > * > div:not([class]) > .seg button { height: var(--ctl-h-sm); padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; box-shadow: none; }
#view .page-tabs > .seg button:hover, #view > * > .seg button:hover, #view > * > div:not([class]) > .seg button:hover { border-color: var(--border-strong); color: var(--text); }
#view .page-tabs > .seg button.on, #view > * > .seg button.on, #view > * > div:not([class]) > .seg button.on { background: var(--ink-pill); border-color: var(--ink-pill); color: var(--on-ink-pill); box-shadow: none; }

/* ——— блоки ——— */
.card { padding: var(--pad); border-radius: var(--r-card); border-color: var(--border); box-shadow: var(--shadow); }
.card h3, .section-title, .chart-head h3 { font-size: 15px; font-weight: 500; letter-spacing: 0; }
.card.soft { background: var(--surface); }
.card.link:hover, a.stat:hover, a.card:hover { transform: none; border-color: var(--violet-200); }
.tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--gap); margin-bottom: 0; }
.stat { padding: var(--pad); background-image: none !important; overflow: visible; border-radius: var(--r-card); }
.stat-icon { display: none; }
.stat-label { font-size: 12px; font-weight: 400; color: var(--text-3); }
.stat .stat-value { font-size: clamp(15px, 10cqi, 21px); font-weight: 600; letter-spacing: 0; line-height: 1.2; margin-top: 5px; color: var(--text); }
.stat-value .tiyn { font-weight: 500; letter-spacing: 0; }
.stat-sub { font-size: 11.5px; margin-top: 3px; color: var(--text-3); }
.stat.neg .stat-value { color: var(--danger-text); }
.stat.warn .stat-value { color: var(--warn-text); }
.stat.ok .stat-value { color: var(--success-text); }
.stat.auto .stat-label::before { content: '⚡ '; color: var(--brand); font-size: 11px; }
/* панель действий и подвал списка — блоки 12 px */
.toolbar { gap: var(--gap-sm); margin-bottom: 0; }
#view > * > .toolbar, #view > * > div:not([class]) > .toolbar, #view > * > div:not([class]) > div:not([class]) > .toolbar, #view .doclist > .toolbar, #view .doclist > * > .toolbar { padding: 8px 10px; min-height: calc(var(--ctl-h) + 18px); border-radius: var(--r-card); }
.toolbar-label { font-size: 14px; font-weight: 500; color: var(--text); margin: 0 4px; }
.pager { padding: 8px 12px; min-height: 0; font-size: 12px; color: var(--text-3); }
#view > * > .section-title, #view > * > div:not([class]) > .section-title { padding: 10px 12px; min-height: 0; }
#view > * > p, #view > * > div:not([class]) > p, #view .doclist > p, #view > * > .hint, #view > * > div:not([class]) > .hint, #view > * > .empty, #view > * > div:not([class]) > .empty,
#view > * > div:not([class]) > div:not([class]) > p, #view > * > div:not([class]) > div:not([class]) > .hint, #view > * > div:not([class]) > div:not([class]) > .empty { padding: 10px 12px; font-size: 13px; }
#view > * > .note, #view > * > div:not([class]) > .note, #view > * > div:not([class]) > div:not([class]) > .note, #view .doclist > .note { padding: 10px 12px; }
.hint { font-size: 12.5px; color: var(--text-3); }
.empty { padding: 28px 16px; font-size: 13px; }

/* ——— таблицы: шапка на светлой подложке, плотные строки ——— */
.table-wrap { border-radius: var(--r-card); border-color: var(--border); box-shadow: var(--shadow); }
table { font-size: 13px; }
th { background: var(--surface-3); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--text-3); padding: 9px 10px; border-bottom: 1px solid var(--border-subtle); }
td { font-size: 13px; padding: 9px 10px; border-bottom: 1px solid var(--border-subtle); }
th:first-child, td:first-child { padding-left: 12px; }
th:last-child, td:last-child { padding-right: 12px; }
tr.click:hover td { background: var(--row-hover); }
tr.picked td, tr.click.picked:hover td { background: var(--picked); }
td b { font-weight: 500; }
td .muted, td div.muted { font-size: 12px; }
.report tfoot td, .report tr.total td { font-weight: 600; }
.report tr.group td { font-weight: 500; }

/* ——— поля и кнопки ——— */
input, select, textarea { border-color: var(--input); border-radius: var(--r-el); }
@media (min-width: 641px) { input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="hidden"]), select, textarea.plain { font-size: 13px; } }
input::placeholder, textarea::placeholder { color: var(--text-4); }
.btn { border-color: var(--border); border-radius: var(--r-el); font-size: 13px; font-weight: 500; letter-spacing: 0; box-shadow: none; color: var(--text); }
.btn:hover { background-color: var(--accent); border-color: var(--border-strong); color: var(--text); }
.btn.small { border-radius: 8px; font-size: 12.5px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: none; }
.btn.primary:hover { background: var(--brand-hover); background-color: var(--brand-hover); border-color: var(--brand-hover); color: #fff; filter: none; box-shadow: none; }
.btn.soft { background: var(--brand-tint); border-color: var(--violet-200); color: var(--accent-fg); }
.btn.link { color: var(--link); }
.btn.link:hover { background: var(--brand-tint); color: var(--link-hover); }
.btn.danger { color: var(--danger-text); }
.icon-btn { border-radius: 8px; }
.seg { border: 0; border-radius: 10px; padding: 3px; background: var(--surface-2); height: var(--ctl-h); }
:root[data-theme="dark"] .seg { background: rgba(255, 255, 255, 0.07); }
/* невыбранная вкладка на серой дорожке: тон темнее третьего — на подложке он читается (контраст не ниже 4,5) */
.seg button { border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--seg-text); }
.seg button.on { background: var(--seg-on); color: var(--text); font-weight: 500; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }
/* выбор периода в заголовке страницы: выбранное — тёмная плашка */
.page-actions .seg { background: var(--surface); border: 1px solid var(--border); height: auto; }
.page-actions .seg button { height: 28px; padding: 0 10px; font-size: 12px; }
.page-actions .seg button.on { background: var(--ink-pill); color: var(--on-ink-pill); box-shadow: none; }
.badge { font-size: 11.5px; font-weight: 500; padding: 2px 9px; }
.chip { background: var(--info-tint); color: var(--info-text); border-color: transparent; font-weight: 500; }
.field > span { font-weight: 400; font-size: 12px; color: var(--text-3); }
.field small { font-size: 11.5px; color: var(--text-3); }
.filter-group { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-4); }
.note { border-radius: var(--r-el); font-size: 13px; }
.bulk-bar { background: var(--info-tint); border-color: var(--violet-200); top: 0; }

/* ——— всплывающее ——— */
.account-menu, .rep-menu, .combo-list { border-color: var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); }
.account-item, .rep-menu-item, .combo-opt { border-radius: 8px; font-size: 13px; }
.account-item:hover, .combo-opt:hover, .combo-opt.hi { background: var(--row-hover); color: var(--text); }
.account-head b { font-weight: 500; }
.modal, .drawer { -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal-panel { border-radius: 14px; border: 1px solid var(--border); padding: 18px; box-shadow: var(--shadow-pop); }
.modal-panel h2, .drawer-head h2 { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.drawer-panel { margin: var(--gap); height: calc(100% - 2 * var(--gap)); border-radius: var(--r-card); border: 1px solid var(--border); box-shadow: var(--shadow-pop); }
.toast { border-radius: 10px; padding: 9px 14px; background: var(--ink-pill); color: var(--on-ink-pill); font-weight: 500; font-size: 13px; }
/* поиск функций: окно под верхней полосой, у правого края — там же, где его кнопка */
.side-menu { position: fixed; top: calc(var(--top-row) + 4px); right: var(--gap); left: auto; bottom: auto; width: min(760px, calc(100vw - 2 * var(--gap))); max-height: calc(100vh - var(--top-row) - 2 * var(--gap)); border-radius: 14px; border-color: var(--rail-border); z-index: 60; }
.side-menu-group h3, .side-menu-intro h3 { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
:root[data-theme="dark"] .side-menu-group h3, :root[data-theme="dark"] .side-menu-intro h3 { color: var(--link); }
.side-menu-search { font-size: 14px !important; }
.fm-dest { background: var(--info-tint); color: var(--info-text); font-weight: 500; }

/* ——— блоки первого экрана и процесса: те же части, новый тон ——— */
.pulse { gap: var(--gap); }
.pulse-head h3 { font-size: 15px; font-weight: 500; }
.pulse-text b { font-weight: 500; font-size: 13px; }
.pulse-text small { font-size: 12px; }
.pulse-count { font-weight: 500; }
.proc-stat b { font-weight: 600; }

/* ——— вход: знак и карточка на точечном поле ——— */
.gate { background: none; }
.gate-card { border-radius: 14px; border-color: var(--border); box-shadow: var(--shadow-pop); background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.gate-card h1 { font-weight: 600; letter-spacing: 0; }
.gate-brand b { font-weight: 600; letter-spacing: 0; }
/* блок страницы, который заголовок забирает к себе (отметки состояния, действия): сам места не занимает */
.head-part { display: contents; }
.account-gw { display: flex; align-items: center; gap: 6px; }
.account-gw i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); }
.account-gw.ok i { background: var(--success); }
.account-gw.off i { background: var(--danger); }
/* ——— блок со списком: шапка (название, поиск, кнопки) и таблица внутри одного блока ——— */
.list-card { padding: 0; overflow: hidden; }
.list-head { display: flex; align-items: center; gap: var(--gap-sm); padding: 6px 10px 6px 14px; min-height: 46px; box-sizing: border-box; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.list-head h2 { margin: 0; font-size: 14px; font-weight: 500; }
.list-tools { margin-left: auto; display: flex; align-items: center; gap: var(--gap-sm); }
.list-more { font-size: 13px; font-weight: 500; padding: 0 4px; }
.list-card > .table-wrap, .card .list-card { border: 0; border-radius: 0; box-shadow: none; }
.list-card > .empty { padding: 18px 14px; text-align: left; }
.list-card > .list-foot { padding: 8px 14px; border-top: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-3); }
/* состояние строки: точка по тону; отметка состояния в таблице — точка и слово, без плашки */
.state-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex: none; }
.state-dot.ok { background: var(--success); }
.state-dot.warn { background: var(--warn); }
.state-dot.err { background: var(--danger); }
.state-dot.info { background: var(--brand); }
.dot-cell { width: 30px; text-align: center; }
td .badge { background: none; padding: 0; border-radius: 0; color: var(--text); font-size: 13px; font-weight: 400; display: inline-flex; align-items: center; gap: 6px; }
td .badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex: none; }
td .badge.ok::before { background: var(--success); }
td .badge.warn::before { background: var(--warn); }
td .badge.err::before { background: var(--danger); }
td .badge.info::before { background: var(--brand); }
td .badge.ok, td .badge.warn, td .badge.err, td .badge.info { background: none; color: var(--text); }
th.center, td.center { text-align: center; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* отметка «авто» у подписи плитки и отметки состояния: молния в цвет ссылки — читается в обеих темах */
.stat.auto .stat-label::before { color: var(--link); }
