/* ==========================================================================
   РЧК Analytics — светлая аналитическая панель
   Токены бренда: --deep #0B1F1E · --emerald #00D18F · --balance #EBECEC
                  --white #FFFFFF · --line #E4EAE8
   Тема только светлая. Шрифт: Inter / Segoe UI. Без внешних зависимостей.
   ========================================================================== */

:root {
  /* --- токены бренда --- */
  --deep: #0b1f1e;
  --emerald: #00d18f;
  --balance: #ebecec;
  --white: #ffffff;
  --line: #e4eae8;

  /* --- производные --- */
  --emerald-dark: #00a874;
  --emerald-deep: #047a58;
  --emerald-soft: #e6faf3;
  --emerald-fade: rgba(0, 209, 143, 0.12);

  --ink: #0b1f1e;
  --text: #1b2f2d;
  --muted: #6b7c79;
  --muted-2: #93a4a1;

  --bg: #f6faf9;
  --surface: #ffffff;
  --surface-2: #f9fcfb;
  --surface-3: #f1f6f4;
  --line-soft: #eef3f1;

  --warn: #e8830c;
  --warn-soft: #fff4e5;
  --danger: #d94b4b;
  --danger-soft: #fdecec;
  --info: #2f6fed;
  --info-soft: #eaf1ff;
  --violet: #6d5ce7;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;

  --shadow-xs: 0 1px 2px rgba(11, 31, 30, 0.05);
  --shadow-sm: 0 1px 2px rgba(11, 31, 30, 0.04), 0 10px 24px -18px rgba(11, 31, 30, 0.22);
  --shadow: 0 2px 6px rgba(11, 31, 30, 0.05), 0 22px 44px -30px rgba(11, 31, 30, 0.3);
  --shadow-lg: 0 32px 80px -44px rgba(11, 31, 30, 0.48);

  --sidebar-w: 264px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(1200px 540px at 88% -12%, rgba(0, 209, 143, 0.09), transparent 60%),
    radial-gradient(760px 420px at 4% 2%, rgba(0, 209, 143, 0.05), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; color: var(--deep); }
p { margin: 0; }
a { color: var(--emerald-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: rgba(0, 209, 143, 0.24); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 6px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7e0dd; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bcc9c5; border: 2px solid transparent; background-clip: content-box; }

/* --------------------------------------------------------------- boot screen */
.boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center;
  gap: 18px; background: var(--white);
}
.boot__mark { animation: bootPulse 1.7s ease-in-out infinite; filter: drop-shadow(0 14px 30px rgba(0, 209, 143, 0.35)); }
.boot__text { color: var(--muted); font-size: 14px; letter-spacing: 0.01em; }
.boot--error .boot__text { color: var(--danger); max-width: 520px; text-align: center; line-height: 1.5; }
@keyframes bootPulse { 0%, 100% { transform: scale(1) translateY(0); } 50% { transform: scale(0.94) translateY(2px); } }

/* ------------------------------------------------------------------- каркас */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.scrim { position: fixed; inset: 0; background: rgba(11, 31, 30, 0.4); z-index: 55; backdrop-filter: blur(2px); }

/* ----------------------------------------------------------------- сайдбар */
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 12px;
  padding: 20px 14px 14px; background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line); backdrop-filter: blur(14px); z-index: 60;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 10px; }
.logo { display: inline-flex; filter: drop-shadow(0 8px 16px rgba(0, 209, 143, 0.34)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.18; overflow: hidden; }
.brand-text b { font-size: 16.5px; letter-spacing: -0.02em; color: var(--deep); white-space: nowrap; }
.brand-text i { font-style: normal; font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 2px 2px 8px; }
.nav__group {
  margin: 14px 10px 5px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 650;
}
.nav__item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text);
  font-size: 13.2px; font-weight: 500; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.nav__item svg { flex: 0 0 17px; opacity: 0.62; }
.nav__item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav__item:hover { background: var(--surface-2); text-decoration: none; }
.nav__item.is-active {
  background: linear-gradient(135deg, rgba(0, 209, 143, 0.16), rgba(0, 209, 143, 0.05));
  color: var(--deep); font-weight: 620;
}
.nav__item.is-active svg { opacity: 1; color: var(--emerald-dark); }
.nav__badge {
  margin-left: auto; font-size: 10px; font-weight: 650; background: var(--emerald-soft);
  color: var(--emerald-deep); border-radius: 999px; padding: 1px 7px;
}

.sidebar__foot { display: flex; flex-direction: column; gap: 9px; }
.sidebar-status {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 10px 11px; display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted);
}
.sidebar-status__row { display: flex; align-items: center; gap: 7px; line-height: 1.35; }
.sidebar-status b { color: var(--text); font-weight: 600; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.status-dot--ok { background: var(--emerald); box-shadow: 0 0 0 3px rgba(0, 209, 143, 0.16); }
.status-dot--warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(232, 131, 12, 0.14); }
.status-dot--err { background: var(--danger); box-shadow: 0 0 0 3px rgba(217, 75, 75, 0.14); }
.status-dot--wait { background: var(--muted-2); animation: dotPulse 1.6s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.sidebar-hermes {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: var(--radius-sm);
  background: var(--deep); color: #fff; text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
}
.sidebar-hermes:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 14px 30px -18px rgba(11, 31, 30, 0.8); }
.sidebar-hermes__icon {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark)); color: var(--deep); font-size: 15px;
}
.sidebar-hermes span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-hermes b { font-size: 12.5px; font-weight: 620; color: #fff; }
.sidebar-hermes i { font-style: normal; font-size: 10.5px; color: rgba(255, 255, 255, 0.62); }

/* ------------------------------------------------------------------- main */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 26px 12px; background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(16px);
}
.topbar__title { min-width: 0; }
.topbar__title h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__title p { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); cursor: pointer; transition: border-color 0.15s;
  max-width: 340px;
}
.meta-chip:hover { border-color: rgba(0, 209, 143, 0.55); }
.meta-chip__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); font-weight: 650; }
.meta-chip__value {
  font-size: 11.5px; color: var(--text); font-weight: 600; max-width: 250px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.meta-chip--warn { border-color: rgba(232, 131, 12, 0.45); background: var(--warn-soft); }
.meta-chip--warn .meta-chip__value { color: #9a5a05; }
.meta-chip--err { border-color: rgba(217, 75, 75, 0.4); background: var(--danger-soft); }
.meta-chip--err .meta-chip__value { color: #a13232; }

/* -------------------------------------------------------------- filter bar */
.only-mobile { display: none !important; }
.filterbar {
  position: sticky; top: 64px; z-index: 25; display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 9px 26px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(12px);
  scrollbar-width: thin;
}
.filterbar__group { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.filterbar__spacer { flex: 1 0 8px; }
.filterbar__label { font-size: 11px; color: var(--muted-2); font-weight: 600; white-space: nowrap; }
.filterbar__divider { width: 1px; height: 22px; background: var(--line); flex: 0 0 1px; }

.date-preset, .date-input, .filter-select {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 4px 10px; font-size: 11.5px; outline: none; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s; height: 27px;
}
.date-preset:hover, .date-input:hover, .filter-select:hover { border-color: rgba(0, 209, 143, 0.5); }
.date-preset:focus, .date-input:focus, .filter-select:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0, 209, 143, 0.14); }
.date-preset { max-width: 168px; cursor: pointer; }
.date-input { width: 124px; padding: 5px 9px; font-variant-numeric: tabular-nums; }
.filter-select { cursor: pointer; max-width: 190px; }

.fchip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--white); padding: 3px 9px 3px 10px; height: 27px; cursor: pointer;
  font-size: 11.5px; color: var(--text); white-space: nowrap; transition: border-color 0.15s, background 0.15s;
}
.fchip:hover { border-color: rgba(0, 209, 143, 0.55); }
.fchip.is-open { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0, 209, 143, 0.13); }
.fchip.is-active { background: var(--deep); color: #fff; border-color: var(--deep); }
.fchip.is-active .fchip__count { background: rgba(255, 255, 255, 0.18); color: #fff; }
.fchip__label { color: var(--muted); font-weight: 560; font-size: 11.5px; }
.fchip.is-active .fchip__label { color: rgba(255, 255, 255, 0.68); }
.fchip__value { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.fchip__count { min-width: 16px; height: 16px; border-radius: 999px; background: var(--emerald-soft); color: var(--emerald-deep); font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.fchip--warn { border-color: rgba(232, 131, 12, 0.55); }
.fchip__warn { color: var(--warn); font-size: 13px; line-height: 1; }
.fchip__caret { opacity: 0.5; font-size: 9px; }
.filterbar__reset { color: var(--muted); }
.filterbar__reset:hover { color: var(--danger); }
.filterbar__mobile { display: none; }

/* --------------------------------------------------------------- warnings */
.warnbar {
  display: flex; flex-direction: column; gap: 6px; padding: 9px 26px 0;
}
.warnbar__row {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px;
  font-size: 12px; line-height: 1.4; border: 1px solid transparent; min-height: 34px;
}
.warnbar__row--stale { background: var(--info-soft); border-color: rgba(47, 111, 237, 0.22); color: #244f9e; }
.warnbar__row--warn { background: var(--warn-soft); border-color: rgba(232, 131, 12, 0.26); color: #7d4a04; }
.warnbar__row .banner__icon { color: inherit; }
.warnbar__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warnbar__more {
  flex: 0 0 auto; border: 0; background: transparent; color: inherit; cursor: pointer;
  font-size: 11.5px; text-decoration: underline dotted; padding: 0 2px; white-space: nowrap;
}
.warnbar__item {
  display: flex; align-items: flex-start; gap: 9px; font-size: 12px; line-height: 1.45;
  background: var(--warn-soft); border: 1px solid rgba(232, 131, 12, 0.32); color: #7d4a04;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.warnbar__item--stale { background: var(--info-soft); border-color: rgba(47, 111, 237, 0.28); color: #244f9e; }
.warn-icon { flex: 0 0 16px; margin-top: 1px; font-weight: 700; }

/* ------------------------------------------------------------------- view */
.view { padding: 18px 26px 64px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.view > * { min-width: 0; }
.page-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.section-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.section-head h2 { font-size: 16px; }
.section-head p { font-size: 12.5px; color: var(--muted); }
.section-head__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--white);
  font-size: 13px; font-weight: 560; cursor: pointer; transition: border-color 0.15s, transform 0.12s, background 0.15s;
  white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { border-color: rgba(0, 209, 143, 0.6); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark)); border-color: transparent;
  color: #043329; box-shadow: 0 10px 22px -14px rgba(0, 168, 116, 0.8);
}
.btn--primary:hover { box-shadow: 0 14px 28px -16px rgba(0, 168, 116, 0.95); }
.btn--dark { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn--dark:hover { background: #12302e; border-color: #12302e; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--deep); }
.btn--danger { color: var(--danger); border-color: rgba(217, 75, 75, 0.35); }
.btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn--sm { padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.btn--xs { padding: 3px 8px; font-size: 11px; border-radius: 8px; }
.btn--icon { width: 36px; height: 36px; padding: 0; flex: 0 0 36px; }
.btn--block { width: 100%; }
.btn.is-busy { pointer-events: none; opacity: 0.7; }
.btn.is-busy::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor;
  border-top-color: transparent; animation: spin 0.7s linear infinite; margin-left: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-content: center; border-radius: 11px;
  border: 1px solid var(--line); background: var(--white); cursor: pointer; color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--deep); border-color: rgba(0, 209, 143, 0.5); }

/* ------------------------------------------------------------------ карточки */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.card--flush { padding: 0; overflow: hidden; }
.card--tint { background: linear-gradient(180deg, rgba(0, 209, 143, 0.045), rgba(255, 255, 255, 0) 55%); }
.card--nopad { padding: 8px; }
.card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; row-gap: 6px; min-height: 26px; }
.card__head > div:first-child { min-width: 0; flex: 1 1 auto; }
.card__title { font-size: 14.5px; font-weight: 630; color: var(--deep); display: flex; align-items: center; gap: 7px; }
.card__sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.card__actions { margin-left: auto; display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.card__body { min-width: 0; }
.card__foot { border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: 11.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); }
.grid--sidebar-left { grid-template-columns: minmax(280px, 0.9fr) minmax(0, 2.1fr); }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }

/* --------------------------------------------------------------------- KPI */
.kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px 15px; box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0;
  display: flex; flex-direction: column; gap: 7px; cursor: default; transition: border-color 0.15s, transform 0.15s;
}
.kpi::after {
  content: ""; position: absolute; inset: auto -34% -66% auto; width: 150px; height: 150px; pointer-events: none;
  background: radial-gradient(circle, rgba(0, 209, 143, 0.14), transparent 70%); border-radius: 50%;
}
.kpi--click { cursor: pointer; }
.kpi--click:hover { border-color: rgba(0, 209, 143, 0.55); transform: translateY(-1px); }
.kpi--na { background: var(--surface-2); }
.kpi--na::after { display: none; }
.kpi__label { font-size: 11px; color: var(--muted); display: flex; align-items: flex-start; gap: 6px; min-width: 0; line-height: 1.3; }
.kpi__label > span:not(.badge):not(.info-btn) {
  min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; word-break: break-word; flex: 1 1 auto;
}
.kpi__label .info-btn { margin-top: 1px; }
.kpi__foot .badge { font-size: 9.5px; padding: 1px 6px; }
.kpi__value { font-size: clamp(19px, 1.75vw, 25px); font-weight: 680; letter-spacing: -0.03em; color: var(--deep); line-height: 1.12; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi__value small { font-size: 13px; font-weight: 550; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi--na .kpi__value { color: var(--muted-2); font-size: 19px; }
.kpi__foot { margin-top: 1px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.kpi__spark { margin-top: 1px; height: 30px; }
.delta {
  display: inline-flex; align-items: center; gap: 3px; font-weight: 640; border-radius: 999px;
  padding: 1px 8px; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.delta--up { color: #06734f; background: rgba(0, 209, 143, 0.15); }
.delta--down { color: #ac3535; background: rgba(217, 75, 75, 0.12); }
.delta--flat { color: var(--muted); background: var(--surface-3); }
.delta--na { color: var(--muted-2); background: var(--surface-3); }
.info-btn {
  width: 17px; height: 17px; flex: 0 0 17px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--white); color: var(--muted-2); font-size: 10px; font-weight: 700; line-height: 1;
  display: inline-grid; place-items: center; cursor: pointer; padding: 0; transition: color 0.15s, border-color 0.15s;
}
.info-btn:hover { color: var(--emerald-deep); border-color: var(--emerald); }
.kpi__meta { font-size: 10.5px; color: var(--muted-2); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.kpi__meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ графики */
.chart { position: relative; min-width: 0; width: 100%; }
.chart__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.chart__title { font-size: 13px; font-weight: 620; color: var(--deep); }
.chart__sub { font-size: 11.5px; color: var(--muted); }
.chart__legend { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.legend-item.is-off { opacity: 0.4; text-decoration: line-through; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; }
.chart__svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart__empty {
  display: grid; place-items: center; min-height: 160px; color: var(--muted-2); font-size: 12.5px;
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); text-align: center; padding: 12px;
}
.chart-tooltip {
  position: fixed; z-index: 400; pointer-events: none; background: var(--deep); color: #fff;
  border-radius: 9px; padding: 7px 10px; font-size: 11.5px; line-height: 1.45; box-shadow: var(--shadow-lg);
  max-width: 300px; opacity: 0; transform: translateY(3px); transition: opacity 0.1s;
}
.chart-tooltip.is-on { opacity: 1; }
.chart-tooltip b { color: #fff; font-weight: 650; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; }
.chart-tooltip .tt-row span:last-child { font-variant-numeric: tabular-nums; }
.chart-tooltip .tt-muted { color: rgba(255, 255, 255, 0.62); font-size: 10.5px; }
.chart svg .ch-hit { cursor: pointer; }
.chart svg .ch-hit:hover { filter: brightness(0.96); }
.chart svg .ch-seg { transition: opacity 0.12s; }
.chart svg .ch-seg.is-dim { opacity: 0.35; }
.spark { display: block; overflow: visible; }
.spark path, .spark polyline { vector-effect: non-scaling-stroke; }

/* ------------------------------------------------------------------- бейджи */
.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 8px;
  font-size: 10.5px; font-weight: 620; white-space: nowrap; border: 1px solid transparent;
  letter-spacing: 0.01em; line-height: 1.5;
}
.badge--ok { background: var(--emerald-soft); color: var(--emerald-deep); border-color: rgba(0, 168, 116, 0.2); }
.badge--warn { background: var(--warn-soft); color: #9a5a05; border-color: rgba(232, 131, 12, 0.24); }
.badge--err { background: var(--danger-soft); color: #a13232; border-color: rgba(217, 75, 75, 0.22); }
.badge--info { background: var(--info-soft); color: #244f9e; border-color: rgba(47, 111, 237, 0.2); }
.badge--na { background: var(--surface-3); color: var(--muted); border-color: var(--line); }
.badge--violet { background: #f0edff; color: #5646c9; border-color: rgba(109, 92, 231, 0.2); }
.badge--dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 1px 7px;
  font-size: 11px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--line-soft);
}
.tag--emerald { background: var(--emerald-soft); color: var(--emerald-deep); }
.tag--id { font-family: var(--mono); font-size: 10.5px; letter-spacing: -0.02em; }
.unit { color: var(--muted); font-size: 0.82em; font-weight: 550; }

/* ------------------------------------------------------------------ таблицы */
.table-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap; background: var(--surface);
}
.table-toolbar__spacer { flex: 1 1 20px; }
.table-search {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; background: var(--white); min-width: 190px; flex: 1 1 220px; max-width: 330px;
}
.table-search:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0, 209, 143, 0.13); }
.table-search input { border: 0; outline: none; background: transparent; width: 100%; font-size: 12.5px; padding: 3px 0; }
.table-search svg { flex: 0 0 15px; color: var(--muted-2); }
.table-info { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-info b { color: var(--text); font-weight: 620; }
.table-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.table-wrap { overflow: auto; max-height: 620px; position: relative; border-radius: 0; }
.table-wrap--tall { max-height: 78vh; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tbl th {
  position: sticky; top: 0; z-index: 3; background: var(--surface-2); text-align: left; font-weight: 650;
  font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
table.tbl th.is-sortable { cursor: pointer; }
table.tbl th.is-sortable:hover { color: var(--deep); background: var(--surface-3); }
table.tbl th .th-inner { display: inline-flex; align-items: center; gap: 4px; }
table.tbl th .sort-caret { opacity: 0.35; font-size: 9px; }
table.tbl th.is-sorted { color: var(--deep); }
table.tbl th.is-sorted .sort-caret { opacity: 1; color: var(--emerald-dark); }
table.tbl td {
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle;
  max-width: 360px; overflow: hidden; text-overflow: ellipsis;
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: rgba(0, 209, 143, 0.04); }
table.tbl tbody tr.row-click { cursor: pointer; }
table.tbl tbody tr.row-click:hover td { background: rgba(0, 209, 143, 0.075); }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl .mono { font-family: var(--mono); font-size: 11.5px; }
table.tbl .cell-strong { font-weight: 620; color: var(--deep); }
table.tbl .cell-muted { color: var(--muted); }
table.tbl .cell-wrap { white-space: normal; overflow-wrap: anywhere; max-width: 420px; }
table.tbl tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line); position: sticky; bottom: 0; }
table.tbl .row-actions { display: flex; gap: 4px; }
table.tbl--compact td, table.tbl--compact th { padding: 6px 10px; }

.pagination {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line-soft);
  flex-wrap: wrap; font-size: 12px; color: var(--muted); background: var(--surface);
}
.pagination__pages { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pagination__page {
  min-width: 28px; height: 28px; padding: 0 7px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; cursor: pointer; font-size: 12px; color: var(--text); display: grid; place-content: center;
}
.pagination__page:hover { background: var(--surface-3); }
.pagination__page.is-current { background: var(--deep); color: #fff; font-weight: 620; }
.pagination__page:disabled { opacity: 0.35; cursor: default; }
.pagination__size, .pagination__select {
  border: 1px solid var(--line); border-radius: 8px; background: var(--white); padding: 3px 7px;
  font-size: 11.5px; height: 28px; color: var(--text);
}
.pagination__total { font-variant-numeric: tabular-nums; }
.pagination__dash { color: var(--muted-2); }

/* выпадающий список колонок */
.col-picker { position: relative; }
.col-picker__panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 120; min-width: 230px; max-height: 340px;
  overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 8px;
}
.col-picker__panel .opt { padding: 5px 7px; }

/* ------------------------------------------------------------------- формы */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label { font-size: 11.5px; font-weight: 620; color: var(--text); display: flex; gap: 6px; align-items: center; }
.field__label small { color: var(--muted-2); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  padding: 8px 11px; font-size: 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; color: var(--text);
}
.input:hover, .select:hover, .textarea:hover { border-color: rgba(0, 209, 143, 0.5); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0, 209, 143, 0.13); }
.textarea { min-height: 82px; resize: vertical; line-height: 1.45; }
.input--sm, .select--sm { padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.input[type="password"] { font-family: var(--mono); letter-spacing: 0.03em; }
.help { font-size: 11px; color: var(--muted-2); line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checkbox { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 12.5px; cursor: pointer; line-height: 1.4; }
.checkbox input { margin: 2px 0 0; accent-color: var(--emerald-dark); width: 14px; height: 14px; flex: 0 0 14px; }
.checkbox small { color: var(--muted); display: block; font-size: 11px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 36px; height: 20px; border-radius: 999px; background: var(--balance); position: relative; transition: background 0.16s; flex: 0 0 36px; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform 0.16s; }
.switch input:checked + .switch__track { background: var(--emerald); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.key-mask { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }

/* --------------------------------------------------------- модалки/дроверы */
.overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(11, 31, 30, 0.42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 22px; animation: fadeIn 0.14s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(560px, 100%); max-height: calc(100vh - 44px); display: flex; flex-direction: column;
  animation: popIn 0.16s ease-out; border: 1px solid var(--line);
}
.modal--wide { width: min(880px, 100%); }
.modal--slim { width: min(420px, 100%); }
@keyframes popIn { from { transform: translateY(8px) scale(0.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.modal__head h3 { font-size: 15.5px; }
.modal__head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal__head .icon-btn { margin-left: auto; flex: 0 0 32px; width: 32px; height: 32px; }
.modal__body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal__foot { padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.drawer-wrap { position: fixed; inset: 0; z-index: 300; background: rgba(11, 31, 30, 0.42); backdrop-filter: blur(3px); animation: fadeIn 0.14s; }
.drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: min(560px, 100%); background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn 0.18s ease-out;
}
@keyframes slideIn { from { transform: translateX(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.drawer__head h3 { font-size: 15.5px; }
.drawer__head .icon-btn { margin-left: auto; }
.drawer__body { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }
.drawer__foot { padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; }

/* ------------------------------------------------------- поповеры/подсказки */
.popover {
  position: fixed; z-index: 250; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 8px; min-width: 230px;
  max-width: min(380px, calc(100vw - 24px)); animation: popIn 0.12s ease-out;
}
.popover__head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.popover__head h4 { font-size: 12.5px; }
.popover__head .fchip__count { margin-left: auto; }
.popover__search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; margin: 0 2px 6px; }
.popover__search input { border: 0; outline: none; width: 100%; font-size: 12px; background: transparent; }
.popover__list { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 1px; }
.popover__opt {
  display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; line-height: 1.35; user-select: none;
}
.popover__opt:hover { background: var(--surface-2); }
.popover__opt input { margin: 2px 0 0; accent-color: var(--emerald-dark); flex: 0 0 14px; }
.popover__opt small { color: var(--muted-2); display: block; font-size: 10.5px; }
.popover__empty { padding: 12px 8px; text-align: center; color: var(--muted-2); font-size: 12px; }
.popover__foot { display: flex; align-items: center; gap: 6px; padding: 7px 4px 2px; border-top: 1px solid var(--line-soft); margin-top: 6px; }
.popover__foot .btn:last-child { margin-left: auto; }
.popover-section { padding: 4px 8px 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); font-weight: 650; }

.def-pop { max-width: 340px; }
.def-pop h4 { font-size: 12.5px; margin-bottom: 2px; }
.def-row { display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; font-size: 11.5px; padding: 2px 0; }
.def-row dt { color: var(--muted-2); }
.def-row dd { margin: 0; color: var(--text); }
.def-pop .limitations { margin: 6px 0 0; padding-left: 16px; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.def-pop .limitations li { line-height: 1.4; }

/* -------------------------------------------------------------------- тосты */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 500; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 9px; background: var(--white); border: 1px solid var(--line);
  border-left: 3px solid var(--muted-2); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 10px 12px; font-size: 12.5px; line-height: 1.4; animation: toastIn 0.18s ease-out;
}
.toast--ok { border-left-color: var(--emerald); }
.toast--warn { border-left-color: var(--warn); }
.toast--err { border-left-color: var(--danger); }
.toast--info { border-left-color: var(--info); }
.toast__icon { flex: 0 0 16px; margin-top: 1px; font-weight: 700; }
.toast--ok .toast__icon { color: var(--emerald-deep); }
.toast--warn .toast__icon { color: var(--warn); }
.toast--err .toast__icon { color: var(--danger); }
.toast--info .toast__icon { color: var(--info); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 620; color: var(--deep); }
.toast__close { border: 0; background: transparent; cursor: pointer; color: var(--muted-2); font-size: 15px; line-height: 1; padding: 0 0 0 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- состояния/скелет */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 9px; padding: 40px 20px; min-height: 180px; color: var(--muted); width: 100%;
}
.state__icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line-soft);
}
.state--error .state__icon { background: var(--danger-soft); color: var(--danger); border-color: rgba(217, 75, 75, 0.18); }
.state--empty .state__icon { background: var(--emerald-soft); color: var(--emerald-deep); border-color: rgba(0, 168, 116, 0.16); }
.state__title { font-size: 14px; font-weight: 620; color: var(--deep); }
.state__text { font-size: 12.5px; max-width: 460px; line-height: 1.5; }
.state__actions { display: flex; gap: 8px; margin-top: 3px; flex-wrap: wrap; justify-content: center; }
.state--compact { padding: 24px 14px; min-height: 120px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--emerald-fade);
  border-top-color: var(--emerald); animation: spin 0.8s linear infinite;
}
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, #f7fbf9 50%, var(--surface-3) 75%); background-size: 300% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton--line { height: 12px; }
.skeleton--title { height: 20px; width: 42%; }
.skeleton--card { height: 112px; border-radius: var(--radius-lg); }
.skeleton--chart { height: 240px; border-radius: var(--radius); }
.loading-block { display: flex; flex-direction: column; gap: 12px; }

/* -------------------------------------------------------------------- вкладки */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; padding: 8px 12px; cursor: pointer; font-size: 12.5px; font-weight: 560;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--deep); }
.tab.is-active { color: var(--deep); border-bottom-color: var(--emerald); font-weight: 640; }
.tab__count { font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 1px 6px; }
.tab.is-active .tab__count { background: var(--emerald-soft); color: var(--emerald-deep); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 1px; }
.seg button {
  border: 0; background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 11.5px;
  color: var(--muted); cursor: pointer; font-weight: 560; white-space: nowrap;
}
.seg button:hover { color: var(--deep); }
.seg button.is-active { background: var(--white); color: var(--deep); box-shadow: var(--shadow-xs); }

/* ------------------------------------------------------------------ баннеры */
.banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.45; border: 1px solid var(--line);
}
.banner--info { background: var(--info-soft); border-color: rgba(47, 111, 237, 0.22); color: #244f9e; }
.banner--warn { background: var(--warn-soft); border-color: rgba(232, 131, 12, 0.26); color: #7d4a04; }
.banner--stale { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.banner--err { background: var(--danger-soft); border-color: rgba(217, 75, 75, 0.24); color: #a13232; }
.banner__icon { flex: 0 0 17px; margin-top: 1px; font-weight: 700; }
.banner__body { min-width: 0; flex: 1; }
.banner__title { font-weight: 650; margin-bottom: 1px; }
.banner__actions { margin-left: auto; display: flex; gap: 6px; flex: 0 0 auto; }
.banner ul { margin: 4px 0 0; padding-left: 17px; display: flex; flex-direction: column; gap: 2px; }

/* ------------------------------------------------------------------- задачи */
.task {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-xs); overflow: hidden;
}
.task + .task { margin-top: 8px; }
.task__head { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; cursor: pointer; }
.task__head:hover { background: var(--surface-2); }
.task__code { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); background: var(--surface-3); border-radius: 6px; padding: 2px 6px; flex: 0 0 auto; }
.task__title { font-size: 13.5px; font-weight: 620; color: var(--deep); line-height: 1.35; }
.task__meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.task__caret { margin-left: auto; color: var(--muted-2); flex: 0 0 auto; transition: transform 0.15s; font-size: 11px; }
.task.is-open .task__caret { transform: rotate(90deg); }
.task__body { padding: 0 15px 15px 15px; display: none; }
.task.is-open .task__body { display: flex; flex-direction: column; gap: 12px; }
.task-block { display: flex; flex-direction: column; gap: 4px; }
.task-block__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted-2); font-weight: 650; }
.task-block__text { font-size: 12.5px; line-height: 1.5; }
.evidence-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text); }
.evidence-list li::marker { color: var(--emerald); }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.task-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Hermes */
.hermes { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 16px; align-items: start; min-height: calc(100vh - 230px); }
.hermes__threads {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100vh - 300px); min-height: 460px; position: sticky; top: 132px;
}
.hermes__threads-head { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; }
.hermes__threads-head h3 { font-size: 13.5px; }
.hermes__threads-head .btn { margin-left: auto; }
.thread-list { overflow-y: auto; flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.thread-item {
  display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; min-width: 0;
}
.thread-item:hover { background: var(--surface-2); }
.thread-item.is-active { background: var(--emerald-soft); border-color: rgba(0, 168, 116, 0.18); }
.thread-item__title { font-size: 12.5px; font-weight: 600; color: var(--deep); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item__meta { font-size: 10.5px; color: var(--muted-2); display: flex; gap: 8px; }
.thread-item__del { border: 0; background: transparent; color: var(--muted-2); cursor: pointer; margin-left: auto; font-size: 13px; opacity: 0; }
.thread-item:hover .thread-item__del { opacity: 1; }
.thread-item__del:hover { color: var(--danger); }

.hermes__chat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; height: calc(100vh - 300px); min-height: 460px; max-height: 900px; overflow: hidden;
}
.hermes-banner {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; font-size: 12px; border-bottom: 1px solid var(--line-soft);
  background: var(--warn-soft); color: #7d4a04; flex-wrap: wrap;
}
.hermes-banner .btn { margin-left: auto; }
.messages { flex: 1; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 14px; }
.hermes-empty { display: flex; flex-direction: column; gap: 12px; padding: 22px 6px; }
.hermes-empty h2 { font-size: 17px; }
.hermes-empty p { font-size: 13px; color: var(--muted); max-width: 560px; line-height: 1.55; }
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 4px; }
.prompt-card {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12px; color: var(--text); cursor: pointer; line-height: 1.4; transition: border-color 0.15s;
}
.prompt-card:hover { border-color: rgba(0, 209, 143, 0.55); background: var(--surface-2); }
.msg { display: flex; flex-direction: column; gap: 5px; max-width: 88%; }
.msg--user { align-self: flex-end; align-items: flex-end; }
.msg--assistant { align-self: flex-start; align-items: flex-start; }
.msg__head { font-size: 10.5px; color: var(--muted-2); display: flex; gap: 7px; align-items: center; }
.msg__bubble {
  border-radius: 14px; padding: 11px 14px; font-size: 13px; line-height: 1.55; white-space: pre-wrap;
  word-break: break-word; border: 1px solid var(--line);
}
.msg--user .msg__bubble { background: var(--deep); color: #fff; border-color: var(--deep); border-bottom-right-radius: 5px; }
.msg--assistant .msg__bubble { background: var(--surface-2); border-bottom-left-radius: 5px; }
.msg--assistant .msg__bubble h4 { margin: 8px 0 3px; font-size: 12.5px; }
.msg__bubble code { font-family: var(--mono); font-size: 11.5px; background: rgba(11, 31, 30, 0.06); border-radius: 4px; padding: 1px 4px; }
.msg__bubble table { border-collapse: collapse; margin: 6px 0; font-size: 11.5px; }
.msg__bubble th, .msg__bubble td { border: 1px solid var(--line); padding: 3px 8px; text-align: left; }
.msg__tools { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); padding: 2px 8px; font-size: 10.5px; color: var(--muted); font-family: var(--mono);
  max-width: 100%; overflow: hidden; white-space: nowrap;
}
.tool-chip--running { border-color: rgba(232, 131, 12, 0.4); background: var(--warn-soft); color: #9a5a05; }
.tool-chip--done { border-color: rgba(0, 168, 116, 0.24); background: var(--emerald-soft); color: var(--emerald-deep); }
.tool-chip--error { border-color: rgba(217, 75, 75, 0.3); background: var(--danger-soft); color: #a13232; }
.tool-chip__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tool-chip--running .tool-chip__dot { animation: dotPulse 1s infinite; }
.msg__chart { width: min(560px, 100%); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: var(--white); }
.msg--tool { max-width: 100%; align-items: flex-start; gap: 3px; margin: -6px 0; }
.msg--tool .msg__head { font-size: 9.5px; }
.msg--tool .tool-chip { max-width: 100%; }
.cursor-blink { display: inline-block; width: 7px; height: 14px; background: var(--emerald); vertical-align: -2px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer { border-top: 1px solid var(--line-soft); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 7px; background: var(--surface); }
.composer__box {
  display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line); border-radius: 14px;
  padding: 7px 8px 7px 12px; background: var(--surface-2); transition: border-color 0.15s, box-shadow 0.15s;
}
.composer__box:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0, 209, 143, 0.12); background: var(--white); }
.composer textarea { flex: 1; border: 0; outline: none; background: transparent; resize: none; font-size: 13px; line-height: 1.5; max-height: 160px; min-height: 22px; padding: 3px 0; }
.composer__foot { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--muted-2); flex-wrap: wrap; }
.composer__foot .send-btn { margin-left: auto; }
.hermes__chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 10px; color: var(--muted); padding: 30px; text-align: center; }

/* ------------------------------------------------- импорт и источники */
.dropzone {
  border: 1.5px dashed #c9d6d2; border-radius: var(--radius); background: var(--surface-2);
  padding: 26px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; min-height: 130px;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--emerald); background: var(--emerald-soft); }
.dropzone__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; color: var(--emerald-deep); }
.dropzone__title { font-size: 13px; font-weight: 620; color: var(--deep); }
.dropzone__hint { font-size: 11.5px; color: var(--muted); }
.wizard-steps { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.step__num { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.step.is-active { color: var(--deep); font-weight: 620; }
.step.is-active .step__num { background: var(--deep); color: #fff; }
.step.is-done .step__num { background: var(--emerald); color: var(--deep); }
.step__line { width: 22px; height: 1px; background: var(--line); }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line-soft); }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--emerald), var(--emerald-dark)); transition: width 0.3s; }
.job-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); flex-wrap: wrap; }
.job-row__meta { font-size: 11px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.kv-grid { display: grid; grid-template-columns: minmax(130px, 0.8fr) minmax(0, 2fr); gap: 6px 14px; font-size: 12.5px; }
.kv-grid dt { color: var(--muted); }
.kv-grid dd { margin: 0; overflow-wrap: anywhere; }
.integration-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.integration-card__head { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); }
.integration-card__head h3 { font-size: 13.5px; }
.integration-card__head .badge { margin-left: auto; }
.integration-card__body { padding: 14px 15px; display: flex; flex-direction: column; gap: 12px; }
.masked-tag { font-family: var(--mono); font-size: 11.5px; background: var(--surface-3); border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 7px; color: var(--muted); }
.test-result { font-size: 12px; border-radius: 9px; padding: 8px 11px; border: 1px solid var(--line); }
.test-result--ok { background: var(--emerald-soft); border-color: rgba(0, 168, 116, 0.24); color: var(--emerald-deep); }
.test-result--err { background: var(--danger-soft); border-color: rgba(217, 75, 75, 0.22); color: #a13232; }
.test-result--warn { background: var(--warn-soft); border-color: rgba(232, 131, 12, 0.24); color: #7d4a04; }

/* ------------------------------------------------------------------ разное */
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 11.5px; }
.smaller { font-size: 10.5px; }
.strong { font-weight: 620; color: var(--deep); }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row--nowrap { flex-wrap: nowrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.flex-1 { flex: 1; min-width: 0; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { border: 0; background: transparent; padding: 0; color: var(--emerald-deep); cursor: pointer; font-size: inherit; text-decoration: underline dotted; }
.link-btn:hover { color: var(--emerald-dark); }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 2px 0; }
.empty-inline { color: var(--muted-2); font-size: 12px; padding: 10px 2px; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--emerald-deep); }
.crumb__sep { color: var(--muted-2); }
.page-title-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-title-row h2 { font-size: 18px; }
.page-title-row p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.page-title-row__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sort-note { font-size: 11px; color: var(--muted-2); }
.hl-emerald { color: var(--emerald-deep); }
.hl-danger { color: var(--danger); }
.hl-warn { color: #9a5a05; }

/* ---------------------------------------------------------------- адаптив */
@media (max-width: 1320px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1160px) {
  :root { --sidebar-w: 238px; }
  .topbar { padding: 12px 18px 10px; }
  .filterbar { padding: 8px 18px; }
  .view { padding: 16px 18px 56px; }
  .topbar__title h1 { font-size: 18px; }
  .meta-chip__label { display: none; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 274px; transform: translateX(-102%);
    transition: transform 0.2s ease-out; box-shadow: var(--shadow-lg); z-index: 70;
  }
  .app.nav-open .sidebar { transform: none; }
  .only-mobile { display: grid !important; }
  .topbar { position: sticky; }
  .filterbar { top: 60px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hermes { grid-template-columns: minmax(0, 1fr); }
  .hermes__threads { position: static; max-height: 240px; }
  .hermes__chat { min-height: 62vh; max-height: none; }
}
@media (max-width: 820px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .task-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar__actions .meta-chip:first-child { display: none; }
  .filterbar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 9px; }
  .filterbar::-webkit-scrollbar { height: 4px; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 12px 9px; gap: 8px; }
  .topbar__title p { display: none; }
  .topbar__title h1 { font-size: 16.5px; }
  .topbar__actions { gap: 5px; }
  .topbar-hermes { width: 34px; height: 34px; padding: 0; font-size: 0; border-radius: 10px; }
  .topbar-hermes span { font-size: 15px; }
  .meta-chip { padding: 4px 8px; }
  .meta-chip__value { max-width: 112px; font-size: 10.5px; }
  .filterbar { top: 56px; padding: 7px 12px; }
  .view { padding: 12px 12px 46px; gap: 12px; }
  .warnbar { padding: 8px 12px 0; }
  .grid { gap: 12px; }
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 12px 13px; border-radius: var(--radius); }
  .kpi__value { font-size: 20px; }
  .kpi__label { font-size: 10.5px; }
  .kpi__foot { font-size: 10.5px; }
  .card { padding: 13px 13px; border-radius: var(--radius); }
  .card__head h3 { font-size: 13.5px; }
  .section-head h2 { font-size: 15px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .overlay { padding: 8px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 16px); border-radius: var(--radius-lg); }
  .modal__foot { justify-content: stretch; }
  .modal__foot .btn { flex: 1; }
  .drawer { width: 100%; }
  .table-toolbar { padding: 8px 10px; }
  .table-search { max-width: none; flex: 1 1 100%; order: -1; }
  .pagination { gap: 6px; padding: 8px 10px; }
  .messages { padding: 12px 12px 6px; }
  .msg { max-width: 96%; }
  .hermes__threads { max-height: 190px; }
  .date-preset { max-width: 140px; }
  .date-input { width: 112px; }
  .fchip__value { max-width: 110px; }
  .page-title-row h2 { font-size: 16px; }
  .toasts { right: 10px; left: 10px; bottom: 10px; max-width: none; }
  .grid--kpi .kpi:nth-child(3) ~ * { grid-column: span 1; }
  .card__head { flex-wrap: wrap; align-items: flex-start; }
  .card__actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .card__actions .btn { flex: 1 1 auto; }
  .topbar__actions { min-width: 0; }
  .meta-chip { max-width: 190px; }
}
/* На узких экранах (в т.ч. 390–520 css px) KPI-карточки всегда в одну колонку:
   никакого обрезания второй карточки по правому краю. */
@media (max-width: 520px) {
  .grid--kpi { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .topbar__actions .btn--ghost { display: none; }
  .view { padding: 10px 10px 42px; }
  .warnbar { padding: 8px 10px 0; }
  .filterbar { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------- журнал изменений (changes.js) */
.journal-filters {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface, #fff);
}
.journal-filters .input { max-width: 260px; }
.journal-filters .filter-select { max-width: 240px; }
.journal-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.journal-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; min-width: 160px; }
.journal-field__label { font-size: 11px; font-weight: 600; color: var(--muted-2); }
.journal-field .input { width: 100%; }
.evidence-pre {
  margin: 4px 0 0; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: 6px; font-size: 10.5px; line-height: 1.35; max-height: 180px; overflow: auto;
  white-space: pre-wrap; word-break: break-word; color: var(--muted);
}
.row--manual { background: rgba(0, 209, 143, 0.05); }
.data-table--changes { min-width: 1080px; }
.data-table--changes td { vertical-align: top; }
.data-table--changes .num { white-space: nowrap; }

/* ==========================================================================
   КРУПНАЯ ТИПОГРАФИКА + ГОРИЗОНТАЛЬНЫЕ СКРОЛЛЫ  (task-7)
   Весь интерфейс крупнее на ~14%: базовый текст 14 -> 16 px,
   KPI-значения 25 -> 29 px (max), таблицы 12.5 -> 14.5 px, заголовок
   страницы 20 -> 23 px. Контролы получили большие высоты, чтобы текст не
   обрезался; фильтр-бар, таблицы и широкие блоки скроллятся по горизонтали.
   Блок добавлен в конец app.css и перекрывает более ранние правила; ниже
   идут собственные адаптивные переопределения (1160/980/820/640/520).
   ========================================================================== */

/* ---------------------------------------------------- базовый масштаб */
html { font-size: 16px; }
body {
  font-size: 16px;
  line-height: 1.55;
}
h1, h2, h3, h4 { line-height: 1.25; }
a { font-size: inherit; }

/* ------------------------------------------------------------- каркас */
.app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
:root { --sidebar-w: 280px; }
.view { padding: 20px 28px 68px; gap: 18px; }
.page-stack { gap: 18px; }
.section-head h2 { font-size: 18px; }
.section-head p { font-size: 14px; }
.page-title-row h2 { font-size: 21px; }
.page-title-row p { font-size: 14px; }
.crumb { font-size: 13px; }
.sort-note { font-size: 12.5px; }
.empty-inline { font-size: 13.5px; }
.divider { margin: 4px 0; }

/* ---------------------------------------------------------- топбар */
.topbar { padding: 16px 28px 14px; gap: 16px; }
.topbar__title h1 { font-size: 23px; }
.topbar__title p { font-size: 13.5px; margin-top: 2px; }
.topbar__actions { gap: 12px; }
.meta-chip { padding: 6px 12px; gap: 8px; max-width: 400px; }
.meta-chip__label { font-size: 11.5px; letter-spacing: 0.06em; }
.meta-chip__value { font-size: 13px; max-width: 300px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; }
.btn--icon { width: 40px; height: 40px; flex: 0 0 40px; }

/* ------------------------------------------------------------- сайдбар */
.sidebar { padding: 22px 16px 16px; gap: 14px; }
.sidebar__brand { gap: 12px; padding: 2px 6px 12px; }
.sidebar__brand svg { width: 42px; height: 42px; }
.brand-text b { font-size: 18.5px; }
.brand-text i { font-size: 11.5px; }
.nav__group { font-size: 11px; margin: 16px 10px 6px; }
.nav__item { font-size: 15px; padding: 10px 11px; gap: 11px; border-radius: 13px; }
.nav__item svg { width: 19px; height: 19px; flex-basis: 19px; }
.nav__badge { font-size: 11.5px; padding: 1.5px 8px; }
.sidebar-status { font-size: 13px; padding: 11px 12px; gap: 7px; }
.sidebar-status .small { font-size: 13px !important; }
.sidebar-hermes { padding: 11px 12px; gap: 11px; }
.sidebar-hermes__icon { width: 34px; height: 34px; font-size: 17px; border-radius: 11px; }
.sidebar-hermes b { font-size: 14px; }
.sidebar-hermes i { font-size: 12px; }
.status-dot { width: 8px; height: 8px; flex-basis: 8px; }

/* --------------------------------------------------------- фильтр-бар */
/* Горизонтальный скролл: чипы больше не переносятся и никогда не обрезаются. */
.filterbar {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 28px;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #cdd9d5 transparent;
}
.filterbar::-webkit-scrollbar { height: 6px; }
.filterbar::-webkit-scrollbar-thumb { background: #cdd9d5; border-radius: 99px; }
.filterbar__group { gap: 7px; }
.filterbar__label { font-size: 12.5px; }
.filterbar__divider { height: 26px; }
.filterbar__reset { flex: 0 0 auto; margin-left: 10px; }
.date-preset, .date-input, .filter-select {
  font-size: 13px;
  height: 34px;
  padding: 6px 12px;
}
.date-preset { max-width: 190px; }
.date-input { width: 142px; }
.filter-select { max-width: 230px; }
.fchip {
  font-size: 13px;
  height: 34px;
  padding: 5px 11px;
  gap: 6px;
}
.fchip__label { font-size: 12.5px; }
.fchip__value { max-width: 190px; }
.fchip__count { min-width: 19px; height: 19px; font-size: 11px; }
.fchip__caret { font-size: 10px; }
.btn.filterbar__reset { font-size: 13.5px; height: 32px; }

/* --------------------------------------------------------------- кнопки */
.btn {
  font-size: 14.5px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 12px;
  gap: 8px;
}
.btn--sm { font-size: 13.5px; min-height: 33px; padding: 6px 12px; border-radius: 10px; }
.btn--xs { font-size: 12.5px; min-height: 28px; padding: 4px 10px; border-radius: 9px; }
.btn--sm svg, .btn--xs svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- KPI */
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(252px, 1fr)); }
.kpi { padding: 16px 18px 17px; gap: 8px; }
.kpi__label { font-size: 12px; gap: 7px; }
.kpi__label > span:not(.badge):not(.info-btn) { font-size: 12.5px; line-height: 1.35; }
.kpi__value { font-size: clamp(22px, 2vw, 29px); }
.kpi__value small { font-size: 15px; }
.kpi__foot { font-size: 13px; gap: 9px; }
.kpi__meta { font-size: 12px; gap: 9px; flex-wrap: wrap; row-gap: 2px; }
.kpi__meta span { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.kpi__spark { height: 34px; }
.info-btn { width: 19px; height: 19px; flex-basis: 19px; font-size: 11px; }
.delta { font-size: 12.5px; padding: 2px 9px; }
.kpi__foot .badge { font-size: 11px; padding: 2px 7px; }

/* -------------------------------------------------------------- карточки */
.card { padding: 18px 20px; gap: 14px; min-width: 0; }
.card__head { flex-wrap: wrap; row-gap: 8px; gap: 12px; }
.card__title { font-size: 16.5px; gap: 8px; }
.card__sub { font-size: 13.5px; }
.card__foot { font-size: 13px; padding-top: 12px; gap: 12px; }
.card__actions { gap: 9px; }
.card__body, .card__head > div:first-child, .grid, .page-stack, .view > * { min-width: 0; }
.between { flex-wrap: wrap; }

/* --------------------------------------------------------------- таблицы */
.table-wrap {
  overflow: auto;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #cdd9d5 transparent;
  -webkit-overflow-scrolling: touch;
}
.table-wrap::-webkit-scrollbar { height: 8px; width: 10px; }
.table-wrap::-webkit-scrollbar-thumb { background: #cdd9d5; border-radius: 99px; }
table.tbl { font-size: 14.5px; }
table.tbl th { font-size: 12.5px; padding: 11px 13px; letter-spacing: 0.04em; }
table.tbl td { padding: 10px 13px; }
table.tbl .num, table.tbl .mono { font-size: 14px; }
table.tbl .mono { font-size: 13px; }
table.tbl--compact td, table.tbl--compact th { padding: 8px 11px; }
table.tbl .badge { font-size: 11.5px; }
.table-toolbar { padding: 12px 16px; gap: 10px; }
.table-search { padding: 5px 13px; min-width: 220px; max-width: 380px; }
.table-search input { font-size: 14px; padding: 4px 0; }
.table-search svg { width: 17px; height: 17px; flex-basis: 17px; }
.table-info { font-size: 13px; }
.table-actions { gap: 8px; }
.pagination { padding: 11px 16px; font-size: 13.5px; gap: 12px; }
.pagination__page { min-width: 32px; height: 32px; font-size: 13.5px; border-radius: 9px; }
.pagination__size, .pagination__select { font-size: 13px; height: 32px; padding: 4px 9px; }
.col-picker__panel { min-width: 250px; }
.col-picker__panel .opt { padding: 7px 9px; font-size: 13.5px; }

/* ----------------------------------------------------- бейджи и чипы */
.badge { font-size: 12px; padding: 2.5px 9px; gap: 6px; }
.tag { font-size: 12.5px; padding: 2px 8px; border-radius: 8px; }
.tag--id { font-size: 12px; }

/* ---------------------------------------------------------------- формы */
.input, .select, .textarea { font-size: 15px; min-height: 42px; padding: 9px 13px; border-radius: 11px; }
.input--sm, .select--sm { font-size: 13.5px; min-height: 34px; padding: 6px 10px; }
.textarea { min-height: 96px; }
.field__label { font-size: 13px; }
.help { font-size: 12.5px; }
.form-grid { gap: 14px; }
.checkbox { font-size: 14px; }
.checkbox input { width: 16px; height: 16px; flex-basis: 16px; }
.switch { font-size: 14px; }
.switch__track { width: 40px; height: 22px; }
.switch__track::after { width: 18px; height: 18px; }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.key-mask, .masked-tag { font-size: 13px; }

/* -------------------------------------------------------- поповеры */
.popover { padding: 10px; min-width: 250px; }
.popover__head { padding: 5px 7px 9px; }
.popover__head h4 { font-size: 14px; }
.popover__search { padding: 5px 10px; }
.popover__search input { font-size: 13.5px; }
.popover__list { max-height: 360px; }
.popover__opt { font-size: 14px; padding: 8px 10px; border-radius: 9px; gap: 9px; }
.popover__opt small { font-size: 12px; }
.popover__empty { font-size: 13.5px; }
.popover__foot { padding: 9px 4px 3px; }
.popover-section { font-size: 11.5px; }
.def-row { font-size: 13px; grid-template-columns: 104px 1fr; }
.def-pop h4 { font-size: 14.5px; }
.def-pop .limitations { font-size: 13px; }
.chart-tooltip { font-size: 13px; padding: 9px 12px; max-width: 340px; }
.chart-tooltip .tt-muted { font-size: 11.5px; }

/* -------------------------------------------------------- баннеры/тосты */
.banner { font-size: 14px; padding: 13px 16px; gap: 12px; line-height: 1.5; }
.banner__title { font-size: 14px; }
.banner ul { font-size: 14px; }
.warnbar { padding: 10px 28px 0; gap: 7px; }
.warnbar__row { font-size: 13.5px; padding: 9px 14px; min-height: 40px; gap: 10px; }
.warnbar__text { font-size: 13.5px; }
.warnbar__more { font-size: 13px; }
.banner__icon svg, .warnbar__row .banner__icon svg { width: 18px; height: 18px; }
.toast { font-size: 14px; padding: 12px 14px; gap: 10px; }
.toast__title { font-size: 14px; }
.toast__close { font-size: 17px; }

/* --------------------------------------------------- состояния/скелет */
.state { padding: 44px 22px; gap: 11px; }
.state__title { font-size: 15.5px; }
.state__text { font-size: 14px; }
.state__icon { width: 48px; height: 48px; font-size: 22px; }
.state__icon svg { width: 23px; height: 23px; }
.spinner { width: 30px; height: 30px; }
.skeleton--card { height: 126px; }
.skeleton--chart { height: 260px; }

/* ---------------------------------------------------------- вкладки */
.tabs { gap: 5px; }
.tab { font-size: 14px; padding: 10px 14px; gap: 7px; }
.tab__count { font-size: 11.5px; padding: 1px 7px; }
.seg { padding: 3px; }
.seg button { font-size: 13px; padding: 5px 12px; }

/* -------------------------------------------------------- задачи плана */
.task__head { padding: 15px 17px; gap: 13px; }
.task__code { font-size: 12px; padding: 2.5px 7px; }
.task__title { font-size: 15px; line-height: 1.4; }
.task__meta { gap: 8px; margin-top: 6px; }
.task__body { padding: 0 17px 17px; gap: 14px; }
.task-block__label { font-size: 11.5px; letter-spacing: 0.06em; }
.task-block__text { font-size: 14px; line-height: 1.55; }
.evidence-list { font-size: 13.5px; gap: 4px; }
.task__caret svg { width: 18px; height: 18px; }
.task-status { gap: 10px; }
.evidence-pre { font-size: 12.5px; line-height: 1.45; max-height: 240px; padding: 8px 10px; }

/* -------------------------------------------------------------- Hermes */
.hermes { grid-template-columns: 320px minmax(0, 1fr); gap: 18px; }
.hermes__threads { max-height: calc(100vh - 320px); min-height: 480px; }
.hermes__threads-head { padding: 14px 16px; }
.hermes__threads-head h3 { font-size: 15.5px; }
.thread-item { padding: 11px 12px; gap: 3px; }
.thread-item__title { font-size: 14px; }
.thread-item__meta { font-size: 12px; }
.hermes__chat { height: calc(100vh - 320px); min-height: 480px; }
.hermes-banner { font-size: 13.5px; padding: 11px 16px; }
.messages { padding: 20px 20px 10px; gap: 16px; }
.msg { max-width: 90%; }
.msg__head { font-size: 12px; gap: 8px; }
.msg__bubble { font-size: 14.5px; line-height: 1.62; padding: 13px 16px; border-radius: 16px; }
.msg__bubble code { font-size: 13px; }
.msg__bubble table { font-size: 13px; }
.msg__bubble th, .msg__bubble td { padding: 5px 10px; }
.tool-chip { font-size: 12px; padding: 3px 10px; }
.msg--tool .msg__head { font-size: 11px; }
.composer { padding: 12px 16px 14px; gap: 9px; }
.composer__box { padding: 9px 10px 9px 14px; border-radius: 15px; }
.composer textarea { font-size: 15px; line-height: 1.55; }
.composer__foot { font-size: 12px; }
.hermes-empty h2 { font-size: 19px; }
.hermes-empty p { font-size: 14.5px; }
.prompt-card { font-size: 13.5px; padding: 12px 14px; }
.prompt-grid { gap: 10px; }
.thread-list { padding: 8px; }

/* ------------------------------------------- источники, импорт, настройки */
.dropzone { padding: 30px 22px; gap: 9px; min-height: 148px; }
.dropzone__title { font-size: 14.5px; }
.dropzone__hint { font-size: 13px; }
.dropzone__icon { width: 44px; height: 44px; }
.step { font-size: 13px; }
.step__num { width: 23px; height: 23px; font-size: 12px; }
.progress { height: 10px; }
.job-row { padding: 11px 14px; gap: 12px; }
.job-row__meta { font-size: 12.5px; }
.kv-grid { font-size: 14px; gap: 8px 16px; grid-template-columns: minmax(150px, 0.8fr) minmax(0, 2fr); }
.integration-card__head { padding: 15px 17px; }
.integration-card__head h3 { font-size: 15px; }
.integration-card__body { padding: 16px 17px; gap: 14px; }
.test-result { font-size: 13.5px; padding: 10px 13px; }
.hermes-banner .btn { font-size: 13px; }
.chart__head { gap: 12px; margin-bottom: 8px; }
.chart__title { font-size: 15px; }
.chart__sub { font-size: 13px; }
.chart__legend { gap: 14px; }
.legend-item { font-size: 13px; gap: 7px; }
.legend-swatch { width: 11px; height: 11px; }
.chart__empty { font-size: 14px; min-height: 180px; }
.chart__svg { min-width: 0; }
/* Подписи осей/сегментов задаются в SVG атрибутом font-size — CSS перекрывает его. */
.chart__svg text[font-size="10.5"] { font-size: 12px; }
.chart__svg text[font-size="10"] { font-size: 11.5px; }
.chart__svg text[font-size="12"] { font-size: 13.5px; }
.chart__svg text[font-size="13.5"] { font-size: 14px; }

/* --------------------------------------------------- журнал изменений */
.journal-filters {
  gap: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}
.journal-filters::-webkit-scrollbar { height: 6px; }
.journal-filters::-webkit-scrollbar-thumb { background: #cdd9d5; border-radius: 99px; }
.journal-filters .filterbar__label { font-size: 12.5px; flex: 0 0 auto; }
.journal-filters .input { max-width: 300px; min-width: 220px; flex: 1 1 220px; }
.journal-filters .filter-select { max-width: 280px; min-width: 200px; flex: 0 0 auto; }
.journal-filters .date-input { flex: 0 0 auto; }
.journal-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.journal-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 220px; min-width: 180px; }
.journal-field__label { font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.journal-field .input { width: 100%; }
.journal-field + .journal-field { min-width: 180px; }
.card__body .journal-field { margin-top: 4px; }
.data-table--changes { min-width: 1240px; }
.data-table--changes td { vertical-align: top; }
.data-table--changes .num { white-space: nowrap; }
.data-table--changes .cell-wrap, .data-table--changes .cell-wrap.small { font-size: 13.5px; line-height: 1.5; }
.data-table--changes .evidence-pre { margin-top: 6px; }
.data-table--changes .badge { white-space: nowrap; }
.row--manual { background: rgba(0, 209, 143, 0.05); }

/* ---------------------------------------------------- адаптив (крупнее) */
@media (max-width: 1320px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1160px) {
  :root { --sidebar-w: 258px; }
  .topbar { padding: 13px 20px 11px; }
  .filterbar { padding: 9px 20px; }
  .warnbar { padding: 9px 20px 0; }
  .view { padding: 18px 20px 60px; }
  .topbar__title h1 { font-size: 20px; }
  .meta-chip__label { display: none; }
  .meta-chip { max-width: 300px; }
  .meta-chip__value { max-width: 240px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 300px; transform: translateX(-102%);
    transition: transform 0.2s ease-out; box-shadow: var(--shadow-lg); z-index: 70;
  }
  .app.nav-open .sidebar { transform: none; }
  .only-mobile { display: grid !important; }
  .topbar { position: sticky; }
  .filterbar { top: 66px; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hermes { grid-template-columns: minmax(0, 1fr); }
  .hermes__threads { position: static; max-height: 260px; min-height: 0; }
  .hermes__chat { height: auto; min-height: 64vh; max-height: none; }
  .data-table--changes { min-width: 1120px; }
}
@media (max-width: 820px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .task-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar__actions .meta-chip:first-child { display: none; }
  .filterbar { padding-bottom: 11px; }
  .journal-filters { flex-wrap: nowrap; }
  .journal-filters .input { min-width: 200px; }
}
@media (max-width: 640px) {
  .topbar { padding: 11px 12px 10px; gap: 8px; }
  .topbar__title p { display: none; }
  .topbar__title h1 { font-size: 18px; }
  .topbar__actions { gap: 6px; }
  .topbar-hermes { width: 38px; height: 38px; padding: 0; font-size: 0; border-radius: 11px; }
  .topbar-hermes span { font-size: 17px; }
  .meta-chip { padding: 5px 9px; max-width: 210px; }
  .meta-chip__value { max-width: 132px; font-size: 11.5px; }
  .filterbar { top: 60px; padding: 8px 12px; }
  .view { padding: 14px 12px 50px; gap: 13px; }
  .warnbar { padding: 9px 12px 0; }
  .warnbar__row { font-size: 13px; padding: 8px 11px; }
  .grid { gap: 13px; }
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 13px 14px; border-radius: var(--radius); }
  .kpi__value { font-size: 22px; }
  .kpi__label > span:not(.badge):not(.info-btn) { font-size: 11.5px; }
  .kpi__foot { font-size: 11.5px; }
  .kpi__meta { font-size: 11px; }
  .card { padding: 14px 14px; border-radius: var(--radius); }
  .card__title { font-size: 15px; }
  .card__sub { font-size: 12.5px; }
  .card__head { flex-wrap: wrap; align-items: flex-start; }
  .card__actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .card__actions .btn { flex: 1 1 auto; }
  .section-head h2 { font-size: 16px; }
  .page-title-row h2 { font-size: 18px; }
  .page-title-row p { font-size: 13px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .overlay { padding: 8px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 16px); }
  .modal__foot { justify-content: stretch; }
  .modal__foot .btn { flex: 1; }
  .drawer { width: 100%; }
  .table-toolbar { padding: 10px 12px; }
  .table-search { max-width: none; flex: 1 1 100%; order: -1; }
  .pagination { gap: 8px; padding: 10px 12px; }
  .messages { padding: 14px 14px 8px; gap: 14px; }
  .msg { max-width: 96%; }
  .msg__bubble { font-size: 14px; padding: 11px 13px; }
  .hermes__threads { max-height: 230px; }
  .composer textarea { font-size: 14.5px; }
  .date-preset { max-width: 160px; }
  .date-input { width: 138px; }
  .fchip__value { max-width: 130px; }
  .toasts { right: 10px; left: 10px; bottom: 12px; max-width: none; }
  .grid--kpi .kpi:nth-child(3) ~ * { grid-column: span 1; }
  .journal-form { gap: 10px; }
  .journal-field { flex: 1 1 100%; min-width: 0; }
  .journal-filters { padding: 10px 12px; }
  .journal-filters .input { min-width: 170px; max-width: 240px; }
  .journal-filters .filter-select { min-width: 170px; max-width: 240px; }
  .data-table--changes { min-width: 1080px; }
}
@media (max-width: 520px) {
  .grid--kpi { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .topbar__actions .btn--ghost { display: none; }
  .view { padding: 12px 10px 46px; }
  .warnbar { padding: 8px 10px 0; }
  .filterbar { padding: 8px 10px; }
  .meta-chip { max-width: 200px; }
  .page-title-row__actions { width: 100%; }
  .page-title-row__actions .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   АВТОРИЗАЦИЯ И РОЛИ (task-10, часть B)
   Экран входа, бейдж пользователя, состояние «Доступ ограничен».
   Стиль — та же белая тема; форм-фактор крупной типографики.
   ========================================================================== */

#login-root[hidden] { display: none !important; }

.login-screen {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  padding: 28px 18px; overflow: auto; background: var(--bg);
}
.login-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 460px at 82% -10%, rgba(0, 209, 143, 0.14), transparent 62%),
    radial-gradient(700px 380px at 8% 8%, rgba(0, 209, 143, 0.07), transparent 60%);
}
.login-card {
  position: relative; width: min(440px, 100%); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 28px 28px 22px;
  display: flex; flex-direction: column; gap: 18px;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-logo { display: inline-flex; filter: drop-shadow(0 10px 22px rgba(0, 209, 143, 0.32)); }
.login-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.login-brand__text b { font-size: 18.5px; letter-spacing: -0.02em; color: var(--deep); }
.login-brand__text i { font-style: normal; font-size: 12px; color: var(--muted-2); }
.login-heading h1 { font-size: 22px; margin: 0 0 4px; color: var(--deep); }
.login-heading p { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.login-notice {
  background: var(--warn-soft); border: 1px solid rgba(232, 131, 12, 0.28);
  color: #7d4a04; border-radius: 10px; padding: 10px 13px; font-size: 13.5px; line-height: 1.45;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field__label { font-size: 13px; font-weight: 620; color: var(--text); }
.login-input { height: 46px; font-size: 15.5px; }
.login-password { position: relative; display: flex; align-items: stretch; }
.login-password .input { padding-right: 90px; }
.login-eye {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--emerald-deep); cursor: pointer;
  font-size: 12.5px; padding: 6px 9px; border-radius: 8px;
}
.login-eye:hover { background: var(--emerald-soft); }
.login-error {
  background: var(--danger-soft); border: 1px solid rgba(217, 75, 75, 0.26);
  color: #a13232; border-radius: 10px; padding: 10px 13px; font-size: 13.5px; line-height: 1.45;
}
.login-actions { display: flex; align-items: center; gap: 10px; }
.login-submit { min-height: 46px; font-size: 15.5px; flex: 1; }
.login-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(11, 31, 30, 0.16); border-top-color: var(--emerald);
  animation: spin 0.8s linear infinite;
}
.login-foot {
  display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid var(--line-soft); padding-top: 12px;
  font-size: 11.5px; color: var(--muted-2); line-height: 1.45;
}
.login-foot__muted { color: var(--muted-2); }

/* бейдж пользователя в топбаре */
.topbar__user { display: flex; align-items: center; flex: 0 0 auto; }
.user-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 4px 4px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--white);
}
.user-badge--admin { border-color: rgba(109, 92, 231, 0.35); background: #f7f5ff; }
.user-badge__avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: #043329; font-weight: 700; font-size: 14px; flex: 0 0 34px;
}
.user-badge__info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-badge__name {
  font-size: 13px; color: var(--deep); max-width: 168px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.user-badge__role { font-size: 10.5px; font-weight: 620; color: var(--muted); }
.user-badge__role--admin { color: #5646c9; }
.user-badge__logout { margin-left: 2px; }

/* отказ в доступе для viewer (admin-only разделы) */
.access-denied .state__icon { background: #f0edff; color: #5646c9; border-color: rgba(109, 92, 231, 0.24); }
.access-denied .state__text { max-width: 560px; }

@media (max-width: 980px) {
  .user-badge__info { display: none; }
  .user-badge { gap: 4px; padding: 3px; }
  .user-badge__avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: 12.5px; }
  .user-badge__logout { margin: 0 3px 0 0; }
}
@media (max-width: 640px) {
  /* на узком топбаре оставляем заголовок, пользователя, Hermes и меню;
     мета-чипы доступны в сайдбаре и на страницах */
  .topbar__actions .meta-chip { display: none; }
  .user-badge__logout { font-size: 11.5px; padding: 3px 8px; min-height: 28px; }
  .login-card { padding: 22px 18px 18px; border-radius: var(--radius); }
  .login-heading h1 { font-size: 20px; }
}
@media (max-width: 400px) {
  .user-badge__avatar { width: 28px; height: 28px; flex-basis: 28px; }
  .user-badge__logout { padding: 2px 7px; min-height: 26px; font-size: 11px; }
  .user-badge { gap: 2px; }
  .topbar__actions { gap: 4px; }
}

/* ==========================================================================
   CRM И КАЧЕСТВО: покрытие ответов, честные null, детали строк (task-10, часть A)
   ========================================================================== */
.crm-block { min-width: 0; overflow: hidden; }
.crm-filters-card .card__head { align-items: flex-start; }
.crm-filters-card .journal-filters { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.crm-search-field { flex: 0 0 auto; min-width: 220px; }
.crm-search-field .input { width: 240px; }

.crm-status { display: flex; flex-direction: column; gap: 2px; }
.crm-cell-strong { font-weight: 620; color: var(--deep); line-height: 1.35; }
.crm-form-cell { min-width: 220px; max-width: 340px; }
.crm-comment { min-width: 180px; max-width: 300px; }
.crm-comment span {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; overflow-wrap: anywhere;
}
.crm-questions-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.crm-expand { white-space: nowrap; }
.crm-table-wrap { max-height: 680px; }
.data-table--crm { min-width: 1160px; }
.data-table--crm td { vertical-align: top; }
.data-table--crm .num { white-space: nowrap; }

/* раскрытие строки лида */
.crm-row { cursor: default; }
.crm-detail-row td { background: var(--surface-2); padding: 0 !important; }
.crm-detail { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.crm-detail__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 18px;
}
.crm-detail__cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crm-detail__label {
  font-size: 11px; font-weight: 620; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.crm-detail__value { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.crm-detail__comment, .crm-detail__questions {
  border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 4px;
}
.crm-open-questions { display: flex; flex-direction: column; gap: 3px; }
.crm-open-questions__item { font-size: 13px; color: var(--muted); }

/* честные null вместо нулей */
.crm-null-card {
  border: 1px dashed var(--line); background: var(--surface-2);
  border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.crm-null-card__label { font-size: 13px; color: var(--muted); }
.crm-null-card__value { font-size: 30px; line-height: 1.1; font-weight: 620; color: var(--muted-2); }
.crm-null-card__badge { margin: 2px 0; }
.crm-null-card__reason { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

@media (max-width: 820px) {
  .data-table--crm { min-width: 1040px; }
  .crm-search-field { min-width: 200px; }
  .crm-search-field .input { width: 220px; }
  .crm-null-card__value { font-size: 26px; }
}
@media (max-width: 640px) {
  .crm-filters-card .card__actions { width: 100%; }
  .crm-filters-card .card__actions .btn { flex: 1 1 auto; }
  .crm-search-field, .crm-search-field .input { width: 100%; min-width: 0; }
  .crm-table-wrap { max-height: none; }
  .crm-detail__grid { grid-template-columns: minmax(0, 1fr); }
}

/* Пакет обратной связи 19.10 в «Источниках» */
.source-package-card .kv-grid { grid-template-columns: minmax(110px, 0.6fr) minmax(0, 2fr); }
.source-package-card .card__body { gap: 10px; }
.source-package-hash {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border-top: 1px solid var(--line-soft); padding-top: 10px;
}
.source-package-hash code {
  background: var(--surface-3); border: 1px solid var(--line-soft);
  border-radius: 7px; padding: 2px 7px; color: var(--muted);
}
.source-package-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
}
.source-package-metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.source-package-metric b { font-size: 24px; line-height: 1.15; color: var(--deep); }
.source-package-quality { margin-top: 2px; }
.source-package-evidence { padding: 0; }
.source-package-evidence > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 620; color: var(--deep);
  border-bottom: 1px solid transparent;
}
.source-package-evidence[open] > summary { border-bottom-color: var(--line-soft); }
.source-package-evidence .table-wrap { max-height: 260px; }

@media (max-width: 640px) {
  .source-package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .source-package-metric b { font-size: 20px; }
}
/* CRM-фильтры: перенос строк вместо горизонтального скролла */
.crm-filters-card .journal-filters {
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: visible;
  gap: 10px;
}
.crm-filters-card .journal-filters .journal-field { flex: 1 1 168px; min-width: 150px; }
.crm-filters-card .crm-search-field { flex: 2 1 230px; min-width: 200px; }
/* Web-режим: бейдж пользователя занимает место в топбаре — версия данных остаётся в сайдбаре */
body.is-auth .user-badge__name { max-width: 148px; }
@media (max-width: 1600px) {
  body.is-auth #data-version-chip { display: none; }
}
@media (max-width: 1200px) {
  body.is-auth .topbar__title h1 { font-size: 21px; }
}
/* компактнее карточки пакета 19.10 */
.source-package-card .kv-grid { grid-template-columns: 82px minmax(0, 1fr); gap: 6px 12px; }
.source-package-card dd { overflow-wrap: anywhere; }
