@import url('tokens.css');
/* ═══════════════════════════════════════════════════════════════════════════
   Sistem Keuangan Terpadu — Design System (satu sumber kebenaran)
   Token & komponen diturunkan dari referensi UI majumapan_v12 (AP).
   Ubah token di tokens.css → seluruh komponen AP, AR, master, admin ikut berubah.
   Komponen di file ini hanya memakai var(--…), bukan nilai warna mentah.
   ═══════════════════════════════════════════════════════════════════════════ */
/* Token desain (warna, tipografi, ruang, radius, bayangan, dimensi) ada di tokens.css — satu sumber nilai */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--navy); font-size: var(--fs); line-height: 1.6; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--blue); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 7px; height: 7px; } ::-webkit-scrollbar-thumb { background: var(--sl2); border-radius: 4px; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { background: var(--w); border-bottom: 1px solid var(--bdr); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 0 var(--sp-5); height: var(--topbar-h); flex-shrink: 0; z-index: 50; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--sp-5); }
.content.flush { padding: 0; overflow: hidden; display: flex; }
.ar-frame { border: 0; width: 100%; height: 100%; flex: 1; background: var(--bg); }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-w); min-width: var(--sidebar-w); background: var(--navy); display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0; transition: transform .2s; z-index: 200; }
.sb-brand { padding: 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 9px; cursor: pointer; }
.sb-ico { width: 32px; height: 32px; background: var(--blue); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: var(--on-solid); flex-shrink: 0; overflow: hidden; }
.sb-ico img { width: 100%; height: 100%; object-fit: contain; }
.sb-name { font-family: var(--font-display); font-size: 12px; font-weight: 700; color: var(--on-solid); line-height: 1.25; }
.sb-sub { font-size: 9.5px; color: rgba(255,255,255,.45); }
.nav-sec { padding: 12px 8px 4px; }
.nav-lbl { font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,.32); padding: 0 8px 6px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 6px; color: rgba(255,255,255,.68); font-size: 12.5px; font-weight: 500; cursor: pointer; margin-bottom: 1px; transition: background .13s, color .13s; user-select: none; border: 0; background: none; width: 100%; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.07); color: var(--on-solid); }
.nav-item.active { background: var(--blue); color: var(--on-solid); }
.nav-item.sub { padding-left: 32px; font-size: 12px; }
.nav-ico { width: 15px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; border-radius: 99px; font-size: 9.5px; font-weight: 700; padding: 1px 6px; color: var(--on-solid); background: rgba(255,255,255,.15); }
.nav-badge.r { background: var(--red); }
.nav-team { display: flex; align-items: center; gap: 7px; margin: 2px 9px 6px 32px; font-size: 11px; color: rgba(255,255,255,.75); }
.nav-team .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.nav-team button { margin-left: auto; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.8); border-radius: 4px; font-size: 10px; padding: 0 6px; cursor: pointer; }
.sb-foot { margin-top: auto; padding: 11px 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 8px; }
.u-av { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; color: var(--on-solid); flex-shrink: 0; }
.u-name { font-size: 12px; font-weight: 600; color: var(--on-solid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: 10px; color: rgba(255,255,255,.45); }
.sb-btn { position: relative; background: rgba(255,255,255,.08); border: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--on-solid); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sb-btn:hover { background: rgba(255,255,255,.18); }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--red); color: var(--on-solid); border-radius: 99px; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--navy); }
.sb-backdrop { display: none; }
.env-badge { display: inline-block; background: var(--amber); color: var(--on-solid); font-size: 9px; font-weight: 800; letter-spacing: .6px; padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }

/* ── Topbar / breadcrumb ────────────────────────────────────────────────── */
.bc { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; flex-wrap: wrap; }
.bc-sep { color: var(--sl2); }
.bc-link { color: var(--slate); cursor: pointer; background: none; border: 0; }
.bc-link:hover { color: var(--blue); }
.bc-cur { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.tb-r { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.menu-btn { display: none; }

/* ── Tombol ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl-h); padding: 0 12px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .13s, color .13s, border-color .13s; white-space: nowrap; text-decoration: none; background: none; }
.btn-pr { background: var(--blue); color: var(--on-solid); } .btn-pr:hover { background: var(--blue-dark); }
.btn-gh { background: var(--w); color: var(--slate); border-color: var(--bdr); } .btn-gh:hover { background: var(--bg); color: var(--navy); }
.btn-dn { background: var(--red); color: var(--on-solid); } .btn-dn:hover { background: var(--red-dark); }
.btn-ok { background: var(--green); color: var(--on-solid); }
.btn-am { background: var(--amber); color: var(--on-solid); }
.btn-link { color: var(--blue); padding: 0 4px; height: auto; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 11.5px; }
.btn-ico { width: var(--ctl-h); padding: 0; } .btn-sm.btn-ico { width: 26px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger-text { color: var(--red) !important; }

/* ── Kartu ──────────────────────────────────────────────────────────────── */
.card { background: var(--w); border: 1px solid var(--bdr); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.card + .card { margin-top: 14px; }
/* Kartu yang bersebelahan di grid (two-col / grid-2) sejajar atas & sama tinggi */
.two-col > .card + .card, .grid-2 > .card + .card { margin-top: 0; }
.two-col > .card, .grid-2 > .card { display: flex; flex-direction: column; }
.two-col > .card > .card-body, .grid-2 > .card > .card-body { flex: 1; }
.card-hdr { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--bdr); flex-wrap: wrap; gap: 7px; }
.card-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; }
.card-sub { font-size: 11px; color: var(--slate); }
.card-body { padding: 16px; }
.page-hdr { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 700; }
.page-desc { font-size: 12.5px; color: var(--slate); }

/* ── KPI ────────────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 18px; }
.kpi-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--w); border: 1px solid var(--bdr); border-radius: var(--r); padding: 14px 16px; position: relative; overflow: hidden; box-shadow: var(--sh); text-align: left; }
button.kpi { cursor: pointer; width: 100%; } button.kpi:hover { border-color: var(--blue); }
.kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--blue); }
.kpi.tl::before { background: var(--teal); } .kpi.am::before { background: var(--amber); } .kpi.rd::before { background: var(--red); } .kpi.gr::before { background: var(--green); } .kpi.vi::before { background: var(--violet); }
.kpi-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--slate); padding-right: 40px; }
.kpi-val { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin: 3px 0 2px; padding-right: 38px; word-break: break-word; }
.kpi-sub { font-size: 10.5px; color: var(--slate); }
.kpi-ico { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; background: var(--blt); color: var(--blue); }
.kpi.tl .kpi-ico { background: var(--teal-lt); color: var(--teal); } .kpi.am .kpi-ico { background: var(--amber-lt); color: var(--amber); } .kpi.rd .kpi-ico { background: var(--red-lt); color: var(--red); } .kpi.gr .kpi-ico { background: var(--green-lt); color: var(--green); } .kpi.vi .kpi-ico { background: var(--violet-lt); color: var(--violet); }
.ql-strip { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }

/* ── Tabel ──────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
.tbl thead th { padding: 8px 11px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--slate); background: var(--bg); border-bottom: 1px solid var(--bdr); text-align: left; white-space: nowrap; }
.tbl thead th.num, .tbl td.num { text-align: right; }
.tbl td.num { white-space: nowrap; }
.tbl thead th.srt { cursor: pointer; } .tbl thead th.srt:hover { background: var(--blt); color: var(--blue); }
.tbl tbody td { padding: 9px 11px; font-size: var(--fs-ctl); line-height: 1.45; border-bottom: 1px solid var(--bdr); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.click { cursor: pointer; } .tbl tbody tr.click:hover td { background: var(--blt); }
.tbl td.muted { color: var(--slate); font-size: 11.5px; }
.tbl td.strong { font-weight: 700; }
.tbl tfoot td { padding: 9px 11px; font-weight: 700; background: var(--bg); border-top: 1px solid var(--bdr); font-size: 12.5px; }
/* Pewarnaan baris status (warisan AP) */
.tbl tr.rw td { background: var(--amber-lt); }
.tbl tr.rd td { background: var(--orange-lt); }
.tbl tr.od td { background: var(--red-lt); } .tbl tr.od td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tbl tr.gn td { background: var(--green-lt); }
.tbl tr.bt td { background: var(--surface-2); color: var(--slate); }
.dtbl { width: 100%; border-collapse: collapse; }
.dtbl td { padding: 8px 11px; border-bottom: 1px solid var(--bdr); font-size: 12.5px; vertical-align: top; }
.dtbl td:first-child { font-weight: 600; color: var(--slate); width: 40%; background: var(--bg); }
.dtbl tr:last-child td { border-bottom: none; }
.legbar { display: flex; gap: 12px; flex-wrap: wrap; padding: 7px 16px; border-top: 1px solid var(--bdr); }
.litem { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--slate); }
.lsq { width: 10px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--bdr); }

/* ── Badge / pill / chip / tab ──────────────────────────────────────────── */
.bge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.bge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.bge.nodot::before { display: none; }
/* Badge-select: status yang dapat diubah langsung di tabel (bentuk badge, warna dari kelas bg-*) */
.bge-sel { border: 0; border-radius: var(--r-pill); padding: 2px 8px; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; font-family: inherit; max-width: 100%; }
.bge-sel:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.bg-gr { background: var(--green-soft); color: var(--green); } .bg-am { background: var(--amber-soft); color: var(--amber); } .bg-rd { background: var(--red-soft); color: var(--red); }
.bg-bl { background: var(--blt); color: var(--blue); } .bg-sl { background: var(--surface-2); color: var(--slate); } .bg-or { background: var(--orange-soft); color: var(--orange); } .bg-vi { background: var(--violet-soft); color: var(--violet); }
.ttpill { font-family: var(--font-display); font-size: 10.5px; font-weight: 700; background: var(--navy); color: var(--on-solid); border-radius: 4px; padding: 2px 6px; letter-spacing: .3px; display: inline-block; white-space: nowrap; }
.code { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.tab-bar { display: flex; gap: 3px; padding: 8px 16px; border-bottom: 1px solid var(--bdr); overflow-x: auto; }
.tab { padding: 5px 11px; border-radius: var(--r-xs); font-size: 12px; font-weight: 500; color: var(--slate); cursor: pointer; white-space: nowrap; border: 0; background: none; }
.tab.active { background: var(--blue); color: var(--on-solid); } .tab:hover:not(.active) { background: var(--bg); }
.tab.danger:not(.active) { color: var(--red); }
.abar { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; border-bottom: 1px solid var(--bdr); gap: 9px; flex-wrap: wrap; }
.abar.soft { background: var(--bg); }
.sbox { display: flex; align-items: center; gap: 6px; border: 1px solid var(--bdr); border-radius: var(--r-sm); padding: 0 9px; height: var(--ctl-h); background: var(--bg); max-width: 280px; width: 100%; color: var(--slate); }
.sbox input { border: none; outline: none; background: transparent; font-size: 12.5px; width: 100%; color: var(--navy); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { padding: 3px 10px; border-radius: var(--r-xs); font-size: 11.5px; font-weight: 500; border: 1px solid var(--bdr); background: var(--w); color: var(--slate); cursor: pointer; white-space: nowrap; }
.chip.active { border-color: var(--blue); background: var(--blt); color: var(--blue); }

/* ── Layout helper ──────────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
.col-stack { display: flex; flex-direction: column; gap: 14px; }
/* Kolom grid boleh menyusut; tabel lebar menggulir di dalam .tbl-wrap, bukan melebarkan halaman */
.two-col > *, .grid-2 > *, .col-stack > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--slate); } .small { font-size: 11.5px; } .xs { font-size: 10.5px; } .b { font-weight: 700; }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-amber { color: var(--amber); } .text-blue { color: var(--blue); }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }

/* ── Form ───────────────────────────────────────────────────────────────── */
.fc { background: var(--w); border: 1px solid var(--bdr); border-radius: var(--r); padding: 20px; box-shadow: var(--sh); }
.fs { font-family: var(--font-display); font-size: 12px; font-weight: 700; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--bdr); }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.fr.s1 { grid-template-columns: 1fr; } .fr.s3 { grid-template-columns: 1fr 1fr 1fr; }
.fg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fg > label, .lbl { font-size: 10.5px; font-weight: 700; color: var(--slate); text-transform: uppercase; letter-spacing: .4px; }
.fg .hint { font-size: 10.5px; color: var(--slate); }
.fc2 { border: 1px solid var(--bdr); border-radius: var(--r-sm); padding: 6px 10px; min-height: var(--ctl-h); font-size: 13px; color: var(--navy); background: var(--w); outline: none; width: 100%; transition: border-color .13s, box-shadow .13s; }
.fc2:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.fc2[readonly] { background: var(--bg); }
.fc2.err, .fc2.dx-bad { border-color: var(--red); background: var(--red-lt); box-shadow: 0 0 0 2px rgba(220,38,38,.12); }
.field-err { color: var(--red); font-size: 11px; }
select.fc2 { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }
textarea.fc2 { resize: vertical; min-height: 64px; }
.star { color: var(--red); }
.check, .fg label.check { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12.5px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--navy); }
.check input { width: 15px; height: 15px; accent-color: var(--blue); }
.inp-pre { display: flex; align-items: stretch; }
.inp-pre-lbl { display: flex; align-items: center; padding: 0 9px; background: var(--surface-2); border: 1px solid var(--bdr); border-right: none; border-radius: var(--r-sm) 0 0 var(--r-sm); font-size: 11.5px; font-weight: 600; color: var(--slate); white-space: nowrap; }
.inp-pre .fc2 { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.inp-pre.suf .inp-pre-lbl { border-right: 1px solid var(--bdr); border-left: none; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.inp-pre.suf .fc2 { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 11px; margin-top: 11px; }
.inv-card { border: 1px solid var(--bdr); border-radius: 8px; padding: 13px; background: var(--bg); }
.inv-hdr { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 12.5px; margin-bottom: 10px; }
.add-inv { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border: 2px dashed var(--bdr); border-radius: var(--r-sm); background: none; color: var(--slate); cursor: pointer; font-size: 12.5px; font-weight: 500; width: 100%; margin-top: 11px; }
.add-inv:hover { border-color: var(--blue); color: var(--blue); background: var(--blt); }
.box { border: 1px solid var(--bdr); border-radius: 8px; padding: 10px; background: var(--bg); }
.box + .box { margin-top: 8px; }
.callout { border-radius: 8px; padding: 10px 12px; font-size: 12px; }
.callout.info { background: var(--blt); color: var(--navy-2); } .callout.warn { background: var(--amber-lt); color: var(--amber-ink); } .callout.err { background: var(--red-lt); color: var(--red-ink); } .callout.ok { background: var(--green-lt); color: var(--green-ink); }

/* ── Supplier / kartu grid ──────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 11px; }
.tile { background: var(--w); border: 1px solid var(--bdr); border-radius: var(--r); padding: 15px; box-shadow: var(--sh); cursor: pointer; text-align: left; transition: border-color .13s, box-shadow .13s; }
.tile:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(37,99,235,.1); }
.tile-av { width: 38px; height: 38px; border-radius: 8px; background: var(--blt); color: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; margin-bottom: 9px; }
.tile-name { font-weight: 700; font-size: 13px; }
.tile-meta { font-size: 11px; color: var(--slate); margin-top: 2px; }
.tile-stats { display: flex; gap: 12px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--bdr); font-size: 10.5px; color: var(--slate); }
.tile-stats strong { display: block; font-size: 12.5px; color: var(--navy); }

/* ── Daftar ringkas (jatuh tempo / notifikasi) ──────────────────────────── */
.list-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px 16px; border-bottom: 1px solid var(--bdr); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.list-item:hover { background: var(--blt); } .list-item:last-child { border-bottom: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; background: var(--red); }
.dot.am { background: var(--amber); } .dot.sl { background: var(--sl2); } .dot.or { background: var(--orange); }
.li-main { flex: 1; min-width: 0; } .li-title { font-size: 12.5px; font-weight: 600; } .li-meta { font-size: 10.5px; color: var(--slate); }
.li-amt { font-size: 12px; font-weight: 700; white-space: nowrap; }
.mrows { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.mrow-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; gap: 8px; }
.pbar { height: 5px; background: var(--bdr); border-radius: 99px; overflow: hidden; }
.pfill { height: 100%; border-radius: 99px; background: var(--blue); }
.pfill.tl { background: var(--teal); } .pfill.am { background: var(--amber); } .pfill.rd { background: var(--red); }

/* ── Grafik ─────────────────────────────────────────────────────────────── */
.chart { padding: 10px 14px 4px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 16px 12px; font-size: 11px; color: var(--slate); }
.chart-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.bars { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.bar-grp { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 26px 1fr minmax(70px, auto); gap: 8px; align-items: center; font-size: 12px; }
.bar-track { height: 12px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }

/* ── Pager ──────────────────────────────────────────────────────────────── */
.pager { display: flex; align-items: center; gap: 3px; padding: 9px 16px; border-top: 1px solid var(--bdr); flex-wrap: wrap; }
.pg { min-width: 28px; height: 26px; padding: 0 8px; border-radius: var(--r-xs); border: 1px solid var(--bdr); background: var(--w); color: var(--slate); cursor: pointer; font-size: 11.5px; font-weight: 500; }
.pg.active, .pg:hover:not(:disabled) { background: var(--blue); color: var(--on-solid); border-color: var(--blue); }
.pg:disabled { opacity: .4; cursor: not-allowed; }
.pg-info { margin-left: auto; font-size: 11px; color: var(--slate); }
.card > .pager:only-child { border-top: 0; }
.pg-size { display: flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 11px; color: var(--slate); white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: 400; }
.pg-size .fc2 { width: auto; min-width: 64px; height: var(--ctl-h-sm); padding: 0 6px; font-size: 11.5px; }

/* ── Modal, toast, panel ────────────────────────────────────────────────── */
.ov { position: fixed; inset: 0; background: rgba(15,27,53,.42); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--w); border-radius: 12px; width: min(var(--mw, 520px), 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--sh-lg); }
.mhdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--bdr); gap: 8px; }
.mtitle { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.mx { background: none; border: none; font-size: 18px; color: var(--slate); cursor: pointer; width: 28px; height: 28px; border-radius: 4px; }
.mx:hover { color: var(--navy); background: var(--bg); }
.mbody { padding: 18px; overflow-y: auto; }
.mfoot { display: flex; justify-content: flex-end; gap: 7px; padding: 12px 18px; border-top: 1px solid var(--bdr); flex-wrap: wrap; }
.toast-wrap { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { background: var(--navy); color: var(--on-solid); padding: 10px 16px; border-radius: 8px; font-size: 12.5px; font-weight: 500; max-width: 340px; box-shadow: var(--sh-lg); animation: tin .2s ease; display: flex; gap: 8px; align-items: flex-start; }
.toast.ok { background: var(--green); } .toast.err { background: var(--red); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel { position: fixed; left: 14px; bottom: 62px; width: 420px; max-width: calc(100vw - 28px); background: var(--w); border: 1px solid var(--bdr); border-radius: 12px; box-shadow: 0 12px 40px rgba(15,27,53,.22); z-index: 1200; overflow: hidden; }
.panel-hdr { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--bdr); font-family: var(--font-display); font-size: 13px; font-weight: 700; }
.panel-list { max-height: min(420px, 55vh); overflow-y: auto; }

/* ── State kosong / loading / error ─────────────────────────────────────── */
.state { padding: 34px 16px; text-align: center; color: var(--slate); font-size: 12.5px; }
.state i.fa-solid { display: block; font-size: 26px; margin-bottom: 8px; color: var(--sl2); }
.state.err { color: var(--red); } .state.err i.fa-solid { color: var(--red); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--sl2); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--navy) 0%, var(--navy-2) 100%); padding: 16px; }
.login-card { background: var(--w); border-radius: 14px; padding: 30px 28px; width: min(380px, 100%); box-shadow: var(--sh-lg); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.login-brand .sb-ico { width: 40px; height: 40px; font-size: 13px; }
.login-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }

/* ── Matriks hak akses ──────────────────────────────────────────────────── */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; }
.perm-sec { border: 1px solid var(--bdr); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.perm-sec h4 { font-size: 12px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }

/* ── Laporan cetak (dipakai preview & jendela print) ────────────────────── */
.lap-doc { font-family: var(--font); color: var(--print-ink); }
.lap-titlebar { margin: 14px 0 12px; padding: 11px 14px; background: var(--navy); border-radius: 8px; color: var(--on-solid); }
.lap-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.lap-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.lap-chip { background: rgba(255,255,255,.14); border-radius: 5px; padding: 3px 9px; font-size: 10.5px; }
.lap-tbl { width: 100%; border-collapse: collapse; font-size: 10px; }
.lap-tbl th { background: var(--navy); color: var(--on-solid); font-weight: 600; text-align: left; padding: 6px 7px; font-size: 9.5px; text-transform: uppercase; border: 1px solid var(--navy); }
.lap-tbl td { padding: 5px 7px; border: 1px solid var(--print-line); vertical-align: top; }
.lap-tbl .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lap-tbl .sub td { border-top: 2px solid var(--navy); background: var(--print-sub); font-weight: 700; }
.lap-tbl .sub .giro { font-weight: 400; font-style: italic; color: var(--slate-2); font-size: 9.5px; }
.lap-tbl .grand td { background: var(--navy); color: var(--on-solid); font-weight: 700; }
.lap-tbl tbody.grp { break-inside: avoid; }
.cbox { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--slate); border-radius: 3px; }
.lap-foot { margin-top: 14px; padding-top: 9px; border-top: 1px solid var(--print-line); display: flex; justify-content: space-between; font-size: 9px; color: var(--slate); flex-wrap: wrap; gap: 6px; }

/* ── Responsif ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: 1fr 1fr; } .two-col { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 150; }
  .menu-btn { display: inline-flex; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .content { padding: 12px; }
  .topbar { padding: 0 10px; }
  .kpi-grid, .kpi-grid.c3 { grid-template-columns: 1fr; }
  .fr, .fr.s3 { grid-template-columns: 1fr; }
  .tb-r .btn-label { display: none; }
  .bc-cur { max-width: 160px; }
}
@media print { .sidebar, .topbar { display: none; } }

/* ── Input tanggal berformat sistem (S.enhanceDates): input bawaan [data-dx] disembunyikan, teks + tombol kalender ── */
input[type=date][data-dx] { position: absolute !important; opacity: 0 !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; pointer-events: none; }
input[data-dx-text] { padding-right: 34px; }
.dx-wrap { position: relative; display: block; min-width: 0; }
.dx-wrap > input { width: 100%; }
.dx-cal { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 28px; height: calc(var(--ctl-h) - 8px); border: 0; background: transparent; color: var(--slate); cursor: pointer; border-radius: var(--r-xs); }
.dx-cal:hover:not(:disabled) { color: var(--blue); background: var(--blt); }
.dx-cal:disabled { opacity: .4; cursor: not-allowed; }

/* ── Purchase Order: rincian barang & ringkasan diskon/PPN ── */
.po-lines td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.fc2.num { text-align: right; }
.po-foot { display: flex; gap: var(--sp-6); align-items: flex-start; flex-wrap: wrap; }
.po-notes { flex: 1; min-width: 260px; }
.po-sum-wrap, .po-foot > .po-sum { flex: 0 1 420px; min-width: 300px; }
.po-sum { width: 100%; }
.po-sum td { padding: 6px 8px; }
.po-sum td:first-child { white-space: nowrap; }
.po-sum td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.po-sum tr.po-total td { font-weight: 700; font-size: var(--fs-md); border-top: 2px solid var(--navy); background: var(--surface-2); }
