:root {
  --green: #2dbe64;
  --green-dim: rgba(45, 190, 100, .14);
  --berry: #d7144b;
  --berry-dim: rgba(215, 20, 75, .1);
  --graphite: #333333;
  --orange: #fa5f0a;
  --orange-dim: rgba(250, 95, 10, .12);
  --blue: #54b3ff;
  --blue-dim: rgba(84, 179, 255, .14);
  --bg: #f3f6f3;
  --surface: #ffffff;
  --surface2: #eef3ee;
  --border: #dce6dc;
  --text: #333333;
  --dim: #6b756e;
  --dim2: #93a098;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(45, 80, 50, .05), 0 1px 3px rgba(45, 80, 50, .06);
  --wait: #c45a00;
  --overdue: #d7144b;
  --trial: #1f7ad4;
  --fixed: #2dbe64;
  --left: #6b756e;
  --page: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.45;
  min-height: 100vh;
}
.mono { font-family: ui-monospace, "Cascadia Code", "Liberation Mono", Menlo, monospace; }

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar-row {
  display: flex; align-items: center; gap: 20px;
  min-height: 64px; padding-top: 8px; padding-bottom: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: 0 0 auto; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
}
.brand h1 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.brand-sub { font-size: 11px; color: var(--dim); margin-top: 1px; }

.desk-nav {
  display: flex; flex-wrap: wrap; gap: 4px 2px; flex: 1; align-items: center;
}
.desk-nav a {
  color: var(--dim); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 6px 10px; border-radius: 8px;
}
.desk-nav a:hover { background: var(--surface2); color: var(--text); }
.desk-nav a.on { color: #176b38; background: var(--green-dim); }

.who {
  display: flex; align-items: center; gap: 10px; flex: 0 0 auto;
  font-size: 13px; margin-left: auto;
}
.who-name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.who-more { display: none; color: var(--dim); font-weight: 600; }
.role-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.role-dot.admin { background: var(--graphite); }
.role-dot.leader { background: #7b4cc4; }
.role-dot.curator { background: var(--trial); }
.role-dot.recruiter { background: var(--green); }
.badge {
  display: inline-block; background: var(--berry); color: #fff;
  border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 4px;
}

.content { padding-top: 28px; padding-bottom: 48px; }

.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; background:
    radial-gradient(1200px 400px at 50% -10%, var(--green-dim), transparent 60%),
    var(--bg);
}
.auth-box { width: 100%; max-width: 400px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-mark {
  width: 48px; height: 48px; border-radius: 14px; background: var(--green);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}

h1.page { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 8px; }
h2 { font-size: 16px; font-weight: 800; margin: 28px 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--dim); }
.lead { font-size: 15px; color: var(--dim); margin-bottom: 20px; max-width: 40rem; }
.eyebrow {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim2); font-weight: 700; margin: 0 0 6px;
}
.section-title { margin: 8px 0 12px; }
.detail-name { font-size: 28px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 12px; }

.flash {
  padding: 12px 14px; border-radius: 12px; margin: 0 0 16px;
  border: 1px solid var(--border); font-size: 14px; font-weight: 600;
}
.flash.ok { background: var(--green-dim); border-color: #b7e6c5; color: #176b38; }
.flash.bad { background: var(--berry-dim); border-color: #f0b3c4; color: var(--berry); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin: 0 0 16px;
  box-shadow: var(--shadow-sm);
}
.form-card, .narrow { max-width: 520px; }
.empty-block {
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 32px 16px; text-align: center; color: var(--dim);
  background: var(--surface); margin-bottom: 16px;
}
.empty-block b { color: var(--text); display: block; margin-bottom: 4px; font-size: 16px; }

.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(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat-num { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stat-label { font-size: 13px; color: var(--dim); margin-top: 8px; }
.stat-card.warn .stat-num { color: var(--overdue); }
.stat-card.wait .stat-num { color: var(--wait); }
.stat-card.fixed .stat-num { color: var(--fixed); }

.field { margin: 0 0 14px; }
.field label, label {
  display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; font-weight: 600;
}
input[type=text], input[type=password], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text);
  font-size: 15px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { min-height: 80px; resize: vertical; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr 1fr; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 10px; border: none;
  background: var(--green); color: #14331c;
  font-weight: 800; font-size: 14px; font-family: inherit;
  cursor: pointer; text-decoration: none;
}
.card button, .card .btn, .filters button { width: auto; min-width: 140px; }
.auth-box button { width: 100%; }
button:hover, .btn:hover { filter: brightness(.97); }
button.secondary, .btn.secondary {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}
button.ok { background: var(--green); color: #14331c; }
button.warn { background: var(--orange-dim); color: var(--orange); }
button.bad {
  background: var(--berry-dim); color: var(--berry); border: 1px solid #f3c0ce;
}
button.linkish {
  background: none; border: 0; color: var(--dim); padding: 0;
  font-size: 13px; font-weight: 600; min-width: 0; text-decoration: underline;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.actions form { margin: 0; }
.inline { display: inline; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chip {
  font-size: 13px; padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface); color: var(--dim);
  text-decoration: none; font-weight: 600;
}
.chip.active { background: var(--green); border-color: var(--green); color: #14331c; }
.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px;
}
.filters .field { margin: 0; min-width: 160px; flex: 1; }
.filters button { margin: 0; height: 42px; }
.sublinks { font-size: 14px; color: var(--dim); margin: 0 0 16px; }
.sublinks a { color: var(--graphite); font-weight: 600; }

.mob-only { display: none; }
.desk-only { display: block; }
table.desk-only { display: table; }

.cand-card, .reminder-item {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 13px 12px 16px; margin-bottom: 9px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.cand-card::before, .reminder-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dim2);
}
.cand-card.new::before, .reminder-item.new::before { background: var(--dim); }
.cand-card.scheduled::before, .reminder-item.scheduled::before { background: var(--orange); }
.cand-card.working::before, .reminder-item.working::before { background: var(--blue); }
.cand-card.done::before, .reminder-item.done::before { background: var(--green); }
.cand-card.no_show::before, .reminder-item.no_show::before { background: var(--berry); }
.cand-card.lost::before, .reminder-item.lost::before { background: var(--left); }
.cand-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cand-code { font-size: 11px; color: var(--dim2); font-family: ui-monospace, monospace; }
.cand-name { font-size: 15px; font-weight: 800; margin-top: 2px; }
.cand-meta { font-size: 13px; color: var(--dim); margin-top: 3px; }
.call-link { color: var(--green); font-weight: 700; text-decoration: none; }

.status-pill, .pill {
  display: inline-block; font-size: 11px; font-weight: 800; padding: 4px 8px;
  border-radius: 8px; font-family: ui-monospace, monospace; white-space: nowrap; border: 0;
}
.pill.new, .status-pill.new { background: var(--surface2); color: var(--dim); }
.pill.scheduled, .status-pill.scheduled { background: var(--orange-dim); color: var(--wait); }
.pill.working, .status-pill.working { background: var(--blue-dim); color: var(--trial); }
.pill.done, .status-pill.done { background: var(--green-dim); color: #176b38; }
.pill.no_show, .status-pill.no_show { background: var(--berry-dim); color: var(--berry); }
.pill.lost, .status-pill.lost { background: #ececec; color: var(--left); }

.routeline { display: flex; align-items: center; margin-top: 12px; }
.rl-seg { flex: 1; height: 3px; background: var(--border); border-radius: 2px; }
.rl-seg.filled { background: var(--green); }
.cand-card.scheduled .rl-seg.filled { background: var(--orange); }
.cand-card.working .rl-seg.filled { background: var(--blue); }
.cand-card.no_show .rl-seg.filled, .cand-card.lost .rl-seg.filled { background: var(--berry); }
.rl-node {
  width: 9px; height: 9px; border-radius: 50%; background: var(--border);
  flex: 0 0 auto; border: 2px solid var(--surface);
}
.rl-node.filled { background: var(--green); }
.cand-card.scheduled .rl-node.filled { background: var(--orange); }
.cand-card.working .rl-node.filled { background: var(--blue); }
.cand-card.no_show .rl-node.filled, .cand-card.lost .rl-node.filled { background: var(--berry); }
.rl-node.current { width: 12px; height: 12px; box-shadow: 0 0 0 3px var(--green-dim); }
.rl-labels { display: flex; justify-content: space-between; margin-top: 5px; }
.rl-labels span { font-size: 10px; color: var(--dim2); }

.dl { display: grid; grid-template-columns: 12rem 1fr; gap: 8px 16px; }
.dl dt { color: var(--dim); font-size: 13px; }
.dl dd { margin: 0; font-weight: 600; }
.bigcode {
  font-size: 1.6rem; letter-spacing: .18em; text-align: center;
  background: var(--graphite); color: #fff; padding: 18px; border-radius: 14px;
  font-family: ui-monospace, monospace;
}

table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; font-size: 14px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); background: var(--surface2); font-weight: 700;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f7fbf7; }
tr.best td { background: var(--green-dim); }
td a { color: var(--text); font-weight: 700; text-decoration: none; }
td a:hover { color: #176b38; }

.timeline { list-style: none; padding: 0; margin: 0 0 16px; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--border); }

.more-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 720px; }
.more-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; text-decoration: none; color: inherit; font-weight: 700;
}
.more-item span { color: var(--dim2); font-weight: 400; font-size: 13px; }

.bottomnav { display: none; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start;
}
.detail-grid .card { margin-bottom: 16px; }

@media (max-width: 900px) {
  .desk-nav { display: none; }
  .who .muted, .who .linkish, .who-name { display: none; }
  .who-more { display: inline; }
  .topbar-row { min-height: 56px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .content { padding-top: 16px; padding-bottom: 88px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .filters { display: grid; grid-template-columns: 1fr; }
  .filters .field { min-width: 0; }
  .filters button, .card button, .card .btn { width: 100%; }
  .dl { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .more-list { grid-template-columns: 1fr; }
  .desk-only { display: none !important; }
  .mob-only { display: block; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 100;
  }
  .nav-btn {
    flex: 1; text-align: center; padding: 8px 0; color: var(--dim2);
    text-decoration: none; font-weight: 700; font-size: 11px;
  }
  .nav-btn.on { color: #176b38; }
  h1.page, .detail-name { font-size: 22px; }
}
