:root {
    /* Gradient dan warna utama jadi Ungu */
    --primary-gradient: linear-gradient(135deg, #6f42c1 0%, #4a2c85 100%);
    --church-blue: #6f42c1; 
    --slate-dark: #1e293b;
    --soft-slate: #64748b;
    --bg-canvas: #f8fafc;
}

body { 
    background-color: var(--bg-canvas); 
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--slate-dark);
}

/* Navbar diatur agar mengikuti navbar.php */
.navbar {
    z-index: 10000 !important;
    position: relative;
}

.hero-stat {
    background: var(--primary-gradient);
    color: white;
    padding: 70px 0 130px 0;
    border-radius: 0 0 35px 35px;
    position: relative;
    z-index: 1;
}

.container-stats {
    margin-top: -80px;
    position: relative;
    z-index: 5;
}

.stat-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.digital-grid { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.aurora-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2; overflow: hidden; }

.stat-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 10px 25px rgba(111, 66, 193, 0.1); 
}

.icon-box {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
}

/* Nuansa Ungu & Light Accent */
.bg-blue-light { background: #f3effb; color: #6f42c1; }
.bg-green-light { background: #f0fdf4; color: #16a34a; }
.bg-orange-light { background: #fff7ed; color: #ea580c; }

.chart-container { 
    position: relative; 
    height: 200px; 
    width: 100%; 
    padding: 5px; 
}

.card-header-digital {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 18px;
    font-weight: 700;
    color: var(--slate-dark);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-pills-custom {
    background: #ffffff;
    padding: 6px;
    border-radius: 50px;
    display: inline-flex;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    border: 1px solid #e2e8f0;
}

.nav-pills-custom .nav-link {
    color: var(--soft-slate);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50px;
    padding: 10px 24px;
    transition: all 0.2s ease;
    white-space: nowrap; /* Menjaga teks tombol agar tidak patah ke bawah */
}

.nav-pills-custom .nav-link.active {
    background-color: var(--church-blue) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.2);
}

/* BPMJ Cards */
.bpmj-card{
    border:none;
    border-radius:20px;
    overflow:hidden;
    transition:.3s;
    background:#fff;
    box-shadow:0 5px 20px rgba(0,0,0,.06);
    max-width:220px;
    margin:auto;
}

.bpmj-card:hover{
    transform:translateY(-6px);
    box-shadow:0 12px 30px rgba(111,66,193,.15);
}

.bpmj-photo{
    width:100%;
    aspect-ratio:1/1;
    object-fit:cover;
    cursor:pointer;
}

.bpmj-info{
    padding:10px 12px;
}

.bpmj-name{
    font-weight:700;
    font-size:.8rem;
    margin-bottom:4px;
    color:#1e293b;
}

.bpmj-position{
    font-size:.72rem;
    color:#64748b;
}

.ketua-card{
    border:2px solid #6f42c1; /* Diubah jadi ungu agar match */
}

.ketua-card .bpmj-name{
    font-size:1.1rem;
}

.ketua-card .bpmj-position{
    color:#6f42c1;
    font-weight:700;
    text-transform:uppercase;
}

#fotoModal .modal-dialog{
    max-width: 700px;
}

#fotoModal .modal-content{
    background: transparent;
}

 #popupImage{
    width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 20px;
}

/* ========================================================
   RESPONSIVE MEDIA QUERIES (OPTIMIZED)
   ======================================================== */
@media (max-width: 1199.98px) {
    .card-header-digital { font-size: 0.85rem; padding: 12px; }
    .chart-container { height: 180px; }
}

@media (max-width: 767.98px) {
    .hero-stat { 
        padding: 60px 0 110px 0; 
    }
    
    .container-stats { 
        margin-top: -70px; 
    }
    
    .chart-container { 
        height: 200px; 
    }
    
    .table-responsive { 
        border-radius: 12px; 
    }

    /* FIX: Membuat navigasi menu tab bisa di-swipe geser kiri-kanan secara mulus di HP */
    .nav-pills-custom {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px; /* Menyesuaikan agar lebih boxy & clean di layar sentuh */
        max-width: 100%;
        padding: 4px;
    }
    
    /* Sembunyikan scrollbar bawaan browser yang merusak estetika */
    .nav-pills-custom::-webkit-scrollbar {
        display: none;
    }

    .nav-pills-custom .nav-link {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    /* Spasi baris kartu jemaat saat ditumpuk vertikal */
    .row.g-4 > [class*='col-'] {
        margin-bottom: 0.5rem;
    }
}