/* Кабинет Умной Авто-Воронки. Цвета — переменные; тёмная тема по системе или по кнопке.
   Нажатия и наведения меняют только цвет: геометрия элементов постоянна. */

@font-face { font-family: "Golos Text"; src: url(golos-cyr.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url(golos-latext.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0100-02BA, U+20A0-20AB, U+20AD-20C4, U+2113; }
@font-face { font-family: "Golos Text"; src: url(golos-lat.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Alumni Sans"; src: url(alumni-cyr.woff2) format("woff2"); font-weight: 500 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Alumni Sans"; src: url(alumni-lat.woff2) format("woff2"); font-weight: 500 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F; }

:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eceef4;
  --line: #dfe2ea;
  --line-strong: #c6cbd7;
  --text: #191c24;
  --muted: #4f5566;
  --faint: #6f7586;
  --accent: #2445d8;
  --accent-hover: #1d39b8;
  --accent-active: #1a31a6;
  --accent-soft: #e8ecfc;
  --accent-text: #1f3bb8;
  --on-accent: #ffffff;
  --sticker: #ffd23f;
  --on-sticker: #191c24;
  --rail: #2445d8;
  --rail-text: #ffffff;
  --rail-muted: rgb(255 255 255 / 74%);
  --rail-hover: rgb(255 255 255 / 10%);
  --rail-active: rgb(255 255 255 / 18%);
  --danger: #b3261e;
  --danger-hover: #9c2019;
  --danger-active: #851b15;
  --danger-soft: #fbe9e7;
  --warn: #8a5a00;
  --warn-soft: #fff4d1;
  --info: #2445d8;
  --info-soft: #e8ecfc;
  --ok: #1d7a4c;
  --ok-soft: #e1f3e9;
  --shadow: none;
  --shadow-pop: 0 10px 32px rgb(20 25 45 / 18%);
  --r: 4px;
  --r-sm: 3px;
  --side-w: 256px;
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Alumni Sans", "Arial Narrow", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f121a; --surface: #161a24; --surface-2: #1b2030; --surface-3: #222839;
    --line: #2a3043; --line-strong: #3a4158; --text: #e9ebf2; --muted: #a9afc0; --faint: #8a90a3;
    --accent: #7b93ff; --accent-hover: #93a7ff; --accent-active: #aabaff; --accent-soft: #1e2747; --accent-text: #a9b8ff; --on-accent: #0f121a;
    --rail: #131a33; --rail-text: #e9ebf2; --rail-muted: rgb(233 235 242 / 68%); --rail-hover: rgb(255 255 255 / 6%); --rail-active: rgb(123 147 255 / 20%);
    --danger: #ef6b5e; --danger-hover: #f4857a; --danger-active: #f79c93; --danger-soft: #3a1f1d;
    --warn: #f0c04a; --warn-soft: #3a3014; --info: #7b93ff; --info-soft: #1e2747; --ok: #5cc28e; --ok-soft: #173326;
    --shadow-pop: 0 12px 40px rgb(0 0 0 / 55%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f121a; --surface: #161a24; --surface-2: #1b2030; --surface-3: #222839;
  --line: #2a3043; --line-strong: #3a4158; --text: #e9ebf2; --muted: #a9afc0; --faint: #8a90a3;
  --accent: #7b93ff; --accent-hover: #93a7ff; --accent-active: #aabaff; --accent-soft: #1e2747; --accent-text: #a9b8ff; --on-accent: #0f121a;
  --rail: #131a33; --rail-text: #e9ebf2; --rail-muted: rgb(233 235 242 / 68%); --rail-hover: rgb(255 255 255 / 6%); --rail-active: rgb(123 147 255 / 20%);
  --danger: #ef6b5e; --danger-hover: #f4857a; --danger-active: #f79c93; --danger-soft: #3a1f1d;
  --warn: #f0c04a; --warn-soft: #3a3014; --info: #7b93ff; --info-soft: #1e2747; --ok: #5cc28e; --ok-soft: #173326;
  --shadow-pop: 0 12px 40px rgb(0 0 0 / 55%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--sticker); color: var(--on-sticker); }
a { color: var(--accent-text); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
.sprite { display: none; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r); z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- каркас ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none;
  display: flex; flex-direction: column; background: var(--rail); color: var(--rail-text);
}
.side :focus-visible { outline-color: var(--sticker); }
.side__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--rail-text); text-decoration: none; min-width: 0; }
.brand__mark {
  width: 34px; height: 34px; border-radius: var(--r); display: grid; place-items: center; flex: none;
  background: var(--sticker); color: var(--on-sticker);
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text b { font-size: 15px; }
.brand__text small { color: var(--rail-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .side__close { display: none; }
.side__search {
  margin: 0 12px 8px; display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px;
  border: 1px solid transparent; border-radius: var(--r); background: var(--rail-hover); color: var(--rail-muted);
}
.side__search:focus-within { border-color: var(--sticker); }
.side__search input { border: 0; background: transparent; outline: 0; font: inherit; color: var(--rail-text); width: 100%; min-width: 0; min-height: 0; padding: 0; }
.side__search input::placeholder { color: var(--rail-muted); }
.side__search input:hover, .side__search input:focus { box-shadow: none; }
.side__nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.side__group { margin: 16px 10px 4px; font-size: 13px; font-weight: 600; color: var(--rail-muted); }
.side__link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--rail-muted); text-decoration: none; font-size: 14.5px;
}
.side__link:hover { background: var(--rail-hover); color: var(--rail-text); }
.side__link:active { background: var(--rail-active); }
.side__link[aria-current="page"] { background: var(--rail-active); color: var(--rail-text); font-weight: 600; }
.side__link[aria-current="page"] .i { color: var(--sticker); }
.side__empty { padding: 10px; color: var(--rail-muted); font-size: 14px; }
.side__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-top: 1px solid rgb(255 255 255 / 16%); }
.side__foot .icon-btn { color: var(--rail-muted); }
.side__foot .icon-btn:hover { background: var(--rail-hover); color: var(--rail-text); }
.side__foot .icon-btn:active { background: var(--rail-active); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who__avatar { width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; background: var(--rail-active); color: var(--rail-text); flex: none; }
.who__text { display: flex; flex-direction: column; min-width: 0; }
.who__text b { font-size: 14px; }
.who__text small { font-size: 12px; color: var(--rail-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar .bar__menu { display: none; }
.bar__title { flex: 1; min-width: 0; }
.bar__title h1 { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { display: block; font-size: 12.5px; color: var(--faint); }
.theme-light { display: none; }
:root[data-theme="dark"] .theme-dark { display: none; }
:root[data-theme="dark"] .theme-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark { display: none; }
  :root:not([data-theme="light"]) .theme-light { display: inline; }
}
.content { padding: 24px 28px 64px; max-width: 1240px; width: 100%; display: flex; flex-direction: column; gap: 20px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid var(--accent); border-radius: var(--r); background: var(--accent); color: var(--on-accent);
  font: 600 14.5px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; position: relative;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { background: var(--accent-active); border-color: var(--accent-active); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn--ghost:active { background: var(--line); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn--danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn--danger:active { background: var(--danger-active); border-color: var(--danger-active); }
.btn[disabled], .btn[aria-busy="true"] { cursor: progress; opacity: 0.75; }
.btn[aria-busy="true"] > .i { visibility: hidden; }
.btn[aria-busy="true"]::before {
  content: ""; position: absolute; left: 16px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--r);
  background: transparent; color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { background: var(--line); }
.icon-btn--small { width: 28px; height: 28px; }
.icon-btn--small .i { width: 15px; height: 15px; }

/* ---------- карточки и разделы ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.card__head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card__head h2 { font-size: 15.5px; font-weight: 650; }
.count { font-size: 12.5px; color: var(--muted); background: var(--surface-3); padding: 1px 8px; border-radius: var(--r-sm); font-variant-numeric: tabular-nums; }
.card__body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.card__text { color: var(--muted); }
.card--warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.section-title { font-size: 15.5px; font-weight: 650; margin-bottom: 10px; }

.card--fold { box-shadow: none; border-style: dashed; background: transparent; }
.card--fold[open] { background: var(--surface); border-style: solid; }
.fold {
  list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 20px; cursor: pointer;
  font-weight: 600; color: var(--accent-text); border-radius: var(--r);
}
.fold::-webkit-details-marker { display: none; }
.fold:hover { background: var(--surface-3); }
.fold:active { background: var(--line); }
.fold__arrow { margin-left: auto; color: var(--faint); transition: transform 0.15s; }
details[open] > .fold { border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
details[open] > .fold .fold__arrow { transform: rotate(90deg); }
details[open] > .fold .fold__plus { color: var(--faint); }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid; }
.callout > .i { margin-top: 2px; }
.callout b { display: block; margin-bottom: 2px; }
.callout p + p { margin-top: 4px; }
.callout--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.callout--warn > .i { color: var(--warn); }
.callout--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.callout--danger > .i { color: var(--danger); }
.callout--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.callout--ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.callout--info > .i { color: var(--info); }
.callout--ok > .i { color: var(--ok); }

/* ---------- цифры ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat {
  display: grid; grid-template-columns: 1fr; row-gap: 2px; align-content: start;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  color: var(--text); text-decoration: none;
}
a.stat:hover { border-color: var(--line-strong); background: var(--surface-2); }
a.stat:active { background: var(--surface-3); }
.stat__icon { display: none; }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat__hint { font-size: 12.5px; color: var(--faint); }

/* ---------- ключ — значение ---------- */
.kv { margin: 0; display: flex; flex-direction: column; }
.kv__row { display: grid; grid-template-columns: minmax(140px, 32%) 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv__row:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }

/* ---------- таблицы ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.filters .field { flex: 1 1 200px; max-width: 360px; }
.table-wrap { overflow-x: auto; margin: 0 -20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 8px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:active td { background: var(--surface-3); }
.cell-link { font-weight: 600; text-decoration: none; }
.cell-link:hover { text-decoration: underline; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600;
  white-space: nowrap; background: var(--surface-3); color: var(--muted);
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
/* новое и ждущее ответа — жёлтая ценовая наклейка каталога */
.badge--warn { background: var(--sticker); color: var(--on-sticker); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; color: var(--faint); text-align: center; }
.empty .i { width: 28px; height: 28px; }
.copyable { display: inline-flex; align-items: flex-start; gap: 4px; max-width: 100%; }
.copyable .icon-btn { flex: none; margin-top: -3px; }
.copyable__text { overflow-wrap: anywhere; white-space: pre-line; }
.copyable--mono .copyable__text { font-family: var(--mono); font-size: 13px; white-space: normal; }
[data-copied] { color: var(--accent-text); }

/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form__note { color: var(--muted); }
.form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.req { color: var(--danger); }
.field__hint { font-size: 12.5px; color: var(--faint); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 8px 11px; min-height: 38px; width: 100%;
}
textarea { resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="color"] { padding: 3px; height: 38px; }
.form .field input:user-invalid, .form .field textarea:user-invalid { border-color: var(--danger); }
.field--check { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.field--check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; border-radius: 99px; background: var(--line-strong); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.field--check input:checked + .switch { background: var(--accent); }
.field--check input:checked + .switch::after { left: 19px; }
.field--check input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 18px; border: 1.5px dashed var(--line-strong);
  border-radius: var(--r); background: var(--surface-2); color: var(--muted); cursor: pointer;
}
.drop:hover, .drop[data-over] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__icon { width: 24px; height: 24px; }
.drop[data-has-file] { border-style: solid; border-color: var(--accent); color: var(--text); }
.form__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.actions--titled { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; }
.actions__row { display: flex; flex-wrap: wrap; gap: 10px; }
.actions__row form { margin: 0; }

/* ---------- чат и прочее ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; min-height: 220px; overflow-y: auto; padding: 8px; background: var(--surface-2); border-radius: var(--r); }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 10px; white-space: pre-line; overflow-wrap: anywhere; }
.bubble--bot { background: var(--surface-3); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble--me { background: var(--accent); color: var(--on-accent); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble__btns form { margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent-text); font: 600 13.5px/1.2 var(--font);
  cursor: pointer; text-decoration: none; text-align: left;
}
.chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.chip:active { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 30%); }
.chip .i { width: 14px; height: 14px; }
.chip--dead { color: var(--faint); cursor: default; }
.chip--dead:hover { background: var(--surface); border-color: var(--line-strong); }
.chat__start { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 16px; text-align: center; color: var(--muted); }
.chat__start > .i { width: 32px; height: 32px; color: var(--accent); }
.chat__form { display: flex; gap: 10px; align-items: end; }
.chat__form .field { flex: 1; }
.chat__form .field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pre { margin: 0; padding: 14px; background: var(--surface-2); border-radius: var(--r); overflow: auto; }
.preview { max-width: 100%; border-radius: var(--r); border: 1px solid var(--line); }

/* ---------- уведомления, подтверждение, загрузка ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); animation: toast-in 0.2s ease-out;
}
.toast > span { flex: 1; }
.toast--ok > .i { color: var(--accent); }
.toast--error { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.toast--error > .i { color: var(--danger); }
.toast[data-leaving] { opacity: 0; transition: opacity 0.25s; }
@keyframes toast-in { from { opacity: 0; } to { opacity: 1; } }
.dialog { border: 0; border-radius: var(--r); padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.dialog::backdrop { background: rgb(10 15 12 / 45%); }
.dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.dialog__text { font-size: 16px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 70; opacity: 0; }
.progress[data-on] { opacity: 1; width: 75%; transition: width 6s cubic-bezier(0.1, 0.7, 0.2, 1); }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login__box { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login__box h1 { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; }
.flash { padding: 10px 14px; border-radius: var(--r); }
.flash--error { background: var(--danger-soft); color: var(--danger); }
.muted { color: var(--muted); }

/* ---------- узкие экраны ---------- */
@media (max-width: 900px) {
  .side { position: fixed; z-index: 40; left: 0; transform: translateX(-100%); transition: transform 0.2s ease-out; box-shadow: var(--shadow-pop); }
  .side[data-open] { transform: none; }
  .side[data-open] ~ .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgb(10 15 12 / 40%); }
  .side .side__close, .bar .bar__menu { display: inline-grid; }
  .bar { padding: 10px 16px; }
  .bar__title h1 { font-size: 28px; }
  .content { padding: 16px 16px 48px; gap: 16px; }
  .card__body { padding: 14px 16px; }
  .card__head { padding: 12px 16px; }
}
@media (max-width: 640px) {
  .table-wrap { margin: 0; overflow: visible; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--r); padding: 6px 0; margin-bottom: 10px; background: var(--surface); }
  .table td { border: 0; padding: 5px 14px !important; display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
  .table td::before { content: attr(data-label); color: var(--faint); font-size: 12.5px; flex: none; max-width: 45%; }
  .table td[data-label=""]::before { content: none; }
  .table td:first-child { font-size: 15.5px; }
  .kv__row { grid-template-columns: 1fr; gap: 2px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .btn { height: 42px; }
  .chat__form { flex-direction: column; align-items: stretch; }
  .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
