/* BIMA Finance — sistem desain. Tema brand BIMA Green Space (hijau) + aksen kuning. */
:root {
  --brand: #0B7A53;
  --brand-600: #096845;
  --brand-700: #075538;
  --brand-800: #0C3B2B;
  --brand-900: #0C2F24;
  --brand-50: #EAF5F0;
  --brand-100: #D3EBE1;
  --accent: #FFE800;
  --accent-600: #E6D000;
  --ink: #10231C;
  --ink-2: #33473F;
  --muted: #6C7C75;
  --muted-2: #8B9A94;
  --line: #E3E9E5;
  --line-strong: #CFD8D2;
  --bg: #F5F7F6;
  --card: #FFFFFF;
  --pos: #0F7B4F;
  --pos-bg: #E6F4EC;
  --neg: #C0392B;
  --neg-bg: #FBEAE8;
  --warn: #A9741A;
  --warn-bg: #FDF3DC;
  --info: #2158C9;
  --info-bg: #E9F0FD;
  --violet: #6D4BB5;
  --violet-bg: #EFEBFA;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 28, .05), 0 8px 24px -12px rgba(16, 35, 28, .18);
  --shadow-lg: 0 24px 60px -20px rgba(16, 35, 28, .35);
  --sidebar: 252px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 650; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.spacer { flex: 1; }

/* ------------------------------------------------------------------ login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.login-brand {
  position: relative; overflow: hidden; padding: 44px 48px; color: #fff;
  background: radial-gradient(120% 90% at 10% 0%, #13795A 0%, #0C3B2B 55%, #082A20 100%);
  display: flex; flex-direction: column; gap: 32px;
}
.login-brand::after {
  content: ''; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,232,0,.22), rgba(255,232,0,0) 65%);
}
.brand-mark { display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; }
.brand-seal {
  width: 46px; height: 46px; border-radius: 13px; background: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45); flex: 0 0 auto; overflow: hidden;
}
.brand-seal img { width: 88%; height: 88%; object-fit: contain; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-sub { font-size: 11.5px; opacity: .78; letter-spacing: .02em; }
.login-hero { position: relative; z-index: 1; margin-top: 26px; }
.login-hero h1 { font-size: 34px; line-height: 1.2; font-weight: 700; max-width: 15em; }
.login-hero h1 em { color: var(--accent); font-style: normal; }
.login-hero p { color: rgba(255, 255, 255, .8); font-size: 13.5px; max-width: 34em; margin: 14px 0 0; }
.login-points { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.login-point { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: rgba(255, 255, 255, .86); }
.login-point i {
  width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 232, 0, .18); color: var(--accent);
  display: grid; place-items: center; font-style: normal; font-size: 11px; flex: 0 0 auto; margin-top: 1px;
}
.login-foot { margin-top: auto; display: flex; gap: 10px; font-size: 11.5px; color: rgba(255, 255, 255, .6); position: relative; z-index: 1; }
.login-panel { display: grid; place-items: center; padding: 40px 32px; background: #fff; }
.login-card { width: 100%; max-width: 388px; }
.login-card h2 { font-size: 22px; }
.login-card .lead { color: var(--muted); font-size: 12.5px; margin: 8px 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-actions { margin-top: 20px; }
.demo-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.demo-row {
  display: grid; grid-template-columns: 96px 1fr 52px; gap: 8px; align-items: center;
  font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #FBFCFB;
}
.demo-row b { font-family: var(--mono); font-size: 11.5px; }
.demo-row button {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; padding: 3px 0;
  font-size: 11px; cursor: pointer; color: var(--brand); font-weight: 600;
}
.login-aside { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.login-note { font-size: 10.8px; color: var(--muted-2); margin-top: 18px; line-height: 1.6; }
.login-err { color: var(--neg); font-size: 12px; min-height: 16px; margin-top: 6px; }

/* ------------------------------------------------------------------ shell */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  background: linear-gradient(180deg, #0C3B2B 0%, #0A3227 60%, #082A20 100%);
  color: #E7F0EC; display: flex; flex-direction: column;
  transition: transform .22s ease;
}
.sidebar-top { padding: 18px 16px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-brand { display: flex; gap: 10px; align-items: center; }
.sidebar-brand .brand-seal { width: 38px; height: 38px; border-radius: 11px; }
.sidebar-brand .brand-name { font-size: 14px; color: #fff; }
.sidebar-brand .brand-sub { font-size: 10.5px; color: rgba(255, 255, 255, .62); }
.company-pill {
  margin-top: 12px; display: flex; align-items: center; gap: 8px; width: 100%;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #fff;
  padding: 7px 10px; border-radius: 9px; font-size: 11.8px; cursor: pointer; text-align: left;
}
.company-pill:hover { background: rgba(255, 255, 255, .12); }
.company-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.company-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 12px 10px 18px; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 3px; }
.nav-group { margin-bottom: 12px; }
.nav-label {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .42);
  padding: 8px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  color: rgba(255, 255, 255, .8); padding: 8px 10px; border-radius: 9px; font-size: 12.6px;
  cursor: pointer; text-align: left; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: #fff; color: var(--brand-800); font-weight: 650; }
.nav-item .ico { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; }
.nav-item .ico svg { width: 16px; height: 16px; }
.nav-item.sub { padding-left: 34px; font-size: 12.2px; }
.nav-item .count {
  margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 20px;
  background: rgba(255, 255, 255, .16); color: #fff;
}
.nav-item.active .count { background: var(--brand-50); color: var(--brand-700); }
.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, .08); padding: 12px 14px; display: flex; gap: 10px; align-items: center;
}
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650; overflow: hidden; flex: 0 0 auto;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who .n { font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who .r { font-size: 10.5px; color: rgba(255, 255, 255, .55); }
.sidebar-foot #logout-btn {
  background: transparent; border: 0; color: rgba(255, 255, 255, .6); cursor: pointer; font-size: 14px; padding: 4px;
}
.sidebar-foot #logout-btn:hover { color: #fff; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
}
.crumb { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar > * { min-width: 0; flex-shrink: 0; }
.topbar .spacer { flex-shrink: 1; }
.quick-label { display: inline; }
@media (max-width: 1180px) { .quick-label { display: none; } }
.crumb b { color: var(--ink); font-weight: 650; }
.searchbox {
  display: flex; align-items: center; gap: 7px; background: #F3F6F4; border: 1px solid var(--line);
  border-radius: 9px; padding: 6px 10px; width: 250px;
}
.searchbox input { border: 0; background: transparent; outline: none; font-size: 12.5px; width: 100%; color: var(--ink); }
.searchbox .ico { color: var(--muted-2); display: grid; place-items: center; }
.searchbox .ico svg { width: 15px; height: 15px; }
.iconbtn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative;
}
.iconbtn:hover { background: #F7FAF8; border-color: var(--line-strong); }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn .dot {
  position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--neg); border: 1.5px solid #fff;
}
.avatar-btn {
  display: flex; align-items: center; gap: 8px; background: transparent; border: 0; cursor: pointer;
  padding: 4px 6px; border-radius: 10px;
}
.avatar-btn:hover { background: #F3F6F4; }
.avatar-btn .avatar-sm { background: var(--brand-50); color: var(--brand-700); }
.avatar-btn .nm { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.menu-pop {
  position: absolute; right: 0; top: 46px; width: 232px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.menu-pop button {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 8px; font-size: 12.5px; cursor: pointer; text-align: left; color: var(--ink);
}
.menu-pop button:hover { background: #F3F6F4; }
.menu-pop .sep { height: 1px; background: var(--line); margin: 5px 4px; }

.content { flex: 1; padding: 22px 24px 40px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted-2); margin-bottom: 6px; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.card-head h3 { font-size: 13.5px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.card-head .tools { display: flex; gap: 6px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; overflow-x: auto; }
.card-body.flush > table.data { min-width: 0; }
@media (max-width: 640px) { .card-body.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; } }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 16px; }
.kpi-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px;
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.kpi-card::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: .9; }
.kpi-card.pos::after { background: var(--pos); }
.kpi-card.neg::after { background: var(--neg); }
.kpi-card.warn::after { background: var(--warn); }
.kpi-card.info::after { background: var(--info); }
.kpi-card.brand::after { background: var(--brand); }
.kpi-card .k-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-card .k-value { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-card .k-value.sm { font-size: 17px; }
.kpi-card .k-foot { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 11.5px; }
.delta.up { color: var(--pos); }
.delta.down { color: var(--neg); }
.delta.flat { color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2);
  padding: 8px 14px; border-radius: 9px; font-size: 12.6px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: #F7FAF8; border-color: #BFCBC5; }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #201F00; }
.btn.accent:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #F1F5F2; }
.btn.danger { background: #fff; border-color: #E9C3BE; color: var(--neg); }
.btn.danger:hover { background: var(--neg-bg); }
.btn.dark { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 11.8px; border-radius: 8px; }
.btn.xs { padding: 3px 8px; font-size: 11px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: #F5F9F6; }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.danger:hover { background: var(--neg-bg); color: var(--neg); border-color: #E9C3BE; }

/* ----------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.8px; font-weight: 650;
  padding: 3px 8px; border-radius: 20px; background: #F1F4F2; color: var(--muted); white-space: nowrap;
  letter-spacing: .01em;
}
.badge.pos { background: var(--pos-bg); color: var(--pos); }
.badge.neg { background: var(--neg-bg); color: var(--neg); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.badge.brand { background: var(--brand-50); color: var(--brand-700); }
.badge.grey { background: #F1F4F2; color: var(--muted); }
.badge.accent { background: #FFF9CC; color: #6B5C00; }
.dot-badge { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 11.8px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--muted-2); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  border-radius: 9px; padding: 8px 11px; font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 122, 83, .12); }
.input:disabled, .select:disabled, .textarea:disabled { background: #F4F6F5; color: var(--muted); }
.textarea { min-height: 80px; resize: vertical; line-height: 1.55; }
.input.sm, .select.sm { padding: 5px 8px; font-size: 12px; border-radius: 7px; }
.input.right { text-align: right; }
.input.mono { font-family: var(--mono); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }
.check-line input { width: 15px; height: 15px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 20px; border-radius: 20px; background: #CBD5CF; position: relative; transition: background .15s; }
.switch .track::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  top: 2px; left: 2px; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.range { width: 100%; accent-color: var(--brand); }
input[type="color"] { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.seg { display: inline-flex; background: #F1F4F2; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12px;
  cursor: pointer; color: var(--muted); font-weight: 600;
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(16, 35, 28, .12); }

/* ------------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.7px; }
table.data th {
  text-align: left; font-size: 10.8px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: #FAFCFB; white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid #F0F3F1; vertical-align: middle; }
table.data tbody tr:hover { background: #FAFCFB; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.right, table.data th.right { text-align: right; }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .acts { white-space: nowrap; text-align: right; }
table.data .cell-main { font-weight: 600; }
table.data .sub { font-size: 11.3px; color: var(--muted); }
table.data tr.total td { font-weight: 700; background: #F7FAF8; border-top: 1px solid var(--line-strong); }
table.data tr.group td { background: #F3F6F4; font-weight: 650; font-size: 11.6px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; }
.toolbar .search { min-width: 200px; flex: 1 1 180px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 11px;
  font-size: 11.8px; cursor: pointer; color: var(--ink-2); font-weight: 600;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ico { font-size: 24px; opacity: .5; }
.empty h4 { font-size: 13px; color: var(--ink-2); }
.empty div { font-size: 12px; max-width: 40ch; }
.note {
  display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  font-size: 12.2px; background: #F3F6F4; color: var(--ink-2); border: 1px solid var(--line);
}
.note .ico { flex: 0 0 auto; font-weight: 700; }
.note.info { background: var(--info-bg); border-color: #D3E0FA; color: #1B3F8F; }
.note.warn { background: var(--warn-bg); border-color: #F0E0B8; color: #7A5410; }
.note.pos { background: var(--pos-bg); border-color: #CDEBD9; color: #0B5A3B; }
.note.neg { background: var(--neg-bg); border-color: #F2CEC9; color: #8E2B20; }
.skeleton { background: linear-gradient(90deg, #EEF2F0 25%, #F7FAF8 37%, #EEF2F0 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: 10px 14px; font-size: 12.6px; cursor: pointer; color: var(--muted);
  font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 22px; }
.dl .item { min-width: 0; }
.dl .k { font-size: 10.8px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.dl .v { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.hbar { display: flex; flex-direction: column; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 2.2fr auto; gap: 10px; align-items: center; font-size: 12px; }
.hbar-row .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-row .trk { height: 8px; background: #EFF3F1; border-radius: 6px; overflow: hidden; }
.hbar-row .trk span { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.hbar-row .val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #F0F3F1; }
.list-row:last-child { border-bottom: 0; }
.list-row > * { min-width: 0; }
.list-row .n { font-size: 12.6px; font-weight: 600; overflow-wrap: anywhere; }
.list-row .s { overflow-wrap: anywhere; }
.list-row .s { font-size: 11.4px; color: var(--muted); }
.list-row .when { margin-left: auto; font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap { position: relative; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.legend { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 11.8px; }
.legend-row .sw { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.legend-row .vl { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }
.chart-tip {
  position: fixed; z-index: 200; pointer-events: none; background: #0C2F24; color: #fff;
  font-size: 11.5px; padding: 5px 9px; border-radius: 7px; opacity: 0; transition: opacity .12s;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); max-width: 260px;
}
.chart-tip.on { opacity: 1; }
.spark { display: block; width: 100%; height: 34px; }

/* ------------------------------------------------------------------ modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9, 26, 20, .46); backdrop-filter: blur(2px);
  z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 34px 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 620px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: calc(100vh - 68px); animation: pop .16s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 1000px; }
.modal.xwide { max-width: 1220px; }
.modal.narrow { max-width: 440px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: 15px; }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-head .x {
  margin-left: auto; border: 0; background: transparent; font-size: 16px; cursor: pointer; color: var(--muted);
  width: 28px; height: 28px; border-radius: 8px;
}
.modal-head .x:hover { background: #F1F5F2; color: var(--ink); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-body.flush { padding: 0; }
.modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end;
  background: #FCFDFC; border-radius: 0 0 16px 16px; flex-wrap: wrap;
}
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0C2F24; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 12.5px;
  box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: flex-start; max-width: 380px;
  animation: pop .16s ease;
}
.toast.pos { background: #0B6B47; }
.toast.neg { background: #A03325; }
.toast.warn { background: #8A5F12; }

/* ------------------------------------------------------------ sub-layouts */
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.split.wide-right { grid-template-columns: 1fr 1.7fr; }
.sticky { position: sticky; top: 74px; }
.item-lines { display: flex; flex-direction: column; gap: 8px; }
.item-line {
  display: grid; grid-template-columns: minmax(0, 2.4fr) 68px 76px 110px 64px 96px 92px 30px;
  gap: 6px; align-items: center;
}
.item-line .input, .item-line .select { font-size: 12.2px; padding: 6px 8px; }
.item-line.head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.totals { display: flex; flex-direction: column; gap: 7px; font-size: 12.6px; }
.totals .t-row { display: flex; justify-content: space-between; gap: 12px; }
.totals .t-row.total { font-size: 15px; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line-strong); }
.totals .t-row .num { font-variant-numeric: tabular-nums; }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-mini { display: flex; flex-direction: column; gap: 2px; }
.stat-mini .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-mini .k { font-size: 11px; color: var(--muted); }
.progress { height: 7px; border-radius: 6px; background: #EFF3F1; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.progress.warn span { background: var(--warn); }
.progress.neg span { background: var(--neg); }

/* --------------------------------------------------- template designer */
.designer { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.designer-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.designer-tabs { display: flex; gap: 2px; padding: 6px; background: #F7FAF8; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.designer-tabs button {
  border: 0; background: transparent; padding: 6px 9px; border-radius: 7px; font-size: 11.5px; cursor: pointer;
  color: var(--muted); font-weight: 600;
}
.designer-tabs button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 2px rgba(16, 35, 28, .12); }
.designer-body { padding: 14px; display: flex; flex-direction: column; gap: 13px; max-height: calc(100vh - 220px); overflow-y: auto; }
.designer-body .field > label { font-size: 11.4px; }
.preview-wrap {
  background: #E9EDEB; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; justify-content: center; overflow: auto; max-height: calc(100vh - 170px);
}
.preview-frame { transform-origin: top center; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .3); background: #fff; }
.tpl-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tpl-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; }
.tpl-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.tpl-card.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11, 122, 83, .18); }
.tpl-thumb { height: 118px; background: #F3F6F4; display: grid; place-items: center; padding: 8px; overflow: hidden; }
.tpl-thumb .mini { width: 100%; background: #fff; border-radius: 4px; padding: 7px; box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .25); }
.tpl-meta { padding: 9px 11px; border-top: 1px solid var(--line); }
.tpl-meta .n { font-size: 12.3px; font-weight: 650; }
.tpl-meta .s { font-size: 11px; color: var(--muted); }
.section-toggle { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.section-toggle:last-child { border-bottom: 0; }
.section-toggle .lbl { flex: 1; font-size: 12.2px; }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .split, .detail-grid, .designer { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .content { padding: 18px 16px 36px; }
  .scrim { position: fixed; inset: 0; background: rgba(9, 26, 20, .4); z-index: 35; }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 24px; gap: 18px; }
  .login-hero h1 { font-size: 25px; }
  .login-points { display: none; }
  .login-panel { padding: 26px 20px 40px; }
  .searchbox { display: none; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: minmax(0, 1fr); }
  .kpi { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .kpi-card { padding: 13px 14px; }
  .kpi-card .k-value { font-size: 17px; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 12px; height: 54px; gap: 8px; }
  .content { padding: 14px 12px 32px; }
  .page-head h1 { font-size: 18px; }
  .page-head .sub { font-size: 11.8px; }
  .card-head, .card-body, .card-foot { padding-left: 13px; padding-right: 13px; }
  /* tabel menjadi kartu */
  table.data.table-cards thead { display: none; }
  table.data.table-cards tbody tr {
    display: block; border: 1px solid var(--line); border-radius: 11px; padding: 8px 11px;
    margin-bottom: 9px; background: #fff;
  }
  table.data.table-cards tbody tr:hover { background: #fff; }
  table.data.table-cards td {
    display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 0;
    font-size: 12.3px; text-align: right;
  }
  table.data.table-cards td::before {
    content: attr(data-l); font-size: 11px; color: var(--muted); text-align: left; flex: 0 0 auto;
    font-weight: 500; padding-top: 1px;
  }
  table.data.table-cards td.cell-main { display: block; text-align: left; font-size: 13px; font-weight: 650; padding-bottom: 6px; }
  table.data.table-cards td.cell-main::before { display: none; }
  table.data.table-cards td.acts { justify-content: flex-end; padding-top: 7px; border-top: 1px dashed var(--line); margin-top: 5px; }
  table.data.table-cards td.acts::before { display: none; }
  .item-line { grid-template-columns: 1fr 1fr; gap: 6px; padding-bottom: 9px; border-bottom: 1px dashed var(--line); }
  .item-line.head { display: none; }
  .item-line > :nth-child(1) { grid-column: 1 / -1; }
  .item-line > :last-child { grid-column: 2; justify-self: end; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 94vh; }
  .modal.wide, .modal.xwide { max-width: 100%; }
  .modal-body { padding: 15px 14px; }
  .modal-head { padding: 14px; }
  .modal-foot { padding: 12px 14px; }
  .modal-foot .btn { flex: 1; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .input, .select, .textarea { font-size: 16px; }
  .input.sm, .select.sm { font-size: 15px; }
  .toolbar { gap: 6px; }
  .toolbar .input, .toolbar .select { min-width: 0; flex: 1 1 120px; font-size: 16px; }
  .toolbar .search { flex: 1 1 100%; }
  .tabs { gap: 0; }
  .tab { padding: 9px 10px; font-size: 12px; }
  .designer { grid-template-columns: minmax(0, 1fr); }
  .designer-body { max-height: none; }
  .preview-wrap { max-height: none; padding: 8px; }
  .toast-root { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
  .avatar-btn .nm { display: none; }
  .hide-sm { display: none !important; }
  .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
}
@media (max-width: 400px) {
  .kpi { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .sidebar, .topbar, .page-actions, .toolbar, .no-print, .toast-root { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ddd; }
  body { background: #fff; font-size: 10.5pt; }
  .modal-open #app { display: none; }
  .modal-open .modal-overlay { position: static; background: #fff; padding: 0; backdrop-filter: none; }
  .modal-open .modal { box-shadow: none; max-width: none; max-height: none; border-radius: 0; }
  .modal-open .modal-foot, .modal-open .modal-head .x { display: none; }
  @page { size: A4 portrait; margin: 12mm; }
}
body.modal-open { overflow: hidden; }
