:root {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: #151e31;
  --bg-card-hover: #1b263e;
  --bg-elevated: #1e293b;
  --border: rgba(148, 163, 184, 0.14);
  --border-accent: rgba(99, 102, 241, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.15);
  --sky: #0ea5e9;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* TOP GLOBAL BAR */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(9, 13, 22, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.brand-title {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.mode-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.38rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--accent-soft);
  color: #fff;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.32);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.45);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.28);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
}

/* LANDING VIEW */
.landing-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

.hero-section {
  text-align: center;
  max-width: 880px;
  margin: 0 auto 4rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2.2rem;
}

.hero-url-box {
  display: flex;
  gap: 0.65rem;
  max-width: 680px;
  margin: 0 auto 1.25rem;
  background: var(--bg-secondary);
  padding: 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-accent);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.18);
}

.hero-url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  font-size: 0.98rem;
  outline: none;
}

.hero-trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.pricing-section {
  margin-top: 3rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.price-card.popular {
  border-color: var(--accent);
  box-shadow: 0 20px 50px rgba(99, 102, 241, 0.22);
}

.popular-ribbon {
  position: absolute;
  top: -12px;
  right: 20px;
  background: linear-gradient(135deg, #6366f1, #10b981);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0.75rem 0;
}

.price-amount span {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.price-features {
  list-style: none;
  margin: 1.25rem 0 1.75rem;
  flex: 1;
}

.price-features li {
  padding: 0.45rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* SAAAS WORKSPACE LAYOUT */
.workspace-layout {
  display: grid;
  grid-template-columns: 255px 1fr;
  min-height: calc(100vh - 67px);
}

.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  transition: all 0.15s;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.side-link.active {
  background: var(--accent-soft);
  color: #a5b4fc;
  border-left: 3px solid var(--accent);
}

.side-badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald);
  font-weight: 700;
}

.campaign-box {
  margin-top: 1.5rem;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.campaign-select {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 0.83rem;
}

.main-content {
  padding: 1.5rem 2rem 3rem;
  overflow-y: auto;
}

/* KPI BAR */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 0.3rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.kpi-trend {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--emerald);
}

/* RADAR TOOLBAR */
.radar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-pill {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* RADAR SPLIT VIEW */
.radar-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}

.leads-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  cursor: pointer;
  transition: all 0.18s;
}

.lead-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--bg-card-hover);
}

.lead-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 30px rgba(99, 102, 241, 0.16);
}

.lead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.platform-reddit {
  background: rgba(255, 69, 0, 0.16);
  color: #ff7b47;
}

.platform-hackernews {
  background: rgba(249, 115, 22, 0.18);
  color: #fb923c;
}

.platform-x {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

.platform-github {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
}

.intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.intent-hot {
  background: var(--emerald-soft);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.intent-warm {
  background: var(--amber-soft);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.lead-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}

.lead-snippet {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* REPLY STUDIO PANEL */
.reply-studio {
  position: sticky;
  top: 84px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
}

.studio-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
}

.why-hot-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
  color: #a7f3d0;
  margin-bottom: 1rem;
}

.tone-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.tone-btn {
  padding: 0.5rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.tone-btn.active {
  background: var(--accent-soft);
  color: #fff;
  border-color: var(--accent);
}

.reply-textarea {
  width: 100%;
  min-height: 210px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.85rem;
  font-family: inherit;
  font-size: 0.87rem;
  line-height: 1.55;
  resize: vertical;
  margin-bottom: 0.85rem;
}

.safety-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

/* FORMS & CARDS */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-textarea {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.crm-table th, .crm-table td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.crm-table th {
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: #1e293b;
  border: 1px solid var(--emerald);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .radar-split {
    grid-template-columns: 1fr;
  }
  .reply-studio {
    position: static;
  }
}
