:root {
    --primary: #5238f5;
    --primary-dark: #3d28d4;
    --primary-soft: #efedff;
    --accent: #1dd4b5;
    --navy: #14213d;
    --text: #1d2a44;
    --muted: #70809b;
    --line: #e6ebf3;
    --surface: #ffffff;
    --surface-soft: #f8f9fd;
    --page-bg: #f4f6fb;
    --success: #0cad82;
    --warning: #e5a100;
    --danger: #d94a5b;
    --sidebar-width: 278px;
    --topbar-height: 78px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
    --shadow-sm: 0 8px 24px rgba(24, 39, 75, .06);
    --shadow: 0 18px 45px rgba(24, 39, 75, .09);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .94rem;
    overflow-x: hidden;
}
a { color: var(--primary-dark); }
a:hover { color: var(--primary); }
.ui-icon { display: inline-block; flex: 0 0 auto; vertical-align: -0.18em; }

/* Application shell */
.app-shell { min-height: 100vh; }
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1045;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 12px 0 35px rgba(28, 40, 74, .035);
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    min-height: var(--topbar-height);
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.sidebar-brand-link {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}
.sidebar-logo {
    width: 46px;
    height: 46px;
    padding: 4px;
    border-radius: 15px;
    background: #f1efff;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand-copy { min-width: 0; line-height: 1.18; }
.sidebar-brand-copy strong { display: block; font-size: .95rem; font-weight: 780; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; }
.sidebar-close, .mobile-menu-button {
    border: 0;
    background: transparent;
    color: var(--text);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
}
.sidebar-close:hover, .mobile-menu-button:hover { background: var(--surface-soft); }
.sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 22px 16px; }
.sidebar-section-label {
    padding: 0 10px 9px;
    color: #8a97ac;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.sidebar-nav { display: grid; gap: 7px; }
.sidebar-link {
    position: relative;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 14px;
    color: #42516a;
    text-decoration: none;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar-link:hover { color: var(--primary); background: #f5f3ff; transform: translateX(2px); }
.sidebar-link.active {
    color: #fff;
    background: linear-gradient(135deg, #5b42fa, #472de9);
    box-shadow: 0 11px 24px rgba(82, 56, 245, .24);
}
.sidebar-link-icon {
    width: 31px;
    height: 31px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--primary-soft);
}
.sidebar-link.active .sidebar-link-icon { color: #fff; background: rgba(255,255,255,.16); }
.active-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.sidebar-quick-card {
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 13px;
    display: flex;
    gap: 11px;
    align-items: center;
    background: linear-gradient(145deg, #fff, #fafaff);
}
.sidebar-quick-icon { width: 38px; height: 38px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; }
.sidebar-quick-card strong { display: block; font-size: .78rem; }
.sidebar-quick-card small { display: block; margin-top: 2px; color: var(--muted); font-size: .67rem; line-height: 1.35; }
.sidebar-account {
    margin: 14px 16px 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
}
.sidebar-avatar, .topbar-user-avatar {
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-weight: 800;
}
.sidebar-avatar { width: 40px; height: 40px; flex: 0 0 auto; }
.sidebar-account-copy { min-width: 0; flex: 1; line-height: 1.2; }
.sidebar-account-copy strong { display: block; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: .65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-logout { width: 34px; height: 34px; border-radius: 10px; color: var(--muted); display: grid; place-items: center; text-decoration: none; }
.sidebar-logout:hover { color: var(--danger); background: #fff0f2; }

.sidebar-backdrop { display: none; }
.app-workspace { min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.workspace-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--topbar-height);
    padding: 12px 28px;
    border-bottom: 1px solid rgba(230,235,243,.9);
    background: rgba(255,255,255,.91);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.topbar-left, .topbar-actions, .topbar-date, .topbar-user { display: flex; align-items: center; }
.topbar-left { min-width: 0; gap: 10px; }
.topbar-title { min-width: 0; line-height: 1.15; }
.topbar-title span { display: block; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.topbar-title strong { display: block; margin-top: 4px; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { gap: 12px; }
.topbar-date { gap: 8px; color: var(--muted); font-size: .78rem; }
.topbar-language { padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); display: inline-flex; gap: 2px; }
.lang-pill { min-width: 34px; min-height: 30px; padding: 5px 8px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 750; text-align: center; }
.lang-pill:hover { color: var(--primary); }
.lang-pill.active { color: #fff; background: var(--primary); box-shadow: 0 6px 14px rgba(82,56,245,.2); }
.topbar-user { min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); gap: 9px; }
.topbar-user-avatar { width: 38px; height: 38px; }
.topbar-user strong { display: block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .76rem; }
.topbar-user small { display: block; margin-top: 3px; color: var(--muted); font-size: .64rem; }
.workspace-main { width: 100%; max-width: 1740px; margin: 0 auto; padding: 28px; flex: 1 1 auto; }
.workspace-footer { padding: 18px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .72rem; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: rgba(255,255,255,.7); }
.admin-readonly-note {
    margin-bottom: 20px;
    padding: 11px 14px;
    border: 1px solid #ded9ff;
    border-radius: 13px;
    color: #5547a7;
    background: #f5f3ff;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .78rem;
}
.note-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--primary); background: #e9e5ff; }
.app-alert { border: 0; border-radius: 14px; box-shadow: var(--shadow-sm); }

/* Shared components */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card-header { border-bottom-color: var(--line); }
.btn { border-radius: 11px; font-weight: 650; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: #b9b1ff; --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); }
.btn-success { --bs-btn-bg: #0aa77b; --bs-btn-border-color: #0aa77b; --bs-btn-hover-bg: #078b67; --bs-btn-hover-border-color: #078b67; }
.btn-light { --bs-btn-bg: #f7f8fc; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: #eceff6; --bs-btn-hover-border-color: #dce2ec; }
.form-control, .form-select, .input-group-text {
    min-height: 44px;
    border-color: #dde4ef;
    border-radius: 11px;
    background-color: #fff;
}
.input-group > .input-group-text:first-child { border-radius: 11px 0 0 11px; }
.input-group > .form-control:last-child { border-radius: 0 11px 11px 0; }
.form-control:focus, .form-select:focus { border-color: #a99eff; box-shadow: 0 0 0 .22rem rgba(82,56,245,.12); }
.form-label { color: #40506a; font-size: .78rem; font-weight: 700; }
.form-text { color: var(--muted); font-size: .7rem; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 6px; color: var(--navy); font-size: clamp(1.45rem, 2vw, 2rem); font-weight: 800; letter-spacing: -.025em; }
.page-heading p { max-width: 880px; color: var(--muted) !important; }
.page-heading > a.text-decoration-none.small { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); outline: none; }
.table { color: #35445e; }
.table > :not(caption) > * > * { padding: .9rem .9rem; border-bottom-color: #edf0f5; }
.table thead th { color: #627087; background: #fafbfe; border-bottom-width: 1px; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:hover > * { background: #fbfbff; }
.action-cell { white-space: nowrap; }
.badge { border-radius: 999px; padding: .45em .7em; font-weight: 700; }
.badge-soft-success { color: #087757; background: #ddf8ef; }
.badge-soft-warning { color: #8a5a00; background: #fff0c9; }
.badge-soft-info { color: #075985; background: #e0f2fe; }
.progress { height: 8px; border-radius: 999px; background: #eceff6; }
.progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--primary), #7a65ff); }
.auto-calculated-field { background: #f0faf6 !important; font-weight: 700; }
.data-language-notice { border: 1px solid #cde9ff; border-left: 4px solid #33a8e8; border-radius: 14px; background: #f1f9ff; }

/* Dashboard */
.dashboard-hero {
    position: relative;
    min-height: 286px;
    padding: clamp(25px, 4vw, 44px);
    border: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: #fff;
    background: linear-gradient(128deg, #6149ff 0%, #5238f5 48%, #3c28da 100%);
    box-shadow: 0 24px 55px rgba(82,56,245,.24);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}
.dashboard-hero::before,
.dashboard-hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); }
.dashboard-hero::before { width: 300px; height: 300px; right: -70px; top: -120px; box-shadow: 0 0 0 45px rgba(255,255,255,.035), 0 0 0 90px rgba(255,255,255,.025); }
.dashboard-hero::after { width: 190px; height: 190px; right: 16%; bottom: -130px; background: rgba(255,255,255,.055); }
.dashboard-hero-content, .hero-visual { position: relative; z-index: 1; }
.dashboard-hero-content { max-width: 720px; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.15); color: #fff; font-size: .66rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #35e6c1; box-shadow: 0 0 0 4px rgba(53,230,193,.15); }
.dashboard-hero h1 { margin: 20px 0 12px; font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 820; letter-spacing: -.045em; }
.dashboard-hero p { max-width: 690px; margin: 0; color: rgba(255,255,255,.82); font-size: 1rem; line-height: 1.7; }
.hero-actions { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn { min-height: 46px; padding: 10px 17px; display: inline-flex; align-items: center; gap: 8px; }
.hero-visual { width: 225px; min-width: 225px; height: 190px; }
.hero-visual-card { position: absolute; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.13); backdrop-filter: blur(9px); box-shadow: 0 16px 30px rgba(27,15,112,.16); }
.hero-visual-card.one { width: 158px; height: 112px; right: 4px; top: 18px; border-radius: 22px; transform: rotate(5deg); }
.hero-visual-card.two { width: 132px; height: 94px; left: 5px; bottom: 9px; border-radius: 20px; transform: rotate(-6deg); }
.hero-visual-card.three { width: 76px; height: 76px; right: 54px; bottom: 12px; border-radius: 24px; display: grid; place-items: center; color: #fff; }
.hero-visual-lines { position: absolute; inset: 21px; border-radius: 14px; background: linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.15) 1px, transparent 1px); background-size: 22px 22px; }
.snapshot-card .card-body { padding: 26px; }
.snapshot-date { color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.snapshot-card h2 { margin: 7px 0 18px; font-size: 1.35rem; font-weight: 800; }
.snapshot-list { display: grid; gap: 12px; }
.snapshot-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fbfcff; }
.snapshot-item span { color: var(--muted); font-size: .76rem; }
.snapshot-item strong { font-size: 1.05rem; }
.metric-card { border: 1px solid var(--line); box-shadow: none; }
.metric-card .card-body { min-height: 126px; padding: 20px; }
.metric-label { color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.metric-value { margin-top: 8px; color: var(--navy); font-size: 1.8rem; line-height: 1; font-weight: 830; }
.metric-note { margin-top: 8px; color: #8a97ab; font-size: .7rem; }
.metric-card .icon-box { width: 46px; height: 46px; border-radius: 15px; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; }
.coverage-row + .coverage-row { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.cadre-stat { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cadre-stat strong { color: var(--primary-dark); font-size: 1.2rem; }
.cadre-stat.total { margin-top: 8px; padding: 14px; border: 0; border-radius: 14px; background: var(--primary-soft); }
.zone-card { height: 100%; overflow: hidden; box-shadow: none; transition: transform .18s ease, box-shadow .18s ease; }
.zone-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.zone-card-head { padding: 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 13px; }
.zone-card-icon { width: 48px; height: 48px; border-radius: 15px; color: var(--primary); background: var(--primary-soft); display: grid; place-items: center; }
.zone-card-head h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.zone-card-head small { display: block; margin-top: 4px; color: var(--muted); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; }
.zone-card-body { padding: 18px 20px 20px; }
.zone-office-box { margin-bottom: 17px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; display: flex; justify-content: space-between; align-items: center; }
.zone-office-box span { color: var(--muted); font-size: .69rem; font-weight: 750; text-transform: uppercase; }
.zone-office-box strong { font-size: 1.28rem; }
.zone-stat-row { padding: 9px 0; border-bottom: 1px solid #eff1f6; display: flex; justify-content: space-between; gap: 10px; }
.zone-stat-row span { color: var(--muted); font-size: .75rem; }
.zone-stat-row strong { font-size: .82rem; }
.zone-card .btn { margin-top: 16px; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.section-heading { margin-bottom: 17px; display: flex; justify-content: space-between; align-items: end; gap: 14px; }
.section-heading h2 { margin: 0; font-size: 1.18rem; font-weight: 820; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .75rem; }

/* Register, profile and forms */
.mini-summary { box-shadow: none; }
.mini-summary .card-body { min-height: 108px; padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; gap: 7px; }
.mini-summary span { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.mini-summary strong { color: var(--navy); font-size: 1.6rem; line-height: 1; }
.mini-summary.warning { border-left: 4px solid var(--warning); }
.school-register-table .school-name-cell { min-width: 250px; max-width: 420px; }
.school-profile-header {
    padding: 23px 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: linear-gradient(135deg, #fff 60%, #f2efff);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}
.school-profile-header h1 { margin: 7px 0 8px; color: var(--navy); font-size: clamp(1.45rem, 2.5vw, 2.15rem); font-weight: 820; letter-spacing: -.03em; }
.school-profile-header p { margin: 0; color: var(--muted); }
.profile-back { color: var(--primary); text-decoration: none; font-size: .76rem; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.census-chip, .zone-chip { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: .68rem; font-weight: 800; }
.census-chip { color: var(--primary-dark); background: var(--primary-soft); }
.zone-chip { color: #42617e; background: #ecf5ff; }
.profile-stat { box-shadow: none; }
.profile-stat .card-body { min-height: 128px; padding: 20px; display: flex; flex-direction: column; }
.profile-stat span { color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.profile-stat strong { margin-top: 8px; color: var(--navy); font-size: 1.72rem; }
.profile-stat small { margin-top: auto; padding-top: 7px; color: #8b98ab; font-size: .68rem; }
.profile-stat.warning { border-top: 4px solid var(--warning); }
.school-info-grid { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.info-item { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.info-item:nth-child(odd) { border-right: 1px solid var(--line); }
.info-item:nth-last-child(-n+2) { border-bottom: 0; }
.info-item span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.info-item strong { color: #34435d; font-size: .83rem; font-weight: 700; overflow-wrap: anywhere; }
.student-count-editor { border: 1px solid #dad4ff; border-radius: 15px; background: #f7f5ff; }
.cadre-table thead tr:first-child th, .professional-cadre-table thead tr:first-child th { color: #3e4770; background: #f0efff; }
.cadre-table thead tr:nth-child(2) th, .professional-cadre-table thead tr:nth-child(2) th { background: #fafaff; }
.cadre-table th, .cadre-table td, .professional-cadre-table th, .professional-cadre-table td { border-color: var(--line); vertical-align: middle; }

/* Login */
.login-page {
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 15%, rgba(82,56,245,.16), transparent 28%),
        radial-gradient(circle at 92% 86%, rgba(29,212,181,.13), transparent 26%),
        #f5f6fb;
}
.login-card { max-width: 1040px; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 28px 70px rgba(30,42,80,.13); }
.login-brand-panel {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #5d43fa, #3f2bd6);
}
.login-brand-panel::before, .login-brand-panel::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); }
.login-brand-panel::before { width: 360px; height: 360px; left: -190px; top: -130px; box-shadow: 0 0 0 55px rgba(255,255,255,.035); }
.login-brand-panel::after { width: 260px; height: 260px; right: -120px; bottom: -120px; box-shadow: 0 0 0 45px rgba(255,255,255,.03); }
.login-logo { position: relative; z-index: 1; width: 128px; max-height: 165px; object-fit: contain; filter: drop-shadow(0 14px 28px rgba(20,10,90,.24)); }
.login-brand-panel h1, .login-brand-panel div { position: relative; z-index: 1; }
.login-security-note { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: #fafbfe; font-size: .72rem; display: flex; align-items: flex-start; gap: 9px; }

@media (max-width: 1199.98px) {
    .hero-visual { width: 180px; min-width: 180px; }
    .workspace-main { padding: 24px; }
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 24px 0 45px rgba(18,30,68,.14); }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(12,20,42,.42); backdrop-filter: blur(2px); }
    .sidebar-open .sidebar-backdrop { display: block; }
    .app-workspace { margin-left: 0; }
    .workspace-topbar { padding: 11px 18px; }
    .workspace-main { padding: 20px; }
    .dashboard-hero { min-height: 250px; }
    .hero-visual { display: none; }
    .login-card { max-width: 680px; }
    .login-brand-panel { min-height: auto; padding-top: 32px !important; padding-bottom: 32px !important; }
    .login-logo { width: 88px; max-height: 110px; }
}

@media (max-width: 767.98px) {
    :root { --topbar-height: 70px; }
    .workspace-topbar { min-height: var(--topbar-height); }
    .topbar-language .lang-pill:not(.active) { display: none; }
    .topbar-language { padding: 3px; }
    .workspace-main { padding: 16px; }
    .workspace-footer { padding: 16px; flex-direction: column; }
    .page-heading { margin-bottom: 18px; }
    .page-heading.d-flex { display: block !important; }
    .page-heading .btn { width: 100%; margin-top: 13px; }
    .dashboard-hero { min-height: 0; padding: 25px 21px; border-radius: 21px; }
    .dashboard-hero h1 { font-size: 2rem; }
    .dashboard-hero p { font-size: .87rem; }
    .hero-actions { display: grid; grid-template-columns: 1fr; }
    .hero-actions .btn { justify-content: center; }
    .school-profile-header { padding: 19px; align-items: flex-start; }
    .school-profile-header > .d-flex { width: 100%; }
    .school-profile-header > .d-flex .btn { flex: 1 1 100%; }
    .school-info-grid { grid-template-columns: 1fr; }
    .info-item:nth-child(odd) { border-right: 0; }
    .info-item:nth-last-child(2) { border-bottom: 1px solid var(--line); }
    .table > :not(caption) > * > * { padding: .78rem .72rem; }
    .action-cell .btn { margin-bottom: 4px; }
    .student-count-editor .btn { width: 100%; }
}

@media (max-width: 575.98px) {
    .workspace-topbar { padding: 10px 12px; }
    .topbar-title span { display: none; }
    .topbar-title strong { font-size: .92rem; }
    .mobile-menu-button { width: 38px; height: 38px; }
    .workspace-main { padding: 12px; }
    .admin-readonly-note { align-items: flex-start; }
    .card { border-radius: 15px; }
    .login-page { padding: 12px; }
    .login-card { border-radius: 20px; }
    .login-card .card-body { padding: 24px !important; }
    .login-brand-panel h1 { font-size: 1.05rem; }
}

.letter-space { letter-spacing: .08em; }
.topbar-search {
    width: min(360px, 28vw);
    min-height: 44px;
    margin-left: auto;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--muted);
    background: #fafbfe;
    align-items: center;
    gap: 9px;
}
.topbar-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: .78rem;
}
.topbar-search input::placeholder { color: #9aa6b8; }
