/* ── Reset & base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f0f4f9;
    color: #3d4f63;
    -webkit-font-smoothing: antialiased;
}

/* ── Shell: 3-area CSS grid ───────────────── */
/*   [  topbar  |  topbar  ]                  */
/*   [ sidebar  |   main   ]                  */
.ampsc-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

/* ── Top bar (spans both columns) ─────────── */
.ampsc-topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    background: #ffffff;
    border-bottom: 1px solid #e2ebf4;
    box-shadow: 0 2px 12px rgba(11,34,64,.09);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 6px 24px;
}

/* Brand */
.ampsc-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
.ampsc-brand img {
    width: 52px; height: auto;
    border-radius: 10px; border: 0;
}
.ampsc-brand-kicker {
    font-size: 10px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase;
    color: #f4a32a; margin-bottom: 2px;
}
.ampsc-brand-title {
    font-size: 24px; font-weight: 800;
    color: #0b2240; line-height: 1.2; letter-spacing: -.01em;
}

/* Login panel */
.ampsc-login {
    flex-shrink: 0;
    padding: 11px 14px;
    background: #f4f8fc;
    border: 1px solid #d2e2f0;
    border-radius: 11px;
    font-size: 14px; color: #3d4f63;
    min-width: 250px;
}
.ampsc-login label {
    font-weight: 700; color: #0b2240;
    font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
}
.ampsc-login table { width: 100%; border-collapse: collapse; }
.ampsc-login td { padding: 2px 0; vertical-align: middle; }
.ampsc-login input[type="text"],
.ampsc-login input[type="password"] {
    width: 128px; padding: 6px 9px;
    border: 1px solid #c5d8ea; border-radius: 6px;
    font-size: 14px; background: #fff; color: #0b2240; outline: none;
}
.ampsc-login input[type="text"]:focus,
.ampsc-login input[type="password"]:focus {
    border-color: #1a6fd1;
    box-shadow: 0 0 0 3px rgba(26,111,209,.1);
}
.ampsc-login input[type="submit"] {
    padding: 6px 13px; border: 0; border-radius: 6px;
    background: #f4a32a; color: #0b2240;
    font-weight: 700; font-size: 13.5px; cursor: pointer; margin-left: 4px;
}
.ampsc-login input[type="submit"]:hover { background: #f9b23e; }
.ampsc-login a {
    color: #1a6fd1; text-decoration: none;
    font-weight: 600; font-size: 13.5px;
}
.ampsc-login a:hover { text-decoration: underline; }
.ampsc-login .welcome { font-size: 15px; font-weight: 700; color: #0b2240; }

/* ── Sidebar (left column, row 2) ─────────── */
.ampsc-sidebar {
    grid-column: 1;
    grid-row: 2;
    background: #0b2240;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: calc(100vh - 163px); /* minus topbar height (150px logo + 12px padding + 1px border) */
    overflow-y: auto;
    scrollbar-width: none;
}
.ampsc-sidebar::-webkit-scrollbar { display: none; }

/* Nav */
.sb-nav { flex: 1; padding: 12px 10px; }
.sb-nav ul { list-style: none; }
.sb-nav > ul > li { margin-bottom: 2px; }

.sb-nav > ul > li > a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px;
    color: rgba(255,255,255,.76);
    font-size: 13px; font-weight: 600;
    text-decoration: none; border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background .13s, color .13s, border-color .13s;
}
.sb-nav > ul > li > a:hover,
.sb-nav > ul > li.is-open > a {
    background: rgba(255,255,255,.08);
    color: #fff; border-left-color: #f4a32a;
}
.sb-caret {
    font-size: 10px; opacity: .5; flex-shrink: 0; margin-left: 4px;
    transition: transform .2s;
}
.sb-nav > ul > li.is-open > a .sb-caret { transform: rotate(90deg); opacity: 1; }

.sb-sub { display: none; padding: 3px 0 6px 14px; }
.sb-nav > ul > li.is-open > .sb-sub { display: block; }
.sb-sub li { margin-bottom: 1px; }
.sb-sub a {
    display: block; padding: 6px 10px;
    color: rgba(255,255,255,.52);
    font-size: 12px; font-weight: 500; text-decoration: none;
    border-radius: 6px; border-left: 2px solid transparent;
    transition: background .12s, color .12s, border-color .12s;
}
.sb-sub a:hover {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.9);
    border-left-color: rgba(244,163,42,.5);
}

/* ── Main content column (shared by all pages) ───── */
.ampsc-main {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    background: #f0f4f9;
    display: flex;
    flex-direction: column;
}

/* Page padding */
.pg {
    padding: 28px 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

/* Card base */
.card {
    background: #fff;
    border: 1px solid #d2e2f0;
    border-radius: 16px;
}

/* Kicker */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #f4a32a;
    margin-bottom: 10px;
}
.kicker::before {
    content: '';
    width: 14px; height: 2px;
    background: #f4a32a;
    border-radius: 2px;
}

/* Footer note */
.foot-note { text-align: center; font-size: 11.5px; color: #6b7e93; }

/* ── Generic content card (text-heavy pages) ─────── */
.content { padding: 26px 30px; }
.content h1 {
    font-size: 22px; font-weight: 800; color: #0b2240;
    letter-spacing: -.01em; margin-bottom: 14px;
}
.content h2 {
    font-size: 15.5px; font-weight: 700; color: #0b2240;
    margin: 20px 0 8px;
}
.content p {
    font-size: 13.5px; line-height: 1.75; color: #3d4f63;
    margin-bottom: 12px;
}
.content ul, .content ol { margin: 0 0 12px 20px; }
.content li { font-size: 13.5px; line-height: 1.75; color: #3d4f63; margin-bottom: 4px; }
.content a { color: #1a6fd1; font-weight: 600; text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content strong { color: #0b2240; }
.content table { border-collapse: collapse; width: 100%; margin-bottom: 14px; }
.content table th, .content table td {
    text-align: left; padding: 8px 10px; font-size: 13px;
    border-bottom: 1px solid #e2ebf4;
}
.content table th { color: #0b2240; font-weight: 700; }

/* Link list (e.g. "Location", "Instructor" sub-page links) */
.link-list { list-style: none; }
.link-list li { margin-bottom: 8px; }
.link-list a {
    display: inline-flex; align-items: center; gap: 8px;
    color: #1a6fd1; font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.link-list a:hover { text-decoration: underline; }
.link-list a::before { content: '\203A'; color: #f4a32a; font-weight: 800; }

/* ── Mobile: keep the side-by-side layout, just narrow the sidebar ── */
@media (max-width: 768px) {
    .ampsc-shell {
        grid-template-columns: 130px 1fr;
        min-height: 0;
    }
    .ampsc-main, .pg, .card { min-width: 0; }
    .pg { padding: 14px 12px 20px; }

    /* Topbar: stack brand + login vertically */
    .ampsc-topbar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }
    .ampsc-brand { flex-shrink: 1; min-width: 0; }
    .ampsc-brand img { width: 40px !important; flex-shrink: 0; }
    .ampsc-brand > div { min-width: 0; flex: 1 1 auto; }
    .ampsc-brand-title {
        font-size: 15px;
        overflow-wrap: break-word;
        word-break: break-word;
        white-space: normal;
    }
    .ampsc-login { min-width: 0; width: 100%; }

    /* Sidebar: same vertical nav as desktop, just narrower */
    .ampsc-sidebar {
        position: static;
        height: auto;
        overflow: visible;
    }
    .sb-nav { padding: 10px 6px; }
    .sb-nav > ul > li > a {
        padding: 8px 8px;
        font-size: 12px;
    }
    .sb-sub { padding: 3px 0 6px 8px; }
    .sb-sub a { padding: 6px 8px; font-size: 11px; }

    /* Legacy pages (registration form, old tables) can be wider than the
       screen — scroll them within their own card instead of widening the
       whole page and breaking the side-by-side layout. */
    .content { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
    .ampsc-shell {
        grid-template-columns: 104px 1fr;
    }
    .sb-nav > ul > li > a {
        padding: 7px 6px;
        font-size: 11px;
    }
    .sb-caret { font-size: 9px; }
}
