/* ============================================================
   RATES & REALTY — DESIGN SYSTEM
   Black / White / Gold — Premium Mortgage + Real Estate
   ============================================================ */

:root {
  --surface: rgba(14, 14, 14, 0.95);
  --surface-soft: rgba(24, 24, 24, 0.95);
  --surface-card: rgba(18, 18, 18, 0.98);
  --surface-hover: rgba(30, 30, 30, 0.98);
  --text: #f6f1e8;
  --text-soft: #e8e0d0;
  --muted: #b6ab93;
  --muted-light: #d4cbb8;
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-mid: rgba(255, 255, 255, 0.13);
  --gold: #d7af52;
  --gold-strong: #f0cb79;
  --gold-dim: rgba(215, 175, 82, 0.15);
  --gold-glow: rgba(240, 203, 121, 0.25);
  --green: #9fd3aa;
  --green-dim: rgba(159, 211, 170, 0.15);
  --red: #f0a2a2;
  --red-dim: rgba(240, 162, 162, 0.15);
  --blue: #7eb8e8;
  --blue-dim: rgba(126, 184, 232, 0.15);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 0 40px rgba(215, 175, 82, 0.12);
  --radius-xl: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --container: 1180px;
  --container-wide: 1360px;
  --sidebar-w: 260px;
  --drawer-w: 480px;
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── LIGHT MODE VARIABLES ───────────────────────────────── */
body.light {
  --surface:       rgba(255, 255, 255, 0.97);
  --surface-soft:  rgba(248, 246, 242, 0.98);
  --surface-card:  #ffffff;
  --surface-hover: rgba(240, 237, 230, 0.98);
  --text:          #1a1410;
  --text-soft:     #2d2820;
  --muted:         #6b5f48;
  --muted-light:   #8a7a62;
  --line-soft:     rgba(0, 0, 0, 0.08);
  --line-mid:      rgba(0, 0, 0, 0.13);
  --shadow:        0 24px 80px rgba(0, 0, 0, 0.10);
  --shadow-sm:     0 8px 32px rgba(0, 0, 0, 0.07);
}

/* ── RESET ──────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, rgba(215, 175, 82, 0.14), transparent 24%),
              linear-gradient(180deg, #030303 0%, #0d0d0d 100%);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}
body.light {
  background: #f5f5f5;
  color: #1a1a1a;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { display: block; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.container { width: min(calc(100% - 32px), var(--container)); margin: 0 auto; }
.container-wide { width: min(calc(100% - 32px), var(--container-wide)); margin: 0 auto; }
.section { padding: 48px 0; }
.section-lg { padding: 80px 0; }
.section-sm { padding: 32px 0; }

/* ── TYPOGRAPHY ─────────────────────────────────────────── */
.brand-text strong, h1, h2, h3, h4,
.metric-card strong, .pipeline-count, .stat-number {
  font-family: "Cormorant Garamond", serif;
}
h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.7rem); line-height: 0.96; }
h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); }
h3 { margin: 0 0 10px; font-size: 1.7rem; }
h4 { margin: 0 0 8px; font-size: 1.3rem; }
.kicker, .panel-label, .card-tag, .eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--gold);
  display: block;
}
.hero-copy, .section-copy, .feature-list, .loan-card p, .panel p, .compact-list, .table-card {
  color: #ddd5c6;
  line-height: 1.7;
}
.text-muted { color: var(--muted); }
.text-gold { color: var(--gold-strong); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

/* ── NAV / HEADER ───────────────────────────────────────── */
/* ── HEADER PLACEHOLDER (keeps page flow correct with fixed header) ── */
#site-header {
  display: block;
  height: 76px;
  flex-shrink: 0;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2147483647;
  isolation: isolate;
  pointer-events: auto !important;
  background: rgba(5, 5, 5, 0.88);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.3s ease, border-color 0.3s ease;
}
body.light .site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 38px; width: auto; object-fit: contain; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(240, 203, 121, 0.26), rgba(215, 175, 82, 0.05));
  border: 1px solid rgba(240, 203, 121, 0.3);
  color: var(--gold-strong);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem; font-weight: 700;
  flex-shrink: 0;
}
.brand-text strong { display: block; font-size: 1.05rem; }
.brand-text span { color: var(--muted); font-size: 0.78rem; }
.nav-links, .header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-link { color: var(--muted); font-size: 0.9rem; font-weight: 500; padding: 6px 10px; border-radius: 8px; transition: color var(--transition), background var(--transition); }
.nav-link:hover, .nav-link.is-active { color: var(--text); background: rgba(255,255,255,0.05); }
body.light .nav-link:hover, body.light .nav-link.is-active { background: rgba(0,0,0,0.05); }

/* ── LOANS DROPDOWN ─────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.nav-chevron { font-size: 0.7em; transition: transform 0.15s ease; }
.nav-dropdown.open .nav-chevron { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #0e0e0e;
  border: 1px solid rgba(215,175,82,0.2);
  border-radius: 14px;
  padding: 20px;
  min-width: 380px;
  gap: 32px;
  z-index: 2147483646;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.dropdown-col { display: flex; flex-direction: column; gap: 2px; }
.dropdown-col-title {
  font-size: 11px; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 6px; padding: 0 8px;
}
.nav-dropdown-menu a {
  font-size: 14px; color: var(--muted); padding: 6px 10px;
  border-radius: 8px; text-decoration: none; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.nav-dropdown-menu a:hover { background: rgba(215,175,82,0.1); color: var(--text); }
.mobile-nav-section-title {
  font-size: 0.7rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 12px 10px 4px; margin-top: 8px;
}

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  font-size: 0.88rem; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, #f2cf85 0%, #c5952d 100%);
  color: #111; font-weight: 800;
  box-shadow: 0 4px 20px rgba(215, 175, 82, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(215, 175, 82, 0.45); transform: translateY(-1px); }
.btn-secondary { border-color: var(--line-soft); background: rgba(255, 255, 255, 0.04); color: var(--text); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-mid); }
body.light .btn-secondary { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.12); }
body.light .btn-secondary:hover { background: rgba(0,0,0,0.07); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }
body.light .btn-ghost:hover { background: rgba(0,0,0,0.05); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 0.82rem; }
.btn-danger { background: var(--red-dim); color: var(--red); border-color: rgba(240,162,162,0.2); }
.btn-success { background: var(--green-dim); color: var(--green); border-color: rgba(159,211,170,0.2); }
.btn-icon { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; }

/* ── CARDS / PANELS ─────────────────────────────────────── */
.panel, .stat-card, .metric-card, .pipeline-column, .cta-banner {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
body.light .panel, body.light .stat-card, body.light .metric-card,
body.light .pipeline-column, body.light .cta-banner {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.panel, .cta-banner { padding: 26px; }
.stat-card, .metric-card, .pipeline-column { padding: 18px 20px; }
.panel-gold { border-color: rgba(215, 175, 82, 0.2); background: linear-gradient(135deg, rgba(215,175,82,0.06), rgba(14,14,14,0.98)); }
.card-elevated { box-shadow: var(--shadow), var(--shadow-gold); }

/* ── HERO ───────────────────────────────────────────────── */
.hero-section { padding: 60px 0 42px; }
.hero-grid { display: grid; gap: 24px; grid-template-columns: 1.35fr 0.85fr; align-items: center; }
.hero-media { grid-column: 1 / -1; }
.hero-media img { width: 100%; min-height: 420px; object-fit: cover; border-radius: var(--radius-xl); border: 1px solid var(--line-soft); background: #111; }
.hero-stats { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: 28px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* ── GLOBAL STACKING SAFETY ─────────────────────────────── */
/* Ensures decorative backgrounds/overlays never intercept nav clicks */
.hero-bg, .lp-hero-bg, [class*="-hero-bg"], [class*="-hero-orb"],
[class*="hero-orb"], [class*="orb-"], [class*="-grid-overlay"],
[class*="hero-grid"], [class*="hero-overlay"],
[class*="particle"], [class*="parallax"] {
  pointer-events: none !important;
}
/* Header and all its children ALWAYS receive pointer events */
.site-header, .site-header * {
  pointer-events: auto !important;
}

/* ── HOMEPAGE ADVISOR SECTION ───────────────────────────── */
.advisor-section { padding: 80px 0; position: relative; overflow: hidden; }
.advisor-section::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(215, 175, 82, 0.07), transparent 70%);
  pointer-events: none;
}
.advisor-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: center; }
.advisor-photo-wrap { position: relative; }
.advisor-photo {
  width: 100%; max-width: 420px;
  aspect-ratio: 3/4;
  object-fit: cover; object-position: top;
  border-radius: 28px;
  border: 1px solid rgba(215, 175, 82, 0.25);
  box-shadow: 0 40px 120px rgba(0,0,0,0.6), var(--shadow-gold);
}
.advisor-photo-badge {
  position: absolute; bottom: -16px; right: -16px;
  background: linear-gradient(135deg, #f2cf85, #c5952d);
  color: #111; padding: 14px 20px; border-radius: var(--radius-md);
  font-weight: 800; font-size: 0.85rem; text-align: center;
  box-shadow: var(--shadow);
}
.advisor-content { display: grid; gap: 24px; }
.advisor-name { font-family: "Cormorant Garamond", serif; font-size: clamp(2.2rem, 3.5vw, 3.4rem); line-height: 1; margin: 0; }
.advisor-title { color: var(--gold); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.1em; }
.advisor-bio { color: var(--muted-light); line-height: 1.8; font-size: 1.05rem; }
.advisor-creds { display: flex; gap: 12px; flex-wrap: wrap; }
.cred-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(215, 175, 82, 0.25);
  background: rgba(215, 175, 82, 0.08);
  color: var(--gold-strong); font-size: 0.82rem; font-weight: 600;
}

/* ── TESTIMONIALS ───────────────────────────────────────── */
.testimonials-section { padding: 80px 0; }
.testimonial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 48px; }
.testimonial-card {
  padding: 28px 26px; border-radius: var(--radius-xl);
  border: 1px solid var(--line-soft);
  background: linear-gradient(145deg, rgba(22,22,22,0.98), rgba(14,14,14,0.98));
  display: grid; gap: 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.testimonial-card:hover { border-color: rgba(215,175,82,0.2); box-shadow: var(--shadow-gold); }
.testimonial-stars { color: var(--gold); font-size: 1rem; letter-spacing: 2px; }
.testimonial-body { color: var(--text-soft); line-height: 1.75; font-size: 0.97rem; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dim), rgba(255,255,255,0.05));
  border: 1px solid rgba(215,175,82,0.2);
  display: grid; place-items: center;
  color: var(--gold); font-family: "Cormorant Garamond", serif; font-size: 1.1rem; font-weight: 700;
  flex-shrink: 0;
}
.testimonial-author-name { font-weight: 700; font-size: 0.9rem; }
.testimonial-author-sub { color: var(--muted); font-size: 0.8rem; }

/* ── TRUST BAND ─────────────────────────────────────────── */
.trust-band { padding: 36px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.trust-band-inner { display: flex; justify-content: space-around; align-items: center; gap: 32px; flex-wrap: wrap; }
.trust-item { text-align: center; }
.trust-number { font-family: "Cormorant Garamond", serif; font-size: 2.6rem; color: var(--gold-strong); display: block; line-height: 1; }
.trust-label { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

/* ── METRIC BAND ────────────────────────────────────────── */
.metric-band { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.band-item, .rate-row, .mini-callout {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}
.band-item { padding: 20px; }
.band-item strong, .rate-row strong, .mini-callout strong { display: block; margin-bottom: 6px; font-size: 1rem; color: var(--text); }
.band-item span, .rate-row span, .mini-callout span { color: var(--muted); line-height: 1.6; }
.rate-row, .mini-callout { padding: 16px 18px; }
.mini-callout { background: linear-gradient(135deg, rgba(240, 203, 121, 0.12), rgba(255, 255, 255, 0.03)); }
.rate-stack { display: grid; gap: 14px; margin-bottom: 18px; }

/* ── METRIC CARDS ───────────────────────────────────────── */
.metric-card { transition: box-shadow var(--transition), border-color var(--transition); }
.metric-card:hover { border-color: var(--line-mid); }
.metric-card strong, .pipeline-count { display: block; font-size: 2rem; }
.metric-card span, .metric-label { color: var(--muted); font-size: 0.85rem; display: block; margin-top: 4px; }
.metric-card-gold { background: linear-gradient(135deg, rgba(215,175,82,0.12), rgba(14,14,14,0.98)); border-color: rgba(215,175,82,0.2); }
.metric-delta { font-size: 0.8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; }
.metric-delta.up { color: var(--green); }
.metric-delta.down { color: var(--red); }

/* ── SECTION HEADING ────────────────────────────────────── */
.section-heading { text-align: center; margin-bottom: 48px; }
.section-heading h2 { margin-top: 8px; }
.section-heading p { color: var(--muted); margin: 12px auto 0; max-width: 560px; line-height: 1.7; }

/* ── LOAN CARDS ─────────────────────────────────────────── */
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.loan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loan-card { overflow: hidden; transition: box-shadow var(--transition), border-color var(--transition); cursor: pointer; }
.loan-card:hover { border-color: rgba(215,175,82,0.2); box-shadow: var(--shadow), var(--shadow-gold); }
.loan-card img { width: 100%; display: block; border-radius: 20px; }
.card-media { margin-bottom: 18px; }
.text-link { color: var(--gold); font-size: 0.88rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; }
.text-link::after { content: "→"; }
.text-link:hover { color: var(--gold-strong); }

/* ── CTA BANNER ─────────────────────────────────────────── */
.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-banner-dark { background: linear-gradient(135deg, rgba(215,175,82,0.08), rgba(14,14,14,0.98)); border-color: rgba(215,175,82,0.15); }

/* ── SPLIT SECTION ──────────────────────────────────────── */
.split-section { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; align-items: center; }
.check-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.check-item {
  padding: 16px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--line-soft); background: rgba(255,255,255,0.02);
  color: var(--text-soft); line-height: 1.5; font-size: 0.92rem;
  position: relative; padding-left: 44px;
}
.check-item::before {
  content: "✓";
  position: absolute; left: 14px; top: 14px;
  color: var(--gold); font-weight: 800;
}

/* ── FORMS ──────────────────────────────────────────────── */
.field { display: grid; gap: 8px; }
.field span { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea, .table-row select, .search-input {
  width: 100%; border-radius: var(--radius-md); border: 1px solid var(--line-soft);
  background: var(--surface-soft); color: var(--text); padding: 13px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus {
  border-color: rgba(215,175,82,0.4);
  box-shadow: 0 0 0 3px rgba(215,175,82,0.1);
}
.field textarea { resize: vertical; min-height: 100px; }
.form-layout, .auth-layout, .stack-form { display: grid; gap: 16px; }
.form-layout, .auth-layout { grid-template-columns: 0.9fr 1.1fr; }
.input-row { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-message { font-size: 0.88rem; margin-top: 4px; }
.form-message.is-error { color: var(--red); }
.form-message.is-success { color: var(--green); }
.narrow-page { max-width: 540px; margin: 0 auto; display: grid; gap: 16px; }
.form-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.82rem; }
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* ── AUTH LAYOUT ────────────────────────────────────────── */
.auth-layout { align-items: start; }
.auth-side-visual {
  border-radius: var(--radius-xl); overflow: hidden;
  background: linear-gradient(145deg, rgba(22,22,22,0.98), rgba(14,14,14,0.98));
  border: 1px solid var(--line-soft);
  padding: 40px 32px; display: grid; gap: 28px; align-content: start;
}
.auth-advisor-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(215,175,82,0.3); }

/* ── STEP PILLS / TABS ──────────────────────────────────── */
.tab-row, .action-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tab-button, .step-pill {
  display: inline-flex; width: fit-content; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: transparent; color: var(--muted);
  cursor: pointer; font-size: 0.85rem; font-weight: 600;
  transition: all var(--transition);
}
.tab-button.is-active, .step-pill.is-active {
  background: rgba(240, 203, 121, 0.12); color: var(--gold-strong);
  border-color: rgba(240, 203, 121, 0.25);
}
.tab-button:hover:not(.is-active), .step-pill:hover:not(.is-active) { color: var(--text); background: rgba(255,255,255,0.04); }
.form-step { display: none; }
.form-step.is-active { display: grid; gap: 16px; }
.status-pill, .badge-pill {
  display: inline-flex; width: fit-content; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(240, 203, 121, 0.1);
  color: var(--gold-strong); font-size: 0.78rem; font-weight: 600;
}
.status-pill-green { background: var(--green-dim); color: var(--green); border-color: rgba(159,211,170,0.2); }
.status-pill-red { background: var(--red-dim); color: var(--red); border-color: rgba(240,162,162,0.2); }
.status-pill-blue { background: var(--blue-dim); color: var(--blue); border-color: rgba(126,184,232,0.2); }

/* ── DASHBOARD LAYOUT ───────────────────────────────────── */
.dashboard-shell, .dashboard-grid { display: grid; gap: 24px; }
.dashboard-grid { grid-template-columns: 1.3fr 0.9fr; }
.dashboard-sidebar-layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 0; min-height: calc(100vh - 76px); }

/* ── CRM SIDEBAR NAV ────────────────────────────────────── */
.crm-sidebar {
  background: rgba(8,8,8,0.95); border-right: 1px solid var(--line-soft);
  padding: 24px 0; position: sticky; top: 76px; height: calc(100vh - 76px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
.crm-sidebar-section { padding: 0 12px; margin-bottom: 8px; }
.crm-sidebar-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); padding: 8px 12px 4px; }
.crm-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: var(--muted); font-size: 0.88rem; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: all var(--transition);
}
.crm-nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.crm-nav-link.is-active { color: var(--gold-strong); background: rgba(215,175,82,0.1); border: 1px solid rgba(215,175,82,0.15); }
.crm-nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.crm-main { padding: 28px 32px; min-width: 0; }

/* ── CRM TAB BAR ────────────────────────────────────────── */
.crm-tab-bar {
  display: flex; gap: 4px; padding: 6px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft);
  border-radius: 999px; width: fit-content; margin-bottom: 28px;
}
.crm-tab {
  padding: 8px 18px; border-radius: 999px; border: none; background: transparent;
  color: var(--muted); font-size: 0.86rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.crm-tab.is-active { background: rgba(215,175,82,0.15); color: var(--gold-strong); }
.crm-tab:hover:not(.is-active) { color: var(--text); }
.crm-tab-panel { display: none; }
.crm-tab-panel.is-active { display: block; }

/* ── CRM PAGE HEADER ────────────────────────────────────── */
.crm-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.crm-page-title h2 { margin-bottom: 4px; }
.crm-page-title p { color: var(--muted); font-size: 0.88rem; margin: 0; }
.crm-hero { max-width: 900px; margin-bottom: 24px; }
.crm-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.admin-stack, .crm-card-grid { display: grid; gap: 14px; }
.crm-board { display: grid; gap: 24px; grid-template-columns: 1.1fr 1.1fr 0.9fr; align-items: start; }
.crm-panel { min-height: 100%; }
.crm-panel-wide { grid-column: span 2; }
.crm-panel-actions { position: sticky; top: 98px; }

/* ── CRM SEARCH BAR ─────────────────────────────────────── */
.crm-search-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.crm-search-bar .search-input { flex: 1; border-radius: 999px; padding: 11px 20px; }
.crm-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-soft);
  background: transparent; color: var(--muted); font-size: 0.8rem; cursor: pointer;
  transition: all var(--transition);
}
.filter-chip.is-active, .filter-chip:hover { border-color: rgba(215,175,82,0.3); color: var(--gold-strong); background: var(--gold-dim); }

/* ── LEADS TABLE ────────────────────────────────────────── */
.leads-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--line-soft); }
.leads-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.leads-table th {
  padding: 12px 16px; text-align: left; font-size: 0.75rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--line-soft); white-space: nowrap;
}
.leads-table td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.leads-table tr:last-child td { border-bottom: none; }
.leads-table tr.lead-row { cursor: pointer; transition: background var(--transition); }
.leads-table tr.lead-row:hover td { background: rgba(255,255,255,0.03); }
.lead-name-cell { font-weight: 600; }
.lead-name-cell span { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 400; margin-top: 2px; }
.lead-name-link { color: inherit; text-decoration: none; }
.lead-name-link:hover { color: var(--gold-strong); text-decoration: underline; }

/* ── LEAD SCORE TIER BADGES ─────────────────────────────── */
.score-tier-badge-sm {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
.score-tier-hot  { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3); color: #f87171; }
.score-tier-warm { background: rgba(251,191,36,.12);  border: 1px solid rgba(251,191,36,.3);  color: #fbbf24; }
.score-tier-cold { background: rgba(96,165,250,.12);  border: 1px solid rgba(96,165,250,.3);  color: #60a5fa; }

/* ── CRM RECORD CARDS ───────────────────────────────────── */
.crm-record-card {
  display: grid; gap: 12px; padding: 18px; border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
  cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition);
}
.crm-record-card:hover { border-color: rgba(215,175,82,0.2); box-shadow: var(--shadow-gold); }
.crm-record-top, .crm-record-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crm-record-top strong { display: block; margin-bottom: 2px; font-size: 1rem; }
.crm-record-top span, .crm-record-meta span, .crm-record-bottom span { color: var(--muted); font-size: 0.82rem; }
.crm-record-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .85rem; }
.crm-list-item { background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015)); }
.table-card, .compact-list { display: grid; gap: 10px; }
.table-row, .doc-row, .list-item {
  display: grid; gap: 8px; padding: 14px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02);
}
.table-row { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: center; }

/* ── LEAD DETAIL DRAWER ─────────────────────────────────── */
.lead-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--drawer-w);
  background: rgba(10,10,10,0.98); border-left: 1px solid var(--line-soft);
  z-index: 500; transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; overflow: hidden;
  backdrop-filter: blur(20px);
}
.lead-drawer.is-open { transform: translateX(0); }
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 499;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.drawer-overlay.is-visible { opacity: 1; pointer-events: auto; }
.lead-drawer-header {
  padding: 20px 24px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0;
}
.lead-drawer-header h3 { margin: 0; font-size: 1.4rem; }
.drawer-close {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.04); color: var(--muted); cursor: pointer; font-size: 1.2rem;
  display: grid; place-items: center; transition: all var(--transition);
}
.drawer-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.lead-drawer-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.drawer-tab {
  flex: 1; padding: 12px 8px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition); text-align: center;
}
.drawer-tab.is-active { color: var(--gold-strong); border-bottom-color: var(--gold); }
.drawer-tab:hover:not(.is-active) { color: var(--text); }
.lead-drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: grid; gap: 16px; align-content: start; }
.drawer-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drawer-field { display: grid; gap: 4px; }
.drawer-field-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.drawer-field-value { font-size: 0.92rem; color: var(--text); }
.drawer-section-title { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin: 8px 0 6px; }

/* ── KANBAN BOARD ───────────────────────────────────────── */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); border-radius: 3px; }
.kanban-board::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.kanban-col {
  flex: 0 0 220px; min-width: 220px; border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
  background: rgba(14,14,14,0.9);
  display: flex; flex-direction: column; gap: 0;
}
.kanban-col-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-col-name { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-light); }
.kanban-col-count {
  font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.06); color: var(--muted); font-weight: 600;
}
.kanban-col-new { border-top: 2px solid #7eb8e8; }
.kanban-col-contacted { border-top: 2px solid var(--gold); }
.kanban-col-prequalified { border-top: 2px solid #a78ee8; }
.kanban-col-preapproved { border-top: 2px solid var(--green); }
.kanban-col-in-process { border-top: 2px solid #e8b87e; }
.kanban-col-in-escrow { border-top: 2px solid #e87e9f; }
.kanban-col-closed { border-top: 2px solid #5cde9c; }
.kanban-col-lost { border-top: 2px solid rgba(255,255,255,0.2); }
.kanban-cards { padding: 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kanban-card {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(22,22,22,0.98);
  cursor: grab; display: grid; gap: 6px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  user-select: none;
}
.kanban-card:hover { border-color: rgba(215,175,82,0.2); box-shadow: var(--shadow-sm); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: 0.5; transform: rotate(1.5deg) scale(0.97); }
.kanban-col.drag-over .kanban-cards { background: rgba(215,175,82,0.04); border-radius: 10px; }
.kanban-card-name { font-weight: 700; font-size: 0.88rem; }
.kanban-card-sub { color: var(--muted); font-size: 0.78rem; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.kanban-card-tag { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: var(--gold-dim); color: var(--gold); }
.kanban-add-btn {
  margin: 0 10px 10px; padding: 8px; border-radius: 8px; border: 1px dashed var(--line-soft);
  background: none; color: var(--muted); font-size: 0.8rem; cursor: pointer;
  transition: all var(--transition); text-align: center; width: calc(100% - 20px);
}
.kanban-add-btn:hover { border-color: rgba(215,175,82,0.3); color: var(--gold); background: var(--gold-dim); }

/* ── CALENDAR ───────────────────────────────────────────── */
.calendar-wrap { display: grid; gap: 20px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-month-label { font-family: "Cormorant Garamond", serif; font-size: 1.5rem; min-width: 200px; text-align: center; }
.calendar-view-toggle { display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,0.04); border-radius: 999px; border: 1px solid var(--line-soft); }
.cal-view-btn {
  padding: 6px 14px; border-radius: 999px; border: none; background: transparent;
  color: var(--muted); font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.cal-view-btn.is-active { background: rgba(215,175,82,0.15); color: var(--gold-strong); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 1px; background: var(--line-soft); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line-soft); }
.calendar-day-label { background: rgba(14,14,14,0.98); padding: 10px 12px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); text-align: center; }
.calendar-cell {
  background: rgba(14,14,14,0.98); padding: 10px 12px; min-height: 90px;
  cursor: pointer; transition: background var(--transition);
  display: flex; flex-direction: column; gap: 4px;
}
.calendar-cell:hover { background: rgba(22,22,22,0.98); }
.calendar-cell.today { background: rgba(215,175,82,0.06); }
.calendar-cell.today .cell-date { color: var(--gold-strong); font-weight: 800; }
.calendar-cell.other-month .cell-date { opacity: 0.3; }
.cell-date { font-size: 0.82rem; font-weight: 600; color: var(--muted-light); margin-bottom: 4px; }
.calendar-event-chip {
  font-size: 0.72rem; padding: 2px 6px; border-radius: 4px;
  background: rgba(215,175,82,0.2); color: var(--gold-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: background var(--transition);
}
.calendar-event-chip:hover { background: rgba(215,175,82,0.35); }
.calendar-event-chip.type-call { background: var(--blue-dim); color: var(--blue); }
.calendar-event-chip.type-showing { background: var(--green-dim); color: var(--green); }
.calendar-event-chip.type-reminder { background: var(--red-dim); color: var(--red); }
.calendar-week-grid { display: grid; grid-template-columns: 60px repeat(7, minmax(0,1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius-md); overflow: hidden; }
.week-time-col { background: rgba(14,14,14,0.98); padding: 6px 8px; font-size: 0.72rem; color: var(--muted); text-align: right; }
.week-day-col { background: rgba(14,14,14,0.98); min-height: 48px; padding: 4px; position: relative; }

/* ── APPOINTMENT MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 600;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: rgba(12,12,12,0.99); border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl); width: 100%; max-width: 520px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: 90vh;
  transform: scale(0.96); transition: transform var(--transition);
}
.modal-overlay.is-open .modal-box { transform: scale(1); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 20px; flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
}
.modal-header h3 { margin: 0; }
.modal-body {
  flex: 1; overflow-y: auto; padding: 24px 28px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 28px; flex-shrink: 0;
  border-top: 1px solid var(--line-soft);
  background: rgba(12,12,12,0.99); border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
/* Field validation */
.field-error { font-size: 0.75rem; color: var(--red, #f87171); margin-top: 3px; display: none; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea {
  border-color: rgba(248,113,113,0.6) !important;
  box-shadow: 0 0 0 2px rgba(248,113,113,0.15);
}
.field.is-invalid .field-error { display: block; }

/* ── COMMUNICATIONS FEED ────────────────────────────────── */
.comm-feed { display: grid; gap: 12px; }
.comm-item {
  display: flex; gap: 14px; padding: 14px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--line-soft); background: rgba(18,18,18,0.98);
  transition: border-color var(--transition);
}
.comm-item:hover { border-color: var(--line-mid); }
.comm-icon {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1rem;
}
.comm-icon-sms { background: var(--green-dim); color: var(--green); }
.comm-icon-email { background: var(--blue-dim); color: var(--blue); }
.comm-icon-call { background: rgba(215,175,82,0.12); color: var(--gold); }
.comm-body { flex: 1; min-width: 0; }
.comm-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.comm-contact { font-weight: 700; font-size: 0.9rem; }
.comm-time { color: var(--muted); font-size: 0.78rem; }
.comm-direction { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; }
.comm-direction-in { background: var(--green-dim); color: var(--green); }
.comm-direction-out { background: var(--blue-dim); color: var(--blue); }
.comm-text { color: var(--muted-light); font-size: 0.88rem; line-height: 1.5; }

/* ── ACTIVITY TIMELINE ──────────────────────────────────── */
.activity-feed { display: grid; gap: 0; }
.activity-item { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.activity-item:not(:last-child)::after {
  content: ""; position: absolute; left: 17px; top: 44px; bottom: 0;
  width: 1px; background: var(--line-soft);
}
.activity-dot {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.85rem;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft);
  position: relative; z-index: 1;
}
.activity-dot-gold { background: var(--gold-dim); border-color: rgba(215,175,82,0.25); }
.activity-dot-green { background: var(--green-dim); border-color: rgba(159,211,170,0.2); }
.activity-dot-blue { background: var(--blue-dim); border-color: rgba(126,184,232,0.2); }
.activity-dot-red { background: var(--red-dim); border-color: rgba(240,162,162,0.2); }
.activity-content { flex: 1; padding-top: 6px; }
.activity-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.activity-desc { font-size: 0.82rem; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.activity-time { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* ── ANALYTICS / CHARTS ─────────────────────────────────── */
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.analytics-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.chart-card { padding: 22px 24px; border-radius: var(--radius-xl); border: 1px solid var(--line-soft); background: var(--surface); }
.chart-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.chart-card-title { font-size: 0.88rem; font-weight: 700; color: var(--muted-light); }
.chart-card-value { font-family: "Cormorant Garamond", serif; font-size: 2.2rem; color: var(--text); line-height: 1; }
.chart-card-sub { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 100px; padding-top: 8px; }
.bar-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-fill {
  width: 100%; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  min-height: 4px; transition: height 0.6s cubic-bezier(0.4,0,0.2,1);
}
.bar-fill-blue { background: linear-gradient(180deg, #9ed0f5, var(--blue)); }
.bar-fill-green { background: linear-gradient(180deg, #b8e8c3, var(--green)); }
.bar-label { font-size: 0.68rem; color: var(--muted); text-align: center; white-space: nowrap; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-legend { display: grid; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.line-chart-svg { width: 100%; height: 80px; overflow: visible; }
.sparkline { fill: none; stroke: var(--gold); stroke-width: 2; }
.sparkline-area { fill: url(#goldGradient); opacity: 0.2; }

/* ── PIPELINE COLUMNS ───────────────────────────────────── */
.pipeline-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.pipeline-column { cursor: pointer; transition: all var(--transition); }
.pipeline-column:hover { border-color: rgba(215,175,82,0.2); }
.pipeline-count { display: block; font-size: 2rem; }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress-track { background: rgba(255,255,255,0.06); border-radius: 999px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-strong)); transition: width 0.5s ease; }
.progress-steps { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.progress-step { flex: 1; text-align: center; }
.progress-step-dot { width: 28px; height: 28px; border-radius: 50%; margin: 0 auto 6px; border: 2px solid var(--line-soft); background: rgba(255,255,255,0.03); display: grid; place-items: center; font-size: 0.8rem; color: var(--muted); }
.progress-step.done .progress-step-dot { border-color: var(--gold); background: var(--gold-dim); color: var(--gold-strong); }
.progress-step.current .progress-step-dot { border-color: var(--gold-strong); background: rgba(240,203,121,0.2); color: var(--gold-strong); box-shadow: 0 0 0 4px rgba(215,175,82,0.12); }
.progress-step-label { font-size: 0.72rem; color: var(--muted); }
.progress-step.done .progress-step-label, .progress-step.current .progress-step-label { color: var(--gold); }

/* ── DOC CHECKLIST ──────────────────────────────────────── */
.doc-checklist { display: grid; gap: 8px; }
.doc-checklist-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.02); font-size: 0.88rem;
  transition: border-color var(--transition);
}
.doc-checklist-item.is-uploaded { border-color: rgba(159,211,170,0.2); background: var(--green-dim); }
.doc-check-icon { font-size: 1.1rem; flex-shrink: 0; }
.doc-check-label { flex: 1; }
.doc-check-label span { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.doc-check-status { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.doc-check-status.uploaded { color: var(--green); }

/* ── LISTINGS / SEARCH ──────────────────────────────────── */
.search-filter-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.listings-grid { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.listing-card { overflow: hidden; border-radius: var(--radius-xl); border: 1px solid var(--line-soft); background: var(--surface); transition: all var(--transition); }
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow), var(--shadow-gold); border-color: rgba(215,175,82,0.15); }
.listing-card img { height: 220px; width: 100%; object-fit: cover; display: block; }
.listing-card .listing-copy { padding: 20px; }
.listing-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; margin: 10px 0; }
.eyebrow-chip { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: rgba(240, 203, 121, 0.12); color: var(--gold-strong); font-size: .78rem; font-weight: 600; }

/* ── SECTION VISUAL ─────────────────────────────────────── */
.section-visual { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; align-items: center; }
.program-visual { overflow: hidden; }
.loan-card img, .hero-media img, .listing-card img, .program-visual img { width: 100%; display: block; border-radius: 20px; }

/* ── FEATURE LIST ───────────────────────────────────────── */
.feature-list-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.feature-item { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius-md); border: 1px solid var(--line-soft); background: rgba(255,255,255,0.02); }
.feature-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.feature-body h4 { margin: 0 0 6px; font-size: 1rem; }
.feature-body p { margin: 0; font-size: 0.88rem; color: var(--muted-light); line-height: 1.6; }

/* ── ABOUT PAGE ─────────────────────────────────────────── */
.about-hero-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 64px; align-items: start; padding: 80px 0 60px; }
.about-photo-col { position: sticky; top: 100px; }
.about-photo { width: 100%; border-radius: var(--radius-xl); aspect-ratio: 3/4; object-fit: cover; object-position: top; border: 1px solid rgba(215,175,82,0.2); box-shadow: var(--shadow), var(--shadow-gold); }
.about-content { display: grid; gap: 32px; }
.about-bio-block { display: grid; gap: 14px; }
.about-bio-block p { color: var(--muted-light); line-height: 1.8; font-size: 1.02rem; }
.credentials-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.credential-card { padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--line-soft); background: rgba(255,255,255,0.02); }
.credential-card .icon { font-size: 1.6rem; margin-bottom: 10px; }
.credential-card h4 { margin: 0 0 4px; font-size: 1rem; }
.credential-card p { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

/* ── CONTACT PAGE ───────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: start; }
.contact-info { display: grid; gap: 20px; }
.contact-info-item { display: flex; gap: 14px; align-items: flex-start; }
.contact-info-icon { font-size: 1.3rem; margin-top: 2px; flex-shrink: 0; }
.contact-info-body h4 { margin: 0 0 4px; font-size: 0.95rem; }
.contact-info-body p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

/* ── FUNNEL PAGES ───────────────────────────────────────── */
.funnel-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; padding: 60px 0; }
.funnel-sidebar { position: sticky; top: 100px; display: grid; gap: 20px; }
.funnel-advisor-card { padding: 24px; border-radius: var(--radius-xl); border: 1px solid rgba(215,175,82,0.15); background: linear-gradient(145deg, rgba(22,22,22,0.98), rgba(14,14,14,0.98)); display: grid; gap: 14px; }
.funnel-advisor-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(215,175,82,0.3); }
.trust-points { display: grid; gap: 10px; }
.trust-point { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted-light); }
.trust-point::before { content: "✓"; color: var(--gold); font-weight: 800; flex-shrink: 0; }

/* ── THANK YOU CARD ─────────────────────────────────────── */
.thank-you-card { text-align: center; padding: 60px 40px; }
.thank-you-icon { font-size: 3rem; margin-bottom: 16px; }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer { padding: 48px 0; border-top: 1px solid var(--line-soft); }
.site-footer .container { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { display: grid; gap: 10px; max-width: 280px; }
.footer-brand p { color: var(--muted); font-size: 0.85rem; line-height: 1.7; margin: 0; }
.footer-logo { height: 32px; width: auto; }
.footer-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.footer-col { display: grid; gap: 10px; align-content: start; }
.footer-col-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 4px; }
.footer-col a { color: var(--muted); font-size: 0.88rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--text); }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { color: var(--muted); font-size: 0.8rem; margin: 0; }
.footer-disclaimer { color: var(--muted); font-size: 0.75rem; line-height: 1.7; margin: 0; border-top: 1px solid var(--line-soft); padding-top: 20px; }

/* ── LIGHT MODE FOOTER / MOBILE NAV ─────────────────────── */
body.light .modal-box { background: #ffffff; border-color: #e0e0e0; }
body.light .modal-header { border-bottom-color: #e0e0e0; }
body.light .modal-footer { background: #ffffff; border-top-color: #e0e0e0; }
body.light .site-footer { border-top-color: #e0e0e0; background: #f0ede8; }
body.light .footer-bottom { border-top-color: #e0e0e0; }
body.light .footer-disclaimer { border-top-color: #e0e0e0; }
body.light .mobile-nav { background: #ffffff; border-bottom-color: #e0e0e0; }

/* ── UTILITY ────────────────────────────────────────────── */
.hidden, .is-hidden { display: none !important; }
.top-gap { margin-top: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-gap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line-soft); margin: 20px 0; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }

/* ── NAVBAR SCROLL + HAMBURGER ──────────────────────────── */
/* Override to transparent at top; .scrolled restores solid bg */
.site-header {
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  background: transparent;
  border-bottom-color: transparent;
}
.site-header.scrolled {
  background: rgba(5,5,5,0.94);
  border-bottom-color: var(--line-soft);
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}
.hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.18s;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.06); }
.hamburger-btn span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.22s ease;
  transform-origin: center;
}
.hamburger-btn.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav {
  position: fixed;
  top: 76px; left: 0; right: 0;
  z-index: 99;
  background: rgba(5,5,5,0.98);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(20px);
  transform: translateY(-100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
.mobile-nav.is-open { transform: translateY(0); pointer-events: auto; }
.mobile-nav-inner { padding: 20px 24px 28px; display: flex; flex-direction: column; gap: 0; }
.mobile-nav-links { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.mobile-nav-links .nav-link { padding: 12px 14px; border-radius: 10px; }
.mobile-nav-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mobile-nav-overlay {
  position: fixed; inset: 0; z-index: 98;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
}
.mobile-nav-overlay.is-visible { opacity: 1; pointer-events: auto; }
@media (max-width: 900px) {
  .hamburger-btn { display: flex; }
  #nav-links-desktop, #header-actions-desktop { display: none !important; }
}

/* ── SIDEBAR UPGRADE ────────────────────────────────────── */
.crm-sidebar {
  width: var(--sidebar-w); flex-shrink: 0; min-height: calc(100vh - 76px);
  background: rgba(8,8,8,0.98); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 0; overflow-y: auto; position: sticky; top: 76px; height: calc(100vh - 76px);
}
.crm-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.crm-sidebar-brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #f2cf85, #c5952d);
  color: #111; font-size: 0.65rem; font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0; letter-spacing: 0;
}
.crm-sidebar-brand-label { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.crm-sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid var(--line-soft); }
.crm-nav-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 16px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--muted); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; text-align: left; transition: all var(--transition); text-decoration: none;
}
.crm-nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.crm-nav-link.is-active { background: var(--gold-dim); color: var(--gold-strong); font-weight: 700; border: 1px solid rgba(215,175,82,0.2); }
.crm-nav-icon-svg { width: 16px; height: 16px; flex-shrink: 0; }
.crm-sidebar-label { padding: 16px 20px 6px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(182,171,147,0.45); }
.crm-sidebar-section { padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }

/* ── SCORE BADGES ───────────────────────────────────────── */
.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; height: 48px; border-radius: 50%;
  font-family: "Cormorant Garamond", serif; font-size: 1.3rem; font-weight: 700;
  border: 2px solid;
}
.score-badge-sm {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; padding: 2px 8px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
}
.score-green { background: var(--green-dim); border-color: rgba(159,211,170,0.35); color: var(--green); }
.score-yellow { background: rgba(255,200,80,0.12); border-color: rgba(255,200,80,0.3); color: #ffc850; }
.score-red { background: var(--red-dim); border-color: rgba(240,162,162,0.3); color: var(--red); }
.score-grey { background: rgba(255,255,255,0.04); border-color: var(--line-soft); color: var(--muted); }

/* ── STATUS PILLS EXTENDED ──────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700;
  text-transform: capitalize; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.05); color: var(--muted-light);
}
.status-pill-blue { background: var(--blue-dim); border-color: rgba(126,184,232,0.25); color: var(--blue); }
.status-pill-yellow { background: rgba(255,200,80,0.12); border-color: rgba(255,200,80,0.25); color: #ffc850; }
.status-pill-orange { background: rgba(232,184,126,0.15); border-color: rgba(232,184,126,0.25); color: #e8b87e; }
.status-pill-purple { background: rgba(167,142,232,0.15); border-color: rgba(167,142,232,0.25); color: #a78ee8; }
.status-pill-green { background: var(--green-dim); border-color: rgba(159,211,170,0.25); color: var(--green); }
.status-pill-red { background: var(--red-dim); border-color: rgba(240,162,162,0.25); color: var(--red); }

/* ── METRIC GRID 6-COL ──────────────────────────────────── */
.metric-grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.metric-card { padding: 18px 20px; border-radius: var(--radius-md); border: 1px solid var(--line-soft); background: rgba(16,16,16,0.98); display: grid; gap: 6px; }
.metric-card strong { font-family: "Cormorant Garamond", serif; font-size: 2rem; display: block; }
.metric-card span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.metric-card-gold { border-color: rgba(215,175,82,0.25); background: linear-gradient(135deg, rgba(215,175,82,0.08), rgba(16,16,16,0.98)); }
.metric-card-gold strong { color: var(--gold-strong); }
.metric-card-green { border-color: rgba(159,211,170,0.2); }
.metric-card-green strong { color: var(--green); }
.metric-card-red { border-color: rgba(240,162,162,0.2); }
.metric-card-red strong { color: var(--red); }
.metric-card-blue { border-color: rgba(126,184,232,0.2); }
.metric-card-blue strong { color: var(--blue); }
.metric-delta { font-size: 0.72rem; color: var(--muted); }
.metric-delta.up { color: var(--green); }
.metric-delta.down { color: var(--red); }

/* ── KANBAN UPGRADES ────────────────────────────────────── */
.kanban-col-new { border-top: 2px solid #7eb8e8; }
.kanban-col-contacted { border-top: 2px solid var(--gold); }
.kanban-col-prequalified { border-top: 2px solid #a78ee8; }
.kanban-col-preapproved { border-top: 2px solid var(--green); }
.kanban-col-in_process { border-top: 2px solid #e8b87e; }
.kanban-col-in_escrow { border-top: 2px solid #e87e9f; }
.kanban-col-closed { border-top: 2px solid #5cde9c; }
.kanban-col-lost { border-top: 2px solid rgba(255,255,255,0.2); }
.kanban-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kanban-card-amount { font-size: 0.78rem; font-weight: 700; color: var(--gold-strong); }
.kanban-tag { font-size: 0.7rem; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,0.06); color: var(--muted); }
.kanban-empty { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 12px; }

/* ── LEAD DRAWER UPGRADES ───────────────────────────────── */
.drawer-section { padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.drawer-section:last-child { border-bottom: none; }
.drawer-score-row { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.drawer-ai-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.score-card { display: flex; flex-direction: column; align-items: center; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item span { display: block; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 3px; }
.detail-item strong { font-size: 0.9rem; font-weight: 600; }

/* ── AI SUMMARY BOX ─────────────────────────────────────── */
.drawer-ai-summary { background: rgba(215,175,82,0.04); border-radius: var(--radius-md); border: 1px solid rgba(215,175,82,0.15); padding: 16px !important; }
.ai-summary-body { font-size: 0.88rem; line-height: 1.65; color: var(--muted-light); white-space: pre-wrap; }
.ai-draft-output { background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px; font-size: 0.86rem; line-height: 1.65; color: var(--muted-light); white-space: pre-wrap; }

/* ── AI CHAT BUBBLE ─────────────────────────────────────── */
.ai-chat-bubble {
  position: fixed; bottom: 28px; right: 28px; z-index: 900;
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, #f2cf85, #c5952d);
  color: #111; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 8px 32px rgba(215,175,82,0.45);
  transition: all var(--transition);
}
.ai-chat-bubble:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(215,175,82,0.6); }
.ai-chat-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; }
.ai-chat-panel {
  position: fixed; bottom: 100px; right: 28px; z-index: 900;
  width: 360px; background: rgba(10,10,10,0.98); border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl); box-shadow: var(--shadow), var(--shadow-gold);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.92) translateY(20px); opacity: 0; pointer-events: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1); transform-origin: bottom right;
}
.ai-chat-panel.is-open { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
.ai-chat-header {
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 0.9rem; color: var(--gold-strong); flex-shrink: 0;
}
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-height: 340px; }
.ai-chat-msg { display: flex; }
.ai-msg { justify-content: flex-start; }
.user-msg { justify-content: flex-end; }
.ai-chat-bubble-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 0.86rem; line-height: 1.55;
}
.ai-msg .ai-chat-bubble-msg { background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft); color: var(--muted-light); border-radius: 4px 16px 16px 16px; }
.user-msg .ai-chat-bubble-msg { background: var(--gold-dim); border: 1px solid rgba(215,175,82,0.25); color: var(--text); border-radius: 16px 4px 16px 16px; }
.ai-thinking { color: var(--muted); font-style: italic; }
.ai-chat-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-soft); flex-shrink: 0; }
.ai-chat-input-row input { flex: 1; border-radius: 999px; padding: 9px 14px; font-size: 0.86rem; background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); color: var(--text); outline: none; }
.ai-chat-input-row input:focus { border-color: rgba(215,175,82,0.3); }

/* ── MODAL LARGE ────────────────────────────────────────── */
.modal-box-lg { max-width: 780px; }
.form-section-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); padding: 4px 0 8px; margin-top: 8px; border-bottom: 1px solid var(--line-soft); }

/* ── CHART PANEL ────────────────────────────────────────── */
.chart-panel { min-height: 140px; }
.pie-legend { display: grid; gap: 8px; }
.pie-legend-item { display: flex; align-items: center; gap: 8px; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── BTN EXTRA SIZES ────────────────────────────────────── */
.btn-xs { min-height: 26px; padding: 0 10px; font-size: 0.76rem; }

/* ── PIPELINE GRID EXTENDED ─────────────────────────────── */
.pipeline-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }

/* ── WEBSITE EDITOR ─────────────────────────────────────── */
.editor-layout { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 76px); overflow: hidden; }
.editor-sidebar { background: rgba(8,8,8,0.98); border-right: 1px solid var(--line-soft); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.editor-page-btn { width: 100%; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); background: none; color: var(--muted); font-size: 0.85rem; text-align: left; cursor: pointer; transition: all var(--transition); }
.editor-page-btn:hover, .editor-page-btn.is-active { border-color: rgba(215,175,82,0.3); color: var(--gold-strong); background: var(--gold-dim); }
.editor-main { display: flex; flex-direction: column; overflow: hidden; }
.editor-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); background: rgba(8,8,8,0.98); flex-shrink: 0; flex-wrap: wrap; }
.editor-canvas { flex: 1; overflow: hidden; }
#gjs { height: 100%; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1280px) {
  .metric-grid-6 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .pipeline-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .analytics-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1024px) {
  .hero-grid, .split-section, .form-layout, .auth-layout,
  .dashboard-grid, .admin-grid, .crm-board,
  .advisor-grid, .funnel-layout, .contact-grid,
  .about-hero-grid { grid-template-columns: 1fr; }
  .loan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-band, .listings-grid, .search-filter-grid, .section-visual,
  .testimonial-grid, .analytics-grid { grid-template-columns: 1fr; }
  .crm-panel-wide { grid-column: auto; }
  .advisor-photo-wrap { max-width: 360px; margin: 0 auto; }
  .about-photo-col { position: static; }
  .dashboard-sidebar-layout { grid-template-columns: 1fr; }
  .crm-sidebar { display: none; }
  .funnel-sidebar { position: static; }
  .pipeline-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .nav-links, .header-actions { display: none; }
  .hero-stats, .metric-grid, .metric-grid-6, .card-grid, .check-grid, .loan-grid,
  .input-row, .pipeline-grid, .table-row, .analytics-grid,
  .feature-list-grid, .credentials-grid, .detail-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; }
  .crm-tab-bar { overflow-x: auto; width: 100%; border-radius: var(--radius-md); }
  .kanban-board { padding-bottom: 12px; }
  .lead-drawer { width: 100%; }
  .footer-cols { gap: 28px; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .ai-chat-panel { width: calc(100vw - 32px); right: 16px; }
  .modal-box-lg { max-width: 100%; }
}

/* ══════════════════════════════════════════════════════════
   LIGHT MODE — CRM / ADMIN OVERRIDES
   ══════════════════════════════════════════════════════════ */

/* Sidebar */
body.light .crm-sidebar {
  background: #ffffff;
  border-right-color: #e0e0e0;
}
body.light .crm-sidebar-brand { border-color: #e0e0e0; }
body.light .crm-sidebar-label { color: #888; }
body.light .crm-nav-link { color: #555; }
body.light .crm-nav-link:hover { color: #1a1a1a; background: rgba(0,0,0,0.05); }
body.light .crm-nav-link.is-active { color: #a07828; background: rgba(192,152,60,0.12); border-color: rgba(192,152,60,0.25); }
body.light .crm-sidebar-footer { border-top-color: #e0e0e0; }

/* Main content area */
body.light .crm-main { background: #f5f5f5; }

/* Tab bar */
body.light .crm-tab-bar { background: #e8e8e8; border-color: #d0d0d0; }
body.light .crm-tab { color: #666; }
body.light .crm-tab.is-active { background: rgba(192,152,60,0.15); color: #a07828; }
body.light .crm-tab:hover:not(.is-active) { color: #1a1a1a; }

/* Stat / metric cards */
body.light .stat-card,
body.light .metric-card,
body.light .card,
body.light .panel { background: #ffffff; border-color: #e0e0e0; }
body.light .stat-card-value { color: #1a1a1a; }
body.light .stat-card-label,
body.light .metric-label { color: #666; }

/* CRM record cards */
body.light .crm-record-card {
  background: #ffffff;
  border-color: #e0e0e0;
}
body.light .crm-record-card:hover { border-color: rgba(192,152,60,0.35); }
body.light .crm-list-item { background: #ffffff; }

/* Table rows / doc rows */
body.light .table-row,
body.light .doc-row,
body.light .list-item { background: #ffffff; border-color: #e0e0e0; }

/* Leads table */
body.light .leads-table-wrap { border-color: #e0e0e0; }
body.light .leads-table th {
  background: #f0f0f0;
  color: #666;
  border-bottom-color: #e0e0e0;
}
body.light .leads-table td { border-bottom-color: #ebebeb; color: #1a1a1a; }
body.light .leads-table tr.lead-row:hover td { background: #f8f8f8; }

/* Lead drawer */
body.light .lead-drawer {
  background: #ffffff;
  border-left-color: #e0e0e0;
}
body.light .lead-drawer-header { border-bottom-color: #e0e0e0; }
body.light .lead-drawer-tabs { border-bottom-color: #e0e0e0; }
body.light .drawer-close { background: #f0f0f0; border-color: #e0e0e0; color: #666; }
body.light .drawer-close:hover { background: #e0e0e0; color: #1a1a1a; }
body.light .lead-drawer-body { background: #ffffff; }

/* Kanban */
body.light .kanban-col {
  background: #f0f0f0;
  border-color: #e0e0e0;
}
body.light .kanban-col-header { border-bottom-color: #e0e0e0; }
body.light .kanban-col-name { color: #555; }
body.light .kanban-col-count { background: rgba(0,0,0,0.07); color: #666; }
body.light .kanban-card {
  background: #ffffff;
  border-color: #e0e0e0;
}
body.light .kanban-card:hover { border-color: rgba(192,152,60,0.35); }
body.light .kanban-card-name { color: #1a1a1a; }
body.light .kanban-card-sub { color: #666; }
body.light .kanban-add-btn { color: #888; border-color: #d0d0d0; }
body.light .kanban-add-btn:hover { color: #a07828; border-color: rgba(192,152,60,0.4); }

/* Calendar */
body.light .calendar-view-toggle { background: #e8e8e8; border-color: #d0d0d0; }
body.light .cal-grid-cell { border-color: #e0e0e0; }
body.light .cal-grid-cell.today { background: rgba(192,152,60,0.08); }
body.light .cal-event { background: rgba(192,152,60,0.12); color: #a07828; }

/* Filter chips */
body.light .filter-chip { color: #666; border-color: #d0d0d0; }
body.light .filter-chip.is-active,
body.light .filter-chip:hover { border-color: rgba(192,152,60,0.4); color: #a07828; }

/* Search inputs inside CRM */
body.light .crm-search-bar .search-input {
  background: #ffffff;
  border-color: #d0d0d0;
  color: #1a1a1a;
}

/* Editor sidebar */
body.light .editor-sidebar,
body.light .editor-toolbar { background: #f0f0f0; border-color: #e0e0e0; }
body.light .editor-page-btn { color: #555; border-color: #d0d0d0; }
body.light .editor-page-btn:hover,
body.light .editor-page-btn.is-active { color: #a07828; border-color: rgba(192,152,60,0.4); background: rgba(192,152,60,0.08); }

/* Drawer overlay stays semi-dark */
body.light .drawer-overlay { background: rgba(0,0,0,0.3); }

/* CRM sidebar theme toggle button */
.crm-theme-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px; margin-top: 8px;
  border-radius: var(--radius-sm); border: none; background: none;
  color: var(--muted); font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); text-align: left;
}
.crm-theme-toggle:hover { color: var(--text); background: rgba(255,255,255,0.05); }
body.light .crm-theme-toggle { color: #555; }
body.light .crm-theme-toggle:hover { color: #1a1a1a; background: rgba(0,0,0,0.05); }
.crm-theme-toggle .icon-moon { display: block; }
.crm-theme-toggle .icon-sun  { display: none; }
body.light .crm-theme-toggle .icon-moon { display: none; }
body.light .crm-theme-toggle .icon-sun  { display: block; }

/* ============================================
   MOBILE RESPONSIVE — 768px and below
   ============================================ */
@media (max-width: 768px) {

  /* Prevent horizontal scroll */
  body, html {
    overflow-x: hidden;
    width: 100%;
  }

  /* Nav */
  .nav-container, nav {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .nav-links {
    display: none; /* hamburger menu handles this */
  }

  /* Hero sections */
  .hero, .hero-section, [class*="hero"] {
    padding: 60px 20px 40px;
    min-height: auto;
  }
  .hero h1, .hero-section h1 {
    font-size: clamp(28px, 7vw, 48px);
    line-height: 1.2;
  }
  .hero p, .hero-section p {
    font-size: 16px;
  }

  /* Buttons */
  .btn, .cta-btn, [class*="btn"] {
    padding: 14px 20px;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  /* Grid layouts → single column */
  .grid, .cards-grid, .programs-grid, .loan-grid,
  [class*="grid"], [class*="cards"] {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* Cards */
  .card, [class*="card"] {
    padding: 20px 16px;
    margin: 0 !important;
  }

  /* DPA Wizard */
  .wizard-container, .matcher-container, [class*="wizard"] {
    padding: 20px 16px;
    margin: 0 12px;
  }
  .wizard-options, .option-grid {
    grid-template-columns: 1fr !important;
  }
  .wizard-option, .option-btn {
    padding: 14px;
    font-size: 14px;
  }

  /* Progress bar labels */
  .step-label {
    display: none;
  }

  /* Stats / counters row */
  .stats-row, .stats-grid, [class*="stats"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }

  /* Sections */
  section, .section {
    padding: 40px 16px;
  }

  /* FAQ */
  .faq-item, .faq-question {
    padding: 16px;
    font-size: 15px;
  }

  /* Forms */
  form, .form-container {
    padding: 20px 16px;
  }
  input, select, textarea {
    font-size: 16px !important; /* prevents iOS zoom on focus */
    width: 100%;
    box-sizing: border-box;
  }

  /* Footer */
  footer, .footer {
    padding: 30px 16px;
    text-align: center;
  }
  .footer-grid, .footer-columns {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }

  /* FAQ toggle */
  .faq-question.open span { transform: rotate(45deg); }
  .faq-answer.open { max-height: 400px !important; padding-top: 8px !important; }
}

@media (max-width: 480px) {
  .hero h1, .hero-section h1 {
    font-size: clamp(24px, 8vw, 36px);
  }
  .stats-row, .stats-grid {
    grid-template-columns: 1fr !important;
  }
}
