/* Lead Engine v3 — Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #1c2333;
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(255,255,255,0.12);
  --text:        #e6edf3;
  --text-muted:  #7d8590;
  --text-sub:    #9198a1;
  --accent:      #7c3aed;
  --accent-glow: rgba(124,58,237,0.25);
  --green:       #34d399;
  --blue:        #60a5fa;
  --yellow:      #fbbf24;
  --red:         #f87171;
  --sidebar-w:   240px;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
pre, code { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
body { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
}

.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px;
  max-width: 1400px;
}

/* ── Sidebar Brand ────────────────────────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.brand-icon { font-size: 1.4rem; }
.brand-name { font-weight: 700; font-size: 0.9rem; letter-spacing: -0.01em; }
.brand-sub  { font-size: 0.7rem; color: var(--text-muted); }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 12px 8px 4px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 500; color: var(--text-sub);
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--accent-glow); color: #a78bfa; font-weight: 600; }
.badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
  min-width: 20px; text-align: center;
}

/* ── Scrape Controls ──────────────────────────────────────────────────────── */
.scrape-controls {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 0 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.btn-scrape {
  width: 100%; padding: 9px 12px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-scrape:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn-scrape:active { transform: translateY(0); }
.btn-scrape--quick { background: var(--surface2); color: var(--text-muted); font-size: 0.72rem; border: 1px solid var(--border2); }
.btn-scrape--quick:hover { background: var(--border2); color: var(--text); }

/* ── Sidebar scrape-running block ─────────────────────────────────────────── */
.scrape-running-block {
  background: linear-gradient(160deg, #0f172a, #1e1b4b);
  border: 1px solid #6366f144;
  border-radius: 12px;
  padding: 14px 12px 10px;
  box-shadow: 0 0 20px rgba(99,102,241,0.2);
  animation: srb-glow 2.5s ease-in-out infinite;
}
@keyframes srb-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(99,102,241,0.15); }
  50%       { box-shadow: 0 0 24px rgba(99,102,241,0.35); }
}
.srb-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.srb-spinner {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2.5px solid #6366f133;
  border-top-color: #818cf8;
  animation: spin 0.85s linear infinite;
}
.srb-text { flex: 1; min-width: 0; }
.srb-title { font-size: 0.74rem; font-weight: 700; color: #a5b4fc; }
.srb-stage { font-size: 0.65rem; color: #818cf8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srb-timer {
  font-size: 1.1rem; font-weight: 800; color: #c7d2fe;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.srb-bar-track {
  height: 3px; background: #1e1b4b; border-radius: 99px;
  overflow: hidden; margin-bottom: 8px;
}
.srb-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 99px;
  transition: width 2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 6px #818cf8;
}
.srb-hint { font-size: 0.62rem; color: #6366f1; text-align: center; opacity: 0.8; }

/* ── Sidebar Footer ──────────────────────────────────────────────────────── */
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 0;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: 0.8rem; font-weight: 600; }
.user-role { font-size: 0.68rem; color: var(--text-muted); }
.logout-btn {
  margin-left: auto; font-size: 1rem; color: var(--text-muted);
  padding: 4px; border-radius: 4px;
  transition: color 0.15s;
}
.logout-btn:hover { color: var(--red); }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-title   { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }
.page-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-top: 3px; }
.step-tag {
  font-size: 0.72rem; font-weight: 600; padding: 4px 12px;
  border-radius: 999px; background: var(--accent-glow);
  border: 1px solid #7c3aed55; color: #a78bfa;
  white-space: nowrap; align-self: flex-start; margin-top: 4px;
}

/* ── Cards Grid ──────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  overflow: hidden;
}
.job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border2);
}

/* Tier left-border accents */
.job-card--tier1 { border-left: 3px solid var(--green) !important; }
.job-card--tier2 { border-left: 3px solid var(--blue)  !important; }
.job-card--tier3 { border-left: 3px solid var(--yellow) !important; }

.card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px 6px;
  gap: 8px;
}
.card-badges { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }

/* Tier badges */
.tier-badge {
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em;
}
.tier-1 { background: #065f4622; color: var(--green); border: 1px solid #34d39955; }
.tier-2 { background: #1e3a8a22; color: var(--blue);  border: 1px solid #60a5fa55; }
.tier-3 { background: #78350f22; color: var(--yellow); border: 1px solid #fbbf2455; }

.score {
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}

/* ICP tier (legacy compat) */
.icp { padding: 2px 9px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; }
.icp-1 { background: #065f4622; color: var(--green); border: 1px solid #34d39955; }
.icp-2 { background: #1e3a8a22; color: var(--blue);  border: 1px solid #60a5fa55; }
.icp-3 { background: #78350f22; color: var(--yellow); border: 1px solid #fbbf2455; }

.remote-tag {
  padding: 2px 7px; border-radius: 999px; font-size: 0.66rem; font-weight: 600;
  background: #0c4a6e22; color: #38bdf8; border: 1px solid #38bdf844;
}

.type-tag {
  padding: 2px 7px; border-radius: 999px; font-size: 0.66rem; font-weight: 600;
  text-transform: capitalize;
  background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
}
.type-tag.type-contract, .type-tag.type-part-time, .type-tag.type-freelance {
  background: #065f4622; color: var(--green); border-color: #34d39944;
}
.type-tag.type-temporary {
  background: #78350f22; color: var(--yellow); border-color: #fbbf2444;
}

.date-posted { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }

.card-body { padding: 6px 14px 10px; flex: 1; }
.job-title  { font-size: 0.9rem; font-weight: 600; margin-bottom: 5px; line-height: 1.3; }
.job-meta   { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.74rem; color: var(--text-muted); margin-bottom: 8px; }
.company    { font-weight: 600; color: var(--text-sub); }
.sep        { color: var(--border2); }
.source     { color: var(--text-muted); font-style: italic; }
.snippet    { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.email-hint {
  margin-top: 8px; font-size: 0.74rem; color: #34d399;
  background: #065f4612; border: 1px solid #34d39930;
  padding: 4px 10px; border-radius: 6px;
}
.email-hint code { font-size: 0.72rem; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.actions { display: flex; gap: 6px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px;
}
.btn-link    { background: transparent; border-color: var(--border2); color: var(--text-muted); }
.btn-link:hover { border-color: var(--accent); color: var(--text); }
.btn-skip    { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-skip:hover { border-color: var(--border2); color: var(--text); }
.btn-reject  { background: #7f1d1d22; border-color: #f8717155; color: var(--red); }
.btn-reject:hover { background: #7f1d1d44; }
.btn-approve { background: #065f4622; border-color: #34d39955; color: var(--green); }
.btn-approve:hover { background: #065f4644; }
.btn-danger  { background: var(--red); color: #fff; border: none; }
.btn-danger:hover { opacity: 0.85; }
.btn-ghost   { background: transparent; border-color: var(--border2); color: var(--text-sub); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 0.72rem; }

/* ── Priority Legend ─────────────────────────────────────────────────────── */
.priority-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.legend-item   { display: flex; align-items: center; gap: 8px; }
.legend-label  { font-size: 0.76rem; color: var(--text-muted); }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty {
  text-align: center; padding: 80px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty h2   { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty p    { font-size: 0.84rem; line-height: 1.7; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 14px; padding: 28px;
  width: min(500px, 90vw); box-shadow: var(--shadow);
}
.modal--wide { width: min(720px, 95vw); }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-sub   { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 14px; }
.modal-select {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); font-size: 0.82rem; margin-bottom: 10px;
}
.modal-textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); font-size: 0.82rem; resize: vertical;
  min-height: 80px; margin-bottom: 16px;
  font-family: inherit;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Pitch output ────────────────────────────────────────────────────────── */
.pitch-output { display: flex; flex-direction: column; gap: 16px; }
.pitch-section {}
.pitch-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 6px; }
.pitch-value {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
  font-size: 0.83rem; line-height: 1.6; color: var(--text);
  cursor: pointer; transition: background 0.2s;
}
.pitch-value:hover { background: var(--surface2); border-color: var(--accent); }
.pitch-bullets { list-style: none; display: flex; flex-direction: column; gap: 6px; padding-left: 0; }
.pitch-bullets li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px; font-size: 0.8rem;
}
.pitch-hint { font-size: 0.72rem; color: var(--text-muted); text-align: center; margin-top: 4px; }

/* ── Test Panel ──────────────────────────────────────────────────────────── */
.test-panel {
  position: fixed; bottom: 24px; right: 24px;
  width: 360px; max-height: 480px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; z-index: 200;
  overflow: hidden;
}
.test-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 600;
}
.test-panel-header button {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 0.9rem; padding: 2px 6px;
}
.test-panel-header button:hover { color: var(--red); }
.test-panel-body { overflow-y: auto; padding: 10px; flex: 1; }
.tp-summary { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; padding: 6px 8px; }
.tp-job {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; margin-bottom: 3px;
  font-size: 0.76rem;
}
.tp-new { background: #065f4612; }
.tp-dup { opacity: 0.45; }
.tp-tier {
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 4px;
  background: var(--accent-glow); color: #a78bfa;
  flex-shrink: 0;
}
.tp-title { flex: 1; color: var(--text); }
.tp-badge {
  font-size: 0.6rem; font-weight: 700; padding: 1px 5px;
  border-radius: 3px; background: var(--green); color: #000;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600;
  z-index: 9999; transition: opacity 0.2s;
  box-shadow: var(--shadow);
}
.toast-success { background: #065f46; color: var(--green); border: 1px solid #34d39955; }
.toast-info    { background: #1e3a5f; color: var(--blue);  border: 1px solid #60a5fa55; }
.toast-error   { background: #7f1d1d; color: var(--red);   border: 1px solid #f8717155; }

/* ── Hidden ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Profile page ────────────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.profile-card--wide { grid-column: 1 / -1; }
.profile-card-title { font-size: 0.92rem; font-weight: 700; margin-bottom: 6px; }
.profile-card-sub   { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.profile-status { font-size: 0.76rem; padding: 8px 12px; border-radius: 6px; margin-top: 10px; }
.profile-status--ok   { background: #065f4620; border: 1px solid #34d39940; color: var(--green); }
.profile-status--warn { background: #78350f20; border: 1px solid #fbbf2440; color: var(--yellow); }

.upload-zone {
  border: 2px dashed var(--border2); border-radius: 10px;
  padding: 28px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: var(--accent-glow);
}
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-zone p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }
.cv-preview {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; font-size: 0.72rem; line-height: 1.6;
  color: var(--text-muted); overflow: auto; max-height: 300px;
  white-space: pre-wrap; word-break: break-word;
}

.pitch-flow {
  display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.pitch-step {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; flex: 1; min-width: 160px;
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.5;
}
.pitch-step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pitch-arrow { font-size: 1.2rem; color: var(--text-muted); padding-top: 10px; }
.pitch-note {
  font-size: 0.78rem; color: var(--text-muted);
  background: var(--accent-glow); border: 1px solid #7c3aed40;
  border-radius: 8px; padding: 10px 14px; line-height: 1.6;
}

/* ── Settings page ───────────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.settings-card--wide { grid-column: 1 / -1; }
.settings-card-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 14px; }
.kw-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kw-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 500;
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text-sub);
}
.kw-remove { cursor: pointer; color: var(--text-muted); transition: color 0.15s; }
.kw-remove:hover { color: var(--red); }
.kw-input-row { display: flex; gap: 8px; }
.kw-input {
  flex: 1; padding: 7px 12px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.8rem; font-family: inherit;
}
.kw-input:focus { outline: none; border-color: var(--accent); }

/* ── Insights / Leads pages ──────────────────────────────────────────────── */
.stats-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; flex: 1; min-width: 120px;
}
.stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.leads-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.leads-table th {
  text-align: left; padding: 8px 12px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.leads-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leads-table tr:hover td { background: var(--surface2); }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 60% 30%, #1a0a2e 0%, var(--bg) 70%);
}
.login-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 16px; padding: 36px 40px; width: min(400px, 92vw);
  box-shadow: var(--shadow);
}
.login-logo  { font-size: 2rem; margin-bottom: 4px; }
.login-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.login-sub   { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 24px; }
.login-input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font-size: 0.9rem; margin-bottom: 12px;
  font-family: inherit; letter-spacing: 0.1em;
}
.login-input:focus { outline: none; border-color: var(--accent); }
.login-btn {
  width: 100%; padding: 11px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; border: none;
  font-size: 0.9rem; font-weight: 700; letter-spacing: 0.02em;
  transition: opacity 0.15s;
}
.login-btn:hover { opacity: 0.88; }
.flash-error {
  background: #7f1d1d22; border: 1px solid #f8717155; color: var(--red);
  padding: 8px 12px; border-radius: 6px; font-size: 0.8rem; margin-bottom: 12px;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Scrape Progress Banner ───────────────────────────────────────────────── */
.scrape-banner {
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
}

/* IDLE */
.scrape-banner--idle {
  background: var(--surface2);
  border-color: var(--border);
}
.banner-idle {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 0.78rem; color: var(--text-muted);
}
.banner-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
}
.banner-last-ran {
  margin-left: auto; font-size: 0.72rem; color: var(--text-muted); opacity: 0.7;
}

/* RUNNING */
.scrape-banner--running {
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  border-color: #6366f155;
  box-shadow: 0 0 0 1px #6366f122, 0 4px 24px rgba(99,102,241,0.15);
}
.banner-running { padding: 14px 18px 0; }
.banner-run-top {
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}
.banner-spinner {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid #6366f133;
  border-top-color: #818cf8;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.banner-run-info { flex: 1; }
.banner-run-title {
  font-size: 0.82rem; font-weight: 700; color: #a5b4fc;
  margin-bottom: 2px;
}
.banner-run-stage {
  font-size: 0.74rem; color: #818cf8; opacity: 0.85;
  transition: opacity 0.3s;
}
.banner-timer-wrap {
  text-align: center; flex-shrink: 0;
}
.banner-timer {
  font-size: 1.6rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #c7d2fe; letter-spacing: -0.04em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.banner-timer-label {
  font-size: 0.62rem; color: #818cf8; text-transform: uppercase;
  letter-spacing: 0.08em; margin-top: -2px;
}
.banner-eta {
  font-size: 0.72rem; color: #818cf8; text-align: right;
  min-width: 80px; flex-shrink: 0;
}
.banner-progress-track {
  height: 3px; background: #1e1b4b; border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.banner-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #6366f1, #818cf8, #a78bfa);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px #818cf888;
}

/* DONE */
.scrape-banner--done {
  background: #052e16;
  border-color: #34d39955;
}
.banner-done {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; font-size: 0.8rem;
}
.banner-done-icon { font-size: 1.1rem; }
#bannerDoneText  { font-weight: 700; color: var(--green); }
.banner-done-stats { color: var(--text-muted); font-size: 0.75rem; }
.banner-done-queue {
  margin-left: auto; font-weight: 700; color: var(--green);
  font-size: 0.78rem;
}

/* ── Status Tabs ─────────────────────────────────────────────────────────── */
.status-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.status-tab {
  padding: 8px 16px; border-radius: 8px 8px 0 0;
  font-size: 0.78rem; font-weight: 600;
  background: transparent; border: 1px solid transparent;
  border-bottom: none; color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
  position: relative; bottom: -1px;
}
.status-tab:hover { color: var(--text); background: var(--surface); }
.status-tab.active {
  background: var(--surface);
  border-color: var(--border); border-bottom-color: var(--surface);
  color: var(--text);
}

/* ── Settings Panels ─────────────────────────────────────────────────────── */
.settings-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 22px;
}
.tab-desc { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }

/* ── Keyword Editor ──────────────────────────────────────────────────────── */
.keyword-section { margin-bottom: 28px; }
.kw-title {
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  margin-bottom: 10px;
}
.kw-hint { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.kw-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px; min-height: 32px;
}
.kw-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text-sub);
}
.kw-rm {
  background: none; border: none; color: var(--text-muted);
  font-size: 0.9rem; line-height: 1; padding: 0 2px;
  cursor: pointer; transition: color 0.15s;
}
.kw-rm:hover { color: var(--red); }
.kw-add-row { display: flex; gap: 8px; align-items: center; }
.kw-input {
  flex: 1; padding: 7px 12px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.8rem; font-family: inherit;
}
.kw-input:focus { outline: none; border-color: var(--accent); }

/* ── Location rows ───────────────────────────────────────────────────────── */
.location-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.location-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.8rem;
}
.loc-name   { flex: 1; font-weight: 500; }
.loc-radius { font-size: 0.72rem; color: var(--text-muted); }
.loc-suffix { font-size: 0.72rem; color: #a78bfa; font-style: italic; }

/* ── Schedule form ───────────────────────────────────────────────────────── */
.schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.76rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.field-select, .field-input {
  padding: 8px 12px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.82rem; font-family: inherit;
}
.field-select:focus, .field-input:focus { outline: none; border-color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar  { width: 200px; }
  .content  { margin-left: 200px; padding: 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  .profile-grid, .settings-grid { grid-template-columns: 1fr; }
  .profile-card--wide, .settings-card--wide { grid-column: 1; }
}
@media (max-width: 640px) {
  .sidebar  { display: none; }
  .content  { margin-left: 0; padding: 16px; }
}
