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

/* ── DESIGN TOKENS (SaaS / ui-ux-pro-max: professional blue + success) ─ */
:root {
  --primary:     #0369a1;
  --primary-2:   #0ea5e9;
  --primary-soft: rgba(3, 105, 161, 0.12);
  --cta:         #22c55e;
  --cta-2:       #4ade80;

  --bg:        #f0f9ff;
  --bg1:       #ffffff;
  --bg2:       #ffffff;
  --bg3:       #e0f2fe;
  --bg4:       #bae6fd;
  --border:    rgba(12, 74, 110, 0.1);
  --border2:   rgba(12, 74, 110, 0.16);
  --border3:   rgba(12, 74, 110, 0.22);

  --indigo:    var(--primary);
  --indigo2:   var(--primary-2);
  --indigo-glow: rgba(14, 165, 233, 0.18);
  --emerald:   #10b981;
  --emerald2:  #34d399;
  --amber:     #f59e0b;
  --amber2:    #fbbf24;
  --red:       #ef4444;
  --red2:      #f87171;
  --sky:       #38bdf8;

  --text:      #0c4a6e;
  --text2:     #0369a1;
  --text3:     #64748b;
  --text4:     #0f172a;

  --font-ui:   'Inter', system-ui, sans-serif;
  --font-head: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-w: 240px;
  --sidebar-collapsed: 56px;
  --topbar-h:  64px;
  --radius:    12px;
  --radius-lg: 16px;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --danger:    #ef4444;

  --tab-bg:    #e0f2fe;
  --tab-border: #7dd3fc;
  --tab-active-bg: #dcfce7;
  --tab-active-text: #166534;
  --tab-active-border: #86efac;
}

body[data-theme="dark"] {
  --primary:     #38bdf8;
  --primary-2:   #7dd3fc;
  --primary-soft: rgba(56, 189, 248, 0.15);
  --bg:        #0f172a;
  --bg1:       #1e293b;
  --bg2:       #1e293b;
  --bg3:       #334155;
  --bg4:       #475569;
  --border:    rgba(248, 250, 252, 0.08);
  --border2:   rgba(248, 250, 252, 0.12);
  --border3:   rgba(248, 250, 252, 0.18);
  --text:      #f8fafc;
  --text2:     #e2e8f0;
  --text3:     #94a3b8;
  --text4:     #ffffff;
  --indigo:    var(--primary);
  --indigo2:   var(--primary-2);
  --tab-bg:    #334155;
  --tab-border: #475569;
  --tab-active-bg: rgba(34, 197, 94, 0.15);
  --tab-active-text: #86efac;
  --tab-active-border: rgba(34, 197, 94, 0.35);
}

/* Light theme */
body[data-theme="light"] {
  --bg:        #f0f9ff;
  --bg1:       #ffffff;
  --bg2:       #ffffff;
  --bg3:       #e0f2fe;
  --bg4:       #bae6fd;
  --border:    rgba(12, 74, 110, 0.1);
  --border2:   rgba(12, 74, 110, 0.16);
  --border3:   rgba(12, 74, 110, 0.22);
  --text:      #0c4a6e;
  --text2:     #0369a1;
  --text3:     #64748b;
  --text4:     #0f172a;
}
body[data-theme="light"] .sidebar {
  box-shadow: 1px 0 0 var(--border2);
}
body[data-theme="light"] .stat-card,
body[data-theme="light"] .table-card {
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}

/* ── RESET ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, var(--primary-soft), transparent 50%),
    radial-gradient(ellipse 80% 60% at -10% 50%, rgba(34, 197, 94, 0.06), transparent 45%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body[data-theme="dark"] {
  background-image:
    radial-gradient(ellipse 100% 70% at 100% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(34, 197, 94, 0.05), transparent 50%);
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-ui); }
input, select, textarea { font-family: var(--font-ui); color: var(--text); }

[hidden] {
  display: none !important;
}

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 99px; }

/* ════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════════════════════════ */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(3, 105, 161, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(34, 197, 94, 0.1) 0%, transparent 55%),
    var(--bg);
}
.login-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 100%);
}

.login-card {
  position: relative; z-index: 2;
  width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 44px 40px 40px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(3, 105, 161, 0.18),
    0 18px 45px rgba(0,0,0,.35),
    0 0 40px rgba(14, 165, 233, 0.1);
  animation: loginFadeIn .4s ease;
}
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 32px;
}
.login-logo-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 16px; font-weight: 800;
  color: #fff; letter-spacing: -.5px;
  box-shadow: 0 8px 28px rgba(3, 105, 161, 0.35);
}
.login-logo-mark svg { stroke: #fff; opacity: 0.95; }
.login-logo-text, .login-logo-name { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--text); }
.login-logo-sub  { font-size: 11px; color: var(--text3); margin-top: 1px; font-family: var(--font-mono); letter-spacing: 1px; }

.login-card h2 { font-family: var(--font-head); font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.login-card p  { font-size: 13px; color: var(--text2); margin-bottom: 28px; }

.form-field { margin-bottom: 16px; }
.form-field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text2); margin-bottom: 6px; letter-spacing: .3px;
}
.form-field input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-field input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-field input::placeholder { color: var(--text3); }

.btn-primary {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 600; font-size: 14px;
  border: none; border-radius: 10px;
  transition: filter .2s, box-shadow .2s, transform .2s;
  box-shadow: 0 4px 22px rgba(3, 105, 161, 0.35);
  margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 10px 32px rgba(3, 105, 161, 0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--bg4); color: var(--text3); box-shadow: none; transform: none; cursor: not-allowed; }

.login-error {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2);
  color: var(--red2); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 16px; display: none;
}
.login-error.show { display: block; }

.login-reset-row {
  text-align: right;
  margin: -6px 0 12px;
}
.login-reset-link {
  background: none;
  border: none;
  color: var(--primary-2, #38bdf8);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  font-family: inherit;
}
.login-reset-link:hover { color: var(--primary); }
.login-reset-panel {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg3);
}
.login-reset-panel[hidden] { display: none !important; }
.login-reset-hint {
  font-size: 12px;
  color: var(--text2);
  margin: 0 0 12px;
  line-height: 1.45;
}
.login-reset-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-reset-actions .btn-primary { margin-top: 0; }
.login-reset-cancel {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
}
.login-reset-cancel:hover { color: var(--text); }
.login-reset-success {
  font-size: 13px;
  color: var(--emerald2, #10b981);
  margin: -8px 0 16px;
  line-height: 1.4;
}
.login-reset-success[hidden] { display: none !important; }
.login-signup-row { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text2); }
.login-signup-row a { color: var(--primary); text-decoration: none; }
.login-signup-row a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════════════════════════════ */
#app-view {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 20;
  transition: width .25s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-logo-name,
.sidebar.collapsed .sidebar-logo-tag,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-item svg { margin: 0; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 14px 8px; }
.sidebar.collapsed .user-chip { justify-content: center; padding: 8px; }
.sidebar-collapse-btn {
  position: absolute; bottom: 70px; right: -12px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text3); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  font-size: 10px; z-index: 21; transition: all .15s;
}
.sidebar-collapse-btn:hover { background: var(--indigo); color: #fff; }

.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 18px rgba(3, 105, 161, 0.35);
}
.sidebar-logo-mark svg { stroke: #fff; }
.sidebar-logo-name { font-family: var(--font-head); font-size: 15px; font-weight: 700; }
.sidebar-logo-tag  { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }

.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text2); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  margin-bottom: 2px; user-select: none;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-2);
  border-left: 3px solid var(--primary);
}
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 10px; font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  cursor: default;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cta));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role {
  font-size: 10px; color: var(--text3); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .5px;
}
.logout-btn {
  background: none; border: none; color: var(--text3);
  padding: 4px; border-radius: 6px; transition: color .15s;
  display: flex; align-items: center;
}
.logout-btn:hover { color: var(--red2); }

/* ── MAIN CONTENT ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── TOP BAR ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg1) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.topbar-title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text4);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.topbar-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.02em;
}
.topbar .jib-theme-btn {
  flex-shrink: 0;
}
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text3);
}
.topbar-breadcrumb span { color: var(--text2); }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.topbar-jobs,
.topbar-market {
  justify-content: space-between;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.fetch-hint-inline {
  font-size: 11px;
  color: var(--text3);
  max-width: 280px;
  line-height: 1.35;
}
.btn-theme {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
  cursor: pointer;
}
.btn-theme:hover {
  background: var(--bg4);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.btn-theme .theme-ico {
  display: block;
}
.req-star { color: var(--amber2); }

/* ── VIEWS ──────────────────────────────────────────────────── */
.view { padding: 28px; animation: viewIn .2s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── FETCH BAR ─────────────────────────────────────────────── */
.fetch-bar {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.fetch-field { flex: 1; min-width: 0; }
.fetch-field-role { flex: 1 1 220px; max-width: 260px; }
.fetch-field-loc { flex: 1 1 170px; max-width: 220px; }
.fetch-field-xs { flex: 0 0 100px; min-width: 92px; max-width: 120px; }
.fetch-field-sm { flex: 0 0 90px; min-width: 80px; }
.fetch-field label {
  display: block; font-size: 12px; color: var(--text2);
  margin-bottom: 3px; font-weight: 600; letter-spacing: .3px;
}
.filter-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); padding: 8px 12px; font-size: 13px;
  outline: none; transition: border-color .2s;
}
.filter-input-compact {
  padding: 9px 12px;
  font-size: 14px;
  height: 42px;
}
.filter-input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.filter-input::placeholder { color: var(--text3); }
.fetch-checks {
  display: flex; align-items: center; gap: 8px; padding-bottom: 2px;
  flex-shrink: 0;
}
.fetch-bar-actions {
  display: flex; align-items: flex-end; gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.fetch-bar-actions .btn-stop,
.fetch-bar-actions .btn-run {
  padding: 7px 12px;
  font-size: 12px;
}
.fetch-bar-actions .btn-run {
  padding: 8px 14px;
}
.check-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 14px; color: var(--text2); cursor: pointer;
  white-space: nowrap;
}

.fetch-bar-unified {
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}
.fetch-bar-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}
.fetch-field-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
}
.fetch-field-actions .btn-stop,
.fetch-field-actions .btn-run {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  min-height: 42px;
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative; overflow: hidden;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--card-accent, transparent);
}
.stat-card.c-indigo { --card-accent: linear-gradient(90deg, var(--indigo), var(--indigo2)); }
.stat-card.c-emerald { --card-accent: linear-gradient(90deg, var(--emerald), var(--emerald2)); }
.stat-card.c-amber   { --card-accent: linear-gradient(90deg, var(--amber), var(--amber2)); }
.stat-card.c-sky     { --card-accent: linear-gradient(90deg, #0ea5e9, var(--sky)); }
.stat-card.c-purple  { --card-accent: linear-gradient(90deg, #9333ea, #c084fc); }
.stat-card.c-red     { --card-accent: linear-gradient(90deg, var(--red), var(--red2)); }
.stat-val {
  font-family: var(--font-mono); font-size: 24px; font-weight: 700;
  color: var(--text); line-height: 1; margin-bottom: 4px;
}
.stat-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; }

/* ── SECTION TABS ──────────────────────────────────────────── */
.section-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.section-tab {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--text2);
  background: var(--tab-bg);
  border: 1px solid var(--tab-border);
  border-radius: 999px;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
  white-space: nowrap;
  cursor: pointer;
}
.section-tab:hover {
  color: var(--text4);
  border-color: var(--primary-2);
  transform: translateY(-1px);
}
.section-tab.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  border-color: var(--tab-active-border);
  box-shadow: 0 0 0 1px var(--tab-active-border);
}
.section-tab svg { flex-shrink: 0; }
.tab-count {
  background: var(--bg4); color: var(--text2);
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  padding: 1px 6px; border-radius: 999px;
}
.section-tab.active .tab-count {
  background: rgba(34, 197, 94, 0.2); color: var(--tab-active-text);
}

.tab-panel { display: none; animation: viewIn .2s ease; }
.tab-panel.active { display: block; }

/* ── TOOLBAR ────────────────────────────────────────────────── */
.toolbar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.search-box {
  position: relative; flex: 1; min-width: 180px; max-width: 300px;
}
.search-box .search-ico {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%); color: var(--text3);
  pointer-events: none;
}
.search-box input {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 10px 12px 10px 34px;
  font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.search-box input::placeholder { color: var(--text3); font-size: 12px; }

.filter-select {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  padding: 10px 28px 10px 12px; font-size: 14px;
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23475569' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color .2s;
}
input.filter-select, input[type="text"].filter-select {
  appearance: none;
  background-image: none;
  padding-right: 12px;
}
.filter-select:focus { border-color: var(--indigo); }

.btn-stop {
  display: flex; align-items: center; gap: 6px;
  background: var(--red); color: #fff; font-weight: 600; font-size: 13px;
  padding: 7px 14px; border-radius: 8px; border: none; cursor: pointer;
  transition: all .2s; white-space: nowrap;
}
.btn-stop:hover { filter: brightness(1.1); }
.btn-run {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 600; font-size: 13px;
  border: none; border-radius: 10px; padding: 9px 18px;
  transition: filter .2s, transform .2s, box-shadow .2s;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(3, 105, 161, 0.35);
  cursor: pointer;
}
.btn-run:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(3, 105, 161, 0.4); }
.btn-run:disabled { background: var(--bg4); color: var(--text3); box-shadow: none; transform: none; }
.btn-run .spin {
  width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite; display: none;
}
.btn-run.loading .spin { display: block; }
.btn-run.loading .btn-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.count-chip {
  margin-left: auto; background: #f1f5f9; border: 1px solid #dbe3ec;
  border-radius: 20px; padding: 4px 12px; font-size: 11px; color: var(--text3);
  font-family: var(--font-mono); white-space: nowrap;
}
.count-chip strong { color: var(--indigo2); }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.scrape-bar {
  overflow: hidden; height: 0; transition: height .3s;
  margin-bottom: 0;
}
.scrape-bar.show { height: 56px; margin-bottom: 12px; }
.scrape-bar-inner {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.bar-track { width: 100%; height: 4px; background: var(--bg4); border-radius: 2px; overflow: hidden; }
.bar-fill  { height: 4px; background: linear-gradient(90deg, var(--primary), var(--cta)); border-radius: 2px; transition: width .35s cubic-bezier(0.22, 1, 0.36, 1); }
.bar-row   { display: flex; align-items: center; justify-content: space-between; }
.bar-msg   { font-size: 12px; color: var(--text2); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-live  { font-size: 12px; color: var(--emerald); font-family: var(--font-mono); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.live-dot  { width: 7px; height: 7px; background: var(--emerald); border-radius: 50%; animation: livePulse 1s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ── NEW BADGE ──────────────────────────────────────────────── */
.new-badge {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .5px;
  padding: 1px 5px; border-radius: 3px; margin-right: 6px;
  background: linear-gradient(135deg, #10b981, #34d399); color: #fff;
  vertical-align: middle; animation: newPop .3s ease-out;
}
@keyframes newPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* ── RESUME CARD ────────────────────────────────────────────── */
.resume-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}
.resume-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; cursor: pointer; user-select: none;
  transition: background .15s;
}
.resume-card-header:hover { background: var(--bg3); }
.resume-card-header-left { display: flex; align-items: center; gap: 10px; }
.resume-icon-wrap {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.resume-icon-wrap svg { flex-shrink: 0; }
.resume-card-title { font-size: 13px; font-weight: 600; }
.resume-card-sub   { font-size: 11px; color: var(--text3); }
.resume-chevron    { color: var(--text3); transition: transform .25s cubic-bezier(0.22, 1, 0.36, 1); display: flex; align-items: center; }
.resume-chevron svg { display: block; }
.resume-card.open .resume-chevron { transform: rotate(180deg); }
.resume-card-body  { display: none; padding: 0 14px 12px; }
.resume-card.open .resume-card-body { display: block; }

.dropzone {
  border: 1.5px dashed var(--border2);
  border-radius: 8px; padding: 18px 16px;
  text-align: center; cursor: pointer;
  position: relative; transition: all .2s;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--primary); background: var(--primary-soft);
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-ico { margin-bottom: 10px; color: var(--primary); display: flex; justify-content: center; opacity: 0.9; }
.dropzone p   { font-size: 13px; color: var(--text2); }
.dropzone em  { color: var(--primary-2); font-style: normal; font-weight: 600; cursor: pointer; }
.dropzone small { font-size: 11px; color: var(--text3); margin-top: 4px; display: block; }

.resume-loaded {
  display: none;
  background: var(--bg3); border: 1px solid rgba(16,185,129,.2);
  border-radius: 8px; padding: 12px 14px;
  align-items: center; gap: 12px;
}
.resume-loaded.show { display: flex; }
.resume-loaded-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cta);
  flex-shrink: 0;
}
.resume-loaded-info { flex: 1; }
.resume-loaded-name { font-size: 13px; font-weight: 600; }
.resume-loaded-stat { font-size: 11px; color: var(--text3); margin-top: 2px; font-family: var(--font-mono); }
.btn-remove {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2);
  color: var(--red2); font-size: 12px; padding: 5px 12px; border-radius: 6px;
  transition: all .15s;
}
.btn-remove:hover { background: rgba(239,68,68,.2); }

/* ATS Overview */
.ats-overview { margin-top: 12px; }
.ats-ov-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ats-ov-lbl { font-size: 11px; color: var(--text2); width: 100px; text-align: right; font-family: var(--font-mono); }
.ats-ov-track { flex: 1; height: 5px; background: var(--bg4); border-radius: 3px; }
.ats-ov-fill  { height: 5px; border-radius: 3px; transition: width .6s ease; }
.ats-ov-pct   { font-size: 11px; color: var(--text3); font-family: var(--font-mono); width: 32px; }

/* ── SOURCE TAGS ──────────────────────────────────────────── */
.src-tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
.src-linkedin  { background: rgba(10,102,194,.1); color: #0a66c2; border: 1px solid rgba(10,102,194,.2); }
.src-indeed    { background: rgba(46,64,87,.1);   color: #2e4057; border: 1px solid rgba(46,64,87,.2); }
.src-gh        { background: rgba(16,185,129,.08); color: #059669; border: 1px solid rgba(16,185,129,.2); }
.src-lever     { background: rgba(147,51,234,.08); color: #7c3aed; border: 1px solid rgba(147,51,234,.2); }
.src-ash       { background: rgba(236,72,153,.08); color: #db2777; border: 1px solid rgba(236,72,153,.2); }
.src-rem       { background: rgba(59,130,246,.08); color: #3b82f6; border: 1px solid rgba(59,130,246,.2); }
.src-rok       { background: rgba(16,185,129,.08); color: #059669; border: 1px solid rgba(16,185,129,.2); }
.src-workday {
  background: rgba(0, 82, 204, .09);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, .22);
}
.src-arb       { background: rgba(234,88,12,.08); color: #ea580c; border: 1px solid rgba(234,88,12,.2); }
.src-sr        { background: rgba(14,165,233,.08); color: #0ea5e9; border: 1px solid rgba(14,165,233,.2); }
.src-bhr       { background: rgba(132,204,22,.08); color: #65a30d; border: 1px solid rgba(132,204,22,.2); }
.src-wd        { background: rgba(251,146,60,.08); color: #ea580c; border: 1px solid rgba(251,146,60,.2); }
.src-other     { background: var(--bg4); color: var(--text3); border: 1px solid var(--border); }

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

/* ── TABLE ──────────────────────────────────────────────────── */
.table-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.jobs-feed-card {
  background: transparent;
  border: 0;
}
.jobs-feed-wrap {
  max-height: min(72vh, calc(100vh - 300px));
  overflow: auto;
  padding: 2px;
}
.jobs-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 2px 0;
}
.job-card-clean {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  border-left: 3px solid transparent;
}
.job-card-clean:hover {
  border-color: var(--border2);
  border-left-color: var(--primary);
  box-shadow: 0 8px 24px rgba(3, 105, 161, 0.08);
  transform: translateY(-2px);
}
body[data-theme="dark"] .job-card-clean:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.job-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.job-card-left {
  display: flex;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.job-card-logo {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d1c3a7, #b9a57e);
  color: #4a3b24;
  border: 1px solid #d5c8ae;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .2px;
  flex-shrink: 0;
}
.job-card-idx {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.job-card-main { min-width: 0; }
.job-card-topline {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.job-card-time {
  background: #ecfdf3;
  color: #0f9f6e;
  border: 1px solid #c7efd8;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
}
.job-card-title {
  display: block;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}
.job-card-title:hover { color: var(--primary-2); }
.job-meta-item .ico-pin {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  margin-right: 2px;
  vertical-align: middle;
}
.job-meta-item .ico-pin svg { display: block; }
.job-card-sub {
  color: var(--text2);
  font-size: 15px;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-card-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px 0;
  margin-bottom: 4px;
}
.job-meta-item {
  font-size: 14px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.job-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.job-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 240px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.job-card-exp {
  margin-left: auto;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text3);
}
.job-card-exp strong {
  color: var(--text2);
}
.delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid rgba(239,68,68,.3);
  background: rgba(239,68,68,.08);
  color: #b91c1c;
  min-height: 34px;
}
.delete-btn:hover {
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.5);
}
.job-card-actions .apply-now {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
.job-card-actions .apply-now:hover { filter: brightness(1.1); }
.table-wrap {
  overflow: auto;
  max-height: min(70vh, calc(100vh - 320px));
}
table { width: 100%; border-collapse: collapse; min-width: 900px; }

thead th {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left; font-size: 11px;
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .8px; color: var(--text3);
  white-space: nowrap; cursor: pointer; user-select: none;
  position: sticky; top: 0; z-index: 3;
  box-shadow: 0 1px 0 var(--border);
  transition: color .15s;
}
thead th:hover { color: var(--indigo2); }
thead th.asc::after  { content: ' ↑'; color: var(--indigo2); }
thead th.desc::after { content: ' ↓'; color: var(--indigo2); }
thead th.nosort { cursor: default; }
thead th.nosort:hover { color: var(--text3); }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s; cursor: pointer;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg3); }

td { padding: 10px 14px; vertical-align: middle; }
td.idx { color: var(--text3); font-family: var(--font-mono); font-size: 11px; text-align: center; width: 40px; }
td.job-title { font-weight: 700; font-size: 14px; max-width: 220px; }
.job-title-text { font-size: 14px; font-weight: 700; color: var(--text); }
td.job-title a {
  color: var(--text); transition: color .15s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
td.job-title a:hover { color: var(--indigo2); }
td.company { color: var(--text2); font-size: 12px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.location { color: var(--text3); font-size: 12px; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.apps { color: var(--text3); font-family: var(--font-mono); font-size: 12px; }
td.posted-td { color: var(--text3); font-size: 11px; white-space: nowrap; }

/* Tags */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.tag-ft { background: rgba(16,185,129,.1); color: var(--emerald2); border: 1px solid rgba(16,185,129,.2); }
.tag-ct { background: rgba(245,158,11,.1); color: var(--amber2);   border: 1px solid rgba(245,158,11,.2); }
.tag-pt { background: rgba(56,189,248,.1); color: var(--sky);      border: 1px solid rgba(56,189,248,.2); }
.tag-in { background: rgba(168,85,247,.1); color: #c084fc;         border: 1px solid rgba(168,85,247,.2); }
.tag-vl { background: rgba(239,68,68,.1);  color: var(--red2);     border: 1px solid rgba(239,68,68,.2); }
.tag-xx { background: var(--bg4); color: var(--text3); border: 1px solid var(--border); }

.lvl-chip {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600; font-family: var(--font-mono);
  background: rgba(99,102,241,.08); color: var(--indigo2);
  border: 1px solid rgba(99,102,241,.15);
}

.salary-val { color: var(--emerald2); font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

/* ATS badge */
.ats-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: filter .15s;
}
.ats-chip:hover { filter: brightness(1.15); }
.ats-h { background: rgba(16,185,129,.1); color: var(--emerald2); border: 1px solid rgba(16,185,129,.25); }
.ats-m { background: rgba(245,158,11,.1); color: var(--amber2);   border: 1px solid rgba(245,158,11,.25); }
.ats-l { background: rgba(239,68,68,.1);  color: var(--red2);     border: 1px solid rgba(239,68,68,.25); }
.ats-n { background: var(--bg3); color: var(--text3); border: 1px solid var(--border); font-size: 10px; }

.ats-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}
.ats-mini-track {
  flex: 1;
  height: 6px;
  min-width: 48px;
  max-width: 72px;
  border-radius: 99px;
  background: var(--bg4);
  overflow: hidden;
}
.ats-mini-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  transition: width .2s ease;
}

.view-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #ffffff; border: 1px solid #cfd8e3;
  color: #334155; font-size: 13px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  min-height: 34px;
  transition: all .15s;
}
.view-btn:hover { background: #f8fafc; border-color: #94a3b8; }

.action-cell { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
td.action-cell { display: flex; }
.applied-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  transition: all .15s; border: 1px solid #cfd8e3;
  background: #ffffff; color: #334155;
  min-height: 34px;
}
.applied-btn:hover { border-color: var(--emerald); color: var(--emerald); }
.applied-btn.applied {
  background: rgba(16,185,129,.1); color: var(--emerald2);
  border-color: rgba(16,185,129,.25);
}
.applied-btn.applied:hover { background: rgba(239,68,68,.08); color: var(--red2); border-color: rgba(239,68,68,.2); }

/* Empty / no results */
.empty-state {
  display: none; padding: 60px 40px; text-align: center;
}
.empty-state.show { display: block; }
.empty-state .big-ico {
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--border2);
}
.empty-state .big-ico svg { opacity: 0.95; }
.empty-state h3 { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text3); max-width: 320px; margin: 0 auto; font-size: 13px; }
.no-results { display: none; padding: 40px; text-align: center; color: var(--text3); }
.no-results.show { display: block; }

.hint { font-size: 12px; color: var(--text3); padding: 8px 0; }
.panel-mini-title { font-size: 12px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }

/* ════════════════════════════════════════════════════════════════
   ADMIN VIEW
   ════════════════════════════════════════════════════════════════ */
.admin-intro {
  font-size: 13px; color: var(--text2); line-height: 1.55; max-width: 800px;
  margin-bottom: 20px; padding: 12px 14px; background: var(--bg2);
  border-radius: 10px; border: 1px solid var(--border);
}
.admin-audit-top { margin-bottom: 16px; }
.admin-audit-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 4px 0 8px;
}
@media (max-width: 900px) {
  .admin-audit-body { grid-template-columns: 1fr; }
}
.admin-audit-col .audit-list { max-height: 280px; overflow-y: auto; }
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.admin-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.admin-card-ico {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.ico-indigo { background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.2); }
.ico-emerald{ background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.2); }
.ico-amber  { background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.2); }
.ico-red    { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.2); }
.admin-card-title { font-size: 13px; font-weight: 600; }
.admin-card-body  { padding: 16px 18px; }

/* Health grid */
.health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.health-item { background: var(--bg3); border-radius: 8px; padding: 10px 12px; }
.health-item-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; font-family: var(--font-mono); }
.health-item-val { font-size: 14px; font-weight: 600; font-family: var(--font-mono); }
.status-ok  { color: var(--emerald2); }
.status-err { color: var(--red2); }
.status-warn{ color: var(--amber2); }

/* Users table */
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { font-size: 11px; color: var(--text3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .6px; padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.users-table td { padding: 9px 10px; font-size: 13px; border-bottom: 1px solid var(--border); }
.users-table tr:last-child td { border-bottom: none; }
.role-badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 700; font-family: var(--font-mono);
  text-transform: uppercase;
}
.role-admin { background: rgba(99,102,241,.15); color: var(--indigo2); border: 1px solid rgba(99,102,241,.2); }
.role-user  { background: var(--bg4); color: var(--text3); border: 1px solid var(--border); }

/* Add user form */
.add-user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.form-group label { font-size: 11px; color: var(--text3); display: block; margin-bottom: 4px; }
.form-group input, .form-group select {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 8px 10px;
  font-size: 13px; outline: none; transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--indigo); }
.form-group select { appearance: none; }
.btn-add-user {
  background: linear-gradient(135deg, #5b5ef4, var(--indigo));
  color: #fff; font-weight: 600; font-size: 13px;
  border: none; border-radius: 6px; padding: 8px 16px;
  transition: filter .2s; white-space: nowrap; align-self: end;
}
.btn-add-user:hover { filter: brightness(1.1); }

/* Audit log */
.audit-list { list-style: none; max-height: 240px; overflow-y: auto; }
.audit-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.audit-item:last-child { border-bottom: none; }
.audit-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--indigo); margin-top: 5px; flex-shrink: 0; }
.audit-actor { color: var(--indigo2); font-weight: 600; font-family: var(--font-mono); }
.audit-action { color: var(--text2); }
.audit-time { margin-left: auto; color: var(--text3); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; }

/* ════════════════════════════════════════════════════════════════
   ATS MODAL
   ════════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); width: 100%; max-width: 660px;
  max-height: 88vh; overflow-y: auto;
  animation: modalIn .2s ease;
  box-shadow: 0 32px 80px rgba(0,0,0,.25), 0 0 0 1px rgba(99,102,241,.1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(-8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-job  { font-family: var(--font-head); font-size: 17px; font-weight: 700; line-height: 1.3; }
.modal-co   { font-size: 13px; color: var(--text2); margin-top: 4px; }
.modal-x {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text3);
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  transition: all .15s;
}
.modal-x:hover { color: var(--red2); border-color: var(--red2); }

.modal-body { padding: 24px; }
.score-row {
  display: flex; align-items: center; gap: 24px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.ring-wrap { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.score-ring { transform: rotate(-90deg); }
.ring-bg   { fill: none; stroke: var(--bg4); stroke-width: 7; }
.ring-fill { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1); }
.ring-num  { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-pct  { font-family: var(--font-mono); font-size: 20px; font-weight: 700; line-height: 1; }
.ring-lbl  { font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.score-info { flex: 1; }
.score-grade { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.score-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }

.kw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kw-col-hd { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; font-family: var(--font-mono); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.kw-col-hd.found   { color: var(--emerald2); }
.kw-col-hd.missing { color: var(--red2); }
.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-tag { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-family: var(--font-mono); }
.kw-found   { background: rgba(16,185,129,.1); color: var(--emerald2); border: 1px solid rgba(16,185,129,.2); }
.kw-missing { background: rgba(239,68,68,.08); color: var(--red2); border: 1px solid rgba(239,68,68,.18); }
.kw-missing.hot { background: rgba(239,68,68,.15); }

.modal-tip {
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 8px; padding: 12px 14px; font-size: 12px; color: var(--text2); line-height: 1.6;
}
.modal-tip strong { color: var(--primary-2); }
.modal-foot {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.btn-ghost {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
  font-size: 13px; border-radius: 8px; padding: 8px 16px;
  transition: border-color .2s, color .2s, background .2s;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.insight-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.insight-pill-ico {
  flex-shrink: 0;
  opacity: 0.85;
}
.btn-apply {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-weight: 600; font-size: 13px;
  border: none; border-radius: 8px; padding: 8px 18px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  transition: filter .2s;
  cursor: pointer;
}
.btn-apply:hover { filter: brightness(1.06); }

.apply-confirm-modal { max-width: 560px; }
.apply-confirm-copy {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 14px;
}
.apply-confirm-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.apply-confirm-yes {
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #06d6a0, #10b981);
}
.apply-confirm-no {
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 10px;
  background: #ffffff;
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--bg1); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px 18px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(60px); opacity: 0;
  transition: all .25s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,.12); max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(16,185,129,.3); }
.toast.error   { border-color: rgba(239,68,68,.3); }

/* ── FOOTER ─────────────────────────────────────────────────── */
.app-footer {
  padding: 12px 28px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text3); font-family: var(--font-mono);
  flex-shrink: 0;
}
.app-footer strong { color: var(--primary-2); }
.app-footer-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-ico {
  display: inline-flex;
  color: var(--cta);
  flex-shrink: 0;
}

/* ── MOTION ACCESSIBILITY ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .view,
  .login-card,
  .new-badge {
    animation: none !important;
  }
  .live-dot {
    animation: none !important;
  }
  .job-card-clean {
    transition: border-color .15s, box-shadow .15s;
  }
  .job-card-clean:hover {
    transform: none;
  }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .section-tab { font-size: 12px; padding: 8px 10px; }
}
/* ── KANBAN BOARD ───────────────────────────────────────────── */
.kanban-board {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px;
  min-height: 400px;
}
.kanban-col {
  min-width: 250px; max-width: 300px; flex-shrink: 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column;
  transition: border-color .15s;
}
.kanban-col.drag-over { border-color: var(--indigo); border-style: dashed; }
.kanban-col-header {
  padding: 10px 12px; font-size: 12px; font-weight: 700;
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .5px; color: var(--text2);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px;
}
.kanban-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kanban-col-count {
  font-size: 10px; background: var(--bg4); padding: 1px 6px;
  border-radius: 8px; margin-left: auto; color: var(--text3);
}
.kanban-col-body { padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 60px; }
.kanban-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; cursor: grab; transition: transform .1s, box-shadow .1s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.kanban-card:active { cursor: grabbing; transform: rotate(2deg) scale(.97); opacity: .85; }
.kanban-card.kanban-stale { border-left: 3px solid #f59e0b; }
.kanban-card-head { display: flex; gap: 8px; align-items: flex-start; }
.kanban-avatar {
  width: 28px; height: 28px; border-radius: 6px; color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.kanban-card-info { flex: 1; min-width: 0; }
.kanban-card-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-card-co { font-size: 11px; color: var(--text3); }
.kanban-card-meta { display: flex; gap: 6px; margin-top: 6px; font-size: 10px; color: var(--text3); flex-wrap: wrap; }
.kanban-days { font-family: var(--font-mono); }
.kanban-action { background: var(--bg4); padding: 1px 6px; border-radius: 4px; }
.kanban-empty { font-size: 11px; color: var(--text3); text-align: center; padding: 16px 4px; }

/* ── MARKET DASHBOARD ──────────────────────────────────────── */
.market-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.market-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.market-card h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text2); margin: 0 0 10px; }
.market-card-wide { grid-column: span 2; }
.market-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.market-bar-label { font-size: 11px; color: var(--text2); width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; flex-shrink: 0; }
.market-bar-track { flex: 1; height: 6px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.market-bar-fill { height: 6px; background: linear-gradient(90deg, var(--indigo), var(--indigo2)); border-radius: 3px; transition: width .4s ease; }
.market-bar-val { font-size: 10px; font-family: var(--font-mono); color: var(--text3); width: 28px; text-align: right; }
.skill-heat-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-heat {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  background: rgba(99,102,241,.1); color: var(--indigo2);
  font-family: var(--font-mono);
}
.skill-heat small { font-size: 9px; color: var(--text3); }
.wp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.view-market-inner { max-width: 1200px; margin: 0 auto; }
.market-lead {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.market-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.market-meta {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 14px;
  line-height: 1.45;
}
.market-meta-line strong { color: var(--text2); }
.market-loading, .market-err {
  padding: 24px;
  text-align: center;
  color: var(--text3);
}
.market-err { color: var(--red2); }
.market-dashboard { margin-top: 4px; }

.companies-wrap { margin-top: 8px; }
.companies-intro {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 12px;
  line-height: 1.45;
}
.companies-table { min-width: 400px; }
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(99,102,241,.12);
  color: var(--indigo2);
  border: 1px solid rgba(99,102,241,.2);
}
.admin-protected {
  font-size: 11px;
  color: var(--text3);
  margin-right: 8px;
  font-style: italic;
}

/* ── JOB DETAIL DRAWER ─────────────────────────────────────── */
.job-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px); z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.job-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.job-drawer {
  position: fixed; top: 0; right: -480px; bottom: 0;
  width: 680px; max-width: 96vw; background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 101; overflow-y: auto; padding: 30px;
  transition: right .25s cubic-bezier(.16,1,.3,1);
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
}
.job-drawer-overlay.open .job-drawer { right: 0; }
.drawer-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); width: 28px; height: 28px;
  border-radius: 6px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.drawer-close:hover { background: var(--bg4); }
.drawer-title { font-size: 30px; font-weight: 800; margin-bottom: 8px; padding-right: 42px; line-height: 1.2; }
.drawer-meta { font-size: 18px; color: var(--text2); margin-bottom: 20px; line-height: 1.4; }
.drawer-section { margin-bottom: 20px; }
.drawer-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); font-weight: 700; margin-bottom: 10px; }
.drawer-desc { font-size: 18px; line-height: 1.8; color: var(--text2); max-height: 56vh; overflow-y: auto; }

#drawerKeywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#drawerKeywords .kw-tag {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
}

#drawerApply.btn-apply {
  font-size: 18px;
  padding: 12px 18px;
  min-height: 48px;
  justify-content: center;
}

/* ── AI INSIGHTS ──────────────────────────────────────────── */
.insight-loading { color: var(--text3); font-size: 12px; padding: 8px; animation: pulse 1.5s ease infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.insight-q { margin-bottom: 8px; line-height: 1.5; }
.insight-probe { color: var(--text3); font-size: 11px; }
.insight-diff { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--bg4); color: var(--text3); text-transform: uppercase; }
.insight-gap { margin-bottom: 4px; font-size: 12px; line-height: 1.4; }
#insightPanel h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--text2); margin: 0 0 6px; }

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .view { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .kw-grid { grid-template-columns: 1fr; }
  .section-tabs { gap: 6px; }
  .section-tab { padding: 6px 10px; font-size: 11px; }
  .jobs-list { grid-template-columns: 1fr; gap: 10px; }
  .job-card-head { flex-direction: column; }
  .job-card-actions { align-items: center; justify-content: flex-start; min-width: 0; flex-wrap: wrap; }
  .job-card-title { font-size: 18px; }
  .job-card-info-grid { grid-template-columns: 1fr; }
  .fetch-field-role,
  .fetch-field-loc,
  .fetch-field-xs {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
  .market-grid { grid-template-columns: 1fr; }
  .market-card-wide { grid-column: span 1; }
  .kanban-board { flex-direction: column; }
  .kanban-col { min-width: auto; max-width: none; }
}

@media (max-width: 1180px) {
  .jobs-list { grid-template-columns: 1fr; }
}
