/* RecruvAI Recruiter UI - design system
   IMPORTANT: every CSS variable and class name that existed before this
   polish pass is preserved exactly (var(--muted), var(--line), var(--brand),
   .card, .btn, .btn.ghost, .badge, .err, table/th/td, tr.row, .topbar, label,
   input/textarea/select) because HTML files use them extensively inline and
   in JS-generated markup. Only values are refined, and new items are purely
   additive (.stat-card, .btn.sm, .success, .empty-state, .mono, .nav-links,
   .section-title, .brand). No JavaScript needed any change for this file. */

:root {
  --brand: #4A63E0;
  --brand-dark: #3949B8;
  --brand-light: #EEF1FD;
  --bg: #F6F7F9;
  --panel: #FFFFFF;
  --line: #E3E6EB;
  --text: #101828;
  --muted: #667085;
  --ok-color: #17A374;
  --warn-color: #B76E00;
  --bad-color: #D0324A;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ---------- Layout ---------- */
.wrap { max-width: 480px; margin: 60px auto; padding: 0 20px; }
.wrap.wide { max-width: 1120px; margin: 32px auto 60px; padding: 0 24px; }

@media (max-width: 820px) {
  .wrap.wide { padding: 0 16px; margin-top: 16px; }
}

/* ---------- Top bar / brand ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar h1 { display: flex; align-items: center; gap: 8px; }
.topbar > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  color: var(--brand-dark);
  letter-spacing: -0.2px;
  text-decoration: none;
}
.brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #8A6CFA);
  color: #fff;
  font-size: 13px;
}

.nav-links { display: flex; gap: 4px; margin-right: 8px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}
.nav-links a:hover { background: var(--brand-light); color: var(--brand-dark); }
.nav-links a.active { background: var(--brand-light); color: var(--brand-dark); }

.page-header { margin-bottom: 4px; }
.page-header h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.3px; }
.page-subtitle { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.stat-card .stat-label { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat-grid { display: grid; gap: 12px; margin-bottom: 24px; }

/* ---------- Typography ---------- */
h1, h2 { margin: 0 0 6px; letter-spacing: -0.2px; }
p.lead { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  background: #FAFBFC;
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 99, 224, 0.14);
  background: #fff;
}

/* ---------- Buttons ---------- */
button.btn {
  background: var(--brand);
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  transition: background .12s, transform .05s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
button.btn:hover { background: var(--brand-dark); }
button.btn:active { transform: translateY(1px); }
button.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

button.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: none;
}
button.btn.ghost:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-light); }

button.btn.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 7px; }

/* ---------- Alerts ---------- */
.err {
  background: #FDECEE;
  border: 1px solid #F3B6C0;
  color: #8A1230;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.success {
  background: #E9F9F2;
  border: 1px solid #A9E6CC;
  color: #0F5C41;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

.muted-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.muted-link:hover { color: var(--brand-dark); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.row { cursor: pointer; transition: background .1s; }
tr.row:hover td { background: var(--brand-light); }
tr:last-child td { border-bottom: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #EEF0F3;
  color: var(--muted);
  letter-spacing: .2px;
}
.badge.ok { background: rgba(23, 163, 116, .12); color: var(--ok-color); }
.badge.warn { background: rgba(183, 110, 0, .12); color: var(--warn-color); }
.badge.bad { background: rgba(208, 50, 74, .12); color: var(--bad-color); }
.badge.idle { background: #EEF0F3; color: var(--muted); }

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 30px; margin-bottom: 10px; opacity: .6; }
.empty-state .empty-title { font-weight: 700; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.empty-state .empty-desc { font-size: 13px; }

/* ---------- Misc utilities ---------- */
.mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 12px; }
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.divider { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

@media (max-width: 700px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
}


/* ---------- Recruiter identity dropdown (additive) ---------- */
.recruiter-menu { position: relative; display: inline-block; }

.recruiter-menu-trigger {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.recruiter-menu-trigger:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-light);
}

.recruiter-menu-trigger .chevron {
  font-size: 10px;
  opacity: .7;
}

.recruiter-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  z-index: 50;
}

.recruiter-menu-panel.open {
  display: block;
}

.recruiter-menu-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.recruiter-menu-role {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.recruiter-menu-divider {
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.recruiter-menu-logout {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--bad-color, #D0324A);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.recruiter-menu-logout:hover {
  background: #FDECEE;
  border-color: #F3B6C0;
}

@media (max-width: 480px) {
  .recruiter-menu-panel {
    right: -8px;
    min-width: 200px;
  }
}
