:root {
    --navy: #0a1f44;
    --navy-light: #142c5e;
    --gold: #d4af37;
    --gold-light: #f0d878;
    --bg: #f7f7f5;
}

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: #1a1a1a;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ═══ HEADER ═══ */
.app-header {
    height: 2.5cm;
    min-height: 2.5cm;
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    border-bottom: 3px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem;
    flex-shrink: 0;
}

.app-header .brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
}
.app-header .brand i { color: var(--gold); font-size: 1.6rem; }

.app-header .entity-name {
    color: var(--gold-light);
    font-weight: 600;
    text-align: center;
    flex: 1;
    padding: 0 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-login-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(212, 175, 55, .15);
    border: 1.5px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 18px;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}
.btn-login-icon:hover { background: var(--gold); color: var(--navy); }

.user-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #fff;
    cursor: pointer;
}
.user-chip .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--gold); color: var(--navy);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; overflow: hidden;
}
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ═══ BODY ═══ */
main.app-body { flex: 1; }

.hero {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
    padding: 3.5rem 1.5rem;
    text-align: center;
    border-bottom: 4px solid var(--gold);
}
.hero h1 {
    font-weight: 800;
    color: var(--gold-light);
    margin-bottom: .75rem;
}
.hero p { color: #dfe4ee; max-width: 700px; margin: 0 auto; }

.feature-card {
    border: none;
    border-radius: 14px;
    border-top: 3px solid var(--gold);
}
.feature-icon { font-size: 30px; color: var(--navy); }

.hero-carousel {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-bottom: 3rem;
    overflow: hidden;
}
.hero-slide {
    height: 7cm;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}
.hero-slide-placeholder {
    height: 7cm;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: var(--gold-light);
    font-size: 28px;
}
.hero-slide-caption {
    width: 100%;
    padding: 1.5rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
    color: #fff;
}
.hero-slide-judul { font-weight: 700; font-size: 1.25rem; color: var(--gold-light); }
.hero-slide-subjudul { font-size: .9rem; color: #eef1f7; max-width: 640px; }

.section-placeholder {
    border: 2px dashed #c9c2a8;
    border-radius: 14px;
    color: #8a8370;
    text-align: center;
    padding: 2.5rem 1rem;
}

/* Modal login accent */
.modal-header.header-gold {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: var(--gold-light);
    border-bottom: 2px solid var(--gold);
}
.btn-navy {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.btn-navy:hover { background: var(--navy-light); color: var(--gold-light); }
.btn-outline-navy {
    background: transparent;
    border-color: var(--navy);
    color: var(--navy);
}
.btn-outline-navy:hover { background: var(--navy); color: #fff; }

/* ═══ DASHBOARD LAYOUT ═══ */
.layout { flex: 1; display: flex; min-height: 0; }

.sidebar {
    width: 240px;
    background: #fff;
    border-right: 3px solid var(--gold);
    flex-shrink: 0;
    overflow-y: auto;
}
.sidebar .nav-link.menu-parent {
    color: var(--navy);
    font-weight: 700;
    border-radius: 0;
    padding: .7rem 1.1rem;
    display: flex;
    align-items: center;
    font-size: .92rem;
    cursor: pointer;
}
.sidebar .nav-link.menu-parent:hover { background: #f0ead8; }
.sidebar .nav-link.menu-parent i:first-child { width: 22px; color: var(--gold); }

/* Induk tingkat 2 ke bawah (mis. "Import Data" di dalam Utilitas) */
.sidebar .nav-link.menu-subparent {
    font-size: .85rem;
    font-weight: 600;
    color: #3f4a5f;
    padding-top: .5rem;
    padding-bottom: .5rem;
    background: #fbfaf6;
}
.sidebar .nav-link.menu-subparent:hover { color: var(--navy); }
.sidebar .menu-parent .caret {
    margin-left: auto;
    font-size: 11px;
    transition: transform .2s;
    color: #9aa3b2;
}
.sidebar .menu-parent:not(.collapsed) .caret { transform: rotate(180deg); }

.sidebar .submenu { background: #fbfaf6; }
.sidebar .submenu-link {
    color: #3f4a5f;
    font-size: .85rem;
    /* padding-left diatur per tingkat lewat inline style di dashboard.js */
    padding: .45rem 1.1rem;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.sidebar .submenu-link:hover { background: #f0ead8; color: var(--navy); }
.sidebar .submenu-link.active {
    border-left-color: var(--gold);
    background: #f5efdc;
    color: var(--navy);
    font-weight: 700;
}
/* Menu tingkat atas tanpa anak (Dashboard): gaya induk, aktif = garis emas */
.sidebar .submenu-link.menu-top {
    color: var(--navy);
    font-weight: 700;
    font-size: .92rem;
    padding-top: .7rem;
    padding-bottom: .7rem;
    display: flex;
    align-items: center;
}
.sidebar .submenu-link.menu-top i:first-child { width: 22px; color: var(--gold); }
.sidebar .submenu-link.disabled-link { color: #a6adb9; cursor: not-allowed; }
.sidebar .submenu-link.disabled-link:hover { background: transparent; color: #a6adb9; }

.content-area { flex: 1; overflow-y: auto; padding: 1.5rem; }

/* ═══ KOMPONEN MODUL ═══ */
.module-card { border: none; border-radius: 12px; border-top: 3px solid var(--gold); }

tr.active-row > td { background-color: #f5efdc !important; }
#umTbody tr { cursor: pointer; }

.um-avatar, .um-avatar-txt {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    object-fit: cover;
}
.um-avatar-txt { background: var(--navy); color: var(--gold); font-weight: 700; font-size: 13px; }

.um-photo-preview {
    width: 52px; height: 52px; border-radius: 50%;
    background: var(--navy); color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.um-photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }

tr.ij-error > td { background-color: #fdeaea !important; }

/* ═══ OVERLAY PEMBLOKIR SAAT PROSES BERJALAN ═══ */
#akukuBusy {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(10, 31, 68, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: wait;
}
#akukuBusy .busy-box {
    background: #fff;
    border-top: 4px solid var(--gold);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    min-width: 340px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    text-align: center;
}
#akukuBusy .busy-title { color: var(--navy); font-weight: 700; }
#akukuBusy .busy-sub { color: #6c757d; font-size: 12px; }
#akukuBusy .progress { height: 14px; background: #eceef2; }
#akukuBusy .progress-bar { background: var(--navy); }
body.akuku-busy, body.akuku-busy * { cursor: wait !important; }

.nav-tabs-sm .nav-link {
    font-size: .82rem;
    padding: .35rem .7rem;
    color: #3f4a5f;
    border: none;
    border-bottom: 2px solid transparent;
}
.nav-tabs-sm .nav-link:hover { color: var(--navy); }
.nav-tabs-sm .nav-link.active {
    color: var(--navy);
    font-weight: 700;
    background: transparent;
    border-bottom-color: var(--gold);
}

/* ═══ MODUL DASHBOARD ═══ */
.db-banner {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    border-bottom: 3px solid var(--gold);
    border-radius: 12px;
    padding: .9rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.db-banner-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--gold); color: var(--navy);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.db-banner-title { color: #fff; font-weight: 700; font-size: 1.15rem; }
.db-banner-sub { color: var(--gold-light); font-size: .8rem; }
.db-mock-badge { background: rgba(212, 175, 55, .2); color: var(--gold-light); border: 1px solid var(--gold); font-weight: 600; }
.db-filter { width: auto; min-width: 230px; max-width: 100%; }

.db-kpi {
    border-radius: 12px;
    color: #fff;
    padding: .9rem 1.1rem;
    height: 100%;
    box-shadow: 0 2px 6px rgba(10, 31, 68, .15);
}
.db-kpi-1 { background: linear-gradient(135deg, #0a1f44, #1f4e8c); }
.db-kpi-2 { background: linear-gradient(135deg, #1f6fb2, #3a8fd6); }
.db-kpi-3 { background: linear-gradient(135deg, #1f9e89, #34c3a5); }
.db-kpi-4 { background: linear-gradient(135deg, #8a5a00, #d4af37); }
.db-kpi-label { font-size: .82rem; opacity: .9; }
.db-kpi-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.db-kpi-note { font-size: .72rem; font-style: italic; opacity: .8; text-align: right; }

.db-card-title { color: var(--navy); font-weight: 700; font-size: .92rem; margin-bottom: .5rem; }
.db-card-title span { color: #8a93a3; font-weight: 400; font-style: italic; font-size: .78rem; margin-left: .4rem; }
.db-chart { position: relative; }

/* ═══ FOOTER ═══ */
.app-footer {
    height: 1cm;
    min-height: 1cm;
    background: var(--navy);
    color: #cfd8e3;
    border-top: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    font-size: 12px;
    flex-shrink: 0;
}
.app-footer .footer-right { color: var(--gold-light); font-variant-numeric: tabular-nums; }
