:root {
    --navy: #172b4d;
    --navy-2: #12223d;
    --navy-line: #244173;
    --blue: #2855a6;
    --blue-2: #356ae6;
    --page: #f5f7fa;
    --white: #ffffff;
    --text: #182230;
    --muted: #667085;
    --line: #e4e7ec;
    --hover: #f2f5f9;
    --green: #16805d;
    --green-bg: #eaf7f0;
    --amber: #a8640a;
    --amber-bg: #fff5e5;
    --red: #c43232;
    --red-bg: #fdecec;
    --soft: #eff5ff;
    --shadow: 0 1px 2px rgba(23, 43, 77, 0.06);
    --rail: 248px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--page);
}

h1, h2, h3, p { margin: 0; }
h1:focus { outline: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.ico { width: 18px; height: 18px; fill: currentColor; flex: none; }

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--rail) 1fr;
}

.shell.slim { --rail: 76px; }

.rail {
    background: var(--navy);
    color: #d5deea;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1f3863;
}

.rail .brand {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    background: var(--navy-2);
    border-bottom: 1px solid var(--navy-line);
}

.mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #356ae6;
    position: relative;
    flex: none;
}

.mark:before,
.mark:after {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    height: 3px;
    border-radius: 2px;
    background: white;
}

.mark:before { top: 9px; }
.mark:after { top: 16px; width: 10px; }

.word { font-weight: 700; color: white; letter-spacing: 0.2px; }
.shell.slim .word,
.shell.slim .nav-label,
.shell.slim .sub,
.shell.slim .account strong,
.shell.slim .account small { display: none; }

.rail-btn {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #9aabc0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
}

.rail-btn:hover { background: #1e3760; color: white; }

.nav {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto;
    flex: 1;
}

.nav-btn, .nav a, .sub a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #c5d0de;
    border-radius: 8px;
    min-height: 36px;
    padding: 0 10px;
    cursor: pointer;
    text-align: left;
}

.nav-btn:hover, .nav a:hover, .sub a:hover { background: #1f3762; color: white; }
.nav a.active, .sub a.active, .nav-btn.on {
    background: var(--blue);
    color: white;
    font-weight: 650;
}

.sub {
    margin: 2px 0 6px 16px;
    padding-left: 10px;
    border-left: 1px solid var(--navy-line);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account {
    margin: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #12223d;
    display: flex;
    gap: 8px;
    align-items: center;
}

.account div { min-width: 0; }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.account strong { color: white; font-size: 13px; }
.account small { color: #9aabc0; font-size: 12px; }
.account a { color: #c5d0de; margin-left: auto; }

.stage { min-width: 0; }
.top {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.school-name { font-weight: 700; color: var(--navy); }
.school-name span { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.spacer { flex: 1; }

.icon-btn, .text-btn {
    border: 1px solid var(--line);
    background: white;
    color: var(--text);
    border-radius: 8px;
    min-height: 36px;
    padding: 0 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.icon-btn { width: 36px; padding: 0; justify-content: center; color: var(--muted); }
.icon-btn:hover, .text-btn:hover { background: var(--hover); }
.primary {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.content { padding: 22px; }

.pop {
    position: absolute;
    right: 18px;
    top: 58px;
    width: 240px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
}

.pop button, .pop a {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.pop button:hover, .pop a:hover { background: var(--hover); }

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .rail {
        position: fixed;
        inset: 0 auto 0 0;
        width: 260px;
        z-index: 20;
        transform: translateX(-105%);
    }
    .shell.open .rail { transform: none; }
    .shell.slim { --rail: 248px; }
    .shell.slim .word, .shell.slim .nav-label, .shell.slim .sub { display: initial; }
}

#blazor-error-ui {
    background: #fff8d6;
    bottom: 0;
    display: none;
    left: 0;
    padding: 12px 16px;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 12px;
}
