
:root {
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-footer: #ffffff;

    --sidebar-bg: #065f46;
    --sidebar-bg-dark: #064e3b;
    --sidebar-border: #047857;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: #047857;
    --sidebar-text: #d1fae5;
    --sidebar-text-hover: #ffffff;
    --sidebar-text-active: #ffffff;
    --sidebar-dropdown-bg: rgba(4, 120, 87, 0.25);
    --sidebar-user-bg: #064e3b;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.10);

    --green-400: #34d399;
    --green-500: #10b981;
    --green-600: #059669;
    --green-700: #047857;
    --green-800: #065f46;
    --green-900: #064e3b;
    --green-950: #042f2e;

    --radius: 12px;
    --transition: 0.25s ease;

    --header-height: 64px;
    --sidebar-width-open: 256px;
    --sidebar-width-closed: 72px;
    --sidebar-width: var(--sidebar-width-open);
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    --bg-footer: #1e293b;

    --sidebar-bg: #042f2e;
    --sidebar-bg-dark: #022c22;
    --sidebar-border: #065f46;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: #047857;
    --sidebar-dropdown-bg: rgba(4, 120, 87, 0.20);
    --sidebar-user-bg: #022c22;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    --border-color: #334155;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.5);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Poppins", sans-serif !important;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition), padding-left var(--transition);
    padding-top: var(--header-height);
    padding-left: var(--sidebar-width);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}
ul {
    list-style: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--green-600);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--green-700);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: width 0.3s ease, transform 0.3s ease, background var(--transition);
    overflow: hidden;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 18px;
    background: var(--sidebar-bg-dark);
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    transition: background var(--transition);
}

.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-header .brand i {
    font-size: 22px;
    color: var(--green-400);
    flex-shrink: 0;
}
.sidebar-header .brand span {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
    transition: opacity 0.2s ease, width 0.2s ease;
    opacity: 1;
}

body.sidebar-closed .sidebar-header .brand span {
    opacity: 0;
    width: 0;
    display: inline-block;
    overflow: hidden;
}

.sidebar-header .toggle-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: color var(--transition);
    flex-shrink: 0;
}
.sidebar-header .toggle-btn:hover {
    color: #fff;
}
body.sidebar-closed .sidebar-header .toggle-btn .fa-chevron-left {
    transform: rotate(180deg);
}
.sidebar-header .toggle-btn .fa-chevron-left {
    transition: transform 0.3s ease;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px 20px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.sidebar-nav .nav-item {
    margin-bottom: 2px;
    border-radius: 10px;
    transition: background var(--transition);
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    position: relative;
    white-space: nowrap;
}

.sidebar-nav .nav-link i:first-child {
    width: 20px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
    color: var(--sidebar-text);
    transition: color var(--transition);
}

.sidebar-nav .nav-link .nav-text {
    flex: 1;
    transition: opacity 0.2s ease;
    opacity: 1;
}

body.sidebar-closed .sidebar-nav .nav-link .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    display: inline-block;
}

.sidebar-nav .nav-link .nav-arrow {
    font-size: 11px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: var(--sidebar-text);
    opacity: 0.6;
}

body.sidebar-closed .sidebar-nav .nav-link .nav-arrow {
    display: none;
}

.sidebar-nav .nav-link .nav-arrow.open {
    transform: rotate(180deg);
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}
.sidebar-nav .nav-link:hover i:first-child {
    color: #fff;
}

.sidebar-nav .nav-item.active>.nav-link {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}
.sidebar-nav .nav-item.active>.nav-link i:first-child {
    color: #fff;
}

.sidebar-nav .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    opacity: 0;
    padding: 0 0 0 16px;
    margin-left: 12px;
    border-left: 2px solid rgba(255, 255, 255, 0.10);
}

body.sidebar-closed .sidebar-nav .submenu {
    padding-left: 0;
    margin-left: 0;
    border-left: none;
}

.sidebar-nav .submenu.open {
    max-height: 300px;
    opacity: 1;
    padding: 6px 0 6px 16px;
}

body.sidebar-closed .sidebar-nav .submenu.open {
    padding: 6px 0;
}

.sidebar-nav .submenu .nav-item .nav-link {
    padding: 8px 14px 8px 12px;
    font-size: 13px;
    font-weight: 400;
    color: var(--sidebar-text);
    border-radius: 8px;
    gap: 12px;
}

.sidebar-nav .submenu .nav-item .nav-link i:first-child {
    font-size: 14px;
    width: 18px;
    opacity: 0.7;
}

.sidebar-nav .submenu .nav-item .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav .submenu .nav-item .nav-link:hover i:first-child {
    color: #fff;
    opacity: 1;
}

.sidebar-nav .submenu .nav-item.active>.nav-link {
    background: var(--sidebar-active);
    color: #fff;
}
.sidebar-nav .submenu .nav-item.active>.nav-link i:first-child {
    color: #fff;
    opacity: 1;
}

body.sidebar-closed .sidebar-nav .submenu .nav-item .nav-link .nav-text {
    opacity: 0;
    width: 0;
    display: inline-block;
    overflow: hidden;
}

.sidebar-user {
    flex-shrink: 0;
    padding: 14px 16px;
    background: var(--sidebar-user-bg);
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background var(--transition), padding var(--transition);
}

.sidebar-user .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-user .user-info {
    overflow: hidden;
    transition: opacity 0.2s ease;
    opacity: 1;
}

body.sidebar-closed .sidebar-user .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    display: inline-block;
}

.sidebar-user .user-info .user-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.sidebar-user .user-info .user-role {
    font-size: 12px;
    color: var(--green-400);
    white-space: nowrap;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 2px solid var(--green-600);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 20px;
    z-index: 1000;
    transition: background var(--transition), border-color var(--transition), left var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-left .logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--green-600);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-left .logo i {
    font-size: 22px;
    color: var(--green-500);
}
.header-left .logo span {
    color: var(--text-primary);
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-right .theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: all var(--transition);
}
.header-right .theme-toggle:hover {
    background: rgba(16, 185, 129, 0.10);
    color: var(--green-600);
    border-color: var(--green-500);
}

.header-right .user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 8px;
    border-radius: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
}
.header-right .user-badge:hover {
    box-shadow: var(--shadow-hover);
}
.header-right .user-badge .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green-600);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}
.header-right .user-badge .name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.header-right .user-badge .chevron {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    padding: 14px 28px;
    font-size: 13px;
    color: var(--text-muted);
    transition: background var(--transition), border-color var(--transition);
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.footer a {
    color: var(--green-600);
    font-weight: 500;
}
.footer a:hover {
    text-decoration: underline;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding: 24px 28px 28px;
    flex: 1;
    transition: padding var(--transition), background var(--transition);
}

.page {
    display: none;
    animation: fadeUp 0.35s ease;
}
.page.active {
    display: block;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(14px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}
.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.stat-card .stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 6px 0 4px;
}
.stat-card .stat-change {
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--green-600);
}
.stat-card .stat-change.down {
    background: #fde8e8;
    color: #c0392b;
}
[data-theme="dark"] .stat-card .stat-change.down {
    background: rgba(192, 57, 43, 0.20);
    color: #e74c3c;
}
.stat-card .stat-icon {
    float: right;
    font-size: 32px;
    opacity: 0.12;
    color: var(--green-600);
}

/* ===== CARDS & CHARTS ===== */
.row-2col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 20px 22px;
    transition: background var(--transition), border-color var(--transition);
}

.card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card .card-title i {
    margin-right: 8px;
    color: var(--green-500);
}

.card .card-title .badge-title {
    font-size: 11px;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.10);
    color: var(--green-600);
    padding: 2px 10px;
    border-radius: 20px;
}

.chart-container {
    height: 220px;
    position: relative;
}

/* ===== ACTIVITY LIST ===== */
.activity-list .activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.activity-list .activity-item:last-child {
    border-bottom: 0;
}
.activity-item .act-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.10);
    color: var(--green-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.activity-item .act-text {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
}
.activity-item .act-text strong {
    color: var(--text-primary);
}
.activity-item .act-time {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== DATATABLE ===== */
.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.table-toolbar .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px 16px 4px 14px;
    transition: all var(--transition);
}
.table-toolbar .search-box:focus-within {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.table-toolbar .search-box input {
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    width: 200px;
    font-family: inherit;
}
.table-toolbar .search-box input::placeholder {
    color: var(--text-muted);
}
.table-toolbar .search-box i {
    color: var(--text-muted);
    font-size: 14px;
}

.table-toolbar .entries-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data-table thead {
    background: var(--bg-body);
    border-bottom: 2px solid var(--border-color);
}
table.data-table thead th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
table.data-table thead th i {
    margin-left: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
table.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition);
}
table.data-table tbody tr:last-child {
    border-bottom: 0;
}
table.data-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.05);
}
table.data-table tbody td {
    padding: 12px 18px;
    color: var(--text-secondary);
    vertical-align: middle;
}
table.data-table tbody td .badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge.active {
    background: #d4edda;
    color: #155724;
}
.badge.inactive {
    background: #f8d7da;
    color: #721c24;
}
.badge.pending {
    background: #fff3cd;
    color: #856404;
}
[data-theme="dark"] .badge.active {
    background: rgba(16, 185, 129, 0.20);
    color: #34d399;
}
[data-theme="dark"] .badge.inactive {
    background: rgba(192, 57, 43, 0.20);
    color: #f87171;
}
[data-theme="dark"] .badge.pending {
    background: rgba(245, 158, 11, 0.20);
    color: #fbbf24;
}

.table-actions {
    display: flex;
    gap: 6px;
}
.table-actions button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 14px;
}
.table-actions button:hover {
    background: rgba(16, 185, 129, 0.10);
    color: var(--green-600);
}
.table-actions button.danger:hover {
    background: #fde8e8;
    color: #c0392b;
}
[data-theme="dark"] .table-actions button.danger:hover {
    background: rgba(192, 57, 43, 0.20);
    color: #f87171;
}

/* ===== PROFILE ===== */
.profile-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition);
}
.profile-card .avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--green-600);
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border: 4px solid rgba(16, 185, 129, 0.15);
}
.profile-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
.profile-card .role {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}
.profile-card .divider {
    margin: 18px 0;
    border-top: 1px solid var(--border-color);
}
.profile-card .info-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}
.profile-card .info-item .label {
    color: var(--text-muted);
}

.profile-details .card {
    margin-bottom: 20px;
}
.profile-details .card:last-child {
    margin-bottom: 0;
}

.settings-list .setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.settings-list .setting-item:last-child {
    border-bottom: 0;
}
.setting-item .setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
}
.setting-item .setting-label i {
    width: 28px;
    color: var(--green-500);
    font-size: 16px;
}
.setting-item .setting-label .title {
    font-weight: 500;
    color: var(--text-primary);
}
.setting-item .setting-label .desc {
    font-size: 13px;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-color);
    border-radius: 30px;
    transition: all var(--transition);
}
.toggle-switch .slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all var(--transition);
}
.toggle-switch input:checked+.slider {
    background: var(--green-500);
}
.toggle-switch input:checked+.slider::before {
    transform: translateX(20px);
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.dot.green {
    background: var(--green-500);
}
.dot.red {
    background: #dc3545;
}
.dot.yellow {
    background: #f59e0b;
}

/* ===== SCHOOL ANALYTICS ===== */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.filter-bar .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-bar .filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-bar .filter-group select,
.filter-bar .filter-group input {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.filter-bar .filter-group select:focus,
.filter-bar .filter-group input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
}

.filter-bar .filter-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.filter-bar .filter-actions button {
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.filter-bar .filter-actions .btn-primary {
    background: var(--green-600);
    color: #fff;
}
.filter-bar .filter-actions .btn-primary:hover {
    background: var(--green-700);
}

.filter-bar .filter-actions .btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.filter-bar .filter-actions .btn-outline:hover {
    background: var(--bg-body);
}

.chart-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.top-schools-list .school-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.top-schools-list .school-item:last-child {
    border-bottom: 0;
}

.school-item .rank {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    width: 24px;
    text-align: center;
}

.school-item .school-info {
    flex: 1;
}

.school-item .school-info .school-name {
    font-weight: 500;
    color: var(--text-primary);
}

.school-item .school-info .school-location {
    font-size: 12px;
    color: var(--text-muted);
}

.school-item .school-score {
    font-weight: 600;
    color: var(--green-600);
}

.progress-bar {
    width: 80px;
    height: 6px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--green-500);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .row-2col {
        grid-template-columns: 1fr;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .chart-grid-2col {
        grid-template-columns: 1fr;
    }
    .filter-bar .filter-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width-open: 0px;
        --sidebar-width-closed: 0px;
    }

    body {
        padding-left: 0 !important;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        border-right: none;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.20);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }

    body.sidebar-closed .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }
    body.sidebar-closed .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-header .brand span {
        opacity: 1 !important;
        width: auto !important;
        display: inline !important;
    }
    .sidebar-nav .nav-link .nav-text {
        opacity: 1 !important;
        width: auto !important;
        display: inline !important;
    }
    .sidebar-nav .nav-link .nav-arrow {
        display: inline !important;
    }
    .sidebar-nav .submenu {
        padding-left: 16px !important;
        margin-left: 12px !important;
        border-left: 2px solid rgba(255, 255, 255, 0.10) !important;
    }
    .sidebar-nav .submenu .nav-item .nav-link .nav-text {
        opacity: 1 !important;
        width: auto !important;
        display: inline !important;
    }
    .sidebar-user .user-info {
        opacity: 1 !important;
        width: auto !important;
        display: inline !important;
    }

    .header,
    .footer {
        left: 0 !important;
    }

    .header {
        padding: 0 16px;
        border-bottom-width: 2px;
    }
    .footer {
        padding: 14px 16px;
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .header-left .logo span {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .table-toolbar .search-box input {
        width: 100%;
    }
    .header-right .user-badge .name {
        display: none;
    }
    .header-right .user-badge .chevron {
        display: none;
    }

    .hamburger {
        display: flex !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 998;
        background: rgba(0, 0, 0, 0.40);
    }
    .sidebar-overlay.show {
        display: block;
    }

    .sidebar-header .toggle-btn {
        display: none !important;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .filter-actions {
        justify-content: stretch;
    }
    .filter-bar .filter-actions button {
        flex: 1;
    }
    .chart-grid-2col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .main-content {
        padding: 16px;
    }
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

/* ===== TRANSITIONS ===== */
* {
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), opacity 0.2s ease;
}
.sidebar * {
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), max-height 0.35s ease, opacity 0.25s ease, transform 0.3s ease, padding 0.25s ease;
}
.sidebar-header .brand span,
.sidebar-nav .nav-link .nav-text,
.sidebar-nav .nav-link .nav-arrow,
.sidebar-user .user-info {
    transition: opacity 0.2s ease, width 0.2s ease;
}
/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group label .required {
    color: #dc3545;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.school-form .btn-primary {
    background: var(--green-600);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}
.school-form .btn-primary:hover {
    background: var(--green-700);
}

.school-form .btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.school-form .btn-outline:hover {
    background: var(--bg-body);
}

@media (max-width: 768px) {
    .school-form > div:first-child {
        grid-template-columns: 1fr !important;
    }
}
@media (min-width: 769px) {
    body.sidebar-closed .sidebar-nav .submenu {
        padding-left: 0 !important;
        margin-left: 0 !important;
        border-left: none !important;
    }
    body.sidebar-closed .sidebar-nav .submenu.open {
        padding: 6px 0 !important;
    }
    body.sidebar-closed .sidebar-nav .nav-link .nav-arrow {
        display: none !important;
    }
}
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 8px;
    border-radius: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
}

.user-badge:hover {
    box-shadow: var(--shadow-hover);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.15s;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-body);
    color: var(--green-600);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
}

.dropdown-divider {
    margin: 6px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Dark mode adjustments */
[data-theme="dark"] .dropdown-menu {
    background: var(--bg-card);
}

[data-theme="dark"] .dropdown-item:hover {
    background: var(--bg-body);
}