/* === SALIN SELURUH ISI CSS DARI ADMIN DISINI === */
:root {
    --primary: #0A1435;
    --accent: #2563EB;
    --accent-hover: #1D4ED8;
    --text-dark: #111827;
    --text-light: #6B7280;
    --bg-page: #F0F7FF;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --purple: #8B5CF6;
    --teal: #14B8A6; /* ✅ WARNA UNTUK SUDAH KELUAR */
    --sidebar-width: 220px;
    --sidebar-kecil: 0px;
    --shadow-soft: 0 8px 24px rgba(37, 99, 235, 0.08);
    --shadow-hover: 0 12px 32px rgba(37, 99, 235, 0.15);
    --transition-speed: 0.5s;
    --transition-fast: 0.3s;
    --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(180deg, #F0F7FF 0%, #E6EFFC 100%);
    color: var(--text-dark);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    font-size: 14px;
}

#app {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #0F2540 0%, #091C33 100%);
    color: #E2E8F0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    background-image: 
        linear-gradient(180deg, rgba(15, 37, 64, 0.92) 0%, rgba(9, 28, 51, 0.95) 100%),
        url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_YTgPjh8yFs573qzCCJvnWJCef0n9e3jxeZtf5mkyDX8tnG1PVRRWVP0YUiwPn40_GtjLU2YjvQwN-iYe6dClkzB_024rRjaeR2667TJgBhyphenhyphenAxd09o7ZfirsJRtPWRIMGeCxfJSCezObVN-GO3wWySJarV_Vu-F_KkivBy2BgSrrCuxVMqKEbSiTWyDY/w225-h400/Pisahkan%20Gambar.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.sidebar.tertutup {
    transform: translateX(-100%);
}

.sidebar-brand {
    padding: 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-logo-row img {
    height: 42px;
    width: auto;
    object-fit: contain;
}
.brand-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.brand-title-main {
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}
.brand-title-sub {
    font-size: 13px;
    color: #94A3B8;
    font-weight: 500;
}

.brand-description {
    margin-top: 14px;
    padding: 12px 3px 0;
    border-top: 1px solid rgba(255,255,255,0.10);
    text-align: left;
}

.brand-system-name {
    font-size: 8.5px;
    line-height: 1.6;
    font-weight: 600;
    color: #CBD5E1;
    letter-spacing: 0.35px;
}

.brand-location {
    margin-top: 6px;
    font-size: 8px;
    line-height: 1.5;
    color: #64748B;
    font-weight: 500;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.sidebar-menu::-webkit-scrollbar {
    width: 3px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.menu-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748B;
    padding: 12px 8px 8px;
    letter-spacing: 0.8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 2px;
    border-radius: 8px;
    color: #CBD5E1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.menu-item i {
    width: 20px;
    font-size: 17px;
    text-align: center;
    flex-shrink: 0;
}
.menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #FFFFFF;
    transform: translateX(3px);
}
.menu-item.active {
    background: rgba(59, 130, 246, 0.18);
    color: #FFFFFF;
    border-left: 3px solid #3B82F6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}
.menu-item-sub {
    font-size: 11px;
    color: #94A3B8;
    margin-top: 1px;
}

.sidebar-footer {
    padding: 16px 12px 20px;
    border-top: 0px solid rgba(255,255,255,0.1);
    text-align: center;
}
.sidebar-footer-logo img {
    height: 150px;
    width: auto;
    margin-bottom: 8px;
    object-fit: contain;
}
.sidebar-footer-text strong {
    display: block;
    font-size: 12px;
    color: #FFFFFF;
    margin-bottom: 4px;
    font-weight: 600;
}
.sidebar-footer-text div {
    font-size: 10px;
    color: #94A3B8;
    line-height: 1.4;
}

.sidebar-logout {
    padding: 12px 12px 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}
.sidebar-logout .menu-item {
    color: #FCA5A5;
}
.sidebar-logout .menu-item:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #FECDD3;
    transform: translateX(3px);
}
.sidebar-logout .menu-item i {
    color: #F87171;
}
.sidebar-logout .menu-item:hover i {
    color: #FCA5A5;
}

.main-content {
    margin-left: 220px;
    width: 100%;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}
.main-content.geser {
    margin-left: 0;
}

.top-header.premium {
    background: linear-gradient(135deg, #0F2540 0%, #2563EB 50%, #0A1435 100%);
    color: white;
    padding: 1.75rem 2rem;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(15, 37, 64, 0.3);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    border: 1px solid rgba(255,255,255,0.1);
}

.header-left {
    display: flex; 
    align-items: center;
    gap: 12px; 
    flex: 1; 
    min-width: 300px;
}

.header-right {
    display: flex; 
    gap: 10px;
}

.toggle-sidebar {
    width: 38px; 
    height: 38px; 
    border-radius: 10px;
    background: rgba(255,255,255,0.2); 
    border: 1px solid rgba(255,255,255,0.3);
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 17px; 
    color: white; 
    transition: all 0.3s ease; 
    flex-shrink: 0;
}
.toggle-sidebar:hover { background: rgba(255,255,255,0.3); transform: scale(1.05); }

.header-text h1 { 
    font-size: 26px; 
    font-weight: 700; 
    color: white; 
    line-height: 1.2; 
    margin: 0;
}

/* ================================================
   ✅ STYLE BARU: MENU DROPDOWN EKSPOR
================================================ */
.dropdown-ekspor {
    position: relative;
    display: inline-block;
}

.btn-ekspor-induk {
    padding: 9px 18px;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

.btn-ekspor-induk:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.ikon-panah {
    font-size: 11px;
    transition: transform 0.3s ease;
}

/* Kotak pilihan dropdown */
.isi-dropdown-ekspor {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    min-width: 220px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: 1px solid var(--border);
    z-index: 9999;
    overflow: hidden;
    transform: translateY(8px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tampilkan saat hover/fokus */
.dropdown-ekspor:hover .isi-dropdown-ekspor {
    display: block;
    transform: translateY(0);
    opacity: 1;
}
.dropdown-ekspor:hover .ikon-panah {
    transform: rotate(180deg); /* panah berbalik ke atas */
}

/* Tombol pilihan di dalam dropdown */
.tombol-pilihan-ekspor {
    width: 100%;
    padding: 12px 18px;
    border: none;
    background: white;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
    text-align: left;
}
.tombol-pilihan-ekspor:hover {
    background: rgba(37, 99, 235, 0.08);
}
.tombol-pilihan-ekspor.excel:hover { color: #16a34a; }
.tombol-pilihan-ekspor.pdf:hover { color: #dc2626; }

.tombol-pilihan-ekspor i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Responsif di HP/Tablet */
@media (max-width: 768px) {
    .isi-dropdown-ekspor {
        right: auto;
        left: 0;
    }
}

.stats-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 1.5rem; 
    margin-bottom: 2rem;
}
.stat-card {
    background: rgba(255,255,255,0.92); 
    backdrop-filter: blur(12px); 
    border-radius: 20px;
    padding: 1.5rem; 
    box-shadow: var(--shadow-soft); 
    display: flex; 
    align-items: center; 
    gap: 1.25rem;
    border: 1px solid rgba(255,255,255,0.7); 
    transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.stat-card.blue { border-left: 4px solid var(--accent); }
.stat-card.green { border-left: 4px solid var(--success); }
.stat-card.amber { border-left: 4px solid var(--warning); }
.stat-card.purple { border-left: 4px solid var(--purple); }
.stat-card.red { border-left: 4px solid var(--danger); }
.stat-card.teal { border-left: 4px solid var(--teal); }
.stat-icon {
    width: 56px; 
    height: 56px; 
    border-radius: 16px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 24px; 
    color: white; 
    flex-shrink: 0;
}
.blue .stat-icon { background: linear-gradient(135deg, var(--accent) 0%, #3B82F6 100%); }
.green .stat-icon { background: linear-gradient(135deg, var(--success) 0%, #34D399 100%); }
.amber .stat-icon { background: linear-gradient(135deg, var(--warning) 0%, #FBBF24 100%); }
.purple .stat-icon { background: linear-gradient(135deg, var(--purple) 0%, #A78BFA 100%); }
.red .stat-icon { background: linear-gradient(135deg, var(--danger) 0%, #F87171 100%); }
.teal .stat-icon { background: linear-gradient(135deg, var(--teal) 0%, #2DD4BF 100%); }
.stat-card h3 { font-size: 32px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.stat-card p { color: var(--text-light); font-size: 14px; }

.card {
    background: rgba(255,255,255,0.92); 
    backdrop-filter: blur(12px); 
    border-radius: 20px;
    box-shadow: var(--shadow-soft); 
    border: 1px solid rgba(255,255,255,0.7);
    transition: all 0.3s ease; 
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card-header {
    padding: 1.5rem; 
    border-bottom: 1px solid var(--border); 
    background: rgba(249,250,251,0.6);
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.card-header h3 { font-size: 16px; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.card-body { padding: 1.5rem; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
}

.form-grup label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.form-grup input,
.form-grup select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-page);
    font-size: 14px;
}

.form-grup input:focus,
.form-grup select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tombol-filter {
    display: flex;
    gap: 8px;
}

.btn-cari {
    flex: 1;
    padding: 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-cari:hover { background: var(--accent-hover); }

.btn-reset {
    padding: 10px 14px;
    background: #E5E7EB;
    color: var(--text-dark);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-reset:hover { background: #D1D5DB; }

.tabel-terbaru { width: 100%; border-collapse: collapse; }
.tabel-terbaru th, .tabel-terbaru td {
    padding: 0.8rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px;
}
.tabel-terbaru th { font-weight: 600; color: var(--text-light); background: #F8FAFC; }
.tabel-terbaru tr:last-child td { border-bottom: none; }

.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}
.badge.menunggu { background: var(--warning); }
.badge.ditolak { background: var(--danger); }
.badge.selesai { background: var(--success); }

.btn-aksi {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-aksi:hover {
    background: var(--accent);
    color: white;
}

.paginasi {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(249,250,251,0.6);
    flex-wrap: wrap;
}

.info-halaman {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

#navigasiHalaman {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-halaman {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
}

.btn-halaman:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(37, 99, 235, 0.05);
}

.btn-halaman.aktif {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}

.btn-halaman:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F3F4F6;
}

@media (max-width: 992px) {
    .main-content { padding: 1.5rem; }
    .sidebar { transform: translateX(-100%); z-index: 999; }
    .sidebar.tertutup { transform: translateX(0); width: 220px; }
    .top-header.premium { flex-direction: column; align-items: flex-start; }
    .header-right { width: 100%; margin-top: 0.5rem; }
    .paginasi { justify-content: center; }
    .info-halaman { margin-left: 0; width: 100%; text-align: center; margin-top: 0.5rem; }
}

/* ================================================
   ANIMASI MASUK HALAMAN REKAP LAPORAN
================================================ */
@keyframes fadeMasuk {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.top-header.premium,
.stat-card,
.card {
    opacity: 0;
    animation: fadeMasuk 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.top-header.premium { animation-delay: 0.08s; }
.stat-card:nth-child(1) { animation-delay: 0.18s; }
.stat-card:nth-child(2) { animation-delay: 0.26s; }
.stat-card:nth-child(3) { animation-delay: 0.34s; }
.stat-card:nth-child(4) { animation-delay: 0.42s; }
.stat-card:nth-child(5) { animation-delay: 0.50s; }
.card:nth-of-type(1) { animation-delay: 0.60s; }
.card:nth-of-type(2) { animation-delay: 0.68s; }

/* ================================================
   POPUP KELUAR - CLASS KHUSUS (TIDAK BENTROK)
================================================ */
.popup-latar-keluar {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: rgba(10, 20, 53, 0.45);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.popup-latar-keluar.aktif { display: flex; }

.popup-kotak-keluar {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.2rem;
    width: 92%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(255,255,255,0.9);
    position: relative;
}
.popup-kotak-keluar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
}
.popup-kotak-keluar h3 {
    margin: 0 0 1.2rem; font-size: 1.4rem; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 0.7rem;
}
.popup-kotak-keluar h3::before {
    content: '\f2f5'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 1.3rem; color: var(--accent);
}
.popup-kotak-keluar p {
    color: var(--text-dark); margin-bottom: 2rem; line-height: 1.7; font-size: 1rem;
}
.popup-tombol {
    display: flex; gap: 1rem; justify-content: flex-end;
}
.btn {
    border: none; padding: 0.85rem 1.8rem; border-radius: 12px;
    cursor: pointer; font-weight: 600; font-size: 0.95rem; min-width: 110px;
}
.btn-batal {
    background: #f8fafc; color: var(--text-dark); border: 1px solid var(--border);
}
.btn-ya {
    background: #2563EB; color: white;
}

/* ================================================
   MODAL DETAIL TAMU - DIRAPIKAN & SESUAI TEMA
================================================ */
.modal-detail-latar {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: rgba(10, 20, 53, 0.45);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100001;
}
.modal-detail-latar.aktif { display: flex; }

.modal-detail-kotak {
    background: #ffffff;
    border-radius: 16px;
    width: 95%;
    max-width: 620px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1px solid var(--border);
}

.modal-detail-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 1.8rem; border-bottom: 1px solid var(--border);
    background: rgba(249,250,251,0.5);
}
.modal-logo-judul { display: flex; align-items: center; gap: 10px; }
.logo-modal { height: 24px; width: auto; }
.modal-detail-header h3 { margin: 0; font-size: 17px; font-weight: 700; color:var(--primary); }
.tombol-tutup-modal {
    background: none; border: none; font-size: 22px;
    color: var(--text-light); cursor: pointer; transition: color 0.2s;
    padding: 0; line-height: 1;
}
.tombol-tutup-modal:hover { color: var(--danger); }

.modal-detail-isi {
    padding: 1.8rem;
    display: flex; gap: 1.8rem; align-items: flex-start;
}

/* ✅ KOTAK FOTO, NAMA & ID TAMU - DIRAPIKAN */
.foto-tamu-wadah {
    flex-shrink: 0; 
    text-align: center;
    background: var(--bg-page);
    border-radius: 12px;
    padding: 1.2rem 1rem;
    width: 200px;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.foto-tamu-wadah:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.foto-tamu {
    width: 150px; 
    height: 160px; 
    border-radius: 8px;
    object-fit: cover; 
    background: white; 
    border: 2px solid var(--border);
    margin-bottom: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.foto-tamu-wadah h4 { 
    margin: 0; 
    font-size: 16px; 
    font-weight: 700; 
    color:var(--primary);
    letter-spacing: 0.3px;
}
.foto-tamu-wadah span { 
    font-size: 12px; 
    color:var(--text-light); 
    display:block; 
    margin-top: 2px;
    font-weight: 500;
}

.data-tamu-wadah {
    flex:1; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 1rem;
}
.baris-data {
    display: flex; align-items: flex-start; gap: 8px;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.baris-data:last-child { border-bottom: none; padding-bottom: 0; }
.baris-data i { color: var(--accent); margin-top: 2px; width: 16px; text-align: center; flex-shrink:0; font-size:14px; }
.baris-data label { 
    font-size: 10px; 
    color:var(--text-light); 
    text-transform: uppercase; 
    margin-bottom: 2px; 
    display:block; 
    letter-spacing: 0.4px;
    font-weight: 600;
}
.baris-data span { 
    font-size: 13px; 
    font-weight:600; 
    color:var(--text-dark); 
}

.modal-detail-tombol {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 0 1.8rem 1.8rem;
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
}
.btn-tutup {
    padding: 9px 20px; border: none; border-radius: 10px;
    background: var(--accent); color:white; font-weight:600; cursor:pointer;
    display:flex; align-items:center; gap:6px; transition:all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.btn-tutup:hover { 
    background: var(--accent-hover); 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

/* ================================================
   DESAIN BARU: PENCARIAN & FILTER DRAWER (DIPERBAIKI)
================================================ */
.pencarian-atas {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.kotak-pencarian {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.kotak-pencarian i {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    font-size: 16px;
}
.kotak-pencarian input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    font-size: 14px;
    transition: all 0.2s;
}
.kotak-pencarian input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tombol-buka-filter {
    padding: 0.85rem 1.25rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.tombol-buka-filter:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.filter-aktif {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-dark);
}

/* DRAWER LATAR BELAKANG */
.latar-drawer {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    transition: opacity 0.3s ease;
}
.latar-drawer.aktif { display: block; }

/* PANEL FILTER KANAN */
.drawer-filter {
    position: fixed;
    top: 0; right: 0;
    width: 380px;
    max-width: 92%;
    height: 100vh;
    background: white;
    box-shadow: -8px 0 32px rgba(0,0,0,0.1);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.drawer-filter.aktif { transform: translateX(0); }

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}
.tombol-tutup-drawer {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.tombol-tutup-drawer:hover { color: var(--danger); }

.drawer-isi {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.grup-filter {
    margin-bottom: 1.75rem;
}

/* Judul grup huruf besar seperti gambar */
.judul-grup {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

/* === PERBAIKAN UTAMA: RADIO KIRI, TEKS KANAN & SEJAJAR === */
.pilihan-periode {
    display: flex;
    flex-direction: column;
    gap: 0.55rem; /* Jarak antar baris seragam */
    padding: 0.3rem 0;
}

.pilihan-radio {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Isi rata kiri */
    gap: 12px; /* Jarak tetap antara radio dan teks */
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s ease;
    text-align: left; /* Teks pasti rata kiri */
}

.pilihan-radio:hover {
    background: rgba(37, 99, 235, 0.05);
}

.pilihan-radio:has(input:checked) {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
    font-weight: 500;
}

.pilihan-radio input[type="radio"] {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0; /* Ukuran radio tetap, tidak tergeser */
}

/* Input tanggal custom sejajar dan rapi */
.input-tanggal-custom {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-left: 26px; /* Sejajar dengan teks pilihan */
}
.form-grup {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-grup label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}

/* Jarak antar grup filter lebih seimbang */
.grup-filter {
    margin-bottom: 1.8rem;
}

/* Perbaiki tinggi drawer agar muat semua konten */
.drawer-filter {
    width: 360px; /* Sedikit lebih ramping */
}

.drawer-isi select,
.drawer-isi input {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-page);
    font-size: 14px;
    transition: all 0.2s;
}
.drawer-isi select:focus,
.drawer-isi input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.drawer-tombol {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.btn-terapkan {
    padding: 0.95rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-terapkan:hover { 
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.btn-reset-semua {
    padding: 0.95rem;
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-reset-semua:hover { background: #F8FAFC; }

/* RESPONSIF */
@media (max-width: 768px) {
    .pencarian-atas { flex-direction: column; align-items: stretch; }
    .tombol-buka-filter { justify-content: center; }
    .drawer-filter { width: 100%; max-width: 100%; }
}

/* ==============================================
✅ MODAL FOTO PENUH — KLIK FOTO UNTUK MEMPERBESAR
============================================== */
.modal-foto-latar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 100002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-foto-konten {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
}

.modal-foto-konten img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.tutup-foto {
    position: absolute;
    top: -12px;
    right: -12px;
    font-size: 32px;
    color: #ffffff;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.4);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tutup-foto:hover {
    color: #fca5a5;
    background: rgba(0,0,0,0.6);
}

/* ✅ Foto di modal detail bisa diklik */
.foto-tamu {
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.foto-tamu:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

/* BUTTON PROFILE */
.user-profile-btn {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.10);
    color: #FFFFFF;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.user-profile-btn:hover {
    background: rgba(255,255,255,0.17);
    border-color: rgba(255,255,255,0.20);
}

.user-profile-btn:active {
    transform: scale(0.98);
}

/* AVATAR HEADER */
.user-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #FFFFFF;
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* USER INFO HEADER */
.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 60px;
    line-height: 1.25;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
}

.user-role {
    font-size: 10px;
    color: rgba(255,255,255,0.65);
    margin-top: 2px;
}

/* CHEVRON */
.user-profile-btn > .fa-chevron-down {
    font-size: 10px;
    color: rgba(255,255,255,0.75);
    margin-left: 2px;
    transition: transform 0.2s ease;
}

/* DROPDOWN */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    min-width: 220px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    display: none;
    z-index: 999999;
    transform-origin: top right;
}

.user-dropdown.show {
    display: block;
    animation: dropdownMasuk 0.18s ease-out;
}

@keyframes dropdownMasuk {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* HEADER USER DI DROPDOWN */
.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px 11px;
}

.dropdown-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(37,99,235,0.20);
    overflow: hidden;
}

.dropdown-user-info strong {
    display: block;
    color: #0F172A;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.dropdown-user-info span {
    display: block;
    margin-top: 2px;
    color: #64748B;
    font-size: 11px;
}

/* GARIS PEMISAH */
.dropdown-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 5px 2px;
}

/* ITEM MENU */
.dropdown-item {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #64748B;
    flex-shrink: 0;
    transition: color 0.18s ease;
}

.dropdown-item:hover {
    background: #F1F5F9;
    color: #1D4ED8;
    transform: translateX(2px);
}

.dropdown-item:hover i {
    color: #2563EB;
}

/* LOGOUT */
.dropdown-item.logout-item {
    color: #DC2626;
}

.dropdown-item.logout-item i {
    color: #EF4444;
}

.dropdown-item.logout-item:hover {
    background: #FEF2F2;
    color: #B91C1C;
    transform: translateX(2px);
}

.dropdown-item.logout-item:hover i {
    color: #DC2626;
}

/* ================================================
✅ PERBAIKAN: Header & Dropdown Tidak Tertutup
================================================ */
.top-header.premium {
    position: relative; /* Penting! Agar z-index anak bekerja */
    z-index: 100; /* Header berada di atas kartu statistik */
}

/* Pastikan dropdown pengguna SELALU di paling atas */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    min-width: 220px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
    display: none;
    z-index: 999999 !important; /* Paling tinggi dari semua elemen lain */
    transform-origin: top right;
}

.user-dropdown.show {
    display: block;
    animation: dropdownMasuk 0.18s ease-out;
}

/* Beri jarak yang cukup agar kartu tidak menumpuk ke header */
.stats-grid {
    position: relative;
    z-index: 1; /* Kartu statistik berada DI BAWAH header */
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

/* Pastikan wrapper header-kanan juga punya posisi relatif */
.header-right {
    position: relative;
    display: flex; 
    gap: 10px;
}

/* Pastikan menu pengguna juga punya posisi relatif sebagai induk */
.user-menu {
    position: relative;
}