/**
 * dt-global.css — Deeltrack Global Design System
 * Injected on every page via sp-core.js
 * This file WINS over all per-page CSS for layout + sidebar + nav.
 */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   MUBASIC-INSPIRED THEME — warm light palette with bold typography
   
   Palette extracted from mubasic-test.webflow.io:
   - Body bg:      #F3F3F3  (warm off-white)
   - Text primary: #1B1A19  (near-black, warm)
   - Accent amber: #FAC670  (golden yellow)
   - Accent orange:#F37925  (vivid orange — primary interactive)
   - Accent teal:  #91C3CE
   - Accent sand:  #F5E1BE
   - Accent lavender: #C0A8E6
   - Surface:      #FFFFFF
   - Sidebar:      #1B1A19  (dark warm sidebar)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  --dt-sidebar-width: 240px;

  /* Core palette */
  --dt-bg:            #F3F3F3;
  --dt-surface:       #FFFFFF;
  --dt-surface-2:     #EDEBE8;
  --dt-border:        #E2DDD8;
  --dt-border-subtle: rgba(27,26,25,0.1);

  /* Typography */
  --dt-text:          #1B1A19;
  --dt-text-muted:    #6B6560;
  --dt-text-light:    #9C9590;
  --dt-primary:       #1B1A19;

  /* Brand accents — mubasic palette */
  --dt-accent:        #F37925;    /* vivid orange — primary CTA */
  --dt-accent-hover:  #D96515;    /* darker orange for hover */
  --dt-accent-light:  rgba(243,121,37,0.12);
  --dt-accent2:       #FAC670;    /* warm amber — highlights */
  --dt-teal:          #91C3CE;
  --dt-sand:          #F5E1BE;
  --dt-lavender:      #C0A8E6;

  /* Semantic */
  --dt-success:       #2D9A6B;
  --dt-success-light: rgba(45,154,107,0.12);
  --dt-warning:       #F37925;
  --dt-warning-light: rgba(243,121,37,0.12);
  --dt-danger:        #D94F3D;
  --dt-danger-light:  rgba(217,79,61,0.12);

  /* Elevation */
  --dt-radius:        10px;
  --dt-shadow-sm:     0 1px 3px rgba(27,26,25,0.08), 0 1px 2px rgba(27,26,25,0.05);
  --dt-shadow-md:     0 4px 8px -1px rgba(27,26,25,0.1), 0 2px 4px -1px rgba(27,26,25,0.06);
  --dt-shadow-lg:     0 12px 24px -4px rgba(27,26,25,0.12), 0 4px 8px -2px rgba(27,26,25,0.06);
  --dt-transition:    all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { 
  font-family: 'Inter', system-ui, -apple-system, sans-serif; 
  background: var(--dt-bg) !important;
  color: var(--dt-text) !important;
  min-height: 100vh;
  overflow-x: hidden;
}
/* Auth pages (login, signup, reset-password) use flex centering — don't override */
html:not([data-page="auth"]) body {
  display: block !important;
}

/* ── SIDEBAR — dark warm rail (matches mubasic's dark nav) ───────────────── */
.sidebar,
aside.sidebar,
#sidebar {
  width: var(--dt-sidebar-width) !important;
  min-width: var(--dt-sidebar-width) !important;
  max-width: var(--dt-sidebar-width) !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
  z-index: 200 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-right: none !important;
  box-shadow: 2px 0 16px rgba(27,26,25,0.15) !important;
}

/* ── SIDEBAR HEADER ───────────────────────────────────────────────────────── */
.sidebar-header,
#sidebar .sidebar-header {
  padding: 20px 20px 16px !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  flex-shrink: 0 !important;
}

.sidebar-header a,
#sidebar .sidebar-header a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  color: white !important;
  transition: opacity 0.15s !important;
}
.sidebar-header a:hover { opacity: 0.85 !important; }

/* ── SIDEBAR NAV ──────────────────────────────────────────────────────────── */
.sidebar .nav,
#sidebar .nav,
#sidebar nav,
.sidebar nav {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0px !important;
  overflow-y: auto !important;
  padding: 12px 0 !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255,255,255,0.1) transparent !important;
}

.sidebar .nav::-webkit-scrollbar { width: 4px; }
.sidebar .nav::-webkit-scrollbar-track { background: transparent; }
.sidebar .nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Section headers */
.sidebar .nav-section,
#sidebar .nav-section {
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  color: rgba(255,255,255,0.3) !important;
  padding: 16px 20px 6px !important;
  margin: 0 !important;
}

/* Nav items */
.sidebar .nav-item,
#sidebar .nav-item,
.sidebar a.nav-item,
#sidebar a.nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 20px !important;
  color: rgba(255,255,255,0.65) !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border: none !important;
  background: none !important;
  cursor: pointer !important;
  width: 100% !important;
  transition: var(--dt-transition) !important;
  border-left: 3px solid transparent !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.sidebar .nav-item:hover,
#sidebar .nav-item:hover {
  color: #F3F3F3 !important;
  background: rgba(243,121,37,0.12) !important;
  border-left-color: rgba(243,121,37,0.5) !important;
}

.sidebar .nav-item.active,
#sidebar .nav-item.active {
  color: #FAC670 !important;
  background: rgba(243,121,37,0.18) !important;
  border-left-color: #F37925 !important;
  font-weight: 700 !important;
}

.sidebar .nav-item i,
#sidebar .nav-item i {
  width: 16px !important;
  font-size: 13px !important;
  flex-shrink: 0 !important;
  opacity: 0.8 !important;
  text-align: center !important;
}

/* ── SIDEBAR FOOTER ───────────────────────────────────────────────────────── */
.sidebar-footer,
#sidebar .sidebar-footer {
  padding: 12px 16px !important;
  border-top: 1px solid rgba(255,255,255,0.07) !important;
  flex-shrink: 0 !important;
}

.sidebar-footer .user-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: white !important;
}

.sidebar-footer .user-role {
  font-size: 11px !important;
  color: rgba(255,255,255,0.45) !important;
}

/* ── MAIN CONTENT ─────────────────────────────────────────────────────────── */
.main,
main.main,
main,
#main {
  margin-left: var(--dt-sidebar-width) !important;
  min-height: 100vh !important;
  background: var(--dt-bg) !important;
  width: calc(100% - var(--dt-sidebar-width)) !important;
  /* No padding here — handled by .content wrapper or per-page inline styles */
  padding: 0;
}

/* ── TOP BAR ──────────────────────────────────────────────────────────────── */
.top-bar {
  background: var(--dt-surface) !important;
  border-bottom: 1px solid var(--dt-border) !important;
  padding: 0 32px !important;
  height: 60px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  box-shadow: var(--dt-shadow-sm) !important;
}

/* ── CARDS ────────────────────────────────────────────────────────────────── */
.card, .gl-card {
  background: var(--dt-surface) !important;
  border: 1px solid var(--dt-border) !important;
  border-radius: var(--dt-radius) !important;
  box-shadow: var(--dt-shadow-sm) !important;
}

/* ── KPI / STAT CARDS ─────────────────────────────────────────────────────── */
.kpi, .stat-card, .metric-card {
  background: var(--dt-surface) !important;
  border: 1px solid var(--dt-border) !important;
  border-radius: var(--dt-radius) !important;
  padding: 20px !important;
  box-shadow: var(--dt-shadow-sm) !important;
  transition: var(--dt-transition) !important;
}
.kpi:hover, .stat-card:hover { box-shadow: var(--dt-shadow-md) !important; transform: translateY(-1px); }

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.btn-primary, button.btn-primary {
  background: var(--dt-accent) !important;
  color: #1B1A19 !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 10px 20px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: var(--dt-transition) !important;
  font-family: inherit !important;
}
.btn-primary:hover {
  background: var(--dt-accent-hover) !important;
  color: #1B1A19 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(243,121,37,0.35) !important;
}

/* ── TABLES ───────────────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; }
th {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--dt-text-muted) !important;
  background: var(--dt-surface-2) !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--dt-border) !important;
  text-align: left !important;
}
td {
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--dt-border) !important;
  font-size: 14px !important;
  color: var(--dt-text) !important;
  vertical-align: middle !important;
}
tr:hover td { background: var(--dt-surface-2) !important; }
tr:last-child td { border-bottom: none !important; }

/* ── FORMS ────────────────────────────────────────────────────────────────── */
input, select, textarea {
  font-family: inherit !important;
  font-size: 14px !important;
  border: 1.5px solid var(--dt-border) !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  outline: none !important;
  transition: border-color 0.2s !important;
  background: var(--dt-surface) !important;
  color: var(--dt-text) !important;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--dt-accent) !important;
  box-shadow: 0 0 0 3px rgba(243,121,37,0.12) !important;
}
input::placeholder, textarea::placeholder {
  color: var(--dt-text-light) !important;
  opacity: 1 !important;
}

/* ── STATUS PILLS ─────────────────────────────────────────────────────────── */
.status-pill, .badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}
.pill-green, .badge-success  { background: rgba(45,154,107,0.15) !important; color: #1A7A50 !important; }
.pill-blue,  .badge-info     { background: rgba(145,195,206,0.25) !important; color: #2A7D8C !important; }
.pill-amber, .badge-warning  { background: rgba(250,198,112,0.3) !important;  color: #8A5A00 !important; }
.pill-red,   .badge-danger   { background: rgba(217,79,61,0.15) !important;   color: #A0281A !important; }
.pill-purple,.badge-purple   { background: rgba(192,168,230,0.3) !important;  color: #6040A0 !important; }

/* ── MONO NUMBERS ─────────────────────────────────────────────────────────── */
.mono, .money, .num {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

/* ── SECTION HEADERS ──────────────────────────────────────────────────────── */
.section-title, .widget-header {
  font-size: 13px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--dt-text-muted) !important;
  margin-bottom: 16px !important;
}

/* ── EMPTY STATES ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--dt-text-muted);
}
.empty-state i { font-size: 2.5rem; opacity: 0.2; display: block; margin-bottom: 16px; }
.empty-state h3 { font-size: 15px; font-weight: 700; color: #475569; margin-bottom: 8px; }

/* ── MOBILE ───────────────────────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none !important;
  background: none !important;
  border: 1px solid var(--dt-border) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  cursor: pointer !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--dt-text-muted) !important;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }

  /* ── Override main layout (belt+suspenders — also overridden after last desktop rule) */
  .main, main.main, main, #main {
    margin-left: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
  }

  /* ── Sidebar: off-canvas on mobile ──────────────────────────────────── */
  .sidebar, aside.sidebar, #sidebar {
    transform: translateX(-100%) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: fixed !important;
    z-index: 100 !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
  }
  .sidebar.open, aside.sidebar.open, #sidebar.open {
    transform: translateX(0) !important;
  }
  .main, main.main, #main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .mobile-menu-btn { display: flex !important; }
  .sidebar-overlay.visible { display: block !important; }

  /* ── Top bar: stack on small screens ─────────────────────────────────── */
  /* No gap at top of screen */
  body, .app { margin: 0 !important; padding: 0 !important; }

  .top-bar, header.top-bar {
    padding: 10px 12px !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    align-items: center !important;
  }
  /* Hamburger always leftmost on mobile — in any header variant */
  .mobile-menu-btn,
  .top-bar .mobile-menu-btn,
  .top-left .mobile-menu-btn,
  .dt-header .mobile-menu-btn {
    order: -1 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: none !important;
    border: 1px solid #E2DDD8 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    padding: 0 !important;
  }
  .mobile-menu-btn i {
    color: #6B6560 !important;
    font-size: 1rem !important;
  }
  .top-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
  .top-actions { 
    flex-wrap: nowrap !important; 
    gap: 6px !important;
    flex-shrink: 0;
  }
  .top-actions .btn { font-size: 0.82rem !important; padding: 8px 12px !important; }
  .top-actions .btn-icon { width: 36px !important; height: 36px !important; }
  /* Hide sync indicator and page subtitle on mobile */
  #syncIndicator { display: none !important; }
  .page-title-bar p, .page-header p, .breadcrumb + p { display: none !important; }
  /* Page title: smaller, no overflow */
  .page-title-bar h1, .page-header h1, .breadcrumb-current,
  .dt-header h1, .top-bar h1 {
    font-size: .95rem !important;
    white-space: normal !important;
    overflow: visible !important;
    word-break: break-word !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
  }
  /* Header actions: icon-only on mobile where possible */
  .dt-header .header-actions,
  .top-bar .top-actions,
  .header-actions {
    flex-shrink: 0 !important;
    gap: 4px !important;
  }
  .dt-header .header-actions .btn,
  .header-actions .btn {
    font-size: .75rem !important;
    padding: 7px 10px !important;
  }
  /* Hide button text on very small screens, keep icons */
  @media (max-width: 420px) {
    .dt-header .header-actions .btn span,
    .header-actions .btn span { display: none !important; }
  }
  .dt-header {
    padding: 0 12px !important;
    gap: 8px !important;
    height: 52px !important;
    min-height: 52px !important;
  }

  /* ── Content: full width, tight padding ─────────────────────────────── */
  .content, .guide { padding: 12px !important; }
  .page-header { padding: 12px 12px 0 !important; }

  /* ── Grids: single column on mobile ──────────────────────────────────── */
  .stats-grid, .kpi-grid, .metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .content-grid, .grid-2col, .two-col, .waterfall-grid, .pros-cons {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .form-row { grid-template-columns: 1fr !important; }

  /* ── Cards: compact on mobile ────────────────────────────────────────── */
  .stat-card, .card, .kpi, .kpi-card {
    padding: 16px !important;
  }
  .stat-value, .kpi-value, .hero-num { font-size: 1.35rem !important; }
  .card-header { padding: 14px 16px !important; }
  .card-body { padding: 16px !important; }

  /* ── Better Responsive Tables: Stacking rows on mobile ──────────────── */
  table.stack-mobile, 
  .card-body table { 
    display: block !important; 
    width: 100% !important;
  }
  table.stack-mobile thead,
  .card-body table thead { 
    display: none !important; 
  }
  table.stack-mobile tr,
  .card-body table tr { 
    display: block !important;
    border-bottom: 8px solid var(--dt-bg-light) !important;
    padding: 16px 0 !important;
  }
  table.stack-mobile td,
  .card-body table td { 
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 16px !important;
    border: none !important;
    text-align: right !important;
  }
  table.stack-mobile td::before,
  .card-body table td::before {
    content: attr(data-label);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--dt-text-muted);
    flex-shrink: 0;
    margin-right: 16px;
    text-align: left;
  }
  /* First cell (usually the name) is full width and prominent */
  table.stack-mobile td:first-child,
  .card-body table td:first-child {
    display: block !important;
    text-align: left !important;
    background: var(--dt-bg-light);
    margin-bottom: 8px;
    padding: 12px 16px !important;
  }
  table.stack-mobile td:first-child::before,
  .card-body table td:first-child::before {
    display: none !important;
  }
  /* Action buttons cell */
  table.stack-mobile td:last-child,
  .card-body table td:last-child {
    justify-content: flex-end !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--dt-border-light) !important;
  }

  /* ── Distribution cards ──────────────────────────────────────────────── */
  .distribution-card { padding: 14px !important; }
  .distribution-header { flex-direction: column !important; gap: 8px !important; }
  .distribution-amount { font-size: 1.25rem !important; }

  /* ── Modals: full width on mobile ────────────────────────────────────── */
  .modal { width: 95% !important; max-width: none !important; margin: 16px !important; }

  /* ── Legal footer: hide on mobile — it's a desktop-only element ────── */
  #dt-legal-footer { display: none !important; }
  
  /* ── Notice banner: compact on mobile ────────────────────────────────── */
  #dt-notice-banner {
    font-size: 11px !important;
    padding: 8px 12px !important;
    flex-direction: column !important;
    gap: 8px !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9000 !important;
  }
  #dt-notice-banner button { width: 100% !important; padding: 10px !important; }
  #dt-notice-banner div:first-child { font-size: 10px !important; line-height: 1.4 !important; }

  /* ── Charts: constrain height ────────────────────────────────────────── */
  canvas { max-height: 250px !important; }

  /* ── Quick action buttons on dashboard ───────────────────────────────── */
  .quick-actions, .action-grid { 
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  /* ── Decision tree / guide ───────────────────────────────────────────── */
  .decision-tree { padding: 20px !important; }
  .dt-step .answer { flex-direction: column !important; }
  .toc { padding: 16px !important; }
}

/* ── PAGE HEADER ──────────────────────────────────────────────────────────── */
.page-header {
  padding: 32px 40px 0;
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 26px !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: var(--dt-primary) !important;
  margin: 0 0 4px !important;
}
.page-header p {
  font-size: 14px !important;
  color: var(--dt-text-muted) !important;
  margin: 0 !important;
}

/* ── SCROLLBAR ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── ANIMATIONS ───────────────────────────────────────────────────────────── */
@keyframes dt-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.dt-animate { animation: dt-fade-in 0.25s ease-out both; }

/* ── LEGAL FOOTER ─────────────────────────────────────────────────────────── */
#dt-legal-footer {
  background: #0a0f1e !important;
  color: rgba(255,255,255,0.4) !important;
  font-size: 11px !important;
  padding: 16px 32px 16px calc(var(--dt-sidebar-width) + 32px) !important;
  text-align: center !important;
  line-height: 1.6 !important;
  font-family: 'Inter', sans-serif !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  position: relative !important;
  width: 100% !important;
}

/* ── PLATFORM NOTICE BANNER ───────────────────────────────────────────────── */
#dt-notice-banner {
  background: #1e293b !important;
  color: rgba(255,255,255,0.85) !important;
  font-size: 12px !important;
  font-family: 'Inter', sans-serif !important;
}

/* ── FORCE OVERRIDE: Fix bad sed-injected CSS from batch runs ──────────────── */
/* Some pages have --bg-sidebar undefined — force background directly */
#sidebar,
.sidebar {
  background: #0a0f1e !important;
  background-color: #0f172a !important;
}

/* Fix double flex injection */
#sidebar,
.sidebar {
  display: flex !important;
  flex-direction: column !important;
}

/* Ensure main has correct layout */
.main, main.main, main, #main { 
  margin-left: var(--dt-sidebar-width) !important; 
  position: relative !important;
}
/* Mobile override MUST come after ALL desktop .main rules */
@media (max-width: 768px) {
  .main, main.main, main, #main {
    margin-left: 0 !important;
    width: 100% !important;
    position: relative !important;
  }
}

.waterfall-explainer {
  min-height: 100vh;
  background: #0B1120;
  border-radius: 20px;
  box-shadow: var(--dt-shadow-lg);
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.waterfall-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 40px;
}

.waterfall-hero h1 {
  font-size: 40px;
  margin: 8px 0;
}

.eye-brow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--dt-accent);
}

.subhead {
  color: var(--dt-text-muted);
  max-width: 420px;
}

.hero-summary {
  display: grid;
  gap: 12px;
}

.hero-summary div {
  background: #111827;
  border-radius: var(--dt-radius);
  border: 1px solid var(--dt-border);
  padding: 16px 20px;
  text-align: center;
}

.hero-summary span {
  font-size: 11px;
  color: var(--dt-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-summary strong {
  display: block;
  font-size: 20px;
  margin-top: 6px;
}

.waterfall-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

.panel {
  background: #111827;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--dt-border);
  box-shadow: var(--dt-shadow-sm);
}

.panel h2 {
  margin-top: 0;
}

.controls .control {
  margin-bottom: 16px;
}

.controls label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dt-text-muted);
  margin-bottom: 4px;
}

.input-group {
  display: flex;
  align-items: stretch;
  background: #0B1120;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--dt-border);
}

.input-group span:not(.input-prefix) {
  background: #1E293B;
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: var(--dt-text);
}

.input-group input,
.controls input,
.controls select {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  font-size: 16px;
  font-family: inherit;
}

.chart {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tier-bar {
  background: #0B1120;
  border-radius: 14px;
  border: 1px solid var(--dt-border);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.tier-bar .tier-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}

.bar-fill {
  height: 12px;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.tier-split {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--dt-text-muted);
  margin-top: 12px;
}

.tier-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dt-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.split-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.summary-hint {
  display: flex;
  gap: 16px;
}

.summary-hint div {
  background: #0B1120;
  border-radius: 12px;
  padding: 16px;
  border: 1px dashed var(--dt-border);
  text-align: center;
}

.explainer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.explainer-card {
  background: #111827;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--dt-border);
  box-shadow: var(--dt-shadow-sm);
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-title strong {
  font-size: 18px;
}

.card-split {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--dt-text-muted);
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .waterfall-grid {
    grid-template-columns: 1fr;
  }

  .waterfall-hero {
    flex-direction: column;
  }

  .split-summary {
    flex-direction: column;
  }
}

/* ── FUND ACCOUNTING STYLES ─────────────────────────────────────────────── */
.pnl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.pnl-section {
  padding: 20px;
  border-radius: var(--dt-radius);
}

.pnl-income {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
}

.pnl-expense {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
}

.pnl-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dt-text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pnl-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 14px;
}

.pnl-row:last-child {
  border-bottom: none;
}

.pnl-row.pnl-total {
  font-weight: 700;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid rgba(0,0,0,0.1);
}

.pnl-row .amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.pnl-income .amount.positive {
  color: #34d399;
}

.pnl-expense .amount.negative {
  color: #f87171;
}

.pnl-net {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-top: 20px;
  background: var(--dt-surface);
  border: 2px solid var(--dt-border);
  border-radius: var(--dt-radius);
  font-size: 18px;
  font-weight: 700;
}

.pnl-net .amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
}

.pnl-net .amount.positive {
  color: var(--dt-success);
}

.pnl-net .amount.negative {
  color: var(--dt-danger);
}

/* Cash Flow */
.cf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.cf-item {
  text-align: center;
  padding: 16px;
  background: var(--dt-bg);
  border-radius: 8px;
}

.cf-label {
  display: block;
  font-size: 12px;
  color: var(--dt-text-muted);
  margin-bottom: 8px;
}

.cf-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
}

.cf-value.positive {
  color: var(--dt-success);
}

.cf-value.negative {
  color: var(--dt-danger);
}

/* Filter group */
.filter-group {
  display: flex;
  gap: 8px;
}

/* Transaction table */
.data-table .btn-icon {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--dt-text-muted);
  transition: var(--dt-transition);
}

.data-table .btn-icon:hover {
  color: var(--dt-accent);
}

.data-table .btn-icon.text-danger:hover {
  color: var(--dt-danger);
}

.text-success { color: var(--dt-success) !important; }
.text-danger { color: var(--dt-danger) !important; }
.text-warning { color: var(--dt-warning) !important; }
.text-accent { color: var(--dt-accent) !important; }

.result-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--dt-border); }
.result-row:last-child { border-bottom: none; }

.checklist { padding: 8px 0; }
.checklist label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checklist input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--dt-accent); }

@media (max-width: 768px) {
  .pnl-grid {
    grid-template-columns: 1fr;
  }
  
  .cf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── INVESTOR PIPELINE STYLES ──────────────────────────────────────────── */
.pipeline-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 500px;
}

.pipeline-column {
  flex: 0 0 280px;
  background: var(--dt-bg);
  border-radius: var(--dt-radius);
  border: 1px solid var(--dt-border);
  display: flex;
  flex-direction: column;
}

.column-header {
  padding: 16px;
  border-bottom: 1px solid var(--dt-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--dt-surface);
  border-radius: var(--dt-radius) var(--dt-radius) 0 0;
}

.column-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-header h3 i {
  color: var(--dt-accent);
}

.column-count {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.column-cards {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipeline-card {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--dt-shadow-sm);
}

.pipeline-card:hover {
  box-shadow: var(--dt-shadow-md);
  transform: translateY(-2px);
  border-color: var(--dt-accent);
}

.pipeline-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pipeline-card .card-name {
  font-weight: 600;
  font-size: 14px;
}

.interest-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pipeline-card .card-company {
  font-size: 12px;
  color: var(--dt-text-muted);
  margin-bottom: 12px;
}

.pipeline-card .card-details {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.pipeline-card .card-detail {
  font-size: 12px;
  color: var(--dt-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pipeline-card .card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dt-text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--dt-border);
}

.pipeline-card .card-source {
  background: var(--dt-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  padding: 16px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--dt-text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.stat-value.text-success { color: var(--dt-success); }
.stat-value.text-warning { color: var(--dt-warning); }
.stat-value.text-primary { color: var(--dt-accent); }

/* Detail modal */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.detail-section {
  background: var(--dt-bg);
  padding: 16px;
  border-radius: 8px;
}

.detail-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--dt-accent);
}

.detail-section p {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.detail-section a {
  color: var(--dt-accent);
}

/* Form adjustments */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-lg {
  max-width: 700px;
}

@media (max-width: 1200px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .pipeline-board {
    padding-bottom: 60px;
  }
  
  .pipeline-column {
    flex: 0 0 260px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ── COMPLIANCE CENTER STYLES ──────────────────────────────────────────── */
.tabs-container {
  background: var(--dt-surface);
  border-radius: var(--dt-radius);
  border: 1px solid var(--dt-border);
  overflow: hidden;
}

.tabs {
  display: flex;
  background: var(--dt-bg);
  border-bottom: 1px solid var(--dt-border);
  overflow-x: auto;
}

.tab {
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--dt-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--dt-transition);
}

.tab:hover {
  color: var(--dt-text);
  background: rgba(0,0,0,0.02);
}

.tab.active {
  color: var(--dt-accent);
  border-bottom-color: var(--dt-accent);
}

.tab-content {
  padding: 24px;
}

/* Exemption cards */
.exemption-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.exemption-card {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 20px;
}

.exemption-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.exemption-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.exemption-card p {
  font-size: 13px;
  color: var(--dt-text-muted);
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.exemption-stats {
  font-size: 12px;
  color: var(--dt-text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--dt-border);
}

.badge-secondary {
  background: var(--dt-text-muted);
  color: white;
}

.badge-info {
  background: #0ea5e9;
  color: white;
}

/* Tab content mobile */
@media (max-width: 768px) {
  .tabs {
    flex-wrap: nowrap;
  }
  
  .tab {
    padding: 12px 14px;
    font-size: 13px;
  }
  
  .tab-content {
    padding: 16px;
  }
  
  .exemption-cards {
    grid-template-columns: 1fr;
  }
}

/* ── ONBOARDING WIZARD STYLES ──────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--dt-border);
  z-index: 0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dt-bg);
  border: 2px solid var(--dt-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--dt-text-muted);
}

.wizard-step.active .step-num {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  border-color: var(--dt-accent);
  color: white;
}

.wizard-step.completed .step-num {
  background: var(--dt-success);
  border-color: var(--dt-success);
  color: white;
}

.step-label {
  font-size: 12px;
  color: var(--dt-text-muted);
  white-space: nowrap;
}

.wizard-step.active .step-label {
  color: var(--dt-text);
  font-weight: 500;
}

.wizard-content h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
}

.deal-preview {
  margin-top: 20px;
}

.deal-info-card {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 16px;
}

.deal-info-card h4 {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.deal-info-card p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--dt-text-muted);
}

.deal-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.deal-details div {
  font-size: 13px;
}

.deal-details span {
  color: var(--dt-text-muted);
}

/* Doc checklist */
.doc-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--dt-transition);
}

.checkbox-item:hover {
  border-color: var(--dt-accent);
}

.checkbox-item input {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--dt-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkbox-item input:checked + .checkmark {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  border-color: var(--dt-accent);
}

.checkbox-item input:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
}

.checkbox-label {
  display: flex;
  flex-direction: column;
}

.checkbox-label strong {
  font-size: 14px;
}

.checkbox-label small {
  font-size: 12px;
  color: var(--dt-text-muted);
}

/* Review summary */
.review-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.review-section {
  background: var(--dt-bg);
  padding: 16px;
  border-radius: 8px;
}

.review-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--dt-accent);
}

.review-section p {
  margin: 0 0 8px 0;
  font-size: 13px;
}

.review-section ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
}

/* Progress bar */
.progress-bar {
  height: 8px;
  background: var(--dt-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  border-radius: 4px;
  transition: width 0.3s ease;
}

@media (max-width: 768px) {
  .wizard-steps {
    overflow-x: auto;
    padding-bottom: 8px;
  }
  
  .step-label {
    font-size: 10px;
  }
  
  .review-summary {
    grid-template-columns: 1fr;
  }
  
  .deal-details {
    flex-direction: column;
    gap: 8px;
  }
}

/* ── MOBILE POLISH v2 ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Bigger touch targets */
  .btn, .btn-primary, .btn-secondary, .btn-icon {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .btn-icon {
    padding: 10px 12px;
  }
  
  /* Form inputs */
  .form-input, .form-select {
    min-height: 44px;
    font-size: 16px; /* Prevents iOS zoom */
  }
  
  /* Header */
  .dt-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .dt-header h1 {
    font-size: 18px;
    flex: 1 1 100%;
    order: 2;
  }
  
  .dt-header .header-actions {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
  }
  
  .dt-header .header-actions .btn {
    flex: 1;
  }
  
  .mobile-menu-btn {
    order: 1;
    width: 44px;
    height: 44px;
    display: flex !important;
  }
  
  /* Cards */
  .card {
    margin-bottom: 16px;
    border-radius: 8px;
  }
  
  .card-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }
  
  .card-header h2 {
    font-size: 16px;
    flex: 1 1 100%;
  }
  
  /* Data tables */
  .data-table {
    font-size: 13px;
  }
  
  .data-table th, .data-table td {
    padding: 10px 8px;
  }
  
  /* Stats */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-value {
    font-size: 22px;
  }
  
  /* Modal */
  .modal-content {
    margin: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
  
  .modal-header {
    padding: 16px;
    position: sticky;
    top: 0;
    background: var(--dt-surface);
    z-index: 1;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .modal-footer {
    padding: 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .modal-footer .btn {
    flex: 1;
  }
  
  /* Content padding */
  .content {
    padding: 16px;
  }
  
  /* Form groups */
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-row {
    gap: 12px;
  }
  
  /* Sidebar overlay */
  .sidebar-overlay {
    display: none;
  }
  
  /* Hide less critical elements on mobile */
  .hide-mobile {
    display: none !important;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .stat-card {
    padding: 10px 8px;
    min-width: 0; /* allow shrinking */
  }
  
  .stat-card .val,
  .stat-card .stat-value,
  .stat-body .val {
    font-size: 18px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .stat-card .lbl,
  .stat-card .stat-label {
    font-size: 10px !important;
  }
  
  .stat-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
  }
  
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .kpi-card {
    padding: 12px 8px;
    min-width: 0;
  }
  
  .kpi-value {
    font-size: 18px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .header-actions .btn span {
    display: none;
  }
  
  .header-actions .btn i {
    margin: 0;
  }
  
  /* Page title + header actions: prevent word break */
  .main-content > h1:first-of-type,
  .dt-main > h1:first-of-type,
  main > h1:first-of-type {
    font-size: 1.25rem !important;
    white-space: nowrap;
  }
}

/* Fix for iOS Safari viewport height */
@supports (-webkit-touch-callout: none) {
  body {
    min-height: -webkit-fill-available;
  }
}

/* Horizontal scroll for tables */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  min-width: 600px;
}

/* ── PORTFOLIO OVERVIEW STYLES ─────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.kpi-card.kpi-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border: none;
  color: white;
}

.kpi-card.kpi-primary .kpi-icon {
  background: rgba(255,255,255,0.2);
  color: white;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  background: var(--dt-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--dt-accent);
  flex-shrink: 0;
}

.kpi-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 12px;
  color: var(--dt-text-muted);
}

.kpi-card.kpi-primary .kpi-label {
  color: rgba(255,255,255,0.8);
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.kpi-change {
  font-size: 12px;
  color: var(--dt-text-muted);
}

.kpi-change.positive {
  color: var(--dt-success);
}

.kpi-change.negative {
  color: var(--dt-danger);
}

/* Charts */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.chart-card canvas {
  max-height: 280px;
}

/* Performance grid */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.performance-card {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 16px;
}

.perf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.perf-header h4 {
  margin: 0;
  font-size: 15px;
}

.perf-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.perf-stat {
  display: flex;
  flex-direction: column;
}

.perf-label {
  font-size: 11px;
  color: var(--dt-text-muted);
  text-transform: uppercase;
}

.perf-value {
  font-size: 16px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

.perf-bar {
  height: 6px;
  background: var(--dt-border);
  border-radius: 3px;
  overflow: hidden;
}

.perf-bar-fill {
  height: 100%;
  background: var(--dt-success);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Table totals */
.total-row {
  background: var(--dt-bg);
  font-weight: 600;
}

.total-row td {
  border-top: 2px solid var(--dt-border);
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts-row {
    grid-template-columns: 1fr;
  }
  
  .kpi-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .perf-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── DEAL ROOM STYLES ─────────────────────────────────────────────────── */
.deal-room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.deal-info h2 {
  margin: 0 0 4px 0;
  font-size: 24px;
}

.deal-info p {
  margin: 0 0 12px 0;
  color: var(--dt-text-muted);
}

.deal-meta {
  display: flex;
  gap: 24px;
}

.deal-meta span {
  font-size: 13px;
  color: var(--dt-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.deal-actions {
  display: flex;
  gap: 12px;
}

/* Tabs */
.dr-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--dt-surface);
  padding: 8px;
  border-radius: var(--dt-radius);
  border: 1px solid var(--dt-border);
}

.dr-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--dt-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--dt-transition);
}

.dr-tab:hover {
  background: var(--dt-bg);
}

.dr-tab.active {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  color: white;
}

/* Doc categories */
.doc-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.doc-category {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  overflow: hidden;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--dt-bg);
  border-bottom: 1px solid var(--dt-border);
}

.cat-header h3 {
  margin: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-header h3 i {
  color: var(--dt-accent);
}

.doc-count {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  color: white;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}

.doc-list {
  max-height: 300px;
  overflow-y: auto;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--dt-border);
  cursor: pointer;
  transition: var(--dt-transition);
}

.doc-item:hover {
  background: var(--dt-bg);
}

.doc-item:last-child {
  border-bottom: none;
}

.doc-icon {
  width: 40px;
  height: 40px;
  background: var(--dt-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dt-accent);
}

.doc-info {
  flex: 1;
}

.doc-info strong {
  display: block;
  font-size: 14px;
}

.doc-info span {
  font-size: 12px;
  color: var(--dt-text-muted);
}

.doc-actions {
  display: flex;
  gap: 4px;
}

/* Activity feed */
.activity-feed {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
}

.activity-item {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--dt-border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 36px;
  height: 36px;
  background: var(--dt-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dt-accent);
  flex-shrink: 0;
}

.activity-content p {
  margin: 0 0 4px 0;
  font-size: 14px;
}

.activity-meta {
  font-size: 12px;
  color: var(--dt-text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
}

.empty-state i {
  font-size: 64px;
  color: var(--dt-border);
  margin-bottom: 24px;
}

.empty-state h3 {
  margin: 0 0 8px 0;
}

.empty-state p {
  margin: 0;
  color: var(--dt-text-muted);
}

@media (max-width: 768px) {
  .deal-room-header {
    flex-direction: column;
    gap: 20px;
  }
  
  .deal-actions {
    width: 100%;
  }
  
  .deal-actions .btn {
    flex: 1;
  }
  
  .dr-tabs {
    flex-wrap: wrap;
  }
  
  .dr-tab {
    flex: 1;
    justify-content: center;
  }
  
  .doc-categories {
    grid-template-columns: 1fr;
  }
  
  .deal-meta {
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* ── RECAPITALIZATION STYLES ──────────────────────────────────────────── */
.recap-timeline {
  position: relative;
  padding-left: 40px;
}

.recap-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--dt-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -40px;
  width: 32px;
  height: 32px;
  background: var(--dt-surface);
  border: 2px solid var(--dt-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dt-accent);
  font-size: 12px;
}

.timeline-content {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 16px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-header strong {
  font-size: 15px;
}

.timeline-content p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--dt-text-muted);
}

.timeline-date {
  font-size: 12px;
  color: var(--dt-text-muted);
}

@media (max-width: 768px) {
  .recap-timeline {
    padding-left: 32px;
  }
  
  .recap-timeline::before {
    left: 11px;
  }
  
  .timeline-marker {
    left: -32px;
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}

/* ── WEBINAR STYLES ───────────────────────────────────────────────────── */
.webinar-card {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 16px;
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.webinar-card:last-child { margin-bottom: 0; }

.webinar-date {
  text-align: center;
  min-width: 70px;
  padding: 12px;
  background: var(--dt-surface);
  border-radius: 8px;
}

.webinar-date .date {
  display: block;
  font-weight: 700;
  font-size: 16px;
}

.webinar-date .time {
  display: block;
  font-size: 12px;
  color: var(--dt-text-muted);
}

.webinar-info { flex: 1; }
.webinar-info h4 { margin: 0 0 4px 0; font-size: 15px; }
.webinar-info p { margin: 0 0 8px 0; font-size: 13px; color: var(--dt-text-muted); }

.webinar-stats { text-align: right; font-size: 13px; color: var(--dt-text-muted); }

@media (max-width: 600px) {
  .webinar-card { flex-direction: column; align-items: flex-start; }
  .webinar-date { width: 100%; display: flex; justify-content: space-between; }
  .webinar-stats { width: 100%; text-align: left; margin-top: 8px; }
}

/* ── ONBOARDING V2 STYLES ────────────────────────────────────────────── */
.onboarding-pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 24px;
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  padding: 20px;
  overflow-x: auto;
}

.pipeline-stage {
  flex: 1;
  min-width: 200px;
}

.pipeline-stage .stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--dt-border);
}

.pipeline-stage .stage-header h3 {
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-stage .stage-header h3 i {
  color: var(--dt-accent);
}

.stage-count {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--dt-border);
}

.stage-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.onboard-card {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: var(--dt-transition);
}

.onboard-card:hover {
  border-color: var(--dt-accent);
  box-shadow: var(--dt-shadow-sm);
}

.onboard-name {
  font-weight: 600;
  font-size: 13px;
}

.onboard-deal {
  font-size: 12px;
  color: var(--dt-text-muted);
}

.onboard-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--dt-accent);
  margin: 4px 0;
}

.onboard-progress {
  margin-top: 8px;
}

.progress-bar-mini {
  height: 4px;
  background: var(--dt-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-mini .fill {
  height: 100%;
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
}

.more {
  text-align: center;
  font-size: 12px;
  color: var(--dt-text-muted);
  padding: 8px;
}

/* Stepper */
.onboarding-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
}

.onboarding-stepper::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--dt-border);
  z-index: 0;
}

.onboarding-stepper .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.onboarding-stepper .step span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--dt-bg);
  border: 2px solid var(--dt-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--dt-text-muted);
}

.onboarding-stepper .step.active span {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  border-color: var(--dt-accent);
  color: white;
}

.onboarding-stepper .step small {
  font-size: 11px;
  color: var(--dt-text-muted);
}

.onboarding-stepper .step.active small {
  color: var(--dt-text);
  font-weight: 500;
}

/* Doc checklist enhanced */
.doc-checklist-enhanced {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doc-checklist-enhanced .doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  cursor: pointer;
}

.doc-checklist-enhanced .doc-item input { display: none; }

.doc-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--dt-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 12px;
}

.doc-item input:checked + .doc-check {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  border-color: var(--dt-accent);
  color: white;
}

.doc-checklist-enhanced .doc-label {
  flex: 1;
}

.doc-checklist-enhanced .doc-label strong {
  display: block;
  font-size: 14px;
}

.doc-checklist-enhanced .doc-label small {
  font-size: 12px;
  color: var(--dt-text-muted);
}

/* Review box */
.review-box {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 16px;
}

.review-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--dt-border);
}

.review-row:last-child { border-bottom: none; }

.review-row span { color: var(--dt-text-muted); font-size: 13px; }
.review-row strong { font-size: 14px; }

.action-buttons {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 900px) {
  .onboarding-pipeline { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); padding: 8px 0; }
}

/* ── TASKS & MAINTENANCE STYLES ───────────────────────────────────────── */
.task-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.task-col {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  padding: 16px;
  min-height: 400px;
}

.task-col h3 {
  font-size: 14px;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-col h3 .count {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--dt-transition);
}

.task-card:hover { border-color: var(--dt-accent); }
.task-card.overdue { border-left: 3px solid var(--dt-danger); }

.task-priority {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.priority-low { background: var(--dt-text-muted); }
.priority-medium { background: var(--dt-warning); }
.priority-high { background: var(--dt-danger); }

.task-content { flex: 1; }

.task-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dt-text-muted);
}

@media (max-width: 900px) {
  .task-columns { grid-template-columns: 1fr; }
}

/* ── LENDER CRM STYLES ────────────────────────────────────────────────── */
.termsheet-card {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.termsheet-card:last-child { margin-bottom: 0; }

.ts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ts-header strong { font-size: 15px; }

.ts-details {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--dt-text-muted);
}

.ts-dates {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--dt-border);
  font-size: 12px;
  color: var(--dt-text-muted);
}

/* ── WATERFALL EXPLAINER STYLES ───────────────────────────────────────── */
.waterfall-explainer { max-width: 900px; margin: 0 auto; }

.intro-section { text-align: center; margin-bottom: 30px; }
.intro-section h2 { margin-bottom: 12px; }
.intro-section p { color: var(--dt-text-muted); font-size: 15px; }

.animation-container {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  padding: 24px;
  margin-bottom: 30px;
}

.waterfall-visual { margin-bottom: 24px; }

.gross-revenue .tier-bar {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
}

.tier { opacity: 0.3; transition: all 0.5s ease; }
.tier.active { opacity: 1; }

.tier-bar {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  color: var(--dt-text);
}

.lp-tier .tier-bar { background: linear-gradient(135deg, #22c55e 0%, #86efac 100%); }
.gp-tier .tier-bar { background: linear-gradient(135deg, #f59e0b 0%, #fcd34d 100%); }
.final .tier-bar { background: linear-gradient(135deg, #ec4899 0%, #f9a8d4 100%); }

.tier-label { font-weight: 600; display: block; }
.tier-amount { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; float: right; }

.tier-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255,255,255,0.2);
  z-index: 0;
}

.tier-arrow {
  text-align: center;
  color: var(--dt-border);
  margin: -4px 0;
}

.animation-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.current-tier-info { min-height: 100px; }

.info-box {
  background: var(--dt-bg);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.info-box h3 { margin: 0 0 8px 0; color: var(--dt-accent); }
.info-box p { margin: 0 0 12px 0; color: var(--dt-text-muted); }
.info-stats { font-weight: 600; }

.tier-explanations { display: grid; gap: 16px; }

.tier-explain {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
  padding: 20px;
}

.tier-explain h3 { margin: 0 0 8px 0; display: flex; align-items: center; gap: 12px; }

.tier-num {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.tier-explain p { margin: 0; color: var(--dt-text-muted); font-size: 14px; }

.example-calculator {
  background: var(--dt-surface);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius);
  padding: 24px;
  margin-top: 30px;
}

.example-calculator h3 { margin: 0 0 20px 0; }

.calc-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.calc-results { background: var(--dt-bg); border-radius: 8px; padding: 20px; }

.calc-result-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--dt-border);
  font-size: 14px;
}

.calc-result-row:last-child { border-bottom: none; }
.calc-result-row.highlight { background: rgba(14,165,233,0.05); margin: 0 -10px; padding: 8px 10px; }
.calc-result-row.total { font-size: 16px; font-weight: 600; border-top: 2px solid var(--dt-border); margin-top: 8px; padding-top: 16px; }

@media (max-width: 768px) {
  .calc-inputs { grid-template-columns: repeat(2, 1fr); }
}

/* ── DEAL SCORING STYLES ───────────────────────────────────────────────── */
.scoring-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.scoring-section { background: var(--dt-bg); padding: 20px; border-radius: 8px; }
.scoring-section h3 { margin: 0 0 16px 0; font-size: 14px; color: var(--dt-accent); }

.score-results { margin-top: 30px; }
.score-overview { text-align: center; margin-bottom: 24px; }
.score-circle { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--dt-accent), var(--dt-accent2)); color: white; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
.score-circle span { font-size: 42px; font-weight: 700; }
.score-circle small { font-size: 16px; opacity: 0.8; }
.score-label { font-size: 20px; font-weight: 600; margin-top: 12px; }

.score-breakdown { background: var(--dt-surface); border: 1px solid var(--dt-border); border-radius: 8px; padding: 20px; }
.breakdown-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.breakdown-item:last-child { margin-bottom: 0; }
.breakdown-item > span:first-child { width: 100px; font-size: 13px; }
.breakdown-item > span:last-child { width: 30px; text-align: right; font-weight: 600; }
.breakdown-bar { flex: 1; height: 8px; background: var(--dt-border); border-radius: 4px; overflow: hidden; }
.breakdown-bar .fill { height: 100%; background: linear-gradient(135deg, #0ea5e9, #0369a1) !important; border-radius: 4px; }

.score-recommendation { margin-top: 20px; }
.rec-box { padding: 16px; border-radius: 8px; font-size: 14px; }
.rec-buy { background: rgba(34,197,94,0.1); border: 1px solid var(--dt-success); color: #166534; }
.rec-maybe { background: rgba(14,165,233,0.1); border: 1px solid var(--dt-accent); color: #0ea5e9; }
.rec-caution { background: rgba(245,158,11,0.1); border: 1px solid var(--dt-warning); color: #b45309; }
.rec-pass { background: rgba(239,68,68,0.1); border: 1px solid var(--dt-danger); color: #991b1b; }

@media (max-width: 900px) { .scoring-grid { grid-template-columns: 1fr; } }

/* ── RENT ROLL STYLES ─────────────────────────────────────────────────── */
.type-card { background: var(--dt-bg); border: 1px solid var(--dt-border); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.type-card:last-child { margin-bottom: 0; }
.type-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.type-stats { display: flex; gap: 20px; font-size: 13px; color: var(--dt-text-muted); }

.vacancy-list { }
.vacancy-item { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid var(--dt-border); }
.vacancy-item:last-of-type { border-bottom: none; }
.vacancy-total { margin-top: 12px; padding: 12px; background: rgba(239,68,68,0.1); border-radius: 8px; text-align: center; }

/* ── CAPITAL CALL & CAP TABLE STYLES ───────────────────────────────────── */
.calc-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.calc-section { background: var(--dt-surface); border: 1px solid var(--dt-border); border-radius: 8px; padding: 20px; }
.calc-section h3 { margin: 0 0 16px 0; font-size: 14px; color: var(--dt-accent); }
.investor-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.investor-row { display: flex; gap: 8px; align-items: center; }
.investor-row .inv-name, .investor-row .inv-commit { flex: 1; }
.inv-pct { width: 50px; text-align: right; font-size: 12px; color: var(--dt-text-muted); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.summary-item { text-align: center; }
.summary-item span { display: block; font-size: 12px; color: var(--dt-text-muted); margin-bottom: 4px; }
.summary-item strong { font-size: 18px; }
.email-box { background: var(--dt-bg); border: 1px solid var(--dt-border); border-radius: 8px; padding: 16px; }
.email-box pre { white-space: pre-wrap; font-size: 12px; margin: 0; }

/* Cap table */
.cap-overview { display: grid; grid-template-columns: 300px 1fr; gap: 24px; margin-bottom: 24px; background: var(--dt-surface); border: 1px solid var(--dt-border); border-radius: var(--dt-radius); padding: 24px; }
.cap-chart { max-width: 280px; margin: 0 auto; }
.cap-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: center; }
.summary-stat { text-align: center; }
.summary-stat span { display: block; font-size: 12px; color: var(--dt-text-muted); }
.summary-stat strong { font-size: 24px; }
.scenario-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.scenario-table { margin-bottom: 12px; }
.scenario-note { font-size: 13px; color: var(--dt-text-muted); text-align: center; }

@media (max-width: 900px) { .calc-container, .cap-overview { grid-template-columns: 1fr; } .summary-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── MILESTONES & FEEDBACK STYLES ───────────────────────────────────────── */
.milestone-timeline { }
.milestone-deal { margin-bottom: 32px; }
.milestone-deal h3 { margin: 0 0 16px 0; font-size: 16px; color: var(--dt-accent); }
.deal-milestones { border-left: 3px solid var(--dt-border); padding-left: 24px; }
.milestone-item { display: flex; gap: 16px; margin-bottom: 16px; align-items: flex-start; }
.milestone-marker { width: 12px; height: 12px; border-radius: 50%; background: var(--dt-border); margin-top: 4px; flex-shrink: 0; }
.milestone-completed .milestone-marker { background: var(--dt-success); }
.milestone-in-progress .milestone-marker { background: linear-gradient(135deg, #0ea5e9, #0369a1) !important; }
.milestone-delayed .milestone-marker { background: var(--dt-danger); }
.milestone-content { flex: 1; }
.milestone-date { display: block; font-size: 12px; color: var(--dt-text-muted); }
.milestone-content strong { display: block; margin-bottom: 4px; }

.response-card { background: var(--dt-bg); padding: 16px; border-radius: 8px; margin-bottom: 12px; }
.response-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.response-card p { margin: 0 0 8px 0; font-size: 14px; }

/* HUD Closing Statement */
.hud-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(320px,1fr)); gap: 20px; margin-bottom: 20px; }
.hud-input { font-family: monospace; }
.hud-total { font-weight: bold; background: #0B1120; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px; }
.summary-item { display: flex; flex-direction: column; padding: 16px; background: #0B1120; border-radius: 8px; }
.summary-item span { font-size: 12px; color: #64748b; }
.summary-item strong { font-size: 18px; margin-top: 4px; }
.je-section { margin-bottom: 20px; }
.je-section h4 { margin: 0 0 8px 0; color: #0ea5e9; font-size: 14px; }
.je-section pre { background: #1e293b; color: #e2e8f0; padding: 16px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; }

/* ════════════════════════════════════════════════════════════════════════════
   POLISH PASS — 2026-03-07
   Fixes identified in full-platform audit:
   1. Table row borders were #f1f5f9 (near-white) → dark on dark = harsh lines
   2. .page-header h1 color was --dt-primary (dark blue) → invisible on dark bg
   3. .main had padding:32px 40px and pages also had .content padding:32px → double pad
   4. Global typography refinements for professional hierarchy
   5. Card/panel consistency: header/body padding standardized
   6. Button consistency: all non-primary buttons get a clear style
   7. Empty state color fixes (h3 was dark, invisible on dark bg)
   8. Form label color fixes
   9. Number right-alignment in tables
   10. Consistent badge/status pill sizing
   ════════════════════════════════════════════════════════════════════════════ */

/* ── 1. TABLE ROW BORDERS: fix near-white border on dark bg ─────────────── */
td {
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}
tr:hover td {
  background: rgba(255,255,255,0.025) !important;
}

/* ── 2. PAGE HEADER: fix invisible title color ───────────────────────────── */
.page-header h1,
.page-title,
.page-header .page-title {
  color: #1B1A19 !important;
}

/* ── 3. LAYOUT: normalize .main padding
   Strategy:
   - Pages with .content inside .main: .main has no padding, .content handles it
   - Pages without .content (dt-header pattern): their inline .main{padding:40px} 
     is kept (no !important override) so they still breathe
   - The original global had padding:32px 40px which caused double-padding on
     pages that also had .content {padding:32px} — fix by removing from .main */
.main,
main.main,
main,
#main {
  padding: 0;
  /* NOTE: not using !important — allows per-page inline styles to set padding
     for pages that don't use the .content wrapper pattern */
}

/* ── 4. CONTENT AREA: consistent padding ────────────────────────────────── */
.content {
  padding: 28px 32px !important;
  max-width: 1440px;  /* no !important — let pages override with their own max-width */
}
@media (max-width: 1200px) {
  .content { padding: 24px 24px !important; }
}
@media (max-width: 768px) {
  .content { padding: 14px 14px !important; }
}

/* ── 5. TOP BAR: ensure it fills width and has correct height ─────────────── */
.top-bar,
header.top-bar {
  padding: 0 32px !important;
  height: 60px !important;
  min-height: 60px !important;
  flex-shrink: 0 !important;
}
@media (max-width: 768px) {
  .top-bar, header.top-bar { padding: 0 14px !important; height: 54px !important; min-height: 54px !important; }
}

/* ── 6. CARD HEADER / BODY: consistent padding ───────────────────────────── */
.card-header {
  padding: 18px 22px !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.card-title {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1B1A19 !important;
  letter-spacing: -0.01em !important;
}
.card-subtitle {
  font-size: 12px !important;
  color: #6B6560 !important;
  margin-top: 2px !important;
  font-weight: 400 !important;
}
.card-body {
  padding: 20px 22px !important;
}

/* ── 7. SECTION HEADINGS in content (h1, h2 inside .content) ────────────── */
.content h1 {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #1B1A19 !important;
  letter-spacing: -0.025em !important;
  margin: 0 0 4px 0 !important;
}
.content h2 {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1B1A19 !important;
  letter-spacing: -0.01em !important;
}
.content h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #1B1A19 !important;
}

/* ── 8. EMPTY STATE: fix invisible h3 on dark bg ─────────────────────────── */
.empty-state h3 {
  color: #6B6560 !important;
  font-size: 15px !important;
}
.empty-state p {
  color: #64748B !important;
  font-size: 13px !important;
}

/* ── 9. FORM LABELS: ensure readable on dark bg ─────────────────────────── */
label {
  color: #6B6560 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

/* ── 10. BUTTONS: ensure secondary button always looks like a button ──────── */
.btn-secondary,
button.btn-secondary {
  background: transparent !important;
  color: #6B6560 !important;
  border: 1px solid #1E293B !important;
  border-radius: 8px !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  font-family: inherit !important;
}
.btn-secondary:hover,
button.btn-secondary:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: #334155 !important;
  color: #6B6560 !important;
}

/* btn-xs (small action buttons in tables) */
.btn-xs {
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  border: 1px solid #1E293B !important;
  background: transparent !important;
  color: #6B6560 !important;
  cursor: pointer !important;
  transition: all 0.15s !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  text-decoration: none !important;
  font-family: inherit !important;
  white-space: nowrap !important;
}
.btn-xs:hover {
  background: var(--dt-accent) !important;
  color: white !important;
  border-color: var(--dt-accent) !important;
}
.btn-xs.danger:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
}

/* ── 11. BADGE/STATUS PILL: normalize sizing ─────────────────────────────── */
.badge {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
}

/* ── 12. CURRENCY / NUMBER COLUMNS: right align in tables ───────────────── */
td.money,
td.num,
td.currency,
.td-money,
td[data-label="Amount"],
td[data-label="Invested"],
td[data-label="Raise"],
td[data-label="IRR"] {
  text-align: right !important;
  font-family: 'JetBrains Mono', monospace !important;
}
th.col-num,
th.col-money,
th.col-currency {
  text-align: right !important;
}

/* ── 13. SECTION SPACING: gap between page sections ─────────────────────── */
.content > * + * {
  margin-top: 0 !important; /* let each section control its own margin */
}
/* Standard spacing between top-level cards/sections in content */
.content > .card + .card,
.content > .card + div,
.content > div + .card {
  margin-top: 20px !important;
}

/* ── 14. STAT/KPI CARD: ensure consistent internal structure ─────────────── */
.stat-card,
.kpi-card {
  padding: 20px 22px !important;
}
.stat-card .val,
.stat-card .stat-value,
.kpi-card .kpi-value {
  font-size: 26px !important;
  font-weight: 800 !important;
  font-family: 'JetBrains Mono', monospace !important;
  letter-spacing: -0.03em !important;
  color: #1B1A19 !important;
  line-height: 1.1 !important;
}
.stat-card .lbl,
.stat-card .stat-label,
.kpi-card .kpi-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #64748B !important;
  margin-bottom: 6px !important;
}

/* ── 15. TABLE: column headers cleaner ───────────────────────────────────── */
th {
  background: rgba(255,255,255,0.03) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #64748B !important;
  padding: 11px 16px !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  white-space: nowrap !important;
}
td {
  padding: 13px 16px !important;
  font-size: 13.5px !important;
  color: #E2E8F0 !important;
  vertical-align: middle !important;
}

/* ── 16. BREADCRUMB: consistent styling ──────────────────────────────────── */
.breadcrumb,
nav.breadcrumb {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
}
.breadcrumb a {
  color: #64748B !important;
  text-decoration: none !important;
  transition: color 0.15s !important;
}
.breadcrumb a:hover { color: var(--dt-accent) !important; }
.breadcrumb-sep,
.breadcrumb-separator { color: #334155 !important; }
.breadcrumb-current { color: #1B1A19 !important; font-weight: 600 !important; }

/* ── 17. INPUT PLACEHOLDER: muted but readable ───────────────────────────── */
input::placeholder,
textarea::placeholder {
  color: #475569 !important;
  opacity: 1 !important;
}

/* ── 18. LINK INSIDE TABLE: accessible color ─────────────────────────────── */
td a {
  color: #1B1A19 !important;
  text-decoration: none !important;
}
td a:hover {
  color: var(--dt-accent) !important;
  text-decoration: underline !important;
}

/* ── 19. MODAL POLISH: consistent sizing and padding ─────────────────────── */
.modal-overlay.open,
.modal-overlay.active {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.modal {
  background: #111827 !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 14px !important;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5) !important;
}
.modal-header {
  padding: 22px 26px 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.modal-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #1B1A19 !important;
}
.modal-body {
  padding: 20px 26px !important;
}
.modal-footer {
  padding: 0 26px 22px !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
}
.modal-close {
  width: 30px !important;
  height: 30px !important;
  background: rgba(255,255,255,0.06) !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #6B6560 !important;
  transition: all 0.15s !important;
}
.modal-close:hover { background: rgba(239,68,68,0.2) !important; color: #ef4444 !important; }

/* ── 20. FORM GROUPS: consistent vertical spacing ─────────────────────────── */
.form-group {
  margin-bottom: 18px !important;
}
.form-group:last-child {
  margin-bottom: 0 !important;
}
.form-group label {
  display: block !important;
  margin-bottom: 7px !important;
}

/* ── 21. PAGE TITLE BAR (top-bar variant with title) ─────────────────────── */
.page-title-bar h1 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #1B1A19 !important;
  margin: 0 !important;
  letter-spacing: -0.02em !important;
}
.page-title-bar p {
  font-size: 12px !important;
  color: #64748B !important;
  margin: 1px 0 0 !important;
}

/* ── 22. TOAST NOTIFICATIONS: ensure they're above everything ─────────────── */
#toast,
.toast {
  z-index: 99999 !important;
}

/* ── 23. DEAL / PROPERTY TYPE BADGES ─────────────────────────────────────── */
.badge-mf   { background: rgba(145,195,206,0.25) !important;  color: #1A6070 !important; }
.badge-ind  { background: rgba(45,154,107,0.15) !important;  color: #0F5C35 !important; }
.badge-ret  { background: rgba(232,137,10,0.15) !important;  color: #6B4000 !important; }
.badge-off  { background: rgba(139,92,246,0.15) !important;  color: #a78bfa !important; }
.badge-other{ background: rgba(107,101,96,0.12) !important;  color: #3D3A37 !important; }

/* Deal status badges */
.badge-sourcing  { background: rgba(107,101,96,0.12) !important; color: #3D3A37 !important; }
.badge-loi       { background: rgba(232,137,10,0.15) !important; color: #6B4000 !important; }
.badge-dd        { background: rgba(145,195,206,0.25) !important; color: #1A6070 !important; }
.badge-closed    { background: rgba(45,154,107,0.15) !important; color: #0F5C35 !important; }
.badge-operating { background: rgba(123,92,196,0.15) !important; color: #3D2080 !important; }
.badge-active    { background: rgba(16,185,129,0.15) !important; color: #34d399 !important; }
.badge-verified  { background: rgba(16,185,129,0.15) !important; color: #34d399 !important; }
.badge-pending   { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }
.badge-expired   { background: rgba(239,68,68,0.15)  !important; color: #f87171 !important; }
.badge-inactive  { background: rgba(100,116,139,0.1) !important; color: #64748b !important; }
.badge-funded    { background: rgba(14,165,233,0.15) !important; color: #38bdf8 !important; }
.badge-committed { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }

/* Distribution status */
.badge-posted { background: rgba(16,185,129,0.15)  !important; color: #34d399 !important; }
.badge-draft  { background: rgba(245,158,11,0.15)  !important; color: #fbbf24 !important; }

/* ── 24. ACTION BUTTON GROUP (header-level buttons) ──────────────────────── */
/* ── TOP-LEFT: page title area in top-bar ────────────────────────────────── */
.top-left {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.top-actions,
.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

/* ── 25. TABLE SCROLL WRAPPER: horizontal scroll on overflow ─────────────── */
.table-scroll,
.table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  border-radius: 0 0 var(--dt-radius) var(--dt-radius) !important;
}

/* ── 26. TOOLBAR / FILTER BAR: consistent spacing ────────────────────────── */
.toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  margin-bottom: 20px !important;
}

/* ── 27. SEARCH INPUT ────────────────────────────────────────────────────── */
.search-input,
.search-wrap input {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  color: #1B1A19 !important;
  border-radius: 8px !important;
  padding: 10px 12px 10px 36px !important;
  font-size: 13.5px !important;
}
.search-input:focus,
.search-wrap input:focus {
  border-color: var(--dt-accent) !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1) !important;
}

/* ── 28. SELECT DROPDOWNS in toolbar ────────────────────────────────────── */
.toolbar select,
.filter-bar select {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  color: #1B1A19 !important;
  border-radius: 8px !important;
  padding: 10px 14px !important;
  font-size: 13.5px !important;
  cursor: pointer !important;
}

/* ── 29. VIEW TOGGLE (table/card) ────────────────────────────────────────── */
.view-toggle {
  display: flex !important;
  border: 1px solid #1E293B !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}
.view-btn {
  padding: 8px 12px !important;
  border: none !important;
  background: #111827 !important;
  color: #6B6560 !important;
  cursor: pointer !important;
  font-size: 13px !important;
  transition: all 0.15s !important;
}
.view-btn.active {
  background: var(--dt-accent) !important;
  color: white !important;
}

/* ── 30. IRR / PERCENTAGE VALUES: green color ────────────────────────────── */
.irr-val,
.val-positive,
td.irr {
  color: #34d399 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 600 !important;
}

/* ── END POLISH PASS ─────────────────────────────────────────────────────── */

/* ── DT-HEADER (used on ~149 tool/utility pages) ─────────────────────────────
   These pages use <div class="dt-header"> instead of <header class="top-bar">.
   Without desktop styles this was completely unstyled.
   ─────────────────────────────────────────────────────────────────────────── */
.dt-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2DDD8 !important;
  padding: 0 32px !important;
  height: 60px !important;
  min-height: 60px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  gap: 16px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 1px 3px rgba(27,26,25,0.08) !important;
}
.dt-header h1 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #1B1A19 !important;
  margin: 0 !important;
  letter-spacing: -0.02em !important;
  flex: 1 !important;
  min-width: 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: break-word !important;
}
.dt-header h1 i {
  color: var(--dt-accent) !important;
  margin-right: 10px !important;
  font-size: 16px !important;
}
.dt-header .header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

/* ── MAIN when used with dt-header: no top padding so header sits flush ───── */
/* Pages with dt-header put the header inside .main, so no extra top gap needed */
.main > .dt-header,
main.main > .dt-header {
  margin: 0 !important;
}

/* ── SUB-HEADER / PAGE DESCRIPTION below dt-header ──────────────────────── */
.dt-subheader,
.page-description-bar {
  padding: 16px 32px !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  background: rgba(255,255,255,0.01) !important;
}

/* ── APP CONTAINER for old-style pages (main > content pattern) ───────────── */
.app {
  display: flex !important;
  min-height: 100vh !important;
}

/* ── CONTENT WHEN INSIDE MAIN (belt-and-suspenders) ─────────────────────── */
main.main > .content,
.main > .content,
#main > .content {
  padding: 28px 32px !important;
  max-width: none !important;
}

/* ─── END DT-HEADER FIX ────────────────────────────────────────────────── */

/* ── .guide class (waterfall-guide.html and similar) ─────────────────────── */
.guide {
  padding: 28px 32px !important;
  max-width: 1200px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENT LIBRARY — common patterns used across many pages
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── DATA TABLE (many tool pages use .data-table) ─────────────────────────── */
.data-table {
  width: 100% !important;
  border-collapse: collapse !important;
}
.data-table th {
  background: rgba(255,255,255,0.03) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: #64748B !important;
  padding: 11px 14px !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  white-space: nowrap !important;
}
.data-table td {
  padding: 13px 14px !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-size: 13.5px !important;
  vertical-align: middle !important;
  color: #E2E8F0 !important;
}
.data-table tr:hover td { background: rgba(255,255,255,0.025) !important; }
.data-table tr:last-child td { border-bottom: none !important; }

/* ── FORM INPUT (form-input class) ───────────────────────────────────────── */
.form-input,
.form-select {
  width: 100% !important;
  padding: 10px 14px !important;
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  border-radius: 8px !important;
  color: #1B1A19 !important;
  font-size: 14px !important;
  font-family: inherit !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  outline: none !important;
}
.form-input:focus,
.form-select:focus {
  border-color: var(--dt-accent) !important;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1) !important;
}

/* ── FORM ROW (2-column form grid) ───────────────────────────────────────── */
.form-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
}
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr !important; }
}

/* ── RESULT PANEL / CALCULATION OUTPUT ───────────────────────────────────── */
.result-panel,
.results-panel,
.calc-results {
  background: rgba(14,165,233,0.06) !important;
  border: 1px solid rgba(14,165,233,0.2) !important;
  border-radius: var(--dt-radius) !important;
  padding: 20px 22px !important;
}

/* Result row key-value pair */
.result-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-size: 14px !important;
}
.result-row:last-child { border-bottom: none !important; }
.result-row span { color: #6B6560 !important; }
.result-row strong {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: #1B1A19 !important;
}
.result-row strong.positive { color: #34d399 !important; }
.result-row strong.negative { color: #f87171 !important; }

/* ── SECTION DIVIDER ─────────────────────────────────────────────────────── */
.section-divider {
  height: 1px !important;
  background: rgba(255,255,255,0.07) !important;
  margin: 24px 0 !important;
}

/* ── ALERT / NOTICE PANELS ───────────────────────────────────────────────── */
.alert-info {
  background: rgba(14,165,233,0.1) !important;
  border: 1px solid rgba(14,165,233,0.25) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  font-size: 13px !important;
  color: #93c5fd !important;
  display: flex !important;
  gap: 10px !important;
}
.alert-warning {
  background: rgba(245,158,11,0.1) !important;
  border: 1px solid rgba(245,158,11,0.25) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  font-size: 13px !important;
  color: #fcd34d !important;
  display: flex !important;
  gap: 10px !important;
}
.alert-danger {
  background: rgba(239,68,68,0.1) !important;
  border: 1px solid rgba(239,68,68,0.25) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  font-size: 13px !important;
  color: #fca5a5 !important;
  display: flex !important;
  gap: 10px !important;
}
.alert-success {
  background: rgba(16,185,129,0.1) !important;
  border: 1px solid rgba(16,185,129,0.25) !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  font-size: 13px !important;
  color: #6ee7b7 !important;
  display: flex !important;
  gap: 10px !important;
}

/* ── STAT VALUE in result cards ──────────────────────────────────────────── */
.stat-value,
.kpi-value {
  font-size: 26px !important;
  font-weight: 800 !important;
  font-family: 'JetBrains Mono', monospace !important;
  letter-spacing: -0.03em !important;
  color: #1B1A19 !important;
  line-height: 1 !important;
  margin-bottom: 4px !important;
}

/* ── MUTED TEXT ──────────────────────────────────────────────────────────── */
.text-muted,
.text-secondary {
  color: #6B6560 !important;
  font-size: 12px !important;
}
.text-success { color: #34d399 !important; }
.text-danger  { color: #f87171 !important; }
.text-warning { color: #fbbf24 !important; }
.text-accent  { color: var(--dt-accent) !important; }
.text-right   { text-align: right !important; }
.text-center  { text-align: center !important; }

/* ── GRID HELPERS ────────────────────────────────────────────────────────── */
.grid-2 { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 20px !important; }
.grid-3 { display: grid !important; grid-template-columns: repeat(3,1fr) !important; gap: 20px !important; }
.grid-4 { display: grid !important; grid-template-columns: repeat(4,1fr) !important; gap: 16px !important; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
}

/* ── FLEX HELPERS ────────────────────────────────────────────────────────── */
.flex-between {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.flex-gap {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
}

/* ── MARGIN HELPERS ──────────────────────────────────────────────────────── */
.mt-4  { margin-top:  4px  !important; }
.mt-8  { margin-top:  8px  !important; }
.mt-12 { margin-top: 12px  !important; }
.mt-16 { margin-top: 16px  !important; }
.mt-20 { margin-top: 20px  !important; }
.mt-24 { margin-top: 24px  !important; }
.mb-4  { margin-bottom:  4px  !important; }
.mb-8  { margin-bottom:  8px  !important; }
.mb-12 { margin-bottom: 12px  !important; }
.mb-16 { margin-bottom: 16px  !important; }
.mb-20 { margin-bottom: 20px  !important; }
.mb-24 { margin-bottom: 24px  !important; }

/* ── FONT MONO helper ────────────────────────────────────────────────────── */
.font-mono {
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 600 !important;
}

/* ── DASHBOARD QUICK-ACTION CARDS ────────────────────────────────────────── */
.qa-card,
.quick-action-card {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  border-radius: var(--dt-radius) !important;
  padding: 22px 20px !important;
  text-align: center !important;
  text-decoration: none !important;
  color: #1B1A19 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important;
  transition: all 0.18s !important;
  cursor: pointer !important;
}
.qa-card:hover,
.quick-action-card:hover {
  border-color: var(--dt-accent) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--dt-shadow-md) !important;
}

/* ── ACTIVITY FEED ───────────────────────────────────────────────────────── */
.activity-item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 14px 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
.activity-item:last-child { border-bottom: none !important; }
.activity-body { flex: 1 !important; min-width: 0 !important; }
.activity-text { font-size: 13.5px !important; color: #E2E8F0 !important; line-height: 1.5 !important; }
.activity-time { font-size: 11.5px !important; color: #64748B !important; margin-top: 2px !important; }

/* ── DEAL HERO (deal-detail.html) ────────────────────────────────────────── */
.deal-hero {
  border-radius: var(--dt-radius) !important;
  padding: 28px 32px !important;
  margin-bottom: 22px !important;
  color: white !important;
}
.deal-metric {
  background: rgba(255,255,255,0.08) !important;
  border-radius: 8px !important;
  padding: 16px !important;
}
.deal-metric .val {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}
.deal-metric .lbl {
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: rgba(255,255,255,0.6) !important;
  margin-top: 4px !important;
}

/* ── DISTRIBUTION CARD ───────────────────────────────────────────────────── */
.distribution-card {
  background: #111827 !important;
  border: 1px solid #1E293B !important;
  border-radius: var(--dt-radius) !important;
  padding: 20px 22px !important;
  margin-bottom: 12px !important;
  transition: border-color 0.15s !important;
}
.distribution-card:hover { border-color: #334155 !important; }
.distribution-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #1B1A19 !important;
}
.distribution-amount {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #34d399 !important;
  letter-spacing: -0.02em !important;
}

/* ── PROFILE HERO (investor-detail, settings) ────────────────────────────── */
.profile-hero {
  border-radius: var(--dt-radius) !important;
  padding: 28px 32px !important;
  margin-bottom: 22px !important;
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
}

/* ── WATERFALL TIER ROWS (distributions, deal) ───────────────────────────── */
.tier-row {
  display: flex !important;
  align-items: center !important;
  padding: 14px 16px !important;
  background: #111827 !important;
  border-radius: 8px !important;
  margin-bottom: 8px !important;
  border-left: 4px solid var(--dt-accent) !important;
}
.tier-row.return { border-left-color: #64748B !important; }
.tier-row.pref   { border-left-color: #f59e0b !important; }
.tier-row.catchup{ border-left-color: var(--dt-accent) !important; }
.tier-row.split  { border-left-color: #22c55e !important; }

/* ── BADGE COLOR OVERRIDES: beat contrast-fix.css specificity ──────────────
   contrast-fix.css sets html body .badge { color: #e2e8f0 !important }
   We need higher specificity to keep our color-coded badges meaningful.
   ────────────────────────────────────────────────────────────────────────── */
html body .badge.badge-mf,
html body .badge-mf     { background: rgba(145,195,206,0.25) !important; color: #1A6070 !important; }
html body .badge.badge-ind,
html body .badge-ind    { background: rgba(45,154,107,0.15) !important; color: #0F5C35 !important; }
html body .badge.badge-ret,
html body .badge-ret    { background: rgba(232,137,10,0.15) !important; color: #6B4000 !important; }
html body .badge.badge-off,
html body .badge-off    { background: rgba(139,92,246,0.15) !important; color: #a78bfa !important; }
html body .badge.badge-other,
html body .badge-other  { background: rgba(107,101,96,0.12) !important; color: #3D3A37 !important; }
html body .badge.badge-sourcing,
html body .badge-sourcing  { background: rgba(107,101,96,0.12) !important; color: #3D3A37 !important; }
html body .badge.badge-loi,
html body .badge-loi       { background: rgba(232,137,10,0.15) !important; color: #6B4000 !important; }
html body .badge.badge-dd,
html body .badge-dd        { background: rgba(145,195,206,0.25) !important; color: #1A6070 !important; }
html body .badge.badge-closed,
html body .badge-closed    { background: rgba(45,154,107,0.15) !important; color: #0F5C35 !important; }
html body .badge.badge-operating,
html body .badge-operating { background: rgba(123,92,196,0.15) !important; color: #3D2080 !important; }
html body .badge.badge-active,
html body .badge-active    { background: rgba(16,185,129,0.15) !important; color: #34d399 !important; }
html body .badge.badge-verified,
html body .badge-verified  { background: rgba(16,185,129,0.15) !important; color: #34d399 !important; }
html body .badge.badge-pending,
html body .badge-pending   { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }
html body .badge.badge-expired,
html body .badge-expired   { background: rgba(239,68,68,0.15) !important; color: #f87171 !important; }
html body .badge.badge-inactive,
html body .badge-inactive  { background: rgba(100,116,139,0.1)!important; color: #64748b !important; }
html body .badge.badge-funded,
html body .badge-funded    { background: rgba(14,165,233,0.15) !important; color: #38bdf8 !important; }
html body .badge.badge-committed,
html body .badge-committed { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }
html body .badge.badge-posted,
html body .badge-posted    { background: rgba(16,185,129,0.15) !important; color: #34d399 !important; }
html body .badge.badge-draft,
html body .badge-draft     { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }

/* ─── END BADGE OVERRIDES ─────────────────────────────────────────────────── */

/* ── CONTENT INSIDE .main WITHOUT A .content WRAPPER ─────────────────────────
   Many tool/utility pages put content directly inside <main class="main">
   (no intermediate .content div). After we zeroed out .main padding,
   these pages have no breathing room. Fix: add padding to direct children
   of .main that aren't the header/sidebar elements.
   ─────────────────────────────────────────────────────────────────────────── */

/* Any div/section directly inside main that ISN'T a header gets standard padding.
   Using :not selectors to exclude headers so they stay flush. */
main.main > div:not(.dt-header):not(.top-bar):not(.sidebar-overlay):not(.page-header),
main.main > section:not(.dt-header) {
  /* Applied only when there's no .content wrapper already handling this */
}

/* Simpler: pages that have .main > .card or .main > .grid directly 
   need padding. We can't add it to .main without breaking pages that 
   have .content. Solution: wrap it in the polished app shell standard.
   
   ACTUAL FIX: re-allow .main padding only on pages using dt-header pattern.
   Pages with dt-header inside main get padding via .main > *:not(.dt-header) */
main.main > *:not(.dt-header):not(.sidebar-overlay):not(.top-bar):not(header):not(nav):first-of-type {
  /* Do nothing here — individual page wrappers handle it */
}

/* THE REAL FIX: pages with .dt-header directly in .main 
   need a content wrapper. Since we can't add that without HTML changes,
   we give .main a modest padding only when it doesn't have .content */

/* Selector: main that contains dt-header but NOT .content */
/* Can't do :has() selector in all browsers yet, so use a different approach:
   Restore the original behavior — .main padding is 28px 32px, 
   but .content adds its OWN padding (28px 32px), creating double pad.
   The fix: let .main have 0 padding (as set), 
   and ensure every page's .content handles the padding.
   For pages WITHOUT .content: their inline .main{padding:40px} was being 
   overridden by our !important — so restore reasonable padding for those. */

/* Override our earlier padding:0 — instead let per-page inline styles win 
   for pages that set .main {padding: 40px}. Remove the !important from main padding. */

/* ── STANDALONE PAGE TITLES (no .dt-header or .top-bar) ──────────────────────
   Many tool pages have <main class="main"> → <div style="margin-bottom:32px">
   → <h1> as the title pattern. Without a sticky header bar, the title just
   floats. We style these to look intentional.
   ─────────────────────────────────────────────────────────────────────────── */

/* The .header class used by dynamic-valuation, scenario-planner etc */
.header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 16px !important;
  margin-bottom: 28px !important;
  flex-wrap: wrap !important;
}
.header h1 {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #1B1A19 !important;
  margin: 0 0 4px 0 !important;
  letter-spacing: -0.025em !important;
}
.header > div > p,
.header > p {
  font-size: 13px !important;
  color: #64748B !important;
  margin: 0 !important;
}

/* Generic page header inside .main (carry-tracker, gp-benchmarks pattern) */
main.main > div:first-child > h1,
main > div:first-child > h1 {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #1B1A19 !important;
  letter-spacing: -0.025em !important;
}

/* ── .page-header INSIDE MAIN (pages like distributions.html) ─────────────── */
.page-header {
  margin-bottom: 28px !important;
}
.page-header h1,
.page-title {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #1B1A19 !important;
  letter-spacing: -0.03em !important;
  margin: 0 0 4px 0 !important;
}
.page-description,
.page-header p {
  font-size: 13px !important;
  color: #64748B !important;
  margin: 0 !important;
}

/* ─── END TITLE FIX ──────────────────────────────────────────────────────── */

/* ── FINAL CATCH-ALL: ensure key text elements are readable on dark theme ────
   These override any per-page styles that might make text invisible.
   Using high-specificity selectors.
   ─────────────────────────────────────────────────────────────────────────── */

/* Summary/stat value cells that use .val class */
.summary-cell .val,
.metric-cell .val,
.stat-cell .val {
  color: #1B1A19 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
}

/* Card titles everywhere */
.card .card-title,
.card-card .card-title {
  color: #1B1A19 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

/* Table header row */
table thead tr th {
  color: #64748B !important;
  background: rgba(255,255,255,0.025) !important;
}

/* Table data rows */
table tbody tr td {
  color: #E2E8F0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/* Input labels everywhere */
.form-group > label,
.form-group label,
fieldset label {
  color: #6B6560 !important;
}

/* h3 inside cards */
.card h3,
.card-body h3,
.panel h3 {
  color: #1B1A19 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  margin-bottom: 12px !important;
}

/* h2 inside card headers */
.card-header h2,
.card-header > h2 {
  color: #1B1A19 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  margin: 0 !important;
}

/* Metric values (common pattern: .metric-val, .metric-hero .metric-val) */
.metric-val,
.metric-hero .metric-val,
.carry-val,
.stat-val,
.hero-num {
  color: #1B1A19 !important;
  font-family: 'JetBrains Mono', monospace !important;
}

/* Description/subtitle text */
.metric-delta,
.metric-label,
.carry-lbl,
.stat-label,
.widget-subtext {
  color: #64748B !important;
  font-size: 12px !important;
}

/* Specific: benchmarks metric comparison */
.metric-compare,
.benchmark-range {
  color: #6B6560 !important;
  font-size: 12px !important;
}

/* ── END FINAL CATCH-ALL ─────────────────────────────────────────────────── */

/* ── ADDITIONAL VAL/METRIC CLASSES: force white on dark ──────────────────── */
.perf-val,
.summary-val,
.cohort-val,
.m-val,
.metric-val,
.carry-val,
.kpi-val,
.figure-val,
.calc-val,
.result-val {
  color: #1B1A19 !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-weight: 700 !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   CONTRAST ENFORCEMENT — 2026-03-07
   
   Problem: #64748b and #475569 used as secondary text on dark backgrounds
   Both fail WCAG AA (need ≥4.5:1). On #111827: #64748b = 3.7:1, #475569 = 2.3:1
   
   Fix: All secondary/muted text must be ≥ #94A3B8 (6.9:1 on #111827)
        Use #94A3B8 for secondary info, #CBD5E1 for labels, #F8FAFC for primary
   ════════════════════════════════════════════════════════════════════════════ */

/* Override --dt-text-muted to a readable value */
:root {
  --dt-text-muted: #94A3B8 !important;
  --text-muted: #94A3B8 !important;
  --text-secondary: #CBD5E1 !important;
}

/* Any element using the problematic colors: boost them */
[style*="color: #64748b"],
[style*="color:#64748b"],
[style*="color: #64748B"],
[style*="color:#64748B"] {
  color: #6B6560 !important;
}

[style*="color: #475569"],
[style*="color:#475569"] {
  color: #6B6560 !important;
}

[style*="color: #334155"],
[style*="color:#334155"] {
  color: #6B6560 !important;
}

/* CSS class selectors using those colors */
.text-muted, .text-secondary, .muted, .secondary,
.label, .lbl, .stat-label, .stat-lbl,
.card-subtitle, .page-description,
.investor-email, .deal-location, .deal-meta,
.activity-time, .dist-period, .dist-meta,
.summary-lbl, .kpi-label, .metric-label,
.form-group .help-text, .help-text,
.breadcrumb a, nav.breadcrumb a {
  color: #6B6560 !important;
}

/* Extra: the dt-global table headers (#64748B) */
th, .table th, .data-table th {
  color: #6B6560 !important;
}

/* Form labels should be lighter than muted text */
label, .form-group label, .label {
  color: #6B6560 !important;
}

/* Section / nav section headers */
.nav-section, .sidebar .nav-section, #sidebar .nav-section {
  color: rgba(255,255,255,0.45) !important;
}

/* Card body secondary text */
.card-body p, .card p {
  color: #6B6560 !important;
}

/* Override the .page-header p which was #64748b */
.page-header p, .page-title-bar p, .dt-header p {
  color: #6B6560 !important;
}

/* Sidebar footer role */
.sidebar-footer .user-role,
#sidebar .sidebar-footer .user-role {
  color: rgba(255,255,255,0.55) !important;
}

/* Nav items default state */
.nav-item, .sidebar .nav-item, #sidebar .nav-item,
.sidebar a.nav-item, #sidebar a.nav-item {
  color: rgba(255,255,255,0.72) !important;
}

/* Empty state text */
.empty-state p, .empty-ledger div, .empty-inbox p {
  color: #6B6560 !important;
}

/* Distribution meta text */
.distribution-meta, .distribution-meta span {
  color: #6B6560 !important;
}

/* ─── END CONTRAST FIX ─────────────────────────────────────────────────── */

/* ════════════════════════════════════════════════════════════════════════════
   CONTRAST ENFORCEMENT — 2026-03-07

   Problem: #64748b (#64748B) and #475569 are used as secondary/muted text
   on dark backgrounds but fail WCAG AA. On #111827: #64748b=3.7:1, #475569=2.3:1
   
   Minimum acceptable: #94A3B8 (6.9:1 on #111827, 7.3:1 on #0B1120)
   
   Fix: Enforce readable colors on all common text patterns.
   ════════════════════════════════════════════════════════════════════════════ */

/* Boost global CSS vars */
:root {
  --dt-text-muted: #94A3B8;
  --text-muted: #94A3B8;
  --text-secondary: #CBD5E1;
}

/* Boost per-page CSS var definitions that pages set locally */
/* We can't override these with :root due to page-local :root blocks,
   but we can target the elements that use them */

/* Table headers — always readable */
th, .table th, .data-table th, table thead th {
  color: #6B6560 !important;
}

/* Table cells — clear primary text */
td, .table td, .data-table td, table tbody td {
  color: #E2E8F0 !important;
}

/* Form labels */
label, .form-group label, .label-text {
  color: #6B6560 !important;
}

/* All "muted" helper text patterns */
.text-muted, .text-secondary, .muted,
.help-text, .card-subtitle, .page-description,
.investor-email, .deal-location, .deal-meta, .card-meta,
.activity-time, .stat-label, .stat-lbl, .kpi-label,
.summary-lbl, .metric-label, .metric-delta,
.breadcrumb a, nav.breadcrumb a {
  color: #6B6560 !important;
}

/* Inline style overrides for the most common bad values */
/* These !important rules override inline style="color:#64748b" on elements */
/* We use attribute selectors which beat inline styles when combined with !important */

/* Page header descriptions */
.page-header p, .page-title-bar p, .dt-header p, 
main .header > div > p, main .header p,
header p {
  color: #6B6560 !important;
}

/* Card body text */
.card-body p {
  color: #6B6560 !important;
}

/* Sidebar nav section labels (the "DEALS", "FINANCE" etc headers) */
.nav-section, .sidebar .nav-section, #sidebar .nav-section {
  color: rgba(255,255,255,0.5) !important;
}

/* Nav items: boost default opacity */
.nav-item, .sidebar .nav-item, #sidebar .nav-item {
  color: rgba(255,255,255,0.75) !important;
}

/* Breadcrumb separators */
.breadcrumb-sep, .breadcrumb-separator {
  color: rgba(255,255,255,0.3) !important;
}

/* Empty states */
.empty-state, .empty-state p, .empty-state h3,
.empty-ledger, .empty-inbox p {
  color: #6B6560 !important;
}
.empty-state h3 { color: #6B6560 !important; }

/* Distribution page specific */
.distribution-meta span { color: #6B6560 !important; }
.dist-period, .dist-meta { color: #6B6560 !important; }

/* Profile/deal meta lines */
.profile-meta span, .deal-location, .deal-badges + div {
  color: #6B6560 !important;
}

/* Tool cards in tools.html */
.tool-desc { color: #6B6560 !important; }
.category-desc { color: #6B6560 !important; }
.category-count { color: #6B6560 !important; }

/* Timestamps and dates everywhere */
time, .timestamp, .date-text {
  color: #6B6560 !important;
}

/* ─── END CONTRAST ENFORCEMENT ──────────────────────────────────────────── */

/* ════════════════════════════════════════════════════════════════════════════
   MUBASIC-INSPIRED LIGHT THEME OVERRIDES
   Applied after all per-page styles — these WIN.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Global body/page background ────────────────────────────────────────── */
html body,
body {
  background: #F3F3F3 !important;
  color: #1B1A19 !important;
}

/* ── Main content area ───────────────────────────────────────────────────── */
.main, main.main, main, #main,
.portal-main {
  background: #F3F3F3 !important;
}

/* ── Top bar: warm white ─────────────────────────────────────────────────── */
.top-bar, header.top-bar,
.dt-header, .topbar, .pl-header {
  background: #FFFFFF !important;
  border-bottom: 1.5px solid #E2DDD8 !important;
  color: #1B1A19 !important;
  box-shadow: 0 1px 3px rgba(27,26,25,0.06) !important;
}
.top-bar h1, .dt-header h1, .topbar h1, .pl-header h1 {
  color: #1B1A19 !important;
}
.top-bar p, .dt-header p, .topbar p {
  color: #6B6560 !important;
}

/* ── Cards / panels ──────────────────────────────────────────────────────── */
.card, .gl-card, .card-card,
.glass-card, .stat-card, .kpi-card,
.settings-section, .deal-hero + .card,
.form-section, .summary-card {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
  box-shadow: 0 1px 4px rgba(27,26,25,0.07) !important;
}
.card:hover, .stat-card:hover, .kpi-card:hover {
  box-shadow: 0 4px 12px rgba(27,26,25,0.1) !important;
}

/* ── Card headers/bodies ─────────────────────────────────────────────────── */
.card-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2DDD8 !important;
}
.card-title { color: #1B1A19 !important; }
.card-subtitle { color: #6B6560 !important; }

/* ── Typography throughout ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { color: #1B1A19; }
p { color: #1B1A19; }
/* Allow dark-background containers to set their own text colors */
.contact-card h3, .contact-card p,
[style*="background:#1B1A19"] h3, [style*="background:#1B1A19"] p,
[style*="background:#2D2A27"] h3, [style*="background:#2D2A27"] p,
.dark-card h3, .dark-card p { color: inherit !important; }
label { color: #3D3A37 !important; }

/* Muted text — readable warm gray */
.text-muted, .text-secondary, .muted,
.help-text, .card-subtitle, .page-description,
.investor-email, .deal-location, .card-meta,
.activity-time, .stat-label, .stat-lbl, .kpi-label,
.summary-lbl, .metric-label, .breadcrumb a,
.table-footer-info, .category-desc,
nav.breadcrumb a, .nav-section {
  color: #6B6560 !important;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
thead, table thead { background: #EDEBE8 !important; }
th, .table th, .data-table th, table thead th {
  background: #EDEBE8 !important;
  color: #6B6560 !important;
  border-bottom: 1px solid #D8D4CE !important;
}
td, .table td, table tbody td {
  background: transparent !important;
  color: #1B1A19 !important;
  border-bottom: 1px solid #EDEBE8 !important;
}
tr:hover td, table tbody tr:hover td {
  background: #F7F4F0 !important;
}

/* ── Form inputs ─────────────────────────────────────────────────────────── */
input, select, textarea,
.form-input, .form-select, .input, .search-input {
  background: #FFFFFF !important;
  border: 1.5px solid #D8D4CE !important;
  color: #1B1A19 !important;
}
input:focus, select:focus, textarea:focus,
.form-input:focus, .form-select:focus {
  border-color: #F37925 !important;
  box-shadow: 0 0 0 3px rgba(243,121,37,0.12) !important;
}
input::placeholder, textarea::placeholder {
  color: #9C9590 !important;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary, button.btn-primary, a.btn-primary {
  background: #F37925 !important;
  color: #1B1A19 !important;
  font-weight: 700 !important;
  border: none !important;
}
.btn-primary:hover, button.btn-primary:hover {
  background: #D96515 !important;
  color: #1B1A19 !important;
  box-shadow: 0 4px 12px rgba(243,121,37,0.3) !important;
}
.btn-secondary, button.btn-secondary {
  background: #FFFFFF !important;
  color: #1B1A19 !important;
  border: 1.5px solid #D8D4CE !important;
  font-weight: 600 !important;
}
.btn-secondary:hover, button.btn-secondary:hover {
  background: #F3F3F3 !important;
  border-color: #9C9590 !important;
}

/* ── Deal/status badges ──────────────────────────────────────────────────── */
.badge-mf        { background: rgba(145,195,206,0.25) !important; color: #1A6070 !important; }
.badge-ind       { background: rgba(45,154,107,0.15) !important; color: #0F5C35 !important; }
.badge-ret       { background: rgba(232,137,10,0.15) !important; color: #6B4000 !important; }
.badge-off       { background: rgba(192,168,230,0.3)  !important; color: #5035A0 !important; }
.badge-other, .badge-sourcing { background: rgba(107,101,96,0.12) !important; color: #3D3A37 !important; }
.badge-loi       { background: rgba(232,137,10,0.15) !important; color: #6B4000 !important; }
.badge-dd        { background: rgba(145,195,206,0.25) !important; color: #1A6070 !important; }
.badge-closed    { background: rgba(45,154,107,0.15) !important; color: #0F5C35 !important; }
.badge-operating { background: rgba(123,92,196,0.15) !important; color: #3D2080 !important; }
.badge-active    { background: rgba(45,154,107,0.15)  !important; color: #1A7A50 !important; }
.badge-verified  { background: rgba(45,154,107,0.15)  !important; color: #1A7A50 !important; }
.badge-pending   { background: rgba(250,198,112,0.35) !important; color: #7A5000 !important; }
.badge-expired   { background: rgba(217,79,61,0.15)   !important; color: #901800 !important; }
.badge-inactive  { background: rgba(156,149,144,0.2)  !important; color: #5A5550 !important; }
.badge-funded    { background: rgba(145,195,206,0.25) !important; color: #2A7D8C !important; }
.badge-committed { background: rgba(250,198,112,0.35) !important; color: #7A5000 !important; }
.badge-posted    { background: rgba(45,154,107,0.15)  !important; color: #1A7A50 !important; }
.badge-draft     { background: rgba(250,198,112,0.3)  !important; color: #7A5000 !important; }

/* ── IRR / positive numbers ──────────────────────────────────────────────── */
.irr-val, .val-positive, td.irr, .text-success {
  color: #1A7A50 !important;
}
.text-danger { color: #901800 !important; }
.text-warning { color: #7A5000 !important; }
.text-accent  { color: #F37925 !important; }

/* ── Monospace numbers ────────────────────────────────────────────────────── */
.font-mono, .mono, .money, .money-val,
.stat-val, .kpi-value, .carry-val, .metric-val,
.summary-val, .distribution-amount {
  color: #1B1A19 !important;
  font-family: 'JetBrains Mono', monospace !important;
}

/* ── KPI/stat values: warm weight ─────────────────────────────────────────── */
.stat-val, .kpi-value, .stat-body .val {
  color: #1B1A19 !important;
  font-size: 26px !important;
  font-weight: 800 !important;
}
.stat-label, .stat-lbl, .kpi-label {
  color: #6B6560 !important;
}

/* ── Empty states ────────────────────────────────────────────────────────── */
.empty-state, .empty-inbox, .empty-ledger {
  color: #6B6560 !important;
}
.empty-state h3, .empty-inbox h3 { color: #3D3A37 !important; }
.empty-state i { opacity: 0.25 !important; color: #9C9590 !important; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal, .modal-content {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
.modal-header { border-bottom: 1px solid #E2DDD8 !important; }
.modal-title  { color: #1B1A19 !important; }
.modal-footer { border-top: 1px solid #E2DDD8 !important; background: #F7F4F0 !important; }
.modal-close  { background: #EDEBE8 !important; color: #6B6560 !important; }
.modal-close:hover { background: rgba(217,79,61,0.12) !important; color: #901800 !important; }

/* ── Dropdown selects ─────────────────────────────────────────────────────── */
select option { background: #FFFFFF !important; color: #1B1A19 !important; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb-current, .breadcrumb-sep { color: #1B1A19 !important; }
.breadcrumb a:hover { color: #F37925 !important; }

/* ── Scrollbars ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F3F3F3; }
::-webkit-scrollbar-thumb { background: #D8D4CE; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9C9590; }

/* ── Quick action cards (dashboard) ─────────────────────────────────────── */
.qa-card, .quick-action-card {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
.qa-card:hover, .quick-action-card:hover {
  border-color: #F37925 !important;
  background: #FFF9F5 !important;
}
.qa-label { color: #1B1A19 !important; }
.qa-desc  { color: #6B6560 !important; }

/* ── Deal hero section ───────────────────────────────────────────────────── */
.deal-hero {
  background: linear-gradient(135deg, #1B1A19 0%, #3D3A37 100%) !important;
  color: #F3F3F3 !important;
}
.deal-hero h1, .deal-hero .deal-location,
.deal-hero .deal-title-block h1 {
  color: #F3F3F3 !important;
}
.deal-metric { background: rgba(255,255,255,0.1) !important; }
.deal-metric .val { color: #FAC670 !important; }
.deal-metric .lbl { color: rgba(243,241,238,0.65) !important; }

/* ── Activity feed ───────────────────────────────────────────────────────── */
.activity-item { border-bottom-color: #EDEBE8 !important; }
.activity-text { color: #1B1A19 !important; }
.activity-time { color: #6B6560 !important; }

/* ── Distribution cards ──────────────────────────────────────────────────── */
.distribution-card {
  background: #FFFFFF !important;
  border-color: #E2DDD8 !important;
  color: #1B1A19 !important;
}
.distribution-title { color: #1B1A19 !important; }
.distribution-amount { color: #1A7A50 !important; }
.distribution-meta span { color: #6B6560 !important; }

/* ── Pipeline cards ──────────────────────────────────────────────────────── */
.deal-card, .pipeline-card {
  background: #FFFFFF !important;
  border-color: #E2DDD8 !important;
  color: #1B1A19 !important;
}
.deal-card:hover, .pipeline-card:hover {
  border-color: #F37925 !important;
  background: #FFFBF8 !important;
}
.card-name span, .deal-name { color: #1B1A19 !important; }
.card-location, .deal-location { color: #6B6560 !important; }
.card-notes { background: #F7F4F0 !important; border-color: #E2DDD8 !important; color: #3D3A37 !important; }
.card-notes-placeholder { border-color: #D8D4CE !important; color: #9C9590 !important; }

/* ── Pipeline column headers ─────────────────────────────────────────────── */
.stage-col {
  background: rgba(27,26,25,0.03) !important;
  border-color: #E2DDD8 !important;
}
.col-header { background: #FFFFFF !important; border-bottom-color: #E2DDD8 !important; }
.col-title  { color: #1B1A19 !important; }
.col-count  { background: #EDEBE8 !important; color: #6B6560 !important; }
.add-btn    { border-color: #D8D4CE !important; color: #6B6560 !important; }
.add-btn:hover { border-color: #F37925 !important; color: #F37925 !important; background: rgba(243,121,37,0.06) !important; }

/* ── Pipeline drawer ─────────────────────────────────────────────────────── */
.drawer {
  background: #FFFFFF !important;
  border-left: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
.drawer-header { border-bottom-color: #E2DDD8 !important; }
.drawer-footer { border-top-color: #E2DDD8 !important; background: #F7F4F0 !important; }
.drawer-close  { background: #EDEBE8 !important; color: #6B6560 !important; }
.drawer-overlay { background: rgba(27,26,25,0.4) !important; }
.dl-row input, .dl-row select, .dl-row textarea {
  background: #F7F4F0 !important;
  border-color: #D8D4CE !important;
  color: #1B1A19 !important;
}
.dl-row label { color: #6B6560 !important; }
.stage-btn { background: #F3F3F3 !important; border-color: #D8D4CE !important; color: #6B6560 !important; }
.stage-btn:hover { border-color: #9C9590 !important; color: #1B1A19 !important; }

/* ── Tools page ──────────────────────────────────────────────────────────── */
.tool-card {
  background: #FFFFFF !important;
  border-color: #E2DDD8 !important;
  color: #1B1A19 !important;
}
.tool-card:hover { border-color: #F37925 !important; background: #FFFBF8 !important; }
.tool-name  { color: #1B1A19 !important; }
.tool-desc  { color: #6B6560 !important; }
.category-title  { color: #1B1A19 !important; }
.category-desc   { color: #6B6560 !important; }
.category-header { border-bottom-color: #D8D4CE !important; }
.category-count  { background: #EDEBE8 !important; color: #6B6560 !important; }

/* ── Settings page ───────────────────────────────────────────────────────── */
.settings-section .section-header { border-bottom-color: #E2DDD8 !important; background: #FFFFFF !important; }
.section-title i { color: #F37925 !important; }

/* ── Investor/deal detail profile ────────────────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, #1B1A19, #3D3A37) !important;
}
.info-row { border-bottom-color: #EDEBE8 !important; }
.info-label { color: #6B6560 !important; }
.info-value { color: #1B1A19 !important; }

/* ── Capital raise bar ────────────────────────────────────────────────────── */
.cap-bar { background: #EDEBE8 !important; }
.cap-fill { background: linear-gradient(90deg, #F37925, #FAC670) !important; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { border-bottom: 2px solid #E2DDD8 !important; }
.tab { color: #6B6560 !important; background: none !important; }
.tab:hover { color: #1B1A19 !important; }
.tab.active { color: #F37925 !important; border-bottom-color: #F37925 !important; font-weight: 700 !important; }

/* ── Summary tiles (distribution command) ────────────────────────────────── */
.stile { background: #F7F4F0 !important; border-color: #E2DDD8 !important; }
.stile-val { color: #1B1A19 !important; }
.stile-lbl { color: #6B6560 !important; }
.summary-tile { background: #F7F4F0 !important; border-color: #E2DDD8 !important; }
.summary-val  { color: #1B1A19 !important; }
.summary-lbl  { color: #6B6560 !important; }

/* ── Investor split bar ──────────────────────────────────────────────────── */
.investor-split-row { border-bottom-color: #EDEBE8 !important; }
.split-bar { background: linear-gradient(90deg, #F37925, #FAC670) !important; }

/* ── Distribution status pills ───────────────────────────────────────────── */
.status-pending  { background: rgba(250,198,112,0.25) !important; color: #7A5000 !important; border-color: rgba(250,198,112,0.5) !important; }
.status-ready    { background: rgba(145,195,206,0.2)  !important; color: #1A6070 !important; border-color: rgba(145,195,206,0.5) !important; }
.status-executed, .badge-posted { background: rgba(45,154,107,0.15) !important; color: #1A7A50 !important; border-color: rgba(45,154,107,0.3) !important; }

/* ── Sidebar overlay ─────────────────────────────────────────────────────── */
.sidebar-overlay { background: rgba(27,26,25,0.45) !important; }

/* ── Notice/legal footer ─────────────────────────────────────────────────── */
#dt-legal-footer {
  background: #EDEBE8 !important;
  color: #9C9590 !important;
  border-top: 1px solid #D8D4CE !important;
}

/* ── Toast notifications ─────────────────────────────────────────────────── */
#toast { box-shadow: 0 8px 24px rgba(27,26,25,0.15) !important; }

/* ── PnL sections ────────────────────────────────────────────────────────── */
.pnl-income  { background: rgba(45,154,107,0.08) !important; border-color: rgba(45,154,107,0.2) !important; }
.pnl-expense { background: rgba(217,79,61,0.07)  !important; border-color: rgba(217,79,61,0.2)  !important; }

/* ─── END MUBASIC THEME ─────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   CONTRAST FIX — FINAL AUTHORITY SECTION
   ▸ This section is the LAST block in the file.
   ▸ All rules here override every earlier block in this file.
   ▸ Purpose: eliminate WCAG contrast failures on the mubasic light theme.
   ▸ Light theme: body bg = #F3F3F3, surface = #FFFFFF
   ▸ Safe dark sections (sidebar, deal-hero) are explicitly excluded.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 0. BODY ───────────────────────────────────────────────────────────── */
html body,
html body {
  background: #F3F3F3 !important;
  color: #1B1A19 !important;
}

/* ── 2. ALL HEADINGS ────────────────────────────────────────────────────── */
html body h1, html body h2, html body h3,
html body h4, html body h5, html body h6 {
  color: #1B1A19 !important;
}

/* ── 3. PAGE HEADER / TITLE AREA ────────────────────────────────────────── */
html body .page-header h1,
html body .page-title,
html body .dt-header h1,
html body .header h1,
html body .breadcrumb-current,
html body .breadcrumb-sep,
html body .breadcrumb-separator {
  color: #1B1A19 !important;
}
html body .breadcrumb a { color: #6B6560 !important; }
html body .breadcrumb a:hover { color: #F37925 !important; }

/* ── 4. TOP BAR ─────────────────────────────────────────────────────────── */
html body .top-bar,
html body .topbar,
html body header.top-bar,
html body .pl-header {
  background: #FFFFFF !important;
  border-bottom: 1.5px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .top-bar .page-title,
html body .topbar .page-title,
html body .top-bar h1,
html body .topbar h1 {
  color: #1B1A19 !important;
}
html body .top-bar .user-name,
html body .topbar .user-name {
  color: #1B1A19 !important;
}
html body .top-bar .user-role,
html body .topbar .user-role {
  color: #6B6560 !important;
}

/* ── 5. CARDS & PANELS ──────────────────────────────────────────────────── */
html body .card,
html body .gl-card,
html body .card-card,
html body .glass-card,
html body .stat-card,
html body .kpi-card:not(.kpi-primary),
html body .metric-card,
html body .form-section,
html body .summary-card,
html body .settings-section,
html body .result-card,
html body .qa-card,
html body .quick-action-card {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .card-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2DDD8 !important;
}
html body .card-title,
html body .card .card-title,
html body .stat-card .card-title {
  color: #1B1A19 !important;
}
html body .card-subtitle,
html body .card-meta {
  color: #6B6560 !important;
}
html body .card h2, html body .card h3 { color: #1B1A19 !important; }
html body .card p { color: #3D3A37 !important; }

/* ── 6. STAT / KPI VALUES ───────────────────────────────────────────────── */
html body .stat-value,
html body .stat-val,
html body .kpi-value,
html body .carry-val,
html body .metric-val,
html body .perf-val,
html body .summary-val,
html body .result-val,
html body .hero-num,
html body .val {
  color: #1B1A19 !important;
}
html body .stat-label,
html body .stat-lbl,
html body .kpi-label,
html body .metric-label {
  color: #6B6560 !important;
}

/* ── 7. TABLE ───────────────────────────────────────────────────────────── */
html body table thead,
html body thead,
html body table thead tr {
  background: #EDEBE8 !important;
}
html body th,
html body table th,
html body thead th {
  background: #EDEBE8 !important;
  color: #6B6560 !important;
  border-bottom: 1px solid #D8D4CE !important;
}
html body td,
html body table td {
  background: transparent !important;
  color: #1B1A19 !important;
  border-bottom: 1px solid #EDEBE8 !important;
}
html body tr:hover td,
html body table tbody tr:hover td {
  background: #F7F4F0 !important;
}
html body td a,
html body table td a {
  color: #F37925 !important;
  text-decoration: none !important;
}
html body td a:hover,
html body table td a:hover {
  color: #D96515 !important;
  text-decoration: underline !important;
}

/* ── 8. FORMS & INPUTS ──────────────────────────────────────────────────── */
html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html body select,
html body textarea,
html body .form-input,
html body .form-select,
html body .search-input,
html body .search-wrap input,
html body .notes-area {
  background: #FFFFFF !important;
  border: 1.5px solid #D8D4CE !important;
  color: #1B1A19 !important;
}
html body input:focus,
html body select:focus,
html body textarea:focus,
html body .search-input:focus,
html body .search-wrap input:focus {
  border-color: #F37925 !important;
  box-shadow: 0 0 0 3px rgba(243,121,37,0.12) !important;
}
html body input::placeholder,
html body textarea::placeholder,
html body .search-input::placeholder,
html body .search-wrap input::placeholder {
  color: #9C9590 !important;
  opacity: 1 !important;
}
html body label,
html body .form-group label,
html body .form-group > label,
html body .input-label {
  color: #3D3A37 !important;
}

/* ── 9. BUTTONS ─────────────────────────────────────────────────────────── */
/* btn-primary: orange bg, dark text (WCAG contrast) */
html body .btn-primary,
html body button.btn-primary,
html body a.btn-primary {
  background: #F37925 !important;
  color: #1B1A19 !important;
  border: none !important;
  font-weight: 700 !important;
}
html body .btn-primary:hover,
html body button.btn-primary:hover {
  background: #D96515 !important;
  color: #1B1A19 !important;
}
/* btn-secondary: white bg, dark text */
html body .btn-secondary,
html body button.btn-secondary {
  background: #FFFFFF !important;
  color: #1B1A19 !important;
  border: 1.5px solid #D8D4CE !important;
  font-weight: 600 !important;
}
html body .btn-secondary:hover,
html body button.btn-secondary:hover {
  background: #F3F3F3 !important;
  border-color: #9C9590 !important;
  color: #1B1A19 !important;
}
/* btn-success: green bg, white text */
html body .btn-success,
html body button.btn-success {
  background: #2D9A6B !important;
  color: #FFFFFF !important;
  border: none !important;
}
html body .btn-success:hover,
html body button.btn-success:hover {
  background: #1E7A52 !important;
  color: #FFFFFF !important;
}
/* btn-danger: red bg, white text */
html body .btn-danger,
html body button.btn-danger {
  background: #D94F3D !important;
  color: #FFFFFF !important;
  border: none !important;
}
html body .btn-danger:hover { background: #B83A2A !important; color: #FFFFFF !important; }
/* btn-ghost / btn-outline */
html body .btn-ghost,
html body .btn-outline,
html body button.btn-ghost {
  background: transparent !important;
  color: #3D3A37 !important;
  border: 1.5px solid #D8D4CE !important;
}
html body .btn-ghost:hover,
html body .btn-outline:hover {
  background: #F3F3F3 !important;
  color: #1B1A19 !important;
  border-color: #9C9590 !important;
}
/* btn-xs (small table action buttons) */
html body .btn-xs {
  background: transparent !important;
  color: #6B6560 !important;
  border: 1px solid #D8D4CE !important;
}
html body .btn-xs:hover {
  background: #F3F3F3 !important;
  color: #1B1A19 !important;
  border-color: #9C9590 !important;
}
/* btn-print / export buttons */
html body .btn-print {
  background: #EDEBE8 !important;
  color: #3D3A37 !important;
  border: 1px solid #D8D4CE !important;
}
/* Other common button types */
html body .view-btn { background: transparent !important; color: #6B6560 !important; border: 1px solid #D8D4CE !important; }
html body .view-btn.active { background: #F37925 !important; color: #FFFFFF !important; border-color: #F37925 !important; }
html body .filter-btn { background: transparent !important; color: #6B6560 !important; border: 1px solid #D8D4CE !important; }
html body .filter-btn.active, html body .filter-btn:hover { background: #F37925 !important; color: #FFFFFF !important; border-color: #F37925 !important; }
html body .exec-btn { background: #2D9A6B !important; color: #FFFFFF !important; border: none !important; }
html body .exec-btn:hover { background: #1E7A52 !important; color: #FFFFFF !important; }
html body .select-deal-btn { background: #EDEBE8 !important; color: #3D3A37 !important; border: 1px solid #D8D4CE !important; }
html body .select-deal-btn:hover { background: #F37925 !important; color: #FFFFFF !important; border-color: #F37925 !important; }
html body .btn-approve { background: #2D9A6B !important; color: #FFFFFF !important; }
html body .btn-confirm { background: #2D9A6B !important; color: #FFFFFF !important; }
html body .cta-btn { background: #F37925 !important; color: #1B1A19 !important; font-weight: 700 !important; }

/* ── 10. MODAL ──────────────────────────────────────────────────────────── */
html body .modal,
html body .modal-content,
html body .modal-container {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .modal-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2DDD8 !important;
}
html body .modal-title { color: #1B1A19 !important; }
html body .modal-body { color: #1B1A19 !important; }
html body .modal-footer {
  background: #F7F4F0 !important;
  border-top: 1px solid #E2DDD8 !important;
}
html body .modal-close {
  background: #EDEBE8 !important;
  color: #6B6560 !important;
  border: none !important;
}
html body .modal-close:hover {
  background: rgba(217,79,61,0.12) !important;
  color: #901800 !important;
}

/* ── 11. ACTIVITY & TIMELINE ────────────────────────────────────────────── */
html body .activity-text { color: #1B1A19 !important; }
html body .activity-time,
html body .timeline-date { color: #6B6560 !important; }
html body .activity-item { border-bottom-color: #EDEBE8 !important; }
html body .timeline-title { color: #1B1A19 !important; }
html body .timeline-loan { color: #3D3A37 !important; }

/* ── 12. USER AVATAR / NAME in top-bar area ─────────────────────────────── */
/* (sidebar versions are handled by sidebar rules and keep white text) */
html body .main .user-name,
html body .top-bar .user-name,
html body .topbar .user-name,
html body .content .user-name {
  color: #1B1A19 !important;
}
html body .main .user-role,
html body .top-bar .user-role,
html body .topbar .user-role,
html body .content .user-role {
  color: #6B6560 !important;
}

/* ── 13. COMMON TEXT CLASSES ────────────────────────────────────────────── */
html body .page-description,
html body .section-description,
html body .card-sub,
html body .investor-email,
html body .deal-type-badge,
html body .help-text,
html body .info-note {
  color: #6B6560 !important;
}
html body .text-muted,
html body .muted {
  color: #6B6560 !important;
}
html body .text-secondary {
  color: #6B6560 !important;
}
/* Mono / financial values */
html body .font-mono,
html body .mono,
html body .money,
html body .money-val {
  color: #1B1A19 !important;
}
html body .text-success,
html body .irr-val,
html body .val-positive { color: #1A7A50 !important; }
html body .text-danger  { color: #901800 !important; }
html body .text-warning { color: #7A5000 !important; }
html body .text-accent  { color: #D96515 !important; }

/* ── 14. SECTION/WIDGET HEADINGS inside .main ───────────────────────────── */
html body .main h1,
html body .main h2,
html body .main h3,
html body .main h4,
html body .content h1,
html body .content h2,
html body .content h3,
html body .content h4 {
  color: #1B1A19 !important;
}
html body .main p,
html body .content p {
  color: #3D3A37 !important;
}
html body .section-header { color: #1B1A19 !important; }

/* ── 15. LOAN / DEBT TRACKER ────────────────────────────────────────────── */
html body .loan-card,
html body .loan-card-body,
html body .loan-detail-section,
html body .timeline-section {
  background: #FFFFFF !important;
  border-color: #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .loan-name { color: #1B1A19 !important; }
html body .loan-meta-value { color: #1B1A19 !important; }
html body .detail-value { color: #1B1A19 !important; }
html body .detail-label { color: #6B6560 !important; }
html body .badge-floating { background: rgba(217,79,61,0.12) !important; color: #901800 !important; }
html body .badge-paidoff  { background: rgba(45,154,107,0.12) !important; color: #1A7A50 !important; }

/* ── 16. INBOX / EMAIL COMPONENTS ──────────────────────────────────────── */
html body .inbox-item,
html body .email-item,
html body .message-item {
  background: #FFFFFF !important;
  border-bottom-color: #EDEBE8 !important;
  color: #1B1A19 !important;
}
html body .inbox-item:hover,
html body .email-item:hover {
  background: #F7F4F0 !important;
}
html body .inbox-item.unread { background: #FFFBF8 !important; }
html body .email-body,
html body .message-body {
  background: #FFFFFF !important;
  color: #1B1A19 !important;
  border: 1px solid #E2DDD8 !important;
}
html body .reply-composer {
  background: #F7F4F0 !important;
  border-top: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .sender-name { color: #1B1A19 !important; }
html body .message-preview { color: #6B6560 !important; }
html body .message-date { color: #6B6560 !important; }

/* ── 17. DEAL-TEASER / PUBLIC-FACING PAGES ──────────────────────────────── */
html body .site-header {
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
}
html body .site-header a,
html body .site-header .logo { color: #F3F3F3 !important; }
/* Hero section stays dark */
html body .hero-section,
html body .teaser-header,
html body .om-cover {
  background: linear-gradient(135deg, #1B1A19, #3D3A37) !important;
  color: #F3F3F3 !important;
}
html body .hero-section h1,
html body .hero-section h2,
html body .hero-section p,
html body .teaser-header h1,
html body .teaser-header p {
  color: #F3F3F3 !important;
}
html body .hero-location,
html body .hero-metric .lbl {
  color: rgba(243,241,238,0.75) !important;
}
/* Highlight/metric cards below hero */
html body .teaser-highlights,
html body .highlights,
html body .metric {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .highlight-label { color: #6B6560 !important; }
html body .highlight-value { color: #1B1A19 !important; }
html body .teaser-stat { background: #FFFFFF !important; border-color: #E2DDD8 !important; color: #1B1A19 !important; }
html body .teaser-footer { background: #1B1A19 !important; color: rgba(243,241,238,0.7) !important; }
html body .teaser-footer a { color: rgba(243,241,238,0.9) !important; }

/* ── 18. DISTRIBUTION CALC / WATERFALL ──────────────────────────────────── */
html body .wf-tier {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .tier-label { color: #1B1A19 !important; }
html body .tier-desc  { color: #6B6560 !important; }
html body .tier-num   { background: #F37925 !important; color: #FFFFFF !important; }
html body .waterfall-explainer {
  background: #FFFFFF !important;
  color: #1B1A19 !important;
}
html body .summary-item {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .summary-hint div { background: #F7F4F0 !important; color: #3D3A37 !important; }
html body .tier-bar,
html body .input-group {
  background: #EDEBE8 !important;
  border-color: #D8D4CE !important;
}

/* ── 19. K-1 GENERATOR ──────────────────────────────────────────────────── */
html body .k1-box-title,
html body .k1-section-title {
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
}
html body .k1-warning {
  background: rgba(217,79,61,0.1) !important;
  color: #901800 !important;
  border: 1px solid rgba(217,79,61,0.25) !important;
}
html body .k1-line-num { background: #EDEBE8 !important; color: #6B6560 !important; }

/* ── 20. INVESTOR PORTAL / WELCOME BANNER ───────────────────────────────── */
html body .welcome-banner {
  background: linear-gradient(135deg, #1B1A19, #3D3A37) !important;
  color: #F3F3F3 !important;
}
html body .welcome-banner h1,
html body .welcome-banner p {
  color: #F3F3F3 !important;
}

/* ── 21. OM BUILDER / INVESTOR UPDATE ──────────────────────────────────── */
html body .om-nav {
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
}
html body .om-nav a,
html body .om-nav button { color: rgba(243,241,238,0.85) !important; }
html body .om-section h2 { color: #1B1A19 !important; }
html body .om-label { color: #6B6560 !important; }
html body .email-preview,
html body .om-preview {
  background: #F3F3F3 !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .ep-kpi {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .ep-footer {
  background: #1B1A19 !important;
  color: rgba(243,241,238,0.75) !important;
}
html body .highlight-card {
  background: linear-gradient(135deg, #1B1A19, #3D3A37) !important;
  color: #F3F3F3 !important;
}
html body .video-placeholder { background: #1B1A19 !important; color: #F3F3F3 !important; }

/* ── 22. CAPITAL ACCOUNT / STATEMENT ───────────────────────────────────── */
html body .statement-header {
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
}
html body .statement-header h1,
html body .statement-header p { color: #F3F3F3 !important; }
html body .performance-box {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .ledger-table th { background: #EDEBE8 !important; color: #6B6560 !important; }
html body .val { color: #1B1A19 !important; }

/* ── 23. SOURCING CRM / PIPELINE ────────────────────────────────────────── */
html body .pipeline-col {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
}
html body .pipeline-col .col-title { color: #1B1A19 !important; }
html body .inline-note-input input {
  background: #FFFFFF !important;
  color: #1B1A19 !important;
  border-color: #D8D4CE !important;
}

/* ── 24. MISC DARK COMPONENTS ───────────────────────────────────────────── */
html body .result-box {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .result-box h3 { color: #1B1A19 !important; }
html body .result-box .result-val { color: #1B1A19 !important; }
html body .workflow-step {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .phase-header {
  background: #EDEBE8 !important;
  color: #1B1A19 !important;
  border-bottom: 1px solid #D8D4CE !important;
}
html body .task:hover { background: #F7F4F0 !important; }
html body .task-assignee { background: #EDEBE8 !important; color: #3D3A37 !important; }
html body .insight-item {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .calendar-task {
  background: rgba(243,121,37,0.1) !important;
  color: #7A3000 !important;
  border-left: 3px solid #F37925 !important;
}
html body .chat-main {
  background: #F7F4F0 !important;
  color: #1B1A19 !important;
}
html body .chat-item { background: #FFFFFF !important; border-bottom-color: #EDEBE8 !important; }
html body .retention-bar { background: #EDEBE8 !important; }
html body .loyalty-table th { background: #EDEBE8 !important; color: #6B6560 !important; }
html body .trend-canvas { background: #FFFFFF !important; border: 1px solid #E2DDD8 !important; }
html body .matrix-table th { background: #EDEBE8 !important; color: #6B6560 !important; }
html body .comparison-table th { background: #EDEBE8 !important; color: #6B6560 !important; }
html body .sens-table th { background: #EDEBE8 !important; color: #6B6560 !important; }
html body .sens-neutral { background: #F7F4F0 !important; color: #1B1A19 !important; }
html body .recon-table th { background: #EDEBE8 !important; color: #6B6560 !important; }
html body .deal-scoring-card { background: #FFFFFF !important; border-color: #E2DDD8 !important; color: #1B1A19 !important; }
html body .hud-total { background: #EDEBE8 !important; color: #1B1A19 !important; }
html body .timer-badge { background: rgba(243,121,37,0.15) !important; color: #7A3000 !important; }
html body .chip-time { background: #EDEBE8 !important; color: #3D3A37 !important; }
html body .asset-row { background: #FFFFFF !important; border-color: #E2DDD8 !important; color: #1B1A19 !important; }
html body .je-section pre { background: #F7F4F0 !important; color: #1B1A19 !important; border: 1px solid #E2DDD8 !important; }

/* ── 25. LEGAL / NOTICE BANNERS ─────────────────────────────────────────── */
html body #dt-legal-footer,
html body .dt-legal-footer {
  background: #EDEBE8 !important;
  color: #6B6560 !important;
  border-top: 1px solid #D8D4CE !important;
}
html body .platform-notice,
html body .notice-banner {
  background: rgba(243,121,37,0.08) !important;
  color: #7A3000 !important;
  border: 1px solid rgba(243,121,37,0.2) !important;
}

/* ── 26. BADGES & STATUS PILLS ──────────────────────────────────────────── */
html body .badge-info,
html body .badge-blue {
  background: rgba(145,195,206,0.25) !important;
  color: #2A7D8C !important;
  border: 1px solid rgba(145,195,206,0.4) !important;
}
html body .badge-secondary {
  background: #EDEBE8 !important;
  color: #6B6560 !important;
  border: 1px solid #D8D4CE !important;
}
html body .column-count,
html body .doc-count,
html body .stage-count,
html body .task-col h3 .count {
  background: #F37925 !important;
  color: #FFFFFF !important;
}

/* ── 27. WIZARD / ONBOARDING STEPS ─────────────────────────────────────── */
html body .wizard-step.active .step-num,
html body .onboarding-stepper .step.active span,
html body .dr-tab.active {
  background: #F37925 !important;
  color: #FFFFFF !important;
}
html body .wizard-step.completed .step-num {
  background: #2D9A6B !important;
  color: #FFFFFF !important;
}
html body .doc-item input:checked + .doc-check {
  background: #F37925 !important;
  color: #FFFFFF !important;
}

/* ── 28. HEATMAP LEVELS ─────────────────────────────────────────────────── */
html body .level-0 { background: #EDEBE8 !important; color: #9C9590 !important; }
html body .level-1 { background: rgba(145,195,206,0.3) !important; color: #2A7D8C !important; }
html body .level-2 { background: rgba(145,195,206,0.6) !important; color: #1A6070 !important; }
html body .level-3 { background: #91C3CE !important; color: #0A3040 !important; }
html body .level-4 { background: #F37925 !important; color: #FFFFFF !important; }

/* ── 29. SCORE CIRCLES / GAUGES ─────────────────────────────────────────── */
html body .score-circle {
  background: linear-gradient(135deg, #F37925, #FAC670) !important;
  color: #FFFFFF !important;
}

/* ── 30. KPIPRIMARY CARDS (intentional accent card) ─────────────────────── */
html body .kpi-card.kpi-primary {
  background: linear-gradient(135deg, #F37925 0%, #FAC670 100%) !important;
  color: #1B1A19 !important;
}
html body .kpi-card.kpi-primary .kpi-label,
html body .kpi-card.kpi-primary .kpi-icon { color: rgba(27,26,25,0.65) !important; }
html body .kpi-card.kpi-primary .kpi-value { color: #1B1A19 !important; font-weight: 800 !important; }

/* ── 31. CARRY TRACKER ──────────────────────────────────────────────────── */
html body .card-box {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .card-box h3 { color: #1B1A19 !important; }
html body .carry-val { color: #1B1A19 !important; }

/* ── 32. EMPTY STATES ───────────────────────────────────────────────────── */
html body .empty-state,
html body .empty-inbox,
html body .empty-ledger {
  color: #6B6560 !important;
}
html body .empty-state h3,
html body .empty-inbox h3 { color: #3D3A37 !important; }
html body .empty-state i  { color: #9C9590 !important; opacity: 0.4 !important; }
html body .empty-title { color: #1B1A19 !important; }
html body .empty-desc  { color: #6B6560 !important; }

/* ── 33. MISC DARK BG ELEMENTS WITHOUT SPECIAL SEMANTIC MEANING ─────────── */
html body .progress-bar,
html body .progress-track {
  background: #EDEBE8 !important;
}

/* ── 34. LOGIN PAGE (has !important body bg override) ─────────────────────
   login.html has body { background: !important } so we need the html selector */
html.login-page body, body.login-page {
  background: #F3F3F3 !important;
  color: #1B1A19 !important;
}
html body .brand-tagline { color: #6B6560 !important; }
html body .card-sub { color: #6B6560 !important; }
html body .login-card, html body .auth-card {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}

/* ── 35. RESPONSIVE: ensure mobile doesn't reintroduce dark ─────────────── */
@media (max-width: 768px) {
  html body .main,
  html body .content,
  html body .page-content {
    background: #F3F3F3 !important;
    color: #1B1A19 !important;
  }
}

/* ─── END CONTRAST FIX — FINAL AUTHORITY ─────────────────────────────────── */



/* ═══════════════════════════════════════════════════════════════════════════
   ADDITIONAL TARGETED FIXES — covers uncovered classes found in page audit
   ═══════════════════════════════════════════════════════════════════════════ */

/* Section titles & widget headers */
html body .section-title:not(.k1-section-title),
html body .widget-header {
  color: #6B6560 !important;
}
html body .page-title, html body .page-header-title { color: #1B1A19 !important; }

/* User avatar — colored circles, white text inside is fine (good contrast on gradient) */
/* .user-avatar intentionally keeps white text — it's on a colored gradient background */

/* User name/role in any container outside sidebar */
html body .main .user-role,
html body .content .user-role,
html body .user-role:not(.sidebar .user-role):not(#sidebar .user-role):not(.sidebar-footer .user-role) {
  color: #6B6560 !important;
}
html body .main .user-name,
html body .content .user-name {
  color: #1B1A19 !important;
}

/* KPI icon (dashboard icon containers) */
html body .kpi-icon:not(.kpi-primary .kpi-icon) {
  color: #F37925 !important;
}

/* Toast notifications (generic) */
html body .toast,
html body #toast {
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
  border: none !important;
}

/* OM builder & investor update specific — light card bg, dark text */
html body .snav-item { color: #6B6560 !important; }
html body .snav-item:hover { color: #1B1A19 !important; }
html body .snav-item.active { color: #F37925 !important; font-weight: 600 !important; }
html body .snav-item .snav-num { background: #E2DDD8 !important; color: #6B6560 !important; }
html body .snav-item.active .snav-num {
  background: #F37925 !important;
  color: #FFFFFF !important;
}
html body .om-label,
html body .fl,
html body .sec-label { color: #6B6560 !important; }

/* Deal teaser specific */
html body .site-logo { color: #F3F3F3 !important; }
html body .header-cta { color: #F3F3F3 !important; }
html body .cta-card { background: #FFFFFF !important; border: 1px solid #E2DDD8 !important; color: #1B1A19 !important; }
html body .cta-card p { color: #3D3A37 !important; }
html body .cta-form-group label { color: #3D3A37 !important; }
html body .hl-dot i { color: #F37925 !important; }

/* Distribution calc step indicators */
html body .step .step-num { background: #EDEBE8 !important; color: #6B6560 !important; border-color: #D8D4CE !important; }
html body .step.active .step-num { background: #F37925 !important; color: #FFFFFF !important; }
html body .step.done .step-num  { background: #2D9A6B !important; color: #FFFFFF !important; }
html body .card-hdr h2 { color: #1B1A19 !important; }

/* Investor/deal avatar color circles — white text fine on colored gradient */
/* .investor-av intentionally uses colored gradient backgrounds */

/* Stile (summary tile variant) */
html body .stile {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
}
html body .stile .stile-val { color: #1B1A19 !important; }
html body .stile .stile-lbl { color: #6B6560 !important; }

/* ─── END ADDITIONAL TARGETED FIXES ─────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE-SPECIFIC & REMAINING FIXES — second pass
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TABS (everywhere) ──────────────────────────────────────────────────── */
html body .tab { color: #6B6560 !important; background: transparent !important; border: none !important; }
html body .tab:hover { color: #1B1A19 !important; background: rgba(27,26,25,0.04) !important; }
html body .tab.active { color: #F37925 !important; border-bottom-color: #F37925 !important; font-weight: 700 !important; background: transparent !important; }
html body .tab-content { color: #1B1A19 !important; }

/* ── SOURCING CRM ────────────────────────────────────────────────────────── */
html body .stage-guide-item { color: #3D3A37 !important; }
html body .stage-guide-item:hover { background: #F7F4F0 !important; color: #1B1A19 !important; }
html body .card-name { color: #1B1A19 !important; font-weight: 600 !important; }
html body .drawer-title { color: #1B1A19 !important; }
html body .stage-btn:hover { background: #F3F3F3 !important; color: #1B1A19 !important; border-color: #9C9590 !important; }
html body .note-text { color: #3D3A37 !important; }

/* ── WATERFALL GUIDE ─────────────────────────────────────────────────────── */
html body .guide h1, html body .guide h2, html body .guide h3 { color: #1B1A19 !important; }
html body .example {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .example h3 { color: #1B1A19 !important; }
html body .decision-tree {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .decision-tree h3 { color: #1B1A19 !important; }
html body .toc {
  background: #FFFBF8 !important;
  border: 1px solid rgba(243,121,37,0.2) !important;
  color: #1B1A19 !important;
}
html body .toc a { color: #D96515 !important; }

/* ── NEW DEAL WIZARD ─────────────────────────────────────────────────────── */
html body .progress-title { color: #1B1A19 !important; }
html body .step-desc { color: #6B6560 !important; }
html body .waterfall-preview {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .tier-number {
  background: #F37925 !important;
  color: #FFFFFF !important;
}
html body .doc-icon { color: #F37925 !important; }
html body .preview-toggle { color: #6B6560 !important; }

/* ── OM BUILDER ──────────────────────────────────────────────────────────── */
html body .om-tagline { color: #6B6560 !important; }
html body .om-chip { background: #EDEBE8 !important; color: #3D3A37 !important; }
html body .om-cover-meta-value { color: #FAC670 !important; } /* on dark cover bg */
html body .om-h2 { color: #1B1A19 !important; }
html body .om-kpi-value { color: #1B1A19 !important; font-weight: 800 !important; }
html body .om-team-name { color: #1B1A19 !important; }

/* ── PRICING PAGE ────────────────────────────────────────────────────────── */
html body .nav-links a:hover { color: #F37925 !important; background: transparent !important; }
html body .badge-green { background: rgba(45,154,107,0.15) !important; color: #1A7A50 !important; }
html body .popular-badge { background: #F37925 !important; color: #1B1A19 !important; }
html body .cta-section {
  background: linear-gradient(135deg, #1B1A19, #3D3A37) !important;
  color: #F3F3F3 !important;
}
html body .cta-section h2 { color: #F3F3F3 !important; }
html body .cta-section p { color: rgba(243,241,238,0.8) !important; }

/* ── DEAL DETAIL ─────────────────────────────────────────────────────────── */
html body .deal-location { color: #6B6560 !important; }
html body .inv-av { width: 28px; height: 28px; } /* keep avatar style, just ensure size */

/* ── DEAL TEASER ─────────────────────────────────────────────────────────── */
html body .cta-success { color: #1B1A19 !important; }
html body .cta-success h4 { color: #1B1A19 !important; }
html body .cta-success p { color: #6B6560 !important; }
html body .firm-logo-circle {
  background: #EDEBE8 !important;
  color: #3D3A37 !important;
  border: 2px solid #D8D4CE !important;
}

/* ── DISTRIBUTION CALC ───────────────────────────────────────────────────── */
html body .wf-tier-name { color: #1B1A19 !important; font-weight: 700 !important; }
html body .wf-tier-amount { color: #1A7A50 !important; font-weight: 800 !important; }
html body .pref-callout { background: rgba(250,198,112,0.15) !important; border: 1px solid rgba(250,198,112,0.4) !important; color: #7A5000 !important; }
html body .pref-callout strong { color: #7A5000 !important; }

/* ── EXIT CALC ───────────────────────────────────────────────────────────── */
html body .result-hero-sub { color: rgba(243,241,238,0.8) !important; }  /* inside dark .result-hero */
html body .rc-value { color: #1B1A19 !important; font-weight: 800 !important; }
html body .bar-val { color: #1B1A19 !important; }

/* ── INVESTOR DETAIL ─────────────────────────────────────────────────────── */
html body .profile-meta { color: #6B6560 !important; }  /* below the hero on light bg */

/* ── DOCUMENTS ───────────────────────────────────────────────────────────── */
html body .doc-type.selected .icon {
  background: #F37925 !important;
  color: #FFFFFF !important;
}

/* ── INBOX ───────────────────────────────────────────────────────────────── */
html body .inbox-avatar,
html body .meta-avatar {
  /* colored gradient circles — keep white text (good contrast on gradient) */
  color: #FFFFFF !important;
}

/* ── INVESTOR PORTAL ─────────────────────────────────────────────────────── */
html body .portal-logo { color: #1B1A19 !important; } /* dark text on white header */
html body .portal-nav a { color: #4B4540 !important; }
html body .portal-nav a:hover { color: #1B1A19 !important; background: rgba(0,0,0,0.04) !important; }
html body .portal-nav a.active { color: #F37925 !important; border-bottom-color: #F37925 !important; }
html body .portal-header .btn-secondary { color: #1B1A19 !important; }
html body .welcome-banner h1, html body .welcome-banner span { color: #FFFFFF !important; }
html body .welcome-banner p { color: rgba(255,255,255,0.7) !important; }

/* ── LENDER CRM ──────────────────────────────────────────────────────────── */
html body .btn-sm:hover {
  background: #F37925 !important;
  color: #FFFFFF !important;
  border-color: #F37925 !important;
}

/* ── TOOLS PAGE ──────────────────────────────────────────────────────────── */
html body .category-title { color: #1B1A19 !important; }
html body .tool-card { background: #FFFFFF !important; border: 1px solid #E2DDD8 !important; color: #1B1A19 !important; }
html body .tool-card:hover { border-color: #F37925 !important; }

/* ── ACCREDITATION — tr:hover ────────────────────────────────────────────── */
/* Already handled by general tr:hover td rule — no separate fix needed */

/* ── CAP TABLE ───────────────────────────────────────────────────────────── */
html body .type-lp { background: rgba(145,195,206,0.25) !important; color: #2A7D8C !important; }

/* ── CRM ─────────────────────────────────────────────────────────────────── */
html body .activity-icon {
  background: rgba(243,121,37,0.15) !important;
  color: #D96515 !important;
}

/* ── CURRENCY CENTER ─────────────────────────────────────────────────────── */
html body .fx-rate { color: #1B1A19 !important; font-weight: 700 !important; }

/* ── DEAL COMPARE ────────────────────────────────────────────────────────── */
html body .summary-winner {
  background: rgba(45,154,107,0.1) !important;
  color: #1A7A50 !important;
  border: 1px solid rgba(45,154,107,0.3) !important;
}

/* ── DISTRIBUTION RECONCILIATION ────────────────────────────────────────── */
html body .btn-recon {
  background: #2D9A6B !important;
  color: #FFFFFF !important;
  border: none !important;
}

/* ── DYNAMIC VALUATION ───────────────────────────────────────────────────── */
html body .val-price { color: #1B1A19 !important; font-weight: 800 !important; }

/* ── EMAIL TEMPLATES ─────────────────────────────────────────────────────── */
html body .email-header {
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
}
html body .email-header h2, html body .email-header p { color: #F3F3F3 !important; }

/* ── IC MEMO BUILDER ─────────────────────────────────────────────────────── */
html body .memo-header {
  background: #1B1A19 !important;
  color: #F3F3F3 !important;
}
html body .memo-header h1, html body .memo-header p { color: #F3F3F3 !important; }

/* ── INVESTOR RETENTION ──────────────────────────────────────────────────── */
html body .cohort-val { color: #1B1A19 !important; font-weight: 700 !important; }

/* ── INVESTOR UPDATE ─────────────────────────────────────────────────────── */
/* ep-header: let page inline gradient handle background */
html body .ep-header {
  color: #F3F3F3 !important;
}
html body .ep-header h1, html body .ep-header p { color: #F3F3F3 !important; }

/* login page .btn-login uses inline styles from login.html directly */

/* ── PIPELINE ────────────────────────────────────────────────────────────── */
html body .card-menu:hover { background: #F7F4F0 !important; color: #1B1A19 !important; }

/* ── PORTFOLIO HEALTH ────────────────────────────────────────────────────── */
html body .score-warn {
  background: rgba(217,79,61,0.1) !important;
  color: #901800 !important;
  border: 1px solid rgba(217,79,61,0.25) !important;
}

/* ── SETTINGS ────────────────────────────────────────────────────────────── */
/* toast already handled globally */

/* ── TASK MANAGER ────────────────────────────────────────────────────────── */
html body .action-icon:hover {
  background: #F7F4F0 !important;
  color: #1B1A19 !important;
}

/* ── UNDERWRITING CALC ───────────────────────────────────────────────────── */
html body .results {
  background: #F7F4F0 !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .results h3 { color: #1B1A19 !important; }

/* ── WIRE CONFIRM ────────────────────────────────────────────────────────── */
/* .status-pending already handled in global section */

/* ── FUNDRAISING ─────────────────────────────────────────────────────────── */
html body .investor-avatar { color: #FFFFFF !important; } /* colored gradient circle, white text correct */

/* ─── END PAGE-SPECIFIC FIXES ────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   LIVE AUDIT FIXES — patterns found by running contrast-audit.js in browser
   Run: 2026-03-07. Pages audited: login, dashboard, deals, investors, etc.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── #94a3b8 on white/light bg → 2.56:1, FAILS. Must be #6B6560 (4.6:1) ── */
/* This is the most widespread failure: ~30+ instances across dashboard/deals */
html body .kpi-change,
html body .deal-meta,
html body .deal-sub,
html body .deal-location:not(.deal-hero .deal-location),
html body .deal-metric-sub,
html body .stat-sub,
html body .card-meta,
html body .activity-meta,
html body .activity-time,
html body .deadline-type,
html body .deadline-name,
html body .month,
html body .day { color: #6B6560 !important; }

/* #f37925 orange on white → 2.77:1, FAILS. Darken to #c85a00 (4.6:1) */
html body .view-all,
html body a.view-all,
html body .view-all:not(.sidebar .view-all) { color: #a04400 !important; }

html body .link-orange,
html body a.link-orange { color: #a04400 !important; }

/* #cbd5e1 label text on white → 1.48:1, invisible. Fix to #6B6560 */
html body .kpi .label,
html body .kpi-label,
html body .stat-card .label,
html body .stat-label { color: #6B6560 !important; }

/* #f8fafc / near-white text on white card bg → invisible */
html body .kpi-value,
html body .kpi .value,
html body .stat-value:not(.sidebar .stat-value) { color: #1B1A19 !important; }

html body .deal-name,
html body .deal-title,
html body .deal-card .deal-name { color: #1B1A19 !important; }

/* ── BADGE COLORS: all these fail on white bg ──────────────────────────── */
/* #38bdf8 (blue-400) on white → 2.14:1. Use #0369a1 (blue-700) → 6.2:1 */
/* #34d399 (green-400) on white → 1.92:1. Use #065f46 (green-800) → 8.1:1 */
/* #fbbf24 (amber-400) on white → 1.67:1. Use #92400e (amber-800) → 6.5:1 */
/* #a78bfa (purple-400) on white → 2.72:1. Use #5b21b6 (purple-700) → 5.9:1 */

html body .badge:not(.pill-green):not(.pill-blue):not(.pill-amber):not(.pill-red):not(.pill-purple):not([class*="badge-"]) {
  background: rgba(27,26,25,0.07) !important;
  color: #3D3A37 !important;
}

/* Deal type / status badges — give them proper colored pill treatment */
html body .badge-type,
html body span.badge[class*="Multifamily"],
html body span.badge[class*="Industrial"],
html body span.badge[class*="Retail"],
html body span.badge[class*="Office"],
html body span.badge[class*="Mixed"] {
  background: rgba(145,195,206,0.2) !important;
  color: #1A6070 !important;
}

/* Status badges by text-based class or inline */
html body .badge-raising,
html body .badge-active,
html body .badge-operating { background: rgba(123,92,196,0.15) !important; color: #3D2080 !important; }
html body .badge-diligence,
html body .badge-due-diligence,
html body .badge-loi { background: rgba(232,137,10,0.15) !important; color: #6B4000 !important; }
html body .badge-closed { background: rgba(45,154,107,0.15) !important; color: #0F5C35 !important; }

/* ── ONBOARDING WIDGET (dashboard "Getting Started") ───────────────────── */
html body .onboarding-step,
html body .checklist-item,
html body .step-item { color: #1B1A19 !important; }
html body .onboarding-step span,
html body .step-item span { color: #1B1A19 !important; }
html body .onboarding-step.done span,
html body .step-item.done span { color: #6B6560 !important; }
html body .step-label,
html body .checklist-label { color: #1B1A19 !important; }

/* Getting Started widget header */
html body .onboarding-widget,
html body .getting-started,
html body [class*="onboarding"],
html body [class*="getting-started"] { color: #1B1A19 !important; }

/* ── FOOTER LINKS (Terms/Privacy/Disclaimer) ────────────────────────────── */
/* #f8f7f6 on #edebe8 → 1.11:1, near-invisible */
html body #dt-legal-footer a,
html body .legal-footer a,
html body footer a:not(.sidebar footer a) { color: #6B6560 !important; }
html body #dt-legal-footer a:hover,
html body footer a:hover:not(.sidebar footer a:hover) { color: #1B1A19 !important; }
html body #dt-legal-footer,
html body .legal-footer { color: #9C9590 !important; }

/* ── KPI CHANGE INDICATORS ───────────────────────────────────────────────── */
/* #2d9a6b on white → 3.53:1 — fails AA normal text but passes large text */
/* Fix to a slightly darker shade for normal-size text: #1A7A50 */
html body .kpi-change.positive,
html body .kpi-change.up,
html body .metric-change.positive { color: #1A7A50 !important; }
html body .kpi-change.negative,
html body .kpi-change.down,
html body .metric-change.negative { color: #901800 !important; }
html body .kpi-change.neutral,
html body .kpi-change { color: #6B6560 !important; }

/* ── DEADLINE BADGES ─────────────────────────────────────────────────────── */
/* #e8890a (amber) on white → 2.62:1, fails. Use #7a3d00 */
html body .deadline-badge.coming-up,
html body .deadline-badge[class*="coming"] { color: #7a3d00 !important; }
/* #d94f3d (red) on white → 4.09:1 — passes large text, fails normal */
html body .deadline-badge.urgent,
html body .deadline-badge[class*="urgent"] { color: #8C1F10 !important; }
/* #2d9a6b on white for scheduled — 3.53:1 fix */
html body .deadline-badge.scheduled,
html body .deadline-badge[class*="scheduled"] { color: #1A7A50 !important; }

/* ── "Synced" / timestamp text ───────────────────────────────────────────── */
/* #9c9590 on white → 2.95:1 — fails. Use #6B6560 (4.6:1) */
html body .sync-indicator,
html body .sync-text,
html body .last-sync,
html body .timestamp,
html body .time-ago { color: #6B6560 !important; }

/* ── INLINE BADGE FIX — colored text badges from JS-generated HTML ─────── */
/* Dynamically generated badges with inline styles use slate/blue/green colors */
/* Catch all small pill-shaped spans that have a light text color on white */
html body .badge[style*="color: #38bdf8"],
html body .badge[style*="color:#38bdf8"] { color: #0369a1 !important; background: rgba(3,105,161,0.1) !important; }
html body .badge[style*="color: #34d399"],
html body .badge[style*="color:#34d399"] { color: #065f46 !important; background: rgba(6,95,70,0.1) !important; }
html body .badge[style*="color: #fbbf24"],
html body .badge[style*="color:#fbbf24"] { color: #92400e !important; background: rgba(146,64,14,0.1) !important; }
html body .badge[style*="color: #a78bfa"],
html body .badge[style*="color:#a78bfa"] { color: #5b21b6 !important; background: rgba(91,33,182,0.1) !important; }
html body .badge[style*="color: #94a3b8"],
html body .badge[style*="color:#94a3b8"] { color: #6B6560 !important; background: rgba(27,26,25,0.07) !important; }

/* Same for spans used as badges */
html body span[style*="color: #38bdf8"],
html body span[style*="color:#38bdf8"] { color: #0369a1 !important; }
html body span[style*="color: #34d399"],
html body span[style*="color:#34d399"] { color: #065f46 !important; }
html body span[style*="color: #fbbf24"],
html body span[style*="color:#fbbf24"] { color: #92400e !important; }
html body span[style*="color: #a78bfa"],
html body span[style*="color:#a78bfa"] { color: #5b21b6 !important; }
html body span[style*="color: #94a3b8"],
html body span[style*="color:#94a3b8"] { color: #6B6560 !important; }
html body span[style*="color: #60a5fa"],
html body span[style*="color:#60a5fa"] { color: #1d6fb8 !important; }

/* Also catch inline style divs (deal location, card meta text) */
html body div[style*="color: #94a3b8"],
html body div[style*="color:#94a3b8"],
html body p[style*="color: #94a3b8"],
html body p[style*="color:#94a3b8"] { color: #6B6560 !important; }

html body div[style*="color: #f8fafc"],
html body div[style*="color:#f8fafc"],
html body span[style*="color: #f8fafc"],
html body span[style*="color:#f8fafc"],
html body p[style*="color: #f8fafc"],
html body p[style*="color:#f8fafc"] { color: #1B1A19 !important; }

html body div[style*="color: #e2e8f0"],
html body div[style*="color:#e2e8f0"],
html body span[style*="color: #e2e8f0"],
html body span[style*="color:#e2e8f0"] { color: #3D3A37 !important; }

html body div[style*="color: #cbd5e1"],
html body div[style*="color:#cbd5e1"],
html body span[style*="color: #cbd5e1"],
html body span[style*="color:#cbd5e1"],
html body label[style*="color: #cbd5e1"],
html body label[style*="color:#cbd5e1"] { color: #6B6560 !important; }

/* ── SYNCED INDICATOR + ACTION BTN in top-bar ─────────────────────────── */
html body #syncIndicator { color: #6B6560 !important; }
html body .top-bar .btn,
html body .top-bar button:not(.btn-primary):not(.btn-danger) {
  color: #3D3A37 !important;
}

/* ── "Got it" / CTA buttons in blue (#3b82f6) ──────────────────────────── */
/* #ffffff on #3b82f6 → 3.68:1 — fails AA normal. Darken button */
html body .btn-blue,
html body button[style*="background: #3b82f6"],
html body button[style*="background:#3b82f6"] {
  background: #1d6fb8 !important;
  color: #FFFFFF !important;
}

/* ── CLOSE BUTTON / X in widgets ────────────────────────────────────────── */
html body .close-btn,
html body .dismiss-btn,
html body button.close:not(.sidebar button.close) { color: #6B6560 !important; background: transparent !important; }
html body .close-btn:hover,
html body .dismiss-btn:hover { color: #1B1A19 !important; background: #EDEBE8 !important; }

/* ── DASHBOARD: Onboarding checklist step text ──────────────────────────── */
html body .step-text,
html body .step-desc:not(.sidebar .step-desc),
html body .checklist-step span { color: #1B1A19 !important; }
html body .step-done,
html body .step-completed { color: #6B6560 !important; }

/* ── ACTIVE DEALS TABLE: deal sub-info ──────────────────────────────────── */
html body .deal-info-sub,
html body .deal-raise-text,
html body .deal-lp-count { color: #6B6560 !important; }

/* ── UPCOMING DEADLINES ──────────────────────────────────────────────────── */
html body .deadline-item { color: #1B1A19 !important; }
html body .deadline-date { color: #6B6560 !important; }

/* ─── END LIVE AUDIT FIXES ──────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   LIVE AUDIT FIXES — patterns found by running contrast-audit.js in browser
   Run: 2026-03-07. Pages audited: login, dashboard, deals, investors, etc.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── #94a3b8 on white/light bg → 2.56:1, FAILS. Fix to #6B6560 (4.6:1) ── */
html body .kpi-change,
html body .deal-meta,
html body .deal-sub,
html body .stat-sub,
html body .card-meta,
html body .activity-meta,
html body .activity-time,
html body .deadline-type,
html body .month,
html body .day { color: #6B6560 !important; }

/* #f37925 orange links on white → 2.77:1, FAILS. Darken to #c85a00 */
html body .view-all:not(.sidebar .view-all),
html body a.view-all { color: #a04400 !important; }

/* #cbd5e1 label on white → 1.48:1, near-invisible. Fix to #6B6560 */
html body .kpi .label,
html body .kpi-label,
html body .stat-label { color: #6B6560 !important; }

/* #f8fafc on white card → 1.05:1, invisible */
html body .kpi-value,
html body .kpi .value { color: #1B1A19 !important; }
html body .deal-name,
html body .deal-title { color: #1B1A19 !important; }

/* ── BADGE COLORS on white bg — all fail, need darker shades ────────────── */
/* Catch inline-style badges from JS with light colors */
html body span[style*="color: #38bdf8"], html body span[style*="color:#38bdf8"],
html body div[style*="color: #38bdf8"],  html body div[style*="color:#38bdf8"]  { color: #0369a1 !important; }
html body span[style*="color: #34d399"], html body span[style*="color:#34d399"],
html body div[style*="color: #34d399"],  html body div[style*="color:#34d399"]  { color: #065f46 !important; }
html body span[style*="color: #fbbf24"], html body span[style*="color:#fbbf24"],
html body div[style*="color: #fbbf24"],  html body div[style*="color:#fbbf24"]  { color: #92400e !important; }
html body span[style*="color: #a78bfa"], html body span[style*="color:#a78bfa"],
html body div[style*="color: #a78bfa"],  html body div[style*="color:#a78bfa"]  { color: #5b21b6 !important; }
html body span[style*="color: #94a3b8"], html body span[style*="color:#94a3b8"],
html body div[style*="color: #94a3b8"],  html body div[style*="color:#94a3b8"],
html body p[style*="color: #94a3b8"],    html body p[style*="color:#94a3b8"]    { color: #6B6560 !important; }
html body span[style*="color: #60a5fa"], html body span[style*="color:#60a5fa"],
html body div[style*="color: #60a5fa"],  html body div[style*="color:#60a5fa"]  { color: #1d6fb8 !important; }
html body span[style*="color: #f8fafc"], html body span[style*="color:#f8fafc"],
html body div[style*="color: #f8fafc"],  html body div[style*="color:#f8fafc"],
html body p[style*="color: #f8fafc"],    html body p[style*="color:#f8fafc"]    { color: #1B1A19 !important; }
html body span[style*="color: #e2e8f0"], html body span[style*="color:#e2e8f0"],
html body div[style*="color: #e2e8f0"],  html body div[style*="color:#e2e8f0"]  { color: #3D3A37 !important; }
html body span[style*="color: #cbd5e1"], html body span[style*="color:#cbd5e1"],
html body div[style*="color: #cbd5e1"],  html body div[style*="color:#cbd5e1"],
html body label[style*="color: #cbd5e1"],html body label[style*="color:#cbd5e1"] { color: #6B6560 !important; }

/* ── FOOTER LINKS ────────────────────────────────────────────────────────── */
/* #f8f7f6 on #edebe8 → 1.11:1, near-invisible */
html body #dt-legal-footer a,
html body .legal-footer a { color: #6B6560 !important; }
html body #dt-legal-footer,
html body .legal-footer { color: #9C9590 !important; background: #EDEBE8 !important; }

/* ── KPI CHANGE / DELTA INDICATORS ──────────────────────────────────────── */
/* #2d9a6b on white → 3.53:1 fails AA normal text. Use #1A7A50 */
html body .kpi-change { color: #6B6560 !important; }
html body .delta-positive, html body .change-positive { color: #1A7A50 !important; }
html body .delta-negative, html body .change-negative { color: #8C1F10 !important; }

/* ── DEADLINE BADGE COLORS ───────────────────────────────────────────────── */
/* #e8890a on white → 2.62:1. Use #7a3d00 */
html body .deadline-badge { font-size: 10px !important; font-weight: 700 !important; }
html body .deadline-badge.urgent    { background: rgba(217,79,61,0.12)  !important; color: #8C1F10 !important; }
html body .deadline-badge.coming-up { background: rgba(232,137,10,0.12) !important; color: #7a3d00 !important; }
html body .deadline-badge.scheduled { background: rgba(45,154,107,0.12) !important; color: #1A7A50 !important; }

/* ── SYNC INDICATOR ──────────────────────────────────────────────────────── */
html body #syncIndicator,
html body .sync-indicator { color: #6B6560 !important; }

/* ── GOT IT / BLUE ACTION BUTTONS ────────────────────────────────────────── */
html body button[style*="background: #3b82f6"],
html body button[style*="background:#3b82f6"],
html body .btn-blue { background: #1d6fb8 !important; color: #FFFFFF !important; }

/* ── CLOSE / DISMISS BUTTONS ─────────────────────────────────────────────── */
html body .close-btn:not(.sidebar .close-btn),
html body button.dismiss:not(.sidebar button.dismiss) {
  color: #6B6560 !important; background: transparent !important;
}
html body .close-btn:hover { color: #1B1A19 !important; background: #EDEBE8 !important; }

/* ─── END LIVE AUDIT FIXES ──────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   BADGE SYSTEM — DEFINITIVE FINAL RULES (appended last, always wins)
   Resolves conflicts from multiple prior fix passes.
   
   CONTEXT MAPPING:
   - .badge-active      = investor is Active (green)
   - .badge-verified    = accreditation Verified (green)
   - .badge-inactive    = investor Inactive (neutral)
   - .badge-pending     = accreditation Pending (amber)
   - .badge-expired     = accreditation Expired (red)
   - .badge-posted      = distribution Posted (green)
   - .badge-draft       = distribution Draft (amber)
   - .badge-operating   = deal status Operating (blue-green)
   - .badge-raising     = deal status Raising Capital (purple)
   - .badge-loi         = deal LOI stage (amber)
   - .badge-closed      = deal Closed (neutral)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Investor status badges */
html body .badge-active   { background: rgba(45,154,107,0.12) !important; color: #0F5C35 !important; border: none !important; }
html body .badge-verified { background: rgba(45,154,107,0.12) !important; color: #0F5C35 !important; border: none !important; }
html body .badge-inactive { background: rgba(107,101,96,0.12) !important; color: #4A4642 !important; border: none !important; }
html body .badge-pending  { background: rgba(232,137,10,0.12) !important; color: #6B4000 !important; border: none !important; }
html body .badge-expired  { background: rgba(217,79,61,0.12)  !important; color: #8C1F10 !important; border: none !important; }
html body .badge-posted   { background: rgba(45,154,107,0.12) !important; color: #0F5C35 !important; border: none !important; }
html body .badge-draft    { background: rgba(232,137,10,0.12) !important; color: #6B4000 !important; border: none !important; }

/* Deal status badges */
html body .badge-operating   { background: rgba(45,154,107,0.12)  !important; color: #0F5C35 !important; border: none !important; }
html body .badge-raising,
html body .badge-fundraising { background: rgba(123,92,196,0.12)  !important; color: #3D2080 !important; border: none !important; }
html body .badge-loi,
html body .badge-diligence,
html body .badge-due-diligence { background: rgba(232,137,10,0.12) !important; color: #6B4000 !important; border: none !important; }
html body .badge-closed,
html body .badge-exited      { background: rgba(107,101,96,0.12)  !important; color: #4A4642 !important; border: none !important; }
html body .badge-sourcing    { background: rgba(243,121,37,0.12)  !important; color: #7A3200 !important; border: none !important; }

/* ─── END BADGE SYSTEM ──────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   FINAL READABILITY SWEEP — 2026-03-08
   Fixes: deal names invisible, capital-calls dark cards, deal-detail 
   action cards, table headers, notice banner overlap, p color on light bg.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TABLE CONTENT: deal/investor names must always be readable ──────────── */
html body td div,
html body td span:not(.badge):not([class*="badge"]),
html body td .deal-name,
html body td .investor-name,
html body .deal-row .deal-title,
html body .deal-list-name,
html body tbody td:first-child div { color: #1B1A19 !important; }

html body td .deal-location,
html body td .investor-email,
html body td .text-muted,
html body td small,
html body td [style*="font-size:11px"],
html body td [style*="font-size: 11px"] { color: #6B6560 !important; }

/* ── TABLE HEADERS ────────────────────────────────────────────────────────── */
html body thead,
html body thead tr { background: #F0EDEA !important; }
html body thead th,
html body th { 
  color: #4A4642 !important; 
  background: #F0EDEA !important;
  border-bottom: 1px solid #E2DDD8 !important;
}

/* ── STAT / KPI CARDS — light theme always ───────────────────────────────── */
html body .stat-card,
html body .kpi-card,
html body .kpi,
html body .metric-card,
html body .summary-card {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .stat-card .val,
html body .stat-card .value,
html body .stat-card .stat-value,
html body .kpi-card .val,
html body .kpi-card .kpi-value,
html body .kpi-value { color: #1B1A19 !important; }

html body .stat-card .lbl,
html body .stat-card .label,
html body .stat-card .stat-label,
html body .kpi-card .label,
html body .kpi-card .kpi-label,
html body .kpi-label { color: #6B6560 !important; }

/* Capital calls specific stat row */
html body .stats-row .stat-card,
html body .cc-stats .stat-card,
html body [class*="stat-row"] .stat-card { background: #FFFFFF !important; }

/* ── DEAL DETAIL: hero section & action cards ────────────────────────────── */
/* Hero banner — keep intentionally dark */
html body .deal-hero,
html body .hero-banner,
html body .deal-header-card { background: #1B1A19 !important; }
html body .deal-hero *,
html body .hero-banner *,
html body .deal-header-card * { color: #F3F0ED !important; }

/* Action cards — force light so labels show */
html body .action-card,
html body .quick-action,
html body .action-grid .card,
html body .actions-grid .card,
html body .action-btn-card {
  background: #FFFFFF !important;
  border: 1px solid #E2DDD8 !important;
  color: #1B1A19 !important;
}
html body .action-card span,
html body .action-card p,
html body .action-card label,
html body .quick-action span,
html body .quick-action p { color: #1B1A19 !important; }

/* ── NOTICE BANNER — push content down, don't cover it ──────────────────── */
html body #dt-notice-banner,
html body .notice-banner,
html body [id*="notice-banner"] {
  position: relative !important;
  top: auto !important;
  z-index: 10 !important;
}

/* ── PARAGRAPH TEXT — never invisible ───────────────────────────────────── */
/* sp-theme-institutional set p { color: #475569 } which is OK on white but
   was being overridden. Ensure readable on all light surfaces. */
html body main p,
html body .content p,
html body .card p,
html body .modal p { color: #4A4642 !important; }

/* ── FORM INPUTS — light theme ───────────────────────────────────────────── */
html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(.sidebar input),
html body select:not(.sidebar select),
html body textarea:not(.sidebar textarea) {
  background: #FFFFFF !important;
  color: #1B1A19 !important;
  border-color: #D4CFC9 !important;
}
html body input::placeholder,
html body textarea::placeholder { color: #9C9590 !important; }

/* ── DEAL TYPE / PROPERTY TYPE BADGES ───────────────────────────────────── */
html body .badge-multifamily  { background: rgba(243,121,37,0.10) !important; color: #7A3200 !important; }
html body .badge-industrial   { background: rgba(107,101,96,0.12) !important; color: #3D3A37 !important; }
html body .badge-retail       { background: rgba(123,92,196,0.12) !important; color: #3D2080 !important; }
html body .badge-hospitality  { background: rgba(232,137,10,0.12) !important; color: #6B4000 !important; }
html body .badge-self-storage { background: rgba(45,154,107,0.12) !important; color: #0F5C35 !important; }
html body .badge-office       { background: rgba(27,26,25,0.08)   !important; color: #3D3A37 !important; }
html body .badge-mixed-use    { background: rgba(123,92,196,0.10) !important; color: #3D2080 !important; }

/* ─── END FINAL READABILITY SWEEP ──────────────────────────────────────── */

/* ── WCAG Focus Indicators (2.4.7 Focus Visible) ──────────────────────── */
.sidebar .nav-item:focus-visible,
#sidebar .nav-item:focus-visible,
.sidebar a.nav-item:focus-visible,
#sidebar a.nav-item:focus-visible {
  outline: 2px solid #F37925 !important;
  outline-offset: -2px !important;
  border-radius: 8px;
}
.btn:focus-visible,
.btn-xs:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
button:focus-visible {
  outline: 2px solid #F37925 !important;
  outline-offset: 2px !important;
}
a:focus-visible {
  outline: 2px solid #F37925 !important;
  outline-offset: 2px !important;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #F37925 !important;
  outline-offset: 0 !important;
}
/* ── END WCAG Focus ───────────────────────────────────────────────────── */

/* ── Print Stylesheet ─────────────────────────────────────────────────── */
@media print {
  /* Hide sidebar, topbar, nav, and non-content elements */
  .sidebar,
  .dt-sidebar,
  .top-bar,
  .dt-topbar,
  .dt-top-bar,
  nav,
  .nav-mobile,
  .hamburger,
  .mobile-nav,
  .btn,
  button:not(.print-keep),
  .toast,
  .modal-overlay,
  .modal-backdrop,
  footer,
  .footer,
  .chat-widget,
  .floating-btn,
  .fab,
  [data-no-print] {
    display: none !important;
  }

  /* Reset main content to fill page */
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    color: black !important;
    font-size: 11pt !important;
  }

  .main-content,
  .dt-main,
  .content,
  main,
  [role="main"] {
    margin-left: 0 !important;
    padding: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Ensure cards/tables print cleanly */
  .card, .dt-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  table {
    border-collapse: collapse !important;
  }

  th, td {
    border: 1px solid #999 !important;
    padding: 4px 8px !important;
  }

  /* Links: show URL after text */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Page break helpers */
  h1, h2, h3 {
    break-after: avoid;
  }

  .page-break {
    break-before: always;
  }

  /* Charts won't print well — show a note */
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }
}
/* ── END Print ────────────────────────────────────────────────────────── */
