:root {
  --ink: #0F2A43; --ink2: #4A5D70; --ink3: #7A8A9A; --line: #E1E7EE; --bg: #F3F5F8;
  --green: #1E9E5A; --side: #0E3B2A; --side-act: #1B5E43; --danger: #B3261E;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ms { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal;
  text-transform: none; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; vertical-align: middle; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.side { width: 262px; flex: none; background: var(--side); color: #DCEBE2; padding: 1.4rem 1rem 1.2rem; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: .2rem .4rem 1.2rem; border-bottom: 1px solid #245A44; margin-bottom: 1rem; }
.side .brand img { height: 4.2rem; width: auto; max-width: 100%; display: block; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: .65rem; color: #DCEBE2; padding: .55rem .75rem; border-radius: 9px; font-weight: 500; }
.side nav a:hover { background: #164C37; text-decoration: none; }
.side nav a.active { background: var(--side-act); color: #fff; font-weight: 700; }
.side .sep { height: 1px; background: #245A44; margin: .8rem 0; }
.side .lab { font-size: .78rem; color: #9DBBAA; margin: .2rem .4rem .35rem; }
.years { display: flex; gap: .3rem; flex-wrap: wrap; padding: 0 .2rem; }
.years a { padding: .25rem .6rem; border-radius: 8px; background: #164C37; color: #DCEBE2; font-size: .82rem; font-weight: 600; }
.years a.active { background: #fff; color: var(--ink); }
.years a:hover { text-decoration: none; background: #1B5E43; }
.years a.active:hover { background: #fff; }
.me { margin-top: auto; padding-top: 1.2rem; font-size: .85rem; }
.me b { color: #fff; display: block; }
.me small { color: #9DBBAA; }
.me form { margin-top: .6rem; }
.side-foot { font-size: .72rem; color: #9DBBAA; margin-top: 1rem; padding-left: .2rem; }
main { flex: 1; min-width: 0; padding: 2rem 2.6rem 4rem; max-width: 1280px; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.85rem; font-weight: 800; line-height: 1.15; }
.page-head p { margin: .35rem 0 0; color: var(--ink2); max-width: 62ch; }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 1.3rem; }
.kpi { padding: 1.15rem 1.3rem 1rem; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .lab { font-size: .82rem; color: var(--ink2); font-weight: 600; }
.kpi .val { font-size: 2.05rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 1rem; font-weight: 600; color: var(--ink2); margin-left: .2rem; letter-spacing: 0; }
.kpi .top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.kpi .foot { margin-top: .3rem; min-height: 18px; }
.kpi .delta { font-size: .78rem; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.kpi .delta.up b { color: #0B6B3A; }
.kpi .delta.down b { color: var(--danger); }
.kpi svg { flex: none; }

/* ---------- Kartu & grid ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; min-width: 0; }
.card-title { font-weight: 700; font-size: 1.02rem; }
.card-sub { color: var(--ink2); font-size: .84rem; margin: .15rem 0 .5rem; }
.grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.g-21 { grid-template-columns: 2.1fr 1fr; }
.g-15 { grid-template-columns: 1.5fr 1fr; }
.g-12 { grid-template-columns: 1.2fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.mrow { display: flex; justify-content: space-between; align-items: baseline; padding: .62rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.mrow:first-of-type { border-top: 0; }
.mrow span:first-child { color: var(--ink2); }
.mrow span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.more { display: inline-flex; align-items: center; gap: .3rem; margin-top: .6rem; font-weight: 600; font-size: .88rem; }
.chart { width: 100%; }

/* ---------- Filter ---------- */
.filters { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1.2rem; }
.filters .grp > .lab { font-size: .8rem; font-weight: 600; color: var(--ink2); margin-bottom: .35rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips label, .seg label { cursor: pointer; }
.chips input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.chips span, .seg span { display: inline-block; padding: .32rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .84rem; font-weight: 600; color: var(--ink2); }
.chips input:checked + span, .seg input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.chips input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Tabel ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: .6rem; }
table.dt { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dt th { text-align: left; background: #F7F9FB; color: var(--ink2); font-weight: 600; padding: .55rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dt td { padding: .5rem .8rem; border-top: 1px solid var(--line); vertical-align: middle; }
.dt tr:first-child td { border-top: 0; }
.dt .r { text-align: right; font-variant-numeric: tabular-nums; }
.dt td.trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt td.act { white-space: nowrap; width: 1%; }
.pbar { position: relative; min-width: 110px; height: 22px; background: #EEF2F6; border-radius: 6px; overflow: hidden; }
.pbar i { position: absolute; inset: 0 auto 0 0; background: #BFE6D0; }
.pbar span { position: relative; display: block; text-align: right; padding: 0 .5rem; line-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
details.card > summary { cursor: pointer; font-weight: 700; }

/* ---------- Form & tombol ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: #F7F9FB; text-decoration: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #188A4E; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: .25rem .6rem; font-size: .82rem; }
.side .btn { background: transparent; border-color: #2F6B52; color: #DCEBE2; width: 100%; justify-content: center; }
.side .btn:hover { background: #164C37; }
label.f { display: block; font-size: .8rem; font-weight: 600; color: var(--ink2); margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #D3DBE4; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
textarea { min-height: 84px; resize: vertical; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.fgrid .full { grid-column: 1 / -1; }
.hint { font-size: .78rem; color: var(--ink3); margin-top: .25rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.check input { width: auto; }
.actions { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; align-items: center; }

/* ---------- Tab & pager ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .55rem 1rem; font-weight: 600; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--green); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.subtabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.subtabs a { padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink2); font-weight: 600; font-size: .86rem; }
.subtabs a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.subtabs a:hover { text-decoration: none; }
.toolbar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.toolbar form { display: flex; gap: .5rem; flex: 1; max-width: 520px; }
.pager { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; font-size: .86rem; color: var(--ink2); }
.pager .btn { padding: .2rem .55rem; }
.pager .gap { flex: 1; }
.pager select { width: auto; padding: .25rem .5rem; }

/* ---------- Pesan ---------- */
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.flash.error { background: #FBE9E7; border-color: #F2C3BD; color: #8C1D18; }
.flash.ok { background: #E6F5EC; border-color: #B7E0C7; color: #0B5A31; }
.flash.warn { background: #FFF4E5; border-color: #F4D7AE; color: #8A4B00; }
.notice { padding: .9rem 1rem; background: #EAF2FA; border: 1px solid #C9DCEE; border-radius: 10px; color: #1B4A75; }
ul.plain { margin: .4rem 0 0; padding-left: 1.2rem; }
code { background: #EEF2F6; padding: .05rem .35rem; border-radius: 5px; font-size: .9em; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.login .top { background: var(--side); padding: 1.4rem 1.6rem; }
.login .top img { height: 3.6rem; display: block; }
.login .body { padding: 1.5rem 1.6rem 1.7rem; }
.login h1 { font-size: 1.5rem; font-weight: 800; }
.login .sub { color: var(--ink2); margin: .2rem 0 1.2rem; font-size: .9rem; }
.login .field { margin-bottom: 1rem; }
.login .btn { width: 100%; justify-content: center; margin-top: .4rem; }

@media (max-width: 1000px) {
  .grid, .g-21, .g-15, .g-12, .g-3, .fgrid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { border-top: 1px solid var(--line); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(-n+2) { border-top: 0; }
}
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; padding: .8rem 1rem; }
  .side .brand { padding-bottom: .6rem; margin-bottom: .6rem; }
  .side .brand img { height: 2.8rem; }
  .side nav { flex-direction: row; overflow-x: auto; gap: .3rem; }
  .side nav a { white-space: nowrap; }
  .me { margin-top: .8rem; padding-top: 0; }
  main { padding: 1.2rem 1rem 3rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
