/* Филиалы СНС — оформление: подача Apple на основе системы BFT.
   От BFT — Montserrat, фирменные синие, плашки с двумя скруглёнными диагональными углами и
   голубой градиент; от Apple — светлый фон, белые карточки с мягкими тенями, системные цвета
   состояний, полупрозрачная навигация. Анимируются только transform и opacity; при настройке
   «уменьшить движение» анимаций нет. */

:root {
  --bft-deep: #023372;
  --bft-electric: #2c39d7;
  --bft-light: #b4d2ff;
  --bft-metal: #b8c3ce;
  --bft-green: #85b521;
  --bft-orange: #f5a25b;

  --page: #f5f6f8;
  --card: #ffffff;
  --surface-alt: #f0f3f8;
  --panel: #e8ecf3;
  --ink: #0b1f3a;
  --heading: var(--bft-deep);
  --ink-muted: #66748a;
  --line: rgba(11, 31, 58, 0.09);
  --plate: var(--bft-deep);
  --on-plate: #ffffff;
  --on-plate-muted: rgba(255, 255, 255, 0.74);
  --link: var(--bft-electric);
  --focus: var(--bft-electric);
  --grad: rgba(180, 210, 255, 0.6);
  --nav-bg: rgba(245, 246, 248, 0.72);
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, 0.04), 0 6px 18px rgba(11, 31, 58, 0.06);
  --shadow-md: 0 2px 6px rgba(11, 31, 58, 0.06), 0 18px 40px rgba(11, 31, 58, 0.12);
  --shadow-accent: 0 2px 6px rgba(2, 51, 114, 0.18), 0 18px 40px rgba(2, 51, 114, 0.28);
  --shadow-thumb: 0 1px 3px rgba(11, 31, 58, 0.14), 0 1px 1px rgba(11, 31, 58, 0.06);

  /* Компании и должности: серии графиков BFT по порядку. */
  --sns: var(--bft-deep);
  --rival: #8db6f2;
  --chart-1: var(--bft-deep);
  --chart-2: #8db6f2;
  --chart-3: var(--bft-orange);
  --chart-4: var(--bft-green);
  --chart-5: var(--bft-metal);

  /* Состояние филиала — системные цвета Apple, всегда вместе с подписью. */
  --good: #34c759;
  --warn: #ffcc00;
  --risk: #ff9500;
  --crit: #ff3b30;
  --info: var(--bft-electric);

  --radius: 26px;
  --font: Montserrat, Arial, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #010d22;
    --card: #0b1a33;
    --surface-alt: #12233f;
    --panel: #1a2c4a;
    --ink: #f2f5fa;
    --heading: #ffffff;
    --ink-muted: #9aa9bf;
    --line: rgba(255, 255, 255, 0.1);
    --plate: #ffffff;
    --on-plate: var(--bft-deep);
    --on-plate-muted: rgba(2, 51, 114, 0.72);
    --link: #8fb6ff;
    --focus: #8fb6ff;
    --grad: rgba(44, 57, 215, 0.35);
    --nav-bg: rgba(1, 13, 34, 0.72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.45);
    --shadow-accent: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.45);
    --shadow-thumb: 0 1px 3px rgba(0, 0, 0, 0.5);
    --sns: #e6eefc;
    --rival: #5d8fe0;
    --chart-1: #e6eefc;
    --chart-2: #5d8fe0;
    --good: #30d158;
    --warn: #ffd60a;
    --risk: #ff9f0a;
    --crit: #ff453a;
    --info: #8fb6ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, p, ul { margin: 0; }
h1, h2 { color: var(--heading); }
h1 { font-size: clamp(38px, 5.4vw, 64px); font-weight: 600; line-height: 1.03; letter-spacing: -0.03em; }
h2 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.eyebrow { color: var(--ink-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.lead { max-width: 56ch; font-size: clamp(18px, 1.7vw, 22px); font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; }
.meta { color: var(--ink-muted); font-size: 13px; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; line-height: 1.45; }
.nowrap { white-space: nowrap; }

/* ---------- Навигация: полупрозрачный слой, контент проходит под ним ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px rgba(11, 31, 58, 0.06); }
.nav__inner { display: flex; align-items: center; gap: 28px; max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 24px; }
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--heading); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.nav__brand:hover { text-decoration: none; }
.nav__mark { width: 18px; height: 18px; border-radius: 7px 0 7px 0; background: linear-gradient(135deg, var(--bft-electric), var(--bft-deep)); }
.nav__links { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav__links::-webkit-scrollbar { display: none; }
.nav__links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.12s ease;
}
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__links a:active { transform: scale(0.97); }
.nav__links a[aria-current="page"] { color: var(--heading); background: var(--card); box-shadow: var(--shadow-thumb); }

/* ---------- Каркас ---------- */
.app { min-height: 100vh; padding-top: var(--nav-h); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hero {
  padding: 72px 0 44px;
  background:
    radial-gradient(55% 90% at 90% 0%, var(--grad), transparent 70%),
    radial-gradient(40% 80% at 0% 100%, var(--grad), transparent 70%);
}
.hero--small { padding: 56px 0 30px; }
.hero h1 { margin: 14px 0 18px; }
.hero .meta { margin-top: 18px; }
.hero__tools { margin-top: 28px; }
.section { padding: 40px 0; }
.section--tight { padding-top: 8px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.section-head p { max-width: 62ch; margin-top: 8px; }
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; }
.more { margin-top: 18px; font-size: 14px; font-weight: 500; }
.empty { padding: 32px 0; }
.footer { padding: 40px 0 64px; color: var(--ink-muted); font-size: 13px; }
.loading { display: grid; min-height: 70vh; place-content: center; }
.loading i { display: block; width: 40px; height: 40px; border-radius: 14px 0 14px 0; background: var(--panel); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- Карточки-плашки: углы BFT, тени Apple ---------- */
.plate, .card {
  position: relative;
  padding: 22px 24px;
  border-radius: var(--radius) 0 var(--radius) 0;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.card { padding: 8px 4px; }
.card--pad { padding: 24px; }
.plate.plate--accent { background: linear-gradient(150deg, #0a4596 0%, var(--bft-deep) 55%, #011f4a 100%); color: #ffffff; box-shadow: var(--shadow-accent); }
.plate--accent .kpi__label, .plate--accent .kpi__note, .plate--accent .muted { color: rgba(255, 255, 255, 0.74); }
a.plate { display: block; color: inherit; transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease); }
a.plate:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-md); }
a.plate--accent:hover { box-shadow: var(--shadow-accent); }
a.plate:active { transform: scale(0.985); transition-duration: 0.12s; }

.plate.kpi { display: flex; flex-direction: column; min-height: 156px; }
.kpi__label { color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.kpi__value { margin-top: auto; padding-top: 16px; font-size: clamp(36px, 3.4vw, 46px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpi__note { margin-top: 8px; color: var(--ink-muted); font-size: 13px; }
.kpi__spark { position: absolute; top: 22px; right: 22px; width: 84px; height: 28px; overflow: visible; }
.kpi__spark polyline { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.pair { display: grid; gap: 10px; margin-top: auto; padding-top: 16px; }
.pair div { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; }
.pair__name { color: var(--ink-muted); font-size: 13px; }
.pair__value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Цвета серий и состояний ---------- */
.s-crit { --c: var(--crit); }
.s-risk { --c: var(--risk); }
.s-warn { --c: var(--warn); }
.s-good { --c: var(--good); }
.s-info { --c: var(--info); }
.c-sns { --c: var(--sns); }
.c-rival { --c: var(--rival); }
.c-1 { --c: var(--chart-1); }
.c-2 { --c: var(--chart-2); }
.c-3 { --c: var(--chart-3); }
.c-4 { --c: var(--chart-4); }
.c-5 { --c: var(--chart-5); }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--ink-muted)) 18%, transparent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-muted)); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--ink-muted); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px 0 3px 0; background: var(--c); }

/* ---------- Кнопки, переключатели, поля ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-thumb);
  color: var(--ink-muted);
  font: 500 14px/1 var(--font);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
}
.pill:hover { color: var(--ink); }
.pill:active { transform: scale(0.97); }
.pill[aria-pressed="true"] { background: var(--heading); color: var(--card); }
.pill[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px var(--card); }
.pill .muted { color: inherit; opacity: 0.6; }

.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel); isolation: isolate; }
.seg button {
  position: relative;
  z-index: 1;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-muted);
  font: 500 14px/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.12s ease;
}
.seg button[aria-pressed="true"] { color: var(--heading); }
.seg button:active { transform: scale(0.97); }
.seg__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  z-index: 0;
  width: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-thumb);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease);
}

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; color: var(--ink-muted); font-size: 12px; font-weight: 600; }
.field--grow { flex: 1 1 220px; }
.input, .select {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: 500 14px var(--font);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:focus, .select:focus { border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); outline: none; }
.button {
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--bft-deep);
  color: #ffffff;
  font: 600 15px var(--font);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.12s ease;
}
.button:hover { opacity: 0.92; }
.button:active { transform: scale(0.97); }
.button--ghost { padding: 9px 16px; background: var(--card); box-shadow: var(--shadow-thumb); color: var(--ink); font-size: 14px; }

/* ---------- Столбики ---------- */
.bars { display: grid; gap: 2px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) 132px;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  border-radius: 12px;
  color: inherit;
  transition: background-color 0.2s ease;
}
a.bar-row:hover { background: var(--surface-alt); text-decoration: none; }
.bar-row__name { overflow: hidden; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.bar-row__value { font-size: 14px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-row__value b { font-weight: 600; }
.track { position: relative; display: block; height: 12px; }
.track > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--v) * 100%);
  min-width: 4px;
  border-radius: 0 6px 6px 0;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms + 150ms);
}
.in .track > i { transform: none; }
.bars .track::after {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: calc(var(--avg) * 100%);
  border-left: 1.5px dashed var(--ink-muted);
  opacity: 0.45;
}
.bar-row--head { padding-top: 4px; padding-bottom: 0; }
.bars .track--head { height: 18px; }
.bars .track--head::after { display: none; }
.track--head em { position: absolute; bottom: 2px; left: calc(var(--avg) * 100%); color: var(--ink-muted); font-size: 12px; font-style: normal; white-space: nowrap; transform: translateX(-50%); }

.dual { display: grid; gap: 14px; }
.dual-row { display: grid; grid-template-columns: minmax(96px, 170px) minmax(0, 1fr); align-items: center; gap: 16px; }
.dual-row__name { overflow: hidden; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.dual-row__bars { display: grid; gap: 5px; }
.dual-line { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; gap: 10px; }
.dual-line .track { height: 10px; }
.dual-line > span:last-child { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.dual .legend { margin-bottom: 4px; }

/* ---------- Сигналы ---------- */
.signals { display: grid; gap: 14px; }
.signal h3 { margin: 12px 0 6px; }
.signal p { color: var(--ink-muted); font-size: 14px; line-height: 1.6; }
.signal a { font-weight: 500; }

/* ---------- Кольцо здоровья ---------- */
.ring { position: relative; flex: none; width: 176px; height: 176px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring__track { stroke: var(--panel); }
.ring__value {
  stroke: var(--c);
  stroke-linecap: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  transition: stroke-dashoffset 1.4s var(--ease-out) 0.25s;
}
.ring.in .ring__value { stroke-dashoffset: calc(var(--len) * (1 - var(--p))); }
.ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring__label b { font-size: 46px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--heading); }
.ring__label span { margin-top: 6px; color: var(--ink-muted); font-size: 12px; }

.branch-head { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.branch-head__text { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; font-weight: 500; }
.select--inline { padding: 6px 12px; font-size: 13px; }
.reasons { display: grid; gap: 6px; margin-top: 18px; padding: 0; list-style: none; }
.reasons li { position: relative; padding-left: 20px; font-size: 15px; font-weight: 500; }
.reasons li::before { content: ""; position: absolute; top: 0.5em; left: 2px; width: 8px; height: 8px; border-radius: 3px 0 3px 0; background: var(--bft-electric); }

/* ---------- Графики SVG ---------- */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); }
.chart .axis { fill: var(--ink-muted); font: 500 11px var(--font); }
.chart .start-line { stroke: var(--ink-muted); stroke-dasharray: 4 4; opacity: 0.6; }
.chart .col rect { fill: var(--c); transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 100%; transition: transform 0.8s var(--ease-out); transition-delay: calc(var(--i) * 40ms + 150ms); }
.chart.in .col rect { transform: none; }
.chart .legend { margin-top: 14px; }

.map-wrap { position: relative; padding: 12px; }
.map { display: block; width: 100%; height: auto; overflow: visible; }
.map circle {
  fill: var(--c);
  stroke: var(--card);
  stroke-width: 1.5;
  cursor: pointer;
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.7s var(--ease-out), stroke 0.2s ease;
  transition-delay: calc(var(--d) * 1ms + 100ms), 0s;
}
.map-wrap.in circle { transform: none; }
.map circle:hover { stroke: var(--ink); stroke-width: 2.5; }
.map text {
  fill: var(--ink);
  font: 600 13px var(--font);
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease 1.1s;
}
.map-wrap.in text { opacity: 1; }

.dumbbell { display: grid; gap: 8px; }
.db-row { display: grid; grid-template-columns: minmax(96px, 170px) minmax(0, 1fr) 70px; align-items: center; gap: 16px; }
.db-row__name { overflow: hidden; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.db-track { position: relative; height: 26px; }
.db-track::before { content: ""; position: absolute; top: 50%; right: 0; left: 0; border-top: 1px solid var(--line); }
.db-link { position: absolute; top: calc(50% - 2px); left: calc(var(--a) * 100%); width: calc((var(--b) - var(--a)) * 100%); height: 4px; border-radius: 2px; background: var(--panel); }
.db-dot {
  position: absolute;
  top: 50%;
  left: calc(var(--x) * 100%);
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2.5px solid var(--card);
  border-radius: 50%;
  background: var(--c);
  box-shadow: var(--shadow-thumb);
  transform: scale(0);
  transition: transform 0.6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 40ms + 200ms);
}
.in .db-dot { transform: none; }
.db-diff { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.db-scale { display: grid; grid-template-columns: minmax(96px, 170px) minmax(0, 1fr) 70px; gap: 16px; margin-top: 6px; color: var(--ink-muted); font-size: 11px; }
.db-scale__range { display: flex; justify-content: space-between; }
.db-scale i { font-style: normal; }
.dumbbell + .db-scale, .legend + .dumbbell { margin-top: 12px; }
.summary-line { max-width: 70ch; margin-bottom: 20px; font-size: 17px; font-weight: 500; line-height: 1.5; letter-spacing: -0.005em; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  user-select: none;
}
.t th[data-action] { cursor: pointer; transition: color 0.2s ease; }
.t th[data-action]:hover { color: var(--ink); }
.t th.sorted { color: var(--heading); }
.t th.sorted::after { content: " ↓"; }
.t th.sorted.asc::after { content: " ↑"; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background-color 0.15s ease; }
.t tbody tr[data-href] { cursor: pointer; }
.t tbody tr:hover { background: var(--surface-alt); }
.t .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t .name-cell { min-width: 220px; max-width: 300px; }
.t .title-cell { min-width: 260px; }
.t .sub { display: block; margin-top: 3px; color: var(--ink-muted); font-size: 12px; line-height: 1.4; }
.t td a { font-weight: 500; }
.health-cell { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.health-cell b { width: 26px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.mini { flex: 1; height: 6px; overflow: hidden; border-radius: 3px; background: var(--panel); }
.mini i { display: block; width: calc(var(--v) * 100%); height: 100%; border-radius: 3px; background: var(--c); }
.table-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.note { max-width: 80ch; margin-top: 14px; color: var(--ink-muted); font-size: 13px; }

.prose { display: grid; gap: 14px; max-width: 70ch; }
.prose h2:not(:first-child) { margin-top: 22px; }
.prose ul { display: grid; gap: 8px; padding-left: 20px; }
.prose li::marker { color: var(--bft-electric); }

/* ---------- Подсказка ---------- */
.tooltip {
  position: fixed;
  z-index: 60;
  max-width: 300px;
  padding: 12px 14px;
  border-radius: 14px 0 14px 0;
  background: rgba(11, 31, 58, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  color: #ffffff;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.25s var(--ease);
}
.tooltip.is-on { opacity: 1; transform: none; }
.tooltip b { display: block; margin-bottom: 2px; font-size: 14px; }

/* ---------- Появление при прокрутке и смена страниц ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), box-shadow 0.45s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
a.plate.reveal.in:hover { transform: translateY(-4px); transition-delay: 0s; }
.page { animation: page-in 0.5s var(--ease-out) both; }
@keyframes page-in { from { opacity: 0; } }

/* ---------- Вход ---------- */
.login { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(60% 70% at 85% 10%, var(--grad), transparent 70%), radial-gradient(50% 60% at 10% 95%, var(--grad), transparent 70%), var(--page); }
.login__card { width: min(420px, 100%); padding: 36px; box-shadow: var(--shadow-md); }
.login__card h1 { margin: 12px 0 10px; font-size: 34px; }
.login__card form { display: grid; gap: 12px; margin-top: 26px; }
.login__error { color: var(--crit); font-size: 14px; font-weight: 600; }

@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; gap: 44px; }
  .branch-head { flex-direction: column-reverse; align-items: flex-start; }
}
@media (max-width: 640px) {
  .wrap, .nav__inner { padding: 0 16px; }
  .nav__inner { gap: 12px; }
  .nav__brand span:not(.nav__mark) { display: none; }
  .nav__links a { padding: 8px 10px; font-size: 13px; }
  .hero { padding: 40px 0 28px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { min-height: 132px; padding: 18px; }
  .bar-row { grid-template-columns: 100px minmax(0, 1fr) 54px; gap: 10px; }
  .bar-row__value .muted { display: none; }
  .db-row, .db-scale { grid-template-columns: 90px minmax(0, 1fr) 54px; gap: 10px; }
  .ring { width: 140px; height: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .track > i, .map circle, .map text, .chart .col rect, .db-dot, .page {
    animation: none !important;
    opacity: 1;
    transform: none !important;
    transition: none !important;
  }
  .ring__value { stroke-dashoffset: calc(var(--len) * (1 - var(--p))); transition: none; }
  .seg__thumb, a.plate, .pill, .tooltip { transition-duration: 0.01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--page); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .tooltip { background: #0b1f3a; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(11, 31, 58, 0.4); }
}
