/* =========================================================
   RESET & VARIABEL DASAR
========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --surface: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --danger: #ef4444;
    --success: #10b981;
}

/* Proteksi Anti-Blok Teks Soal Ujian (PC & HP) */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

/* Grid 2 Kolom Panel Guru Kuis & Ujian */
.quiz-grid-guru {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    align-items: start;
}

/* =========================================================
   HALAMAN LOGIN (index.html)
========================================================= */
.login-body {
    background: linear-gradient(135deg, #0f172a, #1e1b4b, #020617);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-wrapper {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 30px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-header h2 {
    font-size: 24px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
}

/* =========================================================
   TOMBOL & INPUT FORM
========================================================= */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: 0.2s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-left: 4px;
}

.input-group input {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
}

/* =========================================================
   LAYOUT DASHBOARD UTAMA
========================================================= */
.app-layout {
    display: flex;
    height: 100vh;
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-brand {
    padding: 0 20px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-title {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: bold;
    letter-spacing: 1px;
    margin: 15px 0 5px 10px;
}

.menu-item {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 12px 15px;
    border-radius: 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.menu-item.active {
    background: rgba(79, 70, 229, 0.15);
    color: #818cf8;
    font-weight: 600;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 70px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* =========================================================
   DASHBOARD RPL VIBE (BERANDA)
========================================================= */
/* ==========================================
   ANIMASI LATAR BELAKANG BERANDA (RPL BANNER)
========================================== */
.rpl-banner {
    position: relative;
    isolation: isolate;
    overflow: hidden; /* Mencegah animasi keluar batas kotak */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px;
    min-height: 250px;
    border: 1px solid rgba(133, 135, 255, 0.24);
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px -10px rgba(79, 70, 229, 0.3);
    
    /* Warna Gradasi Mengalir (Background Animation) */
    background: linear-gradient(125deg, #171f45, #273969, #463d82, #214b72);
    background-size: 300% 300%;
    animation: gradientFlow 14s ease infinite;
}

/* Memastikan teks tetap berada di atas latar belakang */
.banner-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

/* Efek Partikel Bintang Bergerak di Latar */
.rpl-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,0.65) 0.8px, transparent 0.8px);
    background-size: 25px 25px;
    opacity: 0.15;
    animation: starsMove 25s linear infinite;
}

/* Mesin Penggerak Animasi (Keyframes) */
@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes starsMove {
    from { background-position: 0 0; }
    to { background-position: 100px 100px; }
}

/* Agar tetap rapi saat dibuka di layar HP */
@media (max-width: 850px) {
    .rpl-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 25px 20px;
    }
    .hero-visual {
        align-self: center;
        transform: scale(0.85);
        margin-top: 20px;
    }
}

.banner-content h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-family: 'Courier New', Courier, monospace;
}

.banner-content p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
}

.tech-stack-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tech-stack-pills span {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    color: #a5b4fc;
}

.banner-icon {
    font-size: 60px;
    filter: drop-shadow(0 0 15px rgba(79, 70, 229, 0.6));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.5);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-main);
}

.terminal-box {
    background: #09090b;
    border-radius: 12px;
    border: 1px solid #27272a;
    overflow: hidden;
    font-family: 'Consolas', 'Courier New', monospace;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #18181b;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #27272a;
}

.terminal-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-title {
    margin-left: auto;
    margin-right: auto;
    font-size: 12px;
    color: #71717a;
}

.terminal-body {
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #e4e4e7;
}

.terminal-body .prompt { color: #22c55e; font-weight: bold; }
.terminal-body .output { color: #a1a1aa; }

.cursor-blink {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: #e4e4e7;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =========================================================
   RESPONSIVITAS MOBILE (LAYAR HP)
========================================================= */
@media (max-width: 768px) {
    #btnToggleMenu { display: block !important; }

    .quiz-grid-guru {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 9999;
        transition: left 0.3s ease-in-out;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    .sidebar.buka { left: 0; }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding-top: 70px;
    }

    .topbar {
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 1000;
        padding: 10px 15px;
        background: #0f172a;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .content-area {
        padding: 15px;
    }

    .user-info { gap: 10px !important; }
    #infoPenggunaTampil { display: none; }
    #namaPenggunaTampil { font-size: 11px !important; }
    #ikonProfil { width: 30px !important; height: 30px !important; font-size: 14px !important; }
    #btnLogout { padding: 4px 10px !important; font-size: 11px !important; }
}

.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); z-index: 9998; backdrop-filter: blur(2px);
}
.sidebar-overlay.tampil { display: block; }

/* Pastikan Pop-Up Peringatan (SweetAlert) Selalu Tampil Paling Depan */
.swal2-container {
    z-index: 999999 !important;
}

/* =========================================================
   EDITOR SOAL (GAMBAR & TEKS)
========================================================= */
#teksSoalQuizBaru:empty:before {
    content: attr(data-placeholder);
    color: #64748b;
    pointer-events: none;
    display: block;
}
#teksSoalQuizBaru img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
#teksSoalQuizBaru:focus {
    border-color: #10b981 !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

/* ==========================================
   ILUSTRASI LAPTOP & ANIMASI BERANDA
========================================== */

/* Cahaya di belakang laptop */
.hero-glow {
    position: absolute; width: 185px; height: 185px; border-radius: 50%;
    background: radial-gradient(circle, rgba(126, 141, 255, .55), rgba(102, 94, 230, .12) 55%, transparent 75%);
    filter: blur(8px); animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { transform: scale(.85); opacity: .65; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Wujud Laptop Utama */
.laptop-illustration {
    position: relative; z-index: 2; width: 255px;
    animation: laptopFloat 4.5s ease-in-out infinite; filter: drop-shadow(0 18px 22px rgba(0,0,0,.25));
}
@keyframes laptopFloat {
    0%, 100% { transform: translateY(5px) rotate(-2deg); }
    50% { transform: translateY(-9px) rotate(2deg); }
}

/* Layar Laptop */
.laptop-screen {
    position: relative; width: 225px; height: 145px; margin: 0 auto; padding: 8px; overflow: hidden;
    border: 2px solid rgba(220,230,255,.8); border-bottom: 5px solid #91a0d9; border-radius: 13px 13px 5px 5px;
    background: linear-gradient(145deg, #1b2745, #0d162b); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 0 24px rgba(125,130,255,.15);
}
.screen-toolbar { height: 19px; display: flex; align-items: center; gap: 4px; padding: 0 3px; }
.screen-toolbar i { display: block; width: 5px; height: 5px; border-radius: 50%; background: #ff8b9d; }
.screen-toolbar i:nth-child(2) { background: #ffd16a; }
.screen-toolbar i:nth-child(3) { background: #49dfad; }
.screen-toolbar b { flex: 1; color: #a9b9ec; text-align: center; font-size: 7px; letter-spacing: 1px; }

/* Isi Layar (Kodingan) */
.screen-inner { position: relative; height: calc(100% - 19px); overflow: hidden; padding: 14px 10px; border-radius: 5px; background: linear-gradient(135deg, #131f3b, #1b2850); }
.code-side { display: flex; flex-direction: column; gap: 7px; width: 65%; }
.code-line { display: block; height: 5px; border-radius: 5px; background: #7d8cff; animation: codeGlow 3s ease-in-out infinite; }
.line-1 { width: 88%; } .line-2 { width: 65%; background: #55d9bd; animation-delay: .3s; } .line-3 { width: 78%; margin-left: 9px; animation-delay: .6s; } .line-4 { width: 50%; margin-left: 9px; background: #ffbb75; animation-delay: .9s; } .line-5 { width: 70%; animation-delay: 1.2s; }
@keyframes codeGlow { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* Logo </> di layar */
.code-cube {
    position: absolute; right: 13px; top: 19px; width: 55px; height: 55px; display: grid; place-items: center;
    border: 1px solid rgba(156,158,255,.55); border-radius: 13px; color: #e5e8ff; background: linear-gradient(135deg, rgba(116,113,255,.4), rgba(80,179,255,.16));
    font-size: 22px; font-weight: 800; box-shadow: 0 0 25px rgba(118,121,255,.15); animation: cubeFloat 3s ease-in-out infinite;
}
@keyframes cubeFloat { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-5px) rotate(5deg); } }

.screen-bottom { position: absolute; left: 10px; right: 10px; bottom: 9px; display: flex; align-items: center; justify-content: space-between; color: #9fafd5; font-size: 6px; letter-spacing: 1px; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: #42e2ad; box-shadow: 0 0 10px #42e2ad; animation: dotPulse 1.5s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.7); } }

/* Dudukan / Keyboard Laptop */
.laptop-base { position: relative; width: 255px; height: 10px; margin-top: -1px; border-radius: 2px 2px 10px 10px; background: linear-gradient(90deg, #6576a5, #e0e7ff, #8392c6); clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%); }

/* Kartu Status Melayang (Kiri & Kanan) */
.float-card {
    position: absolute; z-index: 5; display: flex; align-items: center; gap: 9px; min-width: 155px; padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.19); border-radius: 13px; color: #f5f7ff; background: rgba(22,31,60,.86);
    box-shadow: 0 12px 28px rgba(0,0,0,.2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.float-card-icon { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: rgba(139,139,255,.18); font-size: 16px; }
.float-card strong { display: block; white-space: nowrap; font-size: 10px; font-family: inherit; }
.float-card small { display: block; white-space: nowrap; margin-top: 2px; color: #b9c5e2; font-size: 9px; font-family: inherit; }

.float-card-top { top: 2px; right: -3px; animation: floatTop 4s ease-in-out infinite; }
.float-card-bottom { bottom: 4px; left: -3px; animation: floatBottom 4.8s ease-in-out infinite; }
@keyframes floatTop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes floatBottom { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ==========================================
   ANIMASI CINCIN ORBIT (ORBIT RINGS)
========================================== */
.orbit {
    position: absolute;
    top: 50%; left: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.27);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* Lingkaran Pertama (Mendatar) */
.orbit-a {
    width: 190px; height: 190px;
    margin: -95px 0 0 -95px;
    animation: orbitSpin 20s linear infinite;
}

/* Lingkaran Kedua (Miring / Elips) */
.orbit-b {
    width: 260px; height: 145px;
    margin: -72px 0 0 -130px;
    border-color: rgba(190, 177, 255, 0.35);
    animation: orbitTilt 24s linear infinite;
}

/* Simbol/Ikon yang berputar di jalur orbit */
.orbit-symbol {
    position: absolute;
    top: 12px; right: 25px;
    width: 27px; height: 27px;
    display: grid; place-items: center;
    border-radius: 9px;
    color: #fff; background: rgba(132, 126, 255, 0.85);
    box-shadow: 0 0 20px rgba(132, 126, 255, 0.45);
    font-size: 14px;
}

/* Animasi Putaran Orbit */
@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes orbitTilt {
    from { transform: rotate(-25deg); }
    to { transform: rotate(335deg); }
}
/* Responsivitas untuk layar HP */
@media (max-width: 900px) { .hero-visual { transform: scale(.85); } }
@media (max-width: 650px) { 
    .hero-visual { max-width: 100%; transform: scale(.8); transform-origin: left center; } 
}

/* ==========================================
   UPGRADE VISUAL 1: ANIMASI TEKS MENGETIK
========================================== */
.typing-text {
    overflow: hidden;
    white-space: nowrap;
    border-right: 4px solid #6ee7b7; /* Kursor berkedip */
    width: fit-content;
    animation: typing 2.5s steps(30, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}
@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #6ee7b7; }
}

/* ==========================================
   UPGRADE VISUAL 2: CYBER GRID BACKGROUND
========================================== */
/* Kita tambahkan jaring digital bergerak di belakang banner RPL */
.rpl-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1; /* Di bawah teks, di atas warna dasar */
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: gridMove 15s linear infinite;
    opacity: 0.5;
}

@keyframes gridMove {
    0% { transform: translateY(-30px); }
    100% { transform: translateY(0); }
}

/* ==========================================
   UPGRADE VISUAL 3: NEON GLOW HOVER & GLASSMORPHISM
========================================== */
/* Efek kartu statistik melompat dan bercahaya saat disentuh mouse */
.stat-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary) !important;
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.4) !important;
}

/* Animasi denyut (pulse) pada tombol-tombol Tech Stack (HTML, CSS, JS) */
.tech-stack-pills span {
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.tech-stack-pills span:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary);
    transform: translateY(-3px);
    cursor: default;
}

/* Membuat efek kaca (Glassmorphism) pada Topbar agar transparan elegan */
.topbar {
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
body.light-mode .topbar {
    background: rgba(255, 255, 255, 0.85) !important;
}

/* Membuat efek kaca pada Sidebar bawah */
.sidebar-bottom {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================
   UPGRADE VISUAL 4: HOVER GLOW UNTUK SEMUA MENU & KARTU
========================================== */

/* 1. Efek Menu Navigasi Samping (Sidebar) */
.menu-item {
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent; 
}
.menu-item:hover {
    transform: translateX(10px); /* Bergeser ke kanan saat disentuh */
    background: rgba(79, 70, 229, 0.15) !important;
    color: #ffffff !important;
    border-left: 3px solid var(--primary);
    box-shadow: inset 4px 0 15px rgba(79, 70, 229, 0.2);
}

/* 2. Efek Lompat & Neon untuk Kartu Daftar (Materi, Tugas, Kelas, Pengumuman, Komentar) */
#daftarMateri > div,
#daftarTugas > div,
#daftarKelas > div,
#daftarPengumuman > div,
#daftarKomentarArea > div {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    will-change: transform, box-shadow; /* Optimasi agar animasi super lancar (60fps) */
}

#daftarMateri > div:hover,
#daftarTugas > div:hover,
#daftarKelas > div:hover,
#daftarPengumuman > div:hover,
#daftarKomentarArea > div:hover {
    transform: translateY(-6px) scale(1.015); /* Melompat naik dan membesar sedikit */
    border-color: var(--primary) !important;
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.3) !important; /* Cahaya neon kebiruan */
}

/* 3. Efek Kartu Games Edukasi (Lompatan lebih tinggi agar terasa playful) */
/* KODE BARU: Ditambahkan pengecualian :not(#leaderboardGames) agar papan juara tidak ikut lompat */
#lobbyGames > div:not(#leaderboardGames) > div {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
#lobbyGames > div:not(#leaderboardGames) > div:hover {
    transform: translateY(-10px) scale(1.03); 
    border-color: var(--primary) !important;
    box-shadow: 0 20px 35px -5px rgba(79, 70, 229, 0.45) !important;
}

/* 4. Efek Baris Leaderboard (Top 5 Siswa & Papan Juara Games) */
#listLeaderboard li, 
#listLeaderboardGames li {
    transition: all 0.3s ease !important;
}
#listLeaderboard li:hover, 
#listLeaderboardGames li:hover {
    transform: translateX(10px) scale(1.02); /* Melompat ke samping agar berbeda */
    border-color: var(--primary) !important;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3) !important;
    background: rgba(79, 70, 229, 0.15) !important;
}

/* 5. Efek Halus pada Semua Tombol (Tombol Dalam Kartu) */
.btn-primary:hover, .btn-outline:hover {
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

/* Menyembunyikan Watermark Netlify */
a[href*="netlify.com"], 
img[alt*="Netlify"],
.netlify-badge {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ========================================================
   MOTION GRAPHIC & ANIMASI BACKGROUND HALAMAN LOGIN
======================================================== */

/* Wadah utama animasi, diletakkan paling belakang */
.motion-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Berada di belakang form login */
    overflow: hidden;
    background: radial-gradient(circle at center, #1e1b4b 0%, #020617 100%);
}

/* 1. Jaring-jaring Siber (Cyber Grid) */
.cyber-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: gridMove 15s linear infinite;
    opacity: 0.5;
}
@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px) translateZ(-200px); }
}

/* 2. Cahaya Berpendar (Glow Orbs) */
.glow-orb {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: orbPulse 8s ease-in-out infinite alternate;
}
.orb-left {
    top: -10%; left: -10%;
    background: #4f46e5;
}
.orb-right {
    bottom: -10%; right: -10%;
    background: #10b981;
    animation-delay: -4s;
}
@keyframes orbPulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
    100% { transform: scale(1.5) translate(50px, -50px); opacity: 0.5; }
}

/* 3. Garis Cahaya Berjalan (Scanner Line) */
.scanner-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.8), transparent);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    animation: scanLine 6s ease-in-out infinite;
    opacity: 0.3;
}
@keyframes scanLine {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { top: 100%; opacity: 0; }
}

/* 4. Partikel Melayang (Bentuk Geometris) */
.particle {
    position: absolute;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    animation: floatParticle 10s infinite linear;
}
.particle.p-1 { width: 15px; height: 15px; border-radius: 50%; left: 10%; bottom: -5%; animation-duration: 12s; background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); }
.particle.p-2 { width: 25px; height: 25px; left: 80%; bottom: -10%; animation-duration: 18s; transform: rotate(45deg); }
.particle.p-3 { width: 10px; height: 10px; border-radius: 50%; left: 40%; bottom: -2%; animation-duration: 8s; }
.particle.p-4 { width: 30px; height: 30px; border-radius: 4px; left: 25%; bottom: -15%; animation-duration: 20s; transform: rotate(15deg); background: rgba(16, 185, 129, 0.1); }
.particle.p-5 { width: 12px; height: 12px; left: 65%; bottom: -5%; animation-duration: 14s; transform: rotate(30deg); }
.particle.p-6 { width: 20px; height: 20px; border-radius: 50%; left: 90%; bottom: -8%; animation-duration: 16s; }

@keyframes floatParticle {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* 5. Efek Kaca (Glassmorphism) pada Kartu Login */
/* Pastikan untuk meng-override gaya login-card Bapak saat ini */
.login-card {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2) !important;
    animation: cardEntrance 1s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes cardEntrance {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); filter: blur(5px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ========================================================
   ANIMASI LOGO INFORMATIKA (MENGGANTIKAN GAMBAR STATIS)
======================================================== */
.login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    height: 80px; /* Ruang untuk logo berputar */
}

/* Wadah utama logo */
.animated-logo {
    position: relative;
    width: 65px;
    height: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Efek cahaya (Glow) di belakang teks */
.animated-logo::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #10b981;
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0.5;
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

/* Teks Koding di tengah */
.logo-icon {
    font-family: monospace;
    font-size: 20px;
    font-weight: 900;
    color: #10b981; /* Hijau khas kode */
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.8), 0 0 20px rgba(16, 185, 129, 0.5);
    z-index: 3;
    animation: pulseText 2s ease-in-out infinite alternate;
}

/* Cincin Orbit 1 (Garis Putus-putus Melingkar) */
.logo-ring.ring-1 {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px dashed #6366f1; /* Warna ungu/biru */
    border-radius: 50%;
    animation: spinRight 10s linear infinite;
    opacity: 0.8;
}

/* Cincin Orbit 2 (Garis Solid Berputar Terbalik) */
.logo-ring.ring-2 {
    position: absolute;
    width: 75%;
    height: 75%;
    border: 2px solid transparent;
    border-top: 2px solid #3b82f6;
    border-bottom: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spinLeft 5s linear infinite;
    opacity: 0.9;
}

/* === KEYFRAMES (MESIN PENGGERAK ANIMASI) === */
@keyframes spinRight {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes spinLeft {
    0% { transform: rotate(360deg) scale(1); }
    50% { transform: rotate(180deg) scale(0.95); }
    100% { transform: rotate(0deg) scale(1); }
}

@keyframes pulseText {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.15); opacity: 1; }
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.8); opacity: 0.7; }
}

/* ========================================================
   EFEK INTERAKTIF KURSOR (CYBER WATER RIPPLE)
======================================================== */
.cursor-ripple {
    position: fixed;
    border-radius: 50%;
    pointer-events: none; /* Sangat penting: agar tidak menghalangi kursor saat mengklik form */
    transform: translate(-50%, -50%) scale(0);
    animation: rippleEffect 0.8s ease-out forwards;
    z-index: 1; 
    
    /* Desain percikan air ala siber (warna hijau neon & ungu) */
    width: 30px;
    height: 30px;
    border: 2px solid rgba(16, 185, 129, 0.6);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4), inset 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Animasi membesar lalu menghilang seperti riak air */
@keyframes rippleEffect {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}
/* =========================================================
   TAMBAHAN v2: PERAN, KOMPONEN BANTU, CETAK
========================================================= */
/* Elemen khusus peran tetap tersembunyi walau dibuat dinamis */
body.peran-siswa .admin-only { display: none !important; }
body.peran-guru .student-only { display: none !important; }

/* Grid panel guru ujian (dipakai #gridGuruQuizUtama) */
.quiz-guru-grid[style*="grid"] { grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .quiz-guru-grid[style*="grid"] { grid-template-columns: 1fr; } }

.kartu { background: rgba(255,255,255,0.05); padding: 20px; border-radius: 12px; border: 1px solid var(--border); }
.btn-kecil { border: none; color: #fff; padding: 7px 13px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: bold; transition: 0.2s; }
.btn-kecil:hover { filter: brightness(1.12); }
.btn-kecil:disabled { opacity: 0.6; cursor: not-allowed; }
.bg-merah { background: #ef4444; } .bg-hijau { background: #10b981; } .bg-biru { background: #3b82f6; }
.bg-kuning { background: #f59e0b; } .bg-ungu { background: #6366f1; } .bg-abu { background: #475569; }
.btn-garis { background: transparent; border: 1px solid currentColor; }
.teks-redup { color: var(--text-muted); }
.lencana { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; }
.tabel-data { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabel-data th, .tabel-data td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.06); text-align: left; vertical-align: top; }
.tabel-data th { color: var(--text-muted); border-bottom: 2px solid var(--border); }
.sel-nilai-salah { border-color: #ef4444 !important; background: rgba(239,68,68,0.15) !important; }
.konten-guru img { max-width: 100%; height: auto; border-radius: 8px; }
.konten-guru a { color: #60a5fa; }

/* Cetak rapor: hanya isi rapor yang dicetak */
@media print {
    body * { visibility: hidden; }
    #page-rapor, #page-rapor * { visibility: visible; }
    #page-rapor { position: absolute; left: 0; top: 0; width: 100%; background: #fff !important; color: #000 !important; }
    #page-rapor * { color: #000 !important; background: transparent !important; border-color: #999 !important; box-shadow: none !important; }
    #btnCetakRapor { display: none !important; }
}

/* =========================================================
   TEMA TERANG (aktif bila <html data-theme="light">)
   Tombol 🌙/☀️ di pojok atas mengganti tema; pilihan disimpan di browser.
========================================================= */
html[data-theme="light"] {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #eef2f7;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: #cbd5e1;
    --danger: #dc2626;
    --success: #059669;
    color-scheme: light;
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] body { background: var(--bg-dark); color: var(--text-main); }

/* Tombol ganti tema */
.btn-tema {
    background: transparent; border: 1px solid var(--border); color: var(--text-main);
    border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px; transition: 0.2s;
}
.btn-tema:hover { border-color: var(--primary); }
.btn-tema-login { position: fixed; top: 16px; right: 16px; z-index: 50; background: rgba(15,23,42,0.5); color: #fff; }
html[data-theme="light"] .btn-tema-login { background: #fff; color: #0f172a; }

/* Kerangka */
html[data-theme="light"] .topbar { background: rgba(255,255,255,0.88) !important; border-bottom: 1px solid var(--border); }
html[data-theme="light"] .sidebar { box-shadow: 2px 0 12px rgba(15,23,42,0.06); }
html[data-theme="light"] .sidebar-bottom { background: #f8fafc; border-top: 1px solid var(--border); }
html[data-theme="light"] .menu-item:hover { 
    background: #eef2ff !important; 
    color: #3730a3 !important; 
}
html[data-theme="light"] .panel, html[data-theme="light"] .stat-card { box-shadow: 0 1px 3px rgba(15,23,42,0.08); }
html[data-theme="light"] .stat-card:hover { box-shadow: 0 10px 20px -8px rgba(15,23,42,0.18); }
html[data-theme="light"] .kartu { background: #ffffff; box-shadow: 0 1px 3px rgba(15,23,42,0.06); }
html[data-theme="light"] .tabel-data td, html[data-theme="light"] .tabel-data th { border-bottom-color: #e2e8f0; }
html[data-theme="light"] .input-group input, html[data-theme="light"] .input-group select,
html[data-theme="light"] .input-group textarea { background: #f8fafc; color: #0f172a; }
html[data-theme="light"] .input-group input:focus { background: #ffffff; }
html[data-theme="light"] .btn-outline:hover { background: #eef2ff; }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea { color-scheme: light; }
html[data-theme="light"] select option { background: #fff; color: #0f172a; }
html[data-theme="light"] #teksSoalQuizBaru:focus { background: #ffffff !important; }
html[data-theme="light"] .konten-guru a { color: #1d4ed8; }
html[data-theme="light"] .sidebar-overlay { background: rgba(15,23,42,0.35); }

/* Banner beranda: gradasi lebih cerah, teks tetap putih */
html[data-theme="light"] .rpl-banner { background: linear-gradient(125deg, #4f46e5, #6366f1, #7c3aed, #2563eb); background-size: 300% 300%; }
html[data-theme="light"] .float-card { background: rgba(255,255,255,0.92); color: #0f172a; border-color: #e2e8f0; }
html[data-theme="light"] .float-card * { color: inherit; }

/* Terminal tetap gelap (memang tampilan terminal) */
html[data-theme="light"] .terminal-box { box-shadow: 0 10px 25px -8px rgba(15,23,42,0.35); }

/* Halaman login */
html[data-theme="light"] .login-body { background: linear-gradient(135deg, #eef2ff, #f8fafc, #e0f2fe); }
html[data-theme="light"] .motion-bg { background: radial-gradient(circle at center, #eef2ff 0%, #e2e8f0 100%); }
html[data-theme="light"] .login-card { background: rgba(255,255,255,0.92) !important; border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 50px -20px rgba(15,23,42,0.25), 0 0 20px rgba(99,102,241,0.12) !important; color: #0f172a; }

/* Popup SweetAlert */
html[data-theme="light"] .swal2-popup { background: #ffffff !important; color: #0f172a !important; }
html[data-theme="light"] .swal2-title, html[data-theme="light"] .swal2-html-container { color: #0f172a !important; }
html[data-theme="dark"] .swal2-input, html[data-theme="dark"] .swal2-textarea, html[data-theme="dark"] .swal2-select {
    background: #0f172a; color: #f8fafc; border-color: #334155; }

/* ---- Penyesuaian warna gaya inline (ditulis langsung di HTML/JS) ---- */

html[data-theme="light"] [style*="color: white"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:white"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #fff;"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#fff;"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #ffffff"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#ffffff"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #f8fafc"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#f8fafc"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #e4e4e7"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#e4e4e7"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #e2e8f0"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#e2e8f0"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #cbd5e1"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#cbd5e1"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #f1f5f9"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#f1f5f9"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #c6d2e8"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#c6d2e8"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #e5e8ff"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#e5e8ff"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color: #f5f7ff"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]),
html[data-theme="light"] [style*="color:#f5f7ff"]:not(button):not(.lencana):not([class*="bg-"]):not([style*="background: #"]):not([style*="background:#"]):not([style*="background: var(--primary)"]):not([style*="background:var(--danger)"]):not([style*="background: var(--danger)"]) {
    color: #0f172a !important;
}

html[data-theme="light"] [style*="color: #94a3b8"],
html[data-theme="light"] [style*="color:#94a3b8"],
html[data-theme="light"] [style*="color: rgba(255, 255, 255, 0.4)"],
html[data-theme="light"] [style*="color:rgba(255, 255, 255, 0.4)"] {
    color: #475569 !important;
}

html[data-theme="light"] [style*="color: #fcd34d"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#fcd34d"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #b45309 !important;
}

html[data-theme="light"] [style*="color: #a5b4fc"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#a5b4fc"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #4338ca !important;
}

html[data-theme="light"] [style*="color: #60a5fa"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#60a5fa"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #1d4ed8 !important;
}

html[data-theme="light"] [style*="color: #6ee7b7"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#6ee7b7"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #047857 !important;
}

html[data-theme="light"] [style*="color: #fca5a5"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#fca5a5"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #b91c1c !important;
}

html[data-theme="light"] [style*="color: #eab308"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#eab308"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #a16207 !important;
}

html[data-theme="light"] [style*="color: #f59e0b"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#f59e0b"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #b45309 !important;
}

html[data-theme="light"] [style*="color: #22c55e"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#22c55e"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #15803d !important;
}

html[data-theme="light"] [style*="color: #10b981"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#10b981"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #047857 !important;
}

html[data-theme="light"] [style*="color: #f87171"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#f87171"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #dc2626 !important;
}

html[data-theme="light"] [style*="color: #8b5cf6"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#8b5cf6"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #6d28d9 !important;
}

html[data-theme="light"] [style*="color: #3b82f6"]:not(button):not([style*="background: #"]):not([style*="background:#"]),
html[data-theme="light"] [style*="color:#3b82f6"]:not(button):not([style*="background: #"]):not([style*="background:#"]) {
    color: #1d4ed8 !important;
}

html[data-theme="light"] [style*="background: rgba(0,0,0,0.2)"],
html[data-theme="light"] [style*="background:rgba(0,0,0,0.2)"],
html[data-theme="light"] [style*="background-color: rgba(0,0,0,0.2)"],
html[data-theme="light"] [style*="background-color:rgba(0,0,0,0.2)"] {
    background: #f1f5f9 !important;
}

html[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.2)"],
html[data-theme="light"] [style*="background:rgba(0, 0, 0, 0.2)"],
html[data-theme="light"] [style*="background-color: rgba(0, 0, 0, 0.2)"],
html[data-theme="light"] [style*="background-color:rgba(0, 0, 0, 0.2)"] {
    background: #f1f5f9 !important;
}

html[data-theme="light"] [style*="background: rgba(0,0,0,0.3)"],
html[data-theme="light"] [style*="background:rgba(0,0,0,0.3)"],
html[data-theme="light"] [style*="background-color: rgba(0,0,0,0.3)"],
html[data-theme="light"] [style*="background-color:rgba(0,0,0,0.3)"] {
    background: #f1f5f9 !important;
}

html[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.3)"],
html[data-theme="light"] [style*="background:rgba(0, 0, 0, 0.3)"],
html[data-theme="light"] [style*="background-color: rgba(0, 0, 0, 0.3)"],
html[data-theme="light"] [style*="background-color:rgba(0, 0, 0, 0.3)"] {
    background: #f1f5f9 !important;
}

html[data-theme="light"] [style*="background: rgba(0,0,0,0.4)"],
html[data-theme="light"] [style*="background:rgba(0,0,0,0.4)"],
html[data-theme="light"] [style*="background-color: rgba(0,0,0,0.4)"],
html[data-theme="light"] [style*="background-color:rgba(0,0,0,0.4)"] {
    background: #e8edf5 !important;
}

html[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.4)"],
html[data-theme="light"] [style*="background:rgba(0, 0, 0, 0.4)"],
html[data-theme="light"] [style*="background-color: rgba(0, 0, 0, 0.4)"],
html[data-theme="light"] [style*="background-color:rgba(0, 0, 0, 0.4)"] {
    background: #e8edf5 !important;
}

html[data-theme="light"] [style*="background: rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="background:rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="background-color: rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="background-color:rgba(255,255,255,0.05)"] {
    background: #ffffff !important;
}

html[data-theme="light"] [style*="background: rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="background:rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="background-color: rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="background-color:rgba(255, 255, 255, 0.05)"] {
    background: #ffffff !important;
}

html[data-theme="light"] [style*="background: rgba(255,255,255,0.02)"],
html[data-theme="light"] [style*="background:rgba(255,255,255,0.02)"],
html[data-theme="light"] [style*="background-color: rgba(255,255,255,0.02)"],
html[data-theme="light"] [style*="background-color:rgba(255,255,255,0.02)"] {
    background: #f8fafc !important;
}

html[data-theme="light"] [style*="background: rgba(255,255,255,0.03)"],
html[data-theme="light"] [style*="background:rgba(255,255,255,0.03)"],
html[data-theme="light"] [style*="background-color: rgba(255,255,255,0.03)"],
html[data-theme="light"] [style*="background-color:rgba(255,255,255,0.03)"] {
    background: #f8fafc !important;
}

html[data-theme="light"] [style*="background: rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="background:rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="background-color: rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="background-color:rgba(255,255,255,0.1)"] {
    background: #eef2f7 !important;
}

html[data-theme="light"] [style*="background: #1e293b"],
html[data-theme="light"] [style*="background:#1e293b"],
html[data-theme="light"] [style*="background-color: #1e293b"],
html[data-theme="light"] [style*="background-color:#1e293b"] {
    background: #ffffff !important;
}

html[data-theme="light"] [style*="background: #0f172a"],
html[data-theme="light"] [style*="background:#0f172a"],
html[data-theme="light"] [style*="background-color: #0f172a"],
html[data-theme="light"] [style*="background-color:#0f172a"] {
    background: #f8fafc !important;
}

html[data-theme="light"] [style*="background: rgba(15, 23, 42, 0.95)"],
html[data-theme="light"] [style*="background:rgba(15, 23, 42, 0.95)"],
html[data-theme="light"] [style*="background-color: rgba(15, 23, 42, 0.95)"],
html[data-theme="light"] [style*="background-color:rgba(15, 23, 42, 0.95)"] {
    background: rgba(255,255,255,0.97) !important;
}

html[data-theme="light"] [style*="background: #334155"],
html[data-theme="light"] [style*="background:#334155"] {
    background: #e2e8f0 !important; color: #0f172a !important; border-color: #cbd5e1 !important;
}

html[data-theme="light"] [style*="border-bottom: 1px solid rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="border-bottom:1px solid rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="border-top:1px solid rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="border-top: 1px solid rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="border:1px solid rgba(255,255,255,0.05)"],
html[data-theme="light"] [style*="border: 1px solid rgba(255,255,255,0.05)"] {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] [style*="border-bottom: 1px solid rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="border-bottom:1px solid rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="border-top:1px solid rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="border-top: 1px solid rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="border:1px solid rgba(255, 255, 255, 0.05)"],
html[data-theme="light"] [style*="border: 1px solid rgba(255, 255, 255, 0.05)"] {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] [style*="border-bottom: 1px solid rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="border-bottom:1px solid rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="border-top:1px solid rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="border-top: 1px solid rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="border:1px solid rgba(255,255,255,0.1)"],
html[data-theme="light"] [style*="border: 1px solid rgba(255,255,255,0.1)"] {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] [style*="border-bottom: 1px solid rgba(255, 255, 255, 0.1)"],
html[data-theme="light"] [style*="border-bottom:1px solid rgba(255, 255, 255, 0.1)"],
html[data-theme="light"] [style*="border-top:1px solid rgba(255, 255, 255, 0.1)"],
html[data-theme="light"] [style*="border-top: 1px solid rgba(255, 255, 255, 0.1)"],
html[data-theme="light"] [style*="border:1px solid rgba(255, 255, 255, 0.1)"],
html[data-theme="light"] [style*="border: 1px solid rgba(255, 255, 255, 0.1)"] {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] [style*="border-bottom: 1px solid rgba(255,255,255,0.06)"],
html[data-theme="light"] [style*="border-bottom:1px solid rgba(255,255,255,0.06)"],
html[data-theme="light"] [style*="border-top:1px solid rgba(255,255,255,0.06)"],
html[data-theme="light"] [style*="border-top: 1px solid rgba(255,255,255,0.06)"],
html[data-theme="light"] [style*="border:1px solid rgba(255,255,255,0.06)"],
html[data-theme="light"] [style*="border: 1px solid rgba(255,255,255,0.06)"] {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] [style*="border: 1px solid #475569"],
html[data-theme="light"] [style*="border:1px solid #475569"],
html[data-theme="light"] [style*="border:1px solid #334155"],
html[data-theme="light"] [style*="border: 1px solid #334155"] {
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] [style*="background:#1e293b"], html[data-theme="light"] [style*="background: #1e293b"],
html[data-theme="light"] [style*="background:#0f172a"], html[data-theme="light"] [style*="background: #0f172a"] {
    color: #0f172a !important; border-color: #cbd5e1 !important;
}
html[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.25)"], html[data-theme="light"] [style*="background:rgba(0,0,0,0.25)"] { background: #f1f5f9 !important; }
html[data-theme="light"] #btnToggleMenu { color: #0f172a !important; }
html[data-theme="light"] .menu-item.active, html[data-theme="light"] .sidebar .menu-item.active { color: #3730a3 !important; background: #e0e7ff !important; }
html[data-theme="light"] #page-beranda .rpl-banner .banner-content,
html[data-theme="light"] #page-beranda .rpl-banner .banner-content h1,
html[data-theme="light"] #page-beranda .rpl-banner .banner-content p { color: #ffffff !important; }
html[data-theme="light"] #page-beranda .rpl-banner .banner-content span[style] { color: #a7f3d0 !important; }
html[data-theme="light"] #page-beranda .tech-stack-pills span { color: #ffffff !important; background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); }
html[data-theme="light"] #panelLeaderboard { background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%) !important; box-shadow: 0 4px 12px rgba(245,158,11,0.12) !important; }
html[data-theme="light"] #leaderboardGames { background: #ffffff !important; }
html[data-theme="light"] .lencana[class*="bg-"], html[data-theme="light"] .btn-kecil[class*="bg-"] { color: #ffffff !important; }

/* --- PERBAIKAN WARNA KOTAK ESSAY MODE TERANG --- */
html[data-theme="light"] #teksSoalEssayBaru {
    color: #0f172a !important; /* Memaksa teks yang diketik guru menjadi gelap */
}

html[data-theme="light"] #teksSoalEssayBaru:focus {
    background: #ffffff !important; /* Latar belakang menjadi putih bersih saat diklik */
}

html[data-theme="light"] [contenteditable="true"]:empty:before {
    color: #64748b !important; /* Memaksa teks petunjuk/placeholder menjadi abu-abu gelap agar terbaca */
}

/* Pengecualian agar teks Lockdown tetap putih di mode terang */
html[data-theme="light"] #headerKeamananQuiz span {
    color: #f8fafc !important;
}

.sortable-ghost {
    opacity: 0.4;
    background: rgba(59, 130, 246, 0.2);
    border: 2px dashed #3b82f6;
}
.kartu:active { cursor: grabbing !important; }

/* --- PERBAIKAN KONTRAS DROPDOWN (SELECT OPTION) MODE GELAP --- */
select option {
    background-color: #0f172a !important; /* Memaksa latar belakang menjadi gelap solid */
    color: #f8fafc !important; /* Memaksa teks menjadi putih terang */
    font-weight: 600; /* Sedikit menebalkan teks agar lebih jelas */
    padding: 10px;
}

/* --- PERBAIKAN KONTRAS DROPDOWN (KHUSUS MODE TERANG) --- */
html[data-theme="light"] select option {
    background-color: #ffffff !important; /* Latar belakang putih bersih */
    color: #0f172a !important; /* Teks menjadi gelap pekat agar terbaca */
}
/* =========================================================
   PROGRES MODUL INTERAKTIF (js/app-modul.js)
   ========================================================= */
.pm-bar { width: 100%; background: rgba(148, 163, 184, 0.18); border-radius: 999px; overflow: hidden; }
.pm-bar > i { display: block; height: 100%; border-radius: inherit; transition: width .4s ease; }
.pm-bar > .pm-kosong, .pm-bar > .pm-mulai { background: #f59e0b; }
.pm-bar > .pm-jalan { background: #3b82f6; }
.pm-bar > .pm-selesai { background: #10b981; }
.pm-teks-kosong { color: var(--text-muted); } .pm-teks-mulai { color: #f59e0b; } .pm-teks-jalan { color: #60a5fa; } .pm-teks-selesai { color: #22c55e; }
.pm-kartu { background: rgba(16, 185, 129, 0.06); border: 1px solid rgba(16, 185, 129, 0.3); border-radius: 10px; padding: 12px 14px; }
.pm-angka { font-size: 15px; }
.pm-panel { background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(16, 185, 129, 0.4); border-radius: 12px; padding: 20px 22px; margin-bottom: 25px; }
.pm-daftar { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 22px; margin-top: 16px; }
.pm-baris { display: grid; grid-template-columns: minmax(0, 1fr) 70px 38px; align-items: center; gap: 10px; font-size: 12px; color: var(--text-main); }
.pm-baris > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-baris > b { text-align: right; font-size: 12px; }
.pm-metrik-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 15px; }
.pm-metrik { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.pm-metrik span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.pm-metrik b { font-size: 22px; }
.pm-wadah-tabel { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.pm-tabel { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.pm-tabel th, .pm-tabel td { padding: 6px 4px; text-align: center; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }
.pm-tabel thead th { color: var(--text-muted); font-size: 12px; padding: 10px 4px; background: rgba(0, 0, 0, 0.2); }
.pm-tabel .pm-nama { text-align: left; padding-left: 14px; min-width: 170px; position: sticky; left: 0; background: var(--surface); z-index: 1; color: var(--text-main); font-weight: 600; }
.pm-tabel .pm-nama small { display: block; font-weight: 400; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pm-tabel .pm-rata { font-weight: 800; color: #fcd34d; min-width: 60px; }
.pm-tabel tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.pm-sel { display: inline-block; min-width: 42px; padding: 6px 4px; border-radius: 6px; border: 0; font: 700 12px/1 inherit; font-style: normal; cursor: pointer; }
.pm-sel.pm-kosong { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }
.pm-sel.pm-mulai { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.pm-sel.pm-jalan { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
.pm-sel.pm-selesai { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
button.pm-sel:hover { outline: 2px solid rgba(165, 180, 252, 0.6); }
.pm-legenda { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.pm-legenda i { cursor: default; margin-right: 4px; }
.pm-detail { text-align: left; font-size: 13px; color: #e2e8f0; max-height: 62vh; overflow-y: auto; }
.pm-detail h4 { color: #fcd34d; font-size: 13px; margin: 16px 0 8px; }
.pm-detail-angka { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.pm-detail-angka div { background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 8px 10px; }
.pm-detail-angka span { display: block; font-size: 11px; color: #94a3b8; }
.pm-detail-angka b { font-size: 15px; }
.pm-chip-baris { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-chip { font-size: 11px; padding: 4px 9px; border-radius: 999px; background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.pm-chip.ok { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.pm-isian { background: rgba(0, 0, 0, 0.25); border-left: 3px solid #3b82f6; padding: 6px 10px; margin-bottom: 6px; }
.pm-isian span { font-size: 11px; color: #94a3b8; }
.pm-isian p { margin: 2px 0 0; white-space: pre-wrap; }
.pm-curiga { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.5); color: #fca5a5; padding: 8px 10px; border-radius: 8px; margin-top: 10px; }
html[data-theme="light"] .pm-panel { background: #ffffff; }
html[data-theme="light"] .pm-tabel thead th { background: #f1f5f9; }
html[data-theme="light"] .pm-sel.pm-mulai { color: #b45309; }
html[data-theme="light"] .pm-sel.pm-jalan { color: #1d4ed8; }
html[data-theme="light"] .pm-sel.pm-selesai { color: #047857; }
html[data-theme="light"] .pm-teks-selesai { color: #059669; } html[data-theme="light"] .pm-teks-jalan { color: #2563eb; } html[data-theme="light"] .pm-teks-mulai { color: #b45309; }
@media print { .pm-panel { break-inside: avoid; } }
html[data-theme="light"] .pm-detail { color: #0f172a; }
html[data-theme="light"] .pm-detail h4 { color: #b45309; }
html[data-theme="light"] .pm-detail-angka div, html[data-theme="light"] .pm-isian { background: #f1f5f9; }
html[data-theme="light"] .pm-detail-angka span, html[data-theme="light"] .pm-isian span { color: #475569; }
html[data-theme="light"] .pm-chip { background: #e2e8f0; color: #334155; }
html[data-theme="light"] .pm-chip.ok { background: #d1fae5; color: #047857; }
html[data-theme="light"] .pm-curiga { color: #b91c1c; }
