/* ═══════════════════════════════════════════════════════
   SELECTIV — Premium Design System v3
   Clean · Trusted · Tech-Forward
   ═══════════════════════════════════════════════════════ */

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

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

:root {
  /* ── Backgrounds ── */
  --bg:           #07091A;
  --bg-elevated:  #0C1022;
  --bg-card:      #101426;
  --bg-input:     #090D1F;
  --bg-hover:     #141829;

  /* ── Typography ── */
  --text-primary:   #E4EBFF;
  --text-secondary: #7B8FBD;
  --text-dim:       #3D4F73;

  /* ── Blue Accent ── */
  --accent:       #4E8EF5;
  --accent-hover: #6BA3FF;
  --accent-dim:   rgba(78, 142, 245, 0.10);
  --accent-glow:  rgba(78, 142, 245, 0.04);
  --accent-ring:  rgba(78, 142, 245, 0.25);
  --accent-soft:  rgba(78, 142, 245, 0.07);

  /* ── Borders ── */
  --border:       rgba(100, 140, 220, 0.08);
  --border-mid:   rgba(100, 140, 220, 0.15);
  --border-hover: rgba(78, 142, 245, 0.32);

  /* ── Status ── */
  --success:     #4ADE80;
  --success-dim: rgba(74, 222, 128, 0.10);
  --warning:     #FBBF24;
  --warning-dim: rgba(251, 191, 36, 0.10);
  --danger:      #F87171;
  --danger-dim:  rgba(248, 113, 113, 0.10);
  --info:        #60A5FA;
  --info-dim:    rgba(96, 165, 250, 0.10);

  /* ── Layout ── */
  --sidebar-w: 232px;
  --r:    8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* ── Transitions ── */
  --t-fast: 150ms ease;
  --t-mid:  220ms ease;
}

/* ───────────────────────────────────────────────────────
   BASE
   ─────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ───────────────────────────────────────────────────────
   PAGE TRANSITIONS
   ─────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: fadeIn 0.25s var(--t-mid) both;
}

/* ───────────────────────────────────────────────────────
   APP LAYOUT
   ─────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ───────────────────────────────────────────────────────
   SIDEBAR
   ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Logo area */
.sidebar-logo-wrap {
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1;
}

.sidebar-logo span { color: var(--accent); }

.sidebar-tagline {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  margin-top: 0.3rem;
}

/* Nav section */
.sidebar-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 1.25rem 1.5rem 0.5rem;
}

.sidebar-nav { flex: 1; padding-bottom: 0.5rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.845rem;
  font-weight: 500;
  transition: all var(--t-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  letter-spacing: -0.01em;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

/* Sidebar footer / user */
.sidebar-footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent-ring);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  letter-spacing: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--t-fast);
}
.btn-logout:hover { color: var(--danger); }

/* ───────────────────────────────────────────────────────
   MAIN CONTENT
   ─────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 2rem 2.25rem;
  max-width: calc(1280px + var(--sidebar-w));
  min-height: 100vh;
}

/* ───────────────────────────────────────────────────────
   PAGE HEADER
   ─────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
  margin-top: 0.3rem;
  line-height: 1.5;
}

/* ───────────────────────────────────────────────────────
   BUTTONS
   ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r);
  font-size: 0.835rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid transparent;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #06081A;
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(78, 142, 245, 0.30);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(78, 142, 245, 0.38);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

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

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: none;
  padding: 0.4rem 0.75rem;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}
.btn-danger:hover { background: var(--danger-dim); }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.775rem; }
.btn-icon { padding: 0.4rem; border-radius: var(--r); }

.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-sm svg { width: 13px; height: 13px; }

/* ───────────────────────────────────────────────────────
   CARDS
   ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  transition: border-color var(--t-mid);
}

.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.975rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ───────────────────────────────────────────────────────
   STATS GRID
   ─────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.4rem;
  transition: border-color var(--t-mid);
}

.stat-card:hover { border-color: var(--border-hover); }

.stat-card .stat-label {
  font-size: 0.695rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.65rem;
}

.stat-card .stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card .stat-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* ───────────────────────────────────────────────────────
   FORMS
   ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: var(--r);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder { color: var(--text-dim); }
.form-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23534F5A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* ───────────────────────────────────────────────────────
   SCORE DISPLAY
   ─────────────────────────────────────────────────────── */
.score-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.score-ring.high {
  background: var(--success-dim);
  color: var(--success);
  border: 2px solid rgba(74, 222, 128, 0.25);
}
.score-ring.medium {
  background: var(--warning-dim);
  color: var(--warning);
  border: 2px solid rgba(251, 191, 36, 0.25);
}
.score-ring.low {
  background: var(--danger-dim);
  color: var(--danger);
  border: 2px solid rgba(248, 113, 113, 0.25);
}

.score-bar {
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.35rem;
}

.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-bar-fill.high  { background: var(--success); }
.score-bar-fill.medium { background: var(--warning); }
.score-bar-fill.low   { background: var(--danger); }

/* ───────────────────────────────────────────────────────
   BADGES
   ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-scored      { background: var(--accent-dim);  color: var(--accent); }
.badge-contacted   { background: var(--info-dim);    color: var(--info); }
.badge-in_talks, .badge-in-talks { background: var(--warning-dim); color: var(--warning); }
.badge-deal_closed, .badge-deal-closed { background: var(--success-dim); color: var(--success); }
.badge-rejected    { background: var(--danger-dim);  color: var(--danger); }
.badge-draft       { background: rgba(83, 79, 90, 0.2); color: var(--text-dim); }
.badge-sent        { background: var(--info-dim);    color: var(--info); }
.badge-opened      { background: var(--warning-dim); color: var(--warning); }
.badge-replied     { background: var(--success-dim); color: var(--success); }
.badge-no_response, .badge-no-response { background: var(--danger-dim); color: var(--danger); }

/* ───────────────────────────────────────────────────────
   TABLES
   ─────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--t-fast);
  cursor: pointer;
}

.data-table tbody tr:hover td {
  background: var(--bg-hover);
}

.data-table tbody tr:last-child td { border-bottom: none; }

/* ───────────────────────────────────────────────────────
   PIPELINE BAR
   ─────────────────────────────────────────────────────── */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.pipeline-stage {
  text-align: center;
  padding: 1.1rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: border-color var(--t-mid);
}

.pipeline-stage:hover { border-color: var(--border-hover); }

.pipeline-count {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.pipeline-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ───────────────────────────────────────────────────────
   BRAND CARDS
   ─────────────────────────────────────────────────────── */
.brand-card {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1.1rem 1.2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-mid);
}

.brand-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.brand-info { flex: 1; min-width: 0; }

.brand-name {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-meta {
  font-size: 0.79rem;
  color: var(--text-secondary);
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}

.brand-meta span { display: flex; align-items: center; gap: 0.3rem; }

/* ───────────────────────────────────────────────────────
   MODALS
   ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayIn 0.18s ease both;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-xl);
  padding: 1.75rem 2rem;
  width: 90%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  animation: modalIn 0.22s cubic-bezier(0.34, 1.1, 0.64, 1) both;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: all var(--t-fast);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ───────────────────────────────────────────────────────
   SCORE BREAKDOWN
   ─────────────────────────────────────────────────────── */
.score-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1rem 0;
}

.score-metric {
  text-align: center;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--r);
  border: 1px solid var(--border);
}

.score-metric-label {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}

.score-metric-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

/* ───────────────────────────────────────────────────────
   CONTACTS
   ─────────────────────────────────────────────────────── */
.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 0.45rem;
  transition: border-color var(--t-fast);
}

.contact-item:hover { border-color: var(--border-hover); }

.contact-info { display: flex; flex-direction: column; gap: 0.15rem; }
.contact-name { font-weight: 500; font-size: 0.875rem; }
.contact-detail { font-size: 0.775rem; color: var(--text-secondary); }

/* ───────────────────────────────────────────────────────
   EMPTY STATES
   ─────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--text-dim);
}

.empty-icon svg { width: 24px; height: 24px; }

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

.empty-state p {
  font-size: 0.855rem;
  color: var(--text-secondary);
  max-width: 300px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ───────────────────────────────────────────────────────
   PITCH PREVIEW
   ─────────────────────────────────────────────────────── */
.pitch-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin: 1rem 0;
}

.pitch-subject {
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.pitch-body {
  white-space: pre-wrap;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

/* ───────────────────────────────────────────────────────
   TAGS
   ─────────────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tag {
  padding: 0.18rem 0.5rem;
  background: var(--danger-dim);
  color: var(--danger);
  border-radius: 4px;
  font-size: 0.695rem;
  font-weight: 500;
}

/* ───────────────────────────────────────────────────────
   LOADING
   ─────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Skeleton loader */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--r);
}

/* ───────────────────────────────────────────────────────
   AUTH PAGE
   ─────────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
}

.auth-page::before {
  content: '';
  position: fixed;
  top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(78, 142, 245, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease both;
}

.auth-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.auth-logo span { color: var(--accent); }

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.835rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}
.auth-switch a:hover { text-decoration: underline; }

.auth-error {
  background: var(--danger-dim);
  color: var(--danger);
  padding: 0.7rem 1rem;
  border-radius: var(--r);
  font-size: 0.835rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ───────────────────────────────────────────────────────
   TOASTS
   ─────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--r-lg);
  font-size: 0.835rem;
  font-weight: 500;
  z-index: 300;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.15, 0.64, 1) both;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-success {
  background: rgba(8, 14, 30, 0.97);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.25);
}
.toast-error {
  background: rgba(8, 14, 30, 0.97);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

/* ───────────────────────────────────────────────────────
   GRID LAYOUTS
   ─────────────────────────────────────────────────────── */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ───────────────────────────────────────────────────────
   TABS
   ─────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0;
}

.tab {
  padding: 0.65rem 1.1rem;
  font-size: 0.835rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  letter-spacing: -0.01em;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ───────────────────────────────────────────────────────
   FILTER ROW
   ─────────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-row .form-select, .filter-row .form-input {
  width: auto;
  min-width: 150px;
}

/* ───────────────────────────────────────────────────────
   FOLLOW-UP TIMELINE
   ─────────────────────────────────────────────────────── */
.follow-up-timeline {
  padding: 0.875rem 1.1rem;
  background: var(--bg);
  border-top: 1px dashed var(--border);
}

.follow-up-timeline-header {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.follow-up-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.79rem;
}

.follow-up-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.follow-up-dot.scheduled { background: var(--info); box-shadow: 0 0 6px rgba(96, 165, 250, 0.5); }
.follow-up-dot.sent      { background: var(--success); }
.follow-up-dot.cancelled { background: var(--text-dim); opacity: 0.5; }

.follow-up-label       { flex: 1; color: var(--text-secondary); }
.follow-up-label strong { color: var(--text-primary); font-weight: 500; }

.follow-up-date   { font-size: 0.72rem; color: var(--text-dim); }

.follow-up-cancel {
  font-size: 0.68rem;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  opacity: 0.65;
  transition: opacity var(--t-fast);
}
.follow-up-cancel:hover { opacity: 1; background: var(--danger-dim); }

.follow-up-status {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.13rem 0.4rem;
  border-radius: 4px;
}

.follow-up-status.sent      { color: var(--success); background: var(--success-dim); }
.follow-up-status.cancelled { color: var(--text-dim); background: rgba(83, 79, 90, 0.15); text-decoration: line-through; }

.follow-up-toggle {
  font-size: 0.695rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  opacity: 0.75;
  border-radius: 4px;
  transition: all var(--t-fast);
}
.follow-up-toggle:hover { opacity: 1; background: var(--accent-dim); }

/* ───────────────────────────────────────────────────────
   DISCOVER
   ─────────────────────────────────────────────────────── */

/* Hero */
.discover-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3.5rem 2rem;
  max-width: 580px;
  margin: 0 auto;
}

.discover-hero-icon {
  width: 60px; height: 60px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-ring);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--accent);
}
.discover-hero-icon svg { width: 26px; height: 26px; }

.discover-hero h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.discover-hero p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.discover-form { width: 100%; }

.discover-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.discover-handle-wrap {
  flex: 1;
  position: relative;
  min-width: 180px;
}

.discover-at {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.875rem;
  pointer-events: none;
}

.discover-handle-input { padding-left: 1.65rem; width: 100%; }

.discover-generate-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.discover-generate-btn svg { width: 15px; height: 15px; }

.discover-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  text-align: left;
  line-height: 1.5;
}

/* Filters bar */
.discover-filters {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.875rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* Card grid */
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.discover-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--t-mid);
}

.discover-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.disc-card-header {
  padding: 0.875rem 0.875rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  position: relative;
}

.disc-rank {
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 24px;
}

.disc-logo {
  width: 36px; height: 36px;
  border-radius: 7px;
  object-fit: contain;
  background: var(--bg-elevated);
  padding: 4px;
  flex-shrink: 0;
}

.disc-logo-fallback {
  width: 36px; height: 36px;
  border-radius: 7px;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Syne', sans-serif;
}

.disc-score-badge {
  margin-left: auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.825rem;
  flex-shrink: 0;
  font-family: 'Syne', sans-serif;
}

.disc-score-high { background: var(--success-dim); color: var(--success); border: 1.5px solid rgba(74, 222, 128, 0.25); }
.disc-score-med  { background: var(--accent-dim);  color: var(--accent);  border: 1.5px solid var(--accent-ring); }
.disc-score-low  { background: var(--info-dim);    color: var(--info);    border: 1.5px solid rgba(96, 165, 250, 0.2); }

.disc-card-body {
  padding: 0 0.875rem 0.65rem;
  flex: 1;
}

.disc-brand-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.disc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.disc-tag {
  font-size: 0.655rem;
  font-weight: 500;
  padding: 0.13rem 0.4rem;
  border-radius: 4px;
  text-transform: capitalize;
}

.disc-tag-cat  { background: var(--accent-dim); color: var(--accent); }
.disc-tag-tier { background: rgba(83, 79, 90, 0.2); color: var(--text-secondary); }
.disc-tag-size { background: var(--info-dim); color: var(--info); font-size: 0.625rem; }

.disc-card-footer {
  padding: 0.65rem 0.875rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.disc-site-btn  { padding: 0.3rem 0.55rem; flex-shrink: 0; }
.disc-site-btn svg { width: 13px; height: 13px; }
.disc-add-btn   { flex: 1; justify-content: center; font-size: 0.77rem; }

/* ───────────────────────────────────────────────────────
   DIVIDER UTILITY
   ─────────────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ───────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
  .pipeline      { grid-template-columns: repeat(2, 1fr); }
  .score-breakdown { grid-template-columns: 1fr; }
  .two-col       { grid-template-columns: 1fr; }
  .discover-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }

  .main-content {
    margin-left: 0;
    padding: 1.25rem 1rem 5rem;
  }

  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .brands-grid  { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }
  .pipeline     { grid-template-columns: repeat(2, 1fr); }

  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile bottom nav */
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    z-index: 50;
    padding: 0.4rem 0.25rem;
    justify-content: space-around;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .mobile-nav .nav-item {
    flex-direction: column;
    padding: 0.5rem 0.5rem;
    font-size: 0.62rem;
    gap: 0.2rem;
    border-right: none;
    flex: 1;
    justify-content: center;
  }
  .mobile-nav .nav-item::before { display: none; }
  .mobile-nav .nav-item svg { width: 18px; height: 18px; }
  .mobile-nav .nav-item.active { border-bottom: 2px solid var(--accent); }
}

.mobile-nav { display: none; }

@media (max-width: 480px) {
  .stats-grid     { grid-template-columns: 1fr; }
  .discover-grid  { grid-template-columns: 1fr 1fr; }
  .page-header    { flex-direction: column; gap: 1rem; align-items: flex-start; }
}

@media (max-width: 380px) {
  .discover-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .discover-input-row { flex-direction: column; }
  .discover-platform, .discover-generate-btn { width: 100%; }
}

/* ── Reply Detection UI ───────────────────────────────── */

/* Glowing stat card for unread replies */
.stat-highlight {
  border-color: rgba(74, 222, 128, 0.30) !important;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.12), 0 4px 20px rgba(74, 222, 128, 0.08);
  animation: reply-pulse 2.5s ease-in-out infinite;
}

@keyframes reply-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(74,222,128,0.12), 0 4px 20px rgba(74,222,128,0.08); }
  50%       { box-shadow: 0 0 0 1px rgba(74,222,128,0.22), 0 4px 24px rgba(74,222,128,0.18); }
}

/* Unread reply row highlight */
.reply-unread {
  background: rgba(74, 222, 128, 0.03) !important;
  cursor: pointer !important;
}
.reply-unread:hover { background: rgba(74, 222, 128, 0.06) !important; }

/* Nav badge for unread count */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success);
  color: #000;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Unread dot indicator in stat label */
.unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  margin-left: 5px;
  vertical-align: middle;
  animation: dot-blink 1.8s ease-in-out infinite;
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
