:root {
    --portal-blue: #123d70;
    --portal-blue-deep: #082b4b;
    --portal-blue-soft: #e9f2fa;
    --portal-gold: #e8b641;
    --portal-gold-deep: #bc8420;
    --portal-ink: #10283e;
    --portal-muted: #5e7182;
    --portal-surface: #ffffff;
    --portal-canvas: #f4f7fa;
    --portal-border: #dce5ec;
    --portal-shadow: 0 22px 55px rgba(12, 45, 75, .12);
    --portal-radius: 24px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-width: 0;
    overflow-x: hidden;
    color: var(--portal-ink);
    background: var(--portal-canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; }

.skip-link {
    position: fixed;
    z-index: 1000;
    left: 1rem;
    top: -5rem;
    padding: .7rem 1rem;
    background: #fff;
    color: #082b4b;
    border-radius: .5rem;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
    outline: 3px solid #f4c65d;
    outline-offset: 3px;
}

.portal-header {
    position: relative;
    z-index: 50;
    color: var(--portal-header-text, #fff);
    background: linear-gradient(120deg, var(--portal-header, #123d70), #082b4b 80%);
    border-bottom: 5px solid var(--portal-gold);
    box-shadow: 0 9px 28px rgba(5, 37, 65, .18);
}

.portal-header-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.portal-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .8rem;
    color: inherit;
    text-decoration: none;
    flex: 1 1 auto;
}

.portal-logo-wrap {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    padding: .32rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .16);
}
.portal-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }

.portal-brand-copy { min-width: 0; display: grid; line-height: 1.15; }
.portal-brand-copy strong { font-size: clamp(1.15rem, 4.6vw, 1.7rem); letter-spacing: -.03em; }
.portal-brand-copy small {
    margin-top: .35rem;
    font-size: .72rem;
    color: rgba(255, 255, 255, .78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 44vw;
}

.portal-nav-desktop { display: none; align-items: center; gap: 1.6rem; }
.portal-nav-desktop a { color: inherit; text-decoration: none; font-weight: 650; }
.portal-nav-desktop a:hover { color: #ffe2a0; }

.portal-header-actions { display: flex; align-items: center; gap: .55rem; flex: 0 0 auto; }
.portal-login, .portal-menu-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem .85rem;
    color: inherit;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 13px;
    text-decoration: none;
    font-weight: 700;
    font-size: .78rem;
}
.portal-login:hover, .portal-menu-button:hover { background: rgba(255, 255, 255, .16); }
.portal-menu-button { cursor: pointer; }
.login-long { display: none; }
.login-short { display: inline; }
.menu-lines { display: grid; gap: 3px; width: 18px; }
.menu-lines i { height: 2px; background: currentColor; border-radius: 5px; }

.portal-mobile-menu {
    padding: .55rem max(1rem, calc((100vw - 1320px) / 2));
    background: #082b4b;
}
.portal-mobile-menu[hidden] { display: none; }
.portal-mobile-menu a {
    display: block;
    padding: .9rem 1rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.eyebrow {
    margin: 0 0 .7rem;
    color: #0b7a75;
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.portal-hero {
    position: relative;
    min-height: 510px;
    display: flex;
    align-items: flex-end;
    isolation: isolate;
    overflow: hidden;
    background: var(--portal-blue-deep);
}
.portal-hero-media, .portal-hero-shade { position: absolute; inset: 0; z-index: -2; }
.portal-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.portal-hero-shade {
    z-index: -1;
    background: linear-gradient(90deg, rgba(4, 31, 55, .96) 0%, rgba(6, 43, 76, .82) 54%, rgba(6, 43, 76, .28) 100%);
}
.portal-hero-content { padding-top: 5.2rem; padding-bottom: 5.5rem; color: #fff; }
.portal-hero .eyebrow { color: #ffd675; }
.portal-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.35rem, 8.5vw, 5rem);
    font-weight: 850;
    line-height: 1.02;
    letter-spacing: -.055em;
}
.portal-hero-content > p:not(.eyebrow) {
    max-width: 660px;
    margin: 1.35rem 0 0;
    color: rgba(255,255,255,.84);
    font-size: clamp(1rem, 2vw, 1.2rem);
}
.hero-cta, .button-primary, .button-secondary {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    margin-top: 1.8rem;
    padding: .8rem 1.25rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
}
.hero-cta, .button-primary { background: var(--portal-gold); color: #082b4b; }
.hero-cta:hover, .button-primary:hover { background: #ffd675; color: #082b4b; }
.button-secondary { color: var(--portal-blue); border: 1px solid #9db4c7; background: #fff; }
.portal-hero-accent { position: absolute; inset: auto 0 0; height: 9px; background: linear-gradient(90deg, var(--portal-gold) 0 35%, transparent 35%); }

.programme-section { padding: 5.2rem 0; }
.section-heading { display: grid; gap: 1rem; margin-bottom: 2rem; }
.section-heading h2, .about-section h2 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}
.section-heading > p { margin: 0; max-width: 520px; color: var(--portal-muted); }

.programme-grid { display: grid; grid-template-columns: 1fr; gap: 1.15rem; }
.programme-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: 0 12px 34px rgba(22, 55, 82, .08);
    transition: transform .2s ease, box-shadow .2s ease;
}
.programme-card:has(.programme-action:not(.is-disabled)):hover { transform: translateY(-5px); box-shadow: var(--portal-shadow); }
.programme-card-media { position: relative; height: 200px; overflow: hidden; background: #d9e9f4; }
.programme-card-media > img { width: 100%; height: 100%; object-fit: cover; }
.programme-card-media.is-fallback { display: grid; place-items: center; background: linear-gradient(135deg, #123d70, #0b7a75); }
.programme-card-media.is-fallback > span:first-child { color: rgba(255,255,255,.85); font-size: 4rem; font-weight: 850; }
.programme-category {
    --badge-color: #123d70;
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    padding: .45rem .72rem;
    color: #fff;
    background: var(--badge-color);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    box-shadow: 0 5px 15px rgba(0,0,0,.15);
}
.programme-card-body { flex: 1; display: flex; flex-direction: column; padding: 1.35rem; }
.programme-card-title { display: flex; align-items: center; gap: .8rem; }
.programme-card-title img { width: 48px; height: 48px; object-fit: contain; }
.programme-card-title p { margin: 0 0 .2rem; color: #0b7a75; font-size: .7rem; font-weight: 850; letter-spacing: .13em; }
.programme-card-title h3 { margin: 0; font-size: 1.42rem; line-height: 1.15; }
.programme-description { margin: 1rem 0 1.25rem; color: var(--portal-muted); }
.programme-action {
    min-height: 47px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
    padding: .7rem 1rem;
    border-radius: 11px;
    background: var(--portal-blue);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}
.programme-action:hover { background: #0b3159; color: #fff; }
.programme-action.is-disabled { justify-content: center; background: #e6ebef; color: #61717e; cursor: not-allowed; }
.empty-state { padding: 3rem; text-align: center; background: #fff; border: 1px solid var(--portal-border); border-radius: var(--portal-radius); }

.about-section { padding: 5rem 0; background: #fff; border-block: 1px solid var(--portal-border); }
.about-grid { display: grid; gap: 3rem; }
.about-grid > div:first-child > p:last-child { max-width: 620px; margin-top: 1.3rem; color: var(--portal-muted); font-size: 1.05rem; }
.about-points { display: grid; gap: 1rem; }
.about-points article { display: flex; gap: 1rem; padding: 1.15rem; border: 1px solid var(--portal-border); border-radius: 18px; background: #f9fbfc; }
.about-points article > span { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; background: #e5f4f2; color: #0b7a75; font-weight: 850; }
.about-points h3 { margin: 0 0 .25rem; font-size: 1rem; }
.about-points p { margin: 0; color: var(--portal-muted); font-size: .92rem; }

.portal-footer { padding: 2.2rem 0 calc(2.2rem + env(safe-area-inset-bottom)); color: #d9e8f2; background: #082b4b; }
.portal-footer-grid { display: grid; gap: 1rem; }
.portal-footer strong { color: #fff; font-size: 1.18rem; }
.portal-footer p { margin: .3rem 0 0; }
.portal-footer address { display: grid; margin: 0; font-style: normal; }
.portal-footer address span { color: #fff; font-weight: 750; }
.portal-footer-note { color: #9eb5c6; }

.login-placeholder, .error-panel {
    max-width: 780px;
    margin: 4rem auto;
    padding: clamp(1.5rem, 6vw, 3.5rem);
    text-align: center;
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
}
.login-placeholder-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 1.5rem; border-radius: 20px; background: #e7f1f8; color: #123d70; font-size: 2.3rem; }
.login-placeholder h1, .error-panel h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; }
.login-placeholder > p:not(.eyebrow), .error-panel > p { color: var(--portal-muted); }
.login-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }

.admin-preview-shell { padding-top: 2rem; padding-bottom: 4rem; }
.admin-preview-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.5rem; color: #fff; background: linear-gradient(120deg, #123d70, #0b7a75); border-radius: 20px; }
.admin-preview-banner h1 { margin: 0; }
.admin-preview-banner p:last-child { margin: .45rem 0 0; }
.admin-preview-banner > span { padding: .5rem .8rem; color: #082b4b; background: #ffd675; border-radius: 999px; font-weight: 800; }
.admin-preview-tabs { display: flex; gap: .6rem; padding: 1rem 0; overflow-x: auto; }
.admin-preview-tabs a { flex: 0 0 auto; padding: .55rem .85rem; color: #123d70; background: #fff; border: 1px solid var(--portal-border); border-radius: 999px; text-decoration: none; font-weight: 750; }
.admin-panel { margin-top: 1rem; padding: 1.35rem; background: #fff; border: 1px solid var(--portal-border); border-radius: 20px; }
.admin-panel-heading h2 { margin: 0 0 1.1rem; }
.admin-panel fieldset { padding: 0; border: 0; opacity: .78; }
.admin-form-grid { display: grid; gap: 1rem; }
.admin-panel label { display: grid; gap: .35rem; color: #415668; font-weight: 700; }
.admin-panel input, .admin-panel textarea { width: 100%; padding: .65rem .75rem; border: 1px solid #c8d6e0; border-radius: 9px; background: #f6f8fa; }
.admin-panel textarea { min-height: 90px; }
.admin-panel button { padding: .55rem .85rem; border: 0; border-radius: 9px; background: #d8e0e6; color: #63717b; }
.admin-hero-preview { position: relative; min-height: 240px; overflow: hidden; margin-bottom: 1rem; border-radius: 16px; background: #082b4b; }
.admin-hero-preview img { position: absolute; width: 100%; height: 100%; object-fit: cover; opacity: .48; }
.admin-hero-preview div { position: relative; z-index: 1; max-width: 650px; padding: 2rem; color: #fff; }
.admin-table-wrap { overflow-x: auto; }
.admin-table-wrap table { width: 100%; min-width: 800px; border-collapse: collapse; }
.admin-table-wrap th, .admin-table-wrap td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--portal-border); }
.category-preview-list { display: grid; gap: .7rem; }
.category-preview-list article { display: flex; align-items: center; gap: .7rem; padding: .8rem; border: 1px solid var(--portal-border); border-radius: 12px; }
.category-preview-list article > span { width: 18px; height: 18px; border-radius: 50%; background: var(--category-color); }
.category-preview-list article div { display: grid; }
.category-preview-list small { color: var(--portal-muted); }

@media (min-width: 420px) and (max-width: 575.98px) {
    .programme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
    .programme-card-media { height: 142px; }
    .programme-card-body { padding: 1rem; }
    .programme-card-title img { display: none; }
    .programme-card-title h3 { font-size: 1.05rem; }
    .programme-description { font-size: .84rem; }
    .programme-action { padding-inline: .75rem; font-size: .82rem; }
}

@media (max-width: 419.98px) {
    .portal-header-inner { gap: .4rem; padding-inline: .65rem; }
    .portal-logo-wrap { width: 52px; height: 52px; flex-basis: 52px; border-radius: 14px; }
    .portal-brand { gap: .55rem; }
    .portal-brand-copy strong { font-size: 1.12rem; }
    .portal-brand-copy small { display: none; }
    .portal-login, .portal-menu-button { min-width: 46px; min-height: 44px; padding: .55rem .65rem; }
    .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (min-width: 576px) {
    .portal-logo-wrap { width: 68px; height: 64px; flex-basis: 68px; }
    .portal-brand-copy small { max-width: none; font-size: .8rem; }
    .portal-login, .portal-menu-button { padding-inline: 1rem; font-size: .88rem; }
    .programme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .portal-hero { min-height: 600px; }
    .section-heading { grid-template-columns: 1fr minmax(280px, 480px); align-items: end; }
    .about-grid { grid-template-columns: minmax(0, 1fr) minmax(350px, .9fr); align-items: start; }
    .portal-footer-grid { grid-template-columns: 1.3fr 1fr auto; align-items: start; }
}

@media (min-width: 992px) {
    .portal-header-inner { min-height: 108px; gap: 2rem; }
    .portal-nav-desktop { display: flex; }
    .portal-menu-button { display: none; }
    .portal-login { min-width: 148px; }
    .login-long { display: inline; }
    .login-short { display: none; }
    .portal-brand-copy strong { font-size: 1.85rem; }
    .portal-hero-content { padding-block: 7rem; }
}

@media (min-width: 1100px) {
    .programme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Phase 2B: central authentication and administration */
.portal-auth-page main { min-height: 66vh; background: linear-gradient(145deg, #edf4f8, #fffaf0); }
.auth-shell { display: grid; place-items: center; padding-block: clamp(2rem, 8vw, 5rem); }
.auth-card { width: min(100%, 560px); padding: clamp(1.35rem, 5vw, 2.5rem); background: #fff; border: 1px solid var(--portal-border); border-top: 6px solid var(--portal-gold); border-radius: 24px; box-shadow: 0 24px 70px rgba(8,43,75,.12); }
.auth-card-intro h1 { margin: .2rem 0 .7rem; color: #0a2b49; font-size: clamp(1.8rem, 5vw, 2.6rem); }
.auth-card-intro p:last-child { color: var(--portal-muted); }
.portal-form { display: grid; gap: 1rem; }
.portal-form label { display: grid; gap: .4rem; color: #31495e; font-weight: 750; }
.portal-form input, .portal-form textarea, .portal-form select, .admin-filter-form input, .admin-filter-form select { width: 100%; min-height: 46px; padding: .7rem .8rem; color: #102a43; background: #fff; border: 1px solid #b9cbd8; border-radius: 10px; }
.portal-form textarea { min-height: 105px; resize: vertical; }
.portal-form input:focus, .portal-form textarea:focus, .portal-form select:focus { outline: 3px solid rgba(211,157,40,.25); border-color: #9b6e0f; }
.portal-form small { color: var(--portal-muted); font-weight: 500; }
.portal-primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; width: fit-content; padding: .75rem 1.2rem; color: #fff !important; background: #123d70 !important; border: 0; border-radius: 10px; text-decoration: none; font-weight: 850; letter-spacing: .03em; }
.portal-primary-button.compact { min-height: 40px; padding: .55rem .85rem; font-size: .84rem; }
.portal-alert { margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid #b9cbd8; border-radius: 12px; background: #edf4f8; color: #123d70; }
.portal-alert.success { border-color: #9bcbbc; background: #eaf8f2; color: #155b48; }
.portal-alert.warning { border-color: #efd08d; background: #fff8e7; color: #714b00; }
.portal-alert.danger { border-color: #e6a7a7; background: #fff0f0; color: #8b2323; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-top: 1.2rem; }
.auth-links a { color: #123d70; font-weight: 750; }

.portal-admin { margin: 0; min-width: 0; background: #f1f5f8; color: #102a43; }
.admin-topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 82px; padding: .8rem clamp(1rem, 3vw, 2.2rem); color: #fff; background: linear-gradient(115deg, #0a2b49, #123d70 68%, #1b568c); border-bottom: 5px solid var(--portal-gold); box-shadow: 0 8px 28px rgba(8,43,75,.18); }
.admin-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; color: #fff; text-decoration: none; }
.admin-brand img { width: 54px; height: 54px; padding: 5px; object-fit: contain; background: #fff; border-radius: 13px; }
.admin-brand span { display: grid; min-width: 0; }
.admin-brand strong { font-size: clamp(1.05rem, 3vw, 1.4rem); }
.admin-brand small { color: #d9e8f4; }
.admin-identity { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .35rem .8rem; text-align: right; }
.admin-identity > span, .admin-identity > small { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity > small { width: 100%; color: #d9e8f4; }
.admin-identity form { margin: 0; }
.admin-identity button { min-height: 40px; padding: .5rem .75rem; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.65); border-radius: 9px; }
.admin-layout { display: grid; min-height: calc(100vh - 82px); }
.admin-sidebar { display: none; }
.admin-content { min-width: 0; width: 100%; padding: 1rem; }
.admin-mobile-nav { margin: .75rem 1rem 0; background: #fff; border: 1px solid var(--portal-border); border-radius: 12px; }
.admin-mobile-nav summary { padding: .8rem 1rem; color: #123d70; cursor: pointer; font-weight: 850; }
.admin-mobile-nav nav { display: grid; padding: 0 .65rem .65rem; }
.admin-mobile-nav a { padding: .7rem; color: #344f64; border-radius: 8px; text-decoration: none; font-weight: 700; }
.admin-mobile-nav a.active { color: #fff; background: #123d70; }
.admin-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.25rem; }
.admin-page-heading h1 { margin: .1rem 0 .35rem; color: #0a2b49; font-size: clamp(1.75rem, 5vw, 2.65rem); }
.admin-page-heading p:last-child { max-width: 720px; margin: 0; color: var(--portal-muted); }
.portal-admin .admin-panel { min-width: 0; max-width: 100%; margin-top: 1rem; padding: clamp(1rem, 3vw, 1.5rem); box-shadow: 0 12px 35px rgba(8,43,75,.055); }
.portal-admin .admin-panel fieldset { opacity: 1; }
.portal-admin .admin-panel fieldset:disabled { opacity: .65; }
.portal-admin .admin-panel input, .portal-admin .admin-panel textarea { background: #fff; }
.portal-admin .admin-panel select { width: 100%; min-height: 46px; padding: .65rem .75rem; border: 1px solid #c8d6e0; border-radius: 9px; background: #fff; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.admin-stat-grid article { min-width: 0; padding: 1rem; background: #fff; border: 1px solid var(--portal-border); border-left: 5px solid var(--portal-gold); border-radius: 14px; }
.admin-stat-grid span { display: block; color: var(--portal-muted); font-size: .82rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.admin-stat-grid strong { display: block; margin-top: .25rem; color: #123d70; font-size: 2rem; }
.admin-dashboard-grid { display: grid; gap: 1rem; }
.admin-dashboard-grid > * { min-width: 0; }
.admin-programme-list { display: grid; gap: .65rem; }
.admin-programme-list article { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .85rem; border: 1px solid var(--portal-border); border-radius: 11px; }
.admin-programme-list article div { display: grid; }
.admin-programme-list small { color: var(--portal-muted); }
.admin-programme-list a { font-weight: 750; }
.system-list { display: grid; gap: 0; margin: 0; }
.system-list div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--portal-border); }
.system-list dt { color: var(--portal-muted); }
.system-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; text-align: right; font-weight: 750; }
.admin-form-panel { max-width: 1100px; }
.admin-form-panel .check-label, .check-label { display: flex; grid-template-columns: none; align-items: flex-start; gap: .6rem; }
.admin-form-panel .check-label input, .check-label input { flex: 0 0 auto; width: 20px; min-height: 20px; margin-top: .15rem; }
.assignment-group { margin: .4rem 0; padding: 1rem !important; border: 1px solid var(--portal-border) !important; border-radius: 12px; }
.assignment-group legend { float: none; width: auto; padding: 0 .35rem; color: #123d70; font-size: 1rem; font-weight: 850; }
.assignment-toolbar { margin-bottom: 1rem; padding: .85rem; border-radius: 10px; background: #f4f7fb; }
.assignment-toolbar label { margin: 0; }
.assignment-toolbar small { display: block; margin-top: .35rem; color: #5f6f7f; }
.programme-assignment-grid, .permission-grid { display: grid; gap: .75rem; }
.permission-grid .check-label { padding: .75rem; border: 1px solid var(--portal-border); border-radius: 10px; }
.permission-grid .check-label span { display: grid; }
.permission-grid small { color: var(--portal-muted); }
.role-list { display: grid; gap: .55rem; }
.role-list a { display: grid; padding: .8rem; color: #31495e; border: 1px solid var(--portal-border); border-radius: 10px; text-decoration: none; }
.role-list a.active { color: #fff; background: #123d70; border-color: #123d70; }
.role-list small { opacity: .78; }
.admin-filter-form { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.admin-filter-form label { flex: 1 1 190px; }
.admin-filter-form button { min-height: 44px; padding: .65rem 1rem; color: #fff; background: #123d70; }
.admin-table-actions { display: flex; justify-content: flex-end; margin-bottom: .8rem; }
.portal-admin .admin-table-wrap { min-width: 0; max-width: 100%; }
.portal-admin .admin-table-wrap table { min-width: 760px; }
.portal-admin .admin-table-wrap th { color: #536b7d; background: #f6f8fa; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.portal-admin .admin-table-wrap a { color: #123d70; font-weight: 750; }

@media (min-width: 720px) {
    .admin-content { padding: 1.6rem; }
    .admin-stat-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
    .admin-dashboard-grid { grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); }
    .programme-assignment-grid, .permission-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (min-width: 1024px) {
    .admin-mobile-nav { display: none; }
    .admin-layout { grid-template-columns: 255px minmax(0,1fr); }
    .admin-sidebar { position: sticky; top: 82px; display: flex; flex-direction: column; justify-content: space-between; height: calc(100vh - 82px); padding: 1.1rem .9rem; background: #fff; border-right: 1px solid var(--portal-border); }
    .admin-sidebar nav { display: grid; gap: .3rem; }
    .admin-sidebar a { padding: .72rem .85rem; color: #3c566a; border-radius: 9px; text-decoration: none; font-weight: 720; }
    .admin-sidebar a.active { color: #fff; background: #123d70; }
    .admin-sidebar .admin-public-link { color: #123d70; border: 1px solid #b9cbd8; text-align: center; }
    .admin-content { max-width: 1500px; padding: 2rem clamp(1.5rem,3vw,3rem); }
}

@media (max-width: 575.98px) {
    .admin-topbar { align-items: flex-start; }
    .admin-identity > span, .admin-identity > small { display: none; }
    .admin-brand img { width: 46px; height: 46px; }
    .admin-brand small { display: none; }
    .admin-stat-grid strong { font-size: 1.6rem; }
}
