﻿:root {
    --sidebar-width: 290px;
    --sidebar-collapsed-width: 92px;
    --topbar-height: 82px;
    --primary: #1d4ed8;
    --primary-dark: #173da6;
    --sidebar-start: #0f172a;
    --sidebar-end: #16243a;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --body-bg: #f1f5f9;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 12px 28px rgba(15, 23, 42, 0.07);
}

/* =========================
   PROFESSIONAL UI REFRESH
   ========================= */

:root {
    --sidebar-width: 286px;
    --sidebar-collapsed-width: 86px;
    --brand-navy: #111827;
    --brand-slate: #1f2937;
    --brand-blue: #2563eb;
    --brand-green: #059669;
    --brand-red: #dc2626;
    --brand-amber: #d97706;
    --brand-cyan: #0891b2;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --page-bg: #eef3f8;
    --border-soft: #dbe4ef;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.07);
}

html, body {
    letter-spacing: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--page-bg);
    color: var(--text-main);
}

.page-content {
    padding: 28px;
}

.sidebar {
    background: linear-gradient(180deg, #111827 0%, #172033 48%, #1f2937 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    background: linear-gradient(135deg, #2563eb, #059669);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.brand-title {
    letter-spacing: 0;
}

.menu-group {
    margin-bottom: 6px;
}

.menu-group-toggle {
    color: #94a3b8;
    letter-spacing: 0;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 800;
}

.menu-link {
    min-height: 42px;
    border-radius: 8px;
    color: #dbe6f4;
    font-weight: 600;
}

.menu-link i {
    color: #93c5fd;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transform: translateX(2px);
}

.menu-link.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.menu-link.active i {
    color: #ffffff;
}

.submenu-group {
    margin: 4px 10px;
}

.submenu-toggle {
    width: 100%;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: rgba(255, 255, 255, 0.045) !important;
    color: #dbe6f4 !important;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    transition: 0.18s ease;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: #ffffff !important;
}

.submenu-toggle span {
    flex: 1;
    text-align: left;
    white-space: nowrap;
}

.submenu-toggle i:first-child {
    width: 20px;
    color: #93c5fd;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.82rem;
    transition: transform 0.18s ease;
}

.submenu-group.active .submenu-arrow {
    transform: rotate(180deg);
}

.submenu-group.collapsed .submenu-links {
    display: none !important;
}

.submenu-links {
    margin: 6px 0 0 28px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.submenu-link {
    margin-left: 0;
    padding-left: 12px !important;
    font-size: 0.86rem;
}

body.sidebar-collapsed .submenu-toggle {
    display: none !important;
}

body.sidebar-collapsed .submenu-links {
    display: block !important;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
}

body.sidebar-collapsed .submenu-link {
    justify-content: center;
    margin-left: 0;
    padding-left: 0 !important;
}

.topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-soft);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.topbar-title {
    font-weight: 800;
    letter-spacing: 0;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0;
}

.page-header p {
    margin: 6px 0 0;
    color: var(--text-muted);
    max-width: 720px;
}

.page-kicker {
    color: var(--brand-blue);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 4px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.card,
.content-card,
.metric-card,
.report-tile {
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.card {
    overflow: hidden;
}

.card-header {
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-main);
    font-weight: 800;
}

.metric-card {
    min-height: 116px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.metric-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    margin-top: 4px;
    color: var(--text-main);
    font-size: 1.32rem;
    line-height: 1.15;
    font-weight: 800;
}

.metric-icon {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    color: #ffffff;
    font-size: 1.18rem;
}

.metric-blue { background: #2563eb; }
.metric-green { background: #059669; }
.metric-purple { background: #7c3aed; }
.metric-red { background: #dc2626; }
.metric-cyan { background: #0891b2; }
.metric-amber { background: #d97706; }

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 16px;
}

.report-tile {
    min-height: 138px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 14px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.report-tile:hover {
    border-color: #93c5fd;
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.report-tile-copy strong {
    display: block;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 5px;
}

.report-tile-copy small {
    color: var(--text-muted);
    line-height: 1.45;
}

.report-tile-arrow {
    color: var(--text-muted);
    font-size: 1.35rem;
}

.btn {
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-weight: 700;
    letter-spacing: 0;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.form-control,
.form-select {
    border-radius: 8px;
    border-color: #cbd5e1;
    min-height: 42px;
}

.form-control:focus,
.form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.14);
}

.table {
    color: var(--text-main);
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.table tbody td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: #f8fbff;
}

.badge {
    border-radius: 999px;
    padding: 0.42rem 0.62rem;
    font-weight: 800;
}

.alert {
    border-radius: 8px;
    border: 1px solid var(--border-soft);
}

.section-title {
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: 0;
}

.stat-card {
    border-radius: 8px !important;
    border: 1px solid var(--border-soft) !important;
    box-shadow: var(--shadow-soft) !important;
}

.stat-icon {
    border-radius: 8px !important;
}

@media (max-width: 991.98px) {
    .page-content {
        padding: 20px 16px;
    }

    .page-header {
        display: block;
    }

    .page-actions {
        justify-content: flex-start;
        margin-top: 14px;
    }
}

/* Parent dashboard */
.invoice-detail-page{max-width:1500px;margin:0 auto}.invoice-detail-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:18px}.invoice-detail-kicker{color:var(--brand-blue);font-size:.73rem;font-weight:800;text-transform:uppercase;margin-bottom:4px}.invoice-detail-header h1{font-size:1.55rem;font-weight:800;margin:0}.invoice-detail-header p{color:var(--text-muted);margin:5px 0 0}.invoice-header-actions{display:flex;gap:8px;flex-wrap:wrap}.invoice-status,.invoice-lock{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:6px;font-size:.72rem;font-weight:800}.invoice-status-paid{background:#d1fae5;color:#047857}.invoice-status-partial{background:#fef3c7;color:#92400e}.invoice-status-unpaid{background:#fee2e2;color:#b91c1c}.invoice-lock{background:#e2e8f0;color:#475569}.invoice-amount-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:#fff;border:1px solid var(--border-soft);border-radius:8px;margin-bottom:12px;box-shadow:var(--shadow-soft)}.invoice-amount-strip article{padding:17px 18px;border-left:1px solid var(--border-soft);min-width:0}.invoice-amount-strip article:first-child{border-left:0}.invoice-amount-strip span,.invoice-amount-strip strong{display:block}.invoice-amount-strip span{color:var(--text-muted);font-size:.75rem;font-weight:700}.invoice-amount-strip strong{margin-top:4px;font-size:1.05rem;overflow-wrap:anywhere}.invoice-progress-panel{padding:16px 18px;background:#fff;border:1px solid var(--border-soft);border-radius:8px;margin-bottom:14px}.invoice-progress-copy,.invoice-progress-meta{display:flex;align-items:center;justify-content:space-between;gap:12px}.invoice-progress-copy{font-size:.8rem;margin-bottom:8px}.invoice-progress-panel .progress{height:8px;border-radius:4px}.invoice-progress-panel .progress-bar{background:var(--brand-blue)}.invoice-progress-meta{color:var(--text-muted);font-size:.73rem;margin-top:9px;flex-wrap:wrap}.invoice-detail-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.65fr);gap:14px}.invoice-detail-panel{background:#fff;border:1px solid var(--border-soft);border-radius:8px;box-shadow:var(--shadow-soft);overflow:hidden}.invoice-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 17px;border-bottom:1px solid var(--border-soft)}.invoice-panel-heading h2{font-size:.95rem;font-weight:800;margin:0}.invoice-panel-heading p{font-size:.75rem;color:var(--text-muted);margin:2px 0 0}.invoice-panel-heading>span{padding:4px 7px;background:#f1f5f9;border-radius:6px;font-size:.7rem;font-weight:700;color:#475569}.invoice-detail-table th{white-space:nowrap}.invoice-detail-table td,.invoice-detail-table th{padding:12px 16px}.invoice-detail-table tfoot td{font-weight:800;background:#f8fafc}.invoice-type-badge,.invoice-payment-status{display:inline-flex;padding:4px 7px;border-radius:5px;background:#f1f5f9;color:#475569;font-size:.7rem;font-weight:700}.invoice-empty-row{text-align:center!important;color:var(--text-muted);padding:38px!important}.invoice-empty-row i,.invoice-empty-row span{display:block}.invoice-empty-row i{font-size:1.4rem;margin-bottom:5px}.invoice-student-panel{padding-bottom:16px}.invoice-student-identity{display:flex;align-items:center;gap:11px;padding:16px}.invoice-student-identity>span{width:42px;height:42px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:#dbeafe;color:#1d4ed8;font-weight:800}.invoice-student-identity strong,.invoice-student-identity small{display:block}.invoice-student-identity small{color:var(--text-muted);font-size:.75rem}.invoice-info-list{padding:0 16px;margin:0 0 16px}.invoice-info-list>div{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid #edf2f7}.invoice-info-list dt{color:var(--text-muted);font-weight:600}.invoice-info-list dd{font-weight:700;margin:0;text-align:right}.invoice-student-panel>.btn{width:calc(100% - 32px)!important;margin:0 16px}@media(max-width:991.98px){.invoice-detail-grid{grid-template-columns:1fr}.invoice-amount-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-amount-strip article:nth-child(3){border-left:0;border-top:1px solid var(--border-soft)}.invoice-amount-strip article:nth-child(4){border-top:1px solid var(--border-soft)}}@media(max-width:575.98px){.invoice-detail-header{flex-direction:column}.invoice-header-actions{width:100%}.invoice-header-actions .btn{flex:1}.invoice-amount-strip{grid-template-columns:1fr}.invoice-amount-strip article{border-left:0!important;border-top:1px solid var(--border-soft)}.invoice-amount-strip article:first-child{border-top:0}.invoice-progress-meta{align-items:flex-start;flex-direction:column}.invoice-detail-table td,.invoice-detail-table th{padding:10px 12px}}
.bursar-workspace{max-width:1500px;margin:0 auto}.bursar-filter{display:flex;align-items:end;gap:10px;padding:14px;background:#fff;border:1px solid var(--border-soft);border-radius:8px;margin-bottom:14px}.bursar-filter label{min-width:160px;font-size:.78rem;font-weight:700}.bursar-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.bursar-metrics article{display:flex;align-items:center;gap:12px;padding:16px;background:#fff;border:1px solid var(--border-soft);border-radius:8px}.bursar-metrics small,.bursar-metrics strong{display:block}.bursar-metrics small{color:var(--text-muted)}.bursar-metrics strong{font-size:1rem;overflow-wrap:anywhere}.bursar-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,.6fr);gap:16px;margin-bottom:16px}.bursar-progress{height:10px}.bursar-mini-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:20px}.bursar-mini-metrics span,.bursar-mini-metrics strong{display:block}.bursar-mini-metrics span{color:var(--text-muted);font-size:.75rem}.bursar-actions{display:grid;grid-template-columns:1fr 1fr}.bursar-actions a{display:flex;align-items:center;gap:9px;padding:14px;color:inherit;text-decoration:none;border:solid var(--border-soft);border-width:0 1px 1px 0}.bursar-actions i{color:var(--brand-blue)}.bursar-tables{display:grid;grid-template-columns:1.25fr .75fr;gap:16px}@media(max-width:1199.98px){.bursar-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.bursar-grid,.bursar-tables{grid-template-columns:1fr}}@media(max-width:575.98px){.bursar-filter{align-items:stretch;flex-direction:column}.bursar-filter label{width:100%}.bursar-metrics,.bursar-mini-metrics{grid-template-columns:1fr}.bursar-actions{grid-template-columns:1fr}}
.teacher-workspace { max-width: 1500px; margin: 0 auto; }
.teacher-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.teacher-metrics article { display:flex; align-items:center; gap:12px; padding:16px; background:#fff; border:1px solid var(--border-soft); border-radius:8px; }
.teacher-metrics small,.teacher-metrics strong { display:block; } .teacher-metrics small { color:var(--text-muted); } .teacher-metrics strong { font-size:1.2rem; }
.teacher-layout { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(280px,.7fr); gap:16px; }
.teacher-class-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.teacher-class-item { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px; border:1px solid var(--border-soft); border-radius:8px; }
.teacher-class-item h2 { display:inline; margin:0 0 0 8px; font-size:.95rem; } .teacher-class-item p { margin:5px 0 0 36px; color:var(--text-muted); font-size:.78rem; }
.teacher-class-icon { color:var(--brand-blue); } .teacher-class-actions { display:flex; gap:6px; }
.teacher-quick-list a { display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:10px; padding:15px; color:inherit; text-decoration:none; border-top:1px solid var(--border-soft); }
.teacher-quick-list a:first-child { border-top:0; } .teacher-quick-list small { display:block; color:var(--text-muted); font-size:.75rem; }
@media(max-width:991.98px){.teacher-layout{grid-template-columns:1fr}.teacher-class-grid{grid-template-columns:1fr}}
@media(max-width:575.98px){.teacher-metrics{grid-template-columns:1fr}.teacher-class-item{align-items:flex-start;flex-direction:column}.teacher-class-actions{width:100%}}
.portal-page { max-width: 1500px; margin: 0 auto; }
.portal-academic-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.portal-academic-summary > div { padding: 16px 18px; background: #fff; border: 1px solid var(--border-soft); border-radius: 8px; }
.portal-academic-summary span, .report-period-link small { display: block; color: var(--text-muted); font-size: .78rem; }
.portal-academic-summary strong { display: block; margin-top: 4px; font-size: 1.25rem; }
.report-period-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.report-period-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border: 1px solid var(--border-soft); border-radius: 8px; color: inherit; text-decoration: none; }
.report-period-link:hover { border-color: var(--brand-blue); color: var(--brand-blue); background: #f8fbff; }
.portal-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 80px; color: var(--text-muted); }
@media (max-width: 767.98px) { .portal-academic-summary, .report-period-grid { grid-template-columns: 1fr; } }
.parent-dashboard { max-width: 1500px; margin: 0 auto; }
.parent-dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.parent-dashboard-header h1 { margin: 0; font-size: 1.65rem; font-weight: 800; }
.parent-dashboard-header p { margin: 5px 0 0; color: var(--text-muted); }
.parent-dashboard-kicker { margin: 0 0 4px !important; color: var(--brand-blue) !important; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.parent-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.parent-metric { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 18px; background: #fff; border: 1px solid var(--border-soft); border-radius: 8px; box-shadow: var(--shadow-soft); }
.parent-metric-icon { width: 42px; height: 42px; flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 1.1rem; }
.parent-metric div { min-width: 0; }
.parent-metric div span { display: block; color: var(--text-muted); font-size: .78rem; font-weight: 700; }
.parent-metric strong { display: block; margin-top: 3px; font-size: 1.15rem; overflow-wrap: anywhere; }
.metric-students .parent-metric-icon { background: #dbeafe; color: #1d4ed8; }
.metric-outstanding .parent-metric-icon { background: #fee2e2; color: #b91c1c; }
.metric-paid .parent-metric-icon { background: #d1fae5; color: #047857; }
.metric-credit .parent-metric-icon { background: #fef3c7; color: #b45309; }
.parent-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.parent-main-column, .parent-side-column { background: #fff; border: 1px solid var(--border-soft); border-radius: 8px; box-shadow: var(--shadow-soft); padding: 20px; }
.parent-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.parent-section-heading h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.parent-section-heading p { margin: 2px 0 0; color: var(--text-muted); font-size: .8rem; }
.parent-section-heading a { font-size: .82rem; font-weight: 700; text-decoration: none; }
.parent-student-list { display: grid; gap: 10px; }
.parent-student-row { display: grid; grid-template-columns: 46px minmax(170px, 1fr) minmax(175px, .7fr) auto; gap: 14px; align-items: center; padding: 15px 0; border-top: 1px solid #edf2f7; }
.parent-student-row:first-child { border-top: 0; padding-top: 4px; }
.parent-student-avatar { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #e0f2fe; color: #075985; font-weight: 800; }
.parent-student-identity { min-width: 0; }
.parent-student-identity h3 { margin: 0; font-size: .95rem; font-weight: 800; }
.parent-student-identity p { margin: 3px 0 5px; color: var(--text-muted); font-size: .78rem; overflow-wrap: anywhere; }
.parent-payment-code { color: #475569; font-size: .75rem; }
.parent-student-finance span, .parent-student-finance small { display: block; color: var(--text-muted); font-size: .74rem; }
.parent-student-finance strong { display: block; margin: 2px 0; font-size: .95rem; }
.parent-student-actions { display: flex; gap: 6px; }
.icon-action { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.parent-payment-list { display: grid; }
.parent-payment-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid #edf2f7; color: inherit; text-decoration: none; }
.parent-payment-item:first-child { border-top: 0; }
.parent-payment-status { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #d1fae5; color: #047857; }
.parent-payment-item strong, .parent-payment-item small { display: block; overflow-wrap: anywhere; }
.parent-payment-item small { margin-top: 2px; color: var(--text-muted); font-size: .72rem; }
.parent-payment-item b { color: #047857; font-size: .78rem; white-space: nowrap; }
.parent-empty-state { padding: 50px 20px; text-align: center; background: #fff; border: 1px dashed #cbd5e1; border-radius: 8px; }
.parent-empty-state i { color: #64748b; font-size: 2rem; }
.parent-empty-state h2 { margin: 10px 0 5px; font-size: 1rem; }
.parent-empty-state p { margin: 0; color: var(--text-muted); }
.parent-empty-state.compact { padding: 26px 14px; }

@media (max-width: 1199.98px) {
    .parent-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .parent-dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
    .parent-student-row { grid-template-columns: 44px minmax(0, 1fr); }
    .parent-student-finance, .parent-student-actions { grid-column: 2; }
    .parent-student-actions { flex-wrap: wrap; }
}

/* Communications, noticeboard and opened confirmations */
.notification-menu-wrap { position: relative; }
.notification-button {
    position: relative; width: 44px; height: 44px; display: grid; place-items: center;
    border: 1px solid #dbe4ef; border-radius: 11px; background: #fff; color: #334155; font-size: 1.1rem;
}
.notification-button:hover, .notification-button[aria-expanded="true"] { background: #f8fafc; border-color: #bfdbfe; color: #1d4ed8; }
.notification-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; background: #dc2626; color: #fff; font-size: .62rem; font-weight: 800; }
.notification-dropdown { width: 340px; padding: 0 !important; overflow: hidden; border: 1px solid #dbe4ef !important; border-radius: 14px !important; box-shadow: 0 18px 45px rgba(15,23,42,.16) !important; }
.notification-dropdown-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #e2e8f0; }
.notification-dropdown-header > div { display: flex; flex-direction: column; }
.notification-dropdown-header strong { color: #0f172a; font-size: .9rem; }
.notification-dropdown-header span { color: #64748b; font-size: .7rem; }
.notification-dropdown-header a { font-size: .75rem; font-weight: 700; text-decoration: none; }
.notification-dropdown-list { max-height: 360px; overflow-y: auto; }
.notification-item { display: flex; gap: .75rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid #f1f5f9; color: #334155; text-decoration: none !important; }
.notification-item:hover { background: #f8fafc; }
.notification-item > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.notification-item strong { overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.notification-item small { margin-top: .15rem; color: #94a3b8; font-size: .68rem; }
.notification-item-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; background: #eff6ff; color: #2563eb; }
.notification-item-icon.priority-important { background: #fffbeb; color: #d97706; }
.notification-item-icon.priority-urgent { background: #fef2f2; color: #dc2626; }
.notification-empty { padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; color: #94a3b8; font-size: .8rem; }
.notification-empty i { font-size: 1.5rem; }

.notice-filters { display: inline-flex; gap: .35rem; padding: .3rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.notice-filters a { padding: .45rem .85rem; border-radius: 7px; color: #64748b; font-size: .78rem; font-weight: 700; text-decoration: none !important; }
.notice-filters a.active { background: #eff6ff; color: #1d4ed8; }
.notice-list { display: grid; gap: .75rem; }
.notice-row { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.15rem; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; color: #334155; text-decoration: none !important; box-shadow: 0 6px 20px rgba(15,23,42,.045); }
.notice-row::before, .notice-article::before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ""; background: #2563eb; }
.notice-row.priority-important::before, .notice-article.priority-important::before { background: #d97706; }
.notice-row.priority-urgent::before, .notice-article.priority-urgent::before { background: #dc2626; }
.notice-row:hover { border-color: #bfdbfe; box-shadow: 0 12px 28px rgba(15,23,42,.08); transform: translateY(-1px); }
.notice-row.opened { background: #fbfdff; }
.notice-row.unopened strong { color: #0f172a; font-weight: 800; }
.notice-row-icon { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 11px; background: #eff6ff; color: #2563eb; font-size: 1.1rem; }
.priority-important .notice-row-icon { background: #fffbeb; color: #d97706; }
.priority-urgent .notice-row-icon { background: #fef2f2; color: #dc2626; }
.notice-row-content { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.notice-row-content > strong { margin: .2rem 0; font-size: .95rem; }
.notice-row-meta { display: flex; flex-wrap: wrap; gap: .45rem .75rem; color: #64748b; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.notice-priority { color: #1d4ed8; }
.priority-important .notice-priority { color: #b45309; }
.priority-urgent .notice-priority { color: #b91c1c; }
.notice-excerpt { overflow: hidden; color: #64748b; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.notice-date { margin-top: .4rem; color: #94a3b8; font-size: .7rem; }
.notice-state { padding: .5rem; }
.unread-dot { width: 9px; height: 9px; display: block; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 4px #dbeafe; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .45rem; color: #64748b; font-size: .78rem; font-weight: 700; text-decoration: none !important; }
.notice-article { position: relative; overflow: hidden; }
.notice-body { min-height: 160px; color: #334155; font-size: 1rem; line-height: 1.8; white-space: pre-wrap; }
.notice-publisher { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #e2e8f0; color: #64748b; font-size: .76rem; }
.opened-confirmation, .acknowledgement-card { margin-top: 1rem; padding: 1rem 1.15rem; display: flex; align-items: center; gap: .85rem; border: 1px solid #bbf7d0; border-radius: 11px; background: #f0fdf4; color: #166534; }
.opened-confirmation > i { font-size: 1.25rem; }
.opened-confirmation > div { display: flex; flex-direction: column; }
.opened-confirmation span { font-size: .75rem; }
.acknowledgement-card { justify-content: space-between; border-color: #fde68a; background: #fffbeb; color: #92400e; }
.acknowledgement-card p { margin: .15rem 0 0; font-size: .78rem; }
.notice-compose-page { max-width: 1050px; }
.notice-opened-page .summary-card { min-height: 100px; display: flex; align-items: center; gap: .85rem; padding: 1.15rem; background: #fff; }

@media (max-width: 575.98px) {
    .notification-dropdown { position: fixed !important; top: 70px !important; right: 12px !important; left: auto !important; width: calc(100vw - 24px); transform: none !important; }
    .notification-button { width: 42px; height: 42px; }
    .notice-row { align-items: flex-start; padding: 1rem; gap: .75rem; }
    .notice-row-icon { width: 38px; height: 38px; flex-basis: 38px; }
    .notice-excerpt { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
    .notice-state { position: absolute; top: .65rem; right: .65rem; }
    .notice-publisher, .acknowledgement-card { align-items: flex-start; flex-direction: column; }
    .acknowledgement-card .btn { width: 100%; }
}

/* Finance analytics and boarding module finishing touches */
.page-content .metric-card {
    min-height: 118px;
    padding: 1.25rem;
    gap: 1rem;
    border-radius: 14px !important;
    transition: transform .16s ease, box-shadow .16s ease;
}
.page-content .metric-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,23,42,.09) !important; }
.page-content .metric-card > div { min-width: 0; }
.page-content .metric-card .metric-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    padding: 0;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}
.page-content .metric-card .metric-label { color: #64748b; letter-spacing: .035em; }
.page-content .metric-card .metric-value { margin-top: .45rem; font-size: clamp(1.15rem, 1.5vw, 1.4rem); }

.boarding-page .summary-card {
    min-height: 102px;
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.15rem;
    background: #fff;
}
.boarding-page .record-count {
    padding: .3rem .65rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: .75rem;
    font-weight: 700;
}
.boarding-page .house-select { width: 150px; }

@media (max-width: 767.98px) {
    .page-content .metric-card { min-height: 100px; }
    .boarding-page .house-select { width: 130px; }
}
@media (max-width: 575.98px) {
    .parent-dashboard-header { align-items: stretch; flex-direction: column; }
    .parent-dashboard-header h1 { font-size: 1.35rem; }
    .parent-metrics { grid-template-columns: 1fr; }
    .parent-metric { padding: 14px; }
    .parent-main-column, .parent-side-column { padding: 15px; }
    .parent-payment-item { grid-template-columns: 32px minmax(0, 1fr); }
    .parent-payment-item b { grid-column: 2; }
}

/* System-wide Razor view normalization
   Keeps older module views aligned with the current SMIS design language. */
@media screen {
    .page-content > .container,
    .page-content > .container-fluid {
        padding-right: 0;
        padding-left: 0;
    }

    .page-content > .container.mt-4,
    .page-content > .container-fluid.mt-4 { margin-top: 0 !important; }

    .page-content > .container > h1:first-child,
    .page-content > .container > h2:first-child,
    .page-content > .container > h3:first-child,
    .page-content > .container-fluid > h1:first-child,
    .page-content > .container-fluid > h2:first-child,
    .page-content > .container-fluid > h3:first-child {
        margin: 0 0 1.15rem;
        color: #0f172a;
        font-size: clamp(1.35rem, 2vw, 1.8rem);
        font-weight: 800;
        letter-spacing: -.025em;
    }

    /* Replace saturated legacy card banners with restrained section headers. */
    .page-content .card-header.bg-primary,
    .page-content .card-header.bg-secondary,
    .page-content .card-header.bg-success,
    .page-content .card-header.bg-danger,
    .page-content .card-header.bg-warning,
    .page-content .card-header.bg-info,
    .page-content .card-header.bg-dark {
        border-bottom: 1px solid #e2e8f0;
        background: linear-gradient(180deg, #fff, #f8fafc) !important;
        color: #0f172a !important;
    }

    .page-content .card-header.bg-primary { box-shadow: inset 3px 0 #2563eb; }
    .page-content .card-header.bg-success { box-shadow: inset 3px 0 #059669; }
    .page-content .card-header.bg-danger { box-shadow: inset 3px 0 #dc2626; }
    .page-content .card-header.bg-warning { box-shadow: inset 3px 0 #d97706; }
    .page-content .card-header.bg-info { box-shadow: inset 3px 0 #0891b2; }
    .page-content .card-header.bg-dark,
    .page-content .card-header.bg-secondary { box-shadow: inset 3px 0 #475569; }
    .page-content .card-header .btn-light {
        border-color: #cbd5e1;
        background: #fff;
        color: #334155;
    }

    /* Dashboard and finance metrics: white surfaces with semantic accents. */
    .page-content .dashboard-card,
    .page-content .dashboard-card[class*="metric-"] {
        position: relative;
        min-height: 118px;
        padding: 1.25rem 1.35rem;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        background: #fff !important;
        box-shadow: 0 8px 24px rgba(15, 23, 42, .055);
        color: #0f172a !important;
    }
    .page-content .dashboard-card::before,
    .page-content .dashboard-card[class*="metric-"]::before {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 4px;
        content: "";
        background: #2563eb;
    }
    .page-content .dashboard-card.metric-green::before { background: #059669; }
    .page-content .dashboard-card.metric-red::before { background: #dc2626; }
    .page-content .dashboard-card.metric-orange::before,
    .page-content .dashboard-card.metric-yellow::before { background: #d97706; }
    .page-content .dashboard-card h6,
    .page-content .dashboard-card[class*="metric-"] h6 {
        margin-bottom: .55rem;
        color: #64748b !important;
        font-size: .76rem;
        font-weight: 750;
        letter-spacing: .045em;
        text-transform: uppercase;
    }
    .page-content .dashboard-card h3,
    .page-content .dashboard-card[class*="metric-"] h3 {
        margin: 0;
        color: #0f172a !important;
        font-size: clamp(1.35rem, 2vw, 1.75rem);
        font-weight: 800;
        letter-spacing: -.025em;
    }

    /* Tables remain readable and calm even when older views request table-dark. */
    .page-content thead.table-dark,
    .page-content .table-dark > tr,
    .page-content .table-dark > tr > th {
        --bs-table-bg: #f8fafc;
        --bs-table-color: #475569;
        --bs-table-border-color: #dbe4ef;
        background: #f8fafc !important;
        color: #475569 !important;
    }
    .page-content thead.table-dark th {
        font-size: .72rem;
        font-weight: 750;
        letter-spacing: .035em;
        text-transform: uppercase;
    }
    .page-content .card > .table-responsive:last-child,
    .page-content .card-body > .table-responsive:last-child { margin-bottom: 0; }
    .page-content .card.p-3 > .table-responsive {
        border: 0;
        border-radius: 10px;
        box-shadow: none;
    }

    /* Details, confirmations and long legacy forms. */
    .page-content dl.row { margin-bottom: 0; }
    .page-content dl.row dt {
        padding-top: .55rem;
        color: #64748b;
        font-size: .78rem;
        font-weight: 700;
    }
    .page-content dl.row dd {
        padding-top: .55rem;
        color: #0f172a;
        font-weight: 600;
    }
    .page-content .card-body > form > .row { row-gap: .15rem; }
    .page-content .card-body > form > .btn,
    .page-content .card-body > form > a.btn { margin-top: .35rem; }
    .page-content .form-check {
        min-height: 42px;
        padding-top: .62rem;
        padding-bottom: .45rem;
    }
    .page-content .alert { border-width: 1px; border-radius: 10px; }
}

@media (max-width: 767.98px) {
    .page-content .dashboard-card,
    .page-content .dashboard-card[class*="metric-"] { min-height: 102px; margin-bottom: .75rem; }
    .page-content .card-header.d-flex { align-items: flex-start !important; gap: .75rem; }
    .page-content .card-header.d-flex .btn { flex: 0 0 auto; }
}

/* User access management */
.user-table-card { overflow: hidden; }
.user-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.search-control {
    position: relative;
    width: min(100%, 320px);
}
.search-control > i {
    position: absolute;
    top: 50%;
    left: .78rem;
    z-index: 1;
    color: #94a3b8;
    transform: translateY(-50%);
}
.search-control .form-control { padding-left: 2.25rem; }
.user-email { color: #0f172a; font-weight: 650; }
.role-badge,
.status-dot,
.staff-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 700;
}
.role-badge {
    padding: .34rem .58rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}
.role-admin { background: #fef2f2; color: #b91c1c; }
.role-teacher { background: #eff6ff; color: #1d4ed8; }
.role-headteacher { background: #f5f3ff; color: #6d28d9; }
.role-bursar { background: #ecfdf5; color: #047857; }
.role-parent { background: #fff7ed; color: #c2410c; }
.status-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.status-dot.is-active { color: #047857; }
.status-dot.is-locked { color: #b91c1c; }
.staff-link { color: #334155; }
.table-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .4rem;
}
.table-actions form { margin: 0; }
.access-management-page { max-width: 1400px; }

@media (max-width: 767.98px) {
    .user-table-toolbar { align-items: stretch; flex-direction: column; }
    .search-control { width: 100%; }
    .table-actions { justify-content: flex-start; min-width: 250px; }
}

@media (max-width: 575.98px) {
    .page-header h1 {
        font-size: 1.28rem;
    }

    .metric-card {
        min-height: auto;
    }

    .report-tile {
        grid-template-columns: auto 1fr;
    }

    .report-tile-arrow {
        display: none;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--body-bg);
    color: var(--text-main);
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Sidebar */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-start) 0%, var(--sidebar-end) 100%);
    color: #fff;
    z-index: 1040;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar-header {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
    z-index: 2;
    backdrop-filter: blur(8px);
}

.brand-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    min-width: 0;
}

.brand-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    font-size: 1.15rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.brand-copy {
    min-width: 0;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-body {
    padding: 16px 0 28px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-group {
    margin-bottom: 12px;
}

.menu-group-toggle {
    width: calc(100% - 24px);
    margin: 8px 12px 6px;
    padding: 10px 14px;
    border: 0;
    outline: 0;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

    .menu-group-toggle:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

.menu-group:not(.collapsed) .menu-group-toggle {
    color: #e2e8f0;
}

.menu-group-toggle i {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.menu-group.collapsed .menu-group-toggle i {
    transform: rotate(-90deg);
}

.menu-group-links {
    overflow: hidden;
}

.menu-group.collapsed .menu-group-links {
    display: none;
}

.menu-link {
    margin: 0 12px;
    padding: 12px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d8e2f0;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

    .menu-link i {
        min-width: 20px;
        font-size: 1rem;
    }

    .menu-link span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .menu-link:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.08);
        transform: translateX(2px);
    }

    .menu-link.active {
        color: #fff;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
        box-shadow: 0 10px 22px rgba(29, 78, 216, 0.28);
    }

        .menu-link.active::before {
            content: "";
            position: absolute;
            left: -6px;
            top: 10px;
            bottom: 10px;
            width: 4px;
            border-radius: 999px;
            background: #93c5fd;
        }

.sidebar-collapse-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .sidebar-collapse-btn:hover {
        background: rgba(255, 255, 255, 0.16);
        color: #ffffff;
    }

/* Main shell */
.main-shell {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--topbar-height);
    padding: 14px 22px;
    display: grid;
    grid-template-columns: minmax(280px, 1.2fr) minmax(180px, 0.9fr) auto;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(12px);
}

.topbar-left, .topbar-center, .topbar-right {
    display: flex;
    align-items: center;
}

.topbar-center {
    justify-content: center;
}

.topbar-right {
    justify-content: flex-end;
}

.school-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.school-logo-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.school-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.school-brand-text {
    min-width: 0;
}

.school-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.school-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-heading {
    text-align: center;
}

.page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.page-subtitle {
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    color: inherit;
    max-width: 100%;
}

    .profile-chip::after {
        margin-left: 4px;
    }

.profile-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.profile-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.profile-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-dropdown {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    min-width: 240px;
}

    .profile-dropdown .dropdown-item {
        border-radius: 10px;
        padding: 10px 12px;
    }

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 1.3rem;
    margin-right: 12px;
}

    .menu-toggle:hover {
        background: var(--surface-soft);
    }

.page-content {
    padding: 24px;
}

    .page-content > .container, .page-content > .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

.card, .table, .stat-card, .summary-card, .chart-card, .modal-content, .dropdown-menu {
    border-radius: 18px;
}

.card, .table, .modal-content {
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-card);
}

.table {
    overflow: hidden;
    background: #fff;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1035;
    display: none;
}

    .mobile-overlay.show {
        display: block;
    }

/* Sidebar collapsed desktop */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .main-shell {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0 10px;
    flex-direction: column;
}

body.sidebar-collapsed .brand-link {
    justify-content: center;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .menu-link span,
body.sidebar-collapsed .menu-group-toggle span,
body.sidebar-collapsed .menu-group-toggle i {
    display: none !important;
}

body.sidebar-collapsed .menu-group-toggle {
    width: calc(100% - 24px);
    height: 8px;
    padding: 0;
    margin: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

body.sidebar-collapsed .menu-group-links {
    display: block !important;
}

body.sidebar-collapsed .menu-link {
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
}

    body.sidebar-collapsed .menu-link i {
        min-width: auto;
        font-size: 1.1rem;
    }

    body.sidebar-collapsed .menu-link.active::before {
        left: 6px;
    }

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.btn, .form-control, .form-select, .input-group-text {
    border-radius: 12px;
}

.form-control, .form-select {
    min-height: 42px;
}

.table thead th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    border-bottom-width: 1px;
}

.table td, .table th {
    vertical-align: middle;
}

.student-profile-section {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 24px;
    align-items: start;
    margin-bottom: 22px;
}

.student-photo-card {
    width: 140px;
    height: 160px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.student-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-bio {
    min-width: 0;
}

/* Responsive */
@media (max-width: 1199.98px) {
    .topbar {
        grid-template-columns: minmax(240px, 1fr) auto;
    }

    .topbar-center {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .main-shell, body.sidebar-collapsed .main-shell {
        margin-left: 0;
    }

    .topbar {
        grid-template-columns: 1fr auto;
        padding: 12px 16px;
        min-height: 74px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .school-tagline, .profile-role {
        display: none;
    }

    .page-content {
        padding: 16px;
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width);
    }

    body.sidebar-collapsed .sidebar-header {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 18px;
    }

    body.sidebar-collapsed .brand-copy,
    body.sidebar-collapsed .menu-link span,
    body.sidebar-collapsed .menu-group-toggle span,
    body.sidebar-collapsed .menu-group-toggle i {
        display: inline !important;
    }

    body.sidebar-collapsed .menu-group-toggle {
        height: auto;
        padding: 10px 14px;
        margin: 8px 12px 6px;
        background: transparent;
        pointer-events: auto;
    }

    body.sidebar-collapsed .menu-group.collapsed .menu-group-links {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .school-name {
        font-size: 0.92rem;
    }

    .profile-meta {
        display: none;
    }

    .profile-chip {
        padding-right: 8px;
        max-width: 64px;
    }

    .topbar-left, .topbar-right, .school-brand { min-width: 0; }

    .page-content {
        padding: 14px;
    }

    .student-profile-section {
        grid-template-columns: 1fr;
    }

    .student-photo-card {
        width: 120px;
        height: 140px;
    }

    .submenu-group {
        margin: 4px 12px;
    }

    .submenu-toggle {
        width: 100%;
        border: 0;
        outline: 0;
        background: rgba(255, 255, 255, 0.045);
        color: #cbd5e1;
        border-radius: 14px;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
        appearance: none;
    }

        .submenu-toggle span {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .submenu-toggle:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.08);
        }

        .submenu-toggle > i {
            transition: transform 0.2s ease;
        }

    .submenu-group.collapsed .submenu-toggle > i {
        transform: rotate(-90deg);
    }

    .submenu-group.collapsed .submenu-links {
        display: none;
    }

    .submenu-links {
        margin-top: 4px;
    }

    .submenu-link {
        margin-left: 10px;
        margin-right: 0;
        padding-left: 14px;
        font-size: 0.88rem;
    }

    /* =========================
   ACADEMICS SUBMENU FIX
   ========================= */

    .submenu-group {
        margin: 4px 12px;
    }

    .submenu-toggle {
        width: 100%;
        border: 0;
        outline: 0;
        background: rgba(255, 255, 255, 0.045);
        color: #cbd5e1;
        border-radius: 14px;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }

        .submenu-toggle span {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .submenu-toggle:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.08);
        }

        .submenu-toggle > i {
            transition: transform 0.2s ease;
        }

    .submenu-group.collapsed .submenu-toggle > i {
        transform: rotate(-90deg);
    }

    .submenu-links {
        margin-top: 4px;
    }

    .submenu-group.collapsed .submenu-links {
        display: none !important;
    }

    .submenu-link {
        margin-left: 10px;
        margin-right: 0;
        padding-left: 14px;
        font-size: 0.88rem;
    }

    /* Hide submenu label properly when full sidebar is minimized */
    body.sidebar-collapsed .submenu-toggle {
        display: none !important;
    }

    body.sidebar-collapsed .submenu-links {
        display: block !important;
    }

    body.sidebar-collapsed .submenu-link {
        margin-left: 12px;
        padding-left: 12px;
    }

    /* ==========================================
   ADMISSIONS DROPDOWN FIX ONLY
   ========================================== */

    .submenu-group {
        margin: 4px 12px;
    }

    /* Fix ugly white button issue */
    .submenu-toggle {
        width: 100%;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        background: transparent !important;
        color: #d8e2f0 !important;
        border-radius: 14px;
        padding: 12px 14px;
        display: flex;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        font-size: 0.95rem;
        font-weight: 500;
        transition: all 0.2s ease;
        appearance: none !important;
        -webkit-appearance: none !important;
        font-family: inherit;
    }

        /* Hover should behave like other menu items */
        .submenu-toggle:hover {
            color: #ffffff !important;
            background: rgba(255, 255, 255, 0.08) !important;
            transform: translateX(2px);
        }

        /* Admissions icon alignment */
        .submenu-toggle i:first-child {
            min-width: 20px;
            font-size: 1rem;
        }

        /* Text alignment */
        .submenu-toggle span {
            flex: 1;
            text-align: left;
            white-space: nowrap;
        }

    /* Arrow on right */
    .submenu-arrow {
        margin-left: auto;
        font-size: 0.85rem;
        transition: transform 0.2s ease;
    }

    /* Rotate arrow when open */
    .submenu-group.active .submenu-arrow {
        transform: rotate(180deg);
    }

    /* Hide submenu when collapsed */
    .submenu-group.collapsed .submenu-links {
        display: none !important;
    }

    /* Child links styling */
    .submenu-links {
        margin-top: 4px;
        margin-left: 32px;
        padding-left: 16px;
        border-left: 1px solid rgba(255,255,255,0.08);
    }

    .submenu-link {
        padding-left: 12px !important;
    }
}

/* Final override layer: keeps the refreshed shell consistent after legacy rules. */
body {
    background: var(--page-bg) !important;
    color: var(--text-main);
}

.page-content {
    padding: 28px;
}

.sidebar {
    background: linear-gradient(180deg, #111827 0%, #172033 48%, #1f2937 100%) !important;
}

.menu-link {
    border-radius: 8px !important;
    min-height: 42px;
    font-weight: 600;
}

.menu-link.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
}

.submenu-toggle {
    background: rgba(255, 255, 255, 0.045) !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
}

.submenu-links {
    margin: 6px 0 0 28px !important;
    padding-left: 12px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.12) !important;
}

body.sidebar-collapsed .submenu-toggle {
    display: none !important;
}

body.sidebar-collapsed .submenu-links {
    display: block !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: 0 !important;
}

.topbar {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid var(--border-soft) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.card,
.content-card,
.metric-card,
.report-tile,
.stat-card {
    border: 1px solid var(--border-soft) !important;
    border-radius: 8px !important;
    background: var(--surface);
    box-shadow: var(--shadow-soft) !important;
}

.card-header {
    background: var(--surface-soft) !important;
    border-bottom: 1px solid var(--border-soft) !important;
}

.table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.btn,
.form-control,
.form-select,
.alert {
    border-radius: 8px !important;
}

@media (max-width: 991.98px) {
    .page-content {
        padding: 20px 16px;
    }
}

/* ==========================================================
   SMIS UNIFIED UI SYSTEM
   Shared finishing layer for all Razor views and legacy pages.
   ========================================================== */
:root {
    --smis-primary: #2563eb;
    --smis-primary-hover: #1d4ed8;
    --smis-primary-soft: #eff6ff;
    --smis-success: #047857;
    --smis-danger: #b91c1c;
    --smis-warning: #b45309;
    --smis-info: #0369a1;
    --smis-radius-sm: 6px;
    --smis-radius: 10px;
    --smis-radius-lg: 14px;
    --smis-control-height: 42px;
    --smis-focus: 0 0 0 3px rgba(37, 99, 235, .18);
    --smis-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

html { scroll-behavior: smooth; }

body {
    font-size: .9375rem;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection { background: #bfdbfe; color: #0f172a; }

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 2000;
    padding: 10px 14px;
    border-radius: var(--smis-radius-sm);
    background: #fff;
    color: var(--smis-primary-hover);
    font-weight: 700;
    box-shadow: var(--smis-shadow);
    transform: translateY(-160%);
    transition: transform .15s ease;
}

.skip-link:focus { transform: translateY(0); }

a { text-underline-offset: 3px; }
a:not(.btn):not(.menu-link):not(.brand-link):not(.profile-chip) { text-decoration-thickness: 1px; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -.018em;
}

.page-content > :first-child { margin-top: 0; }
.page-content > .container,
.page-content > .container-fluid { max-width: 1600px; }

.page-content h1:not(.display-1):not(.display-2),
.page-content .h1 { font-size: clamp(1.5rem, 2vw, 1.9rem); }
.page-content h2, .page-content .h2 { font-size: clamp(1.25rem, 1.7vw, 1.55rem); }
.page-content h3, .page-content .h3 { font-size: 1.2rem; }
.text-muted { color: #64748b !important; }

/* Cards and content regions */
.card,
.content-card,
.metric-card,
.report-tile,
.stat-card,
.summary-card,
.chart-card,
.modal-content,
.offcanvas {
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--smis-radius) !important;
    box-shadow: var(--smis-shadow) !important;
}

.card-header,
.card-footer {
    padding: 1rem 1.25rem;
    background: #fff !important;
    border-color: var(--border-soft) !important;
}

.card-header:first-child { border-radius: calc(var(--smis-radius) - 1px) calc(var(--smis-radius) - 1px) 0 0 !important; }
.card-body { padding: 1.25rem; }
.card-title { margin-bottom: .4rem; font-weight: 750; }
.card-subtitle { color: var(--text-muted); }

/* Buttons and grouped actions */
.btn {
    min-height: 40px;
    padding: .52rem .9rem;
    border-radius: var(--smis-radius-sm) !important;
    font-size: .875rem;
    font-weight: 650;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    box-shadow: none;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--smis-primary); border-color: var(--smis-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--smis-primary-hover); border-color: var(--smis-primary-hover); }
.btn-light { background: #fff; border-color: #cbd5e1; color: #334155; }
.btn-outline-secondary { border-color: #cbd5e1; color: #475569; }
.btn-sm { min-height: 34px; padding: .38rem .68rem; font-size: .8125rem; }
.btn-lg { min-height: 48px; padding: .7rem 1.15rem; }
.btn-group > .btn { transform: none; }

/* Forms */
.form-label,
label:not(.form-check-label):not(.btn) {
    margin-bottom: .4rem;
    color: #334155;
    font-size: .875rem;
    font-weight: 650;
}

.form-control,
.form-select,
.input-group-text {
    min-height: var(--smis-control-height);
    border-color: #cbd5e1;
    border-radius: var(--smis-radius-sm) !important;
    font-size: .9rem;
}

.form-control,
.form-select { padding: .57rem .75rem; background-color: #fff; color: #0f172a; }
.form-control::placeholder { color: #94a3b8; opacity: 1; }
.form-control:hover:not(:disabled), .form-select:hover:not(:disabled) { border-color: #94a3b8; }
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn:focus-visible, a:focus-visible, button:focus-visible {
    border-color: #60a5fa;
    box-shadow: var(--smis-focus) !important;
    outline: none;
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background: #f1f5f9; color: #64748b; }
textarea.form-control { min-height: 110px; resize: vertical; }
.input-group > .form-control:not(:last-child), .input-group > .form-select:not(:last-child) { border-radius: var(--smis-radius-sm) 0 0 var(--smis-radius-sm) !important; }
.input-group > .btn:last-child, .input-group > .input-group-text:last-child { border-radius: 0 var(--smis-radius-sm) var(--smis-radius-sm) 0 !important; }
.form-text { color: #64748b; font-size: .8rem; }
.field-validation-error, .text-danger { color: var(--smis-danger) !important; }
.validation-summary-errors { padding: .85rem 1rem; border: 1px solid #fecaca; border-radius: var(--smis-radius-sm); background: #fef2f2; }

/* Tables */
.smis-table-responsive,
.table-responsive {
    border: 1px solid var(--border-soft);
    border-radius: var(--smis-radius);
    background: #fff;
    box-shadow: var(--smis-shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card .table-responsive,
.card .smis-table-responsive { border: 0; border-radius: 0; box-shadow: none; }

.table {
    width: 100%;
    margin-bottom: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #334155;
    font-size: .875rem;
}

.table > :not(caption) > * > * { padding: .78rem 1rem; border-bottom-color: #e8eef5; }
.table thead th {
    padding-top: .72rem;
    padding-bottom: .72rem;
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
}
.table tbody tr { transition: background-color .12s ease; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8fbff; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table caption { padding: .75rem 1rem; color: #64748b; }

/* Feedback, status and navigation */
.alert { border-width: 1px; border-radius: var(--smis-radius) !important; padding: .9rem 1rem; }
.alert-success { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; }
.alert-danger { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.alert-warning { color: #92400e; background: #fffbeb; border-color: #fde68a; }
.alert-info { color: #075985; background: #f0f9ff; border-color: #bae6fd; }
.badge { padding: .38em .62em; border-radius: 999px; font-size: .73rem; font-weight: 700; letter-spacing: .01em; }
.pagination { gap: .3rem; }
.page-link { min-width: 38px; min-height: 38px; display: grid; place-items: center; border-radius: var(--smis-radius-sm) !important; color: #334155; border-color: #dbe4ef; }
.page-item.active .page-link { background: var(--smis-primary); border-color: var(--smis-primary); }
.breadcrumb { margin-bottom: 1rem; font-size: .84rem; }
.nav-tabs { gap: .25rem; border-bottom-color: #dbe4ef; }
.nav-tabs .nav-link { padding: .7rem .9rem; border-radius: var(--smis-radius-sm) var(--smis-radius-sm) 0 0; color: #64748b; font-weight: 650; }
.nav-tabs .nav-link.active { color: var(--smis-primary-hover); }

/* Modal and dropdown refinement */
.modal-header, .modal-footer { padding: 1rem 1.25rem; border-color: var(--border-soft); }
.modal-body { padding: 1.25rem; }
.modal-title { font-size: 1.08rem; font-weight: 750; }
.dropdown-menu { padding: .45rem; border: 1px solid var(--border-soft); border-radius: var(--smis-radius) !important; box-shadow: 0 16px 38px rgba(15, 23, 42, .13); }
.dropdown-item { padding: .55rem .7rem; border-radius: var(--smis-radius-sm); font-size: .875rem; }
.dropdown-item:active { background: var(--smis-primary); }

/* Shell polish */
.sidebar { box-shadow: 8px 0 30px rgba(15, 23, 42, .09); }
.sidebar-collapse-btn, .menu-toggle { border-radius: var(--smis-radius-sm) !important; }
.topbar { min-height: 76px; padding-block: 11px; }
.page-content { width: 100%; max-width: 100%; }
.school-logo-wrap { border-radius: var(--smis-radius) !important; }
.profile-chip { border-radius: var(--smis-radius) !important; }

/* Account menu */
.profile-menu-wrap { position: relative; }
.profile-chip {
    min-height: 52px;
    border: 1px solid var(--border-soft);
    background: #fff;
    text-align: left;
    cursor: pointer;
}
.profile-chip:hover,
.profile-chip[aria-expanded="true"] {
    border-color: #bfdbfe;
    background: #f8fbff;
    box-shadow: 0 8px 24px rgba(15,23,42,.08);
}
.profile-chip:focus-visible { outline: 0; box-shadow: var(--smis-focus); }
.profile-dropdown {
    width: 286px;
    min-width: 286px;
    margin-top: 8px !important;
    padding: 8px !important;
    border: 1px solid #dbe4ef !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15,23,42,.16) !important;
    overflow: hidden;
}
.profile-dropdown-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 5px;
    padding: 10px;
    border-radius: 10px;
    background: #f8fafc;
}
.profile-dropdown-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 800;
}
.profile-dropdown-copy { min-width: 0; }
.profile-dropdown-name {
    overflow: hidden;
    color: #0f172a;
    font-size: .84rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-dropdown-role { margin-top: 1px; color: #64748b; font-size: .72rem; }
.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 10px !important;
    border-radius: 9px !important;
    color: #334155;
}
.profile-dropdown .dropdown-item:hover { background: #f1f5f9; color: #0f172a; }
.profile-dropdown .dropdown-item > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.profile-dropdown .dropdown-item strong { font-size: .82rem; font-weight: 700; }
.profile-dropdown .dropdown-item small { margin-top: 1px; color: #94a3b8; font-size: .69rem; }
.profile-action-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
}
.profile-dropdown-footer { margin-top: 5px; padding-top: 5px; border-top: 1px solid #e2e8f0; }
.profile-action-danger { background: #fef2f2; color: #dc2626; }
.profile-dropdown .text-danger:hover { background: #fff7f7; color: #b91c1c !important; }

/* Empty states and common utilities used by legacy views */
.empty-state { padding: clamp(2rem, 6vw, 4rem) 1.5rem; text-align: center; color: #64748b; }
.empty-state i { display: block; margin-bottom: .75rem; color: #94a3b8; font-size: 2.25rem; }
.action-bar, .filter-bar, .toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
hr { border-color: #dbe4ef; opacity: 1; }

@media (max-width: 767.98px) {
    body { font-size: .9rem; }
    .page-content { padding: 16px 12px; }
    .page-header { flex-direction: column; margin-bottom: 16px; }
    .page-actions { width: 100%; justify-content: flex-start; }
    .page-actions .btn { flex: 1 1 auto; }
    .card-body, .modal-body { padding: 1rem; }
    .card-header, .card-footer, .modal-header, .modal-footer { padding: .85rem 1rem; }
    .table > :not(caption) > * > * { padding: .7rem .78rem; }
    .topbar { min-height: 68px; }
}

@media (max-width: 575.98px) {
    .profile-dropdown {
        position: fixed !important;
        top: 70px !important;
        right: 12px !important;
        left: auto !important;
        width: min(286px, calc(100vw - 24px));
        min-width: 0;
        margin: 0 !important;
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
    .sidebar, .topbar, .mobile-overlay, .skip-link, .d-print-none { display: none !important; }
    .main-shell { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    body { background: #fff !important; }
    .card, .table-responsive, .smis-table-responsive { box-shadow: none !important; }
}

/* Legacy table normalization: remove spreadsheet-style vertical grids. */
.page-content .table-bordered > :not(caption) > * { border-width: 0; }
.page-content .table-bordered > :not(caption) > * > * {
    border-right-width: 0;
    border-left-width: 0;
}

/* Teacher alignment report */
.teacher-alignment-page { padding-top: 2px; }
.alignment-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}
.summary-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.25rem;
}
.summary-icon-primary { color: #1d4ed8; background: #eff6ff; }
.summary-icon-success { color: #047857; background: #ecfdf5; }
.summary-icon-danger { color: #b91c1c; background: #fef2f2; }
.summary-icon-warning { color: #b45309; background: #fffbeb; }
.summary-label {
    color: #64748b;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
}
.summary-value {
    margin-top: .1rem;
    color: #0f172a;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
}
.alignment-table-card { overflow: hidden; }
.alignment-table-card .table-responsive { border: 0; box-shadow: none; }
.alignment-table-card .record-count {
    flex: 0 0 auto;
    padding: .34rem .65rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: .76rem;
    font-weight: 700;
}
.alignment-table-card tbody tr.needs-attention > * { background: #fffafa; }
.alignment-table-card tbody tr.needs-attention:hover > * { background: #fff4f4; }
.teacher-name { color: #0f172a; font-weight: 700; }
.teacher-email { color: #475569; }
.student-count {
    display: inline-grid;
    min-width: 28px;
    height: 28px;
    padding-inline: .45rem;
    place-items: center;
    border-radius: 7px;
    background: #f1f5f9;
    color: #334155;
    font-size: .8rem;
    font-weight: 750;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    max-width: 230px;
    padding: .42rem .62rem;
    line-height: 1.25;
    white-space: normal;
    text-align: left;
}

.fee-status-page .summary-value small {
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
}
.fee-status-filters .btn { min-width: 96px; }
.fee-status-table-card { overflow: hidden; }
.fee-status-table-card .table-responsive { border: 0; border-radius: 0; box-shadow: none; }

@media (max-width: 575.98px) {
    .alignment-toolbar > form,
    .alignment-toolbar .btn { width: 100%; }
    .alignment-table-card .card-header { align-items: flex-start !important; }
}

/* Top-bar learner search (Ctrl+K) */
.quick-search-button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-right: 10px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; background: #fff; color: #475569; font-size: .88rem; font-weight: 600; }
.quick-search-button:hover { border-color: #14285c; color: #14285c; }
.quick-search-button kbd { background: #f1f5f9; color: #64748b; border-radius: 5px; padding: 1px 6px; font-size: .72rem; font-family: inherit; box-shadow: none; }
@media (max-width: 991.98px) { .quick-search-button span, .quick-search-button kbd { display: none; } .quick-search-button { width: 40px; justify-content: center; padding: 0; } }
.quick-search { width: min(640px, calc(100vw - 24px)); margin: 10vh auto auto; padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .3); }
.quick-search::backdrop { background: rgba(15, 23, 42, .45); }
.quick-search-box { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #e2e8f0; }
.quick-search-box i { color: #64748b; }
.quick-search-box input { flex: 1; border: 0; outline: 0; font-size: 1.05rem; min-width: 0; }
.quick-search-close { border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 6px; font-size: .75rem; color: #64748b; padding: 2px 8px; }
.quick-search-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.quick-search-hint { margin: 0; padding: 14px 12px; color: #64748b; font-size: .9rem; }
.quick-search-row { display: flex; align-items: center; gap: 8px; border-radius: 10px; }
.quick-search-item { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 9px 12px; border-radius: 10px; color: #1b2233; text-decoration: none; }
.quick-search-item strong { font-weight: 700; }
.quick-search-item small { grid-column: 1; color: #64748b; font-size: .8rem; }
.quick-search-item em { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: .8rem; font-weight: 700; color: #16805a; white-space: nowrap; }
.quick-search-item em.owes { color: #8a1c2b; }
.quick-search-item.active, .quick-search-item:hover { background: #eef2fb; }
.quick-search-links { display: flex; gap: 6px; padding-right: 6px; }
.quick-search-links a { font-size: .78rem; font-weight: 600; color: #14285c; text-decoration: none; border: 1px solid #cdd8f0; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.quick-search-links a:hover { background: #14285c; color: #fff; }
@media (max-width: 575.98px) { .quick-search-row { flex-wrap: wrap; } .quick-search-links { padding: 0 12px 8px; } }

/* Dashboards (staff, teacher, parent): shared look in the school crest colours */
.dash { --dash-navy: #14285c; --dash-gold: #c99a2e; --dash-maroon: #8a1c2b; --dash-ink: #1b2233; --dash-muted: #5d6475; --dash-line: #e6e8ef; }
.dash-hello { background: var(--dash-navy); color: #fff; border-radius: 14px; padding: 22px 26px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-bottom: 4px solid var(--dash-gold); }
.dash-hello h1 { font-size: 1.45rem; font-weight: 700; margin: 0; color: #fff; }
.dash-hello p { margin: 4px 0 0; color: #d6dcec; font-size: .92rem; }
.dash-role { display: inline-block; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 2px 10px; font-size: .78rem; margin: 6px 6px 0 0; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.dash-actions a { display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--dash-line); border-radius: 10px; padding: 8px 13px; color: var(--dash-ink); font-weight: 600; font-size: .88rem; text-decoration: none; }
.dash-actions a:hover { border-color: var(--dash-navy); color: var(--dash-navy); }
.dash-actions i { color: var(--dash-maroon); }
.dash-alerts { display: grid; gap: 8px; margin: 14px 0 4px; }
.dash-alert { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 10px 14px; text-decoration: none; font-weight: 600; font-size: .9rem; border: 1px solid; }
.dash-alert.danger { background: #fdecee; border-color: #f3c3c9; color: #8a1c2b; }
.dash-alert.warning { background: #fdf6e7; border-color: #ecd9a8; color: #7a5a12; }
.dash-alert.info { background: #eef2fb; border-color: #cdd8f0; color: #14285c; }
.dash-alert span { margin-left: auto; font-weight: 500; opacity: .8; }
.dash-section { margin-top: 26px; }
.dash-section > h2 { font-size: 1.05rem; font-weight: 700; color: var(--dash-navy); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.dash-section > h2 a { margin-left: auto; font-size: .85rem; font-weight: 600; color: var(--dash-maroon); text-decoration: none; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.dash-tile { background: #fff; border: 1px solid var(--dash-line); border-radius: 12px; padding: 14px 16px; border-left: 4px solid var(--dash-navy); }
.dash-tile.gold { border-left-color: var(--dash-gold); } .dash-tile.maroon { border-left-color: var(--dash-maroon); } .dash-tile.green { border-left-color: #16805a; }
.dash-tile small { display: block; color: var(--dash-muted); font-weight: 600; font-size: .8rem; }
.dash-tile strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--dash-ink); line-height: 1.3; }
.dash-tile em { font-style: normal; color: var(--dash-muted); font-size: .8rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 12px; margin-top: 12px; }
.dash-card { background: #fff; border: 1px solid var(--dash-line); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.dash-card h3 { font-size: .95rem; font-weight: 700; color: var(--dash-ink); margin: 0 0 10px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f0f1f5; font-size: .88rem; }
.dash-list li:last-child { border-bottom: 0; }
.dash-list b { font-weight: 600; color: var(--dash-ink); }
.dash-list small { color: var(--dash-muted); display: block; font-size: .78rem; }
.dash-list .num { white-space: nowrap; font-weight: 700; color: var(--dash-ink); text-align: right; }
.dash-empty { color: var(--dash-muted); font-size: .88rem; margin: 0; }
.dash-bar { display: grid; grid-template-columns: 90px 1fr 44px; gap: 8px; align-items: center; font-size: .84rem; padding: 3px 0; }
.dash-bar div { background: #eef1f8; border-radius: 4px; height: 10px; overflow: hidden; }
.dash-bar div i { display: block; height: 100%; background: var(--dash-navy); border-radius: 4px; }
.dash-progress { background: #eef1f8; border-radius: 6px; height: 12px; overflow: hidden; margin: 8px 0 4px; }
.dash-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--dash-gold), #16805a); }
@media (max-width: 576px) { .dash-hello { padding: 18px; } .dash-tiles { grid-template-columns: repeat(2, 1fr); } .dash-tile strong { font-size: 1.1rem; } }
.dash-hello .btn-light { font-weight: 600; }
.dash-chip { display: inline-block; background: #fdf6e7; color: #7a5a12; border: 1px solid #ecd9a8; border-radius: 999px; padding: 1px 9px; font-size: .75rem; font-weight: 700; }
.dash-class { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dash-class h3 span { color: var(--dash-muted); font-weight: 600; }
.dash-progress-row { align-items: center; }
.dash-progress-row > span:first-child { flex: 1 1 auto; min-width: 0; }
.dash-progress-inline { flex: 0 0 140px; margin: 0; height: 10px; }
.dash-child header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.dash-child header img, .dash-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: 0 0 52px; }
.dash-avatar { display: flex; align-items: center; justify-content: center; background: var(--dash-navy); color: #fff; font-weight: 700; }
.dash-child h3 { margin: 0; font-size: 1.05rem; }
.dash-code { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: #fdf6e7; border: 1px dashed #d9b766; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.dash-code small { flex-basis: 100%; color: #7a5a12; font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.dash-code strong { font-size: 1.35rem; letter-spacing: .08em; color: var(--dash-ink); margin-right: auto; }
.dash-child-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
@media (max-width: 576px) { .dash-progress-inline { flex-basis: 70px; } .dash-class { flex-wrap: wrap; } }
.dash-bar-wide { grid-template-columns: minmax(120px, 160px) 1fr 36px; }
