/* === Variabel Warna Standar Sistem === */
: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 baru sesuai halaman Laporan */
    --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);
}

/* === Reset Dasar === */
* {
    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;
}

/* === Layout Utama === */
#app {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ================================================
   SIDEBAR - SAMA PENUH DENGAN ADMIN
================================================ */
.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;
}

/* === Konten Utama === */
.main-content {
    margin-left: var(--sidebar-width);
    width: 100%;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}
.main-content.geser {
    margin-left: var(--sidebar-kecil);
}

/* === Header === */
.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;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.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;
}

.pilihan {
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 13px;
    cursor: pointer;
    min-width: 130px;
}
.pilihan option {
    color: var(--text-dark);
}

.btn-header {
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.btn-header:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}
.btn-header.utama {
    background: white;
    color: var(--accent);
    border-color: white;
}
.btn-header.utama:hover {
    background: #F8FAFC;
}

.wadah-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    width: 190px;
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.dropdown.tampil {
    display: block;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 0.8rem 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dark);
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(37,99,235,0.05);
}

.dropdown-item.aktif {
    background: rgba(37,99,235,0.1);
    color: var(--accent);
    font-weight: 500;
}

.text-merah { color: var(--danger); }
.text-hijau { color: var(--success); }
.text-biru { color: var(--accent); }

/* === Kartu Statistik - DISESUAIKAN DENGAN GAYA LAPORAN === */
.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; 
}

/* === Grid & Kartu Grafik === */
.isi-konten {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.grid-grafik { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.grid-grafik-dua { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-jenis { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 1.5rem; align-items: center; }

/* === Kartu Grafik - DISESUAIKAN === */
.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;
    min-width: 0;
}
.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; 
}
.wadah-grafik { 
    padding: 1.5rem; 
    height: 280px; 
}

.daftar-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-info {
    padding: 1rem;
    background: #F8FAFC;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    border: 1px solid var(--border);
}

.item-info.latar-biru {
    background: rgba(37,99,235,0.05);
    border-color: rgba(37,99,235,0.1);
}

.warna-biru { color: var(--accent); font-weight: 600; }

/* === Responsif === */
@media (max-width: 992px) {
    .grid-grafik, .grid-grafik-dua, .grid-jenis {
        grid-template-columns: 1fr;
    }
    .main-content { padding: 1.5rem; margin-left: 0 !important; }
    .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%; text-align: left; margin-top: 0.5rem; }
}

/* === ANIMASI & LAINNYA === */
.animasi-masuk {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}
.animasi-masuk.aktif {
  opacity: 1;
  transform: translateY(0);
}
.stat-card {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.stat-card.masuk {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.card {
  opacity: 0;
  transform: translateY(28px);
  transition: all 0.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}
.card.masuk {
  opacity: 1;
  transform: translateY(0);
}

/* ================================== */
/* ✅ POPUP KONFIRMASI - TANPA ANIMASI */
/* ================================== */
.popup-latar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 20, 53, 0.45);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
}

.popup-latar.aktif {
    opacity: 1;
    visibility: visible;
}

.popup-kotak {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.2rem;
    width: 92%;
    max-width: 440px;
    box-shadow: 
        0 20px 60px rgba(37, 99, 235, 0.18),
        0 8px 24px rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(255,255,255,0.9);
    position: relative;
    overflow: hidden;
}

.popup-kotak::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--accent), var(--purple));
}

.popup-kotak h3 {
    margin: 0 0 1.2rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.popup-kotak h3::before {
    content: '\f2f5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--accent);
}

.popup-kotak p {
    color: var(--text-dark);
    margin-bottom: 2rem;
    line-height: 1.7;
    font-size: 1rem;
    opacity: 0.9;
}

.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;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    min-width: 110px;
}

.btn-batal {
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    color: var(--text-dark);
    border: 1px solid var(--border);
}
.btn-batal:hover {
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
}

.btn-ya {
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-ya:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

/* USER MENU */
.user-menu {
    position: relative;
    z-index: 1200;
}

/* 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;
}

/* FOOTER SIDEBAR — SELALU DI BAWAH */
.sidebar-footer {
    padding: 16px 12px 20px;
    border-top: 0px solid rgba(255,255,255,0.1);
    text-align: center;
    margin-top: auto;
}

.sidebar-footer-logo img {
    height: 150px;
    width: auto;
    margin-bottom: 8px;
    object-fit: contain;
}

.sidebar-footer-text div {
    font-size: 10px;
    color: #94A3B8;
    line-height: 1.4;
}

/* Hapus tombol Keluar lama dari sidebar */
.sidebar-logout {
    display: none;
}

/* Penyesuaian judul header */
.header-text h1 {
    font-size: 22px;
}

/* Responsif */
@media (max-width: 992px) {
    .top-header.premium {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
        margin-top: 0.5rem;
    }
}

@media (max-width: 640px) {
    .header-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .user-profile-btn .user-info {
        display: none;
    }
}