/* ChatBot Solo — дизайн-система дашборда (тёмный графит + тил, Golos Text).
   Основа — мокап docs/design/dashboard-mockup.html. Ноль внешних хостов. */

/* ── Шрифт Golos Text (self-hosted, cyrillic + latin) ── */
@font-face { font-family: 'Golos Text'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/dashboard/static/fonts/golos-text-400-cyr.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('/dashboard/static/fonts/golos-text-400-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: 'Golos Text'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/dashboard/static/fonts/golos-text-500-cyr.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('/dashboard/static/fonts/golos-text-500-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: 'Golos Text'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/dashboard/static/fonts/golos-text-600-cyr.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('/dashboard/static/fonts/golos-text-600-lat.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }

/* ── Tokens ───────────────────────────────────────────── */
:root {
  --ground: #0f1116;
  --surface: #151821;
  --raised: #1b2029;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);
  --ink: #e6e8f0;
  --ink-2: #a7abbe;
  --muted: #7a7f92;
  /* акцент — тил (утверждено) */
  --acc: #3ecfb2;
  --acc-bright: #63dfc6;
  --acc-tint: rgba(62,207,178,0.13);
  --acc-contrast: #08110e;
  --data: #3ecfb2; /* цвет столбцов графика */
  --ok: #46a57c;    --ok-tint: rgba(70,165,124,0.14);
  --warn: #d4a843;  --warn-tint: rgba(212,168,67,0.14);
  --bad: #d0605c;   --bad-tint: rgba(208,96,92,0.14);
  --info: #6b9fc9;  --info-tint: rgba(107,159,201,0.14);
  /* каналы — валидированная категориальная палитра */
  --ch-tg: #2596d1; --ch-wa: #1fae55; --ch-site: #8b7bd8; --ch-ig: #e1306c; --ch-av: #74a31e;
  --sans: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
html { background: var(--ground); }
body {
  font-family: var(--sans);
  background: var(--ground);
  color: var(--ink);
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
button { font-family: inherit; }

/* ── App chrome ── */
.topbar {
  display: flex; align-items: center; gap: 4px;
  padding: 0 20px; height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand {
  font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
  color: var(--acc); margin-right: 20px; white-space: nowrap;
  text-decoration: none;
}
.brand small { color: var(--muted); font-weight: 500; margin-left: 8px; letter-spacing: 0; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.nav button, .nav a {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  padding: 7px 13px; border-radius: 8px; white-space: nowrap;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav button:hover, .nav a:hover { color: var(--ink); background: var(--raised); }
.nav button.active, .nav a.active { color: var(--acc-bright); background: var(--acc-tint); }
.nav button:focus-visible, .nav a:focus-visible, .userbtn:focus-visible {
  outline: 2px solid var(--acc); outline-offset: 2px;
}
.userwrap { position: relative; margin-left: 12px; }
.userbtn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; display: grid; place-items: center;
}

/* ── Layout ── */
.page { padding: 28px 32px 36px; max-width: 1120px; margin: 0 auto; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead h2 { font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.section { margin-top: 34px; }

/* ── Кнопки ── */
.btn {
  appearance: none; cursor: pointer; border-radius: 9px; font-weight: 600;
  font-size: 13.5px; padding: 9px 18px; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  text-decoration: none; display: inline-block;
}
.btn-acc { background: var(--acc); color: var(--acc-contrast); }
.btn-acc:hover { background: var(--acc-bright); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); background: var(--raised); }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: rgba(208,96,92,0.35); }
.btn-danger-ghost:hover { background: var(--bad-tint); }
.btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ── Обзор: герой ── */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 20px 24px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(160deg, rgba(70,165,124,0.07), transparent 55%), var(--surface);
}
.hero .state { display: flex; align-items: center; gap: 14px; }
.pulse {
  width: 11px; height: 11px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 0 rgba(70,165,124,0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(70,165,124,0); } 100% { box-shadow: 0 0 0 0 rgba(70,165,124,0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.hero h3 { margin: 0; font-size: 17px; font-weight: 700; }
.hero .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ── Стат-плитки ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.tile {
  padding: 16px 18px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.tile .label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tile .num {
  font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tile .delta { font-size: 12px; margin-top: 4px; color: var(--muted); }
.delta.up { color: var(--ok); } .delta.warn { color: var(--warn); }

/* ── Графики ── */
.charts { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; }
.chartbox h4, .attn h4 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.hint { color: var(--muted); font-size: 13px; }
.chartbox .hint, .attn .hint { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.barchart { position: relative; }
.barchart svg { display: block; width: 100%; height: auto; }
.barchart .bar { fill: var(--data); opacity: 0.85; transition: opacity .12s; }
.barchart .bar.hot { opacity: 1; }
.barchart .bar.dim { opacity: 0.45; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 30; transform: translate(-50%, -110%);
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; white-space: nowrap; display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.tooltip b { font-variant-numeric: tabular-nums; }
.rowlist { display: grid; gap: 12px; }
.rowitem { display: grid; grid-template-columns: 96px 1fr 32px; align-items: center; gap: 10px; font-size: 13px; }
.rowitem .name { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.track { height: 14px; border-radius: 4px; background: rgba(255,255,255,0.05); overflow: hidden; }
.fill { height: 100%; border-radius: 4px 3px 3px 4px; }
.rowitem .cnt { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ── Требует внимания ── */
.attn-list { display: grid; gap: 8px; }
.attn-item {
  display: flex; gap: 12px; align-items: baseline; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-size: 13px;
}
.attn-item .when { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.attn-item .what { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attn-item a { color: var(--acc); text-decoration: none; margin-left: auto; flex: none; }
.attn-item a:hover { text-decoration: underline; }
.foot { margin-top: 36px; font-size: 12px; color: var(--muted); }

/* ── Бейджи ── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.b-ok   { background: var(--ok-tint); color: #7cc9a6; }
.b-warn { background: var(--warn-tint); color: #e0bd6b; }
.b-bad  { background: var(--bad-tint); color: #e08582; }
.b-mut  { background: rgba(255,255,255,0.06); color: var(--muted); }
.chip-ch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* ── Диалоги ── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search {
  flex: 1; min-width: 220px; max-width: 340px; position: relative;
}
.search input {
  width: 100%; padding: 9px 12px 9px 34px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-family: inherit;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); opacity: 0.5; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none; cursor: pointer; border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink-2); font-size: 12.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px;
  text-decoration: none;
}
.chip:hover { background: var(--raised); }
.chip.active { background: var(--acc-tint); border-color: color-mix(in srgb, var(--acc) 40%, transparent); color: var(--acc-bright); }
.chip .n { color: var(--muted); margin-left: 5px; font-variant-numeric: tabular-nums; }
.chip.active .n { color: var(--acc); }

table.dlg { width: 100%; border-collapse: collapse; }
.dlg th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding: 8px 14px; border-bottom: 1px solid var(--line-strong);
}
.dlg td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dlg tbody tr { cursor: pointer; transition: background .12s; }
.dlg tbody tr:hover { background: var(--raised); }
.dlg .who { font-weight: 600; font-size: 14px; }
.dlg .last { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dlg .arr { color: var(--muted); opacity: 0; transition: opacity .12s; }
.dlg tbody tr:hover .arr { opacity: 0.7; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tablefoot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
.empty { padding: 36px; text-align: center; color: var(--muted); display: none; }
/* Диалоги фильтруются на сервере (нет клиентского JS-тоггла), поэтому
   пустое состояние получает класс .show вместо переключения через script. */
.empty.show { display: block; }

/* ── Страница диалога (переписка) ── */
.dialoglayout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.thread {
  display: grid; gap: 12px; max-height: 640px; overflow-y: auto;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground);
}
.chat-message {
  position: relative; max-width: 82%; padding: 10px 34px 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.chat-user { margin-right: auto; }
.chat-assistant {
  margin-left: auto; background: var(--acc-tint);
  border-color: color-mix(in srgb, var(--acc) 30%, transparent);
}
.msg-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.msg-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
details.noteform > summary {
  position: absolute; top: 8px; right: 10px; list-style: none; cursor: pointer;
  color: var(--muted); font-size: 13px;
}
details.noteform > summary::-webkit-details-marker { display: none; }
details.noteform.has-note > summary { color: var(--warn); }
details.noteform[open] > summary { color: var(--acc); }
.note-body { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.note-body textarea { margin-bottom: 8px; }
.notebar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sidebar { display: grid; gap: 16px; align-content: start; }
.infocard { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px 18px; }
.infocard h4 { margin: 0 0 12px; font-size: 13.5px; font-weight: 600; }
.kv { display: grid; grid-template-columns: 96px 1fr; row-gap: 8px; column-gap: 10px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; }

/* ── Настройки: вкладки ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-bottom: 24px; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 10px 16px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  text-decoration: none; white-space: nowrap;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--acc-bright); border-bottom-color: var(--acc); }
.pane { display: none; max-width: 720px; }
.pane.active { display: block; }
.field { margin-bottom: 26px; }
.field > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field .help { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
textarea, .field input[type="text"], .field input[type="number"],
.field input[type="password"], .field input[type="date"] {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--ink); font-family: inherit; font-size: 13.5px; padding: 10px 12px; line-height: 1.55;
  resize: vertical;
}
textarea:focus, .field input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }
.listrow { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.listrow input, .listrow select { flex: 1; min-width: 0; }
.field select {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--ink); font-family: inherit; font-size: 13.5px; padding: 10px 12px;
}
.field select:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }

/* ── Вход ── */
.authwrap { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.authcard {
  width: 100%; max-width: 360px; padding: 32px 30px 28px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.authbrand { text-align: center; margin-bottom: 22px; }
.authbrand h1 { margin: 0 0 4px; font-size: 21px; font-weight: 700; letter-spacing: 0.05em; color: var(--acc); }
.authbrand p { margin: 0; font-size: 13px; color: var(--muted); }
.authcard .flash { margin-bottom: 18px; }
.authcard .field:last-of-type { margin-bottom: 22px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ── Профиль / смена пароля / форма пользователя ── */
.profilecard, .userform { max-width: 420px; }
.formfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* ── Журнал входов: панель фильтров и пагинация ── */
.toolbar select, .toolbar input[type="text"], .toolbar input[type="date"] {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
  color: var(--ink); font-family: inherit; font-size: 13px; padding: 8px 12px;
}
.toolbar select:focus, .toolbar input:focus {
  outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint);
}
.pager { margin-top: 16px; }
.dlg td.empty-row { text-align: center; color: var(--muted); padding: 24px 14px; }

.iconbtn {
  appearance: none; cursor: pointer; border: 1px solid transparent; background: transparent;
  color: var(--muted); border-radius: 8px; width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; font-size: 15px;
}
.iconbtn:hover { color: var(--bad); background: var(--bad-tint); }
.addbtn {
  appearance: none; cursor: pointer; background: transparent; border: 1px dashed var(--line-strong);
  color: var(--ink-2); border-radius: 9px; padding: 8px 14px; font-size: 13px; font-weight: 500;
}
.addbtn:hover { color: var(--acc-bright); border-color: color-mix(in srgb, var(--acc) 40%, transparent); }
.counter { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* тумблеры — применяются сразу */
.switchrow {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  margin-bottom: 10px;
}
.switchrow .t { font-weight: 600; font-size: 14px; }
.switchrow .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sw { position: relative; width: 40px; height: 23px; flex: none; cursor: pointer; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw .knob {
  position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,0.12); transition: background .15s;
}
.sw .knob::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; opacity: 0.85; transition: transform .15s;
}
.sw input:checked + .knob { background: var(--ok); }
.sw input:checked + .knob::after { transform: translateX(17px); opacity: 1; }
.sw input:focus-visible + .knob { outline: 2px solid var(--acc); outline-offset: 2px; }

/* прилипающая панель сохранения */
.savebar {
  position: sticky; bottom: 14px; margin-top: 28px; z-index: 20;
  display: none; align-items: center; gap: 14px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 10px 12px 10px 18px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  max-width: 720px;
}
.savebar.show { display: flex; }
.savebar .msg { font-size: 13px; color: var(--warn); flex: 1; }
.savebar .msg::before { content: '●'; margin-right: 8px; font-size: 10px; vertical-align: 1px; }

/* ── Плейсхолдеры разделов ── */
.placeholder {
  border: 1px dashed var(--line-strong); border-radius: 14px; padding: 32px; max-width: 640px;
  color: var(--ink-2); font-size: 14px;
}
.placeholder h3 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.placeholder ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.placeholder li { margin-bottom: 4px; }

/* ── Flash-сообщения ── */
.flash { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13.5px;
  border: 1px solid transparent; }
.flash-info    { background: var(--info-tint); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.flash-success { background: var(--ok-tint); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-danger  { background: var(--bad-tint); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.flash button { appearance: none; background: none; border: 0; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }

/* ── Модалки и подтверждения (нативный dialog) ── */
dialog.modal { background: var(--raised); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 0; max-width: 460px; width: calc(100vw - 40px); }
dialog.modal::backdrop { background: rgba(6, 8, 12, 0.7); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ── Details-дропдауны (меню-аватар, кебаб строк) ── */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > .menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; z-index: 40;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 8px 10px;
  border-radius: 7px; color: var(--ink-2); text-decoration: none; font-size: 13.5px;
  background: none; border: 0; cursor: pointer; font-family: inherit; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface); color: var(--ink); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.kebab { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--muted); border: 1px solid transparent; }
.kebab:hover { background: var(--raised); border-color: var(--line-strong); color: var(--ink); }

/* ── Фотографии (категории + сетка фото) ── */
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.catcard { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.catcard h3 { margin: 0; font-size: 15px; font-weight: 600; }
.catcard .cat-desc { color: var(--muted); font-size: 13px; margin: 0; flex: 1; }
.catcard .cat-count { color: var(--ink-2); font-size: 12.5px; }
.catcard .cat-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 8px; }
.photocard { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.photocard .thumb { display: block; width: 100%; height: 180px; object-fit: cover; }
.photocard .pc-body { padding: 12px; display: grid; gap: 8px; }
.photocard .pc-body form { display: grid; gap: 8px; }
.photocard .pc-body input[type="text"] {
  width: 100%; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; color: var(--ink); font-family: inherit; font-size: 13px; padding: 8px 10px;
}
.photocard .pc-body input[type="text"]:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }
.photocard .pc-foot { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.uploadbox { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; margin-bottom: 24px; max-width: 720px; }
.uploadbox form { display: flex; flex-direction: column; gap: 12px; }
.uploadbox label { font-weight: 600; font-size: 14px; }
.uploadbox .help { margin: 0; }
.uploadbox input[type="file"] { color: var(--ink-2); font-size: 13px; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--acc); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ── Уведомления: маршруты + подписчики ── */
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbox {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); margin-bottom: 18px; font-size: 13px; color: var(--ink-2);
}
.linkbox code {
  color: var(--ink); background: var(--raised); border-radius: 6px;
  padding: 4px 8px; font-size: 12.5px; word-break: break-all;
}
.bitrixform { display: flex; gap: 6px; align-items: center; }
.bitrixform input[type="number"] {
  width: 90px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--ink); font-family: inherit; font-size: 13px; padding: 6px 8px;
}
.bitrixform input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-tint); }

/* ── Тосты ── */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--raised); border: 1px solid var(--line-strong); border-left: 3px solid var(--ok);
  border-radius: 10px; padding: 10px 16px; font-size: 13.5px; box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.toast.err { border-left-color: var(--bad); }

/* ── Полоса с шириной из данных ── */
.fill-var { width: var(--w, 0%); }

/* ── Акцентная полоса данных (напр. «По языкам») ── */
.fill-acc { background: var(--acc); }

/* ── Цвета каналов для .dot/.fill без инлайн-стилей ── */
.ch-tg   { background: var(--ch-tg); }
.ch-wa   { background: var(--ch-wa); }
.ch-site { background: var(--ch-site); }
.ch-ig   { background: var(--ch-ig); }
.ch-av   { background: var(--ch-av); }
.ch-mut  { background: var(--muted); }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .charts { grid-template-columns: 1fr; }
  .page { padding: 20px; }
  .dlg .last { max-width: 160px; }
  .dialoglayout { grid-template-columns: 1fr; }
}
