:root {
    --navy: #0d2b6b;
    --navy-2: #092158;
    --navy-3: #071c49;
    --maroon: #8b0000;
    --cream: #F2F0EA;
    --tosca: #A8D5E3;
    --pink: #FF78AC;
    --bg: #f4f6fb;
    --text: #172033;
    --muted: #6b7280;
    --line: rgba(15, 23, 42, .08);
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --sidebar-width: 300px;
}

* { box-sizing: border-box; }
body {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { text-decoration: none; }
.min-w-0 { min-width: 0; }

.text-login-title-dark {
    color: #071a3d !important;
    font-weight: 800;
    letter-spacing: 0.2px;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95),
        0 3px 8px rgba(13, 43, 107, 0.22),
        0 0 14px rgba(168, 213, 227, 0.55);
}

.text-login-subtitle-dark {
    color: #102a43 !important;
    font-weight: 600;
    letter-spacing: 0.1px;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 6px rgba(13, 43, 107, 0.18);
}

.text-login-footer-dark {
    color: #0d2b6b !important;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 8px rgba(13, 43, 107, 0.22);
}

.login-page {
    background:
        radial-gradient(circle at top left, rgba(168, 213, 227, .9), transparent 32%),
        radial-gradient(circle at bottom right, rgba(255, 120, 172, .6), transparent 34%),
        linear-gradient(135deg, var(--navy), var(--maroon));
}
.login-card { width: min(980px, 100%); border-radius: 1.5rem; overflow: hidden; }
.login-brand-panel {
    background: linear-gradient(155deg, rgba(13, 43, 107, .96), rgba(139, 0, 0, .92)), url('../img/logo_madrasah.png');
    background-size: cover;
    min-height: 540px;
}
.text-white-75 { color: rgba(255, 255, 255, .76); }
.brand-logo, .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-weight: 800;
    letter-spacing: .04em;
}
.brand-logo { width: 72px; height: 72px; color: var(--navy); background: #fff; }
.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: #092158; --bs-btn-hover-border-color: #092158; }

.brand-logo-wrap {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.brand-logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    display: block;
}
/* Admin shell refresh */
.admin-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(168, 213, 227, .35), transparent 30%),
        radial-gradient(circle at 88% 22%, rgba(255, 120, 172, .13), transparent 28%),
        linear-gradient(180deg, #f7f9fd 0%, #eef3f9 100%);
}
.admin-shell { display: flex; min-height: 100vh; }
.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1028;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
}
.admin-sidebar {
    width: var(--sidebar-width);
    background:
        radial-gradient(circle at 20% 8%, rgba(168, 213, 227, .22), transparent 32%),
        linear-gradient(180deg, #0d2b6b 0%, #071c49 62%, #041235 100%);
    color: #fff;
    padding: 1rem;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1030;
    transition: transform .22s ease;
    box-shadow: 12px 0 35px rgba(7, 28, 73, .2);
}
.admin-sidebar::-webkit-scrollbar { width: 8px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 999px; }
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .65rem .45rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .13);
    margin-bottom: .85rem;
}
.brand-mark { width: 48px; height: 48px; background: #fff; color: var(--navy); font-size: 1.2rem; box-shadow: 0 16px 28px rgba(0,0,0,.18); }
.brand-title { font-weight: 800; line-height: 1.1; }
.brand-subtitle { font-size: .76rem; color: rgba(255, 255, 255, .66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .75rem .15rem 1rem;
    padding: .75rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 1rem;
    background: rgba(255,255,255,.08);
}
.profile-avatar, .user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    flex: 0 0 auto;
}
.profile-avatar { width: 38px; height: 38px; background: var(--tosca); color: var(--navy); }
.sidebar-profile strong { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile small { color: rgba(255,255,255,.66); font-size: .74rem; }
.sidebar-nav { display: grid; gap: .35rem; }
.sidebar-group { display: grid; gap: .2rem; }
.sidebar-link, .sidebar-sublink {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255, 255, 255, .84);
    border: 0;
    background: transparent;
    text-align: left;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.sidebar-link {
    padding: .8rem .85rem;
    border-radius: 1rem;
    font-weight: 600;
}
.sidebar-link:hover, .sidebar-link.active, .sidebar-link:not(.collapsed) {
    color: #fff;
    background: rgba(255, 255, 255, .13);
}
.sidebar-link:hover { transform: translateX(2px); }
.sidebar-link i:first-child { font-size: 1.05rem; width: 22px; text-align: center; }
.toggle-icon { transition: transform .2s ease; font-size: .8rem; }
.sidebar-toggle:not(.collapsed) .toggle-icon { transform: rotate(180deg); }
.sidebar-submenu {
    display: grid;
    gap: .15rem;
    margin: .15rem 0 .35rem 1.05rem;
    padding: .25rem 0 .25rem .75rem;
    border-left: 1px solid rgba(255,255,255,.16);
}
.sidebar-sublink {
    padding: .58rem .65rem;
    border-radius: .78rem;
    font-size: .88rem;
    position: relative;
}
.sidebar-sublink:hover, .sidebar-sublink.active { color: #fff; background: rgba(255,255,255,.11); }
.sidebar-sublink i { width: 20px; text-align: center; }
.sidebar-sublink em {
    margin-left: auto;
    font-style: normal;
    font-size: .64rem;
    padding: .15rem .38rem;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: rgba(255,255,255,.72);
}
.sidebar-sublink.disabled { opacity: .5; pointer-events: none; }
.sidebar-footer-note {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    margin: 1.15rem .1rem .25rem;
    padding: .85rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(168,213,227,.18), rgba(255,120,172,.12));
    border: 1px solid rgba(255,255,255,.12);
}
.sidebar-footer-note i { color: var(--tosca); }
.sidebar-footer-note strong { display: block; font-size: .82rem; }
.sidebar-footer-note small { display: block; color: rgba(255,255,255,.64); font-size: .72rem; }

.admin-main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1.5rem;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar-title span { display: block; font-size: .78rem; color: var(--muted); }
.topbar-title strong { display: block; font-size: 1.05rem; }
.topbar-actions { display: flex; align-items: center; gap: .55rem; }
.btn-topbar, .user-menu {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}
.user-menu { display: inline-flex; align-items: center; gap: .5rem; }
.user-avatar { width: 28px; height: 28px; background: var(--navy); color: #fff; font-size: .78rem; }
.admin-content { padding: 1.5rem; flex: 1; }
.admin-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(15, 23, 42, .08);
    background: rgba(255,255,255,.82);
    font-size: .875rem;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: 1.35rem;
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(242,240,234,.82));
    border: 1px solid rgba(255,255,255,.7);
    box-shadow: 0 14px 38px rgba(15, 23, 42, .06);
}
.page-heading h1 { letter-spacing: -.02em; }
.page-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.card, .modal-content { border-radius: 1.15rem; }
.card { border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 12px 34px rgba(15, 23, 42, .055); }
.card-header { border-top-left-radius: 1.15rem !important; border-top-right-radius: 1.15rem !important; background: #fff; }
.table { --bs-table-bg: transparent; }
.table thead th {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #667085;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: rgba(168, 213, 227, .14); }
.form-control, .form-select { border-radius: .85rem; border-color: rgba(15,23,42,.12); }
.form-control:focus, .form-select:focus { border-color: rgba(13,43,107,.45); box-shadow: 0 0 0 .22rem rgba(13,43,107,.1); }
.btn { border-radius: .85rem; font-weight: 600; }
.dropdown-menu { border-radius: 1rem; padding: .5rem; }
.dropdown-item { border-radius: .7rem; }
.badge { border-radius: 999px; }

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem;
    background: rgba(255,255,255,.96);
    border-radius: 1.25rem;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
    border: 1px solid rgba(15, 23, 42, .05);
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
    position: relative;
}
.stat-card::after {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    right: -36px;
    top: -36px;
    background: rgba(168,213,227,.22);
    border-radius: 50%;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 18px 45px rgba(15, 23, 42, .09); }
.stat-icon { width: 52px; height: 52px; border-radius: 1rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: 0 0 auto; }
.stat-label { color: var(--muted); font-size: .84rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.soft-card { background: linear-gradient(145deg, #fff, var(--cream)); }

.hero-card {
    background:
        radial-gradient(circle at 90% 10%, rgba(255,120,172,.18), transparent 26%),
        linear-gradient(135deg, var(--navy), #12377f 58%, var(--maroon));
    color: #fff;
    border: 0;
    border-radius: 1.45rem;
    overflow: hidden;
}
.hero-card .text-muted { color: rgba(255,255,255,.72) !important; }
.hero-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(255,255,255,.14); color: rgba(255,255,255,.86); font-size: .78rem; }
.quick-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    color: var(--text);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(13,43,107,.18); }
.quick-card i { width: 38px; height: 38px; border-radius: .9rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(168,213,227,.3); color: var(--navy); }
.quick-card small { color: var(--muted); display: block; }
.timeline-list { display: grid; gap: .85rem; }
.timeline-item { display: grid; grid-template-columns: 24px 1fr; gap: .75rem; align-items: start; }
.timeline-item span { width: 14px; height: 14px; border-radius: 50%; margin-top: .25rem; background: var(--tosca); box-shadow: 0 0 0 5px rgba(168, 213, 227, .28); }
.timeline-item.done span { background: var(--navy); }
.timeline-item.next span { background: var(--pink); box-shadow: 0 0 0 5px rgba(255, 120, 172, .2); }

/* Existing module support */
.kelas-check-card { border: 1px solid rgba(15, 23, 42, .08); border-radius: 1rem; padding: 1rem; background: linear-gradient(145deg, #fff, rgba(242, 240, 234, .58)); }
.relasi-check { padding: .45rem .55rem .45rem 1.95rem; border-radius: .75rem; background: rgba(255, 255, 255, .78); border: 1px solid rgba(15, 23, 42, .05); }
.relasi-check:hover { background: rgba(168, 213, 227, .22); }
.relasi-summary-table { max-height: 380px; overflow: auto; }
.bank-form-card { top: 1rem; }
.bank-kelas-list { display: grid; gap: .45rem; max-height: 260px; overflow: auto; }
.bank-target-table input { min-width: 78px; }
.btn-group form { display: inline-flex; }
.html-editor { background: #fff; overflow-y: auto; }
.html-editor:focus { border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13,110,253,.25); outline: 0; }
.rendered-html img, .html-editor img { max-width: 100%; height: auto; }
.soal-review-card .card-body { line-height: 1.7; }
.question-block.d-none { display: none !important; }
.question-content img, .rendered-html img, .html-editor img, .soal-img { max-width: 100%; width: auto; max-height: 360px; object-fit: contain; display: block; margin: 12px auto; border-radius: 10px; border: 1px solid rgba(15, 23, 42, .08); }
.answer-option img { max-width: 280px; max-height: 220px; object-fit: contain; }
.html-editor img.is-selected { outline: 3px solid var(--pink); outline-offset: 2px; }
.rtl-content, [dir="rtl"] { direction: rtl; text-align: right; font-family: 'Poppins', Tahoma, Arial, sans-serif; }
.soal-table td { vertical-align: middle; }
.soal-summary { min-width: 280px; }
.editor-toolbar { gap: .25rem; }
.editor-toolbar .btn { border-radius: .55rem !important; }
.stat-mini { border: 1px solid rgba(13, 43, 107, 0.12); border-radius: 14px; padding: 12px 14px; background: #f8fafc; }
.stat-mini span { display: block; font-size: 12px; color: #6c757d; }
.stat-mini strong { display: block; font-size: 18px; color: #0d2b6b; }
.token-display { font-size: 2rem; font-weight: 800; letter-spacing: .24rem; text-align: center; background: #0d2b6b; color: #fff; border-radius: 16px; padding: 16px 12px; cursor: pointer; user-select: all; }
.token-card { border-top: 5px solid #A8D5E3 !important; }
.token-copy { cursor: pointer; }

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-overlay.show { display: block; }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 1rem; }
    .admin-footer, .page-heading { flex-direction: column; align-items: flex-start; }
    .page-heading { padding: 1rem; }
}
@media (max-width: 575.98px) {
    .topbar-title span { display: none; }
    .admin-topbar { padding: .7rem 1rem; }
    .stat-card { padding: 1rem; }
}
@media print {
    .admin-sidebar, .admin-topbar, .no-print, .btn, .card-footer { display: none !important; }
    .admin-main, .admin-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .d-print-block { display: block !important; }
    .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd !important; }
    .token-display { color: #000 !important; background: #f1f1f1 !important; border: 2px dashed #000; }
}

/* Tahap 8C - Revisi total UI admin agar sidebar dropdown rapi dan warna lebih premium */
:root {
    --admin-sidebar-width: 292px;
    --admin-navy: #0f172a;
    --admin-navy-2: #111c3a;
    --admin-indigo: #1e3a8a;
    --admin-teal: #14b8a6;
    --admin-teal-soft: #ccfbf1;
    --admin-gold: #f59e0b;
    --admin-bg: #f8fafc;
    --admin-card: #ffffff;
    --admin-text: #0f172a;
    --admin-muted: #64748b;
    --admin-border: #e2e8f0;
    --admin-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

body.admin-body.theme-8c {
    background:
        radial-gradient(circle at 0% 0%, rgba(20, 184, 166, .13), transparent 28%),
        radial-gradient(circle at 100% 0%, rgba(245, 158, 11, .12), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: var(--admin-text);
}

.theme-8c .admin-sidebar {
    width: var(--admin-sidebar-width);
    padding: 16px 14px;
    background:
        radial-gradient(circle at 18% 0%, rgba(20, 184, 166, .20), transparent 28%),
        linear-gradient(180deg, #0f172a 0%, #111c3a 58%, #08111f 100%);
    box-shadow: 14px 0 40px rgba(15, 23, 42, .22);
}

.theme-8c .admin-main { margin-left: var(--admin-sidebar-width); }

.theme-8c .sidebar-brand {
    padding: 8px 8px 16px;
    gap: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, .12);
    margin-bottom: 12px;
}

.theme-8c .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--admin-teal), #60a5fa);
    color: #fff;
    box-shadow: 0 12px 28px rgba(20, 184, 166, .26);
}

.theme-8c .brand-text { min-width: 0; }
.theme-8c .brand-title { font-size: .98rem; color: #fff; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-8c .brand-subtitle { color: rgba(226, 232, 240, .72); font-size: .75rem; }

.theme-8c .sidebar-profile {
    margin: 0 2px 14px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(15, 23, 42, .42);
    border: 1px solid rgba(226, 232, 240, .12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.theme-8c .profile-avatar,
.theme-8c .user-avatar {
    background: var(--admin-teal-soft);
    color: #0f766e;
}

.theme-8c .profile-info { min-width: 0; }
.theme-8c .profile-info strong { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-8c .profile-info small { display: block; color: rgba(226, 232, 240, .68); font-size: .73rem; }

.theme-8c .admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-8c .admin-nav-label {
    margin: 14px 10px 6px;
    font-size: .68rem;
    font-weight: 800;
    color: rgba(226, 232, 240, .50);
    text-transform: uppercase;
    letter-spacing: .12em;
}

.theme-8c .admin-nav-link,
.theme-8c .admin-nav-parent,
.theme-8c .admin-nav-child {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(241, 245, 249, .82);
    border: 0;
    text-align: left;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.theme-8c .admin-nav-link,
.theme-8c .admin-nav-parent {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 13px;
    background: transparent;
    font-weight: 700;
    border: 1px solid transparent;
}

.theme-8c .admin-nav-link > i,
.theme-8c .admin-nav-parent .nav-icon-main {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    color: rgba(204, 251, 241, .92);
}

.theme-8c .admin-nav-link:hover,
.theme-8c .admin-nav-parent:hover,
.theme-8c .admin-nav-link.active,
.theme-8c .admin-nav-parent:not(.collapsed) {
    color: #fff;
    background: rgba(255, 255, 255, .09);
    border-color: rgba(226, 232, 240, .11);
}

.theme-8c .admin-nav-link.active {
    background: linear-gradient(135deg, rgba(20, 184, 166, .28), rgba(30, 58, 138, .22));
    box-shadow: inset 3px 0 0 var(--admin-teal);
}

.theme-8c .nav-chevron {
    margin-left: auto;
    font-size: .78rem;
    color: rgba(226, 232, 240, .54);
    transition: transform .18s ease;
}
.theme-8c .admin-nav-parent:not(.collapsed) .nav-chevron { transform: rotate(180deg); color: #fff; }

.theme-8c .admin-nav-children {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 5px 0 8px 16px;
    padding-left: 13px;
}
.theme-8c .admin-nav-children::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: linear-gradient(180deg, rgba(20, 184, 166, .65), rgba(226, 232, 240, .08));
}

.theme-8c .admin-nav-child {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 600;
    color: rgba(226, 232, 240, .74);
    line-height: 1.25;
}
.theme-8c .admin-nav-child i {
    width: 19px;
    text-align: center;
    font-size: .9rem;
    color: rgba(204, 251, 241, .72);
}
.theme-8c .admin-nav-child span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.theme-8c .admin-nav-child:hover,
.theme-8c .admin-nav-child.active {
    color: #fff;
    background: rgba(20, 184, 166, .16);
}
.theme-8c .admin-nav-child.active {
    box-shadow: inset 3px 0 0 var(--admin-gold);
}
.theme-8c .admin-nav-child small {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .18);
    color: #fde68a;
    font-size: .63rem;
    font-weight: 700;
    white-space: nowrap;
}
.theme-8c .admin-nav-child.disabled { opacity: .54; pointer-events: none; }

.theme-8c .sidebar-footer-note {
    margin-top: 16px;
    padding: 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(20, 184, 166, .16), rgba(245, 158, 11, .10));
    border: 1px solid rgba(226, 232, 240, .12);
}
.theme-8c .sidebar-footer-note i { color: #5eead4; }
.theme-8c .sidebar-footer-note strong { color: #fff; }
.theme-8c .sidebar-footer-note small { color: rgba(226, 232, 240, .66); }

.theme-8c .admin-topbar {
    min-height: 72px;
    background: rgba(255, 255, 255, .90);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--admin-border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.theme-8c .topbar-title span { color: var(--admin-muted); font-weight: 600; }
.theme-8c .topbar-title strong { color: var(--admin-text); font-weight: 800; }
.theme-8c .btn-topbar,
.theme-8c .user-menu {
    border-color: var(--admin-border);
    background: #fff;
    color: var(--admin-text);
    border-radius: 12px;
    box-shadow: none;
}
.theme-8c .btn-topbar:hover,
.theme-8c .user-menu:hover {
    border-color: rgba(20, 184, 166, .45);
    background: #f0fdfa;
}

.theme-8c .admin-content { padding: 24px; }
.theme-8c .page-heading,
.theme-8c .card,
.theme-8c .stat-card,
.theme-8c .quick-card,
.theme-8c .modal-content {
    border-color: rgba(226, 232, 240, .9);
    box-shadow: var(--admin-shadow);
}
.theme-8c .page-heading {
    background: linear-gradient(135deg, #fff, #f8fafc);
}
.theme-8c .card-header {
    background: linear-gradient(180deg, #fff, #fbfdff);
    border-bottom-color: var(--admin-border);
}
.theme-8c .table thead th {
    background: #f1f5f9;
    color: #475569;
}
.theme-8c .table-hover tbody tr:hover { background: rgba(20, 184, 166, .08); }
.theme-8c .btn-primary {
    --bs-btn-bg: #1e3a8a;
    --bs-btn-border-color: #1e3a8a;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
}
.theme-8c .btn-success {
    --bs-btn-bg: #0f766e;
    --bs-btn-border-color: #0f766e;
    --bs-btn-hover-bg: #0d9488;
    --bs-btn-hover-border-color: #0d9488;
}
.theme-8c .dropdown-menu {
    border: 1px solid var(--admin-border) !important;
    border-radius: 14px;
}
.theme-8c .dropdown-item { border-radius: 10px; }
.theme-8c .dropdown-item:hover { background: #f0fdfa; color: #0f766e; }

@media (max-width: 991.98px) {
    .theme-8c .admin-main { margin-left: 0; }
    .theme-8c .admin-sidebar { transform: translateX(-100%); }
    .theme-8c .admin-sidebar.show { transform: translateX(0); }
    .theme-8c .admin-overlay.show { display: block; }
    .theme-8c .admin-content { padding: 16px; }
}


/* Tahap 9 - Area Siswa & Ujian */
.siswa-body{font-family:'Poppins',sans-serif;background:linear-gradient(135deg,#eef6ff 0%,#f8fafc 45%,#fff7ed 100%);min-height:100vh;color:#0f172a}.siswa-navbar{background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-bottom:1px solid rgba(226,232,240,.9);box-shadow:0 10px 30px rgba(15,23,42,.06)}.siswa-brand-mark{width:40px;height:40px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,#1e3a8a,#0f766e);color:#fff}.siswa-navbar .navbar-brand strong{display:block;line-height:1;color:#0f172a}.siswa-navbar .navbar-brand small{display:block;color:#64748b;font-size:.72rem;font-weight:700}.siswa-main{max-width:1440px}.siswa-hero,.result-hero{border-radius:28px;background:linear-gradient(135deg,#1e3a8a,#0f766e);color:#fff;padding:28px;display:flex;align-items:center;justify-content:space-between;gap:20px;box-shadow:0 24px 50px rgba(15,23,42,.18)}.siswa-card,.token-card{border-radius:24px;overflow:hidden}.siswa-table thead th{background:#f1f5f9;color:#475569;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}.token-icon{width:74px;height:74px;border-radius:24px;background:linear-gradient(135deg,#dbeafe,#ccfbf1);display:grid;place-items:center;margin:0 auto 16px;color:#1e3a8a;font-size:2rem}.token-input{letter-spacing:.25em;font-weight:800;text-transform:uppercase}.exam-summary{border:1px solid #e2e8f0;border-radius:18px;padding:16px;background:#f8fafc}.exam-shell{position:relative}.exam-topbar{position:sticky;top:72px;z-index:5;background:rgba(255,255,255,.95);backdrop-filter:blur(14px);border:1px solid #e2e8f0;border-radius:22px;padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px}.timer-box{font-size:1.45rem;font-weight:900;font-variant-numeric:tabular-nums;background:#0f172a;color:#fef3c7;border-radius:16px;padding:10px 16px;min-width:132px;text-align:center}.exam-question-card{display:none;background:#fff;border:1px solid #e2e8f0;border-radius:24px;padding:24px;box-shadow:0 18px 45px rgba(15,23,42,.08)}.exam-question-card.active{display:block}.question-content{font-size:1.02rem;line-height:1.72}.question-content img,.rendered-html img{max-width:100%;max-height:360px;object-fit:contain;display:block;margin:12px auto;border-radius:12px}.rtl-content{direction:rtl;text-align:right;font-family:'Poppins',Tahoma,Arial,sans-serif}.exam-option{display:flex;align-items:flex-start;gap:12px;border:1px solid #e2e8f0;border-radius:18px;padding:14px 16px;margin-bottom:12px;background:#fff;cursor:pointer;transition:.15s}.exam-option:hover{border-color:#14b8a6;background:#f0fdfa}.option-code{display:inline-grid;place-items:center;min-width:34px;height:34px;border-radius:12px;background:#e0f2fe;color:#1e3a8a;font-weight:900}.option-text{flex:1}.ragu-check{background:#fff7ed;border:1px solid #fed7aa;border-radius:14px;padding:10px 14px 10px 38px}.exam-nav-panel{top:154px;background:#fff;border:1px solid #e2e8f0;border-radius:24px;padding:18px;box-shadow:0 18px 45px rgba(15,23,42,.08)}.question-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(42px,1fr));gap:8px}.qnum{height:42px;border-radius:14px;border:1px solid #cbd5e1;background:#fff;color:#334155;font-weight:800}.qnum.active{background:#1e3a8a;color:#fff;border-color:#1e3a8a}.qnum.answered{background:#dcfce7;border-color:#86efac;color:#166534}.qnum.doubt{background:#fef3c7;border-color:#facc15;color:#92400e}.qnum.active.answered,.qnum.active.doubt{outline:3px solid rgba(30,58,138,.22)}.dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:#cbd5e1}.dot.answered{background:#22c55e}.dot.doubt{background:#f59e0b}.matching-row{display:grid;grid-template-columns:1fr 105px;gap:12px;align-items:center;border:1px solid #e2e8f0;border-radius:14px;padding:12px;margin-bottom:10px;background:#f8fafc}.matching-right{border:1px solid #e2e8f0;border-radius:14px;padding:12px;margin-bottom:10px;background:#fff}.result-score{background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.25);border-radius:22px;padding:16px 22px;text-align:center}.result-score span{display:block;font-size:.8rem;opacity:.78}.result-score strong{display:block;font-size:2.8rem;line-height:1}.mini-stat{background:#fff;border:1px solid #e2e8f0;border-radius:22px;padding:18px;box-shadow:0 14px 35px rgba(15,23,42,.06)}.mini-stat span{display:block;color:#64748b;font-size:.82rem}.mini-stat strong{font-size:2rem;color:#0f172a}@media(max-width:991.98px){.siswa-hero,.result-hero,.exam-topbar{align-items:flex-start;flex-direction:column}.exam-topbar{top:64px}.timer-box{width:100%}.matching-row{grid-template-columns:1fr}.exam-question-card{padding:18px}.exam-nav-panel{position:static!important}.result-score{width:100%}}

/* Tahap 9A FIX - UI menjodohkan siswa lebih profesional */
.matching-pro-card{border:1px solid #dbe4f0;border-radius:22px;background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);overflow:hidden;box-shadow:0 14px 34px rgba(15,23,42,.06)}
.matching-instruction{padding:14px 16px;background:#ecfeff;border-bottom:1px solid #bae6fd;color:#0f172a;font-size:.92rem;line-height:1.55}
.matching-table{background:#fff}.matching-table thead th{background:#0f172a;color:#fff;border:0;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}.matching-table tbody td{border-color:#e2e8f0;padding:14px 12px}.matching-table tbody tr:hover{background:#f8fafc}.matching-num{display:inline-grid;place-items:center;min-width:38px;height:38px;border-radius:14px;background:#dbeafe;color:#1e3a8a;font-weight:900}.matching-left-text{font-weight:650;color:#0f172a;line-height:1.65}.matching-select{border-radius:14px;border-color:#cbd5e1;font-weight:650}.matching-select:focus{border-color:#14b8a6;box-shadow:0 0 0 .2rem rgba(20,184,166,.18)}.matching-bank{padding:16px;background:#f8fafc;border-top:1px solid #e2e8f0}.matching-bank-title{font-weight:850;color:#0f172a;margin-bottom:10px}.matching-choice{height:100%;display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid #e2e8f0;border-radius:16px;background:#fff}.matching-code{display:inline-grid;place-items:center;flex:0 0 34px;width:34px;height:34px;border-radius:12px;background:#fef3c7;color:#92400e;font-weight:900}.matching-choice-text{line-height:1.6;color:#334155}.rtl-content .matching-table,.rtl-content .matching-bank{direction:rtl;text-align:right}@media(max-width:767.98px){.matching-table thead{display:none}.matching-table,.matching-table tbody,.matching-table tr,.matching-table td{display:block;width:100%}.matching-table tr{border-bottom:1px solid #e2e8f0}.matching-table tbody td{border:0;padding:10px 12px}.matching-table tbody td:first-child{padding-top:16px}.matching-table tbody td:last-child{padding-bottom:16px}}

/* Tahap 10 - Anti-cheat notice */
.anti-cheat-notice{
    position:fixed;
    right:18px;
    bottom:18px;
    z-index:9999;
    width:min(360px, calc(100vw - 32px));
    background:#111827;
    color:#fff;
    border-left:5px solid #f59e0b;
    border-radius:16px;
    padding:14px 16px;
    box-shadow:0 18px 45px rgba(15,23,42,.28);
    opacity:0;
    transform:translateY(14px);
    pointer-events:none;
    transition:.2s ease;
}
.anti-cheat-notice.show{opacity:1;transform:translateY(0)}
.anti-cheat-fs-btn{white-space:nowrap;border-radius:999px;font-weight:700;}
@media (max-width: 768px){.anti-cheat-fs-btn{width:100%;margin-top:.5rem}.exam-topbar{align-items:stretch}}


/* Tahap 10A FIX - status anti-cheat lebih terlihat */
.anti-cheat-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(16, 185, 129, .12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, .28);
}
.anti-cheat-status.is-warn {
    background: rgba(245, 158, 11, .13);
    color: #92400e;
    border-color: rgba(245, 158, 11, .35);
}
.anti-cheat-status.is-error {
    background: rgba(239, 68, 68, .13);
    color: #991b1b;
    border-color: rgba(239, 68, 68, .35);
}
.dot-live {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}
.anti-cheat-notice {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99999;
    min-width: 290px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, .35);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: .22s ease;
}
.anti-cheat-notice.show {
    opacity: 1;
    transform: translateY(0);
}
.anti-cheat-notice.is-ok {
    background: #ecfdf5;
    color: #047857;
    border-color: rgba(16, 185, 129, .35);
}
.anti-cheat-notice.is-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: rgba(239, 68, 68, .35);
}
@media (max-width: 768px) {
    .anti-cheat-status { width: 100%; justify-content: center; }
    .anti-cheat-notice { left: 12px; right: 12px; bottom: 12px; min-width: auto; }
}

/* Tahap 12 - Portal Pengawas */
.pengawas-body .brand-mark,
.pengawas-body .profile-avatar {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}
.pengawas-body .admin-nav-link.active,
.pengawas-body .admin-nav-link:hover {
    border-color: rgba(45, 212, 191, .45);
}
.token-card {
    border-radius: 22px;
    overflow: hidden;
}
.token-display {
    background: linear-gradient(135deg, rgba(20,184,166,.12), rgba(13,43,107,.08));
    border: 1px dashed rgba(15,118,110,.35);
    border-radius: 20px;
    padding: 22px;
}
.token-value {
    font-size: clamp(2rem, 5vw, 3.4rem);
    letter-spacing: .2em;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}
.info-tile {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 10px 12px;
    min-height: 64px;
}
.info-tile span {
    display: block;
    color: #64748b;
    font-size: .78rem;
}
.info-tile strong {
    display: block;
    color: #0f172a;
    font-weight: 700;
    margin-top: 2px;
}
@media print {
    .admin-sidebar, .admin-topbar, .admin-footer, .no-print, .admin-overlay { display: none !important; }
    .admin-main, .admin-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .card { box-shadow: none !important; border: 1px solid #d1d5db !important; break-inside: avoid; }
    body { background: #fff !important; }
}

/* Tahap 13 - Laporan & Cetak */
.feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20,184,166,.14), rgba(245,158,11,.18));
    color: #0f766e;
    font-size: 1.35rem;
    flex: 0 0 auto;
}
@media print {
    .admin-sidebar,
    .admin-topbar,
    .admin-overlay,
    .btn,
    form,
    .page-header .d-flex { display: none !important; }
    .admin-main { margin: 0 !important; }
    .admin-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* Tahap 21 - Aturan waktu ujian ketat */
.exam-time-policy {
  border: 1px solid rgba(13, 43, 107, .12);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(13, 43, 107, .05), rgba(168, 213, 227, .18));
  padding: 1rem;
}
.exam-time-policy .badge {
  font-size: .78rem;
  letter-spacing: .01em;
}
.siswa-table td .btn[disabled] {
  cursor: not-allowed;
}
/* FIX LOGO SISWA - logo_madrasah.png kecil dan rapi */
.siswa-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #101828;
}

.siswa-brand-logo {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    background: #ffffff !important;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 18px rgba(13, 43, 107, 0.12);
}

.siswa-brand-logo img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: contain !important;
    display: block !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
}

.siswa-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.siswa-brand-text strong {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.siswa-brand-text small {
    font-size: 0.78rem;
    color: #667085;
    font-weight: 600;
}

/* Matikan kemungkinan logo besar yang terbawa dari CSS lama */
.siswa-body .brand-logo,
.siswa-body .login-logo,
.siswa-body .sidebar-logo,
.siswa-body .school-logo,
.siswa-body img[src*="logo_madrasah"] {
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

/* Hindari logo menjadi background besar di dashboard siswa */
.siswa-body::before,
.siswa-body .dashboard-hero::before,
.siswa-body .student-hero::before {
    background-image: none !important;
}
/* Logo kecil portal guru/pengawas/admin */
.brand-logo-wrap {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-logo-white {
    background: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.brand-logo-img {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: contain !important;
    display: block;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    opacity: 1 !important;
}

.brand-logo-fallback {
    display: none;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    color: #0d2b6b;
    font-size: 1.2rem;
}

/* Cegah logo madrasah melebar di sidebar */
.admin-sidebar img[src*="logo_madrasah"] {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    object-fit: contain !important;
}

/* =========================================================
   GLOBAL FONT SIZE TUNING - HOSTING/PRODUCTION
   Menurunkan ukuran font agar tampilan lebih proporsional
   ========================================================= */

html {
    font-size: 14px;
}

body {
    font-size: 0.92rem;
    line-height: 1.45;
}

/* Judul halaman */
h1, .h1 {
    font-size: 1.55rem;
}

h2, .h2 {
    font-size: 1.35rem;
}

h3, .h3 {
    font-size: 1.2rem;
}

h4, .h4 {
    font-size: 1.05rem;
}

h5, .h5 {
    font-size: 0.98rem;
}

h6, .h6 {
    font-size: 0.9rem;
}

/* Topbar dan judul halaman */
.topbar-title span {
    font-size: 0.72rem;
}

.topbar-title strong {
    font-size: 0.98rem;
}

/* Sidebar */
.brand-title {
    font-size: 0.95rem;
}

.brand-subtitle {
    font-size: 0.7rem;
}

.admin-nav-label {
    font-size: 0.65rem;
}

.admin-nav-link {
    font-size: 0.86rem;
    padding-top: 0.62rem;
    padding-bottom: 0.62rem;
}

.sidebar-profile strong {
    font-size: 0.82rem;
}

.sidebar-profile small {
    font-size: 0.68rem;
}

.sidebar-footer-note strong {
    font-size: 0.78rem;
}

.sidebar-footer-note small {
    font-size: 0.65rem;
}

/* Card dashboard */
.card-title,
.stat-title {
    font-size: 0.82rem;
}

.stat-value,
.dashboard-stat-value {
    font-size: 1.45rem;
}

.card,
.dashboard-card,
.stat-card {
    border-radius: 16px;
}

/* Table */
.table {
    font-size: 0.84rem;
}

.table th {
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.table td {
    font-size: 0.84rem;
}

/* Form */
.form-label {
    font-size: 0.82rem;
}

.form-control,
.form-select {
    font-size: 0.86rem;
    min-height: 38px;
}

textarea.form-control {
    line-height: 1.45;
}

/* Button */
.btn {
    font-size: 0.84rem;
    padding: 0.45rem 0.75rem;
}

.btn-sm {
    font-size: 0.76rem;
    padding: 0.28rem 0.55rem;
}

/* Badge dan alert */
.badge {
    font-size: 0.68rem;
}

.alert {
    font-size: 0.86rem;
}

/* Dropdown */
.dropdown-menu {
    font-size: 0.84rem;
}

.dropdown-item {
    font-size: 0.84rem;
}

/* Modal */
.modal-title {
    font-size: 1rem;
}

.modal-body {
    font-size: 0.88rem;
}

/* Halaman siswa */
.siswa-brand-text strong {
    font-size: 1rem;
}

.siswa-brand-text small {
    font-size: 0.68rem;
}

.student-hero h1,
.dashboard-hero h1 {
    font-size: 1.45rem;
}

.student-hero p,
.dashboard-hero p {
    font-size: 0.88rem;
}

/* Tampilan ujian */
.question-title,
.soal-title {
    font-size: 1rem;
}

.question-content,
.soal-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.answer-option,
.option-card {
    font-size: 0.9rem;
}

/* Responsive mobile */
@media (max-width: 768px) {
    html {
        font-size: 13.5px;
    }

    .admin-content {
        padding: 1rem;
    }

    .topbar-title strong {
        font-size: 0.9rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.8rem;
    }
}