/* ============================================
   RESET & BASE
============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.5;
    min-height: 100vh;
}
a { color: #1e88e5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   LAYOUT
============================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main-content { padding: 20px 16px; }

.topbar {
    background: #0d47a1;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 12px 16px;
    flex-wrap: wrap;
}
.brand { font-size: 1.15rem; font-weight: 600; }
.topbar a { color: #fff; }

.footer {
    text-align: center; padding: 24px 16px; color: #7f8c8d; font-size: .875rem;
}

/* ============================================
   CARD
============================================ */
.card {
    background: #fff; border-radius: 12px;
    padding: 20px; margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card h2, .card h3 { margin-bottom: 16px; color: #0d47a1; }
.card h4 { margin: 16px 0 8px; }

/* ============================================
   ALERT
============================================ */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.alert-error   { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
.alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }

/* ============================================
   FORM
============================================ */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 4px; font-size: .9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid #cfd8dc; border-radius: 8px;
    font-size: 1rem; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #1e88e5; box-shadow: 0 0 0 3px rgba(30,136,229,.15);
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.grid-form .full { grid-column: 1 / -1; }

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 500; cursor: pointer;
    text-decoration: none !important; transition: all .15s;
    -webkit-tap-highlight-color: transparent;
}
.btn-sm { padding: 6px 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-primary   { background: #1e88e5; color: #fff; }
.btn-primary:hover   { background: #1565c0; }
.btn-secondary { background: #eceff1; color: #37474f; }
.btn-secondary:hover { background: #cfd8dc; }
.btn-danger    { background: #e53935; color: #fff; }
.btn-danger:hover    { background: #c62828; }

/* ============================================
   TABLE — Responsive
============================================ */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
table {
    width: 100%; border-collapse: collapse; min-width: 500px; background: #fff;
}
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eceff1; }
th { background: #f5f7fa; font-weight: 600; font-size: .875rem; color: #546e7a; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #fafbfc; }
.aksi { white-space: nowrap; }
.aksi .btn { margin: 2px 0; }

.info-table { width: 100%; min-width: auto; }
.info-table td { padding: 8px 12px; }
.info-table td:first-child { width: 40%; color: #546e7a; }

/* ============================================
   STATS & MENU
============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px; margin-bottom: 16px;
}
.stat-card {
    background: #fff; padding: 16px; border-radius: 12px;
    text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-top: 4px solid #1e88e5;
}
.stat-warn { border-top-color: #f57c00; }
.stat-num { font-size: 1.75rem; font-weight: 700; color: #0d47a1; }
.stat-label { font-size: .875rem; color: #546e7a; }

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

/* ============================================
   BADGE
============================================ */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; background: #eceff1; color: #37474f;
}
.badge-pending      { background: #fff3e0; color: #e65100; }
.badge-terverifikasi{ background: #e8f5e9; color: #2e7d32; }
.badge-ditolak      { background: #ffebee; color: #c62828; }

/* ============================================
   SEARCH
============================================ */
.search-form {
    display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.search-form input {
    flex: 1 1 200px; padding: 10px 12px;
    border: 1px solid #cfd8dc; border-radius: 8px; font-size: 1rem;
}

/* ============================================
   AUTH PAGE (LOGIN)
============================================ */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 20px;
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
}
.auth-card {
    background: #fff; padding: 32px 24px;
    border-radius: 16px; width: 100%; max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: 8px; }
.auth-card h2 { text-align: center; font-size: 1.35rem; margin-bottom: 4px; color: #0d47a1; }
.auth-card p { text-align: center; }

/* ============================================
   UTILITIES
============================================ */
.muted { color: #90a4ae; font-size: .875rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.kelas-title { margin-top: 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ============================================
   MOBILE — HP
============================================ */
@media (max-width: 600px) {
    .brand { font-size: 1rem; }
    .card { padding: 16px; border-radius: 10px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-num { font-size: 1.5rem; }
    .btn { padding: 12px 16px; font-size: 1rem; } /* tombol lebih besar agar mudah disentuh */
    .btn-sm { padding: 8px 10px; font-size: .8rem; }
    .topbar-inner { padding: 10px 12px; }
    .search-form .btn { width: 100%; }
    .search-form .btn + .btn { margin-top: 4px; }
    .auth-card { padding: 24px 16px; }
    .grid-form { grid-template-columns: 1fr; }
}

/* ============================================
   LOGIN — INPUT PASSWORD TOGGLE
============================================ */
.input-password-wrap {
    position: relative;
}
.input-password-wrap input {
    padding-right: 46px;
}
.btn-toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    color: #546e7a;
    -webkit-tap-highlight-color: transparent;
}
.btn-toggle-password:hover { background: #eceff1; }
.btn-toggle-password:active { background: #cfd8dc; }

/* ============================================
   CHECKBOX ROW
============================================ */
.form-checkbox label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    color: #455a64;
    cursor: pointer;
    font-weight: 400 !important;
}
.form-checkbox input[type="checkbox"] {
    width: auto !important;
    accent-color: #1e88e5;
    transform: scale(1.15);
}

/* ============================================
   NIK HINT (counter digit)
============================================ */
.nik-hint {
    display: block;
    margin-top: 4px;
    font-size: .75rem;
    text-align: right;
}

/* ============================================
   HIGHLIGHT PENCARIAN
============================================ */
mark {
    background: #fff59d;
    padding: 0 2px;
    border-radius: 2px;
}

/* ============================================
   BUTTON DISABLED
============================================ */
.btn:disabled,
.btn[disabled] {
    opacity: .65;
    cursor: not-allowed;
}

/* ============================================
   SIDEBAR & RESPONSIVE MOBILE (ANDROID)
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: #0d47a1;
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    background: #08306b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li a {
    display: block;
    padding: 15px 20px;
    color: #e3f2fd;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: 0.2s;
}

.sidebar-menu li a:hover {
    background: #1565c0;
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: none; /* Disembunyikan di desktop */
}

.main-content-with-sidebar {
    margin-left: 260px;
    padding: 20px;
    transition: margin-left 0.3s;
}

/* TOMBOL HAMBURGER (Hanya Muncul di HP) */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================================
   MEDIA QUERY UNTUK HP (MAX WIDTH 768PX)
   ============================================ */
@media (max-width: 768px) {
    /* Sidebar disembunyikan secara default di HP */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    
    .close-btn {
        display: block;
    }

    /* Konten utama full width */
    .main-content-with-sidebar {
        margin-left: 0;
        padding: 15px;
    }

    /* Tampilkan hamburger, sembunyikan tombol logout di topbar */
    .hamburger {
        display: block;
    }
    .hide-on-mobile {
        display: none;
    }

    /* Sesuaikan topbar */
    .topbar-inner {
        justify-content: flex-start;
        gap: 15px;
    }
}

.has-sidebar {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.main-content-with-sidebar {
    padding-bottom: 60px; /* Memberi ruang agar konten tidak tertutup footer */
}