:root {
  --ground: #F2F3F6;
  --surface: #FFFFFF;
  --surface-2: #F6F7F9;
  --surface-hover: #ECEEF2;
  --border: #E1E3E9;
  --border-strong: #CBCED6;
  --ink: #16181D;
  --ink-muted: #6B7080;
  --ink-faint: #9498A3;
  --accent: #DD5A0F;
  --accent-ink: #FFFFFF;
  --accent-soft: #FDE7D8;
  --accent-soft-ink: #9A3E0A;
  --success: #1C8955;
  --success-soft: #DFF3E7;
  --danger: #C63A2E;
  --danger-soft: #FBE4E1;
  --blue-soft: #E3EAFB;
  --blue-ink: #3457C9;
  --violet-soft: #EDE7FB;
  --violet-ink: #6A4FC7;
  --rose-soft: #FBE4EA;
  --rose-ink: #B3446E;
  --steel-soft: #E3EEF3;
  --steel-ink: #2E6E85;
  --shadow: 0 1px 2px rgba(20, 21, 26, 0.04), 0 8px 24px -12px rgba(20, 21, 26, 0.12);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --font-ui: "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* hero-панель входа — намеренно фиксированная тёмная поверхность, не зависит от темы хоста */
  --hero-bg: #131419;
  --hero-bg-2: #1B1C22;
  --hero-ink: #F4F5F7;
  --hero-ink-muted: #8A8D97;
  --hero-accent: #FF7C34;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #17181C;
    --surface: #1E2025;
    --surface-2: #25272D;
    --surface-hover: #2B2E35;
    --border: #33363E;
    --border-strong: #454851;
    --ink: #F1F2F4;
    --ink-muted: #9DA1AC;
    --ink-faint: #75798A;
    --accent: #FF7C34;
    --accent-ink: #1A0F06;
    --accent-soft: #3A2415;
    --accent-soft-ink: #FFB27E;
    --success: #3FC879;
    --success-soft: #173626;
    --danger: #FF6E60;
    --danger-soft: #3B211E;
    --blue-soft: #1D2A45;
    --blue-ink: #8DA6F2;
    --violet-soft: #2A2140;
    --violet-ink: #B7A3F2;
    --rose-soft: #3A2130;
    --rose-ink: #F2A7C2;
    --steel-soft: #1B2E36;
    --steel-ink: #7FC2DA;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --ground: #17181C;
  --surface: #1E2025;
  --surface-2: #25272D;
  --surface-hover: #2B2E35;
  --border: #33363E;
  --border-strong: #454851;
  --ink: #F1F2F4;
  --ink-muted: #9DA1AC;
  --ink-faint: #75798A;
  --accent: #FF7C34;
  --accent-ink: #1A0F06;
  --accent-soft: #3A2415;
  --accent-soft-ink: #FFB27E;
  --success: #3FC879;
  --success-soft: #173626;
  --danger: #FF6E60;
  --danger-soft: #3B211E;
  --blue-soft: #1D2A45;
  --blue-ink: #8DA6F2;
  --violet-soft: #2A2140;
  --violet-ink: #B7A3F2;
  --rose-soft: #3A2130;
  --rose-ink: #F2A7C2;
  --steel-soft: #1B2E36;
  --steel-ink: #7FC2DA;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; }
a { color: inherit; }
::selection { background: var(--accent-soft); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Переходы по разделам и вкладки — ссылки: только ссылку браузер предлагает
   открыть в новой вкладке. Выглядят они как прежние кнопки; :where — чтобы
   размеры и цвета по-прежнему задавали классы. Ссылки-кнопки (вкладки,
   «Скачать Excel») ставят подпись по центру, как кнопка. */
:where(a[data-route], a[data-action]) { text-decoration: none; line-height: normal; }
:where(a.filter, a.secondary-button, a.text-button) { display: inline-flex; align-items: center; justify-content: center; }

.muted { color: var(--ink-muted); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 4px; }
.eyebrow.light { color: var(--hero-ink-muted); }

/* ---------- Кнопки и мелкие элементы ---------- */

.primary-button, .secondary-button, .light-button, .yandex-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 700;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.primary-button:hover, .secondary-button:hover, .light-button:hover, .yandex-button:hover { transform: translateY(-1px); }
.primary-button { color: var(--accent-ink); background: var(--accent); }
.primary-button.compact { min-height: 36px; padding: 0 12px; font-size: 12.5px; }
.secondary-button { border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.secondary-button:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.secondary-button.danger { color: var(--danger); border-color: var(--danger-soft); }
.secondary-button.success { color: var(--success); border-color: var(--success-soft); }
.light-button { color: var(--ink); background: var(--surface); }
.text-button { border: 0; padding: 4px; color: var(--ink-muted); background: transparent; font-weight: 700; font-size: 12.5px; }
.text-button:hover { color: var(--ink); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 16px; color: var(--ink-muted); }
.icon-button:hover { background: var(--surface-hover); color: var(--ink); }

.avatar {
  display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  color: var(--accent-soft-ink); background: var(--accent-soft);
  font-size: 12.5px; font-weight: 700;
}
.avatar.small { width: 32px; height: 32px; font-size: 11px; }
.avatar.large { width: 58px; height: 58px; font-size: 18px; }
.avatar.xl { width: 78px; height: 78px; font-size: 24px; }

.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lockup strong { display: block; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
/* Подпись под названием прячем в шапке: она удваивала её высоту.
   На экране входа логотип крупный, там подпись остаётся. */
.brand-lockup small { display: block; color: var(--ink-faint); font-size: 11px; }
.topbar .brand-lockup small { display: none; }
.brand-symbol {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  color: var(--accent-ink); background: var(--accent);
  font-size: 14px; font-weight: 800;
}
.brand-lockup-large .brand-symbol { width: 40px; height: 40px; border-radius: var(--radius-md); font-size: 18px; }
.brand-lockup-large strong { font-size: 17px; }

.prototype-badge, .access-count, .count-badge {
  display: inline-flex; align-items: center; width: max-content; min-height: 26px;
  border-radius: 999px; padding: 0 10px;
  color: var(--ink-muted); background: var(--surface-2);
  font-size: 11px; font-weight: 700;
}

.status-pill, .pill {
  display: inline-flex; align-items: center; justify-content: center; width: max-content; min-height: 22px;
  border-radius: 999px; padding: 2px 9px;
  color: var(--ink-muted); background: var(--surface-2);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.status-pill.done, .pill.success { color: var(--success); background: var(--success-soft); }
.status-pill.warning { color: var(--accent-soft-ink); background: var(--accent-soft); }
.status-pill.new { color: var(--blue-ink); background: var(--blue-soft); }
.pill.danger { color: var(--danger); background: var(--danger-soft); }
.pill.neutral { color: var(--ink-muted); background: var(--surface-2); }

/* ---------- Вход ---------- */

.login-page { min-height: 100vh; display: flex; background: var(--ground); }
.hero-panel {
  width: min(38%, 480px); flex: none;
  background: radial-gradient(120% 90% at 100% 0%, var(--hero-bg-2) 0%, transparent 55%), var(--hero-bg);
  color: var(--hero-ink);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 40px;
}
.hero-word { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: .01em; line-height: 1.16; text-transform: uppercase; }
.hero-word .accent { color: var(--hero-accent); }
.hero-rule { width: 40px; height: 3px; border-radius: 2px; background: var(--hero-accent); margin: 22px 0 0; }
.hero-foot { font-size: 12.5px; color: var(--hero-ink-muted); max-width: 30ch; }
.login-principles { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.login-principles > div { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; }
.login-principles > div > span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-sm);
  color: var(--hero-accent); font-size: 11px; font-weight: 800;
}
.login-principles strong, .login-principles small { display: block; }
.login-principles strong { color: var(--hero-ink); font-size: 12.5px; }
.login-principles small { margin-top: 2px; color: var(--hero-ink-muted); font-size: 11px; }

.flow-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.flow-card { width: 100%; max-width: 460px; }
.login-card { width: 100%; padding: 34px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.login-card h2 { font-size: 21px; font-weight: 700; margin: 14px 0 6px; letter-spacing: -.01em; }
.login-card > .muted { font-size: 13.5px; margin-bottom: 22px; }
.login-form { display: grid; gap: 14px; }
.login-form .field { display: grid; gap: 6px; }
.login-form .field > span { color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.login-form input {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px;
}
.login-form input:focus { border-color: var(--accent); outline: none; }
.login-error {
  margin: 0; padding: 9px 11px; border-radius: var(--radius-md);
  color: var(--danger); background: var(--danger-soft); font-size: 12.5px;
}
.login-submit { width: 100%; margin-top: 4px; }
.boot-screen { display: grid; min-height: 100vh; place-items: center; color: var(--ink-faint); background: var(--ground); font-size: 13.5px; }
.password-value {
  margin: 16px 0; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface-2); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 20px; letter-spacing: .04em; text-align: center; user-select: all;
}

/* Панель чат-бота — отдельный сервис, показанный внутри рабочей области портала.
   Высоту даёт раскладка экрана (.portal-shell--frame), а не вычитание пикселей
   шапки: панель внутри сама распоряжается своей высотой, и лишний хвост здесь
   означал бы вторую полосу прокрутки поверх её собственной. */
.bot-frame {
  display: block; width: 100%; flex: 1; min-height: 420px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface);
}

.auth-btn, .yandex-button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  color: var(--surface); background: var(--ink);
}
.auth-btn:hover, .yandex-button:hover { opacity: .92; }
.yandex-button span, .auth-btn .ya { display: grid; width: 22px; height: 22px; border-radius: var(--radius-sm); place-items: center; color: var(--hero-accent); font-weight: 800; background: transparent; }
.fineprint, .privacy-note { margin-top: 14px; color: var(--ink-faint); font-size: 11.5px; line-height: 1.5; }

.denied-page { display: grid; min-height: 100vh; padding: 30px; place-items: center; background: var(--ground); }
.denied-card { width: min(100%, 480px); padding: 42px; border: 1px solid var(--border); border-radius: var(--radius-lg); text-align: center; background: var(--surface); box-shadow: var(--shadow); }
.denied-icon { display: grid; width: 60px; height: 60px; margin: 0 auto 20px; border-radius: var(--radius-lg); place-items: center; color: var(--danger); background: var(--danger-soft); font-size: 28px; }
.denied-card h1 { margin-bottom: 12px; font-size: 21px; }
.denied-card > p:not(.eyebrow) { color: var(--ink-muted); font-size: 13.5px; }
.denied-help { margin: 22px 0; border-radius: var(--radius-md); padding: 14px; text-align: left; background: var(--surface-2); }
.denied-help strong, .denied-help span { display: block; font-size: 12.5px; }
.denied-help span { margin-top: 4px; color: var(--ink-muted); }

/* ---------- Топбар и навигация ---------- */

.portal-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 3px 24px; display: flex; align-items: center; gap: 16px; }
.topbar-brand { display: flex; }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
  width: 26px; height: 26px; border-radius: var(--radius-md); border: 1px solid transparent;
  background: transparent; display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--ink); }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px; min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  font-size: 9.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.profile-chip { display: flex; align-items: center; gap: 8px; padding: 1px 8px 1px 4px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink); }
.profile-chip:hover { background: var(--surface-hover); }
.topbar .avatar { width: 24px; height: 24px; font-size: 10.5px; }
/* Должность под именем — вторая строка, из-за неё шапка была вдвое выше.
   Роль и так видна в «Личном деле» и в панели администратора. */
.topbar .profile-chip .who .role { display: none; }
.profile-chip .who { text-align: left; }
.profile-chip .who .name { font-size: 12px; font-weight: 600; line-height: 1.15; }
.profile-chip .who .role { font-size: 10.5px; color: var(--ink-muted); line-height: 1.15; }
.chev { color: var(--ink-faint); flex: none; }

.navbar { background: var(--surface); border-bottom: 1px solid var(--border); }
/* Никакого overflow: контейнер с overflow-x обрезает и вертикаль тоже,
   и выпадающие меню под ним становятся невидимыми. На узком экране
   пункты переносятся на вторую строку — прокрутка тут не нужна. */
.navbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-item { position: relative; }
.nav-btn {
  display: flex; align-items: center; gap: 5px; padding: 4px 11px;
  background: none; border: none; font-size: 12.5px; color: var(--ink-muted);
  cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nav-btn:hover { color: var(--ink); }
.nav-item.active .nav-btn { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.nav-btn .chev { width: 11px; height: 11px; }

.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: 6px; display: none; z-index: 20;
}
.dropdown.right { left: auto; right: 0; }
.nav-item.open .dropdown { display: block; }
.dropdown a, .dropdown .drop-row, .dropdown button.drop-simple { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); cursor: pointer; background: none; border: none; width: 100%; text-align: left; font-size: 13px; }
.dropdown a:hover, .dropdown .drop-row:hover, .dropdown button.drop-simple:hover { background: var(--surface-2); }
.dropdown .drop-title { font-size: 13px; font-weight: 600; }
.dropdown .drop-desc { font-size: 11.5px; color: var(--ink-muted); }
.dropdown .drop-sep { height: 1px; background: var(--border); margin: 5px 2px; }
.dropdown .drop-simple { font-size: 13px; padding: 8px 10px; }
.notif-item { padding: 9px 10px; border-radius: var(--radius-sm); }
.notif-item:hover { background: var(--surface-2); }
.notif-item .t { font-size: 12.5px; font-weight: 600; }
.notif-item .d { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

.page-content { max-width: 1280px; margin: 0 auto; padding: 22px 24px 60px; width: 100%; }
.content-stack { display: grid; gap: 20px; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 380px; border-radius: var(--radius-md); padding: 13px 16px; color: var(--accent-ink); background: var(--ink); box-shadow: var(--shadow); font-weight: 600; font-size: 13px; animation: toast-in .18s ease-out; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Панели, заголовки, сетки ---------- */

.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-description { margin: -6px 0 16px; color: var(--ink-muted); font-size: 12.5px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2 { font-size: 18px; font-weight: 700; }
.two-column-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); gap: 16px; }

/* ---------- Главная сотрудника / герои разделов ---------- */

.welcome-hero, .admin-welcome, .knowledge-hero, .marketplace-head, .profile-hero, .security-banner {
  position: relative; display: flex; overflow: hidden; min-height: 200px; align-items: center; justify-content: space-between;
  gap: 26px; border-radius: var(--radius-lg); padding: clamp(26px, 4vw, 44px);
  color: var(--hero-ink);
  background: radial-gradient(120% 90% at 100% 0%, var(--hero-bg-2) 0%, transparent 55%), var(--hero-bg);
  box-shadow: var(--shadow);
}
.welcome-hero > *, .admin-welcome > *, .knowledge-hero > *, .marketplace-head > *, .profile-hero > *, .security-banner > * { position: relative; z-index: 1; }
.welcome-hero h2, .admin-welcome h2, .knowledge-hero h2, .marketplace-head h2, .security-banner h2 { max-width: 700px; margin-bottom: 10px; font-size: 21px; font-weight: 700; }
.welcome-hero p:not(.eyebrow), .admin-welcome p:not(.eyebrow), .knowledge-hero p:not(.eyebrow), .marketplace-head p:not(.eyebrow), .security-banner p:not(.eyebrow) { max-width: 640px; color: var(--hero-ink-muted); font-size: 13.5px; }
.welcome-hero .light-button, .admin-welcome .light-button { margin-top: 18px; }
.hero-access-card { display: grid; min-width: 170px; border: 1px solid rgba(255,255,255,.13); border-radius: var(--radius-md); padding: 20px; background: rgba(255,255,255,.06); }
.hero-access-card strong { font-size: 2rem; color: var(--hero-ink); }
.hero-access-card small { max-width: 150px; color: var(--hero-ink-muted); font-size: 12px; }

.h1 { font-size: 22px; font-weight: 700; margin: 0 0 20px; letter-spacing: -.01em; }
.row { display: grid; gap: 16px; }
.row.top { grid-template-columns: 1.1fr 1.4fr; margin-bottom: 16px; }
.row.grid7, .module-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) {
  .row.top { grid-template-columns: 1fr; }
}

.module-icon { display: grid; width: 36px; height: 36px; border-radius: var(--radius-sm); place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-muted); }
.module-icon.mint { color: var(--success); background: var(--success-soft); }
.module-icon.blue { color: var(--blue-ink); background: var(--blue-soft); }
.module-icon.orange { color: var(--accent-soft-ink); background: var(--accent-soft); }
.module-icon.violet { color: var(--violet-ink); background: var(--violet-soft); }
.module-icon.rose { color: var(--rose-ink); background: var(--rose-soft); }
.module-icon.slate { color: var(--ink-muted); background: var(--surface-2); }
.module-icon.steel { color: var(--steel-ink); background: var(--steel-soft); }
.module-icon.mini { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.soon-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-faint); background: var(--surface-2); padding: 2px 7px; border-radius: 999px; }

/* Карточки главной страницы сотрудника — по макету дизайна */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-size: 14px; font-weight: 700; }
.card-link { font-size: 12.5px; color: var(--ink-muted); text-decoration: none; display: flex; align-items: center; gap: 3px; background: none; border: none; padding: 1px 6px; cursor: pointer; }
.card-link:hover { color: var(--ink); }

.progress-top { display: flex; align-items: center; gap: 16px; }
.ring { width: 64px; height: 64px; flex: none; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), var(--surface-2) 0); display: flex; align-items: center; justify-content: center; position: relative; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-meta .big { font-size: 13.5px; font-weight: 600; }
.progress-meta .sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

.lesson-bar { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.lb-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.lb-fill { height: 100%; background: var(--accent); border-radius: 3px; display: block; }
.lb-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); }

.task { display: flex; align-items: center; gap: 11px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: none; }
.task-check { width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1.5px solid var(--border-strong); }
.task.done .task-check { background: var(--success); border-color: var(--success); display: flex; align-items: center; justify-content: center; }
.task-text { flex: 1; font-size: 13px; }
.task.done .task-text { color: var(--ink-faint); text-decoration: line-through; }
.task-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--ink-muted); font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.task-count.urgent { background: var(--accent-soft); color: var(--accent-soft-ink); }

.announce { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-left: 3px solid var(--accent); margin-bottom: 16px; }
.announce .a-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.announce .a-text { font-size: 13.5px; margin-top: 2px; }
.announce .a-text b { font-weight: 600; }
.announce-cta { margin-left: auto; flex: none; font-size: 12.5px; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border); padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.announce-cta:hover { background: var(--surface-hover); }

.mod-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .12s ease; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: left; }
.mod-card:hover { border-color: var(--border-strong); }
.mod-card.stub { cursor: not-allowed; border-style: dashed; box-shadow: none; }
.mod-card.stub:hover { border-color: var(--border); }
.mod-top { display: flex; align-items: flex-start; justify-content: space-between; }
.mod-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.mod-card.highlight .mod-icon { background: var(--accent-soft); color: var(--accent-soft-ink); }
.mod-title { font-size: 13.5px; font-weight: 700; }
.mod-desc { font-size: 12px; color: var(--ink-muted); line-height: 1.4; min-height: 32px; }
.mod-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.mod-open { font-size: 12px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 3px; }
.mod-card.stub .mod-open { color: var(--ink-faint); }
.spark { display: block; }

/* ---------- База знаний и экзамен ---------- */

.knowledge-stat { display: grid; min-width: 180px; border-left: 1px solid rgba(255,255,255,.15); padding-left: 26px; }
.knowledge-stat strong { font-size: 2.4rem; color: var(--hero-ink); }
.knowledge-stat small { max-width: 160px; color: var(--hero-ink-muted); font-size: 12px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter { min-height: 34px; border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; background: var(--surface); font-size: 12.5px; font-weight: 700; color: var(--ink-muted); }
.filter.active { color: var(--accent-ink); border-color: var(--ink); background: var(--ink); }
.content-search { display: flex; min-height: 36px; align-items: center; gap: 8px; margin-left: auto; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0 12px; color: var(--ink-faint); background: var(--surface); }
.content-search.full { width: 100%; margin: 0; }
.content-search input { width: 200px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.content-search.full input { width: 100%; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lesson-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.lesson-cover { display: flex; height: 110px; align-items: end; justify-content: space-between; padding: 16px; color: var(--hero-ink); background: linear-gradient(135deg, var(--hero-bg), var(--hero-bg-2)); }
.lesson-cover.cover-2 { background: linear-gradient(135deg, #1B2E28, #234036); }
.lesson-cover.cover-3 { background: linear-gradient(135deg, #241B33, #362548); }
.lesson-cover span { font-size: 1.9rem; font-weight: 800; opacity: .5; }
.lesson-cover small { border-radius: 999px; padding: 4px 8px; background: rgba(255,255,255,.14); font-size: 10.5px; }
.lesson-body { display: grid; min-height: 170px; align-content: start; padding: 16px; }
.lesson-body h3 { margin: 13px 0 6px; font-size: 13.5px; font-weight: 700; }
.lesson-body p { color: var(--ink-muted); font-size: 12px; }
.lesson-body .secondary-button { align-self: end; margin-top: 14px; }

.exam-layout { max-width: 1000px; }
.exam-intro { display: flex; justify-content: space-between; gap: 24px; }
.exam-intro > div:first-child { max-width: 620px; }
.exam-intro p:not(.eyebrow) { margin-top: 10px; color: var(--ink-muted); font-size: 13px; }
.exam-meta { display: flex; align-items: center; gap: 10px; }
.exam-meta span { display: grid; min-width: 78px; border-radius: var(--radius-md); padding: 12px; text-align: center; background: var(--surface-2); }
.exam-meta small { color: var(--ink-muted); font-size: 10.5px; }
.exam-meta strong { font-size: 1.1rem; }
.question { display: grid; grid-template-columns: 42px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid var(--border); }
.question:first-child { padding-top: 0; border-top: 0; }
.question-number { display: grid; width: 38px; height: 38px; border-radius: var(--radius-md); place-items: center; color: var(--accent-soft-ink); background: var(--accent-soft); font-size: 11.5px; font-weight: 800; }
.question h3 { font-size: 13.5px; font-weight: 700; }
.answer-list { display: grid; gap: 7px; margin-top: 12px; }
.answer-list label { display: flex; min-height: 40px; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 9px 12px; cursor: pointer; font-size: 13px; }
.answer-list label.selected { border-color: var(--accent); background: var(--accent-soft); }
.answer-list input { accent-color: var(--accent); }
.question-panel > .primary-button { margin: 8px 0 0 58px; }
.attempt-history .history-row { display: grid; grid-template-columns: 1fr 70px 200px; align-items: center; min-height: 44px; border-top: 1px solid var(--border); font-size: 12.5px; }
.attempt-history .history-row small { color: var(--ink-muted); }
.exam-result { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 24px; border: 1px solid var(--danger-soft); border-radius: var(--radius-lg); padding: 30px; background: var(--danger-soft); }
.exam-result.passed { border-color: var(--success-soft); background: var(--success-soft); }
.result-score { display: grid; width: 144px; height: 144px; border: 12px solid rgba(198,58,46,.14); border-radius: 50%; place-items: center; text-align: center; }
.exam-result.passed .result-score { border-color: rgba(28,137,85,.16); }
.result-score strong { display: block; font-size: 2rem; }
.result-score span { max-width: 110px; font-size: 11.5px; font-weight: 700; }
.exam-result p { margin: 10px 0 16px; color: var(--ink); font-size: 13px; }

/* ---------- Чат, маркетплейсы, аналитика, профиль ---------- */

.chat-layout { display: grid; min-height: calc(100vh - 220px); grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
.chat-list { padding: 0; overflow: hidden; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; padding: 18px; }
.chat-list > .content-search { width: calc(100% - 30px); margin: 0 15px 12px; }
.chat-list > button { display: grid; width: 100%; grid-template-columns: 32px 1fr auto; align-items: center; gap: 9px; border: 0; border-top: 1px solid var(--border); padding: 12px 16px; text-align: left; background: var(--surface); }
.chat-list > button.active { background: var(--accent-soft); }
.chat-list > button strong, .chat-list > button small { display: block; }
.chat-list > button small { overflow: hidden; max-width: 170px; margin-top: 2px; color: var(--ink-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.chat-list time { align-self: start; color: var(--ink-faint); font-size: 10.5px; }
.conversation { display: grid; grid-template-rows: auto 1fr auto; padding: 0; overflow: hidden; }
.conversation > header { display: flex; min-height: 66px; align-items: center; gap: 11px; border-bottom: 1px solid var(--border); padding: 13px 20px; }
.conversation > header strong, .conversation > header small { display: block; }
.conversation > header small { margin-top: 2px; color: var(--ink-muted); font-size: 11.5px; }
.online { margin-left: auto; color: var(--success); font-size: 11.5px; font-weight: 700; }
.messages { display: flex; overflow: auto; flex-direction: column; gap: 12px; padding: 22px; background: var(--surface-2); }
.message { width: min(75%, 480px); }
.message small { color: var(--ink-faint); font-size: 10.5px; }
.message p { margin-top: 3px; border-radius: 13px 13px 13px 3px; padding: 11px 13px; background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
.message.outgoing { align-self: end; text-align: right; }
.message.outgoing p { color: var(--accent-ink); border-radius: 13px 13px 3px 13px; text-align: left; background: var(--accent); }
.suggestion { width: min(85%, 560px); align-self: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 12px; background: var(--surface-2); }
.suggestion span { color: var(--ink-muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; }
.suggestion p { margin: 6px 0 8px; font-size: 12.5px; }
.suggestion button { border: 0; padding: 0; color: var(--accent-soft-ink); background: transparent; font-weight: 700; }
.message-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; border-top: 1px solid var(--border); padding: 13px; }
.message-form textarea { min-height: 44px; max-height: 110px; resize: vertical; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; background: var(--surface); color: var(--ink); }

.marketplace-health { display: flex; min-width: 230px; align-items: center; gap: 11px; border: 1px solid rgba(255,255,255,.13); border-radius: var(--radius-md); padding: 13px; background: rgba(255,255,255,.06); }
.marketplace-health > span { width: 9px; height: 9px; border-radius: 50%; background: var(--hero-accent); box-shadow: 0 0 0 5px rgba(255,124,52,.16); }
.marketplace-health strong, .marketplace-health small { display: block; }
.marketplace-health strong { color: var(--hero-ink); }
.marketplace-health small { margin-top: 2px; color: var(--hero-ink-muted); font-size: 11px; }
.operation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.operation-card { display: flex; flex-direction: column; gap: 4px; min-height: 170px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: left; background: var(--surface); transition: border-color .12s ease, box-shadow .12s ease; }
.operation-card:hover { box-shadow: var(--shadow); }
.operation-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.operation-number { color: var(--ink-faint); font-size: 11px; font-weight: 800; }
.operation-card strong { margin-top: auto; font-size: 13.5px; font-weight: 700; }
.operation-card small { color: var(--ink-muted); font-size: 12px; }
.operation-card i { margin-top: 12px; color: var(--accent-soft-ink); font-size: 12px; font-style: normal; font-weight: 700; }
.op-result { margin: 4px 0 8px; color: var(--ink-muted); font-size: 12px; }
.operation-card > .secondary-button { align-self: flex-start; }
.key-warning { border-left: 3px solid var(--accent); }
.key-warning strong { display: block; font-size: 13.5px; }
.key-warning p { margin: 5px 0 12px; color: var(--ink-muted); font-size: 12.5px; }
.empty-state { display: grid; min-height: 200px; place-items: center; align-content: center; text-align: center; }
.empty-state strong { font-size: 15px; }
.empty-state p { margin-top: 6px; color: var(--ink-muted); font-size: 13px; }
.table-head, .table-row { display: grid; min-width: 640px; align-items: center; gap: 14px; padding: 11px 6px; }
.table-head { color: var(--ink-faint); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.table-row { border-top: 1px solid var(--border); font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { position: relative; overflow: hidden; min-height: 120px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; background: var(--surface); box-shadow: var(--shadow); }
.metric-card > small { color: var(--ink-muted); font-size: 12px; }
.metric-card > strong { display: block; margin: 10px 0 3px; font-size: 1.5rem; letter-spacing: -.02em; }
.metric-card > p { color: var(--success); font-size: 11.5px; font-weight: 700; }
.metric-mark { position: absolute; top: 0; left: 0; width: 100%; height: 3px; }
.metric-mark.mint { background: var(--success); }
.metric-mark.blue { background: var(--blue-ink); }
.metric-mark.orange { background: var(--accent); }
.metric-mark.violet { background: var(--violet-ink); }

.profile-hero { min-height: 160px; justify-content: flex-start; gap: 20px; }
.profile-hero h2 { margin-bottom: 5px; }
.profile-hero .profile-status { margin-left: auto; border-radius: 999px; padding: 7px 12px; color: var(--hero-ink); background: rgba(255,255,255,.1); font-size: 11.5px; font-weight: 700; }
.profile-grid { display: grid; grid-template-columns: 1.1fr 1fr .75fr; gap: 16px; }
.details-list { margin: 0; }
.details-list > div { display: grid; grid-template-columns: 160px 1fr; gap: 14px; border-top: 1px solid var(--border); padding: 13px 0; font-size: 12.5px; }
.details-list dt { color: var(--ink-muted); }
.details-list dd { margin: 0; font-weight: 700; }
.achievement { display: flex; align-items: center; gap: 11px; border-top: 1px solid var(--border); padding: 12px 0; }
.achievement > span { display: grid; width: 34px; height: 34px; border-radius: var(--radius-md); place-items: center; color: var(--success); background: var(--success-soft); font-weight: 800; }
.achievement strong, .achievement small { display: block; }
.achievement small { margin-top: 2px; color: var(--ink-muted); font-size: 11.5px; }
.salary-panel > strong { display: block; margin: 18px 0 6px; font-size: 1.1rem; }
.salary-panel > p:not(.eyebrow) { margin-bottom: 20px; color: var(--ink-muted); font-size: 12.5px; }

/* ---------- Администратор ---------- */

.admin-summary { display: grid; min-width: 360px; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255,255,255,.13); border-radius: var(--radius-md); padding: 15px; background: rgba(255,255,255,.06); }
.admin-summary > div { display: grid; min-height: 68px; align-content: center; border-left: 1px solid rgba(255,255,255,.11); padding: 0 13px; text-align: center; }
.admin-summary > div:first-child { border-left: 0; }
.admin-summary strong { font-size: 1.5rem; color: var(--hero-ink); }
.admin-summary small { color: var(--hero-ink-muted); font-size: 11px; }
.admin-columns { grid-template-columns: 1fr 1fr; }
.attention-list, .activity-list { display: grid; }
.attention-list > button { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; border: 0; border-top: 1px solid var(--border); padding: 11px 0; text-align: left; background: transparent; }
.attention-list > button:first-child { border-top: 0; }
.attention-list strong, .attention-list small { display: block; font-size: 12.5px; }
.attention-list small { margin-top: 2px; color: var(--ink-muted); }
.attention-list i { color: var(--accent-soft-ink); font-style: normal; }
.activity-list > p { position: relative; display: grid; border-top: 1px solid var(--border); padding: 11px 0 11px 18px; }
.activity-list > p:first-child { border-top: 0; }
.activity-list strong, .activity-list small { display: block; font-size: 12.5px; }
.activity-list small { margin-top: 2px; color: var(--ink-muted); }
.activity-dot { position: absolute; top: 17px; left: 0; width: 7px; height: 7px; border-radius: 50%; }
.activity-dot.mint { background: var(--success); } .activity-dot.blue { background: var(--blue-ink); } .activity-dot.orange { background: var(--accent); }

.employee-admin-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); align-items: start; gap: 16px; }
.employee-list-panel { position: sticky; top: 96px; padding: 0; overflow: hidden; }
.employee-list-title { display: flex; align-items: center; justify-content: space-between; padding: 18px; }
.employee-list-panel > .content-search { width: calc(100% - 28px); margin: 0 14px 12px; }
.employee-list { max-height: calc(100vh - 260px); overflow: auto; }
.employee-list > button { display: grid; width: 100%; grid-template-columns: 32px 1fr 8px; align-items: center; gap: 9px; border: 0; border-top: 1px solid var(--border); padding: 12px 16px; text-align: left; background: var(--surface); }
.employee-list > button.active { background: var(--accent-soft); }
.employee-list strong, .employee-list small { display: block; }
.employee-list strong { font-size: 12.5px; }
.employee-list small { margin-top: 1px; color: var(--ink-muted); font-size: 11.5px; }
.employee-status { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.employee-status.blocked { background: var(--danger); }
.empty-copy { padding: 22px; color: var(--ink-muted); font-size: 13px; }
.employee-detail { display: grid; min-width: 0; gap: 16px; }
.employee-detail-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.employee-detail-header h2 { margin: 8px 0 4px; font-size: 19px; font-weight: 700; }
.employee-detail-header p { color: var(--ink-muted); font-size: 13px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.switch-list { display: grid; }
.switch-row { display: grid; grid-template-columns: auto 1fr 42px; align-items: center; gap: 11px; min-height: 58px; border-top: 1px solid var(--border); }
.switch-row:first-child { border-top: 0; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 12.5px; }
.switch-row small { margin-top: 2px; color: var(--ink-muted); font-size: 11px; }
.shop-access-group { margin-bottom: 4px; }
.shop-access-title { font-size: 11.5px; font-weight: 700; color: var(--ink-muted); padding: 14px 0 2px; border-top: 1px solid var(--border); margin-top: 4px; }
.shop-access-group:first-child .shop-access-title { border-top: 0; margin-top: 0; padding-top: 0; }
.switch { position: relative; width: 40px; height: 22px; border: 0; border-radius: 999px; background: var(--border-strong); }
.switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .12s ease; display: block; }
.switch.on { background: var(--accent); }
.switch.on i { left: 21px; }
.employee-learning-strip { display: grid; grid-template-columns: 1fr 80px minmax(200px, 1fr) auto; align-items: center; gap: 18px; }
.employee-learning-strip > div > p:not(.eyebrow) { margin-top: 5px; color: var(--ink-muted); font-size: 12.5px; }
.employee-learning-strip textarea { min-height: 62px; resize: vertical; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; background: var(--surface); color: var(--ink); }
.score-ring { display: flex; width: 62px; height: 62px; align-items: baseline; justify-content: center; border: 7px solid var(--surface-2); border-radius: 50%; padding-top: 13px; }
.score-ring.passed { border-color: var(--success-soft); }
.score-ring strong { font-size: 1.15rem; } .score-ring small { font-size: 11px; }

.training-table .table-head, .training-table .table-row { grid-template-columns: minmax(190px, 1.25fr) .7fr .6fr .9fr 100px; }
.person-cell { display: flex; align-items: center; gap: 9px; }
.person-cell strong, .person-cell small { display: block; }
.person-cell strong { font-size: 12.5px; }
.person-cell small { margin-top: 1px; color: var(--ink-muted); font-size: 11.5px; }
.security-banner { min-height: 190px; }
.shield { display: grid; width: 100px; height: 112px; border: 2px solid rgba(255,255,255,.2); border-radius: 50px 50px 40px 40px; place-items: center; color: var(--hero-accent); background: rgba(255,255,255,.06); font-size: 2rem; }
.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.setting-card { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; }
.setting-icon { display: grid; width: 42px; height: 42px; border-radius: var(--radius-md); place-items: center; color: var(--blue-ink); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.setting-card p { margin-top: 4px; color: var(--ink-muted); font-size: 12px; }
.security-log .table-head, .security-log .table-row { grid-template-columns: 1.35fr 1fr .75fr .65fr; }


/* ---------- Модальное окно ---------- */

.modal-backdrop { position: fixed; z-index: 200; inset: 0; display: grid; padding: 24px; place-items: center; background: rgba(20,21,26,.55); backdrop-filter: blur(6px); }
.modal { width: min(100%, 540px); max-height: 92vh; overflow: auto; border-radius: var(--radius-lg); padding: 26px; background: var(--surface); box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.modal-head > button { width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); color: var(--ink-muted); background: var(--surface-2); font-size: 1.2rem; }
.modal > .muted { margin: 15px 0 18px; font-size: 13px; }
.modal form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.modal form > label { display: grid; gap: 5px; color: var(--ink-muted); font-size: 12px; font-weight: 700; }
.modal input, .modal select { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; background: var(--surface); color: var(--ink); }

.drop-row--active { background: var(--accent-soft); }
.drop-row--active .drop-title { color: var(--accent-soft-ink); }

/* ---------- Задачи / планировщик ---------- */

.task-check { border: 1.5px solid var(--border-strong); background: transparent; padding: 0; cursor: pointer; }
.task-check:hover { border-color: var(--accent); }
.task-link { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.task-link:hover { color: var(--accent-soft-ink); }
.task-row-wide { padding: 12px 4px; }
.task-row-wide .task-link { display: grid; gap: 2px; }
.task-row-wide .task-link strong { font-size: 13px; font-weight: 600; }
.task-row-wide .task-link small { color: var(--ink-muted); font-size: 11.5px; }
.task-row-wide.done .task-link strong { color: var(--ink-faint); text-decoration: line-through; }

/* ---------- Чат-бот: очередь разборов и карточка кейса ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 15px 10px; }
.pill {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted);
  border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.pill:hover { border-color: var(--border-strong); color: var(--ink); }
.pill.act { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* Полоса состояния бота: тумблер «включён» и режим разбора */
.bot-strip { margin: 0 15px 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.bot-strip.off { border-color: var(--danger-soft); background: var(--danger-soft); }
.bot-strip .pill-row { padding: 8px 0 0; }
.bot-strip-line { display: flex; align-items: center; gap: 8px; }
.bot-strip-line strong { font-size: 13px; flex: 1; }
.bot-strip small { display: block; margin-top: 4px; color: var(--ink-muted); font-size: 11.5px; line-height: 1.4; }
.bot-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: block; }
.bot-dot.наблюдение { background: var(--blue-ink); box-shadow: 0 0 0 3px var(--blue-soft); }
.bot-dot.подготовка { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bot-dot.автоответ { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.bot-dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.case-list { overflow-y: auto; max-height: calc(100vh - 420px); }
.case-row {
  display: grid; gap: 4px; width: 100%; text-align: left;
  border: 0; border-top: 1px solid var(--border); border-left: 3px solid transparent;
  padding: 11px 16px; background: var(--surface); cursor: pointer;
}
.case-row:hover { background: var(--surface-hover); }
.case-row.active { border-left-color: var(--accent); background: var(--accent-soft); }
.case-row-top { display: flex; align-items: center; gap: 7px; }
.case-row-top b { font-size: 11.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-row-text { font-size: 12px; color: var(--ink-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; }
.case-when { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.case-when.urgent { color: var(--danger); font-weight: 700; }

.level-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; flex: none; white-space: nowrap; }
.level-badge.AUTO { color: var(--success); background: var(--success-soft); }
.level-badge.DRAFT { color: var(--ink-muted); background: var(--surface-2); }
.level-badge.ESCALATE { color: var(--danger); background: var(--danger-soft); font-weight: 800; }

.case-head { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.case-head b { font-size: 13px; }
.case-meta { margin-left: auto; font-size: 11px; }
.case-banner { margin: 12px 20px 0; padding: 11px 13px; border-radius: var(--radius-md); background: var(--accent-soft); font-size: 12.5px; }
.case-banner b { display: block; color: var(--accent-soft-ink); }
.case-banner span { display: block; margin-top: 3px; }

.case-reason { margin: 12px 20px 0; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); font-size: 12.5px; }
.case-reason summary { cursor: pointer; }
.case-reason-body { display: grid; gap: 5px; margin-top: 8px; justify-items: start; }

.case-composer { display: grid; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--border); }
.case-composer textarea {
  width: 100%; resize: vertical; padding: 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); font-family: inherit;
}
.model-fix { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--surface-2); }
.composer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.composer-row .muted { font-size: 11.5px; }
.snippets .secondary-button { min-height: 30px; padding: 0 10px; font-size: 11.5px; }
.bot-original { max-height: 200px; overflow: auto; margin: 6px 0 0; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 12px; white-space: pre-wrap; }
.composer-note { font-size: 11px; line-height: 1.45; }

/* ---------- Чат-бот: вкладки панели ---------- */

.bot-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.bot-tab {
  border: 0; background: none; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--ink-muted); font-size: 13px; font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -5px;
}
.bot-tab:hover { color: var(--ink); }
.bot-tab.act { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px; margin-left: 3px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-size: 10px; font-weight: 800;
}
.bot-control { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bot-mode-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 10px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.bot-mode-btn:hover { background: var(--surface-hover); }
.bot-mode-btn:disabled { opacity: .55; cursor: not-allowed; }
.bot-balance { color: var(--ink-muted); font-size: 12px; }

/* Правки: два столбца «бот предлагал» / «человек отправил» */
.edit-item { padding: 14px 0; border-top: 1px solid var(--border); }
.edit-item:first-of-type { border-top: 0; }
.edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.edit-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.edit-cols .muted { font-size: 11.5px; margin-bottom: 4px; }
@media (max-width: 900px) { .edit-cols { grid-template-columns: 1fr; } }

/* Обучение бота: карточки файлов базы знаний */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.kb-card { display: flex; flex-direction: column; gap: 10px; }
.kb-card-head { display: flex; align-items: flex-start; gap: 10px; }
.kb-card-head > div { flex: 1; min-width: 0; }
.kb-card-head h3 { font-size: 14px; font-weight: 700; }
.kb-file { display: block; margin-top: 3px; color: var(--ink-faint); font-size: 11px; word-break: break-all; }
.kb-about { font-size: 12.5px; }
.kb-sample { border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 10px 12px; background: var(--surface-2); }
.kb-sample-label { font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 5px; }
.kb-sample p { font-size: 12.5px; line-height: 1.5; }
.kb-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; font-size: 11.5px; }

/* Путь от промаха до правила */
.kb-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.kb-flow i { align-self: center; color: var(--accent); font-style: normal; font-weight: 700; }
.kb-step { flex: 1 1 180px; display: grid; gap: 3px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.kb-step > span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; }
.kb-step b { font-size: 12.5px; }
.kb-step small { color: var(--ink-muted); font-size: 11.5px; line-height: 1.4; }

.costs-table .table-head, .costs-table .table-row { grid-template-columns: 1.4fr .6fr .6fr; min-width: 380px; }
.stats-table .table-head, .stats-table .table-row { grid-template-columns: 1.4fr .6fr .6fr .6fr .8fr .6fr .8fr .7fr; min-width: 760px; }
.botlog-table .table-head, .botlog-table .table-row { grid-template-columns: 1fr .9fr 1fr 1.8fr; }
.stats-table, .botlog-table { overflow-x: auto; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }

.op-scenarios { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.op-scenarios li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.op-scenarios li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.op-scenarios strong { margin-top: 0; font-size: 12.5px; }
.op-scenarios small { color: var(--ink-muted); font-size: 11.5px; }
.op-scenarios .secondary-button { flex-shrink: 0; }
.op-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.scenario-number { color: var(--ink-faint); font-weight: 800; font-size: 11px; margin-right: 2px; }

/* Журнал запусков */
.run-log-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.run-log-head h3 { margin: 2px 0 4px; }
.run-log-head p.muted { margin: 0; font-size: 12.5px; }
.run-log-head a.secondary-button { text-decoration: none; }
.run-filters { align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.run-filter { display: flex; flex-direction: column; gap: 4px; }
.run-filter small { color: var(--ink-faint); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.run-filter select, .run-filter input { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; padding: 7px 9px; }
.runs-table .table-head, .runs-table .table-row { grid-template-columns: 130px 1.3fr .7fr .9fr 2.2fr 90px; min-width: 860px; }
.runs-table .table-row.run-failed { background: var(--danger-soft); }
.text-button.danger { color: var(--danger); }
.run-errors { border-top: 1px solid var(--border); padding: 8px 6px; font-size: 12.5px; color: var(--ink-muted); }
.run-errors p { margin: 0 0 4px; }
.run-errors strong { color: var(--ink); font-size: 12.5px; }

/* Большая таблица — внутри широкаяТаблица() (решение Дмитрия 01.10.2026, во всём
   портале): ползунок прокрутки над таблицей, по краям стрелки, своей нижней
   полосы у таблицы нет. Полоса прилипает к верху экрана, пока таблица видна:
   у таблицы на сотни строк до неё иначе не долистать. Таблица влезает
   целиком — полосы и стрелок нет (класс fits ставит app.js).
   contain: inline-size — ширину обёртке задаёт панель, а не таблица: иначе
   строка списка с min-width на узком окне распирала панель и всю страницу. */
.wide-table { contain: inline-size; }
.wide-table-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 4px 0; background: var(--surface); }
.wide-table.fits .wide-table-bar { display: none; }
.wide-table-track { flex: 1; min-width: 0; min-height: 12px; overflow-x: auto; overflow-y: hidden; }
.wide-table-track > div { height: 1px; }
.wide-table-arrow { flex: none; width: 34px; height: 26px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; }
.wide-table-arrow:hover:not(:disabled) { background: var(--surface-2); }
.wide-table-arrow:disabled { opacity: .35; cursor: default; }
.wide-table-body { overflow-x: auto; scrollbar-width: none; }
.wide-table-body::-webkit-scrollbar { display: none; }
/* Столбец, по которому узнают строку, при сдвиге таблицы вбок остаётся у
   левого края (Дмитрий 01.10.2026): первый — артикул, дата, схема, позиция;
   в юнит-экономике первый — дата, поэтому там закреплён «Артикул» (класс pin):
   он доезжает до края и стоит. Черту справа рисует ::after — тень у ячеек
   таблицы браузер не рисует, а рамка уезжает вместе с соседней ячейкой.
   left: -1px — без него у края в щель шириной в пиксель видна уехавшая. */
.wide-table-body table:not(.unit-grid) thead tr:first-child > :first-child,
.wide-table-body table:not(.unit-grid) tbody tr > :first-child,
.wide-table-body table.plan-grid thead tr:first-child > :first-child,
.wide-table-body table.plan-grid tbody tr > :first-child,
.wide-table-body .pin { position: sticky; left: -1px; z-index: 1; }
.wide-table-body table:not(.unit-grid) thead tr:first-child > :first-child::after,
.wide-table-body table:not(.unit-grid) tbody tr > :first-child::after,
.wide-table-body table.plan-grid thead tr:first-child > :first-child::after,
.wide-table-body table.plan-grid tbody tr > :first-child::after,
.wide-table-body .pin::after { content: ""; position: absolute; top: 0; right: -1px; bottom: 0; width: 1px; background: var(--border); }
:where(.wide-table-body) tbody tr > td:first-child, :where(.wide-table-body) td.pin { background: var(--surface); }

/* Сводка по датам внутри портала */
.run-summary-grid { border-collapse: collapse; font-size: 12.5px; }
.run-summary-grid th, .run-summary-grid td { border: 1px solid var(--border); padding: 6px 10px; text-align: right; white-space: nowrap; }
.run-summary-grid thead th { background: var(--surface-2); color: var(--ink-muted); font-weight: 800; text-align: center; }
.run-summary-grid tbody th { background: var(--surface-2); text-align: left; font-weight: 700; }
.run-summary-grid td { font-variant-numeric: tabular-nums; }
.run-summary-grid .total { background: var(--surface-2); font-weight: 800; }
.run-summary-grid .cond-start { border-left: 2px solid var(--ink-muted); }
.run-summary-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; color: var(--ink-muted); font-size: 11.5px; }
.run-summary-legend b { color: var(--ink); }
/* Сверка «Условно доставлен» ↔ «Количество доставленных» (02.10.2026): число —
   кнопка, под таблицей номера заказов; «Доставлено» и «Ждут» — отделены тонкой
   чертой от перевозчиков */
.run-summary-grid .cond-check { border-left: 1px dashed var(--border-strong); }
.run-summary-grid th.muted, .run-summary-grid td.muted { color: var(--ink-muted); }
/* Банк идей (03.10.2026): строки таблицы формы. Текст — влево и сверху; сама
   идея переносится по словам и сохраняет переносы строк из формы */
.ideas-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ideas-meta { margin: 0 0 8px; }
.ideas-error { margin: 0; color: var(--danger); }
.ideas-robot { margin: 12px 0 0; font-size: 12.5px; word-break: break-word; }
.ideas-grid thead th, .ideas-grid td { text-align: left; vertical-align: top; }
.ideas-grid td.wrap { white-space: pre-line; min-width: 280px; max-width: 560px; }
.cell-link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; }
.cell-link:hover, .cell-link:focus-visible { color: var(--accent); }
.postings-view { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.postings-view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.postings-view p { margin: 8px 0 0; font-variant-numeric: tabular-nums; font-size: 12.5px; line-height: 1.6; word-break: break-word; }
/* Отчёт «Количество доставленных»: та же сетка, плюс строка с ошибкой магазина */
.delivered-grid td.danger { color: var(--danger); text-align: left; white-space: normal; }
/* Столбцы кабинета (29.09.2026) не влезали в ширину: заголовки переносятся на
   вторую строку, отступы у ячеек меньше */
.delivered-grid th, .delivered-grid td { padding: 6px 8px; }
.delivered-grid thead th { white-space: normal; vertical-align: bottom; min-width: 4.5em; }
/* Юнит-экономика: та же сетка; текстовые столбцы влево, минус — красным,
   расшифровка начислений переносится, строка «Итого» — как шапка */
/* Колонка раскладки — grid, и её ячейка не ужимается меньше содержимого:
   широкая таблица растягивала всю страницу вместе с шапкой и кнопками
   (15.09.2026). min-width: 0 оставляет прокрутку внутри .wide-table-body. */
.content-stack > .run-summary, .content-stack > .account-fees { min-width: 0; }
.unit-grid td.text, .cost-grid td.text { text-align: left; }
/* Таблица юнит-экономики: столбцы уже, страница под неё шире (просил Дмитрий 15.09.2026) */
.page-content:has(.unit-grid) { max-width: 1720px; }
.unit-grid th, .unit-grid td { padding: 4px 7px; font-size: 12px; }
.unit-grid thead th { font-size: 11.5px; line-height: 1.2; white-space: normal; min-width: 70px; }
.unit-grid tbody th { font-size: 11.5px; }
.unit-grid td.neg { color: var(--danger); }
.unit-grid td.missing { color: var(--danger); font-style: italic; text-align: center; }
.unit-grid td.details { text-align: left; white-space: normal; min-width: 220px; max-width: 340px; font-size: 11px; line-height: 1.25; color: var(--ink-muted); }
.unit-grid tbody tr.total-row th, .unit-grid tbody tr.total-row td { background: var(--surface-2); font-weight: 800; border-top: 2px solid var(--border-strong, var(--border)); }
.unit-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-fees .panel-heading strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.account-fees .panel-heading strong.neg, .account-grid td.neg { color: var(--danger); }
.account-grid { margin-top: 10px; }
.account-grid th:first-child { text-align: left; }
.account-grid td.text { text-align: left; }
.account-grid tbody tr.total-row th, .account-grid tbody tr.total-row td { font-weight: 800; border-top: 2px solid var(--border-strong, var(--border)); }
/* Сверка с кабинетом: группа раскрывается в состав по типам начислений прямо в ячейке */
.account-grid th details { margin: 0; }
.account-grid th details summary { display: list-item; cursor: pointer; }
.account-grid th details .account-grid { margin-top: 6px; font-weight: 400; }
.account-grid th details .account-grid th { font-weight: 400; color: var(--ink-muted); }
.account-spread { margin-top: 12px; }
.unit-grid thead th small.share { display: block; font-weight: 600; color: var(--ink-faint); }
.unit-grid td small.share { display: block; font-weight: 600; font-size: 10.5px; color: var(--ink-muted); }
/* Планирование производства: группы пилюль под подписью и класс ABC. */
.plan-filters .filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
/* Фильтр «Категория»: выпадающий список с галочками, как в каталоге маркетплейса. */
.cat-filter .cat-button { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; padding: 7px 9px; min-width: 160px; text-align: left; cursor: pointer; }
.cat-filter .cat-button.active { border-color: var(--ink); font-weight: 700; }
.cat-dropdown { min-width: 290px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto; top: calc(100% + 4px); }
.cat-dropdown .cat-item, .cat-dropdown .cat-group { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink); cursor: pointer; }
.cat-dropdown .cat-item:hover, .cat-dropdown .cat-group:hover { background: var(--surface-2); }
.cat-dropdown .cat-group, .cat-dropdown .cat-group-name { font-weight: 700; }
.cat-dropdown .cat-group ~ .cat-item, .cat-dropdown .cat-group-name ~ .cat-item { padding-left: 26px; }
.cat-dropdown .cat-group-name { margin: 4px 8px 2px; font-size: 13px; color: var(--ink); }
.cat-dropdown .cat-item span, .cat-dropdown .cat-group span { flex: 1; }
.cat-dropdown small { color: var(--ink-muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.cat-dropdown input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
/* Фильтр «Артикул» юнит-экономики (09.10.2026): поиск остаётся наверху при прокрутке списка. */
.offer-dropdown { min-width: 320px; }
.offer-dropdown .offer-search { position: sticky; top: -6px; z-index: 1; display: block; width: 100%; box-sizing: border-box; margin: -6px 0 4px; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; box-shadow: 0 6px 0 var(--surface); }
.offer-dropdown .offer-found { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 4px 4px; }
/* «Выбрать все» (13.10.2026) — переключатель: нажата — подсвечена, как нажатая кнопка. */
.offer-dropdown .offer-all { display: block; margin: 0 0 4px; padding: 4px 6px; border-radius: var(--radius-sm); }
.offer-dropdown .offer-all.active { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }
.offer-dropdown .cat-item span { overflow-wrap: anywhere; }
.plan-grid td.plan-qty { font-weight: 800; }
.plan-grid tbody th { white-space: nowrap; }
.abc { display: inline-block; min-width: 24px; border-radius: 6px; padding: 1px 6px; font-weight: 800; text-align: center; color: var(--accent-ink); }
.abc-a { background: var(--success); }
.abc-b { background: var(--ink-muted); }
.abc-c { background: var(--ink-faint); }
.plan-grid td.weeks { padding-top: 2px; padding-bottom: 2px; }
.spark-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.spark-bars i { display: block; width: 5px; border-radius: 1px; background: var(--ink-faint); }
.spark-bars i:nth-last-child(-n+4) { background: var(--ink-muted); }
.plan-grid td.trend { white-space: nowrap; font-weight: 700; }
.plan-grid td.trend.up { color: var(--success); }
.plan-grid td.trend.down { color: var(--danger); }
.plan-grid thead th.plan-qty { background: var(--surface-2); }
.plan-grid td.ads { white-space: nowrap; }
.plan-grid td.ads small.ads-off { display: block; font-weight: 700; font-size: 10.5px; color: var(--danger); }
/* Стрелки «в начало / в конец» — таблица юнит-экономики на сотни строк */
.page-jump { position: fixed; right: 18px; bottom: 26px; display: flex; flex-direction: column; gap: 6px; z-index: 20; }
.page-jump button { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
.page-jump button:hover { background: var(--surface-2); }
.account-spread summary { cursor: pointer; color: var(--ink-muted); font-size: 12.5px; }
.cost-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.cost-form .cost-paste { flex: 1 1 320px; }
.cost-form .cost-paste textarea { width: 100%; box-sizing: border-box; }
.key-json { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; padding: 8px 10px; resize: vertical; }
.key-warning { border-left: 3px solid var(--accent); }
.key-warning strong { display: block; font-size: 13.5px; }
.key-warning p { margin: 5px 0 12px; color: var(--ink-muted); font-size: 12.5px; }
.empty-state { display: grid; min-height: 200px; place-items: center; align-content: center; text-align: center; }
.empty-state strong { font-size: 15px; }
.empty-state p { margin-top: 6px; color: var(--ink-muted); font-size: 13px; }
.table-head, .table-row { display: grid; min-width: 640px; align-items: center; gap: 14px; padding: 11px 6px; }
.table-head { color: var(--ink-faint); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.table-row { border-top: 1px solid var(--border); font-size: 13px; }

/* ---------- Очередь разборов: новый макет ---------- */

.queue-state { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; font-size: 12px; }
.queue-state .secondary-button { margin-left: auto; min-height: 28px; padding: 0 10px; font-size: 11.5px; }
.queue-filters { display: grid; gap: 6px; padding: 0 16px 12px; }
.queue-filters .input { min-height: 34px; font-size: 12.5px; }

/* Карточка в очереди: уровень и время сверху, текст клиента, снизу магазин и захват */
.case-row { display: grid; gap: 6px; padding: 12px 16px; }
.case-row-top { display: flex; align-items: center; gap: 8px; }
.case-row-top .case-when { margin-left: auto; }
.case-row-text {
  font-size: 12.5px; color: var(--ink); line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-clamp: 3;
}
.case-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.case-row-bottom .held { white-space: nowrap; }

/* Карточка кейса */
.case-ozon { margin-left: auto; }
.case-head b { font-size: 13.5px; }

.rewrite { border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 10px 12px; background: var(--surface-2); }
.rewrite summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-muted); }
.rewrite textarea { margin-top: 8px; }

.composer-row.actions { gap: 8px; }
.push-right { margin-left: auto; }
.secondary-button.quiet { color: var(--ink-muted); }
.remove-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.remove-row .input { flex: 1 1 220px; }

/* Что было раньше */
.case-past { margin: 0 20px 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.case-past summary { cursor: pointer; font-size: 12.5px; font-weight: 700; }
.past-item { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.past-item:first-of-type { border-top: 0; }
.past-customer { margin-top: 4px; font-size: 12px; }
.past-answer { margin-top: 3px; font-size: 12.5px; }
.past-label { margin-top: 12px; font-size: 11.5px; }
.past-table { margin-top: 6px; display: grid; gap: 4px; }
.past-row { display: grid; grid-template-columns: 60px auto 1fr auto; align-items: center; gap: 8px; font-size: 12px; }

/* ---------- Возвраты, рекламации, отчёты, новости ---------- */

.returns-table .table-head, .returns-table .table-row { grid-template-columns: 100px 1.2fr 1fr 1.4fr 1fr 110px; }
/* Возвраты из Ozon: у полного списка, главной и блока отмен разное число колонок. */
.returns-table.wide .table-head, .returns-table.wide .table-row { grid-template-columns: 130px 80px 1fr 1.6fr 1.6fr 130px 130px; }
.returns-table.compact .table-head, .returns-table.compact .table-row { grid-template-columns: 130px 80px 1fr 1.8fr 130px; }
.returns-table.pending .table-head, .returns-table.pending .table-row { grid-template-columns: 150px 1fr 2fr 150px; }
.returns-table.pickup .table-head, .returns-table.pickup .table-row { grid-template-columns: 140px 120px 1.2fr 1.6fr 130px; }
/* --- Панель заказов ------------------------------------------------------ */
/* Четыре площадки в строку. На узком экране переносятся сами, не сжимаясь
   в нечитаемую полоску. */
.oc-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 12px; }
.oc-card { border: 1px solid #e6e8ec; border-radius: 10px; padding: 12px 14px 10px; background: #fff; }
.oc-card.оff { background: #fafbfc; }
.oc-card-head strong { font-size: 13px; font-weight: 650; color: #1f2530; }

/* Сводка за сегодня: число крупно, деньги рядом — их сравнивают между
   магазинами, а не читают по одному. */
.oc-today { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.oc-today-orders { font-size: 26px; font-weight: 680; line-height: 1; color: #1f2530; }
.oc-today-sub { font-size: 12px; color: #8a9099; }
.oc-today-money { margin-left: auto; font-size: 14px; font-weight: 650; color: #1f2530;
                  font-variant-numeric: tabular-nums; }

.oc-empty { margin: 14px 0 18px; font-size: 13px; line-height: 1.5; }
.oc-why { font-size: 12px; color: #9aa0a8; }

.oc-month { margin: 3px 0 0; font-size: 11.5px; color: #8a9099; }
.oc-month b { font-weight: 650; color: #52585f; font-variant-numeric: tabular-nums; }

/* Ось — сплошная волосяная линия на тон от фона. Пунктир читался бы как
   «прогноз» или «порог», хотя это просто разметка. */
.oc-chart { display: block; width: 100%; height: auto; }
.oc-axis { stroke: #dfe3e8; stroke-width: 1; }
/* Подписи носят цвет текста, а не цвет столбика: цвет — это про метки. */
.oc-tick { fill: #9aa0a8; font-size: 9px; }
.oc-band { cursor: default; }
.oc-band:hover rect { fill: rgba(15, 23, 42, 0.05); }

.oc-chart-wrap { position: relative; margin: 6px 0 4px; }
.oc-tip {
  position: absolute; pointer-events: none; z-index: 3;
  background: #1f2530; color: #fff; border-radius: 6px;
  padding: 6px 9px; font-size: 11.5px; line-height: 1.45;
  white-space: pre-line; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.22);
}
.oc-tip[hidden] { display: none; }

.oc-cancels { margin: 4px 0 0; font-size: 12px; color: #52585f; }
.oc-cancels b { font-weight: 680; color: #1f2530; }

.oc-head-right { display: flex; align-items: center; gap: 14px; }
.oc-when { font-size: 12px; }

/* Переключатель площадок на экране возвратов. Подчёркивание вместо заливки:
   это навигация, а не действие, и спорить с кнопками ей незачем. */
.rt-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px 0 4px;
           border-bottom: 1px solid #e6e8ec; }
.rt-tab { appearance: none; background: none; border: 0; cursor: pointer;
          font: inherit; font-size: 13.5px; color: #6b7280; padding: 8px 12px;
          border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rt-tab:hover { color: #1f2530; }
.rt-tab.active { color: #1f2530; font-weight: 600; border-bottom-color: #d4522a; }
.rt-count { display: inline-block; margin-left: 5px; font-size: 11.5px; color: #9aa0a8;
            font-variant-numeric: tabular-nums; }
.rt-tab.active .rt-count { color: #6b7280; }
.rt-hint { margin: 8px 0 0; font-size: 13px; }

/* Номер заказа ведёт в кабинет Ozon. Стрелка говорит, что уйдём на другой сайт. */
.ozon-link { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.ozon-link:hover { color: var(--accent, #d4522a); }
/* Названия товаров длинные — обрезаем, полное видно в подсказке. */
.returns-table.wide .table-row span, .returns-table.compact .table-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.claims-table .table-head, .claims-table .table-row { grid-template-columns: 100px 1fr 1.4fr 100px 1.4fr 110px; }
.returns-table .status-pill, .claims-table .status-pill { border: 0; cursor: pointer; font-family: inherit; }
.claim-form { margin-bottom: 14px; }
.claim-form .primary-button, .claim-form .secondary-button { margin-right: 8px; }

.report-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.report-card h3 { font-size: 13.5px; font-weight: 700; }
.report-url { font-size: 11.5px; word-break: break-all; }
.report-row { grid-template-columns: 1fr auto; }
.report-row small { word-break: break-all; }

.news-item { display: grid; gap: 8px; }
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.news-item h3 { font-size: 15px; font-weight: 700; }

.field { display: grid; gap: 5px; color: var(--ink-muted); font-size: 12px; font-weight: 700; margin: 0 0 12px; }
.input { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; background: var(--surface); color: var(--ink); font-size: 13px; }
.input:focus { outline: none; border-color: var(--accent); }
.modal-note { display: flex; grid-column: 1 / -1; align-items: center; gap: 10px; border-radius: var(--radius-md); padding: 12px; background: var(--blue-soft); }
.modal-note > span { display: grid; width: 26px; height: 26px; border-radius: var(--radius-sm); place-items: center; color: var(--blue-ink); background: var(--surface); font-weight: 800; }
.modal-note strong, .modal-note small { display: block; font-size: 12px; }
.modal-note small { color: var(--ink-muted); }
.modal-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 8px; margin-top: 4px; }

svg { display: block; }

/* ---------- Адаптивность ---------- */

@media (max-width: 1180px) {
  .row.grid7, .module-grid, .lesson-grid { grid-template-columns: repeat(2, 1fr); }
  .operation-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .salary-panel { grid-column: 1 / -1; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .employee-learning-strip { grid-template-columns: 1fr 70px; }
  .employee-learning-strip textarea { grid-column: 1 / -1; }
  .employee-learning-strip > button { grid-column: 1 / -1; justify-self: start; }
  .admin-welcome { align-items: flex-start; flex-direction: column; }
  .admin-summary { min-width: 0; width: 100%; }
}

@media (max-width: 900px) {
  .login-page { flex-direction: column; }
  .hero-panel { width: auto; padding: 30px 24px; }
  .flow-panel { padding: 32px 20px 48px; }
  .two-column-grid, .detail-grid, .admin-columns { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { max-height: 320px; }
  .conversation { min-height: 560px; }
  .employee-admin-layout { grid-template-columns: 1fr; }
  .employee-list-panel { position: static; }
  .employee-list { max-height: 340px; }
  .security-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .salary-panel { grid-column: auto; }
}

@media (max-width: 620px) {
  body { font-size: 13.5px; }
  .page-content { padding: 18px 14px 45px; }
  .row.grid7, .module-grid, .lesson-grid, .operation-grid, .metric-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filter-row { align-items: stretch; }
  .content-search { width: 100%; margin-left: 0; }
  .content-search input { width: 100%; }
  .exam-intro { flex-direction: column; }
  .exam-meta { width: 100%; }
  .exam-meta span { min-width: 0; flex: 1; }
  .question { grid-template-columns: 1fr; }
  .question-panel > .primary-button { margin-left: 0; }
  .attempt-history .history-row { grid-template-columns: 1fr auto; }
  .attempt-history .history-row small { grid-column: 1 / -1; }
  .exam-result { grid-template-columns: 1fr; text-align: center; }
  .result-score { margin: 0 auto; }
  .message-form { grid-template-columns: 1fr; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-summary > div { border-top: 1px solid rgba(255,255,255,.11); border-left: 0; }
  .admin-summary > div:first-child { border-top: 0; }
  .employee-detail-header { align-items: flex-start; }
  .detail-actions { width: 100%; margin-left: 0; }
  .employee-learning-strip { grid-template-columns: 1fr; }
  .employee-learning-strip textarea, .employee-learning-strip > button { grid-column: auto; }
  .modal form { grid-template-columns: 1fr; }
  .modal-note, .modal-actions { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Ключи маркетплейсов в настройках */
.key-list { display: grid; gap: 10px; }
.key-row {
  display: grid; grid-template-columns: minmax(180px, 1.4fr) auto minmax(160px, 1.6fr) auto;
  align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.key-name strong { display: block; font-size: 13px; }
.key-name small { display: block; margin-top: 1px; color: var(--ink-faint); font-size: 11px; }
.key-row input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px;
}
.key-row input:focus { border-color: var(--accent); outline: none; }
@media (max-width: 900px) {
  .key-row { grid-template-columns: 1fr auto; }
  .key-row input, .key-row button { grid-column: 1 / -1; }
}


/* ---------- Заголовки экранов ---------- */
/* Пришли на смену тёмным блокам-шапкам: те занимали до трети экрана ради
   лозунга, а рабочей площади не оставалось. Заголовок остался, подложка ушла. */

.page-title {
  margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--ink);
}
.page-title:focus { outline: none; }
.page-subtitle { margin: -12px 0 0; color: var(--ink-muted); font-size: 13px; }

/* Экран чат-бота: кроме панели на нём ничего нет, поэтому она занимает всё
   окно под шапкой. Внешней прокрутки здесь быть не должно — переписка
   прокручивается внутри панели. */
.content-stack--tight { display: flex; flex-direction: column; gap: 0; }
.portal-shell--frame { height: 100vh; }
.portal-shell--frame .page { flex: 1; min-height: 0; display: flex; }
.portal-shell--frame .page-content { flex: 1; min-height: 0; display: flex; padding-bottom: 10px; }
.portal-shell--frame .page-content > .content-stack { flex: 1; min-width: 0; }



/* Счётчики с главной администратора. Были белым по тёмному, теперь на светлом. */
.summary-strip .admin-summary {
  min-width: 0; border-color: var(--border); background: var(--surface);
  box-shadow: var(--shadow);
}
.summary-strip .admin-summary strong { color: var(--ink); }
.summary-strip .admin-summary small { color: var(--ink-muted); }

/* Заголовок экрана и индикатор готовности — одной строкой. */
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Магазин прямо в карточке: экран показывает несколько магазинов подряд,
   и при прокрутке без подписи непонятно, к какому она относится. */
.operation-shop {
  display: block; margin-bottom: 2px;
  color: var(--ink-faint); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}

/* «Скоро добавим» — то, что задумано, но ещё не работает. Одной строкой
   вместо карточек с мёртвой кнопкой «Запустить»: карточка обещает действие,
   которого нет, и место занимает как рабочая. */
.soon-block { display: flex; align-items: center; gap: 12px; }
.soon-block p { margin: 0; }
.soon-block .muted { font-size: 13px; line-height: 1.5; }

/* Заголовок ряда карточек: «Смена статусов», «Ответы на отзывы». */
.group-title { margin: 4px 0 -4px; font-size: 14px; font-weight: 700; color: var(--ink-muted);
               letter-spacing: .02em; }
/* Разделитель между разделами и площадками в одном ряду кнопок. */
.filter-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex: none; }

/* Итог прогона автоматизации: человек нажал кнопку и ждёт ответа. */
.run-summary { margin: 12px 0; font-size: 15px; line-height: 1.5; }
.run-errors { margin-bottom: 14px; }
.run-errors summary { cursor: pointer; color: var(--danger); font-weight: 600; font-size: 13px; }
.run-errors ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }

/* Правка текста рассылки. Моноширинный шрифт — чтобы отступы и переносы,
   которые уйдут клиенту, были видны ровно так, как их набрали. */
.modal-wide { width: min(100%, 720px); }
.message-edit {
  width: 100%; margin-top: 10px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface); color: var(--ink);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px;
  line-height: 1.55; resize: vertical; white-space: pre-wrap;
}
.message-edit:focus { border-color: var(--accent); outline: none; }
.char-count { margin: 6px 0 0; color: var(--ink-muted); font-size: 12px; }
.char-count.over { color: var(--danger); font-weight: 600; }

/* Вопрос про повторную отправку: этим заказам сообщение уже уходило. */
.repeat-ask { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--border-strong);
              border-radius: var(--radius-md); background: var(--surface-2); }
.repeat-ask p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; }
.repeat-ask summary { cursor: pointer; font-size: 12.5px; color: var(--ink-muted); }

/* Итоговая экономика производства (вкладка «Итог», 01.10.2026): строки каналов,
   «Всего» жирным, отрицательные суммы красным, сообщения проверки фонда ОПР/ОХР. */
.total-grid td.neg { color: var(--danger); }
.total-grid tr.total-row th, .total-grid tr.total-row td { font-weight: 600; border-top: 1px solid var(--border-strong); }
.fund-messages { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.fund-messages li { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); line-height: 1.45; }
.fund-messages li.fund-ok { background: var(--success-soft); }
.fund-messages li.fund-warn { background: var(--accent-soft); color: var(--accent-soft-ink); }
.fund-messages li.fund-error { background: var(--danger-soft); color: var(--danger); }
.fund-messages li.fund-info { background: var(--steel-soft); color: var(--steel-ink); }
.wholesale .filter-row { align-items: flex-end; }

/* ---- Панель менеджера, ABC-анализ, Панель руководителя (05.10.2026) ---- */
/* Разница к прошлому месяцу: цвет по смыслу показателя (рост отмен — плохо), знак «+/−» — всегда текстом. */
.delta-good { color: var(--success); font-weight: 700; }
.delta-bad { color: var(--danger); font-weight: 700; }
.mp-grid .mp-first > th, .mp-grid .mp-first > td { border-top: 2px solid var(--border-strong); }
.mp-grid .mp-n { width: 34px; text-align: center; color: var(--ink-muted); }
.mp-grid .mp-label { min-width: 200px; white-space: normal; cursor: help; }
.mp-grid .mp-part { font-weight: 600; }
.mp-grid .mp-sub > th { padding-left: 22px; font-weight: 500; color: var(--ink-muted); }
.mp-grid .mp-group > th, .mp-grid .mp-group > td { background: var(--surface-2); font-weight: 800; }
/* ---- Проект поднятия маржи (09.10.2026): план — приглушён, факт заказов — цветом к плану ---- */
.mrg-grid .mrg-sec > th, .mrg-grid .mrg-sec > td { background: var(--surface-2); font-weight: 800; border-top: 2px solid var(--border-strong); }
.mrg-grid .mrg-plan > th, .mrg-grid .mrg-plan > td { color: var(--ink-muted); font-weight: 500; }
.mrg-grid tbody th { white-space: nowrap; }
.mrg-grid thead th small, .mrg-grid td small { font-weight: 500; color: var(--ink-muted); }
.mrg-grid thead th.mrg-now { background: var(--accent-soft); color: var(--accent-soft-ink); }
.mrg-grid td.mrg-good { background: var(--success-soft); }
.mrg-grid td.mrg-warn { background: var(--accent-soft); }
.mrg-grid td.mrg-bad { background: var(--danger-soft); }
.mrg-checks td.mrg-check { text-align: left; white-space: normal; min-width: 230px; vertical-align: top; line-height: 1.45; }
.mrg-calc .mrg-calc-input { width: 76px; }
.mrg-calc th, .mrg-calc td { padding-left: 7px; padding-right: 7px; }
.mrg-calc tbody th small { display: block; font-weight: 500; color: var(--ink-muted); }
/* Калькулятор с оптовой ценой — 14 столбцов: шапки и подпись «сейчас» переносятся, чтобы итог помещался без прокрутки. */
.mrg-calc thead th { white-space: normal; min-width: 64px; vertical-align: bottom; }
.mrg-calc tbody th { white-space: normal; min-width: 150px; max-width: 190px; }
/* «Проект повышения маржи компании»: план и факт калькулятора — приглушены, вписанное — с чертой, оценка — курсивом;
   в калькуляторе строки-рычаги — с заливкой, поле ввода — по ширине столбца. */
.cm-calc tr.cm-lever > th, .cm-calc tr.cm-lever > td { background: var(--accent-soft); }
.cm-calc tr.cm-lever > th { color: var(--accent-soft-ink); }
.cm-grid.cm-calc .cm-input { width: 100%; min-width: 84px; max-width: 120px; box-sizing: border-box; text-align: right; }
.cm-grid tbody th { white-space: normal; min-width: 220px; max-width: 300px; }
.cm-grid td.cm-plan { color: var(--ink-muted); }
.cm-grid td.cm-manual { box-shadow: inset 0 -2px 0 var(--blue-ink); }
.cm-grid td.cm-estimate { font-style: italic; }
.cm-grid .cm-input { width: 84px; }
.cm-grid thead th .text-button { padding: 0 4px; font-size: 11.5px; }
@media (max-width: 600px) {
  .cm-grid tbody th { min-width: 150px; }
}
@media (max-width: 600px) {
  /* На телефоне подписи строк переносятся — иначе столбец подписей съедает экран. */
  .mrg-grid tbody th { white-space: normal; min-width: 120px; }
}
.run-summary-grid td.text { text-align: left; white-space: normal; }
.panel-notes { padding: 12px 16px; }
.notes-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-muted); }
.notes-list .note-warn { color: var(--accent-soft-ink); }
.notes-list .note-error { color: var(--danger); }
.empty-state.compact { min-height: 0; padding: 10px; }
.metric-card > p.muted-ink { color: var(--ink-muted); font-weight: 600; }
.mgmt-tiles .metric-card > strong { font-size: 1.35rem; }
/* Плитки Панели руководителя — компактные, по 5 в ряд: есть место под 10-ю (Дмитрий 06.10.2026).
   У «Панели менеджера» (.mp-tiles) плитки прежние. */
.mgmt-tiles:not(.mp-tiles) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mgmt-tiles:not(.mp-tiles) .metric-card { min-height: 100px; padding: 14px; }
.mgmt-tiles:not(.mp-tiles) .metric-card > strong { margin: 8px 0 3px; font-size: 1.2rem; }
/* Плитка с окном-расшифровкой: окно выходит за плитку, поэтому плитка его не обрезает,
   а цветную полосу сверху обрезает своя подложка со скруглением плитки. */
.metric-card.has-tip { overflow: visible; cursor: help; }
.metric-card.has-tip:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }
.metric-card.has-tip::after { content: "i"; position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--ink-muted); font: italic 700 10px/14px Georgia, serif; text-align: center; }
.metric-clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.tile-tip { display: none; position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: max(100%, 440px); max-width: calc(100vw - 32px); box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); box-shadow: 0 14px 34px -10px rgba(20, 21, 26, 0.35); font-size: 12px; line-height: 1.4; pointer-events: none; }
/* Мышь — наведением, клавиатура — Tab; щелчок мышью окно не закрепляет. На телефоне наведения нет — открывает касание (фокус). */
.metric-card.has-tip:hover .tile-tip, .metric-card.has-tip:focus-visible .tile-tip { display: block; }
@media (hover: none) { .metric-card.has-tip:focus .tile-tip { display: block; } }
/* Закрыто Escape — и под курсором; правило ниже прежних, чтобы перебить :hover. */
.metric-card.has-tip.tip-closed .tile-tip { display: none; }
.tile-tip p { margin: 0; }
.tile-tip .tile-tip-title { margin-bottom: 8px; font-weight: 750; font-size: 12.5px; }
.tile-tip table { width: 100%; border-collapse: collapse; }
.tile-tip th, .tile-tip td { padding: 3px 0; font-weight: 500; vertical-align: top; }
.tile-tip th { text-align: left; padding-right: 10px; }
.tile-tip td { width: 1%; padding-left: 14px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-tip thead td { color: var(--ink-muted); font-size: 11px; }
.tile-tip .tip-total th, .tile-tip .tip-total td { border-top: 1px solid var(--border-strong); padding-top: 5px; font-weight: 750; }
.tile-tip .tip-sub th, .tile-tip .tip-sub td { color: var(--ink-muted); }
.tile-tip .tip-sub th { padding-left: 12px; }
.tile-tip .tip-loans th, .tile-tip .tip-loans td { border-top: 1px solid var(--border); padding-top: 5px; color: var(--danger); }
.tile-tip .tip-loans.tip-total th, .tile-tip .tip-loans.tip-total td { border-top-color: var(--border-strong); }
.tile-tip .tile-tip-note { margin-top: 8px; color: var(--ink-muted); font-size: 11px; }
.abc-badge { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; font-weight: 800; text-align: center; }
.abc-badge.abc-a { color: var(--success); background: var(--success-soft); }
.abc-badge.abc-b { color: var(--blue-ink); background: var(--blue-soft); }
.abc-badge.abc-c { color: var(--accent-soft-ink); background: var(--accent-soft); }
.abc-grid .abc-cell { text-align: center; }
/* «Эффективность артикулов» (13.10.2026): место, артикул с названием, главный столбец, места по месяцам. */
.ae-grid .ae-offer { min-width: 180px; }
.ae-grid thead th { max-width: 112px; white-space: normal; vertical-align: bottom; }
.ae-grid .ae-offer small { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 11px; font-weight: 500; }
.ae-grid .ae-offer small.ae-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ae-grid .ae-offer small.ae-shops { font-weight: 700; }
.ae-grid th.ae-main, .ae-grid td.ae-main { font-weight: 800; }
/* Заголовки-переключатели сортировки (14.10.2026): кнопка без рамки, выбранный — цветом текста и стрелкой. */
.ae-grid th .ae-sort { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
/* Красный минус вне столбца сортировки — без жирного: жирный — только у столбца рейтинга. */
.ae-grid td.delta-bad:not(.ae-main) { font-weight: inherit; }
.ae-grid th .ae-sort:hover, .ae-grid th .ae-sort:focus-visible { color: var(--ink); text-decoration: underline; }
.ae-grid thead th.ae-main { color: var(--ink); }
.ae-grid .ae-rank-cell { text-align: center; }
.ae-rank { display: inline-block; min-width: 24px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-weight: 800; text-align: center; }
.ae-grid tbody tr:nth-child(-n+3) .ae-rank-cell .ae-rank, .ae-history .ae-rank-top { color: var(--success); background: var(--success-soft); }
.ae-grid .ae-prev small { margin-left: 4px; font-size: 11px; }
.ae-grid .ae-new { color: var(--blue-ink); font-weight: 700; text-align: center; }
.ae-grid tfoot th { text-align: left; }
.ae-history td { text-align: center; }
.ae-history th.ae-month-note { color: var(--accent-soft-ink); cursor: help; }
.ae-history td small { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 11px; }
.ae-notes { display: grid; gap: 4px; margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; }
.ae-tiles .metric-card { min-height: 100px; }
.ae-tiles .metric-card > strong { font-size: 1.3rem; }
@media (max-width: 1180px) { .ae-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .ae-tiles { grid-template-columns: 1fr; } }
.abc-shop { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.plan-input { width: 120px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; padding: 4px 6px; text-align: right; }
.plan-input:focus { outline: 2px solid var(--blue-ink); outline-offset: 0; }
/* График «этот месяц против прошлого»: цвета прогнаны валидатором палитры (светлая и тёмная темы). */
.mgmt-chart { --chart-cur: #2a78d6; --chart-prev: #dc5a2a; }
.sales-chart { display: block; width: 100%; height: auto; max-height: 280px; }
.sales-chart .chart-grid { stroke: var(--border); stroke-width: 1; }
.sales-chart .chart-axis { fill: var(--ink-muted); font-size: 11px; }
.sales-chart .chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sales-chart .chart-cur { stroke: var(--chart-cur); }
.sales-chart .chart-prev { stroke: var(--chart-prev); stroke-dasharray: 5 4; }
.sales-chart .chart-end { fill: var(--ink); font-size: 11.5px; font-weight: 700; }
.sales-chart .chart-hit { fill: transparent; }
.sales-chart .chart-hit:hover { fill: var(--surface-hover); fill-opacity: .55; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-muted); }
.chart-legend i { display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid; }
.chart-legend .lg-cur { border-color: var(--chart-cur); }
.chart-legend .lg-prev { border-color: var(--chart-prev); border-top-style: dashed; }

/* Диаграммы отчётов маркетинга (08.10.2026). Синий и оранжевый — только
   магазины (ЛАСТОЧКА, ЛАСТОЧКА58), та же пара, что у графика Панели
   руководителя. Ряды-не-магазины — бирюзовый и цвет текста, чтобы на одном
   экране синий не значил то магазин, то «ставку». Все три оттенка вместе
   прогнаны валидатором палитры (все пары, светлая и тёмная темы). «Всего» —
   цветом текста, прошлый период — серым с контрастом не ниже 3:1. Цвет несёт
   только метка; подписи и числа — цветом текста. */
.mk-chart { --mk-a: #2a78d6; --mk-b: #dc5a2a; --mk-c: #1baf7a; --mk-m: #0f9b8e; --mk-total: var(--ink); --mk-prev: #8a8f9b; }
.mk-chart .s-a, .mk-legend .s-a { --s: var(--mk-a); }
.mk-chart .s-b, .mk-legend .s-b { --s: var(--mk-b); }
.mk-chart .s-c, .mk-legend .s-c { --s: var(--mk-c); }
.mk-chart .s-m, .mk-legend .s-m { --s: var(--mk-m); }
.mk-chart .s-total, .mk-legend .s-total, .mk-chart .s-ink, .mk-legend .s-ink { --s: var(--mk-total); }
.mk-chart .s-prev, .mk-legend .s-prev { --s: var(--mk-prev); }
.view-switch { display: inline-flex; gap: 6px; flex: none; }
.panel-heading:has(.view-switch) { flex-wrap: wrap; }
.mk-head-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.mk-subhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0 8px; }
.mk-subhead h4 { margin: 0; }
.mk-controls { margin: 0 0 12px; }
.mk-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 6px; }
.mk-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.mk-legend .mk-key { display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid var(--s); }
.mk-legend .mk-key.bar { width: 10px; height: 10px; border: 0; border-radius: 2px; background: var(--s); }
.mk-chart svg { display: block; width: 100%; height: auto; max-height: 320px; overflow: visible; }
.mk-chart .mk-grid { stroke: var(--border); stroke-width: 1; }
.mk-chart .mk-zero { stroke: var(--border-strong); stroke-width: 1; }
.mk-chart .mk-ref { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 4 4; }
.mk-chart .mk-axis { fill: var(--ink-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mk-chart .mk-end, .mk-chart .mk-cap { fill: var(--ink); font-size: 11.5px; font-weight: 700; }
.mk-chart .mk-cap { font-size: 11px; }
.mk-chart .mk-line { fill: none; stroke: var(--s); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mk-chart .mk-dot { fill: var(--s); stroke: var(--surface); stroke-width: 2; }
.mk-chart .mk-bar { fill: var(--s); }
.mk-chart .mk-hit { fill: transparent; }
.mk-chart .oc-band:hover rect.mk-hit { fill: var(--surface-hover); fill-opacity: .55; }
.mk-chart .mk-cross { stroke: transparent; stroke-width: 1; }
.mk-chart .oc-band:hover .mk-cross { stroke: var(--ink-faint); }
.mk-chart .mk-zone-a { fill: var(--success-soft); }
.mk-chart .mk-zone-b { fill: var(--blue-soft); }
.mk-chart .mk-zone-c { fill: var(--accent-soft); }
.mk-chart .mk-zone-label { fill: var(--ink-muted); font-size: 11px; font-weight: 700; }
.mk-empty { padding: 18px 0; }
/* Полосы по строкам: подпись слева, полоса и число у её конца справа. */
/* --mk-reserve — место справа под число у конца полосы; с пометкой магазина — шире. */
.mk-hbars { display: grid; gap: 2px; --mk-reserve: 96px; }
.mk-hbars.with-note { --mk-reserve: 200px; }
.mk-hnote::before { content: " · "; }
.mk-hrow { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr); align-items: center; gap: 12px; padding: 4px 6px; border-radius: 6px; }
.mk-hrow:hover { background: var(--surface-hover); }
.mk-hlabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink); text-align: left; }
/* Название-кнопка — цветом текста, а не цветом ссылки: оранжевая ссылка читалась
   бы как ряд «ЛАСТОЧКА58». Что нажимается — показывает подчёркивание. */
button.mk-hlabel { justify-self: start; max-width: 100%; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
button.mk-hlabel:hover { text-decoration-color: var(--ink); }
.mk-htrack { display: grid; gap: 2px; min-width: 0; }
.mk-hline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mk-hbar { flex: none; height: 12px; min-width: 1px; border-radius: 0 4px 4px 0; background: var(--s); }
.mk-hval { flex: none; font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .mk-hrow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  /* Телефон: имя магазина — второй строкой под числом, полосе остаётся прежнее место. */
  .mk-hbars.with-note { --mk-reserve: 96px; }
  .mk-hnote { display: block; }
  .mk-hnote::before { content: none; }
}
.top-models { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.top-models li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; }
.top-models small { grid-column: 1 / -1; color: var(--ink-muted); font-size: 11.5px; }
@media (max-width: 1180px) { .abc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .abc-summary { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .mgmt-tiles:not(.mp-tiles) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .mgmt-tiles:not(.mp-tiles) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .mgmt-tiles:not(.mp-tiles) { grid-template-columns: 1fr; } }
/* Окно-расшифровка плитки (.tile-tip) шире самой плитки. Плитка с окном — «Фактические расходы МП», шестая:
   при 5 колонках она слева, и окно открывается вправо; с 3 колонок и уже она справа — окно у её правого края. */
.mgmt-tiles:not(.mp-tiles) .tile-tip { left: 0; right: auto; }
@media (max-width: 1100px) { .mgmt-tiles:not(.mp-tiles) .tile-tip { left: auto; right: 0; } }
/* «Панель менеджера» — шесть плиток (06.10.2026): по три в ряд, без пустого места во втором. */
.mgmt-tiles.mp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .mgmt-tiles.mp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .mgmt-tiles.mp-tiles { grid-template-columns: 1fr; } }
/* «Ежедневный отчёт по продажам» и «Реклама и продвижение» (08.10.2026): блоки
   групп — своим цветом шапки, как в таблице менеджера; недели и месяцы выделены. */
.ds-grid .ds-start { border-left: 2px solid var(--border-strong); }
.ds-grid thead th.ds-b-total { background: var(--accent-soft); color: var(--accent-soft-ink); }
.ds-grid thead th.ds-b-tables { background: var(--success-soft); color: var(--success); }
.ds-grid thead th.ds-b-chairs { background: var(--blue-soft); color: var(--blue-ink); }
.ds-grid thead th.ds-b-kitchens { background: var(--violet-soft); color: var(--violet-ink); }
.ds-grid thead th.ds-b-cabinet { background: var(--steel-soft); color: var(--steel-ink); }
.ds-grid thead th.ds-b-countertops { background: var(--rose-soft); color: var(--rose-ink); }
.ds-grid thead th.ds-b-other { background: var(--surface-hover); color: var(--ink); }
.ds-grid thead th.ds-metric { white-space: normal; min-width: 92px; max-width: 120px; font-weight: 700; line-height: 1.25; }
.ds-grid .ds-month > th, .ds-grid .ds-month > td { background: var(--surface-2); font-weight: 800; }
.ds-grid .ds-week > th, .ds-grid .ds-week > td { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 800; }
.ds-grid .ds-sep > td { padding: 3px; background: var(--border); border-color: var(--border); }
.ds-grid .ds-missing > th, .ds-grid .ds-missing > td { color: var(--ink-faint); }
.ds-grid .ds-flag { margin-left: 6px; color: var(--danger); cursor: help; font-weight: 800; }
.ds-grid .ds-drr { font-weight: 700; }
.ds-grid .ds-sum { font-weight: 800; }

/* Рекламные кампании и Соинвест (08.10.2026) */
.link-button { border: 0; padding: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 700; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: var(--ink); }
.adc-grid tr.adc-selected > th, .adc-grid tr.adc-selected > td { background: var(--accent-soft); }
.adc-grid tr.muted-row > td { color: var(--ink-muted); }
.adc-grid td.adc-rules { white-space: normal; min-width: 160px; }
.adc-bid-form { display: inline-flex; gap: 6px; align-items: center; }
.adc-bid-form input { width: 80px; }
.adc-confirm { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); display: grid; gap: 8px; white-space: normal; max-width: 420px; }
.adc-confirm input { width: 90px; margin-left: 6px; }
.adc-confirm .primary-button, .adc-confirm .secondary-button { justify-self: start; }
.adc-schedule-form { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin: 8px 0; }
.adc-schedule-form fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.adc-schedule-form legend { font-size: 12px; color: var(--ink-muted); margin-bottom: 4px; }
.adc-schedule-form label { display: grid; gap: 4px; font-size: 13px; }
.adc-schedule-form .adc-day { display: inline-flex; gap: 4px; align-items: center; }
.adc-schedule-form input[name="on"], .adc-schedule-form input[name="off"] { width: 72px; }
.adc-rule-list { margin: 6px 0 10px; padding-left: 18px; display: grid; gap: 4px; }
.adc-rule-list .link-button { margin-left: 10px; font-size: 13px; }
/* График по дням недели (09.10.2026): галочки дней, столбец «сегодня», правки до сохранения. */
.adc-week-grid th, .adc-week-grid td { vertical-align: top; }
.adc-week-grid .adc-week-day { text-align: center; width: 44px; }
.adc-week-grid .adc-week-day input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.adc-week-grid .adc-week-day input:disabled { cursor: default; }
.adc-week-grid .adc-today { background: var(--accent-soft); }
.adc-week-grid .ds-flag { margin-left: 6px; color: var(--danger); cursor: help; font-weight: 800; }
.adc-week-grid tr.adc-week-changed > th, .adc-week-grid tr.adc-week-changed > td:not(.adc-today) { background: var(--surface-2); }
.adc-week-grid tr.adc-week-removed > th > .link-button { text-decoration: line-through; }
.adc-week-notes { display: grid; gap: 2px; margin-top: 4px; font-size: 12px; font-weight: 400; white-space: normal; max-width: 360px; }
.adc-week-pick { display: grid; gap: 8px; margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); max-width: 560px; }
.adc-week-pick .offer-search { width: 100%; box-sizing: border-box; padding: 8px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.adc-week-pick .offer-found { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.adc-week-pick-list { display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.adc-week-pick .cat-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink); cursor: pointer; }
.adc-week-pick .cat-item:hover { background: var(--surface); }
.adc-week-pick .cat-item span { flex: 1; overflow-wrap: anywhere; }
.adc-week-pick .cat-item small { color: var(--ink-muted); white-space: nowrap; }
.adc-week-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
.adc-week-bar .note-warn { flex-basis: 100%; margin: 0; }
.adc-week-confirm { max-width: 560px; }
.panel-notes .notes-list li > .secondary-button { margin-left: 8px; }
.run-filter.run-check { display: inline-flex; gap: 6px; align-items: center; align-self: end; }
.ci-grid td.ci-ordered { background: var(--success-soft); font-weight: 700; }
.ci-grid td { cursor: default; }
