:root {
    --primary: #0088cc;      /* Biru Cerah KPID */
    --primary-dark: #005580; /* Biru Gelap untuk efek Hover */
    --secondary: #f39c12;    /* Kuning Emas (Aksen) */
    --soft-bg: #f0f8ff;      /* Biru Sangat Terang */
    --text: #1f2937;
}

* { box-sizing: border-box; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: #fff;
}
a { text-decoration: none; }

.public-navbar .nav-link { font-weight: 600; color: #304050; margin: 0 .12rem; }
.public-navbar .nav-link.active, .public-navbar .nav-link:hover { color: var(--primary); }

.brand-icon {
    width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 12px;
}

.hero-section { background-size: cover; background-position: center; position: relative; }
.min-vh-hero { min-height: 560px; }
.bg-light-blue { background: var(--soft-bg); }
.section-padding { padding: 80px 0; }

.section-badge {
    color: var(--primary);
    background: rgba(0, 136, 204, 0.12);
    display: inline-block; padding: .35rem .85rem; border-radius: 999px; font-weight: 700; margin-bottom: .8rem;
}

.section-title { font-weight: 800; margin-bottom: 1rem; }

.stat-card, .admin-stat {
    background: #fff; border-radius: 22px; padding: 26px 18px; text-align: center;
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.08); height: 100%;
}
.stat-card i, .admin-stat i { color: var(--primary); font-size: 2.1rem; }
.stat-card h3, .admin-stat h3 { font-weight: 800; margin: .7rem 0 .15rem; }
.stat-card p, .admin-stat p { color: #64748b; margin: 0; }

.info-panel {
    background: linear-gradient(135deg, #fff, #e6f7ff);
    border: 1px solid rgba(0, 136, 204, 0.12);
    border-radius: 26px; padding: 32px; box-shadow: 0 15px 40px rgba(0,0,0,.06);
}
.info-item { background: #fff; border: 1px solid #edf2f7; border-radius: 16px; padding: 16px; height: 100%; }
.info-item span, .list-info span, .contact-item span { display: block; color: #64748b; font-size: .88rem; margin-bottom: .2rem; }
.info-item strong, .list-info strong, .contact-item strong { color: var(--text); }

.content-card, .profile-card {
    background: #fff; border: 1px solid #edf2f7; border-radius: 24px; overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .07); transition: .25s ease;
}
.content-card:hover, .profile-card:hover { transform: translateY(-5px); }
.content-card img { width: 100%; height: 220px; object-fit: cover; }
.content-card p { color: #64748b; }
.profile-card img { width: 100%; height: 260px; object-fit: cover; background: var(--soft-bg); }
.read-more { color: var(--primary); font-weight: 700; }

.gallery-mini, .gallery-card { display: block; position: relative; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.gallery-mini img, .gallery-card img { width: 100%; height: 155px; object-fit: cover; transition: .25s ease; }
.gallery-card img { height: 230px; }
.gallery-mini:hover img, .gallery-card:hover img { transform: scale(1.06); }
.gallery-caption { position: absolute; left: 0; right: 0; bottom: 0; color: #fff; padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,.72)); font-weight: 700; }

.page-header { padding: 80px 0; color: #fff; background: linear-gradient(120deg, var(--primary), var(--primary-dark)); }
.page-header h1 { font-weight: 800; margin-bottom: .5rem; }
.page-header p { margin: 0; opacity: .92; }

.list-info { list-style: none; margin: 0; padding: 0; }
.list-info li { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid #edf2f7; }
.list-info li:last-child { border-bottom: 0; }

.detail-img { width: 100%; height: 420px; object-fit: cover; }
.article-content { line-height: 1.9; color: #374151; }

.contact-item { display: flex; gap: 1rem; padding: 16px 0; border-bottom: 1px solid #edf2f7; }
.contact-item i {
    width: 44px; height: 44px; flex: 0 0 44px; display: inline-flex; align-items: center;
    justify-content: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 14px;
}

.map-box { min-height: 420px; border-radius: 24px; overflow: hidden; box-shadow: 0 12px 32px rgba(15, 23, 42, .07); background: #fff; }
.map-box iframe { width: 100%; height: 100%; min-height: 420px; border: 0; }
.empty-state { padding: 36px; border: 1px dashed #b3e0ff; color: #64748b; background: #fff; border-radius: 18px; text-align: center; }

.footer-public { color: #fff; background: #001a33; }
.footer-public a { color: #ddd; opacity: .9; }
.footer-public a:hover { color: #fff; opacity: 1; text-decoration: underline; }

.btn-top { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; border-radius: 50%; display: none; z-index: 999; }

/* --- Tampilan Admin --- */
.admin-body { background: #f8f9fa; }
.admin-topbar { background: linear-gradient(120deg, var(--primary-dark), var(--primary)); }
.admin-topbar .nav-link { color: rgba(255,255,255,.86); font-weight: 600; }
.admin-topbar .nav-link.active, .admin-topbar .nav-link:hover { color: #fff; background: rgba(255,255,255,.12); border-radius: 999px; }
.admin-page-title { font-size: 1.8rem; font-weight: 800; }
.admin-stat { text-align: left; }
.admin-stat i { font-size: 1.8rem; }
.admin-thumb { width: 70px; height: 58px; object-fit: cover; border-radius: 12px; border: 1px solid #e2e8f0; }
.admin-gallery-img { width: 100%; height: 180px; object-fit: cover; }
.preview-image { max-width: 260px; max-height: 190px; object-fit: cover; border-radius: 16px; border: 1px solid #e2e8f0; }

.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, rgba(0, 136, 204, .95), rgba(0, 51, 77, .95)); padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 26px; padding: 32px; box-shadow: 0 22px 70px rgba(0,0,0,.18); }
.login-icon { width: 72px; height: 72px; border-radius: 24px; margin: 0 auto 1rem; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }

/* ========================================================
   OVERRIDE BOOTSTRAP: Menyulap class 'success' menjadi Biru
   ======================================================== */
.text-success { color: var(--primary) !important; }
.bg-success { background-color: var(--primary) !important; }

.btn-success { background-color: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.btn-success:hover, .btn-success:focus, .btn-success:active { background-color: var(--primary-dark) !important; border-color: var(--primary-dark) !important; color: #fff !important; }

.btn-outline-success { color: var(--primary) !important; border-color: var(--primary) !important; }
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active { background-color: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }

.table-success {
    --bs-table-bg: #e6f7ff;
    --bs-table-color: #000;
    --bs-table-border-color: #b3e0ff;
}
.alert-success {
    background-color: #e6f7ff;
    border-color: #b3e0ff;
    color: var(--primary-dark);
}

.badge.bg-light.text-success { color: var(--primary) !important; }

/* Custom CSS untuk judul Navbar */
.brand-title {
    white-space: normal;
    word-wrap: break-word;
}
.fs-7 { font-size: 0.8rem; }

@media (max-width: 991.98px) {
    .navbar-brand { width: calc(100% - 75px); }
    .min-vh-hero { min-height: 440px; }
    .section-padding { padding: 56px 0; }
    .hero-section .display-4 { font-size: 2.4rem; }
    .content-card img { height: 190px; }
}

@media (max-width: 575.98px) {
    .brand-title span.fw-bold { font-size: 1.15rem; }
    .min-vh-hero { min-height: 390px; }
    .section-padding { padding: 44px 0; }
    .page-header { padding: 56px 0; }
    .hero-section .display-4 { font-size: 2rem; }
    .detail-img { height: 260px; }
    .gallery-card img { height: 170px; }
    .profile-card img { height: 230px; }
    .list-info li { display: block; }
}

/* ===============================
   NUANSA EMAS (GOLD) KPID
   =============================== */
.bg-gold { background-color: var(--secondary) !important; color: #fff !important; }
.text-gold { color: var(--secondary) !important; }
.btn-gold { background-color: var(--secondary) !important; border-color: var(--secondary) !important; color: #fff !important; font-weight: bold; }
.btn-gold:hover { background-color: #d68910 !important; border-color: #d68910 !important; color: #fff !important; }

/* ==========================================
   BERITA CAROUSEL
========================================== */

#beritaCarousel {
    width: 100%;
    overflow: hidden;
    border-radius: 20px;
}

#beritaCarousel .carousel-inner {
    width: 100%;
}


/* Tinggi slide dibuat tetap */
#beritaCarousel .carousel-item {
    height: 500px;
}


/* Gambar memenuhi seluruh area */
.berita-carousel-image {
    width: 100%;
    height: 500px;

    object-fit: cover;
    object-position: center;

    display: block;

    background: #f5f5f5;
}


/* ==========================================
   TOMBOL KIRI / KANAN
========================================== */

#beritaCarousel .carousel-control-prev,
#beritaCarousel .carousel-control-next {
    width: 10%;
    z-index: 5;
}

#beritaCarousel .carousel-control-prev-icon,
#beritaCarousel .carousel-control-next-icon {
    width: 44px;
    height: 44px;

    background-color: rgba(0, 0, 0, 0.45);
    background-size: 50% 50%;

    border-radius: 50%;
    padding: 10px;
}


/* ==========================================
   INDICATOR
========================================== */

#beritaCarousel .carousel-indicators {
    margin-bottom: 14px;
}

#beritaCarousel .carousel-indicators button {
    width: 9px;
    height: 9px;

    border-radius: 50%;
    border: 0;

    opacity: 0.6;
    margin: 0 4px;
}

#beritaCarousel .carousel-indicators .active {
    opacity: 1;
}


/* ==========================================
   TABLET
========================================== */

@media (max-width: 991.98px) {

    #beritaCarousel .carousel-item {
        height: 440px;
    }

    .berita-carousel-image {
        height: 440px;
    }

}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 768px) {

    #beritaCarousel {
        border-radius: 18px;
    }

    #beritaCarousel .carousel-item {
        height: 360px;
    }

    .berita-carousel-image {
        width: 100%;
        height: 360px;

        object-fit: cover;
        object-position: center;
    }

    #beritaCarousel .carousel-control-prev,
    #beritaCarousel .carousel-control-next {
        width: 16%;
    }

    #beritaCarousel .carousel-control-prev-icon,
    #beritaCarousel .carousel-control-next-icon {
        width: 34px;
        height: 34px;
    }

    #beritaCarousel .carousel-indicators {
        margin-bottom: 10px;
    }

    #beritaCarousel .carousel-indicators button {
        width: 8px;
        height: 8px;
        margin: 0 3px;
    }

}


/* ==========================================
   HP KECIL
========================================== */

@media (max-width: 480px) {

    #beritaCarousel .carousel-item {
        height: 320px;
    }

    .berita-carousel-image {
        height: 320px;
    }

    #beritaCarousel .carousel-control-prev-icon,
    #beritaCarousel .carousel-control-next-icon {
        width: 30px;
        height: 30px;
    }

}

/* ==========================================
   DROPDOWN PPID
========================================== */

.public-navbar .dropdown-menu {
    border: 0;
    border-radius: 14px;
    padding: 8px;
    min-width: 230px;

    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.12);
}

.public-navbar .dropdown-item {
    color: #304050;
    font-weight: 500;

    padding: 10px 14px;
    border-radius: 10px;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.public-navbar .dropdown-item:hover {
    color: var(--primary);
    background: rgba(0, 136, 204, 0.08);
}

.public-navbar .dropdown-toggle::after {
    margin-left: 0.45rem;
}

/* ==========================================
   PENGUMUMAN
========================================== */

.announcement-card,
.announcement-mini-card {
    transition: transform .25s ease, box-shadow .25s ease;
}

.announcement-card:hover,
.announcement-mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10) !important;
}

.announcement-mini-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .06);
    border-radius: 20px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.announcement-home-section {
    background: #f8fbff;
}

/* ========================================
   DOCUMENT CENTER
======================================== */
.document-card,
.document-mini-card {
    background: #fff;
    border: 1px solid rgba(0, 82, 61, .08);
    border-radius: 1.25rem;
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .05);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.document-card {
    display: flex;
    gap: 1.1rem;
    padding: 1.5rem;
    align-items: flex-start;
}

.document-card:hover,
.document-mini-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .9rem 1.8rem rgba(0, 0, 0, .08);
    border-color: rgba(0, 82, 61, .16);
}

.document-mini-card {
    padding: 1.5rem;
}

.document-icon,
.document-detail-icon {
    width: 58px;
    height: 58px;
    min-width: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: #fff1f0;
    color: #dc3545;
    font-size: 1.7rem;
}

.document-detail-icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
}

.min-w-0 { min-width: 0; }

@media (max-width: 575.98px) {
    .document-card { padding: 1.2rem; }
    .document-icon { width: 48px; height: 48px; min-width: 48px; font-size: 1.35rem; }
}


/* ================================
   PPID PORTAL
================================ */
.ppid-category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1.35rem;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(0,82,61,.08);
    border-radius: 1.25rem;
    box-shadow: 0 .45rem 1.2rem rgba(0,0,0,.05);
    transition: .25s ease;
}
.ppid-category-card:hover,
.ppid-category-card.active {
    transform: translateY(-4px);
    border-color: rgba(0,82,61,.22);
    box-shadow: 0 .9rem 1.8rem rgba(0,0,0,.08);
}
.ppid-category-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(0,82,61,.08);
    color: #00523d;
    font-size: 1.45rem;
}
.ppid-category-card h2 { font-size: 1rem; margin: 0 0 .3rem; font-weight: 700; }
.ppid-category-card p { margin: 0; color: #6c757d; font-size: .84rem; line-height: 1.5; }
.ppid-file-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0,82,61,.08);
    border-radius: 1.25rem;
    box-shadow: 0 .45rem 1.2rem rgba(0,0,0,.05);
    transition: .25s ease;
}
.ppid-file-card:hover { transform: translateY(-4px); box-shadow: 0 .9rem 1.8rem rgba(0,0,0,.08); }
.ppid-file-preview {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #eef7ff, #f8fbff);
}
.ppid-file-preview img { display:block; width:auto; max-width:100%; height:auto; max-height:100%; object-fit:contain; background:#f4f7fa; margin:0 auto; }
.ppid-pdf-preview { text-align: center; color: #dc3545; }
.ppid-pdf-preview i { display: block; font-size: 5rem; line-height: 1; }
.ppid-pdf-preview span { display: inline-block; margin-top: .7rem; font-weight: 800; letter-spacing: .12em; }
@media (max-width: 575.98px) {
    .ppid-file-preview { height: 210px; }
    .ppid-category-card { padding: 1rem; }
}

/* =========================================
   JAM PELAYANAN
   ========================================= */

.jam-pelayanan-section {
    width: 100%;
    overflow: hidden;
    background: #ffffff;
}

.jam-pelayanan-section .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

.jam-pelayanan-wrapper {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow: hidden;
}

.jam-pelayanan-image {
    display: block;

    /* WAJIB */
    width: 100%;
    max-width: 100%;
    height: auto;

    /* Jangan sampai ada ukuran minimum */
    min-width: 0;
    min-height: 0;

    object-fit: contain;

    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 768px) {

    .jam-pelayanan-section {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .jam-pelayanan-section .container {
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .jam-pelayanan-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .jam-pelayanan-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-width: 0;
        object-fit: contain;
        border-radius: 10px;
    }
}


/* HP kecil */
@media (max-width: 480px) {

    .jam-pelayanan-section .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .jam-pelayanan-image {
        width: 100%;
        max-width: 100%;
        border-radius: 8px;
    }
}