/*
 * Tema Prioritas — mengikuti design kit e-SAKIP Pringsewu agar pengguna OPD
 * merasa masih berada di aplikasi yang sama. Warna, tipografi, bentuk sidebar,
 * dan kartu konten disalin dari sana; yang ditambahkan hanya komponen khas
 * situs ini (lencana program unggulan, papan breakdown, pratinjau impor).
 */

/* Inter dilayani dari server sendiri supaya situs tetap utuh saat jaringan
   ke Google Fonts diblokir dari jaringan pemda. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../vendor/fonts/inter-latin.woff2') format('woff2');
}

:root {
    --brand: #00743e;
    --brand-2: #0a8f50;
    --lime: #6eab11;
    --ink: #24302a;
    --muted: #6b7a70;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.bg-success { background-color: var(--brand) !important; }
.text-success { color: var(--brand) !important; }
.btn-success { background-color: var(--brand) !important; border-color: var(--brand) !important; }
.btn-success:hover { background-color: #005a30 !important; border-color: #004a26 !important; }
.border-success-subtle { border-color: rgba(0, 116, 62, .3) !important; }
.badge.bg-success { background-color: var(--brand) !important; }
.bg-lime { background-color: var(--lime) !important; }
.text-lime { color: var(--lime) !important; }
.btn-lime { background-color: var(--lime) !important; border-color: var(--lime) !important; color: #fff !important; }
.btn-lime:hover { background-color: #5a8d0e !important; border-color: #4d760c !important; color: #fff !important; }

.content-wrapper { transition: margin-left .3s ease; }

/* ---- Header ---- */
header.bg-success {
    background: linear-gradient(120deg, #00803f 0%, #00642f 100%) !important;
    position: sticky;
    top: 0;
    z-index: 1030;
}
header.bg-success::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lime), #9bd34a, var(--lime));
}

.sidebar-burger {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: inline-flex !important;
    align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .14) !important;
    border: 1px solid rgba(255, 255, 255, .28) !important;
    color: #fff !important;
    padding: 0 !important;
    transition: background .15s ease, transform .12s ease;
}
.sidebar-burger:hover { background: rgba(255, 255, 255, .26) !important; }
.sidebar-burger:focus { outline: none; box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .28) !important; }
.sidebar-burger:active { transform: scale(.94); }

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px; height: 100vh;
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 1040;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, .10) !important;
    border-right: 1px solid #eef1ee;
}
.sidebar.sidebar-show { transform: translateX(0); }
.sidebar nav { overflow-y: auto; }
.sidebar nav::-webkit-scrollbar { width: 6px; }
.sidebar nav::-webkit-scrollbar-thumb { background: #cdd9d2; border-radius: 6px; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility .3s;
    z-index: 1035;
}
.sidebar-overlay.show { opacity: 1; visibility: visible; }

@media (min-width: 769px) {
    .content-wrapper.sidebar-open { margin-left: 280px; }
    .sidebar-overlay { display: none; }
}

.sidebar-section {
    text-transform: uppercase;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .6px;
    color: #9aa6a0;
    padding: 14px 8px 4px;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 500;
    font-size: .88rem;
    color: #3a4a40 !important;
    white-space: normal;
    overflow-wrap: anywhere;
}
.sidebar-nav-link > span { flex: 1 1 auto; }
.sidebar-nav-link i { width: 18px; text-align: center; font-size: .9rem; opacity: .9; }
.sidebar-nav-link:hover { background: #eef5ea !important; color: var(--brand) !important; }
.sidebar-nav-link.active {
    background: linear-gradient(135deg, var(--brand-2), var(--brand)) !important;
    color: #fff !important;
    box-shadow: 0 6px 14px rgba(0, 116, 62, .22);
}
.sidebar-nav-link.active i { opacity: 1; }
.sidebar-logout-link { white-space: normal; }

#sidebar .d-grid { grid-template-columns: minmax(0, 1fr); }
#sidebar .d-grid > * { min-width: 0; }
#sidebar .dropdown-menu {
    position: static !important;
    transform: none !important;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #eef1ee;
    border-radius: 10px;
    box-shadow: none;
    padding: .35rem;
    margin-top: 2px;
}
#sidebar .dropdown-item {
    border-radius: 7px;
    font-size: .84rem;
    color: #3a4a40;
    padding: .45rem .7rem;
    white-space: normal;
}
#sidebar .dropdown-item:hover { background: #eef5ea; color: var(--brand); }
#sidebar .dropdown-item.active { background: #e9f3ed; color: var(--brand); font-weight: 600; }
#sidebar .dropdown-toggle::after { transition: transform .2s ease; }
#sidebar .dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* ---- Kartu konten ---- */
main .kartu {
    background: #fff;
    border-radius: 16px !important;
    box-shadow: 0 10px 30px rgba(16, 40, 24, .07) !important;
    border: 1px solid #ebefec;
}

main .kartu > h2.judul-halaman,
main .kartu > h3.judul-halaman {
    position: relative;
    font-weight: 800 !important;
    color: #15311f !important;
    padding-bottom: 14px;
    margin-bottom: 24px !important;
    text-align: center;
}
main .kartu > .judul-halaman::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    width: 72px; height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--brand), var(--lime));
}

main .form-control, main .form-select { border-radius: 9px; }
main .form-control:focus, main .form-select:focus {
    border-color: var(--lime);
    box-shadow: 0 0 0 .2rem rgba(110, 171, 17, .18);
}

/* ---- Tabel ---- */
.tabel-bingkai {
    border: 1px solid #e3e8e4;
    border-radius: 14px;
    overflow: auto;
}
.tabel-bingkai > table { margin-bottom: 0; }
.tabel-bingkai thead th {
    background: #f3f7f4;
    border-bottom: 2px solid #cfd4da !important;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #40534a;
    vertical-align: middle;
    white-space: nowrap;
}
.tabel-bingkai td { vertical-align: middle; font-size: .875rem; }
.tabel-bingkai tbody tr:hover { background-color: #f8f9fa; }

/* Kolom uraian panjang tetap terbaca tanpa memaksa tabel melebar. */
.kolom-uraian { min-width: 260px; max-width: 420px; white-space: normal; }
.kolom-sedang { min-width: 160px; white-space: normal; }

/* ---- Lencana program unggulan ---- */
.lencana-unggulan {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    white-space: nowrap;
}

/* ---- Papan statistik ---- */
.statistik {
    border-radius: 14px;
    border: 1px solid #ebefec;
    background: #fff;
    padding: 1rem 1.15rem;
    height: 100%;
}
.statistik .angka { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: #15311f; }
.statistik .label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }

/* ---- Baris breakdown ---- */
.sel-target { width: 92px; text-align: right; }
.sisa-cocok { color: var(--brand); font-weight: 600; }
.sisa-selisih { color: #c92a2a; font-weight: 600; }

/* ---- Tombol kembali ke atas ---- */
.btop-btn {
    position: fixed;
    right: 20px; bottom: 20px;
    width: 46px; height: 46px;
    border: none; border-radius: 50%;
    background: var(--brand); color: #fff;
    font-size: 1.05rem; line-height: 1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    cursor: pointer;
    opacity: 0; visibility: hidden;
    transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, background .2s ease;
    z-index: 1080;
}
.btop-btn.show { opacity: 1; visibility: visible; transform: translateY(0); }
.btop-btn:hover { background: #005c31; }

@media (max-width: 768px) {
    .btop-btn { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* ---- Halaman masuk ---- */
.halaman-masuk {
    min-height: 100vh;
    background: linear-gradient(135deg, #00743e 0%, #024f2c 55%, #0b3b22 100%);
    display: flex;
    align-items: center;
}
.kartu-masuk {
    border-radius: 18px;
    border: none;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
