/* The frame: sidebar, top bar, content column, and the sign-in layout. ------- */

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: var(--vh-full);
}

/* ---------------------------------------------------------------- sidebar ---- */
.sidebar {
    position: sticky;
    top: 0;
    height: var(--vh-full);
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
    padding: var(--s-5) var(--s-3) var(--s-4);
    background: var(--surface);
    border-right: 1px solid var(--line);
    z-index: 40;
}

.brand { display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-2); color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .28);
    display: grid; place-items: center;
}
.brand__mark svg { width: 34px; height: 34px; display: block; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); letter-spacing: -0.02em; line-height: 1.1; }
.brand__sub { display: block; font-family: var(--font-ui); font-weight: 500; font-size: var(--fs-2xs); color: var(--ink-3); letter-spacing: .02em; text-transform: uppercase; margin-top: 2px; }

.nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-4); }
.nav__group { display: flex; flex-direction: column; gap: 2px; }
.nav__label {
    font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-4); padding: 0 var(--s-3) var(--s-1);
}
.nav__link {
    position: relative;
    display: flex; align-items: center; gap: var(--s-3);
    padding: 5px var(--s-3) 5px 6px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-weight: 500;
    transition: background .15s var(--ease), color .15s var(--ease);
}
/* Each section has its own pastel tile and two-colour icon, so the menu reads at a glance. */
.nav__icon {
    width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px;
    display: grid; place-items: center;
    background: var(--t-bg); box-shadow: inset 0 0 0 1px var(--t-edge);
    transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.nav__icon .i { width: 17px; height: 17px; vertical-align: 0; --i2-o: .55; }
.nav__link:hover { background: var(--sunken); color: var(--ink); }
.nav__link:hover .nav__icon { transform: translateY(-1px); }
.nav__link.is-active { background: var(--violet-bg); color: var(--violet-ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--violet-edge); }
.nav__link.is-active .nav__icon { background: var(--surface); box-shadow: inset 0 0 0 1px var(--t-edge), 0 1px 3px rgba(27, 24, 52, .12); }
.nav__link.is-active::before {
    content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav__count {
    margin-left: auto; min-width: 20px; padding: 0 6px; height: 18px; border-radius: var(--r-full);
    font-size: var(--fs-2xs); font-weight: 700; display: grid; place-items: center;
    background: var(--rose-bg); color: var(--rose-ink); box-shadow: inset 0 0 0 1px var(--rose-edge);
}

.sidebar__foot { border-top: 1px solid var(--line-soft); padding-top: var(--s-3); }
.me { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2); border-radius: var(--r-md); }
.me__name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; }
.me__role { font-size: var(--fs-2xs); color: var(--ink-3); }

/* ----------------------------------------------------------------- topbar ---- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: var(--s-3);
    padding: 0 var(--s-6);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.6) blur(12px);
    -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-base); color: var(--ink-2); }
.topbar__title b { color: var(--ink); }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.menu-toggle { display: none; }

.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s-6) var(--s-6) var(--s-12); }

/* --------------------------------------------------------------- page head ---- */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
    margin-bottom: var(--s-5);
}
.page-head__eyebrow { font-size: var(--fs-xs); font-weight: 600; color: var(--accent-ink); letter-spacing: .02em; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.page-head__title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.025em; }
.page-head__sub { margin-top: 6px; color: var(--ink-3); font-size: var(--fs-sm); max-width: 72ch; }
.page-head__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ------------------------------------------------------------- auth layout ---- */
.auth {
    min-height: var(--vh-full);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background: var(--surface);
}
.auth__art {
    position: relative; overflow: hidden;
    padding: var(--s-10);
    display: flex; flex-direction: column; justify-content: space-between;
    background:
        radial-gradient(60% 60% at 15% 20%, #e7defe 0%, transparent 70%),
        radial-gradient(50% 55% at 85% 30%, #fde2ee 0%, transparent 70%),
        radial-gradient(60% 60% at 60% 90%, #dcf3e8 0%, transparent 70%),
        #faf8ff;
    border-right: 1px solid var(--line);
}
.auth__panel { display: grid; place-items: center; padding: var(--s-10) var(--s-6); }
.auth__card { width: 100%; max-width: 400px; }
.auth__title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.auth__lede { color: var(--ink-3); margin-bottom: var(--s-6); }
.auth__quote { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; max-width: 18ch; color: var(--ink); }
.auth__points { display: grid; gap: var(--s-3); margin-top: var(--s-6); max-width: 360px; }
.auth__point { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); background: rgba(255, 255, 255, .78); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); font-weight: 500; }

/* Onboarding uses the same shell without the art column. */
.wizard { min-height: var(--vh-full); background: var(--page); padding: var(--s-8) var(--s-4) var(--s-12); }
.wizard__inner { max-width: 760px; margin: 0 auto; }

/* ------------------------------------------------------------- responsive ---- */
@media (max-width: 960px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed; left: 0; top: 0; width: min(280px, calc(86vw / var(--ui-zoom)));
        transform: translateX(-100%); transition: transform .2s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(27, 24, 52, .35); z-index: 35; }
    .menu-toggle { display: inline-flex; }
    .topbar { padding: 0 var(--s-4); }
    .content { padding: var(--s-4) var(--s-4) var(--s-10); }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth__art { display: none; }
}
/* Two-paper students: on a phone the CS · DA · Both switch takes the breadcrumb's place. */
@media (max-width: 560px) {
    .topbar:has(.focus-switch) .topbar__title { display: none; }
    .focus-switch button { padding: 4px 8px; }
}
.auth__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--s-6); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); }
.auth__back:hover { color: var(--ink); }

/* Sign-up: anchored to the top and tighter, so showing the join code field adds a little
   height below instead of pushing the whole card around or off the screen. */
.auth__panel--top { place-items: start center; padding-top: var(--s-8); padding-bottom: var(--s-8); }
.auth__panel--top .auth__back { margin-bottom: var(--s-4); }
.auth__panel--top .auth__lede { margin-bottom: var(--s-4); }
.auth__panel--top .divider { margin: var(--s-3) 0; }
