/* ============================================================
   SE Job Board — Dark Theme Design System
   Replaces Pico CSS + style.css. No build step, pure CSS.
   ============================================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Background layers (darkest → lightest) */
  --bg-root:       #0a0a0c;
  --bg-sidebar:    #101014;
  --bg-surface:    #141418;
  --bg-card:       #18181e;
  --bg-elevated:   #1e1e26;
  --bg-hover:      #24242e;
  --bg-input:      #12121a;

  /* Borders */
  --border-subtle:  #1e1e28;
  --border-default: #2a2a36;
  --border-strong:  #3a3a48;

  /* Text
     --text-muted was #5c5c6e — Chunk 4 bumped it to #8a8a9e so subheadings
     and caption copy stay subdued but are actually legible on the black
     elevation surfaces. Still darker than --text-secondary. */
  --text-primary:   #e8e8ed;
  --text-secondary: #9898a8;
  --text-muted:     #8a8a9e;
  --text-inverse:   #0a0a0c;

  /* Accent — cool blue-violet */
  --accent:         #6366f1;
  --accent-hover:   #818cf8;
  --accent-muted:   rgba(99, 102, 241, 0.15);
  --accent-border:  rgba(99, 102, 241, 0.3);

  /* Semantic colors */
  --green:       #22c55e;
  --green-muted: rgba(34, 197, 94, 0.12);
  --red:         #ef4444;
  --red-muted:   rgba(239, 68, 68, 0.12);
  --amber:       #f59e0b;
  --amber-muted: rgba(245, 158, 11, 0.12);
  --cyan:        #06b6d4;
  --cyan-muted:  rgba(6, 182, 212, 0.12);
  --purple:      #a855f7;
  --purple-muted:rgba(168, 85, 247, 0.12);
  --pink:        #ec4899;

  /* Chart palette — 8 high-contrast colors for dark bg */
  --chart-1: #6366f1;
  --chart-2: #22c55e;
  --chart-3: #f59e0b;
  --chart-4: #ef4444;
  --chart-5: #06b6d4;
  --chart-6: #ec4899;
  --chart-7: #a855f7;
  --chart-8: #f97316;

  /* Layout */
  --sidebar-w:    240px;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --radius-full:  9999px;

  /* Typography */
  --font-sans:  'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --fs-xs:   0.7rem;
  --fs-sm:   0.8rem;
  --fs-base: 0.9rem;
  --fs-md:   1rem;
  --fs-lg:   1.15rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  2rem;

  /* Transitions */
  --speed: 150ms;
}


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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-color: var(--border-strong) transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-root);
  min-height: 100vh;
}

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


/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.25;
  font-weight: 600;
}

h2 { font-size: var(--fs-xl); margin-bottom: 1.25rem; }
h3 { font-size: var(--fs-lg); margin-bottom: 0.75rem; }
h2 small { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 400; }

p { margin-bottom: 0.75rem; color: var(--text-secondary); }

a { color: var(--accent-hover); text-decoration: none; transition: color var(--speed); }
a:hover { color: #a5b4fc; }

code, pre {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

code {
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent-hover);
}

pre {
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

small { font-size: var(--fs-xs); color: var(--text-muted); }
strong { font-weight: 600; color: var(--text-primary); }

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1.5rem 0;
}


/* --- Layout: Sidebar + Main --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem 0.75rem;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-brand svg {
  color: var(--accent);
  flex-shrink: 0;
}

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

.sidebar-section {
  padding: 0.5rem 1rem 0.15rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-nav {
  list-style: none;
  padding: 0 0.5rem;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: all var(--speed);
  text-decoration: none;
  border-left: 3px solid transparent;
}

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

.sidebar-nav li a.active {
  background: var(--accent-muted);
  color: var(--accent-hover);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-nav li a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav li a.active svg { opacity: 1; }

.sidebar-spacer { flex: 1; }

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

.main-footer {
  margin-left: var(--sidebar-w);
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Mobile hamburger */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 99;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
}

.mobile-header .brand { font-weight: 700; font-size: var(--fs-md); color: var(--text-primary); }

.hamburger-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}


/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.card h3 {
  margin-top: 0;
  font-size: var(--fs-md);
  color: var(--text-primary);
}


/* --- Stat Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--accent-hover);
  margin: 0;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.25rem 0 0;
}


/* --- Last 24 Hours highlight box --- */
.highlight-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.06));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.highlight-box h3 {
  margin: 0 0 0.75rem 0;
  font-size: var(--fs-md);
  color: var(--accent-hover);
}

.highlight-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.highlight-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.highlight-value {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

.highlight-value.highlight-se { color: var(--green); }
.highlight-value.highlight-non-se { color: var(--text-muted); }

.highlight-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* --- Charts --- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Three-up grid for small/compact chart rows (Chunk 4). Forces 3
   columns on wide viewports, collapses to 2 under 960px, 1 under 640px. */
.charts-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 960px) {
  .charts-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .charts-grid-3 { grid-template-columns: 1fr; }
}

/* Fixed canvas wrapper so maintainAspectRatio:false Chart.js instances
   stay at a consistent compact height across the app. Matches the
   sizing used by the top-of-dashboard stat charts. */
.chart-canvas-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}

/* Subdued caption text under chart titles. Slightly smaller than body
   and uses --text-muted so it stays legible after the Chunk 4 bump. */
.chart-subtitle {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  margin: -0.35rem 0 0.75rem;
  line-height: 1.45;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.chart-card h3 {
  margin-top: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-card-stacked {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

thead th {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  text-align: left;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.loc-toggle {
  color: var(--accent);
  font-size: var(--fs-xs);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.loc-toggle:hover { text-decoration: underline; }

tbody tr {
  transition: background var(--speed);
}

tbody tr:hover {
  background: var(--bg-hover);
}

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

th a {
  text-decoration: none;
  color: inherit;
}

th a:hover {
  color: var(--text-primary);
}

/* Clickable rows */
tr[data-href] { cursor: pointer; }

/* Right-aligned number cells */
td[style*="text-align:right"],
th[style*="text-align:right"] {
  font-family: var(--font-mono);
}


/* --- Salary tables grid --- */
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}


/* --- Fingerprint sort tabs --- */
.fingerprint-sort-tabs {
  display: flex;
  gap: 0.25rem;
}
.fp-sort-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fp-sort-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.fp-sort-btn.fp-sort-active {
  background: var(--cyan-muted);
  color: var(--cyan);
  border-color: var(--cyan);
}


/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-completed { background: var(--green-muted); color: var(--green); }
.badge-error     { background: var(--red-muted); color: var(--red); }
.badge-running   { background: var(--amber-muted); color: var(--amber); }
.badge-pending   { background: var(--amber-muted); color: var(--amber); }
.badge-cancelled { background: rgba(92, 92, 110, 0.15); color: var(--text-muted); }

.badge-remote  { background: var(--green-muted); color: var(--green); }
.badge-hybrid  { background: var(--amber-muted); color: var(--amber); }
.badge-onsite  { background: var(--cyan-muted); color: var(--cyan); }
.badge-open    { background: var(--green-muted); color: var(--green); }
.badge-closed  { background: var(--red-muted); color: var(--red); }
.badge-possibly-closed { background: var(--amber-muted); color: var(--amber); }

.badge-it      { background: var(--green-muted); color: var(--green); }
.badge-non-it  { background: var(--red-muted); color: var(--red); }
.badge-se      { background: var(--green-muted); color: var(--green); }
.badge-non-se  { background: var(--red-muted); color: var(--red); }

.badge-approved { background: var(--green-muted); color: var(--green); }
.badge-rejected { background: var(--red-muted); color: var(--red); }
.badge-applied  { background: var(--cyan-muted); color: var(--cyan); }
.badge-premium  { background: var(--green-muted); color: var(--green); }
.badge-penalty  { background: var(--red-muted); color: var(--red); }
.badge-neutral  { background: rgba(92, 92, 110, 0.15); color: var(--text-muted); }

.badge-active   { background: var(--green-muted); color: var(--green); }
.badge-slowing  { background: var(--amber-muted); color: var(--amber); }
.badge-stale    { background: var(--red-muted); color: var(--red); }

/* Discovery table: "fingerprint ran but no ATS" vs "row never fingerprinted" */
.badge-warning  { background: var(--amber-muted); color: var(--amber); }
.badge-neutral  { background: rgba(128, 128, 128, 0.15); color: var(--text-muted); }

.badge-skill {
  background: var(--purple-muted);
  color: var(--purple);
  font-size: var(--fs-xs);
  text-transform: none;
  font-weight: 500;
}


/* --- Filter bar --- */
.filter-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.filter-row {
  display: flex;
  gap: 0.75rem;
  align-items: end;
}

.filter-controls {
  justify-content: space-between;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.filter-group label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.results-count {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.results-count strong {
  color: var(--text-primary);
}


/* --- Form controls (dark) --- */
select,
input[type="search"],
input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
textarea {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  outline: none;
  transition: border-color var(--speed), box-shadow var(--speed);
  width: 100%;
  margin-bottom: 0;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235c5c6e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
}

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

label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.25rem;
}


/* --- Location type pill toggles --- */
.loctype-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  transition: all var(--speed);
  white-space: nowrap;
  user-select: none;
}

.loctype-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.loctype-pill input[type="checkbox"] {
  display: none;
}

.loctype-pill:has(input:checked) {
  background: var(--accent-muted);
  border-color: var(--accent-border);
  color: var(--accent-hover);
}


/* --- Switch toggle (for "Include non-SE" etc) --- */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 0;
}

.toggle-label input[type="checkbox"] {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--speed);
  flex-shrink: 0;
}

.toggle-label input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--speed);
}

.toggle-label input[type="checkbox"]:checked {
  background: var(--accent);
}

.toggle-label input[type="checkbox"]:checked::after {
  left: 19px;
  background: white;
}


/* --- Buttons --- */
.btn {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--speed);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary, button[type="submit"] {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--speed);
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.4;
  width: auto;
}

.btn-primary:hover, button[type="submit"]:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--speed);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.4;
}

.btn-outline:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Small action buttons (admin) */
.btn-sm {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--speed);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  display: inline-block;
  margin-right: 0.2rem;
  width: auto;
  line-height: 1.4;
}

.btn-sm:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-approve { color: var(--green) !important; border-color: rgba(34,197,94,0.3) !important; }
.btn-approve:hover { background: var(--green-muted) !important; }
.btn-reject { color: var(--red) !important; border-color: rgba(239,68,68,0.3) !important; }
.btn-reject:hover { background: var(--red-muted) !important; }
.btn-refingerprint { color: var(--cyan) !important; border-color: rgba(6,182,212,0.3) !important; }
.btn-refingerprint:hover { background: var(--cyan-muted) !important; }


/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.pagination a {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  transition: all var(--speed);
  text-decoration: none;
}

.pagination a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.pagination .current {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--fs-sm);
}


/* --- Admin page --- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-card header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.admin-card .admin-card-body {
  padding: 1rem;
}

.admin-card form label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.admin-card fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.admin-card fieldset legend {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.admin-card fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.75rem;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.admin-card fieldset input[type="checkbox"] {
  accent-color: var(--accent);
}

.admin-card p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}


/* --- Task status cards --- */
.task-status {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
}

.task-status header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.task-status p {
  padding: 0.5rem 1rem;
  margin: 0;
}

.task-status footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

.task-status footer small {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.task-pending    { border-left: 3px solid var(--amber); }
.task-running    { border-left: 3px solid var(--cyan); }
.task-completed  { border-left: 3px solid var(--green); }
.task-error      { border-left: 3px solid var(--red); }
.task-cancelled  { border-left: 3px solid var(--text-muted); }

.task-progress   { color: var(--text-muted) !important; font-style: italic; }
.task-result     { color: var(--green) !important; }
.task-error-msg  { color: var(--red) !important; }


/* --- Discovery tabs --- */
.discovery-tabs a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.3rem 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color var(--speed);
}

.discovery-tabs a:hover { color: var(--text-secondary); }

.discovery-tabs a.active {
  color: var(--text-primary);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.2rem;
}


/* --- Fingerprint result --- */
.fingerprint-result {
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.fingerprint-result header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.fingerprint-result p {
  padding: 0.25rem 1rem;
  font-size: var(--fs-sm);
}

.fingerprint-result details {
  padding: 0.5rem 1rem;
}

.fingerprint-result summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}


/* --- Page header with controls (dashboard, skills) --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h2 { margin: 0; }

.page-header select {
  display: inline-block;
  width: auto;
  font-size: var(--fs-sm);
}

.page-header label {
  font-size: var(--fs-sm);
  margin-right: 0.5rem;
  color: var(--text-muted);
  display: inline;
  margin-bottom: 0;
}


/* --- Industry badge on postings page --- */
.industry-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(92, 92, 110, 0.15);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.industry-badge a {
  color: var(--red);
  text-decoration: none;
  font-weight: 700;
  margin-left: 0.3rem;
}


/* --- Section headers --- */
section { margin-bottom: 2rem; }
section > h3 {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}


/* --- Empty state --- */
.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3rem;
  text-align: center;
}

.empty-state h3 { color: var(--text-primary); }
.empty-state p { color: var(--text-muted); }


/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .mobile-header { display: flex; }

  .main-content { margin-left: 0; padding: 68px 1rem 2rem; }
  .main-footer { margin-left: 0; padding: 1rem; }

  .charts-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .highlight-stats { flex-direction: column; gap: 0.75rem; }
}

/* --- Phase 1 auth UI --- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: var(--surface, #1e1e26);
  border: 1px solid var(--border, #2a2a36);
  border-radius: 14px;
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  color: var(--accent, #7c8cff);
}
.auth-brand h1 {
  font-size: 1.4rem;
  margin: 0;
  color: var(--fg, #e8e8ed);
}
.auth-subtitle {
  color: var(--fg-muted, #9898a8);
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}
.auth-error {
  background: rgba(220, 60, 60, 0.12);
  border: 1px solid rgba(220, 60, 60, 0.4);
  color: #ff8a8a;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 1rem;
  background: #fff;
  color: #202124;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s;
}
.btn-google:hover { filter: brightness(0.95); }

/* Sidebar user widget */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border, #2a2a36);
  font-size: 0.85rem;
}
.sidebar-user img {
  width: 28px; height: 28px;
  border-radius: 50%;
}
.sidebar-user .name { flex: 1; color: var(--fg, #e8e8ed); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .role { font-size: 0.7rem; color: var(--fg-muted, #9898a8); text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-user a.logout { color: var(--fg-muted, #9898a8); text-decoration: none; font-size: 0.75rem; }
.sidebar-user a.logout:hover { color: var(--accent, #7c8cff); }

/* --- Collapsible sidebar groups (Phase 4 admin submenu) --- */
.sidebar-group { list-style: none; }
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 1rem;
  background: transparent;
  border: 0;
  color: var(--fg-muted, #9898a8);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.sidebar-group-toggle:hover { color: var(--fg, #e8e8ed); background: rgba(255,255,255,0.02); }
.sidebar-group-toggle.active { color: var(--accent, #7c8cff); border-left-color: var(--accent, #7c8cff); }
.sidebar-group-toggle svg { opacity: 0.7; flex-shrink: 0; }
.sidebar-group-toggle.active svg { opacity: 1; }
.sidebar-group-label { flex: 1; }
.sidebar-group-chevron {
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.2s;
}
.sidebar-group.open .sidebar-group-chevron { transform: rotate(90deg); }
.sidebar-subnav {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}
.sidebar-group.open .sidebar-subnav { max-height: 400px; }
.sidebar-subnav li a {
  display: block;
  padding: 0.45rem 1rem 0.45rem 2.6rem;
  color: var(--fg-muted, #9898a8);
  text-decoration: none;
  font-size: 0.82rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s;
}
.sidebar-subnav li a:hover { color: var(--fg, #e8e8ed); background: rgba(255,255,255,0.02); }
.sidebar-subnav li a.active {
  color: var(--accent, #7c8cff);
  border-left-color: var(--accent, #7c8cff);
  background: rgba(124, 140, 255, 0.08);
}

/* --- Clickable task-history rows --- */
.data-table tr.clickable-row {
  cursor: pointer;
  transition: background 0.12s;
}
.data-table tr.clickable-row:hover {
  background: rgba(124, 140, 255, 0.06);
}

/* --- Multi-select skills chip input (postings filter) --- */
.skills-chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-2, #1a1a22);
  border: 1px solid var(--border, #2a2a36);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  min-height: 2.2rem;
}
.skills-chip-input:focus-within {
  border-color: var(--accent, #7c8cff);
}
.skills-chips {
  display: contents;
}
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(124, 140, 255, 0.16);
  color: var(--accent, #7c8cff);
  border: 1px solid rgba(124, 140, 255, 0.3);
  border-radius: 999px;
  padding: 0.15rem 0.55rem 0.15rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}
.skill-chip-remove {
  background: none;
  border: 0;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.1rem;
  cursor: pointer;
  opacity: 0.7;
}
.skill-chip-remove:hover { opacity: 1; }
#skills-typeahead {
  flex: 1 1 120px;
  min-width: 100px;
  background: none;
  border: 0;
  color: var(--fg, #e8e8ed);
  outline: none;
  padding: 0.1rem 0.2rem;
  font-size: 0.85rem;
}
#skills-typeahead::placeholder { color: var(--fg-muted, #9898a8); }

/* Custom skills dropdown — replaces the native <datalist> popup which
   browsers render in unpredictable positions. Anchored directly below
   the filter-group so it never covers the input itself. */
.skills-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: 4px;
  background: var(--surface-2, #1a1a22);
  border: 1px solid var(--border, #2a2a36);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  max-height: 280px;
  overflow-y: auto;
  padding: 0.3rem 0;
}
.skills-dropdown[hidden] { display: none; }
.skills-dropdown-item {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--fg, #e8e8ed);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skills-dropdown-item:hover,
.skills-dropdown-item:focus {
  background: rgba(124, 140, 255, 0.14);
  color: var(--accent, #7c8cff);
}

/* --- Task detail log view --- */
.task-log {
  background: #0d0d14;
  border: 1px solid var(--border, #2a2a36);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #c9c9d1;
}
.task-log code {
  background: none;
  padding: 0;
  color: inherit;
}
