/* Components. Values come from the CSS variables that app.py makes from theme/tokens.py. */

/* Shell: a left menu with the sections (as in the KAD dashboard), then the page. */
.shell { display: flex; align-items: flex-start; min-height: 100vh; }
.main { flex: 1 1 auto; min-width: 0; }
/* "Insights" sits next to the wordmark at the cap height of the wordmark, one word space away. */
.brand { display: flex; align-items: center; gap: var(--s-gap-s); margin: 0; white-space: nowrap;
  font-size: var(--t-h2-size); line-height: 1; font-weight: 700; color: var(--c-text-strong); }
.user-role { color: var(--c-text); font-weight: 600; }
.logo { display: block; width: auto; height: 28px; }
.stack { display: flex; flex-direction: column; gap: var(--s-gap-xs); }

/* Buttons */
.btn-secondary, .btn-primary, .btn-quiet {
  height: var(--s-control-height); border-radius: var(--s-radius-control); padding: 0 16px;
  font-size: var(--t-small-size); font-weight: 600; cursor: pointer; display: inline-flex;
  align-items: center; gap: var(--s-gap-s); text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--c-primary); color: var(--c-text-inverse); border: 1px solid var(--c-primary-outline); }
.btn-primary:hover { background: var(--c-primary-hover); color: var(--c-text-inverse); }
.btn-secondary { background: var(--c-primary-subtle); color: var(--c-primary); border: 1px solid var(--c-primary-border); }
.btn-quiet { background: var(--c-surface); color: var(--c-text-strong); border: 1px solid var(--c-border-control); height: 36px; }
.link-btn { background: none; border: 0; color: var(--c-primary); font-weight: 600; cursor: pointer; padding: 6px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-gap-xl); flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: var(--s-gap-m); flex-wrap: wrap; }
.scope-hint { margin-top: -4px; }

/* Cards */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--s-radius-card); }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--s-gap-l); }
.goal-card { padding: var(--s-card-pad); display: flex; flex-direction: column; gap: var(--s-gap-m); }
.eyebrow { font-size: var(--t-label-size); line-height: var(--t-label-line); font-weight: 600; color: var(--c-text-subtle); }
.card-title { margin: 0; font-size: var(--t-card-title-size); line-height: var(--t-card-title-line);
  font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat { font-size: var(--t-stat-size); line-height: var(--t-stat-line); font-weight: 700; color: var(--c-text-strong); }
.stat-row { display: flex; align-items: center; gap: var(--s-gap-s); flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--c-track); margin: 0; }
.kpi-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-gap-l); }
.info-btn { width: 24px; height: 24px; border: 0; background: none; color: var(--c-text); cursor: help;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 12px; }
.info-btn:hover { color: var(--c-primary); }
.info-icon { width: 16px; height: 16px; border-radius: 8px; border: 1.5px solid currentColor; font-size: 11px;
  line-height: 13px; font-weight: 700; text-align: center; display: inline-block; font-style: normal; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--s-radius-control);
  font-size: var(--t-label-size); line-height: var(--t-label-line); font-weight: 600; white-space: nowrap; }
.b-good { background: var(--c-good-bg); color: var(--c-good-text); border: 1px solid var(--c-good-border); }
.b-avg { background: var(--c-avg-bg); color: var(--c-avg-text); border: 1px solid var(--c-avg-border); }
.b-poor { background: var(--c-poor-bg); color: var(--c-poor-text); border: 1px solid var(--c-poor-border); }
.b-neutral { background: var(--c-neutral-bg); color: var(--c-neutral-text); border: 1px solid var(--c-neutral-border); }
.b-info { background: var(--c-primary-subtle); color: var(--c-primary-strong); border: 1px solid var(--c-primary-border); }

/* Bars: 12px track, label after the end of the fill */
.bar-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: var(--s-gap-m); }
.bar { position: relative; height: 16px; display: flex; align-items: center; }
.bar-track { width: 100%; height: var(--s-bar-height); background: var(--chart-enrolled-fill); border-radius: var(--s-bar-radius); overflow: hidden; }
.bar-fill { height: 100%; min-width: 6px; background: var(--chart-progress-fill); box-shadow: inset 0 0 0 1px var(--chart-progress-outline); border-radius: var(--s-bar-radius); }
.bar-label { position: absolute; top: 0; font-size: var(--t-label-size); line-height: 16px; font-weight: 700; color: var(--c-text-strong); white-space: nowrap; }
.bars { display: flex; flex-direction: column; gap: var(--s-gap-s); padding-top: var(--s-gap-s); }

/* Funnel */
.funnel { display: grid; grid-template-columns: 84px 1fr auto; gap: 6px var(--s-gap-m); align-items: center; font-size: var(--t-label-size); font-weight: 600; color: var(--c-text); }
.funnel .value { color: var(--c-text-strong); text-align: right; white-space: nowrap; }
.funnel .track { height: var(--s-bar-height); background: var(--c-surface); border-radius: var(--s-bar-radius); }
.funnel .fill { height: 100%; border-radius: var(--s-bar-radius); }
.fill-enrolled { background: var(--chart-enrolled-fill); box-shadow: inset 0 0 0 1px var(--chart-enrolled-outline); }
.fill-registered { background: var(--chart-registered-fill); box-shadow: inset 0 0 0 1px var(--chart-progress-outline); }
.fill-activated { background: var(--chart-progress-fill); box-shadow: inset 0 0 0 1px var(--chart-progress-outline); }

/* Domain rows (Overall, Math, Science) */
.domain-rows { display: flex; flex-direction: column; gap: 6px; }
.domain-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s-gap-m); align-items: baseline; }
.domain-row .pct { font-weight: 700; color: var(--c-text-strong); min-width: 40px; text-align: right; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-gap-l); }
.chart-card { padding: var(--s-gap-l); display: flex; flex-direction: column; gap: var(--s-gap-s); min-width: 0; }
.chart-title { font-size: var(--t-card-title-size); line-height: var(--t-card-title-line); font-weight: 700; margin: 0; }
.note-card { padding: var(--s-card-pad); display: flex; flex-direction: column; gap: var(--s-gap-s); justify-content: center; }

/* Rankings */
.rank-layout { display: flex; gap: var(--s-gap-xl); align-items: flex-start; flex-wrap: wrap; }
.map-box { flex: 0 1 400px; min-width: 280px; justify-content: flex-start; display: flex; flex-direction: column; gap: var(--s-gap-m); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-gap-m); font-size: var(--t-label-size); font-weight: 600; color: var(--c-text); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-poor { background: var(--chart-map-poor); border: 1px solid var(--chart-map-poor-outline); }
.sw-avg { background: var(--chart-map-avg); border: 1px solid var(--chart-map-avg-outline); }
.sw-good { background: var(--chart-map-good); border: 1px solid var(--chart-map-good-outline); }
.table-box { min-width: 0; display: flex; flex-direction: column; gap: var(--s-gap-m); }

/* Tabs (dcc.Tabs) */
.tabs-root { border-bottom: 1px solid var(--c-border); overflow-x: auto; }
.tab { font-size: var(--t-small-size); line-height: var(--t-small-line); font-weight: 600; color: var(--c-text);
  background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important;
  padding: 12px 14px !important; white-space: nowrap; width: auto !important; }
.tab--selected { color: var(--c-primary) !important; border-bottom-color: var(--c-primary) !important; }
.tab-panel { display: flex; flex-direction: column; gap: var(--s-gap-l); padding-top: var(--s-gap-l); }
.threshold-form { padding: var(--s-gap-l); display: flex; gap: var(--s-gap-l); align-items: flex-end; flex-wrap: wrap; }
/* Filter bar: directly above the data, no card (Filter and sort pattern). */
.filter-bar { display: flex; gap: var(--s-gap-m); align-items: flex-end; flex-wrap: wrap; }
.filter-bar .grow { flex: 1 1 120px; max-width: 420px; }
.input-unit { font-size: var(--t-small-size); color: var(--c-text-subtle); font-weight: 600; }
.stack-l { display: flex; flex-direction: column; gap: var(--s-gap-l); }
.alert-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-gap-l); }
.alert-card { padding: var(--s-gap-l); display: flex; flex-direction: column; gap: 4px; }
.count-line { font-weight: 600; color: var(--c-text); }

/* States */
.empty-state, .error-state { padding: var(--s-gap-xl); display: flex; flex-direction: column; align-items: center; gap: var(--s-gap-m); text-align: center; }
.banner-warn { display: flex; gap: var(--s-gap-m); align-items: center; padding: 12px 16px; background: var(--c-warn-bg);
  border: 1px solid var(--c-warn-border); border-radius: var(--s-radius-control); font-weight: 600; color: var(--c-warn-text); }

/* AG Grid theme */
.ag-theme-quartz.ka-grid {
  --ag-font-family: var(--font);
  --ag-font-size: 14px;
  --ag-foreground-color: var(--c-text-strong);
  --ag-header-foreground-color: var(--c-text);
  --ag-header-background-color: var(--c-ground);
  --ag-border-color: var(--c-border);
  --ag-row-border-color: var(--c-track);
  --ag-row-hover-color: var(--c-ground);
  --ag-selected-row-background-color: var(--c-primary-subtle);
  --ag-wrapper-border-radius: 8px;
  --ag-active-color: var(--c-primary);
  --ag-header-font-weight: 600;
}
.ka-grid .ag-header-cell-text { font-size: 12px; }
.ka-grid .cell-link { color: var(--c-primary); text-decoration: underline; cursor: pointer; font-weight: 500; }
.ka-grid .cell-strong { font-weight: 700; }
.ka-grid .row-flag { background: var(--c-avg-bg); }

/* Sign-in page (pages/login.py, design board "Sign in page") */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; }
.login-card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 20px;
  box-sizing: border-box; box-shadow: 0 8px 16px rgba(33, 36, 44, 0.08); }
/* Full Khan Academy logo, then "Insights" a little smaller: a product of Khan Academy. A thin
   line between them, as in the app bar. */
.login-brand { margin: 0; display: flex; align-items: center; gap: 10px; color: var(--c-text-strong); }
.login-brand img { height: 28px; width: auto; }
.login-brand span { font-size: 18px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em;
  padding-left: 10px; border-left: 1px solid var(--c-border); }
.login-head h1 { margin: 0 0 4px; font-size: 24px; line-height: 32px; color: var(--c-text-strong); }
.login-head p { margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .btn-primary { height: var(--s-control-height); width: 100%; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.text-input { height: var(--s-control-height); border: 1px solid var(--c-border-control); border-radius: var(--s-radius-control);
  padding: 0 12px; font: inherit; font-size: 14px; color: var(--c-text-strong); background: var(--c-surface, #ffffff);
  box-sizing: border-box; width: 100%; }
.text-input:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.text-input.invalid { border-color: #d92916; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .text-input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 32px; border: 0;
  background: none; color: var(--c-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: var(--s-radius-control); }
.pw-toggle:focus-visible { outline: 2px solid var(--c-primary); }
.pw-toggle[aria-pressed="true"] { color: var(--c-primary); }
.login-note { margin: 0; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--s-radius-control);
  font-size: 14px; line-height: 20px; font-weight: 500; }
.login-note-error { background: #fdf0ee; border: 1px solid #f4b9b1; color: #8a1c0f; }
.login-note-info { background: var(--c-primary-subtle, #ebf1fd); border: 1px solid #bfcaff; color: #363498; }
.login-help { margin: 0; font-size: 12px; line-height: 16px; color: var(--c-text); }
.ic-eye { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 10s3-5.5 8-5.5S18 10 18 10s-3 5.5-8 5.5S2 10 2 10z'/%3E%3Ccircle cx='10' cy='10' r='2.5'/%3E%3C/svg%3E"); }
.ic-alert { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='7.5'/%3E%3Cpath d='M10 6v5M10 13.8v.1'/%3E%3C/svg%3E"); }
.form-error { color: var(--c-poor-text); background: var(--c-poor-bg); border: 1px solid var(--c-poor-border); border-radius: var(--s-radius-control); padding: 8px 12px; font-weight: 600; }

@media (max-width: 680px) {
  .page { padding: 16px 16px 48px; }
}

/* DMC inputs: placeholder text must meet contrast. "All ..." in a scope filter reads as a value. */
.mantine-Select-input::placeholder, .mantine-MultiSelect-inputField::placeholder,
.mantine-TextInput-input::placeholder { color: var(--c-text-subtle); opacity: 1; }
.rank-layout > .table-box { flex: 1 1 520px; }

/* Program goal cards (board 1, option A) */
.title-block { display: flex; flex-direction: column; gap: 2px; }
.headline { display: flex; flex-direction: column; gap: 2px; }
.sub-title { font-size: var(--t-small-size); line-height: var(--t-small-line); font-weight: 700; color: var(--c-text-strong); }
.stack-xs { display: flex; flex-direction: column; gap: var(--s-gap-xs); }
.stack-s { display: flex; flex-direction: column; gap: var(--s-gap-s); }
.goal-card { gap: var(--s-gap-l); }
.seg-bar { display: flex; gap: 2px; height: var(--s-bar-height); border-radius: var(--s-bar-radius); overflow: hidden; }
.seg { height: 100%; }
.seg-activated { background: var(--chart-progress-fill); box-shadow: inset 0 0 0 1px var(--chart-progress-outline); }
.seg-registered { background: var(--chart-registered-fill); box-shadow: inset 0 0 0 1px var(--chart-progress-outline); }
.seg-unregistered { background: var(--chart-enrolled-fill); box-shadow: inset 0 0 0 1px var(--chart-enrolled-outline); }
.key-rows { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: var(--s-gap-s); align-items: center; }
.swatch-key { width: 12px; height: 12px; border-radius: 3px; }
.key-registered { background: var(--chart-registered-fill); border: 1px solid var(--chart-progress-outline); }
.key-unregistered { background: var(--chart-enrolled-fill); border: 1px solid var(--chart-enrolled-outline); }
/* Same columns in every card, so the bars line up across cards. */
.dom-rows { display: grid; grid-template-columns: 64px minmax(0, 1fr) 40px 64px 72px; gap: 10px var(--s-gap-m); align-items: center; }
.dom-label { font-weight: 600; color: var(--c-text); }
.dom-track { height: var(--s-bar-height); background: var(--chart-enrolled-fill); border-radius: var(--s-bar-radius); overflow: hidden; }
.dom-fill { height: 100%; min-width: 6px; border-radius: var(--s-bar-radius); }
/* Overall, Math, and Science: the colours of the trend lines (theme/tokens.py). */
.dom-overall { background: var(--chart-overall); box-shadow: inset 0 0 0 1px var(--chart-overall-outline); }
.dom-math { background: var(--chart-math); box-shadow: inset 0 0 0 1px var(--chart-math-outline); }
.dom-science { background: var(--chart-science); box-shadow: inset 0 0 0 1px var(--chart-science-outline); }
.dom-pct { text-align: right; color: var(--c-text-strong); }
.dom-count { text-align: right; color: var(--c-text); }
.dom-change { text-align: right; }

/* Rankings: map and table share the top and bottom edges (board 1). */
.rank-card { padding: var(--s-card-pad); display: flex; flex-direction: column; gap: var(--s-gap-l); }
.rank-layout { align-items: stretch; }
.rank-layout > .table-box { display: flex; flex-direction: column; }
.rank-layout > .table-box > div { flex: 1 1 auto; min-height: 320px; }
.key-rows strong { text-align: right; }
.ka-grid .ag-header-cell-text { word-break: normal; overflow-wrap: normal; }

/* Breadcrumb: the title of the page, sticky below the tabs. One line: a long name ends in an
   ellipsis (its title gives the full name); the current item keeps its full name. A header
   divider marks the edge between the sticky top and the scrolling content (Borders and
   dividers: header and footer dividers). Surface 1, base elevation: no shadow. */
.scope-path { flex: 1 1 auto; display: flex; align-items: center; gap: var(--s-gap-s); min-width: 0; white-space: nowrap;
  font-size: 16px; line-height: 24px; font-weight: 600; color: var(--c-text-subtle); }
/* One line always. The names get shorter with an ellipsis: the earlier levels first, the current
   node last. The breadcrumb does not go into the period controls. */
.scope-path { overflow: hidden; }
.scope-path > * { flex: none; }
.scope-path > a, .scope-path > span[title] { flex: 0 3 auto; min-width: 2.5em; overflow: hidden; text-overflow: ellipsis; }
.scope-path > .current, .scope-path > .crumb-school { flex: 0 1 auto; min-width: 2.5em; }
.crumb-school > .current { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumb-school > :not(.current) { flex: none; }
.scope-path a { color: var(--c-text); text-decoration: none; border-radius: 2px; }
.scope-path a:hover { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }
.scope-path a:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.scope-path .current { color: var(--c-text-strong); font-weight: 700; }
.scope-path > [aria-hidden] { color: var(--c-text-subtle); }
.crumb-school { display: inline-flex; align-items: center; gap: var(--s-gap-s); }

/* A section keeps its old content, dimmed, while it loads. No blank page, no jump. */
.section { transition: opacity 120ms ease-out; }
.section[data-dash-is-loading] { opacity: 0.5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .section { transition: none; } }

#scope-bar:empty { display: none; }
@media (max-width: 680px) {
}

/* Detailed reports: tabs hug their labels and start at the left. */
.tabs-root .tab { flex: 0 0 auto !important; }
.tabs-root > div { justify-content: flex-start !important; }

/* Numbers in tables: left aligned (Data tables guideline), tabular figures. */
.ka-grid .cell-num { font-variant-numeric: tabular-nums; }

/* Warning badge (Badges: warning status) with its icon. */
.b-warn { background: var(--c-warn-bg); color: var(--c-warn-text); border: 1px solid var(--c-warn-border); }
.warn-icon { width: 12px; height: 12px; flex: none; background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M8 4.5v4.2' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.3' r='1' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3Cpath d='M8 4.5v4.2' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.3' r='1' fill='black'/%3E%3C/svg%3E") center / contain no-repeat; }
.flag-cell { display: inline-flex; align-items: center; gap: var(--s-gap-s); }
.flag-cell .rate { min-width: 36px; font-weight: 700; color: var(--c-text-strong); }

/* Summary tabs above a table (Data tables: table with summary tabs). Each tab shows a label,
   a count, and its share. The first tab is the whole group. */
.summary-tabs .mantine-Tabs-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--s-gap-s); border: 0; }
.summary-tabs .mantine-Tabs-list::before { display: none; }
.summary-tabs .mantine-Tabs-tab { border: 1px solid var(--c-border); border-radius: var(--s-radius-card);
  background: var(--c-surface); padding: var(--s-gap-m) var(--s-gap-l); margin: 0; justify-content: flex-start;
  text-align: left; height: auto; }
.summary-tabs .mantine-Tabs-tab:hover { background: var(--c-ground); border-color: var(--c-border-control); }
.summary-tabs .mantine-Tabs-tab[data-active] { border: 2px solid var(--c-primary); padding: calc(var(--s-gap-m) - 1px) calc(var(--s-gap-l) - 1px);
  background: var(--c-primary-subtle); }
.st-body { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.st-label { font-size: var(--t-small-size); line-height: var(--t-small-line); font-weight: 600; color: var(--c-text); }
.st-count { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--c-text-strong); font-variant-numeric: tabular-nums; }
.st-context { font-size: var(--t-label-size); line-height: var(--t-label-line); font-weight: 500; color: var(--c-text-subtle); }

/* Section head with a control on the right: the heading and the control share a bottom line. */
.section-head:has(> .mantine-Select-root), .section-head:has(> .mantine-InputWrapper-root) { align-items: flex-end; }
/* Detailed reports: the title and Grade (label, then list) are on one line. */
#sec-detailed > .section-head { align-items: center; }
/* The list (40 px) is higher than the title line (32 px): the margin keeps the title at its position. */
.head-field { display: flex; align-items: center; gap: var(--s-gap-m); margin: -4px 0; }

/* ---------------------------------------------------------------- left menu with the filters
   Expanded: 300 px, the logo, a close button, then the period and the scope filters, one field
   for each row. To collapse, the menu gets narrower and cuts off the panel (the panel keeps its
   width), then a rail with a menu button and a filter button fades in. As in KAD. */
.ic { display: inline-block; flex: none; width: 20px; height: 20px; background-color: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.ic-menu { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5.5h14M3 10h14M3 14.5h14'/%3E%3C/svg%3E"); }
.ic-close { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5l10 10M15 5L5 15'/%3E%3C/svg%3E"); }
.ic-filter { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h14l-5.5 6.5V16l-3 1.5v-7z'/%3E%3C/svg%3E"); }
:root { --side-w: 300px; }
.side { --side-rail: 72px; position: sticky; top: 0; flex: none;
  width: var(--side-w); height: 100vh; z-index: 200; overflow: hidden; background: var(--c-surface);
  border-right: 1px solid var(--c-border); transition: width var(--wb-enter); }
.side-panel { width: var(--side-w); height: 100%; display: flex; flex-direction: column; gap: 16px;
  padding: 12px 16px 16px; overflow-y: auto; overflow-x: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 44px; flex: none; }
.side-head .brand { min-width: 0; padding-left: 4px; }
.side-head .logo { height: 26px; }
/* Icon buttons: 2 px border (Wonder Blocks: icon button, secondary). */
.side-btn { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid transparent; border-radius: 8px; background: var(--c-surface); color: var(--c-text); cursor: pointer;
  transition: border-color 120ms ease-out, color 120ms ease-out; }
.side-btn:hover, .side-btn:focus-visible { border-color: var(--c-primary); color: var(--c-primary); outline: none; }
.side-btn-strong { border-color: var(--c-primary); color: var(--c-primary); }
.side-btn-strong:hover { background: var(--c-primary-subtle); }
.side-rail { position: absolute; top: 0; left: 0; z-index: 1; width: var(--side-rail); height: 100%; display: flex;
  flex-direction: column; align-items: center; gap: 16px; padding-top: 12px; background: var(--c-surface);
  opacity: 0; visibility: hidden; transition: opacity 80ms ease-out, visibility 0s linear 80ms; }
/* Title of the filters: the form of a view link (icon, then name), below the separator line. */
.side-title { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 10px; margin: -4px 0;
  font-size: 16px; line-height: 24px; font-weight: 500; color: var(--c-text); }
.side-filters, .period-ctl, #scope-bar { display: flex; flex-direction: column; gap: var(--s-gap-m); }
.side-filters { gap: var(--s-gap-l); }
.side-foot { margin-top: auto; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-gap-s);
  padding-top: var(--s-gap-m); border-top: 1px solid var(--c-border); }
.side-foot .user-role { font-size: var(--t-label-size); line-height: var(--t-label-line); }
/* Motion of the Wonder Blocks DrawerLauncher (inlineStart), Thunderblocks theme, measured in Storybook:
   - Open (enter): 300 ms, cubic-bezier(0.05, 0.7, 0.1, 1). The panel slides in from -42 % and
     fades in, while the menu gets wide.
   - Collapse (exit): 150 ms, cubic-bezier(0.3, 0, 0.8, 0.15). The panel slides out to -42 % and
     fades out, while the menu gets narrow. Then the rail shows. */
:root { --wb-enter: 300ms cubic-bezier(0.05, 0.7, 0.1, 1); --wb-exit: 150ms cubic-bezier(0.3, 0, 0.8, 0.15); }
.side-panel { transition: transform var(--wb-enter), opacity var(--wb-enter); }
.shell.collapsed .side { width: var(--side-rail); transition: width var(--wb-exit); }
.shell.collapsed .side-panel { visibility: hidden; transform: translateX(-42%); opacity: 0;
  transition: transform var(--wb-exit), opacity var(--wb-exit), visibility 0s linear 150ms; }
.shell.collapsed .side-rail { opacity: 1; visibility: visible;
  transition: opacity 150ms linear 150ms, visibility 0s linear 150ms; }
/* Floating filter panel: the panel is in place, and only the filters show. */
.shell.collapsed.float .side-panel { visibility: visible; transform: none; opacity: 1; transition: none; }
.shell.collapsed.float .side-panel > :not(.side-filters) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .side, .shell.collapsed .side, .side-panel, .side-rail, .shell.collapsed .side-rail, .shell.collapsed .side-panel,
  .side-btn { transition: none; }
}

/* Top of the page, sticky: the section tabs with Cadence and the period at the right end, then
   the breadcrumb. The tab of the section in view is selected (assets/nav.js). The line under the
   tabs is the base line of the tabs. */
.main-top { position: sticky; top: 0; z-index: 150; background: var(--c-ground); }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-gap-xl); height: 64px;
  padding: 0 var(--s-page-pad); border-bottom: 1px solid var(--c-border); }
.top-bar .period-ctl { flex: none; flex-direction: row; align-items: center; gap: var(--s-gap-l); }
.period-field { width: auto; min-width: 160px; max-width: 260px; }
.section { scroll-margin-top: 80px; }

/* 1024 px and less: the expanded menu opens over the page. */
@media (max-width: 1024px) {
  .shell { padding-left: 72px; }
  .side { position: fixed; left: 0; top: 0; box-shadow: 0 8px 24px rgba(33, 36, 44, 0.16);
    transition: width var(--wb-enter), box-shadow var(--wb-enter); }
  .shell.collapsed .side { box-shadow: none; transition: width var(--wb-exit), box-shadow var(--wb-exit); }
  .top-bar { padding: 0 16px; gap: var(--s-gap-m); }
}
.ic-chev { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 8l4.5 4.5L14.5 8'/%3E%3C/svg%3E"); }
.ic-search { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='9' r='5.5'/%3E%3Cpath d='M13 13l4 4'/%3E%3C/svg%3E"); }
.ic-lock { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='9' width='11' height='8' rx='1.5'/%3E%3Cpath d='M7 9V6.5a3 3 0 0 1 6 0V9'/%3E%3C/svg%3E"); }

/* ---------------------------------------------------------------- dropdown select (Wonder Blocks)
   Label above. The field shows the value on one line and ends in an ellipsis. The menu has a
   search field, check boxes in groups that open and close, Clear, and Apply. */
.dd { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* The popover target wrapper takes the full width, so the field and its menu do. */
.dd > div { width: 100% !important; }
.dd-label { font-size: var(--t-label-size); line-height: var(--t-label-line); font-weight: 600; color: var(--c-text-strong); }
.dd-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  height: var(--s-control-height); padding: 0 12px; border: 1px solid var(--c-border-control);
  border-radius: var(--s-radius-control); background: var(--c-surface); color: var(--c-text-strong);
  font-size: var(--t-small-size); font-weight: 500; text-align: left; cursor: pointer; }
.dd-field:hover { border-color: var(--c-primary); }
.dd-field[aria-expanded="true"] { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary); }
.dd-field .ic { width: 16px; height: 16px; color: var(--c-text); }
.dd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Read-only: the value stays readable, with a lock and a reason. */
.dd-field.readonly { background: var(--c-neutral-bg); border-color: var(--c-border); color: var(--c-text); cursor: default; }
.dd-help { font-size: var(--t-label-size); line-height: var(--t-label-line); font-weight: 500; color: var(--c-text-subtle); }
.dd-menu { display: flex; flex-direction: column; gap: 8px; padding: 12px !important; }
.dd-menu .ic-search { width: 16px; height: 16px; color: var(--c-text-subtle); }
.dd-list { max-height: min(280px, 36vh); overflow-y: auto; margin: 0 -12px; padding: 4px 12px; }
.dd-opts { display: flex; flex-direction: column; }
/* dcc.Checklist: label.dash-options-list-option > check box wrapper, then the text (.dd-opt). */
.dd-opts .dash-options-list-option, .ss-opts .dash-options-list-option { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0;
  padding: 8px 4px; border-radius: 4px; cursor: pointer; }
.dd-opts .dash-options-list-option:hover, .ss-opts .dash-options-list-option:hover { background: var(--c-ground); }
.dd-opts .dash-options-list-option-wrapper, .ss-opts .dash-options-list-option-wrapper { display: inline-flex; flex: none; }
.dd-opt { font-size: var(--t-small-size); line-height: 20px; font-weight: 500; color: var(--c-text-strong); }
/* Native check box drawn as the Wonder Blocks check box: 20 px, 4 px corners, primary fill when checked. */
.dd-cb { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0;
  border: 1px solid var(--c-border-control); border-radius: 4px; background: var(--c-surface); cursor: pointer;
  display: inline-grid; place-content: center; }
.dd-cb::before { content: ""; width: 12px; height: 12px; background: var(--c-text-inverse); transform: scale(0);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.dd-cb:checked { background: var(--c-primary); border-color: var(--c-primary); }
.dd-cb:checked::before { transform: scale(1); }
.dd-cb:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.dd-details > .dd-opts { padding-left: 24px; }
.dd-group { display: flex; align-items: center; gap: 6px; padding: 8px 4px; list-style: none; cursor: pointer;
  font-size: var(--t-small-size); font-weight: 600; color: var(--c-text); }
.dd-group::-webkit-details-marker { display: none; }
.dd-group .ic { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform 120ms ease-out; }
.dd-details[open] > .dd-group .ic { transform: none; }
.dd-foot { display: flex; justify-content: space-between; align-items: center; margin: 0 -12px;
  padding: 10px 12px 0; border-top: 1px solid var(--c-border); }
.btn-sm { height: 32px; }
.dd-clear-all { align-self: flex-start; padding: 0; }
@media (prefers-reduced-motion: reduce) { .dd-group .ic { transition: none; } }
.dd .mantine-Select-section .ic { width: 16px; height: 16px; color: var(--c-text-subtle); }
.hidden { display: none !important; }
.shell.no-anim .side, .shell.no-anim .side * { transition: none !important; }

/* Single-select menu (Dropdown select: single-select). A pick applies at once and closes the
   menu. A filled circle with a check mark marks the current item; the others have no mark. */
.ss-opts { display: flex; flex-direction: column; }
.ss-radio { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 0;
  border-radius: 50%; background: transparent; display: inline-grid; place-content: center; cursor: pointer; }
.ss-radio::before { content: ""; width: 12px; height: 12px; background: var(--c-text-inverse); transform: scale(0);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.5 2.5L10 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.ss-radio:checked { background: var(--c-primary); }
.ss-radio:checked::before { transform: scale(1); }
.ss-radio:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.ss-opts .dash-options-list-option:has(.ss-radio:checked) .ss-opt { font-weight: 700; }
.ss-opt { font-size: var(--t-small-size); line-height: 20px; font-weight: 500; color: var(--c-text-strong); }

/* Cadence: the segmented control as before (theme/mantine_theme.py: subtle primary fill with a
   primary underline), with the Wonder Blocks selected colors on the labels: primary for the
   selected option, subtle text for the other. The theme sets the label color inline. */
.cadence-seg .mantine-SegmentedControl-label { color: var(--c-text-subtle) !important; }
.cadence-seg .mantine-SegmentedControl-label:hover { color: var(--c-text-strong) !important; }
.cadence-seg .mantine-SegmentedControl-control[data-active] .mantine-SegmentedControl-label { color: var(--c-primary) !important; }

.ic-filter-off { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h14l-5.5 6.5V16l-3 1.5v-7z'/%3E%3Cpath d='M2.5 2.5l15 15'/%3E%3C/svg%3E"); }

/* Tooltip: the Wonder Blocks Tooltip, subtle variant. White bubble, 1 px subtle border, 4 px
   corners, mid elevation (Surfaces and elevations: popovers and tooltips), 10 px by 16 px
   padding, body text, max. 472 px wide, and a tail that points at the anchor. */
.wb-tooltip { width: max-content !important; max-width: min(472px, calc(100vw - 24px)); padding: 10px 16px; border: 1px solid var(--c-border); border-radius: 4px;
  --tooltip-bg: var(--c-surface); --tooltip-color: var(--c-text-strong);
  background: var(--c-surface) !important; color: var(--c-text-strong) !important;
  box-shadow: 0 4px 8px rgba(33, 36, 44, 0.16); font-size: 16px; line-height: 20px; font-weight: 500; }
/* Mantine draws the tail as a turned square under the bubble edge: the border shows on its outer sides. */
.wb-tooltip-tail { background: var(--c-surface) !important; border: 1px solid var(--c-border); }
/* Filters button in the rail: no border. It opens the filters as a floating panel beside the
   rail. The panel is the filter block of the menu, so the filters exist one time only. The
   badge is the number of filters with a value. */
#rail-filter, #rail-filter:hover { border-color: transparent; position: relative; }
#rail-filter:hover, .shell.float #rail-filter { color: var(--c-primary); background: var(--c-primary-subtle); }
#rail-filter:focus-visible { border-color: transparent; outline: 2px solid var(--c-primary); outline-offset: 2px; }
.shell.collapsed.float .side-filters { visibility: visible; position: fixed; top: 12px; left: calc(var(--side-rail) + 8px); z-index: 250;
  width: 300px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 16px; visibility: visible;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(33, 36, 44, 0.16); }
.rail-count:empty { display: none; }
.rail-count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--c-primary); color: var(--c-text-inverse); font-size: 11px; line-height: 16px; font-weight: 700; }
.ic-view-home { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 17.5h15'/%3E%3Cpath d='M3.5 13.5l4-4.5 3.5 3 5.5-6.5'/%3E%3C/svg%3E"); }
.ic-view-activation { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='6.5' r='3'/%3E%3Cpath d='M2.5 17c0-3 2.5-5.5 5.5-5.5 1.5 0 2.8.5 3.8 1.4'/%3E%3Cpath d='M12.5 15l2 2 3.5-4'/%3E%3C/svg%3E"); }
.ic-view-reports { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='3.5' width='15' height='13' rx='1.5'/%3E%3Cpath d='M2.5 8h15M2.5 12.5h15M8 8v8.5'/%3E%3C/svg%3E"); }

/* Views: one view on the screen. Home has Goals, Progress, and Rankings. */
.view-home #sec-activation, .view-home #sec-detailed,
.view-activation > .section:not(#sec-activation), .view-reports > .section:not(#sec-detailed) { display: none; }

/* The open menu and the rail have the same lines (Wonder Blocks sizes): 12 px at the top, a 44 px
   button row, 16 px, then 44 px links with 4 px between them. The icons do not move down or
   sideways when the menu collapses (icon centre at 36 px from the left).
   View links in the menu (as the KAD menu): icon and name; the current view has the subtle primary
   fill. In the rail: the icon only, with a tooltip. */
.side-nav, .rail-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav { flex: none; padding-bottom: var(--s-gap-l); border-bottom: 1px solid var(--c-border); }
.side-link { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 10px; border-radius: 8px;
  color: var(--c-text); font-size: 16px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.side-link:hover { background: var(--c-ground); color: var(--c-text-strong); }
.side-link.on { background: var(--c-primary-subtle); color: var(--c-primary); font-weight: 600; }
.side-link:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.rail-nav .side-link { width: 44px; justify-content: center; padding: 0; }
.rail-nav:empty { display: none; }

/* Goal cards: the KPI names and the numbers are on the same lines across the 3 cards. The cards
   share 3 rows (name, number, the rest) with subgrid. A name that goes onto 2 lines makes the name
   row higher in all the cards. Below 1100 px the cards are in one column. */
.goal-grid { grid-template-columns: 1fr; }
.goal-rest { display: flex; flex-direction: column; gap: var(--s-gap-l); }
.kpi-pair, .kpi { row-gap: var(--s-gap-l); }
.kpi { display: flex; flex-direction: column; }
.title-block { align-self: start; }
@media (min-width: 1100px) {
  .goal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto 1fr; }
  .goal-card { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--s-gap-l); align-content: start; }
  .goal-card > .kpi-pair { grid-row: span 2; grid-template-rows: subgrid; }
  .kpi-pair > .kpi { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
}

/* Resize handle at the right edge of the open menu (assets/nav.js). Drag it, or use the arrow
   keys. A double-click sets the default width. */
.side-resize { position: absolute; top: 0; right: 0; z-index: 2; width: 8px; height: 100%; cursor: col-resize;
  touch-action: none; }
.side-resize::after { content: ""; position: absolute; top: 0; right: 0; width: 2px; height: 100%;
  background: transparent; transition: background 100ms ease-out; }
.side-resize:hover::after, .side-resize:focus-visible::after, .shell.resizing .side-resize::after { background: var(--c-primary); }
.side-resize:focus-visible { outline: none; }
.shell.collapsed .side-resize { display: none; }
.shell.resizing { cursor: col-resize; user-select: none; }

/* Sign-out button at the bottom of the menu and of the rail (config.SIGN_OUT_*). It has the
   form of a view link, so its icon is in line with the view icons. */
.ic-sign-out { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3.5H4.5a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1H8'/%3E%3Cpath d='M13 6.5l3.5 3.5-3.5 3.5M16.5 10H8'/%3E%3C/svg%3E"); }
.side-foot { align-items: stretch; }
.side-rail .rail-foot { width: 44px; justify-content: center; padding: 0; }
/* The tooltip puts the link in a wrapper: the wrapper goes to the bottom of the rail. */
.side-rail > :last-child { margin-top: auto; margin-bottom: 16px; }

/* The name of an icon button does not show after a click on the button (assets/nav.js). */
.tips-off .tip-btn { display: none !important; }

/* Product name: the logomark and the name in the logo colour (assets/logo-full.svg: #151521). */
.app-name { flex: none; display: flex; align-items: center; gap: 8px; padding-right: var(--s-gap-l);
  border-right: 1px solid var(--c-border); font-size: 21px; letter-spacing: -0.02em; font-weight: 800; color: #151521;
  line-height: 28px; }
.top-bar { justify-content: flex-start; gap: var(--s-gap-l); }

/* Loading: a line moves along the lower edge of the top bar while the server works on a
   request that takes more than 250 ms (assets/nav.js). */
.main-top { position: sticky; }
.busy-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; visibility: hidden; }
.busy-bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; border-radius: 2px;
  background: var(--c-primary); }
.shell.busy .busy-bar { visibility: visible; }
.shell.busy .busy-bar::after { animation: busy-move 1.1s ease-in-out infinite; }
@keyframes busy-move { from { transform: translateX(-100%); } to { transform: translateX(334%); } }
@media (prefers-reduced-motion: reduce) {
  .shell.busy .busy-bar::after { animation: none; width: 100%; opacity: 0.6; }
}

/* Schools card (components/stat_card.py schools): one slim row above Program goals. */
.schools-card { padding: 16px 24px; margin-bottom: var(--s-gap-xl); display: grid; align-items: center;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.7fr); gap: var(--s-gap-l); }
.school-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.school-name { display: flex; align-items: center; gap: 6px; height: 24px; font-size: 14px; line-height: 20px; font-weight: 600;
  color: var(--c-text-strong); }
.school-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.school-n { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; color: var(--c-text-strong); }
.school-split { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.school-togo { font-size: 14px; line-height: 20px; color: var(--c-text-strong); }
.school-bar { height: 12px; }
.school-keys { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; line-height: 20px; color: var(--c-text); }
.school-keys strong { color: var(--c-text-strong); }
.school-key { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@media (max-width: 1100px) { .schools-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .school-split { grid-column: 1 / -1; } }

/* Activation bands (pages/reports.py BANDS): Thunderblocks fills, each with an outline one
   step darker. Poor orange, Average light indigo, Good indigo, Other light gray. */
:root { --band-poor: #F97B4F; --band-poor-line: #C8481A; --band-avg: #BFCAFF; --band-avg-line: #8DA2FF;
  --band-good: #4340D0; --band-good-line: #363498; --band-other: #EDEDEE; --band-other-line: #A0A1A4; }
/* A real 1px border (not an inset shadow): an inset shadow on round corners lets the fill show
   at the edge, so the corners look thicker. The fill stops inside the border. */
.band-poor, .band-avg, .band-good, .band-other { border: 1px solid; background-clip: padding-box; box-sizing: border-box; }
.band-poor { background-color: var(--band-poor); border-color: var(--band-poor-line); color: #21242c; }
.band-avg { background-color: var(--band-avg); border-color: var(--band-avg-line); color: #21242c; }
.band-good { background-color: var(--band-good); border-color: var(--band-good-line); color: #ffffff; }
.band-other { background-color: var(--band-other); border-color: var(--band-other-line); color: #21242c; }
.act-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-gap-l); flex-wrap: wrap; }
.act-head h2 { margin: 0; }
.band-legend { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 12px; align-items: end; }
.band-item { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 16px; color: var(--c-text);
  white-space: nowrap; }
.band-item strong { color: var(--c-text-strong); }
.band-key { display: block; height: 10px; border-radius: 3px; }
/* Summary view */
.sum-list { padding: 0; overflow: visible; }
.sum-row { display: grid; grid-template-columns: 40px minmax(160px, 280px) minmax(0, 1fr) 110px; gap: var(--s-gap-l);
  align-items: center; padding: 12px 20px; border-top: 1px solid #ededee; }
.sum-row:hover { background: var(--c-ground); }
.sum-head { border-top: 0; padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--c-text); background: var(--c-ground);
  border-radius: 8px 8px 0 0; }
.sum-head > :last-child, .sum-good { text-align: right; }
.sum-rank { width: 32px; height: 32px; border-radius: 16px; background: #f6f6f6; display: inline-flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 700; color: var(--c-text); }
.sum-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sum-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-good { font-size: 14px; color: var(--c-text); }
.sum-good strong { color: var(--c-text-strong); }
.band-bar { display: flex; gap: 3px; min-width: 0; }
.band-seg { position: relative; min-width: 4px; height: 28px; border-radius: 3px; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; }
.band-seg:hover { box-shadow: inset 0 0 0 2px var(--c-text-strong); }
/* Tooltip of a bar part (Wonder Blocks style: white bubble, subtle border). */
.band-seg::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  z-index: 20; padding: 8px 12px; border-radius: 8px; background: #ffffff; color: var(--c-text-strong);
  border: 1px solid var(--c-border); box-shadow: 0 8px 16px rgba(33, 36, 44, 0.12); font-size: 14px; font-weight: 500;
  white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 100ms ease-out; }
.band-seg:hover::after { opacity: 1; visibility: visible; transition-delay: 300ms; }
@media (max-width: 900px) { .sum-row { grid-template-columns: 32px minmax(0, 1fr) 80px; }
  .band-bar { grid-column: 2 / -1; grid-row: 2; }
  .sum-head { display: none; } }
/* Activation table: the rate as a pill in the band colour (data_table.rate_pill_col). */
.rate-pill { display: inline-flex; justify-content: center; min-width: 52px; padding: 1px 7px; border-radius: 12px;
  font-size: 14px; line-height: 18px; font-weight: 700; font-variant-numeric: tabular-nums; box-sizing: border-box; }
.rate-none, .ka-grid .cell-muted { color: var(--c-text-subtle); }

/* Match the design board (canvas "Current design") in colour and layout. The font sizes are
   the Thunderblocks type scale in theme/tokens.py. */
.eyebrow { color: var(--c-text); }
.label, .ctl-lbl { color: var(--c-text-strong); }
.count-line { font-weight: 500; color: var(--c-text); }
/* Breadcrumb: the earlier levels are grey; the current node is bold. */
.scope-path a { color: var(--c-text-subtle); }
/* Selected item of a segmented control: primary text, as the cadence control. */
.mantine-SegmentedControl-control[data-active] .mantine-SegmentedControl-label { color: var(--c-primary); }
/* Grids: a header group is centered over its columns. */
.ka-grid .ag-header-group-cell-label { justify-content: center; }
.ka-grid .ag-header-group-text { font-size: 12px; }
/* Select: a down chevron, not the up-and-down selector icon. */
.mantine-Select-section[data-position="right"] > svg { display: none; }
.mantine-Select-section[data-position="right"]::after { content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none; color: var(--c-text-strong); }
/* Activation controls on one line at 1440 px, as on the board. */
#sec-activation .grow { flex: 1 1 160px; }
/* Rankings card: the title and the Rank by / More columns fields on one line. */
.rank-card > .section-head { align-items: center; }
.rank-controls { align-items: center; gap: var(--s-gap-xl); }
.dd-label { white-space: nowrap; }
/* The rankings table is taller than the map (about 10 rows); the map sits in the middle of its column. */
.rank-layout > .table-box > div { min-height: 500px; }
.rank-layout > .map-box { justify-content: center; }
/* Map legend for a KPI with no rating: the title on its own line, the shades below it. */
.legend .legend-title { flex-basis: 100%; }
/* Grids: a little less space at the sides of each cell, so more columns fit. */
.ag-theme-quartz.ka-grid { --ag-cell-horizontal-padding: 12px; }
/* Monthly goal card: the first KPI takes its own width, so "Very Active Learners" fits on one line. */
.kpi-pair { grid-template-columns: auto minmax(0, 1fr); }
/* Program goals notes: the rate base and the key for the change badges. */
.goal-notes { display: flex; align-items: center; gap: var(--s-gap-l); flex-wrap: wrap; }
.change-note { display: inline-flex; align-items: center; gap: 6px; }
.change-keys { display: inline-flex; gap: 4px; }
.change-key { font-size: 16px; line-height: 20px; font-weight: 800; padding: 1px 8px; }
/* The same pale fills as the card badges, with a strong outline, so the key stands out. */
.change-key.b-good { border-color: var(--c-good-text); }
.change-key.b-avg { border-color: var(--c-avg-text); }
/* Rating legend: the "Other" label has a small info button with its tooltip. */
.band-other-label { display: inline-flex; align-items: center; gap: 2px; }
.band-other-label .info-btn { width: 16px; height: 16px; margin: -2px 0; }
.band-other-label .info-icon { width: 13px; height: 13px; font-size: 9px; line-height: 10px; }
/* Rating legend: each item stays on one line and the legend does not shrink; on a narrow
   screen it moves below the title (.act-head wraps). */
.band-legend { flex: none; max-width: 100%; }
.band-item, .band-other-label { white-space: nowrap; }
.band-other-label { flex-wrap: nowrap; }
