:root {
    --okr-primary: #0f766e;
    --okr-primary-dark: #0b4f4a;
    --okr-primary-soft: #e6f4f2;
    --okr-accent: #f59e0b;
    --okr-bg: #f3f6f9;
    --okr-border: #e5e9f0;
    --okr-text: #1e293b;
    --okr-muted: #64748b;
    --rag-hijau: #16a34a;
    --rag-kuning: #eab308;
    --rag-merah: #dc2626;
    --sidebar-w: 268px;
    --bs-primary: #0f766e;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: #0f766e;
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: #0b4f4a;
    --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { background: var(--okr-bg); color: var(--okr-text); font-size: .925rem; }
a { text-decoration: none; }

/* ---------- Bootstrap overrides ---------- */
.btn-primary { --bs-btn-bg: var(--okr-primary); --bs-btn-border-color: var(--okr-primary); --bs-btn-hover-bg: var(--okr-primary-dark); --bs-btn-hover-border-color: var(--okr-primary-dark); --bs-btn-active-bg: var(--okr-primary-dark); --bs-btn-disabled-bg: var(--okr-primary); --bs-btn-disabled-border-color: var(--okr-primary); }
.btn-outline-primary { --bs-btn-color: var(--okr-primary); --bs-btn-border-color: var(--okr-primary); --bs-btn-hover-bg: var(--okr-primary); --bs-btn-hover-border-color: var(--okr-primary); --bs-btn-active-bg: var(--okr-primary); }
.text-bg-primary { background-color: var(--okr-primary) !important; }
.text-primary { color: var(--okr-primary) !important; }
.bg-primary { background-color: var(--okr-primary) !important; }
.bg-primary-soft { background: var(--okr-primary-soft) !important; }
.form-control:focus, .form-select:focus { border-color: #5eb5ac; box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .15); }
.form-check-input:checked { background-color: var(--okr-primary); border-color: var(--okr-primary); }
.nav-pills .nav-link.active { background: var(--okr-primary); }
.page-link { color: var(--okr-primary); }
.active > .page-link { background: var(--okr-primary); border-color: var(--okr-primary); }
.form-label { font-weight: 600; font-size: .82rem; color: #334155; margin-bottom: .3rem; }
.form-text { font-size: .76rem; }
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--okr-muted); font-weight: 700; background: #f8fafc; border-bottom-width: 1px; white-space: nowrap; }
.modal-content { border: 0; border-radius: 1rem; box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .25); }
.modal-header { border-bottom: 1px solid var(--okr-border); }
.modal-footer { border-top: 1px solid var(--okr-border); }
.dropdown-menu { border: 1px solid var(--okr-border); box-shadow: 0 10px 30px rgba(15, 23, 42, .1); border-radius: .75rem; }
.badge-status { font-weight: 600; padding: .4em .75em; }

/* ---------- Layout ---------- */
.okr-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
    background: linear-gradient(180deg, #0b3f3a 0%, #0f5e55 60%, #116b61 100%);
    color: #d5ebe8; display: flex; flex-direction: column; transition: transform .25s ease;
}
.okr-sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; color: #fff; }
.okr-sidebar .brand-logo { width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-size: 1.35rem; color: #fde68a; }
.okr-sidebar .brand-title { font-weight: 800; letter-spacing: .08em; line-height: 1.1; }
.okr-sidebar .brand-sub { font-size: .68rem; opacity: .75; line-height: 1.25; max-width: 168px; }
.okr-sidebar .menu { overflow-y: auto; flex: 1; padding: .25rem .75rem 1rem; }
.okr-sidebar .menu-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; opacity: .55; padding: 1rem .75rem .4rem; font-weight: 700; }
.okr-sidebar .menu a { display: flex; align-items: center; gap: .7rem; padding: .58rem .8rem; border-radius: .6rem; color: #d5ebe8; font-weight: 500; margin-bottom: 2px; transition: all .15s; }
.okr-sidebar .menu a i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.okr-sidebar .menu a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.okr-sidebar .menu a.active { background: #fff; color: var(--okr-primary-dark); font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.okr-sidebar .menu a.active i { opacity: 1; color: var(--okr-primary); }
.okr-sidebar .menu .count { margin-left: auto; background: var(--okr-accent); color: #111; font-size: .68rem; font-weight: 700; border-radius: 99px; padding: .1rem .45rem; }
.okr-sidebar .sidebar-foot { padding: .9rem 1.25rem; font-size: .72rem; opacity: .6; border-top: 1px solid rgba(255, 255, 255, .08); }

.okr-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.impersonasi-bar {
    position: sticky; top: 0; z-index: 1045;
    background: #f59e0b; color: #111; padding: .5rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    font-size: .85rem; font-weight: 600;
}
.okr-topbar {
    position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--okr-border); padding: .6rem 1.5rem; display: flex; align-items: center; gap: 1rem;
}
.okr-topbar .page-title { font-weight: 700; font-size: 1.05rem; margin: 0; }
.okr-topbar .crumb { font-size: .75rem; color: var(--okr-muted); }
.okr-content { padding: 1.5rem; flex: 1; }
.okr-footer { padding: 1rem 1.5rem; font-size: .75rem; color: var(--okr-muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #0f766e, #14b8a6); font-size: .85rem; flex-shrink: 0; }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; position: relative; }
.btn-icon .dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; border-radius: 99px; background: var(--rag-merah); color: #fff; font-size: .62rem; display: grid; place-items: center; font-weight: 700; padding: 0 4px; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .okr-sidebar { transform: translateX(-100%); }
    body.sidebar-open .okr-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
    .okr-main { margin-left: 0; }
    .okr-content { padding: 1rem; }
}

/* ---------- Cards ---------- */
.card { border: 1px solid var(--okr-border); border-radius: 1rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-header { background: transparent; border-bottom: 1px solid var(--okr-border); padding: .9rem 1.15rem; font-weight: 700; }
.card-body { padding: 1.15rem; }
.card-title-sm { font-size: .95rem; font-weight: 700; margin: 0; }
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { font-size: .78rem; color: var(--okr-muted); font-weight: 600; }
.stat-card .stat-foot { font-size: .75rem; color: var(--okr-muted); }
.soft-primary { background: #e6f4f2; color: #0f766e; }
.soft-success { background: #dcfce7; color: #15803d; }
.soft-warning { background: #fef9c3; color: #a16207; }
.soft-danger { background: #fee2e2; color: #b91c1c; }
.soft-info { background: #e0f2fe; color: #0369a1; }
.soft-purple { background: #ede9fe; color: #6d28d9; }
.soft-secondary { background: #f1f5f9; color: #475569; }

.hero {
    background: radial-gradient(circle at 85% 20%, rgba(253, 230, 138, .35), transparent 40%), linear-gradient(120deg, #0b4f4a 0%, #0f766e 55%, #14b8a6 100%);
    color: #fff; border-radius: 1.1rem; padding: 1.4rem 1.6rem; position: relative; overflow: hidden;
}
.hero::after { content: "\F5E5"; font-family: bootstrap-icons; position: absolute; right: 1.5rem; bottom: -1.6rem; font-size: 8rem; opacity: .08; }
.hero .hero-sub { opacity: .85; font-size: .88rem; }
.hero .time-track { height: 8px; background: rgba(255, 255, 255, .25); border-radius: 99px; overflow: hidden; }
.hero .time-track span { display: block; height: 100%; background: #fde68a; border-radius: 99px; }

/* ---------- Progress & RAG ---------- */
.progress { background: #edf1f5; border-radius: 99px; }
.progress-thin { height: 6px; }
.progress-md { height: 10px; }
.bg-rag-hijau { background-color: var(--rag-hijau) !important; }
.bg-rag-kuning { background-color: var(--rag-kuning) !important; }
.bg-rag-merah { background-color: var(--rag-merah) !important; }
.text-rag-hijau { color: var(--rag-hijau) !important; }
.text-rag-kuning { color: #ca8a04 !important; }
.text-rag-merah { color: var(--rag-merah) !important; }
.rag-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.rag-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; padding: .22rem .6rem; border-radius: 99px; }
.rag-pill.hijau { background: #dcfce7; color: #15803d; }
.rag-pill.kuning { background: #fef9c3; color: #a16207; }
.rag-pill.merah { background: #fee2e2; color: #b91c1c; }

.ring { --p: 0; --c: var(--okr-primary); --size: 64px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), #e8edf2 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 7px; background: #fff; border-radius: 50%; }
.ring span { position: relative; font-weight: 800; font-size: calc(var(--size) / 4.4); }
.ring.ring-lg { --size: 96px; }
.ring.ring-sm { --size: 46px; }
.ring.ring-sm::before { inset: 5px; }

/* KR chip (dashboard RAG) */
.kr-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 30px; padding: 0 .5rem; border-radius: 8px; font-size: .72rem; font-weight: 700; color: #fff; cursor: default; transition: transform .12s; }
.kr-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, .15); }
.kr-chip.hijau { background: var(--rag-hijau); }
.kr-chip.kuning { background: var(--rag-kuning); color: #422006; }
.kr-chip.merah { background: var(--rag-merah); }
.kr-chip.mini { min-width: 18px; width: 18px; height: 18px; padding: 0; border-radius: 4px; font-size: 0; }
.unit-card { transition: box-shadow .15s, transform .15s; height: 100%; }
.unit-card:hover { box-shadow: 0 10px 25px rgba(15, 23, 42, .08); transform: translateY(-2px); }
.unit-card .unit-border { position: absolute; inset: 0 auto 0 0; width: 5px; border-radius: 1rem 0 0 1rem; }
.obj-line { font-size: .8rem; color: #334155; }
.legend-item { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--okr-muted); }

/* ---------- OKR builder ---------- */
.obj-card { border-left: 4px solid var(--okr-primary); }
.obj-head { display: flex; gap: .9rem; align-items: flex-start; }
.obj-code { background: var(--okr-primary); color: #fff; font-weight: 800; border-radius: 10px; min-width: 46px; height: 46px; display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; }
.kr-item { border: 1px solid var(--okr-border); border-radius: .85rem; background: #fff; margin-top: .75rem; }
.kr-item .kr-head { padding: .8rem 1rem; display: flex; gap: .8rem; align-items: flex-start; }
.kr-code { background: #f1f5f9; color: #334155; font-weight: 700; border-radius: 8px; padding: .2rem .5rem; font-size: .72rem; white-space: nowrap; }
.kr-body { border-top: 1px dashed var(--okr-border); padding: .8rem 1rem; background: #fbfcfd; border-radius: 0 0 .85rem .85rem; }
.meta { font-size: .76rem; color: var(--okr-muted); display: inline-flex; align-items: center; gap: .3rem; }
.meta + .meta { margin-left: .9rem; }
.ini-item { background: #fff; border: 1px solid var(--okr-border); border-radius: .65rem; padding: .6rem .8rem; }
.ini-item + .ini-item { margin-top: .5rem; }
.syarat-item { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .7rem; border-radius: .6rem; background: #fff; border: 1px solid var(--okr-border); }
.syarat-item + .syarat-item { margin-top: .45rem; }
.section-label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--okr-muted); margin-bottom: .45rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--okr-muted); }
.empty-state i { font-size: 2.6rem; opacity: .4; display: block; margin-bottom: .5rem; }
.stepper { display: flex; gap: .25rem; }
.stepper .step { flex: 1; text-align: center; position: relative; font-size: .75rem; color: var(--okr-muted); font-weight: 600; }
.stepper .step .bubble { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .35rem; background: #e2e8f0; color: #64748b; position: relative; z-index: 1; font-size: 1rem; }
.stepper .step::before { content: ""; position: absolute; top: 17px; left: -50%; right: 50%; height: 3px; background: #e2e8f0; }
.stepper .step:first-child::before { display: none; }
.stepper .step.done .bubble { background: var(--okr-primary); color: #fff; }
.stepper .step.done::before, .stepper .step.current::before { background: var(--okr-primary); }
.stepper .step.current .bubble { background: #fff; color: var(--okr-primary); box-shadow: 0 0 0 3px var(--okr-primary); }
.stepper .step.current { color: var(--okr-primary); }
.stepper .step.bad .bubble { background: var(--rag-merah); color: #fff; }
.stepper .step.warn .bubble { background: var(--rag-kuning); color: #422006; }

.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ""; position: absolute; left: .55rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--okr-border); }
.timeline .tl-item { position: relative; padding-bottom: 1rem; }
.timeline .tl-item::before { content: ""; position: absolute; left: -1.33rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--tl, var(--okr-primary)); }
.timeline .tl-time { font-size: .72rem; color: var(--okr-muted); }

.comment { display: flex; gap: .75rem; }
.comment + .comment { margin-top: 1rem; }
.comment .bubble-c { background: #f8fafc; border: 1px solid var(--okr-border); border-radius: 0 .8rem .8rem .8rem; padding: .6rem .85rem; flex: 1; }
.comment.done .bubble-c { opacity: .6; }

.sticky-side { position: sticky; top: 80px; }
.table-hover tbody tr { cursor: default; }
.clickable-row { cursor: pointer !important; }
.text-xs { font-size: .74rem; }
.text-sm { font-size: .84rem; }
.fw-800 { font-weight: 800; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dropzone { border: 2px dashed #cbd5e1; border-radius: .8rem; padding: 1.1rem; text-align: center; color: var(--okr-muted); cursor: pointer; transition: all .15s; background: #f8fafc; }
.dropzone:hover, .dropzone.drag { border-color: var(--okr-primary); background: var(--okr-primary-soft); color: var(--okr-primary); }
.anggaran-table input { min-width: 80px; }
.tree ul { list-style: none; padding-left: 1.4rem; margin: 0; position: relative; }
.tree ul::before { content: ""; position: absolute; left: .5rem; top: 0; bottom: .8rem; border-left: 2px solid var(--okr-border); }
.tree li { position: relative; padding: .3rem 0 .3rem .6rem; }
.tree li::before { content: ""; position: absolute; left: -.9rem; top: 1.15rem; width: 1.1rem; border-top: 2px solid var(--okr-border); }
.tree-node { display: inline-flex; flex-direction: column; background: #fff; border: 1px solid var(--okr-border); border-radius: .7rem; padding: .5rem .8rem; max-width: 100%; }
.tree-node.pilar { color: #fff; border: 0; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: radial-gradient(circle at 20% 20%, rgba(253, 230, 138, .3), transparent 35%), linear-gradient(135deg, #0b3f3a 0%, #0f766e 60%, #14b8a6 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .bubble-bg { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.auth-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
.auth-feature { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.auth-feature i { font-size: 1.3rem; background: rgba(255, 255, 255, .14); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: #fde68a; }
.captcha-box { background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 6px, #e2e8f0 6px, #e2e8f0 12px); font-weight: 800; letter-spacing: .15em; font-size: 1.1rem; border-radius: .5rem; padding: .45rem .9rem; user-select: none; font-family: ui-monospace, monospace; color: #0b4f4a; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- Print ---------- */
@media print {
    .okr-sidebar, .okr-topbar, .no-print, .okr-footer { display: none !important; }
    .okr-main { margin: 0; }
    body { background: #fff; }
    .card { box-shadow: none; }
}
