:root {
    --ink: #172033;
    --muted: #687083;
    --line: #e6e9ef;
    --paper: #ffffff;
    --soft: #f5f7fb;
    --accent: #1f6feb;
    --accent-strong: #144fb2;
    --nav: #101827;
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    background: var(--soft);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--nav);
    color: #fff;
    padding: 28px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 30px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 14px 35px rgba(31, 111, 235, .18);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, .78);
    border-radius: 8px;
    padding: 11px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
}

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

.content {
    padding: 30px;
}

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

.account-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.account-avatar {
    color: var(--accent);
    font-size: 1.35rem;
}

.account-card strong,
.account-card span {
    display: block;
}

.account-card span {
    color: var(--muted);
    font-size: .82rem;
}

.topbar h1,
.login-copy h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.eyebrow {
    color: var(--accent);
    font-size: .75rem;
    font-weight: 800;
}

.panel,
.stat-card,
.login-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(17, 24, 39, .06);
}

.panel {
    padding: 22px;
}

.panel h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 22px;
}

.stat-card i {
    color: var(--accent);
    font-size: 1.35rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-top: 12px;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.actions {
    white-space: nowrap;
}

.actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.actions form {
    display: inline-block;
    margin: 0 0 0 6px;
}

.actions > .btn + .btn,
.actions > .btn + form,
.actions > form + .btn,
.actions > form + form {
    margin-left: 6px;
}

.btn {
    border-radius: 8px;
    font-weight: 700;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

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

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(120deg, rgba(31, 111, 235, .12), rgba(30, 161, 123, .08)),
        #f7f9fd;
}

.login-panel {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 28px;
    align-items: center;
}

.login-copy {
    padding: 28px;
}

.login-copy p {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 560px;
}

.login-card {
    padding: 28px;
}

.login-card h2 {
    font-weight: 800;
    margin-bottom: 20px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    color: var(--muted);
    font-size: .82rem;
    text-transform: uppercase;
}

.student-list-scroll {
    max-height: min(46vh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #9fb3d9 #edf2f9;
}

.student-list-scroll--available {
    max-height: min(36vh, 320px);
}

.student-list-scroll:focus {
    outline: 3px solid rgba(31, 111, 235, .18);
    outline-offset: 3px;
}

.student-list-scroll::-webkit-scrollbar {
    width: 10px;
}

.student-list-scroll::-webkit-scrollbar-track {
    background: #edf2f9;
    border-radius: 999px;
}

.student-list-scroll::-webkit-scrollbar-thumb {
    background: #9fb3d9;
    border: 2px solid #edf2f9;
    border-radius: 999px;
}

.student-list-scroll::-webkit-scrollbar-thumb:hover {
    background: #6f8fc8;
}

.student-list-scroll .list-group-item {
    gap: 12px;
}

.student-list-scroll .list-group-item > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 992px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
    }
    .stats-grid,
    .grid-two,
    .login-panel {
        grid-template-columns: 1fr;
    }
    .content {
        padding: 20px;
    }
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .account-bar {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .student-list-scroll,
    .student-list-scroll--available {
        max-height: 340px;
    }
}
