:root {
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --panel: #ffffff;
    --brand: #0f766e;
    --brand-dark: #134e4a;
    --accent: #f59e0b;
    --surface: #f5f7fb;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background: var(--surface);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, sans-serif;
}

body.sidebar-open {
    overflow: hidden;
}

.logo-wrapper{
    width:120px;
    height:120px;
    margin:auto;
    border-radius:50%;
    background:#ffffff;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
}

.school-logo{
    width:90px;
    height:90px;
    object-fit:contain;
}
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    z-index: 1040;
    background: linear-gradient(180deg, var(--brand-dark), var(--brand));
    color: #fff;
    padding: 18px;
    overflow-y: auto;
    transition: transform .24s ease;
}

.sidebar-backdrop {
    display: none;
}

.sidebar-close,
.mobile-menu-btn {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 8px 22px;
    border-bottom: 1px solid rgba(255,255,255,.18);
    margin-bottom: 14px;
}

.sidebar-close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    background: rgba(255,255,255,.16);
    color: #fff;
}

.sidebar-close:hover {
    background: rgba(255,255,255,.26);
}

.brand > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.brand-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,.16);
    font-size: 24px;
}

.brand strong,
.brand span {
    display: block;
    line-height: 1.35;
}

.brand span {
    font-size: 13px;
    opacity: .82;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,.88);
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
    background: rgba(255,255,255,.16);
    color: #fff;
}

.app-main {
    margin-left: 280px;
    padding: 28px;
    transition: margin-left .24s ease;
}

body.sidebar-collapsed .app-sidebar {
    transform: translateX(-105%);
}

body.sidebar-collapsed .app-main {
    margin-left: 0;
}

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

.topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mobile-menu-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(31,41,55,.06);
    font-size: 22px;
}

.mobile-menu-btn:hover {
    background: #f9fafb;
}

.topbar h1 {
    font-size: 28px;
    font-weight: 750;
    margin: 0;
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(31,41,55,.06);
    white-space: nowrap;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(31,41,55,.06);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.panel-body {
    padding: 20px;
}

.stat {
    min-height: 124px;
}

.stat .icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #ecfdf5;
    color: var(--brand);
    font-size: 22px;
}

.stat strong {
    display: block;
    font-size: 30px;
}

.table > :not(caption) > * > * {
    padding: .85rem .75rem;
    vertical-align: middle;
}

.form-label {
    font-weight: 650;
    color: #374151;
}

.btn {
    border-radius: 8px;
}

.footer {
    color: var(--muted);
    font-size: 13px;
    margin-top: 28px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(120deg, rgba(15,118,110,.92), rgba(19,78,74,.88)),
        radial-gradient(circle at 80% 10%, rgba(245,158,11,.3), transparent 28%);
    padding: 24px;
}

.login-card {
    width: min(440px, 100%);
    background: #fff;
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,.22);
}

@media (max-width: 900px) {
    .app-sidebar {
        width: min(320px, 86vw);
        transform: translateX(-105%);
        box-shadow: 26px 0 70px rgba(15, 23, 42, .25);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }

    .sidebar-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .app-main {
        margin-left: 0;
        padding: 18px;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .topbar h1 {
        font-size: 22px;
        line-height: 1.25;
    }

    .user-pill {
        width: 100%;
        justify-content: flex-start;
        white-space: normal;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-header .btn,
    .panel-header .d-flex {
        width: 100%;
    }

    .panel-header .d-flex {
        flex-wrap: wrap;
    }

    .panel-header .d-flex .btn {
        flex: 1 1 180px;
    }

    .table {
        min-width: 720px;
        font-size: 14px;
    }

    .login-card {
        padding: 24px;
    }
}

@media (max-width: 520px) {
    .app-main {
        padding: 14px;
    }

    .panel-body,
    .panel-header {
        padding: 16px;
    }

    .topbar-title {
        align-items: flex-start;
    }
}
