/* ─── RESET ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── FONT FACES ────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'PPMori';
  src: url('/fonts/PPMori-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PPMori';
  src: url('/fonts/PPMori-RegularItalic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'PPMori';
  src: url('/fonts/PPMori-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PPMori';
  src: url('/fonts/PPMori-SemiBoldItalic.otf') format('opentype');
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

/* ─── DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg-page: #F9F6F0;
  --bg-surface: #FFFFFF;

  /* Text */
  --text-primary: #1D212F;
  --text-secondary: #343434;
  --text-muted: #6B6F7B;

  /* Semantic — sacred color system */
  --enrollment: #55CF90;
  --enrollment-bg: #F0F9F1;
  --enrollment-light: #86E7B3;

  --callout: #C4483D;
  --callout-bg: #FFF0ED;

  --editable: #FFD073;
  --editable-bg: #FFF7E7;
  --editable-strong: #D69938;

  --volume: #82D0FF;
  --volume-bg: #ECF8FF;
  --volume-strong: #439FE1;

  --weekend: #E8E5DF;

  --header: #1D212F;

  /* Typography */
  --font: 'PPMori', system-ui, sans-serif;

  /* Spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --sp-10: 60px;
  --sp-11: 80px;
  --sp-12: 120px;

  /* Shadows (Navy-based) */
  --shadow-sm: 0 2px 12px rgba(29, 33, 47, 0.07);
  --shadow-md: 0 8px 32px rgba(29, 33, 47, 0.10);
  --shadow-lg: 0 16px 48px rgba(29, 33, 47, 0.14);

  /* Radius — never 4px or 6px */
  --radius-pill: 100px;
  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

/* ─── BASE ──────────────────────────────────────────────────────────────── */
html { height: 100%; }

body {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── TYPOGRAPHY ────────────────────────────────────────────────────────── */
.text-display {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.1;
}

.text-heading {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.text-subhead {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.text-body {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.text-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.4;
}

.text-caption {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.text-watch {
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

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

.text-secondary {
  color: var(--text-secondary);
}

.text-enrollment {
  color: var(--enrollment);
}

.text-callout {
  color: var(--callout);
}

.text-volume {
  color: var(--volume-strong);
}

/* ─── LAYOUT ────────────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.section {
  padding: var(--sp-9) 0;
  scroll-margin-top: 104px;
}

.section + .section {
  border-top: 1px solid var(--weekend);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}
.section-subtitle {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 0 var(--sp-5);
  line-height: 1.4;
}
.section-subtitle .at-risk-dot {
  vertical-align: middle;
}

/* Section rhythm: generous → generous → standard → compressed → compressed */
#kpis        { padding: var(--sp-10) 0; }
#enrollment  { padding: var(--sp-7) 0; }
#projections { padding: var(--sp-7) 0; }

/* ─── KPI SUMMARY ───────────────────────────────────────────────────────── */
.kpi-layout {
  display: flex;
  gap: var(--sp-9);
  align-items: flex-start;
}

.kpi-anchor {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kpi-arc-wrap {
  position: relative;
  width: 240px;
  height: 130px;
  margin-bottom: var(--sp-4);
}

.kpi-arc-wrap svg {
  width: 100%;
  height: 100%;
}

.kpi-arc-track {
  fill: none;
  stroke: var(--weekend);
  stroke-width: 14;
  stroke-linecap: round;
}

.kpi-arc-value {
  fill: none;
  stroke: var(--enrollment);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-arc-value.behind {
  stroke: var(--callout);
}

.kpi-arc-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
}

.kpi-arc-numbers {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-primary);
}

.kpi-arc-numbers .kpi-arc-slash {
  color: var(--text-muted);
  font-weight: 400;
  margin: 0 2px;
}

.kpi-arc-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.kpi-pace {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: var(--sp-2);
}

.kpi-pace.behind {
  color: var(--callout);
}

.kpi-metrics {
  flex: 1;
  min-width: 0;
}

.kpi-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-7);
  margin-bottom: var(--sp-7);
}

.kpi-metric-row:last-child {
  margin-bottom: 0;
}

.kpi-metric {
  min-width: 120px;
}

.kpi-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}
.kpi-metric-label[title] {
  cursor: help;
  border-bottom: 1px dotted var(--weekend);
}

.kpi-metric-value {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.kpi-metric-row:first-child .kpi-metric-value {
  font-size: 24px;
  letter-spacing: -0.75px;
  font-variant-numeric: tabular-nums;
}

.kpi-metric-value.concern {
  color: var(--callout);
}

@media (max-width: 1024px) {
  .kpi-layout {
    flex-direction: column;
    align-items: center;
  }
  .kpi-anchor {
    flex: none;
  }
}

/* ─── POWER RANKINGS ────────────────────────────────────────────────────── */
.rankings-section {
  background: var(--bg-surface);
  margin: 0 calc(var(--sp-6) * -1);
  padding: var(--sp-11) var(--sp-6);
  border-top: 1px solid var(--weekend);
  border-bottom: 1px solid var(--weekend);
}

.rankings-section .section-title {
  font-size: 28px;
  letter-spacing: -0.75px;
  margin-bottom: var(--sp-8);
}

/* Rankings table */
.rankings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.rankings-table th {
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
}
.rankings-table th[title] {
  cursor: help;
  white-space: nowrap;
  border-bottom: 2px solid var(--weekend);
}

.rankings-table th:first-child,
.rankings-table td:first-child {
  text-align: center;
  width: 40px;
}

.rankings-table th:nth-child(2),
.rankings-table td:nth-child(2) {
  text-align: left;
}

.rankings-table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  border-bottom: 1px solid #F0EDE8;
}

.rankings-table tbody tr td {
  transition: background 0.15s ease;
}

.rankings-table tbody tr:hover td {
  background: rgba(249, 246, 240, 0.5);
}

/* ── Top-3 rank rows ─────────────────────────────── */
.rank-row td {
  border-bottom: 1px solid #F0EDE8;
}

.rank-row td:first-child {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.rank-row .cell-name {
  font-size: 14px;
}

.rank-1 td {
  background: rgba(214, 153, 56, 0.06);
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
}
.rank-1 td:first-child {
  color: var(--editable-strong);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
}
.rank-1 .cell-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.rank-1:hover td {
  background: rgba(214, 153, 56, 0.1);
}

.rank-2 td {
  background: rgba(214, 153, 56, 0.06);
}
.rank-2 td:first-child {
  color: #908D86;
}
.rank-2:hover td {
  background: rgba(176, 173, 166, 0.12);
}

.rank-3 td {
  background: rgba(196, 149, 106, 0.06);
}
.rank-3 td:first-child {
  color: #B08050;
}
.rank-3:hover td {
  background: rgba(196, 149, 106, 0.12);
}

/* Separator between top 3 and the rest */
.rank-3 + tr:not(.rank-row) td {
  border-top: 3px solid #E8E4DD;
}

.mini-bar {
  display: inline-block;
  height: 8px;
  border-radius: 4px;
  min-width: 2px;
  vertical-align: middle;
}

.rank-row .mini-bar {
  height: 10px;
}
.rank-1 .mini-bar {
  height: 12px;
}

.mini-bar-production  { background: var(--enrollment); }
.mini-bar-efficiency  { background: var(--volume-strong); }
.mini-bar-consistency { background: var(--editable); }
.mini-bar-volume      { background: var(--volume); }
.mini-bar-reliability { background: #B0ADA6; }

.rankings-table .cell-strength,
.rankings-table .cell-watch {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rankings-table .cell-watch {
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
}

.rankings-table .cell-name {
  text-align: left;
  font-weight: 600;
}

/* ─── HEADER ────────────────────────────────────────────────────────────── */
.pet-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  box-shadow: 0 1px 3px rgba(29, 33, 47, 0.08);
}

.pet-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--enrollment);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.header-logo {
  height: 24px;
  width: auto;
  display: block;
}

.header-month {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.header-month-arrows {
  display: inline-flex;
  gap: 2px;
}

.header-month-arrows button {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-xs);
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.header-month-arrows button:hover {
  color: var(--text-primary);
  background: rgba(29, 33, 47, 0.04);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.header-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.header-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
}

.header-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--text-muted);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.header-link:hover::after {
  transform: scaleX(1);
}

/* ─── SECTION NAV ───────────────────────────────────────────────────────── */
.section-nav {
  position: sticky;
  top: 56px;
  z-index: 90;
  background: var(--bg-page);
  padding: var(--sp-3) var(--sp-6);
  display: flex;
  gap: var(--sp-2);
  border-bottom: 1px solid var(--weekend);
}

.section-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.section-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.section-nav a.is-active {
  background: var(--text-primary);
  color: var(--bg-surface);
  transform: translateY(-1px);
}

/* ─── BADGES ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-3);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  line-height: 1.4;
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-enrollment {
  background: var(--enrollment-bg);
  color: #2D8B57;
}
.badge-enrollment::before { background: var(--enrollment); }

.badge-callout {
  background: var(--callout-bg);
  color: var(--callout);
}
.badge-callout::before { background: var(--callout); }

.badge-editable {
  background: var(--editable-bg);
  color: var(--editable-strong);
}
.badge-editable::before { background: var(--editable); }

.badge-volume {
  background: var(--volume-bg);
  color: var(--volume-strong);
}
.badge-volume::before { background: var(--volume); }

.badge-neutral {
  background: #F0EDE8;
  color: var(--text-muted);
}
.badge-neutral::before { background: #B0ADA6; }

/* ─── TABLES ────────────────────────────────────────────────────────────── */
.pet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pet-table th {
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
}
.pet-table th[title] {
  cursor: help;
  border-bottom: 1px dotted var(--weekend);
  white-space: nowrap;
  border-bottom: 2px solid var(--weekend);
}

.pet-table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: center;
  border-bottom: 1px solid #F0EDE8;
}

.pet-table tbody tr:nth-child(even) {
  background: rgba(249, 246, 240, 0.4);
}

.pet-table tbody tr {
  transition: background 0.15s ease;
}

.pet-table tbody tr:hover {
  background: var(--enrollment-bg);
}

.pet-table td.name-col {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
}

.pet-table td.col-group-start,
.pet-table th.col-group-start {
  border-left: 4px solid var(--bg-page);
}

.pet-table th[data-sortable] {
  cursor: pointer;
  user-select: none;
}

.pet-table th[data-sortable]:hover {
  color: var(--enrollment);
}

.pet-table th.sort-active {
  border-bottom-color: var(--enrollment);
  background: var(--enrollment-bg);
}

.pet-table th.sort-asc::after {
  content: ' \2191';
  font-size: 12px;
}

.pet-table th.sort-desc::after {
  content: ' \2193';
  font-size: 12px;
}

.pet-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 3;
}

.pet-table tr.totals td {
  font-weight: 600;
  border-top: 2px solid var(--enrollment);
  background: var(--bg-surface);
  position: sticky;
  bottom: 0;
  z-index: 1;
}

/* ─── EDITABLE CELLS ────────────────────────────────────────────────────── */
td.editable {
  background: var(--editable-bg);
  cursor: text;
  position: relative;
}

td.editable {
  cursor: default;
}

.edit-pencil {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  background: var(--editable-bg);
  border: 1px solid var(--editable-strong);
  border-radius: 3px;
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.edit-pencil:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

td.editable:hover .edit-pencil {
  display: flex;
}

td.editable input,
td.editable select {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  font-family: var(--font);
  text-align: inherit;
  color: inherit;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* ── Schedule time picker ──────────────────────── */
.schedule-picker {
  position: fixed;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--bg-surface);
  border: 1px solid #E0DDD8;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(29, 33, 47, 0.10), 0 1px 3px rgba(29, 33, 47, 0.06);
  white-space: nowrap;
}
.schedule-picker::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--bg-surface);
  border: 1px solid #E0DDD8;
}
.schedule-picker.sp-below::before {
  top: -6px;
  border-right: none;
  border-bottom: none;
  rotate: 45deg;
}
.schedule-picker.sp-above::before {
  bottom: -6px;
  border-top: none;
  border-left: none;
  rotate: 45deg;
}
.sp-cols {
  display: flex;
}

.sp-col {
  display: flex;
  flex-direction: column;
  min-width: 76px;
}
.sp-col + .sp-col {
  border-left: 1px solid #E0DDD8;
}
.sp-col-tz {
  min-width: 56px;
  align-self: start;
}

.sp-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  text-align: center;
  border-bottom: 1px solid #E0DDD8;
}

.sp-opt {
  display: block;
  width: 100%;
  padding: 5px 12px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-align: center;
  cursor: pointer;
  transition: background 0.1s ease;
}

.sp-opt:hover {
  background: var(--editable-bg);
}

.sp-opt.sp-active {
  background: var(--enrollment-bg);
  color: #2D8B57;
  font-weight: 600;
}

.sp-apply {
  display: block;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 7px 0;
  border: none;
  border-radius: 4px;
  background: var(--enrollment);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.sp-apply:hover {
  background: #2D8B57;
}

.sp-input-body {
  padding: 10px 12px 0;
}
.sp-input-body .sp-label {
  padding: 0 0 6px;
  text-align: left;
}
.sp-number {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #E0DDD8;
  border-radius: 4px;
  background: var(--bg-surface);
  font-family: var(--font);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-align: center;
  box-sizing: border-box;
}
.sp-number:focus {
  outline: none;
  border-color: var(--enrollment);
}

td.editable.saving,
td.status-editable.saving {
  opacity: 0.4;
  pointer-events: none;
}

td.editable.saved,
td.status-editable.saved {
  animation: flash-green 1.2s ease;
}

td.editable.error,
td.status-editable.error {
  animation: flash-red 2s ease;
}

td.status-editable {
  cursor: pointer;
}

td.status-editable:hover {
  outline: 1px solid var(--text-muted);
  outline-offset: -1px;
  opacity: 0.85;
}

/* ─── DAY CELLS ─────────────────────────────────────────────────────────── */
td.cell-enr {
  background: var(--enrollment-bg);
  color: #2D8B57;
  font-weight: 600;
}

td.cell-enr.cell-enr-2 {
  background: rgba(85, 207, 144, 0.18);
}

td.cell-enr.cell-enr-3 {
  background: rgba(85, 207, 144, 0.30);
}

td.cell-vol {
  background: var(--volume-bg);
}

td.cell-blank {
  background: var(--bg-surface);
}

td.cell-wknd {
  background: var(--weekend);
  color: var(--text-muted);
  font-size: 11px;
}

td.cell-future {
  background: #FAF8F4;
  color: #C5C2BB;
}

td.cell-callout {
  background: var(--callout-bg);
  color: var(--callout);
  font-weight: 600;
}

td.cell-pto {
  background: var(--weekend);
  color: var(--text-muted);
  font-size: 11px;
}

th.cell-today {
  border-bottom: 2px solid var(--enrollment);
}

/* ─── PCT BADGES ────────────────────────────────────────────────────────── */
.pct-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.pct-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pct-good {
  background: var(--enrollment-bg);
  color: #2D8B57;
}
.pct-good::before { background: var(--enrollment); }

.pct-ok {
  background: var(--volume-bg);
  color: var(--volume-strong);
}
.pct-ok::before { background: var(--volume); }

.pct-bad {
  background: var(--callout-bg);
  color: var(--callout);
}
.pct-bad::before { background: var(--callout); }

/* ─── POWER RANKINGS STATUS BADGES ──────────────────────────────────────── */
.pr-dominant   { background: var(--enrollment-bg); color: #2D8B57; }
.pr-dominant::before   { background: var(--enrollment); }
.pr-star       { background: var(--enrollment-bg); color: #2D8B57; }
.pr-star::before       { background: var(--enrollment); }
.pr-crushing   { background: var(--enrollment-bg); color: #2D8B57; }
.pr-crushing::before   { background: var(--enrollment); }
.pr-respectable { background: var(--volume-bg); color: var(--volume-strong); }
.pr-respectable::before { background: var(--volume); }
.pr-grinding   { background: var(--editable-bg); color: var(--editable-strong); }
.pr-grinding::before   { background: var(--editable); }
.pr-developing { background: var(--callout-bg); color: #E7704C; }
.pr-developing::before { background: #E7704C; }
.pr-needs-push { background: var(--callout-bg); color: var(--callout); }
.pr-needs-push::before { background: var(--callout); }

/* ─── PROJECTIONS ──────────────────────────────────────────────────────── */
#proj-table th.th-editable {
  background: var(--editable-bg);
}

#proj-table td.pace-ahead,
#proj-table td.pace-behind {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  font-size: 12px;
}

.pace-ahead {
  color: #2D8B57;
}

.pace-behind {
  color: var(--callout);
}

.met-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--enrollment-bg);
  color: #2D8B57;
}

/* ─── AT-RISK DOT ───────────────────────────────────────────────────────── */
.at-risk-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--callout);
  margin-right: var(--sp-2);
  vertical-align: middle;
}

/* ─── TABS ──────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: var(--sp-7);
  border-bottom: 2px solid var(--weekend);
  margin-bottom: var(--sp-6);
}

.tab-bar button {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--sp-2) 0 var(--sp-3);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.tab-bar button:hover {
  color: var(--text-primary);
}

.tab-bar button.is-active {
  color: var(--text-primary);
}

.tab-bar button.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text-primary);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* ─── DISCLOSURE TOGGLE ────────────────────────────────────────────────── */
/* ─── GRID LEGEND ──────────────────────────────────────────────────────── */
.grid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
  font-size: 11px;
  color: var(--text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.08);
}
.swatch-enr { background: var(--enrollment-bg); }
.swatch-callout { background: var(--callout-bg); }
.swatch-pto { background: var(--weekend); }
.swatch-future { background: #FAF8F4; }
.swatch-today { border-bottom: 2px solid var(--enrollment); background: var(--bg-surface); }

.disclosure-toggle {
  background: none;
  border: 1px solid var(--weekend);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  cursor: pointer;
  margin-bottom: var(--sp-3);
  transition: border-color 0.15s, color 0.15s;
}

.disclosure-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* ─── GRID TABLE ───────────────────────────────────────────────────────── */
.grid-table {
  font-size: 12px;
}

.grid-table th {
  min-width: 28px;
  font-size: 11px;
  white-space: nowrap;
}

.grid-table td {
  min-width: 28px;
  text-align: center;
  padding: var(--sp-1) var(--sp-1);
  white-space: nowrap;
}

.grid-table td.bold {
  font-weight: 600;
}

/* ─── OVERFLOW WRAPPER ──────────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── ANIMATIONS ────────────────────────────────────────────────────────── */
@keyframes flash-green {
  0%, 100% { background: inherit; }
  20% { background: var(--enrollment-bg); }
}

@keyframes flash-red {
  0%, 100% { background: inherit; }
  20% { background: var(--callout-bg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.page-wrap > .section.fade-up:nth-child(2) { animation-delay: 80ms; }
.page-wrap > .section.fade-up:nth-child(3) { animation-delay: 160ms; }
.page-wrap > .section.fade-up:nth-child(4) { animation-delay: 240ms; }
.page-wrap > .section.fade-up:nth-child(5) { animation-delay: 320ms; }

@media (prefers-reduced-motion: reduce) {
  .fade-up { animation: none; opacity: 1; }
  td.editable.saved, td.status-editable.saved,
  td.editable.error, td.status-editable.error { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ─── FOCUS ─────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--volume);
  outline-offset: 2px;
}

/* ─── STALE WARNING ────────────────────────────────────────────────────── */
.stale-warning {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--editable-bg);
  color: var(--editable-strong);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  line-height: 1.4;
}

.stale-warning::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--editable);
  flex-shrink: 0;
}

/* ─── PILL DROPDOWN (manager filter) ────────────────────────────────────── */
.pill-select {
  appearance: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--weekend);
  border-radius: var(--radius-pill);
  padding: var(--sp-2) var(--sp-7) var(--sp-2) var(--sp-4);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%231D212F' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.pill-select:hover {
  background-color: rgba(29, 33, 47, 0.03);
}

.pill-select:focus {
  outline: none;
  box-shadow: var(--shadow-md);
  border-color: var(--text-muted);
}

/* ─── DATA FRESHNESS WARNING ────────────────────────────────────────────── */
.stale-warning {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--editable-bg);
  color: var(--editable-strong);
  font-size: 11px;
  font-weight: 600;
}

.stale-warning[hidden] {
  display: none;
}
