/* ===================================================================
   Sourcer — Recruiting Dashboard
   Dark theme, editorial density, DM Sans + JetBrains Mono
   =================================================================== */

:root {
  /* Surface palette — warm charcoal */
  --bg-root: #0e0e10;
  --bg-surface: #16161a;
  --bg-raised: #1c1c21;
  --bg-hover: #22222a;
  --bg-active: #282832;

  /* Border */
  --border: #2a2a35;
  --border-subtle: #1f1f28;

  /* Text */
  --text-primary: #ececf1;
  --text-secondary: #8e8ea0;
  --text-tertiary: #5a5a6e;
  --text-inverse: #0e0e10;

  /* Accent — warm amber */
  --accent: #f5a623;
  --accent-soft: rgba(245, 166, 35, 0.12);
  --accent-hover: #f7b84a;

  /* Priority colors */
  --priority-a: #34d399;
  --priority-a-bg: rgba(52, 211, 153, 0.10);
  --priority-b: #60a5fa;
  --priority-b-bg: rgba(96, 165, 250, 0.10);
  --priority-c: #6b7280;
  --priority-c-bg: rgba(107, 114, 128, 0.10);
  --priority-d: #f87171;
  --priority-d-bg: rgba(248, 113, 113, 0.10);

  /* Status colors */
  --status-sourced: #8e8ea0;
  --status-contacted: #60a5fa;
  --status-replied: #a78bfa;
  --status-interview: #f5a623;
  --status-hired: #34d399;
  --status-rejected: #f87171;

  /* Sizing */
  --header-h: 52px;
  --filters-h: 48px;
  --radius: 6px;
  --radius-sm: 4px;

  /* Fonts */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ===== Utilities ===== */
.hidden { display: none !important; }

/* ===== Login Screen / Landing Page ===== */
.login-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-root);
  position: relative;
  overflow: hidden;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
}

.logo-img-lg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* --- Ambient background --- */
.landing-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 700px 500px at 20% 30%, rgba(245, 166, 35, 0.05), transparent),
    radial-gradient(ellipse 500px 500px at 80% 60%, rgba(96, 165, 250, 0.03), transparent);
}

.landing-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 40%, black 10%, transparent 70%);
}

/* --- Split layout --- */
.landing-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.landing-left {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
}

.hero-content {
  max-width: 400px;
}

.landing-right {
  display: flex;
  align-items: center;
  padding: 40px 48px 40px 24px;
  border-left: 1px solid var(--border-subtle);
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

/* --- Hero --- */
.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(245, 166, 35, 0.15);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
  animation: cardEnter 0.6s ease-out both;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  animation: cardEnter 0.6s 0.1s ease-out both;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  color: var(--text-primary);
}

.hero-tagline {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: cardEnter 0.6s 0.2s ease-out both;
}

/* --- Stat counter (inline in hero) --- */
.stats-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 28px;
  min-height: 44px;
}

.stats-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-loader.hidden + .stats-big-number {
  animation: cardEnter 0.4s ease-out both;
}

.stats-big-number {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -2px;
  line-height: 1;
}

.stats-big-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- CTA --- */
.hero-cta {
  display: flex;
  flex-direction: column;
  animation: cardEnter 0.6s 0.3s ease-out both;
}

.btn-hero {
  width: auto;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.2), 0 4px 24px rgba(245, 166, 35, 0.15);
  transition: background 0.15s, box-shadow 0.2s, transform 0.15s;
}

.btn-hero:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.3), 0 8px 32px rgba(245, 166, 35, 0.2);
}

/* --- Hero CTA group --- */
.hero-cta-primary {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-extension-hero {
  width: 100%;
  padding: 13px 28px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  gap: 10px;
}

.hero-badge-recommended {
  position: absolute;
  right: -8px;
  top: -10px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fff;
  background: var(--priority-a);
  padding: 2px 8px;
  border-radius: 100px;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3);
}

.hero-cta-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  animation: cardEnter 0.6s 0.35s ease-out both;
}

.hero-cta-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hero-cta-divider-text {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: lowercase;
  letter-spacing: 0.3px;
}

.btn-hero-secondary {
  width: 100%;
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  animation: cardEnter 0.6s 0.4s ease-out both;
}

.btn-hero-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.btn-badge-beta {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--bg-active);
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.5;
}

/* --- Feature cards (horizontal layout) --- */
.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.15s;
}

.feature-card:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-raised);
}

.feature-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.feature-icon--ai { color: var(--accent); background: var(--accent-soft); }
.feature-icon--li { color: var(--priority-b); background: var(--priority-b-bg); }
.feature-icon--export { color: var(--priority-a); background: var(--priority-a-bg); }

.feature-body {
  min-width: 0;
}

.feature-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}

.feature-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

/* --- Footer --- */
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 32px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Landing responsive --- */
@media (max-width: 800px) {
  .login-screen {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .landing-split {
    grid-template-columns: 1fr;
  }
  .landing-left {
    padding: 48px 24px 32px;
    text-align: center;
  }
  .hero-content {
    max-width: 100%;
  }
  .hero-identity {
    justify-content: center;
  }
  .stats-hero {
    justify-content: center;
  }
  .hero-cta {
    align-items: center;
  }
  .landing-right {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: 24px;
    justify-content: center;
  }
  .btn-hero,
  .btn-hero-secondary {
    width: 100%;
  }
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-group input:focus,
.input-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.input-group input::placeholder {
  color: var(--text-tertiary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-login {
  margin-top: 8px;
  padding: 10px;
}

.btn-loader {
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-error {
  color: var(--priority-d);
  font-size: 12px;
  text-align: center;
  margin-top: 12px;
}

/* ===== App Layout ===== */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Header ===== */
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.divider-v {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.vacancy-select {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 5px 28px 5px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238e8ea0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s;
  min-width: 180px;
}

.vacancy-select:hover {
  border-color: var(--text-tertiary);
}

.vacancy-select:focus {
  border-color: var(--accent);
}

/* Vacancy action buttons */
.vacancy-select-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.btn-vacancy-add:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ===== Vacancy Editor ===== */
.vacancy-editor {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg-root);
  display: flex;
  flex-direction: column;
  animation: editorSlideIn 0.25s ease-out;
}

@keyframes editorSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.editor-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.editor-actions {
  display: flex;
  gap: 8px;
}

.editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  min-height: 0;
}

.editor-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.editor-hint code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--bg-hover);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-secondary);
}

.editor-textarea {
  flex: 1;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 20px 24px;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  tab-size: 2;
}

.editor-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.editor-textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 0.6;
}

/* Stats bar */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: -0.3px;
}

.stat-chip.stat-a { background: var(--priority-a-bg); color: var(--priority-a); }
.stat-chip.stat-b { background: var(--priority-b-bg); color: var(--priority-b); }
.stat-chip.stat-c { background: var(--priority-c-bg); color: var(--priority-c); }
.stat-chip.stat-d { background: var(--priority-d-bg); color: var(--priority-d); }
.stat-chip.stat-total {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.btn-export {
  font-size: 12px;
}

.btn-logout {
  padding: 6px 8px;
}

/* ===== Filters Bar ===== */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
  flex-wrap: wrap;
}

.filters-left,
.filters-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 4px;
  user-select: none;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chip.selected {
  border-color: transparent;
}

.chip-a.selected { background: var(--priority-a-bg); color: var(--priority-a); border-color: rgba(52, 211, 153, 0.25); }
.chip-b.selected { background: var(--priority-b-bg); color: var(--priority-b); border-color: rgba(96, 165, 250, 0.25); }
.chip-c.selected { background: var(--priority-c-bg); color: var(--priority-c); border-color: rgba(107, 114, 128, 0.25); }
.chip-d.selected { background: var(--priority-d-bg); color: var(--priority-d); border-color: rgba(248, 113, 113, 0.25); }

.chip-status.selected {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(245, 166, 35, 0.25);
}

/* Search */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 200px;
  padding: 6px 10px 6px 30px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s, width 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  width: 260px;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

/* Score slider */
.score-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-slider {
  width: 80px;
  height: 4px;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.score-slider::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.score-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.score-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 20px;
}

/* Toggle */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-label input { display: none; }

.toggle-switch {
  width: 28px;
  height: 16px;
  background: var(--border);
  border-radius: 8px;
  position: relative;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.toggle-label input:checked + .toggle-switch {
  background: var(--accent-soft);
}

.toggle-label input:checked + .toggle-switch::after {
  transform: translateX(12px);
  background: var(--accent);
}

/* ===== Table ===== */
.table-container {
  flex: 1;
  overflow-x: auto;
  padding: 0;
}

.candidates-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.candidates-table th {
  position: sticky;
  top: 0;
  background: var(--bg-raised);
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  z-index: 10;
  user-select: none;
}

.col-priority { width: 36px; }
.col-name { width: 22%; }
.col-location { width: 15%; }
.col-score { width: 90px; }
.col-llm { width: 60px; }
.col-skills { width: 22%; }
.col-links { width: 90px; }
.col-status { width: 90px; }
.col-flags { width: 70px; }

/* Rows */
.candidate-row {
  cursor: pointer;
  transition: background 0.1s;
}

.candidate-row:hover {
  background: var(--bg-hover);
}

.candidate-row td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-row.expanded {
  background: var(--bg-hover);
}

/* Priority badge */
.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.priority-badge.p-a { background: var(--priority-a-bg); color: var(--priority-a); }
.priority-badge.p-b { background: var(--priority-b-bg); color: var(--priority-b); }
.priority-badge.p-c { background: var(--priority-c-bg); color: var(--priority-c); }
.priority-badge.p-d { background: var(--priority-d-bg); color: var(--priority-d); }

/* Name cell */
.name-cell .name-primary {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.name-cell .name-secondary {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Location cell */
.location-cell {
  color: var(--text-secondary);
  font-size: 12px;
}

.location-cell .company {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
}

/* Score bar */
.score-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.score-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  min-width: 22px;
  text-align: right;
}

/* LLM score */
.llm-score {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.llm-score.has-score {
  color: var(--accent);
}

/* Skills chips */
.skills-cell {
  display: flex;
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.skill-chip {
  padding: 2px 6px;
  background: var(--bg-active);
  border-radius: 3px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}

.skill-more {
  padding: 2px 4px;
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Links */
.links-cell {
  display: flex;
  gap: 6px;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.link-icon:hover {
  background: var(--bg-active);
  color: var(--text-primary);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-sourced { background: rgba(142, 142, 160, 0.12); color: var(--status-sourced); }
.status-contacted { background: rgba(96, 165, 250, 0.12); color: var(--status-contacted); }
.status-replied { background: rgba(167, 139, 250, 0.12); color: var(--status-replied); }
.status-interview { background: rgba(245, 166, 35, 0.12); color: var(--status-interview); }
.status-hired { background: rgba(52, 211, 153, 0.12); color: var(--status-hired); }
.status-rejected { background: rgba(248, 113, 113, 0.12); color: var(--status-rejected); }

/* Flags */
.flags-cell {
  display: flex;
  gap: 4px;
}

.flag-indicator {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.flag-green { color: var(--priority-a); }
.flag-red { color: var(--priority-d); }

/* ===== Detail Panel (expanded row) ===== */
.detail-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border) !important;
}

.detail-panel {
  padding: 16px 20px 20px 56px;
  background: var(--bg-raised);
  animation: panelSlide 0.2s ease-out;
}

@keyframes panelSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-section h4 {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.detail-bio {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
  max-height: 60px;
  overflow: hidden;
}

.detail-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.detail-score-item {
  text-align: center;
}

.detail-score-item .score-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  display: block;
  margin-bottom: 2px;
}

.detail-score-item .score-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-flags {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-flag {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.detail-flag .flag-icon {
  flex-shrink: 0;
  font-size: 11px;
}

.detail-flag.green .flag-icon { color: var(--priority-a); }
.detail-flag.red .flag-icon { color: var(--priority-d); }

.detail-flag .flag-text {
  color: var(--text-secondary);
}

.detail-reasoning {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  font-style: italic;
}

.detail-recommendation {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

/* Status change */
.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.detail-actions select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 5px 10px;
  outline: none;
}

.detail-actions .btn {
  font-size: 12px;
  padding: 5px 12px;
}

.detail-links-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.detail-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== States ===== */
.state-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}

.state-message p {
  font-size: 14px;
  margin-top: 12px;
}

.empty-icon {
  font-size: 36px;
  opacity: 0.3;
}

.empty-hint {
  font-size: 12px !important;
  margin-top: 4px !important;
}

/* ===== Connection Error Banner ===== */
.connection-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  font-size: 13px;
  color: #856404;
}

.connection-banner-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff9500;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.connection-banner-text { flex: 1; }

.connection-banner-retry {
  padding: 4px 12px;
  border: 1px solid #856404;
  border-radius: 6px;
  background: transparent;
  color: #856404;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.connection-banner-retry:hover {
  background: rgba(0,0,0,0.05);
}

.loader {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.page-info {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.btn-page {
  padding: 6px 10px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease-out;
  backdrop-filter: blur(4px);
}

.modal {
  width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  animation: cardEnter 0.2s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.modal-close {
  font-size: 18px;
  padding: 4px 8px;
}

.modal-body {
  padding: 20px;
}

.export-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* ===== Extension modal ===== */

.modal-wide {
  width: 520px;
}

.extension-intro {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.extension-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
}

.extension-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
}

.step-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.step-content p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.step-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  background: var(--bg-hover);
  padding: 1px 5px;
  border-radius: 4px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  text-decoration: none;
}

.extension-update-note {
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.extension-update-note strong {
  color: var(--text-primary);
}

.extension-update-note code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-surface);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ===== Row animation ===== */
.candidate-row {
  animation: rowEnter 0.3s ease-out both;
}

@keyframes rowEnter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Staggered — set via JS on style attribute */

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ===== Responsive (1200px+) ===== */
@media (max-width: 1100px) {
  .col-flags,
  .col-location { display: none; }
  .candidate-row td:nth-child(3),
  .candidate-row td:nth-child(9),
  .candidates-table th:nth-child(3),
  .candidates-table th:nth-child(9) { display: none; }
}

@media (max-width: 900px) {
  .col-llm,
  .col-links { display: none; }
  .candidate-row td:nth-child(5),
  .candidate-row td:nth-child(7),
  .candidates-table th:nth-child(5),
  .candidates-table th:nth-child(7) { display: none; }

  .filters-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
