/* Rapideal — premium dark theme for ambitious property investors */

:root {
  --primary: #0a0e1a;
  --primary-dark: #050810;
  --primary-light: #131826;
  --accent: #d4af37;
  --accent-light: #f4d03f;
  --accent-dark: #b8860b;
  --accent-glow: rgba(212, 175, 55, 0.25);
  --secondary: #94a3b8;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --pass: #6b7280;
  --pass-bg: rgba(107, 114, 128, 0.15);
  --marginal: #f59e0b;
  --proceed: #10b981;
  --bg: #0a0e1a;
  --bg-elevated: #131826;
  --bg-card: #1a2138;
  --bg-card-hover: #222a45;
  --border: rgba(212, 175, 55, 0.12);
  --border-strong: rgba(212, 175, 55, 0.25);
  --text: #f1f5f9;
  --text-mid: #cbd5e1;
  --text-light: #94a3b8;
  --text-dim: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 20px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.15);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #b8860b 100%);
  --gradient-dark: linear-gradient(180deg, #0a0e1a 0%, #131826 100%);
  --gradient-card: linear-gradient(145deg, #1a2138 0%, #131826 100%);
  --gradient-hero: linear-gradient(135deg, #0a0e1a 0%, #1a2138 50%, #0a0e1a 100%);
  /* Spacing scale (8px base) */
  --sp-1: 0.5rem;   /* 8px  */
  --sp-2: 1rem;     /* 16px */
  --sp-3: 1.5rem;   /* 24px */
  --sp-4: 2rem;     /* 32px */
  --sp-5: 2.5rem;   /* 40px */
  --sp-6: 3rem;     /* 48px */
  --sp-7: 4rem;     /* 64px */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Arial, sans-serif;
  font-size: var(--text-base, 1rem);   /* inherits ds.css token; was hardcoded 14px */
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Subtle gold shimmer on background */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 800px 400px at 20% 0%, rgba(212, 175, 55, 0.06), transparent),
    radial-gradient(ellipse 600px 300px at 80% 100%, rgba(212, 175, 55, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

main { flex: 1; position: relative; z-index: 1; }

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: white;
  padding: 0.9rem 1.75rem;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  filter: drop-shadow(0 0 12px var(--accent-glow));
  margin-right: var(--sp-2);
}
.nav-brand img { display: block; }
.nav-brand-text {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--gradient-gold);
  border-radius: 2px;
}
.nav-links a.nav-logout {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-left: var(--sp-2);
  padding-left: var(--sp-2);
  border-left: 1px solid var(--border);
}
.nav-links a.nav-logout:hover { color: var(--danger); }
.nav-links a.nav-logout:hover::after { display: none; }
.nav-links a.nav-cta {
  padding: 0.45rem 1rem;
  background: var(--gradient-gold);
  color: #0a0e1a !important;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.nav-links a.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,55,0.4);
  filter: brightness(1.1);
}
.nav-links a.nav-cta:hover::after { display: none; }

/* ─── Container ───────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: var(--sp-5) var(--sp-3); width: 100%; }

/* ─── Footer ──────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: var(--sp-4) var(--sp-2);
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  margin-top: var(--sp-7);
  position: relative;
  z-index: 1;
}

/* ─── Page header ─────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 2rem;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.page-header p { color: var(--text-mid); margin-top: 0.4rem; font-size: 0.95rem; }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  line-height: 1.2;
  position: relative;
}
.btn img { display: block; }
.btn-primary {
  background: var(--gradient-gold);
  color: #0a0e1a;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
  font-weight: 700;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow), 0 0 30px var(--accent-glow);
  filter: brightness(1.1);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-lg { padding: 0.95rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.95rem; font-size: 0.82rem; }
button[disabled] { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: none !important; }

/* ─── Hero / Landing ──────────────────────────────────────────── */
.hero {
  padding: var(--sp-7) var(--sp-5);
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  margin-bottom: var(--sp-6);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(80px);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-content {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--sp-5);
  align-items: center;
}
.hero-text { text-align: left; }
.hero-text h1 {
  font-size: 3.5rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.25rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
  filter: drop-shadow(0 0 30px var(--accent-glow));
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
  max-width: 540px;
  font-weight: 400;
  line-height: 1.6;
}
.hero-sub-secondary {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 2.25rem;
  max-width: 540px;
  font-weight: 400;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 20px 60px var(--accent-glow));
  animation: floatHero 6s ease-in-out infinite;
}
@keyframes floatHero {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ─── Section heading (used in landing & inside cards) ───────── */
.section-heading {
  text-align: center;
  margin-bottom: var(--sp-4);
}
.section-heading h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.section-heading p {
  color: var(--text-light);
  font-size: 1rem;
}

/* ─── How it works (steps) ───────────────────────────────────── */
.how-it-works {
  padding: var(--sp-6) 0;
  margin-bottom: var(--sp-4);
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.step {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.step:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow), var(--shadow-glow);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-gold);
  color: #0a0e1a;
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: var(--sp-2);
  box-shadow: 0 4px 14px var(--accent-glow);
}
.step h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.step p {
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Features section (landing) ─────────────────────────────── */
.features-section {
  padding: var(--sp-6) 0 var(--sp-4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--sp-4) 0;
}
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-3);
}
.feature {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.feature::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-gold);
  opacity: 0;
  transition: opacity 0.3s;
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.feature:hover::before { opacity: 1; }
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--gradient-gold);
  color: #0a0e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-2);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.feature-icon img { display: block; }
.feature h3 { color: var(--text); margin-bottom: 0.5rem; font-size: 1.1rem; font-weight: 700; }
.feature p { color: var(--text-mid); font-size: 0.9rem; line-height: 1.6; }

/* ─── Pricing note ────────────────────────────────────────────── */
.pricing-note {
  text-align: center;
  padding: var(--sp-4);
  background: var(--gradient-card);
  color: var(--text);
  border-radius: var(--radius-lg);
  margin: var(--sp-5) auto;
  max-width: 600px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.pricing-note::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-gold);
}
.pricing-note strong { color: var(--accent); font-size: 1.1rem; }

/* ─── Auth pages ──────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-box {
  max-width: 460px;
  width: 100%;
  margin: var(--sp-4) auto;
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.auth-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-gold);
}
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-3);
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
.auth-logo img { display: block; }
.auth-box h1 {
  font-size: 1.85rem;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-align: center;
}
.auth-sub { color: var(--text-mid); margin-bottom: var(--sp-4); font-size: 0.95rem; text-align: center; }
.auth-alt { text-align: center; margin-top: var(--sp-3); color: var(--text-mid); font-size: 0.9rem; }
.auth-alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

/* ─── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-2); }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.form-group small {
  color: var(--text-dim);
  font-size: 0.75rem;
  display: block;
  margin-top: 0.3rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  color: var(--text);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--foreground-faint); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-2); }
.form-section {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow);
}
.form-section h3 {
  color: var(--accent);
  margin-bottom: var(--sp-3);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.form-section h3::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--gradient-gold);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}
.form-actions { display: flex; gap: 0.85rem; margin-top: var(--sp-3); }

/* ─── Tables ──────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--sp-2) 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.table th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--accent);
  padding: var(--sp-2);
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: var(--sp-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(212, 175, 55, 0.04); }
.table a { color: var(--accent); text-decoration: none; font-weight: 600; }
.table a:hover { text-decoration: underline; filter: brightness(1.2); }
.table td.num, .table th.num { text-align: right; }

/* ─── Stats grid (dashboard) ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
}
.stat-card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-gold);
  opacity: 0.5;
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.stat-value {
  font-size: 2rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.65rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-inbound_lead { background: var(--badge-inbound-lead-bg); color: var(--badge-inbound-lead-fg); border: 1px solid var(--badge-inbound-lead-border); }
.badge-lead { background: var(--badge-lead-bg); color: var(--badge-lead-fg); border: 1px solid var(--badge-lead-border); }
.badge-qualified { background: var(--badge-qualified-bg); color: var(--badge-qualified-fg); border: 1px solid var(--badge-qualified-border); }
.badge-offer { background: var(--badge-offer-bg); color: var(--badge-offer-fg); border: 1px solid var(--badge-offer-border); }
.badge-agreed { background: var(--badge-agreed-bg); color: var(--badge-agreed-fg); border: 1px solid var(--badge-agreed-border); }
.badge-legal { background: var(--badge-legal-bg); color: var(--badge-legal-fg); border: 1px solid var(--badge-legal-border); }
.badge-complete { background: linear-gradient(135deg, var(--success), #059669); color: white; }
.badge-dead { background: var(--badge-dead-bg); color: var(--badge-dead-fg); border: 1px solid var(--badge-dead-border); }
.badge-proceed { background: var(--success-bg); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-marginal { background: var(--warning-bg); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-pass { background: var(--danger-bg); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

/* ─── Quick actions ─────────────────────────────────────────── */
.quick-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 0 0 var(--sp-4); }

/* ─── Stage filters ─────────────────────────────────────────── */
.stage-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: var(--sp-3) 0 var(--sp-4); }
.stage-filters .btn-sm {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.stage-filters .btn-sm:hover { background: rgba(212, 175, 55, 0.08); border-color: var(--accent); }
.stage-filters .btn-primary {
  background: var(--gradient-gold);
  color: #0a0e1a;
  border-color: var(--accent);
}
.stage-filters .badge {
  margin-left: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
}
.stage-filters .btn-sm .badge { color: var(--text-mid); }
.stage-filters .btn-primary .badge { background: rgba(0, 0, 0, 0.25); color: #0a0e1a; }

/* ─── Analysis box ───────────────────────────────────────────── */
.analysis-box {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--border-strong);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.analysis-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-gold);
}
.analysis-box h2 {
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
}
.analysis-box p.context {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: var(--sp-3);
  line-height: 1.5;
}
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.analysis-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  padding: var(--sp-2);
  border: 1px solid var(--border);
  transition: all 0.2s;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.analysis-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.analysis-label {
  font-size: 0.65rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.analysis-value {
  font-size: 1.35rem;
  font-weight: 800;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.analysis-score {
  text-align: center;
  padding: var(--sp-2);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.analysis-score.analysis-proceed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}
.analysis-score.analysis-marginal {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}
.analysis-score.analysis-pass {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}
.analysis-score .analysis-value {
  font-size: 2rem;
  background: none;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
}
.verdict-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; margin-top: 0.25rem; letter-spacing: 0.08em; }
.verdict-proceed { color: #6ee7b7; }
.verdict-marginal { color: #fcd34d; }
.verdict-pass { color: #fca5a5; }

/* ─── Verdict legend (3-pill) ────────────────────────────────── */
.verdict-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--sp-3);
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  font-size: 0.8rem;
  border: 1px solid var(--border);
}
.verdict-legend-label {
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  margin-right: 0.25rem;
}
.verdict-pill {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.verdict-pill-proceed { background: var(--success-bg); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.verdict-pill-marginal { background: var(--warning-bg); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
.verdict-pill-pass { background: var(--danger-bg); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

.risks-box {
  margin-top: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: #fcd34d;
}
.risks-box strong { color: #fde68a; }
.risks-box ul { margin: 0.5rem 0 0 1.25rem; }

/* ─── Deal detail layout ────────────────────────────────────── */
.deal-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--sp-4); }
.deal-main { display: flex; flex-direction: column; gap: var(--sp-3); }
.deal-sidebar { display: flex; flex-direction: column; gap: var(--sp-2); }
.sidebar-section {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.sidebar-section h3 {
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.dl { display: grid; grid-template-columns: 110px 1fr; row-gap: 0.4rem; column-gap: var(--sp-2); align-items: baseline; }
.dl dt { font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.dl dd { font-size: 0.92rem; color: var(--text); }
.deal-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.section {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.section h2 {
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: var(--sp-2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── Stage select ──────────────────────────────────────────── */
.stage-select, .sidebar-section select {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  font-size: 0.88rem;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  width: 100%;
}
.stage-select:focus, .sidebar-section select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ─── Doc actions ───────────────────────────────────────────── */
.doc-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.doc-list { list-style: none; margin-top: var(--sp-2); }
.doc-list li {
  padding: 0.55rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
}
.doc-list li:last-child { border-bottom: none; }

/* ─── Notes ─────────────────────────────────────────────────── */
.note-form { display: flex; gap: 0.6rem; margin-bottom: var(--sp-2); }
.note-form textarea { flex: 1; resize: vertical; min-height: 70px; }
.notes-display {
  white-space: pre-wrap;
  font-size: 0.9rem;
  padding: var(--sp-2);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.65;
  color: var(--text-mid);
}

/* ─── Events / Activity ────────────────────────────────────── */
.event-list { list-style: none; }
.event-list li {
  display: flex;
  gap: var(--sp-2);
  padding: 0.65rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.event-list li:last-child { border-bottom: none; }
.event-type {
  font-weight: 600;
  color: var(--accent);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8rem;
}
.event-date { color: var(--text-dim); margin-left: auto; font-size: 0.8rem; }

/* ─── Upload page ─────────────────────────────────────────── */
.upload-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.upload-card {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.upload-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-gold);
  opacity: 0.5;
  transition: opacity 0.3s;
}
.upload-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.upload-card:hover::before { opacity: 1; }
.upload-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--gradient-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-2);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.upload-card-icon img { display: block; filter: brightness(0); }
.upload-card h3 { color: var(--text); margin-bottom: 0.5rem; font-size: 1.1rem; font-weight: 700; }
.upload-card p { color: var(--text-mid); font-size: 0.9rem; margin-bottom: var(--sp-2); line-height: 1.6; }
.upload-card form { display: flex; flex-direction: column; gap: 0.85rem; }
.upload-card input { width: 100%; }

/* ─── Settings ─────────────────────────────────────────────── */
.settings-section {
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow);
}
.settings-section h2 {
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: var(--sp-2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

/* ─── Billing ──────────────────────────────────────────────── */
.billing-box { max-width: 600px; margin: 0 auto; }
.billing-box h1 {
  text-align: center;
  margin-bottom: var(--sp-4);
}
.pricing-tier {
  background: var(--gradient-card);
  border-radius: var(--radius-xl);
  padding: var(--sp-5) var(--sp-4);
  border: 2px solid var(--accent);
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.pricing-tier::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-gold);
}
.pricing-tier::after {
  content: "";
  position: absolute;
  top: -100px; right: -100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.pricing-tier > * { position: relative; z-index: 1; }
.tier-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.tier-price {
  font-size: 3.25rem;
  font-weight: 900;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.6rem 0;
  letter-spacing: -0.03em;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
.tier-price span { font-size: 1rem; font-weight: 500; color: var(--text-mid); }
.tier-features {
  list-style: none;
  text-align: left;
  max-width: 340px;
  margin: var(--sp-3) auto var(--sp-2);
}
.tier-features li {
  padding: 0.6rem 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}
.tier-features li:last-child { border-bottom: none; }
.tier-features li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 800;
  font-size: 1.05rem;
}
.trial-note { margin: var(--sp-2) 0 var(--sp-3); color: var(--text-mid); font-size: 0.92rem; }

/* ─── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
  font-size: 0.92rem;
  border: 1px solid;
}
.alert-error { background: var(--danger-bg); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }

/* ─── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--sp-6) var(--sp-3);
  color: var(--text-mid);
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
}
.empty-state-icon {
  margin-bottom: var(--sp-2);
  opacity: 0.35;
  display: inline-flex;
}
.empty-state-icon img { display: block; }
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; font-size: 1.1rem; }
.empty-state p { margin-bottom: 0.5rem; line-height: 1.6; }
.empty-state a { color: var(--accent); font-weight: 600; text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }
.empty-state .btn { margin-top: var(--sp-2); }
.empty-state ul { list-style: none; padding: 0; }
.empty-state ul li { padding: 0.3rem 0; }

/* ─── Section heading (h2 inside main content, not inside a card) ── */
main > .container > h2 {
  font-size: 1.15rem;
  color: var(--text);
  margin: var(--sp-4) 0 var(--sp-2);
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ─── Badge stage colours (local vars — stage-specific colours not in design-system) ──── */
:root {
  --badge-lead-bg:       rgba(148, 163, 184, 0.15);
  --badge-lead-fg:       #cbd5e1;
  --badge-lead-border:   rgba(148, 163, 184, 0.3);
  --badge-qualified-bg:   rgba(59, 130, 246, 0.15);
  --badge-qualified-fg:  #93c5fd;
  --badge-qualified-border: rgba(59, 130, 246, 0.3);
  --badge-inbound-lead-bg: rgba(168, 85, 247, 0.15);
  --badge-inbound-lead-fg: #c4b5fd;
  --badge-inbound-lead-border: rgba(168, 85, 247, 0.3);
  --badge-offer-bg:      rgba(245, 158, 11, 0.15);
  --badge-offer-fg:      #fbbf24;
  --badge-offer-border:  rgba(245, 158, 11, 0.3);
  --badge-agreed-bg:     rgba(249, 115, 22, 0.15);
  --badge-agreed-fg:     #fdba74;
  --badge-agreed-border: rgba(249, 115, 22, 0.3);
  --badge-legal-bg:      rgba(34, 197, 94, 0.12);
  --badge-legal-fg:      #86efac;
  --badge-legal-border:  rgba(34, 197, 94, 0.3);
  --badge-dead-bg:       rgba(239, 68, 68, 0.12);
  --badge-dead-fg:       #fca5a5;
  --badge-dead-border:   rgba(239, 68, 68, 0.3);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .deal-layout { grid-template-columns: 1fr; }
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-text { text-align: center; }
  .hero-text h1 { font-size: 2.5rem; }
  .hero-sub, .hero-sub-secondary { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual img { max-width: 220px; }
  .container { padding: var(--sp-3) var(--sp-2); }
  .navbar { padding: 0.85rem 1.25rem; gap: var(--sp-2); }
  .nav-links { gap: 1.1rem; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .auth-box { padding: var(--sp-4) var(--sp-3); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stage-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.5rem; }
  .navbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.85rem 1rem; }
  .nav-links { gap: 0.95rem; font-size: 0.85rem; }
  .nav-links a.nav-logout { margin-left: 0; padding-left: 0; border-left: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .hero { padding: var(--sp-4) var(--sp-3); }
  .hero-text h1 { font-size: 2rem; }
  .hero-visual img { max-width: 180px; }
  .auth-box { margin: var(--sp-4) auto; }
  .steps { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.5rem; }
}
