:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #17181a;
  --muted: #6b6f76;
  --line: #e2e2df;
  --accent: #1f5fd6;
  --accent-ink: #ffffff;
  --danger: #b4231f;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a;
    --surface: #1e2024;
    --ink: #ecedef;
    --muted: #9aa0a8;
    --line: #2e3138;
    --accent: #6d9cff;
    --accent-ink: #10131a;
    --danger: #ff7a72;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
}

main { max-width: 1080px; margin: 0 auto; padding: 28px 20px 64px; }

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; text-decoration: none; color: var(--ink); letter-spacing: -0.01em; }
.site-header nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--ink); }

h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 16px; margin: 22px 0 8px; letter-spacing: -0.01em; }
h2:first-child { margin-top: 0; }
a { color: var(--accent); }

.hero, .page-head { margin-bottom: 20px; }
.lede { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.meta { color: var(--muted); font-size: 14px; margin: 4px 0; }
.sub { color: var(--muted); font-size: 13px; }
.strong { font-weight: 600; text-decoration: none; }
.back { display: inline-block; font-size: 14px; text-decoration: none; margin-bottom: 10px; }
.empty { color: var(--muted); padding: 32px 0; }
.fine { color: var(--muted); font-size: 13px; }
.role-desc { max-width: 68ch; margin: 8px 0 0; }
.note, .resume-text { white-space: pre-wrap; }
.resume-text { color: var(--muted); font-size: 13px; max-height: 320px; overflow-y: auto; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card.centered { text-align: center; max-width: 520px; margin: 48px auto; }
.narrow { max-width: 400px; margin: 48px auto; }

.form label, .filters label { display: block; font-size: 14px; font-weight: 550; margin-bottom: 14px; }
input, select, textarea {
  width: 100%; margin-top: 5px; padding: 9px 10px; font: inherit; font-weight: 400;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 7px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; }
.req { color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.hp { position: absolute; left: -9999px; }

.button {
  display: inline-block; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 15px;
  font-weight: 550; text-decoration: none; cursor: pointer;
}
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.button.ghost { background: transparent; }
.button:hover { filter: brightness(0.97); }
.link-button {
  background: none; border: none; color: var(--muted); font: inherit; font-size: 15px;
  cursor: pointer; padding: 0;
}
.link-button.danger { color: var(--danger); margin-top: 14px; }
.inline { display: inline; }
.summary-button { cursor: pointer; font-weight: 550; font-size: 15px; }

.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 7px; margin-bottom: 8px; font-size: 15px; }
.flash-error { background: rgba(180, 35, 31, 0.12); color: var(--danger); }
.flash-success { background: rgba(31, 95, 214, 0.12); color: var(--accent); }

.role-list, .role-admin-list { list-style: none; padding: 0; margin: 0; }
.role-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
}
.role-card h2 { margin: 0; font-size: 18px; }
.role-admin.closed { opacity: 0.62; }
.role-admin-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.role-admin-head h2 { margin: 0; font-size: 18px; }
.role-admin-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.share { display: block; margin: 14px 0 10px; font-size: 13px; color: var(--muted); }
.share input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; align-items: end;
}
.filters input, .filters select { margin-top: 0; }
.filters input[type="search"] { grid-column: span 2; }
.filters .button { height: 39px; line-height: 19px; text-align: center; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.candidates { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
table.candidates th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600;
}
table.candidates td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.candidates tr:last-child td { border-bottom: none; }
.stars { color: #d9a400; white-space: nowrap; letter-spacing: 1px; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  font-weight: 600; background: var(--bg); border: 1px solid var(--line); white-space: nowrap;
}
.badge-new { border-color: var(--accent); color: var(--accent); }
.badge-hired { border-color: #2e8b57; color: #2e8b57; }
.badge-rejected, .badge-archived { color: var(--muted); }
.badge-talent_pool { border-color: #7a5cc4; color: #7a5cc4; }
.tag {
  display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); font-size: 12px;
}

.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px; align-items: start;
}
dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

.tag-browser { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 16px; }
.tag-browser .tag { margin: 0; text-decoration: none; color: var(--ink); }
.tag-browser .tag:hover { border-color: var(--accent); }
.tag-active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.bulk-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.bulk-all { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 550; }
.bulk-bar #selected-count { margin-right: auto; }
.bulk-bar input[type="checkbox"], .check-col input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; accent-color: var(--accent);
}
.check-col { width: 34px; }
.button[disabled] { opacity: 0.45; cursor: not-allowed; }
