:root {
    --bg-1: #07111d;
    --bg-2: #0c1726;
    --surface: rgba(10, 20, 34, 0.94);
    --surface-2: rgba(13, 24, 40, 0.88);
    --surface-3: rgba(255, 255, 255, 0.03);
    --line: rgba(122, 163, 214, 0.16);
    --line-strong: rgba(126, 186, 255, 0.32);
    --text: #e8eef8;
    --muted: #9cb0cb;
    --primary: #56a7ff;
    --primary-2: #3cc8ff;
    --frozen: #8a7dff;
    --success: #2fd39e;
    --warning: #ffbf66;
    --danger: #ff6f80;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --radius: 20px;
    --radius-sm: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(7,17,29,0.98), rgba(9,18,31,0.98)),
        radial-gradient(circle at top right, rgba(60, 200, 255, 0.08), transparent 24%),
        linear-gradient(rgba(75, 111, 149, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(75, 111, 149, 0.08) 1px, transparent 1px);
    background-size: auto, auto, 34px 34px, 34px 34px;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.card,
.stat-card,
.summary-card {
    background: linear-gradient(180deg, rgba(10, 21, 36, 0.96), rgba(8, 17, 30, 0.94));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(5, 11, 22, 0.82), rgba(7, 14, 26, 0.9)),
        linear-gradient(90deg, rgba(5, 11, 22, 0.24), rgba(5, 11, 22, 0.08)),
        url('../img/login-wallpaper.jpg') center center / cover no-repeat;
    opacity: 1;
    z-index: -2;
}

.login-page::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 18% 38%, rgba(60, 200, 255, 0.16), transparent 22%),
        linear-gradient(rgba(75, 111, 149, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(75, 111, 149, 0.06) 1px, transparent 1px);
    background-size: auto, 34px 34px, 34px 34px;
    z-index: -1;
}

.login-shell {
    width: min(100%, 980px);
}

.login-frame {
    padding: 34px;
    background: linear-gradient(180deg, rgba(6, 15, 28, 0.88), rgba(6, 14, 26, 0.92));
    backdrop-filter: blur(6px);
}

.login-brand {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 28px;
}

.brand-logo-wrap {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.brand-logo-wrap--login {
    padding: 10px 14px;
    border-radius: 16px;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 58px;
    object-fit: contain;
}

.login-brand h1 {
    margin: 6px 0 8px;
    font-size: 1.8rem;
    line-height: 1.15;
}

.login-brand p,
.login-footer-note,
.help-text,
.muted,
.page-header p,
.section-header p,
.topbar p,
.activity-item small,
.quick-link span,
.hero-feature span {
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-footer-note {
    margin-top: 16px;
    font-size: 0.92rem;
}

.eyebrow {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-weight: 700;
}

.layout-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 292px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: linear-gradient(180deg, rgba(5, 13, 24, 0.98), rgba(7, 15, 27, 0.97));
    border-right: 1px solid var(--line);
    z-index: 20;
    overflow-y: auto;
}

.sidebar__top { display: flex; flex-direction: column; gap: 18px; }
.brand-block { display: flex; gap: 14px; align-items: center; }
.brand-block .brand-logo-wrap { width: auto; }
.brand-block h1 { margin: 0; font-size: 1rem; }
.brand-block p { margin: 4px 0 0; color: var(--muted); }
.brand-block .brand-logo { height: 42px; }
.brand-logo-wrap--login .brand-logo { height: 74px; }
.sidebar-panel,
.inset-card,
.status-card,
.hero-feature,
.activity-item,
.quick-link,
.enrollment-item,
.course-chip {
    background: var(--surface-3);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.sidebar-panel,
.status-card { padding: 16px; }
.status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 14px rgba(47, 211, 158, 0.7);
}

.nav-menu { display: flex; flex-direction: column; gap: 10px; }
.nav-link {
    padding: 13px 15px;
    border-radius: 14px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: 0.18s ease;
}

.nav-link__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nav-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #2ecc71, #1fbf8f);
    box-shadow: 0 6px 14px rgba(31, 191, 143, 0.28);
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, rgba(86, 167, 255, 0.18), rgba(60, 200, 255, 0.08));
    border-color: var(--line-strong);
    color: #fff;
}
.sidebar__bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

.main-panel {
    margin-left: 292px;
    width: calc(100% - 292px);
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px 0;
}
.topbar__left { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.topbar h2 { margin: 4px 0 6px; font-size: 1.7rem; }
.topbar-chip {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
}
.topbar-chip strong { display: block; margin-top: 4px; }

.content-area {
    padding: 24px 28px 30px;
}

.page-header,
.section-header,
.btn-row,
.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.page-header.slim { margin-bottom: 16px; }
.page-header h3,
.section-header h3 {
    margin: 6px 0 0;
    font-size: 1.25rem;
}

.grid-4,
.grid-3,
.grid-2,
.form-grid,
.filter-grid,
.hero-grid,
.split-layout,
.compact-stats,
.dashboard-grid {
    display: grid;
    gap: 20px;
}
.grid-4,
.compact-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2,
.form-grid,
.filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-layout { grid-template-columns: 320px minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.compact { grid-template-columns: 1fr; }
.grid-4 > *,
.grid-3 > *,
.grid-2 > *,
.split-layout > * { min-width: 0; }

.stat-card,
.summary-card,
.filter-card,
.form-card,
.course-card,
.side-panel,
.main-workspace {
    padding: 22px;
    overflow: hidden;
}
.stat-card small,
.summary-card small {
    display: block;
    margin-bottom: 10px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}
.stat-card strong,
.summary-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 2rem;
}
.text-danger { color: var(--danger); }
.text-inline { font-size: 1rem !important; }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full,
.btn-row.full { grid-column: 1 / -1; }
label { font-size: 0.93rem; font-weight: 600; }
input,
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(3, 9, 17, 0.92);
    color: var(--text);
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
textarea { min-height: 120px; resize: vertical; }
input:focus,
textarea:focus,
select:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(86, 167, 255, 0.10);
}
input[type="checkbox"] { width: auto; accent-color: var(--primary); }
.checkbox-group label { display: flex; align-items: center; gap: 10px; font-weight: 500; }

.table-progress-edit td:nth-child(4) {
    text-align: center;
}
.table-progress-edit td input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(123, 189, 255, 0.30);
    background: rgba(255,255,255,0.94);
    display: inline-grid;
    place-items: center;
    margin: 0;
    cursor: pointer;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.12);
}
.table-progress-edit td input[type="checkbox"]::after {
    content: "";
    width: 6px;
    height: 12px;
    border: solid #0a1a2a;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.16s ease;
    margin-top: -2px;
}
.table-progress-edit td input[type="checkbox"]:checked {
    background: linear-gradient(135deg, rgba(86,167,255,0.96), rgba(102,189,255,0.96));
    border-color: rgba(123, 189, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(86, 167, 255, 0.14);
}
.table-progress-edit td input[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1);
}
.table-progress-edit td input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(125, 190, 255, 0.65);
    outline-offset: 2px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #03101a;
}
.btn-secondary {
    background: rgba(255,255,255,0.06);
    border-color: var(--line);
    color: var(--text);
}
.btn-outline {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--text);
}
.btn-danger {
    background: rgba(255,111,128,0.13);
    border-color: rgba(255,111,128,0.25);
    color: #ffe7eb;
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; border-radius: 12px; font-size: 0.86rem; }

.alert {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    margin-bottom: 18px;
}
.alert.success { background: rgba(47,211,158,0.10); border-color: rgba(47,211,158,0.22); }
.alert.error { background: rgba(255,111,128,0.10); border-color: rgba(255,111,128,0.22); }
.alert.info { background: rgba(86,167,255,0.10); border-color: rgba(86,167,255,0.22); }

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.015);
}
.table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}
.table-wide { min-width: 980px; }
.table-topic-sequence { min-width: 900px; }
.table-progress-edit { min-width: 1180px; }
.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.table th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--muted);
    background: rgba(7, 16, 30, 0.98);
    position: sticky;
    top: 0;
    z-index: 1;
}
.table td { word-break: break-word; }
.table tr:hover td { background: rgba(255,255,255,0.018); }
.empty-row,
.empty-state { padding: 24px; text-align: center; color: var(--muted); }
.row-danger td { background: rgba(255,111,128,0.08); }
.row-glow td { background: rgba(255,191,102,0.05); }
.row-frozen td { background: rgba(138,125,255,0.10); }
.row-exceeded td { background: rgba(255,191,102,0.10); }
.row-completed td { background: rgba(47,211,158,0.09); }
.row-progress td { background: rgba(86,167,255,0.035); }
.danger-outline { border-color: rgba(255,111,128,0.28); }

.progress-track {
    height: 10px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.05);
    overflow: hidden;
}
.progress-track.large { height: 14px; }
.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 0 18px rgba(86,167,255,0.35);
}
.progress-fill.danger {
    background: linear-gradient(135deg, var(--danger), #ff977c);
    box-shadow: 0 0 18px rgba(255,111,128,0.32);
}

.badge,
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge.success { background: rgba(47,211,158,0.12); border-color: rgba(47,211,158,0.25); }
.badge.warning { background: rgba(255,191,102,0.12); border-color: rgba(255,191,102,0.25); }
.badge.danger { background: rgba(255,111,128,0.12); border-color: rgba(255,111,128,0.25); }
.badge.info { background: rgba(86,167,255,0.12); border-color: rgba(86,167,255,0.25); }
.badge.frozen { background: rgba(138,125,255,0.18); border-color: rgba(138,125,255,0.34); color: #ede9ff; }
.badge.exceeded { background: rgba(255,191,102,0.16); border-color: rgba(255,191,102,0.34); color: #ffe8bd; }
.badge.freeze-pill { box-shadow: 0 0 0 1px rgba(138,125,255,0.16), 0 0 20px rgba(138,125,255,0.14); }
.badge.secondary { background: rgba(169,184,202,0.10); border-color: rgba(169,184,202,0.22); }
.badge.muted,
.chip { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.08); }

.action-row,
.stack-list,
.stack-right,
.activity-feed,
.enrollment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.action-row { flex-direction: row; flex-wrap: wrap; }
.stack-right { align-items: flex-end; }
.inline-form { display: inline; }
.quick-link,
.enrollment-item,
.activity-item,
.course-chip { padding: 14px 16px; }
.quick-link { font-weight: 700; }
.quick-link-list .quick-link { min-height: 64px; display: flex; align-items: center; }
.course-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.course-chip {
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
.course-chip strong { display: block; margin-bottom: 6px; }
.course-chip span { color: var(--muted); font-size: 0.9rem; }
.course-chip:hover,
.course-chip.active,
.enrollment-item.active {
    border-color: var(--line-strong);
    background: linear-gradient(135deg, rgba(86, 167, 255, 0.16), rgba(60, 200, 255, 0.08));
    transform: translateY(-1px);
}
.course-chip.status-frozen { border-color: rgba(138,125,255,0.28); background: linear-gradient(135deg, rgba(138,125,255,0.14), rgba(115,104,255,0.06)); }
.course-chip.status-delayed { border-color: rgba(255,111,128,0.25); background: linear-gradient(135deg, rgba(255,111,128,0.12), rgba(255,151,124,0.05)); }
.course-chip.status-exceeded { border-color: rgba(255,191,102,0.26); background: linear-gradient(135deg, rgba(255,191,102,0.14), rgba(255,216,143,0.04)); }
.course-chip.status-completed { border-color: rgba(47,211,158,0.24); background: linear-gradient(135deg, rgba(47,211,158,0.12), rgba(47,211,158,0.04)); }
.course-chip.status-awaiting_final_test { border-color: rgba(255,191,102,0.24); background: linear-gradient(135deg, rgba(255,191,102,0.12), rgba(255,191,102,0.04)); }
.course-chip.status-in_progress { border-color: rgba(86,167,255,0.20); }
.enrollment-item.danger { border-color: rgba(255,111,128,0.28); }

.details-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,0.02);
}
.details-box summary {
    cursor: pointer;
    padding: 16px 18px;
    font-weight: 700;
}
.details-content { padding: 0 16px 16px; }
.meta-row { margin: 12px 0; }
.note-box {
    margin-top: 24px;
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed var(--line-strong);
    background: rgba(255,255,255,0.03);
}

.status-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.status-legend .badge { margin: 0; }

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.05);
    color: var(--text);
}
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2,7,14,0.56);
    backdrop-filter: blur(3px);
    z-index: 19;
}

.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.align-end { align-items: end; }

@media (max-width: 1200px) {
    .grid-4,
    .compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split-layout { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }
    .main-panel {
        margin-left: 0;
        width: 100%;
    }
    .menu-toggle { display: inline-grid; place-items: center; }
    .overlay { display: block; opacity: 0; pointer-events: none; transition: opacity 0.18s ease; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .overlay { opacity: 1; pointer-events: auto; }
    .grid-3,
    .grid-2,
    .grid-4,
    .form-grid,
    .filter-grid,
    .compact-stats { grid-template-columns: 1fr; }
    .topbar,
    .content-area { padding-inline: 18px; }
}

@media (max-width: 640px) {
    .login-page { padding: 18px; }
    .login-frame,
    .content-area,
    .topbar,
    .stat-card,
    .summary-card,
    .card,
    .course-card,
    .side-panel,
    .main-workspace { padding: 18px; }
    .brand-logo-wrap--login {
        width: 104px;
    }
    .brand-block .brand-logo-wrap {
        width: 82px;
    }
    .login-brand { align-items: flex-start; }
}

.compact-grid {
    gap: 12px;
}

.wider-topic-table,
.table-progress-edit {
    min-width: 1400px;
}

.table-progress-edit input,
.table-progress-edit select {
    min-width: 110px;
}

.table-progress-edit td input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    border-radius: 5px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.10);
}

.table-progress-edit td input[type="checkbox"]::after {
    width: 5px;
    height: 9px;
    border-width: 0 2px 2px 0;
    margin-top: -1px;
}

.table-progress-edit td input[type="checkbox"]:checked {
    box-shadow: 0 0 0 2px rgba(86, 167, 255, 0.12);
}

.table-progress-edit th,
.table-progress-edit td,
.wider-topic-table th,
.wider-topic-table td {
    white-space: nowrap;
    vertical-align: top;
}

.table-progress-edit td:nth-child(3),
.wider-topic-table td:nth-child(3) {
    white-space: normal;
    min-width: 220px;
}

.chip.danger-outline,
.badge.danger-outline {
    border-color: rgba(255,111,128,0.28);
    background: rgba(255,111,128,0.10);
    color: #ffd5dc;
}

/* ==================================================
   Premium UI/UX Enhancement Layer
   ================================================== */
:root {
    --bg-deep: #040914;
    --bg-panel: rgba(7, 15, 27, 0.86);
    --bg-panel-2: rgba(12, 23, 39, 0.86);
    --glass: rgba(255,255,255,0.05);
    --glass-strong: rgba(255,255,255,0.09);
    --card-shadow: 0 26px 60px rgba(0,0,0,0.32);
    --card-highlight: inset 0 1px 0 rgba(255,255,255,0.05);
    --cyan-glow: 0 0 0 1px rgba(85, 190, 255, 0.18), 0 18px 40px rgba(18, 73, 125, 0.22);
}

html { scroll-behavior: smooth; }
body {
    position: relative;
    background:
        radial-gradient(circle at 8% 12%, rgba(50, 150, 255, 0.14), transparent 24%),
        radial-gradient(circle at 88% 16%, rgba(39, 213, 255, 0.12), transparent 18%),
        radial-gradient(circle at 72% 78%, rgba(0, 143, 204, 0.10), transparent 22%),
        linear-gradient(135deg, rgba(9, 18, 31, 0.98), rgba(4, 9, 18, 0.98)),
        linear-gradient(rgba(84, 125, 168, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(84, 125, 168, 0.07) 1px, transparent 1px);
    background-size: auto, auto, auto, auto, 34px 34px, 34px 34px;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 18%, transparent 82%, rgba(255,255,255,0.02));
    mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 42%, rgba(0,0,0,0.36) 100%);
}

.card,
.stat-card,
.summary-card,
.filter-card,
.form-card,
.course-card,
.side-panel,
.main-workspace,
.login-frame,
.sidebar-panel,
.status-card,
.inset-card,
.activity-item,
.quick-link,
.enrollment-item,
.course-chip,
.hero-feature {
    background: linear-gradient(180deg, rgba(13, 23, 38, 0.84), rgba(7, 14, 26, 0.88));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(110, 168, 238, 0.14);
    box-shadow: var(--card-shadow), var(--card-highlight);
}

.card,
.stat-card,
.summary-card,
.filter-card,
.form-card,
.course-card,
.side-panel,
.main-workspace {
    position: relative;
}
.card::before,
.stat-card::before,
.summary-card::before,
.filter-card::before,
.form-card::before,
.course-card::before,
.side-panel::before,
.main-workspace::before,
.sidebar-panel::before,
.inset-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(117, 198, 255, 0.28), rgba(255,255,255,0.04), rgba(46, 120, 255, 0.18));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0.65;
    pointer-events: none;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .55s ease, transform .55s ease;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

.sidebar [data-reveal] {
    opacity: 1;
    transform: none;
}

.login-shell {
    width: min(980px, 100%);
}
.login-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 28px;
    padding: 28px;
    border-radius: 28px;
}
.login-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    min-width: 0;
}
.login-panel {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(4, 11, 21, 0.7), rgba(8, 15, 29, 0.82));
    border: 1px solid rgba(140, 194, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.login-panel__header { margin-bottom: 18px; }
.hero-note {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(140, 194, 255, 0.14);
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}
.hero-note__line {
    width: 3px;
    min-height: 56px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
    box-shadow: 0 0 18px rgba(60,200,255,0.35);
}
.hero-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 0.96rem;
}
.input-shell {
    position: relative;
}
.input-shell input { padding-right: 74px; }
.input-shell__toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid rgba(125, 190, 255, 0.16);
    background: rgba(255,255,255,0.04);
    color: var(--muted);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: .18s ease;
}
.input-shell__toggle:hover {
    color: var(--text);
    border-color: rgba(125, 190, 255, 0.28);
    background: rgba(86, 167, 255, 0.12);
}

.sidebar {
    width: 308px;
    min-width: 308px;
    flex-shrink: 0;
    padding: 24px 20px;
    background: linear-gradient(180deg, rgba(4, 10, 19, 0.96), rgba(6, 12, 23, 0.96));
    box-shadow: 16px 0 40px rgba(0,0,0,0.2);
    overflow-x: hidden;
    transition: width .22s ease, min-width .22s ease, padding .22s ease;
}
.sidebar-brand-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.sidebar-pin {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(136, 194, 255, 0.16);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    cursor: pointer;
    transition: .18s ease;
}
.sidebar-pin--bottom {
    align-self: flex-end;
    margin-top: 2px;
}
.sidebar-pin:hover {
    transform: translateY(-1px);
    border-color: rgba(136, 194, 255, 0.34);
    background: rgba(86,167,255,0.12);
}
.brand-block h1 {
    margin: 6px 0 5px;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
}
.brand-block p { margin: 0; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    position: relative;
}
.nav-link__icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    line-height: 0;
    color: #cbe7ff;
    background: linear-gradient(135deg, rgba(86,167,255,0.18), rgba(60,200,255,0.08));
    border: 1px solid rgba(123, 189, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.nav-link__icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-link__row { flex: 1; min-width: 0; overflow: visible; white-space: nowrap; }
.nav-link.active { box-shadow: var(--cyan-glow); }
.nav-link.active .nav-link__icon,
.nav-link:hover .nav-link__icon {
    background: linear-gradient(135deg, rgba(86,167,255,0.28), rgba(60,200,255,0.14));
    border-color: rgba(123, 189, 255, 0.28);
}
.main-panel {
    margin-left: 308px;
    width: calc(100% - 308px);
    transition: margin-left .22s ease, width .22s ease;
}

body:not(.sidebar-compact) .brand-block > div:not(.brand-logo-wrap),
body:not(.sidebar-compact) .sidebar-panel,
body:not(.sidebar-compact) .nav-link__row,
body:not(.sidebar-compact) .status-card > div:first-child,
body:not(.sidebar-compact) .sidebar__bottom .btn {
    display: initial !important;
    opacity: 1 !important;
    visibility: visible !important;
}
body:not(.sidebar-compact) .nav-link__row {
    display: flex !important;
    width: auto !important;
}
body:not(.sidebar-compact) .nav-link {
    justify-content: flex-start;
}
body:not(.sidebar-compact) .brand-block {
    min-width: 0;
}
body.sidebar-compact .sidebar {
    width: 104px;
    min-width: 104px;
    padding-inline: 12px;
}
body.sidebar-compact .main-panel {
    margin-left: 104px;
    width: calc(100% - 104px);
}
body.sidebar-compact .brand-block > div:not(.brand-logo-wrap),
body.sidebar-compact .sidebar-panel,
body.sidebar-compact .nav-link__row,
body.sidebar-compact .status-card > div:first-child,
body.sidebar-compact .sidebar__bottom .btn {
    display: none !important;
}
body.sidebar-compact .sidebar-brand-row { justify-content: center; }
body.sidebar-compact .nav-link {
    justify-content: center;
    padding-inline: 10px;
    width: 100%;
}
body.sidebar-compact .sidebar__bottom {
    align-items: stretch;
}
body.sidebar-compact .sidebar-pin--bottom {
    align-self: center;
}
body.sidebar-compact .status-card {
    padding: 12px;
    justify-content: center;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    padding: 22px 28px 0;
    background: linear-gradient(180deg, rgba(4, 10, 18, 0.84), rgba(4, 10, 18, 0.24), transparent);
    backdrop-filter: blur(6px);
}
.breadcrumb-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.breadcrumb-separator,
.breadcrumb-current {
    color: rgba(201, 220, 245, 0.62);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.topbar h2 { font-size: clamp(1.55rem, 1.2rem + 1vw, 2.1rem); }
.topbar p { max-width: 760px; line-height: 1.65; }
.topbar__right { display: flex; gap: 12px; flex-wrap: wrap; }
.topbar-chip {
    min-width: 180px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.topbar-chip--time strong { letter-spacing: 0.03em; }
.content-area {
    padding: 26px 28px 34px;
}
.page-header,
.section-header {
    margin-bottom: 18px;
}
.page-header h3,
.section-header h3 {
    font-size: 1.28rem;
    letter-spacing: 0.01em;
}
.page-header p,
.section-header p { max-width: 760px; line-height: 1.65; }
.stat-card,
.summary-card {
    overflow: hidden;
}
.stat-card::after,
.summary-card::after {
    content: "";
    position: absolute;
    inset: auto -10% -42% auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(86,167,255,0.24), transparent 68%);
}
.stat-card strong,
.summary-card strong {
    font-size: clamp(1.9rem, 1.3rem + 1vw, 2.4rem);
}
.stat-card:hover,
.summary-card:hover,
.course-chip:hover,
.quick-link:hover,
.activity-item:hover,
.hero-note:hover,
.enrollment-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.05);
}
.quick-link,
.activity-item,
.course-chip,
.enrollment-item,
.hero-note,
.sidebar-panel,
.status-card,
.inset-card,
.stat-card,
.summary-card,
.filter-card,
.form-card,
.side-panel,
.main-workspace,
.course-card {
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.quick-link {
    position: relative;
    overflow: hidden;
}
.quick-link::after {
    content: "→";
    margin-left: auto;
    color: rgba(197, 223, 255, 0.72);
}
.form-group {
    gap: 9px;
}
label {
    color: #dce7f8;
    letter-spacing: 0.01em;
}
input,
textarea,
select {
    min-height: 48px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(3, 10, 19, 0.94), rgba(6, 12, 22, 0.92));
    border-color: rgba(131, 176, 227, 0.13);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
textarea { min-height: 132px; }

select,
option,
optgroup {
    color: var(--text);
}

select option,
select optgroup {
    background: #09131f;
    color: #e8f2ff;
}

select option:hover,
select option:focus,
select option:checked,
select option[selected] {
    background: #2b6fcc;
    color: #ffffff;
}

input::placeholder,
textarea::placeholder { color: rgba(156, 176, 203, 0.7); }
input:focus,
textarea:focus,
select:focus {
    border-color: rgba(116, 194, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(86, 167, 255, 0.12), 0 10px 24px rgba(14, 53, 91, 0.24);
}
input[disabled],
textarea[disabled],
select[disabled],
input[readonly] {
    opacity: 0.85;
    cursor: not-allowed;
}
.btn {
    min-height: 46px;
    border-radius: 14px;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 24px rgba(0,0,0,0.16);
}
.btn-primary {
    box-shadow: 0 16px 30px rgba(45, 124, 204, 0.3);
}
.btn-primary:hover,
.btn-outline:hover,
.btn-secondary:hover,
.btn-danger:hover {
    transform: translateY(-2px);
}
.btn-outline:hover {
    background: rgba(86,167,255,0.09);
}
.alert {
    position: relative;
    overflow: hidden;
}
.alert::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: 0.7;
}
.table-wrap {
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
}
.table {
    min-width: 820px;
}
.table th {
    background: rgba(8, 16, 29, 0.98);
    backdrop-filter: blur(4px);
}
.table td,
.table th { padding: 15px 16px; }
.table tbody tr {
    transition: background .18s ease, transform .18s ease;
}
.table tbody tr:hover td {
    background: rgba(86, 167, 255, 0.055);
}
.table td strong { color: #f3f7ff; }
.badge,
.chip {
    min-height: 31px;
    border-radius: 999px;
    letter-spacing: 0.03em;
}
.progress-track {
    background: rgba(255,255,255,0.05);
}
.progress-fill {
    position: relative;
}
.progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    animation: progressShimmer 2.8s linear infinite;
}
@keyframes progressShimmer {
    to { transform: translateX(100%); }
}
.details-box {
    overflow: hidden;
}
.details-box summary {
    list-style: none;
    position: relative;
}
.details-box summary::-webkit-details-marker { display: none; }
.details-box summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.2rem;
}
.details-box[open] summary::after { content: "−"; }
.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.012));
}
.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px 28px;
    color: rgba(188, 208, 232, 0.76);
}
.app-footer strong {
    display: block;
    margin-top: 4px;
    color: #eef5ff;
}
.app-footer__meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}
.small-gap { gap: 8px; }
.stack-gap-sm { display: flex; flex-direction: column; gap: 10px; }
.help-text { font-size: 0.88rem; }
.mb-16 { margin-bottom: 16px; }
.course-card .section-header,
.main-workspace .section-header,
.side-panel .section-header,
.form-card .section-header { margin-bottom: 16px; }
.main-workspace,
.side-panel { min-width: 0; }
.filter-card form,
.form-card form,
.card form {
    min-width: 0;
}

@media (max-width: 1200px) {
    .login-frame {
        grid-template-columns: 1fr;
    }
    .hero-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 980px) {
    .sidebar-pin { display: none; }
    .topbar__right { width: 100%; }
    .topbar-chip { flex: 1; }

    body.sidebar-compact .sidebar {
        width: 104px;
        min-width: 104px;
        padding-inline: 12px;
    }
    body.sidebar-compact .main-panel {
        margin-left: 104px;
        width: calc(100% - 104px);
    }
    body.sidebar-compact .brand-block > div:not(.brand-logo-wrap),
    body.sidebar-compact .sidebar-panel,
    body.sidebar-compact .nav-link__row,
    body.sidebar-compact .status-card > div:first-child,
    body.sidebar-compact .sidebar__bottom .btn {
        display: none !important;
    }
    body.sidebar-compact .sidebar-brand-row {
        justify-content: center;
    }
    body.sidebar-compact .sidebar-pin--bottom {
        align-self: center;
    }
    body.sidebar-compact .status-card {
        justify-content: center;
    }
}
@media (max-width: 640px) {
    .login-frame {
        padding: 18px;
        gap: 18px;
        border-radius: 22px;
    }
    .login-panel { padding: 18px; }
    .app-footer,
    .content-area,
    .topbar { padding-inline: 18px; }
    .app-footer {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 20px;
    }
    .topbar-chip { min-width: 100%; }
    .breadcrumb-line { gap: 6px; }
}



.audit-results-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.audit-log-fallback {
    margin: -4px 0 2px;
}
.audit-log-stack {
    display: grid;
    gap: 14px;
}
.audit-log-item {
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(110, 168, 238, 0.16);
    background: linear-gradient(180deg, rgba(14, 25, 40, 0.92), rgba(8, 15, 27, 0.96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.audit-log-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.audit-log-item__time {
    color: #b7c9e3;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.audit-log-item__action {
    color: #f5f9ff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}
.audit-log-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
}
.audit-log-item__meta strong {
    color: var(--text);
}
.audit-log-item__details {
    margin: 0;
    color: #dfeaf9;
    line-height: 1.65;
    white-space: pre-wrap;
}
.audit-log-table-wrap {
    margin-top: 6px;
}

.audit-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.audit-log-table {
    min-width: 980px;
}
.audit-log-table td {
    color: var(--text);
}
.audit-log-table td .muted {
    color: var(--muted);
}
.audit-log-table .empty-row {
    padding: 34px 20px;
    color: #dbe8ff;
}
@media (max-width: 1200px) {
    .audit-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 720px) {
    .audit-filter-grid {
        grid-template-columns: 1fr;
    }
}


.audit-results-card,
.audit-results-card[data-reveal],
.audit-results-card .audit-log-stack,
.audit-results-card .audit-log-stack[data-reveal],
.audit-results-card .audit-log-table-wrap,
.audit-results-card .audit-log-table-wrap[data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* Freeze upgrade additions */
.cell-pre {
    margin: 0;
    white-space: pre-wrap;
    font: inherit;
}

.compact-grid {
    gap: 10px;
}

.badge.secondary {
    background: rgba(156, 163, 175, 0.16);
    color: #d1d5db;
    border: 1px solid rgba(209, 213, 219, 0.18);
}

@media (min-width: 1100px) and (max-width: 1440px) {
    .main-panel {
        min-width: 0;
    }

    .filter-grid,
    .form-grid,
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid.grid-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table.table-wide,
    .table-progress-edit,
    .table-topic-sequence {
        min-width: 1100px;
    }

    .btn-row {
        flex-wrap: wrap;
    }
}

@media (min-width: 1441px) {
    .table.table-wide,
    .table-progress-edit,
    .table-topic-sequence {
        min-width: 100%;
    }
}

/* ===== UI spacing & desktop responsiveness refinement pass ===== */
:root {
    --panel-space: clamp(20px, 1.6vw, 28px);
    --panel-space-tight: clamp(16px, 1.2vw, 22px);
    --panel-gap: clamp(14px, 1.2vw, 20px);
}

.card,
.filter-card,
.form-card,
.course-card,
.side-panel,
.main-workspace,
.stat-card,
.summary-card,
.inset-card,
.audit-results-card {
    padding: var(--panel-space);
}

.card,
.filter-card,
.form-card,
.course-card,
.side-panel,
.main-workspace,
.inset-card,
.audit-results-card,
.table-wrap,
.activity-item,
.quick-link,
.enrollment-item,
.course-chip,
.audit-log-item {
    min-width: 0;
}

.page-header,
.section-header {
    margin-bottom: var(--panel-gap);
    gap: 16px 18px;
}

.page-header > div:first-child,
.section-header > div:first-child {
    flex: 1 1 340px;
    min-width: 0;
}

.page-header h3,
.section-header h3,
.topbar h2,
.audit-log-item__action,
.quick-link,
.activity-item strong,
.enrollment-item strong {
    line-height: 1.24;
    overflow-wrap: anywhere;
    word-break: normal;
}

.page-header p,
.section-header p,
.topbar p,
.audit-log-item__details,
.activity-item p,
.activity-item small {
    margin: 8px 0 0;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.page-header .btn,
.section-header .btn,
.page-header .btn-row,
.section-header .btn-row {
    align-self: flex-start;
}

.table-wrap {
    margin-top: 6px;
    max-width: 100%;
}

.table th,
.table td {
    padding: 16px 18px;
}

.table td,
.table th,
.quick-link,
.activity-item,
.enrollment-item,
.audit-log-item,
.cell-pre {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.status-legend {
    margin-top: 12px;
    gap: 12px;
}

.status-legend .badge,
.status-legend .chip {
    margin: 0;
}

.quick-link-list,
.activity-feed,
.enrollment-list,
.audit-log-stack,
.stack-list,
.stack-gap-sm,
.action-row {
    gap: 14px;
}

.side-panel form,
.filter-card form,
.form-card form,
.card > form {
    display: grid;
    gap: var(--panel-gap);
}

.side-panel form + .enrollment-list,
.filter-card form + .table-wrap,
.filter-card form + .stack-list,
.filter-card form + .audit-log-stack,
.card form + .table-wrap,
.card form + .stack-list,
.card form + .audit-log-stack {
    margin-top: 18px;
}

.btn-row {
    gap: 12px;
}

.btn-row.align-end {
    margin-top: 4px;
}

.quick-link,
.activity-item,
.enrollment-item,
.course-chip,
.audit-log-item,
.note-box,
.details-content,
.alert,
.empty-state {
    padding: var(--panel-space-tight);
}

.card > .empty-state:first-child,
.side-panel > .empty-state:first-child,
.main-workspace > .empty-state:first-child {
    border: 1px dashed rgba(110, 168, 238, 0.16);
    border-radius: 18px;
    background: rgba(255,255,255,0.025);
}

.meta-row,
.help-text,
.note-box,
.details-box,
.audit-log-table-wrap,
.audit-log-fallback {
    margin-top: 14px;
}

.app-footer {
    gap: 18px;
}

@media (max-width: 1600px) {
    .grid-4,
    .dashboard-grid.grid-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1366px) {
    .topbar,
    .content-area {
        padding-inline: 22px;
    }

    .grid-4,
    .dashboard-grid.grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .table-wide,
    .audit-log-table,
    .wider-topic-table,
    .table-progress-edit {
        min-width: 1100px;
    }
}

@media (max-width: 1180px) {
    .topbar,
    .content-area {
        padding-inline: 18px;
    }

    .card,
    .filter-card,
    .form-card,
    .course-card,
    .side-panel,
    .main-workspace,
    .stat-card,
    .summary-card,
    .inset-card,
    .audit-results-card {
        padding: 20px;
    }
}

@media (max-width: 1024px) {
    .grid-4,
    .dashboard-grid.grid-4,
    .grid-3,
    .grid-2,
    .filter-grid,
    .form-grid,
    .compact-stats {
        grid-template-columns: 1fr;
    }

    .section-header,
    .page-header {
        align-items: flex-start;
    }
}


/* =====================================================
   Light Futuristic Theme Override
   Same layout / functionality, premium white-blue palette
   ===================================================== */
:root {
    --bg-1: #f5f8fd;
    --bg-2: #edf3fb;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-2: rgba(246, 250, 255, 0.92);
    --surface-3: rgba(255, 255, 255, 0.72);
    --line: rgba(159, 184, 214, 0.38);
    --line-strong: rgba(92, 152, 219, 0.52);
    --text: #19314d;
    --muted: #64809d;
    --primary: #4f9dff;
    --primary-2: #7cc9ff;
    --frozen: #7b77ff;
    --success: #2bbf96;
    --warning: #d39a3e;
    --danger: #e46d86;
    --shadow: 0 18px 48px rgba(137, 165, 196, 0.18);
}

body {
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(126, 196, 255, 0.24), transparent 26%),
        radial-gradient(circle at left bottom, rgba(177, 211, 255, 0.22), transparent 24%),
        linear-gradient(180deg, rgba(250, 252, 255, 0.98), rgba(239, 245, 252, 0.98)),
        linear-gradient(rgba(175, 196, 220, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(175, 196, 220, 0.14) 1px, transparent 1px);
    background-size: auto, auto, auto, 34px 34px, 34px 34px;
}

.card,
.stat-card,
.summary-card,
.filter-card,
.form-card,
.course-card,
.side-panel,
.main-workspace,
.sidebar-panel,
.inset-card,
.status-card,
.hero-feature,
.activity-item,
.quick-link,
.enrollment-item,
.course-chip,
.audit-results-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(247,250,255,0.82));
    border: 1px solid rgba(162, 186, 217, 0.34);
    box-shadow: 0 12px 34px rgba(145, 170, 200, 0.14);
    backdrop-filter: blur(14px);
}

.sidebar {
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(238, 245, 252, 0.98));
    border-right: 1px solid rgba(162, 186, 217, 0.38);
    box-shadow: 8px 0 30px rgba(160, 181, 208, 0.12);
}

.brand-block p,
.login-brand p,
.login-footer-note,
.help-text,
.muted,
.page-header p,
.section-header p,
.topbar p,
.activity-item small,
.quick-link span,
.hero-feature span,
.course-chip span,
.brand-block .eyebrow,
.eyebrow {
    color: var(--muted);
}

.nav-link {
    color: #4c6887;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, rgba(96, 164, 237, 0.16), rgba(144, 206, 255, 0.18));
    border-color: rgba(92, 152, 219, 0.38);
    color: #0f325d;
    box-shadow: 0 10px 22px rgba(111, 161, 220, 0.14);
}

.topbar-chip,
.menu-toggle,
.details-box,
.note-box,
.table-wrap,
.audit-log-table-wrap,
.audit-log-fallback {
    background: rgba(255,255,255,0.72);
    border-color: rgba(162, 186, 217, 0.34);
    box-shadow: 0 10px 26px rgba(150, 174, 202, 0.12);
}

input,
textarea,
select {
    background: rgba(255,255,255,0.96);
    color: var(--text);
    border: 1px solid rgba(161, 185, 214, 0.42);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(136, 160, 190, 0.06);
}

input::placeholder,
textarea::placeholder {
    color: #8aa0b9;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(92, 152, 219, 0.52);
    box-shadow: 0 0 0 4px rgba(95, 162, 234, 0.14), 0 8px 22px rgba(137, 176, 223, 0.12);
}

select option {
    color: #19314d;
    background: #ffffff;
}

.btn {
    box-shadow: 0 10px 22px rgba(153, 178, 208, 0.14);
}

.btn-primary {
    background: linear-gradient(135deg, #4f9dff, #8ad4ff);
    color: #ffffff;
    border-color: rgba(79, 157, 255, 0.22);
}

.btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(244,248,253,0.96));
    border-color: rgba(162, 186, 217, 0.38);
    color: var(--text);
}

.btn-outline {
    background: rgba(255,255,255,0.74);
    border-color: rgba(92, 152, 219, 0.42);
    color: #23466e;
}

.btn-danger {
    background: linear-gradient(180deg, rgba(255,239,242,0.95), rgba(255,245,247,0.98));
    border-color: rgba(228,109,134,0.32);
    color: #b14d67;
}

.alert {
    background: rgba(255,255,255,0.76);
    color: var(--text);
}
.alert.success { background: rgba(237, 250, 246, 0.96); border-color: rgba(43,191,150,0.24); }
.alert.error { background: rgba(255, 242, 245, 0.96); border-color: rgba(228,109,134,0.24); }
.alert.info { background: rgba(239, 247, 255, 0.96); border-color: rgba(79,157,255,0.24); }

.table-wrap {
    background: rgba(255,255,255,0.72);
}

.table th,
.audit-log-table th {
    color: #607d9a;
    background: linear-gradient(180deg, rgba(247,250,255,0.96), rgba(241,246,252,0.98));
    border-bottom: 1px solid rgba(162, 186, 217, 0.34);
}

.table td,
.table th,
.audit-log-table td,
.audit-log-table th {
    border-bottom-color: rgba(180, 199, 223, 0.28);
}

.table tr:hover td,
.audit-log-table tbody tr:hover td {
    background: rgba(101, 164, 236, 0.06);
}

.row-danger td { background: rgba(228,109,134,0.09); }
.row-glow td { background: rgba(211,154,62,0.08); }
.row-frozen td { background: rgba(123,119,255,0.10); }
.row-exceeded td { background: rgba(211,154,62,0.10); }
.row-completed td { background: rgba(43,191,150,0.08); }
.row-progress td { background: rgba(79,157,255,0.055); }

.progress-track {
    background: rgba(212, 224, 239, 0.5);
    border-color: rgba(188, 205, 226, 0.42);
}
.progress-fill {
    box-shadow: 0 0 18px rgba(79,157,255,0.22);
}
.progress-fill.danger {
    box-shadow: 0 0 18px rgba(228,109,134,0.2);
}

.badge,
.chip {
    color: #29476a;
    background: rgba(255,255,255,0.88);
    border-color: rgba(172, 193, 219, 0.34);
}
.badge.success { background: rgba(235,249,244,0.96); border-color: rgba(43,191,150,0.22); color: #188064; }
.badge.warning { background: rgba(255,248,236,0.96); border-color: rgba(211,154,62,0.24); color: #9a6922; }
.badge.danger { background: rgba(255,242,246,0.96); border-color: rgba(228,109,134,0.24); color: #b14d67; }
.badge.info { background: rgba(239,247,255,0.96); border-color: rgba(79,157,255,0.22); color: #2c6bb5; }
.badge.frozen { background: rgba(241,239,255,0.96); border-color: rgba(123,119,255,0.28); color: #5c56df; }
.badge.exceeded { background: rgba(255,248,236,0.96); border-color: rgba(211,154,62,0.28); color: #9a6922; }
.badge.secondary,
.badge.muted,
.chip { background: rgba(247,250,255,0.96); border-color: rgba(172,193,219,0.28); color: #516d8a; }

.course-chip:hover,
.course-chip.active,
.enrollment-item.active,
.quick-link:hover {
    border-color: rgba(92, 152, 219, 0.42);
    background: linear-gradient(135deg, rgba(231, 243, 255, 0.92), rgba(246, 250, 255, 0.96));
    box-shadow: 0 12px 24px rgba(143, 172, 204, 0.16);
}
.course-chip.status-frozen { border-color: rgba(123,119,255,0.24); background: linear-gradient(135deg, rgba(241,239,255,0.96), rgba(249,248,255,0.96)); }
.course-chip.status-delayed { border-color: rgba(228,109,134,0.22); background: linear-gradient(135deg, rgba(255,244,247,0.96), rgba(255,250,251,0.96)); }
.course-chip.status-exceeded,
.course-chip.status-awaiting_final_test { border-color: rgba(211,154,62,0.22); background: linear-gradient(135deg, rgba(255,248,238,0.96), rgba(255,252,246,0.96)); }
.course-chip.status-completed { border-color: rgba(43,191,150,0.22); background: linear-gradient(135deg, rgba(237,250,245,0.96), rgba(248,253,251,0.96)); }
.course-chip.status-in_progress { border-color: rgba(79,157,255,0.22); }

.note-box,
.details-box,
.details-content,
.card > .empty-state:first-child,
.side-panel > .empty-state:first-child,
.main-workspace > .empty-state:first-child {
    background: rgba(250,252,255,0.82);
    border-color: rgba(162, 186, 217, 0.32);
}

.menu-toggle,
.topbar-chip strong,
.page-header h3,
.section-header h3,
.topbar h2,
.login-brand h1,
.brand-block h1,
.table,
.table td,
.table th,
label,
.quick-link,
.activity-item,
.details-box summary,
.stat-card strong,
.summary-card strong,
.audit-log-item,
.audit-log-fallback,
.audit-log-table {
    color: var(--text);
}

.status-dot {
    box-shadow: 0 0 14px rgba(43,191,150,0.35);
}

.login-page::before {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.58), rgba(241,246,252,0.72)),
        linear-gradient(90deg, rgba(255,255,255,0.18), rgba(238,245,252,0.12)),
        url('../img/login-wallpaper-light.jpg') center center / cover no-repeat;
}

.login-page::after {
    background:
        radial-gradient(circle at 18% 38%, rgba(122, 196, 255, 0.18), transparent 22%),
        linear-gradient(rgba(182, 201, 224, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(182, 201, 224, 0.16) 1px, transparent 1px);
    background-size: auto, 34px 34px, 34px 34px;
}

.login-frame {
    background: linear-gradient(180deg, rgba(255,255,255,0.52), rgba(247,250,255,0.64));
    border: 1px solid rgba(184, 201, 224, 0.42);
    box-shadow: 0 20px 52px rgba(146, 170, 199, 0.22);
    backdrop-filter: blur(18px);
}

.login-panel,
.login-panel__header,
.hero-note {
    color: var(--text);
}

.hero-note__line {
    background: linear-gradient(90deg, rgba(79,157,255,0.0), rgba(79,157,255,0.45), rgba(79,157,255,0.0));
}

.input-shell {
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(161, 185, 214, 0.42);
}
.input-shell__toggle {
    color: #4f6d8c;
}

.login-page .btn-primary,
.login-page .input-shell,
.login-page input {
    box-shadow: 0 12px 28px rgba(144, 171, 203, 0.14);
}

.app-footer,
.app-footer * {
    color: #64809d;
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}
::-webkit-scrollbar-track {
    background: rgba(230, 238, 248, 0.78);
}
::-webkit-scrollbar-thumb {
    background: rgba(141, 170, 204, 0.72);
    border-radius: 999px;
    border: 2px solid rgba(230, 238, 248, 0.9);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 145, 188, 0.9);
}

/* =====================================================
   V8 Premium Bluish-White Futuristic Refinement Pass
   Stronger blue identity, better contrast, no washed-out text
   ===================================================== */
:root {
    --bg-1: #edf5ff;
    --bg-2: #e5f0fc;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-2: rgba(246, 250, 255, 0.92);
    --surface-3: rgba(233, 243, 255, 0.76);
    --line: rgba(136, 170, 212, 0.42);
    --line-strong: rgba(67, 139, 228, 0.58);
    --text: #183a5a;
    --muted: #5e7c99;
    --primary: #348dff;
    --primary-2: #7dd4ff;
    --frozen: #726dff;
    --success: #20b98c;
    --warning: #c88a29;
    --danger: #d85f79;
    --shadow: 0 18px 42px rgba(110, 145, 188, 0.14), 0 4px 14px rgba(128, 163, 204, 0.12);
    --cyan-glow: 0 0 0 1px rgba(76, 166, 255, 0.18), 0 16px 32px rgba(82, 144, 216, 0.18);
}

body {
    background:
        radial-gradient(circle at 12% 12%, rgba(132, 201, 255, 0.30), transparent 22%),
        radial-gradient(circle at 86% 18%, rgba(164, 214, 255, 0.26), transparent 24%),
        radial-gradient(circle at 20% 88%, rgba(149, 198, 255, 0.18), transparent 24%),
        linear-gradient(180deg, rgba(249, 252, 255, 0.99), rgba(236, 244, 252, 0.99)),
        linear-gradient(rgba(173, 195, 220, 0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(173, 195, 220, 0.16) 1px, transparent 1px);
    background-size: auto, auto, auto, auto, 34px 34px, 34px 34px;
}

.card,
.stat-card,
.summary-card,
.filter-card,
.form-card,
.course-card,
.side-panel,
.main-workspace,
.sidebar-panel,
.inset-card,
.status-card,
.hero-feature,
.activity-item,
.quick-link,
.enrollment-item,
.course-chip,
.audit-results-card,
.table-wrap,
.details-box,
.note-box,
.hero-note,
.topbar-chip,
.audit-log-table-wrap,
.audit-log-fallback {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(243, 249, 255, 0.84));
    border: 1px solid rgba(143, 176, 214, 0.42);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(235, 243, 252, 0.99)),
        radial-gradient(circle at 20% 0%, rgba(143, 201, 255, 0.16), transparent 24%);
    border-right: 1px solid rgba(140, 173, 210, 0.40);
    box-shadow: 10px 0 36px rgba(126, 155, 191, 0.16);
}

.brand-logo-wrap {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,249,255,0.96));
    box-shadow: 0 14px 30px rgba(118, 150, 190, 0.20);
    border: 1px solid rgba(176, 198, 225, 0.52);
}

.brand-block h1,
.login-brand h1,
.topbar h2,
.page-header h3,
.section-header h3,
.table td strong,
.audit-log-item__action,
.audit-log-item__meta strong,
.quick-link,
.activity-item strong,
.enrollment-item strong,
.sidebar-panel strong,
.status-card strong,
.hero-note strong {
    color: #17395e !important;
    font-weight: 800;
}

.eyebrow,
.brand-block .eyebrow,
.audit-log-item__time,
.table th,
.audit-log-table th,
.page-header p,
.section-header p,
.topbar p,
.brand-block p,
.login-brand p,
.login-footer-note,
.help-text,
.muted,
.table td .muted,
.audit-log-item__meta,
.audit-log-item__details,
.activity-item p,
.activity-item small,
.quick-link span,
.hero-feature span,
.course-chip span,
.hero-note p,
label,
.app-footer,
.app-footer * {
    color: #5e7c99 !important;
}

.page-header h3,
.section-header h3,
.topbar h2,
.login-brand h1 {
    text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

.table td,
.audit-log-table td,
.quick-link,
.activity-item,
.enrollment-item,
label,
input,
textarea,
select {
    color: #224364;
}

.table-wrap {
    background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(244,249,255,0.82));
    border: 1px solid rgba(152, 182, 218, 0.36);
}

.table th,
.audit-log-table th {
    color: #577695 !important;
    background: linear-gradient(180deg, rgba(234, 243, 253, 0.96), rgba(245, 249, 255, 0.98));
}

.table tbody td,
.audit-log-table tbody td {
    background: rgba(255,255,255,0.36);
}

.table tbody tr:hover td,
.audit-log-table tbody tr:hover td {
    background: rgba(78, 152, 235, 0.10);
}

.nav-link {
    color: #4e6d8d;
}

.nav-link__icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    color: #2f6fb1;
    background: linear-gradient(180deg, rgba(244, 249, 255, 0.98), rgba(222, 237, 255, 0.98));
    border: 1px solid rgba(135, 176, 223, 0.42);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 8px 20px rgba(127, 162, 202, 0.18);
}

.nav-link__icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.25;
}

.nav-link__row > span:first-child {
    font-weight: 700;
    color: #39597a;
}

.nav-link:hover,
.nav-link.active {
    color: #163d6a;
    background: linear-gradient(135deg, rgba(199, 226, 255, 0.42), rgba(236, 246, 255, 0.84));
    border-color: rgba(83, 145, 220, 0.42);
    box-shadow: 0 12px 24px rgba(126, 163, 205, 0.18);
}

.nav-link:hover .nav-link__icon,
.nav-link.active .nav-link__icon {
    color: #1a5ea8;
    background: linear-gradient(180deg, rgba(225, 239, 255, 0.98), rgba(203, 228, 255, 0.98));
    border-color: rgba(81, 146, 222, 0.42);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 10px 22px rgba(101, 145, 197, 0.22);
}

.topbar-chip {
    background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(240,247,255,0.86));
    border: 1px solid rgba(145, 176, 212, 0.42);
}

.sidebar-panel,
.status-card,
.quick-link,
.activity-item,
.course-chip,
.enrollment-item,
.hero-feature {
    background: linear-gradient(180deg, rgba(250,252,255,0.88), rgba(239,246,255,0.82));
}

input,
textarea,
select,
.input-shell {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,255,0.96));
    color: #17395e;
    border: 1px solid rgba(147, 178, 214, 0.44);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 1px 2px rgba(136, 160, 190, 0.08);
}

input::placeholder,
textarea::placeholder {
    color: #7b95b2;
}

input:focus,
textarea:focus,
select:focus,
.input-shell:focus-within {
    border-color: rgba(58, 137, 228, 0.56) !important;
    box-shadow: 0 0 0 4px rgba(72, 145, 229, 0.12), 0 14px 28px rgba(118, 161, 214, 0.12) !important;
}

select,
select option,
input[type="date"] {
    color: #17395e;
}

.btn {
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, #3794ff, #7dd7ff);
    border-color: rgba(55, 148, 255, 0.24);
    box-shadow: 0 14px 26px rgba(92, 153, 224, 0.18);
}

.btn-outline,
.btn-secondary {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(242,248,255,0.98));
    border-color: rgba(146, 178, 214, 0.42);
    color: #20466e;
}

.btn-danger {
    color: #b34e67;
}

.badge,
.chip {
    color: #365879;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,249,255,0.98));
    border-color: rgba(159, 186, 219, 0.36);
}

.badge.secondary,
.badge.muted,
.chip {
    color: #486987;
}

.audit-results-card,
.audit-results-card .audit-log-stack,
.audit-results-card .audit-log-table-wrap,
.audit-log-fallback {
    background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(245,249,255,0.86));
}

.audit-log-item {
    background: linear-gradient(135deg, rgba(231, 242, 255, 0.96), rgba(248, 252, 255, 0.98)) !important;
    border: 1px solid rgba(132, 175, 223, 0.40) !important;
    box-shadow: 0 14px 28px rgba(122, 155, 193, 0.14), inset 0 1px 0 rgba(255,255,255,0.94) !important;
}

.audit-log-item__action {
    color: #17395e !important;
}

.audit-log-item__time,
.audit-log-item__meta,
.audit-log-item__details,
.audit-log-table td .muted {
    color: #5c7895 !important;
}

.audit-log-item__details {
    font-weight: 500;
}

.role-chip,
.audit-log-item .badge,
.audit-results-card .badge {
    background: rgba(255,255,255,0.92);
}

.login-page::before {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.56), rgba(236,244,252,0.70)),
        radial-gradient(circle at 18% 34%, rgba(133, 202, 255, 0.22), transparent 18%),
        url('../img/login-wallpaper-light.jpg') center center / cover no-repeat;
}

.login-page::after {
    background:
        radial-gradient(circle at 18% 38%, rgba(103, 186, 255, 0.18), transparent 22%),
        linear-gradient(rgba(182, 201, 224, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(182, 201, 224, 0.18) 1px, transparent 1px);
    background-size: auto, 34px 34px, 34px 34px;
}

.login-frame {
    background: linear-gradient(180deg, rgba(255,255,255,0.66), rgba(243,248,255,0.72));
    border: 1px solid rgba(180, 202, 228, 0.46);
    box-shadow: 0 26px 60px rgba(132, 164, 203, 0.18);
}

.login-panel {
    background: linear-gradient(180deg, rgba(239, 247, 255, 0.92), rgba(228, 238, 250, 0.94)) !important;
    border: 1px solid rgba(144, 176, 213, 0.44) !important;
    box-shadow: 0 18px 34px rgba(130, 162, 199, 0.16), inset 0 1px 0 rgba(255,255,255,0.94) !important;
}

.login-panel,
.login-panel__header,
.login-panel label,
.login-panel p,
.login-panel small,
.login-panel .eyebrow,
.login-panel .muted,
.login-page .hero-note,
.login-page .hero-note p,
.login-page .hero-note strong {
    color: #234362 !important;
}

.login-page input,
.login-page textarea,
.login-page select,
.login-page .input-shell {
    background: rgba(255,255,255,0.98) !important;
    border-color: rgba(145, 176, 213, 0.46) !important;
    color: #17395e !important;
}

.login-page .input-shell__toggle {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(242,247,255,0.98));
    border-color: rgba(145, 176, 213, 0.42);
    color: #40617f;
}

.login-page .btn-primary {
    background: linear-gradient(135deg, #3b95ff, #7ed3ff) !important;
}

.login-page label,
.login-page .eyebrow,
.login-page .muted,
.login-page input::placeholder,
.login-page textarea::placeholder {
    color: #64809d !important;
}

.sidebar .btn-outline,
.sidebar-pin {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(241,247,255,0.98));
    border-color: rgba(143, 176, 214, 0.44);
    color: #20466e;
}

.sidebar .btn-outline:hover,
.sidebar-pin:hover {
    background: linear-gradient(180deg, rgba(238,247,255,0.98), rgba(225,239,255,0.98));
}

.hero-feature,
.stat-card,
.summary-card {
    position: relative;
    overflow: hidden;
}

.hero-feature::after,
.stat-card::after,
.summary-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -34% auto;
    width: 42%;
    height: 56%;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(120, 191, 255, 0.24), rgba(120, 191, 255, 0.02) 70%);
    pointer-events: none;
}

.table td strong,
.quick-link strong,
.activity-item strong,
.enrollment-item strong,
.course-chip strong,
.sidebar-panel strong {
    letter-spacing: 0.01em;
}

.table td .muted,
.audit-log-table td .muted,
.brand-block p,
.page-header p,
.section-header p,
.topbar p,
.login-brand p,
.hero-note p {
    font-weight: 500;
}

.content-area,
.topbar {
    background: transparent;
}

@media (max-width: 1366px) {
    .nav-link__icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .nav-link__icon svg {
        width: 21px;
        height: 21px;
    }
}

/* ===== V9: Strong global status color system ===== */
.status-legend .badge,
.status-legend .chip,
.table .badge,
.card .badge,
.side-panel .badge,
.main-workspace .badge,
.freeze-grid .badge,
.audit-results-card .badge,
.student-freeze-panel .badge {
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 8px 18px rgba(112, 145, 182, 0.10);
}

.badge.success,
.badge.status-completed,
.course-chip.status-completed {
    color: #0b7b58 !important;
    background: linear-gradient(180deg, rgba(226, 251, 242, 0.98), rgba(242, 255, 249, 0.98)) !important;
    border-color: rgba(24, 171, 119, 0.42) !important;
    box-shadow: 0 0 0 1px rgba(24, 171, 119, 0.10), 0 10px 22px rgba(24, 171, 119, 0.10) !important;
}

.badge.info,
.badge.status-in-progress,
.badge.status-in_progress,
.course-chip.status-in_progress,
.badge.open,
.badge.active {
    color: #195ea8 !important;
    background: linear-gradient(180deg, rgba(229, 244, 255, 0.99), rgba(244, 250, 255, 0.98)) !important;
    border-color: rgba(50, 137, 232, 0.44) !important;
    box-shadow: 0 0 0 1px rgba(50, 137, 232, 0.10), 0 10px 24px rgba(50, 137, 232, 0.12) !important;
}

.badge.frozen,
.badge.status-frozen,
.course-chip.status-frozen,
.freeze-pill {
    color: #5a46d6 !important;
    background: linear-gradient(180deg, rgba(239, 236, 255, 0.99), rgba(248, 246, 255, 0.98)) !important;
    border-color: rgba(107, 92, 241, 0.44) !important;
    box-shadow: 0 0 0 1px rgba(107, 92, 241, 0.10), 0 10px 24px rgba(107, 92, 241, 0.12) !important;
}

.badge.danger,
.badge.status-delayed,
.badge.rejected,
.course-chip.status-delayed {
    color: #b33b5c !important;
    background: linear-gradient(180deg, rgba(255, 236, 242, 0.99), rgba(255, 246, 249, 0.98)) !important;
    border-color: rgba(219, 84, 126, 0.42) !important;
    box-shadow: 0 0 0 1px rgba(219, 84, 126, 0.10), 0 10px 24px rgba(219, 84, 126, 0.10) !important;
}

.badge.exceeded,
.badge.status-exceeded,
.badge.status-hours-exceeded,
.course-chip.status-exceeded,
.course-chip.status-awaiting_final_test,
.badge.warning,
.badge.pending,
.badge.locked {
    color: #9a5e12 !important;
    background: linear-gradient(180deg, rgba(255, 244, 223, 0.99), rgba(255, 250, 239, 0.98)) !important;
    border-color: rgba(214, 148, 27, 0.44) !important;
    box-shadow: 0 0 0 1px rgba(214, 148, 27, 0.10), 0 10px 24px rgba(214, 148, 27, 0.10) !important;
}

.badge.secondary,
.badge.muted,
.badge.status-not-started,
.badge.status-neutral,
.chip.neutral {
    color: #4f6782 !important;
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.99), rgba(241, 247, 255, 0.98)) !important;
    border-color: rgba(146, 177, 214, 0.34) !important;
}

.row-frozen td {
    background: linear-gradient(180deg, rgba(242, 239, 255, 0.92), rgba(250, 248, 255, 0.88)) !important;
}
.row-delayed td,
.row-danger td {
    background: linear-gradient(180deg, rgba(255, 241, 246, 0.92), rgba(255, 248, 250, 0.88)) !important;
}
.row-exceeded td {
    background: linear-gradient(180deg, rgba(255, 246, 230, 0.92), rgba(255, 251, 242, 0.88)) !important;
}
.row-completed td {
    background: linear-gradient(180deg, rgba(236, 252, 244, 0.92), rgba(246, 255, 250, 0.88)) !important;
}
.row-progress td {
    background: linear-gradient(180deg, rgba(236, 246, 255, 0.88), rgba(246, 251, 255, 0.84)) !important;
}

.row-frozen td:first-child { box-shadow: inset 4px 0 0 #715bf0; }
.row-delayed td:first-child,
.row-danger td:first-child { box-shadow: inset 4px 0 0 #d9547e; }
.row-exceeded td:first-child { box-shadow: inset 4px 0 0 #d6941b; }
.row-completed td:first-child { box-shadow: inset 4px 0 0 #18ab77; }
.row-progress td:first-child { box-shadow: inset 4px 0 0 #3289e8; }

.status-legend .badge.frozen,
.status-legend .badge.danger,
.status-legend .badge.exceeded,
.status-legend .badge.success,
.status-legend .badge.info,
.status-legend .badge.warning {
    transform: translateY(0);
    opacity: 1;
}


.pagination{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-top:1rem}.page-link{padding:.55rem .85rem;border:1px solid rgba(255,255,255,.14);border-radius:999px;text-decoration:none;color:inherit;background:rgba(255,255,255,.03)}.page-link.active{background:rgba(77,163,255,.18);border-color:rgba(77,163,255,.5)}.filter-summary{display:flex;gap:.5rem;flex-wrap:wrap;margin:0 0 1rem}.result-summary{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem}.empty-state-inline{padding:1rem;border:1px dashed rgba(255,255,255,.14);border-radius:16px;opacity:.8}.topic-highlight{outline:2px solid rgba(77,163,255,.5);box-shadow:0 0 0 1px rgba(77,163,255,.2) inset}.badge.neutral{background:rgba(255,255,255,.08);color:#fff}.filter-grid .form-group select[data-course-filter]{min-width:220px}.topic-pagination-anchor{scroll-margin-top:120px}


/* Mobile sidebar stabilization fix */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.layout-shell,
.main-panel,
.content-area,
.topbar {
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 980px) {
    .layout-shell {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .sidebar,
    body.sidebar-compact .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(320px, calc(100vw - 24px));
        max-width: 86vw;
        min-width: 0;
        padding: 20px 16px max(20px, env(safe-area-inset-bottom));
        transform: translateX(calc(-100% - 18px));
        transition: transform .22s ease;
        z-index: 40;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 22px 0 40px rgba(4, 10, 18, 0.28);
    }

    body.sidebar-open .sidebar,
    body.sidebar-open.sidebar-compact .sidebar {
        transform: translateX(0);
        pointer-events: auto;
    }

    body:not(.sidebar-open) .sidebar {
        pointer-events: none;
    }

    .main-panel,
    body.sidebar-compact .main-panel {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100%;
    }

    .topbar,
    .content-area {
        width: 100%;
        max-width: 100%;
        padding-left: 18px;
        padding-right: 18px;
    }

    .topbar {
        padding-top: 18px;
    }

    .topbar__left,
    .topbar__right,
    .page-header,
    .section-header,
    .meta-row,
    .btn-row {
        min-width: 0;
    }

    .topbar__left {
        align-items: flex-start;
    }

    .content-area > *,
    .topbar > * {
        min-width: 0;
    }

    .overlay {
        z-index: 39;
    }

    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }
}

@media (max-width: 640px) {
    .sidebar,
    body.sidebar-compact .sidebar {
        width: min(300px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
        padding-inline: 14px;
    }

    .topbar,
    .content-area {
        padding-left: 16px;
        padding-right: 16px;
    }
}


/* Critical mobile layout collapse fix */
@media (max-width: 980px) {
    .topbar {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .topbar__left,
    .topbar__right {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .topbar__left {
        display: flex !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .topbar__left > :last-child {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .topbar__right {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        margin-top: 12px !important;
    }

    .topbar-chip {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .page-header,
    .section-header,
    .btn-row,
    .meta-row {
        justify-content: flex-start !important;
        align-items: stretch !important;
    }

    .page-header > *,
    .section-header > *,
    .btn-row > *,
    .meta-row > * {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .content-area > *,
    .topbar > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .topbar h2,
    .page-header h3,
    .section-header h3,
    .topbar p,
    .page-header p,
    .section-header p {
        max-width: 100% !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding-top: 16px !important;
    }

    .topbar__left {
        gap: 10px !important;
    }
}

/* ==================================================
   Students Command Center Redesign + Progress spacing
   ================================================== */
.students-command-deck,
.students-rail-shell,
.students-filter-console,
.students-insight-panel,
.students-results-shell {
    position: relative;
    overflow: hidden;
    border-color: rgba(112, 170, 234, 0.22);
    background:
        radial-gradient(circle at top right, rgba(82, 166, 255, 0.12), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(240,246,255,0.96));
    box-shadow:
        0 22px 55px rgba(58, 90, 132, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.82);
}

.students-command-deck::before,
.students-rail-shell::before,
.students-filter-console::before,
.students-insight-panel::before,
.students-results-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0));
    pointer-events: none;
}

.students-command-deck {
    padding: 28px;
    display: grid;
    gap: 22px;
}

.students-command-deck__intro,
.students-section-header,
.students-results-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.students-command-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.students-command-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.students-stat-tile,
.students-insight-card {
    position: relative;
    padding: 18px 18px 16px;
    border-radius: 18px;
    border: 1px solid rgba(120, 172, 230, 0.26);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,250,255,0.92));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), 0 12px 28px rgba(74, 110, 156, 0.10);
}

.students-stat-tile strong,
.students-insight-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.45rem;
    line-height: 1.1;
    color: #183c69;
}

.students-stat-tile small,
.students-insight-card small {
    display: block;
    margin-top: 6px;
    color: #607999;
}

.students-stat-tile--filters {
    background: linear-gradient(135deg, rgba(237,246,255,0.98), rgba(245,249,255,0.96));
}

.students-rail-shell {
    padding: 24px;
}

.students-all-link {
    min-width: 210px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(108, 164, 224, 0.26);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,249,255,0.95));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.students-all-link strong,
.students-mini-course strong { display: block; overflow-wrap: anywhere; }
.students-all-link span,
.students-mini-course span { color: #5f7d9b; font-size: 0.9rem; }
.students-all-link.active {
    border-color: rgba(63, 144, 235, 0.42);
    box-shadow: 0 0 0 1px rgba(63, 144, 235, 0.18), 0 12px 24px rgba(63, 144, 235, 0.14);
}

.students-section-clusters {
    display: grid;
    gap: 18px;
    margin-top: 20px;
    min-width: 0;
}

.students-section-cluster {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(113, 169, 229, 0.18);
    background: linear-gradient(180deg, rgba(251,253,255,0.95), rgba(243,247,254,0.95));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.88);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.students-section-cluster__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    min-width: 0;
}

.students-section-cluster__head h4 {
    margin: 6px 0 0;
    font-size: 1.05rem;
    color: #1a406f;
    min-width: 0;
    overflow-wrap: anywhere;
}

.students-course-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.students-mini-course {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.students-control-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .75fr);
    gap: 20px;
}

.students-filter-console {
    padding: 24px;
}

.students-filter-grid {
    gap: 16px;
}

.students-filter-grid .form-group label {
    color: #48688b;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.students-filter-grid input,
.students-filter-grid select {
    min-height: 52px;
    border-radius: 16px;
    border-color: rgba(107, 165, 229, 0.24);
    background: rgba(255,255,255,0.74);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.students-filter-actions {
    justify-content: flex-start;
    gap: 12px;
    margin-top: 4px;
}

.students-filter-console .filter-summary {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(113, 169, 229, 0.16);
}

.students-filter-console .chip,
.page-admin-progress-php .filter-summary .chip {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(109, 166, 228, 0.22);
    color: #365679;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.students-insight-panel {
    padding: 24px;
}

.students-insight-stack {
    display: grid;
    gap: 14px;
}

.students-insight-legend {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(113, 169, 229, 0.16);
}

.students-results-shell {
    padding: 24px;
}

.students-results-head {
    margin-bottom: 18px;
}

.students-result-summary-bar {
    margin-bottom: 16px;
    padding: 0 2px;
}

.student-record-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.student-record-card {
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(112, 170, 234, 0.22);
    background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(245,249,255,0.95));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 18px 34px rgba(77, 110, 150, 0.11);
    display: grid;
    grid-template-columns: minmax(220px, 1.15fr) minmax(240px, 1.4fr) minmax(170px, .9fr) minmax(170px, .9fr) minmax(180px, .95fr) auto;
    gap: 12px;
    align-items: stretch;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    overflow: hidden;
}

.student-record-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 22px 40px rgba(77, 110, 150, 0.16);
}

.student-record-card.state-delayed {
    border-color: rgba(228, 109, 134, 0.30);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), 0 16px 32px rgba(228, 109, 134, 0.10);
}

.student-record-card.state-frozen {
    border-color: rgba(123, 119, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), 0 16px 32px rgba(123, 119, 255, 0.10);
}

.student-record-main {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(115, 169, 228, 0.18);
    background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(247,250,255,0.72));
}

.student-record-main h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #163a68;
    line-height: 1.25;
}

.student-record-main p {
    margin: 0;
    color: #6681a1;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.student-record-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.student-meta-item {
    min-width: 0;
    padding: 14px 14px 12px;
    border-radius: 18px;
    border: 1px solid rgba(115, 169, 228, 0.18);
    background: rgba(255,255,255,0.78);
    display: grid;
    align-content: start;
    gap: 4px;
}

.student-meta-item strong {
    display: block;
    margin: 4px 0 0;
    color: #20456f;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.student-meta-item small {
    display: block;
    color: #6c88a8;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.student-meta-item--course {
    background: linear-gradient(180deg, rgba(250,253,255,0.88), rgba(245,249,255,0.8));
}

.student-record-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
}

.student-record-card__actions .btn {
    white-space: nowrap;
}

@media (max-width: 1480px) {
    .student-record-card {
        grid-template-columns: minmax(220px, 1.15fr) minmax(240px, 1.4fr) minmax(170px, 1fr) minmax(170px, 1fr);
    }

    .student-record-card__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 1180px) {
    .students-command-stats,
    .students-control-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .students-control-layout {
        grid-template-columns: 1fr;
    }

    .student-record-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .student-record-main,
    .student-meta-item--course,
    .student-record-card__actions {
        grid-column: 1 / -1;
    }

    .student-record-card__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 820px) {
    .students-command-stats,
    .student-record-grid {
        grid-template-columns: 1fr;
    }

    .student-record-card {
        grid-template-columns: 1fr;
    }

    .students-command-deck,
    .students-rail-shell,
    .students-filter-console,
    .students-insight-panel,
    .students-results-shell {
        padding: 20px;
    }

    .students-command-deck__intro,
    .students-section-header,
    .students-results-head {
        flex-direction: column;
        align-items: stretch;
    }

    .students-command-actions,
    .student-record-card__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .students-course-rail {
        grid-template-columns: 1fr;
.students-empty-state {
    text-align: center;
    padding: 44px 24px;
    border: 1px dashed rgba(112, 170, 234, 0.24);
    border-radius: 22px;
    background: rgba(255,255,255,0.60);
}

.students-empty-state h3 {
    margin: 10px 0 10px;
    color: #173b68;
}

.students-empty-state p {
    max-width: 560px;
    margin: 0 auto 18px;
    color: #6a86a6;
}

.page-admin-progress-php .filter-grid .btn-row.align-end,
.page-monitoring-progress-php .filter-grid .btn-row.align-end {
    margin-bottom: 10px;
}

.page-admin-progress-php .filter-summary,
.page-monitoring-progress-php .filter-summary {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(113, 169, 229, 0.16);
}

@media (max-width: 1180px) {
    .students-command-stats,
    .students-control-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .students-control-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .students-command-stats,
    .student-record-grid,
    .student-record-card__meta {
        grid-template-columns: 1fr;
    }

    .student-meta-item--course {
        grid-column: auto;
    }

    .students-command-deck,
    .students-rail-shell,
    .students-filter-console,
    .students-insight-panel,
    .students-results-shell {
        padding: 20px;
    }

    .students-command-deck__intro,
    .students-section-header,
    .students-results-head,
    .student-record-card__head {
        flex-direction: column;
        align-items: stretch;
    }

    .students-command-actions,
    .student-record-card__badges,
    .student-record-card__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .students-course-rail {
        grid-template-columns: 1fr;
    }

    .students-all-link {
        min-width: 0;
        width: 100%;
    }
}

.course-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.course-groups--compact {
    grid-template-columns: 1fr;
}

.course-group-card {
    border: 1px solid rgba(113, 169, 229, 0.20);
    border-radius: 22px;
    padding: 18px 18px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(245,250,255,0.78));
    box-shadow: 0 14px 34px rgba(146, 171, 202, 0.12);
    overflow: hidden;
}

.course-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(159, 184, 214, 0.22);
}

.course-rail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.course-rail-card.compact {
    min-width: 0;
    width: 100%;
    padding: 14px;
}

.trainer-course-check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.trainer-course-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 88px;
    border: 1px solid rgba(113, 169, 229, 0.22);
    border-radius: 18px;
    padding: 14px 15px;
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(245,249,255,0.76));
    box-shadow: 0 8px 20px rgba(150, 174, 202, 0.08);
}

.trainer-course-check:hover {
    border-color: rgba(92, 152, 219, 0.34);
    box-shadow: 0 12px 28px rgba(120, 161, 210, 0.12);
}

.trainer-course-check input[type="checkbox"] {
    flex: 0 0 auto;
    margin-top: 4px;
}

.trainer-course-check span {
    display: grid;
    gap: 4px;
    min-width: 0;
    width: 100%;
}

.trainer-course-check strong,
.course-rail-card.compact strong {
    display: block;
    min-width: 0;
    font-size: 0.94rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.trainer-course-check small,
.course-rail-card.compact span {
    display: block;
    color: #6b86a7;
    font-size: 0.78rem;
    line-height: 1.3;
}

@media (max-width: 1480px) {
    .trainer-course-check-grid,
    .course-rail-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .trainer-course-check-grid,
    .course-rail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .trainer-course-check-grid,
    .course-groups,
    .course-rail-grid {
        grid-template-columns: 1fr;
    }

    .course-group-card {
        padding-inline: 14px;
    }
}

/* Trainer registry UI refresh */
.trainer-registry-page {
    display: grid;
    gap: 18px;
}

.trainer-registry-shell {
    padding: 22px 22px 26px;
}

.trainer-page-header {
    align-items: flex-start;
}

.trainer-identity-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 16px;
}

.trainer-status-toggle {
    margin-top: 2px;
}

.trainer-assignment-shell {
    border: 1px solid rgba(130, 173, 222, 0.22);
    border-radius: 24px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(243,248,255,0.72));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 14px 30px rgba(150, 172, 204, 0.10);
}

.trainer-assignment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.trainer-assignment-header h3 {
    margin-bottom: 6px;
}

.trainer-assignment-chips,
.trainer-section-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip.chip-info {
    color: #1f5d91 !important;
    background: linear-gradient(180deg, rgba(229,243,255,0.98), rgba(242,248,255,0.96)) !important;
    border-color: rgba(108, 169, 232, 0.38) !important;
}

.chip.chip-success {
    color: #147251 !important;
    background: linear-gradient(180deg, rgba(228, 255, 241, 0.98), rgba(244, 255, 248, 0.96)) !important;
    border-color: rgba(83, 181, 128, 0.34) !important;
}

.chip.chip-neutral {
    color: #4f6782 !important;
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.99), rgba(241, 247, 255, 0.98)) !important;
    border-color: rgba(146, 177, 214, 0.34) !important;
}

.trainer-course-groups {
    gap: 16px;
}

.trainer-section-card {
    border: 1px solid rgba(120, 166, 219, 0.20);
    border-radius: 22px;
    padding: 16px;
    background:
        radial-gradient(circle at top right, rgba(137, 188, 255, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,0.90), rgba(246,250,255,0.82));
    box-shadow: 0 16px 36px rgba(145, 171, 202, 0.12);
}

.trainer-section-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(153, 186, 224, 0.24);
}

.trainer-section-card__head strong {
    display: block;
    font-size: 1rem;
    color: #173b63;
}

.trainer-course-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.trainer-course-tile {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    min-height: 102px;
    padding: 14px 15px;
    border-radius: 18px;
    border: 1px solid rgba(120, 169, 226, 0.24);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,249,255,0.92));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 12px 28px rgba(154, 175, 204, 0.10);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.trainer-course-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(84, 152, 226, 0.42);
    box-shadow: 0 16px 30px rgba(135, 170, 214, 0.14);
}

.trainer-course-tile.is-selected,
.trainer-course-tile:has(.trainer-course-tile__input:checked) {
    border-color: rgba(58, 132, 222, 0.46);
    background:
        radial-gradient(circle at top right, rgba(126, 194, 255, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(240,247,255,0.98), rgba(231,242,255,0.94));
    box-shadow: 0 18px 34px rgba(93, 155, 221, 0.16);
}

.trainer-course-tile__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.trainer-course-tile__check {
    position: relative;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 7px;
    border: 1px solid rgba(121, 170, 226, 0.38);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,247,255,0.95));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.trainer-course-tile__input:checked + .trainer-course-tile__check::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid #2d7de2;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.trainer-course-tile__body {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.trainer-course-tile__body strong {
    display: block;
    min-width: 0;
    color: #173d66;
    font-size: 0.95rem;
    line-height: 1.38;
    overflow-wrap: anywhere;
}

.trainer-course-tile__body small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 3px 8px;
    border-radius: 999px;
    color: #6583a4;
    background: rgba(232, 240, 250, 0.9);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

@media (max-width: 1480px) {
    .trainer-course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1080px) {
    .trainer-identity-grid,
    .trainer-assignment-header,
    .trainer-section-card__head {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 820px) {
    .trainer-registry-shell,
    .trainer-assignment-shell,
    .trainer-section-card {
        padding: 16px;
    }

    .trainer-course-grid {
        grid-template-columns: 1fr;
    }

    .trainer-course-tile {
        min-height: 90px;
    }
}
