:root {
  --bg: #0F1A0F;
  --surface: #162016;
  --surface2: #1E2A1E;
  --fg: #E8F0E8;
  --fg-muted: #8BA88B;
  --accent: #F59E0B;
  --accent-dim: #C4820A;
  --border: #2A3D2A;
  --green-tint: rgba(245, 158, 11, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* Navbar */
.navbar {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.nav-tagline {
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 500;
}

/* Section label */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* Hero */
.hero {
  padding: 80px 40px 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-text h1 {
  font-size: clamp(40px, 5vw, 64px);
  color: var(--fg);
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}
.hero-lede {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 24px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-tint);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Hero Widget */
.hero-widget {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pipeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pipeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface2);
  font-size: 13px;
}
.pipeline-row.active {
  border: 1px solid var(--accent-dim);
  background: var(--green-tint);
}
.pipeline-row.warm {
  border: 1px solid #4CAF50;
  background: rgba(76, 175, 80, 0.08);
}
.plabel { color: var(--fg-muted); font-weight: 500; }
.pcount { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--fg); }

.email-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 13px;
}
.email-to { color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.email-subject { color: var(--fg); font-weight: 600; margin-bottom: 8px; }
.email-body { color: var(--fg-muted); line-height: 1.5; margin-bottom: 12px; }
.email-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.status-sent { color: var(--fg-muted); font-size: 12px; }
.status-reply {
  background: rgba(76, 175, 80, 0.15);
  color: #6FCF6F;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

/* How Section */
.how {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 40px;
}
.how-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.how h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  margin-bottom: 48px;
  max-width: 500px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.step {
  background: var(--surface);
  padding: 28px 24px;
}
.step-num {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}
.step h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.step p {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Outcomes */
.outcomes {
  padding: 80px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.outcomes h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  max-width: 520px;
  margin-bottom: 48px;
}
.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.outcome {
  background: var(--surface);
  padding: 28px 24px;
}
.outcome-icon {
  margin-bottom: 16px;
}
.outcome h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.outcome p {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Features */
.features {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 80px 40px;
}
.features-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.features h2 {
  font-size: clamp(28px, 3.5vw, 42px);
  max-width: 500px;
  margin-bottom: 48px;
}
.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.feature {
  background: var(--surface2);
  padding: 24px 24px;
}
.feature h3 {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--accent);
}
.feature p {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Closing */
.closing {
  padding: 100px 40px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.closing h2 {
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.closing-sub {
  font-size: 18px;
  color: var(--fg-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.footer-logo {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}
.footer-brand p {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.footer-meta {
  font-size: 12px;
  color: var(--fg-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .outcomes-grid { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 60px 24px 40px; }
  .how, .outcomes, .features { padding: 60px 24px; }
  .closing { padding: 80px 24px; }
  .footer-inner { flex-direction: column; gap: 20px; align-items: flex-start; }
}
@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
}

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-navbar .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}
.app-navbar .nav-logo {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}
.app-navbar .nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}
.app-navbar .nav-link {
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.app-navbar .nav-link:hover { background: var(--surface2); color: var(--fg); }
.app-navbar .nav-user { margin-left: auto; }

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
  width: 100%;
  flex: 1;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.app-header h1 {
  font-size: 28px;
  color: var(--fg);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #0F1A0F;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { border-color: var(--fg-muted); }

.btn-ghost {
  background: none;
  color: var(--fg-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--surface2); color: var(--fg); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn-link { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; padding: 0; text-decoration: underline; }
.btn-icon { background: none; border: none; color: var(--fg-muted); font-size: 18px; cursor: pointer; padding: 0; line-height: 1; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--fg-muted); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--accent); }
input[type="file"] { color: var(--fg-muted); font-size: 14px; padding: 10px 0; }
.form-error { color: #EF4444; font-size: 13px; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); padding: 10px 14px; border-radius: 8px; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.auth-title { font-size: 24px; margin-bottom: 8px; }
.auth-subtitle { color: var(--fg-muted); font-size: 14px; margin-bottom: 28px; }
.auth-form { margin-bottom: 20px; }
.auth-footer { font-size: 14px; color: var(--fg-muted); text-align: center; }
.auth-footer a { color: var(--accent); text-decoration: none; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
}
.modal-content h2 { font-size: 20px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; color: var(--fg); margin-bottom: 8px; }
.empty-state p { font-size: 15px; margin-bottom: 24px; }

/* Campaign grid */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}
.campaign-card:hover { border-color: var(--accent); background: var(--surface2); }
.campaign-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.campaign-card-header h3 { font-size: 16px; font-weight: 700; color: var(--fg); }
.campaign-stats { display: flex; gap: 24px; margin-bottom: 12px; }
.stat { display: flex; flex-direction: column; }
.stat-val { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; color: var(--fg); }
.stat-label { font-size: 12px; color: var(--fg-muted); margin-top: 2px; }
.campaign-progress-bar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s; }

/* Campaign detail */
.campaign-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 32px; gap: 24px; flex-wrap: wrap; }
.campaign-header h1 { font-size: 24px; margin-bottom: 8px; }
.breadcrumb { font-size: 13px; color: var(--fg-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--fg-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--fg); }
.campaign-meta { font-size: 14px; color: var(--fg-muted); }
.campaign-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* Prospect table */
.prospect-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.prospect-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.prospect-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}
.prospect-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.prospect-table tr:last-child td { border-bottom: none; }
.prospect-table tr:hover td { background: var(--surface2); }
.td-name { font-weight: 600; }
.td-email { color: var(--fg-muted); font-size: 13px; }
.td-research { white-space: nowrap; }
.td-research .btn-link { font-size: 13px; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: capitalize;
}
.status-pending { background: rgba(139,168,139,0.1); color: var(--fg-muted); border: 1px solid var(--border); }
.status-researching { background: rgba(245,158,11,0.1); color: var(--accent); border: 1px solid rgba(245,158,11,0.2); }
.status-researched { background: rgba(76,175,80,0.1); color: #6FCF6F; border: 1px solid rgba(76,175,80,0.2); }
.status-failed { background: rgba(239,68,68,0.1); color: #EF4444; border: 1px solid rgba(239,68,68,0.2); }
.badge-active { background: rgba(245,158,11,0.1); color: var(--accent); border: 1px solid rgba(245,158,11,0.2); }

/* Spinner */
.research-spinner { display: inline-block; animation: spin 1s linear infinite; color: var(--accent); font-size: 16px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Research results modal */
.research-content { font-size: 14px; line-height: 1.7; }
.research-section { margin-bottom: 20px; color: var(--fg-muted); }
.research-section strong { color: var(--fg); display: block; margin-bottom: 6px; font-size: 13px; }
.ai-summary { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; white-space: pre-wrap; font-size: 13px; color: var(--fg); line-height: 1.7; margin-top: 6px; }
.sources-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sources-list li { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.sources-list a { color: var(--accent); text-decoration: none; }
.sources-list a:hover { text-decoration: underline; }