/* ============================================================
   BANK PROJECT — Bold Contrast
   Final visual layer: Burgundy brand + neutral surfaces.
   Loaded after all legacy themes so light/dark tokens live here.
   Layout/data behavior stays in the existing component styles.
   ============================================================ */

:root {
  color-scheme: light;
  --brand:#9C231F;
  --bg:#F3F3F5; --surface:#FFFFFF; --raised:#F7F7F8; --raised2:#ECECEF;
  --line:#E1E1E5; --line-soft:#EEEEF1; --line-strong:#CBCBD1;
  --ink:#111113; --ink2:#3F3F45; --muted:#6F6F77; --faint:#92929B;
  --accent:#9C231F; --accent-d:#771714;
  --accent-soft:#F3DEDC; --accent-bg:#F3DEDC; --accent-tint:#FBF2F1; --accent-fg:#FFFFFF;
  --accent-2:#B83B36; --accent-ring:rgba(156,35,31,.24);
  --grad-accent:linear-gradient(135deg, #B5322D 0%, #9C231F 58%, #771714 100%);
  --accent-shadow:rgba(119,23,20,.26); --ring:0 0 0 3px rgba(156,35,31,.18);
  --ok:#2D754C; --ok-bg:#E8F1EB;
  --warn:#8B6726; --warn-bg:#F6EEDB; --warn-soft:#F6EEDB;
  --danger:#B43A42; --danger-bg:#F8E7E8; --danger-soft:#F8E7E8;
  --info:#315F94; --info-bg:#E8EFF7;
  --neutral:#686871; --neutral-bg:#EFEFF2;
  --glass:rgba(255,255,255,.92); --toast-bg:#151517; --toast-fg:#FFFFFF; --scroll:#CFCFD5;
  --shadow:0 1px 2px rgba(17,17,19,.05);
  --shadow-lg:0 12px 30px rgba(17,17,19,.12), 0 2px 6px rgba(17,17,19,.06);
  --r-sm:8px; --r:10px; --r-lg:12px;
  --serif:var(--sans);
  --shell-bg:#151517; --shell-raised:#212124; --shell-line:#303034;
  --shell-text:#F7F7F8; --shell-muted:#9B9BA3;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:#09090B; --surface:#151517; --raised:#1D1D20; --raised2:#252529;
  --line:#2D2D32; --line-soft:#222226; --line-strong:#424249;
  --ink:#F7F7F8; --ink2:#CCCCD2; --muted:#9A9AA3; --faint:#72727A;
  --accent:#DF827D; --accent-d:#CD625D;
  --accent-soft:#3A1B19; --accent-bg:#3A1B19; --accent-tint:#281413; --accent-fg:#FFFFFF;
  --accent-2:#E69A96; --accent-ring:rgba(223,130,125,.26);
  --grad-accent:linear-gradient(135deg, #C64A45 0%, #9C231F 100%);
  --accent-shadow:rgba(0,0,0,.5); --ring:0 0 0 3px rgba(217,107,102,.24);
  --ok:#68BA89; --ok-bg:#14281D;
  --warn:#D6AD61; --warn-bg:#2A2418; --warn-soft:#2A2418;
  --danger:#E17379; --danger-bg:#301A1D; --danger-soft:#301A1D;
  --info:#79A0CE; --info-bg:#172438;
  --neutral:#AAAAB2; --neutral-bg:#242428;
  --glass:rgba(9,9,11,.92); --toast-bg:#252529; --toast-fg:#F7F7F8; --scroll:#34343A;
  --shadow:0 1px 2px rgba(0,0,0,.38);
  --shadow-lg:0 14px 34px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.34);
}

/* Modern, direct hierarchy: type and shapes do the work instead of decoration. */
.page-title,
.sec-title,
.sec-head-title,
.rail-card .rc-h h3,
.sidebar .bn b,
.appbar .bn b,
.empty-title,
.err-title { font-family:var(--sans); font-weight:700; letter-spacing:-.02em; }

.eyebrow { color:var(--accent); letter-spacing:.065em; }
.card,
.rail-card,
.panel,
.summary-card,
.meet-card,
.dlog-card,
.doc-card { box-shadow:var(--shadow); }

.btn.pri { background:var(--brand); border-color:var(--brand); color:#FFFFFF; }
.btn.pri:hover { background:#771714; border-color:#771714; }
.prog-bar > i { background:var(--brand); }

/* Filled controls always use the true company Burgundy in both themes.
   The lighter dark-mode accent is reserved for text, icons and focus rings. */
.mkt-tab.on,
.seg button.on,
.flow-node.active,
.folder-chip.on {
  background:var(--brand); border-color:var(--brand); color:#FFFFFF;
}
.mkt-tab.on svg,
.flow-node.active .fn-no,
.folder-chip.on .fc-ic,
.folder-chip.on .fc-ct { color:#FFFFFF; }
.mkt-cell.today .mkt-dnum,
.mkt-today-chip,
.mcd-logo,
.mcd-sec.open .mcd-sec-h .no,
.mcd-badge.sm,
.mcd-banner .mb-top .mcd-badge,
.tl-focus-badge,
.restore-ct { background:var(--brand); color:#FFFFFF; }
.mcd-hero { background:linear-gradient(135deg, #B5322D 0%, #771714 100%); }
.mcd-sec.open { border-color:var(--brand); }
.mcd-banner { border-left-color:var(--brand); }
.mkt-hbar .tr i,
.mkt-mchart .mc-track i,
.mcd-mix-row .bar i,
.mcd-stat-row .bar i { background:var(--brand); }
.mcd-badge,
.mcd-inline-icon { display:inline-flex; align-items:center; gap:6px; }
.mcd-badge svg,
.mcd-inline-icon svg { width:15px; height:15px; flex:none; }
.mcd-empty-ic {
  width:50px; height:50px; margin:0 auto; display:grid; place-items:center;
  border-radius:12px; background:var(--accent-tint); color:var(--accent);
}
.mcd-empty-ic svg { width:27px; height:27px; }

.sec-head-ic {
  width:32px; height:32px; border-radius:8px;
  background:var(--accent-tint); color:var(--accent);
}
.sec-head-ic svg { width:18px; height:18px; stroke-width:2; }

/* Color governance: brand owns interaction; semantic colors describe state.
   Large card outlines stay neutral so pages do not become a rainbow. */
.sec-card.accent-top { border-top-color:var(--line-strong); }
.sec-card.accent-left { border-left-color:var(--line-strong); }
.nextup-card.lv-late,
.nextup-card.lv-today,
.nextup-card.lv-soon { border-color:var(--line) !important; }
.nextup-card.primary { box-shadow:0 0 0 1px var(--brand) inset, var(--shadow); }
.nextup-card.lv-late.primary,
.nextup-card.lv-today.primary,
.nextup-card.lv-soon.primary { border-color:var(--brand) !important; }

/* Company color is governed centrally; Settings explains why it is fixed. */
.brand-fixed-color {
  display:flex; align-items:center; gap:11px; min-height:48px; padding:9px 11px;
  border:1px solid var(--line); border-radius:10px; background:var(--raised);
}
.brand-fixed-swatch {
  width:30px; height:30px; flex:none; border-radius:8px; background:var(--brand);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand-fixed-color > span:nth-child(2) { display:flex; flex-direction:column; gap:1px; min-width:0; }
.brand-fixed-color b { color:var(--ink); font-size:13.5px; }
.brand-fixed-color small { color:var(--muted); font-size:11.5px; line-height:1.45; }
.brand-fixed-lock {
  margin-left:auto; flex:none; padding:3px 9px; border-radius:99px;
  background:var(--accent-tint); color:var(--accent); font-size:11px; font-weight:700;
}

/* App bar: calm neutral surface; the black shell remains the strongest anchor. */
.appbar {
  background:var(--glass); border-bottom-color:var(--line);
  box-shadow:none; backdrop-filter:saturate(120%) blur(12px);
  -webkit-backdrop-filter:saturate(120%) blur(12px);
}
.appbar .mark { background:var(--brand); box-shadow:none; color:#FFFFFF; border-radius:8px; }
.appbar .search { border-radius:9px; box-shadow:none; }

/* Mobile navigation: direct symbols live in stable square targets. */
.bottomnav { background:var(--glass); border-top-color:var(--line); }
.bottomnav a { gap:3px; color:var(--muted); }
.bottomnav a > svg {
  box-sizing:content-box; width:19px; height:19px; padding:5px;
  border-radius:8px; background:transparent; color:currentColor;
}
.bottomnav a.on { color:var(--brand); }
.bottomnav a.on > svg { background:var(--brand); color:#FFFFFF; transform:none; }

/* Executive home: clearer KPI symbols and less card-inside-card noise. */
.exec-screen {
  --exec-radius:12px;
  --exec-radius-sm:8px;
  --exec-radius-lg:14px;
  --exec-shadow:var(--shadow);
  --exec-shadow-hover:0 5px 16px rgba(17,17,19,.10);
  --exec-ok-tint:color-mix(in srgb, var(--ok-bg) 72%, var(--surface));
  --exec-warn-tint:color-mix(in srgb, var(--warn-bg) 76%, var(--surface));
  --exec-danger-tint:color-mix(in srgb, var(--danger-bg) 78%, var(--surface));
  --exec-info-tint:color-mix(in srgb, var(--info-bg) 76%, var(--surface));
  --exec-neutral-tint:var(--raised);
}
.exec-screen .exec-snapshot-card {
  background:transparent; border:0; box-shadow:none; padding:0 !important;
}
.exec-screen .exec-snapshot-card:hover { box-shadow:none; }
.exec-screen .exec-snapshot { gap:10px; }
.exec-screen .exec-stat {
  min-height:112px; justify-content:center; padding:16px;
  border-radius:10px; box-shadow:none;
}
.exec-screen .exec-stat-top { display:flex; align-items:center; gap:12px; }
.exec-screen .exec-stat-ic {
  width:34px; height:34px; border-radius:8px; display:grid; place-items:center;
  flex:none; background:var(--surface); border:1px solid currentColor;
}
.exec-screen .exec-stat-ic svg { width:19px; height:19px; stroke-width:2; }
.exec-screen .exec-stat.alert-danger .exec-stat-ic { color:var(--danger); }
.exec-screen .exec-stat.alert-warn .exec-stat-ic { color:var(--warn); }
.exec-screen .exec-stat.alert-ok .exec-stat-ic { color:var(--ok); }
.exec-screen .exec-stat.alert-info .exec-stat-ic { color:var(--info); }
.exec-screen .exec-stat .v { color:var(--ink); }
.exec-screen .exec-stat .l { font-weight:600; color:var(--ink2); }
.exec-screen .exec-stat:hover { transform:none; box-shadow:0 0 0 2px color-mix(in srgb, currentColor 16%, transparent); }

.exec-screen .sec-card { border-radius:12px; }
.exec-screen .exec-project-card { box-shadow:none; }

/* Black desktop shell in both themes: high contrast, predictable active state. */
@media (min-width:1000px) {
  .sidebar {
    background:var(--shell-bg); border-right-color:var(--shell-line);
    color:var(--shell-text); padding:14px 12px 12px;
  }
  .sidebar .mark { background:var(--brand); color:#FFFFFF; box-shadow:none; border-radius:8px; }
  .sidebar .bn b { color:var(--shell-text); }
  .sidebar .bn small,
  .sidebar .grp,
  .sidebar .grp-toggle,
  .sidebar .grp-chev { color:var(--shell-muted); }
  .sidebar .grp-toggle:hover { color:var(--shell-text); }
  .sidebar .side-collapse,
  .sidebar .side-search,
  .sidebar .side-foot {
    background:var(--shell-raised); border-color:var(--shell-line); color:var(--shell-muted);
    box-shadow:none;
  }
  .sidebar .side-collapse:hover,
  .sidebar .side-search:hover,
  .sidebar .side-foot:hover { background:#29292D; border-color:#4A4A50; color:var(--shell-text); }
  .sidebar .side-search .kbd { color:var(--shell-muted); border-color:#444449; }
  .sidebar .nav {
    min-height:46px; gap:10px; padding:7px 8px; border:1px solid transparent;
    border-radius:9px; color:#CECED4; transform:none;
  }
  .sidebar .nav .nav-ic {
    width:30px; height:30px; display:grid; place-items:center;
    border-radius:7px; background:var(--shell-raised); color:var(--shell-muted);
  }
  .sidebar .nav .nav-ic svg { width:18px; height:18px; color:currentColor; stroke-width:2; }
  .sidebar .nav:hover { background:#202023; color:var(--shell-text); transform:none; }
  .sidebar .nav:hover .nav-ic { color:var(--shell-text); }
  .sidebar .nav.on {
    background:var(--brand); border-color:var(--brand); color:#FFFFFF;
    font-weight:700; box-shadow:none; transform:none;
  }
  .sidebar .nav.on::before { display:none; }
  .sidebar .nav.on .nav-ic { background:rgba(255,255,255,.14); color:#FFFFFF; }
  .sidebar .nav.on .nav-ic svg { color:#FFFFFF; }
  .sidebar .nav .ct { color:#D2D2D7; background:#303034; }
  .sidebar .nav.on .ct { color:#FFFFFF; background:rgba(255,255,255,.18); }
  .sidebar .side-foot .ot b { color:var(--shell-text); }
  .sidebar .side-foot .ot span,
  .sidebar .side-foot .sf-switch { color:var(--shell-muted); }
  .app.nav-collapsed .sidebar:not(:hover) .grp-toggle::before { background:var(--shell-line); }
  .app.nav-collapsed .sidebar:not(:hover) .nav-dot { background:#E57A75; border-color:var(--shell-bg); }

  /* Project selector becomes a scan-friendly executive table on desktop. */
  .exec-screen .exec-project-grid {
    grid-template-columns:1fr !important; gap:0 !important;
    border-top:1px solid var(--line);
  }
  .exec-screen .exec-project-card {
    display:grid !important;
    grid-template-columns:minmax(220px, .95fr) minmax(150px, .6fr) minmax(340px, 1.55fr);
    grid-template-rows:auto auto;
    gap:10px 22px !important;
    align-items:center;
    padding:16px 4px !important;
    border:0 !important; border-bottom:1px solid var(--line) !important;
    border-radius:0 !important; background:transparent;
  }
  .exec-screen .exec-project-card:hover { background:var(--raised); box-shadow:none; transform:none; }
  .exec-screen .exec-project-head { grid-column:1; grid-row:1; }
  .exec-screen .exec-project-card .tl-alert-chips { grid-column:1; grid-row:2; }
  .exec-screen .exec-project-progress { grid-column:2; grid-row:1 / span 2; width:100%; }
  .exec-screen .exec-project-meta { grid-column:3; grid-row:1 / span 2; align-self:center; }
}

@media (max-width:999px) {
  .exec-screen .exec-snapshot-card { padding:0 !important; }
  .exec-screen .exec-stat { min-height:104px; padding:14px !important; }
  .exec-screen .exec-project-grid { grid-template-columns:1fr !important; }
  .exec-screen .exec-project-card {
    display:flex !important; flex-direction:column !important; gap:12px !important;
    padding:18px !important; background:var(--surface);
    border:1px solid var(--line) !important; border-left:0 !important; border-radius:12px !important;
  }
  .exec-screen .exec-project-progress { width:100%; }
  .exec-screen .exec-project-meta {
    display:grid !important; grid-template-columns:auto minmax(0,1fr) !important;
    column-gap:10px; row-gap:7px;
  }
  .brand-fixed-color { align-items:flex-start; flex-wrap:wrap; }
  .brand-fixed-lock { margin-left:41px; }
}

@media (prefers-reduced-motion:reduce) {
  .sidebar .nav,
  .exec-screen .exec-stat { transition:none; }
}

@media print {
  :root { --brand:#000000; --accent:#000000; }
  .sidebar, .bottomnav, .appbar { display:none !important; }
}
