@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #0e0f10;
  --ink-2: #3a3b3d;
  --muted: #7c7d80;
  --line: #e8e6df;
  --line-2: #efede6;
  --accent: #0e0f10;
  --accent-2: #e9633a;
  --accent-3: #4b6b52;
  --violet: #5b4b8a;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Geist', -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 13.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ── Shell ── */
.shell { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 248px; background: var(--bg); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 14px; flex-shrink: 0; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 22px; cursor: pointer; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
  font-size: 13px; letter-spacing: -.02em;
}
.brand-name { font-weight: 600; font-size: 15.5px; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; font-family: var(--mono); }
.nav-sec {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); padding: 14px 10px 6px; font-family: var(--mono); font-weight: 500;
}
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; margin-bottom: 1px;
  position: relative; transition: background var(--duration-fast) var(--ease-out);
}
.nav a:hover { background: rgba(0,0,0,.03); color: var(--ink); }
.nav a.active { background: var(--ink); color: #fff; }
.nav a.active .ico { color: #fff; }
.nav a.active .badge { background: rgba(255,255,255,.16); color: #fff; }
.ico { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.nav a:hover .ico { color: var(--ink); }
.badge {
  margin-left: auto; background: #efede6; color: var(--ink-2); border-radius: 20px;
  padding: 1px 8px; font-size: 11px; font-weight: 600; font-family: var(--mono);
}
.side-foot {
  margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.side-foot:hover { background: #fbfaf6; }
.avatar {
  width: 32px; height: 32px; border-radius: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.side-foot .who { font-size: 13px; font-weight: 600; }
.side-foot .role { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ── Main ── */
.main { flex: 1; min-width: 0; background: var(--bg); }

/* ── Topbar ── */
.topbar {
  height: 64px; padding: 0 32px; display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px);
}
.crumbs {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: var(--muted); font-family: var(--mono);
}
.crumbs .cur { color: var(--ink); font-weight: 500; }
.search { margin-left: 16px; flex: 1; max-width: 440px; position: relative; }
.search input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px 0 38px; font-size: 13px; background: var(--surface);
  color: var(--ink); outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.04); }
.search svg { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.kbd {
  position: absolute; right: 10px; top: 9px; font-family: var(--mono); font-size: 10.5px;
  color: var(--muted); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 6px; background: var(--bg);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); position: relative;
  transition: background var(--duration-fast) var(--ease-out);
}
.icon-btn:hover { background: #fbfaf6; }
.dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  background: var(--accent-2); border-radius: 50%; border: 2px solid var(--surface);
}

/* ── Buttons ── */
.btn {
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink);
  display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--duration-fast) var(--ease-out);
}
.btn:hover { background: #fbfaf6; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.03); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

/* ── Page ── */
.page { padding: 32px 32px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 24px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .16em; color: var(--muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(75,107,82,.15);
}
.page-title {
  font-size: 38px; font-weight: 500; letter-spacing: -.028em; line-height: 1.08; color: var(--ink);
}
.page-title em { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; color: var(--ink-2); }
.page-sub { font-size: 14px; color: var(--muted); margin-top: 10px; max-width: 640px; }
.page-head-r { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Metrics ── */
.metrics { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 22px 20px; position: relative; overflow: hidden;
  animation: fadeSlideUp var(--duration-normal) var(--ease-out) both;
}
.metric:nth-child(2) { animation-delay: 50ms; }
.metric:nth-child(3) { animation-delay: 100ms; }
.metric:nth-child(4) { animation-delay: 150ms; }
.metric.hero {
  background: linear-gradient(160deg, #141516 0%, #0e0f10 100%);
  color: #fff; border-color: transparent;
}
.metric.hero::before {
  content: ""; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle at center, rgba(233,99,58,.35), transparent 70%);
  pointer-events: none;
}
.m-lbl {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); display: flex;
  align-items: center; justify-content: space-between;
}
.metric.hero .m-lbl { color: rgba(255,255,255,.55); }
.m-val {
  font-size: 44px; font-weight: 500; letter-spacing: -.03em;
  margin-top: 12px; line-height: 1; font-feature-settings: "tnum";
}
.metric.hero .m-val { font-size: 56px; }
.m-val .unit { font-size: 18px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.metric.hero .m-val .unit { color: rgba(255,255,255,.5); }
.m-foot {
  margin-top: 14px; display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--muted);
}
.metric.hero .m-foot { color: rgba(255,255,255,.55); }
.trend {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px; background: #f0efe8; color: var(--ink);
}
.trend.up { background: rgba(75,107,82,.14); color: var(--accent-3); }
.trend.down { background: rgba(233,99,58,.14); color: var(--accent-2); }
.metric.hero .trend { background: rgba(255,255,255,.12); color: #fff; }
.metric.hero .trend.up { background: rgba(120,180,130,.22); color: #a3d1a8; }

.capacity { margin-top: 16px; }
.cap-track { height: 6px; background: rgba(255,255,255,.12); border-radius: 20px; overflow: hidden; display: flex; }
.cap-track > i { display: block; height: 100%; }
.cap-legend {
  display: flex; gap: 18px; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.6);
}
.cap-legend span::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; margin-right: 6px; vertical-align: 1px;
}
.cap-legend .l1::before { background: #a3d1a8; }
.cap-legend .l2::before { background: rgba(255,255,255,.55); }
.cap-legend .l3::before { background: rgba(255,255,255,.2); }

.spark { margin-top: 14px; height: 34px; display: flex; align-items: end; gap: 3px; }
.spark i { display: block; width: 6px; background: #e0ded5; border-radius: 2px; transition: height var(--duration-normal); }
.spark i.hi { background: var(--accent-3); }

/* ── Split layout ── */
.split { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }

/* ── Queue card ── */
.queue { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.q-head {
  padding: 20px 24px 16px; display: flex; align-items: flex-end;
  justify-content: space-between; border-bottom: 1px solid var(--line-2);
}
.q-title { font-size: 19px; font-weight: 600; letter-spacing: -.015em; }
.q-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-family: var(--mono); }
.seg { display: inline-flex; background: #f2f0e9; border-radius: 10px; padding: 3px; }
.seg > div {
  padding: 6px 14px; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; border-radius: 8px; transition: all var(--duration-fast);
}
.seg > div.on {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.03);
}

/* ── Filters ── */
.filters {
  padding: 14px 24px; display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; border-bottom: 1px solid var(--line-2);
}
.chip {
  height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); font-size: 12.5px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 500;
  transition: all var(--duration-fast) var(--ease-out);
}
.chip:hover { background: #fbfaf6; }
.chip .ct { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on .ct { color: rgba(255,255,255,.7); }
.dot-t { width: 6px; height: 6px; border-radius: 50%; }
.filters-r { margin-left: auto; display: flex; gap: 8px; }
.chip-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ── Queue list ── */
.q-list { display: flex; flex-direction: column; }
.q-item {
  display: grid; grid-template-columns: 44px 1.7fr 1.4fr 1fr 1fr auto;
  gap: 18px; align-items: center; padding: 18px 24px;
  border-bottom: 1px solid var(--line-2);
  transition: background var(--duration-fast); cursor: pointer;
}
.q-item:hover { background: #fbfaf6; }
.q-item:last-child { border-bottom: none; }
.rank { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rank .n { width: 26px; text-align: center; }
.acct { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 40px; height: 40px; border-radius: 11px; display: flex;
  align-items: center; justify-content: center; font-weight: 600;
  font-size: 14px; color: #fff; flex-shrink: 0; letter-spacing: -.01em;
}
.acct-nm { font-weight: 600; color: var(--ink); font-size: 14px; letter-spacing: -.01em; }
.acct-meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.seg-tag {
  font-size: 10.5px; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: .08em; padding: 1px 6px; border-radius: 4px;
  background: #f2f0e9; color: var(--ink-2);
}
.seg-tag.strategic { background: rgba(91,75,138,.12); color: var(--violet); }

.trig-cell .tt {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px;
  font-weight: 500; color: var(--ink); padding: 4px 10px 4px 8px;
  border-radius: 20px; background: #f2f0e9;
}
.trig-cell .tt.lead { background: rgba(14,15,16,.06); color: var(--ink); }
.trig-cell .tt.fund { background: rgba(75,107,82,.10); color: var(--accent-3); }
.trig-cell .tt.tech { background: rgba(91,75,138,.10); color: var(--violet); }
.trig-cell .tt.hire { background: rgba(233,99,58,.10); color: var(--accent-2); }
.trig-cell .tt.prod { background: rgba(178,60,46,.10); color: #b23c2e; }
.trig-cell .tt .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.trig-when { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-family: var(--mono); }

.conf-cell { display: flex; flex-direction: column; gap: 6px; }
.conf-num { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.conf-num .of { color: var(--muted); font-weight: 400; }
.conf-bar { height: 4px; background: #efede6; border-radius: 4px; overflow: hidden; }
.conf-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent-3); }
.conf-cell.med .conf-bar i { background: #c9a557; }
.conf-cell.low .conf-bar i { background: #c1c0b9; }

.stat-cell { display: flex; flex-direction: column; gap: 4px; }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.stat-pill .d { width: 7px; height: 7px; border-radius: 50%; }
.d.g { background: var(--accent-3); }
.d.y { background: #c9a557; }
.d.gr { background: #c1c0b9; }
.d.r { background: #dc2626; }
.d.o { background: var(--accent-2); }
.stat-note { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.act-btn {
  padding: 8px 14px; border-radius: 9px; background: var(--ink); color: #fff;
  font-size: 12.5px; font-weight: 500; border: none; display: inline-flex;
  align-items: center; gap: 6px; transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.act-btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.act-btn.ghost:hover { background: #fbfaf6; }
.act-btn:hover { background: #000; }

/* ── Pagination ── */
.q-foot {
  padding: 16px 24px; display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--muted); font-family: var(--mono);
  background: #fbfaf6; border-top: 1px solid var(--line-2);
}
.pg-btns { display: flex; gap: 4px; }
.pg {
  width: 32px; height: 32px; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--line); font-size: 12.5px; display: inline-flex;
  align-items: center; justify-content: center; color: var(--ink);
  transition: all var(--duration-fast);
}
.pg.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pg:hover:not(.on) { background: #fbfaf6; }

/* ── Rail ── */
.rail { display: flex; flex-direction: column; gap: 16px; }
.rail-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.rc-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.rc-sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: var(--mono); margin-bottom: 16px; }

/* ── Donut ── */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { width: 112px; height: 112px; position: relative; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.donut .center .n { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.donut .center .l { font-size: 10.5px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.legend { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.lg-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.lg-l { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.lg-l .sw { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.lg-r { font-family: var(--mono); color: var(--ink); font-weight: 600; }

/* ── Activity ── */
.act-list { display: flex; flex-direction: column; }
.act { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--line-2); }
.act:last-child { border-bottom: none; }
.act-ico {
  width: 30px; height: 30px; border-radius: 8px; background: #f2f0e9;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink-2);
}
.act-ico.g { background: rgba(75,107,82,.12); color: var(--accent-3); }
.act-ico.o { background: rgba(233,99,58,.12); color: var(--accent-2); }
.act-ico.v { background: rgba(91,75,138,.12); color: var(--violet); }
.act-t { font-size: 13px; color: var(--ink); line-height: 1.45; }
.act-t b { font-weight: 600; }
.act-time { font-size: 11px; color: var(--muted); margin-top: 3px; font-family: var(--mono); }

/* ── Cadence ── */
.cad { display: flex; flex-direction: column; gap: 14px; }
.cad-row { display: flex; align-items: center; justify-content: space-between; }
.cad-l { display: flex; align-items: center; gap: 10px; }
.cad-day {
  width: 34px; height: 34px; border-radius: 9px; background: #f2f0e9;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  flex-direction: column; line-height: 1;
}
.cad-day .d { font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.cad-day.on { background: var(--ink); color: rgba(255,255,255,.6); }
.cad-day.on .d { color: #fff; }
.cad-lbl { font-size: 13px; color: var(--ink); font-weight: 500; }
.cad-sub { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.cad-count { font-family: var(--mono); font-size: 12.5px; color: var(--ink); font-weight: 600; }

/* ── Toast ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--ink); color: #fff; border-radius: 12px;
  font-size: 13px; font-weight: 500; min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  transform: translateX(120%); transition: transform var(--duration-normal) var(--ease-out), opacity var(--duration-normal);
  opacity: 0;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast-success { background: var(--accent-3); }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-icon { font-size: 16px; }

/* ── Modal ── */
#modal-container {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}
#modal-container.open { pointer-events: all; opacity: 1; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative; background: var(--surface); border-radius: 18px;
  width: 90%; box-shadow: 0 24px 64px rgba(0,0,0,.2);
  transform: scale(0.95); transition: transform var(--duration-normal) var(--ease-out);
  max-height: 85vh; overflow-y: auto;
}
#modal-container.open .modal-card { transform: scale(1); }
.modal-header {
  padding: 24px 24px 0; display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); font-size: 18px; display: flex;
  align-items: center; justify-content: center; color: var(--muted); cursor: pointer;
}
.modal-close:hover { background: #fbfaf6; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px 24px; display: flex; gap: 8px; justify-content: flex-end; }

/* ── Dropdown ── */
.dropdown-panel {
  position: fixed; z-index: 999; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px; opacity: 0; transform: translateY(-4px);
  pointer-events: none; transition: all var(--duration-fast) var(--ease-out);
  max-height: 320px; overflow-y: auto;
}
.dropdown-panel.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.dropdown-option {
  padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--duration-fast);
}
.dropdown-option:hover { background: #f2f0e9; }
.dropdown-option.selected { font-weight: 600; }
.dropdown-count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.dropdown-divider { height: 1px; background: var(--line); margin: 4px 8px; }
.dd-trigger { cursor: pointer; }

/* ── Login ── */
.login-screen {
  width: 1440px; margin: 0 auto; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 440px; text-align: center;
}
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 40px; }
.login-brand .brand-mark { width: 40px; height: 40px; font-size: 17px; border-radius: 12px; }
.login-brand .brand-name { font-size: 22px; }
.login-title { font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin-bottom: 8px; }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.user-cards { display: flex; gap: 12px; margin-bottom: 32px; justify-content: center; }
.user-card {
  flex: 1; padding: 20px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); cursor: pointer; text-align: center;
  transition: all var(--duration-fast) var(--ease-out);
}
.user-card:hover { border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.user-card.selected { border-color: var(--ink); background: #fbfaf6; }
.user-card .avatar { margin: 0 auto 10px; }
.user-card .name { font-weight: 600; font-size: 13.5px; }
.user-card .role-label { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.login-form { text-align: left; }
.login-form label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; margin-top: 14px; }
.login-form input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 14px; font-size: 13.5px; background: var(--surface); color: var(--ink); outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.login-form input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.04); }
.login-form .btn { width: 100%; justify-content: center; margin-top: 20px; height: 44px; font-size: 14px; }

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  font-family: var(--mono); border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.data-table th:hover { color: var(--ink); }
.data-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px;
  vertical-align: middle;
}
.data-table tr { transition: background var(--duration-fast); }
.data-table tbody tr:hover { background: #fbfaf6; }
.data-table tbody tr { cursor: pointer; }
.sort-indicator { margin-left: 4px; }

/* ── Status badges ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px;
  border-radius: 20px; font-size: 11.5px; font-weight: 500;
  font-family: var(--mono); white-space: nowrap;
}
.status-badge.green { background: rgba(75,107,82,.12); color: var(--accent-3); }
.status-badge.yellow { background: rgba(201,165,87,.15); color: #96790e; }
.status-badge.red { background: rgba(220,38,38,.10); color: #dc2626; }
.status-badge.orange { background: rgba(233,99,58,.12); color: var(--accent-2); }
.status-badge.gray { background: #f2f0e9; color: var(--muted); }
.status-badge.violet { background: rgba(91,75,138,.12); color: var(--violet); }
.status-badge .dot-s { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

/* ── Form elements ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.form-label .req { color: var(--accent-2); }
.form-input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 13px; background: var(--surface); color: var(--ink); outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.form-input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.04); }
textarea.form-input { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.error-border { border-color: #dc2626 !important; }
.error-text { font-size: 11px; color: #dc2626; margin-top: 4px; }

/* ── Toggle switch ── */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--line); border-radius: 22px;
  cursor: pointer; transition: background var(--duration-fast);
}
.toggle-slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform var(--duration-fast);
}
.toggle input:checked + .toggle-slider { background: var(--accent-3); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Detail page ── */
.detail-split { display: grid; grid-template-columns: 1fr 400px; gap: 24px; }
.detail-split.wide { grid-template-columns: 1fr 1fr; }
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; letter-spacing: -.01em; }
.detail-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.detail-item-label { color: var(--muted); }
.detail-item-value { font-weight: 500; text-align: right; max-width: 60%; }

/* ── Quick nav cards ── */
.quick-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.quick-nav-card {
  padding: 20px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.quick-nav-card:hover { border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.06); transform: translateY(-2px); }
.quick-nav-card .qn-icon { width: 36px; height: 36px; border-radius: 10px; background: #f2f0e9; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.quick-nav-card .qn-title { font-weight: 600; font-size: 14px; }
.quick-nav-card .qn-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Role badge ── */
.role-badge { font-size: 11px; font-family: var(--mono); padding: 2px 8px; border-radius: 4px; }
.role-badge.dm { background: rgba(14,15,16,.06); color: var(--ink); }
.role-badge.inf { background: rgba(91,75,138,.10); color: var(--violet); }
.role-badge.user-role { background: rgba(75,107,82,.10); color: var(--accent-3); }
.role-badge.champ { background: rgba(233,99,58,.10); color: var(--accent-2); }
.role-badge.blocker { background: rgba(220,38,38,.10); color: #dc2626; }
.role-badge.eb { background: rgba(201,165,87,.15); color: #96790e; }

/* ── Warning banner ── */
.warning-banner {
  padding: 14px 18px; background: rgba(233,99,58,.08); border: 1px solid rgba(233,99,58,.2);
  border-radius: 12px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--accent-2); margin-bottom: 20px;
}
.warning-banner a { text-decoration: underline; font-weight: 600; }

/* ── Checklist ── */
.checklist-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-2); font-size: 13.5px;
}
.check-icon { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.check-icon.pass { background: rgba(75,107,82,.12); color: var(--accent-3); }
.check-icon.fail { background: rgba(220,38,38,.10); color: #dc2626; }
.check-icon.pending { background: #f2f0e9; color: var(--muted); }

/* ── Response cards ── */
.response-card {
  padding: 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); cursor: pointer; margin-bottom: 10px;
  transition: all var(--duration-fast) var(--ease-out);
}
.response-card:hover { border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.06); }

/* ── Integration cards ── */
.int-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.int-card {
  padding: 22px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); transition: all var(--duration-fast);
}
.int-card.error { border-color: rgba(220,38,38,.3); }
.int-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); }

/* ── Template cards ── */
.template-card {
  padding: 20px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); margin-bottom: 12px;
  transition: all var(--duration-fast);
}
.template-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.template-card.inactive { opacity: 0.6; }

/* ── Code block ── */
.code-block {
  background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: 10px;
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  overflow-x: auto; white-space: pre-wrap;
}

/* ── Message preview ── */
.message-preview {
  padding: 20px; border: 1px solid var(--line); border-radius: 12px;
  background: #fbfaf6; font-size: 13.5px; line-height: 1.6;
  white-space: pre-wrap;
}

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state-icon { margin-bottom: 16px; }
.empty-state-icon .ico { width: 40px; height: 40px; color: var(--line); }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.empty-state-msg { font-size: 13px; margin-bottom: 20px; }

/* ── Skeleton ── */
.skeleton { background: linear-gradient(90deg, #f2f0e9 25%, #e8e6df 50%, #f2f0e9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.med { width: 80%; }
.skeleton-block { height: 120px; margin-bottom: 16px; }

/* ── Metrics compact (3-col for non-hero) ── */
.metrics-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.metrics-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }

/* ── Conversation thread ── */
.thread-msg { padding: 16px; border-radius: 12px; margin-bottom: 12px; }
.thread-msg.sent { background: rgba(14,15,16,.03); border: 1px solid var(--line); }
.thread-msg.received { background: rgba(75,107,82,.06); border: 1px solid rgba(75,107,82,.15); }
.thread-meta { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-bottom: 8px; }
.thread-body { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }

/* ── Outcome cards ── */
.outcome-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.outcome-card {
  padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: all var(--duration-fast);
  display: flex; align-items: center; gap: 10px;
}
.outcome-card:hover { border-color: var(--ink); }
.outcome-card.selected { border-color: var(--ink); background: rgba(14,15,16,.03); }
.outcome-card .oc-icon { font-size: 18px; }
.outcome-card .oc-label { font-weight: 500; font-size: 13px; }
.outcome-card .oc-desc { font-size: 11px; color: var(--muted); }

/* ── Test results ── */
.test-result {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border-bottom: 1px solid var(--line-2);
}
.test-status { font-size: 18px; width: 32px; text-align: center; }
.test-name { font-weight: 500; flex: 1; }
.test-duration { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ── Guardrail pills ── */
.guardrail-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; background: #f2f0e9; border-radius: 20px;
  font-size: 12px; margin: 2px 4px 2px 0;
}
.guardrail-pill .remove-guardrail { cursor: pointer; color: var(--muted); font-size: 14px; }
.guardrail-pill .remove-guardrail:hover { color: var(--ink); }

/* ── Animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-in { animation: fadeSlideUp var(--duration-normal) var(--ease-out) both; }
.stagger-in > * { animation: fadeSlideUp var(--duration-normal) var(--ease-out) both; }
.stagger-in > *:nth-child(1) { animation-delay: 0ms; }
.stagger-in > *:nth-child(2) { animation-delay: 50ms; }
.stagger-in > *:nth-child(3) { animation-delay: 100ms; }
.stagger-in > *:nth-child(4) { animation-delay: 150ms; }
.stagger-in > *:nth-child(5) { animation-delay: 200ms; }
.stagger-in > *:nth-child(6) { animation-delay: 250ms; }
.stagger-in > *:nth-child(7) { animation-delay: 300ms; }
.stagger-in > *:nth-child(8) { animation-delay: 350ms; }

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--line);
  border-top-color: var(--ink); border-radius: 50%;
  animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
