/* Azure Home Loans — Broker CRM · Private-banking premium theme */
:root {
  --font: "Outfit", system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;
  --bg: #edf0f5;
  --bg-subtle: #e2e7ef;
  --surface: #ffffff;
  --surface-hover: #f5f7fa;
  --surface-alt: #f5f7fa;
  --border: rgba(12, 22, 40, 0.09);
  --border-strong: rgba(12, 22, 40, 0.16);
  --text: #0b1424;
  --text-secondary: #3d4a5c;
  --text-muted: #7a8799;
  --brand: #0a5678;
  --brand-dark: #063d56;
  --brand-light: #e6f2f7;
  --brand-mid: #0d6e99;
  --brand-gradient: linear-gradient(145deg, #0a5678 0%, #0a3d5c 55%, #082f47 100%);
  --accent: #9c7d4f;
  --accent-light: #f3efe6;
  --accent-bg: #f7f4ed;
  --gold: #b8956c;
  --gold-soft: rgba(184, 149, 108, 0.14);
  --success: #0f766e;
  --success-bg: #ecf8f6;
  --warning: #b45309;
  --warning-bg: #fff8ed;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(8, 18, 36, 0.04);
  --shadow: 0 1px 2px rgba(8, 18, 36, 0.03), 0 10px 28px rgba(8, 18, 36, 0.06);
  --shadow-lg: 0 4px 8px rgba(8, 18, 36, 0.04), 0 24px 48px rgba(8, 18, 36, 0.1);
  --nav-bg: linear-gradient(180deg, #050d18 0%, #0a1628 48%, #0c1c32 100%);
  --nav-text: #f4f7fb;
  --glow: 0 4px 20px rgba(10, 86, 120, 0.28);
  --ring: 0 0 0 3px rgba(10, 86, 120, 0.16);
  --transition: 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  --hairline: 1px solid var(--border);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 480px at 8% -10%, rgba(10, 86, 120, 0.07), transparent 55%),
    radial-gradient(900px 420px at 92% 0%, rgba(184, 149, 108, 0.06), transparent 50%),
    linear-gradient(180deg, #e8ecf3 0%, var(--bg) 160px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" on, "kern" on;
}

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* Nav — ink glass header */
.nav {
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(184, 149, 108, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 40px rgba(0,0,0,0.35);
}
.nav-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}
.nav-actions {
  display: flex; gap: 6px; align-items: center; flex-wrap: nowrap;
  justify-content: flex-end; min-width: 0; flex: 1;
}
.nav-actions .status-chip { flex-shrink: 0; }
.nav-actions .btn { flex-shrink: 0; }
@media (max-width: 1280px) {
  .nav-actions .status-chip:not(#healthChip):not(#overdueChip):not(#aiChip) { display: none; }
}
@media (max-width: 980px) {
  .nav-inner { flex-wrap: wrap; }
  .nav-actions { flex-wrap: wrap; justify-content: flex-start; }
}
.nav-brand-link {
  background: none; border: none; cursor: pointer; text-align: left;
  padding: 4px 8px 4px 0; border-radius: var(--radius-sm);
  transition: opacity var(--transition);
}
.nav-brand-link:hover { opacity: 0.92; }
.nav-brand { display: flex; align-items: center; gap: 14px; }
.nav-logo-img {
  display: block; object-fit: contain; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(184, 149, 108, 0.35), 0 8px 20px rgba(0,0,0,0.35);
}
.nav-title {
  font-family: var(--font-display);
  font-weight: 600; font-size: 18px; letter-spacing: -0.02em;
  color: var(--nav-text); line-height: 1.15;
}
.nav-sub {
  font-size: 11px; color: rgba(244,247,251,0.55); font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px;
}
.nav .status-chip { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); color: rgba(241,245,249,0.88); }
.nav .status-chip.ok { background: rgba(15,118,110,0.25); border-color: rgba(45,212,191,0.35); color: #5eead4; }
.nav .status-chip.brand { background: rgba(10,86,120,0.35); border-color: rgba(184,149,108,0.35); color: #d4eaf4; }
.nav .btn-ghost { color: rgba(241,245,249,0.88); border-color: rgba(255,255,255,0.12); }
.nav .btn-ghost:hover { background: rgba(255,255,255,0.08); }

.export-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.checkbox-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-label input { width: auto; }

.report-section { margin-bottom: 24px; }
.report-section h3 {
  margin: 0 0 12px;
  font-size: 14px; font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.report-section h3 .count {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--bg-subtle); color: var(--text-muted);
}

.settlement-alert {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
}
.settlement-alert.danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
  border-color: #fecaca;
}
.settlement-alert h3 { margin: 0 0 6px; font-size: 15px; }
.settlement-alert p { margin: 0; font-size: 13px; color: var(--text-secondary); }

.pipeline-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.pipeline-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.pipeline-group-card h4 {
  margin: 0 0 4px;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.pipeline-group-card .pg-count {
  font-size: 28px; font-weight: 800;
  color: var(--brand);
}
.pipeline-group-card .pg-vol {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
}

.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }
.mini-table th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 4px 0; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.mini-table tr:last-child td { border-bottom: none; }

.nav-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.nav-sub { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.nav-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav-search-wrap { position: relative; min-width: 200px; max-width: 340px; flex: 1; }
.nav-search-input {
  width: 100%; padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 13px; font-family: var(--font);
  background: rgba(255,255,255,0.07); color: var(--nav-text);
  outline: none; transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.nav-search-input::placeholder { color: rgba(244,247,251,0.42); }
.nav-search-input:focus {
  background: rgba(255,255,255,0.1);
  border-color: rgba(184, 149, 108, 0.45);
  box-shadow: 0 0 0 3px rgba(184, 149, 108, 0.12);
}
.nav-search-results {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto;
  z-index: 500;
}
#globalSearchResults {
  position: fixed;
  z-index: 500;
  min-width: 200px;
  max-width: min(360px, calc(100vw - 16px));
}
.nav-search-item {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.nav-search-item:hover { background: var(--surface-alt, #f4f7fb); }
.nav-search-item strong { display: block; }
.nav-search-item span { font-size: 11px; color: var(--text-muted); }

.lender-field-wrap .lender-select,
.lender-field-wrap select.lender-select {
  width: 100%;
  max-width: 100%;
}
.lender-field-wrap .lender-custom-input {
  width: 100%;
}

.hunt-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .hunt-layout { grid-template-columns: 1fr; }
}
.hunt-candidate {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.hunt-candidate:hover, .hunt-candidate.active {
  background: var(--surface-alt, #f4f7fb);
}
.hunt-candidate strong { display: block; font-size: 14px; }
.hunt-candidate-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.hunt-confidence {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft, #e8f0fe);
  color: var(--brand, #2563eb);
}
.hunt-confidence.high { background: #dcfce7; color: #166534; }
.hunt-confidence.medium { background: #fef3c7; color: #92400e; }
.hunt-msg-preview {
  font-size: 12px;
  padding: 10px;
  background: var(--surface-alt, #f8fafc);
  border-radius: 8px;
  margin-top: 8px;
  border-left: 3px solid var(--border);
}
.hunt-signals { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.hunt-signal-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-muted);
}

.email-intel-health {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
}
.email-intel-score {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--brand, #2563eb);
}
.email-intel-score.warn { color: #d97706; }
.email-intel-score.danger { color: #dc2626; }
.email-intel-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.email-intel-filter {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.email-intel-filter.active {
  background: var(--brand, #2563eb);
  color: #fff;
  border-color: var(--brand, #2563eb);
}
.email-intel-filter .fc { opacity: 0.8; margin-left: 4px; }
.email-intel-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.email-intel-item:hover, .email-intel-item.active { background: var(--surface-alt, #f4f7fb); }
.email-intel-item .ei-pri {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.email-intel-item .ei-pri.high { background: #ef4444; }
.email-intel-item .ei-pri.medium { background: #f59e0b; }
.email-intel-item .ei-pri.low { background: #94a3b8; }
.email-intel-ai-block { margin-bottom: 14px; }
.email-intel-ai-block h4 { margin: 0 0 6px; font-size: 13px; }
.email-intel-top-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
  padding: 10px 12px; background: var(--surface-alt); border-radius: 10px;
  border: 1px solid var(--border);
}
.email-intel-top-actions .ei-pin {
  font-size: 12px; padding: 6px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.email-intel-top-actions .ei-pin:hover { border-color: var(--brand); }
.email-intel-must-do-bar { width: 100%; }
.email-intel-must-do-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px; margin-top: 8px;
}
.ei-must-do-card {
  text-align: left; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
}
.ei-must-do-card:hover { border-color: var(--brand); background: var(--accent-bg); }
.ei-must-do-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.ei-must-do-preview { font-size: 11px; color: var(--text-secondary); line-height: 1.35; }
.ei-must-do-sent { font-size: 10px; color: var(--warning); margin-top: 4px; }
.email-intel-outbound-preview { font-size: 13px; }
.ceo-must-item.clickable:hover { background: var(--accent-bg); }
.ceo-must-preview { line-height: 1.4; }
.email-intel-unread { color: #2563eb; font-size: 10px; font-weight: 700; margin-left: 4px; }
.email-intel-link-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.email-intel-link-row input { flex: 1; min-width: 160px; max-width: 280px; }
.email-intel-silent-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.email-intel-draft {
  padding: 10px;
  background: var(--surface-alt);
  border-radius: 8px;
  font-size: 12px;
  margin-top: 6px;
  white-space: pre-wrap;
}

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
}
.status-chip.ok { background: var(--success-bg); border-color: #9fd5cf; color: var(--success); }
.status-chip.warn { background: var(--warning-bg); border-color: #f5d0a0; color: var(--warning); }
.status-chip.brand { background: var(--brand-light); border-color: rgba(10, 86, 120, 0.25); color: var(--brand-dark); }

/* Tabs */
.tab-bar {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 150;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
}
.tab-bar-inner {
  max-width: 1480px; margin: 0 auto;
  padding: 0 20px;
  display: flex; gap: 2px; flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.tab-bar-inner::-webkit-scrollbar { height: 3px; }
.tab-bar-inner::-webkit-scrollbar-thumb { background: rgba(12,22,40,0.18); border-radius: 4px; }
.tab-btn {
  font-family: var(--font);
  font-size: 12.5px; font-weight: 600;
  padding: 13px 14px;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: 0.01em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--brand-dark);
  border-bottom-color: var(--gold);
}
.tab-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
  background: var(--bg-subtle); color: var(--text-secondary);
}
.tab-btn.active .tab-badge { background: var(--brand-light); color: var(--brand-dark); }
.tab-badge.danger { background: var(--danger-bg); color: var(--danger); }

.nav-dropdown { position: relative; flex-shrink: 0; }
.nav-dropdown-btn::after { opacity: 0.6; }
.nav-dropdown-menu {
  display: none; position: fixed; z-index: 500;
  min-width: 200px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px 0;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown.open .nav-dropdown-btn { color: var(--brand); border-bottom-color: var(--brand); }
.nav-dropdown-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 10px 16px; border: none; background: none;
  font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer;
}
.nav-dropdown-item:hover { background: var(--surface-hover); color: var(--brand); }

.audit-check-row {
  display: grid; grid-template-columns: 1fr 72px auto auto; gap: 8px; align-items: start;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px;
}
.audit-check-row.critical { background: #fff7ed; margin: 0 -12px; padding: 10px 12px; border-left: 3px solid var(--danger); }
.audit-check-row .audit-help { font-size: 10px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.audit-check-row select { font-size: 11px; padding: 4px 8px; }
.audit-check-row .audit-assignee { font-size: 10px; font-weight: 700; color: var(--brand); white-space: nowrap; padding-top: 4px; }
.audit-section-title { font-weight: 800; font-size: 13px; margin: 16px 0 8px; color: var(--brand-dark); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.audit-critical-badge { font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: var(--danger-bg); color: var(--danger); }
.audit-team-chip { font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 8px; background: var(--bg-subtle); border: 1px solid var(--border); }
.audit-team-chip strong { color: var(--brand); }

.facility-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; background: var(--surface);
}
.facility-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.facility-card-head strong { font-size: 13px; }
.facility-type-tag {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 4px; background: var(--bg-subtle); color: var(--text-muted);
}
.facility-type-tag.car { background: #fef3c7; color: #b45309; }
.facility-type-tag.home { background: #dbeafe; color: #1d4ed8; }
.facility-meta { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

/* Full-screen audit wizard */
.audit-session-shell { max-width: 720px; margin: 0 auto; }
.audit-session-top {
  display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.audit-session-title-wrap { flex: 1; min-width: 200px; }
.audit-session-title-wrap h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.audit-session-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.audit-session-progress {
  height: 6px; background: var(--bg-subtle); border-radius: 999px;
  overflow: hidden; margin-bottom: 20px;
}
.audit-session-progress-fill {
  height: 100%; background: var(--brand); border-radius: 999px; transition: width 0.25s ease;
}
.audit-session-body .audit-wizard-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.audit-wizard-step-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--brand); margin-bottom: 8px;
}
.audit-wizard-question {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.audit-wizard-question:last-child { border-bottom: none; }
.audit-wizard-question input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.audit-wizard-question label { flex: 1; cursor: pointer; line-height: 1.45; }
.audit-wizard-question .auto-tag {
  font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px;
  background: #dbeafe; color: #1d4ed8; margin-left: 6px; vertical-align: middle;
}
.audit-wizard-sign-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px;
}
.audit-wizard-sign-row label {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.audit-wizard-sign-row input { margin: 0; }
.audit-wizard-nav {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; flex-wrap: wrap;
}
.audit-split-layout {
  display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start;
}
@media (max-width: 800px) {
  .audit-split-layout { grid-template-columns: 1fr; }
}
.audit-file-sidebar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-height: 72vh; overflow: auto; position: sticky; top: 12px;
}
.audit-file-sidebar-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted);
}
.audit-file-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px;
  border-bottom: 1px solid var(--border); font-size: 11px; cursor: pointer; line-height: 1.35;
}
.audit-file-row:hover { background: var(--surface-hover); }
.audit-file-row.active { background: var(--brand-light); border-left: 3px solid var(--brand); }
.audit-file-row.done { opacity: 0.85; }
.audit-file-row .af-icon { width: 18px; flex-shrink: 0; font-weight: 800; text-align: center; }
.audit-file-row .af-icon.done { color: var(--success); }
.audit-file-row .af-icon.pending { color: var(--warning); }
.audit-file-row .af-icon.missing { color: var(--danger); }
.audit-file-row .af-icon.na { color: var(--text-muted); }
.audit-scan-summary { font-size: 12px; line-height: 1.55; }
.audit-scan-summary ul { margin: 8px 0 0 18px; }
.audit-ai-box {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0; font-size: 12px; line-height: 1.5;
}
.audit-suggest-box {
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--radius);
  padding: 10px 12px; margin: 10px 0; font-size: 11px;
}

.content {
  flex: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 32px 28px 96px;
  width: 100%;
}
.view { display: none; animation: fadeUp 0.35s var(--transition); }
.view.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-header { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.view-header h1 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1.12;
}
.view-header h1::after {
  content: "";
  display: block;
  width: 36px; height: 2px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 2px;
}
.view-header p { margin: 0; color: var(--text-secondary); font-size: 14px; max-width: 52ch; line-height: 1.5; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover::after { opacity: 1; }
.stat-card.highlight {
  border-color: rgba(10, 86, 120, 0.22);
  background: linear-gradient(160deg, #f3f9fc 0%, #ffffff 55%);
}
.stat-label { font-size: 11px; font-weight: 650; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-value.money { color: var(--brand-dark); }

input.money-input {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Pipeline */
.pipeline {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.pipeline-stage {
  flex: 1; min-width: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.pipeline-stage:hover { border-color: var(--brand); transform: translateY(-1px); }
.pipeline-stage.active { border-color: var(--brand); background: var(--brand-light); }
.pipeline-count { font-size: 22px; font-weight: 800; }
.pipeline-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 4px; text-transform: capitalize; }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 100%);
}
.panel-head h2 {
  margin: 0;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-secondary);
}
.panel-head-toggle {
  width: 100%; margin: 0; padding: 18px 22px; text-align: left; cursor: pointer;
  background: transparent; border: none; font: inherit; color: inherit;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background .15s ease;
}
.panel-head-toggle:hover { background: var(--bg-subtle); }
.panel-head-toggle:focus-visible {
  outline: 2px solid var(--brand); outline-offset: -2px;
}
.collapsible:not(.is-open) .panel-head-toggle { border-bottom: none; }
.collapsible .panel-collapse-body { display: none; }
.collapsible.is-open .panel-collapse-body { display: block; }
.collapse-meta {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.collapse-count {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-subtle); padding: 2px 8px; border-radius: 999px;
}
.collapse-chevron {
  width: 8px; height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform .2s ease;
  margin-top: -3px;
}
.collapsible.is-open .collapse-chevron { transform: rotate(-135deg); margin-top: 3px; }
.panel-body { padding: 0; }
.panel-body.padded { padding: 22px; }

/* Lead table */
.lead-table { width: 100%; border-collapse: collapse; }
.lead-table th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.lead-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.lead-table tr { cursor: pointer; transition: background var(--transition); }
.lead-table tbody tr:hover { background: var(--surface-hover); }
.lead-table tr:last-child td { border-bottom: none; }
.lead-name { font-weight: 700; color: var(--text); }
.lead-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Status badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  text-transform: capitalize;
}
.badge-new { background: var(--brand-light); color: var(--brand-dark); }
.badge-contacted { background: #fff4e5; color: #9a6700; }
.badge-qualified { background: #e8f4f0; color: #0f766e; }
.badge-docs_received { background: #ecf8f6; color: #0f766e; }
.badge-in_progress { background: #e8eef8; color: #1e3a5f; }
.badge-submitted { background: #f3efe6; color: #7a5c2e; }
.badge-pre_approved { background: var(--brand-light); color: var(--brand); }
.badge-approved { background: #e6f5f2; color: #0f766e; }
.badge-settled { background: var(--success-bg); color: var(--success); }
.badge-lost { background: var(--danger-bg); color: var(--danger); }
.badge-on_hold { background: var(--bg-subtle); color: var(--text-secondary); }

.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: var(--success); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--brand-gradient); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 6px 16px rgba(8, 47, 71, 0.28);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.14) inset, 0 10px 22px rgba(8, 47, 71, 0.34);
}
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: rgba(10, 86, 120, 0.28); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.next-step-chip.active {
  outline: 2px solid rgba(10, 86, 120, 0.35);
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.field input, .field textarea, .field select, .search-input {
  width: 100%; padding: 10px 14px;
  font-family: var(--font); font-size: 14px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field textarea:focus, .field select:focus, .search-input:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-input { max-width: 320px; }

/* Detail view */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.raw-block {
  font-family: "SF Mono", "Consolas", monospace;
  font-size: 12px; line-height: 1.6;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.section-card-head {
  padding: 10px 14px;
  background: var(--bg-subtle);
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-card-body {
  padding: 14px;
  font-size: 13px;
  white-space: pre-wrap;
  line-height: 1.65;
}

/* Timeline */
.lead-table tr.row-warn td { background: rgba(239, 68, 68, 0.06); }
.lead-table tr.row-warn .lead-name { color: var(--danger); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  display: flex; gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px;
}
.timeline-icon.whatsapp { background: #dcfce7; color: #16a34a; }
.timeline-icon.email { background: #dbeafe; color: #2563eb; }
.timeline-icon.sms { background: #fef3c7; color: #d97706; }
.timeline-icon.phone { background: #e0e7ff; color: #4f46e5; }
.timeline-icon.intake { background: var(--accent-light); color: var(--accent); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.timeline-meta strong { color: var(--text-secondary); }
.timeline-content { font-size: 13px; white-space: pre-wrap; line-height: 1.6; }

/* Import */
.import-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.import-area:focus-within { border-color: var(--brand); }
.import-area textarea {
  width: 100%; min-height: 200px;
  border: none; outline: none; resize: vertical;
  font-family: "SF Mono", Consolas, monospace;
  font-size: 12px; line-height: 1.6;
  background: transparent;
}

.preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.preview-card.duplicate { border-color: var(--warning); background: var(--warning-bg); }
.preview-card.new { border-color: var(--success); background: var(--success-bg); }

/* Report */
.report-header {
  background: var(--brand-gradient);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.report-header h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.report-header p { margin: 0; opacity: 0.85; font-size: 14px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.report-stat { background: rgba(255,255,255,0.15); border-radius: var(--radius); padding: 14px; }
.report-stat-val { font-size: 24px; font-weight: 800; }
.report-stat-label { font-size: 11px; opacity: 0.8; margin-top: 4px; }

.reminder-box {
  background: var(--warning-bg);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.reminder-box.danger { background: var(--danger-bg); border-color: #fecaca; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* Empty state */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state h3 { margin: 0 0 8px; color: var(--text-secondary); font-size: 16px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: #fff;
  padding: 12px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Integration placeholders */
.integration-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.integration-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.integration-card.live {
  border-color: #6ee7b7;
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
}
.integration-card.live .integration-status { color: var(--success); font-weight: 600; }

.ai-panel {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.ai-panel-inner { font-size: 14px; line-height: 1.6; }
.ai-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-tag {
  font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  background: #ede9fe; color: #6d28d9;
}
.ai-draft-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  white-space: pre-wrap;
  font-size: 13px;
  margin: 10px 0;
}
.ai-draft { font-size: 13px; background: rgba(255,255,255,0.6); padding: 10px; border-radius: var(--radius-sm); margin-top: 8px; }

/* Previa-style client detail */
.previa-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .previa-layout { grid-template-columns: 1fr; }
  .previa-rail { order: -1; }
}
.previa-rail {
  min-width: 0;
  max-width: 100%;
}
.previa-rail .panel-body.padded {
  padding: 14px 16px;
}
.previa-rail .form-grid,
.previa-rail .workflow-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}
.previa-rail .form-grid .field,
.previa-rail .workflow-grid .field {
  margin-bottom: 0;
  min-width: 0;
}
.previa-rail .field input,
.previa-rail .field textarea,
.previa-rail .field select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.previa-rail-sticky { position: sticky; top: 88px; max-height: calc(100vh - 100px); overflow-y: auto; }

.rail-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.rail-timeline::before {
  content: "";
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 2px; background: var(--border);
}
.rail-item {
  position: relative;
  padding: 0 0 18px 32px;
  font-size: 12px;
}
.rail-item:last-child { padding-bottom: 0; }
.rail-dot {
  position: absolute; left: 4px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--brand);
}
.rail-item.intake .rail-dot { border-color: #7c3aed; background: #ede9fe; }
.rail-item.action .rail-dot { border-color: var(--danger); background: var(--danger-bg); }
.rail-item.provider .rail-dot { border-color: #059669; background: #ecfdf5; }
.rail-when { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.rail-who { font-weight: 700; color: var(--text); margin: 2px 0; }
.rail-summary { color: var(--text-secondary); line-height: 1.45; }

.import-mode-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.import-mode {
  font-family: var(--font); font-size: 12px; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.import-mode.active { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }

.smart-import-options {
  display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 12px;
  padding: 10px 12px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
}
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.check-row input { accent-color: var(--brand); }

.smart-report-body { max-height: 65vh; overflow-y: auto; }
.smart-outcome-grid { display: grid; gap: 10px; margin-top: 12px; }
.smart-outcome-card {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); display: grid; gap: 4px;
}
.smart-outcome-card.created { border-left: 3px solid var(--success); }
.smart-outcome-card.updated { border-left: 3px solid var(--brand); }
.conversion-quick {
  margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.conversion-quick-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin-bottom: 8px;
}
.weekly-report-hero {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch;
  margin-bottom: 20px; padding: 24px;
  background: linear-gradient(135deg, #0f2744 0%, #1e40af 55%, #0284c7 100%);
  border-radius: var(--radius-lg); color: #fff;
}

/* Premium provider weekly report — matches executive PDF */
.premium-provider-report { max-width: 1200px; margin: 0 auto; }
.weekly-report-cover {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch;
  margin-bottom: 16px; padding: 22px 26px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #0ea5e9; border-radius: 14px;
  box-shadow: 0 4px 24px rgba(15, 39, 68, 0.06);
}
.weekly-cover-brand { flex: 1; min-width: 280px; }
.weekly-cover-logo {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: #0f2744; margin-bottom: 6px;
}
.weekly-cover-title { margin: 0 0 6px; font-size: 1.4rem; font-weight: 800; color: #0f2744; line-height: 1.25; }
.weekly-cover-meta { margin: 0; font-size: 12px; color: #64748b; }
.weekly-cover-stat {
  min-width: 180px; padding: 18px 22px; border-radius: 12px;
  background: linear-gradient(135deg, #0f2744, #1e40af);
  color: #fff; display: flex; flex-direction: column; justify-content: center;
  box-shadow: 0 8px 24px rgba(30, 64, 175, 0.25);
}
.weekly-cover-stat-val { font-size: 1.65rem; font-weight: 800; color: #86efac; line-height: 1.1; }
.weekly-cover-stat-label { font-size: 12px; color: #cbd5e1; margin-top: 6px; }
.weekly-exec-summary {
  margin-bottom: 16px; padding: 14px 18px;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  font-size: 13px; line-height: 1.55; color: #1e3a5f;
}
.weekly-exec-summary p { margin: 0 0 8px; }
.weekly-exec-team { font-size: 12px; color: #64748b; }
.weekly-kpi-matrix { margin-bottom: 20px; }
.premium-kpi-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden;
}
.premium-kpi-table th {
  text-align: left; font-weight: 700; color: #0f2744; padding: 10px 14px;
  background: #f1f5f9; width: 22%;
}
.premium-kpi-table td {
  padding: 10px 14px; color: #334155; font-weight: 600; width: 28%;
  border-top: 1px solid #e2e8f0;
}
.premium-status-panel { margin-bottom: 20px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
.premium-panel-head {
  padding: 12px 18px; background: #0f2744; color: #fff;
}
.premium-panel-head h2 { margin: 0; font-size: 14px; font-weight: 700; color: #fff; }
.premium-status-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--surface);
}
@media (max-width: 900px) {
  .premium-status-split { grid-template-columns: 1fr; }
}
.premium-status-table-wrap { padding: 16px 18px; border-right: 1px solid var(--border); }
.premium-status-chart { padding: 16px; min-height: 240px; position: relative; }
.premium-status-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.premium-status-table th {
  text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 2px solid var(--border);
}
.premium-status-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
}
.status-bar-track {
  height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; min-width: 80px;
}
.status-bar-fill { height: 100%; border-radius: 999px; min-width: 2px; }
.premium-report-section {
  margin-bottom: 20px; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 39, 68, 0.06); border: 1px solid var(--border);
}
.premium-section-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, #f8fafc, #fff);
}
.premium-section-head.report-section-settled { background: linear-gradient(90deg, #ecfdf5, #f0fdf4); border-bottom: 2px solid #22c55e; }
.premium-section-head.report-section-awaiting { background: linear-gradient(90deg, #eff6ff, #f8fafc); border-bottom: 2px solid #0f2744; }
.premium-section-head.report-section-preapproved { background: linear-gradient(90deg, #eff6ff, #dbeafe); border-bottom: 2px solid #3b82f6; }
.premium-section-head.report-section-pipeline { border-bottom: 2px solid #64748b; }
.premium-section-head.report-section-lost { background: #f8fafc; border-bottom: 2px solid #94a3b8; }
.premium-section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.premium-section-title h2 { margin: 0; font-size: 15px; font-weight: 800; color: #0f2744; }
.report-section-settled .premium-section-title h2 { color: #047857; }
.report-section-preapproved .premium-section-title h2 { color: #1d4ed8; }
.premium-section-count {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: #0f2744; color: #fff;
}
.report-section-settled .premium-section-count { background: #059669; }
.report-section-preapproved .premium-section-count { background: #2563eb; }
.premium-section-desc { margin: 0; font-size: 12px; color: var(--text-muted); }
.premium-table-wrap { padding: 0; overflow-x: auto; }
.premium-report-table { margin: 0; font-size: 12px; }
.premium-report-table thead th {
  background: #0f2744; color: #fff; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 12px;
  border: none; white-space: nowrap;
}
.report-section-settled .premium-report-table thead th { background: #059669; }
.report-section-preapproved .premium-report-table thead th { background: #2563eb; }
.premium-report-table tbody tr:nth-child(even) { background: #f8fafc; }
.premium-report-table tbody tr:hover { background: #eff6ff; }
.premium-report-table td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid #e2e8f0; }
.premium-money { font-weight: 700; color: #0f2744; font-variant-numeric: tabular-nums; }
.premium-empty-state {
  padding: 32px; text-align: center; color: var(--text-muted); font-size: 13px;
  background: #fafafa;
}
.premium-report-footer {
  margin-top: 8px; padding: 16px; text-align: center;
  font-size: 11px; color: var(--text-muted); font-style: italic;
  border-top: 1px solid var(--border);
}
.weekly-hero-main { flex: 1; min-width: 260px; }
.weekly-hero-main h2 { margin: 0 0 8px; font-size: 1.35rem; color: #fff; }
.weekly-hero-sub { font-size: 13px; line-height: 1.5; color: #cbd5e1; margin: 0 0 8px; max-width: 720px; }
.weekly-hero-meta { font-size: 12px; color: #94a3b8; margin: 0; }
.weekly-hero-stat {
  min-width: 160px; padding: 16px 20px; border-radius: var(--radius);
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  display: flex; flex-direction: column; justify-content: center;
}
.weekly-hero-val { font-size: 1.75rem; font-weight: 800; color: #86efac; }
.weekly-hero-label { font-size: 12px; color: #e2e8f0; margin-top: 4px; }
.weekly-kpi-grid { margin-bottom: 16px; }
.report-section.settled .settled-head { background: linear-gradient(90deg, #ecfdf5, #f0fdf4); border-bottom: 2px solid #22c55e; }
.report-section.settled .settled-head h2 { color: #047857; }

.workflow-track {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--bg-subtle);
  overflow: hidden;
  max-width: 100%;
}
.workflow-track.workflow-active { border-color: var(--brand); background: var(--surface); }
.workflow-track.workflow-muted { opacity: 0.85; }
.workflow-track-title { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.workflow-grid { gap: 10px; }
.workflow-track .field { margin-bottom: 10px; }
.workflow-track .field:last-child { margin-bottom: 0; }
.workflow-track textarea { resize: vertical; min-height: 56px; }
.workflow-checks { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.workflow-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary); cursor: pointer;
}
.workflow-check input { accent-color: var(--brand); }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.status-cell { min-width: 160px; }
.inline-status-select {
  font-size: 12px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); max-width: 180px;
}
.inline-status-select:hover { border-color: var(--brand); }

.source-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.source-chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer;
}
.source-chip.active { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }
.source-chip .chip-count { opacity: .7; font-weight: 500; margin-left: 4px; }

.health-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.health-card {
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.health-card.green { background: #ecfdf5; border-color: #86efac; }
.health-card.amber { background: #fffbeb; border-color: #fcd34d; }
.health-card.red { background: #fef2f2; border-color: #fca5a5; }
.health-card-val { font-size: 28px; font-weight: 800; }
.health-card-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }

.dashboard-charts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.chart-wrap { height: 220px; position: relative; }
@media (max-width: 900px) { .dashboard-charts { grid-template-columns: 1fr; } .health-summary { grid-template-columns: 1fr; } }

.deal-health-banner {
  margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.deal-health-banner.health-green { background: #ecfdf5; border: 1px solid #86efac; }
.deal-health-banner.health-amber { background: #fffbeb; border: 1px solid #fcd34d; }
.deal-health-banner.health-red { background: #fef2f2; border: 1px solid #fca5a5; }

.profile-intel-banner {
  margin-bottom: 16px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.profile-intel-banner.health-green { border-color: #86efac; background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%); }
.profile-intel-banner.health-amber { border-color: #fcd34d; background: linear-gradient(135deg, #fffbeb 0%, #fefce8 100%); }
.profile-intel-banner.health-red { border-color: #fca5a5; background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%); }
.profile-intel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.profile-intel-stage { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.profile-intel-headline { font-size: 17px; font-weight: 800; line-height: 1.35; margin: 4px 0 0; color: var(--text-primary); }
.profile-intel-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.profile-intel-metrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px;
  margin: 10px 0; padding: 10px 0; border-top: 1px solid rgba(15, 23, 42, 0.08); border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.profile-intel-metric { text-align: center; }
.profile-intel-metric .lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.profile-intel-metric .val { font-size: 14px; font-weight: 700; margin-top: 2px; }
.profile-intel-action { font-size: 13px; line-height: 1.5; margin-top: 8px; }
.profile-intel-action strong { color: var(--text-primary); }
.profile-intel-summary { font-size: 13px; line-height: 1.55; color: var(--text-secondary); margin-top: 8px; }
.profile-intel-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.profile-intel-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.profile-intel-flag { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(59, 130, 246, 0.1); color: #1d4ed8; border: 1px solid rgba(59, 130, 246, 0.2); }
.profile-intel-risk { font-size: 12px; color: #b45309; margin-top: 6px; }

.meta-qualify-panel {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #c7d2fe; background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}
.meta-qualify-panel.is-qualified { border-color: #86efac; background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%); }
.meta-qualify-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.meta-qualify-title { font-size: 13px; font-weight: 700; }
.meta-qualify-checks { display: grid; gap: 8px; margin: 12px 0; }
.meta-qualify-checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; cursor: pointer; }
.meta-qualify-checks input { margin-top: 3px; }

.profile-grid { display: grid; gap: 14px; }
.profile-section {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.profile-section-head {
  padding: 10px 14px; background: var(--bg-subtle); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.profile-section-body { padding: 12px 14px; font-size: 13px; }
.profile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.profile-row label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 2px; }
.profile-row input, .profile-row select, .profile-row textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px;
}
.profile-card {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  background: var(--surface);
}
.profile-card-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.profile-kv { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

.edit-lead-modal { max-width: 720px; width: 96%; max-height: 92vh; display: flex; flex-direction: column; }
.edit-lead-body { overflow-y: auto; max-height: calc(92vh - 140px); }
.edit-section { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.edit-section:last-child { border-bottom: none; margin-bottom: 0; }
.edit-section.highlight { background: rgba(59, 130, 246, 0.06); border: 1px solid rgba(59, 130, 246, 0.15); border-radius: 12px; padding: 14px 16px; }
.edit-section-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }
.modal-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); font-weight: 400; }
.smart-notes-modal { max-width: 900px; width: 96%; max-height: 94vh; display: flex; flex-direction: column; }
.smart-notes-modal .modal-body { overflow-y: auto; }
.smart-notes-step { margin-bottom: 16px; }
.smart-notes-step-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 750; margin-bottom: 10px; }
.smart-notes-step-label > span {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px;
}
.smart-notes-template-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.smart-notes-template-row select { min-width: 210px; }
.smart-notes-target {
  display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.3fr);
  gap: 6px 12px; align-items: center; margin-bottom: 10px; padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, .35); border-radius: 10px; background: rgba(245, 158, 11, .06);
}
.smart-notes-target label { font-size: 12px; font-weight: 800; color: var(--text); }
.smart-notes-target select { width: 100%; }
.smart-notes-target small { grid-column: 1 / -1; color: var(--text-muted); line-height: 1.4; }
.smart-notes-voice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 9px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-subtle);
}
.smart-notes-voice-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.smart-notes-voice-status { flex: 1; min-width: 240px; font-size: 11px; color: var(--text-muted); line-height: 1.45; }
.smart-notes-voice.is-listening {
  border-color: rgba(220, 38, 38, .4);
  background: rgba(220, 38, 38, .05);
}
.smart-notes-voice.is-listening .smart-notes-voice-status { color: var(--danger); font-weight: 700; }
.smart-notes-voice.is-paused {
  border-color: rgba(245, 158, 11, .4);
  background: rgba(245, 158, 11, .06);
}
.smart-notes-voice.is-unsupported { opacity: .8; }
.smart-notes-help { margin-top: 7px; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.smart-notes-preview { border-top: 1px solid var(--border); padding-top: 16px; }
.smart-notes-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.smart-notes-select-actions { display: flex; gap: 6px; }
.smart-notes-warning {
  padding: 9px 11px; margin-bottom: 8px; border-radius: 8px; font-size: 12px;
  background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .3);
}
.smart-notes-ledger-note {
  padding: 9px 11px; margin-bottom: 12px; border-radius: 8px; font-size: 12px;
  background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-secondary);
}
.smart-notes-missing {
  margin: 8px 0; padding: 10px 12px; border: 1px dashed rgba(37, 99, 235, .35);
  border-radius: 9px; background: rgba(37, 99, 235, .04); color: var(--text-muted); font-size: 11px;
}
.smart-notes-missing strong { color: var(--text); }
.smart-notes-section-title { margin: 15px 0 7px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.smart-note-change {
  display: grid; grid-template-columns: 28px minmax(130px, .8fr) minmax(150px, 1fr) 24px minmax(150px, 1fr);
  align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px;
  margin-bottom: 7px; background: var(--surface);
}
.smart-note-change:has(input:checked) { border-color: rgba(37,99,235,.45); background: rgba(37,99,235,.04); }
.smart-note-change .change-label { font-size: 12px; font-weight: 700; }
.smart-note-change .change-value { min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.smart-note-change .change-old { color: var(--text-muted); text-decoration: line-through; }
.smart-note-change .change-new { color: var(--text-primary); font-weight: 650; }
.smart-note-proposed-input {
  width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid rgba(22, 163, 74, .35);
  border-radius: 7px; background: rgba(22, 163, 74, .04); color: var(--text); font-weight: 700;
}
.smart-note-proposed-input:focus {
  border-color: var(--success); box-shadow: 0 0 0 3px rgba(22, 163, 74, .1); outline: none;
}
.smart-note-proposed-input.is-edited { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .6); }
.smart-note-change .change-arrow { color: var(--text-muted); text-align: center; }
.smart-note-change .change-source { grid-column: 2 / -1; font-size: 10px; color: var(--text-muted); line-height: 1.35; }
.smart-note-change.new .change-old { text-decoration: none; }
.smart-notes-unchanged { margin-top: 12px; padding: 9px 11px; border-radius: 8px; background: var(--bg-subtle); font-size: 11px; color: var(--text-muted); }
.branded-email-modal { max-width: 1180px; width: min(1180px, calc(100vw - 30px)); }
.email-test-banner {
  margin-bottom: 12px; padding: 10px 12px; border: 1px solid rgba(245, 158, 11, .45);
  border-radius: 9px; background: rgba(245, 158, 11, .08); color: var(--text); font-size: 12px;
}
.branded-email-grid { display: grid; grid-template-columns: minmax(430px, .9fr) minmax(430px, 1.1fr); gap: 20px; }
.branded-email-editor, .branded-email-preview { min-width: 0; }
.email-template-row { display: flex; gap: 8px; }
.email-template-row select { flex: 1; }
.email-guided-fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; padding: 12px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg-subtle);
}
.email-guided-fields:empty { display: none; }
.email-guided-fields .span-2 { grid-column: 1 / -1; }
.email-history-panel { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; }
.email-history-panel summary { cursor: pointer; font-weight: 700; }
.email-compose-options { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.email-preview-frame {
  width: 100%; height: 360px; border: 1px solid var(--border); border-radius: 9px;
  background: #fff; margin: 8px 0 14px;
}
.email-mobile-wrap { max-width: 390px; margin: 0 auto; }
.email-preview-frame.mobile { height: 300px; }
@media (max-width: 940px) {
  .branded-email-grid { grid-template-columns: 1fr; }
  .branded-email-preview { border-top: 1px solid var(--border); padding-top: 14px; }
}
@media (max-width: 700px) {
  .smart-note-change { grid-template-columns: 26px 1fr; }
  .smart-note-change .change-label, .smart-note-change .change-value, .smart-note-change .change-source { grid-column: 2; }
  .smart-note-change .change-arrow { display: none; }
}
.ml-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ml-feature-card { background: var(--surface-2, var(--bg-subtle)); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.ml-feature-card .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ml-feature-card .value { font-size: 16px; font-weight: 700; margin-top: 4px; }
.ml-feature-card .value.small { font-size: 13px; font-weight: 600; }
.prop-type-select { width: 100%; margin-bottom: 8px; }
.emp-type-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border); margin-left: 6px; }

.health-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.health-dot.green { background: #22c55e; }
.health-dot.amber { background: #f59e0b; }
.health-dot.red { background: #ef4444; }

.falling-behind-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.falling-behind-table th, .falling-behind-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.falling-behind-table tr { cursor: pointer; }
.falling-behind-table tr:hover { background: var(--bg-subtle); }

.smart-portfolio-block {
  padding: 14px; border-radius: 10px; background: var(--brand-light); border: 1px solid rgba(37,99,235,.2);
  margin-bottom: 16px;
}
}


.integration-icon { font-size: 24px; margin-bottom: 8px; }
.integration-label { font-size: 13px; font-weight: 700; }
.integration-status { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .lender-matrix { grid-template-columns: 1fr; }
}

/* Expert dashboard */
.view-header-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.view-toggle {
  display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; box-shadow: var(--shadow-sm);
}
.view-toggle-btn {
  font-family: var(--font); font-size: 12px; font-weight: 700;
  padding: 8px 16px; border: none; background: transparent;
  border-radius: 999px; cursor: pointer; color: var(--text-secondary);
  transition: var(--transition);
}
.view-toggle-btn.active {
  background: var(--brand-gradient); color: #fff;
  box-shadow: var(--glow);
}

.expert-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  flex-wrap: wrap; margin-bottom: 20px;
  padding: 24px 28px; border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0f2744 0%, #1e3a5f 100%);
  color: #f1f5f9; box-shadow: var(--shadow-lg);
}
.expert-hero h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.expert-hero p { margin: 0; font-size: 14px; opacity: 0.85; max-width: 520px; }
.expert-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.expert-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px;
}
@media (max-width: 768px) { .expert-stats { grid-template-columns: 1fr 1fr; } }
.expert-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.expert-stat-card.highlight { border-color: #7dd3fc; background: linear-gradient(135deg, #f0f9ff, #fff); }
.expert-stat-val { font-size: 28px; font-weight: 800; color: var(--brand); }
.expert-stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.expert-panel { border: 1px solid #bae6fd; box-shadow: var(--shadow); }
.panel-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 999px; background: var(--brand-light); color: var(--brand);
}

.lender-matrix {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
  padding: 16px;
}
.lender-matrix-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; cursor: pointer;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.lender-matrix-card:hover {
  border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow);
}
.lmc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lmc-name { font-weight: 700; font-size: 14.5px; letter-spacing: -0.02em; font-family: var(--font); }
.lmc-type { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.lmc-lender { font-size: 18px; font-weight: 750; color: var(--brand-dark); margin: 12px 0 4px; letter-spacing: -0.02em; }
.lmc-rate { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.lmc-summary { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 10px 0; min-height: 36px; }
.lmc-foot { display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }

.fit-badge {
  font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-subtle); color: var(--text-secondary);
}
.fit-badge.fit-high { background: #dcfce7; color: #166534; }
.fit-badge.fit-mid { background: #fef9c3; color: #854d0e; }
.fit-badge.fit-low { background: #fee2e2; color: #991b1b; }

.btn-glow {
  background: var(--brand-gradient); color: #fff; border: none;
  box-shadow: var(--glow); font-weight: 700;
}
.btn-glow:hover { filter: brightness(1.05); }

.lender-panel {
  border: 1px solid #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 40%);
  margin-bottom: 16px;
}
.lender-exec { font-size: 14px; line-height: 1.65; margin: 0 0 14px; color: var(--text); }
.best-lender-pill {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  background: var(--brand-gradient); color: #fff; font-size: 13px; margin-bottom: 16px;
}
.lender-rec-list { display: flex; flex-direction: column; gap: 12px; }
.lender-rec-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.lender-rec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lender-rank { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.lender-rec-meta { font-size: 12px; color: var(--text-secondary); margin: 6px 0; }
.lender-reasons { margin: 8px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-secondary); }
.lender-next { font-size: 12px; font-weight: 600; color: var(--brand); margin-top: 8px; }
.muted-text { font-size: 13px; color: var(--text-muted); margin: 0; }
.lender-mini { color: var(--brand); font-weight: 700; }

.ai-insight-panel { border: 1px solid rgba(10, 86, 120, 0.2); background: linear-gradient(180deg, #f3f9fc 0%, #fff 70%); }
.status-ok { color: var(--success); font-weight: 600; }
.status-warn { color: var(--warning); font-weight: 600; }
.status-muted { color: var(--text-muted); }

.gmail-connect-panel {
  padding: 18px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f8fafc, #f0f9ff);
  border: 1px solid var(--border);
}

.content { max-width: 1400px; }

.health-summary.clickable-health-row .health-card.clickable-health {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
}
.health-summary.clickable-health-row .health-card.clickable-health:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.12);
}
.health-summary.clickable-health-row .health-card.clickable-health.active {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.ceo-command-center { border: 1px solid #c4b5fd; background: linear-gradient(180deg, #faf5ff 0%, #fff 120px); }
.ceo-lead-command { border: 1px solid #93c5fd; background: linear-gradient(180deg, #eff6ff 0%, #fff 100px); }
.leads-toolbar { flex-wrap: wrap; gap: 8px; }
.lead-priority-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lead-priority-pill.tier-call_now { background: #fef2f2; color: #b91c1c; }
.lead-priority-pill.tier-call_today { background: #fff7ed; color: #c2410c; }
.lead-priority-pill.tier-nurture { background: #eff6ff; color: #1d4ed8; }
.lead-priority-pill.tier-monitor { background: #f1f5f9; color: #64748b; }
.lead-mgmt-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.lead-mgmt-kpi .stat-card { padding: 10px 12px; }
.lead-mgmt-kpi .stat-value { font-size: 20px; }
.lead-kpi-btn {
  text-align: left; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); border-radius: 10px; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.lead-kpi-btn:hover { border-color: var(--brand, #2563eb); box-shadow: 0 1px 4px rgba(15,23,42,.08); transform: translateY(-1px); }
.lead-call-reason { font-size: 11px; color: var(--text-muted); max-width: 240px; }
.leads-ai-brief { font-size: 13px; line-height: 1.55; color: var(--text); margin-top: 10px; }
.leads-ai-brief ul { margin: 8px 0; padding-left: 18px; }
.lead-aging-strip, .lead-source-strip {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px;
}
.lead-chip {
  border: 1px solid var(--border); background: var(--surface-alt, #f8fafc);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text);
}
.lead-chip strong { margin-left: 4px; }
.lead-chip.active, .lead-chip:hover { border-color: var(--brand, #2563eb); background: var(--accent-bg, #eff6ff); }
.lead-must-call { margin-top: 14px; }
.lead-must-call-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.lead-must-call-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px;
}
.lead-must-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer;
  background: var(--surface);
}
.lead-must-card:hover { border-color: var(--brand, #2563eb); background: var(--surface-hover); }
.lead-must-rank {
  font-size: 11px; font-weight: 800; color: var(--brand, #2563eb);
  background: var(--accent-bg, #eff6ff); border-radius: 6px; padding: 4px 6px;
}
.lead-must-meta { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.lead-must-actions { display: flex; flex-direction: column; gap: 4px; }
.leads-page-controls { display: flex; align-items: center; gap: 8px; }
.lead-tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.lead-tag-chip {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-alt, #f1f5f9); color: var(--text-secondary); border: 1px solid var(--border);
}
.leads-error-banner, .leads-error-state {
  background: var(--danger-bg); border: 1px solid #fecaca; border-radius: 10px; padding: 14px;
}
.leads-error-banner p, .leads-error-state p { margin: 6px 0 10px; font-size: 13px; }
.dialer-next-flash {
  outline: 2px solid var(--brand, #1a2b4a);
  outline-offset: 2px;
  animation: dialerFlash 1.6s ease;
}
@keyframes dialerFlash {
  0% { background: #fef9c3; }
  100% { background: transparent; }
}
.lead-signal-chip {
  font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 700;
  border: 1px solid var(--border);
}
.lead-signal-chip.rate { background: #fff7ed; color: #c2410c; }
.lead-signal-chip.tenure { background: #eff6ff; color: #1d4ed8; }
.lead-signal-chip.eligible { background: #ecfdf5; color: #047857; }
.lead-signal-chip.ready { background: #fef3c7; color: #b45309; }
.crm-analyst-chat {
  max-height: 280px; overflow: auto; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface-alt, #f8fafc);
}
.crm-analyst-compose { display: flex; gap: 8px; margin-bottom: 8px; }
.crm-analyst-compose .search-input { flex: 1; }
.crm-analyst-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-msg { margin-bottom: 10px; font-size: 13px; line-height: 1.45; }
.crm-msg.user { color: var(--text-secondary); }
.crm-msg.bot { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }

.ceo-delta-banner { margin-bottom: 14px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.ceo-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ceo-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; text-align: center; }
.ceo-kpi strong { display: block; font-size: 22px; margin-top: 4px; }
.ceo-kpi span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ceo-kpi.warn { border-color: #fca5a5; background: #fef2f2; }
.ceo-kpi.good { border-color: #86efac; background: #f0fdf4; }
.ceo-charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ceo-chart-panel { margin: 0; }
.ceo-chart-panel .chart-wrap { height: 200px; }
.ceo-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .ceo-section-grid { grid-template-columns: 1fr; } }
.ceo-must-item { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ceo-must-item:last-child { border-bottom: none; }
.ceo-must-item .ceo-must-title { font-weight: 700; margin-bottom: 4px; }
.ceo-must-item .ceo-must-meta { font-size: 12px; color: var(--text-secondary); }
.ceo-must-item.critical { border-left: 3px solid #ef4444; }
.ceo-must-item.high { border-left: 3px solid #f59e0b; }
.ceo-report-text { white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.55; max-height: 420px; overflow: auto; background: #f8fafc; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); margin: 0; }
.ceo-ai-section { margin-bottom: 16px; }
.ceo-ai-section h3 { font-size: 14px; margin: 0 0 8px; color: var(--brand); }
.ceo-ai-section p, .ceo-ai-section li { font-size: 13px; line-height: 1.6; color: var(--text); }
.ceo-ai-section ul { margin: 0; padding-left: 18px; }
.ceo-history-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ceo-junk-item { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }

/* Nurture IQ — professional analytics dashboard */
.nurture-iq-report { max-width: 1280px; margin: 0 auto; }
.nurture-hero {
  margin-bottom: 16px; padding: 22px 26px; border-radius: 14px;
  background: linear-gradient(135deg, #0f2744 0%, #1e3a8a 50%, #2563eb 100%);
  color: #fff; box-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
}
.nurture-hero.off { background: linear-gradient(135deg, #334155, #475569); }
.nurture-hero-status { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.9; margin-bottom: 6px; }
.nurture-hero-title { margin: 0 0 6px; font-size: 1.35rem; font-weight: 800; }
.nurture-hero-meta { margin: 0 0 16px; font-size: 12px; opacity: 0.85; }
.nurture-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.nurture-kpi {
  padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
}
.nurture-kpi.warn { background: rgba(239, 68, 68, 0.25); border-color: rgba(252, 165, 165, 0.4); }
.nurture-kpi-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.8; margin-bottom: 4px; }
.nurture-kpi-val { font-size: 1.25rem; font-weight: 800; display: block; }
.nurture-kpi-sub { font-size: 10px; opacity: 0.75; display: block; margin-top: 2px; }
.nurture-charts-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px;
}
.nurture-chart-panel.wide { grid-column: span 2; }
@media (max-width: 900px) { .nurture-charts-grid { grid-template-columns: 1fr; } .nurture-chart-panel.wide { grid-column: span 1; } }
.nurture-chart-wrap { height: 220px; position: relative; }
.nurture-chart-wrap.tall { height: 280px; }
.nurture-ai-panel { margin-bottom: 16px; border: 1px solid #c7d2fe; background: linear-gradient(180deg, #f5f3ff, #fff); }
.nurture-ai-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.nurture-timeline-track {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.nurture-timeline-item {
  flex: 0 0 220px; scroll-snap-align: start; cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: #fff; transition: box-shadow 0.15s, border-color 0.15s;
}
.nurture-timeline-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #93c5fd; }
.nurture-timeline-item.warn { border-color: #fca5a5; background: #fff7f7; }
.nurture-timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-bottom: 8px; }
.nurture-timeline-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.nurture-timeline-meta { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; line-height: 1.4; }
.nurture-timeline-stage { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.nurture-progress-bar { background: var(--border); border-radius: 4px; height: 8px; width: 80px; display: inline-block; vertical-align: middle; }
.nurture-progress-fill { background: var(--accent); height: 8px; border-radius: 4px; }
.nurture-progress-label { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.nurture-leads-table th:first-child { min-width: 130px; }
.report-sort-bar select { min-width: 160px; }

/* Book & financial hub */
.book-hero {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  padding: 24px 28px; margin-bottom: 20px; border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0f2744 0%, #1e3a5f 40%, #0c4a6e 100%);
  color: #f8fafc; box-shadow: var(--shadow-lg);
}
.book-hero h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.book-hero p { margin: 0; font-size: 13px; opacity: 0.85; max-width: 520px; }
.book-hero .btn-ghost { color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.25); }
.book-hero .btn-ghost:hover { background: rgba(255,255,255,0.1); }
.book-hero .btn-secondary { background: rgba(255,255,255,0.15); border-color: transparent; color: #fff; }
.book-watch-line { font-size: 12px; color: var(--text-muted); margin: -8px 0 14px; }
.book-alert {
  padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px;
  background: var(--warning-bg); border: 1px solid #fcd34d; color: #92400e;
}
.book-alert.danger { background: var(--danger-bg); border-color: #fecaca; color: #991b1b; }
.book-health-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px;
}
.book-metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.book-metric::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--brand-gradient);
}
.book-metric.accent::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.book-metric.success::before { background: linear-gradient(90deg, #059669, #34d399); }
.book-metric.warn::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.book-metric.danger::before { background: linear-gradient(90deg, #dc2626, #f87171); }
.book-metric-val { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.book-metric-val.money { color: var(--brand-dark); }
.book-metric-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 4px; }
.book-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .book-section-grid { grid-template-columns: 1fr; } }
.book-panel-accent { border-color: #bae6fd; box-shadow: 0 4px 20px rgba(14,165,233,0.08); }
.book-chart-wrap { height: 240px; }
.invoice-row-imported { color: var(--success); font-size: 11px; font-weight: 600; }
.invoice-row-skipped { color: var(--text-muted); font-size: 11px; }

.finance-period-hero {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
}
.finance-hero-stat {
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px;
}
.finance-hero-stat strong { display: block; font-size: 18px; font-weight: 800; color: var(--brand-dark); }
.finance-hero-stat span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.finance-hero-stat .delta { font-size: 11px; font-weight: 700; margin-top: 4px; }
.finance-hero-stat .delta.up { color: var(--success); }
.finance-hero-stat .delta.down { color: var(--danger); }
.finance-hero-stat .delta.flat { color: var(--text-muted); }

.finance-insights-board { display: flex; flex-wrap: wrap; gap: 8px; }
.finance-insight-chip {
  flex: 1 1 220px; max-width: 100%; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); font-size: 12px; line-height: 1.45;
}
.finance-insight-chip.positive { border-left: 3px solid var(--success); }
.finance-insight-chip.negative { border-left: 3px solid var(--danger); }
.finance-insight-chip.warn { border-left: 3px solid var(--warning); }
.finance-insight-chip.neutral { border-left: 3px solid var(--brand); }
.finance-insight-chip strong { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; color: var(--brand); }

.book-metric-delta { font-size: 10px; font-weight: 700; margin-top: 3px; }
.book-metric-delta.up { color: var(--success); }
.book-metric-delta.down { color: var(--danger); }

/* Client cards */
.client-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.client-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px;
}
.client-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; cursor: pointer; transition: box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.client-card:hover { box-shadow: var(--shadow); border-color: #93c5fd; transform: translateY(-1px); }
.client-card.high-attention { border-left: 4px solid var(--danger); }
.client-card.high-value { border-left: 4px solid var(--gold); }
.client-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.client-card-name { font-weight: 800; font-size: 15px; letter-spacing: -0.02em; }
.client-card-commission { font-weight: 800; font-size: 14px; color: var(--brand-dark); white-space: nowrap; }
.client-card-lenders { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; }
.client-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.client-chip {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--bg-subtle); color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em;
}
.client-chip.risk-high { background: var(--danger-bg); color: var(--danger); }
.client-chip.risk-medium { background: var(--warning-bg); color: var(--warning); }
.client-chip.risk-low { background: var(--success-bg); color: var(--success); }
.client-chip.missing { background: #fef3c7; color: #92400e; }
.client-card-reasons { font-size: 11px; color: var(--text-muted); line-height: 1.45; }
.client-card-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* Post-settlement command centre */
.ps-hero-kpi {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px;
}
@media (max-width: 1000px) { .ps-hero-kpi { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ps-hero-kpi { grid-template-columns: 1fr; } }
.ps-hero-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition), transform 0.15s;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.ps-hero-card:hover { border-color: #93c5fd; box-shadow: var(--shadow); transform: translateY(-1px); }
.ps-hero-card.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15); }
.ps-hero-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.ps-hero-card.tone-danger::before { background: linear-gradient(90deg, #dc2626, #f87171); }
.ps-hero-card.tone-warn::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.ps-hero-card.tone-accent::before { background: linear-gradient(90deg, var(--brand), var(--gold)); }
.ps-hero-card.tone-brand::before { background: var(--brand-gradient); }
.ps-hero-val { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.ps-hero-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-top: 6px; }
.ps-hero-sub { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.ps-kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px;
}
.ps-kpi-chip {
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; text-align: center;
}
.ps-kpi-chip strong { display: block; font-size: 18px; font-weight: 800; color: var(--brand-dark); }
.ps-kpi-chip span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.ps-must-do-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ps-must-do-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  background: var(--surface); transition: border-color var(--transition), background var(--transition);
}
.ps-must-do-card:hover { border-color: var(--brand); background: var(--accent-bg); }
.ps-must-do-card.overdue { border-left: 4px solid var(--danger); }
.ps-must-do-card.today { border-left: 4px solid var(--warning); }
.ps-must-do-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.ps-must-do-meta { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.ps-queue-toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.ps-queue-toolbar-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ps-review-table tr.ps-row-overdue td { background: rgba(239, 68, 68, 0.06); }
.ps-review-table tr.ps-row-today td { background: rgba(245, 158, 11, 0.06); }
.ps-priority-pill {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}
.ps-priority-pill.overdue { background: var(--danger-bg); color: var(--danger); }
.ps-priority-pill.today { background: var(--warning-bg); color: var(--warning); }
.ps-priority-pill.this_week { background: var(--brand-light); color: var(--brand-dark); }
.ps-priority-pill.upcoming { background: var(--bg-subtle); color: var(--text-muted); }
.ps-milestone-bar { margin-bottom: 10px; }
.ps-milestone-bar-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.ps-milestone-bar-track { height: 8px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; display: flex; }
.ps-milestone-bar-overdue { background: var(--danger); }
.ps-milestone-bar-upcoming { background: #93c5fd; }
.ps-clickable {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s, border-color 0.15s;
}
.ps-clickable:hover { background: var(--accent-bg); }
.ps-clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ps-clickable-stat {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.ps-clickable-stat:hover { color: var(--brand); text-decoration-color: var(--brand); }
.ps-kpi-chip.ps-clickable:hover { border-color: var(--brand); background: var(--accent-bg); }
.ps-drilldown-body { max-height: 58vh; overflow: auto; }
.ps-drilldown-modal .data-table td { vertical-align: middle; }

/* ═══════════════════════════════════════════════════════════
   PREMIUM POLISH LAYER — private-banking broker CRM finish
   ═══════════════════════════════════════════════════════════ */

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.02em;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  white-space: nowrap;
}
.status-chip.warn { background: var(--warning-bg); border-color: #f5d0a0; color: var(--warning); }
.status-chip.neutral { background: rgba(255,255,255,0.06); }

.pipeline-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.pipeline-group-card:hover {
  border-color: rgba(10, 86, 120, 0.22);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.pipeline-group-card h4 {
  margin: 0 0 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pipeline-group-card .pg-count {
  font-family: var(--font-display);
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--brand-dark);
}

.pipeline-stage {
  border-radius: var(--radius);
  padding: 14px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.pipeline-stage:hover {
  border-color: rgba(10, 86, 120, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.pipeline-stage.active {
  border-color: var(--brand);
  background: linear-gradient(180deg, var(--brand-light), #fff);
  box-shadow: 0 0 0 1px rgba(10, 86, 120, 0.12), var(--shadow-sm);
}
.pipeline-count {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600;
  color: var(--text);
}

.lead-table th {
  background: linear-gradient(180deg, #f7f9fc, #f1f4f8);
  font-size: 10.5px; letter-spacing: 0.07em;
  padding: 13px 18px;
}
.lead-table td { padding: 15px 18px; }
.lead-table tbody tr:hover { background: rgba(10, 86, 120, 0.035); }
.lead-name { font-weight: 650; letter-spacing: -0.015em; }

.badge {
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.modal-backdrop {
  background: rgba(6, 14, 26, 0.55);
  backdrop-filter: blur(8px);
}
.modal-head h3 {
  font-family: var(--font-display);
  font-weight: 600; font-size: 18px;
  letter-spacing: -0.02em;
}

.expert-hero {
  background:
    radial-gradient(600px 200px at 90% 0%, rgba(184, 149, 108, 0.18), transparent 50%),
    linear-gradient(145deg, #050d18 0%, #0c1c32 55%, #0a2a40 100%);
  border: 1px solid rgba(184, 149, 108, 0.22);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.expert-hero h2 {
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: -0.02em;
}
.expert-stat-val {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brand-dark);
}

.view-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.view-toggle-btn.active {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 47, 71, 0.25);
}

.btn-glow {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, var(--glow);
  font-weight: 650;
}
.btn-glow:hover { filter: brightness(1.06); transform: translateY(-1px); }

.report-header {
  background:
    radial-gradient(500px 180px at 100% 0%, rgba(184, 149, 108, 0.25), transparent 55%),
    var(--brand-gradient);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow-lg);
}
.report-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

.hunt-candidate {
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin: 4px 8px;
  transition: background var(--transition), border-color var(--transition);
}
.hunt-candidate:hover { background: var(--surface-hover); border-color: var(--border); }
.hunt-candidate.active {
  background: linear-gradient(90deg, var(--brand-light), #fff);
  border-color: rgba(10, 86, 120, 0.25);
  box-shadow: inset 3px 0 0 var(--gold);
}
.hunt-confidence {
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  background: var(--bg-subtle); color: var(--text-secondary);
}
.hunt-msg-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--surface-hover);
}

.mailbox-picker-panel,
#view-lead-hunt .panel {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.timeline-icon.phone { background: var(--brand-light); color: var(--brand-dark); }
.timeline-icon.intake { background: var(--accent-light); color: var(--accent); }

.nav-dropdown-menu {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  backdrop-filter: blur(8px);
}
.nav-dropdown-item {
  border-radius: 7px;
  font-weight: 550;
}
.nav-dropdown-item:hover {
  background: var(--brand-light);
  color: var(--brand-dark);
}
.nav-dropdown.open .nav-dropdown-btn {
  color: var(--brand-dark);
  border-bottom-color: var(--gold);
}

.toast, .toast-stack .toast {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  font-family: var(--font);
}

/* Dense tables feel premium when quiet */
.data-table th, .falling-behind-table th {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #f5f7fa;
}

.client-card:hover { border-color: rgba(10, 86, 120, 0.28); }
.ps-hero-card:hover { border-color: rgba(10, 86, 120, 0.28); }
.ps-hero-val {
  font-family: var(--font-display);
  font-weight: 600;
}

.gmail-connect-panel {
  background: linear-gradient(145deg, #f8fafc, var(--brand-light));
  border: 1px solid rgba(10, 86, 120, 0.15);
}

.lender-panel {
  border: 1px solid rgba(10, 86, 120, 0.18);
  background: linear-gradient(180deg, #f3f9fc 0%, #fff 42%);
}

.panel-tag {
  background: var(--gold-soft);
  color: #7a5c2e;
  border: 1px solid rgba(184, 149, 108, 0.28);
}

.best-lender-pill {
  background: var(--brand-gradient);
  box-shadow: 0 4px 14px rgba(8, 47, 71, 0.22);
}

/* Selection + focus polish */
::selection { background: rgba(10, 86, 120, 0.18); color: var(--text); }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) { outline: none; }

/* Scrollbar — restrained */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(12, 22, 40, 0.25) transparent;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Command-centre density: slightly tighter nav actions on laptop */
@media (max-width: 1100px) {
  .nav-inner { padding: 10px 16px; }
  .content { padding: 24px 16px 80px; }
  .view-header h1 { font-size: 26px; }
}

/* Round-2 premium density & empty-state finish */
.panel {
  box-shadow: 0 1px 1px rgba(8,18,36,0.02), 0 12px 32px rgba(8,18,36,0.055);
  border-color: rgba(12, 22, 40, 0.08);
}
.panel-head {
  position: relative;
  padding: 14px 20px 14px 22px;
  background: linear-gradient(180deg, #fcfdff 0%, #f7f9fc 100%);
}
.panel-head::before {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--gold), var(--brand));
  opacity: 0.85;
}
.panel-body.padded { padding: 18px 20px; }
.panel-body:empty::after,
.panel .muted-text:only-child {
  display: block;
}

.stat-card {
  min-height: 108px;
  box-shadow: 0 1px 1px rgba(8,18,36,0.02), 0 8px 20px rgba(8,18,36,0.04);
}
.stat-card::after { opacity: 0.55; }
.stat-value {
  font-family: var(--font);
  font-weight: 750;
  font-size: 30px;
}

.nav-title {
  font-family: var(--font);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
}
.nav-logo-img { border-radius: 9px; }

.tab-bar {
  background: rgba(255,255,255,0.9);
}
.tab-btn {
  font-size: 12px;
  font-weight: 650;
  padding: 12px 12px;
}
.tab-btn.active {
  color: var(--brand-dark);
  border-bottom-color: var(--gold);
  font-weight: 700;
}

.content { padding-top: 26px; }

.export-bar .btn,
.view-header-actions .btn {
  min-height: 34px;
}

.btn-primary, .btn-glow {
  letter-spacing: 0.015em;
}

/* Soften emoji noise in remaining UI chrome */
.panel-head h2 {
  font-variant-emoji: text;
}

/* Lead hunt period strip — quieter, more intentional */
#view-lead-hunt .panel strong {
  font-weight: 700;
}
#view-lead-hunt input[type="date"],
#view-lead-hunt input[type="number"],
#view-lead-hunt select {
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  min-height: 38px;
  font-family: var(--font);
}

/* Collapsible section bars */
.panel-head-toggle {
  padding-left: 22px;
}
