:root {
    --brand: #0f3d5e;
    --brand-2: #155e75;
    --brand-ink: #0b2a42;
    --gold: #c9a227;
    --bg: #f3f5f8;
    --line: #e3e8ef;
    --c1: #155e75;
    --c2: #c9a227;
    --c3: #b4413a;
    --sidebar-w: 268px;
    --bs-primary: #155e75;
    --bs-primary-rgb: 21, 94, 117;
    --bs-link-color: #155e75;
    --bs-link-color-rgb: 21, 94, 117;
    --bs-link-hover-color: #0f3d5e;
}
body { background: var(--bg); color: #1d2733; font-size: .95rem; }
a { text-decoration: none; }

/* Buttons */
.btn-brand { --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-2); --bs-btn-hover-border-color: var(--brand-2); --bs-btn-active-bg: var(--brand-ink); --bs-btn-active-color: #fff; }
.btn-primary { --bs-btn-bg: var(--brand-2); --bs-btn-border-color: var(--brand-2); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand-2); --bs-btn-border-color: var(--brand-2); --bs-btn-hover-bg: var(--brand-2); --bs-btn-hover-border-color: var(--brand-2); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }
.nav-pills .nav-link { color: var(--brand-ink); }
.form-control:focus, .form-select:focus { border-color: #6aa5b8; box-shadow: 0 0 0 .2rem rgba(21, 94, 117, .15); }
.form-check-input:checked { background-color: var(--brand-2); border-color: var(--brand-2); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--brand-ink) !important; color: #cfe0ea; display: flex; flex-direction: column; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; flex: 0 0 var(--sidebar-w); } }
@media (max-width: 991.98px) { .sidebar.offcanvas-lg { --bs-offcanvas-width: var(--sidebar-w); background: var(--brand-ink); } }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-title { color: #fff; font-weight: 700; line-height: 1.1; }
.brand-sub { font-size: .75rem; opacity: .7; }
.sidebar-nav { padding: .75rem .6rem; overflow-y: auto; flex: 1; }
.sidebar-nav .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; opacity: .5; padding: .9rem .7rem .35rem; }
.sidebar-nav a { display: flex; align-items: center; gap: .7rem; color: #cfe0ea; padding: .55rem .7rem; border-radius: .5rem; font-size: .9rem; }
.sidebar-nav a i { font-size: 1.05rem; opacity: .85; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav a.active { background: rgba(201, 162, 39, .16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.5rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-title { font-weight: 700; color: var(--brand-ink); font-size: 1.05rem; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; }
.content { padding: 1.5rem; flex: 1; }
.footer { padding: 1rem 1.5rem; font-size: .8rem; color: #7a8796; }
@media (max-width: 575.98px) { .content { padding: 1rem; } .topbar { padding: .6rem 1rem; } }

.card { border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1rem; }
.table > thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6b7785; font-weight: 600; background: #f8fafc; white-space: nowrap; }

/* Pegawai dashboard */
.hero-card { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding: 1.5rem 1.75rem; border-radius: 1rem; color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, rgba(201, 162, 39, .35) 0%, transparent 45%), linear-gradient(120deg, var(--brand-ink), var(--brand-2)); }
.hero-progress { text-align: right; background: rgba(255, 255, 255, .08); padding: .75rem 1.1rem; border-radius: .75rem; }
.form-card { transition: transform .15s ease, box-shadow .15s ease; }
.form-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 61, 94, .09); }
.form-icon { display: inline-grid; place-items: center; flex: 0 0 44px; height: 44px; border-radius: .75rem; background: rgba(21, 94, 117, .1); color: var(--brand-2); font-size: 1.35rem; }

/* Paper form (meniru formulir cetak) */
.paper { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: 2rem 2.25rem; max-width: 900px; box-shadow: 0 1px 3px rgba(16, 24, 40, .05); }
@media (max-width: 575.98px) { .paper { padding: 1.25rem 1rem; } }
.paper-title { font-size: 1.45rem; font-weight: 800; text-align: center; color: #1d2733; margin-bottom: 1.5rem; letter-spacing: .01em; }
.ident { display: grid; grid-template-columns: 220px 1fr; gap: .6rem 1rem; align-items: center; }
.ident > label { margin: 0; color: #2b3540; }
@media (max-width: 767.98px) { .ident { grid-template-columns: 1fr; gap: .2rem; } .ident > label { margin-top: .5rem; font-weight: 600; font-size: .85rem; } }
.statement { border: 1px solid var(--line); border-radius: .6rem; padding: 1.1rem 1.25rem; font-size: .9rem; }
.statement ol { padding-left: 1.25rem; }
.statement ol li { margin-bottom: .25rem; }
.statement ol.uraian li::marker { font-weight: 600; }
.sigpad { position: relative; border: 2px dashed #c3ccd6; border-radius: .5rem; height: 180px; background: #fff; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.sigpad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #a4afbb; font-size: .85rem; pointer-events: none; }
.sigpad.has-sign .sigpad-hint { display: none; }
.sigpad.is-invalid { border-color: #dc3545; }
.doc-preview { padding: 2.25rem 2.5rem; }
.doc-preview .doc .meta { font-size: .72rem; }

/* Stats */
.stat { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: 1rem 1.1rem; height: 100%; }
.stat-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7785; font-weight: 600; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--brand-ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; color: #7a8796; }
.progress { height: 6px; }
.progress-bar { background: var(--brand-2); }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 2rem; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.bar-track { height: 8px; background: #edf1f5; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--c3); border-radius: 4px; }
.bar-fill.alt { background: var(--c1); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .35rem; }
.dot-ok { background: var(--c1); }
.dot-warn { background: var(--c2); }

/* Pager CodeIgniter */
.pagination { display: flex; gap: .25rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.pagination li a, .pagination li span { display: block; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: .4rem; color: var(--brand-ink); font-size: .85rem; }
.pagination li.active a { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Login */
.login-page { background: var(--brand-ink); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { color: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: flex-end; position: relative;
    background: linear-gradient(180deg, rgba(8, 24, 38, .25) 0%, rgba(8, 24, 38, .55) 45%, rgba(8, 24, 38, .92) 100%),
                url("../img/kantor-bupati-landak.webp") center 35% / cover no-repeat, var(--brand-ink); }
.login-hero h1, .login-hero p, .login-hero .login-list { text-shadow: 0 1px 12px rgba(0, 0, 0, .45); }
.login-hero .brand-logo { filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .4)); }
.login-list li { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .7rem; }
.login-list i { color: var(--gold); font-size: 1.15rem; }
.login-card { background: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: center; max-width: 560px; width: 100%; justify-self: center; }
.login-page .login-wrap { background: #fff; }
.divider { display: flex; align-items: center; gap: .75rem; color: #8a96a3; font-size: .8rem; margin: .5rem 0 1.25rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 991.98px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { padding: 2rem 1.5rem; } .login-hero h1 { font-size: 1.6rem; } .login-card { padding: 2rem 1.5rem; } }

@media print {
    .sidebar, .topbar, .footer, form.card, .btn, .nav-pills { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
}
.statement ol.uraian .form-label { display: block; }
@media (max-width: 991.98px) {
    .login-hero { min-height: 260px; background-position: center 30%, center 30%; }
    .login-hero .hero-extra { display: none; }
    .login-hero p { margin-bottom: 0 !important; }
}

/* Daftar Kepentingan Pribadi */
.kp-section { border: 1px solid var(--line); border-radius: .6rem; padding: 1rem 1.1rem; margin-top: 1rem; }
.kp-title { font-size: 1rem; font-weight: 700; margin: 0 0 .25rem; color: var(--brand-ink); }
.kp-title span { display: inline-block; min-width: 1.4rem; }
.kp-hint { font-size: .85rem; font-style: italic; color: #5d6a78; margin-bottom: .75rem; }
.kp-head, .kp-row { display: grid; grid-template-columns: 2rem repeat(var(--kp-cols), minmax(0, 1fr)) 2.25rem; gap: .4rem; align-items: start; }
.kp-head { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #6b7785; padding-bottom: .3rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.kp-row { margin-bottom: .4rem; }
.kp-row textarea { resize: vertical; min-height: calc(1.5em + .5rem + 2px); }
.kp-no { font-size: .85rem; color: #6b7785; padding-top: .3rem; text-align: center; }
.kp-question { padding: .75rem 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.kp-question:first-of-type { border-top: 0; }
@media (max-width: 767.98px) {
    .kp-head { display: none; }
    .kp-row { grid-template-columns: 1fr 2.25rem; padding: .6rem; border: 1px solid var(--line); border-radius: .5rem; }
    .kp-row .kp-no { grid-column: 1 / -1; text-align: left; padding: 0; font-weight: 600; }
    .kp-row .kp-no::before { content: "Baris "; }
    .kp-row > input, .kp-row > textarea { grid-column: 1 / 2; }
    .kp-row .kp-del { grid-column: 2; grid-row: 2; }
}
.doc-preview { overflow-x: auto; }
@media (max-width: 575.98px) { .doc-preview { padding: 1.25rem 1rem; } .doc-preview .doc table.kp { font-size: 9.5pt; } }
