/* Daya Lintas — demo lokal. Tata letak mengikuti Stitch (sidebar 240, bilah atas 64, padding 20,
   gap kartu 12, gap panel 16, radius 12), warna & font mengikuti Brand Board (design-review.md). */
:root {
  --shell: #082C63; --shell-line: #1B3A73; --shell-muted: #97ABDA; --active: #0756BD; --net: #0E3A7A;
  --bg: #EAF7FF; --panel: #FFFFFF; --text: #082C63; --text-2: #434655; --line: #C4C5D7; --line-soft: #E3E8F2;
  --s1: #0756BD; --s2: #1C9AD6; --s3: #3E8E5A;
  --red: #BF0715; --red-bg: #FFDAD6; --red-tx: #93000B;
  --radius: 12px; --radius-sm: 8px; --t: 120ms;
  --font: "Aptos", "Segoe UI", system-ui, sans-serif; --font-h: "Aptos Display", "Aptos", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); }
h1, h2, h3 { font-family: var(--font-h); font-weight: 600; margin: 0; }
h1 { font-size: 24px; line-height: 32px; }
h2 { font-size: 16px; line-height: 24px; }
a { color: var(--active); }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--shell); color: #fff; border-right: 1px solid var(--shell-line); display: flex; flex-direction: column; gap: 24px; }
.brand { height: 64px; padding: 0 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--shell-line); }
.brand img { width: 36px; height: 36px; }
.brand .name { font-family: var(--font-h); font-weight: 600; font-size: 16px; line-height: 1.2; }
.brand .sub { font-size: 12px; color: var(--shell-muted); }
.nav { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px; border-radius: var(--radius-sm); color: var(--shell-muted); text-decoration: none; font-weight: 600; font-size: 14px; transition: background var(--t), color var(--t); }
.nav a:hover { background: var(--shell-line); color: #fff; }
.nav a[aria-current="page"] { background: var(--active); color: #fff; }
.net { margin: 0 12px 16px; padding: 14px; border-radius: var(--radius); background: var(--net); color: #fff; }
.net .big { font-family: var(--font-h); font-weight: 600; font-size: 16px; }
.net ul { list-style: none; margin: 8px 0; padding: 0; font-size: 12px; display: grid; gap: 2px; }
.net ul li { display: flex; justify-content: space-between; }
.net p { margin: 6px 0 0; font-size: 11px; color: #CFE0FF; }
.net .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--shell-muted); }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; background: var(--shell); color: #fff; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--shell-line); }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chip-demo { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--shell-line); color: #DCE8FF; white-space: nowrap; }
.tb-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--shell-line); background: transparent; color: #fff; cursor: pointer; }
.tb-btn:hover { background: var(--shell-line); }
.tb-select { min-height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--shell-line); background: var(--shell); color: #fff; padding: 0 10px; max-width: 240px; }
.tb-date { font-size: 13px; color: #DCE8FF; white-space: nowrap; }
.profile { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.profile .n { font-weight: 600; font-size: 13px; }
.profile .r { font-size: 12px; color: var(--shell-muted); }
.menu-btn { display: none; }
main { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-filter { display: none; width: 100%; }
.page-filter select { width: 100%; }

/* ---------- komponen ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line-soft); box-shadow: 0 1px 2px rgba(8,44,99,.06); text-decoration: none; color: var(--text); transition: box-shadow var(--t), border-color var(--t); min-height: 112px; }
a.kpi:hover { border-color: var(--active); box-shadow: 0 2px 8px rgba(7,86,189,.15); }
a.kpi:focus-visible, .nav a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--active); outline-offset: 2px; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .lbl { font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi .ic { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg); color: var(--active); display: grid; place-items: center; }
.kpi .val { font-family: var(--font-h); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi .hint { font-size: 12px; color: var(--text-2); }
.kpi.alert { border-left: 4px solid var(--red); }
.kpi.locked .val { font-size: 16px; color: var(--text-2); }
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(8,44,99,.06); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > header { padding: 14px 20px; }
.panel.danger > header { background: var(--red-bg); color: var(--red-tx); border-bottom: 1px solid #F5B8B1; }
.panel.flush > .body { padding: 0 20px 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; color: var(--text-2); font-weight: 600; background: #F6FAFF; }
td.wrap { white-space: normal; min-width: 180px; }
tbody tr:hover { background: #F6FAFF; }
tfoot td, tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; background: inherit; }
.table-wrap td:first-child { background: var(--panel); }
.table-wrap th:first-child { background: #F6FAFF; }
td a.cell-link { font-weight: 600; text-decoration: none; display: inline-block; min-width: 28px; }
td a.cell-link:hover { text-decoration: underline; }
.empty { padding: 16px; text-align: center; color: var(--text-2); border: 1px dashed var(--line); border-radius: var(--radius-sm); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.b-neutral { background: #E5EEFF; color: #434655; }
.b-progress { background: var(--bg); color: var(--active); }
.b-ok { background: #E6F2EA; color: #2F6B44; }
.b-bad { background: var(--red-bg); color: var(--red-tx); }
.b-warn { background: #FFDCC3; color: #2F1500; }
.b-branch { background: #F0F3F9; color: var(--text); }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 8px; font-size: 13px; }
.bar-track { display: flex; gap: 2px; height: 14px; background: #F0F3F9; border-radius: 4px; overflow: hidden; }
.bar-seg { height: 100%; border-radius: 0 4px 4px 0; min-width: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.list li:last-child { border-bottom: 0; }

/* ---------- tombol & form ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--active); background: var(--active); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; transition: background var(--t); }
.btn:hover { background: var(--shell); border-color: var(--shell); }
.btn.sec { background: #fff; color: var(--active); }
.btn.sec:hover { background: var(--bg); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.form { display: grid; gap: 14px; }
.form.cols { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; }
.field .req { color: var(--red); }
.field input, .field select, td input, td select { min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; background: #fff; }
td input, td select { min-height: 34px; }
.field .help { font-size: 12px; color: var(--text-2); }
.field .err { font-size: 12px; color: var(--red); }
.check { display: flex; gap: 8px; align-items: center; min-height: 40px; }
.check input { width: 18px; height: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions > input[type="search"], .actions > select { min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; background: #fff; }
.actions > input[type="search"] { min-width: 220px; flex: 1 1 220px; }
.banner { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.banner.bad { background: var(--red-bg); color: var(--red-tx); }
.banner.info { background: var(--bg); color: var(--text); border: 1px solid #CBE7FA; }
.banner.ok { background: #E6F2EA; color: #2F6B44; }
.banner.warn { background: #FFF6E0; color: #7A5200; border: 1px solid #F2D58A; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; min-height: 44px; font-weight: 600; color: var(--text-2); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--active); border-bottom-color: var(--active); }
.minis { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; }
.mini .lbl { font-size: 12px; font-weight: 600; color: var(--text-2); }
.mini .val { font-family: var(--font-h); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- kanban ---------- */
.board { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.col { background: #F4F8FD; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.col > header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 2px rgba(8,44,99,.05); }
.card h3 { font-size: 14px; line-height: 1.35; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); }
.card .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card select { min-height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 8px; background: #fff; }
.history { font-size: 12px; color: var(--text-2); margin: 0; padding-left: 16px; }

/* ---------- unduh ---------- */
.dl-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dl-card { display: flex; gap: 16px; align-items: flex-start; }
.dl-card .ic { width: 48px; height: 48px; border-radius: var(--radius-sm); background: #E6F2EA; color: #2F6B44; display: grid; place-items: center; flex: none; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line-soft); box-shadow: 0 8px 28px rgba(8,44,99,.10); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 40px; height: 40px; }
.login-brand .name { font-family: var(--font-h); font-weight: 600; font-size: 20px; }
.login-brand .tag { font-size: 12px; color: var(--text-2); }
.demo-accts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-accts button { min-height: 44px; }

/* ---------- modal & toast ---------- */
.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: 0 16px 48px rgba(8,44,99,.25); color: var(--text); }
.modal::backdrop { background: rgba(8,44,99,.35); }
.modal .m-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
.modal .m-body { padding: 20px; }
.toasts { position: fixed; top: 76px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--shell); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: 0 6px 20px rgba(8,44,99,.25); max-width: 360px; font-size: 13px; }
.toast.bad { background: var(--red-tx); }
.scrim { display: none; }

/* ---------- responsif (breakpoint mengikuti ZIP) ---------- */
@media (max-width: 1279px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3, .board { grid-template-columns: 1fr; }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-btn { display: inline-flex; }
  .sidebar { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform 160ms; overflow-y: auto; }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(8,44,99,.35); z-index: 30; }
}
@media (max-width: 767px) {
  .hide-md, .tb-select { display: none; }
  .page-filter { display: block; }
  .dl-grid { grid-template-columns: 1fr; }
  .dl-card .btn { width: 100%; }
  .field input, .field select { min-height: 44px; }
  .chip-demo { display: none; }
  /* QA-08: semua tab terlihat di layar sempit (bungkus ke baris berikutnya, tanpa gulir tersembunyi) */
  .tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
  .tabs button { padding: 10px 12px; }
}
@media (max-width: 639px) {
  .kpis { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  main { padding: 16px; }
  .topbar { padding: 0 12px; }
}
/* QA-13: ringkasan konfirmasi Manajemen Akses — teks panjang dibungkus; di layar sempit tiap field bertumpuk tanpa gulir samping */
.confirm-wrap { overflow-x: visible; }
.confirm-table td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.confirm-table td.c-field, .confirm-table td.c-arrow { white-space: nowrap; }
@media (max-width: 559px) {
  .confirm-table thead { display: none; }
  .confirm-table, .confirm-table tbody, .confirm-table tr, .confirm-table td { display: block; width: 100%; }
  .confirm-table tr { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .table-wrap.confirm-wrap .confirm-table td { border: 0; padding: 2px 0; position: static; background: transparent; }
  .confirm-table td.c-field { font-weight: 600; color: var(--text-2); font-size: 12px; }
  .confirm-table td.c-arrow { display: none; }
  .confirm-table td[data-label]::before { content: attr(data-label) ": "; color: var(--text-2); font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
