:root {
  color-scheme: light;
  --red: #c70f30;
  --red-strong: #d20f36;
  --red-soft: #fff1f3;
  --purple: #722ed1;
  --blue: #2468f2;
  --cyan: #20c6c9;
  --yellow: #f6bd16;
  --green: #52c41a;
  --text: rgba(0, 0, 0, .88);
  --muted: #8c8c8c;
  --line: #f0f0f0;
  --canvas: #f5f5f5;
  --card: #f7f8fa;
  font-family: "Alibaba PuHuiTi 3.0", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; overflow-x: hidden; background: var(--canvas); color: var(--text); font-size: 14px; font-weight: 400; line-height: 1.45; }
body.modal-open { overflow: hidden; }
button, select { font: inherit; }
button { cursor: pointer; }
.ui-icon { width: 16px; height: 16px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 180px;
  background: #fff;
  border-right: 1px solid var(--line);
}
.brand {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
}
.brand img { width: 100%; max-width: 160px; max-height: 56px; display: block; object-fit: contain; }
.side-nav { padding: 8px; }
.nav-item {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #333;
  text-align: left;
}
.nav-item + .nav-item { margin-top: 4px; }
.nav-item.active { background: #fcecef; color: var(--red); font-weight: 600; }
.nav-icon { width: 17px; height: 17px; }

.workspace { min-width: 0; margin-left: 180px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
}
.topbar strong { font-size: 16px; font-weight: 600; }
.account-switcher { position: relative; }
.account-button { height: 32px; display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #4a4a4a; }
.account-button .ui-icon:last-child { width: 14px; height: 14px; }
.account-menu { position: absolute; z-index: 40; top: 38px; right: 0; width: 224px; display: grid; gap: 2px; padding: 4px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 6px; background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.account-menu button { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; color: #595959; text-align: left; }
.account-menu button:hover, .account-menu button:focus { background: #fafafa; outline: none; }
.account-menu button.active { background: #fff1f3; color: var(--red); font-weight: 600; }
.main { min-width: 0; padding: 16px; }
.content { width: 100%; min-width: 0; }
.surface { background: #fff; border-radius: 8px; }

.briefing { margin-bottom: 16px; padding: 24px; }
.briefing-title-row { display: flex; align-items: center; justify-content: space-between; gap: 60px; }
.briefing-title-row > div { min-width: 0; }
.briefing h1 { margin: 0; font-size: 20px; font-weight: 600; line-height: 28px; }
.briefing-title-row p { margin: 0; max-width: 760px; font-size: 14px; line-height: 20px; }
.school-chip { flex: 0 0 auto; max-width: 240px; overflow: hidden; padding: 10px 16px; border-radius: 820px; background: #f9f0ff; color: var(--purple); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.briefing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.brief-card { min-height: 98px; padding: 10px 16px; border: 1px solid; border-radius: 8px; }
.brief-card h3 { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 14px; line-height: 22px; }
.brief-card ul { margin: 0; padding-left: 21px; color: var(--muted); line-height: 20px; }
.brief-card.issue { border-color: var(--red); background: #fff8f8; }
.brief-card.issue h3 { color: var(--red); }
.brief-card.suggestion { border-color: var(--yellow); background: #fff9e8; }
.brief-card.suggestion h3 { color: var(--yellow); }
.brief-card.accountability { border-color: var(--green); background: #f9fff6; }
.brief-card.accountability h3 { color: var(--green); }
.recommendation { display: flex; flex-direction: column; margin-top: 10px; line-height: 20px; }
.recommendation strong { color: var(--purple); line-height: 28px; }

.primary-tabs { min-height: 52px; display: flex; align-items: end; gap: 28px; margin-bottom: 16px; padding: 0 16px; }
.primary-tabs button { height: 52px; flex: 0 0 auto; padding: 0 2px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #555; font-weight: 600; white-space: nowrap; }
.primary-tabs button.active { border-bottom-color: var(--red); color: var(--red); }
.slt-primary-tabs { align-items: stretch; gap: 0; padding: 0 16px; background: #fafafa; }
.slt-primary-tabs > button { padding: 0 16px; border-bottom-width: 2px; border-radius: 0; font-size: 14px; font-weight: 400; }
.slt-primary-tabs > button.active { background: #fff; font-weight: 700; }
.slt-primary-tabs > .data-upload-button { height: 52px; margin-left: auto; padding: 0 8px; border-bottom: 0; color: var(--red); font-size: 12px; font-weight: 400; }
.slt-primary-tabs > .data-upload-button:hover, .slt-primary-tabs > .data-upload-button:focus { background: #fff1f3; outline: none; }
.data-upload-input { display: none; }

.upload-modal-layer { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .38); }
.upload-modal { width: min(510px, 100%); overflow: hidden; padding: 32px 32px 24px; border-radius: 8px; background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .08), 0 3px 6px -4px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05); animation: modal-in .18s ease both; }
.upload-modal-header { display: flex; align-items: center; gap: 10px; }
.upload-modal-header h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; line-height: 24px; }
.upload-modal-close { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--text); }
.upload-modal-close .ui-icon { width: 20px; height: 20px; }
.upload-modal-divider { height: 1px; margin: 10px 0; background: rgba(0, 0, 0, .06); }
.upload-modal-body { display: grid; gap: 16px; }
.upload-form-row { min-width: 0; display: grid; grid-template-columns: 87px minmax(0, 1fr); align-items: center; margin: 0; padding: 0; border: 0; }
.upload-form-row > label, .upload-type-label, .upload-field-label { color: #000; font-size: 14px; line-height: 22px; }
.upload-month-control { position: relative; display: block; }
.upload-month-control input { width: 100%; height: 32px; padding: 0 36px 0 12px; border: 1px solid rgba(0, 0, 0, .15); border-radius: 6px; background: #fff; color: transparent; font: inherit; }
.upload-month-control input::-webkit-datetime-edit { color: transparent; }
.upload-month-control input:focus { border-color: #2f80ff; outline: 2px solid rgba(47, 128, 255, .12); }
.upload-month-display { position: absolute; inset: 0 36px 0 12px; display: flex; align-items: center; overflow: hidden; color: rgba(0, 0, 0, .25); text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.upload-month-control.has-value .upload-month-display { color: var(--text); }
.upload-month-control .ui-icon { position: absolute; top: 8px; right: 12px; width: 16px; height: 16px; color: #8c8c8c; pointer-events: none; }
.upload-month-control input::-webkit-calendar-picker-indicator { position: absolute; right: 8px; width: 24px; height: 24px; opacity: 0; cursor: pointer; }
.upload-radio-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.upload-radio-group label { min-width: 0; display: flex; align-items: center; gap: 8px; line-height: 22px; white-space: nowrap; }
.upload-radio-group input { width: 16px; height: 16px; margin: 0; accent-color: #1677ff; }
.upload-file-row { align-items: start; }
.upload-field-label { padding-top: 3px; }
.upload-dropzone { width: 100%; height: 155px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 18px 16px; border: 2px dashed rgba(0, 0, 0, .08); border-radius: 8px; background: #fff; color: var(--text); text-align: center; transition: border-color .18s ease, background-color .18s ease; }
.upload-dropzone:hover, .upload-dropzone:focus-visible, .upload-dropzone.dragging { border-color: #2f80ff; background: #f7faff; outline: none; }
.upload-dropzone.has-file { border-color: rgba(47, 128, 255, .45); }
.upload-dropzone .ui-icon { width: 64px; height: 64px; color: #1677ff; stroke-width: 1.7; }
.upload-dropzone strong { max-width: 100%; overflow: hidden; font-size: 16px; font-weight: 600; line-height: 24px; text-overflow: ellipsis; white-space: nowrap; }
.upload-dropzone small { color: rgba(0, 0, 0, .25); font-size: 12px; line-height: 20px; }
.upload-file-input { display: none; }
.upload-error { min-height: 18px; margin: -10px 0 0 87px; color: #ff4d4f; font-size: 12px; line-height: 18px; }
.upload-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: -2px; }
.upload-modal-actions button { height: 32px; padding: 0 16px; border-radius: 8px; font-size: 14px; }
.upload-cancel { border: 1px solid rgba(0, 0, 0, .08); background: #fff; color: var(--text); }
.upload-confirm { border: 1px solid #2f80ff; background: #2f80ff; color: #fff; box-shadow: 0 2px 0 rgba(255, 255, 255, .04); }
.upload-modal-actions button:focus-visible, .upload-modal-close:focus-visible { outline: 2px solid rgba(47, 128, 255, .3); outline-offset: 2px; }

.top-level-empty { display: grid; gap: 16px; }
.empty-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty-panel { min-width: 0; padding: 24px; border-radius: 8px; background: #fff; }
.empty-panel h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 28px; }
.empty-panel > p { margin: 0; color: #878787; font-size: 12px; line-height: 20px; }
.empty-scorecard { min-height: 430px; display: grid; grid-template-rows: 231px 1fr; justify-items: center; }
.empty-ring { width: 210px; height: 210px; display: grid; place-items: center; align-self: center; border: 37px solid #f7ebed; border-radius: 50%; }
.empty-ring span { color: #878787; font-size: 12px; text-align: center; white-space: nowrap; }
.empty-progress-list { width: 100%; display: grid; align-content: start; gap: 10px; padding: 0 2px; }
.empty-progress-list > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; }
.empty-progress-list span { color: #8c8c8c; font-weight: 600; line-height: 24px; }
.empty-progress-list strong { font-size: 14px; font-weight: 600; }
.empty-progress-list i { height: 8px; grid-column: 1 / -1; border-radius: 999px; background: #f0f0f0; }
.empty-table-wrap { margin-top: 16px; overflow-x: auto; }
.empty-table { width: 100%; min-width: 430px; border-collapse: collapse; table-layout: fixed; }
.empty-table th { height: 38px; padding: 8px; background: rgba(0, 0, 0, .02); font-weight: 600; text-align: left; }
.empty-table th:first-child, .empty-table td:first-child { width: 50px; }
.empty-table th:last-child { width: 43%; }
.empty-table td { height: 40px; padding: 8px; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.empty-table tbody tr:last-child td { border-bottom: 0; }
.empty-panel-message { min-height: 222px; }
.empty-panel-message h2 { font-size: 16px; line-height: 24px; }
.empty-message { min-height: 145px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.empty-message .ui-icon { width: 64px; height: 64px; color: #1677ff; stroke-width: 1.8; }
.empty-message strong { font-size: 16px; font-weight: 600; }
.strategic-summary .empty-scorecard { min-height: 230px; grid-template-columns: minmax(250px, 1fr) minmax(320px, 1fr); grid-template-rows: 1fr; align-items: center; }
.strategic-summary .empty-progress-list { max-width: 470px; }
.slt-empty-view { display: grid; gap: 16px; }
.slt-reminders { min-height: 382px; }
.slt-reminders h2, .slt-compact-empty h2 { font-size: 16px; line-height: 24px; }
.slt-empty-message { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slt-empty-message .ui-icon { width: 64px; height: 64px; color: #1677ff; stroke-width: 1.8; }
.slt-empty-message strong { margin-top: 8px; font-size: 16px; font-weight: 600; line-height: 24px; }
.slt-empty-message small { color: rgba(0, 0, 0, .25); font-size: 12px; line-height: 20px; }
.slt-compact-empty { min-height: 176px; }
.slt-compact-empty .slt-empty-message { min-height: 112px; }

.group-dashboard { overflow: hidden; }
.section-head { height: 66px; display: flex; flex-direction: column; justify-content: center; padding: 0 10px; }
.section-head h2, .content-section > h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: 24px; }
.section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.kpi-grid { display: grid; gap: 10px; }
.kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 10px 10px; }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.group-dashboard > .kpi-grid.three { padding: 0 10px 10px; }
.kpi-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-card { min-width: 0; min-height: 85px; display: flex; flex-direction: column; justify-content: center; padding: 12px 10px; border-radius: 6px; background: var(--card); }
.kpi-card > span { min-height: 18px; overflow: hidden; color: #595959; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.kpi-card > strong { overflow: hidden; margin-top: 3px; font-size: 20px; font-weight: 600; line-height: 25px; text-overflow: ellipsis; white-space: nowrap; }
.kpi-card > small { margin-top: 4px; font-size: 11px; }
.kpi-card > small.positive { color: var(--green); }
.kpi-card > small.negative { color: #ff4d4f; }

.content-section { padding: 16px 10px; background: #fff; border-top: 10px solid var(--canvas); }
.content-section > h2 { margin-bottom: 14px; }
.school-operations { min-height: 620px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.data-table th { height: 38px; padding: 9px 12px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600; text-align: left; }
.data-table th:first-child { border-radius: 4px 0 0 0; }
.data-table th:last-child { border-radius: 0 4px 0 0; }
.data-table td { height: 45px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: #555; font-size: 12px; overflow-wrap: anywhere; }
.data-table tbody tr:nth-child(even) td { background: #fafafa; }
.data-table tbody tr:hover td { background: #fff7f8; }
.cost-table { min-width: 900px; }
.cost-table th:first-child { width: 33%; }
.cost-table th:nth-child(2), .cost-table th:nth-child(3), .cost-table th:nth-child(4) { width: 15%; }
.cost-table th:nth-child(5) { width: 10%; }
.cost-table th:nth-child(6) { width: 12%; }
.data-table.cost-table .cost-group-row td { height: 44px; background: #fff; color: var(--text); font-weight: 600; }
.data-table.cost-table .cost-detail-row td { height: 38px; border-bottom: 0; background: #f5f7fc; }
.data-table.cost-table .cost-detail-row td:first-child { padding-left: 42px; color: #595959; }
.data-table.cost-table .cost-total-row td { background: #eef1f8; color: var(--text); font-weight: 700; }
.cost-toggle { width: 100%; display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: inherit; font-weight: inherit; text-align: left; }
.cost-toggle .ui-icon { width: 15px; height: 15px; transition: transform .18s ease; }
.cost-toggle[aria-expanded="true"] .ui-icon { transform: rotate(90deg); }
.cost-toggle:focus-visible { outline: 2px solid rgba(199, 15, 48, .35); outline-offset: 3px; }
.school-table { min-width: 920px; }
.school-link { border: 0; background: transparent; color: #1677ff; padding: 0; font-weight: 600; text-align: left; }
.status { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.status.healthy { background: #f6ffed; color: #389e0d; }
.status.watch { background: #fffbe6; color: #d48806; }
.status.risk { background: #fff1f0; color: #cf1322; }
.pagination { display: flex; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.pagination button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; }
.pagination button.active { border-color: var(--red); background: var(--red); color: #fff; }
.pagination button:disabled { color: #bbb; }

.breadcrumb { height: 60px; min-width: 0; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 0 16px; }
.breadcrumb button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: #777; }
.breadcrumb > span { color: #aaa; }
.breadcrumb strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.school-dashboard { overflow: hidden; }
.dashboard-toolbar { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 10px; }
.segmented { display: flex; align-items: center; gap: 2px; border-radius: 8px; background: #fafafa; }
.segmented button { height: 32px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: #555; font-size: 13px; }
.segmented button.active { background: var(--red); color: #fff; font-weight: 600; }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap > .ui-icon:first-child { position: absolute; left: 10px; z-index: 1; color: #8c8c8c; pointer-events: none; }
.select-wrap > .ui-icon:last-child { position: absolute; right: 9px; z-index: 1; width: 14px; color: #8c8c8c; pointer-events: none; }
.select-wrap select { width: 172px; height: 32px; appearance: none; padding: 0 32px; border: 1px solid rgba(0, 0, 0, .06); border-radius: 8px; background: #fff; color: #555; font-size: 13px; }

.ai-read { border-top: 1px solid #fde8ec; border-bottom: 1px solid #fde8ec; background: linear-gradient(90deg, #fff1f3, #fff); }
.ai-read-head { min-height: 66px; display: flex; align-items: center; gap: 12px; padding: 10px; }
.ai-read-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: #ffe7eb; color: var(--red); }
.ai-read-head > div { min-width: 0; flex: 1; }
.ai-read-head strong { font-weight: 600; }
.ai-read-head p { margin: 2px 0 0; color: #aaa; font-size: 12px; }
.ai-read-head > button { height: 30px; padding: 0 12px; border: 1px solid var(--red); border-radius: 8px; background: #fff; color: var(--red); font-size: 12px; }
.ai-read-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 12px 24px 18px 66px; border-top: 1px solid #f4dde2; }
.ai-read-body h4 { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--red); font-size: 13px; }
.ai-read-body > div:last-child h4 { color: #d99b00; }
.ai-read-body ul { margin: 4px 0 0; padding-left: 20px; color: #777; font-size: 12px; line-height: 20px; }

.kpi-section { padding: 10px; }
.chart-section { padding: 10px; }
.chart-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.chart-card { min-width: 0; min-height: 360px; padding: 20px 16px; border: 1px solid #ededed; border-radius: 6px; background: #fff; }
.chart-card.span-4 { grid-column: span 4; }
.chart-card.span-5 { grid-column: span 5; }
.chart-card.span-6 { grid-column: span 6; }
.chart-card.span-7 { grid-column: span 7; }
.chart-card.span-8 { grid-column: span 8; }
.chart-card.span-12 { grid-column: span 12; }
.chart-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.chart-title h3 { margin: 0; font-size: 14px; font-weight: 600; }
.chart-title span { color: var(--muted); font-size: 11px; }
.chart-visual { min-width: 0; }
.trend-chart { min-height: 270px; }
.trend-svg-wrap { position: relative; width: 100%; height: 210px; }
.trend-chart svg { width: 100%; height: 100%; overflow: visible; }
.trend-y-axis { position: absolute; z-index: 2; top: 24px; bottom: 28px; left: 0; width: 9.36%; display: flex; flex-direction: column; justify-content: space-between; padding-right: 6px; color: #86909c; font-size: 9px; text-align: right; pointer-events: none; }
.trend-y-axis.dual-right { right: 0; left: auto; width: 6.81%; padding: 0 0 0 6px; text-align: left; }
.chart-legend { min-height: 24px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-bottom: 4px; color: #4e5969; font-size: 10px; }
.chart-legend.reason-legend { flex-wrap: wrap; justify-content: flex-start; gap: 5px 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.chart-legend .chart-unit { margin-right: auto; color: #86909c; }
.chart-legend i { width: 8px; height: 8px; display: inline-block; background: var(--legend-color); }
.chart-legend i.line { width: 13px; height: 2px; }
.grid-lines line { stroke: #e8e8e8; stroke-dasharray: 3 4; }
.grid-lines text { fill: #86909c; font-size: 9px; }
.grid-lines text.right-axis { text-anchor: end; }
.trend-chart .area { opacity: 0; animation: fade .7s .55s ease forwards; }
.trend-chart .line { fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.1s .2s ease forwards; }
.line-marker { stroke-width: 8; stroke-linecap: round; }
.svg-bar { stroke-width: 10; transform-origin: center bottom; animation: rise .75s ease both; }
.chart-hit-zone { fill: transparent; cursor: crosshair; transition: fill .16s ease; }
.chart-hit-zone:hover, .chart-hit-zone:focus { fill: rgba(78, 89, 105, .06); outline: none; }
.axis-labels { position: relative; height: 18px; padding: 0; color: #86909c; font-size: 9px; }
.axis-labels span { position: absolute; top: 0; width: max-content; max-width: 72px; min-width: 0; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; transform: translateX(-50%); }
.bar-chart-shell { min-height: 224px; display: grid; grid-template-columns: 38px minmax(0, 1fr); }
.bar-y-axis { height: 204px; display: flex; flex-direction: column; justify-content: space-between; padding: 10px 4px 19px 0; color: #86909c; font-size: 9px; text-align: right; }
.grouped-bars { height: 215px; display: flex; align-items: end; justify-content: space-around; gap: 12px; padding: 10px 12px 0; border-bottom: 1px solid #ddd; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 44px, #edf0f3 45px); }
.bar-group { min-width: 0; flex: 1; max-width: 90px; border-radius: 6px; text-align: center; }
.bar-group:hover, .bar-group:focus { background: rgba(78, 89, 105, .05); outline: none; }
.bar-pair { height: 180px; display: flex; align-items: end; justify-content: center; gap: 4px; }
.bar-pair i { width: 28%; min-width: 8px; max-width: 20px; display: block; background: var(--blue); }
.bar-pair i:last-child { background: var(--cyan); }
.single-series .bar-pair i { width: 20px; background: var(--blue); }
.bar-group > span { display: block; margin-top: 8px; overflow: hidden; color: #777; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stacked-bar { width: 32px; max-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; margin: auto; }
.stacked-bar i { min-height: 1px; display: block; }
.donut-layout { min-height: 235px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-chart { width: 164px; height: 164px; overflow: visible; }
.donut-segment { fill: none; stroke-width: 28; transform: rotate(-90deg); transform-origin: center; cursor: pointer; transition: stroke-width .16s ease, filter .16s ease; }
.donut-segment.blue { stroke: var(--blue); }
.donut-segment.cyan { stroke: var(--cyan); }
.donut-segment:hover, .donut-segment:focus { stroke-width: 32; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .14)); outline: none; }
.legend { max-width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 14px; color: #666; font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 1px; }
.metric-list { display: grid; }
.metric-list > div { min-height: 31px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); border-radius: 4px; font-size: 10px; }
.metric-list > div:hover, .metric-list > div:focus { background: #f7f9fc; outline: none; }
.metric-list b { font-weight: 500; }
.metric-list em { padding: 2px 5px; border-radius: 3px; background: #e6f4ff; color: #1677ff; font-size: 9px; font-style: normal; white-space: nowrap; }
.metric-list em.warning { background: #fffbe6; color: #d48806; }
.metric-list em.empty { background: #f2f3f5; color: #86909c; }
.no-chart-data { min-height: 245px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 6px; background: #fafafa; color: #878787; }
.no-chart-data:hover, .no-chart-data:focus { background: #f5f7fa; outline: none; }
.no-chart-data img { display: block; width: min(184px, 62%); height: auto; aspect-ratio: 184 / 114; object-fit: contain; }
.empty-state-label { min-height: 32px; display: grid; place-items: center; padding: 5px 12px; font-size: 14px; font-weight: 400; line-height: 22px; }
.summary-strip { padding: 10px; }
.summary-strip .kpi-card { min-height: 85px; }
.progress-chart { display: grid; gap: 12px; padding: 12px 10px 18px; }
.progress-chart > div { display: grid; grid-template-columns: minmax(150px, 260px) 1fr; align-items: center; gap: 12px; border-radius: 6px; }
.progress-chart > div:hover, .progress-chart > div:focus { background: #f7f9fc; outline: none; }
.progress-chart span { color: #777; font-size: 11px; text-align: right; }
.progress-chart i { position: relative; height: 18px; display: block; background: #eef1f5; }
.progress-chart b { height: 100%; display: block; background: var(--blue); }
.progress-chart i em { position: absolute; inset: 0; display: grid; place-items: center; color: #86909c; font-size: 10px; font-style: normal; }
.progress-chart i.empty { display: grid; place-items: center; color: #86909c; }
.progress-chart i.empty em { font-style: normal; }
.level-head { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.level-head h3 { margin: 0; font-size: 13px; }
.period-tabs { display: flex; gap: 2px; border-radius: 8px; background: #fafafa; }
.period-tabs button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #666; font-size: 11px; }
.period-tabs button.active { background: var(--red); color: #fff; }
.growth-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.growth-grid article { min-height: 78px; display: flex; flex-direction: column; justify-content: center; padding: 10px; border-radius: 6px; background: var(--card); transition: background-color .18s ease; }
.growth-grid span, .growth-grid small { color: #999; font-size: 10px; }
.growth-grid strong { color: var(--green); font-size: 15px; }
.section-description { margin: -10px 0 14px; color: #999; font-size: 11px; }
.source-note { margin: 0; padding: 12px 10px 18px; border-top: 10px solid var(--canvas); color: #999; font-size: 11px; }
.loading { min-height: 100vh; display: grid; place-items: center; color: #777; }

.chart-tooltip { position: fixed; z-index: 100; min-width: 160px; max-width: min(280px, calc(100vw - 16px)); padding: 12px 14px; border: 1px solid #f2d9de; border-radius: 6px; background: rgba(255, 255, 255, .98); box-shadow: 0 6px 20px rgba(0, 0, 0, .14); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .14s ease, transform .14s ease; }
.chart-tooltip.visible { opacity: 1; transform: translateY(0); }
.chart-tooltip-title { margin-bottom: 7px; color: #6b5a5d; font-size: 12px; line-height: 18px; }
.chart-tooltip-content { display: grid; gap: 5px; }
.chart-tooltip-line { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.chart-tooltip-line span { min-width: 0; flex: 1; display: inline-flex; align-items: center; gap: 6px; color: #6b6b6b; font-size: 11px; }
.chart-tooltip-line span:empty { display: none; }
.chart-tooltip-line i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 2px; }
.chart-tooltip-line strong { color: #241f20; font-size: 16px; font-weight: 600; line-height: 20px; }
.tooltip-target { cursor: default; transition: background-color .16s ease; }

.brief-card, .kpi-card, .chart-card, .content-section, .ai-read-body { animation: enter .42s ease both; }
.kpi-card:nth-child(2), .chart-card:nth-child(2), .brief-card:nth-child(2) { animation-delay: 50ms; }
.kpi-card:nth-child(3), .chart-card:nth-child(3), .brief-card:nth-child(3) { animation-delay: 90ms; }
.bar-pair i, .stacked-bar { transform-origin: center bottom; animation: rise .75s ease both; }
.donut-chart { animation: donut-in .8s ease both; }
.nav-item, .segmented button, .ai-read-head button, .primary-tabs button, .school-link, .period-tabs button { transition: color .18s ease, background-color .18s ease, border-color .18s ease; }

@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { from { transform: scaleY(.05); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }
@keyframes donut-in { from { opacity: .2; transform: rotate(-60deg) scale(.8); } to { opacity: 1; transform: rotate(0) scale(1); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1120px) and (min-width: 761px) {
  .sidebar { width: 72px; }
  .workspace { margin-left: 72px; }
  .brand { padding: 5px 4px; }
  .brand img { max-width: 64px; }
  .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
}

@media (max-width: 960px) {
  .kpi-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .school-operations { min-height: 0; }
}

@media (max-width: 820px) {
  .briefing-grid, .ai-read-body { grid-template-columns: 1fr; }
  .briefing-title-row { gap: 20px; align-items: flex-start; }
  .chart-card.span-4, .chart-card.span-5, .chart-card.span-6, .chart-card.span-7, .chart-card.span-8, .chart-card.span-12 { grid-column: span 12; }
  .chart-card { min-height: 360px; }
  .empty-two-column { grid-template-columns: 1fr; }
  .strategic-summary .empty-scorecard { grid-template-columns: 1fr; grid-template-rows: 231px auto; }
}

@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { height: 54px; justify-content: flex-start; padding: 3px 16px; }
  .brand img { width: auto; max-width: 142px; max-height: 48px; }
  .side-nav { display: flex; gap: 4px; padding: 6px 12px 10px; overflow-x: auto; }
  .nav-item { width: auto; min-width: max-content; height: 34px; padding: 0 10px; }
  .nav-item + .nav-item { margin-top: 0; }
  .workspace { margin-left: 0; }
  .topbar { height: 54px; padding: 0 16px; }
  .main { padding: 10px; }
  .briefing { margin-bottom: 10px; padding: 16px 14px; }
  .briefing-title-row { display: block; }
  .school-chip { display: inline-flex; margin-top: 10px; }
  .brief-card { min-height: 0; }
  .primary-tabs { margin-bottom: 10px; overflow-x: auto; }
  .top-level-empty { gap: 10px; }
  .empty-two-column { gap: 10px; }
  .empty-panel { padding: 18px 16px; }
  .empty-panel h2 { font-size: 18px; }
  .empty-scorecard { min-height: 410px; }
  .empty-panel-message { min-height: 210px; }
  .empty-table { min-width: 0; }
  .empty-table th { height: 48px; font-size: 12px; line-height: 16px; white-space: normal; }
  .empty-table th:first-child, .empty-table td:first-child { width: 48px; }
  .empty-table th:last-child { width: 46%; }
  .breadcrumb { height: 48px; margin-bottom: 10px; }
  .breadcrumb strong { font-size: 0; }
  .breadcrumb strong::after { content: attr(data-short); font-size: 13px; }
  .dashboard-toolbar { height: auto; align-items: stretch; flex-direction: column; padding: 10px; }
  .segmented { display: grid; grid-template-columns: 1fr 1fr; }
  .select-wrap select { width: 100%; }
  .ai-read-head { align-items: flex-start; }
  .ai-read-body { padding-left: 24px; }
  .kpi-grid.five, .kpi-grid.six, .kpi-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.two { grid-template-columns: 1fr; }
  .growth-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-legend { flex-wrap: wrap; justify-content: flex-start; gap: 5px 10px; }
  .chart-legend .chart-unit { width: 100%; margin-right: 0; }
  .progress-chart > div { grid-template-columns: 120px 1fr; }
  .data-table { min-width: 760px; }
}

@media (max-width: 600px) {
  .account-button { width: 32px; padding: 0; justify-content: center; }
  .account-button span, .account-button .ui-icon:last-child { display: none; }
  .account-menu { width: min(224px, calc(100vw - 32px)); }
  .upload-modal { max-height: calc(100vh - 24px); overflow-y: auto; padding: 24px 20px 20px; }
  .upload-form-row { grid-template-columns: 1fr; gap: 6px; }
  .upload-error { margin-left: 0; }
}

@media (max-width: 430px) {
  .briefing h1 { font-size: 18px; }
  .kpi-grid.five, .kpi-grid.six, .kpi-grid.three { grid-template-columns: 1fr; }
  .growth-grid { grid-template-columns: 1fr; }
  .recommendation span { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
