/* ============================================================
   ds12-branding.20261016.css — усиленный брендинг.
   Раньше --c-accent был жёстко зашит в ds1/ds6, поэтому смена
   персональных цветов почти не влияла на интерфейс. Теперь вся
   палитра выводится из ОДНОЙ переменной --brand (её ставит
   ds12-branding.js из ?brand=… / setBrandAccent()), а акцент
   видно в меню, кнопках, заголовках, KPI и фокусе.
   ============================================================ */

:root {
  --brand: #17362C;                                          /* базовый цвет бренда */
  --brand-contrast: #FFFFFF;
  /* производные тона считаются из --brand, поэтому любой цвет даёт целостную палитру */
  --c-accent: var(--brand);
  --c-accent-hover: color-mix(in srgb, var(--brand) 82%, #000);
  --c-accent-text: #FFFFFF;
  --c-accent-soft: color-mix(in srgb, var(--brand) 10%, #FFFFFF);
  --c-accent-soft-text: color-mix(in srgb, var(--brand) 80%, #000);
  --c-accent-border: color-mix(in srgb, var(--brand) 34%, #FFFFFF);
  --c-focus: color-mix(in srgb, var(--brand) 55%, #3B82F6);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
  --brand-tint-1: color-mix(in srgb, var(--brand) 6%, #FFFFFF);
  --brand-tint-2: color-mix(in srgb, var(--brand) 12%, #FFFFFF);
  --brand-line: color-mix(in srgb, var(--brand) 40%, #FFFFFF);
}
[data-theme="dark"] {
  /* в тёмной теме акцент светлеет, иначе он «тонет» в фоне */
  --c-accent: color-mix(in srgb, var(--brand) 58%, #FFFFFF);
  --c-accent-hover: color-mix(in srgb, var(--brand) 44%, #FFFFFF);
  --c-accent-soft: color-mix(in srgb, var(--brand) 24%, #0F1513);
  --c-accent-soft-text: color-mix(in srgb, var(--brand) 40%, #FFFFFF);
  --c-accent-border: color-mix(in srgb, var(--brand) 40%, #17201D);
  --brand-tint-1: color-mix(in srgb, var(--brand) 14%, #0F1513);
  --brand-tint-2: color-mix(in srgb, var(--brand) 24%, #0F1513);
  --brand-line: color-mix(in srgb, var(--brand) 45%, #17201D);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-accent: color-mix(in srgb, var(--brand) 58%, #FFFFFF);
    --c-accent-hover: color-mix(in srgb, var(--brand) 44%, #FFFFFF);
    --c-accent-soft: color-mix(in srgb, var(--brand) 24%, #0F1513);
    --c-accent-soft-text: color-mix(in srgb, var(--brand) 40%, #FFFFFF);
  }
}

/* ---------- 1. Меню: бренд виден сразу ---------- */
html body .sidebar { border-left: 4px solid var(--brand) !important; }
html body .sidebar .brand-mark {
  background: var(--brand) !important;
  color: var(--brand-contrast) !important;
  box-shadow: 0 0 0 3px var(--brand-tint-2) !important;
}
html body .sidebar .nav-list .nav-link.active.active,
html body .mobile-menu-panel .nav-link.active.active,
html body .nav-list .nav-link.active,
html body .mobile-menu-panel .nav-link.active {
  background: var(--brand) !important;
  color: var(--brand-contrast) !important;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--brand) 30%, #FFFFFF) !important;
}
html body .nav-list .nav-link.active span,
html body .nav-list .nav-link.active b,
html body .mobile-menu-panel .nav-link.active span { color: var(--brand-contrast) !important; }
html body .nav-list .nav-link:hover,
html body .mobile-menu-panel .nav-link:hover { background: var(--brand-tint-2) !important; }
html body .sidebar .tenant-card { border-left: 3px solid var(--brand) !important; }

/* ---------- 2. Заголовок раздела и заголовки панелей ---------- */
html body .topbar h1, html body h1#screen-title {
  border-bottom: 3px solid var(--brand) !important;
  display: inline-block !important;
  padding-bottom: 4px !important;
}
html body .topbar .eyebrow, html body #screen-kicker {
  color: var(--c-accent) !important;
  border-color: var(--brand-line) !important;
  background: var(--brand-tint-1) !important;
}
html body .panel-head h3::before,
html body .dashboard-widget .panel-head h3::before {
  content: '' !important;
  display: inline-block !important;
  width: 4px; height: 15px;
  background: var(--brand) !important;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: -2px;
}

/* ---------- 3. Кнопки и ссылки ---------- */
html body button.primary, html body .primary,
html body .op-btn--primary, html body .btn--primary,
html body #screen-stage button.primary {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: var(--brand-contrast) !important;
}
html body #screen-stage a, html body .screen-stage a { color: var(--c-accent) !important; }
html body :focus-visible { outline: 2px solid var(--c-accent) !important; outline-offset: 2px !important; }

/* ---------- 4. Цифры и метрики — фирменным цветом ---------- */
html body .kpi__value, html body .op-kpi__value, html body .metric-card b,
html body .metric-row b, html body .wide-bars b, html body .analytics-kpi-inline .metric-value {
  color: var(--c-accent) !important;
}
html body .mini-bar i, html body .op-bar__fill, html body .progress i { background: var(--brand) !important; }
html body .metric-chip.active, html body .dashboard-builder-toggle.is-active {
  border-color: var(--brand) !important;
  box-shadow: inset 0 -2px 0 var(--brand) !important;
}

/* ---------- 5. Плашки и чипы ---------- */
html body .lead-channel, html body .unified-row-channel, html body .vp-cw-chip,
html body #screen-stage .chip, html body .badge.brand {
  border-color: var(--brand-line) !important;
  background: var(--brand-tint-1) !important;
  color: var(--c-accent-soft-text) !important;
}
html body .owner-message-status.manual,
html body .owner-message-status {
  border-color: var(--c-accent-border) !important;
  color: var(--c-accent-soft-text) !important;
}
