/* ═══════════════════════════════════════════════════════
   Greenhouse Dashboard — Open Design v2
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:      oklch(13% 0.006 160);
  --surface: oklch(16.5% 0.006 160);
  --raised:  oklch(20.5% 0.006 160);
  --fg:      oklch(93% 0.006 150);
  --muted:   oklch(60% 0.012 155);
  --border:  oklch(26% 0.008 160);
  --accent:  oklch(72% 0.15 152);
  --accent-strong: oklch(66% 0.16 152);
  --accent-soft: oklch(72% 0.15 152 / 0.16);
  --on-accent: oklch(16% 0.03 152);
  --success: oklch(74% 0.15 150);
  --warning: oklch(80% 0.14 85);
  --danger:  oklch(66% 0.18 25);
  --info:    oklch(72% 0.11 235);
  --pending: oklch(72% 0.12 300);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono:    'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, monospace;

  /* Legacy compat aliases */
  --text: var(--fg);
  --text-dim: var(--muted);
  --card-bg: var(--surface);
  --surface2: var(--raised);
  --surface1: var(--surface);
  --primary: var(--accent);
  --error: var(--danger);
  --input-bg: var(--raised);
  --hover: oklch(26% 0.006 260);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: oklch(80% 0.15 152); }

/* ═════════════════ 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(--muted); }

/* ═════════════════ App Layout (sidebar + main) ═════════════════ */
.app-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  min-width: 0;
}

/* ═════════════════ Sidebar ═════════════════ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-brand h1 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand h1 .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
}

.sidebar-brand span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

.nav-section {
  padding: 16px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}

.nav-item:hover {
  background: oklch(20% 0.005 260);
  color: var(--fg);
}

.nav-item.active {
  color: var(--accent);
  background: oklch(18% 0.012 255);
  border-right: 2px solid var(--accent);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.runner-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.runner-badge.is-running { color: var(--success); }

/* ═════════════════ Main Content ═════════════════ */
.main-content {
  padding: 32px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 100vh;
  min-width: 0;
}

/* ═════════════════ Page Header ═════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.page-header .header-date {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ═════════════════ Stats Cards ═════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.stat-card:hover {
  border-color: oklch(28% 0.008 260);
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-card .stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card .stat-change {
  font-size: 12px;
  font-family: var(--font-mono);
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

.stat-red { border-color: var(--danger) !important; }

/* ═════════════════ Content Grid (2-column) ═════════════════ */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
  min-width: 0;
}

/* ═════════════════ Table Panel ═════════════════ */
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
}

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

.table-toolbar h3 {
  font-size: 14px;
  font-weight: 600;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  width: 260px;
  transition: border-color 0.15s;
}

.search-box:focus-within { border-color: var(--accent); }

.search-box svg {
  width: 15px;
  height: 15px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: none;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  width: 100%;
}

.search-box input::placeholder { color: var(--muted); }

/* ═════════════════ Side Panels ═════════════════ */
.side-panels {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.2s;
}

.panel:hover { border-color: oklch(28% 0.008 260); }

.panel h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ═════════════════ Funnel Chart ═════════════════ */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.funnel-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-bar {
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--bg);
  transition: width 0.4s ease;
}

.funnel-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 70px;
}

/* ═════════════════ Activity Timeline ═════════════════ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  position: relative;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 36px;
  bottom: -1px;
  width: 1px;
  background: var(--border);
}

.timeline-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-dot svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.timeline-dot.applied  { background: oklch(30% 0.04 250); color: var(--info); }
.timeline-dot.approved { background: oklch(28% 0.04 145); color: var(--success); }
.timeline-dot.pending  { background: oklch(30% 0.04 85);  color: var(--warning); }
.timeline-dot.failed   { background: oklch(26% 0.04 25);   color: var(--danger); }

.timeline-content { flex: 1; min-width: 0; }
.timeline-text { font-size: 13px; line-height: 1.4; }
.timeline-text strong { font-weight: 600; color: var(--fg); }
.timeline-time { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }

/* ═════════════════ Company Icon ═════════════════ */
.company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.company-name { font-weight: 500; }
.company-location { font-size: 12px; color: var(--muted); }

/* ═════════════════ Status Pill ═════════════════ */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-pill.applied  { background: oklch(30% 0.04 250); color: var(--info); }
.status-pill.applied .pill-dot { background: var(--info); }
.status-pill.approved { background: oklch(28% 0.04 145); color: var(--success); }
.status-pill.approved .pill-dot { background: var(--success); }
.status-pill.review   { background: oklch(28% 0.06 270); color: #a78bfa; }
.status-pill.review .pill-dot { background: #a78bfa; }
.status-pill.pending  { background: oklch(30% 0.04 85); color: var(--warning); }
.status-pill.pending .pill-dot { background: var(--warning); }
.status-pill.failed   { background: oklch(26% 0.04 25); color: var(--danger); }
.status-pill.failed .pill-dot { background: var(--danger); }

/* ═════════════════ Score Badge ═════════════════ */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.score-badge.high   { background: oklch(28% 0.04 145); color: var(--success); }
.score-badge.medium { background: oklch(30% 0.04 85);  color: var(--warning); }
.score-badge.low    { background: oklch(26% 0.04 25);   color: var(--danger); }

/* Legacy score classes */
.score-high { background: oklch(28% 0.04 145); color: var(--success); }
.score-mid  { background: oklch(30% 0.04 250);  color: var(--info); }

/* ═════════════════ Company-color generator ═════════════════ */
.cc-0 { background: oklch(30% 0.04 250); color: var(--info); }
.cc-1 { background: oklch(28% 0.04 145); color: var(--success); }
.cc-2 { background: oklch(30% 0.04 85);  color: var(--warning); }
.cc-3 { background: oklch(28% 0.04 300); color: var(--pending); }
.cc-4 { background: oklch(26% 0.04 25);  color: var(--danger); }
.cc-5 { background: oklch(28% 0.04 180); color: oklch(65% 0.15 180); }

/* ═════════════════ Table (global styles) ═════════════════ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  min-width: 0;
}

table { width: 100%; border-collapse: collapse; table-layout: auto; }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: oklch(14% 0.006 260);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.jobs-table th {
  background: oklch(14% 0.006 260);
  position: sticky;
  top: 0;
}

.jobs-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.jobs-table th.sortable:hover {
  background: oklch(20% 0.01 260);
}

.jobs-table tbody tr { transition: background 0.1s; }
.jobs-table tbody tr:hover { background: oklch(19% 0.005 260); }
.jobs-table tbody tr:last-child td { border-bottom: none; }

tr:last-child td { border-bottom: none; }
tr:hover td { background: oklch(19% 0.005 260); }

/* ═════════════════ Jobs table → cards on narrow screens ═════════════════ */
@media (max-width: 680px) {
  .jobs-table thead { display: none; }
  .jobs-table, .jobs-table tbody, .jobs-table tr, .jobs-table td { display: block; width: 100%; }
  .jobs-table tbody tr {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    padding: 12px 40px 12px 14px;
    background: var(--surface);
  }
  .jobs-table tbody tr:last-child { margin-bottom: 0; }
  .jobs-table td { padding: 4px 0; border-bottom: none; }
  .jobs-table td:first-child { position: absolute; top: 12px; right: 8px; width: auto; padding: 0; }
  .jobs-table td.td-title { padding-top: 0; }
  .jobs-table td.td-actions { margin-top: 8px; }
  .jobs-table td.td-actions .btn { width: 100%; }
  .jobs-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .table-toolbar { flex-wrap: wrap; gap: 10px; }
  .table-toolbar .search-box { width: 100%; }
}

.td-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-company { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }

/* ═════════════════ Date Cell ═════════════════ */
.date-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ═════════════════ Card ═════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
  overflow: hidden;
}

.card:hover {
  border-color: oklch(28% 0.008 260);
}

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

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  font-family: var(--font-display);
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ═════════════════ Grid ═════════════════ */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ═════════════════ Buttons ═════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary  { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover  { background: oklch(78% 0.15 152); }
.btn-success  { background: var(--success); color: var(--on-accent); font-weight: 600; }
.btn-success:hover  { background: oklch(80% 0.15 150); }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover   { background: oklch(70% 0.18 25); }
.btn-warning  { background: var(--warning); color: var(--bg); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--raised); color: var(--fg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ═════════════════ Badges ═════════════════ */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-t1     { background: oklch(28% 0.04 145);  color: var(--success); }
.badge-t2     { background: oklch(30% 0.04 250);  color: var(--info); }
.badge-t3     { background: oklch(30% 0.04 85);   color: var(--warning); }
.badge-green  { background: oklch(28% 0.04 145);  color: var(--success); }
.badge-blue   { background: oklch(30% 0.04 250);  color: var(--info); }
.badge-yellow { background: oklch(30% 0.04 85);  color: var(--warning); }
.badge-red    { background: oklch(26% 0.04 25);   color: var(--danger); }
.badge-purple { background: oklch(28% 0.04 300); color: var(--pending); }
.badge-grey   { background: var(--raised); color: var(--muted); }

/* ═════════════════ Filter Bar ═════════════════ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-bar input, .filter-bar select {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 7px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  min-width: 0;
  transition: border-color 0.15s;
}

.filter-bar input:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ═════════════════ Status Dot ═════════════════ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.dot-green  { background: var(--success); }
.dot-yellow { background: var(--warning); }
.dot-red    { background: var(--danger); }
.dot-blue   { background: var(--info); }
.dot-grey   { background: var(--muted); }

.dot-pulse { animation: dot-pulse 1.8s ease-in-out infinite; }
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63,185,80,.5); }
  50%       { box-shadow: 0 0 0 5px rgba(63,185,80,0); }
}

/* ═════════════════ Section ═════════════════ */
.section { margin-bottom: 24px; min-width: 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 16px; font-weight: 600; color: var(--fg); font-family: var(--font-display); }

/* ═════════════════ Pagination ═════════════════ */
.pagination { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.page-info  { color: var(--muted); font-size: 13px; margin-left: auto; }

/* ═════════════════ Applier Status ═════════════════ */
.applier-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.runner-row-top { display: flex; align-items: center; justify-content: space-between; }
.current-job { padding-top: 4px; }
.current-job-title { font-weight: 600; color: var(--fg); font-size: 14px; }
.current-job-company { font-weight: 400; color: var(--muted); }
.current-job-step { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 16px; }

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, oklch(78% 0.16 250) 100%);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
  min-width: 0;
}

/* Step pills */
.step-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  background: var(--raised);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.step-pill.active { background: oklch(18% 0.012 250); color: var(--accent); border-color: oklch(35% 0.06 250); }
.step-pill.done   { background: oklch(18% 0.01 145);  color: var(--success); border-color: oklch(25% 0.04 145); }
.step-check { width: 10px; height: 8px; flex-shrink: 0; }

/* ═════════════════ Live Log ═════════════════ */
.live-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: 280px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.log-page-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  height: calc(100vh - 160px);
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Log items */
.log-list { display: flex; flex-direction: column; gap: 0; }
.log-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--font-mono);
  display: grid;
  grid-template-columns: 160px 60px 1fr;
  gap: 8px;
  align-items: start;
}
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--muted); }
.log-level-info    { color: var(--info); }
.log-level-success { color: var(--success); }
.log-level-warn    { color: var(--warning); }
.log-level-error   { color: var(--danger); }
.log-level-running { color: var(--pending); }

/* ═════════════════ Applied Page ═════════════════ */
.applied-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.applied-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.applied-card:hover {
  border-color: oklch(28% 0.008 260);
  box-shadow: 0 2px 8px oklch(0% 0 0 / 0.3);
}

.apc-title { font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.apc-company { font-size: 12px; color: var(--muted); }
.apc-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.apc-time { margin-left: auto; }

/* ═════════════════ Failed List ═════════════════ */
.failed-list { display: flex; flex-direction: column; gap: 8px; }
.failed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s;
}
.failed-item:hover { border-color: var(--danger); }
.failed-info { flex: 1; }
.failed-title { font-weight: 600; color: var(--fg); font-size: 13px; }
.failed-company { font-size: 12px; color: var(--muted); }
.failed-error { font-size: 11px; color: var(--danger); margin-top: 2px; }

/* ═════════════════ Profile Page ═════════════════ */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.form-group { margin-bottom: 8px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.form-group input {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  transition: border-color 0.15s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }
.form-group input[readonly] { opacity: .7; }

.filter-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px;
  color: var(--muted);
  transition: all 0.15s;
}
.filter-chip.active {
  background: oklch(18% 0.012 250);
  color: var(--accent);
  border-color: var(--accent);
}

/* ═════════════════ Filter Config ═════════════════ */
.filter-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.filter-group { display: flex; flex-direction: column; }
.filter-group-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--fg);
}
.filter-textarea {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s;
}
.filter-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px oklch(35% 0.06 250); }
.filter-textarea::placeholder { color: var(--muted); }

/* ═════════════════ QBank Page ═════════════════ */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
}
.tab-btn.active { background: var(--raised); color: var(--fg); }
.tab-btn:hover { color: var(--fg); }

.qbank-list { display: flex; flex-direction: column; gap: 4px; }
.qbank-item {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.qbank-item:hover { background: var(--raised); border-color: oklch(28% 0.008 260); }
.qb-question { font-size: 13px; color: var(--fg); margin-bottom: 4px; }
.qb-answer {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qb-type {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--raised);
  color: var(--muted);
  display: inline-block;
  margin-top: 4px;
}

.pending-list { display: flex; flex-direction: column; gap: 12px; }
.pending-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: border-color 0.15s;
}
.pending-question { font-size: 13px; font-weight: 600; color: var(--fg); }
.pending-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.pending-answer-row { display: flex; gap: 8px; margin-top: 10px; }
.pending-input {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  transition: border-color 0.15s;
}
.pending-input:focus { outline: none; border-color: var(--accent); }
.pending-select {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
}
.pending-select:focus { outline: none; border-color: var(--accent); }

.search-input {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--accent); }

.more-link { text-align: center; padding: 12px; color: var(--muted); font-size: 12px; }

/* ═════════════════ Empty/Spinner ═════════════════ */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-icon { font-size: 32px; margin-bottom: 8px; }

.spinner {
  display: inline-block;
  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); } }

/* ═════════════════ Misc ═════════════════ */
.text-dim  { color: var(--muted); }
.text-sm   { font-size: 12px; }
.text-xs   { font-size: 11px; }
.mt4       { margin-top: 4px; }
.mt8       { margin-top: 8px; }
.mt16      { margin-top: 16px; }
.mb4       { margin-bottom: 4px; }
.ml8       { margin-left: 8px; }
.flex      { display: flex; }
.gap8      { gap: 8px; }
.gap16     { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═════════════════ Page Transitions ═════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

main#app {
  animation: fadeIn 0.25s ease;
}

/* ═════════════════ Review card expand animation ═════════════════ */
@keyframes expandDown {
  from { opacity: 0; transform: translateY(-8px); max-height: 0; }
  to   { opacity: 1; transform: translateY(0); max-height: 5000px; }
}

.card-expand-content {
  animation: expandDown 0.3s ease;
  overflow: hidden;
}

/* ═════════════════ Pulse animation for status dots ═════════════════ */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50%	   { opacity: 1; }
}

.status-pill.running .pill-dot,
.status-dot.dot-pulse {
  animation: pulseGlow 1.8s ease-in-out infinite;
}

/* ═════════════════ Responsive ═════════════════ */
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr; }
  .filter-section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .filter-section-grid { grid-template-columns: 1fr; }
}

/* ═════════════════ Legacy compat ═════════════════ */
/* Nav bar is now sidebar — hide old horizontal nav */
.nav { display: none; }

/* ═════════════════ Toast ═════════════════ */
#_toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  max-width: 340px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(8px);
  font-family: var(--font-body);
  box-shadow: 0 4px 16px oklch(0% 0 0 / 0.4);
}
#_toast[style*="opacity: 1"] {
  transform: translateY(0);
}

/* ═════════════════ Hover Animations ═════════════════ */
.card:hover {
  border-color: oklch(28% 0.008 260);
  box-shadow: 0 4px 12px oklch(0% 0 0 / 0.2);
}
.stat-card:hover {
  border-color: oklch(28% 0.008 260);
  box-shadow: 0 2px 8px oklch(0% 0 0 / 0.15);
}
.nav-item {
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

/* ═════════════════ Mobile nav toggle ═════════════════ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 200;
  justify-content: space-around;
}
.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
}
.mobile-nav a.active { color: var(--accent); }
.mobile-nav a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.mobile-more-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--muted); background: none; border: none;
  padding: 4px 8px; font-family: inherit; cursor: pointer;
}
.mobile-more-btn.active { color: var(--accent); }
.mobile-more-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }

.mobile-more-backdrop {
  display: none; position: fixed; inset: 0; background: oklch(0% 0 0 / 0.5); z-index: 210;
}
.mobile-more-backdrop.open { display: block; }

.mobile-more-sheet {
  display: none; position: fixed; bottom: calc(72px + env(safe-area-inset-bottom)); left: 12px; right: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 24px oklch(0% 0 0 / 0.5); z-index: 220; overflow: hidden;
}
.mobile-more-sheet.open { display: block; }
.mobile-more-sheet a {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  color: var(--fg); text-decoration: none; font-size: 14px; border-bottom: 1px solid var(--border);
}
.mobile-more-sheet a:last-child { border-bottom: none; }
.mobile-more-sheet a.active { color: var(--accent); }
.mobile-more-sheet a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }

@media (max-width: 768px) {
  .mobile-nav { display: flex; }
  .main-content { padding: 16px 16px 80px; }
}
/* Tag input (multi-select filter) */
.tag-input-wrap { position: relative; }
.tag-input-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 4px 8px; min-height: 36px; cursor: text;
}
.tag-input-box:focus-within { border-color: var(--accent); }
.tag-input {
  border: none; outline: none; background: transparent; color: var(--fg);
  font-size: 13px; flex: 1; min-width: 60px; margin: 2px 0;
}
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent); color: #fff; border-radius: 4px;
  padding: 2px 6px; font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.tag-chip .tag-x { cursor: pointer; font-size: 14px; opacity: 0.7; line-height: 1; }
.tag-chip .tag-x:hover { opacity: 1; }
.tag-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  max-height: 220px; overflow-y: auto; margin-top: 2px; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tag-option {
  padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--fg);
  display: flex; justify-content: space-between;
}
.tag-option:hover { background: var(--accent); color: #fff; }
.tag-option .text-dim { color: var(--muted); }
.tag-option:hover .text-dim { color: rgba(255,255,255,0.7); }

/* ═════════════════ Review — Inspector layout ═════════════════ */
.rv { display: flex; flex-direction: column; }
.rv-tabs { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.rv-tab { padding: 7px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.rv-tab.on { background: var(--raised); color: var(--fg); }
.rv-tab .n { color: var(--muted); margin-left: 5px; font-size: 12px; }

.rv-split { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .rv-split { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .rv-dhead { flex-wrap: wrap; }
  .rv-dacts { margin-left: 0; width: 100%; }
  .rv-fields { gap: 10px; }
  .rv-field.grow { min-width: 100%; }
}

.rv-queue { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.rv-qhead { padding: 11px 14px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.qrow { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-left: 2px solid transparent; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.qrow:last-child { border-bottom: none; }
.qrow:hover { background: var(--raised); }
.qrow.sel { background: var(--accent-soft); border-left-color: var(--accent); }
.qrow .qt { font-size: 13px; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .qc { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .qm { margin-left: auto; text-align: right; font-size: 11px; color: var(--muted); flex-shrink: 0; line-height: 1.5; }

.rv-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.rv-dhead { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.rv-dtitle { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.rv-dsub { font-size: 12px; color: var(--muted); margin-top: 5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rv-dacts { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.rv-body { padding: 16px 18px; }
.rv-empty { padding: 72px 24px; text-align: center; color: var(--muted); }
.rv-empty .ei { font-size: 30px; margin-bottom: 10px; opacity: .7; }

.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--raised); color: var(--muted); }
.tag.acc { background: var(--accent-soft); color: var(--accent); }

.cov { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; margin-bottom: 20px; }
.cov-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.cov-top .cl { font-size: 13px; font-weight: 500; }
.cov-top .cr { font-size: 12px; color: var(--muted); }
.cov-bar { height: 7px; background: var(--raised); border-radius: 5px; overflow: hidden; }
.cov-fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width .3s ease; }
.cov-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.chip { font-size: 11px; padding: 3px 9px; border-radius: 7px; background: var(--raised); color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.chip.warn { background: oklch(30% 0.05 25); color: var(--danger); }
.chip.ok { background: var(--accent-soft); color: var(--accent); }

.rv-sec { margin-bottom: 22px; }
.rv-sech { display: flex; align-items: center; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.rv-sech .ln { flex: 1; height: 1px; background: var(--border); }

.qline { display: flex; align-items: flex-start; gap: 14px; padding: 11px 2px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.qline:last-child { border-bottom: none; }
.qline.dem { background: var(--bg); margin: 0 -10px; padding: 11px 12px; border-radius: 8px; border-bottom: none; }
.qline .ql { flex: 1.4 1 0; min-width: 0; font-size: 13px; line-height: 1.45; }
.qline .qsrc { font-size: 11px; color: var(--muted); margin-top: 4px; display: inline-flex; align-items: center; gap: 5px; }
.qline .qctl { flex: 1 1 0; min-width: 260px; max-width: 440px; }
.qline .qctl > select, .qline .qctl > input { width: 100%; }
.qline .qact { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.iconbtn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 3px; border-radius: 6px; opacity: .65; transition: opacity .12s; }
.iconbtn:hover { opacity: 1; background: var(--raised); }
.optflag { font-size: 10px; color: var(--muted); background: var(--raised); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }

/* ═════════════════ Form inputs — global base ═════════════════ */
input[type="text"], input[type="number"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], select, textarea {
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); }

/* Review education / employment field rows */
.rv-fields { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.rv-field { display: flex; flex-direction: column; gap: 5px; }
.rv-field > label { font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.rv-field input, .rv-field select { width: 100%; height: 36px; }
.rv-field.grow { flex: 1; min-width: 220px; position: relative; }
.edu-school-dropdown { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; box-shadow: 0 8px 24px rgba(0,0,0,.5) !important; }
.edu-school-dropdown > div:hover { background: var(--accent-soft) !important; color: var(--fg) !important; }

/* ═════════════════ App shell — rail + top bar (overhaul) ═════════════════ */
.app-frame { display: grid; grid-template-columns: 70px 1fr; min-height: 100vh; min-width: 0; }
.rail { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 20px; text-decoration: none; margin-bottom: 10px; }
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.rail-sep { width: 30px; height: 1px; background: var(--border); margin: 8px 0; }
.rail .nav-item { width: 52px; height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; border-radius: 13px; border-right: none; color: var(--muted); }
.rail .nav-item span { font-size: 9.5px; font-weight: 500; }
.rail .nav-item svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rail .nav-item:hover { background: var(--raised); color: var(--fg); }
.rail .nav-item.active { background: var(--accent-soft); color: var(--accent); border-right: none; }

.app-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; height: 58px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.topbar-brand { display: flex; align-items: center; gap: 11px; }
.topbar-brand .logo-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.topbar-brand strong { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); }
.topbar-brand span { display: block; font-size: 11px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; }

.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 28px 36px; max-height: none; min-width: 0; }

@media (max-width: 768px) {
  .app-frame { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar-brand span { display: none; }
  .app-main { height: auto; }
  .main-content { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
}

/* ═════════════════ Dashboard (overhaul) ═════════════════ */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.section-card h3 { font-size: 14px; font-weight: 600; margin: 0; }
.sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.run-flag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.run-flag.on { color: var(--success); }
.bigbar { height: 26px; background: var(--raised); border-radius: 9px; overflow: hidden; }
.bigbar > div { height: 100%; background: var(--accent); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--on-accent); font-size: 12px; font-weight: 600; transition: width .4s ease; }
.mini3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.mini { background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 13px; text-align: center; }
.mini .mv { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.mini .ml { font-size: 11px; color: var(--muted); margin-top: 3px; }
.qa { display: flex; flex-direction: column; gap: 8px; }
.qa a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); color: var(--fg); font-size: 13px; }
.qa a:hover { border-color: var(--accent); background: var(--raised); }
.qa a .ai { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.qa a .av { margin-left: auto; color: var(--muted); font-size: 12px; }
.funnel-row { margin-bottom: 13px; }
.funnel-row .fl { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.funnel-row .fl .fc { font-family: var(--font-mono); color: var(--muted); }
.funnel-track { height: 9px; background: var(--raised); border-radius: 5px; overflow: hidden; }
.funnel-track > div { height: 100%; border-radius: 5px; transition: width .3s; }
.verdict { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.verdict:last-child { border-bottom: none; }
.verdict .vv { font-family: var(--font-mono); font-weight: 600; min-width: 46px; font-size: 11px; }

/* ═════════════════ Jobs (overhaul) ═════════════════ */
.filter-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 11px; }
.seg-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.fpill { white-space: nowrap; font-size: 12.5px; padding: 6px 13px; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); cursor: pointer; background: var(--bg); transition: all .12s; }
.fpill:hover { color: var(--fg); border-color: var(--muted); }
.fpill.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 500; }
.filter-row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.jobs-table td { padding: 12px 14px; vertical-align: middle; }
.jobs-table th { padding: 11px 14px; }
.jobs-table tbody tr:hover { background: var(--raised); }
.td-title a { color: var(--fg); font-weight: 500; }
.td-title a:hover { color: var(--accent); }

/* ═════════════════ Auto-Applier (overhaul + animations) ═════════════════ */
.ap-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; transition: border-color .3s, box-shadow .3s; }
.ap-hero.run { border-color: var(--accent); box-shadow: 0 0 36px -14px var(--accent); }
.ap-hero .st { display: flex; align-items: center; gap: 15px; }
.ap-statedot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; }
.ap-statedot.off { background: var(--muted); }
.ap-statedot.on { background: var(--success); animation: apPulse 1.7s ease-out infinite; }
@keyframes apPulse { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ap-state-title { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.ap-state-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.ap-tracker { background: var(--surface); border: 1px solid var(--accent); border-radius: 16px; padding: 20px 22px; margin-top: 14px; position: relative; overflow: hidden; }
.ap-scan { position: absolute; top: 0; left: -42%; height: 2px; width: 42%; background: var(--accent); opacity: .65; animation: apScan 2.2s linear infinite; }
@keyframes apScan { 0% { left: -42%; } 100% { left: 100%; } }
.ap-job { font-size: 15px; font-weight: 600; }
.ap-job .co { color: var(--muted); font-weight: 400; }

.ap-pipeline { display: flex; align-items: center; margin: 20px 0 16px; }
.ap-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; width: 62px; }
.ap-node { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .35s ease; }
.ap-node .ck { width: 14px; height: 11px; }
.ap-stage.done .ap-node { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ap-stage.active .ap-node { border-color: var(--accent); color: var(--accent); animation: apNode 1.3s ease-in-out infinite; }
@keyframes apNode { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); } 50% { box-shadow: 0 0 0 8px var(--accent-soft); } }
.ap-slabel { font-size: 10.5px; color: var(--muted); transition: color .3s; }
.ap-stage.active .ap-slabel, .ap-stage.done .ap-slabel { color: var(--fg); }
.ap-conn { flex: 1; height: 2px; background: var(--border); min-width: 14px; position: relative; overflow: hidden; }
.ap-conn.fill { background: var(--accent); }
.ap-conn.live::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform: translateX(-100%); animation: apConn 1.3s ease-in-out infinite; }
@keyframes apConn { 100% { transform: translateX(100%); } }

.ap-bar { height: 10px; background: var(--raised); border-radius: 6px; overflow: hidden; }
.ap-bar-fill { height: 100%; background: var(--accent); border-radius: 6px; width: 0; transition: width .5s ease; position: relative; overflow: hidden; }
.ap-bar-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); transform: translateX(-100%); animation: apShimmer 1.5s infinite; }
@keyframes apShimmer { 100% { transform: translateX(100%); } }
.ap-steplabel { font-size: 13px; color: var(--accent); font-weight: 500; margin-top: 10px; }
.ap-idle { text-align: center; padding: 22px; color: var(--muted); font-size: 13px; }

.ap-q { display: flex; flex-direction: column; }
.ap-qrow { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.ap-qrow:last-child { border-bottom: none; }
.ap-qrow a { color: var(--fg); }
.ap-qrow a:hover { color: var(--accent); }

.hv { display: flex; align-items: center; gap: 11px; padding: 11px 13px; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; margin-bottom: 8px; }
.hv .hd { font-size: 13px; font-weight: 500; }
.hv .hs { font-size: 11px; color: var(--muted); }

.ap-log { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; height: 300px; overflow-y: auto; font-family: var(--font-mono); font-size: 12px; padding: 10px 14px; }
.ap-log .log-list { display: flex; flex-direction: column; }
.ap-log .log-item { display: flex; gap: 10px; padding: 3px 0; align-items: baseline; animation: logIn .25s ease; }
@keyframes logIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ap-log .log-time { color: var(--muted); flex-shrink: 0; }
.ap-log .log-item > span:last-child { color: var(--fg); word-break: break-word; }
.log-level-info { color: var(--info); } .log-level-success { color: var(--success); } .log-level-warn { color: var(--warning); } .log-level-error { color: var(--danger); } .log-level-running { color: var(--accent); }
.ap-log [class^="log-level-"] { flex-shrink: 0; font-weight: 600; min-width: 52px; }
