:root {
    --navy: #082657;
    --navy-dark: #031a3d;
    --gold: #f6c400;
    --green: #36a56f;
    --blue: #3157d6;
    --ink: #111827;
    --muted: #6b7280;
    --line: #d8deea;
    --soft: #f5f7fb;
    --white: #ffffff;
}

* { box-sizing: border-box; }
html {
    min-width: 320px;
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Arial, Helvetica, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
svg {
    display: inline-block;
    flex-shrink: 0;
    max-height: 32px;
    max-width: 32px;
}
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px;
    flex: 0 0 230px;
    background: linear-gradient(180deg, var(--navy), var(--navy-dark));
    color: var(--white);
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.sidebar-logo {
    display: block;
    height: 42px;
    object-fit: contain;
    width: 42px;
}
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: var(--gold);
    color: var(--navy);
    font-weight: 800;
}
.brand span { display: block; color: #dbe6ff; font-size: 12px; margin-top: 2px; }
.sidebar-toggle {
    align-items: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    display: grid;
    height: 36px;
    margin-left: auto;
    place-items: center;
    width: 36px;
}
.sidebar-toggle {
    display: none;
}
.sidebar nav { display: grid; gap: 8px; }
.sidebar a {
    align-items: center;
    border-radius: 8px;
    color: #edf4ff;
    display: flex;
    font-size: 15px;
    font-weight: 600;
    gap: 10px;
    padding: 12px 14px;
}
.nav-icon {
    display: none;
    flex: 0 0 auto;
    line-height: 1;
}
.nav-label {
    min-width: 0;
}
.sidebar a:hover,
.sidebar a.active {
    background: var(--gold);
    color: var(--navy);
}
.sidebar.is-collapsed {
    flex-basis: 0;
    overflow: hidden;
    padding-left: 0;
    padding-right: 0;
    transform: translateX(-100%);
    width: 0;
}
.sidebar.is-collapsed .brand {
    flex-direction: column;
    justify-content: center;
}
.sidebar.is-collapsed .brand > div:not(.brand-mark),
.sidebar.is-collapsed .nav-label {
    color: transparent;
    font-size: 0;
    overflow: hidden;
}
.sidebar.is-collapsed nav a {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 42px;
    padding: 12px;
    position: relative;
    text-align: center;
}
.sidebar.is-collapsed .nav-icon {
    color: #edf4ff;
    display: grid;
    font-size: 17px;
    font-weight: 900;
    place-items: center;
}
.sidebar.is-collapsed nav a.active .nav-icon,
.sidebar.is-collapsed nav a:hover .nav-icon {
    color: var(--navy);
}
.sidebar.is-collapsed .sidebar-toggle {
    margin-left: 0;
}
body.sidebar-collapsed .app-footer {
    left: 0;
}
.sidebar-backdrop {
    background: rgba(8, 38, 87, .42);
    inset: 0;
    position: fixed;
    z-index: 19;
}
.sidebar-backdrop[hidden] {
    display: none;
}
.content { flex: 1; padding: 0 36px 56px; min-width: 0; }
.content.narrow { max-width: none; width: 100%; }
.app-header {
    align-items: center;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
    border-radius: 0;
    box-shadow: none;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 0 -36px 28px;
    min-height: 74px;
    padding: 13px 36px;
    position: sticky;
    top: 0;
    z-index: 8;
}
.admin-header {
    background: var(--navy);
    color: var(--white);
}
.student-header {
    background: var(--navy);
    color: var(--white);
}
.header-left {
    align-items: center;
    display: flex;
    gap: 18px;
    min-width: 0;
}
.header-title {
    font-weight: 900;
    font-size: 21px;
    color: var(--white);
    white-space: nowrap;
}
.icon-button {
    background: #f6f8fc;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    font-size: 20px;
    height: 42px;
    place-items: center;
    width: 42px;
}
.header-menu {
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    display: grid;
    font-size: 20px;
    height: 42px;
    place-items: center;
    width: 42px;
}
.icon-button svg {
    fill: none;
    height: 21px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 21px;
}
.admin-header .header-menu,
.admin-header .icon-button,
.student-header .header-menu,
.student-header .icon-button {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.22);
    color: var(--white);
}
.admin-header .icon-button {
    color: var(--white);
}
.header-actions {
    align-items: center;
    display: flex;
    gap: 14px;
}
.notification-menu {
    position: relative;
}
.notification-menu summary {
    list-style: none;
    position: relative;
}
.notification-menu summary::-webkit-details-marker {
    display: none;
}
.notification-menu summary b {
    align-items: center;
    background: #f6c400;
    border: 2px solid var(--navy);
    border-radius: 999px;
    color: var(--navy);
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    height: 19px;
    justify-content: center;
    line-height: 1;
    min-width: 19px;
    padding: 0 5px;
    position: absolute;
    right: -7px;
    top: -7px;
}
.notification-panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(8, 38, 87, .18);
    color: var(--navy);
    max-height: min(420px, calc(100vh - 92px));
    overflow-y: auto;
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(340px, calc(100vw - 24px));
    z-index: 30;
}
.notification-head {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 4px 4px 10px;
}
.notification-head strong {
    font-size: 14px;
    font-weight: 900;
}
.notification-head button {
    background: #edf3ff;
    border: 0;
    border-radius: 8px;
    color: var(--blue);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    padding: 8px 10px;
}
.notification-panel article {
    border-bottom: 1px solid #eef2f8;
    padding: 12px 4px;
}
.notification-panel article:last-child {
    border-bottom: 0;
}
.notification-panel article.unread {
    background: #f8fbff;
}
.notification-panel article span {
    color: var(--navy);
    display: block;
    font-size: 13px;
    font-weight: 900;
}
.notification-panel article p,
.notification-empty {
    color: #5f6f88;
    font-size: 12px;
    line-height: 1.45;
    margin: 5px 0;
}
.notification-panel article small {
    color: #8b97aa;
    font-size: 11px;
    font-weight: 800;
}
.profile-box {
    align-items: center;
    color: var(--white);
    display: flex;
    gap: 10px;
    text-decoration: none;
}
.avatar {
    background: #e5e7eb;
    border-radius: 50%;
    color: #64748b;
    display: grid;
    font-size: 20px;
    height: 42px;
    place-items: center;
    overflow: hidden;
    width: 42px;
}
.avatar img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}
.avatar svg {
    fill: currentColor;
    height: 22px;
    width: 22px;
}
.profile-box strong {
    color: inherit;
    display: block;
    font-size: 14px;
    line-height: 1.1;
}
.profile-box span {
    color: currentColor;
    display: block;
    font-size: 11px;
    margin-top: 3px;
    opacity: .72;
}
.profile-box .profile-caret {
    font-size: 18px;
    font-weight: 900;
    margin-left: 2px;
    margin-top: 0;
    opacity: .8;
}
.logout-button {
    align-items: center;
    background: transparent;
    border-radius: 8px;
    color: #ff2d3d;
    display: grid;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 42px;
}
.logout-button svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 22px;
}
.logout-button:hover {
    background: rgba(255,255,255,.12);
}
.app-footer {
    align-items: center;
    background: var(--navy);
    border-top: 1px solid rgba(255,255,255,.12);
    color: #dbe6ff;
    display: flex;
    font-size: 11px;
    gap: 12px;
    justify-content: space-between;
    margin: 0;
    min-height: 34px;
    padding: 4px 36px;
    position: fixed;
    left: 230px;
    right: 0;
    bottom: 0;
    z-index: 7;
}
.app-footer strong {
    color: var(--gold);
}
.footer-credit {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    line-height: 1.1;
    text-align: center;
}
.footer-credit span {
    color: #dbe6ff;
    flex-basis: 100%;
    font-size: 8px;
    font-weight: 800;
    text-align: center;
}
.footer-credit strong {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .2px;
}
.footer-credit .dev-mark {
    color: #111827;
    text-transform: none;
}
.footer-credit .dev-mark em {
    color: #d71920;
    font-style: normal;
}
.footer-credit i {
    background: #d8dee8;
    display: block;
    height: 10px;
    width: 1px;
}
.topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.page-heading {
    margin-bottom: 26px;
}
.page-heading h1 {
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: 8px;
}
.breadcrumb {
    align-items: center;
    color: #8390a4;
    display: flex;
    flex-wrap: wrap;
    font-size: 15px;
    gap: 10px;
    margin-bottom: 8px;
}
.breadcrumb a {
    color: #1d6fbf;
    font-weight: 900;
}
.breadcrumb b {
    color: #9aa5b6;
    font-weight: 700;
}
.page-heading p {
    margin-bottom: 0;
}
h1, h2, p { margin-top: 0; }
h1 { color: var(--navy); font-size: 28px; margin-bottom: 6px; }
h2 { color: var(--navy); font-size: 18px; margin-bottom: 10px; }
p { color: var(--muted); line-height: 1.55; }
.panel, .progress-card, .final-banner, .final-overview {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(8, 38, 87, .06);
}
.primary-link, .secondary-link, .actions button {
    border: 0;
    border-radius: 8px;
    background: var(--gold);
    color: var(--navy);
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    padding: 12px 16px;
}
.secondary-link { background: #eef2f8; }
.bar {
    background: #e6ebf3;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.bar span { background: var(--gold); display: block; height: 100%; }
.bar.is-complete span { background: var(--green); }
.bar.is-low span { background: #dc2626; }
.alert,
.success-alert {
    background: #eaf8f0;
    border: 1px solid #b7e4ca;
    border-radius: 8px;
    color: #14633d;
    margin-bottom: 16px;
    padding: 12px 14px;
}
@media (max-width: 840px) {
    body.sidebar-open {
        overflow: hidden;
    }
    .app-shell {
        display: block;
        min-height: 100vh;
    }
    .sidebar {
        box-shadow: 18px 0 40px rgba(3, 26, 61, .22);
        height: 100vh;
        left: 0;
        max-width: min(64vw, 230px);
        overflow-y: auto;
        padding: 18px 16px;
        position: fixed;
        top: 0;
        transform: translateX(-102%);
        transition: transform .22s ease;
        width: 230px;
        z-index: 30;
    }
    .sidebar.is-open {
        transform: translateX(0);
    }
    .brand {
        align-items: center;
        gap: 10px;
        justify-content: flex-start;
        margin-bottom: 28px;
        min-height: 38px;
        position: relative;
    }
    .sidebar-logo {
        height: 34px;
        width: 34px;
    }
    .brand strong {
        font-size: 14px;
    }
    .brand span {
        font-size: 10px;
    }
    .sidebar-toggle {
        display: none;
    }
    .header-menu {
        display: grid;
        height: 40px;
        width: 40px;
    }
    .sidebar nav {
        display: grid;
        gap: 8px;
        height: auto;
        max-width: none;
        overflow: visible;
        padding: 0;
        position: static;
        transform: none;
        transition: none;
        width: auto;
    }
    .sidebar a {
        flex: initial;
        font-size: 14px;
        gap: 10px;
        min-height: 44px;
        padding: 12px 14px;
        white-space: normal;
    }
    .nav-icon {
        display: none;
    }
    .sidebar.is-collapsed nav {
        display: grid;
    }
    .sidebar.is-collapsed {
        flex-basis: auto;
        width: 230px;
    }
    .sidebar.is-collapsed .brand {
        flex-direction: row;
        margin-bottom: 28px;
    }
    .sidebar.is-collapsed .brand > div:not(.brand-mark),
    .sidebar.is-collapsed .nav-label {
        color: inherit;
        font-size: inherit;
        overflow: visible;
    }
    .app-footer {
        left: 0;
        margin: 0;
        min-height: 36px;
        padding: 5px 16px;
    }
    body.sidebar-collapsed .app-footer {
        left: 0;
    }
    .content {
        padding: 0 18px 64px;
    }
    .app-header {
        align-items: center;
        gap: 12px;
        margin: 0 -18px 18px;
        min-height: 54px;
        padding: 8px 18px;
        position: sticky;
        top: 0;
        z-index: 16;
    }
    .header-left {
        flex: 0 1 auto;
        min-width: 0;
    }
    .header-title {
        display: inline;
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-actions {
        flex: 1 0 auto;
        gap: 10px;
        justify-content: flex-end;
        min-width: 0;
    }
    .icon-button {
        height: 40px;
        width: 40px;
    }
    .app-footer > span:first-child {
        display: none;
    }
    .footer-credit {
        justify-content: center;
        margin-left: auto;
    }
    .footer-credit span {
        text-align: center;
    }
    .topbar { align-items: flex-start; flex-direction: column; }
    h1 { font-size: 24px; }
}
@media (max-width: 520px) {
    .sidebar {
        max-width: min(62vw, 210px);
        padding: 16px 14px;
        width: 210px;
    }
    .sidebar.is-collapsed {
        width: 210px;
    }
    .brand {
        justify-content: flex-start;
        min-height: 38px;
    }
    .sidebar-logo {
        height: 30px;
        width: 30px;
    }
    .brand strong {
        font-size: 13px;
    }
    .brand span {
        font-size: 9px;
    }
    .header-menu {
        height: 38px;
        width: 38px;
    }
    .content {
        padding: 0 10px 64px;
    }
    .app-header {
        margin: 0 -10px 14px;
        min-height: 50px;
        padding: 7px 10px;
        top: 0;
    }
    .header-left {
        display: flex;
        max-width: 165px;
    }
    .header-title {
        font-size: 16px;
    }
    .header-actions {
        gap: 8px;
    }
    .header-actions > .icon-button {
        display: none;
    }
    .notification-menu .icon-button {
        display: grid;
        height: 34px;
        width: 34px;
    }
    .notification-panel {
        right: -96px;
        top: calc(100% + 8px);
        width: min(300px, calc(100vw - 20px));
    }
    .profile-box {
        gap: 7px;
        max-width: 158px;
        min-width: 0;
    }
    .avatar {
        font-size: 16px;
        height: 34px;
        width: 34px;
    }
    .profile-box > div:last-child {
        min-width: 0;
    }
    .profile-box strong,
    .profile-box span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .logout-button {
        height: 34px;
        width: 34px;
    }
    .logout-button svg {
        height: 20px;
        width: 20px;
    }
    .app-footer {
        padding: 6px 10px;
    }
    .sidebar a {
        font-size: 13px;
        padding: 11px 13px;
    }
    .primary-link, .secondary-link, .actions button {
        justify-content: center;
        width: 100%;
    }
    h1 { font-size: 22px; }
    h2 { font-size: 17px; }
}

@media (max-width: 620px) {
    body {
        -webkit-font-smoothing: antialiased;
        text-rendering: geometricPrecision;
    }
    .sidebar {
        box-shadow: 18px 0 40px rgba(3, 26, 61, .22);
        padding-bottom: 16px;
        padding-top: 16px;
    }
    .brand {
        min-height: 34px;
    }
    .brand strong {
        letter-spacing: .01em;
        line-height: 1.05;
    }
    .brand span {
        line-height: 1.05;
    }
    .sidebar nav {
        gap: 7px;
    }
    .sidebar a {
        border-radius: 7px;
        font-size: 13px;
        font-weight: 800;
        line-height: 1.1;
        padding: 11px 13px;
    }
    .app-header {
        backdrop-filter: blur(10px);
        box-shadow: 0 8px 18px rgba(15, 35, 75, .05);
        min-height: 48px;
    }
    .header-title {
        font-size: 15px;
        letter-spacing: .01em;
    }
    .profile-box strong {
        font-size: 12px;
    }
    .profile-box span {
        font-size: 10px;
    }
}

.app-confirm-open {
    overflow: hidden;
}
.app-confirm-backdrop {
    align-items: center;
    background: rgba(9, 16, 31, .62);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 1000;
}
.app-confirm-backdrop[hidden] {
    display: none;
}
.app-confirm-card {
    background: #fff;
    border: 1px solid #fecdd3;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(225, 29, 72, .08), 0 0 32px rgba(225, 29, 72, .38), 0 22px 60px rgba(2, 8, 23, .28);
    max-width: 430px;
    padding: 26px;
    text-align: center;
    width: min(100%, 430px);
}
.app-confirm-icon {
    align-items: center;
    background: #fff1f2;
    border: 1px solid #fb7185;
    border-radius: 999px;
    color: #e11d48;
    display: inline-flex;
    font-size: 22px;
    font-weight: 1000;
    height: 46px;
    justify-content: center;
    margin-bottom: 14px;
    width: 46px;
}
.app-confirm-card h2 {
    color: var(--navy);
    font-size: 24px;
    margin: 0 0 10px;
}
.app-confirm-card p {
    color: #475569;
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}
.app-confirm-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
}
.app-confirm-actions button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 900;
    min-height: 46px;
    padding: 0 18px;
}
.app-confirm-primary {
    background: #e11d48;
    color: #fff;
    box-shadow: 0 10px 22px rgba(225, 29, 72, .22);
}
.app-confirm-secondary {
    background: #eef2f8;
    color: var(--navy);
}

@media (max-width: 520px) {
    .app-confirm-card {
        padding: 22px;
    }
    .app-confirm-actions {
        grid-template-columns: 1fr;
    }
}
