/* Self-hosted fonts — no external requests. Variable woff2 (Fraunces 400–600,
   Inter 400–800). Falls back to Georgia / system stack if a file is missing. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/fraunces-latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latinext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --navy: #050b18;
  --navy-2: #0d1728;
  --brand-red: #e02f22;
  --bright-red: #f44336;
  --positive: #1f9d83;
  --caution: #f2b84b;
  --canvas: #f3f5f8;
  --card: #ffffff;
  --ink: #14201f;
  --ink-soft: #33403e;
  --muted: #5f6b69;
  --faint: #8a938f;
  --paper: #f1efe7;
  --paper-2: #ece9df;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --line: #ddd9cd;
  --line-soft: #e7e3d8;
  --teal: #0f6b62;
  --teal-bright: #12857a;
  --teal-dark: #084641;
  --teal-deep: #063733;
  --teal-pale: #d8e8e2;
  --teal-wash: #eef4f1;
  --gold: #c08a2c;
  --gold-bright: #d29b3a;
  --gold-dark: #9a6a1d;
  --gold-pale: #f4e8cf;
  --red: #b0463d;
  --red-pale: #f4ddd9;
  --status-ahead: var(--positive);
  --status-watch: var(--caution);
  --status-behind: var(--red);
  --status-ahead-wash: var(--teal-wash);
  --status-watch-wash: var(--gold-pale);
  --status-behind-wash: var(--red-pale);
  --shadow-sm: 0 1px 2px rgba(16, 40, 37, 0.05);
  --shadow: 0 10px 30px -14px rgba(16, 40, 37, 0.22);
  --shadow-lift: 0 22px 48px -20px rgba(16, 40, 37, 0.32);
  --ring: 0 0 0 3px rgba(15, 107, 98, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 220ms;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% -4%, rgba(192, 138, 44, 0.14), transparent 30rem),
    radial-gradient(circle at 4% 8%, rgba(15, 107, 98, 0.06), transparent 26rem),
    var(--paper);
  background-attachment: fixed;
  font-family: var(--sans);
  font-feature-settings: "cv05" 1, "ss01" 1;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:where(a, button, input, select, summary):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--teal-dark);
  border-radius: 10px;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(1480px, calc(100% - 3rem));
  margin-inline: auto;
}

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  z-index: 20;
  top: 0;
  color: white;
  background:
    linear-gradient(180deg, rgba(8, 70, 65, 0.98), rgba(6, 55, 51, 0.98));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px -20px rgba(6, 40, 37, 0.9);
  backdrop-filter: blur(14px);
}

.masthead__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
  transition: opacity var(--dur) var(--ease);
}

.brand:hover {
  opacity: 0.92;
}

.brand__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  background: linear-gradient(150deg, #fbf1da, var(--gold-pale));
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(192, 138, 44, 0.35), 0 6px 14px -8px rgba(0, 0, 0, 0.5);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.16em;
  font-weight: 700;
}

.brand small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.masthead__status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 500;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(196, 144, 52, 0.18);
  animation: pulse 2s var(--ease) infinite;
}

.status-dot.is-live {
  background: #7fd0ae;
  box-shadow: 0 0 0 4px rgba(127, 208, 174, 0.16);
}

.status-dot.is-error {
  background: #ef948d;
  box-shadow: 0 0 0 4px rgba(239, 148, 141, 0.16);
  animation: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(127, 208, 174, 0.16); }
  50% { box-shadow: 0 0 0 7px rgba(127, 208, 174, 0.04); }
}

/* ---------- App layout ---------- */
.app-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  transition: grid-template-columns var(--dur) var(--ease), gap var(--dur) var(--ease);
}

.app-layout.is-sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 1.4rem;
}

.side-rail {
  position: sticky;
  top: 104px;
  padding: 2.3rem 0 1.5rem;
}

.sidebar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.58rem 0.72rem;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 0.7rem;
  font-weight: 800;
}

.sidebar-toggle__icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  background: var(--teal-pale);
  border-radius: 8px;
}

.sidebar-toggle__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-layout.is-sidebar-collapsed .sidebar-toggle {
  justify-content: center;
  padding-inline: 0.35rem;
}

.app-layout.is-sidebar-collapsed .sidebar-toggle__label,
.app-layout.is-sidebar-collapsed .side-rail__eyebrow,
.app-layout.is-sidebar-collapsed .side-note {
  display: none;
}

.side-rail__eyebrow,
.eyebrow,
.panel__kicker {
  margin: 0 0 0.55rem;
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.side-rail nav {
  display: grid;
  margin-top: 1rem;
  gap: 0.1rem;
}

.side-rail nav a {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 0.55rem;
  align-items: center;
  padding: 0.72rem 0.85rem 0.72rem 0.7rem;
  color: var(--muted);
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.app-layout.is-sidebar-collapsed .side-rail nav a {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0.72rem 0.35rem;
  font-size: 0;
}

.app-layout.is-sidebar-collapsed .side-rail nav a span {
  font-size: 0.68rem;
}

.side-rail nav a::before {
  content: "";
  position: absolute;
  left: -0.7rem;
  top: 50%;
  width: 3px;
  height: 0;
  background: var(--teal);
  border-radius: 999px;
  transform: translateY(-50%);
  transition: height var(--dur) var(--ease);
}

.side-rail nav a span {
  color: var(--faint);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: color var(--dur) var(--ease);
}

.side-rail nav a:hover {
  color: var(--teal-dark);
  background: var(--teal-wash);
  transform: translateX(2px);
}

.side-rail nav a.is-active {
  color: var(--teal-dark);
  background: var(--teal-wash);
  font-weight: 600;
}

.side-rail nav a.is-active::before {
  height: 60%;
}

.side-rail nav a.is-active span,
.side-rail nav a:hover span {
  color: var(--teal);
}

.side-note {
  margin-top: 2rem;
  padding: 1.1rem 1.15rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.side-note span,
.side-note strong,
.side-note small {
  display: block;
}

.side-note span,
.side-note small {
  color: var(--muted);
  font-size: 0.68rem;
}

.side-note strong {
  margin: 0.3rem 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
}

main {
  min-width: 0;
  padding-bottom: 5rem;
}

/* ---------- Page intro ---------- */
.page-intro {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0 1rem;
}

.page-intro h1 {
  max-width: 900px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.2vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

.lede {
  max-width: 62ch;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  text-wrap: pretty;
}

.refresh-stamp {
  min-width: 178px;
  padding: 1.35rem 1.25rem;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(150deg, #f7ecd3, var(--gold-pale));
  border: 1px solid #e6cf9a;
  border-radius: 52% 48% 46% 54% / 47% 52% 48% 53%;
  box-shadow: 0 18px 34px -20px rgba(150, 110, 30, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  text-align: center;
  transform: rotate(2deg);
  transition: transform var(--dur) var(--ease);
}

.refresh-stamp:hover {
  transform: rotate(0deg) scale(1.02);
}

.refresh-stamp span,
.refresh-stamp strong,
.refresh-stamp small {
  display: block;
}

.refresh-stamp span,
.refresh-stamp small {
  color: #7a5c20;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.refresh-stamp strong {
  margin: 0.35rem 0;
  color: #513a13;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Control bar ---------- */
.control-bar {
  position: sticky;
  top: 88px;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3.5rem;
  padding: 0.7rem 0.8rem;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.intake-selector-label,
.target-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.reporting-mode-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.reporting-mode {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 800;
}

.reporting-mode:hover,
.reporting-mode.is-active {
  color: white;
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

#intake-control[hidden],
#intake-command-panel[hidden] {
  display: none;
}

.intake-selector-label select,
.target-form input {
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
}

.advanced-reporting {
  margin-left: auto;
}

.advanced-reporting summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.advanced-reporting[open] {
  width: min(100%, 620px);
}

.dashboard-loading {
  position: fixed;
  z-index: 100;
  top: 92px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  color: white;
  background: rgba(5, 11, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  transform: translateX(-50%);
}

.dashboard-loading[hidden] {
  display: none;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--gold-bright);
  border-radius: 50%;
  animation: dashboard-spin 700ms linear infinite;
}

@keyframes dashboard-spin {
  to { transform: rotate(360deg); }
}

.intake-command-panel {
  margin: -2.2rem 0 3rem;
  padding: clamp(1rem, 2vw, 1.6rem);
  background: linear-gradient(145deg, var(--navy), #102a48);
  border-radius: 20px;
  color: white;
  box-shadow: var(--shadow);
}

.intake-command-heading {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.1rem;
}

.intake-command-heading h2,
.intake-command-heading p {
  margin-top: 0;
}

.intake-command-heading .target-form {
  display: flex;
  align-items: end;
  gap: 0.55rem;
}

.intake-command-actions {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
}

.report-button {
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  color: var(--navy);
  background: var(--gold-bright);
  border: 0;
  border-radius: 9px;
  font-weight: 800;
}

.report-button.is-loading::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 0.45rem;
  border: 2px solid rgba(7, 20, 37, 0.25);
  border-top-color: var(--navy);
  border-radius: 50%;
  vertical-align: -2px;
  animation: dashboard-spin 700ms linear infinite;
}

.executive-decision-grid > :only-child {
  grid-column: 1 / -1;
}

.target-form button {
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 9px;
  background: var(--brand-red);
  color: white;
  font-weight: 800;
}

.intake-command-panel .kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.intake-command-panel .kpi-card {
  color: var(--ink);
}

@media (max-width: 760px) {
  .intake-command-heading,
  .intake-command-heading .target-form {
    align-items: stretch;
    flex-direction: column;
  }
  .intake-command-actions {
    justify-items: stretch;
  }
  .intake-command-panel .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.filter-impact {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 0.85rem;
  align-items: center;
  margin: -2.3rem 0 3rem;
  padding: 0.8rem 1rem;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.82);
  border: 1px dashed rgba(15, 107, 98, 0.26);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.filter-impact strong {
  color: var(--teal-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter-impact p {
  margin: 0;
  font-size: 0.72rem;
}

.filter-impact span {
  color: var(--teal-dark);
  font-weight: 800;
}

.preset-group {
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--paper-2);
  border-radius: 12px;
  overflow-x: auto;
}

.preset,
.date-form button,
.error-banner button {
  padding: 0.6rem 0.9rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 600;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.preset:hover {
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.7);
}

.preset.is-active {
  color: white;
  background: linear-gradient(150deg, var(--teal-bright), var(--teal));
  box-shadow: 0 8px 16px -8px rgba(15, 107, 98, 0.7);
}

.preset:active,
.date-form button:active,
.error-banner button:active {
  transform: translateY(1px);
}

.date-form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.date-form > span {
  color: var(--faint);
}

.date-form label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.date-form input {
  max-width: 140px;
  margin-left: 0.4rem;
  padding: 0.5rem 0.55rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.74rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.date-form input:hover {
  border-color: var(--teal);
}

.date-form button,
.error-banner button {
  color: white;
  background: var(--teal-dark);
  box-shadow: 0 8px 16px -10px rgba(8, 70, 65, 0.8);
}

.date-form button:hover,
.error-banner button:hover {
  background: var(--teal);
}

.error-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-bottom: 2rem;
  padding: 1rem 1.2rem;
  color: #6e2b26;
  background: var(--red-pale);
  border: 1px solid #e0a49d;
  border-left: 4px solid var(--red);
  border-radius: 12px;
}

.error-banner[hidden] {
  display: none;
}

.error-banner strong {
  font-weight: 700;
}

.error-banner span {
  color: #834039;
}

.error-banner button {
  margin-left: auto;
  background: var(--red);
}

.error-banner button:hover {
  background: #973b33;
}

/* ---------- Sections ---------- */
.dashboard-section {
  scroll-margin-top: 150px;
  margin-bottom: 6rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.section-heading h2 {
  margin: 0.1rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
}

.section-heading > p {
  max-width: 400px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

/* ---------- Cards / panels base ---------- */
.kpi-card,
.panel,
.pending-card,
.definitions {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.kpi-card {
  position: relative;
  min-height: 150px;
  padding: 1.2rem 1.2rem 1.25rem;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--kpi-accent, linear-gradient(90deg, var(--teal), var(--teal-bright)));
  opacity: 0.9;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--teal-pale);
}

.kpi-card.is-attention::before {
  background: linear-gradient(90deg, var(--red), #c85b50);
}

.kpi-card.is-pending {
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.012) 0 10px, transparent 10px 20px),
    rgba(255, 253, 248, 0.6);
  border-style: dashed;
  box-shadow: none;
}

.kpi-card.is-pending::before {
  background: var(--line);
  opacity: 0.8;
}

.kpi-card__context { margin-top: 0.4rem; }
.kpi-card__progress {
  margin-top: 0.55rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.07);
  overflow: hidden;
}
.kpi-card__progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--kpi-accent, var(--teal));
}
.kpi-card.status-ahead  { --kpi-accent: linear-gradient(90deg, var(--positive), var(--teal-bright)); }
.kpi-card.status-watch  { --kpi-accent: linear-gradient(90deg, var(--caution), var(--gold-bright)); }
.kpi-card.status-behind { --kpi-accent: linear-gradient(90deg, var(--status-behind), #c85b50); }

.kpi-card__index {
  color: var(--faint);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.kpi-card h3 {
  min-height: 2.2rem;
  margin: 0.6rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.4;
}

.kpi-card__value {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0.15rem 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.kpi-card.is-attention .kpi-card__value {
  color: var(--red);
}

.kpi-card.is-pending .kpi-card__value {
  color: var(--faint);
  font-size: clamp(1.3rem, 1.7vw, 1.55rem);
}

.kpi-card small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

.skeleton {
  position: relative;
  background:
    linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.85) 50%, transparent 70%),
    #e7e4dc;
  background-size: 220% 100%;
  border-color: transparent;
  animation: shimmer 1.5s infinite;
  box-shadow: none;
}

.skeleton::before,
.skeleton::after {
  display: none;
}

@keyframes shimmer {
  to { background-position-x: -220%; }
}

/* ---------- Insight strip ---------- */
.insight-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.1rem 1.3rem;
  color: white;
  background:
    radial-gradient(circle at 100% 0%, rgba(196, 144, 52, 0.22), transparent 55%),
    linear-gradient(135deg, var(--teal-dark), var(--teal-deep));
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.insight-strip__label {
  align-self: start;
  padding: 0.25rem 0.6rem;
  color: var(--teal-deep);
  background: var(--gold-pale);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.insight-strip p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.45;
}

.section-guide {
  margin-bottom: 1.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.section-guide > strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 0.95rem;
}

.section-guide > p {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.section-guide dl {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.section-guide dl > div {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  gap: 0.85rem;
  align-items: baseline;
}

.section-guide dt {
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-guide dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .section-guide dl > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/* ---------- Panels ---------- */
.intake-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(460px, 1.4fr);
  gap: 1rem;
}

.intake-layout > * {
  min-width: 0;
}

.panel {
  padding: 1.4rem;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.panel:hover {
  box-shadow: var(--shadow-lift);
}

.panel__heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.panel__heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.info-dot {
  width: 1.05rem;
  height: 1.05rem;
  display: inline-grid;
  place-items: center;
  margin-left: 0.28rem;
  color: var(--teal-dark);
  background: var(--gold-pale);
  border: 1px solid rgba(192, 138, 44, 0.38);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: 0.12em;
  cursor: help;
}

.panel__kicker {
  margin-bottom: 0.3rem;
  font-size: 0.62rem;
}

.definition-pill {
  padding: 0.32rem 0.6rem;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border: 1px solid rgba(15, 107, 98, 0.12);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Daily registration pulse ---------- */
.daily-registration-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.55fr) minmax(420px, 1.45fr);
  gap: 1rem;
  margin-top: 1rem;
}

.latest-day-registration {
  min-height: 138px;
  display: grid;
  align-content: center;
  gap: 0.2rem;
}

.latest-day-registration > span,
.latest-day-registration > small,
.latest-day-registration > strong {
  display: block;
}

.latest-day-registration > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.latest-day-registration > strong {
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5.4rem);
  font-weight: 500;
  line-height: 0.95;
}

.latest-day-registration > small {
  color: var(--faint);
  font-size: 0.72rem;
}

.daily-counsellor-breakdown {
  display: grid;
  gap: 0.38rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.daily-counsellor-breakdown__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: start;
  font-size: 0.68rem;
}

.daily-counsellor-breakdown__label {
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.daily-counsellor-breakdown__value,
.daily-counsellor-breakdown__total strong {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.daily-counsellor-breakdown__total {
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line-soft);
  font-weight: 800;
}

.daily-calendar__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.daily-calendar__month {
  color: var(--ink);
  text-align: center;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.daily-calendar__nav {
  width: 36px;
  min-height: 34px;
  padding: 0.35rem;
  border: 1px solid rgba(15, 107, 98, 0.18);
  border-radius: 8px;
  background: var(--paper);
  color: var(--teal-dark);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.daily-calendar__nav:hover:not(:disabled) {
  border-color: rgba(15, 107, 98, 0.42);
  background: var(--teal-wash);
}

.daily-calendar__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.daily-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 0.42rem;
}

.daily-calendar__weekday {
  padding: 0.2rem;
  color: var(--faint);
  text-align: center;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
}

.daily-calendar__day {
  position: relative;
  min-height: 68px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 0.12rem;
  padding: 0.42rem 0.3rem;
  color: color-mix(in srgb, var(--ink-soft) 72%, white);
  background: color-mix(in srgb, var(--teal) calc(var(--intensity) * 82%), var(--paper-2));
  border: 1px solid rgba(15, 107, 98, 0.1);
  border-radius: 10px;
  font-weight: 700;
}

.daily-calendar__placeholder,
.daily-calendar__day.is-outside-range {
  min-height: 68px;
  border: 1px dashed rgba(15, 107, 98, 0.08);
  border-radius: 10px;
  background: rgba(15, 107, 98, 0.025);
}

.daily-calendar__day.is-outside-range {
  color: var(--faint);
  opacity: 0.55;
}

.daily-calendar__day.has-registrations {
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.daily-calendar__date {
  align-self: start;
  justify-self: start;
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.82;
}

.daily-calendar__count {
  align-self: center;
  justify-self: center;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
}

.daily-calendar__tooltip {
  position: absolute;
  z-index: 40;
  bottom: calc(100% + 8px);
  left: 50%;
  width: max-content;
  min-width: 210px;
  max-width: min(280px, calc(100vw - 32px));
  display: grid;
  gap: 0.36rem;
  padding: 0.75rem;
  color: white;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(13, 30, 43, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.daily-calendar__tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 6px solid transparent;
  border-top-color: var(--ink);
  transform: translateX(-50%);
}

.daily-calendar__day:hover .daily-calendar__tooltip,
.daily-calendar__day:focus .daily-calendar__tooltip,
.daily-calendar__day:focus-within .daily-calendar__tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.daily-calendar__day:focus {
  z-index: 41;
  outline: 3px solid rgba(210, 144, 45, 0.42);
  outline-offset: 2px;
}

.daily-calendar__day[data-weekday="0"] .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="1"] .daily-calendar__tooltip {
  left: -4px;
  transform: translate(0, 4px);
}

.daily-calendar__day[data-weekday="0"]:hover .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="0"]:focus .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="0"]:focus-within .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="1"]:hover .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="1"]:focus .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="1"]:focus-within .daily-calendar__tooltip {
  transform: translate(0, 0);
}

.daily-calendar__day[data-weekday="0"] .daily-calendar__tooltip::after,
.daily-calendar__day[data-weekday="1"] .daily-calendar__tooltip::after {
  left: 24px;
}

.daily-calendar__day[data-weekday="5"] .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="6"] .daily-calendar__tooltip {
  right: -4px;
  left: auto;
  transform: translate(0, 4px);
}

.daily-calendar__day[data-weekday="5"]:hover .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="5"]:focus .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="5"]:focus-within .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="6"]:hover .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="6"]:focus .daily-calendar__tooltip,
.daily-calendar__day[data-weekday="6"]:focus-within .daily-calendar__tooltip {
  transform: translate(0, 0);
}

.daily-calendar__day[data-weekday="5"] .daily-calendar__tooltip::after,
.daily-calendar__day[data-weekday="6"] .daily-calendar__tooltip::after {
  right: 24px;
  left: auto;
}

.daily-calendar__tooltip-title {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--sans);
  font-size: 0.72rem;
  line-height: 1.35;
}

.daily-calendar__tooltip-label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.daily-calendar__tooltip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: start;
  font-size: 0.66rem;
  line-height: 1.35;
}

.daily-calendar__tooltip-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.daily-calendar__tooltip-value {
  color: var(--gold-pale);
  font-variant-numeric: tabular-nums;
}

.basis-pill {
  display: inline-flex;
  align-items: center;
  margin-right: 0.4rem;
  padding: 0.25rem 0.5rem;
  color: var(--teal-dark);
  background: var(--teal-wash);
  border: 1px solid rgba(15, 107, 98, 0.16);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Intake volume bars ---------- */
.bar-list {
  display: grid;
  gap: 0.95rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(82px, auto);
  grid-template-areas:
    "label cumulative"
    "track cumulative"
    "count cumulative";
  gap: 0.35rem 0.85rem;
  align-items: center;
  font-size: 0.74rem;
}

.bar-row__label {
  grid-area: label;
  color: var(--muted);
  font-weight: 500;
}

.bar-row__label strong,
.bar-row__label small {
  display: block;
}

.bar-row__label strong {
  color: var(--ink-soft);
  font-size: 0.8rem;
  text-align: left;
}

.bar-row__label small {
  margin-top: 0.08rem;
  color: var(--faint);
  font-size: 0.58rem;
  line-height: 1.25;
}

.bar-row__track {
  grid-area: track;
  width: 100%;
  max-width: 360px;
  height: 10px;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bar-row__cumulative {
  grid-area: cumulative;
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 0.1rem;
}

.bar-row__cumulative small {
  color: var(--faint);
  font-size: 0.6rem;
  white-space: nowrap;
}

.bar-row__cumulative strong {
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1;
}

.bar-row__count {
  grid-area: count;
  color: var(--muted);
  font-size: 0.64rem;
}

.bar-row__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  border-radius: inherit;
  transition: width 600ms var(--ease);
}

.bar-row.is-current .bar-row__fill {
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.bar-row.is-current .bar-row__label strong {
  color: var(--gold);
  font-weight: 700;
}

.bar-row__cumulative strong {
  text-align: right;
  font-weight: 700;
}

/* ---------- Pace ---------- */
.pace-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.mini-stat {
  padding: 0.8rem;
  background: var(--teal-wash);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.mini-stat span,
.mini-stat strong {
  display: block;
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 500;
}

.mini-stat strong {
  margin-top: 0.2rem;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
}

.chart-wrap {
  min-height: 250px;
  overflow-x: auto;
}

#pace-chart {
  width: 100%;
  min-width: 580px;
  height: auto;
}

.chart-grid {
  stroke: #e0ded6;
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart-axis-label {
  fill: var(--faint);
  font-size: 10px;
  font-family: var(--sans);
}

.chart-line-current,
.chart-line-previous,
.chart-line-muted {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.5;
}

.chart-line-current {
  stroke: var(--gold);
  filter: drop-shadow(0 4px 6px rgba(192, 138, 44, 0.25));
}

.chart-bar-current {
  fill: var(--gold);
  filter: drop-shadow(0 4px 6px rgba(192, 138, 44, 0.18));
}

.chart-line-previous {
  stroke: var(--teal);
  opacity: 0.85;
}

.chart-line-muted {
  stroke: #bdb6a5;
  stroke-width: 2;
  opacity: 0.68;
}

.chart-label-current {
  fill: var(--gold-dark);
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 800;
}

.data-table tr.is-current-comparison td {
  color: var(--ink);
  background: var(--gold-pale);
  font-weight: 800;
}

.chart-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-swatch {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.reconciliation-panel {
  margin-top: 1rem;
}

/* ---------- Local filter bar ---------- */
.local-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(160px, 0.45fr));
  gap: 0.9rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
  color: white;
  background:
    radial-gradient(circle at 0% 0%, rgba(196, 144, 52, 0.18), transparent 50%),
    linear-gradient(135deg, var(--teal-dark), var(--teal-deep));
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.local-filter-bar__scope,
.local-filter-bar strong {
  display: block;
}

.local-filter-bar__scope {
  color: #a9dcca;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.local-filter-bar strong {
  margin-top: 0.22rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 500;
}

.local-filter-bar label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.local-filter-bar select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 2rem 0.65rem 0.75rem;
  color: var(--ink);
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23084641' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.76rem;
  appearance: none;
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease);
}

.local-filter-bar select:hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

/* ---------- Admissions overview ---------- */
.admissions-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.admission-stat {
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.admission-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.admission-stat span,
.admission-stat small,
.admission-stat strong {
  display: block;
}

.admission-stat span {
  min-height: 2rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.admission-stat strong {
  margin: 0.3rem 0;
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.admission-stat small {
  color: var(--faint);
  font-size: 0.61rem;
  line-height: 1.45;
}

.cohort-note {
  margin-bottom: 0.85rem;
  padding: 0.85rem 1.1rem;
  color: #7a5c20;
  background: var(--gold-pale);
  border: 1px solid #e5cf9d;
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

#admissions-window-comparison {
  margin: 0 0 1rem;
  padding: 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.admissions-layout,
.breakdown-grid {
  display: grid;
  gap: 1rem;
}

.admissions-layout {
  grid-template-columns: minmax(320px, 0.75fr) minmax(460px, 1.25fr);
  margin-bottom: 1rem;
}

.admissions-layout > *,
.breakdown-grid > * {
  min-width: 0;
}

/* ---------- Funnel ---------- */
.funnel {
  display: grid;
  gap: 0.6rem;
}

.funnel-stage {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: var(--radius-sm);
}

.funnel-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--funnel-width);
  background: linear-gradient(90deg, var(--teal-pale), rgba(216, 232, 226, 0.55));
  border-right: 2px solid rgba(15, 107, 98, 0.35);
  transition: width 600ms var(--ease);
}

/* ---------- SleekFlow lead journey ---------- */
.sleekflow-funnel-panel,
.sleekflow-quality-panel,
.sleekflow-origin-panel {
  margin-bottom: 1rem;
}

.sleekflow-origin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.sleekflow-origin-grid--age,
.sleekflow-origin-grid--reasons {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sleekflow-subheading {
  margin: 1.2rem 0 0.65rem;
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
}

.sleekflow-subheading:first-child {
  margin-top: 0.35rem;
}

.sleekflow-subheading--minor {
  margin: 0.9rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sleekflow-section-note {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.sleekflow-funnel {
  display: grid;
  gap: 0.65rem;
}

.sleekflow-funnel__stage {
  position: relative;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: var(--radius-sm);
}

.sleekflow-funnel__stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--stage-width);
  background: linear-gradient(90deg, var(--teal-pale), rgba(216, 232, 226, 0.3));
}

.sleekflow-funnel__stage--2::before {
  background: linear-gradient(90deg, var(--gold-pale), rgba(244, 232, 207, 0.3));
}

.sleekflow-funnel__stage--3::before {
  background: linear-gradient(90deg, #cde8dc, rgba(205, 232, 220, 0.28));
}

.sleekflow-funnel__stage > * {
  position: relative;
  z-index: 1;
}

.sleekflow-funnel__stage strong,
.sleekflow-funnel__stage small {
  display: block;
}

.sleekflow-funnel__stage small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.sleekflow-funnel__stage b {
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 500;
}

.sleekflow-breakdowns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.sleekflow-breakdowns > * {
  min-width: 0;
}

.sleekflow-ranking {
  overflow-x: auto;
}

.sleekflow-ranking__row {
  min-width: 430px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(3, 60px);
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.76rem;
}

.sleekflow-ranking__row > :not(:first-child) {
  text-align: right;
}

.sleekflow-ranking__header {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sleekflow-empty {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
  background: var(--teal-wash);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

#sleekflow-quality {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .sleekflow-breakdowns {
    grid-template-columns: 1fr;
  }

  #sleekflow-quality {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sleekflow-origin-grid,
  .sleekflow-origin-grid--age,
  .sleekflow-origin-grid--reasons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  #sleekflow-quality {
    grid-template-columns: 1fr;
  }

  .sleekflow-origin-grid,
  .sleekflow-origin-grid--age,
  .sleekflow-origin-grid--reasons {
    grid-template-columns: 1fr;
  }
}

.funnel-stage span,
.funnel-stage strong {
  position: relative;
  z-index: 1;
}

.funnel-stage span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
}

.funnel-stage strong {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
}

/* ---------- Trend ---------- */
.cohort-trend {
  display: grid;
  gap: 0.7rem;
}

.trend-row {
  display: grid;
  grid-template-columns: 66px 1fr 50px;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.7rem;
}

.trend-row > span:first-child {
  color: var(--muted);
  font-weight: 500;
}

.trend-row__track {
  height: 26px;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 8px;
}

.trend-row__fill {
  height: 100%;
  display: flex;
  align-items: center;
  min-width: 3px;
  padding-left: 0.5rem;
  color: white;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  border-radius: 8px;
  font-size: 0.58rem;
  font-weight: 500;
  white-space: nowrap;
  transition: width 600ms var(--ease);
}

.trend-row strong {
  text-align: right;
  font-weight: 700;
}

/* ---------- Monthly comparison ---------- */
.monthly-comparison {
  display: grid;
  gap: 0.85rem;
}

.monthly-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.monthly-row__period {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.monthly-row__bars {
  display: grid;
  gap: 0.32rem;
}

.monthly-row__track {
  position: relative;
  min-width: 0;
  height: 24px;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 8px;
}

.monthly-row__revenue-stack {
  height: 100%;
  display: flex;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  transition: width 600ms var(--ease);
}

.monthly-row__segment {
  height: 100%;
  min-width: 0;
}

.monthly-row__segment.is-registration-fee {
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
}

.monthly-row__segment.is-remaining-revenue {
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
}

.monthly-row__purpose-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
}

.monthly-row__purpose-text span:first-child {
  color: var(--teal-dark);
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.data-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.monthly-comparison + .data-table-wrap {
  margin-top: 1.2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.55rem;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table td {
  color: var(--ink-soft);
}

.data-table .is-right {
  text-align: right;
}

.ranking-row.is-finance {
  grid-template-columns: minmax(130px, 1fr) 72px 120px;
}

.total-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.85rem 0.7rem;
  color: var(--teal-dark);
  background: var(--gold-pale);
  border: 1px solid rgba(192, 138, 44, 0.22);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 800;
}

.total-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 600;
}

.frozen-panel {
  margin-top: 1rem;
  border-color: rgba(192, 138, 44, 0.28);
}

.counsellor-profiles {
  display: grid;
  gap: 0.85rem;
}

.counsellor-profile {
  padding: 0.85rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.counsellor-profile summary {
  cursor: pointer;
}

.counsellor-profile summary::marker {
  color: var(--teal);
}

.counsellor-profile__name,
.counsellor-profile summary small {
  display: block;
}

.counsellor-profile__name {
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
}

.counsellor-profile summary small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.profile-metric {
  padding: 0.75rem;
  background: var(--teal-wash);
  border: 1px solid rgba(15, 107, 98, 0.12);
  border-radius: var(--radius-xs);
}

.profile-metric span,
.profile-metric strong,
.profile-metric small {
  display: block;
}

.profile-metric span {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-metric strong {
  margin: 0.2rem 0;
  color: var(--teal-dark);
  font-size: 1.1rem;
}

.profile-metric small {
  color: var(--faint);
  font-size: 0.58rem;
  line-height: 1.35;
}

.profile-breakdowns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.profile-breakdown {
  padding: 0.75rem;
  background: var(--surface-strong);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
}

.profile-breakdown-chart {
  min-width: 0;
}

.profile-breakdown h4 {
  margin: 0 0 0.55rem;
  color: var(--gold-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-breakdown__rows {
  display: grid;
  gap: 0.65rem;
}

.profile-breakdown-bar {
  display: grid;
  grid-template-columns: minmax(6.5rem, 0.9fr) minmax(7rem, 1.6fr) auto;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
}

.profile-breakdown-bar__label {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.profile-breakdown-bar__track {
  position: relative;
  height: 0.72rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--navy) 9%, white);
  border-radius: 999px;
}

.profile-breakdown-bar__enquiries,
.profile-breakdown-bar__paid {
  position: absolute;
  left: 0;
  border-radius: inherit;
}

.profile-breakdown-bar__enquiries {
  top: 0;
  height: 100%;
  background: var(--navy);
}

.profile-breakdown-bar__paid {
  bottom: 0;
  height: 0.28rem;
  background: var(--brand-red);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 32%);
}

.profile-breakdown-bar__value {
  color: var(--ink);
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

.profile-breakdown--intake {
  grid-column: 1 / -1;
  min-width: 0;
}

.intake-paid-bars {
  display: grid;
  gap: 0.65rem;
}

.intake-paid-bar {
  display: grid;
  grid-template-columns: minmax(7rem, 0.9fr) minmax(8rem, 2fr) auto;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
}

.intake-paid-bar__label,
.intake-paid-bar__value {
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}

.intake-paid-bar__label {
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.intake-paid-bar__label strong,
.intake-paid-bar__label small {
  display: block;
}

.intake-paid-bar__label small {
  margin-top: 0.12rem;
  color: var(--faint);
  font-size: 0.56rem;
  font-weight: 600;
  line-height: 1.3;
}

.intake-paid-bar__track {
  height: 0.72rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--brand-red) 10%, white);
  border-radius: 999px;
}

.intake-paid-bar__fill {
  display: block;
  height: 100%;
  background: var(--brand-red);
  border-radius: inherit;
}

.intake-paid-bar__value {
  color: var(--ink);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.intake-paid-total {
  margin-top: 0.8rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: right;
}

.intake-paid-note {
  display: block;
  margin-top: 0.55rem;
  color: var(--faint);
  font-size: 0.58rem;
  line-height: 1.4;
}

/* ---------- Rankings ---------- */
.breakdown-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ranking-list {
  display: grid;
  gap: 0.1rem;
}

.ranking-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 78px 82px;
  gap: 0.7rem;
  align-items: center;
  padding: 0.62rem 0.5rem;
  margin: 0 -0.5rem;
  border-top: 1px solid var(--line-soft);
  border-radius: 8px;
  font-size: 0.71rem;
  transition: background var(--dur) var(--ease);
}

.ranking-row--graphic {
  grid-template-columns: minmax(130px, 0.9fr) minmax(120px, 1.5fr) 92px 96px;
}

.ranking-row__visual {
  height: 18px;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 6px;
}

.ranking-row__bar {
  display: block;
  height: 100%;
  min-width: 3px;
  background: linear-gradient(90deg, #9bc7f2, #4d98e6);
  border-radius: 6px;
}

.ranking-row:hover {
  background: var(--teal-wash);
}

.ranking-row:first-child {
  border-top: 0;
}

.ranking-row__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.ranking-row__volume,
.ranking-row__rate {
  text-align: right;
}

.ranking-row__volume {
  color: var(--muted);
}

.ranking-row__rate {
  padding: 0.24rem 0.4rem;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 7px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ranking-row__rate.is-immature {
  color: var(--muted);
  background: var(--paper-2);
  font-weight: 600;
}

/* ---------- Reconciliation / quality ---------- */
.reconciliation-grid,
.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.reconciliation-item,
.quality-card {
  padding: 1.1rem;
  background: var(--teal-wash);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.reconciliation-item span,
.quality-card span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.reconciliation-item strong,
.quality-card strong {
  display: block;
  margin: 0.3rem 0;
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.reconciliation-item small,
.quality-card small {
  color: var(--faint);
  font-size: 0.62rem;
  line-height: 1.45;
}

/* ---------- Pending sections ---------- */
.pending-section {
  opacity: 0.9;
}

.pending-card {
  position: relative;
  padding: 2.2rem;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(216, 232, 226, 0.55), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.pending-card::after {
  content: "IN PROGRESS";
  position: absolute;
  top: 2rem;
  right: -2.6rem;
  padding: 0.35rem 3rem;
  color: white;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  transform: rotate(36deg);
  box-shadow: 0 8px 16px -8px rgba(15, 107, 98, 0.6);
}

.pending-card > span {
  color: var(--teal);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pending-card h3 {
  margin: 0.55rem 0;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.pending-card p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
}

/* ---------- Definitions ---------- */
.definitions {
  margin-top: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.definitions summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.05rem 1.25rem;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  transition: background var(--dur) var(--ease);
}

.definitions summary::-webkit-details-marker {
  display: none;
}

.definitions summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform var(--dur) var(--ease);
}

.definitions[open] summary::before {
  transform: rotate(45deg);
}

.definitions summary:hover {
  background: var(--teal-wash);
}

.definitions__content {
  padding: 0.25rem 1.25rem 1.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.definitions__content p {
  margin: 0 0 0.7rem;
}

.definitions__content p:last-child {
  margin-bottom: 0;
}

.definitions__content code {
  padding: 0.05rem 0.35rem;
  background: var(--paper-2);
  border-radius: 5px;
  font-size: 0.85em;
}

.definitions__content strong {
  color: var(--ink);
}

/* ---------- Footer ---------- */
.page-footer {
  color: rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 100% 0%, rgba(196, 144, 52, 0.14), transparent 45%),
    linear-gradient(135deg, var(--teal-dark), var(--teal-deep));
}

.page-footer .shell {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .app-layout.is-sidebar-collapsed {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .side-rail {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intake-layout {
    grid-template-columns: 1fr;
  }

  .admissions-layout {
    grid-template-columns: 1fr;
  }

  .daily-registration-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 1.4rem, 1480px);
  }

  .masthead__status {
    max-width: 155px;
    text-align: right;
  }

  .page-intro {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 2rem 0;
  }

  .refresh-stamp {
    justify-self: start;
  }

  .control-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .filter-impact {
    grid-template-columns: 1fr;
    margin-top: -2rem;
  }

  .date-form {
    flex-direction: column;
    align-items: stretch;
  }

  .date-form span {
    display: none;
  }

  .date-form input {
    max-width: none;
  }

  .kpi-grid,
  .reconciliation-grid,
  .quality-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .section-heading > p {
    text-align: left;
  }

  .insight-strip {
    grid-template-columns: 1fr;
  }

  .pace-summary {
    grid-template-columns: 1fr;
  }

  .local-filter-bar {
    grid-template-columns: 1fr;
  }

  .admissions-overview,
  .breakdown-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-metrics,
  .profile-breakdowns {
    grid-template-columns: 1fr 1fr;
  }

  .page-footer .shell {
    align-items: start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .kpi-grid,
  .reconciliation-grid,
  .quality-grid,
  .admissions-overview,
  .breakdown-grid,
  .profile-metrics,
  .profile-breakdowns {
    grid-template-columns: 1fr;
  }

  .brand small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Hybrid Executive redesign ---------- */
:root {
  --ink: #172338;
  --ink-soft: #3f4c61;
  --muted: #758095;
  --faint: #98a2b3;
  --paper: var(--canvas);
  --paper-2: #edf0f4;
  --surface: var(--card);
  --surface-strong: var(--card);
  --line: #dfe4ec;
  --line-soft: #e9edf2;
  --teal: var(--navy);
  --teal-bright: #1d2c45;
  --teal-dark: var(--navy);
  --teal-deep: #020711;
  --teal-pale: #e8ecf2;
  --teal-wash: #f1f3f7;
  --gold: var(--caution);
  --gold-bright: #f7c866;
  --gold-dark: #b77a13;
  --gold-pale: #fff5df;
  --red: var(--brand-red);
  --red-pale: #fff0ee;
  --sans: "Inter", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: var(--sans);
  --shadow: 0 12px 30px -20px rgba(5, 11, 24, 0.3);
  --shadow-lift: 0 24px 55px -28px rgba(5, 11, 24, 0.38);
  --ring: 0 0 0 3px rgba(224, 47, 34, 0.25);
}

body {
  background: var(--canvas);
}

.masthead {
  background: var(--navy);
  border-bottom: 1px solid #202c42;
  box-shadow: 0 10px 28px rgba(5, 11, 24, 0.18);
}

.brand__mark {
  color: white;
  background: var(--brand-red);
}

.brand strong,
.brand small,
.masthead__status {
  color: white;
}

.side-rail {
  color: #aab4c5;
  background: var(--navy-2);
  border: 1px solid #202c42;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.side-rail__eyebrow,
.side-note span,
.side-note small {
  color: #8996aa;
}

.side-note {
  background: #121d31;
  border-color: #2a3750;
}

.side-note strong {
  color: white;
}

.side-rail nav a {
  color: #aeb8c8;
}

.side-rail nav a:hover {
  color: white;
  background: #17243a;
}

.side-rail nav a.is-active {
  color: white;
  background: var(--brand-red);
}

.side-rail nav a.is-active::before {
  background: white;
}

.sidebar-toggle {
  color: #dce2eb;
  background: #151f32;
  border-color: #2a374d;
}

.page-intro {
  min-height: 260px;
}

.page-intro h1 {
  max-width: 760px;
  font-family: var(--sans);
  font-size: clamp(2.5rem, 5vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.055em;
}

.refresh-stamp {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.control-bar,
.filter-impact,
.panel,
.kpi-card,
.admission-stat,
.quality-card,
.definitions,
.local-filter-bar {
  background: white;
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.date-form button {
  background: var(--navy);
}

.preset.is-active {
  color: white;
  background: var(--brand-red);
}

.dashboard-section {
  scroll-margin-top: 100px;
}

.section-heading h2 {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.eyebrow,
.panel__kicker,
.side-rail__eyebrow {
  color: var(--brand-red);
}

.kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi-card {
  min-height: 165px;
}

.kpi-card.is-primary {
  color: white;
  background: var(--brand-red);
  border-color: var(--brand-red);
}

.kpi-card.is-primary h3,
.kpi-card.is-primary .kpi-card__value,
.kpi-card.is-primary small,
.kpi-card.is-primary .kpi-card__index {
  color: white;
}

.kpi-card__value,
.latest-day-registration strong {
  font-family: var(--sans);
  font-weight: 800;
}

.executive-decision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 1rem;
  margin-top: 1rem;
}

.attribution-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
}

.attribution-flow__operator {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 800;
}

.attribution-card {
  min-width: 0;
  padding: 0.9rem 0.65rem;
  text-align: center;
  background: #f2f4f7;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.attribution-card span,
.attribution-card strong {
  display: block;
}

.attribution-card span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
}

.attribution-card strong {
  margin-top: 0.3rem;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.attribution-card.is-total {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

.attribution-card.is-total span,
.attribution-card.is-total strong {
  color: white;
}

.attribution-card.is-unattributed {
  background: var(--red-pale);
  border-color: #ffc9c3;
}

.attribution-card.is-unattributed strong {
  color: #bd251c;
}

.attribution-reasons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.attribution-reason {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  background: #f7f8fa;
  border-radius: 8px;
}

.attribution-reason strong {
  color: var(--brand-red);
}

.attribution-reason small {
  color: var(--muted);
  font-size: 0.62rem;
}

.attribution-explanation {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.chart-frame {
  min-width: 0;
}

.chart-frame--compact {
  margin-top: 0.85rem;
}

.registration-bars {
  min-height: 205px;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.registration-bar {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.35rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.62rem;
}

.registration-bar strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.registration-bar__track {
  min-height: 150px;
  display: flex;
  align-items: end;
  justify-content: center;
  background: linear-gradient(to top, #edf0f4 1px, transparent 1px);
  background-size: 100% 25%;
  border-bottom: 1px solid var(--line);
}

.registration-bar__fill {
  width: min(34px, 72%);
  display: block;
  background: var(--navy);
  border-radius: 5px 5px 0 0;
}

.registration-bar__fill.is-latest {
  background: var(--brand-red);
}

.segmented-chart,
.aging-stack {
  width: 100%;
  height: 22px;
  display: flex;
  overflow: hidden;
  background: #edf0f4;
  border-radius: 999px;
}

.segmented-chart__segment,
.aging-stack__segment {
  display: block;
  min-width: 2px;
}

.is-navy { background: var(--navy); }
.is-red { background: var(--brand-red); }
.is-green { background: var(--positive); }
.is-amber { background: var(--caution); }
.is-slate { background: var(--muted); }

.segmented-chart__legend,
.aging-stack__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.segmented-chart__legend > span,
.aging-stack__legend > span {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
}

.segmented-chart__legend i,
.aging-stack__legend i {
  width: 8px;
  height: 8px;
  display: block;
  border-radius: 50%;
}

.segmented-chart__legend strong,
.aging-stack__legend strong {
  color: var(--ink);
  font-size: 0.68rem;
}

.aging-stack__segment.is-bucket-0,
.aging-stack__legend i.is-bucket-0 { background: var(--positive); }
.aging-stack__segment.is-bucket-1,
.aging-stack__legend i.is-bucket-1 { background: var(--caution); }
.aging-stack__segment.is-bucket-2,
.aging-stack__legend i.is-bucket-2 { background: #ef884d; }
.aging-stack__segment.is-bucket-3,
.aging-stack__legend i.is-bucket-3,
.aging-stack__segment.is-bucket-4,
.aging-stack__legend i.is-bucket-4 { background: var(--brand-red); }
.aging-stack__segment.is-bucket-5,
.aging-stack__legend i.is-bucket-5 { background: var(--muted); }

.method-bars,
.counsellor-chart-row {
  display: grid;
}

.method-bar,
.counsellor-chart-row {
  grid-template-columns: minmax(90px, 0.7fr) minmax(120px, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  margin: 0.5rem 0;
  font-size: 0.7rem;
}

.method-bar__track,
.counsellor-chart-row__track {
  height: 9px;
  overflow: hidden;
  background: #edf0f4;
  border-radius: 999px;
}

.method-bar__fill,
.counsellor-chart-row__fill {
  height: 100%;
  display: block;
  background: var(--navy);
  border-radius: 999px;
}

.counsellor-chart-row:nth-child(2) .counsellor-chart-row__fill,
.counsellor-chart-row:nth-child(3) .counsellor-chart-row__fill {
  background: var(--brand-red);
}

.counsellor-chart-row__fill.is-low-sample-bar {
  background: repeating-linear-gradient(
    135deg,
    #9aa4b2 0,
    #9aa4b2 5px,
    #c5ccd5 5px,
    #c5ccd5 10px
  );
}

.counsellor-low-sample-note {
  margin: 0.75rem 0 0;
  color: var(--caution);
  font-size: 0.64rem;
  font-weight: 750;
  line-height: 1.45;
}

.is-low-sample {
  color: var(--caution);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-red) 70%, white);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .executive-decision-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .attribution-flow {
    grid-template-columns: 1fr;
  }

  .attribution-flow__operator {
    transform: rotate(90deg);
    text-align: center;
  }

  .attribution-reasons,
  .segmented-chart__legend,
  .aging-stack__legend {
    grid-template-columns: 1fr;
  }

  .registration-bars {
    gap: 0.25rem;
  }

  .registration-bar strong {
    font-size: 0.58rem;
  }

  .method-bar,
  .counsellor-chart-row {
    grid-template-columns: 82px minmax(80px, 1fr) auto;
    gap: 0.4rem;
  }
}

/* ---------- Mobile responsive optimisation ---------- */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.shell,
.app-layout,
.app-layout > *,
main,
.dashboard-section,
.panel,
.kpi-card,
.chart-frame,
.chart-wrap,
.data-table-wrap {
  min-width: 0;
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 2rem, 1480px);
  }

  .app-layout,
  .app-layout.is-sidebar-collapsed {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .side-rail {
    display: none;
  }

  .page-intro {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 2.5rem 0 2rem;
  }

  .page-intro h1 {
    max-width: 14ch;
    font-size: clamp(2.5rem, 8vw, 4.4rem);
  }

  .refresh-stamp {
    width: min(100%, 420px);
    justify-self: start;
  }

  .control-bar {
    position: static;
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .date-form {
    min-width: 0;
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .date-form label {
    min-width: min(100%, 190px);
    flex: 1 1 190px;
  }

  .date-form input {
    width: 100%;
    max-width: none;
  }

  .filter-impact,
  .executive-decision-grid,
  .intake-layout,
  .daily-registration-layout,
  .admissions-layout,
  .collections-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel__heading,
  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .section-heading > p {
    max-width: 62ch;
    text-align: left;
  }

  .chart-wrap,
  .chart-frame {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  #pace-chart {
    min-width: 680px;
  }

  .data-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    width: max-content;
    min-width: 100%;
  }

  .data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .data-table th:first-child,
  .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: white;
    box-shadow: 1px 0 0 var(--line);
  }

  .data-table th:first-child {
    z-index: 3;
    background: var(--navy);
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 1.1rem, 1480px);
  }

  .masthead__inner {
    min-height: 68px;
    gap: 0.75rem;
  }

  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .masthead__status {
    max-width: 148px;
    font-size: 0.66rem;
    line-height: 1.35;
    text-align: right;
  }

  .page-intro {
    padding: 1.75rem 0 1.5rem;
  }

  .page-intro h1 {
    max-width: 12ch;
    font-size: clamp(2.15rem, 12vw, 3.25rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
  }

  .lede {
    font-size: 0.9rem;
  }

  .refresh-stamp,
  .control-bar,
  .filter-impact,
  .panel,
  .kpi-card,
  .local-filter-bar,
  .definitions {
    padding: 1rem;
    border-radius: 12px;
  }

  .control-bar,
  .date-form {
    align-items: stretch;
    flex-direction: column;
  }

  .preset-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .preset,
  .date-form button,
  .date-form input,
  .local-filter-bar select,
  .daily-calendar__nav,
  .error-banner button {
    min-height: 44px;
  }

  .date-form label {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .date-form span {
    display: none;
  }

  .filter-impact,
  .kpi-grid,
  .executive-decision-grid,
  .insight-strip,
  .reconciliation-grid,
  .pace-summary,
  .local-filter-bar,
  .admissions-overview,
  .breakdown-grid,
  .profile-metrics,
  .profile-breakdowns,
  .quality-grid,
  .attribution-flow,
  .attribution-reasons,
  .segmented-chart__legend,
  .aging-stack__legend {
    grid-template-columns: 1fr;
  }

  .profile-breakdown-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.6rem;
  }

  .profile-breakdown-bar__track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 0.8rem;
  }

  .profile-breakdown-bar__value {
    white-space: normal;
  }

  .intake-paid-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.6rem;
  }

  .intake-paid-bar__track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 0.8rem;
  }

  .counsellor-low-sample-note {
    font-size: 0.68rem;
  }

  .kpi-card {
    min-height: 138px;
  }

  .kpi-card__value {
    font-size: clamp(1.65rem, 10vw, 2.45rem);
    overflow-wrap: anywhere;
  }

  .section-heading {
    gap: 0.65rem;
  }

  .section-heading h2 {
    font-size: clamp(1.7rem, 8vw, 2.35rem);
  }

  .panel__heading {
    gap: 0.65rem;
  }

  .panel__heading > *,
  .section-heading > * {
    min-width: 0;
  }

  .definition-pill,
  .basis-pill {
    max-width: 100%;
    white-space: normal;
  }

  .attribution-flow__operator {
    transform: rotate(90deg);
    text-align: center;
  }

  .registration-bars {
    min-width: 520px;
  }

  .daily-calendar__header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 0.4rem;
  }

  .daily-calendar__month {
    font-size: 0.88rem;
  }

  .daily-calendar__grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
  }

  .daily-calendar__weekday {
    padding: 0.2rem 0;
    font-size: 0.54rem;
  }

  .daily-calendar__day,
  .daily-calendar__placeholder {
    min-width: 0;
    min-height: 58px;
    padding: 0.3rem 0.2rem;
    border-radius: 6px;
  }

  .daily-calendar__date {
    font-size: 0.58rem;
  }

  .daily-calendar__count {
    align-self: center;
    font-size: clamp(0.82rem, 4.3vw, 1.1rem);
  }

  .chart-legend {
    align-items: flex-start;
    flex-direction: column;
  }

  .method-bar,
  .counsellor-chart-row {
    grid-template-columns: minmax(72px, 0.75fr) minmax(80px, 1fr) auto;
    gap: 0.35rem;
  }

  .method-bar > :first-child,
  .counsellor-chart-row > :first-child {
    overflow-wrap: anywhere;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem 0.7rem;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .counsellor-profiles {
    grid-template-columns: 1fr;
  }

  .page-footer .shell {
    min-height: 110px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

/* ---------- Trend pill (shared status delta) ---------- */
.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.trend-pill__glyph { font-size: 0.7em; }
.trend-pill--ahead  { color: var(--teal-dark);  background: var(--status-ahead-wash); }
.trend-pill--watch  { color: var(--gold-dark);  background: var(--status-watch-wash); }
.trend-pill--behind { color: var(--status-behind); background: var(--status-behind-wash); }
.trend-pill--neutral{ color: var(--muted);      background: rgba(0,0,0,0.05); }

/* Status tokens pinned after the Hybrid Executive :root so they are not shadowed */
:root {
  --status-ahead: #1f9d83;
  --status-watch: #f2b84b;
  --status-behind: #b0463d;
  --status-ahead-wash: #eef4f1;
  --status-watch-wash: #f4e8cf;
  --status-behind-wash: #f4ddd9;
}

/* ---------- Intake verdict banner ---------- */
.intake-verdict {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 1rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--muted);
  background: rgba(0,0,0,0.04);
}
.intake-verdict__label { font-size: 0.95rem; letter-spacing: 0.02em; }
.intake-verdict__detail { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.intake-verdict.status-ahead  { border-left-color: var(--positive); background: var(--status-ahead-wash); }
.intake-verdict.status-ahead  .intake-verdict__label { color: var(--teal-dark); }
.intake-verdict.status-watch  { border-left-color: var(--caution); background: var(--status-watch-wash); }
.intake-verdict.status-watch  .intake-verdict__label { color: var(--gold-dark); }
.intake-verdict.status-behind { border-left-color: var(--status-behind); background: var(--status-behind-wash); }
.intake-verdict.status-behind .intake-verdict__label { color: var(--status-behind); }

/* Hero (is-primary) card tinted by pace instead of permanent brand red */
.kpi-card.is-primary.status-ahead  { background: linear-gradient(160deg, var(--teal-dark), var(--teal-deep)); border-color: var(--teal-deep); }
.kpi-card.is-primary.status-watch  { background: linear-gradient(160deg, var(--gold-dark), #7c5417); border-color: var(--gold-dark); }
.kpi-card.is-primary.status-behind { background: linear-gradient(160deg, var(--status-behind), #7f2f28); border-color: var(--status-behind); }

/* ---------- Risk triage: aging rows, frozen tiles, pace-chart gap ---------- */
.risk-band--watch  { border-left: 3px solid var(--caution); background: var(--status-watch-wash); }
.risk-band--behind { border-left: 3px solid var(--status-behind);     background: var(--status-behind-wash); }
.pace-gap { fill: rgba(176, 70, 61, 0.12); stroke: none; }
.pace-marker { fill: var(--status-behind); }

/* Intake year breakdown table (registrations & conversion by intake) */
.intake-breakdown-wrap { width: 100%; overflow-x: auto; }
.intake-breakdown-table {
  width: 100%; border-collapse: collapse;
  font: 500 0.92rem var(--sans); font-variant-numeric: tabular-nums;
}
.intake-breakdown-table th {
  text-align: left; font: 600 0.7rem var(--sans); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  padding: 0 14px 10px; border-bottom: 1px solid var(--line);
}
.intake-breakdown-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft);
}
.intake-breakdown-table th.num, .intake-breakdown-table td.num { text-align: right; }
.intake-breakdown-table td.intake-name { font-weight: 600; color: var(--ink); white-space: nowrap; }
.intake-breakdown-table td.reg, .intake-breakdown-table td.conv { font-weight: 600; color: var(--ink); }
.intake-breakdown-table tbody tr:hover { background: var(--teal-wash); }
.intake-breakdown-table tr.is-progress td { background: var(--gold-pale); }
.intake-breakdown-table tr.is-progress .intake-name::after {
  content: " · in progress"; font-weight: 500; color: var(--gold-dark);
  font-size: 0.76rem; text-transform: none; letter-spacing: 0;
}
.intake-breakdown-table tfoot td {
  padding: 13px 14px; border-top: 2px solid var(--line);
  font: 700 0.95rem var(--sans); color: var(--ink); background: var(--surface-strong);
}
.intake-breakdown-table .conv-pill {
  display: inline-block; min-width: 46px; padding: 2px 8px; border-radius: 999px;
  font-weight: 700; font-size: 0.82rem;
}

/* Top navigation bar (replaces the side-rail on the split pages) */
.top-nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--card); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.top-nav__inner {
  display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap;
  padding-block: 4px;
}
.top-nav__group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.top-nav__group--ext { margin-inline-start: auto; }
.top-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 14px 14px; font: 600 0.9rem var(--sans); color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.top-nav a:hover { color: var(--ink); }
.top-nav a.is-active { color: var(--ink); border-bottom-color: var(--brand-red); }
.top-nav__ext { color: var(--faint); font-weight: 500; }
.top-nav__ext.is-active { color: var(--ink); border-bottom-color: var(--teal); }
.top-nav__note {
  font: 500 0.78rem var(--sans); color: var(--faint); white-space: nowrap;
}
.top-nav__note strong { color: var(--ink-soft); font-weight: 600; }
.page-body { padding-block: 4px; }
@media (max-width: 700px) {
  .top-nav__inner { padding-inline: 0; }
  .top-nav a { padding: 12px 10px; font-size: 0.84rem; }
  .top-nav__note { display: none; }
}

/* Aggregate customer journey (SleekFlow lead cohort) */
.journey { display: flex; flex-direction: column; gap: 0; }
.journey__stage {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--teal-wash); border: 1px solid var(--line-soft);
}
.journey__stage--lead { background: var(--teal-pale); }
.journey__stage--paid { background: var(--status-ahead-wash); border-color: var(--teal-pale); }
.journey__copy strong { display: block; font: 600 1rem var(--sans); color: var(--ink); }
.journey__copy small { font: 500 0.78rem var(--sans); color: var(--muted); }
.journey__figures { text-align: right; white-space: nowrap; }
.journey__figures b { font: 600 1.4rem var(--serif); color: var(--ink); }
.journey__share {
  display: block; font: 600 0.74rem var(--sans); color: var(--teal-dark);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.journey__link {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px;
}
.journey__link-arrow { font-size: 1.1rem; color: var(--faint); }
.journey__link-meta { display: flex; flex-direction: column; }
.journey__link-meta strong { font: 700 0.86rem var(--sans); color: var(--gold-dark); }
.journey__link-meta span { font: 500 0.76rem var(--sans); color: var(--muted); }

/* ============================================================
   Counsellor performance — SleekFlow columns, detail panel,
   and the agent (introducer) channel.
   ============================================================ */

/* SleekFlow columns grouped visually inside the counsellor table */
.data-table th.sleekflow-col,
.data-table td.sleekflow-col { background: var(--teal-wash); }
.data-table th.sleekflow-col--first,
.data-table td.sleekflow-col--first { border-left: 2px solid var(--teal-pale); }
.data-table th.sleekflow-col { color: var(--teal-dark); }

.counsellor-table-note {
  margin-top: 12px;
  font: 500 0.8rem var(--sans);
  color: var(--muted);
  line-height: 1.5;
}

/* SleekFlow lead-handling panel inside each counsellor profile card */
.profile-sleekflow {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.profile-sleekflow__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.profile-sleekflow__head h4 {
  margin: 0;
  font: 700 0.92rem var(--serif);
  color: var(--ink);
}
.profile-sleekflow__meta {
  font: 600 0.78rem var(--sans);
  color: var(--teal-dark);
  background: var(--teal-wash);
  padding: 3px 10px;
  border-radius: 999px;
}
.profile-sleekflow__empty {
  font: 500 0.82rem var(--sans);
  color: var(--faint);
  margin: 6px 0 0;
}

.sleekflow-mini-journey {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .sleekflow-mini-journey { grid-template-columns: 1fr; }
}
.sleekflow-mini-journey__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.sleekflow-mini-journey__label {
  font: 600 0.78rem var(--sans);
  color: var(--ink-soft);
}
.sleekflow-mini-journey__count {
  font: 700 0.82rem var(--sans);
  color: var(--ink);
  white-space: nowrap;
}
.sleekflow-mini-journey__track {
  height: 8px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}
.sleekflow-mini-journey__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-bright), var(--teal));
}
.sleekflow-mini-journey__note {
  display: block;
  margin-top: 5px;
  font: 500 0.72rem var(--sans);
  color: var(--muted);
}

.profile-sleekflow__sources h5 {
  margin: 0 0 10px;
  font: 700 0.8rem var(--sans);
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.profile-sleekflow__sources h5 small {
  font: 500 0.7rem var(--sans);
  color: var(--gold-dark);
}
.sleekflow-source-bar {
  display: grid;
  grid-template-columns: minmax(90px, 130px) 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.sleekflow-source-bar__label {
  font: 500 0.78rem var(--sans);
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sleekflow-source-bar__track {
  height: 7px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}
.sleekflow-source-bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
}
.sleekflow-source-bar__value {
  font: 600 0.76rem var(--sans);
  color: var(--muted);
  white-space: nowrap;
}

/* Agent (introducer) channel */
.agent-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 640px) {
  .agent-stats { grid-template-columns: 1fr; }
}
.agent-stat {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.agent-stat__value {
  display: block;
  font: 700 1.9rem var(--serif);
  color: var(--ink);
  line-height: 1.1;
}
.agent-stat__label {
  display: block;
  margin-top: 4px;
  font: 600 0.82rem var(--sans);
  color: var(--ink-soft);
}
.agent-stat__note {
  display: block;
  margin-top: 5px;
  font: 500 0.72rem var(--sans);
  color: var(--muted);
  line-height: 1.4;
}

.agent-top__title {
  margin: 0 0 12px;
  font: 700 0.9rem var(--serif);
  color: var(--ink);
}
.agent-bar {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
}
.agent-bar__label {
  font: 500 0.82rem var(--sans);
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-bar__track {
  height: 9px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}
.agent-bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
}
.agent-bar__value {
  font: 700 0.84rem var(--sans);
  color: var(--ink);
  min-width: 24px;
  text-align: right;
}
.agent-note, .agent-empty {
  margin-top: 16px;
  font: 500 0.78rem var(--sans);
  color: var(--muted);
  line-height: 1.5;
}

/* Agent channel — introduction → paid funnel */
.agent-funnel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .agent-funnel { grid-template-columns: 1fr; }
}
.agent-funnel__stage {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.agent-funnel__label {
  display: block;
  font: 600 0.82rem var(--sans);
  color: var(--ink-soft);
}
.agent-funnel__count {
  display: block;
  margin: 4px 0 10px;
  font: 700 2rem var(--serif);
  color: var(--ink);
  line-height: 1.05;
}
.agent-funnel__track {
  height: 10px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}
.agent-funnel__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
}
.agent-funnel__sub {
  display: block;
  margin-top: 8px;
  font: 500 0.74rem var(--sans);
  color: var(--ink-soft);
}
.agent-funnel__meta {
  display: block;
  margin-top: 2px;
  font: 600 0.74rem var(--sans);
  color: var(--gold-dark);
}

.agent-counsellor { margin-top: 22px; }

.responsiveness-sync {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.responsiveness-sync__progress {
  display: grid;
  gap: 5px;
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.responsiveness-sync progress {
  width: 100%;
  height: 8px;
  accent-color: var(--gold-dark);
}

@media (max-width: 680px) {
  .responsiveness-sync {
    align-items: stretch;
    flex-direction: column;
  }
}

.transcript-downloads {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.transcript-downloads span {
  color: var(--muted);
  font-size: 0.82rem;
}

.report-button--compact {
  min-height: 34px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}
