*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Restore viewport centering stripped by the reset above */
dialog:modal {
    position: fixed;
    inset: 0;
    width: fit-content;
    height: fit-content;
    max-height: calc(100vh - 2rem);
    margin: auto;
    overflow: auto;
}

:root {
    --primary: #0f6cbf;
    --primary-dark: #095ba8;
    --primary-light: #e7f0fa;
    --accent-l: #e7f0fa;
    --accent-l2: #d4e8f8;
    --success: #357a32;
    --warning: #a6670e;
    --danger: #ca3120;
    --info: #08799c;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-2: #f8faff;
    --text: #1d2125;
    --ink-2: #3a4f72;
    --text-muted: #6a737b;
    --border: #e2e6ea;
    --navbar-bg: #ffffff;
    --drawer-bg: #ffffff;
    --drawer-active: #eef5fc;
    --course-card-border: #e2e6ea;
    --radius: 0.625rem;
    --radius-lg: 0.875rem;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --navbar-height: 60px;
    --topbar-h: 60px;
    --drawer-width: 221px;
    --sidebar-w: 221px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    font-size: 0.9375rem;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

/* ===== Moodle App Shell ===== */
.moodle-body { min-height: 100vh; background: var(--bg); }
.moodle-app { min-height: 100vh; display: flex; flex-direction: column; }

.moodle-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 1.25rem;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.drawer-toggle {
    background: none; border: none; font-size: 1.25rem;
    color: var(--text); cursor: pointer; padding: 0.5rem;
    border-radius: var(--radius);
}
.drawer-toggle:hover { background: var(--bg); }
.navbar-brand {
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none !important;
}
.navbar-brand:hover { opacity: 0.9; }
.navbar-brand-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}
.navbar-school {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: min(280px, 34vw);
    padding: 0.2rem 0.65rem 0.2rem 0.2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--surface-2) 0%, #fff 100%);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none !important;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.navbar-school:hover {
    border-color: rgba(15, 108, 191, 0.28);
    box-shadow: var(--shadow);
    text-decoration: none !important;
}
.navbar-school--brand {
    max-width: min(340px, 52vw);
    flex-shrink: 1;
}
.navbar-school__avatar {
    width: 1.65rem !important;
    height: 1.65rem !important;
    margin-left: 0 !important;
    border: 2px solid #fff !important;
    font-size: 0.6875rem !important;
    font-weight: 800 !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12) !important;
}
.navbar-school__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}
.navbar-school__label {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.navbar-school__name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-spacer { flex: 1; }

.user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 0.5rem;
    background: none; border: 1px solid var(--border);
    border-radius: 2rem; padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    cursor: pointer; font-family: inherit; font-size: 0.875rem;
}
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
    flex-shrink: 0;
}
.user-avatar.user-avatar--image,
.table-avatar.user-avatar--image,
.user-profile-avatar.user-avatar--image,
.dashboard-welcome-avatar.user-avatar--image {
    padding: 0;
    overflow: hidden;
    background: var(--surface);
}
.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.user-name { display: none; }
@media (min-width: 576px) { .user-name { display: inline; } }
.user-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + 0.5rem);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 0.5rem 1rem rgba(0,0,0,.12);
    min-width: 200px; z-index: 1001; overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-header { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.user-dropdown-header small { color: var(--text-muted); display: block; }
.user-dropdown a {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1rem; color: var(--text); text-decoration: none;
}
.user-dropdown a:hover { background: var(--bg); text-decoration: none; }

.moodle-layout {
    display: flex; margin-top: var(--navbar-height); min-height: calc(100vh - var(--navbar-height));
}
.moodle-drawer {
    width: var(--drawer-width); background: var(--drawer-bg);
    border-right: 1px solid var(--border);
    position: fixed; top: var(--navbar-height); left: 0; bottom: 0;
    overflow-y: auto; z-index: 900;
    transform: translateX(-100%); transition: transform 0.2s ease;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
}
.drawer-brand {
    padding: 1.25rem 1.25rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.drawer-brand-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.moodle-drawer.open { transform: translateX(0); }
@media (min-width: 992px) {
    .moodle-drawer { transform: translateX(0); position: sticky; top: var(--navbar-height); height: calc(100vh - var(--navbar-height)); }
    .drawer-toggle { display: none; }
}
.drawer-overlay {
    display: none; position: fixed; inset: 0; top: var(--navbar-height);
    background: rgba(0,0,0,.4); z-index: 850;
}
.drawer-overlay.open { display: block; }
@media (min-width: 992px) { .drawer-overlay { display: none !important; } }

.drawer-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.5rem 0.75rem 1rem;
}
.drawer-nav-bottom {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.drawer-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.85rem; color: var(--text);
    text-decoration: none; font-weight: 500; font-size: 0.9375rem;
    border-radius: var(--radius);
    margin-bottom: 0.15rem;
    border-left: none;
}
.drawer-link i { width: 1.25rem; text-align: center; color: var(--text-muted); font-size: 0.9375rem; }
.drawer-link:hover { background: var(--primary-light); text-decoration: none; color: var(--primary); }
.drawer-link:hover i { color: var(--primary); }
.drawer-link.active {
    background: var(--drawer-active); color: var(--primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}
.drawer-link.active i { color: var(--primary); }
.drawer-section-label {
    display: block;
    padding: 1rem 0.85rem 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.drawer-link-badge {
    margin-left: auto;
    padding: 0.1rem 0.45rem;
    background: var(--warning);
    color: #fff;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.3;
}

.drawer-link-tag {
    margin-left: auto;
    padding: 0.1rem 0.45rem;
    background: var(--surface-2, #e2e8f0);
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.moodle-main {
    flex: 1; min-width: 0;
    padding: 1.5rem 1.75rem 2rem;
}
@media (min-width: 992px) {
    .moodle-main { margin-left: 0; max-width: calc(100% - var(--drawer-width)); }
}

.breadcrumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
    font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.75rem;
}
.breadcrumb-sep { font-size: 0.625rem; color: var(--border); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.625rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    margin-bottom: 1.5rem;
}
.admin-page-header__main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: min(100%, 280px);
}
.admin-page-header__icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(15, 108, 191, 0.12) 0%, rgba(15, 108, 191, 0.06) 100%);
    color: var(--primary);
    font-size: 1.15rem;
}
.admin-page-header__copy { min-width: 0; }
.admin-page-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}
.admin-page-header__actions .btn {
    white-space: nowrap;
}
.page-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 42rem;
    line-height: 1.45;
}

.page-content { max-width: 1120px; }
.page-content--wide { max-width: none; width: 100%; min-width: 0; }

/* Toasts */
.toast-container { margin-bottom: 1rem; }
.toast {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.75rem 1rem; border-radius: var(--radius);
    margin-bottom: 0.5rem; animation: slideIn 0.3s ease;
    border: 1px solid transparent;
}
.toast.fade-out { opacity: 0; transition: opacity 0.4s; }
.toast-success { background: #d4edda; border-color: #c3e6cb; color: #155724; }
.toast-error { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }
.toast-info { background: #d1ecf1; border-color: #bee5eb; color: #0c5460; }
.toast-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; margin-left: auto; opacity: 0.6; }
@keyframes slideIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Course cards (Moodle-style) */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem; margin-bottom: 1.5rem;
}
.course-card {
    background: var(--surface); border: 1px solid var(--course-card-border);
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.course-card:hover { box-shadow: 0 0.35rem 1rem rgba(0,0,0,.12); }
.course-card-clickable {
    display: block;
    text-decoration: none !important;
    color: inherit;
    cursor: pointer;
}
.course-card-clickable:hover { text-decoration: none !important; color: inherit; }
.lms-course-card.course-card-clickable:hover {
    transform: translateY(-3px) scale(1.01);
}
.course-card-footer {
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.course-open-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.course-card-clickable:hover .course-open-link { color: var(--primary-dark); }

/* ===== Gradebook & grading ===== */
.grading-overview { margin-bottom: 1rem; }
.grading-overview__pending { display: flex; align-items: center; gap: 0.5rem; color: #856404; font-size: 0.9375rem; }
.grading-card-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; margin-top: 0.65rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.grading-card-stats i { color: var(--primary); margin-right: 0.2rem; }
.grading-card-stats__pending { color: #b45309; }
.empty-state--compact { padding: 1.25rem; text-align: center; }
.course-grade-card-link { align-self: center; margin-left: 0.5rem; white-space: nowrap; }

/* Category color tokens */
.gb-weight-bar__seg--quiz, .gb-chip-btn--quiz, .gb-sync-card--quiz, .grading-scheme-row--quiz { --gb-tone: #0f6cbf; --gb-tone-bg: #e8f2fb; }
.gb-weight-bar__seg--exam, .gb-chip-btn--exam, .gb-sync-card--exam, .grading-scheme-row--exam { --gb-tone: #6f42c1; --gb-tone-bg: #f3ebff; }
.gb-weight-bar__seg--assignment, .gb-chip-btn--assignment, .gb-sync-card--assignment, .grading-scheme-row--assignment { --gb-tone: #08799c; --gb-tone-bg: #e0f4fa; }
.gb-weight-bar__seg--participation, .gb-chip-btn--participation, .gb-sync-card--participation, .grading-scheme-row--participation { --gb-tone: #b45309; --gb-tone-bg: #fff8eb; }
.gb-weight-bar__seg--project, .gb-chip-btn--project, .gb-sync-card--project, .grading-scheme-row--project { --gb-tone: #198754; --gb-tone-bg: #eaf7ef; }
.gb-weight-bar__seg--other, .gb-chip-btn--other, .gb-sync-card--other, .grading-scheme-row--other { --gb-tone: #6c757d; --gb-tone-bg: #f1f3f5; }

.gb-weight-bar { margin: 0.75rem 0; }
.gb-weight-bar__track { display: flex; height: 0.55rem; border-radius: 999px; overflow: hidden; background: #e9ecef; }
.gb-weight-bar__seg { display: block; height: 100%; min-width: 2px; background: var(--gb-tone, var(--primary)); }
.gb-weight-bar__legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0.5rem 0 0; padding: 0; list-style: none; font-size: 0.75rem; }
.gb-weight-bar__legend li { display: flex; align-items: center; gap: 0.35rem; }
.gb-weight-bar__legend strong { color: var(--ink); }
.gb-weight-bar__dot { width: 0.55rem; height: 0.55rem; border-radius: 999px; background: var(--gb-tone, var(--primary)); }
.gb-weight-bar--compact .gb-weight-bar__legend { display: none; }
.gb-weight-bar--hero { margin: 0; }
.gb-weight-bar--admin .gb-weight-bar__track { height: 0.75rem; }

/* Teacher class hero */
.gb-class-hero {
    display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: space-between; align-items: flex-end;
    padding: 1.25rem 1.35rem; margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 55%);
    border: 1px solid #d4e4f4; border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.gb-class-hero__badge { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary); }
.gb-class-hero__title { margin: 0.2rem 0 0.5rem; font-size: 1.45rem; font-weight: 800; }
.gb-class-hero__chips { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; font-size: 0.8125rem; color: var(--text-muted); }
.gb-class-hero__chips i { color: var(--primary); margin-right: 0.2rem; }
.gb-class-hero__pending { color: #b45309; font-weight: 700; }
.gb-class-hero__aside { flex: 1; min-width: 220px; max-width: 360px; }

/* Tabs */
.gb-workspace { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.gb-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--border); background: var(--bg); padding: 0 0.5rem; }
.gb-tab {
    display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.85rem 1rem;
    border: none; background: transparent; font: inherit; font-size: 0.875rem; font-weight: 600;
    color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.gb-tab:hover { color: var(--primary); }
.gb-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }
.gb-tab__badge { font-size: 0.6875rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 700; }
.gb-tab__badge--warn { background: #f0ad4e; color: #5c3d00; }
.gb-tab-panel { display: none; padding: 1.15rem 1.25rem 1.35rem; }
.gb-tab-panel.is-active { display: block; }
.gb-tab-intro { margin: 0 0 1rem; font-size: 0.875rem; color: var(--text-muted); }

/* Setup / sync */
.gb-setup-alert {
    display: grid; grid-template-columns: auto 1fr auto; gap: 0.85rem; align-items: center;
    padding: 0.85rem 1rem; margin-bottom: 1rem; border-radius: var(--radius);
    background: #fff8eb; border: 1px solid #f0d9a8; color: #7a5200;
}
.gb-setup-alert p { margin: 0.15rem 0 0; font-size: 0.8125rem; }
.gb-setup-alert__meter { width: 4rem; height: 0.45rem; border-radius: 999px; background: #f0d9a8; overflow: hidden; }
.gb-setup-alert__meter span { display: block; height: 100%; background: #b45309; border-radius: 999px; }
.gb-setup-success {
    display: flex; align-items: center; gap: 0.55rem; padding: 0.75rem 1rem; margin-bottom: 1rem;
    border-radius: var(--radius); background: #eaf7ef; border: 1px solid #b8dfc4; color: #0f5132; font-size: 0.875rem;
}
.gb-sync-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.gb-sync-card {
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff;
    border-left: 4px solid var(--gb-tone, var(--primary)); overflow: hidden;
}
.gb-sync-card.is-linked { box-shadow: 0 0 0 1px rgba(25, 135, 84, 0.2); }
.gb-sync-card.is-manual { border-left-color: var(--gb-tone, #6c757d); }
.gb-sync-card__head { display: flex; gap: 0.65rem; align-items: flex-start; padding: 0.85rem 0.9rem 0.5rem; }
.gb-sync-card__icon {
    width: 2rem; height: 2rem; border-radius: 0.5rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--gb-tone-bg, #e8f2fb); color: var(--gb-tone, var(--primary));
}
.gb-sync-card__title { flex: 1; min-width: 0; }
.gb-sync-card__title strong { display: block; font-size: 0.9375rem; }
.gb-sync-card__title span { font-size: 0.75rem; color: var(--text-muted); }
.gb-sync-card__status { font-size: 0.6875rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 999px; white-space: nowrap; }
.gb-sync-card__status--linked { background: #eaf7ef; color: #0f5132; }
.gb-sync-card__status--pending { background: #fff3cd; color: #856404; }
.gb-sync-card__status--manual { background: #e9ecef; color: #495057; }
.gb-sync-card__body { padding: 0 0.9rem 0.9rem; }
.gb-sync-card__hint { margin: 0.35rem 0 0; font-size: 0.75rem; color: var(--text-muted); }
.gb-sync-form__actions { display: flex; gap: 0.5rem; }

/* Gradebook table */
.gb-table-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.gb-table-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
    padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); background: var(--bg);
}
.gb-table-search { display: flex; align-items: center; gap: 0.45rem; flex: 1; max-width: 280px; }
.gb-table-search i { color: var(--text-muted); }
.gb-table-search input { padding: 0.4rem 0.65rem; font-size: 0.875rem; }
.gb-table-toolbar__count { font-size: 0.8125rem; color: var(--text-muted); font-weight: 600; }
.gb-table-wrap { overflow-x: auto; }
.gb-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; min-width: 720px; }
.gb-table th, .gb-table td { padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.gb-table thead th { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
.gb-table tbody tr:hover { background: rgba(15, 108, 191, 0.03); }
.gb-table__student-col { position: sticky; left: 0; z-index: 2; background: #fff; min-width: 200px; box-shadow: 2px 0 6px rgba(0,0,0,0.04); }
.gb-table thead .gb-table__student-col { z-index: 3; background: #f8fafc; }
.gb-table__student { display: flex; align-items: center; gap: 0.55rem; }
.gb-table__avatar { width: 2rem !important; height: 2rem !important; font-size: 0.75rem !important; }
.gb-table__student strong { display: block; font-size: 0.875rem; }
.gb-table__student span { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.gb-table__comp-col { min-width: 100px; text-align: center; }
.gb-table__comp-head {
    display: inline-flex; flex-direction: column; align-items: center; gap: 0.1rem;
    padding: 0.35rem 0.45rem; border-radius: 0.45rem; font-size: 0.6875rem;
    background: var(--gb-tone-bg, #f8f9fa); color: var(--gb-tone, var(--ink));
}
.gb-table__comp-head i { font-size: 0.85rem; }
.gb-table__comp-name { font-weight: 700; font-size: 0.75rem; color: var(--ink); }
.gb-table__comp-weight { opacity: 0.85; }
.gb-table__comp-warn { color: #b45309; }
.gb-table__cell { text-align: center; }
.gb-table__cell--empty { background: #fafbfc; }
.gb-table__cell--partial { background: #fffdf5; }
.gb-table__cell--full { background: #f4fbf6; }
.gb-table__cell--zero { background: #fff5f5; }
.gb-cell-score__raw { display: block; font-size: 0.6875rem; color: var(--text-muted); }
.gb-cell-score__pct { display: block; font-weight: 800; font-size: 0.875rem; }
.gb-cell-bar { display: block; height: 3px; border-radius: 999px; background: #e9ecef; margin-top: 0.25rem; overflow: hidden; }
.gb-cell-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.gb-cell-empty { color: var(--text-muted); }
.gb-manual-input { width: 4.25rem; margin: 0 auto; text-align: center; padding: 0.3rem; font-size: 0.875rem; }
.gb-manual-input--override { border-color: #c9a227; background: #fffdf5; box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.15); }
.gb-cell-edit { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.gb-cell-edit--override .gb-manual-input { font-weight: 700; }
.gb-cell-badge {
    display: inline-flex; align-items: center; gap: 0.2rem;
    font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
    padding: 0.1rem 0.35rem; border-radius: 999px; white-space: nowrap;
}
.gb-cell-badge--override { background: #fff3cd; color: #856404; border: 1px solid #f0d9a8; }
.gb-cell-badge--pending { background: #e8f2fb; color: #0f6cbf; border: 1px solid #b6d4f0; }
.gb-cell-sync-hint { font-size: 0.6875rem; color: var(--text-muted); line-height: 1.2; }
.gb-table__cell--override { box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.35); }
.gb-table__final-col { text-align: center; min-width: 72px; background: rgba(15, 108, 191, 0.04); }
.gb-final { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-weight: 800; font-size: 0.875rem; }
.gb-final--excellent { background: #d4edda; color: #155724; }
.gb-final--good { background: #cce5ff; color: #084298; }
.gb-final--fair { background: #fff3cd; color: #856404; }
.gb-final--low { background: #f8d7da; color: #721c24; }
.gb-final--pending { color: var(--text-muted); font-weight: 600; }
.gb-manual-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }

/* Assignment grid (teacher tab) */
.gb-assignment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; }
.gb-assignment-card {
    display: flex; gap: 0.75rem; align-items: center; padding: 0.9rem 1rem;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff;
}
.gb-assignment-card__icon {
    width: 2.5rem; height: 2.5rem; border-radius: 0.65rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #e0f4fa; color: #08799c; font-size: 1rem;
}
.gb-assignment-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.gb-assignment-card__body strong { font-size: 0.9375rem; }
.gb-assignment-card__body span { font-size: 0.75rem; color: var(--text-muted); }
.gb-assignment-card__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }

/* Student grade card */
.gb-student-card { max-width: 720px; }
.gb-student-card__hero {
    display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap;
    padding: 1.35rem 1.5rem; margin-bottom: 1.25rem;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fbff, #fff);
}
.gb-student-card__hero--excellent { border-color: #b8dfc4; }
.gb-student-card__hero--good { border-color: #9ec5fe; }
.gb-student-card__ring {
    --gb-pct: 0;
    width: 6.5rem; height: 6.5rem; border-radius: 999px; flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: conic-gradient(var(--primary) calc(var(--gb-pct) * 1%), #e8eef4 0);
    position: relative;
}
.gb-student-card__ring::before { content: ''; position: absolute; inset: 0.5rem; border-radius: 999px; background: #fff; }
.gb-student-card__ring-value, .gb-student-card__ring-label { position: relative; z-index: 1; line-height: 1.1; }
.gb-student-card__ring-value { font-size: 1.65rem; font-weight: 800; }
.gb-student-card__ring-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.gb-student-card__subject { margin: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--primary); }
.gb-student-card__hero-text h2 { margin: 0.15rem 0 0.35rem; font-size: 1.35rem; font-weight: 800; }
.gb-student-card__hero-text p { margin: 0; font-size: 0.875rem; color: var(--text-muted); }
.gb-weight-bar--student { margin-bottom: 1.25rem; }
.gb-student-breakdown { display: flex; flex-direction: column; gap: 0.65rem; }
.gb-breakdown-item {
    display: flex; gap: 0.85rem; padding: 0.9rem 1rem;
    border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff;
    border-left: 4px solid var(--gb-tone, var(--primary));
}
.gb-breakdown-item.is-pending { opacity: 0.85; }
.gb-breakdown-item__icon {
    width: 2.25rem; height: 2.25rem; border-radius: 0.55rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--gb-tone-bg); color: var(--gb-tone);
}
.gb-breakdown-item__main { flex: 1; min-width: 0; }
.gb-breakdown-item__top strong { display: block; font-size: 0.9375rem; }
.gb-breakdown-item__top span { font-size: 0.75rem; color: var(--text-muted); }
.gb-breakdown-item__bar { height: 0.4rem; border-radius: 999px; background: #e9ecef; margin: 0.5rem 0 0.35rem; overflow: hidden; }
.gb-breakdown-item__bar span { display: block; height: 100%; background: var(--gb-tone, var(--primary)); border-radius: 999px; }
.gb-breakdown-item__scores { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; font-size: 0.8125rem; }
.gb-breakdown-item__pct { font-weight: 800; color: var(--ink); }
.gb-breakdown-item__contrib { color: var(--primary); font-weight: 600; }
.gb-breakdown-item__pending { margin: 0.35rem 0 0; font-size: 0.8125rem; color: var(--text-muted); font-style: italic; }

.gb-empty-scheme { text-align: center; padding: 2rem 1.5rem; }
.gb-empty-scheme__icon { font-size: 2rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.gb-empty-scheme h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.gb-empty-scheme p { margin: 0; color: var(--text-muted); font-size: 0.875rem; max-width: 420px; margin-inline: auto; }

/* Admin grading scheme editor */
.grading-scheme-fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.15rem 1.25rem; margin: 1rem 0; background: #fafbfc; }
.grading-scheme-fieldset legend { font-weight: 800; padding: 0 0.35rem; }
.grading-scheme-help { font-size: 0.875rem; margin-bottom: 0.85rem; }
.grading-scheme-preview { margin-bottom: 1rem; }
.grading-scheme-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.85rem; }
.grading-scheme-toolbar__label { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); margin-right: 0.25rem; }
.gb-chip-btn {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.65rem;
    border: 1px solid var(--border); border-radius: 999px; background: #fff;
    font-size: 0.8125rem; font-weight: 600; cursor: pointer; color: var(--gb-tone, var(--ink));
}
.gb-chip-btn:hover { background: var(--gb-tone-bg, var(--bg)); border-color: var(--gb-tone, var(--primary)); }
.grading-scheme-table-head {
    display: grid; grid-template-columns: 150px 1fr 120px 2.5rem; gap: 0.5rem;
    padding: 0 0.25rem 0.35rem; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted);
}
.grading-scheme-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.grading-scheme-row {
    display: grid; grid-template-columns: 150px 1fr 120px 2.5rem; gap: 0.5rem; align-items: center;
    padding: 0.5rem 0.55rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--border);
    border-left: 3px solid var(--gb-tone, var(--primary));
}
.grading-scheme-row__type { display: flex; gap: 0.35rem; align-items: center; }
.grading-scheme-row__icon {
    width: 1.75rem; height: 1.75rem; border-radius: 0.4rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--gb-tone-bg); color: var(--gb-tone); font-size: 0.8rem;
}
.grading-scheme-row__type select { flex: 1; min-width: 0; font-size: 0.8125rem; padding: 0.35rem 0.45rem; }
.grading-scheme-row__weight { display: flex; align-items: center; gap: 0.25rem; }
.grading-scheme-row__weight input { text-align: right; }
.grading-scheme-row__pct { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.grading-scheme-row__remove { padding: 0.25rem 0.5rem; line-height: 1; }
.grading-weight-total-line { margin: 0.5rem 0 0; font-size: 0.875rem; }
.grading-weight-hint { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; }
#gradingWeightTotal.is-invalid { color: #b45309; }
#gradingWeightTotal.is-valid { color: #0f5132; }

@media (max-width: 720px) {
    .gb-class-hero { flex-direction: column; align-items: stretch; }
    .gb-class-hero__aside { max-width: none; }
    .grading-scheme-table-head { display: none; }
    .grading-scheme-row { grid-template-columns: 1fr; }
    .gb-setup-alert { grid-template-columns: 1fr; }
    .gb-student-card__hero { flex-direction: column; text-align: center; }
}

.page-section-title,
[id] { scroll-margin-top: calc(var(--navbar-height) + 1rem); }
.page-section-title { font-size: 1.1rem; font-weight: 700; }

.course-page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

/* ===== Course view (Moodle-style) ===== */
.course-view { margin-bottom: 1.5rem; }

.course-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    background-color: var(--primary-dark);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(15, 108, 191, 0.2);
    position: relative;
    overflow: hidden;
}
.course-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(15, 108, 191, 0.88) 0%, rgba(8, 90, 158, 0.82) 55%, rgba(8, 121, 156, 0.85) 100%);
}
.course-hero--custom-cover .course-hero-overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.78) 100%);
}
.course-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px;
    height: 280px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.course-hero-main { position: relative; z-index: 1; flex: 1; min-width: 220px; }
.course-hero-settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.course-hero-settings-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
}
.course-hero-settings-btn i { font-size: 1rem; }
.course-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255,255,255,0.88);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 0.85rem;
}
.course-back-link:hover { color: #fff; text-decoration: none; }
.course-hero-title-row { display: flex; align-items: center; gap: 1rem; }
.course-hero-avatar {
    width: 56px; height: 56px;
    border-radius: 0.875rem;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 800; flex-shrink: 0;
}
.course-hero-title {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: #fff;
    line-height: 1.2;
}
.course-hero-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.course-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.course-hero-desc {
    margin: 0.85rem 0 0;
    max-width: 560px;
    line-height: 1.55;
    opacity: 0.92;
    font-size: 0.9375rem;
}
.course-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    position: relative;
    z-index: 1;
}
.course-stat {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.75rem;
    padding: 0.65rem 1rem;
    min-width: 72px;
    text-align: center;
}
.course-stat strong { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.course-stat span { font-size: 0.6875rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.course-layout {
    display: grid;
    grid-template-columns: 188px 1fr;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 900px) {
    .course-layout { grid-template-columns: 1fr; }
}

.course-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: calc(var(--navbar-height) + 1rem);
}
@media (max-width: 900px) {
    .course-sidebar { position: static; }
}
.course-sidebar-title { font-size: 0.8125rem; font-weight: 700; margin: 0 0 0.15rem; }
.course-sidebar-hint {
    font-size: 0.6875rem; color: var(--text-muted);
    margin: 0 0 0.65rem; line-height: 1.4;
}

.activity-picker { display: flex; flex-direction: column; gap: 0.35rem; }
.activity-picker-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    row-gap: 0;
    align-items: center;
    padding: 0.5rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none !important;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.activity-picker-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 1px 4px rgba(15,108,191,0.08);
}
.activity-picker-card.is-active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: inset 2px 0 0 var(--primary);
}
.activity-picker-icon {
    width: 28px; height: 28px;
    border-radius: 0.4rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8125rem;
    margin-bottom: 0;
    grid-row: 1 / 3;
}
.activity-picker-icon.material { background: #e7f0fa; color: var(--primary); }
.activity-picker-icon.assignment { background: #fff3cd; color: #856404; }
.activity-picker-icon.quiz { background: #d1ecf1; color: #0c5460; }
.activity-picker-label { font-weight: 700; font-size: 0.75rem; line-height: 1.2; }
.activity-picker-desc {
    font-size: 0.625rem; color: var(--text-muted);
    line-height: 1.25;
    grid-column: 2;
}

.course-main { min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }

.course-form-sheet {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.35rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.course-form-sheet--material { border-top: 4px solid var(--primary); }
.course-form-sheet--assignment { border-top: 4px solid #c9a227; }
.course-form-sheet--quiz { border-top: 4px solid #08799c; }
.course-form-sheet--section { border-top: 4px solid #4338ca; }
.course-form-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}
.course-form-sheet-header h2 { font-size: 1.15rem; font-weight: 700; margin: 0.35rem 0 0; }
.course-form-sheet-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.course-form-sheet-badge.material { background: #e7f0fa; color: var(--primary-dark); }
.course-form-sheet-badge.assignment { background: #fff3cd; color: #856404; }
.course-form-sheet-badge.quiz { background: #d1ecf1; color: #0c5460; }
.course-form-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.course-form-close:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.course-form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

/* Teacher course builder toolbar */
.course-builder {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.course-builder-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}
.course-builder-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
}
.course-builder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.course-builder-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.course-builder-btn:hover { text-decoration: none !important; }
.course-builder-btn--material.is-active,
.course-builder-btn--material:hover { border-color: var(--primary); background: #e7f0fa; color: var(--primary-dark); }
.course-builder-btn--assignment.is-active,
.course-builder-btn--assignment:hover { border-color: #c9a227; background: #fff8e6; color: #856404; }
.course-builder-btn--quiz.is-active,
.course-builder-btn--quiz:hover { border-color: #08799c; background: #e8f6f8; color: #0c5460; }
.course-builder-lesson-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    padding-right: 0.85rem;
    margin-right: 0.15rem;
    border-right: 2px solid var(--border);
}
.course-builder-lesson {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: 1px solid #4338ca;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(67, 56, 202, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.course-builder-lesson i {
    font-size: 0.95rem;
}
.course-builder-lesson:hover,
.course-builder-lesson.is-active {
    border-color: #3730a3;
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    color: #fff;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(67, 56, 202, 0.35);
}
.course-builder-lesson.is-active {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35), 0 4px 14px rgba(67, 56, 202, 0.28);
}
.course-builder-side {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.course-builder-students {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink-2);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.course-builder-students:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none !important;
}
.course-main--full { width: 100%; }

/* Class roster (teacher) */
.class-roster-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 55%);
    border: 1px solid #d4e4f4;
}
.class-roster-hero__badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
}
.class-roster-hero__title { margin: 0.2rem 0 0.35rem; font-size: 1.35rem; font-weight: 800; }
.class-roster-hero__meta { margin: 0; font-size: 0.875rem; }
.class-roster-hero__count {
    text-align: center;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-lg);
    background: var(--primary-light);
    border: 1px solid rgba(15, 108, 191, 0.15);
}
.class-roster-hero__count strong { display: block; font-size: 1.75rem; font-weight: 800; color: var(--primary-dark); line-height: 1.1; }
.class-roster-hero__count span { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.class-roster-panel { padding: 0; overflow: hidden; }
.class-roster-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.class-roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.65rem;
    padding: 1rem;
}
.class-roster-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    color: inherit;
    text-decoration: none !important;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.class-roster-card:hover {
    border-color: rgba(15, 108, 191, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    text-decoration: none !important;
}
.class-roster-card__top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.class-roster-card__chevron {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.class-roster-card__avatar { flex-shrink: 0; }
.class-roster-card__info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.class-roster-progress {
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
}
.class-roster-progress__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.class-roster-progress__head strong {
    font-size: 0.8125rem;
    color: var(--primary-dark);
    text-transform: none;
    letter-spacing: 0;
}
.class-roster-progress__bar {
    height: 0.35rem;
    border-radius: 999px;
    background: #e9ecef;
    overflow: hidden;
    margin-bottom: 0.45rem;
}
.class-roster-progress__bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #3b9ae8);
    border-radius: 999px;
}
.class-roster-progress__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ink-2);
}
.class-roster-progress__stats i { color: var(--primary); margin-right: 0.15rem; }
.class-roster-progress__grade { font-size: 0.6875rem !important; padding: 0.1rem 0.4rem !important; }

.student-progress-hero {
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 55%);
    border: 1px solid #d4e4f4;
}
.student-progress-hero__identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.15rem;
}
.student-progress-hero__identity h2 { margin: 0 0 0.15rem; font-size: 1.35rem; font-weight: 800; }
.student-progress-hero__avatar { flex-shrink: 0; }
.student-progress-hero__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.student-progress-metric {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
}
.student-progress-metric--grade {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.student-progress-metric__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.student-progress-metric__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.1;
}
.student-progress-metric__hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.student-progress-bar {
    height: 0.45rem;
    border-radius: 999px;
    background: #e9ecef;
    overflow: hidden;
    margin: 0.45rem 0;
}
.student-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #3b9ae8);
    border-radius: 999px;
}
.student-progress-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.student-progress-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-2);
}
.student-progress-chip--warn {
    background: #fff8eb;
    border-color: #f0d9a8;
    color: #856404;
}
.student-progress-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.student-progress-section { padding: 1rem 1.1rem; }
.student-progress-section__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 700;
}
.student-progress-section__title i { color: var(--primary); }
.student-progress-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.student-progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    border-left: 3px solid #dee2e6;
}
.student-progress-item--full { border-left-color: #198754; background: #f4fbf6; }
.student-progress-item--partial { border-left-color: #f0ad4e; background: #fffdf5; }
.student-progress-item--empty { border-left-color: #dee2e6; }
.student-progress-item__main { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.student-progress-item__main strong { font-size: 0.875rem; }
.student-progress-item__main span { font-size: 0.75rem; color: var(--text-muted); }
.student-progress-item__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.student-progress-status {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}
.student-progress-status--full { background: #d4edda; color: #155724; }
.student-progress-status--partial { background: #fff3cd; color: #856404; }
.student-progress-status--empty { background: #e9ecef; color: #6c757d; }
.student-progress-score { font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); }
.mt-1 { margin-top: 1rem; }
.class-roster-card__info strong {
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.class-roster-card__info span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.class-roster-note {
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    font-size: 0.8125rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.class-roster-note i { margin-right: 0.35rem; color: var(--primary); }

.course-content-actions {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.course-lessons {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
    padding-left: 0.35rem;
}

.course-lesson {
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.course-lesson.is-open {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border-color: #c7d7e8;
}
.course-lesson:has(.course-lesson-add-menu:not([hidden])) {
    overflow: visible;
    position: relative;
    z-index: 5;
}
.course-lesson--general {
    background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
    border-color: #fcd34d;
    border-style: solid;
}
.course-lesson--general .course-lesson-header {
    background: rgba(254, 243, 199, 0.35);
}
.course-lesson-header {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid transparent;
}
.course-lesson.is-open .course-lesson-header {
    border-bottom-color: var(--border);
}
.course-lesson-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: inherit;
    min-width: 0;
}
.course-lesson-toggle:hover { background: rgba(15, 108, 191, 0.04); }
.course-lesson-index {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #e7f0fa 0%, #dbeafe 100%);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 108, 191, 0.12);
}
.course-lesson-index--general {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.15);
    font-size: 0.85rem;
}
.course-lesson-heading {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
    flex: 1;
}
.course-lesson-heading strong {
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 700;
}
.course-lesson-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.course-lesson-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.course-lesson-badge--material {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.course-lesson-badge--assignment {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}
.course-lesson-badge--quiz {
    background: #ecfeff;
    border-color: #a5f3fc;
    color: #0e7490;
}
.course-lesson-chevron {
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.15s ease;
    flex-shrink: 0;
    font-size: 0.85rem;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--bg);
}
.course-lesson.is-open .course-lesson-chevron {
    transform: rotate(180deg);
    color: var(--primary);
    background: var(--primary-light);
}
.course-lesson-admin {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.65rem;
    border-left: 1px solid var(--border);
}
.course-lesson-admin form { display: inline; margin: 0; }
.course-lesson-admin-btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none !important;
}
.course-lesson-admin-btn:hover {
    background: var(--bg);
    color: var(--text);
}
.course-lesson-admin-btn--danger:hover {
    background: #fdecea;
    color: #ca3120;
}
.course-lesson-admin-btn--add {
    color: var(--primary);
}
.course-lesson-admin-btn--add:hover {
    background: var(--primary-light, #eff6ff);
    color: var(--primary);
}
.course-lesson-add {
    position: relative;
}
.course-lesson-add-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 30;
    min-width: 11.5rem;
    padding: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    background: var(--surface, #fff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
.course-lesson-add-menu[hidden] {
    display: none;
}
.course-lesson-add-menu__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: none;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--text);
    font-size: 0.8125rem;
    text-align: left;
    text-decoration: none !important;
    cursor: pointer;
}
.course-lesson-add-menu__item:hover:not(:disabled) {
    background: var(--bg);
    color: var(--primary);
}
.course-lesson-add-menu__item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.course-lesson-add-menu__item i {
    width: 1rem;
    text-align: center;
    color: var(--text-muted);
}
.course-lesson-add-menu__item:hover:not(:disabled) i {
    color: var(--primary);
}
.course-lesson-body {
    display: none;
    padding: 0.85rem 1rem 1.1rem;
    background: linear-gradient(180deg, #dce3ec 0%, #e8edf2 100%);
    border-top: 1px solid #cbd5e1;
}
.course-lesson--general .course-lesson-body {
    background: linear-gradient(180deg, #e8e0c8 0%, #f0ead8 100%);
    border-top-color: #d6c48a;
}
.course-lesson.is-open .course-lesson-body { display: block; }
.course-lesson-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.8125rem;
    line-height: 1.5;
}
.course-lesson-callout i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}
.course-lesson-callout p { margin: 0; }
.course-lesson-desc {
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.9rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.course-lesson-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.15rem 0 0;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    background: #fff;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.course-lesson-empty i {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}
.course-lesson-empty p { margin: 0; line-height: 1.5; }
.course-lesson-body .activity-list { gap: 0.55rem; }
.activity-list--modules { display: flex; flex-direction: column; gap: 0.55rem; }

.activity-module {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.9rem 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.activity-module:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.activity-module--material { border-left: 4px solid var(--primary); }
.activity-module--assignment { border-left: 4px solid #d97706; }
.activity-module--quiz { border-left: 4px solid #0891b2; }
.activity-module-leading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.activity-module-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.activity-module--material .activity-module-icon { background: #e7f0fa; color: var(--primary); }
.activity-module--assignment .activity-module-icon { background: #fff7ed; color: #c2410c; }
.activity-module--quiz .activity-module-icon { background: #ecfeff; color: #0e7490; }
.activity-module-type {
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
    max-width: 4.5rem;
}
.activity-module-main { min-width: 0; }
.activity-module-main h3 {
    font-size: 0.975rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    line-height: 1.35;
}
.activity-module-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.activity-module-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    flex-shrink: 0;
    min-width: 9.5rem;
}
.activity-module-move {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.activity-module-move-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.activity-module-move-select {
    min-width: 0;
    width: 100%;
    font-size: 0.75rem;
    border-radius: 0.5rem;
}
.activity-module-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}
.activity-module-buttons .btn-sm {
    padding: 0.35rem 0.55rem;
}
.activity-module-buttons form { display: inline; margin: 0; }
@media (max-width: 900px) {
    .activity-module {
        grid-template-columns: auto 1fr;
    }
    .activity-module-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
    }
    .activity-module-move {
        flex: 1;
        min-width: 0;
        max-width: 12rem;
    }
}

.activity-module-meta .activity-meta-chip {
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem;
}

.course-form-sheet-badge.section { background: #eef2ff; color: #4338ca; }

.course-content-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow);
}
.course-content-section--full { max-width: none; }
.course-content-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.course-content-intro h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.55rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.course-content-intro h2 i {
    color: var(--primary);
    font-size: 1rem;
}
.course-content-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.course-content-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
}
.course-content-stat i {
    color: var(--primary);
    font-size: 0.7rem;
}
.course-content-stat--muted {
    color: var(--text-muted);
}
.course-content-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex-shrink: 0;
}
.course-content-summary {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}
.course-content-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.course-content-header h2 i { color: var(--primary); }
.course-content-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}
.course-content-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.course-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
}
.course-empty-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
    border-radius: 1rem;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem;
}
.course-empty h3 { margin-bottom: 0.35rem; font-size: 1.1rem; }
.course-empty p { color: var(--text-muted); max-width: 360px; margin: 0 auto 1.25rem; font-size: 0.9375rem; }
.course-empty-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }

.activity-list { display: flex; flex-direction: column; gap: 0.65rem; }
.activity-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.activity-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.activity-card--material { border-left: 4px solid var(--primary); }
.activity-card--assignment { border-left: 4px solid #c9a227; }
.activity-card--quiz { border-left: 4px solid #08799c; }
.activity-card-icon {
    width: 44px; height: 44px;
    border-radius: 0.625rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.activity-card--material .activity-card-icon { background: #e7f0fa; color: var(--primary); }
.activity-card--assignment .activity-card-icon { background: #fff3cd; color: #856404; }
.activity-card--quiz .activity-card-icon { background: #d1ecf1; color: #0c5460; }
.activity-card-body { flex: 1; min-width: 0; }
.activity-card-type {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}
.activity-card-body h3 { font-size: 1rem; font-weight: 700; margin: 0 0 0.35rem; line-height: 1.3; }
.activity-card-body p { font-size: 0.875rem; color: var(--text-muted); margin: 0 0 0.35rem; line-height: 1.5; }
.activity-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.activity-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    text-decoration: none;
}
.activity-meta-chip:not(.muted):hover { border-color: var(--primary); color: var(--primary); }
.activity-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
    flex-shrink: 0;
}
.activity-card-actions form { display: inline; }
@media (max-width: 640px) {
    .activity-card { flex-direction: column; }
    .activity-card-actions { width: 100%; }
    .course-hero-title { font-size: 1.35rem; }
}

.course-page-header h2 { font-size: 1.5rem; font-weight: 700; margin: 0.35rem 0 0; color: #fff; }
.course-page-meta { font-size: 0.875rem; opacity: 0.9; margin: 0.15rem 0 0; }
.course-page-desc { margin-top: 0.75rem; opacity: 0.95; max-width: 640px; line-height: 1.55; }

.course-toolbar .panel-header,
.course-toolbar h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.course-add-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.course-module-list { list-style: none; margin: 0; padding: 0; }
.course-module-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.course-module-item:last-child { border-bottom: none; }
.course-module-icon {
    width: 40px; height: 40px; border-radius: 0.5rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 1rem;
}
.course-module-icon.material { background: #e7f0fa; color: var(--primary); }
.course-module-icon.assignment { background: #fff3cd; color: #856404; }
.course-module-icon.quiz { background: #d1ecf1; color: #0c5460; }
.course-module-body { flex: 1; min-width: 0; }
.course-module-body strong { display: block; font-size: 1rem; margin-bottom: 0.2rem; }
.course-module-type {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.course-module-body p { font-size: 0.875rem; margin: 0.25rem 0; }
.course-module-meta {
    display: flex; flex-wrap: wrap; gap: 0.65rem 1rem;
    font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.35rem;
}
.course-module-meta a { font-weight: 600; text-decoration: none; }
.course-module-actions {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
    align-items: flex-start; flex-shrink: 0;
}
@media (max-width: 768px) {
    .course-module-item { flex-direction: column; }
    .course-module-actions { width: 100%; }
}

.course-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff; padding: 1rem 1.25rem;
}
.lms-course-card .course-card-header {
    position: relative;
    min-height: 7.5rem;
    padding: 0;
    background-color: var(--primary-dark);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.lms-course-card .course-card-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
}
.lms-course-card:not(.course-card-has-cover) .course-card-header-overlay {
    background: linear-gradient(135deg, rgba(13,110,253,.85) 0%, rgba(10,88,202,.92) 100%),
        linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.35) 100%);
}
.lms-course-card.course-card-has-cover .course-card-header-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.65) 100%);
}
.lms-course-card .course-card-header-content {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.1rem 1.25rem 1.15rem;
}
.lms-course-card .course-card-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    margin-bottom: 0.4rem;
    backdrop-filter: blur(4px);
}
.lms-course-card .course-card-header h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.lms-course-card .course-card-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,.18);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    backdrop-filter: blur(4px);
}
.lms-course-card .course-card-chip i { font-size: 0.65rem; opacity: 0.9; }
.lms-course-card .course-card-desc { font-size: 0.875rem; margin: 0; }
.course-card-header h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.course-card-header small { opacity: 0.85; font-size: 0.8125rem; }
.course-card-body { padding: 1rem 1.25rem; }
.course-card-actions {
    display: flex; flex-wrap: wrap; gap: 0.5rem;
    padding: 0 1.25rem 1rem;
}

/* Course appearance & admin cover upload */
.course-settings-modal {
    max-width: 480px;
    max-height: min(90vh, 640px);
    overflow-y: auto;
}
.course-settings-modal-intro {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}
.course-settings-section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.course-settings-section-desc { margin-bottom: 1rem; font-size: 0.875rem; }
.course-appearance-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-width: 320px;
}
.course-appearance-preview-card {
    width: 100%;
    pointer-events: none;
    box-shadow: var(--shadow);
}
.course-appearance-preview-note { font-size: 0.8125rem; }
.course-appearance-form { max-width: 28rem; }
.course-cover-file-preview {
    margin-bottom: 0.85rem;
}
.course-cover-file-preview-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.course-cover-file-preview-frame {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    aspect-ratio: 2 / 1;
    max-height: 10rem;
}
.course-cover-file-preview-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.course-cover-file-preview[hidden] { display: none !important; }
.course-appearance-remove { margin-top: 0.75rem; }

.class-cover-details { position: relative; }
.class-cover-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
}
.class-cover-summary::-webkit-details-marker { display: none; }
.class-cover-thumb {
    display: block;
    width: 3.5rem;
    height: 2rem;
    border-radius: 0.25rem;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.class-cover-upload-panel {
    position: absolute;
    z-index: 20;
    right: 0;
    top: calc(100% + 0.35rem);
    width: min(18rem, 70vw);
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,.12);
}
.class-cover-upload-panel .class-cover-preview {
    margin-bottom: 0.75rem;
    pointer-events: none;
}
.class-cover-upload-panel .course-card-header { min-height: 5rem; }
.class-cover-remove { margin-top: 0.5rem; }
.activity-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.8125rem; padding: 0.35rem 0.65rem;
    background: var(--bg); border-radius: var(--radius);
    color: var(--text); text-decoration: none; border: 1px solid var(--border);
}
.activity-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; border-color: var(--primary); }
.activity-link i { color: var(--primary); }

/* Empty state */
.admin-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}
.admin-empty-icon {
    width: 4rem; height: 4rem; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin: 0 auto 1rem;
}
.admin-empty-state h3 { margin-bottom: 0.35rem; font-size: 1.125rem; font-weight: 700; }
.admin-empty-state p { color: var(--text-muted); margin-bottom: 1.25rem; max-width: 28rem; margin-left: auto; margin-right: auto; }

.empty-state {
    text-align: center; padding: 2.5rem 1.5rem;
    background: var(--surface); border: 1px dashed var(--border);
    border-radius: var(--radius-lg); color: var(--text-muted);
    box-shadow: var(--shadow);
}
.empty-state i { font-size: 2.5rem; color: var(--border); margin-bottom: 0.75rem; }
.empty-state h3 { color: var(--text); margin-bottom: 0.35rem; }

/* Quick action tiles */
.action-tiles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
}
.action-tile {
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
    padding: 1.35rem 0.85rem; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    text-decoration: none !important; color: var(--text);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    font-weight: 600; font-size: 0.875rem;
}
.action-tile:hover {
    background: var(--primary-light); border-color: rgba(15, 108, 191, 0.3);
    color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px);
}
.action-tile i {
    font-size: 1.35rem; color: var(--primary);
    width: 2.5rem; height: 2.5rem; border-radius: var(--radius);
    background: var(--surface); display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
}

/* Public pages */
.public-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo {
    display: inline-flex; align-items: center; gap: 0.65rem;
    text-decoration: none;
}
.logo:hover { text-decoration: none; opacity: 0.92; }
.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    line-height: 0;
}
.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}
.logo-text-edu { color: var(--primary-dark); }
.logo-text-platform { color: var(--primary); }
.site-logo {
    display: block;
    width: auto;
    object-fit: contain;
}
.site-logo--header-mark {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    object-position: center;
}
.site-logo--header { height: 2.5rem; }
.site-logo--footer { height: 2.25rem; filter: brightness(0) invert(1); }
.site-logo--navbar { height: 1.85rem; }
.site-logo--loader { height: 2.5rem; margin: 0 auto; }
.site-logo--auth-panel { height: 3.25rem; margin-bottom: 1.25rem; }
.auth-panel-school-logo {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.92);
    background: #fff;
    padding: 0.55rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
}
.auth-panel-school-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.auth-panel-school-avatar {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 4px solid rgba(255, 255, 255, 0.92);
    margin-bottom: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
}
.public-nav { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.nav-link {
    padding: 0.45rem 0.85rem; border-radius: var(--radius);
    color: var(--text); font-weight: 500; font-size: 0.875rem;
    text-decoration: none;
}
.nav-link:hover { background: var(--bg); color: var(--primary); text-decoration: none; }

.public-footer {
    background: var(--text);
    color: rgba(255, 255, 255, 0.75);
    padding: 3rem 0 2rem;
    font-size: 0.875rem;
}
.footer-inner { display: grid; gap: 1.5rem; }
.footer-brand .logo { color: #fff; margin-bottom: 0.5rem; }
.footer-brand p { max-width: 280px; line-height: 1.6; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.footer-links a { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy { color: rgba(255, 255, 255, 0.5); font-size: 0.8125rem; margin-top: 0.5rem; }
.footer-version { color: rgba(255, 255, 255, 0.4); font-size: 0.75rem; margin-top: 0.25rem; }
@media (min-width: 768px) {
    .footer-inner { grid-template-columns: 1.5fr 1fr; align-items: start; }
    .footer-copy,
    .footer-version { grid-column: 1 / -1; }
}

/* Legacy hero (auth pages) */
.hero { text-align: center; padding: 4rem 1rem 3rem; }
.hero h1 { font-size: 2.25rem; margin-bottom: 0.75rem; color: var(--text); }
.hero p { color: var(--text-muted); font-size: 1.0625rem; max-width: 560px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== Landing page ===== */
.landing-page { background: #f4f7fb; }
.landing-main { max-width: none; padding: 0; }

.landing-flash { padding-top: 1rem; }

.landing-hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 0 2.75rem;
    background: #eef4fb url('../img/bg.jpg') center 40% / cover no-repeat;
}
.landing-hero-decor {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.landing-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    animation: landingOrbDrift 18s ease-in-out infinite;
}
.landing-hero-orb--1 {
    width: 280px;
    height: 280px;
    top: -8%;
    right: 12%;
    background: rgba(15, 108, 191, 0.35);
}
.landing-hero-orb--2 {
    width: 220px;
    height: 220px;
    bottom: 5%;
    left: 8%;
    background: rgba(8, 121, 156, 0.28);
    animation-delay: -6s;
}
.landing-hero-orb--3 {
    width: 160px;
    height: 160px;
    top: 40%;
    right: 35%;
    background: rgba(15, 108, 191, 0.2);
    animation-delay: -12s;
}
@keyframes landingOrbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(12px, -16px) scale(1.05); }
    66% { transform: translate(-8px, 10px) scale(0.95); }
}
.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.35) 100%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.45) 48%, rgba(255, 255, 255, 0.12) 100%);
    z-index: 0;
}
.landing-hero-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.landing-hero-grid {
    display: grid;
    gap: 1.5rem;
    align-items: center;
}
@media (min-width: 992px) {
    .landing-hero {
        min-height: clamp(440px, 52vh, 580px);
        padding: 5rem 0 4.5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .landing-hero-grid {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
        gap: 2rem;
        align-items: center;
    }
    .landing-hero-shell { padding: 0 2rem; }
}

.landing-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}

.landing-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    width: fit-content;
    padding: 0.45rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 108, 191, 0.2);
    border-radius: 999px;
    font-size: 0.6875rem; font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(15, 108, 191, 0.08);
}
.landing-badge i {
    font-size: 0.625rem;
    animation: landingSparkle 2.5s ease-in-out infinite;
}
@keyframes landingSparkle {
    0%, 100% { opacity: 1; transform: rotate(0deg); }
    50% { opacity: 0.7; transform: rotate(12deg); }
}
.landing-hero-copy h1 {
    font-size: clamp(1.85rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #08799c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-gradient--animated {
    background-size: 200% auto;
    animation: landingGradientShift 6s ease-in-out infinite;
}
@keyframes landingGradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}
.landing-lead {
    font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
    color: var(--ink-2);
    line-height: 1.55;
    margin-bottom: 1.15rem;
    max-width: 52ch;
}
.landing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.landing-hero-btn-primary {
    box-shadow: 0 6px 20px rgba(15, 108, 191, 0.35);
    padding: 0.65rem 1.25rem;
    transition: box-shadow 0.25s, transform 0.25s, background 0.2s;
}
.landing-hero-btn-primary:hover {
    box-shadow: 0 10px 28px rgba(15, 108, 191, 0.45);
    text-decoration: none;
    transform: translateY(-2px);
}
.landing-hero-btn-secondary,
.landing-hero-btn-tertiary {
    background: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    border: 1px solid rgba(15, 108, 191, 0.15);
    padding: 0.65rem 1.15rem;
    transition: background 0.2s, border-color 0.2s, transform 0.25s, box-shadow 0.25s;
}
.landing-hero-btn-secondary:hover,
.landing-hero-btn-tertiary:hover {
    background: #fff;
    border-color: var(--primary);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(15, 108, 191, 0.12);
}

.landing-hero-panel {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 0.85rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
    transition: box-shadow 0.3s, transform 0.3s;
}
.landing-hero-panel:hover {
    box-shadow: 0 16px 40px rgba(15, 108, 191, 0.14);
}
.hero-panel-grid .hero-panel-card:hover {
    border-color: rgba(15, 108, 191, 0.25);
}
@media (min-width: 992px) {
    .landing-hero-panel {
        padding: 0.75rem;
        max-width: 280px;
        justify-self: end;
    }
}
.hero-panel-card--featured {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 0.65rem;
    color: #fff;
}
.hero-panel-icon {
    width: 1.75rem; height: 1.75rem; flex-shrink: 0;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
}
.hero-panel-card--featured strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}
.hero-panel-card--featured p {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.4;
    opacity: 0.92;
}
.hero-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}
.hero-panel-grid .hero-panel-card {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text);
}
.hero-panel-grid .hero-panel-card i {
    width: 1.35rem; height: 1.35rem;
    border-radius: 0.35rem;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.625rem;
    flex-shrink: 0;
}
.btn-lg { padding: 0.75rem 1.35rem; font-size: 1rem; border-radius: 0.625rem; }
.btn-ghost {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn-ghost:hover { background: #fff; border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* Hero visual cards (hidden when photo background is used) */
.landing-hero-visual {
    position: relative;
    min-height: 320px;
    display: none;
}

.hero-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(15, 108, 191, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
}
.hero-card-main {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(100%, 320px);
    padding: 1.25rem 1.35rem;
    display: flex; align-items: center; gap: 1rem;
    animation: heroFloat 6s ease-in-out infinite;
}
.hero-card-icon {
    width: 48px; height: 48px; border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; flex-shrink: 0;
}
.hero-card-main strong { display: block; font-size: 0.9375rem; margin-bottom: 0.15rem; }
.hero-card-main small { color: var(--text-muted); font-size: 0.8125rem; }

.hero-card-float {
    position: absolute;
    padding: 0.65rem 1rem;
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8125rem; font-weight: 600; color: var(--text);
    white-space: nowrap;
}
.hero-card-float i { color: var(--primary); }
.hero-card-1 { top: 8%; right: 0; animation: heroFloat 5s ease-in-out infinite 0.5s; }
.hero-card-2 { bottom: 12%; left: 0; animation: heroFloat 5.5s ease-in-out infinite 1s; }
.hero-card-3 { top: 18%; left: 5%; animation: heroFloat 6.5s ease-in-out infinite 1.5s; }

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.hero-card-main { animation-name: heroFloatMain; }
@keyframes heroFloatMain {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 8px)); }
}

/* Schools section */
.landing-section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.landing-section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.landing-section-head h2 i { color: var(--primary); margin-right: 0.35rem; }
.landing-section-head p { color: var(--text-muted); font-size: 1rem; }

.landing-page .container.landing-section-container {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (min-width: 992px) {
    .landing-page .container.landing-section-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.landing-page .public-header .container {
    max-width: 1280px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (min-width: 992px) {
    .landing-page .public-header .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.schools-section {
    position: relative;
    padding: 3rem 0 3.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.schools-section-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(15, 108, 191, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(8, 121, 156, 0.05) 0%, transparent 50%);
}
.schools-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #08799c 45%, transparent);
    opacity: 0.55;
}
.schools-section-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(226, 230, 234, 0.85);
}
.schools-section-head {
    display: block;
    text-align: left;
    max-width: none;
    margin: 0;
    flex: 1 1 18rem;
}
.schools-section-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.schools-section-head h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text);
}
.schools-section-head h2 i {
    color: var(--primary);
    font-size: 0.85em;
}
.schools-section-header .schools-search-wrap {
    margin-bottom: 0;
    flex: 1 1 16rem;
    max-width: 24rem;
    min-width: min(100%, 16rem);
}
.schools-section-header .schools-search { max-width: none; }

.schools-search-wrap { margin-bottom: 1.5rem; }
.schools-section-header + .school-carousel-wrap,
.schools-section-header + .landing-empty,
.schools-section-header + .empty-state { margin-top: 0; }
.schools-search {
    position: relative;
    max-width: 32rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.schools-search:focus-within {
    border-color: rgba(15, 108, 191, 0.35);
    box-shadow: 0 4px 16px rgba(15, 108, 191, 0.1);
}
.schools-search > .fa-magnifying-glass {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.schools-search .schools-search-input {
    width: 100%;
    padding: 0.8rem 1.25rem 0.8rem 2.75rem;
    border: none;
    background: transparent;
    border-radius: 999px;
    font-size: 0.9375rem;
    transition: none;
}
.schools-search .schools-search-input:focus {
    outline: none;
    box-shadow: none;
}
.schools-search-empty { margin-top: 0.5rem; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.school-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
#schoolGrid [data-search][hidden],
#schoolGrid .school-card--filtered-out,
#schoolGrid .school-card-wrap[hidden],
#schoolGrid .school-card-wrap.school-card--filtered-out {
    display: none !important;
}
#schoolGrid.is-filtering [data-landing-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
}

.school-card-wrap {
    position: relative;
    min-width: 0;
}
.school-card-wrap.is-pinned .school-card-modern {
    border-color: rgba(15, 108, 191, 0.35);
    box-shadow: 0 6px 22px rgba(15, 108, 191, 0.12);
}
.school-card-pin {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 4;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-muted);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.school-card-pin:hover {
    background: #fff;
    color: var(--primary);
    transform: scale(1.06);
}
.school-card-pin.is-active {
    background: var(--primary);
    color: #fff;
}
.school-card-pin.is-active i {
    transform: rotate(-45deg);
}
.school-card-pin i {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.school-card-modern {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.125rem;
    min-height: 18rem;
    padding: 0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.school-card-cover {
    height: 8rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    flex-shrink: 0;
}
.school-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 35%, rgba(15, 23, 42, 0.22) 100%);
    pointer-events: none;
}
.school-card-status {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.school-card-cover .badge-active {
    background: rgba(212, 237, 218, 0.95);
    color: #155724;
}
.school-card-cover .badge-pending {
    background: rgba(255, 243, 205, 0.95);
    color: #856404;
}
.school-card-cover .badge-suspended {
    background: rgba(226, 230, 234, 0.95);
    color: #495057;
}
.school-card-cover .badge-rejected {
    background: rgba(248, 215, 218, 0.95);
    color: #721c24;
}
.school-card-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 1.25rem 1.25rem;
    flex: 1;
}
a.school-card-modern {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.school-card-modern:hover,
a.school-card-modern:focus-visible {
    text-decoration: none;
    color: inherit;
}
a.school-card-modern:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}
.school-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #08799c);
    opacity: 0;
    transition: opacity 0.3s;
}
.school-card-modern:hover {
    box-shadow: 0 16px 40px rgba(15, 108, 191, 0.12);
    transform: translateY(-4px);
    border-color: rgba(15, 108, 191, 0.28);
}
.school-card-modern:hover::before {
    opacity: 1;
}
.school-avatar {
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    border: 4px solid var(--surface);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-left: -0.25rem;
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
    transition: transform 0.3s;
}
.school-card-modern:hover .school-avatar {
    transform: scale(1.04);
}
.school-avatar--image {
    padding: 0;
    overflow: hidden;
    background: var(--surface);
}
.school-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.school-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: -1.0rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}
.school-card-identity {
    min-width: 0;
    flex: 1;
    padding-top: 1.85rem;
}
.school-card-identity h3 {
    font-size: 1.0625rem;
    font-weight: 800;
    margin: 0 0 0.4rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.school-card-identity .school-code-tag {
    max-width: 100%;
    font-size: 0.5625rem;
    padding: 0.2rem 0.45rem;
    letter-spacing: 0.03em;
}
.school-card-identity .school-code-tag i {
    font-size: 0.5rem;
}
.school-card-meta {
    min-width: 0;
    margin-bottom: 1rem;
}
.school-card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.school-card-footer .school-card-meta {
    margin-bottom: 0;
}
.school-card-modern.is-pending .school-avatar { background: linear-gradient(135deg, #a6670e, #856404); }
.school-card-modern.is-suspended .school-avatar { background: linear-gradient(135deg, #6c757d, #495057); }
.school-card-modern.is-rejected .school-avatar { background: linear-gradient(135deg, #ca3120, #991b1b); }
.school-card-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
    min-width: 0;
}
.school-card-location i {
    color: var(--primary);
    flex-shrink: 0;
    font-size: 0.75rem;
}
.school-card-location span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.school-code-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.school-code-tag i {
    color: var(--primary);
    flex-shrink: 0;
}
.school-card-link {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    margin-top: auto;
    padding: 0.65rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    font-weight: 600; font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.school-card-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    text-decoration: none;
}

.landing-empty {
    background: var(--bg);
    border: 1px dashed rgba(15, 108, 191, 0.2);
    border-radius: 1.125rem;
    padding: 3rem 2rem;
    text-align: center;
}
.schools-section .landing-empty {
    margin-top: 0.5rem;
}
.empty-state-icon {
    width: 64px; height: 64px; margin: 0 auto 1rem;
    border-radius: 1rem;
    background: var(--primary-light);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem;
}

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; padding: 2rem 0 4rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.feature-card i { font-size: 1.75rem; color: var(--primary); margin-bottom: 0.75rem; }

.section-title {
    font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: 0.5rem; color: var(--text);
}
.school-card .course-card-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); }
.school-card.pending-card .course-card-header { background: linear-gradient(135deg, #a6670e, #856404); }
.school-card.suspended-card .course-card-header { background: linear-gradient(135deg, #6c757d, #495057); }
.school-card.rejected-card .course-card-header { background: linear-gradient(135deg, #ca3120, #991b1b); }

.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, #eef4fb 0%, #f0f2f5 45%, #e8f0fa 100%);
}
.auth-page .auth-card-split { max-width: 820px; }
.auth-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.75rem 1.85rem;
    width: 100%; max-width: 400px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}
.auth-card.wide { max-width: 560px; }

.auth-top {
    margin-bottom: 1.25rem;
}
.auth-top .auth-footer-link {
    justify-content: flex-start;
}

.auth-brand {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    margin-bottom: 1.5rem; text-align: center;
}
.auth-brand-icon {
    width: 3rem; height: 3rem; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; box-shadow: 0 4px 12px rgba(15, 108, 191, 0.25);
}
.auth-brand-name { font-size: 1.125rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }

/* Super admin login */
.auth-page--superadmin {
    background: linear-gradient(160deg, #f4eef9 0%, #faf6f2 42%, #eef1f8 100%);
}
.auth-card-split--superadmin { max-width: 860px; }
.auth-split-panel--superadmin {
    background: linear-gradient(155deg, #4a2f6e 0%, #2f1b4d 55%, #1a1030 100%);
}
.auth-split-panel--superadmin .auth-split-panel-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(214, 90, 58, 0.22) 0%, transparent 42%),
        radial-gradient(circle at 88% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 45%);
}
.auth-split-panel--superadmin .auth-split-panel-orb--2 {
    background: rgba(214, 90, 58, 0.35);
}
.auth-split-panel--superadmin h2 {
    margin: 0;
    font-size: 1.75rem;
}
.auth-superadmin-logo-wrap {
    display: inline-block;
    background: #fff;
    border-radius: 1rem;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.35rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
.auth-superadmin-logo {
    display: block;
    width: 100%;
    max-width: 210px;
    height: auto;
}
.auth-superadmin-logo-wrap--mobile {
    display: block;
    margin: 0 auto 1.25rem;
    text-align: center;
}
@media (min-width: 768px) {
    .auth-superadmin-logo-wrap--mobile { display: none; }
}
.auth-split-form--superadmin { padding: 2rem 1.85rem 1.75rem; }
.auth-form-heading { margin-bottom: 1.35rem; }
.auth-form-heading h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0.5rem 0 0.25rem;
}
.auth-form-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.auth-superadmin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #f3eef9;
    color: #4a2f6e;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.auth-submit--superadmin {
    background: linear-gradient(135deg, #4a2f6e 0%, #2f1b4d 100%);
    border-color: #2f1b4d;
}
.auth-submit--superadmin:hover {
    background: linear-gradient(135deg, #563880 0%, #3a2258 100%);
    border-color: #3a2258;
}
.auth-superadmin-note {
    margin: 1.25rem 0 0;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.auth-superadmin-note i { font-size: 0.75rem; opacity: 0.85; }

/* ===== Super Admin Dashboard & Schools ===== */
.superadmin-dashboard,
.superadmin-schools,
.superadmin-storage {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.superadmin-stats { margin-bottom: 1.25rem; }
.superadmin-stat-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}
.superadmin-stat-link .stat-card { height: 100%; }
.superadmin-stat-link:hover .stat-card {
    border-color: rgba(74, 47, 110, 0.25);
    box-shadow: var(--shadow-md);
}
.stat-card-icon-ns { background: #f3ebfa; color: #4a2f6e; }
.stat-card-icon-muted { background: #f1f3f5; color: #6c757d; }
.stat-card--highlight {
    border-color: rgba(166, 103, 14, 0.35);
    background: linear-gradient(135deg, #fffdf5 0%, var(--surface) 100%);
}
.stat-card--highlight .value { color: var(--warning); }

.superadmin-alert-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.15rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #fff8e6 0%, #fffdf5 100%);
    border: 1px solid rgba(166, 103, 14, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.superadmin-alert-banner-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #fff3cd;
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.superadmin-alert-banner-text {
    flex: 1;
    min-width: 12rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.superadmin-alert-banner-text strong {
    font-size: 0.9375rem;
    color: var(--text);
}
.superadmin-alert-banner-text span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.superadmin-panel .panel-header h2 i { color: #4a2f6e; }
.superadmin-panel-sub {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.superadmin-pending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.superadmin-pending-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.superadmin-pending-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(166, 103, 14, 0.3);
}
.superadmin-pending-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.superadmin-pending-card-info {
    flex: 1;
    min-width: 0;
}
.superadmin-pending-card-info h3 {
    margin: 0 0 0.25rem;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
}
.superadmin-pending-card-info h3 a {
    color: var(--text);
    text-decoration: none;
}
.superadmin-pending-card-info h3 a:hover { color: var(--primary); }
.superadmin-pending-email {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    word-break: break-all;
}
.superadmin-pending-email i { font-size: 0.7rem; opacity: 0.8; flex-shrink: 0; }
.superadmin-pending-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.superadmin-pending-meta > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.superadmin-pending-actions {
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}

.superadmin-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.superadmin-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.superadmin-filter-tab i { font-size: 0.75rem; opacity: 0.85; }
.superadmin-filter-tab:hover {
    background: var(--bg);
    color: var(--text);
}
.superadmin-filter-tab.is-active {
    background: linear-gradient(135deg, #4a2f6e 0%, #2f1b4d 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(47, 27, 77, 0.25);
}
.superadmin-filter-tab.is-active i { opacity: 1; }
.superadmin-filter-tab--pending.is-active { background: linear-gradient(135deg, #a6670e, #856404); box-shadow: 0 2px 8px rgba(166, 103, 14, 0.25); }
.superadmin-filter-tab--active.is-active { background: linear-gradient(135deg, var(--success), #2d6a2a); box-shadow: 0 2px 8px rgba(53, 122, 50, 0.25); }
.superadmin-filter-tab--rejected.is-active { background: linear-gradient(135deg, var(--danger), #991b1b); box-shadow: 0 2px 8px rgba(202, 49, 32, 0.25); }
.superadmin-filter-tab--suspended.is-active { background: linear-gradient(135deg, #6c757d, #495057); box-shadow: 0 2px 8px rgba(108, 117, 125, 0.25); }
.superadmin-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}
.superadmin-filter-tab.is-active .superadmin-filter-count {
    background: rgba(255, 255, 255, 0.22);
}

.superadmin-table-card {
    margin-bottom: 1rem;
}
.superadmin-table-wrap {
    max-height: none;
}
.superadmin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.superadmin-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f4f6f9;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    white-space: nowrap;
}
.superadmin-table tbody td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    min-height: 4.25rem;
}
.superadmin-table tbody tr:last-child td { border-bottom: none; }
.superadmin-table-row { cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.superadmin-table-row:hover {
    background: linear-gradient(90deg, #f8f6fc 0%, #fafbff 100%);
}
.superadmin-table-row:hover .superadmin-school-name { color: var(--primary); }
.superadmin-col-school { min-width: 14rem; }
.superadmin-col-admin { min-width: 12rem; }
.superadmin-col-status { width: 8.5rem; }
.superadmin-col-date { width: 9.5rem; }
.superadmin-col-actions { width: 1%; text-align: right; }
.superadmin-table-card .admin-empty-state {
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
}
.superadmin-table-card-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}
.superadmin-table-card-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.superadmin-storage-toolbar { justify-content: flex-end; }
.storage-bar-list { display: grid; gap: 0.85rem; }
.storage-bar-item { display: grid; gap: 0.35rem; }
.storage-bar-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8125rem;
}
.storage-bar-head a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}
.storage-bar-head a:hover { color: var(--primary); }
.storage-bar-head span { color: var(--text-muted); white-space: nowrap; }
.storage-bar-track {
    height: 0.45rem;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
}
.storage-bar-track--inline { flex: 1; min-width: 4rem; }
.storage-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4a2f6e, #6b46a3);
}
.storage-share-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 8rem;
}
.storage-size-cell strong { color: #4a2f6e; }
.storage-breakdown-row td {
    background: #fafbfc;
    padding-top: 0;
}
.storage-breakdown {
    padding: 0.75rem 0 0.25rem;
}
.storage-breakdown h3 {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
}
.storage-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.storage-breakdown-item {
    display: grid;
    gap: 0.15rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.storage-breakdown-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}
.storage-breakdown-item strong { font-size: 0.9375rem; }
.storage-breakdown-item small { color: var(--text-muted); font-size: 0.75rem; }

.superadmin-school-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, #4a2f6e, #2f1b4d);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(47, 27, 77, 0.22);
}
.superadmin-school-avatar.school-avatar--image {
    padding: 0;
    overflow: hidden;
    background: var(--surface);
}
.superadmin-school-avatar .school-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.table-school-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.superadmin-school-cell { gap: 0.85rem; min-width: 0; }
.superadmin-school-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    min-height: 2.5rem;
}
.superadmin-school-name {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    transition: color 0.15s;
}
.superadmin-school-code {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.superadmin-contact-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    min-height: 2.5rem;
}
.superadmin-admin-name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.3;
    color: var(--text);
}
.superadmin-contact-email {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    word-break: break-all;
    line-height: 1.3;
}
.superadmin-email-cell {
    font-size: 0.875rem;
    color: var(--text-muted);
    word-break: break-all;
}
.superadmin-date-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.superadmin-date-cell i { font-size: 0.75rem; opacity: 0.75; }

.superadmin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}
.superadmin-status-badge i { font-size: 0.625rem; }

.superadmin-action-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.3rem;
}
.superadmin-actions {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}
.superadmin-actions.actions {
    flex-wrap: nowrap;
    gap: 0;
}
.table-wrap td.superadmin-actions {
    min-width: 0;
    width: 1%;
    padding-left: 0.5rem;
    padding-right: 1rem;
}
.superadmin-action-form {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    margin: 0;
}
.superadmin-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8125rem;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    flex-shrink: 0;
}
.superadmin-icon-btn:hover {
    background: var(--bg);
    color: var(--text);
    border-color: #cbd5e1;
}
.superadmin-icon-btn--success {
    color: #166534;
    border-color: rgba(22, 101, 52, 0.2);
    background: #f0fdf4;
}
.superadmin-icon-btn--success:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #14532d;
}
.superadmin-icon-btn--danger {
    color: #991b1b;
    border-color: rgba(153, 27, 27, 0.18);
    background: #fef2f2;
}
.superadmin-icon-btn--danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #7f1d1d;
}
.superadmin-icon-btn--view {
    color: var(--text-muted);
    background: var(--surface);
}
.superadmin-icon-btn--view:hover {
    color: var(--primary);
    border-color: rgba(15, 108, 191, 0.35);
    background: #eef5fc;
}

.superadmin-panel .admin-empty-state {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .superadmin-alert-banner { flex-direction: column; align-items: flex-start; }
    .superadmin-alert-banner .btn { width: 100%; }
    .superadmin-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .superadmin-pending-grid { grid-template-columns: 1fr; }
    .superadmin-table-card-header { padding: 0.9rem 1rem; }
    .superadmin-table thead th,
    .superadmin-table tbody td { padding: 0.75rem 1rem; }
    .superadmin-table tbody td { height: auto; }
    .superadmin-table th:nth-child(4),
    .superadmin-table td:nth-child(4) { display: none; }
}

.school-login-banner {
    display: flex; align-items: center; gap: 0.85rem;
    background: linear-gradient(135deg, #eef5fc 0%, #e7f0fa 100%);
    border: 1px solid rgba(15, 108, 191, 0.15);
    border-radius: var(--radius-lg); padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
}
.school-login-avatar {
    width: 2.75rem; height: 2.75rem; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-size: 1.125rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.school-login-banner small {
    display: block; font-size: 0.6875rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
    margin-bottom: 0.1rem;
}
.school-login-banner strong {
    display: block; font-size: 1.0625rem; font-weight: 700;
    color: var(--text); line-height: 1.3; letter-spacing: -0.01em;
}

.auth-card .form-group:last-of-type { margin-bottom: 1.25rem; }
.auth-submit { padding: 0.65rem 1rem; font-size: 0.9375rem; margin-top: 0.25rem; }

.auth-footer {
    margin-top: 1.5rem; padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center; display: flex; flex-direction: column; gap: 0.65rem;
}
.auth-footer p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.auth-footer-link {
    font-size: 0.875rem; font-weight: 500; color: var(--primary);
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
}
.auth-footer-link:hover { color: var(--primary-dark); text-decoration: underline; }
.auth-footer-link.muted { color: var(--text-muted); font-weight: 400; }
.auth-footer-link.muted:hover { color: var(--text); }

.auth-card .school-code-input {
    text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
    font-family: ui-monospace, monospace;
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; font-size: 0.875rem; }
.form-group small { color: var(--text-muted); font-size: 0.8125rem; }
.form-control {
    width: 100%; padding: 0.55rem 0.75rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9375rem; font-family: inherit; background: var(--surface);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,108,191,.15); }
textarea.form-control { min-height: 100px; resize: vertical; }

.password-field { position: relative; display: flex; align-items: stretch; }
.password-field .form-control { padding-right: 2.75rem; }
.password-toggle {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 2.75rem; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; border-radius: 0 var(--radius) var(--radius) 0;
    display: flex; align-items: center; justify-content: center;
}
.password-toggle:hover { color: var(--primary); }
.password-toggle:focus { outline: none; color: var(--primary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
    padding: 0.5rem 1rem; border: none; border-radius: var(--radius);
    font-size: 0.9375rem; font-weight: 600; cursor: pointer;
    text-decoration: none; font-family: inherit; line-height: 1.4;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(15, 108, 191, 0.2); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; box-shadow: 0 2px 8px rgba(15, 108, 191, 0.25); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8125rem; }
.btn-block { width: 100%; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9375rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.25rem 1.35rem;
    display: flex; align-items: center; gap: 1rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-icon {
    width: 2.75rem; height: 2.75rem; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; flex-shrink: 0;
}
.stat-card-icon-blue { background: #e7f0fa; color: var(--primary); }
.stat-card-icon-green { background: #e8f5e9; color: var(--success); }
.stat-card-icon-purple { background: #f3e8ff; color: #7c3aed; }
.stat-card-icon-orange { background: #fff4e6; color: var(--warning); }
.stat-card .value { font-size: 1.625rem; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -0.02em; }
.stat-card .label { color: var(--text-muted); font-size: 0.8125rem; font-weight: 500; margin-top: 0.1rem; }

.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
.panel h2 {
    font-size: 1.05rem; margin-bottom: 0.85rem; font-weight: 700;
    display: flex; align-items: center; gap: 0.5rem;
}
.panel h2 i { color: var(--primary); font-size: 0.95rem; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.75rem; }
.panel-header h2 { margin-bottom: 0; }

.login-code-card {
    background: linear-gradient(135deg, #0f6cbf 0%, #095ba8 100%);
    border: none; color: #fff;
    box-shadow: 0 4px 12px rgba(15, 108, 191, 0.2);
    padding: 0.85rem 1.15rem;
}
.login-code-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.login-code-info h2 {
    color: #fff;
    font-size: 0.9375rem;
    margin-bottom: 0.15rem;
    font-weight: 700;
}
.login-code-info h2 i { color: rgba(255,255,255,0.9); font-size: 0.875rem; }
.login-code-desc {
    color: rgba(255,255,255,0.78);
    font-size: 0.8125rem;
    margin: 0;
    line-height: 1.4;
}
.login-code-details {
    text-align: right;
    flex-shrink: 0;
}
.login-code-value {
    font-size: 1rem; font-weight: 800; letter-spacing: 0.08em;
    background: rgba(255,255,255,0.15); display: inline-block;
    padding: 0.3rem 0.65rem; border-radius: 0.375rem;
    margin: 0 0 0.2rem; font-family: ui-monospace, monospace;
    line-height: 1.3;
}
.login-code-url {
    color: rgba(255,255,255,0.78);
    font-size: 0.75rem;
    margin: 0;
    word-break: break-all;
}
.login-code-card a { color: #fff; text-decoration: underline; }
@media (max-width: 640px) {
    .login-code-details { text-align: left; width: 100%; }
}

.admin-table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.admin-table-card .table-wrap { border: none; border-radius: 0; box-shadow: none; overflow-x: hidden; }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.admin-table-card table,
.admin-table-card .table-wrap table {
    table-layout: fixed;
    font-size: 0.8125rem;
}
.admin-table-card th,
.admin-table-card td {
    padding: 0.5rem 0.75rem;
}
.admin-table-card th {
    font-size: 0.625rem;
    letter-spacing: 0.05em;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}
.admin-table-card td.col-desc { line-height: 1.4; font-size: 0.8125rem; }
.admin-table-card .table-subject-cell { gap: 0.5rem; }
.admin-table-card .table-icon-badge {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
}
.admin-table-card .table-user-name,
.admin-table-card .table-subject-cell strong { font-size: 0.8125rem; }
.admin-table-card .badge { font-size: 0.6875rem; padding: 0.12rem 0.4rem; }
.admin-table-card .btn-sm {
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
}
.admin-table-card .table-row-actions { gap: 0.35rem; }
.admin-table-card tbody tr td.text-muted { padding: 1.25rem 0.75rem; }

/* Subjects catalog table */
.admin-table-card--subjects { overflow: hidden; }
.admin-table-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}
.admin-table-card-head-text h2 {
    margin: 0 0 0.15rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
}
.admin-table-card-head-text p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.admin-table-search {
    position: relative;
    min-width: min(100%, 240px);
    max-width: 280px;
    flex: 1;
}
.admin-table-search i {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8125rem;
    pointer-events: none;
}
.admin-table-search .form-control {
    padding: 0.4rem 0.65rem 0.4rem 2rem;
    font-size: 0.8125rem;
    border-radius: 999px;
    background: var(--bg);
}

.admin-data-table thead th {
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
    color: #64748b;
}
.admin-data-table tbody tr {
    transition: background 0.12s, box-shadow 0.12s;
}
.admin-data-table tbody tr:hover {
    background: #f8fbff;
}
.admin-data-table tbody tr:hover .subject-code-chip {
    border-color: var(--primary);
    color: var(--primary-dark);
    background: var(--primary-light);
}
.admin-data-table tbody tr[hidden] { display: none; }

.admin-table-card--subjects .col-subject { width: 6.5rem; }
.admin-table-card--subjects .col-scheme { width: 9.5rem; }
.admin-table-card--subjects .col-num { width: 4.5rem; }
.admin-table-card--subjects th.col-actions,
.admin-table-card--subjects td.actions { width: 4.5rem; }

.subject-code-link {
    text-decoration: none !important;
    display: inline-block;
}
.subject-code-chip {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.02em;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.subject-title {
    color: var(--text);
    font-size: 0.8125rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.subject-title--empty { color: var(--text-muted); font-style: italic; }

.subject-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}
.subject-status i { font-size: 0.625rem; }
.subject-status--ok {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.subject-status--muted {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

.subject-usage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
}
.subject-usage-badge.is-active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none !important;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.table-action-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}
.table-action-btn--danger:hover {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}
.admin-table-card--subjects .table-row-actions {
    opacity: 0.55;
    transition: opacity 0.12s;
}
.admin-table-card--subjects tbody tr:hover .table-row-actions,
.admin-table-card--subjects tbody tr:focus-within .table-row-actions {
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

th, td {
    padding: 0.85rem 1.15rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    overflow-wrap: anywhere;
}
th { background: #f8fafc; font-weight: 700; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #f8fbff; }
tr.table-row-link { cursor: pointer; }
tr.table-row-link:hover {
    background: #e6edf6;
}
tr.table-row-link:hover .table-user-name { color: var(--primary); }
tr.table-row-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    background: #e6edf6;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr td.text-muted { padding: 2rem 1.15rem; text-align: center; }

/* Standard admin list tables */
.admin-table-card:not(.admin-table-card--subjects) .admin-data-table {
    table-layout: auto;
    width: 100%;
}
/* Shrink-to-fit columns cluster on the left; flexible column absorbs extra width */
.admin-data-table--people .col-name,
.admin-data-table--people .col-tags,
.admin-data-table--people .col-status,
.admin-data-table--people td.actions {
    width: 1%;
    white-space: nowrap;
}
.admin-data-table--people .col-email {
    width: 99%;
}
.admin-data-table--roster .col-code,
.admin-data-table--roster .col-num,
.admin-data-table--roster .col-status,
.admin-data-table--roster td.actions {
    width: 1%;
    white-space: nowrap;
}
.admin-data-table--roster .col-name {
    width: auto;
    max-width: 14rem;
}
.admin-data-table--roster .col-program {
    width: auto;
    max-width: 10rem;
}

.admin-table-card .col-program { width: auto; }
.admin-table-card .col-code { width: 1%; white-space: nowrap; }
.admin-table-card .col-status { width: 1%; white-space: nowrap; }
.admin-table-card .col-num { width: 1%; text-align: center; white-space: nowrap; }
.admin-table-card th.col-num { text-align: center; padding-left: 0.35rem; padding-right: 0.35rem; }
.admin-table-card td.col-num { padding-left: 0.35rem; padding-right: 0.35rem; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.8125rem; }
.admin-table-card th.col-actions,
.admin-table-card td.actions {
    width: 1%;
    white-space: nowrap;
    text-align: left;
    padding-right: 0.75rem;
}

.admin-table-card .col-email,
.admin-table-card td.col-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-table-card .col-program,
.admin-table-card td.col-program {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
}
.admin-table-card .cell-stack {
    min-width: 0;
}
.admin-table-card .cell-stack__title {
    display: block;
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-table-card .cell-stack__title:hover {
    color: var(--primary);
    text-decoration: underline;
}
.admin-table-card .cell-stack__sub {
    display: block;
    font-size: 0.6875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.1rem;
}

.admin-table-card .table-user-cell,
.admin-table-card .table-group-cell {
    gap: 0.45rem;
    min-width: 0;
}
.admin-table-card .table-avatar {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.5625rem;
}
.admin-table-card .table-icon-badge {
    width: 1.65rem;
    height: 1.65rem;
    font-size: 0.6875rem;
}
.admin-table-card .table-user-name,
.admin-table-card .table-group-cell strong {
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-table-card .table-group-cell small {
    font-size: 0.6875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.admin-table-card .subject-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    max-height: 2.4rem;
    overflow: hidden;
}
.admin-table-card .subject-tag {
    font-size: 0.625rem;
    padding: 0.08rem 0.35rem;
}
.admin-table-card .badge {
    font-size: 0.625rem;
    padding: 0.12rem 0.4rem;
    white-space: nowrap;
}
.admin-table-card .subject-code-chip {
    font-size: 0.6875rem;
    padding: 0.12rem 0.35rem;
}

.admin-table-card .table-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    opacity: 0.65;
    transition: opacity 0.12s;
}
.admin-table-card tbody tr:hover .table-row-actions,
.admin-table-card tbody tr:focus-within .table-row-actions {
    opacity: 1;
}
.admin-table-card .table-row-actions form {
    display: inline-flex;
    margin: 0;
}
.table-action-btn--primary {
    color: var(--primary);
    border-color: #b8d4f0;
    background: var(--primary-light);
}
.table-action-btn--primary:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* Subjects catalog overrides */
.admin-table-card--subjects .col-subject { width: 6.5rem; }
.admin-table-card--subjects .col-scheme { width: 9.5rem; }
.admin-table-card--subjects .col-num { width: 4.5rem; }
.admin-table-card--subjects th.col-actions,
.admin-table-card--subjects td.actions { width: 4.5rem; }

.subject-scheme-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.table-user-cell, .table-subject-cell, .table-group-cell {
    display: flex; align-items: center; gap: 0.75rem;
}
.table-avatar {
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.table-user-name { font-weight: 600; }
.table-user-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    border-radius: var(--radius);
}
.table-user-link:hover .table-user-name {
    color: var(--primary);
    text-decoration: underline;
}
.table-user-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.table-icon-badge {
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius);
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    font-size: 0.875rem;
}
.table-icon-badge-group { background: #f3e8ff; color: #7c3aed; }
.table-group-cell strong { display: block; line-height: 1.3; }
.table-group-cell small { display: block; font-size: 0.8125rem; }
.table-group-link { text-decoration: none; color: inherit; display: block; }
.table-group-link:hover .table-group-cell strong { color: var(--primary); }

.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-active { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-suspended { background: #e9ecef; color: #495057; }
.badge-submitted { background: #d1ecf1; color: #0c5460; }
.badge-graded { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-inactive { background: #e9ecef; color: #495057; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
td.actions,
th.actions,
td.col-actions,
th.col-actions {
    display: table-cell;
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
}
.table-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
}
.table-row-actions form {
    display: inline-flex;
    margin: 0;
}
.inline-form { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 1rem; }
.mt-1 { margin-top: 1rem; }
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input { max-width: 220px; }

.question-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; background: var(--bg); }
.option-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }

.pagination { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.pagination-info { color: var(--text-muted); font-size: 0.875rem; }

.pending-card {
    border-left: 4px solid var(--warning);
    background: #fffdf5;
}

/* Admin setup & group management */
.setup-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.setup-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    transition: border-color 0.15s;
}
.setup-checklist-item.is-done {
    background: #f0faf2;
    border-color: #b8dfc0;
}
.setup-checklist-num {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    color: var(--text-muted);
}
.setup-checklist-item.is-done .setup-checklist-num {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.setup-checklist-body strong { display: block; margin-bottom: 0.15rem; }
.setup-checklist-body p { font-size: 0.875rem; margin-bottom: 0.5rem; }

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
}
.admin-tab:hover { color: var(--primary); text-decoration: none; }
.admin-tab.active {
    color: var(--primary);
    background: var(--surface);
    border-color: var(--border);
}

.subject-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.subject-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.subject-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}
.subject-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
}
.subject-checkbox input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.subject-checkbox__label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.subject-checkbox__title {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.teacher-subject-picker { margin-top: 0.25rem; }
.teacher-subject-picker .subject-checkbox-grid {
    max-height: 280px;
    overflow-y: auto;
}
.teacher-subject-picker .subject-checkbox.is-hidden {
    display: none !important;
}
.teacher-subject-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.teacher-subject-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.teacher-subject-empty {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.75rem;
}
.teacher-subject-empty.hidden { display: none; }

.inline-assign-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.inline-assign-form .form-control { min-width: 180px; max-width: 280px; }

.group-subject-add { margin-bottom: 1rem; }
.group-subject-add-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.group-subject-add-form .searchable-select {
    flex: 1;
    min-width: min(100%, 240px);
    max-width: 420px;
}

.searchable-select {
    position: relative;
}
.searchable-select__native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.searchable-select__control {
    position: relative;
}
.searchable-select__control .fa-magnifying-glass {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8125rem;
    pointer-events: none;
}
.searchable-select__input {
    width: 100%;
    padding-left: 2.15rem;
}
.searchable-select__panel {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow-y: auto;
}
.searchable-select__panel[hidden] {
    display: none;
}
.searchable-select__option {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--ink);
}
.searchable-select__option:hover,
.searchable-select__option.is-active {
    background: var(--surface-2);
}
.searchable-select__option.is-selected {
    font-weight: 600;
}
.searchable-select__empty {
    margin: 0;
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.group-subject-add {
    position: relative;
    z-index: 2;
}
.group-subject-add-hint {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.group-subject-add-hint.hidden { display: none; }

.group-detail-header { margin-bottom: 0; }
.group-detail-header .panel-header { margin-bottom: 0; }

.user-profile-header {
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}
.user-profile-header::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
}
.user-profile-header .panel-header { margin-bottom: 0; align-items: flex-start; }
.user-profile-intro {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.user-profile-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px rgba(15, 108, 191, 0.25);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-profile-avatar--teacher {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
}
.user-profile-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.user-profile-title-row h2 {
    margin: 0;
    font-size: 1.35rem;
}
.user-profile-role {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
}
.user-profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: start;
}
@media (min-width: 900px) {
    .user-profile-grid {
        grid-template-columns: 1fr 1fr;
    }
    /* Panels containing tables read better at full width */
    .user-profile-grid > .user-profile-panel:has(.table-wrap) {
        grid-column: 1 / -1;
    }
}
.user-profile-panel {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.user-profile-panel:hover {
    border-color: rgba(15, 108, 191, 0.28);
    box-shadow: var(--shadow);
}
.user-profile-panel h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 700;
}
.user-profile-panel h3 i {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.55rem;
    background: rgba(15, 108, 191, 0.1);
    color: var(--primary);
    font-size: 0.85rem;
}
.user-profile-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    margin: 0;
}
@media (min-width: 640px) {
    .user-profile-details {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
}
.user-profile-details div {
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 0.6rem;
    background: var(--surface-2, var(--surface-muted));
    border: 1px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.user-profile-details div:hover {
    border-color: var(--border);
}
.user-profile-details dt {
    margin: 0 0 0.2rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.user-profile-details dd {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    word-break: break-word;
}
.user-profile-avatar--large {
    width: 6rem;
    height: 6rem;
    font-size: 2rem;
}
.user-profile-photo-preview {
    margin: 1rem 0 1.25rem;
}
.user-profile-photo-panel h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
}

/* Profile page */
.profile-page { max-width: 960px; }
.profile-hero {
    --profile-accent: var(--primary);
    --profile-accent-dark: var(--primary-dark);
    --profile-accent-soft: var(--primary-light);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    border: 1px solid #d4e4f4;
    box-shadow: var(--shadow);
    background: #fff;
}
.profile-hero--teacher,
.profile-hero--student,
.profile-hero--admin,
.profile-hero--super {
    --profile-accent: var(--primary);
    --profile-accent-dark: var(--primary-dark);
    --profile-accent-soft: var(--primary-light);
}
.profile-hero__cover {
    height: 7rem;
    background:
        linear-gradient(135deg, rgba(15, 108, 191, 0.07) 0%, rgba(15, 108, 191, 0.02) 42%, transparent 100%),
        linear-gradient(180deg, #f4f8fc 0%, #fafcfe 100%);
    border-bottom: 1px solid rgba(15, 108, 191, 0.08);
}
.profile-hero__content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.35rem 1.35rem;
    margin-top: -2.75rem;
}
.profile-hero__main {
    display: flex;
    align-items: flex-end;
    gap: 1.15rem;
    min-width: 0;
    flex: 1;
}
.profile-hero__avatar-ring {
    flex-shrink: 0;
    padding: 0.25rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-md);
}
.profile-hero__avatar {
    width: 5.5rem !important;
    height: 5.5rem !important;
    font-size: 1.75rem !important;
    font-weight: 800 !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--profile-accent), var(--profile-accent-dark)) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.profile-hero__avatar.user-avatar--image {
    background: var(--surface) !important;
    overflow: hidden;
}
.profile-hero__text { min-width: 0; padding-top: 3rem; }
.profile-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}
.profile-role-badge,
.profile-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.profile-role-badge { background: var(--profile-accent-soft); color: var(--profile-accent-dark); }
.profile-status-badge--active { background: #eaf7ef; color: #0f5132; }
.profile-status-badge--inactive { background: #f8d7da; color: #721c24; }
.profile-hero__name {
    margin: 0 0 0.2rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.profile-hero__email {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--ink-2);
    text-decoration: none !important;
    margin-bottom: 0.45rem;
}
.profile-hero__email:hover { color: var(--profile-accent); text-decoration: underline !important; }
.profile-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.profile-hero__meta i { margin-right: 0.25rem; color: var(--profile-accent); }
.profile-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-self: flex-end;
    padding-bottom: 0.15rem;
}
.profile-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 900px) {
    .profile-layout { grid-template-columns: minmax(260px, 320px) 1fr; }
}
.profile-layout__aside { min-width: 0; }
.profile-layout__main { padding: 1.15rem 1.25rem 1.35rem; }
.profile-section-head { margin-bottom: 1rem; }
.profile-section-head h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 800;
}
.profile-section-head h2 i { color: var(--primary); }
.profile-section-head p { margin: 0; font-size: 0.875rem; }
.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}
@media (min-width: 640px) {
    .profile-details-grid { grid-template-columns: 1fr 1fr; }
}
.profile-detail-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
}
.profile-detail-card__icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.85rem;
}
.profile-detail-card__body { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.profile-detail-card__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.profile-detail-card__value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}
a.profile-detail-card__value:hover { color: var(--primary); }
.profile-photo-card { padding: 1.15rem 1.25rem; }
.profile-photo-drawer { margin-bottom: 1rem; }
.profile-photo-drawer[hidden] { display: none !important; }
.profile-photo-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.profile-photo-drawer__head h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}
.profile-photo-drawer__head h3 i { color: var(--primary); }
.profile-photo-drawer__close {
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profile-photo-drawer__close:hover { background: var(--border); color: var(--text); }
.profile-photo-drawer__desc { margin: 0 0 1rem; font-size: 0.8125rem; }
.profile-photo-drawer__body { padding-top: 0; }
.profile-photo-card__head h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
}
.profile-photo-card__head h3 i { color: var(--primary); }
.profile-photo-card__head p { margin: 0 0 1rem; font-size: 0.8125rem; }
.profile-photo-card__preview { text-align: center; margin-bottom: 1rem; }
.profile-photo-card__avatar {
    width: 5rem !important;
    height: 5rem !important;
    font-size: 1.5rem !important;
    margin: 0 auto;
}
.profile-photo-upload { display: block; cursor: pointer; }
.profile-photo-upload input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}
.profile-photo-upload__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1.15rem 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.profile-photo-upload:hover .profile-photo-upload__box,
.profile-photo-upload:focus-within .profile-photo-upload__box {
    border-color: var(--primary);
    background: var(--primary-light);
}
.profile-photo-upload__box i { font-size: 1.35rem; color: var(--primary); margin-bottom: 0.15rem; }
.profile-photo-upload__box strong { font-size: 0.875rem; color: var(--text); }
.profile-photo-upload__box span { font-size: 0.75rem; color: var(--text-muted); }
.profile-photo-note {
    margin: 0.65rem 0 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
}
.profile-photo-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}
.profile-section-head--compact { margin-top: 1.35rem; padding-top: 1.25rem; border-top: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.profile-section-head--compact h3 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 800;
}
.profile-section-head--compact h3 i { color: var(--primary); }
.profile-teaching-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    white-space: nowrap;
}
.profile-teaching-section { margin-top: 0.25rem; }
.profile-teaching-empty {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}
.profile-teaching-empty i { color: var(--primary); margin-top: 0.15rem; }
.profile-teaching-empty p { margin: 0; }
.profile-subject-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 720px) {
    .profile-subject-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.profile-subject-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.profile-subject-card:hover {
    border-color: rgba(15, 108, 191, 0.22);
    box-shadow: var(--shadow);
}
.profile-subject-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.profile-subject-card__icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.6rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.95rem;
}
.profile-subject-card__title { min-width: 0; }
.profile-subject-card__title strong { display: block; font-size: 1rem; font-weight: 800; line-height: 1.2; }
.profile-subject-card__title span {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    line-height: 1.35;
}
.profile-subject-card__classes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}
.profile-subject-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-2);
    text-decoration: none !important;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.profile-subject-chip:hover {
    border-color: rgba(15, 108, 191, 0.28);
    background: var(--primary-light);
    color: var(--primary-dark);
    text-decoration: none !important;
}
.profile-subject-chip i { color: var(--primary); font-size: 0.7rem; }
.profile-subject-chip__year {
    color: var(--text-muted);
    font-weight: 500;
}
.profile-subject-chip__year::before { content: '·'; margin-right: 0.35rem; }
.profile-subject-card__pending {
    margin: 0;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}
@media (max-width: 720px) {
    .profile-hero__content { flex-direction: column; align-items: stretch; }
    .profile-hero__main { flex-direction: column; align-items: center; text-align: center; }
    .profile-hero__text { padding-top: 0; }
    .profile-hero__badges,
    .profile-hero__meta { justify-content: center; }
    .profile-hero__actions { justify-content: center; }
}
.image-upload-preview-note {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
}
[data-preview-cover].is-previewing,
[data-preview-avatar].is-previewing {
    outline: 2px solid rgba(15, 108, 191, 0.45);
    outline-offset: 2px;
}
[data-preview-cover].is-previewing {
    box-shadow: inset 0 0 0 9999px rgba(15, 108, 191, 0.08);
}
.panel h3 { font-size: 1rem; margin-bottom: 0.75rem; font-weight: 700; }

.admin-form-card .panel { margin-bottom: 0; }

/* Compact subject add/edit form */
.admin-form-card--subject .panel {
    padding: 0.85rem 1rem;
}
.admin-form-card--subject .panel h2 {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}
.admin-form-card--subject .panel > .text-muted.mb-1 {
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 0.65rem !important;
}
.admin-form-card--subject .subject-form__basics {
    grid-template-columns: 9rem 1fr;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px dashed var(--border);
}
.admin-form-card--subject .form-group {
    margin-bottom: 0;
}
.admin-form-card--subject .form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.admin-form-card--subject .form-control {
    font-size: 0.8125rem;
    padding: 0.35rem 0.6rem;
}
.admin-form-card--subject .subject-form .actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.admin-form-card--subject .subject-form .actions .btn {
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
}

.admin-form-card--subject .grading-scheme-fieldset--featured {
    position: relative;
    padding: 0;
    margin: 0.85rem 0 0;
    border: 1px solid #b8d4f0;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f0f7ff 0%, #fafcff 48%, #fff 100%);
    box-shadow: 0 2px 8px rgba(15, 108, 191, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}
.admin-form-card--subject .grading-scheme-legend {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    float: left;
    width: auto;
    margin: 0;
    padding: 0.55rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid #d4e4f7;
    border-right: 1px solid #d4e4f7;
    border-radius: 0 0 var(--radius) 0;
}
.admin-form-card--subject .grading-scheme-legend__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.35rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.6875rem;
}
.admin-form-card--subject .grading-scheme-fieldset__banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    clear: both;
    padding: 0.65rem 0.85rem 0.55rem;
    border-bottom: 1px solid #d4e4f7;
    background: rgba(255, 255, 255, 0.55);
}
.admin-form-card--subject .grading-scheme-fieldset__banner-text strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.admin-form-card--subject .grading-scheme-fieldset__banner-text p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #475569;
    max-width: 52ch;
}
.admin-form-card--subject .grading-scheme-total-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 5.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius);
    border: 1px solid #cbd5e1;
    background: #fff;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}
.admin-form-card--subject .grading-scheme-total-badge__label {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.admin-form-card--subject .grading-scheme-total-badge__value {
    font-size: 0.6875rem;
    color: var(--text-muted);
}
.admin-form-card--subject .grading-scheme-total-badge__value strong {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}
.admin-form-card--subject .grading-scheme-total-badge.is-valid {
    border-color: #6ee7b7;
    background: #ecfdf5;
}
.admin-form-card--subject .grading-scheme-total-badge.is-valid .grading-scheme-total-badge__value strong {
    color: #047857;
}
.admin-form-card--subject .grading-scheme-total-badge.is-invalid {
    border-color: #fcd34d;
    background: #fffbeb;
}
.admin-form-card--subject .grading-scheme-total-badge.is-invalid .grading-scheme-total-badge__value strong {
    color: #b45309;
}
.admin-form-card--subject .grading-scheme-total-badge.is-empty .grading-scheme-total-badge__value strong {
    color: #94a3b8;
}

.admin-form-card--subject .grading-scheme-fieldset--featured .grading-scheme-preview--compact {
    padding: 0.55rem 0.85rem 0;
    margin-bottom: 0;
}
.admin-form-card--subject .grading-scheme-fieldset--featured .gb-weight-bar--admin .gb-weight-bar__track {
    height: 0.625rem;
    border: 1px solid #cbd5e1;
    background: #fff;
}
.admin-form-card--subject .grading-scheme-fieldset--featured .grading-scheme-toolbar {
    padding: 0.5rem 0.85rem 0;
    margin-bottom: 0;
}
.admin-form-card--subject .grading-scheme-fieldset--featured .grading-scheme-table-head {
    margin: 0.45rem 0.85rem 0.25rem;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
}
.admin-form-card--subject .grading-scheme-fieldset--featured .grading-scheme-rows {
    padding: 0 0.85rem 0.65rem;
}

/* Apply grading scheme to other subjects */
.admin-form-card--subject .grading-scheme-apply {
    margin: 0 0.85rem 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid #d4e4f7;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.75);
}
.admin-form-card--subject .grading-scheme-apply.is-active {
    border-color: var(--primary);
    background: #f8fbff;
}
.admin-form-card--subject .grading-scheme-apply__head strong {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text);
}
.admin-form-card--subject .grading-scheme-apply__head p {
    margin: 0.35rem 0 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.admin-form-card--subject .scheme-apply-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.admin-form-card--subject .scheme-apply-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.admin-form-card--subject .scheme-apply-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.admin-form-card--subject .scheme-apply-option input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}
.admin-form-card--subject .scheme-apply-option__text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.admin-form-card--subject .scheme-apply-option__text strong {
    font-size: 0.78rem;
    color: var(--text);
}
.admin-form-card--subject .scheme-apply-option__text small {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.admin-form-card--subject .scheme-apply-panel {
    padding-top: 0.25rem;
}
.admin-form-card--subject .scheme-apply-panel.hidden {
    display: none;
}
.admin-form-card--subject .scheme-apply-panel__hint {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.admin-form-card--subject .scheme-apply-checkgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.admin-form-card--subject .scheme-apply-check {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.4rem 0.45rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.78rem;
}
.admin-form-card--subject .scheme-apply-check:hover {
    background: var(--surface-2);
}
.admin-form-card--subject .scheme-apply-check input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.admin-form-card--subject .scheme-apply-check__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
.admin-form-card--subject .scheme-apply-check__prefix {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.admin-form-card--subject .scheme-apply-check__title {
    color: var(--text-muted);
    font-size: 0.72rem;
}
.admin-form-card--subject .subject-code-chip--sm {
    font-size: 0.68rem;
    padding: 0.1rem 0.35rem;
}

.admin-form-card--subject .grading-scheme-fieldset--featured .grading-scheme-toolbar__label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.admin-form-card--subject .grading-scheme-fieldset--featured .grading-scheme-toolbar__label i {
    margin-right: 0.15rem;
}

.admin-form-card--subject .grading-scheme-fieldset {
    padding: 0.6rem 0.75rem;
    margin: 0.5rem 0 0;
    border-radius: var(--radius);
}
.admin-form-card--subject .grading-scheme-fieldset legend {
    font-size: 0.8125rem;
    font-weight: 700;
    padding: 0 0.25rem;
}
.admin-form-card--subject .grading-scheme-help {
    font-size: 0.6875rem;
    margin-bottom: 0.45rem;
    line-height: 1.35;
}
.admin-form-card--subject .grading-scheme-preview--compact {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}
.admin-form-card--subject .grading-scheme-preview--compact .gb-weight-bar {
    flex: 1;
    min-width: 0;
    margin: 0;
}
.admin-form-card--subject .gb-weight-bar--admin .gb-weight-bar__track {
    height: 0.5rem;
}
.admin-form-card--subject .grading-weight-total-line {
    margin: 0;
    font-size: 0.6875rem;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
}
.admin-form-card--subject .grading-weight-total-line strong {
    font-size: 0.8125rem;
}
.admin-form-card--subject .grading-scheme-toolbar {
    margin-bottom: 0.45rem;
    gap: 0.25rem;
}
.admin-form-card--subject .grading-scheme-toolbar__label {
    font-size: 0.6875rem;
    margin-right: 0.1rem;
}
.admin-form-card--subject .gb-chip-btn {
    padding: 0.15rem 0.4rem;
    font-size: 0.6875rem;
    gap: 0.25rem;
}
.admin-form-card--subject .gb-chip-btn i {
    font-size: 0.625rem;
}
.admin-form-card--subject .grading-scheme-table-head {
    grid-template-columns: 7.5rem 1fr 5.5rem 1.75rem;
    gap: 0.35rem;
    padding: 0 0.15rem 0.25rem;
    font-size: 0.5625rem;
}
.admin-form-card--subject .grading-scheme-rows {
    gap: 0.3rem;
}
.admin-form-card--subject .grading-scheme-row {
    grid-template-columns: 7.5rem 1fr 5.5rem 1.75rem;
    gap: 0.35rem;
    padding: 0.3rem 0.4rem;
}
.admin-form-card--subject .grading-scheme-row__icon {
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.625rem;
    border-radius: 0.3rem;
}
.admin-form-card--subject .grading-scheme-row__type select,
.admin-form-card--subject .grading-scheme-row input.form-control {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    min-height: 1.75rem;
}
.admin-form-card--subject .grading-scheme-row__pct {
    font-size: 0.6875rem;
}
.admin-form-card--subject .grading-scheme-row__remove {
    padding: 0.15rem 0.35rem;
    font-size: 0.6875rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
}

@media (max-width: 640px) {
    .admin-form-card--subject .subject-form__basics {
        grid-template-columns: 1fr;
    }
}

/* Programs curriculum builder */
.program-curriculum-app { display: flex; flex-direction: column; gap: 1rem; }

.program-curriculum-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.program-toolbar-meta {
    flex: 1;
    min-width: min(100%, 280px);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.program-toolbar-desc {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.45;
    max-width: 52ch;
}
.program-toolbar-desc--muted { color: var(--text-muted); }
.program-toolbar-stats {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.program-toolbar-stats strong {
    color: var(--text);
    font-weight: 700;
}
.program-toolbar-stats-sep { opacity: 0.5; }
.program-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.program-toolbar-edit-btn { white-space: nowrap; }

.program-mode-toggle {
    display: inline-flex;
    padding: 0.2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 0.15rem;
}
.program-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.program-mode-btn:hover { color: var(--primary); background: var(--surface); }
.program-mode-btn.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Preview vs edit visibility */
.is-preview-mode [data-curriculum-edit] { display: none !important; }
.is-edit-mode [data-curriculum-preview] { display: none !important; }

.is-preview-mode .program-term-preview-body { display: block !important; }
.is-preview-mode .program-term-actions { display: none !important; }
.is-preview-mode .program-level-panel-head form { display: none !important; }
.is-preview-mode .program-level-panel-head .program-rename-form,
.is-preview-mode .program-level-panel-head [data-rename-toggle] { display: none !important; }

/* Preview layout: horizontal level tabs + term grid */
.is-preview-mode .program-curriculum-layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.is-preview-mode .program-curriculum-sidebar {
    position: static;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}
.is-preview-mode .program-curriculum-sidebar-head { display: none; }
.is-preview-mode .program-level-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    scrollbar-width: thin;
}
.is-preview-mode .program-level-nav-item {
    min-width: 7.5rem;
    flex: 1 1 auto;
    align-items: center;
    text-align: center;
    padding: 0.6rem 0.85rem;
    box-shadow: none;
}
.is-preview-mode .program-level-nav-item.is-active {
    box-shadow: none;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.is-preview-mode .program-level-nav-item.is-active .program-level-nav-label,
.is-preview-mode .program-level-nav-item.is-active .program-level-nav-meta {
    color: #fff;
}
.is-preview-mode .program-level-nav-meta { font-size: 0.6875rem; opacity: 0.9; }

.is-preview-mode .program-curriculum-main { min-width: 0; }
.is-preview-mode .program-level-panel {
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
}
.is-preview-mode .program-level-panel-head { display: none; }
.is-preview-mode .program-terms-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1rem;
    padding: 0;
}
.is-preview-mode .program-term-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.is-preview-mode .program-term-card-head {
    border-bottom: 1px solid var(--border);
}
.is-preview-mode .program-term-toggle {
    cursor: default;
    padding: 0.75rem 1rem;
    background: var(--surface-2);
}
.is-preview-mode .program-term-chevron { display: none; }
.is-preview-mode .program-term-preview-body {
    padding: 0;
    border: none;
    background: var(--surface);
}

/* Edit mode layout (matches preview: horizontal levels + term grid) */
.is-edit-mode .program-curriculum-layout {
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.is-edit-mode .program-curriculum-sidebar {
    position: static;
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.is-edit-mode .program-curriculum-sidebar-head { display: none; }
.is-edit-mode .program-level-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    scrollbar-width: thin;
}
.is-edit-mode .program-level-nav-item {
    min-width: 7.5rem;
    flex: 1 1 auto;
    align-items: center;
    text-align: center;
}
.is-edit-mode .program-level-nav-item.is-active {
    box-shadow: none;
    background: var(--primary);
    border-color: var(--primary);
}
.is-edit-mode .program-level-nav-item.is-active .program-level-nav-label,
.is-edit-mode .program-level-nav-item.is-active .program-level-nav-meta { color: #fff; }
.is-edit-mode .program-level-nav-meta { font-size: 0.6875rem; opacity: 0.9; }
.is-edit-mode [data-curriculum-edit] .program-add-trigger {
    width: auto;
    align-self: flex-start;
    border-style: solid;
    background: var(--surface);
}
.is-edit-mode .program-curriculum-main { min-width: 0; }
.is-edit-mode .program-level-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.is-edit-mode .program-level-panel-head {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.is-edit-mode .program-level-edit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.is-edit-mode .program-level-edit-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.is-edit-mode .program-level-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}
.is-edit-mode .program-terms-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
}
.is-edit-mode .program-term-card.is-open {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.program-term-preview-body {
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.program-term-preview-empty {
    margin: 0;
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.program-subject-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.program-subject-table thead {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.program-subject-table th {
    padding: 0.5rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.program-subject-table td {
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.program-subject-table tbody tr:last-child td { border-bottom: none; }
.program-subject-table tbody tr:hover { background: var(--bg); }
.program-subject-table-code {
    font-weight: 800;
    color: var(--primary-dark);
    white-space: nowrap;
    width: 5.5rem;
}

.program-code-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    width: fit-content;
}

.program-curriculum-layout {
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.program-curriculum-sidebar {
    position: sticky;
    top: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
}
.program-curriculum-sidebar-head h3 {
    margin: 0 0 0.15rem;
    font-size: 0.9375rem;
    font-weight: 700;
}
.program-curriculum-sidebar-head p {
    margin: 0 0 0.85rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.program-level-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.program-level-nav-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.program-level-nav-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.program-level-nav-item.is-active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: inset 3px 0 0 var(--primary);
}
.program-level-nav-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
}
.program-level-nav-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.program-add-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    justify-content: center;
    padding: 0.55rem 0.75rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.program-add-trigger:hover { border-color: var(--primary); background: var(--primary-light); }
.program-add-trigger--inline { width: auto; }

.program-add-form {
    margin-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.program-add-form .form-group { margin-bottom: 0; }
.program-add-form--inline {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0;
}
.program-add-form--inline .form-control { min-width: min(100%, 260px); }
.program-add-form--centered {
    max-width: 320px;
    margin: 0 auto;
}

.program-curriculum-main { min-width: 0; }
.program-level-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.program-level-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.program-level-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.program-rename-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
.program-rename-wrap .program-rename-form { display: none; }
.program-rename-wrap.is-editing .program-term-heading { display: none; }
.program-rename-wrap.is-editing > .program-level-title { display: none; }
.program-rename-wrap.is-editing [data-rename-toggle] { display: none; }
.program-rename-form--inline {
    display: none;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.program-rename-wrap.is-editing .program-rename-form--inline {
    display: flex;
}
.program-rename-wrap .program-rename-form:not(.program-rename-form--inline):not(.program-rename-form--dropdown) { display: none; }
.program-rename-wrap.is-editing .program-rename-form {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.program-rename-wrap.is-editing [data-rename-toggle] { display: none; }
.program-rename-form--dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 5;
    min-width: 220px;
    padding: 0.65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.program-rename-wrap--compact { position: relative; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

.program-level-toolbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.program-term-empty {
    padding: 2rem 1.15rem;
    text-align: center;
    color: var(--text-muted);
}
.program-term-empty i { font-size: 1.75rem; opacity: 0.45; margin-bottom: 0.65rem; display: block; }
.program-term-empty p { margin: 0; font-size: 0.875rem; }

.program-terms-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1rem 1.15rem 1.15rem;
}

.program-term-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg);
}
.program-term-card-head {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.program-term-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: none;
    background: var(--surface);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s;
}
.program-term-toggle:hover { background: var(--surface-2); }
.program-term-order {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8125rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.program-term-heading {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.program-term-heading strong { font-size: 0.9375rem; color: var(--text); }
.program-term-heading small { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.program-term-chevron {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.program-term-card.is-open .program-term-chevron { transform: rotate(180deg); }
.program-term-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.5rem;
    border-left: 1px solid var(--border);
    background: var(--surface);
}
.program-term-body {
    display: none;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.program-term-card.is-open .program-term-body { display: block; }

.program-subject-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}
.program-subject-search-wrap {
    position: relative;
    flex: 1;
    min-width: min(100%, 200px);
    max-width: 360px;
}
.program-subject-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8125rem;
    pointer-events: none;
}
.program-subject-search-wrap .form-control {
    padding-left: 2.1rem;
    font-size: 0.875rem;
}
.program-subject-filter {
    display: inline-flex;
    padding: 0.15rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    gap: 0.1rem;
}
.program-subject-filter-btn {
    padding: 0.35rem 0.65rem;
    border: none;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.program-subject-filter-btn:hover { color: var(--primary); }
.program-subject-filter-btn.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.program-subject-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.65rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.program-subject-summary-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.program-subject-summary-count strong {
    color: var(--primary-dark);
    font-weight: 800;
}
.program-subject-toolbar-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.program-subject-catalog {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
    background: var(--surface);
}
.program-subject-catalog-head {
    display: grid;
    grid-template-columns: 2.25rem 5.5rem 1fr;
    gap: 0.65rem;
    padding: 0.5rem 0.85rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}
.program-subject-catalog-col {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.program-subject-row {
    display: grid;
    grid-template-columns: 2.25rem 5.5rem 1fr auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}
.program-subject-row:last-child { border-bottom: none; }
.program-subject-row:hover { background: var(--bg); }
.program-subject-row.is-selected {
    background: var(--primary-light);
}
.program-subject-row.is-selected:hover { background: #dce9fc; }
.program-subject-row.is-hidden { display: none; }
.program-subject-row-check {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.program-subject-row-code {
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--primary-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.program-subject-row-title {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.35;
    min-width: 0;
}
.program-subject-row-icon {
    width: 1.25rem;
    color: var(--primary);
    opacity: 0;
    font-size: 0.8125rem;
    transition: opacity 0.12s;
}
.program-subject-row.is-selected .program-subject-row-icon { opacity: 1; }

.program-subject-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.85rem;
    margin-top: 0.85rem;
    border-top: 1px solid var(--border);
}

/* Legacy pill picker removed — catalog rows used instead */

.program-curriculum-empty .admin-empty-state { margin-bottom: 1rem; }
.program-curriculum-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.program-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .program-curriculum-layout { grid-template-columns: 1fr; }
    .program-curriculum-sidebar { position: static; }
    .program-toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }
    .program-mode-toggle { flex: 1; }
    .program-mode-btn { flex: 1; justify-content: center; }
    .program-toolbar-edit-btn { flex-shrink: 0; }
    .is-preview-mode .program-terms-list,
    .is-edit-mode .program-terms-list { grid-template-columns: 1fr; }
    .program-subject-catalog-head { display: none; }
    .program-subject-row {
        grid-template-columns: 2rem 4.5rem 1fr auto;
        gap: 0.5rem;
        padding: 0.55rem 0.65rem;
    }
    .program-subject-filter { width: 100%; justify-content: stretch; }
    .program-subject-filter-btn { flex: 1; text-align: center; }
    .program-level-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        scrollbar-width: thin;
    }
    .program-level-nav-item {
        min-width: 140px;
        flex-shrink: 0;
    }
}

/* Legacy aliases (class-groups) */
.program-curriculum { display: flex; flex-direction: column; gap: 1rem; }
.program-inline-form {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.program-inline-form .form-group { margin-bottom: 0; min-width: min(100%, 220px); }

/* ===== Global UX (loader, confirm, inputs) ===== */
.page-loader {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(240, 242, 245, 0.85);
    backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.page-loader.is-active { opacity: 1; visibility: visible; }
.page-loader-inner {
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
}
.page-loader-inner .site-logo--loader {
    animation: loaderPulse 1.2s ease-in-out infinite;
}
.page-loader-text { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
@keyframes loaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
}

.confirm-overlay {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    padding: 1rem;
}
.confirm-overlay[hidden] { display: none; }
.confirm-dialog {
    background: var(--surface); border-radius: var(--radius-lg);
    padding: 1.5rem; width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.confirm-dialog-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.confirm-dialog-message { color: var(--ink-2); margin-bottom: 1.25rem; font-size: 0.9375rem; }
.confirm-dialog-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

.alert-icon {
    display: flex; align-items: flex-start; gap: 0.65rem;
}
.alert-icon > i { flex-shrink: 0; margin-top: 0.1rem; }
.alert-success.alert-icon > i { color: var(--success); }
.alert-error.alert-icon > i { color: var(--danger); }
.alert-info.alert-icon > i { color: var(--info); }
.alert-warning.alert-icon > i { color: var(--warning); }

.input-wrap { position: relative; }
.input-wrap .form-control { padding-left: 2.5rem; }
.input-wrap-icon {
    position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; font-size: 0.875rem;
}
.input-hint { display: block; margin-top: 0.35rem; font-size: 0.8125rem; color: var(--text-muted); }

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 0.75rem; margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }

/* ===== Dashboard welcome ===== */
.dashboard-welcome {
    display: flex; align-items: center; gap: 1rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface) 100%);
    border: 1px solid rgba(15, 108, 191, 0.12);
    border-radius: var(--radius-lg); padding: 1.25rem 1.35rem;
    margin-bottom: 1.5rem;
}
.dashboard-welcome-avatar {
    width: 3rem; height: 3rem; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; font-size: 1.125rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dashboard-welcome-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.15rem; }
.dashboard-welcome-sub { color: var(--text-muted); font-size: 0.875rem; margin: 0; }

/* ===== Student dashboard widgets ===== */
.stu-alert {
    display: flex; align-items: flex-start; gap: 0.85rem;
    padding: 1rem 1.15rem; border-radius: var(--radius-lg);
    margin-bottom: 1.25rem; border: 1px solid;
}
.stu-alert > i { flex-shrink: 0; margin-top: 0.15rem; font-size: 1.125rem; }
.stu-alert strong { display: block; margin-bottom: 0.2rem; }
.stu-alert p { margin: 0; font-size: 0.875rem; color: var(--ink-2); }
.stu-alert--warning { background: #fff8e6; border-color: #f0d78c; color: #856404; }
.stu-alert--info { background: #e8f4f8; border-color: #b8dce8; color: #0c5460; }
.stu-alert--action { background: var(--primary-light); border-color: rgba(15, 108, 191, 0.2); }
.stu-alert-actions { display: flex; gap: 0.5rem; flex-shrink: 0; align-items: center; }

.tasks-panel { margin-bottom: 1.5rem; }
.tasks-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem;
}
.tasks-panel-header h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }
.tasks-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tasks-controls .form-control { max-width: 200px; font-size: 0.875rem; padding: 0.4rem 0.65rem; }
.tasks-list { display: flex; flex-direction: column; gap: 0.5rem; }
.task-item {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.85rem 1rem; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.task-item-icon {
    width: 2.25rem; height: 2.25rem; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.task-item-icon--assignment { background: #fff4e6; color: var(--warning); }
.task-item-icon--quiz { background: #e8f4f8; color: var(--info); }
.task-item-body { flex: 1; min-width: 0; }
.task-item-body strong { display: block; font-size: 0.9375rem; }
.task-item-body small { color: var(--text-muted); font-size: 0.8125rem; }
.task-item-due { font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; }
a.task-item { text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
a.task-item:hover { border-color: var(--primary); background: var(--primary-light); }

.stat-card-term { font-size: 0.6875rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ===== Landing enhancements ===== */
.landing-features-section {
    padding: 3rem 0 3.5rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    position: relative;
}
.landing-features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(90%, 640px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15, 108, 191, 0.25), transparent);
}
.landing-features-head {
    margin-bottom: 1.75rem;
    text-align: center;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.landing-features-sub {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-top: 0.5rem;
    line-height: 1.55;
}
.landing-features-head h2 {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text);
}
.landing-features-head h2 i { color: var(--primary); }
.features--landing {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0;
}
@media (min-width: 640px) {
    .features--landing { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
}
@media (min-width: 1100px) {
    .features--landing { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
}
.landing-features-section .feature-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem;
    border-radius: 0.85rem;
    position: relative;
}
.feature-card-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}
.landing-features-section .feature-card h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}
.landing-features-section .feature-card p {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin: 0;
}
.landing-features-section .feature-card-icon i {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: inherit;
}

.school-carousel-wrap {
    position: relative;
    overflow: hidden;
}
.school-carousel-nav {
    display: none;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    z-index: 2;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.school-carousel-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(15, 108, 191, 0.15);
}
@media (min-width: 768px) {
    .school-carousel-wrap {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    .school-carousel-nav {
        display: flex;
        position: static;
        transform: none;
    }
    .school-carousel-nav:hover {
        transform: scale(1.06);
    }
    .school-grid.school-carousel {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: stretch;
        gap: 1.25rem;
        overflow-x: auto;
        overflow-y: visible;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        padding-bottom: 0.5rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    @media (hover: none) and (pointer: coarse) {
        .school-grid.school-carousel {
            touch-action: pan-x pan-y;
        }
    }
    .school-grid.school-carousel::-webkit-scrollbar { display: none; }
    .school-grid.school-carousel .school-card-wrap {
        flex: 0 0 min(320px, 85vw);
        scroll-snap-align: start;
    }
    .school-grid.school-carousel .school-card-modern {
        height: 100%;
    }
}
.school-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.school-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.25s, box-shadow 0.25s;
    min-width: 0;
    white-space: nowrap;
}
.school-card-btn i {
    font-size: 0.7rem;
    flex-shrink: 0;
}
.school-card-btn--page {
    background: var(--primary);
    color: #fff !important;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 12px rgba(15, 108, 191, 0.2);
}
.school-card-btn--page:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 108, 191, 0.3);
}
.school-card-btn--login {
    background: var(--surface);
    color: var(--primary) !important;
    border: 1px solid rgba(15, 108, 191, 0.28);
}
.school-card-btn--login:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark) !important;
    transform: translateY(-1px);
}

/* Public school page */
.school-public-page { background: #eef4fb; }
.school-public-main { max-width: none; padding: 0; }
.school-public-hero {
    position: relative;
    padding: 2rem 0 4rem;
    overflow: hidden;
}
.school-public-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(15, 108, 191, 0.08) 0%, transparent 42%),
        radial-gradient(circle at 88% 75%, rgba(8, 121, 156, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #eef4fb 0%, #f4f7fb 100%);
    pointer-events: none;
}
.school-public-hero .container {
    position: relative;
    z-index: 1;
}
.school-public-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(15, 108, 191, 0.1);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.school-public-back:hover {
    color: var(--primary);
    border-color: rgba(15, 108, 191, 0.22);
    background: #fff;
    text-decoration: none;
}
.school-public-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}
.school-public-cover {
    position: relative;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--primary);
}
.school-public-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.55) 100%);
}
.school-public-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.school-public-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 0 2rem;
    margin-top: -3.75rem;
    position: relative;
    z-index: 3;
}
.school-public-avatar {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 50%;
    border: 5px solid var(--surface);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 12px 32px rgba(15, 108, 191, 0.3);
}
.school-public-avatar.school-avatar--image {
    padding: 0;
    overflow: hidden;
    background: var(--surface);
}
.school-public-avatar .school-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.school-public-heading {
    min-width: 0;
    padding-top: 4.25rem;
    padding-bottom: 0.5rem;
}
.school-public-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
}
.school-public-heading h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.school-public-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.school-public-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}
.school-public-meta-chip i {
    color: var(--primary);
    flex-shrink: 0;
    font-size: 0.75rem;
}
.school-public-meta-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.school-public-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid var(--border);
}
@media (min-width: 900px) {
    .school-public-layout {
        grid-template-columns: 1fr min(340px, 38%);
    }
}
.school-public-content {
    padding: 2rem;
}
.school-public-content h2 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.school-public-intro {
    margin: 0 0 1.75rem;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 36rem;
}
.school-public-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.school-public-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.school-public-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.95rem;
    line-height: 1;
}
.school-public-feature-icon i {
    display: block;
    line-height: 1;
}
.school-public-features li strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.school-public-features li > div > span {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.school-public-signin {
    background: linear-gradient(165deg, rgba(15, 108, 191, 0.06) 0%, rgba(8, 121, 156, 0.04) 100%);
    border-top: 1px solid var(--border);
    padding: 2rem;
}
@media (min-width: 900px) {
    .school-public-signin {
        border-top: none;
        border-left: 1px solid var(--border);
    }
}
.school-public-signin-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    max-width: 280px;
    margin: 0 auto;
}
.school-public-signin-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(15, 108, 191, 0.25);
}
.school-public-signin h3 {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 800;
}
.school-public-signin p {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.school-public-code-box {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px dashed rgba(15, 108, 191, 0.25);
}
.school-public-code-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.school-public-code-box code {
    display: block;
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 0.04em;
    word-break: break-all;
}
.school-public-signin-btn {
    margin-bottom: 0.85rem;
}
.school-public-alt-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.school-public-alt-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
@media (max-width: 640px) {
    .school-public-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 1.25rem;
    }
    .school-public-heading {
        padding-top: 0.75rem;
    }
    .school-public-meta-row {
        justify-content: center;
    }
    .school-public-content,
    .school-public-signin {
        padding: 1.5rem 1.25rem;
    }
}

.school-settings-preview { margin: 1.25rem 0 1.5rem; max-width: 320px; }
.school-settings-preview--logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.school-settings-preview--logo .school-avatar {
    margin-left: 0;
}
.school-settings-preview-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: -1rem;
}
.school-settings-preview-header .school-avatar {
    margin-left: 0;
    flex-shrink: 0;
}
.school-settings-preview-card {
    border: 1px solid var(--border);
    border-radius: 1.125rem;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.school-settings-preview-body {
    padding: 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.school-settings-form { max-width: 28rem; }
.school-settings-remove { margin-top: 1rem; }

/* Landing page animations */
[data-landing-delay="1"] { --landing-delay: 1; }
[data-landing-delay="2"] { --landing-delay: 2; }
[data-landing-delay="3"] { --landing-delay: 3; }
[data-landing-delay="4"] { --landing-delay: 4; }
[data-landing-delay="5"] { --landing-delay: 5; }
[data-landing-delay="6"] { --landing-delay: 6; }
@media (prefers-reduced-motion: no-preference) {
    [data-landing-hero] {
        opacity: 0;
        transform: translateY(20px);
        animation: landingHeroIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        animation-delay: calc(0.08s * var(--landing-delay, 1));
    }
    @keyframes landingHeroIn {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    [data-landing-reveal] {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
        transition-delay: calc(0.07s * var(--landing-delay, 0));
    }
    [data-landing-reveal].is-visible {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (prefers-reduced-motion: reduce) {
    [data-landing-hero],
    [data-landing-reveal] {
        opacity: 1;
        transform: none;
        animation: none;
        transition: none;
    }
    .landing-hero-orb,
    .text-gradient--animated,
    .landing-badge i {
        animation: none;
    }
    .landing-page .public-header {
        transition: none;
    }
}
.landing-page .public-header {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(16px) saturate(1.08);
    -webkit-backdrop-filter: blur(16px) saturate(1.08);
    border-bottom-color: rgba(226, 230, 234, 0.55);
    transition: box-shadow 0.3s, background 0.3s, border-color 0.3s;
}
.landing-page.is-scrolled .public-header {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: var(--border);
}
.landing-page .public-footer {
    position: relative;
    overflow: hidden;
}
.landing-page .public-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #08799c, var(--primary));
    background-size: 200% auto;
    animation: landingGradientShift 8s ease-in-out infinite;
}
.landing-page .footer-links a {
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}
.landing-page .footer-links a:hover {
    transform: translateY(-1px);
}

/* ===== Split auth login ===== */
.auth-card-split {
    display: grid; width: 100%; max-width: 820px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-lg);
}
@media (min-width: 768px) {
    .auth-card-split { grid-template-columns: 1fr 1.1fr; }
}
.auth-split-panel {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 2.5rem 2rem;
    color: #fff;
    flex-direction: column;
    justify-content: center;
    min-height: 22rem;
}
.auth-split-panel--platform {
    background: linear-gradient(155deg, #0f6cbf 0%, #0a4d8c 52%, #063a6b 100%);
}
.auth-split-panel--school {
    background: linear-gradient(155deg, #0f6cbf 0%, #0a4d8c 100%);
}
.auth-split-panel-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.auth-split-panel--school .auth-split-panel-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--auth-panel-cover);
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
    filter: saturate(1.08);
}
.auth-split-panel--school .auth-split-panel-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 36, 72, 0.55) 0%, rgba(6, 36, 72, 0.82) 55%, rgba(4, 24, 52, 0.94) 100%),
        linear-gradient(135deg, rgba(15, 108, 191, 0.35) 0%, transparent 60%);
}
.auth-split-panel--platform .auth-split-panel-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.14) 0%, transparent 42%),
        radial-gradient(circle at 85% 80%, rgba(8, 121, 156, 0.35) 0%, transparent 45%);
}
.auth-split-panel-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.45;
}
.auth-split-panel-orb--1 {
    width: 9rem;
    height: 9rem;
    top: -2rem;
    right: -1.5rem;
    background: rgba(255, 255, 255, 0.22);
}
.auth-split-panel-orb--2 {
    width: 7rem;
    height: 7rem;
    bottom: 2rem;
    left: -2rem;
    background: rgba(8, 121, 156, 0.55);
}
.auth-split-panel-orb--3 {
    width: 5rem;
    height: 5rem;
    bottom: -1rem;
    right: 2.5rem;
    background: rgba(255, 255, 255, 0.12);
}
.auth-split-panel-content {
    position: relative;
    z-index: 1;
}
@media (min-width: 768px) {
    .auth-split-panel { display: flex; }
}
.auth-split-panel h2 {
    font-size: 1.625rem;
    font-weight: 800;
    margin: 0 0 0.65rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-wrap: balance;
}
.auth-panel-eyebrow {
    display: inline-block;
    margin-bottom: 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.72);
}
.auth-panel-code {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    backdrop-filter: blur(6px);
}
.auth-panel-code i { font-size: 0.6875rem; opacity: 0.85; }
.auth-panel-tagline {
    font-size: 0.9375rem;
    line-height: 1.55;
    margin: 0 0 1.35rem;
    color: rgba(255, 255, 255, 0.88);
    max-width: 18rem;
}
.auth-panel-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.auth-panel-features li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}
.auth-panel-features li i {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.75rem;
}
.auth-split-form { padding: 1.75rem 1.85rem; }

/* ===== Topbar enhancements ===== */
.navbar-notifications { position: relative; margin-right: 0.5rem; }
.navbar-notif-btn {
    position: relative;
    width: 2.25rem; height: 2.25rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.navbar-notif-btn:hover { border-color: var(--primary); color: var(--primary); }
.notif-dropdown {
    position: absolute; top: calc(100% + 0.5rem); right: 0;
    width: 280px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); display: none; z-index: 1100;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
    padding: 0.75rem 1rem; font-weight: 700; font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}
.notif-empty { padding: 1.5rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.navbar-notif-badge {
    position: absolute; top: -2px; right: -2px; min-width: 1.1rem; height: 1.1rem;
    padding: 0 0.25rem; border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 0.65rem; font-weight: 700; line-height: 1.1rem; text-align: center;
}
.notif-dropdown-header {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.notif-mark-all {
    border: none; background: none; color: var(--primary); font-size: 0.75rem;
    font-weight: 600; cursor: pointer; padding: 0;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-dropdown-body { max-height: 320px; overflow-y: auto; }
.notif-item {
    display: block; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
    text-decoration: none !important; color: inherit;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item--unread { background: #f0f7ff; }
.notif-item strong { display: block; font-size: 0.875rem; margin-bottom: 0.2rem; }
.notif-item p { margin: 0; font-size: 0.8125rem; color: var(--text-muted); line-height: 1.4; }
.notif-item time { font-size: 0.75rem; color: var(--text-muted); }
.notif-item-priority {
    display: inline-block; margin-left: 0.35rem; font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; vertical-align: middle;
}
.notif-item-priority--important { color: #d97706; }
.notif-item-priority--urgent { color: #dc2626; }
.notif-view-all {
    display: block; padding: 0.65rem 1rem; text-align: center; font-size: 0.8125rem;
    font-weight: 600; border-top: 1px solid var(--border); text-decoration: none !important;
}

.announcements-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1rem; flex-wrap: wrap;
}
.announcements-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.announcements-list-meta { font-size: 0.8rem; margin-top: 0.15rem; }
.form-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem;
}
.form-grid .span-2 { grid-column: span 2; }
.announcement-form-grid { margin-bottom: 1.5rem; }
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
}
.announcement-audience {
    margin: 1.5rem 0; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.announcement-audience__head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    margin-bottom: 1rem;
}
.announcement-audience__head h2 { margin: 0 0 0.25rem; font-size: 1rem; }
.audience-rule {
    display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.75rem; align-items: end;
    margin-bottom: 0.75rem; padding: 0.85rem; background: var(--surface-2); border-radius: var(--radius);
    border: 1px solid var(--border);
}
.audience-rule label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.35rem; }
.audience-user-results {
    position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin-top: 0.25rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-md); max-height: 180px; overflow-y: auto;
}
.audience-user-picker { position: relative; }
.audience-user-option {
    display: block; width: 100%; text-align: left; border: none; background: none;
    padding: 0.55rem 0.75rem; cursor: pointer; font-size: 0.8125rem;
}
.audience-user-option:hover { background: var(--surface-2); }
.announcement-recipient-estimate {
    margin-top: 0.75rem; font-size: 0.875rem; color: var(--ink-2);
}
.announcement-form-actions {
    display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap;
    padding-top: 1rem; border-top: 1px solid var(--border);
}
.announcement-priority {
    display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    padding: 0.15rem 0.45rem; border-radius: 999px;
}
.announcement-priority--important { background: #fef3c7; color: #b45309; }
.announcement-priority--urgent { background: #fee2e2; color: #b91c1c; }
.status-chip {
    display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem;
    border-radius: 999px; background: var(--surface-2);
}
.status-chip--published { background: #dcfce7; color: #166534; }
.status-chip--draft { background: #e5e7eb; color: #374151; }
.status-chip--archived { background: #f3f4f6; color: #6b7280; }
.inline-form { display: inline; }
.table-actions { white-space: nowrap; }
.table-actions .btn { margin-left: 0.25rem; }
.notifications-list { display: flex; flex-direction: column; gap: 0.75rem; }
.notification-item { display: block; text-decoration: none !important; color: inherit; }
.notification-item--unread { border-left: 3px solid var(--primary); }
.notification-item__head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.notification-item__preview { margin: 0 0 0.35rem; color: var(--text-muted); font-size: 0.9rem; }
.notification-detail__body { line-height: 1.6; margin: 1rem 0; }
.notifications-page-toolbar { margin-bottom: 1rem; text-align: right; }
@media (max-width: 768px) {
    .audience-rule { grid-template-columns: 1fr; }
}
.user-dropdown .role-badge {
    display: inline-block; margin-top: 0.35rem;
    padding: 0.15rem 0.5rem; background: var(--primary-light);
    color: var(--primary-dark); border-radius: 999px;
    font-size: 0.6875rem; font-weight: 700;
}
.navbar-term-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.3rem 0.7rem;
    background: var(--primary-light);
    border: 1px solid rgba(15, 108, 191, 0.15);
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
}
.navbar-term-chip i { font-size: 0.625rem; opacity: 0.85; }

/* ===== Course accordions & activity modal ===== */
.course-section { margin-bottom: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.course-section-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 0.85rem 1rem; background: var(--surface-2);
    border: none; cursor: pointer; font-family: inherit;
    font-size: 0.9375rem; font-weight: 700; color: var(--text);
    text-align: left;
}
.course-section-header i.section-icon { margin-right: 0.5rem; color: var(--primary); }
.course-section-header .section-count {
    font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
    margin-left: auto; margin-right: 0.5rem;
}
.course-section-header .section-chevron { color: var(--text-muted); transition: transform 0.2s; }
.course-section.is-open .section-chevron { transform: rotate(180deg); }
.course-section-body { display: none; padding: 0.75rem; }
.course-section.is-open .course-section-body { display: block; }
.course-section-body .activity-list { gap: 0.65rem; }

.activity-modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, 0.45); padding: 1rem;
}
.activity-modal-overlay[hidden] { display: none; }
.activity-modal {
    background: var(--surface); border-radius: var(--radius-lg);
    padding: 1.5rem; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.activity-modal h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.35rem; }
.activity-modal p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }
.activity-modal-options { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-modal-option {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.85rem 1rem; border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none !important;
    color: var(--text); transition: border-color 0.15s, background 0.15s;
}
.activity-modal-option:hover { border-color: var(--primary); background: var(--primary-light); }
.activity-modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; font-size: 1.25rem;
    color: var(--text-muted); cursor: pointer;
}
.activity-modal { position: relative; }

@media (max-width: 768px) {
    .moodle-main { padding: 1rem; }
    .admin-page-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.1rem;
    }
    .admin-page-header__main { align-items: flex-start; }
    .admin-page-header__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .admin-page-header__actions .btn { width: 100%; justify-content: center; }
    .form-row { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.75rem; }
    .landing-hero { padding: 3rem 0 3.25rem; }
    .landing-hero-actions { flex-direction: column; }
    .landing-hero-actions .btn { width: 100%; }
    .schools-section { padding: 2.25rem 0 2.75rem; }
    .schools-section-header { flex-direction: column; align-items: stretch; }
    .schools-section-header .schools-search-wrap { max-width: none; }
    .public-nav .nav-link:first-child { display: none; }
    .dashboard-welcome { flex-direction: column; text-align: center; }
    .stu-alert { flex-direction: column; }
    .stu-alert-actions { width: 100%; }
    .auth-card-split { max-width: 400px; }
}

/* ===== Materials module ===== */
.material-editor-wrap { max-width: 900px; margin: 0 auto; }
.material-editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.material-quill-editor { min-height: 280px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.material-quill-editor .ql-editor { min-height: 240px; }
.material-view-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.material-view-header { margin-bottom: 1.25rem; }
.material-view-type { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.35rem; }
.material-doc-body { line-height: 1.65; }
.material-doc-body h1, .material-doc-body h2, .material-doc-body h3 { margin: 1rem 0 0.5rem; }
.material-video-embed { position: relative; padding-bottom: 56.25%; height: 0; margin-bottom: 1rem; border-radius: var(--radius); overflow: hidden; }
.material-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.material-file-preview { margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.material-file-preview img, .material-file-preview video { display: block; max-width: 100%; margin: 0 auto; }
.material-file-preview--pdf iframe { width: 100%; min-height: 480px; border: 0; }

/* ===== Quiz module ===== */
.quiz-cover-preview { display: block; max-width: 200px; margin-top: 0.5rem; border-radius: var(--radius); }
.quiz-take-cover { height: 140px; background-size: cover; background-position: center; border-radius: var(--radius-lg); margin-bottom: 1rem; }
.quiz-question-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.quiz-attempt-type-meta { margin: -0.35rem 0 0.75rem; }

/* Quiz attempt review (teacher) */
.quiz-attempt-review { max-width: 920px; }
.quiz-attempt-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}
.quiz-attempt-hero__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.quiz-attempt-hero__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.quiz-attempt-hero__student { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.quiz-attempt-hero__avatar {
    width: 3.25rem; height: 3.25rem; border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), #0a4d8c);
    color: #fff; font-weight: 800; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.quiz-attempt-hero__quiz {
    margin: 0 0 0.15rem; font-size: 0.8125rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
}
.quiz-attempt-hero__name { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.quiz-attempt-hero__meta { margin: 0.25rem 0 0; font-size: 0.875rem; }
.quiz-attempt-hero__score { text-align: center; flex-shrink: 0; }
.quiz-attempt-hero__score-label { display: block; margin-top: 0.35rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.quiz-attempt-score-ring {
    --score-pct: 0;
    width: 5.5rem; height: 5.5rem; border-radius: 999px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: conic-gradient(var(--primary) calc(var(--score-pct) * 1%), #e8eef4 0);
    position: relative;
}
.quiz-attempt-score-ring::before {
    content: '';
    position: absolute; inset: 0.45rem; border-radius: 999px; background: var(--surface);
}
.quiz-attempt-score-ring__value,
.quiz-attempt-score-ring__max {
    position: relative; z-index: 1; line-height: 1.1;
}
.quiz-attempt-score-ring__value { font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.quiz-attempt-score-ring__max { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }

.quiz-review-questions { display: flex; flex-direction: column; gap: 0.4rem; }
.quiz-review-questions__toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    margin-bottom: 0.35rem; flex-wrap: wrap;
}
.quiz-review-questions__count { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.quiz-review-questions__actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.quiz-review-question {
    background: var(--surface);
    border: 1px solid #c8d8ea;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 40, 80, 0.05);
}
.quiz-review-question[open] {
    box-shadow: 0 2px 8px rgba(15, 108, 191, 0.12);
    border-color: rgba(15, 108, 191, 0.45);
}
.quiz-review-question__summary {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(180deg, #ffffff 0%, #f3f8fd 100%);
    border-left: 3px solid var(--primary);
    color: var(--ink);
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.quiz-review-question__summary::-webkit-details-marker { display: none; }
.quiz-review-question__summary:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e8f2fb 100%);
}
.quiz-review-question[open] > .quiz-review-question__summary {
    background: #e8f2fb;
    border-left-color: #0a4d8c;
}
.quiz-review-question__chevron {
    color: var(--primary); font-size: 0.72rem; width: 0.85rem;
    transition: transform 0.15s ease, color 0.15s ease;
}
.quiz-review-question[open] > .quiz-review-question__summary .quiz-review-question__chevron { transform: rotate(90deg); color: #0a4d8c; }
.quiz-review-question__num {
    flex-shrink: 0; min-width: 1.85rem; height: 1.55rem; padding: 0 0.35rem; border-radius: 0.35rem;
    background: var(--primary); color: #fff; font-size: 0.6875rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.quiz-review-question__title {
    margin: 0; font-size: 0.875rem; font-weight: 700; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
    color: #1a2b3c;
}
.quiz-review-question__type {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.15rem 0.45rem; border-radius: 999px;
    font-size: 0.6875rem; font-weight: 700; white-space: nowrap;
    background: rgba(15, 108, 191, 0.12); color: #0c5a9e;
}
.quiz-review-score {
    flex-shrink: 0; padding: 0.22rem 0.6rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 800; white-space: nowrap;
    border: 1px solid transparent;
}
.quiz-review-score--full { background: #ccebd4; color: #0f5132; border-color: #9fd4ae; }
.quiz-review-score--partial { background: #ffe8a3; color: #7a5200; border-color: #f0c84d; }
.quiz-review-score--zero { background: #f8c2c8; color: #842029; border-color: #ea868f; }
.quiz-review-score--pending { background: #dde2e8; color: #343a40; border-color: #c4cbd4; }
.quiz-review-score__sep, .quiz-review-score__unit { font-weight: 600; opacity: 0.85; }
.quiz-review-score__unit { margin-left: 0.05rem; font-size: 0.6875rem; }
.quiz-review-question__body { padding: 0.65rem 0.75rem 0.75rem; border-top: 1px solid var(--border); font-size: 0.875rem; }

.quiz-review-answer {
    padding: 0.55rem 0.7rem; border-radius: var(--radius);
    background: var(--bg); border: 1px solid var(--border); line-height: 1.45;
}
.quiz-review-answer--essay { white-space: pre-wrap; }
.quiz-review-file-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 0.9rem; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--border); text-decoration: none; font-weight: 600;
}
.quiz-review-file-link:hover { border-color: var(--primary); color: var(--primary); }

.quiz-review-matching { display: flex; flex-direction: column; gap: 0.35rem; }
.quiz-review-matching-pair {
    display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 0.35rem 0.55rem; align-items: center;
    padding: 0.4rem 0.55rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg);
    font-size: 0.8125rem;
}
.quiz-review-matching-pair--correct { border-color: #b8dfc4; background: #f0faf3; }
.quiz-review-matching-pair--incorrect { border-color: #f1c2c7; background: #fff8f8; }
.quiz-review-matching-status {
    width: 1.35rem; height: 1.35rem; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem;
}
.quiz-review-matching-pair--correct .quiz-review-matching-status { background: #d4edda; color: #155724; }
.quiz-review-matching-pair--incorrect .quiz-review-matching-status { background: #f8d7da; color: #721c24; }
.quiz-review-matching-left, .quiz-review-matching-chosen { font-weight: 600; min-width: 0; word-break: break-word; }
.quiz-review-matching-arrow { color: var(--text-muted); text-align: center; }
.quiz-review-matching-expected {
    grid-column: 2 / -1; font-size: 0.8125rem; color: #721c24; font-weight: 600;
}

.quiz-review-blanks { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-review-blank {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
    padding: 0.65rem 0.85rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg);
}
.quiz-review-blank--correct { border-color: #b8dfc4; background: #f0faf3; }
.quiz-review-blank--incorrect { border-color: #f1c2c7; background: #fff8f8; }
.quiz-review-blank-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.quiz-review-blank-given { font-weight: 700; }
.quiz-review-blank-expected { font-size: 0.8125rem; color: #721c24; font-weight: 600; }

.quiz-review-choice {
    display: inline-flex; align-items: center; gap: 0.65rem;
    padding: 0.75rem 1rem; border-radius: var(--radius); border: 2px solid var(--border); font-weight: 600;
}
.quiz-review-choice--correct { border-color: #28a745; background: #f0faf3; color: #155724; }
.quiz-review-choice--incorrect { border-color: #dc3545; background: #fff8f8; color: #721c24; }
.quiz-review-choice--neutral { background: var(--bg); }

.quiz-review-grade-form {
    margin-top: 0.65rem; padding-top: 0.65rem; border-top: 1px dashed var(--border);
}
.quiz-review-grade-form__fields {
    display: grid; grid-template-columns: minmax(120px, 160px) 1fr; gap: 0.65rem; margin-bottom: 0.65rem;
}
.quiz-review-empty { margin: 0; }

@media (max-width: 720px) {
    .quiz-review-question__summary {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
    }
    .quiz-review-question__type { display: none; }
    .quiz-review-matching-pair { grid-template-columns: auto 1fr; }
    .quiz-review-matching-arrow { display: none; }
    .quiz-review-matching-chosen { grid-column: 2; }
    .quiz-review-grade-form__fields { grid-template-columns: 1fr; }
    .quiz-attempt-hero__body { flex-direction: column; align-items: stretch; }
    .quiz-attempt-hero__score { align-self: center; }
}
.quiz-fill-blank { line-height: 2.2; }
.quiz-blank-input { display: inline-block; width: auto; min-width: 120px; max-width: 220px; margin: 0 0.25rem; vertical-align: baseline; }
.quiz-fill-text { white-space: pre-wrap; }
.quiz-matching-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.quiz-matching-left { font-weight: 600; }
.quiz-matching-help { font-size: 0.875rem; margin: 0 0 0.75rem; }
.quiz-matching-connect { margin-top: 0.25rem; }
.quiz-matching-board {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(3rem, 5rem) minmax(0, 1fr);
    gap: 0.5rem;
    align-items: stretch;
    min-height: 6rem;
    padding: 0.35rem 0;
}
.quiz-matching-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}
.quiz-matching-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.5;
    stroke-linecap: round;
}
.quiz-matching-col {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    position: relative;
    z-index: 2;
}
.quiz-matching-col--left { grid-column: 1; }
.quiz-matching-col--right { grid-column: 3; }
.quiz-matching-item {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 0.9375rem;
    line-height: 1.35;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.quiz-matching-item:hover { border-color: var(--primary-light); background: rgba(15, 108, 191, 0.04); }
.quiz-matching-item.is-selected {
    border-color: var(--primary);
    background: rgba(15, 108, 191, 0.1);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.quiz-matching-item.is-connected {
    border-color: #10b981;
    background: #ecfdf5;
}
.quiz-matching-item.is-connected.is-selected {
    border-color: var(--primary);
    background: rgba(15, 108, 191, 0.1);
}
.quiz-settings-form .quiz-settings-group { border: 0; padding: 0; margin: 0 0 1.35rem; }
.quiz-settings-form legend { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.75rem; padding: 0; }
.quiz-settings-publish { margin-top: 0.65rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius); }

/* Quiz wizard flow */
.quiz-wizard { max-width: none; margin: 0; }
.course-view--quiz-builder .course-builder { display: none; }
.course-content-section--quiz-wizard { padding: 0; border: none; box-shadow: none; background: transparent; }
.course-content-section--quiz-wizard .quiz-wizard-steps { margin-top: 0; }
.quiz-wizard-title { margin: 0.15rem 0 0; font-size: 1.2rem; font-weight: 700; }
.quiz-wizard { max-width: 920px; margin: 0 auto; }
.quiz-wizard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.quiz-wizard-heading { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.quiz-wizard-heading h1 { margin: 0.15rem 0 0; font-size: 1.35rem; }
.quiz-wizard-subtitle { margin: 0.2rem 0 0; font-size: 0.8125rem; }
.quiz-wizard-draft { color: #b45309; font-weight: 700; }
.quiz-wizard-steps {
    display: flex; align-items: center; gap: 0; margin-bottom: 1.35rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 0.85rem 1rem; box-shadow: var(--shadow);
}
.quiz-wizard-step {
    display: flex; align-items: center; gap: 0.55rem; color: var(--text-muted);
    text-decoration: none; font-size: 0.8125rem; font-weight: 600; min-width: 0;
}
.quiz-wizard-step.is-active { color: var(--primary); }
.quiz-wizard-step.is-complete { color: var(--ink-2); }
.quiz-wizard-step-num {
    width: 1.65rem; height: 1.65rem; border-radius: 999px; border: 2px solid currentColor;
    display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; flex-shrink: 0;
}
.quiz-wizard-step.is-active .quiz-wizard-step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.quiz-wizard-step.is-complete .quiz-wizard-step-num { background: #ecfdf5; border-color: #10b981; color: #059669; }
.quiz-wizard-step-line { flex: 1; height: 2px; background: var(--border); margin: 0 0.65rem; min-width: 1rem; }
.quiz-wizard-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.quiz-wizard-panel--list { margin-top: 0; }
.quiz-wizard-panel-head { margin-bottom: 1rem; }
.quiz-wizard-panel-head h2 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.quiz-wizard-form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.quiz-wizard-empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); }
.quiz-wizard-empty i { font-size: 2rem; opacity: 0.35; margin-bottom: 0.65rem; display: block; }
.quiz-wizard-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
    margin-top: 0.5rem; padding-top: 0.25rem;
}
.quiz-wizard-footer--form { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.quiz-wizard-footer-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 640px) {
    .quiz-wizard-steps { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .quiz-wizard-step-line { display: none; }
    .quiz-wizard-footer, .quiz-wizard-footer--form { flex-direction: column; align-items: stretch; }
    .quiz-wizard-footer-actions { width: 100%; }
    .quiz-wizard-footer-actions .btn { flex: 1; }
}
.quiz-edit-question .panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }

.quiz-edit-options { margin: 0.5rem 0 0.75rem; padding-left: 1.25rem; }
.quiz-grade-form { background: var(--bg); padding: 0.85rem; border-radius: var(--radius); }
.quiz-essay-answer { background: var(--bg); padding: 0.85rem; border-radius: var(--radius); margin: 0.5rem 0; }
.quiz-payload-preview { font-size: 0.75rem; background: var(--bg); padding: 0.5rem; border-radius: var(--radius); overflow-x: auto; }
.quiz-type-fields { margin-top: 0.75rem; }
.quiz-builder-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.quiz-builder-head label { margin: 0; font-weight: 700; }
.quiz-builder-help { margin: 0 0 0.75rem; font-size: 0.8125rem; }
.quiz-mcq-list { display: flex; flex-direction: column; gap: 0.45rem; }
.quiz-mcq-choice { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; }
.quiz-mcq-correct { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.quiz-mcq-correct input { width: 1rem; height: 1rem; accent-color: var(--primary); }
.quiz-remove-row { min-width: 2rem; padding-inline: 0.5rem; line-height: 1; }
.quiz-matching-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.quiz-matching-table { width: 100%; border-collapse: collapse; }
.quiz-matching-table th, .quiz-matching-table td { padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.quiz-matching-table th { background: var(--bg); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); text-align: left; }
.quiz-matching-table tr:last-child td { border-bottom: 0; }
.quiz-matching-table td:last-child { width: 3rem; text-align: center; }
.quiz-fib-toolbar { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.quiz-fib-builder {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.1rem;
    padding: 0.85rem 1rem;
    min-height: 3.25rem;
    line-height: 1.75;
    font-size: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    cursor: text;
}
.quiz-fib-builder:focus { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.quiz-fib-segment {
    display: inline-flex;
    align-items: baseline;
    vertical-align: baseline;
    max-width: 100%;
}
.quiz-fib-segment--text { flex: 0 0 auto; }
.quiz-fib-text {
    display: inline-block;
    width: 10ch;
    min-width: 3ch;
    max-width: min(100%, 48ch);
    padding: 0.15rem 0.1rem;
    margin: 0;
    border: none;
    border-bottom: 1px solid rgba(15, 108, 191, 0.25);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    vertical-align: baseline;
    line-height: 1.75;
}
.quiz-fib-text:focus {
    outline: none;
    border-bottom-color: var(--primary);
    background: rgba(15, 108, 191, 0.04);
}
.quiz-fib-segment--blank {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
    margin: 0 0.1rem;
    padding: 0;
    border: none;
    background: transparent;
    vertical-align: baseline;
}
.quiz-fib-blank-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    vertical-align: baseline;
}
.quiz-fib-answer {
    display: inline-block;
    width: auto;
    min-width: 5ch;
    max-width: min(100%, 48ch);
    padding: 0.12rem 0.4rem;
    box-sizing: border-box;
    margin: 0;
    border: 2px solid var(--primary);
    border-radius: 0.35rem;
    background: rgba(15, 108, 191, 0.08);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
    vertical-align: baseline;
    box-shadow: 0 1px 0 rgba(15, 108, 191, 0.12);
}
.quiz-fib-answer::placeholder { color: rgba(15, 108, 191, 0.45); font-weight: 500; }
.quiz-fib-answer:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-light);
}
.quiz-fib-segment .quiz-remove-row {
    opacity: 0.35;
    min-width: 1.35rem;
    padding: 0 0.2rem;
    font-size: 0.85rem;
    line-height: 1;
    vertical-align: baseline;
}
.quiz-fib-segment--blank .quiz-remove-row { margin-left: 0.1rem; }
.quiz-fib-scoring-mode { margin-top: 0.85rem; }
.quiz-fib-scoring-mode small { display: block; margin-top: 0.35rem; }
.quiz-fib-segment:hover .quiz-remove-row,
.quiz-fib-segment:focus-within .quiz-remove-row { opacity: 1; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.quiz-settings-panel { margin-bottom: 1.25rem; }
@media (max-width: 640px) {
    .quiz-matching-row { grid-template-columns: 1fr; }
    .quiz-matching-board { grid-template-columns: 1fr; gap: 0.75rem; }
    .quiz-matching-col--left,
    .quiz-matching-col--right { grid-column: 1; }
    .quiz-matching-lines { display: none; }
}

/* Messenger */
.messenger-page { margin-top: -0.5rem; }
.messenger-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    min-height: calc(100vh - 9rem);
    overflow: hidden;
    padding: 0;
}
.messenger-inbox {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--surface);
}
.messenger-inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
}
.messenger-inbox-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.messenger-inbox-search {
    position: relative;
    padding: 0 1rem 0.75rem;
}
.messenger-inbox-search i {
    position: absolute;
    left: 1.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.messenger-inbox-search input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--bg);
}
.messenger-inbox-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.35rem 0.75rem;
}
.messenger-inbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}
.messenger-inbox-item:hover,
.messenger-inbox-item.is-active {
    background: rgba(15, 108, 191, 0.08);
}
.messenger-inbox-item.has-unread .messenger-inbox-name {
    font-weight: 700;
}
.messenger-inbox-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.messenger-inbox-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}
.messenger-inbox-name {
    font-size: 0.9375rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.messenger-inbox-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.messenger-inbox-preview {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.messenger-inbox-badge {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.messenger-inbox-empty,
.messenger-loading,
.messenger-error {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.messenger-error { color: var(--danger, #c0392b); }
.messenger-thread {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    flex: 1;
    background: var(--bg);
    overflow: hidden;
}
.messenger-thread-empty,
.messenger-thread-active {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.messenger-thread-empty[hidden],
.messenger-thread-active[hidden] {
    display: none !important;
}
.messenger-thread-empty {
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-muted);
    padding: 2rem;
    text-align: center;
}
.messenger-thread-empty i {
    font-size: 2.5rem;
    opacity: 0.45;
}
.messenger-thread-empty h3 {
    margin: 0;
    color: var(--text);
}
.messenger-thread-header {
    flex-shrink: 0;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.messenger-thread-peer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.messenger-thread-peer-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.messenger-thread-peer-meta strong {
    font-size: 0.98rem;
}
.messenger-thread-role {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.messenger-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.messenger-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: min(85%, 560px);
}
.messenger-msg.is-mine {
    align-self: flex-end;
    flex-direction: row;
}
.messenger-msg.is-theirs {
    align-self: flex-start;
    flex-direction: row;
}
.messenger-msg-avatar {
    width: 2rem;
    height: 2rem;
    margin-top: 0.2rem;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 108, 191, 0.12);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 700;
}
.messenger-bubble {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    position: relative;
}
.messenger-msg-actions {
    display: none;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 0.2rem;
}
.messenger-msg.is-mine:hover .messenger-msg-actions,
.messenger-msg.is-mine:focus-within .messenger-msg-actions,
.messenger-msg.is-theirs:hover .messenger-msg-actions,
.messenger-msg.is-theirs:focus-within .messenger-msg-actions {
    display: flex;
}
.messenger-msg-actions.is-theirs-actions {
    justify-content: flex-start;
}
.messenger-msg.is-highlighted {
    animation: messenger-msg-highlight 1.4s ease;
}
@keyframes messenger-msg-highlight {
    0%, 100% { background: transparent; }
    20%, 60% { background: rgba(15, 108, 191, 0.1); border-radius: 0.75rem; }
}
.messenger-msg-action {
    width: 1.65rem;
    height: 1.65rem;
    border: none;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    transition: background 0.15s ease, color 0.15s ease;
}
.messenger-msg-action:hover {
    background: rgba(15, 108, 191, 0.1);
    color: var(--primary);
}
.messenger-msg-action[data-action="unsend"]:hover {
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger, #c0392b);
}
.messenger-bubble-edited {
    font-style: italic;
    border: none;
    background: none;
    padding: 0;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}
.messenger-bubble-edited:hover {
    color: var(--primary);
}
.messenger-history-popover {
    position: fixed;
    z-index: 1300;
    width: min(280px, calc(100vw - 24px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}
.messenger-history-popover[hidden] {
    display: none !important;
}
.messenger-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
}
.messenger-history-header h4 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}
.messenger-history-body {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.messenger-history-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.messenger-history-item.is-current {
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
}
.messenger-history-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.messenger-history-text {
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}
.messenger-history-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.messenger-history-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}
.messenger-history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem 0.85rem 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.messenger-history-actions .btn {
    font-size: 0.78rem;
}
.messenger-history-delete:hover {
    color: var(--danger, #c0392b);
}
.messenger-bubble-body.is-unsent {
    background: var(--bg) !important;
    border: 1px dashed var(--border) !important;
    color: var(--text-muted) !important;
    font-style: italic;
}
.messenger-msg.is-unsent .messenger-bubble.is-mine .messenger-bubble-body {
    border-bottom-right-radius: 0.25rem;
}
.messenger-reply-quote {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    margin-bottom: 0.15rem;
    padding: 0.45rem 0.6rem;
    border: none;
    border-left: 3px solid var(--primary);
    border-radius: 0.55rem;
    background: rgba(15, 108, 191, 0.08);
    text-align: left;
    cursor: pointer;
}
.messenger-bubble.is-mine .messenger-reply-quote {
    background: rgba(255, 255, 255, 0.16);
    border-left-color: rgba(255, 255, 255, 0.85);
}
.messenger-reply-quote-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
}
.messenger-bubble.is-mine .messenger-reply-quote-name {
    color: rgba(255, 255, 255, 0.95);
}
.messenger-reply-quote-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.messenger-bubble.is-mine .messenger-reply-quote-text {
    color: rgba(255, 255, 255, 0.82);
}
.messenger-reply-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: rgba(15, 108, 191, 0.08);
    border-top: 1px solid var(--border);
}
.messenger-reply-banner[hidden] {
    display: none !important;
}
.messenger-reply-banner-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.messenger-reply-banner-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}
.messenger-reply-banner-label i {
    margin-right: 0.3rem;
}
.messenger-reply-banner-preview {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.messenger-reply-banner-preview strong {
    color: var(--text);
    font-size: 0.78rem;
}
.messenger-reply-banner-preview span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.messenger-edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    background: rgba(15, 108, 191, 0.08);
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}
.messenger-edit-banner[hidden] {
    display: none !important;
}
.messenger-edit-banner i {
    margin-right: 0.35rem;
}
.messenger-bubble.is-mine {
    align-items: flex-end;
}
.messenger-bubble.is-theirs {
    align-items: flex-start;
}
.messenger-bubble-body {
    padding: 0.65rem 0.85rem;
    border-radius: 1rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9375rem;
}
.messenger-bubble.is-mine .messenger-bubble-body {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}
.messenger-bubble.is-theirs .messenger-bubble-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0.25rem;
}
.messenger-bubble-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.messenger-composer {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.messenger-composer textarea {
    flex: 1;
    min-height: 2.75rem;
    max-height: 8rem;
    resize: vertical;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
    font: inherit;
}
.messenger-send-btn {
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.messenger-avatar,
.messenger-thread-avatar {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 108, 191, 0.12);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
}
.messenger-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.messenger-modal[hidden] { display: none !important; }
.messenger-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.messenger-modal-panel {
    position: relative;
    width: min(100%, 420px);
    z-index: 1;
    padding: 0;
    overflow: hidden;
}
.messenger-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.messenger-modal-header h3 { margin: 0; font-size: 1rem; }
.messenger-modal-body { padding: 1rem; }
.messenger-user-search-wrap {
    position: relative;
    margin-top: 0.35rem;
}
.messenger-user-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.messenger-user-search-wrap input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
}
.messenger-user-results {
    margin-top: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.messenger-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.5rem;
    border: none;
    border-radius: 0.65rem;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.messenger-user-item:hover { background: rgba(15, 108, 191, 0.08); }
.messenger-user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.messenger-user-meta strong {
    font-size: 0.92rem;
}
.messenger-user-meta span {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.messenger-user-empty {
    padding: 1rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.navbar-messages { position: relative; }
.navbar-msg-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s ease;
}
.navbar-msg-btn:hover {
    background: rgba(15, 108, 191, 0.08);
    color: var(--primary);
}
.navbar-msg-badge {
    position: absolute;
    top: 0.1rem;
    right: 0.05rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}
.navbar-msg-badge[hidden] { display: none !important; }
@media (max-width: 900px) {
    .messenger-layout {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 8rem);
    }
    .messenger-inbox { max-height: 42vh; border-right: none; border-bottom: 1px solid var(--border); }
    .messenger-thread { min-height: 48vh; }
}

/* Virtual Library */
.library-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    margin-bottom: 1.1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.library-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}
.library-tab:hover { color: var(--text); text-decoration: none; }
.library-tab.is-active {
    background: var(--surface);
    border-color: var(--border);
    color: var(--primary);
    box-shadow: var(--shadow);
}
.library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1.25rem;
}
.library-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 10rem;
}
.library-filter span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}
.library-filter .fa-magnifying-glass {
    position: absolute;
    margin: 2.1rem 0 0 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}
.library-filter:first-child {
    position: relative;
    flex: 1 1 14rem;
}
.library-filter:first-child input {
    padding-left: 2rem;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.library-card {
    --lib-tone: 15, 108, 191;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.library-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--lib-tone), 0.45);
}
.library-card--indigo { --lib-tone: 79, 70, 229; }
.library-card--emerald { --lib-tone: 5, 150, 105; }
.library-card--sky { --lib-tone: 2, 132, 199; }
.library-card--amber { --lib-tone: 217, 119, 6; }
.library-card--violet { --lib-tone: 124, 58, 237; }
.library-card--slate { --lib-tone: 71, 85, 105; }

.library-card-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 96px;
    text-decoration: none;
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(var(--lib-tone), 0.18), transparent 60%),
        linear-gradient(135deg, rgba(var(--lib-tone), 0.14), rgba(var(--lib-tone), 0.05));
    border-bottom: 1px solid rgba(var(--lib-tone), 0.18);
}
.library-card-cover-icon {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.9rem;
    background: var(--surface);
    color: rgb(var(--lib-tone));
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(var(--lib-tone), 0.22);
    transition: transform 0.18s ease;
}
.library-card:hover .library-card-cover-icon { transform: scale(1.06); }
.library-card-cover-badges {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.3rem;
}
.library-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.9rem 1rem 0.4rem;
}
.library-card-body h3 {
    margin: 0.1rem 0 0;
    font-size: 1.02rem;
    line-height: 1.3;
}
.library-card-body h3 a {
    color: inherit;
    text-decoration: none;
}
.library-card-body h3 a:hover { color: rgb(var(--lib-tone)); }
.library-card-body p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}
.library-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.library-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(var(--lib-tone), 0.1);
    color: rgb(var(--lib-tone));
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.library-tag--muted {
    background: var(--surface-muted);
    color: var(--text-muted);
}
.library-tag--audience {
    background: rgba(230, 126, 34, 0.14);
    color: #c0651a;
}
.library-tag--pending { background: rgba(241, 196, 15, 0.18); color: #9a7b0a; }
.library-tag--published { background: rgba(39, 174, 96, 0.15); color: #1e8449; }
.library-tag--rejected { background: rgba(231, 76, 60, 0.15); color: #c0392b; }
.library-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.library-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.library-card-meta span i { color: rgba(var(--lib-tone), 0.7); }
.library-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding: 0.75rem 1rem 0.9rem;
    border-top: 1px solid var(--border);
}
.library-card-actions .btn { flex: 1 1 auto; justify-content: center; gap: 0.35rem; }
.library-pending-list {
    display: grid;
    gap: 1rem;
}
.library-pending-card {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 280px);
    gap: 1rem;
    align-items: start;
}
.library-pending-actions {
    display: grid;
    gap: 0.75rem;
}
.library-reject-form textarea {
    margin-bottom: 0.5rem;
}
.library-view-card .library-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.library-view-desc {
    margin-top: 0.5rem;
    color: var(--text-muted);
}
.library-chip { background: rgba(15, 108, 191, 0.08); color: var(--primary); }
.library-chip--pending { background: rgba(241, 196, 15, 0.15); color: #9a7b0a; }
.library-chip--published { background: rgba(39, 174, 96, 0.12); color: #1e8449; }
.library-chip--rejected { background: rgba(231, 76, 60, 0.12); color: #c0392b; }
.course-builder-btn--library {
    border-color: rgba(15, 108, 191, 0.25);
}
.library-attach-dialog,
.library-share-dialog {
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 32rem;
    width: calc(100% - 2rem);
    box-shadow: var(--shadow-lg);
}
.library-attach-dialog::backdrop,
.library-share-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.library-attach-form,
.library-share-form {
    padding: 1.25rem;
}
.library-attach-header,
.library-share-header {
    position: relative;
    margin-bottom: 1rem;
}
.library-attach-header h2,
.library-share-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}
.library-attach-close,
.library-share-close {
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}
@media (max-width: 768px) {
    .library-pending-card {
        grid-template-columns: 1fr;
    }
}

/* Resources hub */
.resources-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 1.25rem;
}
.resources-toolbar-create {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.resources-create-form { display: inline; }
.resources-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
.resources-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.resources-card-preview {
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: calc(var(--radius) - 2px);
    background: linear-gradient(135deg, #e2e8f0, #f8fafc);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.resources-card-preview:hover {
    box-shadow: inset 0 0 0 2px var(--primary);
}
.resources-card-preview-mount {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.resources-card-preview-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
    pointer-events: none;
}
.resources-card-preview.has-thumb .resources-card-preview-fallback {
    display: none;
}
.resources-card-preview.has-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.resources-doc-preview-inner {
    position: absolute;
    inset: 0;
    padding: 0.75rem 1rem;
    font-size: 11px;
    line-height: 1.45;
    color: #1f2937;
    background: #fff;
    overflow: hidden;
    transform-origin: top left;
    pointer-events: none;
}
.resources-doc-preview-inner h1 { font-size: 1.35em; margin: 0 0 0.35em; }
.resources-doc-preview-inner h2 { font-size: 1.15em; margin: 0 0 0.35em; }
.resources-doc-preview-inner p { margin: 0 0 0.5em; }
.resources-card-body h3 {
    margin: 0;
    font-size: 1rem;
}
.resources-card-body h3 a {
    color: var(--text);
    text-decoration: none;
}
.resources-card-body h3 a:hover { color: var(--primary); }
.resources-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
}
.resources-inline-form { display: inline; }

/* Full-screen resource editors */
.editor-shell-active .moodle-navbar { position: relative; z-index: 20; }
.editor-shell-layout { margin-top: 0; min-height: calc(100vh - var(--navbar-height)); }
.editor-shell-main {
    padding: 0 !important;
    max-width: none !important;
}
.editor-shell-main .page-content {
    padding: 0;
    max-width: none;
}
.editor-shell-main .toast-container {
    position: fixed;
    top: 4.25rem;
    right: 1rem;
    z-index: 200;
    width: auto;
    max-width: 360px;
    margin: 0;
}
.editor-shell-main .toast-container:empty { display: none; }
.resource-editor-shell {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3.5rem);
    background: #0f172a;
}
.deck-editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    color: #f8fafc;
}
.deck-editor-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}
.deck-title-input {
    flex: 1;
    min-width: 8rem;
    max-width: 28rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid #475569;
    border-radius: var(--radius);
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
}
.deck-save-status {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}
.deck-save-status.is-dirty { color: #fbbf24; }
.deck-save-status.is-saving { color: #60a5fa; }
.deck-save-status.is-saved { color: #34d399; }
.deck-save-status.is-error { color: #f87171; }
.deck-editor-layout {
    display: grid;
    grid-template-columns: 200px 1fr 260px;
    flex: 1;
    min-height: 0;
}
.deck-slide-rail {
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.deck-slide-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.deck-slide-thumbs {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.deck-slide-thumb {
    position: relative;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0;
    background: #0f172a;
    cursor: pointer;
    text-align: left;
}
.deck-slide-thumb.is-active { border-color: #3b82f6; }
.deck-slide-thumb-canvas {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.deck-slide-thumb-num {
    display: block;
    padding: 0.2rem 0.35rem;
    font-size: 0.7rem;
    color: #94a3b8;
}
.deck-slide-thumb-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: none;
    gap: 2px;
}
.deck-slide-thumb:hover .deck-slide-thumb-actions { display: flex; }
.deck-slide-del, .deck-slide-dup {
    border: none;
    background: rgba(15, 23, 42, 0.75);
    color: #f8fafc;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.65rem;
}
.deck-canvas-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #0f172a;
}
.deck-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    flex-wrap: wrap;
}
.deck-tool-btn {
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}
.deck-tool-btn:hover, .deck-tool-btn.active {
    background: #334155;
    border-color: #475569;
    color: #fff;
}
.deck-toolbar-sep {
    width: 1px;
    height: 1.5rem;
    background: #475569;
    margin: 0 0.25rem;
}
.deck-template-select {
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.8rem;
}
.deck-shapes-menu {
    position: relative;
}
.deck-shapes-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 2.1rem);
    gap: 0.25rem;
    padding: 0.5rem;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.deck-shape-btn {
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #0f172a;
    color: #cbd5e1;
    cursor: pointer;
}
.deck-shape-btn:hover {
    background: #334155;
    border-color: #475569;
    color: #fff;
}
.deck-text-edit {
    position: fixed;
    z-index: 10000;
    padding: 0.35rem 0.5rem;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    background: #fff;
    resize: none;
    outline: none;
    line-height: 1.35;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.deck-canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: auto;
    min-height: 0;
}
#deckStageContainer {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.deck-properties {
    background: #1e293b;
    border-left: 1px solid #334155;
    padding: 0.75rem;
    overflow-y: auto;
    color: #e2e8f0;
}
.deck-properties h3 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.deck-props-section {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #334155;
}
.deck-props-section h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    color: #cbd5e1;
}
.deck-props-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #94a3b8;
}
.deck-props-section .form-control {
    width: 100%;
    margin-top: 0.2rem;
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}
.deck-layer-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.deck-layers-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.deck-layers-list li {
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    color: #cbd5e1;
}
.deck-layers-list li:hover { background: #334155; }
.deck-layers-list li.is-active {
    background: #2563eb;
    color: #fff;
}
.doc-editor-body {
    flex: 1;
    padding: 1.25rem;
    background: var(--surface);
    overflow: auto;
}
.doc-resource-editor { min-height: 420px; }
.deck-presenter {
    padding: 0;
    border: none;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    background: #000;
}
.deck-presenter::backdrop { background: #000; }
.deck-presenter-inner {
    width: 100%;
    height: calc(100vh - 3rem);
}
.deck-presenter-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    height: 3rem;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
}
.deck-presenter-controls button {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    cursor: pointer;
}
.deck-player {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #0f172a;
}
.deck-player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    color: #e2e8f0;
}
.deck-player-nav { display: flex; gap: 0.35rem; }
.deck-player-canvas {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.deck-player:fullscreen .deck-player-canvas { min-height: calc(100vh - 3rem); }
.course-builder-btn--resources {
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font: inherit;
}
.course-builder-btn--resources:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
/* --- Feature-rich deck editor additions --- */
.deck-editor-topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.deck-zoom-controls { display: flex; align-items: center; gap: 0.15rem; }
.deck-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: 1px solid transparent; border-radius: 6px;
    background: transparent; color: #cbd5e1; cursor: pointer; font-size: 0.85rem;
}
.deck-icon-btn:hover { background: #334155; color: #fff; }
.deck-icon-btn.is-on { background: #2563eb; border-color: #3b82f6; color: #fff; }
.deck-zoom-level {
    min-width: 3.2rem; height: 2rem; padding: 0 0.4rem; border: 1px solid #475569;
    border-radius: 6px; background: #0f172a; color: #e2e8f0; font-size: 0.78rem; cursor: pointer;
}
.deck-zoom-level:hover { border-color: #64748b; }

.deck-menu { position: relative; }
.deck-menu-panel, .deck-dropdown-panel {
    position: absolute; z-index: 60; top: calc(100% + 6px);
    background: #1e293b; border: 1px solid #475569; border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45); padding: 0.35rem;
}
.deck-menu-panel[hidden], .deck-dropdown-panel[hidden] { display: none; }
.deck-menu-panel { right: 0; min-width: 12rem; display: flex; flex-direction: column; gap: 2px; }
.deck-menu-panel button {
    display: flex; align-items: center; gap: 0.55rem; width: 100%;
    padding: 0.45rem 0.6rem; border: none; border-radius: 6px; background: transparent;
    color: #e2e8f0; cursor: pointer; font-size: 0.82rem; text-align: left;
}
.deck-menu-panel button:hover { background: #334155; }

.deck-dropdown { position: relative; }
.deck-dropdown-panel { left: 0; }
.deck-caret { font-size: 0.6rem; margin-left: 0.1rem; opacity: 0.7; }
.deck-image-panel { display: flex; flex-direction: column; gap: 2px; min-width: 11rem; }
.deck-image-panel button {
    display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.6rem;
    border: none; border-radius: 6px; background: transparent; color: #e2e8f0;
    cursor: pointer; font-size: 0.82rem; text-align: left;
}
.deck-image-panel button:hover { background: #334155; }
.deck-tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.15rem; width: auto; min-width: 2.1rem; padding: 0 0.45rem; }
.deck-tool-btn.is-on { background: #2563eb; border-color: #3b82f6; color: #fff; }
.deck-align-group { display: inline-flex; gap: 0.1rem; }

/* Properties tabs */
.deck-prop-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.deck-prop-tab {
    flex: 1; padding: 0.45rem 0.5rem; border: 1px solid #334155; border-radius: 6px;
    background: #0f172a; color: #94a3b8; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.deck-prop-tab.is-active { background: #2563eb; border-color: #3b82f6; color: #fff; }
.deck-prop-pane { display: none; }
.deck-prop-pane.is-active { display: block; }
.deck-empty-hint { color: #64748b; font-size: 0.82rem; padding: 1rem 0.25rem; text-align: center; }
.deck-hint { font-weight: 400; color: #64748b; font-size: 0.7rem; }
.deck-mt { margin-top: 0.6rem; }

.deck-seg { display: flex; gap: 0.25rem; margin-bottom: 0.6rem; }
.deck-seg button {
    flex: 1; padding: 0.4rem 0.3rem; border: 1px solid #334155; border-radius: 6px;
    background: #0f172a; color: #94a3b8; font-size: 0.75rem; cursor: pointer;
}
.deck-seg button.is-active { background: #334155; border-color: #475569; color: #fff; }
.deck-bg-row { display: flex; flex-direction: column; gap: 0.4rem; }

.deck-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.deck-grid-2 label, .deck-bg-row label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; color: #94a3b8; }
.deck-grid-2 input[type="number"] { width: 100%; }
.deck-btn-row { display: flex; align-items: center; gap: 0.2rem; flex-wrap: wrap; }
.deck-props-section input[type="color"] {
    width: 100%; height: 2rem; padding: 0; border: 1px solid #475569; border-radius: 6px; background: #0f172a; cursor: pointer;
}
.deck-props-section input[type="range"] { width: 100%; accent-color: #3b82f6; }

.deck-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.3rem; margin-top: 0.4rem; }
.deck-swatch { width: 100%; aspect-ratio: 1; border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 5px; cursor: pointer; padding: 0; }
.deck-swatch:hover { transform: scale(1.08); }

.deck-layers-list li {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.5rem; border-radius: 6px; font-size: 0.78rem;
    cursor: pointer; color: #cbd5e1; border: 1px solid transparent;
}
.deck-layer-icon { width: 1rem; text-align: center; opacity: 0.8; }
.deck-layer-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-layer-lock { border: none; background: transparent; color: inherit; cursor: pointer; opacity: 0.7; }
.deck-layer-lock:hover { opacity: 1; }
.deck-layers-list li.is-dropzone { border-color: #3b82f6; background: #1e3a5f; }

.deck-slide-thumb { transition: opacity 0.15s ease; }
.deck-slide-thumb.is-dragging { opacity: 0.4; }
.deck-slide-thumb.is-dropzone { box-shadow: 0 0 0 2px #3b82f6 inset; }
.deck-slide-thumb-actions { gap: 2px; }

.deck-presenter-stage { width: 100%; height: calc(100vh - 3rem); overflow: hidden; }
.deck-presenter { overflow: hidden; }
.deck-presenter-notes {
    position: fixed; left: 0; right: 0; bottom: 3rem; max-height: 30vh; overflow-y: auto;
    padding: 1rem 1.5rem; background: rgba(15, 23, 42, 0.92); color: #e2e8f0;
    font-size: 1.1rem; line-height: 1.6; white-space: pre-wrap; border-top: 1px solid #334155;
}

@media (max-width: 1100px) {
    .deck-editor-layout {
        grid-template-columns: 160px 1fr;
    }
    .deck-properties { display: none; }
}
@media (max-width: 768px) {
    .deck-editor-layout { grid-template-columns: 1fr; }
    .deck-slide-rail { max-height: 140px; }
    .deck-slide-thumbs { flex-direction: row; overflow-x: auto; }
    .deck-slide-thumb { min-width: 120px; }
}

/* AI platform monitor */
.ai-monitor-stats { margin-bottom: 1rem; }
.ai-key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.ai-key-card { padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ai-monitor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.ai-monitor-live { font-size: 0.85rem; }
.ai-pulse { color: var(--success); font-size: 0.5rem; vertical-align: middle; animation: ai-pulse 1.5s infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.ai-prompt-cell { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-cancelled { background: #f3f4f6; color: #6b7280; }
.superadmin-settings-form { max-width: 520px; display: flex; flex-direction: column; gap: 1rem; }

/* AI analytics */
.ai-analytics-toolbar {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1rem; padding: 1rem 1.25rem;
}
.ai-analytics-filters { flex: 1; min-width: 280px; }
.ai-analytics-filter-label {
    display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.5rem;
}
.ai-granularity-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ai-granularity-pill {
    border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
    border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.8125rem; font-weight: 600;
    cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ai-granularity-pill:hover { border-color: var(--primary); color: var(--primary); }
.ai-granularity-pill.is-active {
    background: var(--primary); border-color: var(--primary); color: #fff;
}
.ai-analytics-school-filter { min-width: 200px; }
.ai-analytics-school-filter label {
    display: block; font-size: 0.75rem; font-weight: 700; margin-bottom: 0.35rem;
}
.ai-analytics-range { width: 100%; font-size: 0.8125rem; margin: 0; }
.ai-analytics-stats { margin-bottom: 1rem; }
.ai-analytics-chart-panel { margin-bottom: 1rem; }
.ai-analytics-chart-wrap { position: relative; min-height: 280px; padding: 0.5rem 0; }
.ai-analytics-loading { text-align: center; padding: 1rem; }
.ai-job-types-cell code { font-size: 0.75rem; }

/* Practice quizzes */
.practice-page .practice-intro { margin-bottom: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.practice-section-heading { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.75rem; color: var(--ink-2); }
.practice-course-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #bae6fd;
}
.practice-course-card__badge {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.practice-course-card__body h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.practice-course-card__body p { margin: 0 0 0.5rem; font-size: 0.9rem; }
.practice-status--error { color: #dc2626 !important; }
.practice-lessons { display: flex; flex-direction: column; gap: 1rem; }
.practice-lesson-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.practice-lesson-card__head { display: flex; align-items: center; gap: 1rem; }
.practice-lesson-index { width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary-muted); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.85rem; }
.practice-level { font-size: 0.85rem; }
.practice-level--beginner { color: #6b7280; }
.practice-level--developing { color: #d97706; }
.practice-level--proficient { color: #2563eb; }
.practice-level--mastery { color: #059669; }
.practice-quiz-banner { margin-bottom: 1rem; }

.practice-config-dialog {
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 28rem;
    width: min(28rem, calc(100vw - 2rem));
    box-shadow: var(--shadow-lg);
}
.practice-config-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.practice-config-form { padding: 1.25rem; }
.practice-config-header {
    position: relative;
    margin-bottom: 1rem;
}
.practice-config-header h2 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.practice-config-close {
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}
.practice-config-body { display: flex; flex-direction: column; gap: 1.25rem; }
.practice-config-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
/* School settings — practice quizzes */
.practice-setting-panel { padding: 0; overflow: hidden; border: none; background: transparent; box-shadow: none; }
.practice-setting-card {
    border: 1px solid #c4b5fd;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 48%, #eff6ff 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.practice-setting-card.is-disabled {
    border-color: #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}
.practice-setting-card__body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: start;
    padding: 1.35rem 1.5rem;
}
.practice-setting-card__icon {
    width: 3.25rem; height: 3.25rem; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem; color: #fff;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}
.practice-setting-card.is-disabled .practice-setting-card__icon {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: none;
}
.practice-setting-card__head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 0.85rem;
}
.practice-setting-card__title { margin: 0 0 0.3rem; font-size: 1.15rem; font-weight: 700; }
.practice-setting-card__subtitle { margin: 0; font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; max-width: 36rem; }
.practice-setting-status {
    flex-shrink: 0; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; padding: 0.3rem 0.65rem; border-radius: 999px;
    background: #dcfce7; color: #166534;
}
.practice-setting-status[data-state="off"] { background: #f1f5f9; color: #64748b; }
.practice-setting-features {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 0.45rem;
}
.practice-setting-features li {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.875rem; color: var(--ink-2);
}
.practice-setting-features li i { color: #7c3aed; width: 1rem; text-align: center; font-size: 0.8rem; }
.practice-setting-features__off i { color: #94a3b8; }
.practice-setting-card__control {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding-top: 0.25rem; min-width: 4.5rem;
}
.practice-setting-switch-label {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-muted);
}
.practice-setting-card.is-enabled .practice-setting-switch-label { color: #6d28d9; }
.practice-setting-card__footer {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-top: 1px solid rgba(124, 58, 237, 0.12);
    background: rgba(255, 255, 255, 0.55);
    font-size: 0.8125rem; color: var(--text-muted);
}
.practice-setting-card.is-disabled .practice-setting-card__footer {
    border-top-color: var(--border);
    background: rgba(255, 255, 255, 0.65);
}
.practice-setting-notice {
    display: flex; gap: 0.75rem; align-items: flex-start;
    margin-top: 1rem; padding: 0.9rem 1rem;
    border-radius: var(--radius); border: 1px solid #fde68a;
    background: #fffbeb; color: #92400e;
}
.practice-setting-notice i { margin-top: 0.15rem; }
.practice-setting-notice p { margin: 0.2rem 0 0; font-size: 0.875rem; }
.toggle-switch {
    position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer;
}
.toggle-switch input {
    position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.toggle-switch__track {
    display: block; width: 2.75rem; height: 1.5rem; border-radius: 999px;
    background: #cbd5e1; transition: background 0.2s ease; position: relative;
}
.toggle-switch--lg .toggle-switch__track { width: 3.25rem; height: 1.75rem; }
.toggle-switch__track::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 1.25rem; height: 1.25rem;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}
.toggle-switch--lg .toggle-switch__track::after { width: 1.45rem; height: 1.45rem; top: 2px; left: 2px; }
.toggle-switch input:checked + .toggle-switch__track { background: #7c3aed; }
.toggle-switch input:checked + .toggle-switch__track::after { transform: translateX(1.25rem); }
.toggle-switch--lg input:checked + .toggle-switch__track::after { transform: translateX(1.5rem); }
.toggle-switch input:focus-visible + .toggle-switch__track { outline: 2px solid #7c3aed; outline-offset: 2px; }
.practice-password-dialog {
    border: none; border-radius: var(--radius-lg); padding: 0;
    max-width: 26rem; width: min(26rem, calc(100vw - 2rem)); box-shadow: var(--shadow-lg);
}
.practice-password-form { padding: 1.5rem; position: relative; }
.practice-password-icon {
    width: 2.75rem; height: 2.75rem; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #ede9fe; color: #6d28d9; font-size: 1.15rem;
    margin-bottom: 0.75rem;
}
.practice-password-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
    margin-bottom: 0.5rem; padding-right: 1.5rem;
}
.practice-password-header h3 { margin: 0; font-size: 1.1rem; }
.practice-password-close {
    position: absolute; top: 1rem; right: 1rem;
    border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.1rem;
}
.practice-password-message { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 1rem; line-height: 1.5; }
.practice-password-footer {
    display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem;
}
@media (max-width: 768px) {
    .practice-setting-card__body { grid-template-columns: 1fr; }
    .practice-setting-card__icon { display: none; }
    .practice-setting-card__control {
        flex-direction: row; justify-content: space-between;
        width: 100%; padding-top: 0.5rem; border-top: 1px solid rgba(124, 58, 237, 0.1);
    }
    .practice-setting-card__head { flex-direction: column; gap: 0.5rem; }
}
.course-lesson-practice { margin-bottom: 0.75rem; }
.course-builder-btn--ai { border-color: #7c3aed; color: #7c3aed; }

/* AI quiz builder */
.ai-quiz-builder-page { max-width: 1100px; }

.ai-builder-hero {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem;
    align-items: start;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg, 12px);
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 45%, #faf5ff 100%);
    border: 1px solid #ddd6fe;
}
.ai-builder-hero__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.ai-builder-hero__eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6d28d9;
    margin: 0 0 0.35rem;
}
.ai-builder-hero__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--ink);
}
.ai-builder-hero__desc {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 52ch;
}
.ai-builder-hero__back { align-self: start; white-space: nowrap; }

.ai-builder-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}
.ai-builder-main { display: flex; flex-direction: column; gap: 1.25rem; }

.ai-builder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
}
.ai-builder-card__head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem 1.5rem 0;
}
.ai-builder-card__head h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 700;
}
.ai-builder-card__head p { margin: 0; font-size: 0.875rem; }
.ai-builder-card__body { padding: 1.25rem 1.5rem 1.5rem; }

.ai-builder-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #ede9fe;
    color: #6d28d9;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-field { display: block; margin-bottom: 1rem; }
.ai-field:last-child { margin-bottom: 0; }
.ai-field--grow { flex: 1; }
.ai-field__label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
    color: var(--ink);
}
.ai-field__hint { font-weight: 400; color: var(--ink-3); }
.ai-field__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ai-field .required { color: #dc2626; }

.ai-source-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.ai-source-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    background: var(--surface);
}
.ai-source-card input { position: absolute; opacity: 0; pointer-events: none; }
.ai-source-card:hover { border-color: #c4b5fd; background: #faf5ff; }
.ai-source-card.is-selected {
    border-color: #7c3aed;
    background: #f5f3ff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.ai-source-card__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: #ede9fe;
    color: #6d28d9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.ai-source-card.is-selected .ai-source-card__icon {
    background: #7c3aed;
    color: #fff;
}
.ai-source-card__title { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.ai-source-card__desc { font-size: 0.78rem; color: var(--ink-3); line-height: 1.4; }

.ai-source-panel__note {
    display: flex;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: #0369a1;
    line-height: 1.45;
}
.ai-source-panel__note i { margin-top: 0.15rem; flex-shrink: 0; }

.ai-upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    background: var(--surface-alt, #f9fafb);
}
.ai-upload-zone.is-dragover,
.ai-upload-zone:hover { border-color: #a78bfa; background: #faf5ff; }
.ai-upload-zone.has-file { padding: 0; border-style: solid; }
.ai-upload-zone__inner i { font-size: 2rem; color: #7c3aed; margin-bottom: 0.5rem; }
.ai-upload-zone__inner p { margin: 0 0 0.35rem; }
.ai-upload-browse {
    background: none;
    border: none;
    padding: 0;
    color: #7c3aed;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
}
.ai-upload-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #f5f3ff;
}
.ai-upload-file i { font-size: 1.5rem; color: #6d28d9; }
.ai-upload-file span { flex: 1; font-weight: 500; text-align: left; word-break: break-all; }
.ai-upload-clear {
    background: none;
    border: none;
    color: var(--ink-3);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 4px;
}
.ai-upload-clear:hover { background: rgba(0,0,0,0.06); color: var(--ink); }

.ai-config-row { margin-bottom: 1rem; }
.ai-count-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.ai-count-btn {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--ink);
    line-height: 1;
}
.ai-count-btn:hover { background: var(--surface-alt); border-color: #c4b5fd; }
.ai-count-input {
    width: 4rem;
    text-align: center;
    font-weight: 600;
}
.ai-count-slider {
    width: 100%;
    accent-color: #7c3aed;
}

.ai-difficulty-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ai-difficulty-pill {
    cursor: pointer;
}
.ai-difficulty-pill input { position: absolute; opacity: 0; pointer-events: none; }
.ai-difficulty-pill span {
    display: block;
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}
.ai-difficulty-pill:hover span { border-color: #c4b5fd; background: #faf5ff; }
.ai-difficulty-pill.is-selected span {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

.ai-type-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ai-type-chip {
    cursor: pointer;
}
.ai-type-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ai-type-chip span,
.ai-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    background: var(--surface);
}
.ai-type-chip i { color: var(--ink-3); font-size: 0.9rem; }
.ai-type-chip:hover { border-color: #c4b5fd; }
.ai-type-chip.is-selected {
    border-color: #7c3aed;
    background: #f5f3ff;
    color: #5b21b6;
}
.ai-type-chip.is-selected i { color: #7c3aed; }

.ai-builder-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}
.ai-builder-preview h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ink-2);
}
.ai-builder-preview h3 i { color: #7c3aed; }
.ai-preview-list { margin: 0; }
.ai-preview-list > div {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.ai-preview-list > div:last-child { border-bottom: none; }
.ai-preview-list dt {
    font-weight: 600;
    color: var(--ink-3);
    margin: 0;
}
.ai-preview-list dd { margin: 0; color: var(--ink); word-break: break-word; }

.ai-builder-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.ai-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border: none;
}
.ai-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
}
.ai-generate-btn:disabled { opacity: 0.65; cursor: not-allowed; }
.ai-builder-footnote {
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0;
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
}
.ai-builder-footnote i { margin-top: 0.1rem; color: #7c3aed; }

.ai-builder-progress {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius);
}
.ai-builder-progress__spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #ddd6fe;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: ai-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-builder-progress strong { display: block; margin-bottom: 0.2rem; }
.ai-builder-progress p { margin: 0; font-size: 0.85rem; }

@media (max-width: 900px) {
    .ai-builder-layout { grid-template-columns: 1fr; }
    .ai-builder-sidebar { position: static; order: -1; }
    .ai-source-cards { grid-template-columns: 1fr; }
    .ai-builder-hero {
        grid-template-columns: 1fr;
    }
    .ai-builder-hero__icon { display: none; }
    .ai-builder-hero__back { justify-self: start; }
}

/* Resources hub enhancements */
.resources-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.resources-stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.resources-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.resources-stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1; color: var(--text); }
.resources-stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.resources-stat--indigo .resources-stat-icon { background: #eef2ff; color: #4f46e5; }
.resources-stat--emerald .resources-stat-icon { background: #ecfdf5; color: #059669; }
.resources-stat--sky .resources-stat-icon { background: #e7f0fa; color: var(--primary); }
.resources-stat--amber .resources-stat-icon { background: #fff7ed; color: #d97706; }

.resources-toolbar--enhanced {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: stretch;
    padding: 0.9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}
.resources-toolbar-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}
.resources-search { position: relative; flex: 1 1 18rem; min-width: 12rem; }
.resources-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.85rem;
}
.resources-search-input {
    width: 100%;
    padding: 0.6rem 0.85rem 0.6rem 2.35rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 0.9rem;
    color: var(--text);
}
.resources-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 108, 191, 0.15);
    background: var(--surface);
}
.resources-toolbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.resources-toolbar-actions .resources-create-form { display: inline-flex; }

.resources-view-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.resources-view-btn {
    width: 2.1rem;
    height: 2.1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
}
.resources-view-btn:hover { color: var(--text); }
.resources-view-btn.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

.resources-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}
.resources-chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); }
.resources-chip > span { font-weight: 600; }
.resources-chip-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.4rem 1.9rem 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--surface-2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a737b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 0.7rem;
    font-size: 0.8rem;
    color: var(--text);
    cursor: pointer;
}
.resources-chip-select:hover { border-color: var(--primary); }
.resources-chip-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 108, 191, 0.15); }
.resources-filter-clear {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--danger);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
}
.resources-filter-clear:hover { text-decoration: underline; color: var(--danger); }

.resources-bulk-bar { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 1rem; margin-bottom: 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }

@media (max-width: 720px) {
    .resources-stats { grid-template-columns: repeat(2, 1fr); }
    .resources-toolbar-actions { width: 100%; }
    .resources-toolbar-actions .resources-create-form { flex: 1; }
    .resources-toolbar-actions .resources-create-form .btn { width: 100%; }
}
.resources-card { position: relative; }
.resources-card-select { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2; }
.resources-grid--list { display: flex; flex-direction: column; }
.resources-grid--list .resources-card { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 1rem; }
.resources-grid--list .resources-card-preview { height: 80px; }

/* User profile extended forms */
.admin-form-card--profile .panel h2 { margin-bottom: 1.25rem; }
.form-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.form-section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--ink-2);
}
.form-section--optional .form-section-title { font-weight: 600; }
.form-row--3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.form-row--4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) {
    .form-row--3, .form-row--4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .form-row--3, .form-row--4 { grid-template-columns: 1fr; }
}
.checkbox-label, .radio-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}
.radio-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.radio-row fieldset { border: none; padding: 0; margin: 0; }
.transferee-fields { display: none; margin-top: 1rem; }
.transferee-fields.is-visible { display: block; }
.required { color: var(--danger); }

/* Student curriculum progress on profile */
.student-curriculum-panel { margin-top: 1.25rem; }
.student-curriculum-intro { margin: 0 0 1rem; max-width: 42rem; }
.student-curriculum-app { margin-top: 0.5rem; }
.student-curriculum-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
}
.student-subject-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
}
.student-subject-status--in_progress { color: var(--primary); }
.student-subject-status--ready_to_pass { color: var(--warning); }
.student-subject-status--completed { color: var(--success); }
.student-subject-status--not_enrolled { color: var(--text-muted); }
.student-subject-progress-count { font-weight: 500; opacity: 0.85; }
.program-subject-table--progress td { vertical-align: middle; }
.student-subject-row--completed { background: rgba(53, 122, 50, 0.04); }
.student-subject-row--ready_to_pass { background: rgba(166, 103, 14, 0.05); }

/* Gradebook passed column */
.gb-table__pass-col { width: 5.5rem; text-align: center; }
.gb-pass-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.gb-pass-toggle.is-disabled { opacity: 0.45; cursor: not-allowed; }
.gb-pass-toggle input { margin: 0; }

/* =========================================================================
   User Import Wizard
   ========================================================================= */

/* Wizard shell */
.import-wizard { max-width: 100%; width: 100%; min-width: 0; }
.import-wizard .panel { min-width: 0; overflow: visible; }

/* Step indicator */
.wizard-nav { margin-bottom: 1.5rem; }
.wizard-steps {
    display: flex;
    list-style: none;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 0;
}
.wizard-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
    cursor: default;
    position: relative;
    transition: background 0.15s;
}
.wizard-step:last-child { border-right: none; }
.step-num {
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.wizard-step.active { background: var(--primary-light); color: var(--primary-dark); }
.wizard-step.active .step-num { background: var(--primary); color: #fff; }
.wizard-step.done { color: var(--success); }
.wizard-step.done .step-num { background: var(--success); color: #fff; }

/* Panel */
.wizard-panel.hidden { display: none; }
.panel { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 1.75rem 2rem; box-shadow: var(--shadow); }
.panel-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--text); }

/* Wizard form fields */
.wizard-field-row { margin-bottom: 1.5rem; }
.wizard-field-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.6rem; color: var(--text); }
.wizard-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }

/* Radio options */
.radio-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.radio-group--horizontal .radio-option { flex: 1; min-width: 220px; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-weight: 500;
}
.radio-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-option:hover { border-color: var(--primary); background: var(--primary-light); }
.radio-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.radio-hint { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); display: block; }

/* Template cards */
.wizard-templates { margin-top: 0.25rem; }
.wizard-template-download {
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.35rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface) 55%);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 14px rgba(15, 108, 191, 0.12);
}
.wizard-template-download.hidden { display: none; }
.wizard-template-download__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid rgba(15, 108, 191, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #1d6f42;
    flex-shrink: 0;
}
.wizard-template-download__icon--sm {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
}
.wizard-template-download__content { min-width: 0; }
.wizard-template-download__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
}
.wizard-template-download__title {
    font-size: 1.05rem;
    color: var(--primary-dark);
}
.wizard-template-download__badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.wizard-template-download__text {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.45;
}
.wizard-template-download__steps {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.wizard-template-download__steps li + li { margin-top: 0.15rem; }
.wizard-template-download__action {
    flex-shrink: 0;
    align-self: center;
}
.wizard-template-download--compact {
    margin-top: 0;
    padding: 0.85rem 1rem;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem 1rem;
    border-width: 1px;
    box-shadow: none;
}
.wizard-template-download--compact .wizard-template-download__text {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
}
.wizard-template-download--compact .wizard-template-download__title {
    font-size: 0.95rem;
}
@media (max-width: 768px) {
    .wizard-template-download {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .wizard-template-download__icon { margin: 0 auto; }
    .wizard-template-download__header { justify-content: center; }
    .wizard-template-download__steps { text-align: left; }
    .wizard-template-download__action { width: 100%; }
    .wizard-template-download__action .btn { width: 100%; justify-content: center; }
}
.template-cards { display: flex; flex-direction: column; gap: 0.5rem; }
.template-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    transition: border-color 0.15s;
}
.template-card:hover { border-color: var(--primary); }
.template-card.selected { border-color: var(--primary); background: var(--primary-light); }
.template-card__icon { font-size: 1.25rem; color: var(--primary); width: 2rem; text-align: center; }
.template-card__info { flex: 1; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.875rem; }
.template-card__actions { display: flex; gap: 0.4rem; }

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--surface-2);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-light); }
.dropzone__icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 0.75rem; }
.dropzone__text { font-size: 0.95rem; color: var(--text); margin-bottom: 0.25rem; }
.dropzone__browse { color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; }
.dropzone__hint { font-size: 0.8rem; color: var(--text-muted); }

/* Upload progress */
.upload-progress { margin-top: 1rem; }
.upload-progress__bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.upload-progress__fill { height: 100%; background: var(--primary); transition: width 0.3s; border-radius: 3px; }
.upload-progress__label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; }

/* Mapper layout */
.mapper-layout {
    min-width: 0;
    width: 100%;
    gap: 1.25rem;
}
.mapper-layout--bulk {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.mapper-layout--bulk .mapper-panel {
    width: 100%;
    flex-shrink: 0;
}
.mapper-layout--bulk .mapper-preview-block {
    width: 100%;
    min-width: 0;
}
.mapper-layout--side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1.25rem;
    align-items: start;
}
.mapper-layout--side .mapper-preview-block { order: 1; }
.mapper-layout--side .mapper-panel { order: 2; }
.mapper-layout--pdf {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1rem;
    align-items: stretch;
    min-height: 520px;
}
.mapper-layout--pdf .mapper-preview-block {
    order: 1;
    min-height: 0;
    height: min(72vh, 680px);
    display: flex;
    flex-direction: column;
}
.mapper-layout--pdf .mapper-preview-block__head {
    display: none;
}
.mapper-layout--pdf .mapper-panel {
    order: 2;
    position: sticky;
    top: 0;
    align-self: start;
    max-height: min(72vh, 680px);
    overflow-y: auto;
}
.mapper-preview.mapper-preview--pdf {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
}
.mapper-preview-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mapper-preview-block.hidden { display: none; }
.mapper-preview-block__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}
.mapper-preview-block__head h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}
.mapper-preview-block__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.mapper-preview {
    min-width: 0;
    width: 100%;
}
.mapper-panel__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.mapper-panel__toolbar.hidden { display: none; }
.mapper-loading { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); padding: 2rem 0; font-size: 0.9rem; }

/* Excel table */
.mapper-excel-wrap {
    overflow: auto;
    max-height: 340px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    -webkit-overflow-scrolling: touch;
}
.mapper-excel-table { border-collapse: collapse; font-size: 0.8rem; width: max-content; min-width: 100%; }
.mapper-excel-table td, .mapper-excel-table th {
    border: 1px solid var(--border);
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mapper-row-num { background: var(--surface-2); color: var(--text-muted); font-size: 0.75rem; text-align: center; width: 2rem; }
.excel-col-header {
    background: var(--surface-2);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.12s;
    vertical-align: bottom;
    min-width: 72px;
    max-width: 120px;
}
.excel-col-header:hover { background: var(--primary-light); color: var(--primary-dark); }
.excel-col-header.mapped { background: #e8f5e9; border-bottom: 2px solid var(--success); }
.col-letter { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.col-header-name {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-2);
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
    max-height: 2.5em;
    overflow: hidden;
}
.mapped-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.2rem;
    color: var(--success);
    font-size: 0.65rem;
}
.mapped-badge--compact {
    display: block;
    margin-top: 0.2rem;
    margin-left: 0;
    font-size: 0.62rem;
    padding: 0.1rem 0.3rem;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Excel sheet selector */
.excel-sheet-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 0;
}
.excel-sheet-bar.hidden { display: none; }
.excel-sheet-bar__label { font-weight: 600; font-size: 0.875rem; white-space: nowrap; flex-shrink: 0; }
.excel-sheet-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}
.excel-sheet-tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.excel-sheet-tab:hover { border-color: var(--primary); color: var(--primary-dark); }
.excel-sheet-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.excel-sheet-bar__hint { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; margin-left: auto; }

/* Manual column mapping */
.column-mapping-section { margin-bottom: 0.75rem; }
.column-mapping-section.hidden { display: none; }
.column-mapping-hint { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.column-mapping-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.65rem;
}
.mapper-layout--side .column-mapping-list {
    grid-template-columns: 1fr;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.column-mapping-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color 0.12s, background 0.12s;
    min-width: 0;
}
.column-mapping-row.is-mapped { border-color: var(--primary); background: var(--primary-light); }
.column-mapping-meta { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.column-mapping-col {
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    flex-shrink: 0;
}
.column-mapping-header {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.column-mapping-select { font-size: 0.82rem; padding: 0.35rem 0.5rem; }
.excel-header-row td { background: var(--primary-light); font-weight: 600; color: var(--ink-2); }
.excel-cell { cursor: pointer; position: relative; transition: background 0.1s; }
.excel-cell:hover { background: var(--primary-light); }
.excel-cell.mapped { background: #e6f4ea; }

/* Text line mapper */
.text-line-list { max-height: 460px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.text-line {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
    font-size: 0.85rem;
}
.text-line:last-child { border-bottom: none; }
.text-line:hover { background: var(--primary-light); }
.text-line.mapped { background: #e6f4ea; }
.text-line__page { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; padding-top: 0.1rem; min-width: 2rem; }
.text-line__content { flex: 1; line-height: 1.4; }

#previewLoading.hidden { display: none; }

.mapper-load-template {
    margin-bottom: 0.85rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2, #f8fafc);
}
.mapper-load-template__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mapper-load-template__row {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}
.mapper-load-template__row .form-control { flex: 1; min-width: 0; }
.mapper-load-template__status {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--success, #15803d);
}
.mapper-load-template__extract {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.pdf-mapper-region {
    position: absolute;
    border: 2px dashed rgba(37, 99, 235, 0.75);
    background: rgba(37, 99, 235, 0.12);
    border-radius: 3px;
    pointer-events: none;
    z-index: 2;
}
.pdf-mapper-region__label {
    position: absolute;
    top: -1.1rem;
    left: 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: rgba(37, 99, 235, 0.9);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    white-space: nowrap;
}

/* PDF visual mapper */
.pdf-mapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}
.pdf-mapper-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2, #f8fafc);
    font-size: 0.8125rem;
    flex-shrink: 0;
}
.pdf-mapper-toolbar__left,
.pdf-mapper-toolbar__right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.pdf-mapper-page-nav,
.pdf-mapper-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.pdf-mapper-icon-btn {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.pdf-mapper-icon-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: rgba(15, 108, 191, 0.35);
    color: var(--primary);
}
.pdf-mapper-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pdf-mapper-text-btn {
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.pdf-mapper-text-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(15, 108, 191, 0.35);
}
.pdf-mapper-toolbar__hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.pdf-mapper-toolbar__hint i { color: var(--primary); }
.pdf-mapper-toolbar__meta,
.pdf-mapper-zoom__label {
    color: var(--text);
    font-weight: 600;
    font-size: 0.78rem;
    min-width: 5.5rem;
    text-align: center;
}
.pdf-mapper-mapped {
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-muted, #eef2f7);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}
.pdf-mapper-mapped.is-active {
    background: rgba(39, 174, 96, 0.14);
    color: #1e8449;
}
.pdf-mapper-viewport {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background-color: #e8edf3;
    background-image:
        linear-gradient(45deg, rgba(148, 163, 184, 0.18) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(148, 163, 184, 0.18) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.18) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.18) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    padding: 1.25rem;
}
.pdf-mapper-stage-host {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100%;
}
.pdf-mapper-stage {
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
}
.pdf-mapper-canvas {
    display: block;
    vertical-align: top;
}
.pdf-mapper-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.pdf-mapper-hit {
    position: absolute;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.pdf-mapper-hit:hover {
    background: rgba(15, 108, 191, 0.16);
    border-color: rgba(15, 108, 191, 0.55);
    box-shadow: inset 0 -2px 0 rgba(15, 108, 191, 0.65);
}
.pdf-mapper-hit.is-active {
    background: rgba(15, 108, 191, 0.22);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(15, 108, 191, 0.35);
}
.pdf-mapper-hit.is-mapped {
    background: rgba(39, 174, 96, 0.2);
    border-color: rgba(39, 174, 96, 0.65);
    box-shadow: inset 0 -2px 0 rgba(39, 174, 96, 0.75);
}
.pdf-mapper-hit__badge {
    position: absolute;
    top: -1.15rem;
    left: 0;
    max-width: 10rem;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: #1e8449;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 2;
}

/* Mapped badge */
.mapped-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    margin-left: 0.35rem;
    vertical-align: middle;
    white-space: nowrap;
}

/* Mapper panel */
.mapper-panel {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    min-width: 0;
}
.mapper-panel__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; gap: 0.5rem; flex-wrap: wrap; }
.mapper-panel__header h3 { font-size: 0.95rem; font-weight: 700; margin: 0; }
.mapper-panel__header-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.mapper-option { font-size: 0.85rem; margin: 0; }

/* Mapping list */
.mapping-list { display: flex; flex-direction: column; gap: 0.4rem; }
.mapping-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}
.mapping-source { font-family: monospace; font-size: 0.78rem; background: var(--bg); padding: 0.1rem 0.3rem; border-radius: 3px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-arrow { color: var(--text-muted); font-size: 0.7rem; }
.mapping-field { flex: 1; font-weight: 600; font-size: 0.8rem; }
.mapping-field--required::after { content: ' *'; color: var(--danger); }
.mapping-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.2rem; margin-left: auto; }
.mapping-remove:hover { color: var(--danger); }

/* Assign popup */
.assign-popup {
    position: fixed;
    z-index: 1200;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 320px;
    padding: 1rem;
}
.assign-popup.hidden { display: none; }
.assign-popup__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.assign-popup__close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0; }
.assign-popup__close:hover { color: var(--text); }
.assign-popup__source { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; background: var(--bg); padding: 0.35rem 0.5rem; border-radius: var(--radius); word-break: break-all; }
.assign-popup__actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.input-error { border-color: var(--danger) !important; }
.form-control--sm { padding: 0.3rem 0.5rem; font-size: 0.82rem; }

/* Save template dialog */
.save-template-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.save-template-dialog.hidden { display: none; }
.save-template-dialog__inner {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 420px;
    max-width: calc(100vw - 2rem);
    box-shadow: var(--shadow-lg);
}

/* Preview / import summary */
.import-summary { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.summary-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 600; }
.summary-item--ok { color: var(--success); }
.summary-item--warn { color: var(--warning); }
.summary-item--info { color: var(--primary); }
.import-summary-banner .alert { margin: 0; }
.row-error td { background: #fff5f5 !important; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.generated-pw { font-family: monospace; font-size: 0.85rem; background: var(--bg); padding: 0.15rem 0.4rem; border-radius: 3px; }

/* Import running */
.import-running { display: flex; align-items: center; gap: 0.75rem; padding: 2rem; font-size: 0.95rem; color: var(--text-muted); }
.import-running.hidden { display: none; }

/* Badges for import results */
.badge-warning { background: #fef3c7; color: #92400e; border-radius: 999px; padding: 0.15rem 0.5rem; font-size: 0.75rem; font-weight: 700; }
.badge-danger  { background: #fee2e2; color: #991b1b; border-radius: 999px; padding: 0.15rem 0.5rem; font-size: 0.75rem; font-weight: 700; }

/* Responsive */
@media (max-width: 992px) {
    .mapper-layout--side { grid-template-columns: 1fr; }
    .mapper-layout--side .mapper-preview-block { order: 2; }
    .mapper-layout--pdf { grid-template-columns: 1fr; }
    .mapper-layout--pdf .mapper-preview-block { order: 2; }
    .column-mapping-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 860px) {
    .wizard-steps { flex-wrap: wrap; }
    .wizard-step { min-width: 50%; border-bottom: 1px solid var(--border); }
    .column-mapping-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .panel { padding: 1.25rem 1rem; }
    .wizard-step { min-width: 100%; }
}

/* btn-danger-ghost */
.btn-danger-ghost {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-danger-ghost:hover { background: var(--danger); color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }

/* Academic Tools */
.academic-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.academic-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.academic-tool-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.academic-tool-card__icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light, #eff6ff);
    color: var(--primary);
    border-radius: var(--radius, 8px);
    font-size: 1.25rem;
}

.academic-tool-card__body {
    flex: 1;
    min-width: 0;
}

.academic-tool-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.academic-tool-card__desc {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.academic-tool-card__arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.academic-tool-card:hover .academic-tool-card__arrow {
    color: var(--primary);
}

.web-editor-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 3.5rem);
    min-height: 480px;
}

.web-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface, #fff);
    flex-shrink: 0;
}

.web-editor-toolbar__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.web-editor-toolbar__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.web-editor-toolbar__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.web-editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.web-editor-panes {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: auto;
    border-right: 1px solid var(--border);
}

.web-editor-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border-bottom: 1px solid var(--border);
}

.web-editor-pane:last-child {
    border-bottom: none;
}

.web-editor-pane__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.web-editor-pane__label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.web-editor-pane__clear {
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface, #fff);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color 0.15s, color 0.15s;
}

.web-editor-pane__clear:hover {
    border-color: var(--danger, #dc2626);
    color: var(--danger, #dc2626);
}

.web-editor-pane__editor {
    flex: 1;
    min-height: 8rem;
    overflow: hidden;
}

.web-editor-pane__editor .CodeMirror {
    height: 100%;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.web-editor-pane__editor .CodeMirror-scroll {
    min-height: 8rem;
}

.web-editor-pane__editor .CodeMirror-gutters {
    border-right: 1px solid var(--border);
    background: var(--bg);
}

.web-editor-pane__editor .CodeMirror-linenumber {
    color: #94a3b8;
    padding: 0 0.35rem 0 0;
}

/* HTML pane */
.web-editor-pane--html .CodeMirror {
    background: #f8fbff;
    color: #1e293b;
}

.web-editor-pane--html .cm-tag { color: #2563eb; font-weight: 600; }
.web-editor-pane--html .cm-bracket { color: #64748b; }
.web-editor-pane--html .cm-attribute { color: #7c3aed; }
.web-editor-pane--html .cm-string { color: #059669; }
.web-editor-pane--html .cm-comment { color: #94a3b8; font-style: italic; }
.web-editor-pane--html .cm-meta { color: #0d9488; }

/* CSS pane */
.web-editor-pane--css .CodeMirror {
    background: #fdfaff;
    color: #1e293b;
}

.web-editor-pane--css .cm-qualifier,
.web-editor-pane--css .cm-builtin { color: #7c3aed; }
.web-editor-pane--css .cm-property { color: #2563eb; }
.web-editor-pane--css .cm-atom { color: #059669; }
.web-editor-pane--css .cm-number { color: #d97706; }
.web-editor-pane--css .cm-string { color: #059669; }
.web-editor-pane--css .cm-keyword { color: #db2777; }
.web-editor-pane--css .cm-comment { color: #94a3b8; font-style: italic; }

/* JavaScript pane */
.web-editor-pane--js .CodeMirror {
    background: #fffdf5;
    color: #1e293b;
}

.web-editor-pane--js .cm-keyword { color: #7c3aed; font-weight: 600; }
.web-editor-pane--js .cm-def { color: #2563eb; }
.web-editor-pane--js .cm-variable { color: #1e293b; }
.web-editor-pane--js .cm-variable-2 { color: #0d9488; }
.web-editor-pane--js .cm-property { color: #2563eb; }
.web-editor-pane--js .cm-string { color: #059669; }
.web-editor-pane--js .cm-number { color: #d97706; }
.web-editor-pane--js .cm-atom { color: #db2777; }
.web-editor-pane--js .cm-comment { color: #94a3b8; font-style: italic; }
.web-editor-pane--js .cm-operator { color: #64748b; }

.web-editor-pane__input {
    display: none;
}

.web-editor-preview {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--bg);
}

.web-editor-preview__header {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface, #fff);
    flex-shrink: 0;
}

.web-editor-preview__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.web-editor-preview__frame {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: none;
    background: #fff;
}

@media (max-width: 900px) {
    .web-editor-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .web-editor-panes {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}

/* Python Compiler */
.academic-tool-card__icon--python {
    background: #ecfdf5;
    color: #047857;
}

.python-compiler-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 3.5rem);
    min-height: 520px;
    position: relative;
    overflow: hidden;
}

.python-compiler-shell--booting {
    overflow: hidden;
}

.python-compiler-boot {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem 1.5rem 2.5rem;
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 42%),
        linear-gradient(180deg, #f8fafc 0%, #ffffff 55%, #eff6ff 100%);
}

.python-compiler-boot[hidden] {
    display: none !important;
}

.python-compiler-boot__back {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.python-compiler-boot__back:hover {
    color: var(--text);
    border-color: #bfdbfe;
    background: #fff;
}

.python-compiler-boot__card {
    width: min(100%, 28rem);
    padding: 2rem 1.75rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid #dbeafe;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.08);
    text-align: center;
}

.python-compiler-boot__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1rem;
    border-radius: 1.1rem;
    background: linear-gradient(135deg, #306998 0%, #ffd43b 100%);
    color: #fff;
    font-size: 2.2rem;
    box-shadow: 0 10px 24px rgba(48, 105, 152, 0.22);
}

.python-compiler-boot__title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.python-compiler-boot__subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.python-compiler-boot__spinner {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 1rem;
    border: 3px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: python-compiler-spin 0.85s linear infinite;
}

.python-compiler-boot__status {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1d4ed8;
}

.python-compiler-boot__status.is-error {
    color: #b91c1c;
}

.python-compiler-boot__hint {
    margin: 0.85rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.python-compiler-boot__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.python-compiler-boot__actions[hidden] {
    display: none !important;
}

.python-compiler-boot__steps {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: grid;
    gap: 0.65rem;
    text-align: left;
}

.python-compiler-boot__steps li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.python-compiler-boot__step-marker {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    flex-shrink: 0;
    position: relative;
}

.python-compiler-boot__steps li.is-active {
    color: #1d4ed8;
    font-weight: 600;
}

.python-compiler-boot__steps li.is-active .python-compiler-boot__step-marker {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.python-compiler-boot__steps li.is-active .python-compiler-boot__step-marker::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #2563eb;
    animation: python-compiler-pulse 1.2s ease-in-out infinite;
}

.python-compiler-boot__steps li.is-done {
    color: #047857;
}

.python-compiler-boot__steps li.is-done .python-compiler-boot__step-marker {
    border-color: #10b981;
    background: #10b981;
}

.python-compiler-boot__steps li.is-done .python-compiler-boot__step-marker::after {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.05rem;
    width: 0.28rem;
    height: 0.5rem;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

.python-compiler-boot__progress {
    height: 0.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.python-compiler-boot__progress-bar {
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 0.8s ease;
}

@keyframes python-compiler-spin {
    to { transform: rotate(360deg); }
}

@keyframes python-compiler-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@keyframes python-compiler-progress {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

.python-compiler-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    animation: python-compiler-fade-in 0.35s ease;
}

.python-compiler-main[hidden] {
    display: none !important;
}

@keyframes python-compiler-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.python-compiler-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.python-compiler-status[data-state="loading"] {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.python-compiler-status[data-state="ready"] {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.python-compiler-status[data-state="error"] {
    color: var(--danger, #dc2626);
    border-color: #fecaca;
    background: #fef2f2;
}

.python-compiler-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.python-compiler-workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.python-compiler-pane {
    display: flex;
    flex-direction: column;
    flex: 1.2;
    min-height: 0;
    border-bottom: 1px solid var(--border);
}

.python-compiler-editor {
    flex: 1;
    min-height: 12rem;
}

.python-compiler-output-wrap {
    display: flex;
    flex-direction: column;
    flex: 0.8;
    min-height: 10rem;
    background: #0f172a;
}

.python-compiler-output-wrap .web-editor-preview__header {
    background: #1e293b;
    border-bottom-color: #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.python-compiler-output-wrap .web-editor-preview__label {
    color: #cbd5e1;
}

.python-compiler-output-wrap .web-editor-pane__clear {
    color: #94a3b8;
    background: transparent;
    border-color: #475569;
}

.python-compiler-output-wrap .web-editor-pane__clear:hover {
    color: #f8fafc;
    border-color: #94a3b8;
}

.python-compiler-output {
    flex: 1;
    margin: 0;
    padding: 0.85rem 1rem;
    overflow: auto;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
}

.python-compiler-output.is-error {
    color: #fca5a5;
}

.python-compiler-terminal-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid #334155;
    background: #1e293b;
}

.python-compiler-terminal-input[hidden] {
    display: none;
}

.python-compiler-terminal-input__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.python-compiler-terminal-input__prompt {
    color: #38bdf8;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    font-weight: 700;
}

.python-compiler-terminal-input__field {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid #475569;
    border-radius: 4px;
    background: #0f172a;
    color: #f8fafc;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
    font-size: 0.8125rem;
}

.python-compiler-terminal-input__field:focus {
    outline: none;
    border-color: #38bdf8;
}

.web-editor-pane--python .CodeMirror {
    background: #f0fdf4;
    color: #1e293b;
}

.web-editor-pane--python .cm-keyword { color: #7c3aed; font-weight: 600; }
.web-editor-pane--python .cm-def { color: #2563eb; }
.web-editor-pane--python .cm-variable { color: #1e293b; }
.web-editor-pane--python .cm-variable-2 { color: #0d9488; }
.web-editor-pane--python .cm-property { color: #2563eb; }
.web-editor-pane--python .cm-string { color: #059669; }
.web-editor-pane--python .cm-number { color: #d97706; }
.web-editor-pane--python .cm-comment { color: #94a3b8; font-style: italic; }
.web-editor-pane--python .cm-operator { color: #64748b; }
.web-editor-pane--python .cm-builtin { color: #db2777; }

.python-compiler-ai-fab {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.python-compiler-ai-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(79, 70, 229, 0.42);
}

.python-compiler-shell--assistant-open .python-compiler-ai-fab {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}

.python-compiler-ai-backdrop {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(2px);
    animation: python-compiler-fade-in 0.2s ease;
}

.python-compiler-ai-backdrop[hidden] {
    display: none !important;
}

.python-compiler-assistant {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: min(24rem, calc(100% - 2rem));
    max-height: min(32rem, calc(100% - 5.5rem));
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface, #fff);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    animation: python-compiler-assistant-in 0.25s ease;
}

.python-compiler-assistant[hidden] {
    display: none !important;
}

@keyframes python-compiler-assistant-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.python-compiler-assistant__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.python-compiler-assistant__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.python-compiler-assistant__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.python-compiler-assistant__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.python-compiler-assistant__close:hover {
    color: var(--text);
    border-color: var(--primary);
}

.python-compiler-assistant__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
}

.python-compiler-assistant__subtitle {
    margin: 0.1rem 0 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.python-compiler-assistant__notice {
    display: flex;
    gap: 0.65rem;
    padding: 1rem;
    margin: 1rem;
    border-radius: var(--radius, 8px);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.python-compiler-assistant__notice i {
    color: var(--primary);
    margin-top: 0.15rem;
}

.python-compiler-assistant__prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem 0;
}

.python-ai-prompt-chip {
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
}

.python-ai-prompt-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light, #eff6ff);
}

.python-compiler-assistant__messages {
    flex: 1;
    min-height: 5.5rem;
    overflow: auto;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.python-ai-message {
    display: flex;
}

.python-ai-message--user {
    justify-content: flex-end;
}

.python-ai-message__bubble {
    max-width: 92%;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.python-ai-message--assistant .python-ai-message__bubble {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
}

.python-ai-message--applied .python-ai-message__bubble {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.python-ai-message--user .python-ai-message__bubble {
    background: var(--primary-light, #eff6ff);
    color: var(--text);
}

.python-compiler-assistant__form {
    padding: 0.65rem 0.85rem 0.85rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.python-compiler-assistant__composer {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
}

.python-compiler-assistant__input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    font-family: inherit;
    font-size: 0.8125rem;
    resize: none;
    min-height: 2.5rem;
    max-height: 6rem;
    background: #fff;
    line-height: 1.4;
}

.python-compiler-assistant__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.python-compiler-assistant__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.python-compiler-assistant__send:hover:not(:disabled) {
    transform: scale(1.05);
}

.python-compiler-assistant__send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .python-compiler-assistant {
        right: 0.75rem;
        left: 0.75rem;
        bottom: 0.75rem;
        width: auto;
        max-height: min(70vh, calc(100% - 4.5rem));
    }

    .python-compiler-ai-fab {
        right: 1rem;
        bottom: 1rem;
    }
}

