/* ALLTRACE Dark Premium v2 — production visual layer.
   Presentation only: no routing, RBAC, data, or business logic changes. */
:root {
  --dp-brand: #63c833;
  --dp-brand-strong: #8fe35f;
  --dp-brand-soft: rgba(99, 200, 51, .14);
  --dp-brand-line: rgba(99, 200, 51, .28);
  --dp-bg: #090b0f;
  --dp-elevated: #0c0f14;
  --dp-surface: #121720;
  --dp-surface-2: #171d27;
  --dp-surface-3: #1b2230;
  --dp-border: #232c3a;
  --dp-border-soft: #1a222e;
  --dp-text: #f2f5f8;
  --dp-muted: #9aa5b7;
  --dp-subtle: #647087;
  --dp-blue: #5b9cff;
  --dp-purple: #9b7cf6;
  --dp-danger: #ff5c67;
  --dp-warning: #f5ad42;
  --bg: var(--dp-bg);
  --bg-elevated: var(--dp-elevated);
  --surface: var(--dp-surface);
  --surface-2: var(--dp-surface-2);
  --surface-hover: var(--dp-surface-2);
  --border: var(--dp-border);
  --border-soft: var(--dp-border-soft);
  --text-primary: var(--dp-text);
  --text-secondary: var(--dp-muted);
  --text-tertiary: var(--dp-subtle);
  --primary: var(--dp-brand);
  --primary-soft: var(--dp-brand-soft);
  --success: var(--dp-brand);
  --success-soft: var(--dp-brand-soft);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --shadow-card: 0 14px 42px -28px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.018);
  --sidebar-w: 252px;
  --header-h: 64px;
}

html, body {
  background:
    radial-gradient(900px 520px at 79% -12%, rgba(59, 130, 246, .06), transparent 62%),
    radial-gradient(620px 420px at 10% 100%, rgba(99, 200, 51, .035), transparent 68%),
    var(--dp-bg);
  color: var(--dp-text);
}

body {
  letter-spacing: -.01em;
}

/* Shell */
.app-shell {
  background: transparent;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(14,18,25,.98), rgba(9,12,17,.99)),
    var(--dp-elevated);
  border-right-color: rgba(120,140,170,.13);
  box-shadow: 18px 0 42px -38px rgba(0,0,0,.9);
}

.sidebar-brand {
  height: 82px;
  padding: 0 20px;
  border-bottom-color: rgba(120,140,170,.12);
  gap: 12px;
}

.sidebar-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  position: relative;
  background:
    linear-gradient(140deg, #9aff66 0 34%, #62d83e 35% 62%, #285f24 63% 100%);
  box-shadow: 0 0 32px rgba(99,200,51,.16);
}
.sidebar-brand-mark::before {
  content: "A";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #081009;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 21px;
}

.sidebar-brand-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.sidebar-brand-text::after {
  content: "Сеть автошкол";
  display: block;
  margin-top: 3px;
  color: var(--dp-subtle);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
}

.sidebar-nav {
  padding: 16px 10px;
  gap: 2px;
}

.nav-group-title {
  padding: 20px 12px 6px;
  font-size: 9.5px;
  letter-spacing: .09em;
  color: #63718c;
}

.nav-item {
  padding: 10px 12px;
  gap: 12px;
  border-radius: 11px;
  color: #aab5c8;
  font-size: 12.5px;
  font-weight: 560;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav-item:hover {
  background: rgba(255,255,255,.035);
  color: #f7f9fc;
}
.nav-item.active {
  color: #7ee657;
  background: linear-gradient(90deg, rgba(99,200,51,.18), rgba(99,200,51,.08));
  box-shadow: inset 0 0 0 1px rgba(99,200,51,.08);
}
.nav-item.active svg { color: #7ee657; }

.sidebar-footer {
  padding: 12px 10px 16px;
  border-top-color: rgba(120,140,170,.11);
}
.sidebar-branch-row {
  background: #121923;
  border: 1px solid rgba(128,146,174,.12);
  padding: 9px 10px;
}
.sidebar-status-row { color: #727f94; }
.sidebar-profile-row .avatar,
.header .avatar {
  background: linear-gradient(135deg, #75e64f, #43bc2c);
  border-color: rgba(142,227,95,.55);
  color: #071008;
}

/* Header */
.header {
  height: var(--header-h);
  padding: 0 24px;
  background: rgba(9,12,17,.92);
  border-bottom-color: rgba(120,140,170,.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-title {
  font-size: 15px;
  color: #e8edf5;
}

.header-city-pill {
  background: #111720;
  border-color: rgba(126,145,175,.18);
  color: #b7c0cf;
  padding: 6px 13px 6px 10px;
}

.header-search {
  height: 38px;
  max-width: 430px;
  border: 1px solid rgba(126,145,175,.12);
  background: #121821;
  border-radius: 999px;
  padding: 0 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
}
.header-search:focus-within {
  border-color: rgba(99,200,51,.34);
  box-shadow: 0 0 0 3px rgba(99,200,51,.075);
}

.icon-btn {
  width: 36px;
  height: 36px;
  background: #121821;
  border-color: rgba(126,145,175,.14);
}
.icon-btn:hover {
  border-color: rgba(99,200,51,.28);
  background: #171e29;
}
.icon-btn.primary {
  background: linear-gradient(135deg, #6edf49, #4bbb32);
  color: #071008;
  box-shadow: 0 8px 24px -12px rgba(99,200,51,.8);
}

.header-user {
  padding: 4px 6px;
  border-radius: 12px;
}
.header-user-name { color: #edf2f8; }
.header-user-role { color: #738096; }

/* Main workspace */
.main {
  padding: 26px 28px 42px;
  background:
    radial-gradient(780px 360px at 70% 0%, rgba(31,73,125,.05), transparent 75%);
}

.page-title-h1 {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -.025em;
  color: #f8fafc;
}
.page-subtitle {
  margin-bottom: 20px;
  font-size: 12px;
  color: #718097;
}

/* Cards */
.card,
.integration-card,
.occ-item-card,
.int-card {
  background:
    linear-gradient(180deg, rgba(21,27,38,.98), rgba(17,22,31,.98));
  border: 1px solid rgba(127,146,178,.14);
  border-radius: 17px;
  box-shadow: var(--shadow-card);
}
.card:hover {
  border-color: rgba(127,146,178,.2);
}

.card-header {
  border-bottom-color: rgba(127,146,178,.1);
}
.card-title,
.int-card-id,
.occ-section-title {
  color: #f1f5f9;
}

/* Tabs / toolbars */
.page-toolbar {
  gap: 10px;
}
.chip-group {
  gap: 6px;
  padding: 3px;
}
.chip {
  border: 1px solid rgba(127,146,178,.13);
  background: #121821;
  color: #8d9ab0;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11.5px;
  transition: all .15s ease;
}
.chip:hover {
  color: #eef3f8;
  border-color: rgba(127,146,178,.24);
}
.chip.active {
  color: #071008;
  background: linear-gradient(135deg, #79ea52, #55c738);
  border-color: transparent;
  box-shadow: 0 8px 24px -14px rgba(99,200,51,.85);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-ghost-int {
  border-radius: 11px;
}
.btn-primary {
  background: linear-gradient(135deg, #6ee047, #50bd33);
  color: #071008;
  border: 1px solid rgba(128,235,87,.25);
  box-shadow: 0 8px 22px -14px rgba(99,200,51,.7);
}
.btn-secondary,
.btn.btn-secondary {
  background: #141b25;
  color: #d5dce8;
  border: 1px solid rgba(130,150,182,.16);
}

.marketing-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 14px 8px 10px;
  border: 1px solid rgba(121,234,82,.26);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(121,234,82,.16), rgba(85,199,56,.07));
  color: #dfffd5;
  font: 750 12px/1 var(--font-sans);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 26px -18px rgba(99,200,51,.75);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.marketing-refresh-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(121,234,82,.5);
  background: linear-gradient(145deg, rgba(121,234,82,.24), rgba(85,199,56,.1));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 12px 28px -16px rgba(99,200,51,.9);
}
.marketing-refresh-btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.marketing-refresh-btn:disabled { cursor: wait; opacity: .8; }
.marketing-refresh-btn.compact { min-height: 34px; padding: 7px 12px 7px 9px; }
.marketing-refresh-icon {
  width: 23px;
  height: 23px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: rgba(121,234,82,.13);
  border: 1px solid rgba(121,234,82,.15);
}
.marketing-refresh-icon svg { width: 14px; height: 14px; }
.marketing-refresh-icon .spinner { width: 13px; height: 13px; border-width: 2px; }
.marketing-refresh-btn.loading .marketing-refresh-icon { background: rgba(121,234,82,.08); }
.marketing-refresh-label { white-space: nowrap; }

/* KPI / numerical emphasis */
.kpi-value,
.dcc-big-number,
.metric-value {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.03em;
  color: #fff;
}
.kpi-card {
  min-height: 118px;
  border-radius: 17px;
  background:
    radial-gradient(280px 100px at 100% 0%, rgba(76,135,255,.045), transparent 75%),
    linear-gradient(180deg, #151b26, #111720);
  border: 1px solid rgba(126,147,178,.14);
}

/* Status */
.int-status-pill.connected,
.pill.connected {
  background: rgba(99,200,51,.14);
  color: #78e653;
  border-color: rgba(99,200,51,.16);
}
.int-status-pill.warning,
.pill.warning {
  background: rgba(245,173,66,.12);
  color: #f6b34f;
}
.int-status-pill.error,
.pill.error {
  background: rgba(255,92,103,.12);
  color: #ff6d77;
}

/* Tables / rows */
table,
.table-wrap {
  border-color: rgba(126,146,177,.1);
}
th {
  color: #718096 !important;
  font-size: 10px !important;
  letter-spacing: .055em;
}
td { border-color: rgba(126,146,177,.08) !important; }
tr:hover td { background: rgba(255,255,255,.018); }

/* Marketing page: stronger panel hierarchy */
[data-marketing-ops-refresh] {
  background: #141b25;
  border-color: rgba(126,146,177,.16);
}
.dcc-learning-track {
  background: #1d2634;
}
.dcc-learning-track span {
  background: linear-gradient(90deg, #5d9cff, #76e44f);
}

/* Small premium accents */
.state-loading,
.state-empty,
.state-unknown-inline {
  color: #748198;
}
a, .link-button {
  color: #72a9ff;
}

@media (max-width: 1279px) {
  :root { --sidebar-w: 236px; }
}
@media (max-width: 767px) {
  .main { padding: 16px 12px 28px; }
  .page-title-h1 { font-size: 22px; }
  .mobile-bottom-nav {
    background: rgba(10,13,18,.96);
    backdrop-filter: blur(18px);
    border-top-color: rgba(120,140,170,.14);
  }
  .mobile-bottom-nav .bn-item.active { color: #7ee657; }
}

/* Marketing & AI — premium emphasis */
.marketing-cmo-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  background:
    radial-gradient(420px 150px at 100% 0%, rgba(99,200,51,.075), transparent 70%),
    linear-gradient(180deg, #151c26, #111720);
}
.marketing-cmo-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -120px;
  width: 260px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(99,200,51,.12), rgba(99,200,51,0) 70%);
  pointer-events: none;
}
.marketing-cmo-card .int-card-id {
  color: #7ee657;
  font-size: 13px;
}
.marketing-cmo-card .int-card-id svg {
  color: #7ee657;
}

.marketing-kpi-card {
  min-height: 116px;
  padding: 16px 17px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(150px 90px at 100% 0%, rgba(91,156,255,.07), transparent 72%),
    linear-gradient(180deg, #151c27, #111720);
}
.marketing-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
}
.marketing-kpi-card .int-card-id {
  color: #7f8ca1;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.marketing-kpi-card > div:nth-child(2) {
  font-family: var(--font-display);
  font-size: 25px !important;
  font-weight: 800 !important;
  letter-spacing: -.035em;
  color: #fff;
  margin-top: 10px !important;
}

/* Give dashboard sections a calmer Apple-like rhythm. */
.dashboard-grid {
  gap: 14px;
}
.occ-registry-row,
.occ-item-row,
.missed-item {
  border-color: rgba(126,146,177,.08);
}
.occ-registry-row {
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (min-width: 1440px) {
  .main {
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* ===== Marketing phase 2: executive composition ===== */
.marketing-exec-kpi {
  min-height: 122px;
  padding: 17px 18px;
  position: relative;
  overflow: hidden;
}
.marketing-exec-kpi::after {
  content: "";
  position: absolute;
  inset: auto -24px -34px auto;
  width: 120px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,200,51,.10), transparent 70%);
  pointer-events: none;
}
.marketing-exec-kpi-blue::after { background: radial-gradient(circle, rgba(91,156,255,.10), transparent 70%); }
.marketing-exec-kpi-purple::after { background: radial-gradient(circle, rgba(155,124,246,.10), transparent 70%); }
.marketing-exec-kpi-label {
  color: #78859a;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .065em;
}
.marketing-exec-kpi-value {
  margin-top: 12px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.04em;
}
.marketing-exec-kpi-sub {
  margin-top: 9px;
  color: #68768b;
  font-size: 11px;
}

.marketing-analytics-panel {
  padding: 18px 20px;
  min-height: 282px;
}
.marketing-panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
}
.marketing-panel-title {
  color: #f4f7fb;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -.015em;
}
.marketing-panel-sub {
  margin-top: 4px;
  color: #6f7d92;
  font-size: 11px;
}
.marketing-panel-link {
  border: 0;
  background: transparent;
  color: #72a9ff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 0;
}
.marketing-panel-link:hover { color: #96beff; }

.marketing-metric-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.marketing-metric-grid > div {
  padding: 12px 12px;
  border: 1px solid rgba(126,146,177,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.016);
}
.marketing-metric-grid span {
  display: block;
  color: #6d7b90;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.marketing-metric-grid strong {
  display: block;
  margin-top: 6px;
  color: #f8fafc;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 750;
}
.marketing-traffic-band {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(126,146,177,.10);
  border-radius: 12px;
  background: rgba(6,10,15,.28);
}
.marketing-traffic-band-title {
  color: #8d99ab;
  font-size: 10.5px;
  font-weight: 650;
}
.marketing-traffic-band-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: #7a879b;
  font-size: 11px;
}
.marketing-traffic-band-meta b {
  color: #eaf0f6;
  font-weight: 700;
}

.marketing-health-ring {
  min-width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid rgba(99,200,51,.42);
  box-shadow: inset 0 0 0 4px rgba(99,200,51,.06);
  color: #83e75f;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
}
.marketing-source-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
}
.marketing-source-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 10px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(126,146,177,.08);
}
.marketing-source-row:last-child { border-bottom: 0; }
.marketing-source-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #707b8f;
}
.marketing-source-dot.connected { background: #63c833; box-shadow: 0 0 0 4px rgba(99,200,51,.08); }
.marketing-source-dot.warning { background: #f5ad42; }
.marketing-source-dot.error { background: #ff5c67; }
.marketing-source-name {
  color: #cbd4e1;
  font-size: 11.5px;
}
.marketing-source-state {
  font-size: 10.5px;
  color: #758198;
}
.marketing-source-state.connected { color: #7ee657; }
.marketing-source-state.warning { color: #f3b85e; }
.marketing-source-state.error { color: #ff747e; }

.marketing-cmo-narrative {
  margin-top: 15px;
  color: #aeb8c8;
  font-size: 12.5px;
  line-height: 1.65;
  max-width: 1100px;
}
.marketing-ai-recommendation {
  min-height: 112px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 17px 18px;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(280px 130px at 100% 100%, rgba(99,200,51,.12), transparent 72%),
    linear-gradient(180deg, #141b25, #111720);
}
.marketing-ai-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #7ee657;
  background: rgba(99,200,51,.12);
  border: 1px solid rgba(99,200,51,.15);
}
.marketing-ai-icon svg { width: 19px; height: 19px; }
.marketing-ai-title {
  color: #7ee657;
  font-size: 12px;
  font-weight: 750;
}
.marketing-ai-title svg {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  margin-right: 5px;
}
.marketing-ai-text {
  margin-top: 4px;
  color: #aab5c6;
  font-size: 11.5px;
  line-height: 1.5;
}
.marketing-ai-action {
  white-space: nowrap;
  padding: 10px 14px;
}
.marketing-quick-actions {
  padding: 17px 18px;
}
.marketing-quick-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.marketing-section-divider {
  padding: 14px 18px;
  background: rgba(17,23,32,.72);
}

@media (max-width: 1279px) {
  .marketing-exec-kpi.span-3 { grid-column: span 6; }
  .marketing-analytics-panel.span-6 { grid-column: span 12; }
}
@media (max-width: 767px) {
  .marketing-exec-kpi.span-3 { grid-column: span 12; }
  .marketing-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .marketing-ai-recommendation {
    grid-template-columns: 38px 1fr;
  }
  .marketing-ai-action {
    grid-column: 1 / -1;
    width: 100%;
  }
  .marketing-quick-actions.span-4,
  .marketing-ai-recommendation.span-8 { grid-column: span 12; }
}

.marketing-source-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.marketing-source-reason {
  color: #667389;
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marketing-economy-note {
  margin-top: 9px;
  color: #6f7d92;
  font-size: 10.5px;
}
.marketing-economy-note strong {
  color: #9aa6b9;
  font-weight: 650;
}

/* Control Center v7 */
.marketing-control-summary {
  min-height: 104px;
  padding: 16px 18px;
  background:
    radial-gradient(160px 80px at 100% 0%, rgba(99,200,51,.05), transparent 72%),
    linear-gradient(180deg, #151c26, #111720);
}
.marketing-control-project-card {
  min-height: 220px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.marketing-control-project-card::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -80px;
  width: 170px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,156,255,.055), transparent 72%);
  pointer-events: none;
}
.marketing-control-project-card .dcc-learning-line {
  margin-top: 16px;
}
.marketing-control-project-card .dcc-learning-track {
  height: 8px;
  background: #1c2532;
}
.marketing-control-project-card .occ-item-grid {
  color: #8895a8;
  font-size: 11px;
}
.marketing-control-project-card .occ-item-grid strong {
  color: #b7c1cf;
  font-weight: 650;
}
@media (max-width: 1279px) {
  .marketing-control-project-card.span-4,
  .marketing-control-summary.span-4 { grid-column: span 6; }
}
@media (max-width: 767px) {
  .marketing-control-project-card.span-4,
  .marketing-control-summary.span-4 { grid-column: span 12; }
}

/* Control Center v8 — wide-screen composition */
.marketing-control-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.marketing-control-projects-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.marketing-control-projects-grid .marketing-control-project-card {
  grid-column: auto !important;
  min-width: 0;
  min-height: 248px;
}
.marketing-control-summary {
  min-height: 88px;
  padding: 14px 16px;
}
.marketing-control-summary .dcc-big-number {
  margin-top: 6px;
  font-size: 24px;
}
.marketing-control-project-card .int-card-id {
  font-size: 13px;
}
.marketing-control-project-card .dcc-learning-line > strong {
  font-size: 14px;
  color: #f4f7fb;
}
.marketing-control-project-card .occ-item-grid {
  grid-template-columns: 1fr;
  gap: 7px;
}
.marketing-control-project-card .dcc-next-step {
  min-height: 42px;
}
@media (max-width: 1799px) {
  .marketing-control-projects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1199px) {
  .marketing-control-summary-grid { grid-template-columns: 1fr; }
  .marketing-control-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .marketing-control-projects-grid { grid-template-columns: 1fr; }
}

/* Control Center v9 — drill-down + Supervisor */
.marketing-control-project-card {
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.marketing-control-project-card:hover,
.marketing-control-project-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(99,200,51,.28);
  outline: none;
}
.marketing-control-detail {
  margin-top: 4px;
  padding: 20px;
  background:
    radial-gradient(480px 180px at 100% 0%, rgba(99,200,51,.055), transparent 72%),
    linear-gradient(180deg, #141b25, #10161f);
}
.marketing-control-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.marketing-control-detail-name {
  color: #f7f9fc;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -.025em;
}
.marketing-control-detail-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.marketing-control-controller-banner {
  margin-top: 16px;
  padding: 13px 15px;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(99,200,51,.14);
  border-radius: 13px;
  background: rgba(99,200,51,.045);
  color: #92a0b4;
  font-size: 11px;
}
.marketing-control-controller-banner strong {
  color: #cbd4e1;
  font-weight: 680;
}
.marketing-control-detail-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.marketing-control-detail-grid > section {
  min-width: 0;
  border: 1px solid rgba(126,146,177,.10);
  border-radius: 14px;
  background: rgba(8,12,17,.26);
  overflow: hidden;
}
.marketing-control-column-head {
  min-height: 45px;
  padding: 12px 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(126,146,177,.09);
  color: #dce3ec;
  font-size: 11.5px;
  font-weight: 700;
}
.marketing-control-column-head b {
  min-width: 27px;
  padding: 3px 8px;
  text-align: center;
  border-radius: 999px;
  background: #18212d;
  color: #8f9cb0;
  font-size: 10px;
}
.marketing-control-detail-list {
  max-height: 460px;
  overflow-y: auto;
}
.marketing-control-detail-item,
.marketing-control-supervisor-action {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(126,146,177,.07);
}
.marketing-control-detail-item:last-child,
.marketing-control-supervisor-action:last-child { border-bottom: 0; }
.marketing-control-detail-item-top {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}
.marketing-control-detail-title {
  color: #d7dfe9;
  font-size: 10.8px;
  line-height: 1.4;
  font-weight: 650;
}
.marketing-control-state {
  flex: 0 0 auto;
  color: #6f7d91;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.marketing-control-detail-meta {
  margin-top: 4px;
  color: #617087;
  font-size: 9px;
  overflow-wrap: anywhere;
}
.marketing-control-detail-reason {
  margin-top: 6px;
  color: #8c99aa;
  font-size: 9.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.marketing-control-blocked-count {
  padding: 7px 12px;
  color: #ff7d86;
  background: rgba(255,92,103,.06);
  border-bottom: 1px solid rgba(255,92,103,.09);
  font-size: 9.5px;
}
.marketing-control-supervisor-column {
  border-color: rgba(99,200,51,.12) !important;
}
.marketing-control-next-action {
  padding: 11px 12px;
  color: #8fdc72;
  background: rgba(99,200,51,.045);
  border-bottom: 1px solid rgba(99,200,51,.10);
  font-size: 10px;
  line-height: 1.5;
}
@media (max-width: 1599px) {
  .marketing-control-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .marketing-control-detail-head { flex-direction: column; }
  .marketing-control-detail-grid { grid-template-columns: 1fr; }
  .marketing-control-detail-list { max-height: 340px; }
}

/* Departments v10 — drill-down agents inside Marketing & AI */
.dcc-executive-row {
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.dcc-executive-row:hover,
.dcc-executive-row:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(99,200,51,.25);
  outline: none;
}
.dcc-executive-row.org-branch-card-selected {
  border-color: rgba(99,200,51,.34);
  box-shadow: 0 0 0 1px rgba(99,200,51,.06), var(--shadow-card);
}

.dcc-executive-detail {
  margin-top: 14px;
  padding: 20px;
  background:
    radial-gradient(460px 170px at 100% 0%, rgba(91,156,255,.05), transparent 72%),
    linear-gradient(180deg, #141b25, #10161f);
}
.dcc-executive-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.dcc-executive-detail-name {
  color: #f7f9fc;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -.025em;
}
.dcc-executive-detail-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.dcc-executive-detail-summary {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.dcc-executive-detail-summary > div {
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid rgba(126,146,177,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.016);
}
.dcc-executive-detail-summary span {
  display: block;
  color: #718096;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.dcc-executive-detail-summary strong {
  display: block;
  margin-top: 7px;
  color: #f5f7fb;
  font-family: var(--font-display);
  font-size: 20px;
}
.dcc-executive-detail-warning,
.dcc-executive-detail-next {
  margin-top: 11px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 10.5px;
  line-height: 1.5;
}
.dcc-executive-detail-warning {
  color: #ff8d95;
  background: rgba(255,92,103,.06);
  border: 1px solid rgba(255,92,103,.11);
}
.dcc-executive-detail-next {
  color: #b7c3d3;
  background: rgba(99,200,51,.045);
  border: 1px solid rgba(99,200,51,.10);
}
.dcc-executive-detail-next strong { color: #8ce56c; }

.dcc-executive-agent-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}
.dcc-agent-drill-card {
  min-width: 0;
  padding: 15px;
}
.dcc-agent-drill-id {
  margin-top: 7px;
  color: #647188;
  font-size: 9px;
}
.dcc-agent-drill-id code {
  color: #78869b;
  font-size: 9px;
}
.dcc-agent-drill-work {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(126,146,177,.08);
}
.dcc-agent-drill-label {
  color: #6f7d91;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.dcc-agent-drill-summary {
  margin-top: 7px;
  color: #cbd4e1;
  font-size: 10.5px;
  line-height: 1.45;
}
.dcc-agent-drill-meta {
  margin-top: 9px;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  color: #6c7990;
  font-size: 9px;
}
.dcc-executive-recent-work {
  margin-top: 18px;
}
.dcc-executive-task-list {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(126,146,177,.08);
  border-radius: 12px;
  background: rgba(7,10,15,.22);
}
.dcc-executive-task-list .occ-item-row {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(126,146,177,.07);
}
.dcc-executive-task-list .occ-item-row:last-child {
  border-bottom: 0;
}

@media (max-width: 1599px) {
  .dcc-executive-agent-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 999px) {
  .dcc-executive-detail-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 767px) {
  .dcc-executive-detail-head { flex-direction: column; }
  .dcc-executive-agent-grid,
  .dcc-executive-detail-summary { grid-template-columns: 1fr; }
}

/* v11 Live — large-display legibility + live status */
html, body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.marketing-live-indicator,
.dcc-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8290a4;
  font-size: 10.5px;
  font-weight: 650;
}
.marketing-live-indicator::before,
.dcc-live-indicator::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #63c833;
  box-shadow: 0 0 0 4px rgba(99,200,51,.08);
}
.marketing-control-project-card .occ-item-grid {
  font-size: 11.5px;
  line-height: 1.5;
}
.marketing-control-detail-title {
  font-size: 11.5px;
  line-height: 1.45;
}
.marketing-control-detail-meta {
  font-size: 10px;
  line-height: 1.4;
}
.marketing-control-detail-reason {
  font-size: 10.5px;
  line-height: 1.55;
}
.marketing-control-state {
  font-size: 9.5px;
}
.marketing-control-next-action {
  font-size: 11px;
  line-height: 1.55;
}
.dcc-agent-drill-label {
  font-size: 10px;
}
.dcc-agent-drill-id,
.dcc-agent-drill-id code {
  font-size: 10px;
}
.dcc-agent-drill-summary {
  font-size: 11.5px;
  line-height: 1.5;
}
.dcc-agent-drill-meta {
  font-size: 10px;
}
.dcc-executive-detail-warning,
.dcc-executive-detail-next {
  font-size: 11px;
}
.dcc-executive-row .dcc-next-step {
  font-size: 10.5px;
  line-height: 1.5;
}

@media (min-width: 1800px) {
  .page-title-h1 { font-size: 28px; }
  .page-subtitle { font-size: 12.5px; }
  .chip { font-size: 12px; padding: 8px 13px; }
  .marketing-control-project-card .int-card-id,
  .dcc-executive-row .int-card-id { font-size: 13.5px; }
  .marketing-control-project-card .occ-item-grid { font-size: 12px; }
  .marketing-control-detail-title,
  .dcc-agent-drill-summary { font-size: 12px; }
  .marketing-control-detail-meta,
  .dcc-agent-drill-meta { font-size: 10.5px; }
}

/* v12 — direct agent command controls */
.dcc-agent-capabilities {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(126,146,177,.08);
}
.dcc-agent-capability-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.dcc-agent-capability-list > span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #151d28;
  border: 1px solid rgba(126,146,177,.10);
  color: #8d9aae;
  font-size: 9px;
}
.dcc-agent-automation-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: #65738a;
  font-size: 9px;
}
.dcc-agent-automation-row strong { color: #98a5b8; }
.dcc-agent-command-actions {
  margin-top: 12px;
}
.dcc-agent-command-selected {
  border-color: rgba(99,200,51,.30);
  box-shadow: 0 0 0 1px rgba(99,200,51,.06), var(--shadow-card);
}
.dcc-agent-command-form {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(99,200,51,.14);
  border-radius: 12px;
  background: rgba(99,200,51,.035);
}
.dcc-agent-command-target {
  color: #aeb9c8;
  font-size: 10.5px;
  margin-bottom: 8px;
}
.dcc-agent-command-target strong { color: #7ee657; }
.dcc-agent-command-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 78px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid rgba(126,146,177,.16);
  background: #0e141d;
  color: #edf2f7;
  font: inherit;
  font-size: 11px;
  line-height: 1.45;
}
.dcc-agent-command-form textarea:focus {
  outline: none;
  border-color: rgba(99,200,51,.34);
  box-shadow: 0 0 0 3px rgba(99,200,51,.06);
}
.dcc-agent-command-form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}
.dcc-agent-command-result {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(99,200,51,.07);
  color: #9db08e;
  font-size: 10px;
}
.dcc-agent-command-result strong { color: #7ee657; }

/* v14 — global typography clarity on every CRM page */
:root {
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", Menlo, Monaco, Consolas, monospace;

  --text-primary: #f7f9fc;
  --text-secondary: #b7c1cf;
  --text-tertiary: #8794a8;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-sans);
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-synthesis: none;
}

body {
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font-size: 13px;
}

.page-title-h1,
.header-title,
.sidebar-brand-text,
.card-title,
.marketing-panel-title,
.dcc-executive-detail-name,
.marketing-control-detail-name {
  font-family: var(--font-display);
  letter-spacing: -0.018em;
}

.page-subtitle {
  color: #a6b1c1;
  font-size: 12.5px;
  line-height: 1.5;
}

.nav-item {
  color: #bac4d2;
  font-size: 13.5px;
  font-weight: 600;
}

.nav-group-title {
  color: #8996aa;
  font-size: 11px;
  font-weight: 750;
}

.sidebar-status-row,
.sidebar-branch-row select,
.sidebar-branch-static {
  font-size: 12.5px;
}

.header-search input {
  font-size: 13.5px;
}

.header-city-pill,
.header-user-name {
  font-size: 12.5px;
}

.chip {
  font-size: 12px;
  font-weight: 650;
}

.card,
.integration-card,
.int-card,
.occ-item-card {
  color: #dbe2eb;
}

.int-card-id,
.occ-section-title {
  color: #e8edf4;
  font-size: 11.5px;
  font-weight: 700;
}

.int-status-pill,
.pill {
  font-size: 10.5px;
  font-weight: 700;
}

.state-empty,
.state-loading,
.state-error,
.state-success,
.state-unknown-inline {
  font-size: 11.5px;
  line-height: 1.5;
}

table {
  font-size: 12.5px;
}

th {
  color: #96a3b5 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

td {
  color: #d0d8e3;
  line-height: 1.45;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  -webkit-font-smoothing: auto;
}

.kpi-value,
.metric-value,
.dcc-big-number,
.marketing-exec-kpi-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Small operational text was too faint on a non-Retina external display. */
.occ-item-grid,
.occ-item-row,
.dcc-next-step,
.dcc-agent-drill-meta,
.dcc-agent-drill-id,
.dcc-agent-drill-id code,
.dcc-agent-automation-row,
.dcc-agent-capability-list > span,
.marketing-control-detail-meta,
.marketing-control-state,
.marketing-source-reason,
.marketing-economy-note {
  color: #93a0b2;
}

@media (min-width: 1600px) {
  body {
    font-size: 14.5px;
  }

  .nav-item {
    font-size: 14px;
  }

  .page-title-h1 {
    font-size: 29px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .int-card-id,
  .occ-section-title {
    font-size: 12px;
  }

  .dcc-agent-drill-summary,
  .marketing-control-detail-title,
  .dcc-executive-detail-next,
  .dcc-executive-detail-warning {
    font-size: 12px;
  }

  .dcc-agent-drill-meta,
  .marketing-control-detail-meta,
  .dcc-agent-capability-list > span {
    font-size: 10.5px;
  }
}

@media (max-width: 767px) {
  body {
    font-size: 13.5px;
  }
}

/* v15 — global Light / Dark / Auto appearance */
.theme-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 9px 0 10px;
  border: 1px solid rgba(126,145,175,.14);
  border-radius: 11px;
  background: #121821;
  color: #8d9ab0;
}
.theme-control-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.theme-control select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e6ecf3;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.theme-control select option {
  background: #111720;
  color: #eef3f8;
}

/* Light palette is applied through the root data-theme attribute so every
   existing page keeps the same component tree and business logic. */
html[data-theme="light"] {
  --dp-brand: #4fb82c;
  --dp-brand-strong: #3f9d22;
  --dp-brand-soft: rgba(79,184,44,.12);
  --dp-brand-line: rgba(79,184,44,.22);

  --dp-bg: #f3f5f8;
  --dp-elevated: #ffffff;
  --dp-surface: #ffffff;
  --dp-surface-2: #f7f9fc;
  --dp-surface-3: #eef2f7;
  --dp-border: #d8dee8;
  --dp-border-soft: #e5e9f0;

  --dp-text: #18212f;
  --dp-muted: #526177;
  --dp-subtle: #75849a;
  --dp-blue: #3478f6;
  --dp-purple: #7c5ce7;
  --dp-danger: #d83d49;
  --dp-warning: #c98216;

  --bg: var(--dp-bg);
  --bg-elevated: var(--dp-elevated);
  --surface: var(--dp-surface);
  --surface-2: var(--dp-surface-2);
  --surface-hover: #eef3f8;
  --border: var(--dp-border);
  --border-soft: var(--dp-border-soft);
  --text-primary: var(--dp-text);
  --text-secondary: var(--dp-muted);
  --text-tertiary: var(--dp-subtle);
  --primary: var(--dp-brand);
  --primary-soft: var(--dp-brand-soft);
  --success: var(--dp-brand);
  --success-soft: var(--dp-brand-soft);

  color-scheme: light;
}

html[data-theme="light"] body {
  background:
    radial-gradient(900px 520px at 79% -12%, rgba(52,120,246,.05), transparent 62%),
    linear-gradient(180deg, #f7f9fc, #f2f5f8);
  color: #18212f;
}

html[data-theme="light"] .app-shell {
  background: transparent;
}

html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #fbfcfe, #f6f8fb);
  border-right-color: #dfe5ed;
  box-shadow: 14px 0 32px -32px rgba(33,45,62,.35);
}

html[data-theme="light"] .sidebar-brand {
  border-bottom-color: #e4e9f0;
}

html[data-theme="light"] .sidebar-brand-text,
html[data-theme="light"] .header-title,
html[data-theme="light"] .header-user-name {
  color: #152033;
}

html[data-theme="light"] .nav-item {
  color: #536278;
}

html[data-theme="light"] .nav-item:hover {
  background: #eef3f7;
  color: #172235;
}

html[data-theme="light"] .nav-item.active {
  background: linear-gradient(90deg, rgba(79,184,44,.15), rgba(79,184,44,.07));
  color: #3f9d22;
}

html[data-theme="light"] .nav-group-title {
  color: #7d8ca1;
}

html[data-theme="light"] .sidebar-branch-row,
html[data-theme="light"] .header-search,
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .theme-control {
  background: #ffffff;
  border-color: #dce3ec;
  color: #5a687d;
}

html[data-theme="light"] .sidebar-status-row {
  color: #68778d;
}

html[data-theme="light"] .header {
  background: rgba(255,255,255,.94);
  border-bottom-color: #dfe5ec;
  box-shadow: 0 8px 24px -24px rgba(30,43,58,.35);
}

html[data-theme="light"] .header-search input,
html[data-theme="light"] .theme-control select {
  color: #182335;
}

html[data-theme="light"] .theme-control select option {
  background: #fff;
  color: #182335;
}

html[data-theme="light"] .header-city-pill {
  background: #fff;
  border-color: #dce3ec;
  color: #56657a;
}

html[data-theme="light"] .main {
  background:
    radial-gradient(780px 360px at 70% 0%, rgba(52,120,246,.035), transparent 75%);
}

html[data-theme="light"] .page-title-h1,
html[data-theme="light"] .card-title,
html[data-theme="light"] .int-card-id,
html[data-theme="light"] .occ-section-title,
html[data-theme="light"] .marketing-panel-title,
html[data-theme="light"] .dcc-executive-detail-name,
html[data-theme="light"] .marketing-control-detail-name {
  color: #172235;
}

html[data-theme="light"] .page-subtitle {
  color: #68778c;
}

html[data-theme="light"] .card,
html[data-theme="light"] .integration-card,
html[data-theme="light"] .occ-item-card,
html[data-theme="light"] .int-card,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .marketing-kpi-card,
html[data-theme="light"] .marketing-exec-kpi,
html[data-theme="light"] .marketing-analytics-panel,
html[data-theme="light"] .marketing-control-summary,
html[data-theme="light"] .marketing-control-project-card,
html[data-theme="light"] .marketing-control-detail,
html[data-theme="light"] .dcc-executive-detail,
html[data-theme="light"] .dcc-agent-drill-card {
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border-color: #dce3ec;
  box-shadow: 0 10px 28px -24px rgba(28,42,58,.32);
  color: #273447;
}

html[data-theme="light"] .marketing-cmo-card,
html[data-theme="light"] .marketing-ai-recommendation {
  background:
    radial-gradient(320px 140px at 100% 0%, rgba(79,184,44,.07), transparent 72%),
    linear-gradient(180deg, #ffffff, #f9fbfd);
}

html[data-theme="light"] .marketing-cmo-narrative,
html[data-theme="light"] .marketing-ai-text,
html[data-theme="light"] .marketing-panel-sub,
html[data-theme="light"] .marketing-exec-kpi-sub,
html[data-theme="light"] .dcc-executive-meta,
html[data-theme="light"] .dcc-agent-drill-summary,
html[data-theme="light"] .marketing-control-detail-reason {
  color: #657489;
}

html[data-theme="light"] .marketing-exec-kpi-value,
html[data-theme="light"] .dcc-big-number,
html[data-theme="light"] .kpi-value,
html[data-theme="light"] .metric-value,
html[data-theme="light"] .marketing-metric-grid strong {
  color: #172235;
}

html[data-theme="light"] .marketing-metric-grid > div,
html[data-theme="light"] .marketing-traffic-band,
html[data-theme="light"] .dcc-executive-detail-summary > div,
html[data-theme="light"] .dcc-executive-task-list,
html[data-theme="light"] .marketing-control-detail-grid > section {
  background: #f8fafc;
  border-color: #dde4ed;
}

html[data-theme="light"] .marketing-source-row,
html[data-theme="light"] .marketing-control-detail-item,
html[data-theme="light"] .marketing-control-supervisor-action,
html[data-theme="light"] .occ-registry-row,
html[data-theme="light"] .occ-item-row {
  border-color: #e5e9f0;
}

html[data-theme="light"] .marketing-source-name,
html[data-theme="light"] .marketing-control-detail-title,
html[data-theme="light"] .dcc-agent-drill-summary,
html[data-theme="light"] .dcc-executive-detail-summary strong,
html[data-theme="light"] td {
  color: #273447;
}

html[data-theme="light"] .marketing-source-reason,
html[data-theme="light"] .marketing-control-detail-meta,
html[data-theme="light"] .dcc-agent-drill-meta,
html[data-theme="light"] .dcc-agent-drill-id,
html[data-theme="light"] .dcc-agent-drill-id code,
html[data-theme="light"] .dcc-agent-automation-row {
  color: #718096;
}

html[data-theme="light"] .chip {
  background: #fff;
  border-color: #dce3ec;
  color: #5f6d80;
}

html[data-theme="light"] .chip:hover {
  color: #172235;
  border-color: #c9d2de;
}

html[data-theme="light"] .chip.active {
  background: linear-gradient(135deg, #69d940, #4eb92e);
  color: #0d1b0b;
}

html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn.btn-secondary,
html[data-theme="light"] .btn-ghost-int {
  background: #fff;
  color: #344258;
  border-color: #d6dee8;
}

html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .btn.btn-secondary:hover,
html[data-theme="light"] .btn-ghost-int:hover {
  background: #f0f4f8;
}

html[data-theme="light"] table,
html[data-theme="light"] .table-wrap {
  border-color: #dde4ed;
}

html[data-theme="light"] th {
  color: #6b788b !important;
}

html[data-theme="light"] td {
  border-color: #e6ebf1 !important;
}

html[data-theme="light"] tr:hover td {
  background: #f6f8fb;
}

html[data-theme="light"] .notifications-panel,
html[data-theme="light"] .bn-more-sheet,
html[data-theme="light"] .mobile-bottom-nav {
  background: #fff;
  border-color: #dde4ed;
  color: #273447;
}

html[data-theme="light"] .notification-row.unread {
  background: #f4f7fa;
}

html[data-theme="light"] .dcc-learning-track,
html[data-theme="light"] .marketing-control-project-card .dcc-learning-track {
  background: #e6ebf1;
}

html[data-theme="light"] .marketing-control-controller-banner,
html[data-theme="light"] .dcc-executive-detail-next,
html[data-theme="light"] .dcc-agent-command-form {
  background: rgba(79,184,44,.05);
  border-color: rgba(79,184,44,.18);
}

html[data-theme="light"] .dcc-agent-command-form textarea {
  background: #fff;
  color: #172235;
  border-color: #cfd8e4;
}

html[data-theme="light"] .dcc-agent-capability-list > span {
  background: #f0f4f8;
  border-color: #dae2ec;
  color: #5b6a7f;
}

html[data-theme="light"] .marketing-control-blocked-count,
html[data-theme="light"] .dcc-executive-detail-warning {
  background: rgba(216,61,73,.055);
  color: #c53440;
}

html[data-theme="light"] .state-empty,
html[data-theme="light"] .state-loading,
html[data-theme="light"] .state-unknown-inline {
  color: #758399;
}

/* Auto mode is resolved to data-theme=light/dark by app.js and reacts to
   matchMedia changes live, so no separate media-query component tree exists. */

@media (max-width: 767px) {
  .theme-control-label {
    display: none;
  }
  .theme-control {
    padding: 0 7px;
    height: 34px;
  }
  .theme-control select {
    font-size: 11px;
  }
}

/* v16 — live execution vs Fabric roadmap */
.marketing-control-roadmap-label {
  margin-top: 12px;
  color: var(--text-tertiary);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* v17 — official ALLTRACE website logo */
.sidebar-brand {
  overflow: hidden;
}
.sidebar-brand-logo {
  display: block;
  width: 158px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
  image-rendering: auto;
}
.login-brand-logo {
  display: block;
  width: min(240px, 78%);
  height: auto;
  margin: 0 auto 18px;
  object-fit: contain;
  image-rendering: auto;
}
.app-shell.sidebar-toggled .sidebar-brand-logo {
  width: 158px;
  max-width: none;
  transform: translateX(0);
}
@media (max-width: 767px) {
  .sidebar-brand-logo { width: 146px; }
}

/* v18 — brand lockup: symbol + ALLTRACE only; keep original website asset intact */
.sidebar-brand-logo,
.login-brand-logo {
  clip-path: inset(0 0 27% 0);
}
.sidebar-brand-logo {
  margin-bottom: -10px;
}
.login-brand-logo {
  margin-bottom: -18px;
}

/* v18 — ALLTRACE-only brand, no "СЕТЬ АВТОШКОЛ" tagline */
.alltrace-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}
.alltrace-brand-symbol,
.alltrace-brand-word {
  display: block;
  object-fit: contain;
  image-rendering: auto;
  flex: 0 0 auto;
}
.alltrace-brand-sidebar {
  width: 100%;
  min-width: 0;
}
.alltrace-brand-sidebar .alltrace-brand-symbol {
  width: 34px;
  height: 39px;
}
.alltrace-brand-sidebar .alltrace-brand-word {
  width: 118px;
  height: auto;
  max-height: 30px;
}
.alltrace-brand-login {
  justify-content: center;
  margin: 0 auto 18px;
}
.alltrace-brand-login .alltrace-brand-symbol {
  width: 48px;
  height: 55px;
}
.alltrace-brand-login .alltrace-brand-word {
  width: 174px;
  height: auto;
  max-height: 44px;
}
/* Neutralize the previous v17 whole-image sizing rules. */
.sidebar-brand-logo,
.login-brand-logo { display: none !important; }
.app-shell.sidebar-toggled .alltrace-brand-sidebar {
  justify-content: flex-start;
}
.app-shell.sidebar-toggled .alltrace-brand-sidebar .alltrace-brand-word {
  display: none;
}
@media (max-width: 767px) {
  .alltrace-brand-sidebar .alltrace-brand-symbol { width: 32px; height: 37px; }
  .alltrace-brand-sidebar .alltrace-brand-word { width: 110px; }
}

/* v20 — exact ALLTRACE lockup geometry from the original 480x135 asset */
.alltrace-brand {
  align-items: flex-end;
  gap: 0;
}
.alltrace-brand-sidebar .alltrace-brand-symbol {
  width: 34px;
  height: 39px;
}
.alltrace-brand-sidebar .alltrace-brand-word {
  width: 105px;
  height: auto;
  max-height: none;
}
.alltrace-brand-login .alltrace-brand-symbol {
  width: 48px;
  height: 55px;
}
.alltrace-brand-login .alltrace-brand-word {
  width: 148px;
  height: auto;
  max-height: none;
}
@media (max-width: 767px) {
  .alltrace-brand-sidebar .alltrace-brand-symbol { width: 32px; height: 37px; }
  .alltrace-brand-sidebar .alltrace-brand-word { width: 99px; }
}
