/* ── JobGuru Dashboard — Cloudflare-inspired ─────────────────────── */

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

:root {
  /* Content area */
  --bg-primary: #f5f6fa;
  --bg-secondary: #eef0f6;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbff;
  --bg-input: #ffffff;
  --border: #e2e4eb;
  --border-card: #e2e4eb;
  --text-primary: #1a1c23;
  --text-secondary: #5f6368;
  --text-muted: #8b8d97;

  /* Sidebar */
  --bg-sidebar: #1b1f3b;
  --sidebar-text: #b0b5d0;
  --sidebar-text-hover: #ffffff;
  --sidebar-active-bg: rgba(255, 255, 255, 0.1);
  --sidebar-border: rgba(255, 255, 255, 0.06);

  /* Accent — Cloudflare orange influence but keeping brand indigo */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-text: #ffffff;
  --accent-dim: rgba(79, 70, 229, 0.08);
  --accent-light: #6366f1;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-dim: rgba(79, 70, 229, 0.08);

  /* Semantic */
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.08);
  --yellow: #d97706;
  --red: #dc2626;
  --orange: #f6821f;

  /* Layout */
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --bg-primary: #111318;
  --bg-secondary: #1a1c24;
  --bg-card: #1e2029;
  --bg-card-hover: #252733;
  --bg-input: #252733;
  --border: #2e303a;
  --border-card: #2e303a;
  --text-primary: #e8e9ed;
  --text-secondary: #9ca0ab;
  --text-muted: #6b6f7b;

  --bg-sidebar: #0d0f1a;
  --sidebar-text: #7a7f96;
  --sidebar-text-hover: #e2e4f0;
  --sidebar-active-bg: rgba(255, 255, 255, 0.08);
  --sidebar-border: rgba(255, 255, 255, 0.04);

  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-text: #0f0f1a;
  --accent-dim: rgba(129, 140, 248, 0.12);
  --accent-light: #a5b4fc;
  --brand: #818cf8;
  --brand-hover: #a5b4fc;
  --brand-dim: rgba(129, 140, 248, 0.12);

  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Theme toggle ────────────────────────────────────────────────── */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ── Reset ───────────────────────────────────────────────────────── */

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-size: 14px;
}

body::before,
body::after {
  display: none;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 3px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); }

/* ── Sidebar ─────────────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.2s ease;
  border-right: none;
}

[data-theme="dark"] .sidebar {
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: #ffffff;
  height: 56px;
}

.logo-icon {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #ffffff;
  flex-shrink: 0;
  border-radius: 6px;
}

.logo-text {
  color: #ffffff;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-separator {
  height: 1px;
  background: var(--sidebar-border);
  margin: 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all 0.12s ease;
  cursor: pointer;
}

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

.nav-item.active {
  color: #ffffff;
  background: var(--sidebar-active-bg);
  font-weight: 600;
}

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

.nav-item { position: relative; }

.nav-item svg {
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active svg,
.nav-item:hover svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-details {
  overflow: hidden;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 11px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--sidebar-text);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.12s;
  font-family: inherit;
}

.btn-logout:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

/* ── Main Content ────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.page {
  display: none;
  padding: 24px 28px;
  max-width: 1200px;
  width: 100%;
}

.page.active {
  display: block;
}

/* ── Stat Cards ──────────────────────────────────────────────────── */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-card.accent {
  border-left: 3px solid var(--accent);
}

.stat-card.green {
  border-left: 3px solid var(--green);
}

/* ── Cards ────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-body {
  padding: 20px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

/* ── Tables ───────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.1s;
}

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

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

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 16px !important;
  font-size: 13px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
  white-space: nowrap;
}

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

.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
  white-space: nowrap;
}

.btn-small:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-small:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--red);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-small.btn-danger {
  padding: 5px 12px;
  font-size: 12px;
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}

.btn-small.btn-danger:hover {
  background: var(--red);
  color: #ffffff;
  opacity: 1;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* ── Score badges ─────────────────────────────────────────────────── */

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.score-high {
  background: var(--green-dim);
  color: var(--green);
}

.score-mid {
  background: rgba(217, 119, 6, 0.08);
  color: var(--yellow);
}

.score-low {
  background: rgba(220, 38, 38, 0.08);
  color: var(--red);
}

/* ── Status badges ────────────────────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-applied {
  background: var(--green-dim);
  color: var(--green);
}

.status-scored {
  background: var(--accent-dim);
  color: var(--accent);
}

.status-pending {
  background: rgba(217, 119, 6, 0.08);
  color: var(--yellow);
}

.status-failed {
  color: var(--red);
}

/* ── Forms & Inputs ──────────────────────────────────────────────── */

.setup-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

.setup-section-label:first-child {
  margin-top: 8px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.setup-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setup-field.full {
  grid-column: span 2;
}

.setup-field span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.setup-field input,
.setup-field select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.setup-field input:focus,
.setup-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.setup-field input::placeholder {
  color: var(--text-muted);
}

.setup-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

/* Settings page inputs */

.settings-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.settings-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.settings-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.settings-form-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-form-actions {
  margin-top: 4px;
}

/* Settings grid / fields */

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}

.settings-slider-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 20px;
  text-align: center;
}

.settings-select {
  width: 100%;
  max-width: 280px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.settings-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Toggle switch */

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.settings-toggle input {
  display: none;
}

.settings-toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.settings-toggle input:checked + .settings-toggle-track {
  background: var(--accent);
}

.settings-toggle-thumb {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.settings-toggle input:checked + .settings-toggle-track .settings-toggle-thumb {
  transform: translateX(16px);
}

.settings-toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Toggle switch (inline / quick settings) */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(14px);
}

/* ── Upload area ──────────────────────────────────────────────────── */

.setup-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  transition: all 0.15s;
}

.setup-upload-area:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.upload-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Job boards grid ──────────────────────────────────────────────── */

.job-boards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.board-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.board-checkbox input {
  accent-color: var(--accent);
}

.board-label {
  font-weight: 500;
}

/* Stage checkboxes */

.stage-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.stage-checkbox input {
  accent-color: var(--accent);
}

/* Search preview */

.search-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

/* AI tier badge */

.ai-tier-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
}

/* Save status */

.save-status {
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
}

/* ── Danger zone ──────────────────────────────────────────────────── */

.danger-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.danger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  gap: 16px;
}

.danger-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.danger-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Modal ────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
}

.modal-warning {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── Toast ────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-primary);
  animation: toastIn 0.3s ease;
}

.toast.error {
  border-left: 3px solid var(--red);
}

.toast.success {
  border-left: 3px solid var(--green);
}

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

/* ── FAQ styles ───────────────────────────────────────────────────── */

.faq-section {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

.faq-intro {
  margin-bottom: 20px;
}

.faq-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.faq-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-step strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.faq-step p {
  font-size: 13px;
  color: var(--text-secondary);
}

.faq-score-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.faq-score-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-answer {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  line-height: 1.7;
}

.faq-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.faq-link:hover {
  text-decoration: underline;
}

/* ── Pipeline animation ──────────────────────────────────────────── */

@keyframes pipelinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Loading spinner ──────────────────────────────────────────────── */

.setup-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.setup-loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Pipeline flow visual ─────────────────────────────────────────── */

.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.pipeline-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.pipeline-stage-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pipeline-stage-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.pipeline-stage.active {
  background: var(--accent-dim);
}

.pipeline-stage.active .pipeline-stage-name {
  color: var(--accent);
}

.pipeline-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.4;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .page {
    padding: 16px;
  }

  .stat-cards {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .setup-field.full {
    grid-column: span 1;
  }

  .topbar {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }
}

/* ── Pipeline option val ──────────────────────────────────────────── */

.pipeline-option-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 16px;
  text-align: center;
}

/* ── Job detail modal ─────────────────────────────────────────────── */

.job-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.job-detail-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.job-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.job-detail-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.job-detail-company {
  font-size: 14px;
  color: var(--text-secondary);
}

.job-detail-body {
  padding: 24px;
}

.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.job-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.job-detail-section {
  margin-bottom: 20px;
}

.job-detail-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.job-detail-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

.job-detail-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ── Row selected ─────────────────────────────────────────────────── */

.row-selected {
  background: var(--accent-dim) !important;
}
