.school-native-workspace { --school-ink: #203936; --school-line: #d8e3df; --school-soft: #f0f5f2; }
.school-module-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--school-line, #d8e3df); padding-bottom: 8px; }
.school-module-tabs > button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #536560; padding: 10px 4px; font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; min-height: 42px; }
.school-module-tabs > button[aria-current="page"] { color: #146c50; border-bottom-color: #178461; }
.school-module-tabs > button:hover { color: #146c50; background: #eef5f1; }
.school-module-tabs svg { width: 17px; height: 17px; flex-shrink: 0; }
.school-class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 18px; }
.school-class-item { min-width: 0; border: 1px solid #d9e4df; border-top: 3px solid #228562; border-radius: 6px; background: #fff; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.school-class-item:nth-child(3n+2) { border-top-color: #2595b2; }
.school-class-item:nth-child(3n) { border-top-color: #d09b25; }
.school-class-item header { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.school-class-item header svg { width: 23px; height: 23px; color: #62827a; }
.school-class-item h3 { font-size: 18px; line-height: 1.3; color: #203936; margin: 0; overflow-wrap: anywhere; }
.school-class-item p { margin: 4px 0 0; font-size: 13px; color: #64766e; line-height: 1.65; }
.school-class-total { display: flex; align-items: baseline; gap: 10px; }
.school-class-total strong { font-size: 32px; font-weight: 700; line-height: 1.2; color: #203936; }
.school-class-total span { font-size: 13px; color: #687b72; }
.school-class-item footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.school-section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.school-section-toolbar h3, .school-release-list h3 { margin: 0; font-size: 17px; color: #203936; }
.school-release-list { padding: 20px 0; }
.school-release-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 0; border-bottom: 1px solid #d8e3df; }
.school-release-list small, .school-native-workspace td small, .school-register-grid small, .school-mark-grid small { display: block; margin-top: 4px; color: #6b7a75; font-size: 12px; line-height: 1.45; }
.school-register-grid, .school-mark-grid, .school-grading-editor { grid-column: 1 / -1; max-width: 100%; overflow-x: auto; }
.school-register-grid table, .school-mark-grid table { width: 100%; border-collapse: collapse; text-align: left; }
.school-register-grid th, .school-register-grid td, .school-mark-grid th, .school-mark-grid td { padding: 12px 8px; border-bottom: 1px solid #d8e3df; }
.school-register-grid th, .school-mark-grid th { font-size: 12px; color: #60746b; background: #f3f6f4; }
.school-register-grid input, .school-register-grid select, .school-mark-grid input { width: 100%; min-width: 80px; padding: 10px; border: 1px solid #cbdad1; border-radius: 4px; font: inherit; font-size: 14px; background: #fff; color: #203936; }
.school-mark-grid input[type="number"] { min-width: 85px; max-width: 120px; }
.school-mark-grid input[readonly] { background: #f2f5f3; border-color: transparent; }
.school-grade-row { display: grid; grid-template-columns: .7fr .8fr .8fr 1.5fr auto 32px; align-items: end; gap: 9px; padding: 12px 0; border-bottom: 1px solid #d8e3df; }
.school-grade-row label { min-width: 0; font-size: 12px; color: #54685e; }
.school-grade-row input:not([type="checkbox"]) { width: 100%; min-width: 0; padding: 8px; border: 1px solid #cbdad1; border-radius: 4px; margin-top: 5px; }
.school-grade-row button { width: 32px; height: 36px; padding: 6px; background: transparent; border: 0; color: #aa4653; cursor: pointer; }
.school-grade-row button svg { width: 18px; height: 18px; }
.school-grading-editor > button { margin-top: 12px; }
.school-native-workspace button:disabled { cursor: not-allowed; opacity: .45; }
.school-native-workspace :focus-visible, .school-register-grid :focus-visible, .school-mark-grid :focus-visible { outline: 2px solid #188361; outline-offset: 3px; }
.school-native-workspace .table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.school-teaching-analytics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; padding: 22px 0; border-top: 1px solid #d8e3df; border-bottom: 1px solid #d8e3df; }
.school-teaching-analytics section { min-width: 0; }
.school-teaching-analytics h3 { margin: 0 0 20px; font-size: 17px; color: #203936; }

/* School identity stays in the fixed shell, leaving the working view clear. */
body[data-workspace-template="school"] .workspace-label,
body[data-workspace-template="school"] .system-state { display: none; }
body[data-workspace-template="school"] .erp-topbar { height: var(--topbar-height); min-height: var(--topbar-height); background: var(--school-primary, var(--navy)); color: var(--school-on-brand, #fff); border-bottom: 3px solid var(--gold); gap: 16px; }
body[data-workspace-template="school"] .topbar-start { flex: 1; }
body[data-workspace-template="school"] .topbar-heading { min-width: 0; }
body[data-workspace-template="school"] .topbar-title-line { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
body[data-workspace-template="school"] .erp-topbar h1 { color: inherit; font-size: 22px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-workspace-template="school"] .page-kicker { color: inherit; opacity: .85; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.school-header-context { font-size: 11px; font-weight: 500; white-space: nowrap; }
body[data-workspace-template="school"] .topbar-actions { flex-shrink: 0; }
body[data-workspace-template="school"] .user-menu-button,
body[data-workspace-template="school"] .user-meta small { color: inherit; }
body[data-workspace-template="school"] .user-avatar { border: 1px solid currentColor; color: var(--school-on-brand, #fff); background-color: var(--school-primary, var(--navy)); flex-shrink: 0; }
body[data-workspace-template="school"] .user-menu { color: #16293d; }
body[data-workspace-template="school"] .user-menu .profile-menu-action,
body[data-workspace-template="school"] .icon-button { color: #16293d; }
body[data-workspace-template="school"] .erp-sidebar { color: var(--school-on-brand, #fff); background: var(--school-primary, var(--navy)); }
body[data-workspace-template="school"] .erp-sidebar .sidebar-close { color: var(--school-on-brand, #fff); }
body[data-workspace-template="school"] .workspace-brand-lockup img.workspace-logo-mark { border-radius: 0; }
body[data-workspace-template="school"] .erp-nav button,
body[data-workspace-template="school"] .workspace-brand-copy strong,
body[data-workspace-template="school"] .workspace-brand-copy small,
body[data-workspace-template="school"] .workspace-brand-monogram,
body[data-workspace-template="school"] .platform-credit,
body[data-workspace-template="school"] .platform-credit strong { color: inherit; }
body[data-workspace-template="school"] .erp-nav button.active { background: color-mix(in srgb, var(--school-on-brand) 12%, transparent); }
body[data-workspace-template="school"] .erp-nav button:hover { background: color-mix(in srgb, var(--school-on-brand) 8%, transparent); }
body[data-workspace-template="school"] .erp-nav { padding-top: 20px; }
body[data-workspace-template="school"] .erp-button.primary { color: var(--school-on-brand, #fff); background: var(--school-primary, var(--navy)); }
body[data-workspace-template="school"] .erp-button.secondary,
body[data-workspace-template="school"] .school-module-tabs > button[aria-current="page"] { color: var(--school-brand-ink, #16293d); }
body[data-workspace-template="school"] .school-module-tabs > button[aria-current="page"] { border-bottom-color: var(--navy); }
.school-search-toggle { display: none; }
.school-search-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 28px; background: #edf4f8; border-bottom: 1px solid #cfdee6; font-size: 13px; color: #263d50; }
.school-search-status .icon-button { width: 30px; height: 30px; }
[data-school-search-hidden] { display: none !important; }
.school-fee-chart { padding: 24px 20px; min-width: 0; }
.school-fee-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #566c7a; }
.school-fee-summary > strong { color: #16293d; font-size: 18px; }
.school-fee-track { display: flex; height: 34px; margin: 25px 0 20px; border: 1px solid var(--navy); border-radius: 4px; background: #fff; }
.school-fee-segment { position: relative; display: block; min-width: 0; cursor: default; }
.school-fee-segment.collected { background: var(--navy); }
.school-fee-segment:first-child { border-radius: 3px 0 0 3px; }
.school-fee-segment:last-child { border-radius: 0 3px 3px 0; }
.school-fee-segment:only-child { border-radius: 3px; }
.school-fee-segment:focus-visible { outline: 2px solid #1879a1; outline-offset: 4px; z-index: 2; }
.school-chart-tooltip { display: none; position: absolute; z-index: 5; bottom: calc(100% + 10px); left: 0; min-width: 180px; max-width: 230px; padding: 10px 14px; background: #152b3b; color: #fff; border-radius: 4px; box-shadow: 0 3px 12px #152b3b26; font-size: 12px; pointer-events: none; }
.school-chart-tooltip strong { display: block; color: #fff; margin: 3px 0; font-size: 15px; }
.school-chart-tooltip small { color: #d5e7f2; }
.school-fee-segment.outstanding .school-chart-tooltip { left: auto; right: 0; }
.school-fee-segment:hover .school-chart-tooltip,
.school-fee-segment:focus .school-chart-tooltip { display: block; }
.school-fee-legend { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.school-fee-legend > span { display: grid; grid-template-columns: 12px auto; align-items: center; gap: 5px 7px; font-size: 12px; color: #566c7a; }
.school-fee-legend i { width: 12px; height: 12px; border: 1px solid var(--navy); border-radius: 2px; }
.school-fee-legend i.collected { background: var(--navy); }
.school-fee-legend strong { grid-column: 2; font-size: 14px; color: #16293d; }
.school-branding-preview { display: flex; align-items: center; gap: 16px; min-height: 90px; padding: 16px; background: var(--preview-primary, #0a2342); color: var(--preview-on, #fff); border-bottom: 4px solid var(--preview-accent, #f2b705); }
.school-branding-preview img { width: 58px; height: 58px; object-fit: contain; background: #fff; border-radius: 4px; }
.school-branding-preview strong { color: inherit; overflow-wrap: anywhere; }
body[data-workspace-template="school"] .modal-field input[type="color"] { width: 56px; height: 40px; padding: 3px; border: 1px solid #cbdad1; border-radius: 4px; cursor: pointer; }
@media (max-width: 1280px) and (min-width: 681px) {
  body[data-workspace-template="school"] .user-meta { display: none; }
  body[data-workspace-template="school"] .user-menu-button { min-width: 60px; }
}
@media (max-width: 1120px) {
  body[data-workspace-template="school"] .school-search-toggle { display: inline-grid; }
  body[data-workspace-template="school"] .school-search-open .erp-search { display: block; position: absolute; right: 0; top: calc(100% + 20px); width: min(360px, calc(100vw - 28px)); padding: 10px; background: #fff; border: 1px solid #cfdee6; border-radius: 4px; box-shadow: 0 6px 20px #152b3b26; }
  body[data-workspace-template="school"] .school-search-open .erp-search svg { left: 21px; }
  body[data-workspace-template="school"] .school-search-open ~ .school-search-status { margin-top: 64px; }
}
@media (max-width: 680px) {
  body[data-workspace-template="school"] .erp-topbar { padding: 8px 12px; gap: 8px; }
  body[data-workspace-template="school"] .topbar-start { gap: 8px; }
  body[data-workspace-template="school"] .topbar-title-line { flex-direction: column-reverse; align-items: flex-start; gap: 1px; }
  body[data-workspace-template="school"] .erp-topbar h1 { font-size: 17px; max-width: 100%; }
  .school-header-context { font-size: 9px; white-space: normal; line-height: 1.2; }
  body[data-workspace-template="school"] .topbar-actions { gap: 5px; }
  body[data-workspace-template="school"] .erp-topbar .icon-button { width: 32px; height: 36px; }
  body[data-workspace-template="school"] .user-avatar { width: 34px; height: 34px; }
  .school-fee-chart { padding: 20px 16px; }
  .school-search-status { padding: 6px 12px; }
}
@media (max-width: 650px) {
  .school-teaching-analytics { grid-template-columns: 1fr; }
  .school-class-grid { grid-template-columns: 1fr; }
  .school-module-tabs { gap: 2px 10px; }
  .school-module-tabs > button { font-size: 12px; }
  .school-release-list > div { align-items: start; flex-direction: column; }
  .school-grade-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .school-register-grid th, .school-register-grid td, .school-mark-grid th, .school-mark-grid td { padding: 9px 5px; }
  .school-mark-grid { max-height: 60vh; }
}
