/* ==================================================================== */
/* SCHOOL PORTAL SHELL (School Admin, Principal, Teacher, Accountant,    */
/* Coordinator, Librarian, Transport Manager, Staff)                     */
/*                                                                       */
/* Loaded after aspirant-theme.css (tokens + component polish, shared    */
/* with Super Admin). Restyles the EXISTING shared markup (.sidebar-nav, */
/* .nav-group, .topbar, legacy .stat-card / .kpi-tile / .filter-bar ...) */
/* so every page picks up the new look without per-page edits.           */
/* Scoped under [data-sa-theme-root], set by partials/_app-shell.        */
/* The Vite build is unavailable in this environment, so these live in   */
/* public/css instead of resources/sass.                                 */
/* ==================================================================== */

/* ---- Sidebar header: school logo + name + role tag ---- */
[data-sa-theme-root] .sidebar .sidebar-header { padding: .8rem 1rem; min-height: 64px; align-items: center; }
[data-sa-theme-root] .sidebar .sidebar-header > .d-flex { align-items: center !important; gap: .65rem !important; width: 100%; }
[data-sa-theme-root] .sidebar .sidebar-header .school-logo,
[data-sa-theme-root] .sidebar .sidebar-header > .d-flex > div.rounded-2 { width: 40px !important; height: 40px !important; border-radius: .7rem !important; flex-shrink: 0; }
[data-sa-theme-root] .sidebar .sidebar-header .school-logo { object-fit: contain; background: var(--sa-color-primary-soft); }
[data-sa-theme-root] .sidebar .school-info { display: flex; flex-direction: column; line-height: 1.2; }
[data-sa-theme-root] .sidebar .school-info .school-name { font-weight: 800; font-size: .92rem; color: var(--sa-text-primary); letter-spacing: -.01em; }
[data-sa-theme-root] .sidebar .school-info .school-slogan { font-size: .68rem; color: var(--sa-text-muted); white-space: normal; }
/* Long school names / slogans wrap onto up to two lines instead of being cut with "…"; the full text is also in the
   header's title attribute (hover) for anything longer than two lines. */
[data-sa-theme-root] .sidebar .school-info { min-width: 0; flex: 1 1 auto; }
[data-sa-theme-root] .sidebar .school-info .school-name,
[data-sa-theme-root] .sidebar .school-info .school-slogan {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  white-space: normal; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere;
}
[data-sa-theme-root] .sidebar .school-info::after {
  content: var(--portal-role, ''); order: 3; margin-top: .15rem; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--sa-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content;
}

/* ---- Sidebar nav container ---- */
[data-sa-theme-root] .sidebar .sidebar-nav { padding: .5rem .75rem 1rem; min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
[data-sa-theme-root] .sidebar .sidebar-nav .nav-section { padding: 1rem .65rem .35rem; margin-top: 0; font-size: .66rem; font-weight: 800; letter-spacing: .09em; color: var(--sa-text-muted); }

/* ---- Top-level + nested links ---- */
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link {
  display: flex; align-items: center; gap: .7rem; padding: .52rem .7rem; margin-bottom: 2px;
  border-radius: .7rem; font-size: .86rem; font-weight: 600; color: var(--sa-text-secondary);
  white-space: nowrap; transition: background .15s, color .15s; position: relative;
}
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link i,
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link > span > i { font-size: 1.02rem; width: 1.3rem; text-align: center; color: var(--sa-text-muted); transition: color .15s; flex-shrink: 0; }
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link:hover { background: var(--sa-bg-surface-alt); color: var(--sa-text-primary); }
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link:hover i { color: var(--sa-color-primary); }
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link .badge { margin-left: auto; font-size: .64rem; }
/* Active — beats layouts/app.blade.php's school-colour !important rule */
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link.active {
  background: var(--sa-gradient) !important; color: #fff !important; font-weight: 700; box-shadow: 0 8px 18px rgba(46, 91, 255, .28);
}
[data-sa-theme-root] .sidebar .sidebar-nav .nav-link.active i { color: #fff !important; }
/* Items inside an expanded group: lighter, no gradient pill */
[data-sa-theme-root] .sidebar .nav-group-items .nav-link { padding: .4rem .65rem; font-size: .82rem; font-weight: 500; margin-bottom: 1px; }
[data-sa-theme-root] .sidebar .nav-group-items .nav-link i { font-size: .9rem; width: 1.15rem; }
[data-sa-theme-root] .sidebar .sidebar-nav .nav-group-items .nav-link.active {
  background: var(--sa-color-primary-soft) !important; color: var(--sa-color-primary) !important; font-weight: 700; box-shadow: none;
}
[data-sa-theme-root] .sidebar .sidebar-nav .nav-group-items .nav-link.active i { color: var(--sa-color-primary) !important; }

/* ---- Collapsible groups ---- */
[data-sa-theme-root] .sidebar .nav-group { margin-top: 2px; }
[data-sa-theme-root] .sidebar .nav-group-toggle {
  padding: .55rem .7rem; border-radius: .7rem; font-size: .86rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--sa-text-secondary);
}
[data-sa-theme-root] .sidebar .nav-group-toggle > span { gap: .7rem; }
[data-sa-theme-root] .sidebar .nav-group-toggle > span > i { font-size: 1.02rem; width: 1.3rem; color: var(--sa-text-muted); transition: color .15s; }
[data-sa-theme-root] .sidebar .nav-group-toggle:hover { background: var(--sa-bg-surface-alt); color: var(--sa-text-primary); }
[data-sa-theme-root] .sidebar .nav-group-toggle:hover > span > i { color: var(--sa-color-primary); }
[data-sa-theme-root] .sidebar .nav-group-arrow { font-size: .68rem; opacity: .6; }
[data-sa-theme-root] .sidebar .nav-group.open > .nav-group-toggle { color: var(--sa-color-primary); background: var(--sa-color-primary-soft); }
[data-sa-theme-root] .sidebar .nav-group.open > .nav-group-toggle > span > i { color: var(--sa-color-primary); }
[data-sa-theme-root] .sidebar .nav-group-items { margin: 2px 0 6px 1.55rem; padding-left: .6rem; border-left: 2px solid var(--sa-border-color); }
[data-sa-theme-root] .sidebar .nav-group:not(.open) .nav-group-items { border-left-color: transparent; }
[data-sa-theme-root] .sidebar .nav-subgroup-toggle { font-size: .66rem; color: var(--sa-text-muted); }
[data-sa-theme-root] .sidebar .nav-subgroup-label { padding-left: .65rem !important; }
[data-sa-theme-root] .sidebar .nav-group-toggle:focus-visible,
[data-sa-theme-root] .sidebar .nav-link:focus-visible { outline: none; box-shadow: var(--sa-shadow-focus); }

/* ---- Sidebar: viewport-high flex column so the nav scrolls ---- */
[data-sa-theme-root] .sidebar { position: fixed; display: flex; flex-direction: column; height: 100vh; }
@media (min-width: 992px) { [data-sa-theme-root] aside.sidebar.d-lg-block { display: flex !important; } }
@media (max-width: 991.98px) {
  [data-sa-theme-root] aside.sidebar.d-lg-none { display: flex !important; }
  [data-sa-theme-root] .sidebar { box-shadow: var(--sa-shadow-lg); }
}

/* ---- Topbar ---- */
[data-sa-theme-root] .topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; justify-content: space-between; }
[data-sa-theme-root] .topbar-left { display: flex; align-items: center; gap: .85rem; min-width: 0; }
[data-sa-theme-root] .topbar-right { display: flex; align-items: center; }
[data-sa-theme-root] .topbar .hamburger-btn { color: var(--sa-text-secondary); font-size: 1.35rem; }
[data-sa-theme-root] .topbar .breadcrumb { margin: 0; flex-wrap: nowrap; white-space: nowrap; }
[data-sa-theme-root] .topbar .breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--sa-text-muted); }
.sa-school-chip {
  display: inline-flex; align-items: center; gap: .4rem; max-width: 220px; padding: .35rem .75rem; border-radius: 2rem;
  background: var(--sa-bg-surface-alt); border: 1px solid var(--sa-border-color); font-size: .78rem; font-weight: 600; color: var(--sa-text-secondary);
}
.sa-school-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-sa-theme-root] .topbar-right > .dropdown > .btn.btn-light.btn-sm { width: 38px; height: 38px; padding: 0; border-radius: .8rem; display: inline-grid; place-items: center; background: #fff; border: 1px solid var(--sa-border-color); color: var(--sa-text-secondary); }
[data-sa-theme-root] .topbar-right > .dropdown > .btn.btn-light.btn-sm:hover { color: var(--sa-color-primary); border-color: #c9d5ff; background: var(--sa-color-primary-soft); }
[data-sa-theme-root] .topbar-right > .dropdown > .btn.btn-light.btn-sm::after { display: none; }
[data-sa-theme-root] .topbar-right .sa-user-btn::after { display: none; }
/* Global search (students / teachers / drivers) */
[data-sa-theme-root] .gs-box { border-radius: .8rem !important; background: var(--sa-bg-surface-alt) !important; border: 1px solid var(--sa-border-color) !important; }
[data-sa-theme-root] .gs-box:focus-within { border-color: var(--sa-color-primary) !important; box-shadow: var(--sa-shadow-focus) !important; background: #fff !important; }
[data-sa-theme-root] .gs-type-select { background: transparent !important; font-weight: 600; color: var(--sa-text-secondary); }
@media (max-width: 767.98px) { [data-sa-theme-root] .gs-search, .sa-school-chip { display: none; } }

/* ---- Page header (legacy markup + design-system helpers) ---- */
[data-sa-theme-root] .page-header-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.015em; color: var(--sa-text-primary); }
[data-sa-theme-root] .page-header-desc { color: var(--sa-text-muted); font-size: .85rem; }

/* ---- Legacy stat card / KPI tile / filter bar / empty state ---- */
[data-sa-theme-root] .stat-card {
  background: var(--sa-bg-surface); border: 1px solid var(--sa-border-color); border-top: 1px solid var(--sa-border-color);
  border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-sm); padding: 1rem 1.1rem;
}
[data-sa-theme-root] .stat-card:hover { box-shadow: var(--sa-shadow-md); transform: translateY(-1px); }
[data-sa-theme-root] .stat-card .stat-icon { width: 42px; height: 42px; border-radius: .85rem; font-size: 1.15rem; }
[data-sa-theme-root] .stat-card .stat-value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; color: var(--sa-text-primary); }
[data-sa-theme-root] .stat-card .stat-label { font-size: .76rem; font-weight: 600; color: var(--sa-text-muted); }
[data-sa-theme-root] .kpi-tile { border: 1px solid var(--sa-border-color); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-sm); padding: .8rem 1rem; }
[data-sa-theme-root] a.kpi-tile:hover { box-shadow: var(--sa-shadow-md); border-color: #c9d5ff; }
[data-sa-theme-root] .kpi-label { color: var(--sa-text-muted); font-weight: 700; }
[data-sa-theme-root] .kpi-value { font-weight: 800; letter-spacing: -.01em; }
[data-sa-theme-root] .filter-bar { border: 1px solid var(--sa-border-color); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-sm); }
[data-sa-theme-root] .filter-bar .form-label { color: var(--sa-text-muted); font-weight: 700; }
[data-sa-theme-root] .empty-state { color: var(--sa-text-muted); }
[data-sa-theme-root] .table-compact th { color: var(--sa-text-muted); font-weight: 800; letter-spacing: .06em; }
[data-sa-theme-root] .table-sticky-header thead th { background: var(--sa-bg-surface-alt); box-shadow: 0 1px 0 var(--sa-border-color); }
[data-sa-theme-root] .badge-active { background: var(--sa-color-success-soft); color: #12a36a; }
[data-sa-theme-root] .badge-inactive { background: var(--sa-color-neutral-soft); color: var(--sa-color-neutral); }
[data-sa-theme-root] .badge-pending { background: var(--sa-color-warning-soft); color: #b36b00; }
[data-sa-theme-root] .btn-school { background: var(--sa-gradient); border: 0; color: #fff; box-shadow: 0 6px 14px rgba(46, 91, 255, .25); }
[data-sa-theme-root] .btn-school:hover { background: var(--sa-gradient); color: #fff; filter: brightness(.94); }
[data-sa-theme-root] .btn-success { box-shadow: 0 6px 14px rgba(46, 204, 113, .22); }
[data-sa-theme-root] .btn-danger  { box-shadow: 0 6px 14px rgba(231, 76, 60, .2); }
[data-sa-theme-root] .btn-outline-secondary { border-color: var(--sa-border-color); color: var(--sa-text-secondary); background: #fff; }
[data-sa-theme-root] .btn-outline-secondary:hover { background: var(--sa-bg-surface-alt); color: var(--sa-text-primary); border-color: #c9d5ff; }
[data-sa-theme-root] .bg-primary,
[data-sa-theme-root] .text-bg-primary { background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important; }
[data-sa-theme-root] .list-group-item { border-color: var(--sa-border-color); }
[data-sa-theme-root] .list-group-item.active { background: var(--sa-gradient); border-color: transparent; }
[data-sa-theme-root] .accordion-item { border-color: var(--sa-border-color); }
[data-sa-theme-root] .accordion-button:not(.collapsed) { background: var(--sa-color-primary-soft); color: var(--sa-color-primary); box-shadow: none; }

/* ---- Helpers for redesigned portal pages ---- */
.sa-welcome {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 1.35rem; border-radius: var(--sa-radius-lg); background: var(--sa-gradient); color: #fff;
  box-shadow: 0 12px 26px rgba(46, 91, 255, .22);
}
.sa-welcome h4 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #fff; }
.sa-welcome p { margin: .15rem 0 0; font-size: .84rem; opacity: .9; }
.sa-welcome .btn { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); box-shadow: none; }
.sa-welcome .btn:hover { background: rgba(255,255,255,.28); color: #fff; transform: none; }
.sa-section-title { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--sa-text-muted); margin: 1.4rem 0 .6rem; }
.sa-shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.sa-shortcut { display: flex; align-items: center; gap: .75rem; padding: .8rem .95rem; background: var(--sa-bg-surface); border: 1px solid var(--sa-border-color); border-radius: var(--sa-radius-lg); text-decoration: none; color: var(--sa-text-primary); font-size: .84rem; font-weight: 700; transition: transform .15s, box-shadow .15s, border-color .15s; }
.sa-shortcut:hover { transform: translateY(-2px); box-shadow: var(--sa-shadow-md); border-color: #c9d5ff; color: var(--sa-text-primary); }
.sa-shortcut small { display: block; font-weight: 500; font-size: .72rem; color: var(--sa-text-muted); }
.sa-shortcut .sa-kpi-icon { width: 38px; height: 38px; font-size: 1rem; }
.sa-tone-success { background: var(--sa-color-success-soft) !important; color: #12a36a !important; }
.sa-tone-warning { background: var(--sa-color-warning-soft) !important; color: #d98200 !important; }
.sa-tone-danger  { background: var(--sa-color-danger-soft) !important; color: #d6402f !important; }
.sa-tone-violet  { background: #EFE8FF !important; color: #6D4AFF !important; }
.sa-tone-info    { background: var(--sa-color-info-soft) !important; color: #1c86c9 !important; }
.sa-tone-neutral { background: var(--sa-color-neutral-soft) !important; color: var(--sa-color-neutral) !important; }

/* ==== Teacher workspace pages (teacher/*): unify header typography + primary buttons with the Super Admin look ==== */
[data-sa-theme-root] .adref-title,[data-sa-theme-root] .ann-title,[data-sa-theme-root] .att-title,[data-sa-theme-root] .beh-title,[data-sa-theme-root] .classrep-title,[data-sa-theme-root] .dash-title,[data-sa-theme-root] .exam-title,[data-sa-theme-root] .examappr-title,[data-sa-theme-root] .fp-title,[data-sa-theme-root] .fps-title,[data-sa-theme-root] .interv-title,[data-sa-theme-root] .lib-title,[data-sa-theme-root] .markentry-title,[data-sa-theme-root] .rc-title,[data-sa-theme-root] .rec-title,[data-sa-theme-root] .roster-title,[data-sa-theme-root] .syl-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.015em; color: var(--sa-text-primary); margin-bottom: 0; }
[data-sa-theme-root] .adref-eyebrow,[data-sa-theme-root] .ann-eyebrow,[data-sa-theme-root] .att-eyebrow,[data-sa-theme-root] .beh-eyebrow,[data-sa-theme-root] .classrep-eyebrow,[data-sa-theme-root] .dash-eyebrow,[data-sa-theme-root] .exam-eyebrow,[data-sa-theme-root] .examappr-eyebrow,[data-sa-theme-root] .fp-eyebrow,[data-sa-theme-root] .fps-eyebrow,[data-sa-theme-root] .interv-eyebrow,[data-sa-theme-root] .lib-eyebrow,[data-sa-theme-root] .markentry-eyebrow,[data-sa-theme-root] .rc-eyebrow,[data-sa-theme-root] .rec-eyebrow,[data-sa-theme-root] .roster-eyebrow,[data-sa-theme-root] .syl-eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .09em; color: var(--sa-color-primary); }
[data-sa-theme-root] .adref-subtext,[data-sa-theme-root] .ann-subtext,[data-sa-theme-root] .att-subtext,[data-sa-theme-root] .beh-subtext,[data-sa-theme-root] .classrep-subtext,[data-sa-theme-root] .dash-subtext,[data-sa-theme-root] .exam-subtext,[data-sa-theme-root] .examappr-subtext,[data-sa-theme-root] .fp-subtext,[data-sa-theme-root] .fps-subtext,[data-sa-theme-root] .interv-subtext,[data-sa-theme-root] .lib-subtext,[data-sa-theme-root] .markentry-subtext,[data-sa-theme-root] .rc-subtext,[data-sa-theme-root] .rec-subtext,[data-sa-theme-root] .roster-subtext,[data-sa-theme-root] .syl-subtext { font-size: .85rem; color: var(--sa-text-muted); margin-top: .2rem; }
[data-sa-theme-root] .adref-primary-btn,[data-sa-theme-root] .ann-primary-btn,[data-sa-theme-root] .att-primary-btn,[data-sa-theme-root] .beh-primary-btn,[data-sa-theme-root] .classrep-primary-btn,[data-sa-theme-root] .dash-primary-btn,[data-sa-theme-root] .exam-primary-btn,[data-sa-theme-root] .examappr-primary-btn,[data-sa-theme-root] .fp-primary-btn,[data-sa-theme-root] .fps-primary-btn,[data-sa-theme-root] .interv-primary-btn,[data-sa-theme-root] .lib-primary-btn,[data-sa-theme-root] .markentry-primary-btn,[data-sa-theme-root] .rc-primary-btn,[data-sa-theme-root] .rec-primary-btn,[data-sa-theme-root] .roster-primary-btn,[data-sa-theme-root] .syl-primary-btn { background: var(--sa-gradient) !important; box-shadow: 0 6px 14px rgba(46, 91, 255, .25) !important; border-radius: .65rem !important; font-size: .85rem !important; font-weight: 600 !important; }
[data-sa-theme-root] [class$="-ws"] [class*="-toolbar-primary"], [data-sa-theme-root] [class$="-ws"] [class*="-btn-primary"] { background: var(--sa-gradient) !important; color: #fff !important; }
[data-sa-theme-root] [class$="-ws"] { background: transparent !important; }
[data-sa-theme-root] [class$="-ws"] { margin: 0 !important; padding: 0 !important; }

/* ---- admin dashboards (accounts / admissions / vendor / inventory / payroll / fees) ---- */
.sa-kpi-row.sa-kpi-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sa-kpi-row.sa-kpi-row-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1399.98px) { .sa-kpi-row.sa-kpi-row-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .sa-kpi-row.sa-kpi-row-4, .sa-kpi-row.sa-kpi-row-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 8 tiles: one row on wide screens, otherwise an even 4 + 4 (never an orphaned tile) */
.sa-kpi-row.sa-kpi-row-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
@media (max-width: 1699.98px) { .sa-kpi-row.sa-kpi-row-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 991.98px) { .sa-kpi-row.sa-kpi-row-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sa-kpi-card .sa-kpi-sub { font-size: .74rem; color: var(--sa-text-muted); margin-top: .35rem; }

/* ---- Finance & inventory modules: page-header polish (admin portal) ---- */
[data-sa-theme-root] .page-header h2 i { color: var(--sa-primary, #2E5BFF); font-size: 1.1em; }
[data-sa-theme-root] .page-header-title > h2 { margin-bottom: 0; }
[data-sa-theme-root] .sa-empty-state .sa-empty-state-description { max-width: 460px; }

/* ---- People / HR / Admissions / Reports modules (admin) ---- */
[data-sa-theme-root] .page-header-title .sa-page-sub,
[data-sa-theme-root] .page-header-title .page-header-desc { margin-top: .2rem; }
[data-sa-theme-root] .page-header-title h2 i,
[data-sa-theme-root] .page-header > div > h2 i { color: var(--sa-color-primary, #4A6CF7); font-size: 1.1em; vertical-align: -.05em; }
[data-sa-theme-root] .page-header-actions { align-items: center; }
/* form section headings inside cards */
[data-sa-theme-root] .card-body form h6.fw-semibold.mb-3,
[data-sa-theme-root] .card-body h6.fw-semibold.mb-3 {
  font-size: .78rem; font-weight: 800 !important; letter-spacing: .06em; text-transform: uppercase;
  color: var(--sa-text-muted); padding-bottom: .55rem; margin-bottom: 1rem !important;
  border-bottom: 1px solid var(--sa-border-color);
}
[data-sa-theme-root] .card-header.bg-transparent { border-bottom: 1px solid var(--sa-border-color); padding: .9rem 1.15rem; }
[data-sa-theme-root] .card-header.bg-transparent .card-title { font-size: 1rem; font-weight: 800; }
[data-sa-theme-root] .form-label { font-size: .8rem; font-weight: 700; color: var(--sa-text-secondary, var(--sa-text-muted)); margin-bottom: .35rem; }

/* KPI rows: fit however many tiles a role's dashboard has, without orphans */
.sa-kpi-row:not(.sa-kpi-row-4):not(.sa-kpi-row-7):not(.sa-kpi-row-8) { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Long figures (e.g. ₹66.0L) must shrink and stay inside their tile instead of pushing the icon out of it */
.sa-kpi-row .sa-kpi-card { min-width: 0; padding: var(--sa-space-4); }
.sa-kpi-row .sa-kpi-card-top > div:first-child { min-width: 0; }
.sa-kpi-row .sa-kpi-value { font-size: clamp(1.05rem, 0.55rem + 0.85vw, 1.4rem); white-space: nowrap; }
.sa-kpi-row .sa-kpi-card-top { gap: .5rem; }
.sa-kpi-row .sa-kpi-label { line-height: 1.25; }
.sa-kpi-row .sa-kpi-icon { width: 34px; height: 34px; font-size: .95rem; }

/* Sidebar menu search */
.sa-nav-hidden { display: none !important; }
.sa-nav-search { position: relative; flex: 0 0 auto; padding: .6rem .75rem .1rem; }
.sa-nav-search > .bi-search { position: absolute; left: 1.4rem; top: 50%; transform: translateY(-35%); font-size: .8rem; color: var(--sa-text-muted); pointer-events: none; }
.sa-nav-search-input { width: 100%; padding: .45rem 2rem .45rem 2.05rem; font-size: .82rem; border: 1px solid var(--sa-border-color); border-radius: .7rem; background: var(--sa-bg-surface-alt); color: var(--sa-text-primary); outline: none; }
.sa-nav-search-input:focus { background: #fff; border-color: var(--sa-color-primary); box-shadow: var(--sa-shadow-focus); }
.sa-nav-search kbd { position: absolute; right: 1.4rem; top: 50%; transform: translateY(-35%); background: #fff; border: 1px solid var(--sa-border-color); border-radius: .35rem; padding: 0 .35rem; font-size: .66rem; color: var(--sa-text-muted); box-shadow: none; pointer-events: none; }
.sa-nav-search-input:focus ~ kbd, .sa-nav-search-input:not(:placeholder-shown) ~ kbd { display: none; }
.sa-nav-empty { padding: 1rem .8rem; font-size: .8rem; color: var(--sa-text-muted); text-align: center; }

/* Super Admin sidebar: match the school-portal sidebar (soft-tint open group, lighter children) */
[data-sa-theme-root] .sidebar-nav .nav-link.sa-nav-link.is-group-open { background: var(--sa-color-primary-soft); color: var(--sa-color-primary); }
[data-sa-theme-root] .sidebar-nav .nav-link.sa-nav-link.is-group-open > i:first-child { color: var(--sa-color-primary); }
[data-sa-theme-root] .sidebar-nav .nav-link.sa-nav-link.is-group-open .sa-nav-caret { opacity: .8; }
[data-sa-theme-root] .sidebar .sa-nav-children { margin: 2px 0 6px 1.55rem; padding-left: .6rem; }
[data-sa-theme-root] .sidebar .sa-nav-child { padding: .4rem .65rem; font-size: .82rem; font-weight: 500; }
[data-sa-theme-root] .sidebar .sa-nav-child.active { font-weight: 700; }
[data-sa-theme-root] .sidebar .sa-nav-section { padding: 1rem .65rem .35rem; }

/* Page-header subtitles should be regular weight, not inherit the title's */
.page-header .sa-page-sub, .page-header .page-header-desc { font-weight: 400; }
