/* === assets/style.css === */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
    --primary: #4D6BFE;
    --primary-light: #E8F0FE;
    --primary-hover: #3B82F6;
    --primary-dark: #3452D9;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #1F2937;
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow: 0 4px 16px rgba(77,107,254,.08), 0 1px 4px rgba(0,0,0,.05);
    --shadow-lg: 0 8px 32px rgba(77,107,254,.12), 0 2px 8px rgba(0,0,0,.06);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --sidebar-width: 240px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

/* ===========================
   LAYOUT
=========================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo .logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), #7C90FF);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.02em;
}

.logo-text span { color: var(--primary); }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    padding: 0 8px;
    margin-bottom: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    font-size: .9rem;
    font-weight: 500;
    transition: all .15s ease;
    margin-bottom: 2px;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-link .icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--gray-100);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background .15s;
    cursor: pointer;
}

.user-card:hover { background: var(--gray-50); }

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7C90FF);
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-weight: 600;
    font-size: .9rem;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info .name { font-size: .875rem; font-weight: 600; color: var(--gray-900); }
.user-info .role {
    font-size: .75rem;
    color: var(--gray-400);
    text-transform: capitalize;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
}

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.02em;
}

.topbar-title p {
    font-size: .8rem;
    color: var(--gray-400);
    line-height: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-body {
    padding: 28px 32px;
}

/* ===========================
   CARDS
=========================== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body { padding: 24px; }

/* ===========================
   BUTTONS
=========================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all .15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); color: white; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(77,107,254,.35); }

.btn-secondary {
    background: var(--primary-light);
    color: var(--primary);
}
.btn-secondary:hover { background: #d5e4fd; color: var(--primary); }

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #DC2626; color: white; }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #059669; color: white; }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }

/* ===========================
   FORMS
=========================== */
.form-group { margin-bottom: 20px; }

label, .label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(77,107,254,.1);
}

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control { cursor: pointer; }

.form-hint {
    font-size: .78rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===========================
   BADGES
=========================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: .75rem;
    font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: #065F46; }
.badge-danger  { background: var(--danger-light); color: #991B1B; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-gray    { background: var(--gray-100); color: var(--gray-500); }

/* ===========================
   ALERTS
=========================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: var(--success-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: var(--danger-light); color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background: var(--info-light); color: #1E40AF; border: 1px solid #BFDBFE; }

/* ===========================
   TABLES
=========================== */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-400);
    padding: 10px 16px;
    text-align: left;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: .9rem;
    color: var(--gray-700);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }

/* ===========================
   STAT CARDS
=========================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue  { background: var(--primary-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.yellow{ background: var(--warning-light); }
.stat-icon.red   { background: var(--danger-light); }

.stat-info .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.stat-info .label {
    font-size: .8rem;
    color: var(--gray-400);
    margin-top: 4px;
    font-weight: 500;
}

/* ===========================
   COURSE CARDS
=========================== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.course-thumb {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #C7D7FD 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.course-body { padding: 18px; }
.course-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .8rem;
    color: var(--gray-400);
    margin-bottom: 12px;
}

.progress-bar-wrap {
    background: var(--gray-100);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
    margin: 8px 0 4px;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7C90FF);
    border-radius: 100px;
    transition: width .5s ease;
}
.progress-label {
    font-size: .75rem;
    color: var(--gray-400);
    display: flex;
    justify-content: space-between;
}

/* ===========================
   TABS
=========================== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all .15s;
}

.tab-btn.active, .tab-btn:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===========================
   CBT EXAM STYLES
=========================== */
.exam-header {
    background: linear-gradient(135deg, var(--primary) 0%, #7C90FF 100%);
    color: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.exam-header h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.exam-header p { opacity: .85; font-size: .95rem; }
.exam-meta { display: flex; gap: 24px; margin-top: 16px; font-size: .85rem; }
.exam-meta span { display: flex; align-items: center; gap: 6px; opacity: .9; }

.exam-container { max-width: 820px; margin: 0 auto; }

.exam-timer {
    position: fixed;
    top: 20px; right: 24px;
    background: var(--primary);
    color: white;
    padding: 10px 22px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 16px rgba(77,107,254,.4);
    z-index: 500;
    font-family: 'DM Mono', monospace;
    transition: background .3s;
}
.exam-timer.warning { background: var(--warning); }
.exam-timer.danger  { background: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.question-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 28px;
    margin-bottom: 20px;
}

.question-num {
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 20px;
    line-height: 1.5;
}

.options-list { display: flex; flex-direction: column; gap: 10px; }

.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
}

.option-item:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-item input[type="radio"] { display: none; }

.option-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-letter {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: var(--gray-500);
    flex-shrink: 0;
    transition: all .15s;
}

.option-item.selected .option-letter {
    background: var(--primary);
    color: white;
}

/* Result page */
.result-hero {
    text-align: center;
    padding: 40px 32px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.score-circle {
    width: 140px; height: 140px;
    border-radius: 50%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    border: 8px solid;
}

.score-circle.pass { border-color: var(--success); background: var(--success-light); }
.score-circle.fail { border-color: var(--danger); background: var(--danger-light); }

.score-circle .pct { font-size: 2.2rem; font-weight: 800; }
.score-circle.pass .pct { color: var(--success); }
.score-circle.fail .pct { color: var(--danger); }

.score-circle .label { font-size: .75rem; font-weight: 600; color: var(--gray-400); }

/* Question review */
.review-item {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 20px 24px;
    margin-bottom: 12px;
}

.review-item.correct { border-left: 4px solid var(--success); }
.review-item.incorrect { border-left: 4px solid var(--danger); }
.review-item.skipped { border-left: 4px solid var(--warning); }

/* Question palette */
.question-palette {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    gap: 8px;
}

.palette-btn {
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    font-family: inherit;
    color: var(--gray-700);
}

.palette-btn:hover { border-color: var(--primary); color: var(--primary); }
.palette-btn.answered { background: var(--success); border-color: var(--success); color: white; }
.palette-btn.current  { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* ===========================
   CERTIFICATE
=========================== */
.certificate-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border: 12px solid var(--primary);
    border-radius: 8px;
    padding: 48px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.certificate-inner {
    border: 2px solid #C7D7FD;
    border-radius: 4px;
    padding: 40px;
}

.cert-logo { font-size: 2.5rem; margin-bottom: 8px; }
.cert-org { font-size: .85rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; margin-bottom: 32px; }
.cert-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .15em; color: var(--primary); font-weight: 700; margin-bottom: 12px; }
.cert-of-completion { font-size: 2rem; font-weight: 800; color: var(--gray-900); margin-bottom: 24px; }
.cert-presented-to { font-size: .85rem; color: var(--gray-400); margin-bottom: 8px; }
.cert-name { font-size: 2.4rem; font-weight: 800; color: var(--primary); margin-bottom: 24px; font-style: italic; }
.cert-for { font-size: .85rem; color: var(--gray-400); margin-bottom: 6px; }
.cert-course { font-size: 1.2rem; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.cert-exam { font-size: .9rem; color: var(--gray-500); margin-bottom: 24px; }
.cert-score { font-size: 1rem; color: var(--gray-700); margin-bottom: 32px; }
.cert-score strong { color: var(--success); }

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    font-size: .78rem;
    color: var(--gray-400);
}

.cert-seal {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7C90FF);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: center;
    line-height: 1.3;
    margin: 0 auto;
}

/* ===========================
   DRAGGABLE WINDOWS
=========================== */
.float-window {
    position: fixed;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(0,0,0,.2);
    z-index: 9999;
    overflow: hidden;
    min-width: 320px;
    min-height: 200px;
    display: none;
    border: 1px solid var(--gray-200);
}

.float-window.visible { display: flex; flex-direction: column; }

.window-titlebar {
    background: var(--primary);
    color: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    cursor: move;
    user-select: none;
    gap: 8px;
}

.window-titlebar .title { flex: 1; font-size: .9rem; font-weight: 600; }

.window-controls {
    display: flex;
    gap: 8px;
}

.win-btn {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .8;
    transition: opacity .15s;
}

.win-btn:hover { opacity: 1; }
.win-btn.minimize { background: var(--warning); color: #7C4A00; }
.win-btn.close    { background: var(--danger); color: #fff; }

.window-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.window-body iframe {
    flex: 1;
    border: none;
    width: 100%;
    height: 100%;
}

.window-resize {
    position: absolute;
    bottom: 0; right: 0;
    width: 16px; height: 16px;
    cursor: se-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: .7rem;
}

.window-minimized { height: 44px !important; overflow: hidden; }
.window-minimized .window-body { display: none; }

/* ===========================
   LANDING PAGE
=========================== */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #F0F4FF 0%, #FFFFFF 60%, #E8F0FE 100%);
    display: flex;
    flex-direction: column;
}

.nav-bar {
    padding: 20px 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #C7D7FD;
    border-radius: 100px;
    padding: 6px 16px;
    font-size: .8rem;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--gray-900);
    line-height: 1.15;
    letter-spacing: -.03em;
    margin-bottom: 20px;
    max-width: 700px;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary), #7C90FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--gray-500);
    max-width: 540px;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.features-section {
    padding: 80px 60px;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--gray-200);
    transition: all .2s;
}

.feature-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.feature-title {
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.feature-desc {
    font-size: .85rem;
    color: var(--gray-500);
    line-height: 1.5;
}

/* ===========================
   AUTH PAGES
=========================== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #E8F0FE 0%, #F0F4FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 6px;
    letter-spacing: -.03em;
}

.auth-card .sub { font-size: .9rem; color: var(--gray-400); margin-bottom: 28px; }

/* ===========================
   VIDEO LIST
=========================== */
.video-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 10px;
    background: var(--white);
    transition: all .15s;
}

.video-item:hover { border-color: var(--primary); }

.video-thumb {
    width: 80px; height: 52px;
    background: var(--primary-light);
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.video-thumb img { width: 100%; height: 100%; object-fit: cover; }

.video-info { flex: 1; min-width: 0; }
.video-title { font-weight: 600; color: var(--gray-900); font-size: .9rem; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-meta  { font-size: .78rem; color: var(--gray-400); }

.video-check {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    color: transparent;
    font-size: .9rem;
    transition: all .2s;
}

.video-check.watched { background: var(--success); border-color: var(--success); color: white; }

/* ===========================
   UTILITIES
=========================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-muted { color: var(--gray-400); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

.w-full { width: 100%; }

.empty-state {
    text-align: center;
    padding: 48px 32px;
    color: var(--gray-400);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p { font-size: .875rem; }

/* ===========================
   PRINT / CERTIFICATE
=========================== */
@media print {
    body * { visibility: hidden; }
    .certificate-container, .certificate-container * { visibility: visible; }
    .certificate-container { position: absolute; top: 0; left: 0; width: 100%; border: none; box-shadow: none; }
    .no-print { display: none !important; }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 768px) {
    :root { --sidebar-width: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-body { padding: 20px 16px; }
    .topbar { padding: 0 16px; }
    .form-row { grid-template-columns: 1fr; }
    .nav-bar { padding: 16px 20px; }
    .hero-content { padding: 60px 20px; }
    .features-section { padding: 60px 20px; }
    .exam-timer { top: auto; bottom: 20px; right: 16px; }
}
