/* --- Halaman Portal Login --- */
.portal-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); /* Gradasi gelap */
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; /* Pastikan font diterapkan */
}

/* --- Halaman Preview/Cetak --- */
.print-preview-body {
    background-color: #ffffff; /* Latar Belakang Putih */
    color: #000000; /* Teks Hitam */
    font-family: 'Poppins', sans-serif;
    margin: 0;
}
.print-preview-body h1,
.print-preview-body h2,
.print-preview-body h3,
.print-preview-body h4,
.print-preview-body h5,
.print-preview-body h6 {
    color: #000000; /* Judul Hitam */
}
/* Pastikan konten TinyMCE juga terlihat */
.print-preview-body .soal-pertanyaan p,
.print-preview-body .soal-pertanyaan li,
.print-preview-body .soal-menjodohkan td p,
.print-preview-body .soal-menjodohkan td li {
     color: #000000 !important; /* Paksa warna hitam untuk konten */
     background-color: transparent !important; /* Hapus latar belakang gelap jika ada */
}
.print-preview-body .soal-pilihan li p { /* Perbaiki warna teks pilihan ganda */
     color: #000000 !important;
}


.portal-container {
    background-color: #1e293b; /* Warna card sedikit lebih terang */
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 170, 255, 0.15);
    text-align: center;
    max-width: 900px;
    width: 100%;
    border: 1px solid #334155;
}

.portal-header {
    margin-bottom: 40px;
}

.portal-logo-placeholder {
    width: 80px;
    height: 80px;
    background-color: #334155;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #00aaff;
}
.portal-logo { /* Jika menggunakan gambar */
    max-height: 80px;
    margin-bottom: 20px;
}

.portal-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #00aaff; /* Biru Neon */
}

.portal-header p {
    font-size: 1.1rem;
    color: #94a3b8; /* Abu-abu terang */
}

.portal-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.portal-card {
    background-color: #0f172a; /* Lebih gelap dari container */
    border-radius: 10px;
    padding: 30px 20px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #334155;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 170, 255, 0.2);
    border-color: #00aaff;
}

.portal-icon {
    font-size: 2.8rem;
    margin-bottom: 15px;
    color: #00aaff; /* Biru Neon */
}
.portal-icon i { /* Efek shadow untuk icon */
     text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

.portal-card h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #ffffff; /* Putih */
}

.portal-card p {
    font-size: 0.9rem;
    color: #94a3b8; /* Abu-abu terang */
    line-height: 1.5;
}

.portal-footer {
    margin-top: 40px;
    font-size: 0.8em;
    color: #64748b; /* Abu-abu lebih gelap */
}

/* Penyesuaian Responsif Portal */
@media (max-width: 600px) {
    .portal-container {
        padding: 25px;
    }
    .portal-header h1 {
        font-size: 1.6rem;
    }
    .portal-selection {
         grid-template-columns: 1fr; /* Satu kolom di layar kecil */
         gap: 20px;
    }
}


/* Pengaturan Dasar (Tema Utama - DIUBAH) */
body:not(.portal-body):not(.print-preview-body) { /* Terapkan tema gelap HANYA jika bukan portal dan bukan preview */
    background-color: #0a0a0f; /* Latar belakang hitam kebiruan gelap */
    color: #e0e0e0; /* Teks abu-abu terang */
    font-family: 'Poppins', sans-serif;
    margin: 0;
}

/* Judul Biru Neon HANYA untuk tema gelap */
body:not(.portal-body):not(.print-preview-body) h1,
body:not(.portal-body):not(.print-preview-body) h2,
body:not(.portal-body):not(.print-preview-body) h3,
body:not(.portal-body):not(.print-preview-body) h4,
body:not(.portal-body):not(.print-preview-body) h5,
body:not(.portal-body):not(.print-preview-body) h6 {
    color: #00aaff;
}

/* Layout Admin (Berlaku untuk tema gelap) */
.admin-layout {
    display: flex;
    align-items: flex-start;
}
.sidebar {
    width: 250px;
    background-color: #12121e; /* Sidebar lebih gelap */
    color: white;
    min-height: 100vh;
    flex-shrink: 0;
    border-right: 1px solid #2a2a3a;
}
.sidebar-header {
    padding: 20px;
    text-align: center;
    background-color: #380135; /* Header sidebar biru cerah */
    color: #ffffff;
}
.sidebar-header h3 {
    margin: 0;
    color: #ffffff; /* Warna teks putih untuk header */
}
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
/* Style untuk item menu utama */
.sidebar-nav > li {
    position: relative; /* Diperlukan untuk submenu */
}
.sidebar-nav li a {
    display: block;
    color: #b0b0c0; /* Teks menu abu-abu */
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s ease, transform 0.2s ease-out; /* Tambah transisi transform */
    border-bottom: 1px solid #2a2a3a;
}
/* Efek Bounce saat hover */
.sidebar-nav li a:hover {
    transform: translateX(5px); /* Sedikit geser ke kanan */
    background-color: #007bff;
    color: #ffffff;
}
.sidebar-nav li a.active {
    background-color: #007bff; /* Biru cerah saat aktif */
    color: #ffffff;
}
.sidebar-nav li a.logout-link {
    background-color: #dc3545; /* Merah untuk logout */
}
 .sidebar-nav li a.logout-link:hover {
    background-color: #c82333;
    transform: translateX(5px); /* Bounce juga untuk logout */
}

/* Style untuk Submenu */
.sidebar-nav ul.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #1f1f2f; /* Warna latar submenu sedikit berbeda */
    display: none; /* Sembunyikan secara default */
    position: relative; /* Atau absolute jika ingin overlay */
}
.sidebar-nav li:hover > ul.submenu,
.sidebar-nav li.open > ul.submenu { /* 'open' class untuk klik (JS) */
    display: block;
}
.sidebar-nav ul.submenu li a {
    padding-left: 35px; /* Indentasi untuk submenu item */
    font-size: 0.9em;
    color: #a0a0b0; /* Warna teks submenu */
    border-bottom: 1px solid #3a3a4a; /* Garis pemisah lebih halus */
}
.sidebar-nav ul.submenu li a:hover,
.sidebar-nav ul.submenu li a.active {
    background-color: #0056b3; /* Warna hover/aktif submenu */
    color: #ffffff;
    transform: translateX(3px); /* Bounce lebih kecil */
}
/* Opsi: Tambah panah untuk item menu yang punya submenu */
.sidebar-nav li.has-submenu > a::after {
    content: ' ▼'; /* Panah ke bawah */
    font-size: 0.7em;
    float: right;
    transition: transform 0.3s ease;
}
.sidebar-nav li.has-submenu:hover > a::after,
.sidebar-nav li.has-submenu.open > a::after {
     transform: rotate(180deg); /* Panah ke atas saat terbuka */
}


.main-content-area {
    flex-grow: 1;
    padding: 30px 40px;
    background-color: #0a0a0f; /* Latar utama */
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    text-align: left !important;
}
.main-content-area h1 {
    margin-top: 0;
    border-bottom: 1px solid #2a2a3a;
    padding-bottom: 10px;
}

/* Tombol (Berlaku untuk tema gelap) */
.btn {
     display: inline-block;
     padding: 8px 15px;
     border-radius: 5px;
     text-decoration: none;
     color: white;
     font-weight: 600;
     border: none;
     cursor: pointer;
     transition: background-color 0.3s ease, transform 0.1s ease;
     font-size: 0.9em;
     margin-right: 5px; /* Jarak antar tombol */
     margin-bottom: 5px;
}
.btn:hover {
     filter: brightness(1.1);
     transform: translateY(-1px);
}
.btn-add { background-color: #0d6efd; } /* Biru primer */
.btn-edit { background-color: #ffc107; color: #111; } /* Kuning */
.btn-delete { background-color: #dc3545; } /* Merah */
.action-buttons {
    margin-bottom: 20px;
}

/* Form (Berlaku untuk tema gelap) */
.app-form {
    background-color: #12121e;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.1); /* Shadow biru */
    border: 1px solid #2a2a3a;
    width: 100%;
    max-width: 900px;
    text-align: left;
    margin-top: 20px; /* Jarak dari judul */
}
.app-form h2 {
    text-align: center;
    margin-top: 0;
    color: #00aaff;
}
.input-group {
    margin-bottom: 20px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #b0b0c0;
}
.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"],
.input-group input[type="number"],
.input-group input[type="date"],
.input-group input[type="datetime-local"],
.input-group input[type="file"],
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #3a3a4a;
    border-radius: 5px;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    background-color: #1f1f2f;
    color: #e0e0e0;
}
.input-group input[type="file"] {
    padding: 8px; /* Padding berbeda untuk file input */
}
.input-group textarea {
    min-height: 80px;
    resize: vertical;
}
.input-group small {
    color: #888;
    font-size: 0.8em;
    margin-top: 5px;
    display: block;
}
.checkbox-group label {
    display: inline-block; /* Ubah ke inline-block agar bisa sebelahan */
    margin-right: 15px;
    margin-bottom: 10px;
    color: #e0e0e0;
}
.back-link {
    display: block;
    margin-top: 20px;
    text-decoration: none;
    color: #00aaff;
    text-align: center;
}
.back-link:hover {
     text-decoration: underline;
}
.btn-login { /* Tombol utama form */
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}
.btn-login:hover {
    background-color: #0056b3;
}

/* Filter Form (Berlaku untuk tema gelap) */
.filter-form {
    background-color: #12121e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap; /* Agar responsif */
    align-items: flex-end;
    gap: 15px;
    border: 1px solid #2a2a3a;
}
.filter-form .input-group {
    margin-bottom: 0;
    flex-grow: 1;
    min-width: 150px; /* Lebar minimum */
}
.filter-form label { color: #b0b0c0; margin-bottom: 5px; } /* Margin diperkecil */
.filter-form input[type="text"], .filter-form select {
    background-color: #1f1f2f;
    border: 1px solid #3a3a4a;
    color: #e0e0e0;
    height: 44px; /* Samakan tinggi */
    padding: 10px;
}
.filter-form .btn {
    height: 44px;
    background-color: #007bff;
    border: none;
    flex-shrink: 0; /* Jangan menyusut */
}
.filter-form .back-link {
     color: #00aaff;
     text-decoration: none;
     margin-left: 10px;
     line-height: 44px;
     flex-shrink: 0;
}
.filter-form .back-link:hover { text-decoration: underline; }

/* Tabel (Berlaku untuk tema gelap) */
.table-container {
    background-color: #12121e;
    border-radius: 8px;
    padding: 0; /* Padding diatur di tabel */
    border: 1px solid #2a2a3a;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    color: #e0e0e0;
}
th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a3a;
    text-align: left;
    vertical-align: middle;
}
th {
    background-color: #1f1f2f;
    color: #00aaff;
    white-space: nowrap; /* Mencegah header wrap */
}
th a {
    color: inherit;
    text-decoration: none;
}
th a:hover {
    text-decoration: underline;
}
td { background-color: #12121e; }
tr:hover td { /* Efek hover pada baris tabel */
    background-color: #1f1f2f;
}
tr:last-child td { border-bottom: none; }
.action-cell {
    white-space: nowrap;
    text-align: right;
}
.action-cell a, .action-cell button {
    margin-left: 5px;
    margin-bottom: 5px;
}
.action-cell a:first-child, .action-cell button:first-child {
    margin-left: 0;
}

/* Notifikasi (Berlaku untuk tema gelap) */
.pesan {
     border-radius: 5px; color: white; padding: 15px; margin-bottom: 20px;
     border: 1px solid;
}
.pesan.sukses { background-color: #198754; border-color: #146c43; }
.pesan.error { background-color: #dc3545; border-color: #b02a37;}

/* Badge (Berlaku untuk tema gelap) */
.badge { padding: 3px 8px; border-radius: 5px; color: white; font-size: 0.8em; }
.badge-success { background-color: #28a745; }
.badge-warning { background-color: #ffc107; color: #000; }
.badge-danger { background-color: #dc3545; }
.badge-secondary { background-color: #6c757d; }

/* Modal (Berlaku untuk tema gelap) */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.7);
    justify-content: center; align-items: center;
}
.modal-content {
    position: relative; margin: auto; width: 90%; max-width: 500px;
    background-color: #12121e; /* Sesuaikan dengan tema */
    border: 1px solid #2a2a3a;
    border-radius: 10px; /* Tambahkan radius */
    padding: 30px; /* Tambahkan padding */
    box-shadow: 0 5px 20px rgba(0, 170, 255, 0.1);
}
.close-button {
    position: absolute; top: 10px; right: 20px; color: #aaa;
    font-size: 28px; font-weight: bold; cursor: pointer;
}
.close-button:hover { color: #fff; }
.tipe-soal-selector a {
    background-color: #1f1f2f; /* Sesuaikan */
    color: #00aaff;
    border: 1px solid #3a3a4a;
}
.tipe-soal-selector a:hover { background-color: #2a2a3a; }

/* Halaman Login Spesifik */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}
.login-form {
    background-color: #1e293b;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 170, 255, 0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid #334155;
}
.login-form h2 { color: #00aaff; }
.login-form p { color: #94a3b8; }
.login-form .input-group label { text-align: left; }
.login-form .error-message {
    background-color: rgba(220, 53, 69, 0.2);
    color: #f8d7da;
    border: 1px solid rgba(220, 53, 69, 0.5);
    padding: 10px;
    border-radius: 5px;
}

/* Dashboard Statistik (Berlaku untuk tema gelap) */
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}
.school-logo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.school-logo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-color: #334155; /* Ubah warna placeholder */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #64748b; /* Warna ikon placeholder */
    flex-shrink: 0;
}
.dashboard-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #00aaff; /* Warna judul dashboard */
}
.dashboard-header p {
    margin: 5px 0 0 0;
    color: #b0b0c0; /* Warna teks deskripsi */
}
.stat-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.stat-card {
    background-color: #12121e; /* Warna card statistik */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.1); /* Shadow biru */
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #2a2a3a;
}
.stat-card .stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    color: white;
}
.stat-card .stat-info h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #b0b0c0; /* Warna subjudul card */
}
.stat-card .stat-info .stat-number {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #e0e0e0; /* Warna angka statistik */
}
.stat-info .badge {
    padding: 3px 8px; border-radius: 5px; color: white; font-size: 0.8em;
}

/* Toggle Switch (Berlaku untuk tema gelap) */
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #3a3a4a; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #007bff; }
input:checked + .slider:before { transform: translateX(26px); }

/* Responsif */
@media (max-width: 768px) {
     .admin-layout { flex-direction: column; }
     .sidebar { width: 100%; min-height: auto; border-right: none; border-bottom: 1px solid #2a2a3a; }
     .main-content-area { padding: 20px; height: auto; }
     .filter-form { flex-direction: column; align-items: stretch; }
     .filter-form .back-link { text-align: center; margin-left: 0; margin-top: 10px; }
     .action-cell { white-space: normal; text-align: left; }
     .action-cell a, .action-cell button { display: block; margin-left: 0; margin-right: 0; }
     .form-grid { grid-template-columns: 1fr; }
     /* Pastikan submenu tampil dengan benar di mobile */
     .sidebar-nav ul.submenu { position: static; background-color: #2a2a3a; }
     .sidebar-nav li:hover > ul.submenu { display: none; } /* Nonaktifkan hover di mobile */
     .sidebar-nav li.open > ul.submenu { display: block; } /* Gunakan class 'open' */
     .login-form { padding: 25px; }
     .stat-cards-container { grid-template-columns: 1fr; } /* Satu kolom di mobile */
}

