:root {
    --green-950: #063d31;
    --green-900: #075f49;
    --green-800: #087a5d;
    --green-700: #0b916b;
    --green-600: #12a879;
    --green-500: #22bd88;
    --green-100: #dff7ed;
    --green-50: #f0fbf6;
    --ink: #12352e;
    --muted: #6c827c;
    --line: #dce9e4;
    --surface: rgba(255, 255, 255, .94);
    --danger: #c63f43;
    --warning: #c87a19;
    --navy: #244a68;
    --navy-soft: #eaf2f8;
    --amber: #b87516;
    --amber-soft: #fff5df;
    --violet: #7357a6;
    --violet-soft: #f2edfb;
    --coral: #c75555;
    --coral-soft: #fff0ef;
    --shadow-sm: 0 8px 24px rgba(7, 95, 73, .07);
    --shadow-md: 0 18px 45px rgba(7, 95, 73, .12);
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 26px;
}

.student-fee { display:block; width:170px; padding:9px 11px; border:1px solid #e1ebe7; border-radius:12px; background:#f8fbfa; color:#526a63; text-decoration:none; transition:.15s ease; }
.student-fee:hover { border-color:#b8d9ce; background:#fff; box-shadow:0 6px 18px rgba(7,95,73,.08); transform:translateY(-1px); }
.fee-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.fee-top strong { color:#173f36; font-size:13px; white-space:nowrap; }
.fee-state { font-size:10px; font-weight:800; }
.fee-caption { display:block; margin-top:4px; color:#7b8e88; font-size:9px; }
.fee-progress { display:block; height:3px; margin-top:7px; overflow:hidden; border-radius:99px; background:#e4ece9; }
.fee-progress i { display:block; height:100%; border-radius:inherit; background:#0b916b; }
.student-fee.paid { border-color:#bde8d8; background:#effbf6; color:#087a5d; }
.student-fee.paid .fee-top strong { color:#087a5d; }
.student-fee.partial { border-color:#f0ddb1; background:#fffaf0; color:#9b6814; }
.student-fee.partial .fee-progress i { background:#d2922c; }
.student-fee.unpaid { border-color:#f0d1d1; background:#fff7f6; color:#b84a4d; }
.student-fee.unpaid .fee-progress i { background:#d45a5e; }
.year-cell { color:#4f6760; font-size:12px; font-weight:600; white-space:nowrap; }
.action-sheet .fees-link { color:#9b6814 !important; background:#fff8e8 !important; font-weight:800; }
.action-sheet .fees-link { align-items:center !important; gap:9px; margin:3px 0; border:1px solid #f1e4c6; }
.fees-link .fee-menu-icon { display:grid; place-items:center; width:30px; height:30px; flex:0 0 auto; border-radius:9px; background:#fff; }
.fees-link span:last-child { display:flex; flex-direction:column; gap:1px; }
.fees-link b { font-size:12px; }
.fees-link small { color:#8a7660; font-size:9px; font-weight:500; }
.action-sheet .fee-menu-paid { color:#087a5d !important; background:#effbf6 !important; border-color:#cbe9df; }
.action-sheet .fee-menu-unpaid { color:#b84a4d !important; background:#fff7f6 !important; border-color:#f0d1d1; }
.action-sheet .fee-menu-partial { color:#9b6814 !important; background:#fffaf0 !important; border-color:#f0ddb1; }
.teachers-panel .tablewrap { overflow: visible; }
@media (max-width: 900px) { .teachers-panel .tablewrap { overflow-x: auto; overflow-y: visible; } }

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0 !important;
    min-height: 100vh;
    color: var(--ink) !important;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
    background:
        radial-gradient(circle at 8% 4%, rgba(34, 189, 136, .13), transparent 25rem),
        radial-gradient(circle at 95% 92%, rgba(11, 145, 107, .09), transparent 30rem),
        #f4faf7 !important;
    line-height: 1.55;
}

body, input, select, textarea, button { font-size: 15px; }
h1 { font-weight: 800; }
h2, h3 { font-weight: 750; }

a { color: var(--green-800); }
.item-link { color: inherit !important; text-decoration: none !important; border-radius: 9px; transition: background .15s, padding .15s; }
.item-link:hover { padding-inline: 9px; background: var(--green-50); }
.attendance-toggle { width: fit-content; margin-top: 8px; padding: 7px 11px; border-radius: 10px; color: var(--green-800); background: var(--green-100); font-weight: 700; cursor: pointer; list-style: none; }
.attendance-toggle::-webkit-details-marker { display: none; }
.term-nav { display:flex; gap:7px; position:sticky; top:10px; z-index:8; margin:13px 0; padding:7px; overflow:auto; border:1px solid rgba(255,255,255,.8); border-radius:14px; background:rgba(243,250,247,.88); box-shadow:0 7px 20px rgba(7,95,73,.08); backdrop-filter:blur(14px); }
.term-nav a { flex:0 0 auto; min-width:92px; padding:8px 12px; border-radius:10px; color:#47675f; text-align:center; text-decoration:none; font-size:12px; font-weight:700; transition:.16s ease; }
.term-nav a:hover { color:var(--green-800); background:var(--green-100); }
.term-nav a.active { color:#fff; background:linear-gradient(135deg,var(--green-700),var(--green-900)); box-shadow:0 6px 15px rgba(7,95,73,.18); }
.data-box { scroll-margin-top:18px; }
.data-box.is-hidden { display:none !important; }
.sections-grid.single-panel { grid-template-columns:1fr; }
.sections-grid.single-panel .data-box { grid-column:1/-1; min-height:210px; }
.sections-grid.overview-mode { display:none !important; }
.term-overview { display:none !important; }
.overview-modules { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-top:14px; }
.overview-module { display:flex; align-items:center; justify-content:space-between; min-height:76px; padding:13px 15px!important; border:1px solid #e0ece7!important; border-radius:14px; color:var(--ink)!important; background:#fff!important; box-shadow:none!important; cursor:pointer; }
.overview-module:hover { border-color:#b8e2d2!important; background:var(--green-50)!important; transform:translateY(-1px); }
.overview-module span { display:block; color:var(--muted); font-size:12px; font-weight:500; }
.overview-module strong { color:var(--green-800); font-size:21px; }
.overview-module::after { content:'←'; color:#83a198; }
.data-box .item-link { grid-template-columns:1fr auto auto; align-items:center; }
.data-box .item-link::after { content:'←'; color:#8aa098; }
@media(max-width:900px) { .overview-modules { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) { .data-box .item-link { grid-template-columns:1fr auto; } .data-box .item-link::after { display:none; } .overview-modules { grid-template-columns:1fr 1fr; } .overview-module { min-height:66px; padding:10px; } }

/* Student academic record: deliberately narrower and easier to scan. */
.history-wrap { width:min(1160px,calc(100% - 34px)) !important; }
.history-wrap .student-hero { padding:16px 18px !important; border-radius:18px !important; }
.history-wrap .student-avatar { width:56px !important; height:56px !important; border-radius:16px !important; font-size:23px !important; }
.history-wrap .student-hero h2 { font-size:21px; }
.history-wrap .hero-count { padding:8px 14px !important; }
.history-wrap .hero-count strong { font-size:21px !important; }
.history-wrap .current-strip { padding:9px !important; margin:11px 0 18px !important; border-radius:15px !important; }
.history-wrap .current-strip div { padding:7px 11px !important; }
.history-wrap .current-strip small { font-size:11px; }
.history-wrap .current-strip strong { font-size:13px; }
.history-wrap .history-title { margin:18px 3px 9px !important; }
.history-wrap .history-title h2 { font-size:21px; }
.history-wrap .year-details { border-radius:17px !important; }
.history-wrap .year-details > summary { padding:13px 16px !important; }
.history-wrap .year-icon { width:40px !important; height:40px !important; border-radius:12px !important; font-size:17px !important; }
.history-wrap .year-name { font-size:17px !important; }
.history-wrap .year-content { padding:10px !important; }
.history-wrap .term-card { padding:12px !important; border-radius:14px !important; }
.history-wrap .term-head h3 { font-size:18px; }
.history-wrap .term-nav { position:relative; top:auto; gap:5px; padding:6px; }
.history-wrap .term-nav a { min-width:auto; padding:7px 10px; font-size:12px; }
.history-wrap .metrics { gap:7px; margin:9px 0 !important; }
.history-wrap .metric { min-height:59px; padding:7px !important; display:flex; flex-direction:column; justify-content:center; }
.history-wrap .metric strong { font-size:16px !important; }
.history-wrap .metric small { font-size:12px; }
.history-wrap .data-box { padding:14px !important; border-radius:14px !important; min-height:0 !important; }
.history-wrap .data-box h4 { font-size:16px; margin-bottom:8px; }
.history-wrap .item { min-height:52px; padding:8px 5px; }
.history-wrap .item-title { font-size:14px; }
.history-wrap .item-meta { margin-top:3px; font-size:12px; line-height:1.65; }
@media(max-width:650px) { .history-wrap { width:calc(100% - 18px) !important; } .history-wrap .term-card { padding:10px !important; } .history-wrap .term-nav a { padding:8px 10px; font-size:12px; } .history-wrap .data-box { padding:14px !important; } }

/* Calm accent palette for the academic record */
.history-wrap .student-hero {
    background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(234,242,248,.82)) !important;
    border-color:#e4edf3 !important;
}
.history-wrap .student-avatar { background:linear-gradient(145deg,var(--navy),#39759b) !important; }
.history-wrap .hero-count { background:var(--navy-soft) !important; }
.history-wrap .hero-count strong { color:var(--navy) !important; }
.history-wrap .current-strip { background:linear-gradient(120deg,#0b7258 0%,#138f6b 58%,var(--navy) 145%) !important; }
.history-wrap .year-icon { color:var(--navy) !important; background:var(--navy-soft) !important; }
.history-wrap .year-details[open] .year-icon { color:#fff !important; background:var(--navy) !important; }
.history-wrap .year-status { color:var(--navy) !important; background:var(--navy-soft) !important; }
.history-wrap .term-nav a.active { background:linear-gradient(135deg,var(--navy),#356c91) !important; box-shadow:0 6px 15px rgba(36,74,104,.2) !important; }
.history-wrap .term-badge { color:var(--amber) !important; background:var(--amber-soft) !important; }
.history-wrap .metrics > .metric:nth-child(1) { background:var(--navy-soft) !important; border-color:#d9e7f1 !important; }
.history-wrap .metrics > .metric:nth-child(1) strong { color:var(--navy) !important; }
.history-wrap .metrics > .metric:nth-child(2) { background:#edf8f4 !important; }
.history-wrap .metrics > .metric:nth-child(3) { background:#eaf7f5 !important; }
.history-wrap .metrics > .metric:nth-child(4) { background:var(--amber-soft) !important; border-color:#f4e3bd !important; }
.history-wrap .metrics > .metric:nth-child(4) strong { color:var(--amber) !important; }
.history-wrap .metrics > .metric:nth-child(5) { background:var(--violet-soft) !important; border-color:#e5daf6 !important; }
.history-wrap .metrics > .metric:nth-child(5) strong { color:var(--violet) !important; }
.history-wrap .metrics > .metric:nth-child(6) { background:var(--coral-soft) !important; border-color:#f4d8d6 !important; }
.history-wrap .metrics > .metric:nth-child(6) strong { color:var(--coral) !important; }
.history-wrap .data-box[data-panel="subjects"] { border-top:3px solid var(--navy) !important; }
.history-wrap .data-box[data-panel="lessons"] { border-top:3px solid var(--green-600) !important; }
.history-wrap .data-box[data-panel="assignments"] { border-top:3px solid #d4932e !important; }
.history-wrap .data-box[data-panel="assignments"] .score { color:var(--amber) !important; }
.history-wrap .data-box[data-panel="exams"] { border-top:3px solid var(--violet) !important; }
.history-wrap .data-box[data-panel="exams"] .score { color:var(--violet) !important; }
.history-wrap .data-box[data-panel="marks"] { border-top:3px solid #39759b !important; }
.history-wrap .data-box[data-panel="notes"] { border-top:3px solid #d4932e !important; }
.history-wrap .data-box[data-panel="attendance"] { border-top:3px solid var(--coral) !important; }
.history-wrap .data-box .count { color:var(--navy) !important; background:var(--navy-soft) !important; }
h1, h2, h3 { color: var(--green-950); letter-spacing: -.02em; }

.layout {
    grid-template-columns: 278px minmax(0, 1fr) !important;
    background: transparent !important;
}

aside {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 28px 18px !important;
    background:
        radial-gradient(circle at 20% 0, rgba(255,255,255,.14), transparent 18rem),
        linear-gradient(165deg, var(--green-800), var(--green-950)) !important;
    box-shadow: -12px 0 38px rgba(6, 61, 49, .16);
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
}

.admin-sidebar nav { display: block; }
.brand-mark { font-size: 25px; }
.admin-nav-label {
    margin: 18px 12px 7px;
    color: rgba(255,255,255,.48);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.sidebar-logout {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.13);
}

.sidebar-logout button {
    width: 100%;
    color: #fff !important;
    background: rgba(255,255,255,.1) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
    box-shadow: none;
}

.admin-menu-toggle, .admin-sidebar-backdrop { display: none; }

body.admin-page { padding-right: 278px; }
body.admin-page > .admin-sidebar {
    position: fixed;
    z-index: 80;
    inset: 0 0 0 auto;
    width: 278px;
}

body.admin-page > .head,
body.admin-page > .wrap { max-width: 100%; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 8px 24px !important;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    font-size: 22px !important;
}

.nav {
    display: flex !important;
    align-items: center;
    min-height: 45px;
    margin: 4px 0 !important;
    padding: 10px 13px !important;
    border: 1px solid transparent;
    border-radius: 13px !important;
    color: rgba(255,255,255,.88) !important;
    text-decoration: none !important;
    transition: .18s ease;
}

.nav:hover, .nav.active {
    color: #fff !important;
    background: rgba(255,255,255,.14) !important;
    border-color: rgba(255,255,255,.12);
    transform: translateX(-2px);
}

.layout > main { padding: 34px clamp(18px, 3vw, 44px) !important; }

.top {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    margin-bottom: 24px;
    padding: 27px 30px !important;
    gap: 18px;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255,255,255,.84), rgba(237,252,246,.7)) !important;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.top::after {
    content: "";
    position: absolute;
    left: -45px;
    bottom: -75px;
    width: 175px;
    height: 175px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34,189,136,.2), rgba(34,189,136,0) 70%);
    pointer-events: none;
}

.top h1 { margin: 0 0 6px; font-size: clamp(25px, 3vw, 36px); line-height: 1.25; }
.top > div > div { color: var(--muted); font-size: 14px; }

.head {
    position: relative;
    overflow: hidden;
    min-height: 0;
    margin: 18px 22px 0;
    padding: 22px clamp(20px, 3vw, 34px) !important;
    color: var(--ink) !important;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(237,252,246,.78)) !important;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(7,95,73,.1);
    backdrop-filter: blur(20px) saturate(135%);
    -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.head::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    left: -35px;
    bottom: -75px;
    border-radius: 50%;
    background: rgba(34,189,136,.1);
}

.head h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 3px;
    color: var(--green-950) !important;
    font-size: clamp(24px, 2.5vw, 32px);
    line-height: 1.25;
    text-shadow: none;
}
.head p { position: relative; z-index: 1; margin: 0 0 10px; color: var(--muted) !important; font-size: 13px; }
.head a {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid rgba(11,145,107,.14);
    border-radius: 10px;
    color: var(--green-800) !important;
    background: rgba(223,247,237,.78);
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background .16s, transform .16s;
}
.head a:hover { background: var(--green-100); transform: translateY(-1px); }

.wrap {
    width: min(1450px, calc(100% - 34px)) !important;
    margin: 18px auto 36px !important;
    position: relative;
    z-index: 2;
}

.card, .panel, .stat, .filter, .box, .summary, .form-card {
    border: 1px solid rgba(7, 95, 73, .07) !important;
    border-radius: var(--radius) !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow-sm) !important;
}

.card, .panel, .box, .form-card { padding: clamp(17px, 2vw, 24px) !important; }

.stats {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)) !important;
    gap: 14px !important;
    margin: 0 0 18px !important;
}

.stat {
    position: relative;
    overflow: hidden;
    min-height: 105px;
    padding: 20px !important;
}

.stat::after {
    content: "";
    position: absolute;
    width: 72px;
    height: 72px;
    left: -22px;
    bottom: -30px;
    border-radius: 50%;
    background: var(--green-100);
}

.stat strong, .num {
    color: var(--green-700) !important;
    font-size: 30px !important;
    font-weight: 800;
}

.filter, .tools, .actions, .pager {
    gap: 9px !important;
    align-items: center;
    flex-wrap: wrap;
}

.filter {
    margin: 0 0 16px !important;
    padding: 14px !important;
}

input, select, textarea, button, .btn {
    min-height: 44px;
    border-radius: var(--radius-sm) !important;
    font-family: inherit !important;
}

input, select, textarea {
    border: 1px solid var(--line) !important;
    background: #fff !important;
    color: var(--ink) !important;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--green-500) !important;
    box-shadow: 0 0 0 4px rgba(34,189,136,.13) !important;
}

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px !important;
    border: 0 !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--green-700), var(--green-800)) !important;
    box-shadow: 0 6px 14px rgba(7,95,73,.13);
    text-decoration: none !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: transform .15s, box-shadow .15s, opacity .15s;
}

button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(7,95,73,.19); }
.light { color: var(--green-800) !important; background: var(--green-50) !important; box-shadow: none !important; }
.green { background: linear-gradient(135deg, var(--green-600), var(--green-800)) !important; }
.danger { color: var(--danger) !important; background: #fff0f0 !important; box-shadow: none !important; }
.logout { color: var(--danger) !important; background: #fff !important; box-shadow: var(--shadow-sm) !important; }

.tablewrap { overflow: auto; border-radius: 14px; }
table { width: 100%; border-collapse: separate !important; border-spacing: 0; }
thead { background: var(--green-50); }
th {
    color: var(--green-900);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
th, td { padding: 14px 12px !important; border-bottom: 1px solid #e8f0ed !important; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8fcfa; }
tbody tr:last-child td { border-bottom: 0 !important; }

.avatar {
    background: linear-gradient(145deg, var(--green-100), #c5f0df) !important;
    color: var(--green-800) !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px !important;
    color: var(--green-800) !important;
    background: var(--green-100) !important;
    font-weight: 700;
}

.badge.bad, .bad { color: var(--danger) !important; background: #ffeded !important; }
.muted { color: var(--muted) !important; }

.notice, .success {
    margin-bottom: 14px;
    padding: 13px 15px !important;
    border: 1px solid #bde8d5;
    border-radius: var(--radius-sm) !important;
    color: var(--green-900) !important;
    background: var(--green-50) !important;
}

.error, .errors { color: #a52e35 !important; background: #fff0f1 !important; border-color: #ffd1d4 !important; }

.modal { backdrop-filter: blur(7px); background: rgba(5, 41, 33, .58) !important; }
.modalbox {
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 28px 80px rgba(4,44,35,.25);
}

/* Login */
body:has(> form.card) {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 10%, rgba(255,255,255,.2), transparent 25rem),
        linear-gradient(145deg, var(--green-950), var(--green-600)) !important;
}

body > form.card {
    width: min(440px, 100%) !important;
    padding: 38px !important;
    border: 1px solid rgba(255,255,255,.5) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 30px 80px rgba(4,44,35,.28) !important;
}

.logo {
    color: #fff !important;
    background: linear-gradient(145deg, var(--green-600), var(--green-900)) !important;
    box-shadow: 0 12px 28px rgba(7,95,73,.24);
}

@media (max-width: 850px) {
    .layout { display: block !important; }
    .layout > aside {
        display: flex !important;
        position: sticky;
        z-index: 50;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 10px 12px !important;
        gap: 6px;
        overflow-x: auto;
        box-shadow: 0 7px 24px rgba(6,61,49,.13);
    }
    .brand { flex: 0 0 auto; margin: 0 2px !important; padding: 8px 10px !important; border: 0; font-size: 17px !important; }
    .nav { flex: 0 0 auto; min-height: 39px; margin: 0 !important; white-space: nowrap; font-size: 13px; }
    .layout > main { padding: 18px 13px !important; }
    .head {
        min-height: 0;
        margin: 10px 10px 0;
        padding: 18px 16px !important;
        border-radius: 18px;
    }
    .head h1 { font-size: 24px; }
    .head p { max-width: 85%; font-size: 12px; }
    .head a { min-height: 32px; padding: 5px 10px; font-size: 12px; }
    .wrap { width: min(100% - 20px, 1450px) !important; margin-top: 12px !important; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .filter { display: grid !important; grid-template-columns: 1fr !important; }
    .filter > * { width: 100% !important; margin: 0 !important; }
    .grid { grid-template-columns: 1fr !important; }
    .top {
        min-height: 125px;
        margin-bottom: 18px;
        padding: 22px 18px !important;
        align-items: flex-start !important;
        border-radius: 21px;
    }
    .top h1 { font-size: 25px; }
    .card, .panel { padding: 14px !important; }

    body.admin-page { padding-right: 0; }
    body.admin-page > .admin-sidebar {
        display: flex !important;
        position: fixed;
        z-index: 100;
        inset: 0 0 0 auto;
        width: min(310px, 86vw);
        height: 100vh;
        padding: 24px 16px !important;
        overflow-y: auto;
        transform: translateX(105%);
        transition: transform .23s ease;
    }
    body.admin-page > .admin-sidebar .brand {
        margin: 0 8px 18px !important;
        padding: 0 0 18px !important;
        border-bottom: 1px solid rgba(255,255,255,.14);
        font-size: 21px !important;
    }
    body.admin-page > .admin-sidebar .nav {
        width: 100%;
        margin: 3px 0 !important;
        font-size: 14px;
    }
    body.admin-sidebar-open > .admin-sidebar { transform: translateX(0); }
    .admin-menu-toggle {
        display: grid !important;
        place-items: center;
        position: fixed;
        z-index: 90;
        top: 14px;
        right: 14px;
        width: 46px;
        height: 46px;
        min-height: 46px;
        padding: 0 !important;
        border-radius: 14px !important;
        font-size: 21px;
        box-shadow: 0 10px 25px rgba(7,95,73,.24) !important;
    }
    .admin-sidebar-backdrop {
        display: block;
        position: fixed;
        z-index: 95;
        inset: 0;
        pointer-events: none;
        opacity: 0;
        background: rgba(3,34,27,.56);
        backdrop-filter: blur(4px);
        transition: opacity .2s;
    }
    body.admin-sidebar-open .admin-sidebar-backdrop { pointer-events: auto; opacity: 1; }
    body.admin-page > .head { padding-right: 68px !important; }
}

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr 1fr !important; }
    .stat { min-height: 92px; padding: 15px !important; }
    .stat strong, .num { font-size: 25px !important; }
    body > form.card { padding: 26px 20px !important; }
    body, input, select, textarea, button { font-size: 14px; }
    button, .btn { min-height: 42px; padding: 9px 13px !important; }
    .top { display: grid !important; grid-template-columns: 1fr auto; }
    .top h1 { font-size: 23px; }
}

/* Compact administration shell */
@media (min-width: 851px) {
    body.admin-page { padding-right: 232px; }
    body.admin-page > .admin-sidebar { width:232px; padding:18px 12px !important; }
    .layout { grid-template-columns:232px minmax(0,1fr) !important; }
    .layout > .admin-sidebar { padding:18px 12px !important; }
    .admin-sidebar .brand { margin:0 7px 14px !important; padding:0 0 14px !important; font-size:19px !important; }
    .admin-sidebar .brand-mark { font-size:21px; }
    .admin-sidebar .admin-nav-label { margin:13px 10px 4px; font-size:10px; }
    .admin-sidebar .nav { min-height:37px; margin:2px 0 !important; padding:7px 10px !important; border-radius:10px !important; font-size:13px; }
    .admin-sidebar .sidebar-logout { padding-top:11px; }
    .admin-sidebar .sidebar-logout button { min-height:38px; padding:7px 10px !important; font-size:13px; }
    body.admin-page > .head {
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        grid-template-rows:auto auto;
        align-items:center;
        column-gap:18px;
        min-height:0;
        margin:10px 14px 0;
        padding:14px 20px !important;
        border-radius:16px;
    }
    body.admin-page > .head h1 { grid-column:1; grid-row:1; margin:0; font-size:25px; }
    body.admin-page > .head p { grid-column:1; grid-row:2; margin:2px 0 0; font-size:12px; }
    body.admin-page > .head a { grid-column:2; grid-row:1 / span 2; min-height:32px; padding:5px 10px; font-size:12px; }
    body.admin-page > .head::after { width:78px; height:78px; bottom:-54px; }
    body.admin-page > .history-wrap { margin-top:12px; }
}

body.admin-page > .head { border-right:4px solid var(--navy); }
body.admin-page > .head a { color:var(--navy) !important; background:var(--navy-soft) !important; border-color:#d7e5ef !important; }
.admin-sidebar .nav.active { position:relative; background:rgba(255,255,255,.15) !important; }
.admin-sidebar .nav.active::before { content:""; width:5px; height:20px; flex:0 0 5px; border-radius:99px; background:#f2bd59; box-shadow:0 0 0 4px rgba(242,189,89,.1); }

/* Professional sidebar navigation */
.sidebar-symbols { position:absolute; width:0; height:0; overflow:hidden; }
.admin-sidebar { background:linear-gradient(180deg,#103b5d 0%,#075c55 55%,#06473f 100%)!important; }
.admin-sidebar .brand { gap:12px!important; }
.admin-sidebar .brand-mark { display:grid; place-items:center; width:42px; height:42px; flex:0 0 42px; border-radius:13px; color:#fff; background:linear-gradient(145deg,#2d83cc,#16a085); box-shadow:0 8px 22px rgba(0,0,0,.18); }
.admin-sidebar .brand-mark svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.admin-sidebar .brand > span:last-child { display:flex; flex-direction:column; line-height:1.25; }
.admin-sidebar .brand strong { color:#fff; font-size:18px; }
.admin-sidebar .brand small { margin-top:3px; color:rgba(255,255,255,.54); font-size:9px; font-weight:600; }
.admin-sidebar .nav { gap:10px; color:rgba(255,255,255,.78)!important; transition:background .18s ease,color .18s ease,transform .18s ease; }
.admin-sidebar .nav:hover { color:#fff!important; background:rgba(255,255,255,.08)!important; transform:translateX(-2px); }
.admin-sidebar .nav-icon { display:grid; place-items:center; width:29px; height:29px; flex:0 0 29px; border-radius:9px; color:#bfe1f7; background:rgba(64,157,216,.13); }
.admin-sidebar .nav-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.admin-sidebar .nav-violet .nav-icon { color:#d8cbff; background:rgba(132,94,225,.17); }
.admin-sidebar .nav-cyan .nav-icon { color:#aee8df; background:rgba(27,180,157,.15); }
.admin-sidebar .nav-green .nav-icon { color:#b9edc8; background:rgba(70,190,112,.15); }
.admin-sidebar .nav-amber .nav-icon { color:#ffe0a4; background:rgba(232,159,38,.16); }
.admin-sidebar .nav-coral .nav-icon { color:#ffc0b6; background:rgba(229,104,86,.16); }
.admin-sidebar .nav.active { color:#fff!important; background:rgba(255,255,255,.12)!important; box-shadow:inset 0 0 0 1px rgba(255,255,255,.11),0 8px 20px rgba(0,0,0,.08); }
.admin-sidebar .nav.active .nav-icon { color:#fff; background:rgba(255,255,255,.16); }
.admin-sidebar .nav.active::before { width:3px; height:22px; flex:0 0 3px; background:#f2bd59; box-shadow:0 0 0 3px rgba(242,189,89,.08); }
.admin-sidebar .sidebar-logout button { display:flex; align-items:center; justify-content:center; gap:9px; border-radius:11px!important; }
.admin-sidebar .sidebar-logout button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.student-page-actions { display:flex; align-items:center; gap:13px; }
.student-modal { display:none; position:fixed; z-index:200; inset:0; padding:22px; overflow:auto; }
.student-modal.open { display:grid; place-items:center; }
.student-modal-backdrop { position:fixed; inset:0; background:rgba(8,35,30,.58); backdrop-filter:blur(6px); }
.student-modal-card { position:relative; width:min(760px,100%); max-height:calc(100vh - 44px); padding:22px; overflow:auto; border:1px solid rgba(255,255,255,.75); border-radius:22px; background:#fff; box-shadow:0 28px 80px rgba(5,48,39,.28); }
.student-modal-head { display:flex; justify-content:space-between; align-items:flex-start; gap:15px; margin-bottom:15px; }
.student-modal-head h2 { margin:0; font-size:23px; }
.student-modal-head p { margin:3px 0 0; color:var(--muted); font-size:12px; }
.modal-close { width:38px; height:38px; min-height:38px; padding:0!important; color:var(--navy)!important; background:var(--navy-soft)!important; box-shadow:none!important; font-size:23px; }
.modal-year { margin-bottom:13px; padding:10px 12px; border-radius:11px; color:var(--navy); background:var(--navy-soft); }
.student-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.student-form-grid label { color:var(--ink); font-size:13px; font-weight:700; }
.student-form-grid input,.student-form-grid select { display:block; width:100%; margin-top:5px; }
.modal-note { margin-top:13px; padding:10px 12px; border-radius:11px; color:#735516; background:var(--amber-soft); font-size:12px; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:15px; }
@media(max-width:650px){.student-page-actions{align-items:flex-end;flex-direction:column}.student-page-actions .muted{display:none}.student-form-grid{grid-template-columns:1fr}.student-modal{padding:8px}.student-modal-card{max-height:calc(100vh - 16px);padding:16px;border-radius:17px}}

@media (max-width: 850px) {
    body.admin-page > .head { margin:8px 8px 0; padding:13px 62px 13px 14px !important; border-radius:15px; }
    body.admin-page > .head h1 { font-size:21px; }
    body.admin-page > .head p { margin-bottom:7px; font-size:11px; }
    body.admin-page > .head a { min-height:30px; padding:4px 9px; font-size:11px; }
    .admin-menu-toggle { top:12px; right:12px; width:40px; height:40px; min-height:40px; border-radius:12px !important; font-size:18px; }
}

@media print {
    aside, .head a, .tools, .filter, button { display: none !important; }
    body { background: #fff !important; }
    .layout { display: block !important; }
    .wrap { width: 100% !important; margin: 0 !important; }
    .card, .panel, .stat { box-shadow: none !important; }
}
