/* ==========================================================================
   SiTes Dukcapil — Test & Pre-Test Online
   Design system: Dark Navy + Gold / Blue accent · Plus Jakarta Sans
   Light & Dark mode · Mobile-first
   ========================================================================== */
:root {
    --navy-950: #061029;
    --navy-900: #0b1b3f;
    --navy-800: #13265a;
    --navy-700: #1d3577;
    --blue: #2f6bff;
    --gold: #d4a72c;
    --primary-rgb: 47, 107, 255;
    --accent-rgb: 212, 167, 44;
    --green: #12a150;
    --red: #e04848;
    --amber: #e59a1a;
    --blue-soft: rgba(var(--primary-rgb), .1);
    --gold-soft: rgba(var(--accent-rgb), .16);
    --green-soft: #e3f7ec;
    --red-soft: #fdeaea;
    --amber-soft: #fff3dc;
    --navy-soft: #e6eaf4;
    --ink: #0f1a33;
    --muted: #66728c;
    --line: #e5e9f2;
    --bg: #f3f5fa;
    --card: #ffffff;
    --surface-2: #f7f8fc;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 26, 51, .04), 0 4px 14px rgba(15, 26, 51, .04);
    --shadow: 0 10px 30px rgba(15, 26, 51, .08);
    --shadow-lg: 0 24px 60px rgba(11, 27, 63, .2);
    --sidebar-w: 268px;
    --bs-body-font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-primary: var(--blue);
    --bs-border-color: var(--line);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
}
[data-bs-theme="dark"] {
    --ink: #e7ecf6;
    --muted: #94a1bd;
    --line: #22304f;
    --bg: #0a1122;
    --card: #101a30;
    --surface-2: #142039;
    --green-soft: rgba(18, 161, 80, .16);
    --red-soft: rgba(224, 72, 72, .16);
    --amber-soft: rgba(229, 154, 26, .16);
    --navy-soft: rgba(148, 161, 189, .14);
    --blue-soft: rgba(var(--primary-rgb), .18);
    --gold-soft: rgba(var(--accent-rgb), .18);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-border-color: var(--line);
    --bs-secondary-bg: var(--surface-2);
    --bs-tertiary-bg: var(--surface-2);
    color-scheme: dark;
}

* { -webkit-font-smoothing: antialiased; }
html, body { min-height: 100%; }
body { font-family: var(--bs-body-font-family); color: var(--ink); background: var(--bg); font-size: .935rem; letter-spacing: -.003em; }
a { text-decoration: none; color: var(--blue); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); letter-spacing: -.015em; }
.min-w-0 { min-width: 0; }
.text-muted { color: var(--muted) !important; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.text-reset { color: inherit !important; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons ---------- */
.btn { border-radius: 11px; font-weight: 600; padding: .56rem 1.05rem; transition: transform .15s ease, box-shadow .15s ease, background .15s, color .15s; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .36rem .72rem; border-radius: 9px; }
.btn-lg { padding: .82rem 1.4rem; border-radius: 13px; }
.btn-primary { background: var(--blue); border-color: var(--blue); box-shadow: 0 6px 18px rgba(var(--primary-rgb), .28); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--blue) !important; border-color: var(--blue) !important; filter: brightness(.94); }
.btn-gold { background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 80%, #fff), var(--gold)); color: var(--navy-950); border: 0; box-shadow: 0 6px 18px rgba(var(--accent-rgb), .3); }
.btn-gold:hover, .btn-gold:focus { color: var(--navy-950); filter: brightness(1.05); }
.btn-soft { background: var(--blue-soft); color: var(--blue); border: 0; }
.btn-soft:hover, .btn-soft:focus { background: rgba(var(--primary-rgb), .18); color: var(--blue); }
.btn-soft-danger { background: var(--red-soft); color: var(--red); border: 0; }
.btn-soft-danger:hover { background: rgba(224, 72, 72, .22); color: var(--red); }
.btn-light { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn-light:hover, .btn-light:focus { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .1); }
.btn-ghost-light:hover, .btn-ghost-light:focus { background: rgba(255, 255, 255, .16); color: #fff; }
.btn-icon { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border-radius: 12px; font-size: 1.05rem; flex-shrink: 0; }
.btn:disabled { opacity: .5; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 11px; border-color: var(--line); padding: .62rem .9rem; font-size: .92rem; background-color: var(--card); color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .22rem rgba(var(--primary-rgb), .15); background-color: var(--card); color: var(--ink); }
.form-control::placeholder { color: var(--muted); opacity: .75; }
.form-label { font-weight: 600; font-size: .84rem; margin-bottom: .38rem; }
.form-text { color: var(--muted); }
.form-check-input { border-color: color-mix(in srgb, var(--muted) 55%, transparent); }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-switch { padding-left: 3.4em; }
.form-switch .form-check-input { width: 2.7em; height: 1.4em; cursor: pointer; margin-left: -3.4em; }
.form-switch.m-0 { padding-left: 0; }
.form-switch.m-0 .form-check-input { margin-left: 0; }
@media (max-width: 767.98px) {
    .filter-collapsible .filter-adv { display: none; }
    .filter-collapsible.show-adv .filter-adv { display: block; }
}
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 2; }
.input-icon > .form-control { padding-left: 2.55rem; }
.form-control-color { width: 3.2rem; height: 2.7rem; padding: .3rem; }

/* ---------- Cards ---------- */
.card-x { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-x .card-x-header { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.card-x .card-x-header h2, .card-x .card-x-header h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.card-x .card-x-body { padding: 1.3rem; }
.hover-lift { transition: transform .22s ease, box-shadow .22s ease, border-color .22s; }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(var(--primary-rgb), .25); }

.stat-card { padding: 1.15rem 1.25rem; display: flex; gap: 1rem; align-items: center; position: relative; overflow: hidden; }
.stat-card .stat-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.stat-card .stat-label { color: var(--muted); font-size: .78rem; font-weight: 600; }
.ic-blue { background: var(--blue-soft); color: var(--blue); }
.ic-gold { background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 70%, #000); }
[data-bs-theme="dark"] .ic-gold { color: var(--gold); }
.ic-green { background: var(--green-soft); color: var(--green); }
.ic-red { background: var(--red-soft); color: var(--red); }
.ic-navy { background: var(--navy-soft); color: var(--navy-700); }
[data-bs-theme="dark"] .ic-navy { color: #9fb3e8; }
.ic-amber { background: var(--amber-soft); color: #b3740a; }
.icon-bubble { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.7rem; }

/* ---------- Badges ---------- */
.badge-type { font-size: .66rem; letter-spacing: .07em; font-weight: 800; padding: .38em .72em; border-radius: 7px; display: inline-block; }
.badge-pretest { background: var(--blue-soft); color: var(--blue); }
.badge-test { background: var(--navy-900); color: var(--gold); }
[data-bs-theme="dark"] .badge-test { background: rgba(var(--accent-rgb), .16); }
.badge-soft { font-weight: 600; padding: .42em .75em; border-radius: 999px; }
.bs-green { background: var(--green-soft); color: var(--green); }
.bs-red { background: var(--red-soft); color: var(--red); }
.bs-amber { background: var(--amber-soft); color: #a8690a; }
[data-bs-theme="dark"] .bs-amber { color: #f0b445; }
.bs-gray { background: var(--navy-soft); color: var(--muted); }
.bs-blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); }
.table-x { margin: 0; }
.table-x thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; padding: .85rem 1rem; }
.table-x td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--line); }
.table-x tbody tr { transition: background .15s; }
.table-x tbody tr:hover { background: rgba(var(--primary-rgb), .035); }
.table-x .clickable { cursor: pointer; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: '\F282'; font-family: 'bootstrap-icons'; margin-left: .3rem; opacity: .35; font-size: .7rem; }
th.sortable.asc::after { content: '\F286'; opacity: 1; }
th.sortable.desc::after { content: '\F282'; opacity: 1; }
.user-cell { display: flex; align-items: center; gap: .7rem; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; background: linear-gradient(135deg, var(--blue), color-mix(in srgb, var(--blue) 55%, #fff)); color: #fff; flex-shrink: 0; }
.score-pill { font-weight: 800; padding: .28rem .62rem; border-radius: 9px; display: inline-block; min-width: 54px; text-align: center; }

/* Tabel menjadi kartu di layar kecil: <table class="table-stack"> + <td data-label> */
@media (max-width: 767.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { border-bottom: 1px solid var(--line); padding: .7rem .4rem; }
    .table-stack td { border: 0 !important; padding: .32rem .8rem !important; display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: right !important; }
    .table-stack td::before { content: attr(data-label); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; flex-shrink: 0; }
    .table-stack td[data-label=""]::before, .table-stack td:not([data-label])::before { display: none; }
    .table-stack td.td-main { justify-content: flex-start; text-align: left !important; }
    .table-stack td.td-main::before { display: none; }
    .table-stack td.td-actions { justify-content: flex-end; }
}

/* ---------- Admin shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: radial-gradient(400px 260px at 0% 0%, rgba(var(--accent-rgb), .12), transparent 60%), linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #c7d0e6; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040; transition: transform .28s ease; }
.sidebar .brand { padding: 1.25rem 1.2rem 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff !important; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.15; }
.brand small { font-size: .68rem; font-weight: 500; color: #9fb0d6; letter-spacing: .01em; margin-top: 2px; }
.brand-logo { border-radius: 11px; object-fit: contain; background: #fff; padding: 3px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.side-nav { padding: .25rem .85rem; flex: 1; overflow-y: auto; }
.side-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: #6f80aa; padding: 1rem .7rem .4rem; font-weight: 700; }
.side-nav a { display: flex; align-items: center; gap: .8rem; padding: .66rem .9rem; color: #c7d0e6; border-radius: 11px; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s, transform .15s; }
.side-nav a i { font-size: 1.08rem; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; transform: translateX(2px); }
.side-nav a.active { background: linear-gradient(90deg, rgba(var(--accent-rgb), .22), rgba(var(--accent-rgb), .04)); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-nav a.active i { color: var(--gold); }
.side-footer { padding: 1rem 1.1rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; gap: .7rem; align-items: center; color: #fff; }
.side-user small { color: #9fb0d6; }
.module-pills { display: flex; gap: .4rem; margin-bottom: .9rem; }
.module-pills span { font-size: .7rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.module-pills span i { font-size: .45rem; vertical-align: middle; margin-right: .2rem; }
.module-pills .on i { color: #3ddc84; }
.module-pills .off { color: #8391b3; }
.module-pills .off i { color: #e04848; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); padding: .9rem 1.75rem; display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--line); }
.page-title { font-size: 1.2rem; font-weight: 800; margin: 0; }
.date-chip { align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: .45rem .8rem; border-radius: 999px; }
.content { padding: 1.5rem 1.75rem; flex: 1; }
.app-footer { color: var(--muted); font-size: .8rem; padding: 1.25rem 1.75rem; }
.sidebar-backdrop { display: none; }
.dropdown-menu { border-radius: 14px; padding: .4rem; background: var(--card); }
.dropdown-item { border-radius: 9px; padding: .5rem .75rem; font-weight: 500; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(6, 16, 41, .5); backdrop-filter: blur(2px); z-index: 1030; }
    .main { margin-left: 0; }
    .topbar { padding: .75rem 1rem; }
    .page-title { font-size: 1.05rem; }
    .content { padding: 1rem; }
    .app-footer { padding: 1rem; }
}

/* ---------- User nav ---------- */
.user-nav { background: linear-gradient(90deg, var(--navy-950), var(--navy-800)); padding: .7rem 0; box-shadow: 0 6px 24px rgba(6, 16, 41, .25); }
.nav-pill { display: inline-flex; align-items: center; gap: .45rem; color: #c7d0e6; font-weight: 500; border-radius: 10px; padding: .5rem .85rem; transition: background .15s, color .15s; }
.nav-pill:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-pill.active { color: var(--gold); background: rgba(255, 255, 255, .08); }
.user-main { min-height: calc(100vh - 150px); }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .4rem 0; color: var(--muted); font-size: .7rem; font-weight: 600; border-radius: 12px; }
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--blue); }
.bottom-nav a.active i { transform: translateY(-1px); }
@media (max-width: 991.98px) {
    .layout-user .user-main { padding-bottom: 6rem !important; }
    .layout-user .app-footer { padding-bottom: 5.5rem; }
}

.hero { background: radial-gradient(900px 280px at 100% -10%, rgba(var(--accent-rgb), .38), transparent 60%), radial-gradient(600px 300px at -10% 120%, rgba(var(--primary-rgb), .35), transparent 60%), linear-gradient(120deg, var(--navy-900), var(--navy-700)); color: #fff; border-radius: 24px; padding: 2rem 2.2rem; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero h1 { font-weight: 800; letter-spacing: -.025em; font-size: 1.8rem; color: #fff; }
.hero p { color: #c7d0e6; margin: 0; }
.hero::after { content: ''; position: absolute; right: -60px; bottom: -90px; width: 280px; height: 280px; border-radius: 50%; border: 42px solid rgba(255, 255, 255, .05); }
.hero .hero-logo { width: 74px; height: 74px; border-radius: 20px; background: #fff; padding: 6px; object-fit: contain; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.announcement { border-radius: var(--radius); border: 1px solid rgba(var(--accent-rgb), .35); background: linear-gradient(90deg, var(--gold-soft), transparent); padding: 1rem 1.2rem; display: flex; gap: .9rem; align-items: flex-start; }
.announcement i { color: var(--gold); font-size: 1.3rem; }

.exam-card { padding: 1.3rem; height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.exam-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--blue); opacity: .85; }
.exam-card.is-test::before { background: linear-gradient(90deg, var(--navy-800), var(--gold)); }
.exam-card h3 { font-size: 1.04rem; font-weight: 700; margin: .7rem 0 .35rem; }
.exam-card .meta { display: flex; flex-wrap: wrap; gap: .5rem; color: var(--muted); font-size: .78rem; margin: .8rem 0 1.1rem; }
.exam-card .meta span { background: var(--surface-2); padding: .3rem .6rem; border-radius: 8px; }
.exam-card .meta i { margin-right: .25rem; }

.summary-tile { padding: 1.15rem 1.25rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); height: 100%; position: relative; overflow: hidden; }
.summary-tile .label { padding-right: 2.4rem; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.summary-tile .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; margin-top: .25rem; }
.summary-tile .sub { font-size: .8rem; color: var(--muted); }
.summary-tile .deco { position: absolute; right: 1rem; top: 1rem; font-size: 1.15rem; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.summary-tile.disabled { opacity: .6; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth-side { background: radial-gradient(800px 420px at 0% 100%, rgba(var(--primary-rgb), .38), transparent 60%), radial-gradient(700px 320px at 100% 0%, rgba(var(--accent-rgb), .32), transparent 60%), linear-gradient(140deg, var(--navy-950), var(--navy-800)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); }
.auth-side > * { position: relative; }
.auth-side h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.12; color: #fff; }
.auth-side h1 span { color: var(--gold); }
.auth-side .feature { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; color: #c7d0e6; }
.auth-side .feature i { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; color: var(--gold); flex-shrink: 0; }
.auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--card); position: relative; }
.auth-form .inner { width: 100%; max-width: 410px; }
.auth-logo { width: 72px; height: 72px; border-radius: 20px; background: #fff; padding: 6px; object-fit: contain; box-shadow: var(--shadow); }
.auth-theme { position: absolute; top: 1rem; right: 1rem; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-form { background: radial-gradient(600px 300px at 50% -10%, rgba(var(--primary-rgb), .18), transparent 70%), var(--bg); }
    .auth-form .inner { background: var(--card); padding: 2rem 1.5rem; border-radius: 24px; box-shadow: var(--shadow); border: 1px solid var(--line); }
}

/* ---------- Exam taking ---------- */
.layout-exam { background: var(--bg); }
.exam-topbar { position: sticky; top: 0; z-index: 1030; background: linear-gradient(90deg, var(--navy-950), var(--navy-800)); color: #fff; padding: .7rem 0; box-shadow: 0 6px 24px rgba(6, 16, 41, .3); }
.exam-topbar .title { font-weight: 700; font-size: .98rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.2rem; padding: .4rem .9rem; border-radius: 12px; background: rgba(255, 255, 255, .1); letter-spacing: .03em; display: inline-flex; align-items: center; gap: .45rem; flex-shrink: 0; }
.timer.warn { background: var(--amber); color: var(--navy-950); }
.timer.danger { background: var(--red); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.exam-progress { height: 4px; background: rgba(var(--primary-rgb), .15); position: sticky; top: 62px; z-index: 1029; }
.exam-progress > div { height: 100%; background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 60%, #fff)); transition: width .35s ease; border-radius: 0 4px 4px 0; }
.question-card { padding: 1.8rem; }
.question-no { font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--blue); }
.question-text { font-size: 1.1rem; font-weight: 600; line-height: 1.65; margin: .65rem 0 1.3rem; white-space: pre-wrap; }
.question-img { max-width: 100%; max-height: 360px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 1.25rem; }
.option { display: flex; align-items: flex-start; gap: .9rem; padding: .95rem 1.05rem; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: .7rem; cursor: pointer; transition: border-color .15s, background .15s, transform .1s, box-shadow .15s; background: var(--card); }
.option:hover { border-color: rgba(var(--primary-rgb), .45); background: rgba(var(--primary-rgb), .03); }
.option:active { transform: scale(.995); }
.option input { display: none; }
.option .key { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--muted); flex-shrink: 0; transition: all .15s; }
.option .txt { padding-top: .25rem; white-space: pre-wrap; }
.option.selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 6px 16px rgba(var(--primary-rgb), .12); }
.option.selected .key { background: var(--blue); color: #fff; }
.option.multi .key { border-radius: 7px; }
.q-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: .5rem; }
.q-nav button { aspect-ratio: 1; border-radius: 11px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: .85rem; color: var(--muted); transition: all .15s; }
.q-nav button:hover { border-color: var(--blue); }
.q-nav button.answered { background: var(--green-soft); border-color: rgba(18, 161, 80, .4); color: var(--green); }
.q-nav button.flagged { box-shadow: inset 0 -3px 0 var(--amber); }
.q-nav button.current { border-color: var(--blue); background: var(--blue); color: #fff; }
.save-status { font-size: .8rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; min-height: 1.3rem; }
.save-status.ok { color: var(--green); }
.save-status.err { color: var(--red); }
.save-status.saving { color: var(--blue); }
.legend-dot { width: 13px; height: 13px; border-radius: 4px; display: inline-block; vertical-align: middle; margin-right: .3rem; border: 1.5px solid var(--line); }
.legend-dot.answered { background: var(--green-soft); border-color: rgba(18, 161, 80, .4); }
.legend-dot.flagged { box-shadow: inset 0 -3px 0 var(--amber); }
.legend-dot.current { background: var(--blue); border-color: var(--blue); }
.exam-mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: .6rem .8rem calc(.7rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .08); }
.exam-mobile-bar .btn { padding: .7rem 0; font-size: 1.1rem; }
.nav-sheet { height: auto !important; max-height: 75vh; border-radius: 22px 22px 0 0; background: var(--card); }
@media (max-width: 991.98px) {
    .exam-main { padding-bottom: 8.5rem !important; }
    .exam-progress { top: 58px; }
}

/* ---------- Result pages ---------- */
.result-shell { max-width: 660px; margin: 1.5rem auto; }
.result-card { padding: 2.5rem 2rem; text-align: center; position: relative; overflow: hidden; }
.result-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 140px; background: radial-gradient(400px 140px at 50% 0%, rgba(var(--primary-rgb), .14), transparent 70%); pointer-events: none; }
.score-ring { --val: 0; --clr: var(--blue); width: 196px; height: 196px; border-radius: 50%; margin: 1.25rem auto; display: grid; place-items: center; background: conic-gradient(var(--clr) calc(var(--val) * 1%), var(--surface-2) 0); position: relative; transition: --val 1s; }
.score-ring::before { content: ''; position: absolute; inset: 15px; border-radius: 50%; background: var(--card); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .04); }
.score-ring .inner { position: relative; }
.score-ring .num { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.score-ring .of { color: var(--muted); font-weight: 600; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1.5rem 0; }
.result-stats > div { background: var(--surface-2); border-radius: 14px; padding: .95rem .5rem; }
.result-stats strong { display: block; font-size: 1.5rem; font-weight: 800; }
.result-stats span { font-size: .76rem; color: var(--muted); font-weight: 600; }
.success-icon { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 1.25rem; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 3rem; animation: pop .5s ease both; position: relative; }
.success-icon::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid rgba(18, 161, 80, .25); animation: ripple 1.8s ease-out infinite; }
@keyframes ripple { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.status-banner { display: inline-block; padding: .55rem 1.4rem; border-radius: 999px; font-weight: 800; letter-spacing: .08em; }

.review-item { border-left: 4px solid var(--line); }
.review-item.correct { border-left-color: var(--green); }
.review-item.wrong { border-left-color: var(--red); }
.review-item.pending, .review-item.unanswered { border-left-color: var(--amber); }
.opt-review { padding: .58rem .85rem; border-radius: 11px; margin-bottom: .42rem; border: 1px solid var(--line); display: flex; gap: .6rem; align-items: flex-start; }
.opt-review.is-correct { background: var(--green-soft); border-color: rgba(18, 161, 80, .35); }
.opt-review.is-wrong { background: var(--red-soft); border-color: rgba(224, 72, 72, .35); }

/* ---------- Settings ---------- */
.logo-drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer; }
.logo-drop:hover, .logo-drop.drag { border-color: var(--blue); background: var(--blue-soft); }
.logo-drop img { max-height: 110px; max-width: 100%; object-fit: contain; border-radius: 14px; background: #fff; padding: 6px; }
.module-switch { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); transition: border-color .2s, box-shadow .2s; }
.module-switch.on { border-color: rgba(18, 161, 80, .45); box-shadow: 0 0 0 4px rgba(18, 161, 80, .07); }
.module-switch .form-switch .form-check-input { width: 3.2em; height: 1.7em; }
.module-switch .state { font-size: .75rem; font-weight: 700; }
.module-switch.on .state { color: var(--green); }
.module-switch:not(.on) .state { color: var(--red); }

/* ---------- Misc ---------- */
.soft-alert { border-radius: 14px; border: 0; box-shadow: var(--shadow-sm); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: .75rem; opacity: .45; }
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; }
@media (max-width: 991.98px) { .layout-user .toast-stack, .layout-exam .toast-stack { bottom: 7.5rem; } }
.toast-x { background: var(--navy-900); color: #fff; padding: .78rem 1rem; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 500; font-size: .88rem; display: flex; align-items: center; gap: .55rem; animation: slideIn .25s ease; max-width: 360px; }
.toast-x.success i { color: #5ee0a6; }
.toast-x.error { background: #8f1f1f; }
.toast-x.warning i { color: var(--gold); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.fade-in { animation: fadeIn .4s ease both; }
.fade-in:nth-child(2) { animation-delay: .04s; } .fade-in:nth-child(3) { animation-delay: .08s; } .fade-in:nth-child(4) { animation-delay: .12s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.modal-content { border-radius: 20px; border: 0; box-shadow: var(--shadow-lg); background: var(--card); }
.modal-header { border-bottom: 1px solid var(--line); padding: 1.1rem 1.4rem; }
.modal-header .modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top: 1px solid var(--line); padding: .9rem 1.4rem; }
.chart-box { position: relative; height: 280px; }
.filter-bar .form-control, .filter-bar .form-select { font-size: .85rem; padding: .5rem .75rem; }
.filter-bar .input-icon > .form-control { padding-left: 2.4rem; }
.pagination .page-link { border-radius: 9px !important; margin: 0 2px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .85rem; background: var(--card); }
.pagination .active .page-link { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination .disabled .page-link { background: var(--surface-2); color: var(--muted); }
.instruction-box { background: var(--surface-2); border-radius: 14px; padding: 1.1rem 1.25rem; white-space: pre-wrap; line-height: 1.75; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .5rem 1rem; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.option-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.pool-list { max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; }
.pool-list label { display: flex; gap: .7rem; padding: .72rem .95rem; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.pool-list label:last-child { border-bottom: 0; }
.pool-list label:hover { background: rgba(var(--primary-rgb), .035); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-pills .nav-link { border-radius: 11px; font-weight: 600; color: var(--muted); }
.nav-pills .nav-link.active { background: var(--blue); color: #fff; }
.nav-pills.nav-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-pills.nav-scroll .nav-link { white-space: nowrap; }
.list-group-item { background: var(--card); border-color: var(--line); color: var(--ink); }
hr { border-color: var(--line); opacity: 1; }
code { color: var(--blue); }
.offcanvas { background: var(--card); color: var(--ink); }
.text-bg-light { background: var(--surface-2) !important; color: var(--ink) !important; }
.tab-badge { margin-left: .2rem; font-size: .7rem; }
.timeline-item { display: flex; gap: .85rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item .dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; font-size: .95rem; }

@media (max-width: 575.98px) {
    body { font-size: .92rem; }
    .hero { padding: 1.4rem; border-radius: 20px; }
    .hero h1 { font-size: 1.35rem; }
    .hero .hero-logo { width: 54px; height: 54px; border-radius: 15px; }
    .question-card { padding: 1.2rem; }
    .question-text { font-size: 1rem; }
    .result-card { padding: 2rem 1.2rem; }
    .score-ring { width: 164px; height: 164px; }
    .score-ring .num { font-size: 2.5rem; }
    .kv { grid-template-columns: 105px 1fr; }
    .stat-card { padding: 1rem; gap: .75rem; }
    .stat-card .stat-icon { width: 42px; height: 42px; font-size: 1.15rem; border-radius: 13px; }
    .stat-card .stat-value { font-size: 1.3rem; }
    .summary-tile .value { font-size: 1.35rem; }
    .chart-box { height: 240px; }
    .timer { font-size: 1.05rem; padding: .35rem .7rem; }
    .card-x .card-x-header, .card-x .card-x-body { padding: 1rem; }
}
@media print {
    .sidebar, .topbar, .no-print, .app-footer, .bottom-nav, .user-nav { display: none !important; }
    .main { margin: 0 !important; }
    body { background: #fff; }
}
