/* ================================================================
   ABFRL / Louis Philippe — Campaign Intelligence Engine
   Theme: DARK — Deep Navy with Crimson (#8B1A2F) + Gold (#C4A862)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  /* ── Brand Palette ── */
  --abg-red:        #8B1A2F;
  --abg-red-dark:   #6B1222;
  --abg-red-light:  #C4425A;
  --abg-gold:       #C4A862;
  --abg-gold-light: #E0C880;

  /* ── Dark Surfaces ── */
  --abg-bg:         #07080f;
  --abg-bg2:        #0d0f1a;
  --abg-surface:    #111420;
  --abg-surface2:   #161928;
  --abg-border:     rgba(255,255,255,0.07);
  --abg-border2:    rgba(255,255,255,0.13);

  /* ── Text ── */
  --abg-text:       #E8EAF0;
  --abg-text2:      #9BA5B8;
  --abg-text3:      #5A6478;
  --abg-heading:    #F0F2F8;

  /* ── Semantic ── */
  --abg-success:    #22C55E;
  --abg-warning:    #F59E0B;
  --abg-info:       #60A5FA;
  --abg-purple:     #A78BFA;
  --abg-yellow:     #FBBF24;
  --abg-blue:       #60A5FA;
  --abg-orange:     #C4A862;

  /* ── Alias (used in JS inline styles) ── */
  --abg-dark:       var(--abg-bg);
  --abg-darker:     var(--abg-bg2);
  --abg-card:       var(--abg-surface);
  --abg-card2:      var(--abg-surface2);
  --tvs-red:        var(--abg-red);
  --tvs-red-dark:   var(--abg-red-dark);
  --tvs-red-light:  var(--abg-red-light);
  --tvs-dark:       var(--abg-bg);
  --tvs-darker:     var(--abg-bg2);
  --tvs-card:       var(--abg-surface);
  --tvs-card2:      var(--abg-surface2);
  --tvs-border:     var(--abg-border);
  --tvs-border2:    var(--abg-border2);
  --tvs-text:       var(--abg-text);
  --tvs-text1:      var(--abg-text);
  --tvs-text2:      var(--abg-text2);
  --tvs-text3:      var(--abg-text3);
  --tvs-success:    var(--abg-success);
  --tvs-orange:     var(--abg-orange);
  --tvs-blue:       var(--abg-blue);
  --tvs-yellow:     var(--abg-yellow);
  --tvs-purple:     var(--abg-purple);

  /* ── Layout ── */
  --nav-height:     64px;
  --progress-height:56px;
  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      14px;
  --shadow:         0 2px 16px rgba(0,0,0,0.5);
  --shadow-md:      0 4px 28px rgba(0,0,0,0.6);
  --shadow-lg:      0 8px 48px rgba(0,0,0,0.7);
  --transition:     all 0.18s ease;
}

/* ─── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--abg-bg);
  color: var(--abg-text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--abg-red-light); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--abg-gold); }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--abg-bg2); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--abg-red-light); }

/* ─── BACKGROUND ─── */
.bg-grid { display: none; }
.bg-glow, .bg-glow-1, .bg-glow-2 { display: none; }

/* ─── NAV ──────────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-height);
  background: rgba(7,8,15,0.96);
  border-bottom: 1px solid rgba(139,26,47,0.35);
  display: flex; align-items: center; gap: 0; padding: 0 24px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
}
.nav-logo {
  display: flex; align-items: center; gap: 12px; min-width: 300px; flex-shrink: 0;
}
.nav-logo-badge {
  width: 40px; height: 40px; background: var(--abg-red);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 10px; letter-spacing: 0.5px; color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0; box-shadow: 0 0 16px rgba(139,26,47,0.5);
}
.nav-title {
  font-size: 13px; font-weight: 700; color: var(--abg-heading);
  font-family: 'Space Grotesk', sans-serif; line-height: 1.2;
}
.nav-subtitle {
  font-size: 10px; color: var(--abg-text3); letter-spacing: 0.3px;
}
.nav-steps {
  display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center;
}
.nav-step {
  display: flex; align-items: center; gap: 7px; padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 500;
  color: var(--abg-text3); transition: var(--transition); position: relative;
  white-space: nowrap;
}
.nav-step:hover { color: var(--abg-text2); background: rgba(255,255,255,0.05); }
.nav-step.active { color: #fff; background: rgba(139,26,47,0.25); font-weight: 700;
  border: 1px solid rgba(139,26,47,0.4); }
.nav-step.active i { color: var(--abg-red-light); }
.nav-step.done { color: var(--abg-success); }
.step-num {
  width: 18px; height: 18px; background: rgba(255,255,255,0.08);
  border-radius: 50%; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--abg-text3);
}
.nav-step.active .step-num { background: var(--abg-red); color: #fff; box-shadow: 0 0 8px rgba(139,26,47,0.6); }
.nav-step.done .step-num { background: var(--abg-success); color: #fff; }
.nav-right { display: flex; align-items: center; gap: 10px; min-width: 180px; justify-content: flex-end; flex-shrink: 0; }
.btn-admin {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--abg-border2);
  color: var(--abg-text2); padding: 7px 14px; border-radius: 8px;
  font-size: 12px; font-weight: 500; transition: var(--transition);
}
.btn-admin:hover { background: rgba(255,255,255,0.1); color: var(--abg-text); border-color: var(--abg-red-light); }

/* ─── MAIN CONTENT ─────────────────────────────────────────────── */
#main-content {
  padding-top: calc(var(--nav-height) + 16px);
  padding-bottom: calc(var(--progress-height) + 24px);
  min-height: 100vh;
  position: relative; z-index: 1;
}
.step-view { display: none; padding: 24px 32px; animation: fadeIn 0.25s ease; }
.step-view.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ─── PROGRESS BAR ─────────────────────────────────────────────── */
#progress-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  height: var(--progress-height);
  background: rgba(13,15,26,0.97);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}
.progress-flow { display: flex; align-items: center; gap: 4px; }
.progress-step { display: flex; align-items: center; gap: 4px; }
.progress-step-node {
  padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 500;
  color: var(--abg-text3); cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 5px;
  border: 1px solid transparent;
}
.progress-step-node:hover { color: var(--abg-text2); border-color: var(--abg-border2); }
.progress-step-node.active {
  background: rgba(139,26,47,0.2); color: var(--abg-red-light);
  border-color: rgba(139,26,47,0.35); font-weight: 700;
}
.progress-step-node.done { color: var(--abg-success); }
.progress-arrow { color: var(--abg-text3); font-size: 16px; opacity: 0.3; }
.progress-actions { display: flex; align-items: center; gap: 10px; }

/* ─── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600;
  transition: var(--transition); cursor: pointer; border: none;
  font-family: 'Inter', sans-serif; white-space: nowrap;
}
.btn-primary { background: var(--abg-red); color: #fff; }
.btn-primary:hover { background: var(--abg-red-light); box-shadow: 0 4px 16px rgba(139,26,47,0.5); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.07); color: var(--abg-text); border: 1px solid var(--abg-border2); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); border-color: var(--abg-red-light); }
.btn-success { background: var(--abg-success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-orange { background: var(--abg-gold); color: #0a0a0f; }
.btn-outline { background: transparent; color: var(--abg-red-light); border: 1.5px solid var(--abg-red-light); }
.btn-outline:hover { background: rgba(139,26,47,0.12); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-xs { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--abg-text3); padding: 6px 10px; }
.btn-ghost:hover { color: var(--abg-text2); background: rgba(255,255,255,0.06); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }
.btn-group { display: flex; gap: 8px; }

/* ─── CARDS ─────────────────────────────────────────────────────── */
.card {
  background: var(--abg-surface); border-radius: var(--radius-lg);
  border: 1px solid var(--abg-border); padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.card:hover { border-color: var(--abg-border2); box-shadow: var(--shadow-md); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--abg-heading); display: flex; align-items: center; gap: 8px; }
.card-icon { width: 32px; height: 32px; background: rgba(255,255,255,0.06); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--abg-text2); font-size: 13px; }
.card-elevated {
  background: var(--abg-surface); border-radius: var(--radius-lg);
  border: 1px solid var(--abg-border2); padding: 24px;
  box-shadow: var(--shadow-md);
}
.card-glow {
  box-shadow: 0 0 0 1px rgba(139,26,47,0.3), 0 0 32px rgba(139,26,47,0.15), var(--shadow-md);
}

/* ─── STEP HERO ─────────────────────────────────────────────────── */
.step-hero { margin-bottom: 28px; max-width: 700px; }
.step-hero-eyebrow {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--abg-red-light); margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.step-hero h2 {
  font-size: 26px; font-weight: 800; color: var(--abg-heading); line-height: 1.2;
  font-family: 'Space Grotesk', sans-serif; margin-bottom: 8px;
}
.step-hero p { font-size: 13px; color: var(--abg-text2); line-height: 1.6; max-width: 600px; }

/* ─── KPI ROW ───────────────────────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); transition: var(--transition);
}
.kpi-card:hover { border-color: var(--abg-border2); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-label { font-size: 11px; color: var(--abg-text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 800; color: var(--abg-heading); font-family: 'Space Grotesk', sans-serif; line-height: 1; margin-bottom: 4px; }
.kpi-sub { font-size: 11px; color: var(--abg-text2); }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-top: 4px; }
.kpi-delta.up   { color: var(--abg-success); background: rgba(34,197,94,0.12); }
.kpi-delta.down { color: var(--abg-red-light); background: rgba(139,26,47,0.12); }

/* ─── GRID LAYOUTS ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8  { gap: 8px;  } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }

/* ─── TABLES ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--abg-text3);
  background: rgba(255,255,255,0.04); border-bottom: 1px solid var(--abg-border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px; border-bottom: 1px solid var(--abg-border);
  color: var(--abg-text); vertical-align: middle;
}
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child td { border-bottom: none; }

/* ─── BADGES / TAGS ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-red    { background: rgba(139,26,47,0.20);  color: var(--abg-red-light);   border: 1px solid rgba(139,26,47,0.35); }
.badge-green  { background: rgba(34,197,94,0.12);  color: #4ade80;                border: 1px solid rgba(34,197,94,0.25); }
.badge-orange { background: rgba(196,168,98,0.15); color: var(--abg-gold-light);  border: 1px solid rgba(196,168,98,0.30); }
.badge-blue   { background: rgba(96,165,250,0.12); color: #93c5fd;                border: 1px solid rgba(96,165,250,0.25); }
.badge-purple { background: rgba(167,139,250,0.12);color: #c4b5fd;                border: 1px solid rgba(167,139,250,0.25); }
.badge-gray   { background: rgba(255,255,255,0.06);color: var(--abg-text2);       border: 1px solid var(--abg-border); }
.badge-yellow { background: rgba(251,191,36,0.12); color: #fcd34d;                border: 1px solid rgba(251,191,36,0.25); }

/* ─── PERSONA ATTRIBUTE TAGS ────────────────────────────────────── */
.attr-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  cursor: default; transition: var(--transition); position: relative;
  border: 1px solid transparent;
}
.attr-tag .tag-icon { font-size: 12px; }
.attr-tag .tag-weight {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; flex-shrink: 0;
}
.attr-tag.weight-high { background: rgba(139,26,47,0.18); color: #f87171; border-color: rgba(139,26,47,0.35); }
.attr-tag.weight-high .tag-weight { background: var(--abg-red); color: #fff; }
.attr-tag.weight-med  { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.attr-tag.weight-med  .tag-weight { background: #D97706; color: #fff; }
.attr-tag.weight-low  { background: rgba(255,255,255,0.05); color: var(--abg-text2); border-color: var(--abg-border); }
.attr-tag.weight-low  .tag-weight { background: rgba(255,255,255,0.1); color: var(--abg-text2); }

/* ─── BRAND CARDS ───────────────────────────────────────────────── */
.brand-card {
  background: var(--abg-surface); border: 2px solid transparent;
  border-radius: var(--radius-lg); padding: 20px; cursor: pointer;
  transition: all 0.25s ease; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.brand-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--brand-color, var(--abg-red));
}
.brand-card:hover { border-color: var(--brand-color, var(--abg-red)); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.brand-card.selected {
  border-color: var(--brand-color, var(--abg-red));
  background: rgba(139,26,47,0.08);
  box-shadow: 0 4px 24px rgba(139,26,47,0.25);
}
.brand-card-icon { font-size: 28px; margin-bottom: 10px; }
.brand-card-name { font-size: 18px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; margin-bottom: 4px; color: var(--abg-heading); }
.brand-card-segment { font-size: 11px; color: var(--abg-text3); margin-bottom: 8px; }
.brand-card-price { font-size: 12px; font-weight: 600; color: var(--brand-color, var(--abg-red-light)); }
.brand-card-persona { font-size: 11px; color: var(--abg-text2); margin-top: 6px; line-height: 1.4; }
.selected-check {
  position: absolute; top: 12px; right: 12px; width: 20px; height: 20px;
  background: var(--brand-color, var(--abg-red)); border-radius: 50%;
  display: none; align-items: center; justify-content: center; font-size: 10px; color: #fff;
}
.brand-card.selected .selected-check { display: flex; }

/* ─── BRAND SELECTOR CARDS (Screen 1) ──────────────────────────── */
.brand-selector-card {
  background: var(--abg-surface);
  border-radius: 16px;
  border: 1.5px solid var(--abg-border);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow);
}
.brand-selector-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.1);
}
.brand-selector-card.selected {
  box-shadow: 0 8px 40px rgba(139,26,47,0.35), 0 0 0 1px rgba(139,26,47,0.4);
}

/* ─── FILTER TOOLBAR ────────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.filter-input, .filter-select {
  background: rgba(255,255,255,0.06); border: 1px solid var(--abg-border2);
  color: var(--abg-text); border-radius: 8px; padding: 7px 12px; font-size: 12px;
  transition: var(--transition);
}
.filter-input:focus, .filter-select:focus {
  border-color: var(--abg-red-light); background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(139,26,47,0.15);
}
.filter-input::placeholder { color: var(--abg-text3); }
.filter-select option { background: var(--abg-surface2); color: var(--abg-text); }
.filter-divider { width: 1px; height: 24px; background: var(--abg-border); flex-shrink: 0; }
.filter-label { font-size: 11px; color: var(--abg-text2); font-weight: 500; white-space: nowrap; }
.toggle-group {
  display: flex; background: rgba(255,255,255,0.04); border: 1px solid var(--abg-border);
  border-radius: 8px; overflow: hidden;
}
.toggle-btn {
  padding: 7px 14px; font-size: 11px; font-weight: 600;
  background: transparent; color: var(--abg-text3); cursor: pointer;
  transition: var(--transition); border: none; white-space: nowrap;
}
.toggle-btn:hover { background: rgba(255,255,255,0.06); color: var(--abg-text2); }
.toggle-btn.active { background: var(--abg-red); color: #fff; }

/* ─── SECTION TITLE ─────────────────────────────────────────────── */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--abg-heading);
  display: flex; align-items: center; gap: 6px;
}

/* ─── SHARE BAR ─────────────────────────────────────────────────── */
.share-bar-container { display: flex; align-items: center; gap: 8px; }
.share-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.share-bar-fill { height: 100%; border-radius: 3px; background: var(--abg-red); transition: width 0.5s ease; }
.share-pct { font-size: 12px; font-weight: 700; min-width: 36px; text-align: right; color: var(--abg-heading); }

/* ─── PROSPERITY MAP ────────────────────────────────────────────── */
#prosperity-map { height: 480px; border-radius: var(--radius); overflow: hidden; }
.prosperity-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 10px 14px; transition: var(--transition);
  display: flex; align-items: center; justify-content: space-between;
}
.prosperity-card:hover { border-color: var(--abg-border2); box-shadow: var(--shadow); }
.prosperity-badge {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.prosperity-badge.High   { background: #22C55E; }
.prosperity-badge.Medium { background: #F59E0B; }
.prosperity-badge.Low    { background: #EF4444; }
.prosperity-list { display: flex; flex-direction: column; gap: 5px; max-height: 500px; overflow-y: auto; }

/* ─── PROSPERITY MAP LEAFLET TILES ─────────────────────────────── */
.leaflet-tile-pane { filter: saturate(0.5) brightness(0.7) hue-rotate(200deg); }
.leaflet-container { background: #0d0f1a; }

/* ─── LEAFLET DARK TOOLTIPS & POPUPS ────────────────────────────── */
.leaflet-tooltip {
  background: rgba(13,15,26,0.97) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #E8EAF0 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7) !important;
  border-radius: 8px !important;
  backdrop-filter: blur(8px);
  font-family: 'Inter', sans-serif !important;
}
.leaflet-tooltip-top::before,
.leaflet-tooltip-bottom::before,
.leaflet-tooltip-left::before,
.leaflet-tooltip-right::before {
  border-top-color: rgba(13,15,26,0.97) !important;
  border-bottom-color: rgba(13,15,26,0.97) !important;
  border-left-color: rgba(13,15,26,0.97) !important;
  border-right-color: rgba(13,15,26,0.97) !important;
}
.leaflet-popup-content-wrapper {
  background: rgba(13,15,26,0.97) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #E8EAF0 !important;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8) !important;
  border-radius: 10px !important;
}
.leaflet-popup-tip { background: rgba(13,15,26,0.97) !important; }
.leaflet-popup-close-button { color: #9BA5B8 !important; }
.leaflet-popup-close-button:hover { color: #E8EAF0 !important; }

/* ─── CHOROPLETH LEGEND ─────────────────────────────────────────── */
.choropleth-legend {
  background: rgba(13,15,26,0.95);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--abg-border2);
  line-height: 1.8;
  color: var(--abg-text2);
  backdrop-filter: blur(6px);
}
.choropleth-legend i {
  width: 14px; height: 14px; display: inline-block;
  border-radius: 3px; margin-right: 6px; vertical-align: middle;
}

/* ─── SCORE BAR ─────────────────────────────────────────────────── */
.score-bar-wrap { margin-bottom: 10px; }
.score-bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--abg-text2); margin-bottom: 4px; }
.score-bar-track { height: 8px; background: rgba(255,255,255,0.07); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.score-hot  { background: linear-gradient(90deg, var(--abg-red), var(--abg-red-light)); }
.score-warm { background: linear-gradient(90deg, #D97706, #F59E0B); }
.score-cold { background: linear-gradient(90deg, #2563EB, #60A5FA); }

/* ─── PROPENSITY CARDS ──────────────────────────────────────────── */
.propensity-city-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 16px; transition: var(--transition);
  box-shadow: var(--shadow);
}
.propensity-city-card:hover { border-color: var(--abg-border2); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.propensity-city-card.hot  { border-left: 3px solid var(--abg-red-light); }
.propensity-city-card.warm { border-left: 3px solid var(--abg-warning); }
.propensity-city-card.cold { border-left: 3px solid var(--abg-blue); }

/* ─── CAMPAIGN PLAN OUTPUT ──────────────────────────────────────── */
.plan-section { margin-bottom: 20px; }
.plan-section-title {
  font-size: 13px; font-weight: 700; color: var(--abg-heading);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--abg-border); padding-bottom: 8px;
}
.plan-platform-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 14px; flex: 1; min-width: 160px;
  box-shadow: var(--shadow);
}
.plan-kpi-row { display: flex; flex-wrap: wrap; gap: 12px; }
.plan-kpi-item {
  background: rgba(255,255,255,0.04); border: 1px solid var(--abg-border);
  border-radius: 8px; padding: 10px 14px; flex: 1; min-width: 120px; text-align: center;
}
.plan-kpi-label { font-size: 10px; color: var(--abg-text3); text-transform: uppercase; letter-spacing: 0.5px; }
.plan-kpi-val { font-size: 16px; font-weight: 800; color: var(--abg-heading); margin-top: 2px; font-family: 'Space Grotesk', sans-serif; }

/* ─── PLAN TABS ─────────────────────────────────────────────────── */
.plan-tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition); border: 1.5px solid var(--abg-border2);
  background: transparent; color: var(--abg-text3); white-space: nowrap;
}
.plan-tab-btn:hover { color: var(--abg-text2); border-color: var(--abg-border2); background: rgba(255,255,255,0.05); }
.plan-tab-btn.active {
  color: #fff; border-color: var(--abg-red); background: rgba(139,26,47,0.25);
  box-shadow: 0 0 12px rgba(139,26,47,0.3);
}

/* ─── OBJECTIVE CARDS ───────────────────────────────────────────── */
.objective-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: var(--transition); position: relative;
  box-shadow: var(--shadow);
}
.objective-card:hover { border-color: var(--abg-border2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.objective-card.selected { border-color: var(--abg-red-light); background: rgba(139,26,47,0.08); box-shadow: 0 4px 20px rgba(139,26,47,0.2); }
.objective-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.objective-name { font-size: 13px; font-weight: 700; color: var(--abg-heading); margin-bottom: 4px; }
.objective-desc { font-size: 11px; color: var(--abg-text2); line-height: 1.4; }
.objective-kpi  { font-size: 10px; color: var(--abg-red-light); font-weight: 600; margin-top: 8px; }

/* ─── ACTIVATION CARDS ──────────────────────────────────────────── */
.platform-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius-lg); padding: 20px; transition: var(--transition);
  box-shadow: var(--shadow);
}
.platform-card:hover { border-color: var(--abg-border2); box-shadow: var(--shadow-md); }
.platform-logo { font-size: 24px; margin-bottom: 8px; }
.platform-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--abg-heading); }
.platform-meta { font-size: 11px; color: var(--abg-text2); line-height: 1.5; }
.platform-status { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; margin-top: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.active  { background: var(--abg-success); animation: pulse 2s infinite; }
.status-dot.ready   { background: var(--abg-warning); }
.status-dot.pending { background: var(--abg-text3); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ─── ADMIN PANEL ───────────────────────────────────────────────── */
#admin-panel {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: flex-end;
}
#admin-panel.open { display: flex; }
.admin-drawer {
  width: 900px; max-width: 96vw; height: 100vh;
  background: var(--abg-surface); border-left: 1px solid var(--abg-border2);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: -8px 0 60px rgba(0,0,0,0.7);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.admin-header {
  padding: 20px 24px; border-bottom: 1px solid var(--abg-border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
  background: var(--abg-bg2);
}
.admin-header h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--abg-heading); }
.admin-nav {
  display: flex; gap: 4px; padding: 12px 24px;
  border-bottom: 1px solid var(--abg-border); flex-shrink: 0; flex-wrap: wrap;
  background: var(--abg-surface);
}
.admin-nav-btn {
  padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 500;
  color: var(--abg-text3); background: transparent; cursor: pointer;
  transition: var(--transition); border: none; display: flex; align-items: center; gap: 5px;
}
.admin-nav-btn:hover { color: var(--abg-text2); background: rgba(255,255,255,0.06); }
.admin-nav-btn.active { color: var(--abg-red-light); background: rgba(139,26,47,0.12); font-weight: 700; }
.admin-content { flex: 1; overflow-y: auto; padding: 20px 24px; background: var(--abg-bg); }
.admin-section { display: none; }
.admin-section.active { display: block; }

/* Brand Profile Large Card */
.brand-profile-card {
  background: var(--abg-surface); border-radius: var(--radius-lg);
  border: 1px solid var(--abg-border2); padding: 24px; margin-bottom: 16px;
  position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.brand-profile-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--brand-color, var(--abg-red));
}
.brand-profile-header { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.brand-profile-icon-wrap {
  width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center;
  justify-content: center; font-size: 28px; flex-shrink: 0;
  background: rgba(255,255,255,0.06);
}
.brand-profile-name { font-size: 22px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; color: var(--abg-heading); }
.brand-profile-segment { font-size: 12px; color: var(--abg-text2); margin-top: 2px; }
.brand-profile-price { font-size: 13px; font-weight: 600; margin-top: 4px; }
.brand-profile-positioning { font-size: 13px; color: var(--abg-text2); font-style: italic; margin-top: 6px; line-height: 1.5; }

/* Attribute tags container */
.attr-tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.attr-tag-human {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 20px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: var(--transition); border: 1px solid transparent;
  position: relative; user-select: none;
}
.attr-tag-human .human-icon {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; flex-shrink: 0;
}
.attr-tag-human .attr-wt { font-size: 9px; opacity: 0.6; margin-left: 2px; }
.attr-tag-human:hover { transform: translateY(-1px); filter: brightness(1.15); }
.attr-weight-10 { background: rgba(139,26,47,0.22); color: #f87171; border-color: rgba(139,26,47,0.4); }
.attr-weight-10 .human-icon { background: var(--abg-red); color: #fff; }
.attr-weight-9  { background: rgba(180,30,50,0.16);  color: #fca5a5; border-color: rgba(180,30,50,0.3); }
.attr-weight-9  .human-icon { background: #C0392B; color: #fff; }
.attr-weight-8  { background: rgba(217,119,6,0.15);  color: #fbbf24; border-color: rgba(217,119,6,0.30); }
.attr-weight-8  .human-icon { background: #D97706; color: #fff; }
.attr-weight-7  { background: rgba(196,168,98,0.15); color: var(--abg-gold-light); border-color: rgba(196,168,98,0.28); }
.attr-weight-7  .human-icon { background: var(--abg-gold); color: #0a0a0f; }
.attr-weight-6  { background: rgba(96,165,250,0.12); color: #93c5fd; border-color: rgba(96,165,250,0.25); }
.attr-weight-6  .human-icon { background: #2563EB; color: #fff; }
.attr-weight-5  { background: rgba(255,255,255,0.06); color: var(--abg-text2); border-color: var(--abg-border); }
.attr-weight-5  .human-icon { background: rgba(255,255,255,0.12); color: var(--abg-text2); }

/* ─── FORMS ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: var(--abg-text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: rgba(255,255,255,0.06); border: 1px solid var(--abg-border2);
  color: var(--abg-text); border-radius: 8px; padding: 10px 12px; font-size: 13px;
  transition: var(--transition); font-family: 'Inter', sans-serif;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--abg-red-light); background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px rgba(139,26,47,0.15);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-select option { background: var(--abg-surface2); color: var(--abg-text); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ─── LOADING STATES ────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-kpi { height: 80px; width: 100%; }
.skeleton-card { height: 140px; }
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--abg-red); border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px; }
.loading-text { font-size: 13px; color: var(--abg-text2); }

/* ─── AI LOADING ANIMATION ──────────────────────────────────────── */
.ai-loading {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 60px 24px; text-align: center;
}
.ai-pulse {
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,26,47,0.3) 0%, transparent 70%);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  animation: aiPulse 2s ease-in-out infinite;
  position: relative;
}
.ai-pulse::before {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(139,26,47,0.25); animation: aiRing 2s ease-in-out infinite;
}
@keyframes aiPulse { 0%,100%{transform:scale(1);opacity:0.8} 50%{transform:scale(1.1);opacity:1} }
@keyframes aiRing  { 0%,100%{transform:scale(1);opacity:0.5} 50%{transform:scale(1.15);opacity:0.8} }
.ai-loading h3 { font-size: 17px; font-weight: 700; color: var(--abg-heading); }
.ai-loading p  { font-size: 12px; color: var(--abg-text2); max-width: 300px; line-height: 1.5; }
.ai-steps { display: flex; flex-direction: column; gap: 6px; text-align: left; width: 280px; }
.ai-step-item { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--abg-text2); }
.ai-step-item.done   { color: var(--abg-success); }
.ai-step-item.active { color: var(--abg-text); font-weight: 600; }

/* ─── TOAST ─────────────────────────────────────────────────────── */
#toast-container { position: fixed; top: 80px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 280px; max-width: 380px; padding: 12px 16px;
  background: var(--abg-surface2); border: 1px solid var(--abg-border2);
  border-radius: 10px; display: flex; align-items: flex-start; gap: 10px;
  box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease;
  color: var(--abg-text);
}
@keyframes toastIn { from{transform:translateX(20px);opacity:0} to{transform:translateX(0);opacity:1} }
.toast.success { border-left: 3px solid var(--abg-success); }
.toast.error   { border-left: 3px solid var(--abg-red-light); }
.toast.info    { border-left: 3px solid var(--abg-blue); }
.toast-icon { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--abg-success); }
.toast.error   .toast-icon { color: var(--abg-red-light); }
.toast.info    .toast-icon { color: var(--abg-blue); }
.toast-msg { font-size: 12px; color: var(--abg-text); line-height: 1.4; }

/* ─── TABS ──────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--abg-border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: 12px; font-weight: 600;
  color: var(--abg-text3); background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer; transition: var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--abg-text2); }
.tab-btn.active { color: var(--abg-red-light); border-bottom-color: var(--abg-red-light); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── MODALS ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--abg-surface); border: 1px solid var(--abg-border2);
  border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  animation: modalIn 0.25s ease; box-shadow: var(--shadow-lg);
}
@keyframes modalIn { from{transform:scale(0.95);opacity:0} to{transform:scale(1);opacity:1} }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--abg-heading); }
.modal-close {
  background: rgba(255,255,255,0.08); border: none; color: var(--abg-text3);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 14px;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.14); color: var(--abg-text); }

/* ─── UPLOAD ZONE ───────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--abg-border2); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer; transition: var(--transition);
  background: rgba(255,255,255,0.03);
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--abg-red-light); background: rgba(139,26,47,0.08); }
.upload-icon { font-size: 32px; color: var(--abg-text3); margin-bottom: 10px; }
.upload-text { font-size: 13px; color: var(--abg-text2); }
.upload-sub  { font-size: 11px; color: var(--abg-text3); margin-top: 4px; }

/* ─── LEARN / ANALYTICS ─────────────────────────────────────────── */
.learn-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.chart-wrap { position: relative; height: 260px; }
.insight-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 16px; display: flex; gap: 12px;
  align-items: flex-start; box-shadow: var(--shadow);
}
.insight-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.insight-text h4 { font-size: 12px; font-weight: 700; margin-bottom: 4px; color: var(--abg-heading); }
.insight-text p  { font-size: 11px; color: var(--abg-text2); line-height: 1.4; }

/* ─── CITY / MARKET CARDS ───────────────────────────────────────── */
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.city-card {
  background: var(--abg-surface); border: 1px solid var(--abg-border);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  transition: var(--transition); position: relative; box-shadow: var(--shadow);
}
.city-card:hover { border-color: var(--abg-border2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.city-card.selected { border-color: var(--abg-red-light); background: rgba(139,26,47,0.08); }
.city-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.city-name  { font-size: 14px; font-weight: 700; color: var(--abg-heading); }
.city-state { font-size: 10px; color: var(--abg-text3); margin-top: 1px; }
.city-volume { font-size: 20px; font-weight: 800; color: var(--abg-heading); font-family: 'Space Grotesk', sans-serif; }
.city-volume-label { font-size: 10px; color: var(--abg-text3); }
.city-share-bar { height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.city-share-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }

/* ─── EMPTY STATE ────────────────────────────────────────────────── */
.empty-state { padding: 48px 24px; text-align: center; color: var(--abg-text3); }
.empty-state i { font-size: 32px; margin-bottom: 12px; display: block; opacity: 0.3; }
.empty-state p { font-size: 13px; }

/* ─── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .step-view { padding: 16px; }
  .nav-steps { display: none; }
  .nav-logo { min-width: auto; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .step-hero h2 { font-size: 20px; }
  .filter-bar { padding: 10px 12px; }
  .progress-flow { display: none; }
  #progress-bar { justify-content: flex-end; }
  #prosperity-map { height: 320px; }
}
