:root {
    --navy: #0b2b66;
    --navy-2: #12408f;
    --gold: #f2b705;
    --bg: #f3f5fa;
    --line: #e3e8f2;
    --sb-w: 252px;
    --bs-primary: #12408f;
    --bs-primary-rgb: 18, 64, 143;
}
body { background: var(--bg); font-size: .925rem; color: #2b3445; }
a { color: var(--navy-2); }
.btn-primary { --bs-btn-bg: var(--navy-2); --bs-btn-border-color: var(--navy-2); --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-active-bg: var(--navy); }
.btn-outline-primary { --bs-btn-color: var(--navy-2); --bs-btn-border-color: var(--navy-2); --bs-btn-hover-bg: var(--navy-2); --bs-btn-hover-border-color: var(--navy-2); }

/* ---------- layout ---------- */
#wrapper { display: flex; min-height: 100vh; }
#sidebar {
    width: var(--sb-w); flex: 0 0 var(--sb-w);
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #dbe4f7; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; z-index: 1040; transition: transform .2s;
}
.sb-brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.1rem; color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.12); }
.sb-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-size: 1.2rem; }
.sb-brand-text { font-weight: 700; line-height: 1.15; }
.sb-menu { list-style: none; margin: 0; padding: .5rem .6rem 1rem; flex: 1; }
.sb-head { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.5); padding: 1rem .7rem .35rem; font-weight: 600; }
.sb-menu li a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 8px; color: #dbe4f7; text-decoration: none; margin-bottom: 2px; }
.sb-menu li a i { width: 1.2rem; text-align: center; font-size: 1.02rem; }
.sb-menu li a:hover { background: rgba(255,255,255,.1); color: #fff; }
.sb-menu li.active a { background: #fff; color: var(--navy); font-weight: 600; }
.sb-foot { padding: .8rem 1.1rem; font-size: .72rem; color: rgba(255,255,255,.45); border-top: 1px solid rgba(255,255,255,.1); }

#content-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1.25rem; display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 1030; }
.topbar-title { font-weight: 600; color: var(--navy); }
#sb-toggle { display: none; }
.content { padding: 1.4rem 1.4rem 2rem; flex: 1; }
.app-foot { text-align: center; color: #8a94a8; font-size: .78rem; padding: 1rem; }
#sb-backdrop { display: none; }

@media (max-width: 991.98px) {
    #sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
    body.sb-open #sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
    body.sb-open #sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
    #sb-toggle { display: inline-block; }
    .content { padding: 1rem .8rem 2rem; }
}

/* ---------- komponen ---------- */
.card { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 600; border-radius: 12px 12px 0 0 !important; }
.stat { border-left: 4px solid var(--navy-2); }
.stat .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #7b869b; font-weight: 600; }
.stat .value { font-size: 1.45rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat .icon { font-size: 1.9rem; color: #c9d3e8; }
.stat.s-green { border-left-color: #1f9d6b; } .stat.s-gold { border-left-color: var(--gold); }
.stat.s-red { border-left-color: #d64550; }   .stat.s-teal { border-left-color: #14a3b8; }
.stat.s-violet { border-left-color: #7a55d1; }

.progress { height: .8rem; background: #e9eef8; border-radius: 99px; }
.progress.lg { height: 1.5rem; font-weight: 600; }
.progress-bar { background: var(--navy-2); }
.progress-bar.bg-ok { background: #1f9d6b; }

.table > :not(caption) > * > * { padding: .6rem .7rem; vertical-align: middle; }
.table thead th { background: #f6f8fd; color: #51607c; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-actions { white-space: nowrap; width: 1%; }
.kode-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef2fb; color: var(--navy); padding: .12rem .45rem; border-radius: 6px; font-weight: 600; font-size: .84rem; }

.sub-card { border: 1px solid var(--line); border-radius: 10px; padding: .8rem .9rem; background: #fff; height: 100%; }
.sub-card .nm { font-weight: 600; color: var(--navy); }
.sub-card .members { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.sub-card .members span { background: #eef2fb; border-radius: 99px; padding: .1rem .55rem; font-size: .76rem; }
.sub-card.no-sub { background: #fffbeb; border-color: #f4e3a6; }

.foto-slot { border: 2px dashed #c9d3e8; border-radius: 12px; padding: .8rem; text-align: center; background: #fafbfe; }
.foto-slot img { max-width: 100%; max-height: 240px; border-radius: 8px; }
.empty { text-align: center; color: #8a94a8; padding: 2rem 1rem; }
.empty i { font-size: 2rem; display: block; margin-bottom: .4rem; color: #c3cde2; }
.form-label { font-weight: 600; font-size: .84rem; color: #46526a; }
.req::after { content: " *"; color: #d64550; }
.ctx-banner { border-radius: 10px; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 220px; }

/* DataTables */
div.dt-container .dt-search input, div.dataTables_filter input { border-radius: 8px; }
.dt-length select, .dataTables_length select { border-radius: 8px; }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, #1d5bc0 100%); padding: 1rem; }
.login-card { width: 100%; max-width: 410px; background: #fff; border-radius: 16px; padding: 2rem 1.8rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-brand { text-align: center; margin-bottom: 1.4rem; }
.login-logo { width: 58px; height: 58px; border-radius: 16px; margin: 0 auto .8rem; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-size: 1.7rem; }
.login-brand h1 { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin: 0; }
.login-brand p { color: #7b869b; font-size: .8rem; margin: .25rem 0 0; }

@media print {
    #sidebar, .topbar, .app-foot, .no-print, .ctx-banner, .dt-search, .dt-length, .dataTables_filter, .dataTables_length { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
    .card { border: 0; box-shadow: none; }
}

/* ================= Tema dashboard (kartu gradasi) ================= */
@font-face { font-family: 'Nunito'; font-weight: 400; font-style: normal; font-display: swap; src: url('../vendor/fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600; font-style: normal; font-display: swap; src: url('../vendor/fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-style: normal; font-display: swap; src: url('../vendor/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-style: normal; font-display: swap; src: url('../vendor/fonts/nunito-latin-800-normal.woff2') format('woff2'); }
:root { --bs-body-font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --bg: #eef2fb; }
body { font-family: var(--bs-body-font-family); background: var(--bg); }

.dash-hero { background: linear-gradient(90deg, #0a2760 0%, #123f8c 55%, #1b58c4 100%); color: #fff; border-radius: 16px; padding: 1.15rem 1.4rem; margin-bottom: 1.1rem; box-shadow: 0 8px 22px rgba(18,64,140,.25); }
.dash-hero h1 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.dash-hero .sub { opacity: .8; font-size: .85rem; }

.gcard { position: relative; overflow: hidden; display: block; height: 100%; min-height: 158px; border-radius: 16px; padding: 1.2rem 1.3rem; color: #fff; text-decoration: none; box-shadow: 0 8px 20px rgba(16,24,60,.14); transition: transform .15s, box-shadow .15s; }
a.gcard:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(16,24,60,.2); }
.gcard::after { content: ""; position: absolute; right: -38px; top: -38px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.14); }
.gcard .gicon { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1.05rem; margin-bottom: .95rem; }
.gcard .glabel { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.gcard .gvalue { font-size: 2.1rem; font-weight: 800; line-height: 1.15; margin-top: .1rem; }
.gcard .gvalue.sm { font-size: 1.55rem; padding: .22rem 0; }
.gcard .gsub { font-size: .8rem; opacity: .92; }
.gcard .gbar { height: 6px; border-radius: 9px; background: rgba(255,255,255,.28); margin-top: .5rem; overflow: hidden; }
.gcard .gbar > span { display: block; height: 100%; background: #fff; border-radius: 9px; }
.g-blue   { background: linear-gradient(135deg, #2b72e0 0%, #12306f 100%); }
.g-purple { background: linear-gradient(135deg, #8b5cf6 0%, #4b36b5 100%); }
.g-orange { background: linear-gradient(135deg, #f5a623 0%, #c76d08 100%); }
.g-teal   { background: linear-gradient(135deg, #1fc3a0 0%, #0a8a70 100%); }
.g-red    { background: linear-gradient(135deg, #ef5a67 0%, #b3263a 100%); }
.card { box-shadow: 0 4px 14px rgba(16,24,60,.06); border: 0; border-radius: 16px; }
.card-header { border-radius: 16px 16px 0 0 !important; font-weight: 800; }
