/* BHS OMS — дизайн-система: токены, база и классы UI-кита (frontend/src/ui).
   Значения — из макета редизайна (docs/specs/redesign.md § 3.1). Частное,
   нужное одному модулю, живёт в frontend/src/modules/<key>/module.css —
   здесь только общее. */

@import url("https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&family=Onest:wght@600;700&display=swap");

:root {
  /* поверхности и текст */
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --panel: #011205;          /* боковая панель и тёмные плашки */
  --ink: #1D1D1D;
  --ink-soft: #545454;
  --line: #E8E8E8;           /* обводка карточки */
  --line-2: #E2E2E2;         /* обводка кнопки-значка, поля-мини */
  --line-3: #C3C3C3;         /* обводка поля и белой кнопки */
  --fill: #EFEFEF;           /* серая подложка (сегменты, бейджи, нейтральный чип) */
  --fill-soft: #FAFAFA;      /* шапка таблицы и наведение строки */
  --tile: #F7F7F7;           /* плитка внутри карточки */
  --line-row: #F0F0F0;       /* разделитель строк и дорожка прогресса */

  /* основной цвет */
  --primary: #FA7315;
  --primary-hover: #DA630F;
  --primary-active: #B85008;
  --primary-tint: rgba(250,115,21,0.08);
  --primary-tint-2: rgba(250,115,21,0.14);
  --primary-tint-3: rgba(250,115,21,0.22);
  --primary-ring: rgba(250,115,21,0.15);
  --primary-soft: #FFF4EC;
  --primary-light: #FFA567;  /* счётчик-тревога на тёмном */

  /* семантика: цвет, тинт, обводка */
  --success: #1A7F37;  --success-tint: rgba(26,127,55,0.08);  --success-line: rgba(26,127,55,0.3);
  --warn: #B45309;     --warn-tint: rgba(180,83,9,0.08);      --warn-line: rgba(180,83,9,0.3);
  --danger: #C62828;   --danger-tint: rgba(198,40,40,0.08);   --danger-line: rgba(198,40,40,0.3);
  --info: #1E5EFF;     --info-tint: rgba(30,94,255,0.08);     --info-line: rgba(30,94,255,0.3);
  --neutral: #6B7280;  --neutral-tint: rgba(107,114,128,0.08); --neutral-line: rgba(107,114,128,0.3);

  --font: "Golos Text", system-ui, sans-serif;
  --font-num: "Onest", "Golos Text", system-ui, sans-serif;   /* логотип, суммы, счётчики */

  --r-6: 6px;    /* чипы, поля-мини */
  --r-8: 8px;    /* кнопки, поля, пункты меню */
  --r-10: 10px;  /* карточки */
  --r-12: 12px;  /* крупные карточки, поповеры */
  --r-14: 14px;  /* модалка поиска */
  --r-pill: 999px;

  --shadow-pop: 0 12px 32px rgba(0,0,0,0.12);
  --shadow-modal: 0 24px 60px rgba(0,0,0,0.25);

  --h-btn: 36px;
  --h-btn-sm: 32px;
  --h-btn-xs: 28px;
  --h-field: 36px;
  --h-head: 56px;
  --h-nav: 36px;
  --h-row: 52px;
  --h-row-compact: 40px;
  --h-tab: 38px;

  --sidebar-w: 236px;
  --sidebar-w-min: 64px;

  /* ── Псевдонимы прежних имён: на них ещё стоят экраны до переезда на кит ── */
  --orange-300: var(--primary-light);
  --orange-400: #FE8933;
  --orange-500: var(--primary);
  --orange-700: var(--primary-hover);
  --orange-800: var(--primary-active);
  --green-500: var(--success);
  --green-600: #025F45;
  --green-700: #025139;
  --green-900: #023925;
  --green-950: var(--panel);
  --blue-600: var(--info);
  --red-500: var(--danger);
  --ink-900: #000000;
  --ink-600: var(--ink);
  --ink-500: #323232;
  --ink-400: var(--ink-soft);
  --white: #FFFFFF;
  --grey-075: var(--bg);
  --grey-100: var(--fill);
  --grey-150: var(--line);
  --grey-200: var(--line-2);
  --grey-300: #D9D9D9;
  --grey-450: var(--line-3);
  --font-display: var(--font-num);
  --font-body: var(--font);
  --radius-xs: 4px;
  --radius-sm: var(--r-8);
  --radius-md: var(--r-10);
  --radius-pill: var(--r-pill);
  --tracking-display: -0.03em;
  --tracking-default: -0.01em;
  --tracking-eyebrow: 0.08em;
}

/* ───────────────────────────── база ───────────────────────────── */

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: -0.01em;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

a { color: var(--primary-hover); text-decoration: none; }
a:hover { color: var(--primary-active); }

input, select, textarea, button { font-family: inherit; letter-spacing: inherit; }

input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; margin: 0; }
input[type=radio] { accent-color: var(--primary); cursor: pointer; margin: 0; }

/* Видимый фокус только с клавиатуры: мышью кольцо вокруг кнопок мешает */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D9D9D9; border-radius: 8px; }

@keyframes bhs-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes bhs-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Цифры — дисплейным шрифтом с табличными знаками: суммы в колонке ровные */
.num { font-family: var(--font-num); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-end { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.spacer { margin-left: auto; }
.divider { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.section-gap { margin-top: 16px; }

/* ──────────────────────────── каркас ──────────────────────────── */

.shell { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--panel); color: #fff;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 16px 12px 14px; transition: width 0.2s ease; overflow: hidden;
}
.sidebar.mini { width: var(--sidebar-w-min); }

.sb-top { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; justify-content: space-between; }
/* В свёрнутой панели логотип и кнопка не помещаются в строку — ставим столбиком */
.sidebar.mini .sb-top { flex-direction: column; gap: 8px; padding: 2px 0 14px; }
.sb-brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.sb-brand:hover { color: #fff; }
.sb-brand img { width: 28px; height: 28px; flex-shrink: 0; }
.sb-brand > div { min-width: 0; }
.sb-name { font-family: var(--font-num); font-weight: 700; font-size: 14px; line-height: 1; letter-spacing: -0.04em; white-space: nowrap; }
.sb-sub { margin-top: 3px; font-size: 11px; line-height: 1; color: rgba(255,255,255,0.5); white-space: nowrap; }
.sb-icon {
  width: 28px; height: 28px; border: 0; border-radius: var(--r-6); background: transparent;
  color: rgba(255,255,255,0.55); cursor: pointer; display: grid; place-items: center; flex-shrink: 0;
}
.sb-icon:hover { background: rgba(255,255,255,0.08); color: #fff; }

.sb-nav { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.sb-group-label {
  padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.4); white-space: nowrap;
}
.sb-group-sep { height: 1px; margin: 0 10px 8px; background: rgba(255,255,255,0.1); }
.sb-items { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 10px; height: var(--h-nav); padding: 0 10px;
  border-radius: var(--r-8); color: rgba(255,255,255,0.78); font-size: 13px; font-weight: 500;
  white-space: nowrap; position: relative; text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--primary-tint-3); color: #fff; font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-count { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.5); font-variant-numeric: tabular-nums; }
.nav-count.alert { color: var(--primary-light); }
.nav-dot { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

.sb-user {
  margin-top: 12px; padding: 10px; border-radius: var(--r-10);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px; position: relative;
}
.sb-user-main { min-width: 0; flex: 1; }
.sb-user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 11px; color: rgba(255,255,255,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.hdr {
  height: var(--h-head); flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 40;
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); min-width: 0; }
.crumbs span { white-space: nowrap; }
.crumb-sep { color: var(--line-3); }
.crumb-page { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.hdr-search {
  display: flex; align-items: center; gap: 10px; height: var(--h-btn); width: min(360px, 34vw);
  padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-8);
  background: var(--bg); color: var(--ink-soft); font-size: 13px; cursor: text; text-align: left;
}
.hdr-search:hover { border-color: var(--line-3); background: #fff; }
.hdr-search span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kbd {
  font-size: 11px; font-weight: 600; color: var(--ink-soft); padding: 2px 6px;
  border-radius: 5px; border: 1px solid var(--line-2); background: #fff; white-space: nowrap;
}
.hdr-bell {
  position: relative; width: var(--h-btn); height: var(--h-btn); border: 1px solid var(--line-2);
  border-radius: var(--r-8); background: #fff; color: var(--ink); cursor: pointer; display: grid; place-items: center;
}
.hdr-bell:hover { background: var(--bg); }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}

.content { flex: 1; min-height: 0; padding: 22px 28px 40px; }

/* Сигналы: поповер колокольчика */
.sig-pop {
  position: absolute; top: 60px; right: 24px; width: 380px; background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r-12); box-shadow: var(--shadow-pop);
  z-index: 50; animation: bhs-fade 0.15s ease; overflow: hidden;
}
.sig-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--fill); font-size: 13px; font-weight: 600; }
.sig-head em { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.sig-list { max-height: 360px; overflow: auto; }
.sig-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--bg); color: var(--ink); text-decoration: none; }
.sig-item:hover { background: #FAFAFA; color: var(--ink); }
.sig-dot { margin-top: 5px; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--neutral); }
.sig-dot.warn { background: var(--warn); }
.sig-dot.danger { background: var(--danger); }
.sig-dot.info { background: var(--info); }
.sig-main { flex: 1; min-width: 0; }
.sig-title { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.sig-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-soft); }
.sig-when { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.sig-empty { padding: 18px 16px; font-size: 13px; color: var(--ink-soft); }

/* Поиск ⌘K */
.sk-back { position: fixed; inset: 0; background: rgba(1,18,5,0.45); z-index: 100; display: flex; justify-content: center; padding: 12vh 16px 16px; }
.sk-box {
  width: 640px; max-width: 100%; align-self: flex-start; background: #fff; border-radius: var(--r-14);
  box-shadow: var(--shadow-modal); overflow: hidden; animation: bhs-fade 0.15s ease; display: flex; flex-direction: column;
}
.sk-field { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--fill); color: var(--ink-soft); }
.sk-input { flex: 1; border: 0; outline: none; font-size: 16px; color: var(--ink); background: none; }
.sk-body { padding: 8px; max-height: 56vh; overflow: auto; }
.sk-label { padding: 6px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.sk-label + .sk-label, .sk-item + .sk-label { margin-top: 4px; }
.sk-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-8); color: var(--ink); text-decoration: none; width: 100%; border: 0; background: none; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.sk-item:hover { background: var(--bg); color: var(--ink); }
.sk-item.on { background: var(--primary-soft); }
.sk-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-title { font-weight: 600; }
.sk-sub { color: var(--ink-soft); }
.sk-meta { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.sk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--fill); font-size: 11px; color: var(--ink-soft); flex-wrap: wrap; }
.sk-empty { padding: 22px 18px; font-size: 13px; color: var(--ink-soft); }

/* Заголовок экрана */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.page-back:hover { color: var(--ink); }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.page-title.lg { font-size: 24px; }
.page-meta { margin-top: 5px; font-size: 12px; color: var(--ink-soft); }
.page-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ──────────────────────────── кнопки ──────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h-btn); padding: 0 14px; border: 1px solid var(--line-3); border-radius: var(--r-8);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; border-color: var(--line-3); }

.btn-primary { padding: 0 16px; background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.btn-primary:disabled:hover { background: var(--primary); border-color: var(--primary); }

/* tone="success" — зелёная кнопка действия (написать в WhatsApp) */
.btn-primary.btn-success { background: var(--success); border-color: var(--success); }
.btn-primary.btn-success:hover { background: #166A2E; border-color: #166A2E; }
.btn-primary.btn-success:active { background: #124F23; border-color: #124F23; }

.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--fill); border-color: transparent; color: var(--ink); }

.btn-danger { color: var(--danger); border-color: var(--danger-line); background: #fff; }
.btn-danger:hover { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }

.btn-icon { width: var(--h-btn); padding: 0; border-color: var(--line-2); }
.btn-icon:hover { border-color: var(--ink); }

.btn-sm { height: var(--h-btn-sm); padding: 0 12px; font-size: 12px; }
.btn-xs { height: var(--h-btn-xs); padding: 0 10px; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14px; }
.btn-icon.btn-sm { width: var(--h-btn-sm); padding: 0; }
.btn-icon.btn-xs { width: var(--h-btn-xs); padding: 0; }
.btn-icon.btn-lg { width: 44px; padding: 0; }
.btn-block { width: 100%; }

/* ───────────────────── чипы, вкладки, сегменты ───────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: var(--r-6); font-size: 12px; font-weight: 600; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  background: var(--fill); color: var(--ink-soft); border: 1px solid transparent;
}
.chip-sm { height: 20px; padding: 0 7px; font-size: 11px; border-radius: 5px; }
.chip-lg { height: 24px; padding: 0 9px; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.chip-success { background: rgba(26,127,55,0.1); color: var(--success); }
.chip-warn { background: rgba(180,83,9,0.1); color: var(--warn); }
.chip-danger { background: rgba(198,40,40,0.1); color: var(--danger); }
.chip-info { background: rgba(30,94,255,0.1); color: var(--info); }
.chip-neutral { background: var(--fill); color: var(--ink-soft); }
.chip-orange { background: var(--primary-tint-2); color: var(--primary-hover); }
.chip-dark { background: var(--ink); color: #fff; }
.chip-line { border-color: currentColor; }

.tabs { display: flex; align-items: stretch; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: var(--h-tab); padding: 0 14px;
  margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--primary); }
.tab-count { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-6); background: var(--fill); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tab.on { color: var(--ink); border-bottom-color: var(--primary); }
.tab.on .tab-count { background: var(--primary-tint-2); color: var(--primary-hover); }

.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--fill); }
.segmented.block { display: flex; width: 100%; }
.segmented.block > .seg-btn { flex: 1; justify-content: center; }
.segmented > .seg-btn, .segmented > a {
  height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent;
  color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none;
}
.segmented > .seg-btn:hover, .segmented > a:hover { color: var(--ink); }
.segmented > .seg-btn.on, .segmented > a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* ──────────────────── фильтры и строка отбора ──────────────────── */

.fbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fbtn {
  display: inline-flex; align-items: center; gap: 6px; height: var(--h-btn); padding: 0 10px 0 12px;
  border: 1px solid var(--line-3); border-radius: var(--r-8); background: #fff; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.fbtn:hover { border-color: var(--ink); }
.fbtn.on:hover { border-color: var(--primary-hover); }
.fbtn.on { border-color: var(--primary); background: var(--primary-tint); color: var(--primary-active); font-weight: 600; }
.fbtn svg { color: var(--ink-soft); flex-shrink: 0; }
.fbtn.on svg { color: var(--primary-hover); }
.fbtn-val { font-weight: 600; }

.fsearch { position: relative; flex: 1 1 240px; min-width: 200px; max-width: 360px; }
.fsearch > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.fsearch input { width: 100%; height: var(--h-field); padding: 0 32px 0 36px; border: 1px solid var(--line-3); border-radius: var(--r-8); background: #fff; font: inherit; font-size: 13px; color: var(--ink); }
.fsearch input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.fsearch-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: var(--r-6); background: none; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; }
.fsearch-clear:hover { background: var(--fill); color: var(--ink); }
.fbar-summary { margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.fchip { height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.fchip:hover { border-color: var(--ink); }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip-count { opacity: 0.7; }
.btn-dashed { border-style: dashed; border-color: var(--line-3); color: var(--ink-soft); background: #fff; font-weight: 600; }
.btn-dashed:hover { border-color: var(--primary); color: var(--primary-hover); }

.toggle { width: 30px; height: 18px; border-radius: var(--r-pill); background: var(--line-3); border: 0; padding: 0; cursor: pointer; position: relative; flex-shrink: 0; transition: background 0.15s ease; }
.toggle.on { background: var(--primary); }
.toggle i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.15s ease; }
.toggle.on i { left: 14px; }
.toggle-box { display: inline-flex; align-items: center; gap: 8px; height: var(--h-btn); padding: 0 12px; border: 1px solid var(--line-3); border-radius: var(--r-8); background: #fff; font-size: 13px; cursor: pointer; white-space: nowrap; }
.toggle-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.check-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-soft); }

/* ──────────────────────────── таблица ──────────────────────────── */

.dt { display: flex; flex-direction: column; min-height: 0; }
.dt-row, .dt-head-row { display: grid; grid-template-columns: var(--dt-cols); gap: 10px; align-items: center; padding: 0 16px; min-width: var(--dt-min, auto); }
.dt-head {
  position: sticky; top: var(--h-head); z-index: 5; height: 40px; background: var(--fill-soft);
  border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-soft);
  /* overflow-x:auto СДЕЛАЛ БЫ этот узел контейнером прокрутки, и sticky вместо
     «липнуть к шапке каркаса при скролле страницы» просто сдвинулся бы вниз
     на свой top ОДНОКРАТНО — дальше не следит за страницей и закрывает первую
     строку. Поэтому шапка не скроллится сама, а догоняет .dt-body по scrollLeft:
     сама .dt-head держит ширину контейнера (0 своей ширины сверх этого), а
     широкая сетка — во вложенном .dt-head-row, иначе min-width растянул бы
     и рамку тоже, и обрезать снаружи было бы уже нечего. */
  overflow-x: hidden;
}
.dt-head-row { height: 100%; }
.dt-head-row > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-scroll .dt-head { top: 0; }
.dt-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.dt-body { overflow-x: auto; }
.dt-sort {
  display: inline-flex; align-items: center; gap: 4px; border: 0; padding: 0; background: none;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.dt-sort:hover, .dt-sort.on { color: var(--ink); }
.dt-sort.on svg { color: var(--primary); }
.dt-row { min-height: var(--h-row); border-bottom: 1px solid var(--line-row); font-size: 13px; color: var(--ink); background: #fff; }
.dt.compact .dt-row { min-height: var(--h-row-compact); }
.dt-row:last-child { border-bottom: 0; }
.dt-row.click { cursor: pointer; }
.dt-row:hover { background: var(--fill-soft); }
.dt-row.on { background: var(--primary-soft); }
.dt-row.warn { background: var(--warn-tint); }
.dt-row.danger { background: var(--danger-tint); }
.dt-row.off { color: var(--ink-soft); }
.dt-right { text-align: right; justify-self: end; }
.dt-check { display: flex; align-items: center; }
.dt-cell { min-width: 0; }
.dt-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dt-main.plain { font-weight: 400; }
.dt-main { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-sub { margin-top: 1px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-money { font-family: var(--font-num); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dt-money.success { color: var(--success); }
.dt-money.warn { color: var(--warn); }
.dt-money.danger { color: var(--danger); font-weight: 700; }
.dt-money.zero { color: var(--ink-soft); font-weight: 600; }
.dt-more { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--primary-hover); cursor: pointer; }

.bulkbar {
  position: sticky; bottom: 16px; margin-top: 16px; z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px;
  border-radius: var(--r-12); background: var(--panel); color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25); animation: bhs-fade 0.15s ease; flex-wrap: wrap;
}
.bulkbar-count { font-size: 13px; font-weight: 600; white-space: nowrap; }
.bulkbar .btn { height: var(--h-btn-sm); padding: 0 12px; font-size: 12px; background: transparent; border-color: rgba(255,255,255,0.25); color: #fff; }
.bulkbar .btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); color: #fff; }
.bulkbar-clear { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: rgba(255,255,255,0.65); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.bulkbar-clear:hover { color: #fff; }

.table-foot .select { width: auto; }
.table-foot { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.page-btn {
  height: var(--h-btn-xs); min-width: var(--h-btn-xs); padding: 0 8px; border: 1px solid var(--line-2);
  border-radius: var(--r-6); background: #fff; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer;
}
.page-btn:hover { border-color: var(--line-3); color: var(--ink); }
.page-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ───────────────── карточки, плитки, баннеры, пустое ───────────────── */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-10); }
.card-lg { border-radius: var(--r-12); }
.card + .card, .stack > * + * { margin-top: 14px; }
.card-clip {
  /* clip, а не hidden: hidden делает карточку контейнером прокрутки, и липкая
     шапка таблицы внутри считает top от карточки, а не от страницы — съезжает
     на 56px и накрывает первую строку. clip так же обрезает по радиусу, но
     контейнером прокрутки не становится. */
  overflow: clip;
}
.card-pad { padding: 16px 18px; }
.card-pad-lg { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.card-note { margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.card-pad > .card-title:first-child { margin-bottom: 10px; }
.card-head-plain { margin-bottom: 10px; }
/* CardHead sub — вторая строка под заголовком; flex-basis:100% в ряду .row
   (card-head-plain) или .card-head переносит её на свою строку */
.card-sub { flex: 1 0 100%; margin-top: 2px; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.card-empty { padding: 20px 18px; font-size: 13px; color: var(--ink-soft); }
.card-col { display: flex; flex-direction: column; }
/* Значки-кнопки в строках (Banner, Drawer): цель не меньше 24px (HIG) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px;
  padding: 4px 6px; border: 0; border-radius: var(--r-6); background: transparent;
  color: var(--ink-soft); cursor: pointer; font: inherit;
}
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-tint); color: var(--danger); }
/* Экран целиком не загрузился (бэкенд не ответил) — до роли и каркаса */
.app-fail { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.app-fail-box { max-width: 420px; }
.app-fail-box .muted { margin: 8px 0 14px; font-size: 12px; }
.form-error { font-size: 12px; color: var(--danger); }
/* Вторая строка мелким серым вне таблицы (например, под номером телефона) */
.row-sub { margin-top: 3px; font-size: 10px; line-height: 1.25; color: var(--ink-soft); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 12px; }
.kpi { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 118px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-10); padding: 16px 18px; text-align: left; color: inherit; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.kpi-value { margin-top: 8px; display: flex; align-items: baseline; gap: 8px; font-family: var(--font-num); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value.good { color: var(--success); }
.kpi-value.bad { color: var(--danger); }
.kpi-value.warn { color: var(--warn); }
.kpi-value.primary { color: var(--primary); }
.kpi-note { margin-top: 6px; font-size: 11px; line-height: 1.35; color: var(--ink-soft); }
.kpi-unit { font-family: var(--font); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-soft); }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 5px; background: var(--fill); font-size: 11px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.kpi-delta.up { background: rgba(26,127,55,0.1); color: var(--success); }
.kpi-delta.down { background: rgba(198,40,40,0.1); color: var(--danger); }
.kpi-bar { margin-top: 14px; }
a.kpi:hover, .kpi-link:hover { border-color: var(--line-3); color: inherit; }
.kpi-grid > .card { margin-top: 0; }
.kpi-link {
  display: block; width: 100%; text-align: left; font: inherit; letter-spacing: inherit;
  color: inherit; text-decoration: none; border: 1px solid var(--line); cursor: pointer;
}

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-10); font-size: 13px; line-height: 1.4; border: 1px solid var(--info-line); background: var(--info-tint); color: var(--ink); }
.banner svg { flex-shrink: 0; margin-top: 1px; color: var(--info); }
.banner-main { flex: 1; min-width: 0; }
.banner-title { font-weight: 600; }
.banner-text { margin-top: 2px; color: var(--ink-soft); }
.banner-act { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.banner-warn { border-color: var(--warn-line); background: var(--warn-tint); }
.banner-warn svg { color: var(--warn); }
.banner-success { border-color: var(--success-line); background: var(--success-tint); }
.banner-success svg { color: var(--success); }
.banner-danger { border-color: var(--danger-line); background: var(--danger-tint); }
.banner-danger svg { color: var(--danger); }
.banner-neutral { border-color: var(--line); background: var(--fill-soft); }
.banner-neutral svg { color: var(--ink-soft); }

/* Сообщения-плашки и тосты: те же тона, что у баннера */
.notice, .toast { display: block; padding: 11px 14px; border-radius: var(--r-10); font-size: 13px; line-height: 1.4; border: 1px solid var(--line); background: var(--fill-soft); color: var(--ink); }
.notice-bad, .toast-bad { border-color: var(--danger-line); background: var(--danger-tint); color: #8A1B1B; }
.notice-ok, .toast-ok { border-color: var(--success-line); background: var(--success-tint); color: #14602A; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast { display: flex; align-items: center; gap: 10px; background: #fff; box-shadow: var(--shadow-pop); }
.toast-act { margin-left: auto; flex-shrink: 0; font-weight: 600; white-space: nowrap; }
.toast-bad { background: #FDF3F3; }
.toast-ok { background: #F2F9F4; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.es { padding: 28px 18px; text-align: center; }
.es-icon { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%; background: var(--bg); color: var(--ink-soft); display: grid; place-items: center; }
.es-title { font-size: 13px; font-weight: 600; }
.es-text { margin-top: 4px; font-size: 12px; color: var(--ink-soft); }
.es-act { margin-top: 14px; display: flex; gap: 8px; justify-content: center; }

.ava { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); color: var(--ink); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.ava-22 { width: 22px; height: 22px; font-size: 9px; }
.ava-36 { width: 36px; height: 36px; font-size: 12px; }
.ava-30 { width: 30px; height: 30px; font-size: 12px; }
.ava-56 { width: 56px; height: 56px; font-size: 18px; font-family: var(--font-num); }
.ava-dark { background: var(--panel); color: #fff; }
.ava-orange { background: var(--primary); color: #fff; }
.ava-sq { border-radius: var(--r-8); }

/* ─────────────── поповеры, меню, модалки, панель сбоку ─────────────── */

.pop-wrap { position: relative; display: inline-flex; }
/* порталом в body: координаты считает Popover.tsx, поверх шапки и модалки */
.pop {
  position: fixed; z-index: 120; min-width: 240px; max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px); overflow: auto; padding: 6px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-10);
  box-shadow: 0 12px 30px rgba(0,0,0,0.14); animation: bhs-fade 0.12s ease;
}
.pop-label { padding: 6px 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 7px 10px;
  border: 0; border-radius: var(--r-8); background: none; font: inherit; font-size: 13px;
  color: var(--ink); cursor: pointer; text-align: left; text-decoration: none;
}
.pop-item:hover { background: var(--bg); color: var(--ink); }
.pop-item-sub { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-soft); }
.pop-item:disabled { opacity: 0.45; cursor: not-allowed; }
.pop-item.danger { color: var(--danger); }
.pop-item.danger:hover { background: var(--danger-tint); }
.pop-item svg { flex-shrink: 0; color: var(--ink-soft); }
.pop-item.danger svg { color: var(--danger); }
.pop-sep { height: 1px; margin: 6px 0; background: var(--line); }
.pop-text { padding: 6px 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }

.modal { position: fixed; inset: 0; background: rgba(1,18,5,0.45); z-index: 100; display: none; padding: 24px; overflow: auto; }
.modal.open { display: flex; }
.modal-box { margin: auto; width: 100%; max-width: 560px; background: #fff; border-radius: var(--r-12); box-shadow: var(--shadow-modal); padding: 20px 22px; animation: bhs-fade 0.15s ease; }
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2, .modal-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.modal-close { margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: var(--r-6); background: none; color: var(--ink-soft); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--fill); color: var(--ink); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: span 2; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.dialog-text { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.modal-foot:first-child, .modal-box > .modal-foot:only-child { margin-top: 0; }

.drawer-back { position: fixed; inset: 0; background: rgba(1,18,5,0.35); z-index: 100; display: flex; justify-content: flex-end; }
.drawer { width: 420px; max-width: 100%; height: 100%; background: #fff; box-shadow: var(--shadow-modal); display: flex; flex-direction: column; animation: bhs-slide 0.18s ease; }
.drawer-head { height: var(--h-head); flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.drawer-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 18px; }
.drawer-foot { flex-shrink: 0; display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); }

/* ───────────────────────────── поля ───────────────────────────── */

.field { display: block; }
.field + .field, .field-stack > * + * { margin-top: 12px; }
.field-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.field-label .req { color: var(--danger); }
.field-hint { margin-top: 5px; font-size: 12px; color: var(--ink-soft); }
.field-error { margin-top: 5px; font-size: 12px; color: var(--danger); }
.field-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.input, .select, .textarea {
  width: 100%; height: var(--h-field); padding: 0 12px; border: 1px solid var(--line-3);
  border-radius: var(--r-8); background: #fff; font: inherit; font-size: 13px; color: var(--ink);
}
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23545454' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input::placeholder, .textarea::placeholder { color: #9A9A9A; }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--fill-soft); color: var(--ink-soft); cursor: not-allowed; }
.input.bad, .select.bad, .textarea.bad { border-color: var(--danger); }
.input-sm { height: var(--h-btn-sm); padding: 0 10px; font-size: 12px; }
.input-w { width: auto; }

/* DateInput: маска ДД.ММ.ГГГГ поверх текстового поля + кнопка нативного
   календаря; сам пикер живёт в невидимом input type=date той же геометрии,
   чтобы всплывающий календарь открылся рядом с кнопкой, а не в углу экрана. */
.din { position: relative; display: flex; }
.din-input { padding-right: 34px; }
.din-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--r-6);
  background: transparent; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center;
}
.din-btn:hover { background: var(--fill); color: var(--ink); }
.din-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.din-native {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; padding: 0; opacity: 0; pointer-events: none;
}

.tile { padding: 12px 14px; border-radius: var(--r-8); background: var(--tile); }
.tile-label { font-size: 11px; color: var(--ink-soft); }
.tile-value { margin-top: 6px; font-family: var(--font-num); font-weight: 700; font-size: 17px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile-value.lg { font-size: 20px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }

/* ─────────── шаги, этапы, таймлайн, полоски прогресса ─────────── */

.stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-wrap { display: flex; align-items: center; flex-wrap: nowrap; gap: 0; }
.step { display: flex; align-items: center; gap: 8px; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #fff; border: 2px solid var(--line-2); color: var(--ink-soft); flex-shrink: 0; }
.step-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.step.on .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.on .step-label { color: var(--ink); }
.step.done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.step-line { width: 56px; height: 2px; margin: 0 10px; background: var(--line-2); }

.stages { display: flex; gap: 4px; }
.stages > i { display: block; height: 6px; flex: 1; min-width: 12px; border-radius: 3px; background: var(--fill); }
.stages > i.done { background: var(--success); }
.stages > i.on { background: var(--primary); }
.stages > i.late { background: var(--danger); }
.stages-grid { display: grid; gap: 4px; }
.stages-grid > .stages { grid-column: 1 / -1; }
.stage-label { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-label.done { color: var(--success); }
.stages-label { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }

.tl { display: flex; flex-direction: column; gap: 10px; }
.tl-item { display: flex; gap: 10px; }
.tl-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--primary); flex-shrink: 0; position: relative; z-index: 1; }
.tl-dot.success { background: var(--success); }
.tl-dot.warn { background: var(--warn); }
.tl-dot.danger { background: var(--danger); }
.tl-dot.info { background: var(--info); }
.tl-dot.neutral { background: var(--neutral); }
.tl-main { flex: 1; min-width: 0; }
.tl-title { display: block; font-size: 12px; font-weight: 600; line-height: 1.4; }
.tl-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.tl-when { font-size: 11px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-time { width: 110px; flex-shrink: 0; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.pbar { height: 6px; border-radius: 3px; background: var(--line-row); overflow: hidden; }
.pbar > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); }
.pbar.md { height: 8px; border-radius: 4px; }
.pbar.lg { height: 10px; border-radius: 5px; }
.pbar-split { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: none; }
.pbar-split > i { border-radius: 0; }
.pbar > i.success { background: var(--success); }
.pbar > i.warn { background: var(--warn); }
.pbar > i.danger { background: var(--danger); }
.pbar > i.info { background: var(--info); }
.pbar > i.neutral { background: var(--line-3); }
.pbar-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.pbar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.dropzone { width: 100%; padding: 40px 24px; border: 2px dashed var(--line-3); border-radius: var(--r-14); background: #fff; text-align: center; cursor: pointer; }
.dropzone:hover { border-color: var(--primary); background: #FFF9F5; }
.dropzone-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--primary-tint); color: var(--primary); display: grid; place-items: center; }
.dropzone-title { margin-top: 14px; font-size: 16px; font-weight: 700; }
.dropzone-text { margin-top: 4px; font-size: 13px; color: var(--ink-soft); }

/* Свой радиопереключатель: родной не красится в фирменный цвет */
.radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-3); display: grid; place-items: center; flex-shrink: 0; }
.radio-dot.on { border-color: var(--primary); }
.radio-dot.on i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ──────────────────────────── логин ──────────────────────────── */

.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); background: #fff; }
.login-left { background: var(--panel); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo img { width: 32px; height: 32px; }
.login-logo-name { font-family: var(--font-num); font-weight: 700; font-size: 16px; letter-spacing: -0.04em; }
.login-logo-sub { margin-top: 2px; font-size: 12px; color: rgba(255,255,255,0.55); }
.login-claim { max-width: 420px; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.login-claim-sub { margin-top: 14px; max-width: 420px; font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.7); }
.login-foot { font-size: 12px; color: rgba(255,255,255,0.45); }
.env-badge { display: inline-block; padding: 2px 8px; border-radius: var(--r-6); background: var(--primary-tint-3); color: var(--primary-light); font-weight: 600; }
.login-right { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form { width: 380px; max-width: 100%; }
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.login-sub { margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.login-field { margin-top: 16px; }
.login-field:first-of-type { margin-top: 24px; }
.login-form .input { height: 44px; font-size: 14px; padding: 0 14px; }
.login-pw { position: relative; }
.login-pw .input { padding-right: 44px; }
.login-eye { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; border-radius: var(--r-6); background: transparent; color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; }
.login-eye:hover { background: var(--bg); color: var(--ink); }
.login-submit { margin-top: 24px; width: 100%; height: 44px; font-size: 14px; }
.login-error { margin-top: 20px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-8); background: var(--danger-tint); border: 1px solid var(--danger-line); color: #8A1B1B; font-size: 13px; line-height: 1.4; }
.login-error svg { flex-shrink: 0; margin-top: 1px; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-left { display: none; }
}

/* ─────────────────────── узкие экраны ─────────────────────── */

@media (max-width: 1000px) {
  .content { padding: 18px 16px 32px; }
  .hdr { padding: 0 16px; }
  .hdr-search span { display: none; }
  .hdr-search { width: auto; }
}
