:root {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: rgba(11, 11, 11, 0.10);
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0fc;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --good: #0ca30c;
  --good-text: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-text: #b02a2a;
  --sidebar: #12263f;
  --sidebar-text: #c9d6e8;
  --sidebar-active: #2a78d6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .05);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --border: rgba(255, 255, 255, 0.10);
    --text: #ffffff; --text-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
    --accent: #3987e5; --accent-soft: #1b2b40; --series-1: #3987e5; --series-2: #d95926;
    --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --good-text: #0ca30c; --critical-text: #e66767; --sidebar: #101418; --sidebar-text: #aab4c0;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #242422; --border: rgba(255, 255, 255, 0.10);
  --text: #ffffff; --text-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
  --accent: #3987e5; --accent-soft: #1b2b40; --series-1: #3987e5; --series-2: #d95926;
    --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --good-text: #0ca30c; --critical-text: #e66767; --sidebar: #101418; --sidebar-text: #aab4c0;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--text-2); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.neg { color: var(--critical-text); }
.pos { color: var(--good-text); }
code, pre { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow: auto; max-height: 360px; margin: 0; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--sidebar); color: var(--sidebar-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 10px 24px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; color: #fff; }
.brand small { display: block; color: var(--sidebar-text); font-size: 12px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--sidebar-active); display: grid; place-items: center; font-size: 24px; font-weight: 700; color: #fff; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; padding: 14px 10px 4px; }
#nav a { display: block; padding: 7px 10px; border-radius: 7px; color: var(--sidebar-text); }
#nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
#nav a.active { background: var(--sidebar-active); color: var(--sidebar-ink, #fff); box-shadow: inset 3px 0 0 var(--highlight, transparent); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 18px; }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.user-pick { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.content { padding: 20px 24px 48px; max-width: 1500px; width: 100%; }
.menu-btn { display: none; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: 12px; color: var(--text-2); }
.kpi .value { font-size: 22px; font-weight: 600; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
a.kpi { color: var(--text); }
a.kpi:hover { text-decoration: none; border-color: var(--accent); }
.kpi.hl { border-left: 3px solid var(--highlight, var(--accent)); }

button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 12px; border-radius: 7px; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--critical-text); }
button.sm { padding: 3px 8px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { padding: 5px 9px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input.num { text-align: right; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--axis); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
td { padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
tr.total td { font-weight: 600; border-top: 1px solid var(--axis); background: var(--surface-2); }
tr.group td { font-weight: 600; background: var(--surface-2); }
td.indent-1 { padding-left: 26px; } td.indent-2 { padding-left: 44px; } td.indent-3 { padding-left: 62px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-text); }
.badge.warn { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--text); }
.badge.serious { background: color-mix(in srgb, var(--serious) 22%, transparent); color: var(--text); }
.badge.crit { background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical-text); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 14px; color: var(--text-2); }
.tabs button.active { border-bottom-color: var(--accent); color: var(--text); font-weight: 600; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 12px; color: var(--muted); }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.alerts li:last-child { border-bottom: none; }
.alert-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.alert-ico.high { background: var(--critical); }
.alert-ico.med { background: var(--warning); color: #000; }
.alert-ico.low { background: var(--muted); }
.alerts .area { font-size: 11px; color: var(--muted); }

.callout { padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.callout.err { background: color-mix(in srgb, var(--critical) 12%, transparent); }

/* ---------- charts ---------- */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbars { display: grid; grid-template-columns: minmax(90px, max-content) 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.hbars .lbl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars .track { height: 14px; position: relative; }
.hbars .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbars .val { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hbars .hit { cursor: pointer; }
.hbars .row-hit:hover .lbl { color: var(--text); }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 80px; position: relative; }
.meter > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--series-1); }
.meter > span.c2 { background: var(--series-2); }
.meter > span.warn { background: var(--warning); }
.meter > span.crit { background: var(--critical); }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
svg.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
svg.chart .gridline { stroke: var(--grid); stroke-width: 1; }
svg.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 4px 16px rgba(0, 0, 0, .15); border-radius: 8px; padding: 8px 10px; font-size: 12px; opacity: 0; transition: opacity .08s; max-width: 280px; }
.tip.show { opacity: 1; }
.tip b { font-weight: 600; }
.tip .tr { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }

/* ---------- journey ---------- */
.journey { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.journey .step { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.journey .step b { display: block; font-size: 13px; }
.journey .arrow { color: var(--muted); }
.waterfall td:first-child { width: 60%; }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--surface); color: var(--text); border-radius: 12px; width: 100%; max-width: 760px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.modal.wide { max-width: 1080px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; font-size: 16px; }
.modal-body { padding: 16px 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 8px; max-width: 420px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); font-size: 13px; }
.toast.err { background: var(--critical); color: #fff; }

/* ---------- grafik 3D ---------- */
.c3d { display: block; width: 100%; cursor: grab; touch-action: none; border-radius: 8px; }
.c3d.dragging { cursor: grabbing; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: none; border-radius: 0; padding: 5px 12px; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent); color: var(--accent-ink); }

/* ---------- neraca saldo ---------- */
.presets { display: flex; gap: 4px; flex-wrap: wrap; }
.presets button.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
table.tb { border: 1px solid var(--border); border-radius: 8px; }
table.tb th { position: static; background: var(--surface-2); text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
table.tb th.grp { text-align: center; border-left: 1px solid var(--axis); }
table.tb th.grp-l, table.tb td:nth-child(2), table.tb td:nth-child(4), table.tb td:nth-child(6) { border-left: 1px solid var(--grid); }
table.tb th.tb-acc { vertical-align: bottom; min-width: 240px; }
table.tb tr.tb-type td { background: var(--surface); font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); padding-top: 12px; border-left: none; }
table.tb a.acc { color: var(--text); }
table.tb a.acc:hover { color: var(--accent); }
.acc-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); margin-right: 8px; }
table.tb tfoot td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--axis); }

/* ---------- neraca ---------- */
.bs { align-items: start; }
table.bs-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
table.bs-card tr.bs-head td { background: var(--surface-2); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
table.bs-card tr.bs-sub td { font-weight: 700; border-top: 1px solid var(--axis); }
table.bs-card tr.bs-total td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--axis); }
table.bs-card a.acc { color: var(--text); }
table.bs-card a.acc:hover { color: var(--accent); }

/* ---------- laba rugi ---------- */
.pl-card { max-width: 780px; margin: 0 auto; border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: var(--surface); }
.pl-title { margin-bottom: 10px; } .pl-title h2 { margin: 0 0 2px; }
table.pl tr.pl-head td { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); padding-top: 14px; border-bottom: none; }
table.pl tr.pl-sub td { font-weight: 700; border-top: 1px solid var(--axis); }
table.pl a.acc { color: var(--text); } table.pl a.acc:hover { color: var(--accent); }
.pl-net { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-weight: 700; font-size: 16px; }
.pl-net.profit { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-text); }
.pl-net.loss { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical-text); }

/* ---------- arus kas ---------- */
.cf-kpi { margin-bottom: 14px; }
.cf-kpi .value { font-size: 20px; }
.cf-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 14px; overflow: hidden; }
.cf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.cf-head h3 { color: var(--text); font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.cf-net { font-size: 15px; font-weight: 600; white-space: nowrap; }
table.cf th { position: static; background: var(--surface-2); text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
table.cf tfoot td { font-weight: 700; background: var(--surface-2); }
table.cf a.acc { color: var(--text); } table.cf a.acc:hover { color: var(--accent); }
.cf-empty { text-align: center; color: var(--muted); padding: 14px; border-top: 1px solid var(--grid); font-size: 13px; }

/* ---------- piutang penjamin ---------- */
.claim-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .claim-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .claim-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.claim-tile .label { text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.claim-tile .value { font-size: 15px; letter-spacing: -0.02em; overflow: visible; }
.claim-tile.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.amber { color: var(--warning-text, #b7791f); }
:root[data-theme="dark"] .amber { color: var(--warning-text, #f0b54a); }
.pills { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.pill { border-radius: 8px; padding: 5px 12px; }
.pill.active { background: var(--text); color: var(--surface); border-color: var(--text); }
table.claims th { position: static; background: var(--surface-2); text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
table.claims td { vertical-align: middle; }
a.inv { color: var(--text); text-decoration: underline; text-decoration-color: var(--axis); }
.claim-st.st-REJECTED, .claim-st.st-DISPUTED { color: var(--critical-text); }
.claim-st.st-PAID { color: var(--good-text); }
.claim-st.st-VERIFIED { color: var(--accent); }

/* ---------- utang ---------- */
.ap-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 1200px) { .ap-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ap-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inv-doc { text-decoration: underline; text-decoration-color: var(--axis); }

/* ---------- setoran kasir ---------- */
.step-card { padding: 0; overflow: hidden; }
.step-head { display: flex; gap: 8px; align-items: center; padding: 12px 14px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--grid); }

/* ---------- RAB ---------- */
.rab-tile .value { font-size: 20px; }
.rab-bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 99px; margin-top: 10px; overflow: visible; }
.rab-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--series-1); }
.rab-bar span.amber { background: var(--warning); } .rab-bar span.neg { background: var(--critical); }
.rab-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); }
table.rab tr.rab-sec td { background: var(--surface); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 14px; }
table.rab tr.rab-total td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--axis); }
.rab-in { width: 140px; padding: 3px 6px; font-size: 12px; }
.rab-month .rab-in { width: 96px; font-size: 11px; }
.rab-month td { white-space: nowrap; }

/* ---------- banner restart ---------- */
.restart-banner { margin: 16px 24px 0; padding: 12px 14px; border-radius: 8px; background: color-mix(in srgb, var(--warning) 25%, var(--surface)); color: var(--text); font-size: 13px; }

/* ---------- BAPB ---------- */
#nav [hidden] { display: none !important; }
.demo-banner { margin: 0; padding: 9px 24px; font-size: 13px; background: color-mix(in srgb, var(--warning) 22%, var(--surface)); color: var(--text); border-bottom: 1px solid var(--border); }
/* Menu dengan hak "lihat" saja: tombol simpan/ubah/hapus disembunyikan (server tetap menolak bila dipaksa). */
body.view-only #content button.primary, body.view-only #content button.danger, body.view-only .modal button.primary, body.view-only .modal button.danger,
body.view-only #content [data-new], body.view-only #content [data-act="new"] { display: none !important; }
body.view-only #page-title::after { content: 'hanya lihat'; margin-left: 10px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); vertical-align: middle; }
.bapb-ttd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; text-align: center; font-size: 12px; }

/* ---------- login & pengguna ---------- */
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--sidebar); padding: 16px; z-index: 70; }
.login-screen[hidden] { display: none; }
.login-card { background: var(--surface); color: var(--text); border-radius: 14px; padding: 24px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.user-chip { font-size: 13px; white-space: nowrap; }

@media (max-width: 760px) { .user-chip .small { display: none; } }

/* ---------- manajemen aset ---------- */
.qr-box { width: 180px; margin: 0 auto; background: #fff; padding: 8px; border-radius: 8px; }
.qr-box svg { width: 100%; height: auto; display: block; }
tr.flash td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--good) 30%, transparent); } to { background: transparent; } }
.labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
.label-card { display: flex; gap: 2.5mm; align-items: center; border: 0.3mm solid #000; border-radius: 2mm; padding: 2mm; height: 32mm;
  overflow: hidden; break-inside: avoid; background: #fff; color: #000; font: 8pt/1.2 Arial, sans-serif; }
.label-qr { width: 26mm; flex: none; } .label-qr svg { width: 100%; height: auto; display: block; }
.label-text { min-width: 0; }
.label-org { font-size: 6.5pt; font-weight: 700; text-transform: uppercase; }
.label-code { font-size: 11pt; font-weight: 700; margin: 0.5mm 0; }
.label-name { font-weight: 700; max-height: 2.4em; overflow: hidden; }
.label-meta { font-size: 6.5pt; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- lembar laporan keuangan (A4) ---------- */
.sim-tag { display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700; color: #000; background: var(--warning); padding: 1px 6px; border-radius: 4px; }
.paper-wrap { overflow-x: auto; }
.paper { background: #fff; color: #000; width: 210mm; max-width: 100%; min-height: 200mm; margin: 0 auto 16px; padding: 14mm 14mm 12mm;
  box-shadow: 0 2px 12px rgba(0,0,0,.15); font: 12px/1.4 Arial, "Helvetica Neue", sans-serif; position: relative; }
.paper .muted { color: #666; }
.kop { text-align: center; border-bottom: 3px double #000; padding-bottom: 6px; margin-bottom: 14px; }
.kop-1 { font-weight: 700; font-size: 14px; } .kop-2 { font-weight: 700; font-size: 15px; } .kop-3 { font-size: 11px; }
.lk-title { text-align: center; font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.lk-period { text-align: center; font-weight: 700; font-size: 12px; }
.lk-unit { text-align: center; font-size: 11px; margin-bottom: 10px; }
.lk-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.lk-table th { background: #f0f0f0 !important; color: #000; border: 1px solid #000; text-align: center; position: static; padding: 5px 6px; white-space: normal; }
.lk-table td { border-left: 1px solid #000; border-right: 1px solid #000; border-bottom: 1px dotted #bbb; padding: 3px 6px; color: #000; }
.lk-table tbody tr:last-child td { border-bottom: 1px solid #000; }
.lk-table tr.lk-h td { font-weight: 700; }
.lk-table tr.lk-s td { font-weight: 700; border-top: 1px solid #000; }
.lk-table tr.lk-g td { font-weight: 700; border-top: 1px solid #000; border-bottom: 2px solid #000; background: #f7f7f7; }
.lk-table td.num, .lk-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lk-note { text-align: center; font-size: 10.5px; white-space: nowrap; }
.lk-foot { font-size: 10.5px; font-style: italic; margin: 8px 0 0; }
.ttd { width: 260px; margin: 22px 0 0 auto; text-align: center; font-size: 12px; }
.ttd-space { height: 64px; } .ttd-name { font-weight: 700; text-decoration: underline; }
.sim-mark { position: absolute; top: 4mm; right: 14mm; left: 14mm; text-align: center; font-size: 10px; font-weight: 700; color: #b02a2a; border: 1px solid #b02a2a; padding: 2px; }
.calk-h { font-size: 13px; color: #000; margin: 16px 0 6px; border-bottom: 1px solid #000; }
.calk-sec { margin-bottom: 12px; break-inside: avoid; }
.calk-sec h4 { margin: 8px 0 4px; font-size: 12px; }
.cover { display: flex; flex-direction: column; justify-content: center; text-align: center; min-height: 260mm; gap: 8px; }
.cover-1 { font-weight: 700; font-size: 16px; } .cover-2 { font-weight: 700; font-size: 15px; }
.cover-title { font-weight: 700; font-size: 22px; margin: 60px 0 30px; line-height: 1.5; }
#print-all { display: none; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -260px; z-index: 30; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-block; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .user-pick { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .sidebar, .topbar, .filters, button, .tabs, .pager, .callout { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: none; }
  .paper { box-shadow: none; width: auto; min-height: 0; margin: 0; padding: 0; page-break-after: always; }
  .paper:last-child { page-break-after: auto; }
  .lk-table tr { break-inside: avoid; }
  body.printing-all .app { display: none !important; }
  body.printing-all #print-all { display: block !important; }
  .sim-mark { position: static; margin-bottom: 6px; }
}

.app[hidden] { display: none; }

/* ---------- pengaturan tampilan ---------- */
.th-label { font-size: 12px; color: var(--text-2); margin: 18px 0 8px; }
.th-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.th-preset { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; white-space: normal; padding: 12px 14px; border-radius: 9px; background: var(--surface); }
.th-preset.on { border-color: var(--text); outline: 1px solid var(--text); background: var(--surface-2); }
.th-dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.th-chip { width: 24px; height: 15px; border-radius: 4px; display: inline-block; }
.th-dot { width: 15px; height: 15px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 4px; }
.th-dot.sm { width: 10px; height: 10px; margin-right: 3px; }
.th-box { border: 1px solid var(--border); border-radius: 9px; padding: 12px; background: var(--surface); }
.th-group.on { border-color: var(--text-2); }
.th-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.th-swatch { position: relative; flex: none; width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--border); cursor: pointer; overflow: hidden; }
.th-swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.th-circle { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 1px solid var(--border); }
.th-circle.on { outline: 2px solid var(--text); outline-offset: 2px; }
.th-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linklike { border: 0; background: none; color: var(--accent); padding: 4px 6px; }
.linklike:disabled { color: var(--muted); }
.th-preview { display: flex; gap: 16px; background: var(--page); border: 1px solid var(--border); border-radius: 9px; padding: 12px; }
.th-side { width: 150px; flex: none; background: var(--sidebar); color: var(--sidebar-text); border-radius: 8px; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.th-side-h { color: #fff; font-weight: 600; padding: 0 6px 8px; }
.th-side span { padding: 5px 8px; border-radius: 6px; }
.th-side span.on { background: var(--sidebar-active); color: var(--sidebar-ink, #fff); box-shadow: inset 3px 0 0 var(--highlight, transparent); }
.th-bar { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.th-bar.show { border-color: var(--highlight, var(--accent)); }
@media (max-width: 700px) { .th-side { display: none; } }

/* input tanggal dd-mm-yyyy */
.dpick { position: relative; display: inline-flex; align-items: center; min-width: 0; }
label.field .dpick, .field > .dpick { display: flex; }
.dpick > input[type=text] { width: 100%; min-width: 128px; padding-right: 30px; font-variant-numeric: tabular-nums; }
.dpick > input.bad { outline: 2px solid var(--critical); }
.dpick-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 2px 5px; font-size: 13px; line-height: 1; opacity: .7; }
.dpick-btn:hover { opacity: 1; }
.dpick > .dpick-native { position: absolute; right: 0; bottom: 0; width: 30px; height: 100%; opacity: 0; pointer-events: none; padding: 0; border: 0; }

tr.sel-row td { background: var(--accent-soft); }
