/* ===== CSS Variables ===== */
:root {
  --primary: #00A878;
  --primary-hover: #008F66;
  --primary-light: #E6F7F1;
  --accent: #4F46E5;
  --accent-light: #EEF2FF;
  --secondary: #1A1A2E;
  --background: #F8F9FA;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --border-hover: #D1D5DB;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --success: #10B981;
  --success-light: #D1FAE5;
  --score-high: #10B981;
  --score-mid: #F59E0B;
  --score-low: #6B7280;
  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 220px;
  --transition: 0.15s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--background); color: var(--text-primary); line-height: 1.5; display: flex; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Sidebar ===== */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  padding: 0 0 1rem 0;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.logo-wordmark { height: 20px; width: auto; }
.sidebar-app-name {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 1px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 0.5rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-link:hover { background: var(--background); color: var(--text-primary); text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary); }
.nav-link.active .nav-icon { color: var(--primary); }
.nav-link-sm { font-size: 0.8125rem; color: var(--text-muted); }
.nav-link-sm:hover { color: var(--text-secondary); }

.nav-icon { width: 1rem; height: 1rem; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }

/* ===== Main content ===== */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  overflow-y: auto;
}

/* ===== Pages ===== */
.page { display: none; padding: 2rem; max-width: 1200px; }
.page.active { display: block; }

/* ===== Page header ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.125rem; }

/* ===== Buttons ===== */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--background); border-color: var(--border-hover); }

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.875rem;
}
.btn-danger:hover { opacity: 0.9; }

/* ===== Dashboard ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-value.accent { color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.375rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dashboard-section { margin-bottom: 1.5rem; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.section-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.section-action { font-size: 0.8125rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.section-action:hover { text-decoration: underline; }

/* Dashboard top finds */
.dash-find-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: box-shadow var(--transition);
  cursor: pointer;
}
.dash-find-card:hover { box-shadow: var(--shadow); }
.dash-find-score {
  font-size: 0.75rem;
  font-weight: 700;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-high { background: var(--success-light); color: var(--success); }
.score-mid { background: var(--warning-light); color: var(--warning); }
.score-low { background: var(--background); color: var(--text-muted); }
.dash-find-title { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.dash-find-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.dash-find-reason { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; font-style: italic; }

/* Scout status cards */
.scout-status-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.scout-status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.scout-status-name { font-size: 0.875rem; font-weight: 500; }
.scout-status-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.scout-status-count {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
}
.scout-status-count.zero { background: var(--background); color: var(--text-muted); }
.scout-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); flex-shrink: 0;
  margin-right: 0.5rem;
}
.scout-status-dot.inactive { background: var(--text-muted); }

/* Recent outreach table */
.outreach-table { width: 100%; border-collapse: collapse; }
.outreach-table th {
  text-align: left; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
}
.outreach-table td {
  font-size: 0.875rem; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.outreach-table tr:last-child td { border-bottom: none; }
.outreach-table tr:hover td { background: var(--background); }

/* ===== Filter chips ===== */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.chip {
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: white; }
.chip-count {
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(255,255,255,0.3);
  padding: 1px 5px;
  border-radius: 8px;
}
.chip.active .chip-count { background: rgba(255,255,255,0.25); }

/* ===== Scout Inbox ===== */
.scouts-inbox {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  align-items: start;
}

.scout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.scout-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }

.scout-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.scout-card-favicon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--background);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 1.125rem;
}
.scout-card-favicon img { width: 100%; height: 100%; object-fit: cover; }

.scout-card-title-block { flex: 1; min-width: 0; }
.scout-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.25rem;
}
.scout-card-title a { color: inherit; }
.scout-card-title a:hover { color: var(--primary); text-decoration: none; }
.scout-card-domain { font-size: 0.75rem; color: var(--text-muted); }

.scout-card-score-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.scout-score-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.scout-score-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.scout-score-num {
  font-size: 0.75rem;
  font-weight: 700;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

.scout-card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-source { background: var(--info-light); color: var(--info); }
.badge-source.reddit { background: #FEF0E7; color: #E07B39; }
.badge-source.kickstarter { background: #F0FDF4; color: #22C55E; }
.badge-source.dataforseo { background: var(--info-light); color: var(--info); }
.badge-source.curation_sites { background: var(--accent-light); color: var(--accent); }
.badge-category { background: var(--background); color: var(--text-secondary); }

.scout-card-reason {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-style: italic;
  border-left: 2px solid var(--border);
  padding-left: 0.625rem;
}

.scout-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.btn-approve {
  flex: 1;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-approve:hover { background: var(--primary-hover); }
.btn-reject {
  flex: 1;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-reject:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

/* Scout manager */
.scouts-manager { max-width: 700px; }
.scouts-manager-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.scouts-manager-header h3 { font-size: 1.125rem; font-weight: 600; }
.scouts-categories-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }
.scout-category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}
.scc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.scc-name { font-weight: 600; font-size: 0.9375rem; }
.scc-actions { display: flex; gap: 0.5rem; align-items: center; }
.scc-desc { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.scc-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-run {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-run:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.btn-run:disabled { opacity: 0.5; cursor: not-allowed; }

.scouts-runs-section { margin-top: 1.5rem; }
.scouts-runs-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.scouts-runs-list { display: flex; flex-direction: column; gap: 0.5rem; }
.run-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.run-category { font-weight: 600; }
.run-stats { color: var(--text-secondary); }
.run-date { color: var(--text-muted); }
.run-status { padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.run-status.completed { background: var(--success-light); color: var(--success); }
.run-status.running { background: var(--info-light); color: var(--info); }
.run-status.error { background: var(--danger-light); color: var(--danger); }

/* ===== Pipeline ===== */
.pipeline-list { display: flex; flex-direction: column; gap: 0.5rem; }
.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow var(--transition);
}
.pipeline-card:hover { box-shadow: var(--shadow); }
.pipeline-brand-name { font-weight: 600; font-size: 0.9375rem; flex: 1; min-width: 0; }
.pipeline-domain { font-size: 0.75rem; color: var(--text-muted); }
.pipeline-meta { font-size: 0.8125rem; color: var(--text-secondary); flex-shrink: 0; text-align: right; }
.pipeline-status {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}
.pipeline-status.pushed { background: var(--success-light); color: var(--success); }
.pipeline-status.pending { background: var(--warning-light); color: var(--warning); }
.pipeline-status.error { background: var(--danger-light); color: var(--danger); }
.pipeline-status.none { background: var(--background); color: var(--text-muted); }

/* ===== Search page ===== */
.search-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.search-hero-content {
  text-align: center;
  max-width: 600px;
}
.search-hero-content h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.search-hero-content p { color: var(--text-secondary); margin-bottom: 1.5rem; }

.hero-search-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.hero-search-wrapper input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--surface);
}
.hero-search-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.hero-search-wrapper .btn-primary { padding: 0.75rem 1.5rem; border-radius: var(--radius-lg); font-size: 0.9375rem; }

.search-suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.suggestion {
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.suggestion:hover { border-color: var(--primary); color: var(--primary); }

.results-search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.results-search-bar input {
  flex: 1;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
}
.results-search-bar input:focus { border-color: var(--primary); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-bar select, .filter-bar label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.625rem;
  background: var(--surface);
  cursor: pointer;
}
.filter-bar select:focus { outline: none; border-color: var(--primary); }
.filter-toggle { border: none !important; display: flex; align-items: center; gap: 0.375rem; }

.search-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 1rem;
}

.results-warning {
  background: var(--warning-light);
  color: #92400E;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid #FDE68A;
}

/* ===== Results grid (brand cards from search) ===== */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.brand-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-hover); }
.brand-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

.card-thumb-container {
  position: relative;
  width: 100%;
  height: 160px;
  background: var(--background);
  overflow: hidden;
}
.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.brand-card:hover .card-thumb-img { transform: scale(1.03); }

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.card-top-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.card-title { font-size: 0.9375rem; font-weight: 600; flex: 1; line-height: 1.3; }
.innovation-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  color: white;
}
.source-badge { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); }
.discovery-headline { font-size: 0.8125rem; color: var(--text-secondary); font-style: italic; }
.card-store { font-size: 0.75rem; color: var(--text-muted); }
.card-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.tier-badge {
  font-size: 0.6875rem; font-weight: 600; padding: 2px 7px;
  border-radius: 100px; text-transform: uppercase;
}
.tier-badge.tier-1 { background: var(--success-light); color: var(--success); }
.tier-badge.tier-2 { background: var(--info-light); color: var(--info); }
.tier-badge.tier-3 { background: var(--warning-light); color: var(--warning); }
.tier-badge.unqualified { background: var(--background); color: var(--text-muted); }

.card-metrics { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.metric { font-size: 0.75rem; color: var(--text-secondary); }
.metric-val { font-weight: 600; color: var(--text-primary); }
.card-select-wrap { display: flex; justify-content: flex-end; }
.card-select-check { width: 1rem; height: 1rem; cursor: pointer; }

.pre-launch-section { margin-top: 1.5rem; }
.pre-launch-header { margin-bottom: 1rem; }
.pre-launch-header h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.25rem; }
.pre-launch-subtitle { font-size: 0.875rem; color: var(--text-secondary); }
.pre-launch-card { opacity: 0.9; border-style: dashed; }

.selection-bar {
  position: sticky;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--secondary);
  color: white;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  margin-top: 1rem;
}
.selection-bar #selection-count { font-size: 0.875rem; font-weight: 500; flex: 1; }
.selection-bar select {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: var(--radius);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}
.selection-bar .btn-primary { background: white; color: var(--secondary); }
.selection-bar .btn-primary:hover { background: var(--background); }

.pipeline-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1rem;
}
.pipeline-step {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.pipeline-step:last-child { border-bottom: none; }
.pipeline-step-title { font-weight: 600; margin-bottom: 0.25rem; }

/* ===== Archive ===== */
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
}
.archive-filters input, .archive-filters select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--surface);
  outline: none;
  color: var(--text-primary);
}
.archive-filters input { min-width: 200px; flex: 1; }
.archive-filters input:focus, .archive-filters select:focus { border-color: var(--primary); }

.archive-list { display: flex; flex-direction: column; gap: 0.5rem; }
.archive-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow var(--transition);
}
.archive-card:hover { box-shadow: var(--shadow); }
.archive-card-main { flex: 1; min-width: 0; }
.archive-card-name { font-weight: 600; font-size: 0.9375rem; }
.archive-card-url { font-size: 0.75rem; color: var(--text-muted); }
.archive-card-meta { font-size: 0.8125rem; color: var(--text-secondary); flex-shrink: 0; text-align: right; }
.archive-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ===== Templates / Tags ===== */
.templates-list { display: flex; flex-direction: column; gap: 0.75rem; }
.template-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.template-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.375rem; }
.template-name { font-weight: 600; }
.template-actions { display: flex; gap: 0.5rem; }
.template-preview { font-size: 0.8125rem; color: var(--text-secondary); }

.template-editor { display: flex; flex-direction: column; gap: 0.75rem; max-width: 700px; }
.template-editor input, .template-editor textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--surface);
  outline: none;
  resize: vertical;
  color: var(--text-primary);
}
.template-editor input:focus, .template-editor textarea:focus { border-color: var(--primary); }
.editor-actions { display: flex; gap: 0.5rem; }

.tags-list { display: flex; flex-direction: column; gap: 0.5rem; }
.tag-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tag-swatch { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.tag-name-text { font-size: 0.875rem; font-weight: 500; flex: 1; }
.tag-editor { display: flex; flex-direction: column; gap: 0.75rem; max-width: 400px; margin-top: 1rem; }
.tag-editor input {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  outline: none;
  background: var(--surface);
}
.tag-editor input:focus { border-color: var(--primary); }
.color-palette { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.color-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  transition: transform var(--transition);
  border: 2px solid transparent;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text-primary); }

/* ===== Settings ===== */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  max-width: 700px;
}
.settings-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.settings-hint { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.settings-section select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.875rem;
  margin-right: 0.5rem;
  outline: none;
}
.api-status-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.api-status-item {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.875rem; padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.api-status-item:last-child { border-bottom: none; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.green { background: var(--success); }
.status-dot.red { background: var(--danger); }
.api-name { font-weight: 500; flex: 1; }
.api-state-text.green { color: var(--success); font-size: 0.75rem; font-weight: 600; }
.api-state-text.red { color: var(--danger); font-size: 0.75rem; font-weight: 600; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-title { font-size: 1.125rem; font-weight: 700; }
.modal-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.125rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text-primary); }

.modal-loading {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.modal-brand-info {
  margin: 1rem 1.5rem;
  padding: 0.875rem 1rem;
  background: var(--background);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
}
.modal-brand-stat { }
.modal-brand-stat-label { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 1px; }
.modal-brand-stat-val { font-weight: 600; color: var(--text-primary); }

.modal-email-section { padding: 0 1.5rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-field { display: flex; flex-direction: column; gap: 0.375rem; }
.modal-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.modal-input, .modal-select {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
}
.modal-input:focus, .modal-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.modal-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  font-family: var(--font);
  line-height: 1.6;
}
.modal-field .btn-secondary { align-self: flex-start; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--surface);
}
.modal-send-status {
  text-align: center;
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
}
.modal-send-status.success { color: var(--success); }
.modal-send-status.error { color: var(--danger); }

/* ===== Shared / Utility ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}
.empty-icon {
  width: 48px; height: 48px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.empty-icon svg { width: 100%; height: 100%; }
.empty-state h2 { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.375rem; }
.empty-state p { font-size: 0.875rem; color: var(--text-secondary); max-width: 400px; }

.loading-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
}

/* Card animations */
.card-fade-out {
  transition: opacity 0.3s ease, transform 0.3s ease !important;
  opacity: 0 !important;
  transform: scale(0.96) !important;
}
