/* ===================================================================
   TribeCity — design system
   Inspired by Cloudflare / Linear: neutral surfaces, single accent,
   tight type, lots of whitespace.
   =================================================================== */

:root {
  --bg:        #f7f7f8;
  --surface:   #ffffff;
  --surface-2: #fafafb;
  --border:    #e6e6e9;
  --border-2:  #ececef;
  --text:      #16161a;
  --text-2:    #525258;
  --text-3:    #8a8a92;
  --accent:    #ff5b1f;     /* TribeCity orange */
  --accent-soft: #fff3ec;
  --success:   #1aa971;
  --success-soft: #e7f6ef;
  --danger:    #d9384a;
  --danger-soft: #fdecee;
  --warning:   #d97706;
  --info:      #2563eb;
  --purple:    #7c3aed;
  --shadow-1: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --radius:    10px;
  --radius-sm: 6px;
  --sidebar-w: 230px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text-2); }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0;
  padding: 16px 12px;
  display: flex; flex-direction: column;
}
.brand {
  font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
  padding: 8px 10px 18px;
  display: flex; align-items: center; gap: 8px;
}
.brand .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); display: inline-block; }
.brand .brand-sub { color: var(--text-3); font-weight: 500; }
.nav-section { margin-top: 10px; }
.nav-section h6 {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 0 10px; margin: 12px 0 4px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  color: var(--text-2); font-weight: 500;
  font-size: 13.5px;
}
.nav a .ico {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--text-3);
}
.nav a:hover .ico { color: var(--text); }
.nav a.active .ico { color: var(--accent); }
/* Candidate header stats strip */
.cand-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px;
  margin: 8px 0 24px; overflow: hidden;
}
.cand-stats .stat {
  background: var(--surface); padding: 12px 14px;
}
.cand-stats .stat .lbl {
  font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; margin-bottom: 4px;
}
.cand-stats .stat .val {
  font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.cand-stats .stat .val.muted { color: var(--text-3); font-weight: 500; }
.cand-stats .stat.accent .val { color: var(--accent); }
.cand-stats .stat.success .val { color: var(--success); }
/* Row-as-link — qrow with data-href becomes clickable to a detail page.
   Inner <a> / button / .actions stop propagation so they fire their own actions. */
.qrow.qrow-link { cursor: pointer; transition: background .12s; }
.qrow.qrow-link:hover { background: var(--surface-2); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; justify-content: center; }
.pagination a, .pagination span {
  padding: 6px 11px; border-radius: 6px; font-size: 13px;
  color: var(--text-2); text-decoration: none; border: 1px solid var(--border);
}
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .current { background: var(--text); color: #fff; border-color: var(--text); font-weight: 600; }
.pagination .ellipsis { border: none; color: var(--text-3); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
/* Count badges: muted by default — only the primary work queue gets accent. */
.nav a .badge-n {
  margin-left: auto; background: var(--surface-2); color: var(--text-2);
  font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 600;
}
.nav a .badge-n.badge-accent { background: var(--accent); color: #fff; }
.sidebar-footer {
  margin-top: auto; padding: 12px 10px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.sb-user { display: flex; align-items: center; gap: 8px; }
.sb-user-meta { min-width: 0; flex: 1; }
.sb-user-name { font-weight: 600; color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-role { font-size: 11px; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-signout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: transparent; border: 1px solid transparent;
  color: var(--text-3); cursor: pointer;
}
.sb-signout:hover { background: var(--surface-2); color: var(--text); }

.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  padding: 60px 36px 60px;
}
/* Back button on inner pages — sits above the page title */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; margin-bottom: 18px;
}
.back-link:hover { background: var(--surface-2); color: var(--text); }
.back-link svg { flex-shrink: 0; }

/* ---- Mobile menu (hamburger + off-canvas sidebar) ---- */
.menu-toggle { display: none; }
.sidebar-scrim { display: none; }
@media (max-width: 820px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; left: 12px; z-index: 140;
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; box-shadow: var(--shadow-1);
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 150; box-shadow: 2px 0 20px rgba(0,0,0,.14);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.42); opacity: 0; pointer-events: none;
    transition: opacity .22s ease; z-index: 145;
  }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; padding: 66px 16px 48px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
.topbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
.crumbs { color: var(--text-3); font-size: 13px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { margin: 0 6px; color: var(--border); }

/* ---- Type ---- */
h1.page-title {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.025em; margin: 0 0 4px;
}
.page-sub { color: var(--text-3); font-size: 13.5px; margin: 0 0 22px; }
h2.section-title {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 28px 0 10px;
}

/* ---- Card ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 12px;
}
.card-head h3 {
  margin: 0; font-size: 14px; font-weight: 600;
  letter-spacing: -0.005em;
}
.card-head .meta { color: var(--text-3); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-tight .card-body { padding: 0; }

/* ---- Collapsible cards (details/summary) ---- */
details.card-collapse > summary.card-head {
  cursor: pointer; user-select: none; list-style: none;
  border-bottom: none;
}
details.card-collapse > summary.card-head::-webkit-details-marker { display: none; }
details.card-collapse[open] > summary.card-head { border-bottom: 1px solid var(--border-2); }
details.card-collapse > summary.card-head:hover h3 { color: var(--text); }
details.card-collapse .chev {
  margin-left: auto; color: var(--text-3); font-size: 18px; font-weight: 600;
  transform: rotate(0deg); transition: transform .15s ease; line-height: 1;
}
details.card-collapse[open] .chev { transform: rotate(90deg); }
details.card-collapse > summary.card-head .right { margin-left: 0; }

/* ---- KPI tiles ---- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.kpi .label { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; margin-top: 6px; }
.kpi .sub   { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.kpi.accent .value { color: var(--accent); }
.kpi.success .value { color: var(--success); }
.kpi.danger .value { color: var(--danger); }
.kpi.purple .value { color: var(--purple); }

/* Clickable KPI tiles (buttons / anchors styled as KPIs) */
.kpi-clickable {
  font: inherit; text-align: left; cursor: pointer; text-decoration: none;
  display: block; width: 100%; color: inherit;
  transition: background .12s ease;
}
button.kpi-clickable { -webkit-appearance: none; appearance: none; }
.kpi-clickable:hover { background: var(--surface-2); }
.kpi-clickable:focus-visible { outline: 2px solid var(--text-3); outline-offset: 2px; }

/* ---- Slide-over panel (slides in from the right; for drill-in lists) ---- */
.slideover {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw); background: var(--surface);
  border-left: 1px solid var(--border); z-index: 150;
  transform: translateX(100%); transition: transform .24s ease;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 28px rgba(0,0,0,.16);
}
.slideover.open { transform: translateX(0); }
.slideover-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.slideover-head h3 { margin: 0; }
.slideover-body { padding: 0; overflow: auto; flex: 1; }
.slideover-scrim {
  position: fixed; inset: 0; background: rgba(15,18,24,.42);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 149;
}
.slideover-scrim.open { opacity: 1; pointer-events: auto; }

/* Pending-outreach rows inside the slide-over */
.po-list { display: flex; flex-direction: column; }
.po-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  color: inherit; text-decoration: none;
}
.po-row:hover { background: var(--surface-2); color: inherit; }
.po-main { min-width: 0; }
.po-co { font-weight: 600; color: var(--text); font-size: 14px; }
.po-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-engage { text-align: right; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.po-engage span { margin-left: 6px; }

/* ---- Lazy-load skeletons ---- */
.lazy-loading { opacity: .85; }
.skel-row {
  display: grid; gap: 14px; padding: 15px 16px;
  border-bottom: 1px solid var(--border); align-items: center;
  grid-template-columns: minmax(0,2fr) 1.2fr 1fr 90px;
}
.skel-bar {
  height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, #ececef 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: skel 1.4s ease infinite;
}
.skel-bar.short { width: 55%; }
.skel-bar.tiny  { width: 35%; height: 9px; margin-top: 5px; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.lazy-error { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.lazy-error .btn { margin-left: 8px; }

/* ---- Centered modal (class names kept as .drawer for back-compat) ---- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,18,24,.45);
  opacity: 0; pointer-events: none; transition: opacity .16s ease; z-index: 90;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(.97);
  width: min(740px, 96vw); max-height: 92vh;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; z-index: 100;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.drawer.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
}
.drawer-body { padding: 18px 20px 20px; overflow: auto; flex: 1; min-height: 0; }
/* Form that fills a modal: fields scroll in .drawer-body, buttons stay pinned
   in .drawer-foot so long forms never push the actions off-screen. */
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-foot {
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface); border-radius: 0 0 14px 14px; flex-shrink: 0;
}
.drawer-row {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; background: var(--surface);
}
.drawer-row:hover { background: var(--surface-2); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  background: var(--surface); color: var(--text);
  border-color: var(--border); cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--surface-2); }
/* Button hierarchy — exactly three tiers plus two semantic colors:
   PRIMARY   .btn-primary / .btn-accent  → solid dark, the ONE main action per view
   SECONDARY .btn (default)              → outlined neutral
   TERTIARY  .btn-ghost                  → borderless text
   Semantic: .btn-success (positive: Invite/Send) · .btn-danger (destructive) */
.btn-primary, .btn-accent { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover, .btn-accent:hover { background: #000; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #168459; color: #fff; }
.btn-danger  { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover  { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Pills / Badges ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 500;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .85; }
.pill.pending  { background: #fff7ed; color: #c2410c; }
.pill.review   { background: #fff7ed; color: #c2410c; }
.pill.approved { background: var(--success-soft); color: #0e7a52; }
.pill.rejected { background: var(--danger-soft); color: #a02633; }
.pill.danger   { background: var(--danger-soft); color: #a02633; }
.pill.contacted{ background: #f3eaff; color: #6b21a8; }
.pill.filled   { background: var(--success-soft); color: #0e7a52; }
.pill.unfilled { background: #f1f1f4; color: var(--text-2); }
.pill.in_progress { background: #e0eaff; color: #1d4ed8; }
.pill.paused   { background: #fff8db; color: #93660b; }
.pill.muted    { background: #f1f1f4; color: var(--text-2); }
.pill.muted::before { display: none; }

/* ---- Table ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 11px 18px; text-align: left; border-bottom: 1px solid var(--border-2); }
.tbl thead th {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td a.row-link { color: var(--text); font-weight: 500; }
.tbl td a.row-link:hover { color: var(--text); }
.tbl tr.row-clickable { cursor: pointer; }

/* ---- Forms ---- */
/* Inputs, selects, and buttons that sit side-by-side share the same heights:
   38px regular, 32px for the -sm variants. textarea is exempt (multiline). */
.input, select, textarea,
input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="url"], input[type="number"], input[type="tel"] {
  width: 100%; padding: 8px 11px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; color: var(--text);
  font-family: inherit; line-height: 1.4;
}
.input, select,
input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="url"], input[type="number"], input[type="tel"] {
  height: 38px; padding-top: 0; padding-bottom: 0;
}
textarea { min-height: 80px; }
.input:focus, select:focus, textarea:focus,
input[type="text"]:focus, input[type="email"]:focus, input[type="search"]:focus,
input[type="password"]:focus, input[type="url"]:focus, input[type="number"]:focus, input[type="tel"]:focus {
  outline: none; border-color: var(--text-2);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
.input-sm, select.input-sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.priority-input { width: 60px; height: 32px; padding: 0 6px; text-align: right; }
label.field { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; font-weight: 500; }

/* Vertical form row used on /settings + the role/filled modals */
.form-row { margin-bottom: 14px; }
.form-row > label { display: block; font-size: 12.5px; color: var(--text-2, var(--text-3)); margin-bottom: 6px; font-weight: 600; }
.form-row > label .small { font-weight: 400; color: var(--text-3); }
.form-row > .small { margin-top: 6px; color: var(--text-3); font-size: 12px; line-height: 1.45; }
.form-row > input[type="checkbox"] { width: auto; margin-right: 6px; vertical-align: middle; }
.form-row > textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

/* Tab strip — used on /settings */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0; }
.tabs .tab {
  padding: 10px 16px; font-size: 13.5px; font-weight: 500;
  color: var(--text-3); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.tab-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- Progress bar ---- */
.bar { height: 6px; background: var(--border-2); border-radius: 99px; overflow: hidden; }
.bar > .fill { height: 100%; background: linear-gradient(90deg, var(--success), #4ade80); border-radius: 99px; transition: width .25s; }
.bar.accent > .fill { background: linear-gradient(90deg, var(--accent), #ffa073); }

/* ---- Sparkline (inline icon) ---- */
.spark { display: inline-flex; align-items: end; gap: 2px; height: 16px; }
.spark span { width: 3px; background: var(--text-3); border-radius: 1px; }

/* ---- Tribe grid (compact) ---- */
.tribe-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tribe-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: block; color: inherit;
  transition: border-color .12s, transform .12s;
}
.tribe-tile:hover { background: var(--surface-2); color: inherit; }
.tribe-tile h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; }
.tribe-tile h4 .pct { margin-left: auto; color: var(--text-3); font-size: 12px; font-weight: 500; }
.tribe-tile .stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.tribe-tile .stats strong { color: var(--text); font-weight: 600; }

/* ---- Candidate row (action queue) ---- */
.qrow {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 1fr 1fr 90px 80px auto;
  gap: 16px; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
}
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: var(--surface-2); }
.qrow .co { display: flex; flex-direction: column; min-width: 0; }
.qrow .co .co-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .co .co-meta { color: var(--text-3); font-size: 12px; }
.qrow .role { color: var(--text-2); font-size: 13px; min-width: 0; }
.qrow .role .role-tribe { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.qrow .person { font-size: 12.5px; }
.qrow .person .pn { color: var(--text); font-weight: 500; }
.qrow .person .pt { color: var(--text-3); font-size: 11.5px; }
.qrow .rating { font-size: 13px; color: var(--text-2); }
.qrow .score { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.qrow .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- Candidate detail people grid ---- */
.people-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.person-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; background: var(--surface);
}
.person-card .pn { font-weight: 600; }
.person-card .pt { color: var(--text-3); font-size: 12px; }
.person-card .links { margin-top: 8px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.person-card .links a { color: var(--info); }
.person-card .meta { margin-top: 8px; font-size: 11.5px; color: var(--text-3); }

/* Legacy .scrim modal kept only for any older modal callers — slide-out drawers
   (.drawer + #drawer-backdrop) are the canonical pattern now. */
.scrim {
  position: fixed; inset: 0; background: rgba(15,15,20,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 50;
}
.scrim.open { display: flex; }
.drawer .row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---- Decision feed ---- */
.feed { display: flex; flex-direction: column; }
.feed-item {
  padding: 12px 18px; border-bottom: 1px solid var(--border-2);
  display: flex; gap: 10px; align-items: center;
}
.feed-item .pill { align-self: center; flex-shrink: 0; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .what { flex: 1; min-width: 0; }
.feed-item .what .head { display: flex; gap: 8px; align-items: center; }
.feed-item .what .head .co-name { font-weight: 600; }
.feed-item .what .head .role { color: var(--text-3); font-size: 12px; }
.feed-item .what .reason { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.feed-item .when { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }

/* ---- Lesson card ---- */
.lesson-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .lesson-grid { grid-template-columns: 1fr; } }
.lesson-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.lesson-card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.lesson-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-list .item { font-size: 13px; color: var(--text-2); border-left: 3px solid var(--border); padding-left: 10px; }
.lesson-list .item.approved { border-color: var(--success); }
.lesson-list .item.rejected { border-color: var(--danger); }
.lesson-list .item .head { font-weight: 600; color: var(--text); font-size: 13px; }

/* ---- Empty states ---- */
.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 38px 24px;
  text-align: center; color: var(--text-3);
  background: var(--surface);
}
.empty .e-title { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 6px; }

/* ---- Coverage indicator ---- */
.cov {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
}
.cov .dots { display: inline-flex; gap: 2px; }
.cov .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--border); }
.cov .dot.ok { background: var(--success); }
.cov .dot.missing { background: #f1f1f4; }
.cov .dot.failed { background: var(--danger); }
.cov .dot.deferred { background: #d4d4d8; outline: 1px dashed #9ca3af; outline-offset: -1px; }
.cov.lg .dot { width: 11px; height: 11px; border-radius: 3px; }
.cov .pct { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cov.high .pct { color: var(--success); }
.cov.mid .pct { color: var(--warning); }
.cov.low .pct { color: var(--danger); }

.cov-bar { display: flex; gap: 2px; height: 6px; }
.cov-bar > div { flex: 1; background: var(--border-2); border-radius: 1px; }
.cov-bar > div.ok { background: var(--success); }
.cov-bar > div.failed { background: var(--danger); }
.cov-bar > div.deferred { background: #d4d4d8; }

.source-row {
  display: grid; grid-template-columns: 16px 1fr auto auto;
  gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border-2); align-items: center;
}
.source-row:last-child { border-bottom: 0; }
.source-row .src-status {
  width: 10px; height: 10px; border-radius: 3px;
}
.source-row .src-status.ok { background: var(--success); }
.source-row .src-status.missing { background: var(--border); }
.source-row .src-status.failed { background: var(--danger); }
.source-row .src-status.not_found { background: var(--warning); }
.source-row .src-status.not_available, .source-row .src-status.deferred { background: #d4d4d8; outline: 1px dashed #9ca3af; outline-offset: -1px; }
.source-row .src-label { font-weight: 500; font-size: 13px; }
.source-row .src-tier {
  font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; background: var(--surface-2); color: var(--text-3);
}
.source-row .src-tier.S { background: #fff3ec; color: var(--accent); }
.source-row .src-tier.A { background: #eff5ff; color: var(--info); }
.source-row .src-tier.B { background: #f5ecff; color: var(--purple); }

/* ---- Utility ---- */
.row { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.center { align-items: center; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.flex1 { flex: 1; min-width: 0; }
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
.hide { display: none; }

/* --- Chunk 3: role_mode multi UI ---------------------------------- */
.badge-multi { background: #4f46e5; color: #fff; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.stat-strip { background: #f3f4f6; padding: 14px 18px; border-radius: 8px; margin-bottom: 18px; font-size: 15px; }
.stat-strip strong { color: #4f46e5; font-size: 18px; }
.people-list { list-style: none; padding: 0; margin: 24px 0; }
.person-card { padding: 14px; border-bottom: 1px solid #e5e7eb; }
.person-head strong { color: #111; font-size: 15px; }
.person-contact { margin-top: 4px; font-size: 14px; color: #4b5563; }
.badge-warning { background: #fef3c7; color: #92400e; padding: 1px 8px; border-radius: 10px; font-size: 11px; margin-left: 6px; }
