/* ==========================================================
   TES ONLINE - Modern Stylesheet
   Menggabungkan: halaman peserta, tes, hasil, dan admin panel
   ========================================================== */

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f2937;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input,
textarea,
select {
    user-select: text;
    -webkit-user-select: text;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==========================================================
   HALAMAN TENGAH (Login, Index, Hasil)
   ========================================================== */
.page-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 24px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    animation: fadeUp .5s ease;
}

.glass {
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ============ BRAND ============ */
.brand {
    text-align: center;
    margin-bottom: 28px;
}

.brand-icon {
    font-size: 52px;
    margin-bottom: 8px;
    line-height: 1;
}

.brand h1 {
    font-size: 26px;
    font-weight: 800;
    color: #1e1b4b;
    letter-spacing: -0.5px;
}

.brand .sub {
    color: #6b7280;
    font-size: 14px;
    margin-top: 6px;
    line-height: 1.5;
}

/* ============ FORM ============ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background: #f9fafb;
    transition: all .2s;
    outline: none;
    color: #1f2937;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.5;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============ BUTTONS ============ */
.btn {
    padding: 13px 22px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, .4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, .4);
}

.btn-ghost {
    background: #f3f4f6;
    color: #374151;
}

.btn-ghost:hover {
    background: #e5e7eb;
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============ LINK ============ */
.admin-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: #6b7280;
    font-size: 13px;
    text-decoration: none;
    transition: color .2s;
}

.admin-link:hover {
    color: #6366f1;
}

/* ============ ALERT ============ */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ==========================================================
   HALAMAN TES
   ========================================================== */
.page-tes {
    background: #f1f5f9;
    padding-bottom: 40px;
    background-image: none;
}

.tes-header {
    background: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tes-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mini {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.title-mini {
    font-weight: 700;
    font-size: 15px;
    color: #1e1b4b;
    line-height: 1.2;
}

.user-mini {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.timer {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
    min-width: 80px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transition: all .3s;
}

.timer.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: pulse 1s infinite;
}

.progress-bar {
    height: 4px;
    background: #e5e7eb;
    position: sticky;
    top: 72px;
    z-index: 99;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width .3s ease;
}

.tes-container {
    max-width: 780px;
    margin: 24px auto;
    padding: 0 16px;
}

.soal-card {
    background: #fff;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    animation: fadeUp .3s ease;
}

.soal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 10px;
    flex-wrap: wrap;
}

.soal-num {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.badge-pg {
    background: #ddd6fe;
    color: #5b21b6;
}

.badge-essai {
    background: #fed7aa;
    color: #9a3412;
}

.badge-bs {
    background: #bbf7d0;
    color: #166534;
}

.badge-match {
    background: #bae6fd;
    color: #075985;
}

.pertanyaan {
    font-size: 16px;
    line-height: 1.7;
    color: #1f2937;
    margin-bottom: 20px;
    font-weight: 500;
}

/* ============ OPSI PILIHAN ============ */
.opsi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    background: #fafafa;
}

.opsi:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
}

.opsi input[type=radio] {
    width: 20px;
    height: 20px;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}

.opsi input[type=radio]:checked ~ .opsi-label {
    color: #4f46e5;
    font-weight: 600;
}

.opsi:has(input:checked) {
    border-color: #6366f1;
    background: #eef2ff;
}

.opsi-label {
    font-size: 15px;
    color: #374151;
    line-height: 1.5;
}

/* ============ ESSAI ============ */
.input-essai {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    outline: none;
    background: #fafafa;
    line-height: 1.6;
    color: #1f2937;
    min-height: 120px;
    transition: all .2s;
}

.input-essai:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}

/* ============ MENJODOHKAN ============ */
.match-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
}

.match-item {
    font-weight: 600;
    padding: 8px 12px;
    color: #1f2937;
    font-size: 14px;
}

.match-select {
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all .2s;
}

.match-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}

/* ============ NAVIGASI SOAL ============ */
.soal-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

/* ==========================================================
   MODAL (Warning Kecurangan & Form Edit)
   ========================================================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: shake .4s;
}

.modal-icon {
    font-size: 56px;
    margin-bottom: 12px;
    line-height: 1;
}

.modal-box h3 {
    color: #dc2626;
    font-size: 22px;
    margin-bottom: 10px;
}

.modal-box p {
    color: #4b5563;
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 14px;
}

.modal-box .small {
    font-size: 13px;
    color: #6b7280;
}

/* Modal Form (untuk edit admin) */
.modal-form {
    max-width: 560px;
    text-align: left;
    animation: fadeUp .3s;
}

.modal-form h3 {
    margin-bottom: 20px;
    color: #1e1b4b;
    font-size: 18px;
    text-align: left;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ==========================================================
   HALAMAN HASIL TES
   ========================================================== */
.hasil-card {
    text-align: center;
}

.hasil-icon {
    font-size: 60px;
    margin-bottom: 8px;
    line-height: 1;
}

.nilai-bulat {
    width: 160px;
    height: 160px;
    margin: 24px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 15px 40px rgba(99, 102, 241, .4);
}

.nilai-angka {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.nilai-label {
    font-size: 12px;
    letter-spacing: 3px;
    margin-top: 4px;
    opacity: .9;
    font-weight: 600;
}

.hasil-detail {
    background: #f9fafb;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.hasil-detail > div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    gap: 10px;
}

.hasil-detail > div:last-child {
    border: none;
}

.hasil-detail span {
    color: #6b7280;
}

.hasil-detail b {
    color: #1f2937;
    text-align: right;
}

/* ==========================================================
   ADMIN PANEL
   ========================================================== */
.page-admin {
    background: #f1f5f9;
    padding-bottom: 40px;
    background-image: none;
}

/* ============ NAVBAR ============ */
.navbar {
    background: #fff;
    padding: 0 20px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 800;
    font-size: 18px;
    color: #1e1b4b;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-menu a {
    padding: 9px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s;
    white-space: nowrap;
}

.nav-menu a:hover {
    background: #f3f4f6;
}

.nav-menu a.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3);
}

.btn-logout {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

.btn-logout:hover {
    background: #fecaca !important;
}

/* ============ ADMIN CONTAINER ============ */
.admin-container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: #1e1b4b;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header-row .page-title {
    margin-bottom: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

/* ============ STATS CARDS ============ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, .08);
}

.stat-icon {
    font-size: 32px;
    line-height: 1;
}

.stat-num {
    font-size: 26px;
    font-weight: 800;
    color: #6366f1;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-lbl {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

/* ============ INFO BOX ============ */
.info-box {
    background: #fff;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    margin-bottom: 20px;
}

.info-box h3 {
    margin-bottom: 12px;
    color: #1e1b4b;
    font-size: 16px;
}

.info-box ol {
    padding-left: 20px;
    line-height: 1.9;
    color: #4b5563;
    font-size: 14px;
}

.info-box code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: #6366f1;
    word-break: break-all;
}

/* ============ PANEL ============ */
.panel {
    background: #fff;
    padding: 22px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
    margin-bottom: 20px;
}

.panel h3 {
    margin-bottom: 16px;
    color: #1e1b4b;
    font-size: 17px;
}

/* ============ GRID ============ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============ PAKET LIST ============ */
.paket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

.paket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all .2s;
    gap: 8px;
}

.paket-item:hover {
    background: #f9fafb;
}

.paket-item.active {
    background: #eef2ff;
    border-color: #6366f1;
}

.paket-item a {
    text-decoration: none;
    color: #1f2937;
    flex: 1;
    font-size: 14px;
}

.paket-item small {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-top: 3px;
    font-weight: 400;
}

/* ============ SOAL ITEM ============ */
.soal-item {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    transition: background .2s;
}

.soal-item:hover {
    background: #fafafa;
}

.soal-item-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.soal-item-q {
    flex: 1;
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============ TABEL ============ */
.table-wrap {
    background: #fff;
    border-radius: 16px;
    overflow: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th {
    background: #f9fafb;
    padding: 14px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.table td {
    padding: 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
}

.table tr:hover td {
    background: #fafafa;
}

.table tr:last-child td {
    border-bottom: none;
}

.table small {
    color: #6b7280;
    font-size: 11px;
}

/* ============ NILAI BADGE ============ */
.nilai-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.nilai-badge.good {
    background: #dcfce7;
    color: #166534;
}

.nilai-badge.mid {
    background: #fef3c7;
    color: #92400e;
}

.nilai-badge.bad {
    background: #fee2e2;
    color: #991b1b;
}

/* ============ ROLE BADGE ============ */
.badge-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: #ddd6fe;
    color: #5b21b6;
    display: inline-block;
}

.badge-role.super {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

/* ============ STATUS ============ */
.status-aktif {
    color: #16a34a;
    font-weight: 600;
    font-size: 13px;
}

.status-nonaktif {
    color: #dc2626;
    font-weight: 600;
    font-size: 13px;
}

/* ============ CHECKBOX ============ */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    background: #f9fafb;
    transition: all .2s;
}

.checkbox-label:hover {
    border-color: #a5b4fc;
    background: #f5f3ff;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

/* ============ ACTION BUTTONS ============ */
.aksi-cell {
    display: flex;
    gap: 6px;
}

.btn-icon {
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    line-height: 1;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit:hover {
    background: #bfdbfe;
    transform: scale(1.05);
}

.btn-del {
    background: #fee2e2;
    color: #dc2626;
}

.btn-del:hover {
    background: #fecaca;
    transform: scale(1.05);
}

/* ============ FILTER ============ */
.filter-row {
    margin-bottom: 16px;
}

.filter-row select {
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    font-family: inherit;
    background: #fff;
    font-size: 14px;
    min-width: 220px;
    cursor: pointer;
    outline: none;
    transition: all .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.filter-row select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}

/* ==========================================================
   SCROLLBAR CUSTOM
   ========================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================
   RESPONSIVE - TABLET & MOBILE
   ========================================================== */
@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 20px;
    }

    .stat-num {
        font-size: 22px;
    }

    .stat-icon {
        font-size: 28px;
    }

    .navbar {
        padding: 0 12px;
    }

    .nav-brand {
        font-size: 15px;
    }
}

@media (max-width: 640px) {
    /* Center card */
    .card {
        padding: 28px 22px;
        border-radius: 20px;
    }

    .brand h1 {
        font-size: 22px;
    }

    .brand-icon {
        font-size: 44px;
    }

    /* Tes */
    .soal-card {
        padding: 20px;
        border-radius: 16px;
    }

    .pertanyaan {
        font-size: 15px;
    }

    .tes-header {
        padding: 12px 14px;
    }

    .title-mini {
        font-size: 14px;
    }

    .user-mini {
        font-size: 11px;
    }

    .logo-mini {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .timer {
        padding: 6px 12px;
        font-size: 14px;
        min-width: 70px;
    }

    .progress-bar {
        top: 62px;
    }

    /* Navigasi */
    .soal-nav {
        flex-direction: column-reverse;
    }

    .soal-nav .btn {
        width: 100%;
    }

    /* Match */
    .match-row {
        grid-template-columns: 1fr;
    }

    /* Form */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Table */
    .table th,
    .table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    /* Hasil */
    .nilai-angka {
        font-size: 46px;
    }

    .nilai-bulat {
        width: 140px;
        height: 140px;
    }

    /* Navbar mobile - scroll horizontal */
    .nav-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 0;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu a {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Admin actions */
    .aksi-cell {
        flex-direction: column;
    }

    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-row .btn {
        width: 100%;
    }

    /* Modal */
    .modal-box {
        padding: 24px 20px;
    }

    .modal-form {
        max-width: 100%;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }

    /* Filter */
    .filter-row select {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 400px) {
    .card {
        padding: 24px 18px;
    }

    .brand h1 {
        font-size: 20px;
    }

    .pertanyaan {
        font-size: 14px;
    }

    .opsi {
        padding: 12px;
    }

    .opsi-label {
        font-size: 14px;
    }

    .btn {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* ==========================================================
   PRINT STYLE (untuk cetak/PDF dari browser)
   ========================================================== */
@media print {
    body {
        background: #fff;
    }

    .navbar,
    .btn,
    .btn-logout,
    .filter-row,
    .aksi-cell {
        display: none !important;
    }

    .panel,
    .table-wrap {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .page-admin {
        background: #fff;
    }
}

/* ==========================================================
   DARK MODE (opsional - otomatis mengikuti sistem)
   ========================================================== */
@media (prefers-color-scheme: dark) {
    /* Biarkan default karena app sudah modern dengan warna