: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%; }
.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 {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    height: 36px;
    margin-left: auto;
    width: 36px;
}
.sidebar nav { display: grid; gap: 8px; }
.sidebar a {
    border-radius: 8px;
    color: #edf4ff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 14px;
}
.sidebar a:hover,
.sidebar a.active {
    background: var(--gold);
    color: var(--navy);
}
.sidebar.is-collapsed {
    flex-basis: 82px;
    width: 82px;
}
.sidebar.is-collapsed .brand {
    flex-direction: column;
    justify-content: center;
}
.sidebar.is-collapsed .brand > div:not(.brand-mark),
.sidebar.is-collapsed nav a {
    color: transparent;
    font-size: 0;
    overflow: hidden;
}
.sidebar.is-collapsed nav a {
    min-height: 42px;
    padding: 12px;
}
.sidebar.is-collapsed .sidebar-toggle {
    margin-left: 0;
}
body.sidebar-collapsed .app-footer {
    left: 82px;
}
.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 #e6ebf3;
    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: rgba(255,255,255,.98);
    color: var(--navy);
}
.student-header {
    background: rgba(255,255,255,.98);
    color: var(--navy);
}
.header-left {
    align-items: center;
    display: flex;
    gap: 18px;
    min-width: 0;
}
.header-title {
    font-weight: 900;
    font-size: 21px;
    color: var(--navy);
    white-space: nowrap;
}
.header-menu,
.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;
}
.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: #f6f8fc;
    border-color: var(--line);
    color: var(--navy);
}
.admin-header .icon-button {
    color: var(--navy);
}
.header-actions {
    align-items: center;
    display: flex;
    gap: 14px;
}
.profile-box {
    align-items: center;
    display: flex;
    gap: 10px;
}
.avatar {
    background: #e5e7eb;
    border-radius: 50%;
    color: #64748b;
    display: grid;
    font-size: 20px;
    height: 42px;
    place-items: center;
    width: 42px;
}
.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: #d71920;
    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: #fff1f1;
}
.app-footer {
    align-items: center;
    background: rgba(255,255,255,.96);
    border-top: 1px solid #edf0f6;
    color: #526173;
    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: #0074c8;
}
.footer-credit {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
    line-height: 1.1;
}
.footer-credit span {
    color: #7b8797;
    flex-basis: 100%;
    font-size: 8px;
    font-weight: 800;
    text-align: right;
}
.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 {
    background: #eaf8f0;
    border: 1px solid #b7e4ca;
    border-radius: 8px;
    color: #14633d;
    margin-bottom: 16px;
    padding: 12px 14px;
}
@media (max-width: 840px) {
    .app-shell { display: block; min-height: 100vh; }
    .sidebar {
        padding: 16px;
        position: sticky;
        top: 0;
        height: auto;
        width: 100%;
        z-index: 10;
    }
    .brand {
        margin-bottom: 14px;
    }
    .sidebar.is-collapsed .brand {
        flex-direction: row;
        margin-bottom: 0;
    }
    .sidebar.is-collapsed nav {
        display: none;
    }
    .sidebar.is-collapsed {
        flex-basis: auto;
        width: 100%;
    }
    body.sidebar-collapsed .app-footer,
    .app-footer {
        left: 0;
    }
    .sidebar.is-collapsed .brand > div:not(.brand-mark) {
        color: inherit;
        display: block;
        font-size: inherit;
    }
    .sidebar nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }
    .sidebar a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .content { padding: 18px 18px 64px; }
    .app-header {
        align-items: flex-start;
        flex-direction: column;
        margin: -18px -18px 18px;
        padding: 14px 18px;
        position: static;
    }
    .header-left {
        width: 100%;
    }
    .header-title {
        font-size: 18px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-actions {
        flex-wrap: wrap;
        width: 100%;
    }
    .header-pill {
        padding: 9px 12px;
    }
    .header-menu,
    .icon-button {
        height: 44px;
        width: 44px;
    }
    .app-footer {
        align-items: flex-start;
        flex-direction: column;
        margin: 0;
        min-height: 42px;
        padding: 6px 18px;
    }
    .footer-credit {
        justify-content: flex-start;
    }
    .footer-credit span {
        text-align: left;
    }
    .topbar { align-items: flex-start; flex-direction: column; }
    h1 { font-size: 24px; }
}
@media (max-width: 520px) {
    .content { padding: 14px 14px 64px; }
    .app-header {
        margin: -14px -14px 14px;
        padding: 12px 14px;
    }
    .header-left {
        gap: 10px;
    }
    .header-title {
        display: inline;
        font-size: 17px;
    }
    .header-actions {
        gap: 10px;
    }
    .profile-box {
        width: 100%;
    }
    .logout-button {
        text-align: center;
        width: 100%;
    }
    .app-footer {
        margin: 0;
        padding: 6px 14px;
    }
    .brand-mark {
        height: 36px;
        width: 36px;
    }
    .sidebar-logo {
        height: 36px;
        width: 36px;
    }
    .sidebar a {
        padding: 10px 12px;
    }
    .primary-link, .secondary-link, .actions button {
        justify-content: center;
        width: 100%;
    }
    h1 { font-size: 22px; }
    h2 { font-size: 17px; }
}
