:root {
  --bg: #0b0d12;
  --bg-elev: #12151d;
  --card: #151925;
  --card-hover: #1a1f2e;
  --border: #232838;
  --border-soft: #1c2130;
  --text: #f2f4f8;
  --text-muted: #8b93a7;
  --text-dim: #5f6982;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 72px;
}

/* header */
.masthead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 0 22px;
}
.masthead h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.masthead .subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin: 0;
}
.masthead .mast-left { display: flex; flex-direction: column; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; margin: 0 0 16px; }
.brand-mark { width: 28px; height: 28px; display: block; flex-shrink: 0; filter: drop-shadow(0 1px 5px rgba(124, 58, 237, 0.5)); }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.brand-name .brand-accent { color: var(--accent); }
.brand:hover .brand-name { filter: brightness(1.12); }
.team-filter { display: flex; align-items: center; gap: 9px; margin: 2px 0 20px; }
.team-filter label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.team-filter select {
  background: var(--card, #171922); color: var(--text); border: 1px solid var(--border, #2a2d3a);
  border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 13.5px; cursor: pointer; min-width: 160px;
}
.team-filter select:hover { border-color: var(--accent); }
.team-filter-empty { color: var(--text-muted); font-size: 14px; padding: 8px 2px; }
.masthead .actions { flex-shrink: 0; display: inline-flex; align-items: center; gap: 10px; }
.masthead .who { display: inline-flex; align-items: center; gap: 8px; }
.who-handle { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.who-handle::before { content: "@"; opacity: 0.6; }
.auth-form { margin: 0; display: inline; }
.btn-ghost { background: transparent; }
.denied-box {
  max-width: 560px; margin: 12vh auto 0; text-align: center;
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 40px 36px;
}
.denied-box h1 { font-size: 22px; margin: 0 0 14px; }
.denied-box p { color: var(--text-muted); line-height: 1.5; margin: 0 0 12px; }
.denied-box .btn { margin-top: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); color: var(--text); }

/* tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 34px;
}
.tabs a {
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}
.tabs a:hover { color: var(--text); }
.tabs a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* hero KPI row */
.hero {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 40px;
}
.hero .cell {
  background: var(--card);
  padding: 22px 22px 20px;
}
.hero .num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero .lbl {
  margin-top: 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero .cell-note {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* section header */
.section-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 4px 0 16px;
}
.section-note {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 8px;
}
.block { margin-bottom: 44px; }

/* card grid - one card per row, full width */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.grid.wide { grid-template-columns: 1fr; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  transition: border-color .15s;
}
.card:hover { border-color: var(--border); }
.card .card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.card .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.card .unit { font-size: 11px; color: var(--text-dim); }
.card .card-def {
  font-size: 11.5px;
  color: var(--text-dim);
  margin: 3px 0 12px;
  line-height: 1.35;
}
.card .headline {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 6px 0 2px;
}
.card .headline .h-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 5px;
}
.card .headline.hero-pair {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}
.card .hero-pair .hp-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  margin-bottom: 1px;
}
.card .hero-pair .hp-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.card .hero-pair .hp-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 3px;
}
.card .hero-pair .c-primary { color: #a78bfa; }
.card .hero-pair .c-secondary { color: #8fbcff; }
.card .hero-pair .c-warn { color: #e5566d; }
.card .hero-pair .c-good { color: #2dd4a7; }
.card .hero-pair .c-amber { color: #f5a524; }
.card .hero-routes { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.card .hero-route {
  flex: 1 1 260px;
  min-width: 260px;
  padding: 13px 16px 14px;
  border: 1px solid var(--border-soft);
  border-left-width: 3px;
  border-left-color: transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}
.card .hero-route.hr-reviewed { border-left-color: #6ea8fe; }
.card .hero-route.hr-noreview { border-left-color: #e5566d; }
.card .hero-route .hr-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}
.card .hero-route.hr-reviewed .hr-label { color: #6ea8fe; }
.card .hero-route.hr-noreview .hr-label { color: #e5566d; }
.card .hero-route .hr-nums { display: flex; gap: 28px; align-items: flex-start; }
.card .hero-routes .hp-num {
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.card .hero-routes .hp-num.hp-tail { font-size: 22px; font-weight: 600; color: var(--text-dim); }
.card .hero-routes .hp-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-left: 3px;
}
.card .hero-routes .hp-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
}
.card .hero-routes-note { margin-top: 10px; text-align: left; }
.card .headline .c-warn { color: #e5566d; }
.card .headline .c-good { color: #2dd4a7; }
.card .headline-note {
  font-size: 11px;
  color: var(--text-dim);
  margin: 0 0 8px;
  cursor: help;
}
.card .why {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 4px 0 14px;
  line-height: 1.5;
  max-width: 720px;
}
.card .chart-wrap { position: relative; height: 240px; }

/* composition bar */
.composition { margin: 6px 0 12px; }
.composition .comp-cap {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.composition .comp-cov {
  font-size: 11.5px;
  color: var(--text-soft, #cdd3de);
  margin: -3px 0 8px;
}
.composition .route {
  border: 1px solid var(--border-soft);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 11px 13px 12px;
  margin: 10px 0 0;
  background: rgba(255, 255, 255, 0.015);
}
.composition .route:first-of-type { margin-top: 8px; }
.composition .route.route-reviewed { border-left-color: #6ea8fe; }
.composition .route.route-noreview { border-left-color: #e5566d; }
.composition .route-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.composition .route-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-soft, #cdd3de);
  letter-spacing: 0.01em;
}
.composition .route-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.composition .bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border-soft);
}
.composition .bar span { display: block; height: 100%; }
.composition .bar span + span { box-shadow: inset 1px 0 0 rgba(9, 11, 16, 0.6); }
.composition .seg-coding { background: var(--accent); }
.composition .seg-review { background: #6366f1; opacity: 0.72; }
.composition .seg-merge { background: #a78bfa; opacity: 0.5; }
.composition .seg-prep { background: var(--accent); }
.composition .seg-wait { background: #f5a524; opacity: 0.85; }
.composition .seg-after { background: #6ea8fe; opacity: 0.85; }
.composition .seg-open { background: #e5566d; opacity: 0.7; }
.composition .legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 9px;
  font-size: 11px;
  color: var(--text-muted);
}
.composition .legend .k { display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.composition .legend .k.zero { opacity: 0.68; }
.composition .legend .dot {
  width: 8px; height: 8px; border-radius: 2px; display: inline-block;
}
.composition .legend .dot.seg-coding { background: var(--accent); }
.composition .legend .dot.seg-review { background: #6366f1; opacity: 0.72; }
.composition .legend .dot.seg-merge { background: #a78bfa; opacity: 0.5; }
.composition .legend .dot.seg-prep { background: var(--accent); }
.composition .legend .dot.seg-wait { background: #f5a524; opacity: 0.85; }
.composition .legend .dot.seg-after { background: #6ea8fe; opacity: 0.85; }
.composition .legend .dot.seg-open { background: #e5566d; opacity: 0.7; }

/* pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}
.pill.partial { background: var(--amber-soft); color: var(--amber); }
.pill.pending { background: var(--amber-soft); color: var(--amber); }
.pill.range { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* pending card */
.card.pending-card { border-style: dashed; border-color: var(--border); }
.card.pending-card .headline { color: var(--text-dim); font-size: 18px; }

/* people list */
.people-list { display: flex; flex-direction: column; gap: 2px; }
.people-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.people-list a:hover { border-color: var(--accent); background: var(--card-hover); }
.people-list .login { color: var(--text-dim); font-size: 12px; }

/* notice */
.notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}
.notice strong { color: var(--text); }

/* methodology prose */
.prose { max-width: 760px; }
.prose h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 34px 0 12px;
}
.prose p { color: var(--text-muted); font-size: 14px; line-height: 1.65; margin: 0 0 12px; }
.prose p.lead { color: var(--text); font-weight: 600; font-size: 14.5px; margin: 0 0 10px; }
.prose ul { color: var(--text-muted); font-size: 14px; line-height: 1.65; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose code {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12.5px;
  color: var(--text);
}

.foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim);
  font-size: 11.5px;
}

@media (max-width: 880px) {
  .hero { grid-template-columns: repeat(2, 1fr); }
  .grid, .grid.wide { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; color: #111; }
  .tabs, .actions, .foot, .chart-wrap { display: none; }
  .card, .hero .cell, .notice { border-color: #ddd; }
}

/* ============ Leadership overview (private, manager/admin) ============ */
.wide-shell { max-width: 1360px; }
.lead-note {
  color: var(--text-muted); font-size: 13px; line-height: 1.65;
  background: var(--card); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 6px 0 22px;
}
.lead-filters {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  margin: 6px 0 4px;
}
.lf-field { display: flex; flex-direction: column; gap: 5px; }
.lf-label {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.lead-filters select {
  background: var(--card); color: var(--text); font-size: 13px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 7px 30px 7px 11px; min-width: 190px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%237a879a' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.lead-filters select:hover { border-color: var(--accent); }
.lf-go {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.admin-form {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px;
}
.admin-form input, .admin-form select {
  background: var(--bg); color: var(--text); font-size: 13px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 7px 10px;
}
.admin-form input[type="text"] { min-width: 190px; }
.admin-form button {
  background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.admin-inline { display: inline-flex; gap: 4px; align-items: center; }
.admin-inline input[type="text"] {
  background: var(--bg); color: var(--text); font-size: 12px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 4px 7px; min-width: 130px;
}
.admin-inline button {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 3px 7px; font-size: 11px; cursor: pointer;
}
.admin-inline button:hover { color: var(--text); border-color: var(--accent); }
.team-pill {
  display: inline-flex; align-items: center; gap: 5px; margin: 2px 5px 2px 0;
  background: rgba(120,130,255,0.08); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 12px;
}
.team-pill button { padding: 0 4px; line-height: 1; }

/* admin sub-nav under the main tabs */
.subtabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin: -8px 0 22px;
  padding: 4px; background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); width: fit-content;
}
.subtabs a {
  font-size: 12.5px; color: var(--text-muted); text-decoration: none;
  padding: 5px 12px; border-radius: var(--radius-sm);
}
.subtabs a:hover { color: var(--text); background: rgba(120,130,255,0.08); }
.subtabs a.active { color: #fff; background: var(--accent); }

/* admin validation banner (poka-yoke: a refused map or bad date shows here) */
.admin-error {
  background: rgba(220,90,90,0.10); border: 1px solid rgba(220,90,90,0.45);
  color: #e88; border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 18px; font-size: 13px;
}
.toggle-on { color: var(--good, #4ca) !important; border-color: rgba(80,200,160,0.5) !important; }
.toggle-off { color: var(--text-muted) !important; }

.muted { color: var(--text-muted); }
.lead-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.s-card {
  flex: 1 1 140px; background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.s-num { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.s-lab { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.panel {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 22px;
}
.panel h2 { font-size: 16px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.panel-why { color: var(--text-muted); font-size: 12.5px; line-height: 1.6; margin: 0 0 16px; max-width: 900px; }

.callouts { display: grid; gap: 10px; }
.callout {
  display: flex; align-items: baseline; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-left: 3px solid var(--text-dim); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13px; line-height: 1.55;
}
.callout .c-tag {
  flex-shrink: 0; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-dim); font-weight: 600; min-width: 108px;
}
.callout.tone-good { border-left-color: #2dd4a7; }
.callout.tone-watch { border-left-color: var(--amber); }
.callout.tone-bad { border-left-color: #e5566d; }
.callout.tone-neutral { border-left-color: var(--text-dim); }

.quadrant-wrap { height: 460px; position: relative; }

.roster-wrap, .matrix-wrap { overflow-x: auto; }
table.roster { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.roster th, table.roster td {
  padding: 8px 10px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid var(--border-soft);
}
table.roster th {
  color: var(--text-muted); font-weight: 600; font-size: 11px;
  position: sticky; top: 0; background: var(--card); user-select: none;
}
table.roster th.sorted { color: var(--accent); }
table.roster th.txt, table.roster td.txt { text-align: left; }
table.roster td.name { font-weight: 600; }
table.roster tbody tr:hover { background: var(--card-hover); }
td.cell-watch { color: var(--amber); font-weight: 600; }
td.cell-bad { color: #e5566d; font-weight: 600; }

.flags { display: flex; gap: 5px; flex-wrap: wrap; }
.flag {
  font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap;
}
.flag-review-backbone { color: #2dd4a7; border-color: rgba(45,212,167,0.4); }
.flag-ships-no-review { color: var(--amber); border-color: rgba(245,165,36,0.4); }
.flag-unreviewed { color: #e5566d; border-color: rgba(229,86,109,0.4); }
.flag-approve-only { color: var(--amber); border-color: rgba(245,165,36,0.4); }
.flag-quiet { color: var(--text-dim); }

.flag-key { margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.flag-key h3 { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 10px; font-weight: 600; }
.flag-key dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; }
.flag-key dt { white-space: nowrap; }
.flag-key dd { margin: 0; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; align-self: center; }

table.matrix { border-collapse: collapse; font-size: 12.5px; }
table.matrix th, table.matrix td {
  border: 1px solid var(--border-soft); padding: 7px 10px; text-align: center; min-width: 46px;
}
table.matrix th.corner, table.matrix td.row-h { text-align: left; color: var(--text-muted); font-weight: 600; white-space: nowrap; min-width: 170px; }
table.matrix th.corner { vertical-align: bottom; padding-bottom: 8px; }
table.matrix td.row-h { position: sticky; left: 0; background: var(--card); z-index: 1; }
table.matrix th.col-h { height: 104px; vertical-align: bottom; padding: 0; border: none; }
table.matrix th.col-h span {
  display: inline-block; transform: translateX(14px) rotate(-45deg);
  transform-origin: left bottom; white-space: nowrap;
  color: var(--text-muted); font-weight: 500; font-size: 12px; line-height: 1;
}
table.matrix td.mcell { color: var(--text); }
table.matrix td.diag { background: repeating-linear-gradient(45deg, transparent, transparent 3px, var(--border-soft) 3px, var(--border-soft) 4px); }
table.matrix th.tot-h, table.matrix td.tot { color: var(--text-muted); font-weight: 600; }
