/* =========================================================
   Exam Portal design system (on top of Bootstrap 5.3)
   ========================================================= */
:root {
    --ep-primary: #4f46e5;
    --ep-primary-600: #4338ca;
    --ep-primary-rgb: 79, 70, 229;
    --ep-accent: #06b6d4;
    --ep-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 120%);
    --ep-bg: #f4f6fb;
    --ep-surface: #ffffff;
    --ep-surface-2: #f8f9fc;
    --ep-border: #e6e8f0;
    --ep-text: #0f172a;
    --ep-muted: #64748b;
    --ep-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
    --ep-shadow: 0 4px 6px -2px rgba(15, 23, 42, .05), 0 12px 24px -6px rgba(15, 23, 42, .10);
    --ep-shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .25);
    --ep-radius: 14px;
    --ep-sidebar-w: 264px;
    --ep-sidebar-bg: #0f172a;
    --ep-sidebar-bg-2: #131c34;

    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-primary: var(--ep-primary);
    --bs-primary-rgb: var(--ep-primary-rgb);
    --bs-link-color: var(--ep-primary);
    --bs-link-color-rgb: var(--ep-primary-rgb);
    --bs-link-hover-color: var(--ep-primary-600);
    --bs-border-radius: 10px;
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: 14px;
    --bs-border-color: var(--ep-border);
    --bs-body-bg: var(--ep-bg);
    --bs-body-color: var(--ep-text);
    --bs-secondary-color: var(--ep-muted);
    --bs-tertiary-bg: var(--ep-surface-2);
}
[data-bs-theme="dark"] {
    --ep-primary: #818cf8;
    --ep-primary-600: #a5b4fc;
    --ep-primary-rgb: 129, 140, 248;
    --ep-bg: #0b1120;
    --ep-surface: #111a2e;
    --ep-surface-2: #0f172a;
    --ep-border: #1f2a44;
    --ep-text: #e2e8f0;
    --ep-muted: #94a3b8;
    --ep-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --ep-shadow: 0 8px 24px -8px rgba(0, 0, 0, .55);
    --ep-sidebar-bg: #070c18;
    --ep-sidebar-bg-2: #0b1222;
    --bs-body-bg: var(--ep-bg);
    --bs-body-color: var(--ep-text);
    --bs-border-color: var(--ep-border);
    --bs-secondary-color: var(--ep-muted);
    --bs-tertiary-bg: var(--ep-surface-2);
    --bs-emphasis-color: #f8fafc;
    color-scheme: dark;
}
.role-super {
    --ep-primary: #d97706;
    --ep-primary-600: #b45309;
    --ep-primary-rgb: 217, 119, 6;
    --ep-grad: linear-gradient(135deg, #f59e0b 0%, #ea580c 60%, #db2777 130%);
}
[data-bs-theme="dark"] .role-super {
    --ep-primary: #fbbf24;
    --ep-primary-600: #fcd34d;
    --ep-primary-rgb: 251, 191, 36;
}

html { scroll-behavior: smooth; }
body {
    background: var(--ep-bg);
    color: var(--ep-text);
    font-family: var(--bs-font-sans-serif);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; letter-spacing: -.02em; color: var(--bs-emphasis-color, var(--ep-text)); }
h1.h4, .h4.mb-0, .h4.mb-3 { font-size: 1.45rem; }
::selection { background: rgba(var(--ep-primary-rgb), .25); }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- App shell ---------- */
.ep-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--ep-sidebar-w); z-index: 1040;
    background: linear-gradient(180deg, var(--ep-sidebar-bg) 0%, var(--ep-sidebar-bg-2) 100%);
    color: #cbd5e1; display: flex; flex-direction: column; padding: 18px 14px;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    border-right: 1px solid rgba(255, 255, 255, .04);
}
.ep-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; padding: 6px 8px 18px; }
.ep-brand:hover { color: #fff; }
.ep-brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: var(--ep-grad); color: #fff; font-size: 1.2rem;
    box-shadow: 0 8px 20px -6px rgba(var(--ep-primary-rgb), .7);
}
.ep-brand-name { display: block; font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem; line-height: 1.1; }
.ep-brand-sub { display: block; font-size: .72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.ep-nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #64748b; padding: 8px 12px 6px; font-weight: 600; }
.ep-nav { display: flex; flex-direction: column; gap: 2px; }
.ep-nav-link {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    color: #cbd5e1; text-decoration: none; border-radius: 10px; font-weight: 500; font-size: .93rem;
    transition: background .2s, color .2s, transform .2s;
}
.ep-nav-link i { font-size: 1.1rem; opacity: .85; transition: transform .2s; }
.ep-nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.ep-nav-link:hover i { transform: translateX(2px); }
.ep-nav-link.active {
    color: #fff; background: linear-gradient(90deg, rgba(var(--ep-primary-rgb), .35), rgba(var(--ep-primary-rgb), .08));
    box-shadow: inset 0 0 0 1px rgba(var(--ep-primary-rgb), .35);
}
.ep-nav-link.active::before {
    content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px;
    border-radius: 0 4px 4px 0; background: var(--ep-grad);
}
.ep-nav-link.active i { opacity: 1; }
.ep-plan-card {
    margin-top: auto; display: block; text-decoration: none; color: #e2e8f0; padding: 14px;
    border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07);
    font-size: .85rem; transition: background .2s, transform .2s;
}
.ep-plan-card:hover { background: rgba(255, 255, 255, .09); color: #fff; transform: translateY(-2px); }
.ep-plan-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 8px 0 6px; }
.ep-plan-bar span { display: block; height: 100%; background: var(--ep-grad); border-radius: 6px; animation: ep-grow 1s ease-out; }
.ep-plan-meta { color: #94a3b8; font-size: .78rem; }
.ep-sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 6px 2px; margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .07); color: #e2e8f0; }
.ep-plan-card + .ep-sidebar-foot { margin-top: 14px; }
.ep-nav + .ep-sidebar-foot { margin-top: auto; }
.ep-muted-on-dark { color: #94a3b8; font-size: .75rem; }
.ep-avatar {
    width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
    background: var(--ep-grad); color: #fff; font-weight: 700; font-size: .9rem;
}
.ep-avatar.sm { width: 30px; height: 30px; font-size: .8rem; }

.ep-main { margin-left: var(--ep-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.ep-topbar {
    position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 12px;
    padding: 12px 28px; min-height: 64px;
    background: color-mix(in srgb, var(--ep-bg) 78%, transparent);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--ep-border);
}
.ep-crumb { display: flex; align-items: center; gap: 8px; font-size: .9rem; min-width: 0; }
.ep-crumb-org { color: var(--ep-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.ep-crumb .bi-chevron-right { color: var(--ep-muted); font-size: .7rem; }
.ep-crumb-page { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-icon-btn {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--ep-border); background: var(--ep-surface);
    color: var(--ep-text); display: inline-grid; place-items: center; font-size: 1.05rem; transition: all .2s;
}
.ep-icon-btn:hover { border-color: rgba(var(--ep-primary-rgb), .5); color: var(--ep-primary); transform: translateY(-1px); }
[data-bs-theme="dark"] .theme-dark-hide, [data-bs-theme="light"] .theme-light-hide { display: none; }
.ep-user-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
    border: 1px solid var(--ep-border); background: var(--ep-surface); color: var(--ep-text); font-size: .88rem; font-weight: 500;
    transition: border-color .2s;
}
.ep-user-btn:hover { border-color: rgba(var(--ep-primary-rgb), .5); }
.ep-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
    font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: transform .2s;
}
.ep-pill:hover { transform: translateY(-1px); }
.ep-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); animation: ep-pulse 2s infinite; }
.pill-success { background: #dcfce7; color: #15803d; }
.pill-info { background: #e0f2fe; color: #0369a1; }
.pill-danger { background: #fee2e2; color: #b91c1c; }
[data-bs-theme="dark"] .pill-success { background: rgba(34, 197, 94, .15); color: #4ade80; }
[data-bs-theme="dark"] .pill-info { background: rgba(14, 165, 233, .15); color: #38bdf8; }
[data-bs-theme="dark"] .pill-danger { background: rgba(239, 68, 68, .15); color: #f87171; }

.ep-banner { display: flex; align-items: center; gap: 12px; padding: 10px 28px; font-size: .9rem; color: #fff; flex-wrap: wrap; }
.ep-banner.info { background: var(--ep-grad); }
.ep-banner.warn { background: linear-gradient(90deg, #f59e0b, #ea580c); }
.ep-banner .btn-light { font-weight: 600; }

.ep-content { padding: 28px; width: 100%; max-width: 1400px; flex: 1; }
.ep-content > * { animation: ep-fade-up .5s cubic-bezier(.2, .7, .2, 1) both; }
.ep-content > *:nth-child(2) { animation-delay: .05s; }
.ep-content > *:nth-child(3) { animation-delay: .1s; }
.ep-content > *:nth-child(4) { animation-delay: .15s; }
.ep-content > *:nth-child(5) { animation-delay: .2s; }
.ep-content > *:nth-child(n+6) { animation-delay: .25s; }

.ep-backdrop { display: none; }
@media (max-width: 991.98px) {
    .ep-sidebar { transform: translateX(-100%); box-shadow: var(--ep-shadow-lg); }
    .sidebar-open .ep-sidebar { transform: none; }
    .ep-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s; }
    .sidebar-open .ep-backdrop { opacity: 1; pointer-events: auto; }
    .ep-main { margin-left: 0; }
    .ep-topbar { padding: 10px 16px; }
    .ep-content { padding: 20px 16px; }
    .ep-banner { padding: 10px 16px; }
}

/* ---------- Page headers (existing markup) ---------- */
.ep-content > .d-flex:first-child h1, .ep-content > h1:first-child { margin-bottom: .15rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1.5rem; }
.page-head .sub { color: var(--ep-muted); font-size: .92rem; }

/* ---------- Cards ---------- */
.card {
    --bs-card-bg: var(--ep-surface);
    --bs-card-border-color: var(--ep-border);
    --bs-card-cap-bg: var(--ep-surface);
    border: 1px solid var(--ep-border); border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow-sm); background: var(--ep-surface);
    transition: box-shadow .25s, transform .25s, border-color .25s;
}
.card > .table-responsive:last-child, .card > .table-responsive:only-child { border-radius: 0 0 var(--ep-radius) var(--ep-radius); }
.card > .table-responsive:only-child { border-radius: var(--ep-radius); }
.card-header {
    background: var(--ep-surface) !important; border-bottom: 1px solid var(--ep-border);
    padding: 14px 18px; border-radius: var(--ep-radius) var(--ep-radius) 0 0 !important;
}
.card-header strong { font-weight: 650; }
.card-footer { background: var(--ep-surface) !important; border-top: 1px solid var(--ep-border); }
.card.p-3, .card.p-4 { padding: 1.35rem !important; }
[data-bs-theme="dark"] .bg-white { background-color: var(--ep-surface) !important; }

/* Stat tiles */
.stat { font-size: 2rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.card:has(> .stat), .card:has(.stat):not(:has(table)) { position: relative; overflow: hidden; }
.card:has(> .stat):hover, .stat-card:hover { transform: translateY(-3px); box-shadow: var(--ep-shadow); }
.card:has(> .stat) > .text-muted.small:first-child { font-weight: 500; }
.card:has(> .stat)::after {
    content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--ep-primary-rgb), .14), transparent 70%); pointer-events: none;
}
.stat-card { position: relative; overflow: hidden; height: 100%; padding: 1.25rem !important; }
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 14px;
}
.stat-card .stat-label { color: var(--ep-muted); font-size: .85rem; font-weight: 500; }
.stat-card .stat-foot { color: var(--ep-muted); font-size: .78rem; margin-top: 6px; }
.tone-indigo .stat-icon { background: rgba(99, 102, 241, .12); color: #6366f1; }
.tone-green .stat-icon { background: rgba(34, 197, 94, .12); color: #16a34a; }
.tone-amber .stat-icon { background: rgba(245, 158, 11, .14); color: #d97706; }
.tone-rose .stat-icon { background: rgba(244, 63, 94, .12); color: #e11d48; }
.tone-sky .stat-icon { background: rgba(14, 165, 233, .12); color: #0284c7; }
.tone-violet .stat-icon { background: rgba(139, 92, 246, .12); color: #7c3aed; }
.stat-card.tone-indigo::after, .stat-card.tone-green::after, .stat-card.tone-amber::after,
.stat-card.tone-rose::after, .stat-card.tone-sky::after, .stat-card.tone-violet::after {
    content: ""; position: absolute; right: -40px; bottom: -40px; width: 130px; height: 130px; border-radius: 50%; opacity: .5; pointer-events: none;
}
.stat-card.tone-indigo::after { background: radial-gradient(circle, rgba(99, 102, 241, .18), transparent 70%); }
.stat-card.tone-green::after { background: radial-gradient(circle, rgba(34, 197, 94, .18), transparent 70%); }
.stat-card.tone-amber::after { background: radial-gradient(circle, rgba(245, 158, 11, .2), transparent 70%); }
.stat-card.tone-rose::after { background: radial-gradient(circle, rgba(244, 63, 94, .18), transparent 70%); }
.stat-card.tone-sky::after { background: radial-gradient(circle, rgba(14, 165, 233, .18), transparent 70%); }
.stat-card.tone-violet::after { background: radial-gradient(circle, rgba(139, 92, 246, .18), transparent 70%); }

/* Hero / welcome card */
.ep-hero {
    position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px; color: #fff;
    background: var(--ep-grad); box-shadow: 0 18px 40px -18px rgba(var(--ep-primary-rgb), .8); margin-bottom: 1.5rem;
}
.ep-hero::before, .ep-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.ep-hero::before { width: 260px; height: 260px; right: -60px; top: -110px; }
.ep-hero::after { width: 160px; height: 160px; right: 140px; bottom: -100px; background: rgba(255, 255, 255, .08); }
.ep-hero h1 { color: #fff; margin: 0; }
.ep-hero .hero-sub { opacity: .85; font-size: .95rem; margin-top: 4px; }
.ep-hero .code-chip {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 8px 6px 12px; border-radius: 10px;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); font-size: .85rem; position: relative; z-index: 1;
}
.ep-hero .code-chip code { color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .08em; }
.ep-hero .code-chip button { border: 0; background: rgba(255, 255, 255, .2); color: #fff; border-radius: 7px; padding: 2px 8px; font-size: .8rem; }
.ep-hero .code-chip button:hover { background: rgba(255, 255, 255, .32); }
.ep-hero .hero-actions { position: relative; z-index: 1; }
.ep-hero .btn-light { font-weight: 600; color: #312e81; }
.ep-hero .btn-outline-light { font-weight: 600; }

/* Empty states */
.ep-empty { text-align: center; padding: 40px 16px !important; color: var(--ep-muted); }
.ep-empty i { display: block; font-size: 2.2rem; margin-bottom: 8px; color: rgba(var(--ep-primary-rgb), .55); }

/* ---------- Tables ---------- */
.table {
    --bs-table-bg: transparent; --bs-table-color: var(--ep-text);
    --bs-table-hover-bg: rgba(var(--ep-primary-rgb), .045); --bs-table-striped-bg: var(--ep-surface-2);
    --bs-table-border-color: var(--ep-border);
}
.table > :not(caption) > * > * { padding: .8rem 1rem; }
.table-sm > :not(caption) > * > * { padding: .6rem .9rem; }
.table td, .table th { vertical-align: middle; }
.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ep-muted); font-weight: 600;
    background: var(--ep-surface-2) !important; border-bottom: 1px solid var(--ep-border); white-space: nowrap;
}
.table tbody tr { transition: background-color .15s; }
.table tbody tr:last-child > * { border-bottom: 0; }
.card .table { margin-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: rgba(var(--ep-primary-rgb), .05); }
td.text-muted.text-center, td.text-center.text-muted { padding: 2.5rem 1rem !important; }

/* ---------- Buttons ---------- */
.btn { font-weight: 550; border-radius: 10px; transition: all .2s cubic-bezier(.4, 0, .2, 1); }
.btn-sm { border-radius: 8px; padding: .32rem .7rem; }
.btn:active { transform: scale(.97); }
.btn-primary {
    --bs-btn-bg: var(--ep-primary); --bs-btn-border-color: var(--ep-primary);
    --bs-btn-hover-bg: var(--ep-primary-600); --bs-btn-hover-border-color: var(--ep-primary-600);
    --bs-btn-active-bg: var(--ep-primary-600); --bs-btn-active-border-color: var(--ep-primary-600);
    --bs-btn-disabled-bg: var(--ep-primary); --bs-btn-disabled-border-color: var(--ep-primary);
    --bs-btn-focus-shadow-rgb: var(--ep-primary-rgb);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .12), transparent);
    box-shadow: 0 4px 14px -4px rgba(var(--ep-primary-rgb), .55);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0b1120; --bs-btn-hover-color: #0b1120; --bs-btn-active-color: #0b1120; --bs-btn-disabled-color: #0b1120; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(var(--ep-primary-rgb), .6); }
.btn-outline-primary {
    --bs-btn-color: var(--ep-primary); --bs-btn-border-color: rgba(var(--ep-primary-rgb), .35);
    --bs-btn-hover-bg: var(--ep-primary); --bs-btn-hover-border-color: var(--ep-primary); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--ep-primary-600); --bs-btn-active-border-color: var(--ep-primary-600);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-hover-color: #0b1120; --bs-btn-active-color: #0b1120; }
.btn-outline-secondary { --bs-btn-color: var(--ep-text); --bs-btn-border-color: var(--ep-border); --bs-btn-hover-bg: var(--ep-surface-2); --bs-btn-hover-color: var(--ep-text); --bs-btn-hover-border-color: #cbd5e1; --bs-btn-active-bg: var(--ep-surface-2); --bs-btn-active-color: var(--ep-text); }
.btn-success { box-shadow: 0 4px 14px -4px rgba(25, 135, 84, .5); }
.btn-success:hover, .btn-danger:hover { transform: translateY(-1px); }
.btn-link { text-decoration: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 1.1em; height: 1.1em; border-radius: 50%;
    border: 2px solid currentColor; border-color: rgba(255, 255, 255, .9) rgba(255, 255, 255, .9) transparent transparent;
    animation: ep-spin .7s linear infinite;
}
.btn-outline-primary.is-loading::after, .btn-outline-secondary.is-loading::after, .btn-outline-danger.is-loading::after, .btn-light.is-loading::after {
    border-color: rgba(var(--ep-primary-rgb), .9) rgba(var(--ep-primary-rgb), .9) transparent transparent;
}

/* ---------- Forms ---------- */
.form-label { font-weight: 550; font-size: .88rem; margin-bottom: .35rem; }
.form-control, .form-select {
    border-radius: 10px; border-color: var(--ep-border); background-color: var(--ep-surface); padding: .6rem .85rem;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.form-control-sm, .form-select-sm { padding: .35rem .65rem; border-radius: 8px; }
.form-control:hover, .form-select:hover { border-color: #c7cbe0; }
[data-bs-theme="dark"] .form-control:hover, [data-bs-theme="dark"] .form-select:hover { border-color: #334155; }
.form-control:focus, .form-select:focus {
    border-color: rgba(var(--ep-primary-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--ep-primary-rgb), .14); background-color: var(--ep-surface);
}
.form-check-input:checked { background-color: var(--ep-primary); border-color: var(--ep-primary); }
.form-check-input:focus { border-color: rgba(var(--ep-primary-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--ep-primary-rgb), .14); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.form-text { color: var(--ep-muted); font-size: .8rem; }
.input-group-text { background: var(--ep-surface-2); border-color: var(--ep-border); }
.validation-summary-errors ul { list-style: none; padding: 10px 14px; margin: 0 0 6px; border-radius: 10px; background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .25); }
.ep-pass { position: relative; }
.ep-pass .form-control { padding-right: 2.6rem; }
.ep-pass-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ep-muted); width: 32px; height: 32px; border-radius: 8px; }
.ep-pass-btn:hover { color: var(--ep-primary); background: rgba(var(--ep-primary-rgb), .08); }
input[type="file"].form-control { padding: .45rem; }
input[type="file"].form-control::file-selector-button { border-radius: 8px; border: 0; margin-right: 10px; background: rgba(var(--ep-primary-rgb), .1); color: var(--ep-primary); font-weight: 600; padding: .35rem .8rem; }

/* ---------- Badges (soft) ---------- */
.badge { font-weight: 600; padding: .38em .7em; border-radius: 999px; letter-spacing: .01em; }
.text-bg-success { background-color: #dcfce7 !important; color: #15803d !important; }
.text-bg-info { background-color: #e0f2fe !important; color: #0369a1 !important; }
.text-bg-danger { background-color: #fee2e2 !important; color: #b91c1c !important; }
.text-bg-warning { background-color: #fef3c7 !important; color: #92400e !important; }
.text-bg-secondary { background-color: #f1f5f9 !important; color: #475569 !important; }
.text-bg-dark { background-color: #1e293b !important; color: #f1f5f9 !important; }
.text-bg-primary { background-color: rgba(var(--ep-primary-rgb), .14) !important; color: var(--ep-primary) !important; }
.text-bg-light { background-color: var(--ep-surface-2) !important; color: var(--ep-text) !important; border-color: var(--ep-border) !important; }
[data-bs-theme="dark"] .text-bg-success { background-color: rgba(34, 197, 94, .15) !important; color: #4ade80 !important; }
[data-bs-theme="dark"] .text-bg-info { background-color: rgba(14, 165, 233, .15) !important; color: #38bdf8 !important; }
[data-bs-theme="dark"] .text-bg-danger { background-color: rgba(239, 68, 68, .15) !important; color: #f87171 !important; }
[data-bs-theme="dark"] .text-bg-warning { background-color: rgba(245, 158, 11, .15) !important; color: #fbbf24 !important; }
[data-bs-theme="dark"] .text-bg-secondary { background-color: rgba(148, 163, 184, .15) !important; color: #cbd5e1 !important; }
[data-bs-theme="dark"] .text-bg-dark { background-color: #334155 !important; }
.badge-flag { background: #fef3c7; color: #92400e; font-weight: 500; }
[data-bs-theme="dark"] .badge-flag { background: rgba(245, 158, 11, .15); color: #fbbf24; }

/* ---------- Alerts, dropdowns, modals, nav tabs ---------- */
.alert { border-radius: 12px; border-width: 1px; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .3); color: #fcd34d; }
[data-bs-theme="dark"] .alert-danger { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .3); color: #fca5a5; }
[data-bs-theme="dark"] .alert-info { background: rgba(59, 130, 246, .1); border-color: rgba(59, 130, 246, .3); color: #93c5fd; }
[data-bs-theme="dark"] .alert-success { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .3); color: #86efac; }
.dropdown-menu {
    --bs-dropdown-bg: var(--ep-surface); --bs-dropdown-border-color: var(--ep-border);
    --bs-dropdown-link-active-bg: var(--ep-primary); --bs-dropdown-link-hover-bg: rgba(var(--ep-primary-rgb), .08);
    border-radius: 12px; padding: 6px; box-shadow: var(--ep-shadow) !important; animation: ep-pop .15s ease-out;
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .9rem; }
.modal-content { border-radius: 18px; border: 1px solid var(--ep-border); background: var(--ep-surface); box-shadow: var(--ep-shadow-lg); }
.nav-tabs .nav-link.active, .nav-pills .nav-link.active { font-weight: 600; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--ep-primary); }
.page-link { color: var(--ep-primary); }
.progress { border-radius: 999px; background: var(--ep-surface-2); }
.progress-bar { background: var(--ep-grad); }

/* ---------- Toasts ---------- */
.ep-toast {
    border: 1px solid var(--ep-border); border-radius: 14px; background: var(--ep-surface); box-shadow: var(--ep-shadow-lg);
    overflow: hidden; min-width: 300px; animation: ep-slide-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.ep-toast.success > div > .bi { color: #16a34a; }
.ep-toast.error > div > .bi { color: #dc2626; }
.ep-toast.error { border-left: 4px solid #dc2626; }
.ep-toast.success { border-left: 4px solid #16a34a; }
.ep-toast-timer { height: 3px; background: #16a34a; transform-origin: left; animation: ep-timer 5s linear forwards; opacity: .6; }

/* ---------- Pricing cards (billing) ---------- */
.plan-card { position: relative; display: flex; flex-direction: column; padding: 1.6rem !important; }
.plan-card:hover { transform: translateY(-4px); box-shadow: var(--ep-shadow); border-color: rgba(var(--ep-primary-rgb), .4); }
.plan-card.featured { border: 2px solid var(--ep-primary); box-shadow: 0 20px 40px -20px rgba(var(--ep-primary-rgb), .6); }
.plan-card .plan-ribbon {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px;
    background: var(--ep-grad); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.plan-card .plan-price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.plan-card .plan-price small { font-size: 1rem; color: var(--ep-muted); font-weight: 500; letter-spacing: 0; }
.plan-card ul { list-style: none; padding: 0; margin: 1.1rem 0 1.4rem; }
.plan-card li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: .9rem; }
.plan-card li i { color: #16a34a; font-size: 1rem; line-height: 1.3; }

/* ---------- Auth (login / signup) ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; background: #0f172a; color: #fff; padding: 56px; align-items: center; }
.auth-hero::before { content: ""; position: absolute; inset: 0; background: var(--ep-grad); opacity: .9; }
.auth-hero::after {
    content: ""; position: absolute; inset: 0; opacity: .12;
    background-image: linear-gradient(rgba(255, 255, 255, .6) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .6) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.auth-hero-inner { position: relative; z-index: 2; max-width: 520px; }
.auth-hero .ep-brand { padding: 0; }
.auth-hero .ep-brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; border: 1px solid rgba(255, 255, 255, .3); }
.auth-hero-title { font-size: clamp(2rem, 3.2vw, 2.9rem); font-weight: 800; line-height: 1.1; color: #fff; letter-spacing: -.035em; }
.auth-hero-title span { color: #a5f3fc; }
.auth-hero-text { font-size: 1.05rem; opacity: .88; margin: 18px 0 28px; line-height: 1.6; }
.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-features li { display: flex; align-items: center; gap: 12px; font-weight: 500; animation: ep-fade-up .6s both; }
.auth-features li:nth-child(2) { animation-delay: .1s; }
.auth-features li:nth-child(3) { animation-delay: .2s; }
.auth-features li:nth-child(4) { animation-delay: .3s; }
.auth-features i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22); flex: none; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(2px); z-index: 1; animation: ep-float 12s ease-in-out infinite; }
.auth-orb.o1 { width: 340px; height: 340px; right: -110px; top: -90px; background: rgba(255, 255, 255, .1); }
.auth-orb.o2 { width: 200px; height: 200px; left: -60px; bottom: 60px; background: rgba(6, 182, 212, .35); animation-delay: -4s; }
.auth-orb.o3 { width: 120px; height: 120px; right: 18%; bottom: -30px; background: rgba(255, 255, 255, .12); animation-delay: -8s; }
.auth-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--ep-bg); }
.auth-theme { position: absolute; top: 20px; right: 20px; }
.auth-card { width: 100%; max-width: 440px; animation: ep-fade-up .55s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card .card { box-shadow: var(--ep-shadow); }
.auth-card.wide, .auth-card:has(.signup-form) { max-width: 620px; }
.auth-head { margin-bottom: 1.75rem; }
.auth-head .ep-brand-mark { margin-bottom: 18px; }
.auth-head h1 { font-size: 1.75rem; margin-bottom: .35rem; }
.auth-head p { color: var(--ep-muted); margin: 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--ep-muted); font-size: .8rem; margin: 22px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--ep-border); }
.auth-section { font-size: .72rem; font-weight: 700; color: var(--ep-muted); text-transform: uppercase; letter-spacing: .1em; display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.auth-section .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--ep-primary-rgb), .12); color: var(--ep-primary); font-size: .72rem; }
.btn-lg-auth { padding: .75rem 1rem; font-size: 1rem; border-radius: 12px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } }

/* ---------- Misc existing classes ---------- */
.q-text { white-space: pre-wrap; }
.opt-correct { color: #16a34a; font-weight: 600; }
[data-bs-theme="dark"] .opt-correct { color: #4ade80; }
.font-monospace { font-feature-settings: normal; }
code { color: var(--ep-primary); }

/* ---------- AI assistant ---------- */
#assistant-toggle {
    position: fixed; right: 24px; bottom: 24px; z-index: 1050; padding: .7rem 1.2rem; font-weight: 600;
    background: var(--ep-grad); border: 0; box-shadow: 0 12px 30px -8px rgba(var(--ep-primary-rgb), .7);
    animation: ep-fade-up .6s .4s both;
}
#assistant-toggle:hover { transform: translateY(-2px) scale(1.02); }
#assistant-toggle .bi-stars { display: inline-block; animation: ep-twinkle 3s ease-in-out infinite; }
#assistant-panel {
    position: fixed; right: 24px; bottom: 24px; z-index: 1050;
    width: 400px; max-width: calc(100vw - 24px); height: 600px; max-height: calc(100vh - 48px);
    display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; box-shadow: var(--ep-shadow-lg);
    animation: ep-pop .25s cubic-bezier(.2, .9, .3, 1.2); transform-origin: bottom right;
}
#assistant-panel.d-none { display: none !important; }
#assistant-panel .assistant-head { background: var(--ep-grad) !important; border: 0; padding: 14px 16px; border-radius: 0 !important; }
.assistant-icon { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; }
#assistant-messages { overflow-y: auto; flex: 1 1 auto; background: var(--ep-surface-2); scroll-behavior: smooth; }
#assistant-input { resize: none; }
#assistant-form { background: var(--ep-surface) !important; padding: 10px 12px; }
.assistant-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; margin-bottom: 10px; font-size: .9rem; line-height: 1.45; word-wrap: break-word; animation: ep-fade-up .25s both; }
.assistant-msg p { margin: 0 0 .4rem; }
.assistant-msg p:last-child { margin-bottom: 0; }
.assistant-msg ul, .assistant-msg ol { padding-left: 1.2rem; margin: .2rem 0 .4rem; }
.assistant-msg.from-user { background: var(--ep-grad); color: #fff; margin-left: auto; white-space: pre-wrap; border-bottom-right-radius: 4px; }
.assistant-msg.from-user a { color: #fff; }
.assistant-msg.from-bot { background: var(--ep-surface); border: 1px solid var(--ep-border); border-bottom-left-radius: 4px; box-shadow: var(--ep-shadow-sm); }
.assistant-msg.typing { color: var(--ep-muted); letter-spacing: 2px; }
#assistant-suggestions .btn { border-radius: 999px; font-size: .78rem; }
@media (max-width: 576px) {
    #assistant-toggle { right: 16px; bottom: 16px; }
    #assistant-panel { right: 12px; bottom: 12px; height: calc(100vh - 24px); }
}

/* ---------- Keyframes ---------- */
@keyframes ep-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ep-pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ep-slide-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes ep-spin { to { transform: rotate(360deg); } }
@keyframes ep-grow { from { width: 0; } }
@keyframes ep-timer { to { transform: scaleX(0); } }
@keyframes ep-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes ep-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-16px, 18px); } }
@keyframes ep-twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(15deg) scale(1.15); } }

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