:root {
  --canvas: #F7F8FB;
  --surface: #FFFFFF;
  --surface-2: #F1F2F8;
  --ink: #16172B;
  --muted: #6B6F8A;
  --line: #E6E8F0;
  --indigo: #4F46E5;
  --indigo-soft: #ECEBFD;
  --coral: #FF6B5A;
  --coral-soft: #FFE9E5;
  --amber: #E0A422;
  --violet: #7C5CFC;
  --success: #16A36A;
  --alert: #DC4B3E;
  --radius: 8px;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3, .brand {
  font-family: var(--font-display);
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--indigo);
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link.active {
  color: var(--indigo);
  border-bottom-color: var(--indigo);
}

.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: 30px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--indigo);
  font-family: var(--font-display);
  margin-bottom: 0.4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 1px 3px rgba(22, 23, 43, 0.06);
  margin-bottom: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--indigo);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(22, 23, 43, 0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22, 23, 43, 0.10);
}

.stat.is-coral {
  border-left-color: var(--coral);
}

.stat.is-success {
  border-left-color: var(--success);
}

.stat.is-amber {
  border-left-color: var(--amber);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 10px;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 5px;
}

.card form label {
  display: block;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.card form label input,
.card form label select,
.card form label textarea {
  margin-top: 6px;
  font-weight: 400;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--indigo);
  outline-offset: 0;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row-actions form {
  display: inline;
  margin: 0;
}

table {
  width: 100%;
  background: var(--surface);
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

thead {
  background: var(--surface-2);
}

thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-2);
}

tbody td {
  padding: 12px 16px;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pill-sourced {
  background: var(--surface-2);
  color: var(--muted);
}

.pill-screening {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.pill-submitted {
  background: var(--coral-soft);
  color: var(--coral);
}

.pill-interview {
  background: #FFF3D6;
  color: var(--amber);
}

.pill-offer {
  background: #EFEAFE;
  color: var(--violet);
}

.pill-placed {
  background: #DDF3E9;
  color: var(--success);
}

.pill-rejected {
  background: var(--surface-2);
  color: var(--muted);
}

.pill-open {
  background: #DDF3E9;
  color: var(--success);
}

.pill-on_hold {
  background: #FFF3D6;
  color: var(--amber);
}

.pill-filled {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.pill-closed {
  background: var(--surface-2);
  color: var(--muted);
}

.btn {
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: filter 0.15s;
}

.btn:hover {
  filter: brightness(0.95);
}

.btn-2 {
  background: transparent;
  color: var(--coral);
  border: 1.5px solid var(--coral);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, color 0.15s;
}

.btn-2:hover {
  background: var(--coral-soft);
}

.muted {
  color: var(--muted);
}

.board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 12px;
}

.board-col {
  min-width: 264px;
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.board-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid var(--line);
}

.board-col-head .count {
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 700;
}

.board-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  min-height: 60px;
}

.board-col.stage-sourced .board-col-head {
  border-bottom-color: var(--muted);
}

.board-col.stage-screening .board-col-head {
  border-bottom-color: var(--indigo);
}

.board-col.stage-submitted .board-col-head {
  border-bottom-color: var(--coral);
}

.board-col.stage-interview .board-col-head {
  border-bottom-color: var(--amber);
}

.board-col.stage-offer .board-col-head {
  border-bottom-color: var(--violet);
}

.board-col.stage-placed .board-col-head {
  border-bottom-color: var(--success);
}

.cand-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--indigo);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(22, 23, 43, 0.05);
  transition: transform 0.12s, box-shadow 0.12s;
}

.cand-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 23, 43, 0.10);
}

.cand-card .cand-name {
  font-weight: 700;
}

.cand-card .cand-headline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.cand-move {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.cand-move select {
  padding: 5px 8px;
  font-size: 12px;
}

.cand-move button {
  padding: 6px 10px;
  font-size: 12px;
}

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 20px;
  }
  
  .main {
    padding: 20px 16px;
  }
  
  .field-grid {
    grid-template-columns: 1fr;
  }
}

/* records-layout + form/list grammar (New Patient pattern) */
.count-badge{ display:inline-block; background:var(--indigo-soft); color:var(--indigo); font-size:.75rem; font-weight:700; padding:5px 12px; border-radius:999px; }
.records-layout{ display:grid; grid-template-columns:420px 1fr; gap:20px; align-items:start; margin-bottom:20px; }
.records-layout > .card{ margin-bottom:0; }
.card form .stacked-label{ display:block; margin-bottom:16px; }
.card form .stacked-label > span{ display:block; font-weight:600; font-size:14px; color:var(--ink); margin-bottom:6px; }
.card form .field-grid .stacked-label{ margin-bottom:16px; }
.row-name{ display:inline-flex; align-items:center; gap:10px; color:var(--indigo); font-weight:600; text-decoration:none; }
.row-name:hover{ text-decoration:underline; }
.avatar{ display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; background:var(--indigo-soft); color:var(--indigo); font-size:12px; font-weight:700; flex-shrink:0; }
.def-grid{ display:grid; gap:1rem; }
.def-label{ font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:700; margin-bottom:.25rem; }
@media (max-width:760px){ .records-layout{ grid-template-columns:1fr; } }
