/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --bg:         #0c0c0e;
  --bg-2:       #141416;
  --surface:    #18181b;
  --surface-2:  #1f1f24;
  --surface-3:  #27272d;
  --border:     rgba(255,255,255,.07);
  --border-2:   rgba(255,255,255,.12);

  --text:       #f0f0f2;
  --text-2:     #a0a0aa;
  --text-3:     #606068;

  --accent:     #818cf8;
  --accent-dim: rgba(129,140,248,.15);
  --accent-h:   #6366f1;

  --green:  #34d399;
  --yellow: #fbbf24;
  --red:    #f87171;
  --orange: #fb923c;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.4);

  --sidebar-w: 220px;
  --transition: .15s ease;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
select option { background: var(--surface-3); }
textarea { resize: vertical; min-height: 80px; }
h1,h2,h3,h4 { font-weight: 600; line-height: 1.3; }
img { max-width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-badge {
  margin-left: auto;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: 99px;
  padding: 1px 7px;
  font-size: .75rem;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.btn-new-app {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}
.btn-new-app:hover { background: var(--accent-h); }
.btn-new-app svg { width: 16px; height: 16px; }

#main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
#page-content { padding: 28px 32px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: rgba(248,113,113,.12); color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.2); }
.btn-icon {
  padding: 6px;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon svg { width: 15px; height: 15px; display: block; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.page-header .subtitle { color: var(--text-2); font-size: .875rem; margin-top: 2px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* ── Stats Cards ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-color, var(--accent));
  opacity: .6;
}
.stat-card .stat-label { font-size: .75rem; color: var(--text-2); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; margin: 6px 0 2px; }
.stat-card .stat-sub { font-size: .75rem; color: var(--text-3); }

/* ── Grid layout ─────────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: .9rem; font-weight: 600; }
.card-body { padding: 16px 20px; }

/* ── Status Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2px;
}
.badge::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; }

.badge-draft      { background: rgba(113,113,122,.15); color: #a1a1aa; }
.badge-applied    { background: rgba(96,165,250,.15);  color: #60a5fa; }
.badge-seen       { background: rgba(167,139,250,.12); color: #a78bfa; }
.badge-screening  { background: rgba(192,132,252,.12); color: #c084fc; }
.badge-hr_interview { background: rgba(251,191,36,.12); color: #fbbf24; }
.badge-technical_test { background: rgba(251,191,36,.18); color: #f59e0b; }
.badge-interview_1 { background: rgba(251,146,60,.12); color: #fb923c; }
.badge-interview_2 { background: rgba(251,146,60,.18); color: #f97316; }
.badge-interview_3 { background: rgba(251,146,60,.22); color: #ea580c; }
.badge-offer      { background: rgba(52,211,153,.12); color: #34d399; }
.badge-accepted   { background: rgba(16,185,129,.18); color: #10b981; }
.badge-rejected   { background: rgba(248,113,113,.12); color: #f87171; }
.badge-withdrawn  { background: rgba(156,163,175,.12); color: #9ca3af; }
.badge-ghosted    { background: rgba(107,114,128,.12); color: #6b7280; }

.badge-priority-high   { background: rgba(248,113,113,.12); color: var(--red); }
.badge-priority-medium { background: rgba(251,191,36,.12);  color: var(--yellow); }
.badge-priority-low    { background: rgba(52,211,153,.1);   color: var(--green); }

/* ── Application List ────────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-box {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 0 12px;
}
.search-box svg { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; }
.search-box input {
  background: none;
  border: none;
  box-shadow: none;
  padding: 8px 0;
  font-size: .875rem;
  flex: 1;
}
.filter-select {
  padding: 8px 12px;
  border-radius: var(--r);
  font-size: .8rem;
  background: var(--surface);
  border-color: var(--border-2);
  min-width: 120px;
}

.app-table { width: 100%; border-collapse: collapse; }
.app-table thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.app-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.app-table tbody tr:hover { background: var(--surface-2); }
.app-table tbody tr:last-child { border-bottom: none; }
.app-table td {
  padding: 12px 12px;
  font-size: .875rem;
  vertical-align: middle;
}

.company-cell { display: flex; align-items: center; gap: 10px; }
.company-avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  flex-shrink: 0;
}
.company-name { font-weight: 600; }
.company-location { font-size: .75rem; color: var(--text-3); }

.td-pos { color: var(--text-2); }
.td-date { color: var(--text-3); font-family: 'JetBrains Mono', monospace; font-size: .78rem; }

.priority-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.priority-dot.high   { background: var(--red); }
.priority-dot.medium { background: var(--yellow); }
.priority-dot.low    { background: var(--green); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state svg { width: 48px; height: 48px; margin: 0 auto 16px; display: block; opacity: .3; }
.empty-state p { margin-top: 6px; font-size: .875rem; }

/* ── Kanban ──────────────────────────────────────────────────────────────── */
.kanban-wrapper {
  overflow-x: auto;
  padding-bottom: 16px;
}
.kanban-board {
  display: flex;
  gap: 12px;
  min-width: max-content;
  align-items: flex-start;
}
.kanban-col {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.kanban-col-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 600;
}
.kanban-col-count {
  font-size: .72rem; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
  border-radius: 99px; padding: 1px 7px;
}
.kanban-cards { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.kanban-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.kanban-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.kanban-card-company { font-weight: 600; font-size: .8rem; }
.kanban-card-pos { font-size: .75rem; color: var(--text-2); margin-top: 2px; }
.kanban-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.kanban-card-date { font-size: .7rem; color: var(--text-3); }

/* ── Application Detail ──────────────────────────────────────────────────── */
.detail-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
}
.detail-avatar {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 700;
  flex-shrink: 0;
}
.detail-meta { flex: 1; }
.detail-company { font-size: 1.2rem; font-weight: 700; }
.detail-position { font-size: 1rem; color: var(--text-2); margin-top: 2px; }
.detail-pills {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.pill {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .75rem; color: var(--text-2);
}
.pill svg { width: 12px; height: 12px; }
.detail-header-actions { display: flex; gap: 6px; flex-shrink: 0; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 8px 16px;
  background: none;
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); background: var(--surface-2); }
.tab-btn.active { color: var(--accent); border-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Overview tab */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.info-item label {
  display: block;
  font-size: .72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.info-item .val {
  font-size: .875rem;
  color: var(--text);
}
.info-item .val a { color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.info-item .val a:hover { text-decoration: underline; }
.info-item .val svg { width: 13px; height: 13px; flex-shrink: 0; }

.notes-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  font-size: .875rem;
  color: var(--text-2);
  line-height: 1.6;
  white-space: pre-wrap;
  min-height: 60px;
}
.notes-box.empty { color: var(--text-3); font-style: italic; }

.section-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  margin-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
}

/* Timeline */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border-2);
}
.timeline-item {
  position: relative;
  margin-bottom: 16px;
}
.timeline-dot {
  position: absolute;
  left: -24px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.timeline-item .tl-date {
  font-size: .72rem;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 2px;
}
.timeline-item .tl-title { font-size: .875rem; font-weight: 600; }
.timeline-item .tl-desc { font-size: .8rem; color: var(--text-2); margin-top: 2px; }
.timeline-item .tl-delete {
  position: absolute; right: 0; top: 0;
  opacity: 0; transition: opacity var(--transition);
}
.timeline-item:hover .tl-delete { opacity: 1; }

/* Contacts */
.contacts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.contact-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
}
.contact-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.contact-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.contact-name { font-weight: 600; font-size: .875rem; }
.contact-role { font-size: .72rem; color: var(--text-3); }
.contact-links { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-link {
  display: flex; align-items: center; gap: 4px;
  font-size: .75rem; color: var(--text-2);
  background: var(--surface-3);
  border-radius: 99px;
  padding: 2px 8px;
  transition: color var(--transition);
}
.contact-link:hover { color: var(--accent); }
.contact-link svg { width: 11px; height: 11px; }
.contact-card-actions { display: flex; gap: 4px; margin-top: 10px; }

/* Documents */
.docs-list { display: flex; flex-direction: column; gap: 6px; }
.doc-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  transition: border-color var(--transition);
}
.doc-item:hover { border-color: var(--border-2); }
.doc-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.doc-icon.pdf { background: rgba(248,113,113,.12); color: var(--red); }
.doc-icon.doc { background: rgba(96,165,250,.12); color: #60a5fa; }
.doc-icon.other { background: var(--surface-3); color: var(--text-3); }
.doc-icon svg { width: 16px; height: 16px; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: .875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: .72rem; color: var(--text-3); margin-top: 1px; }
.doc-type-badge { font-size: .7rem; font-weight: 600; color: var(--text-2); background: var(--surface-3); padding: 2px 7px; border-radius: 99px; }
.doc-actions { display: flex; gap: 4px; }

.upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 12px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-zone svg { width: 32px; height: 32px; margin: 0 auto 10px; display: block; color: var(--text-3); }
.upload-zone p { font-size: .875rem; color: var(--text-2); }
.upload-zone span { font-size: .75rem; color: var(--text-3); }

/* ── Dashboard Charts ─────────────────────────────────────────────────────── */
.chart-container { position: relative; height: 200px; }

.funnel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
}
.funnel-label { width: 100px; color: var(--text-2); text-align: right; white-space: nowrap; }
.funnel-bar-wrap { flex: 1; background: var(--surface-3); border-radius: 4px; overflow: hidden; height: 6px; }
.funnel-bar { height: 100%; border-radius: 4px; background: var(--accent); transition: width .6s ease; }
.funnel-count { width: 30px; font-weight: 600; color: var(--text); text-align: right; }

/* Recent applications */
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity var(--transition);
}
.recent-item:hover { opacity: .8; }
.recent-item:last-child { border-bottom: none; }
.recent-info { flex: 1; min-width: 0; }
.recent-company { font-weight: 600; font-size: .875rem; }
.recent-pos { font-size: .75rem; color: var(--text-2); }
.recent-date { font-size: .72rem; color: var(--text-3); white-space: nowrap; }

/* Upcoming events */
.event-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.event-item:last-child { border-bottom: none; }
.event-date-box {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  text-align: center;
  font-size: .7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  min-width: 44px;
}
.event-title { font-size: .8rem; font-weight: 600; }
.event-company { font-size: .72rem; color: var(--text-3); }

/* ── Form ────────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span-2 { grid-column: span 2; }
.form-group label { font-size: .78rem; font-weight: 600; color: var(--text-2); }
.form-group input,
.form-group select,
.form-group textarea { width: 100%; }
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
#modal-overlay.hidden { display: none; }
#modal-box {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
#modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--surface);
  z-index: 1;
}
#modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: transparent;
  color: var(--text-3);
  border-radius: var(--r-sm);
  padding: 4px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; display: block; }
#modal-body { padding: 24px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 500;
  max-width: 320px;
  animation: slideLeft .2s ease;
  box-shadow: var(--shadow);
}
.toast.success { border-color: rgba(52,211,153,.3); }
.toast.error   { border-color: rgba(248,113,113,.3); }
.toast.info    { border-color: rgba(129,140,248,.3); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success svg { color: var(--green); }
.toast.error svg   { color: var(--red); }
.toast.info svg    { color: var(--accent); }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--text-3);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-2); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { width: 12px; height: 12px; }

/* ── Quick status pills ──────────────────────────────────────────────────── */
.status-select-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.status-pill {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.status-pill:hover { border-color: var(--border-2); }
.status-pill.active { border-color: currentColor; background: transparent; }

/* ── Source bar ──────────────────────────────────────────────────────────── */
.source-list { display: flex; flex-direction: column; gap: 8px; }
.source-row {
  display: flex; align-items: center; gap: 8px; font-size: .8rem;
}
.source-name { width: 120px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-bar-wrap { flex: 1; background: var(--surface-3); border-radius: 4px; overflow: hidden; height: 4px; }
.source-bar { height: 100%; border-radius: 4px; background: var(--accent); transition: width .6s ease; }
.source-count { font-weight: 600; color: var(--text); }

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(20px); } }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: .8rem; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.flex { display: flex; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; gap: 12px; color: var(--text-3);
}

/* ── CV inline embed (aperçu tab) ────────────────────────────────────────── */
.cv-inline-section {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cv-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cv-inline-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--green);
}
.cv-inline-title svg { width: 15px; height: 15px; }
.cv-inline-name { font-weight: 400; color: var(--text-2); font-size: .78rem; margin-left: 2px; }
.cv-embed-pdf {
  display: block;
  width: 100%;
  height: 82vh;
  border: none;
}
.cv-embed-img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  padding: 16px;
}
.cv-no-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-3);
  font-size: .875rem;
}
.cv-no-preview svg { width: 40px; height: 40px; opacity: .3; }

/* ── Wide modal (CV preview) ─────────────────────────────────────────────── */
#modal-box.wide {
  max-width: 880px;
}

/* ── CV upload zone (in form) ────────────────────────────────────────────── */
.cv-drop-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px dashed var(--border-2);
  border-radius: var(--r);
  padding: 16px 18px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.cv-drop-zone:hover, .cv-drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.cv-drop-zone.has-file {
  border-color: var(--green);
  background: rgba(52,211,153,.06);
  border-style: solid;
}
.cv-drop-zone svg { width: 22px; height: 22px; color: var(--text-3); flex-shrink: 0; }
.cv-drop-zone.has-file svg { color: var(--green); }
.cv-drop-zone-text { flex: 1; min-width: 0; }
.cv-drop-label { font-size: .875rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-drop-zone.has-file .cv-drop-label { color: var(--text); font-weight: 500; }
.cv-drop-sub { font-size: .72rem; color: var(--text-3); margin-top: 1px; }

/* ── CV preview ──────────────────────────────────────────────────────────── */
.preview-pdf {
  width: 100%;
  height: 74vh;
  border: none;
  border-radius: var(--r);
  background: #fff;
  display: block;
}
.preview-img {
  max-width: 100%;
  border-radius: var(--r);
  display: block;
  margin: 0 auto;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cv-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(52,211,153,.1);
  color: var(--green);
  border: 1px solid rgba(52,211,153,.25);
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.cv-badge:hover { background: rgba(52,211,153,.18); }
.cv-badge svg { width: 12px; height: 12px; }

/* ── Auth Screen ─────────────────────────────────────────────────────────── */
.auth-box {
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 32px;
  justify-content: center;
}
.auth-box h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; text-align: center; }
.auth-subtitle { text-align: center; color: var(--text-2); font-size: .875rem; margin-bottom: 24px; }
.auth-form {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.auth-field input { width: 100%; }
.auth-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r);
  font-size: .9rem;
  font-weight: 600;
  margin-top: 6px;
  transition: background var(--transition);
}
.auth-btn:hover:not(:disabled) { background: var(--accent-h); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-switch { text-align: center; margin-top: 16px; font-size: .8rem; color: var(--text-3); }
.auth-switch a { color: var(--accent); cursor: pointer; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }
.auth-error {
  background: rgba(248,113,113,.1);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: var(--r-sm);
  color: var(--red);
  padding: 8px 12px;
  font-size: .8rem;
  margin-bottom: 14px;
  display: none;
}
.auth-error.visible { display: block; }

/* ── Sidebar user info ───────────────────────────────────────────────────── */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--surface-2);
  margin-bottom: 8px;
}
.sidebar-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .66rem; color: var(--text-3); }
.sidebar-logout {
  background: transparent;
  color: var(--text-3);
  border-radius: var(--r-sm);
  padding: 4px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--red); }
.sidebar-logout svg { width: 14px; height: 14px; display: block; }

/* ── Admin panel ─────────────────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead th {
  text-align: left;
  font-size: .72rem; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .5px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.admin-table tbody tr { border-bottom: 1px solid var(--border); }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table td { padding: 10px 12px; font-size: .875rem; vertical-align: middle; }
.role-badge-admin { background: rgba(129,140,248,.15); color: var(--accent); padding: 2px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.role-badge-user  { background: var(--surface-3); color: var(--text-2); padding: 2px 8px; border-radius: 99px; font-size: .72rem; font-weight: 600; }
.status-active   { color: var(--green); font-size: .8rem; font-weight: 600; }
.status-inactive { color: var(--text-3); font-size: .8rem; }

/* ── Import from URL ─────────────────────────────────────────────────────── */
.import-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.import-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.import-section-label svg { width: 13px; height: 13px; }
.import-row { display: flex; gap: 8px; }
.import-input { flex: 1; min-width: 0; }
.import-status { margin-top: 8px; font-size: .78rem; min-height: 18px; }
.import-ok  { color: var(--green); }
.import-err { color: var(--red); }
.import-bm-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: var(--text-3);
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: rgba(129,140,248,.4);
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--accent-h); }

/* ── Bookmarklet modal ──────────────────────────────────────────────────── */
.bm-modal { display: flex; flex-direction: column; gap: 16px; }
.bm-intro { color: var(--text-2); font-size: .875rem; line-height: 1.6; }
.bm-steps { display: flex; flex-direction: column; gap: 14px; }
.bm-step  { display: flex; gap: 12px; align-items: flex-start; font-size: .875rem; }
.bm-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.bm-drag-zone {
  margin-top: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 2px dashed var(--border-2);
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
}
.bm-drag-link {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(129,140,248,.3);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  font-size: .875rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  text-decoration: none;
  display: inline-block;
}
.bm-drag-link:hover { background: rgba(129,140,248,.25); }
.bm-drag-tip { font-size: .72rem; color: var(--text-3); margin-top: 6px; }
.bm-details {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
}
.bm-details summary {
  cursor: pointer;
  font-size: .8rem;
  color: var(--text-2);
  outline: none;
}
.bm-code-textarea {
  width: 100%;
  height: 80px;
  font-size: .68rem;
  font-family: 'JetBrains Mono', monospace;
  resize: vertical;
  margin-top: 6px;
}
.spinner-sm {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2,1fr); }
  .contacts-grid { grid-template-columns: 1fr; }
  #page-content { padding: 16px; }
}
@media (max-width: 600px) {
  :root { --sidebar-w: 0; }
  #sidebar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span-2 { grid-column: span 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
