/* Layout: navy command bar (brand + tabs) → nota prototype → view aktif. Dashboard: tiles dahulu, kemudian panel 2 lajur; Client 360: profil → journey → tiles → 2 lajur panel */
:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #e9edf5; --line: #d9dfea;
  --ink: #0d1a38; --ink-2: #47536e; --muted: #687490;
  --head: #0b1f4d; --head-ink: #ffffff; --head-ink-2: #b8c3de; --gold: #f2c200; --gold-soft: #fff3c4;
  --accent: #0b1f4d; --accent-ink: #ffffff; --link: #1f4fc8;
  --bar: #2a78d6; --bar-soft: #9ec5f4; --renew: #b77d00; --pos: #2a78d6; --neg: #e34948;
  --cat1: #2a78d6; --cat2: #eb6834; --cat3: #1baf7a;
  --good: #0ca30c; --warn: #fab219; --crit: #d03b3b; --none: #a3abbd;
  --font-display: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1022; --surface: #111a31; --surface-2: #1a2541; --line: #27334f;
    --ink: #e8ecf5; --ink-2: #b0b9cf; --muted: #8590aa;
    --head: #0d1d45; --head-ink: #ffffff; --head-ink-2: #aebadb; --gold: #f5c816; --gold-soft: #2e2913;
    --accent: #f5c816; --accent-ink: #0b1f4d; --link: #8fb2ff;
    --bar: #3987e5; --bar-soft: #1c5cab; --renew: #f5c816; --pos: #3987e5; --neg: #e66767; --none: #5d6782;
    --cat1: #3987e5; --cat2: #d95926; --cat3: #199e70;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1022; --surface: #111a31; --surface-2: #1a2541; --line: #27334f;
  --ink: #e8ecf5; --ink-2: #b0b9cf; --muted: #8590aa;
  --head: #0d1d45; --head-ink: #ffffff; --head-ink-2: #aebadb; --gold: #f5c816; --gold-soft: #2e2913;
  --accent: #f5c816; --accent-ink: #0b1f4d; --link: #8fb2ff;
  --bar: #3987e5; --bar-soft: #1c5cab; --renew: #f5c816; --pos: #3987e5; --neg: #e66767; --none: #5d6782;
  --cat1: #3987e5; --cat2: #d95926; --cat3: #199e70;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1240px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; }

/* Command bar */
.top { background: var(--head); color: var(--head-ink); }
.top-in { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; padding-block: 18px 0; }
.brandline { display: flex; gap: 14px; align-items: center; padding-bottom: 14px; }
.mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--gold); color: #0b1f4d; font-family: var(--font-display); font-weight: 800; font-size: 16px; border-radius: 6px; transform: skewX(-8deg); flex: none; }
.brandline h1 { font-size: 22px; font-weight: 800; color: var(--head-ink); }
.brandline p { color: var(--head-ink-2); font-size: 13px; margin-top: 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tabs button { appearance: none; border: 0; background: none; color: var(--head-ink-2); font-weight: 600; font-size: 14px; padding: 11px 13px 13px; border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button:hover { color: var(--head-ink); }
.tabs button[aria-selected="true"] { color: var(--head-ink); border-bottom-color: var(--gold); }
.tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.demo { background: var(--gold-soft); color: var(--ink); font-size: 13.5px; }
.demo .wrap { padding-block: 9px; }

main.wrap { padding-block: 24px 64px; }
.view { display: grid; gap: 18px; }
[hidden] { display: none !important; } /* tab tersembunyi kekal tersembunyi walaupun ada display: grid */

/* Shared pieces */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; min-width: 0; }
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.panel h3 small { font: 400 12.5px var(--font-body); color: var(--muted); letter-spacing: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
.bar-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.asof { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer; }
.chip span { font-weight: 500; color: var(--muted); margin-left: 2px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .75; }
.chip:focus-visible, .lnk:focus-visible, .btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.lnk { background: none; border: 0; padding: 0; color: var(--link); font-weight: 600; cursor: pointer; text-align: left; }
.lnk:hover { text-decoration: underline; }
.lnk.more { margin-top: 10px; font-size: 13.5px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 6px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.empty { color: var(--muted); font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend.top { margin: 0 0 8px; }
.legend span, .t-legend span, .cs-nums span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--bar); }
.sw.soft { background: var(--bar-soft); } .sw.base { background: var(--none); } .sw.renew { background: var(--renew); }
.sw.miss { background: transparent; border: 1.5px dashed var(--muted); }
.sw.pos { background: var(--pos); } .sw.neg { background: var(--neg); }
.be-key { display: inline-block; width: 16px; border-top: 2px dashed var(--ink-2); }
.cat1 { --c: var(--cat1); } .cat2 { --c: var(--cat2); } .cat3 { --c: var(--cat3); }
.sw.cat1, .sw.cat2, .sw.cat3 { background: var(--c); }
.good { --c: var(--good); } .warn { --c: var(--warn); } .crit { --c: var(--crit); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--c) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.flag { display: inline-block; font-size: 11.5px; line-height: 1.5; padding: 0 7px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; margin: 1px 0; }
.flag.caution { border-color: color-mix(in srgb, var(--warn) 70%, transparent); }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.field em.warn-t { color: var(--crit); font-weight: 600; }
.field.inline { display: flex; align-items: center; gap: 8px; }
input, select, textarea { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 14px; font-weight: 400; }
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--link); outline-offset: 0; border-color: transparent; }
.t-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Framework */
.fw-lead { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.fw-lead h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; line-height: 1.15; margin-bottom: 12px; }
.fw-lead p.lede { font-size: 16.5px; color: var(--ink-2); max-width: 62ch; }
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.principles li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.principles b { display: block; color: var(--ink); font-size: 14.5px; }
.sec { display: grid; gap: 14px; margin-top: 18px; }
.sec-head { display: grid; gap: 4px; }
.sec-head h2 { font-size: 20px; font-weight: 800; }
.sec-head p { color: var(--ink-2); max-width: 75ch; font-size: 14.5px; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 26px; }
.flow li { position: relative; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 8px; padding: 14px 14px 16px; display: grid; gap: 8px; align-content: start; }
.flow li.gate { border-top-color: var(--gold); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 60%, transparent); }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -21px; top: 46%; color: var(--muted); font-size: 18px; }
.step-no { justify-self: start; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 13px var(--font-display); }
.flow h4 { font-size: 15.5px; font-weight: 800; }
.flow p { font-size: 13.5px; color: var(--ink-2); }
.flow .io { display: flex; flex-wrap: wrap; gap: 4px; }
.cadence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cadence div { border-left: 3px solid var(--gold); padding: 2px 0 2px 12px; font-size: 13.5px; color: var(--ink-2); }
.cadence b { display: block; color: var(--ink); font-size: 14px; }
.entities { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.entity { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 6px; align-content: start; }
.entity h4 { font-size: 15px; font-weight: 800; }
.entity .rel { font-size: 12px; color: var(--muted); font-weight: 600; }
.entity ul { margin: 0; padding-left: 16px; font-size: 13px; color: var(--ink-2); display: grid; gap: 2px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl.rules td:first-child { width: 130px; }
.tbl.wide { min-width: 640px; }
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: ph; }
.phases li { counter-increment: ph; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 6px; align-content: start; }
.phases li::before { content: "Fasa " counter(ph); font: 800 12px var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.phases li.now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.phases b { color: var(--ink); font-size: 14.5px; }
.qs { margin: 0; padding: 0; list-style: none; counter-reset: q; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.qs li { counter-increment: q; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.qs li::before { content: "S" counter(q); font: 800 14px var(--font-display); color: var(--ink); }
.qs b { color: var(--ink); }
.qs.open li::before { content: "T" counter(q); }
.tbl.decide td:first-child { width: 48px; font: 800 14px var(--font-display); }
.tbl.decide td:nth-child(2) { width: 150px; font-weight: 600; }
.arch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.arch div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 6px; align-content: start; }
.arch h4 { font-size: 15px; font-weight: 800; color: var(--ink); }
.phases li.done { opacity: .7; }
.phases li.done::before { content: "Fasa " counter(ph) " · siap"; }
.note-box { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); }

/* Overview */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.tile.alert { border-left: 4px solid var(--crit); }
.tile.caution { border-left: 4px solid var(--warn); }
.t-value { font: 800 24px/1.15 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.t-sub { font-size: 12.5px; color: var(--ink-2); }
.t-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--ink-2); }
.stack { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; margin-block: 6px 2px; }
.stack.big { height: 18px; margin: 0; }
.seg { background: var(--c); min-width: 4px; }
.csrow { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.csrow:last-child { border-bottom: 0; }
.cs-name { display: grid; } .cs-name b { font-family: var(--font-display); font-size: 15px; } .cs-name span { font-size: 12.5px; color: var(--muted); }
.cs-nums { grid-column: 2; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--ink-2); }
.hist { display: flex; gap: 4px; height: 150px; align-items: flex-end; padding-top: 18px; }
.hcol { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; min-width: 0; }
.hbar { width: 100%; background: var(--bar); border-radius: 4px 4px 0 0; }
.hbar.renew { background: var(--renew); }
.hval { position: absolute; left: 0; right: 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--ink-2); transform: translateY(-3px); }
.hx { display: flex; gap: 4px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 4px; }
.hx span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: grid; gap: 2px; padding-block: 9px; border-bottom: 1px solid var(--line); font-size: 14px; }
.attn li:last-child { border-bottom: 0; }
.attn .why { font-size: 13px; color: var(--ink-2); }
.report { margin: 0; white-space: pre-wrap; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 8px; padding: 12px 14px; color: var(--ink); overflow-wrap: anywhere; }

/* Portfolio */
.pf-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.pf-tools .field { width: 170px; }
.pf-tools .field.grow { width: 220px; }
.count { font-size: 13px; color: var(--muted); }
#pf-table { min-width: 1080px; }
.mini { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.mini .m-track { flex: 1; }

/* Client 360 */
.c-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; align-items: flex-start; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.c-id h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; line-height: 1.1; margin: 4px 0 6px; }
.meta { font-size: 14px; color: var(--ink-2); }
.c-status { display: grid; gap: 8px; justify-items: start; }
.c-status select { width: auto; }
.journey { display: grid; gap: 6px; }
.jbar { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.jbar span { height: 10px; border-radius: 2px; background: var(--surface-2); }
.jbar .done { background: var(--bar-soft); }
.jbar .now { background: var(--gold); box-shadow: 0 0 0 1px var(--ink-2); }
.why-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: grid; gap: 6px; }
.why-box ul { margin: 0; padding-left: 18px; font-size: 14px; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; }
.c-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.c-col { display: grid; gap: 18px; min-width: 0; }
.cols { padding-left: 42px; padding-top: 16px; }
.cols.bare { padding-left: 0; }
.plot { position: relative; height: 170px; }
.plot.short { height: 120px; }
.gl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.gl span { position: absolute; right: calc(100% + 6px); top: -8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 4px; }
.col { flex: 1; height: 100%; position: relative; display: flex; align-items: flex-end; min-width: 0; }
.bar { width: 100%; background: var(--bar-soft); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.last { background: var(--bar); }
.bar.base { background: var(--none); }
.bar.missing { height: 28%; background: transparent; border: 1.5px dashed var(--muted); border-bottom: 0; }
.vlabel { position: absolute; right: 0; transform: translateY(-4px); font-size: 11.5px; font-weight: 700; white-space: nowrap; color: var(--ink); }
.xs { display: flex; gap: 4px; margin-top: 6px; }
.xs span { flex: 1; min-width: 0; text-align: center; font-size: 10.5px; color: var(--muted); overflow: hidden; }
.zero { position: absolute; left: 0; right: 0; border-top: 1.5px solid var(--ink-2); z-index: 1; }
.dbar { position: absolute; left: 0; right: 0; border-radius: 3px; }
.dbar.pos { background: var(--pos); } .dbar.neg { background: var(--neg); }
.kv { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 14px; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.kv b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding-block: 7px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.meter-row:last-child { border-bottom: 0; }
.m-track { position: relative; height: 10px; background: var(--surface-2); border-radius: 5px; }
.m-fill { position: absolute; inset: 0 auto 0 0; background: var(--bar); border-radius: 5px; }
.be { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink-2); z-index: 1; }
.be span { position: absolute; left: 4px; top: -18px; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--surface); padding: 0 4px; border-radius: 3px; }
.chan { display: grid; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.chan .legend { margin-top: 0; }
.chan .legend b { font-variant-numeric: tabular-nums; }
#v-client .note { margin-bottom: 6px; }
.m-num { text-align: right; font-weight: 600; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding-block: 9px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tl li:last-child { border-bottom: 0; }
.tl-date { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.tl-head { font-size: 12.5px; margin-bottom: 2px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 0 7px; border-radius: 4px; background: var(--surface-2); color: var(--ink); }
.ap { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ap li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.ap-st { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line); text-align: center; color: var(--ink-2); }
.ap-st.done { background: color-mix(in srgb, var(--good) 15%, var(--surface)); color: var(--ink); }
.ap-st.prog { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--ink); }

/* Dump */
.dump-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
#dp-form { display: grid; gap: 12px; }
#dp-form h3 { margin-bottom: 0; }
#dp-text { font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.fields { display: grid; gap: 12px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.note { font-size: 12.5px; color: var(--muted); }
.err { color: var(--crit); font-weight: 600; font-size: 13.5px; margin-top: 10px; }
.saved { display: grid; gap: 8px; font-size: 14.5px; }

#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.4; padding: 6px 9px; border-radius: 6px; max-width: 280px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entities, .arch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cadence { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .flow li:not(:last-child)::after { content: "↓"; right: auto; left: 22px; top: auto; bottom: -24px; }
}
@media (max-width: 900px) {
  .grid-2, .c-grid, .dump-grid, .fw-lead { grid-template-columns: minmax(0, 1fr); }
  .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .tiles, .entities, .arch, .phases, .cadence, .row2 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csrow { grid-template-columns: minmax(0, 1fr); }
  .cs-nums { grid-column: 1; }
  .pf-tools .field, .pf-tools .field.grow { width: 100%; }
  .pf-tools { width: 100%; }
}
/* v0.3: data sebenar + Database */
#hdr-count:empty { display: none; }
.banner { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 12px 16px; font-size: 14.5px; margin-bottom: 18px; }
.view.blocked { display: none !important; }
.none { --c: var(--none); }
.dot.none { background: var(--none); }
.sub-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.sub-pill.ok { color: var(--ink); background: color-mix(in srgb, var(--good) 14%, var(--surface)); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.sub-pill.hold { color: var(--ink); background: color-mix(in srgb, var(--warn) 18%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.m-name small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.links a { color: var(--link); font-weight: 600; }
.be-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.be-form .field { width: 170px; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding-block: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.people li:last-child { border-bottom: 0; }
.people small { display: block; color: var(--muted); font-size: 12px; }
.th-sort { appearance: none; border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; } .th-sort:hover, .th-sort:focus-visible, .th-sort.on { color: var(--ink); }
.db-pick { font-size: 12.5px; padding: 3px 6px; width: auto; min-width: 92px; max-width: 150px; }
.db-cell, .db-cell-edit { display: inline-flex; align-items: center; gap: 5px; } .db-tempoh { display: grid; gap: 4px; min-width: 150px; }
.db-pen { appearance: none; border: 0; background: none; color: var(--muted); padding: 3px; border-radius: 4px; line-height: 0; cursor: pointer; flex: none; } .db-pen:hover, .db-pen:focus-visible { color: var(--ink); background: var(--surface-2); }
.db-tempoh label { display: grid; font-size: 11.5px; color: var(--muted); } .db-tempoh input { font-size: 12.5px; padding: 3px 6px; }
.field.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.field.check input { width: auto; }
.ed-head { display: grid; gap: 4px; margin-bottom: 14px; justify-items: start; }
.ed-head h3 { font-size: 20px; margin: 4px 0 0; }
.ed-form { display: grid; gap: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; margin: 0; min-width: 0; }
legend { font: 800 14px var(--font-display); padding: 0 6px; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.span2 { grid-column: span 2; }
.slotgrp { padding-block: 10px; border-bottom: 1px solid var(--line); }
.slotgrp:last-child { border-bottom: 0; }
.slot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.slots input { font-size: 13px; padding: 6px 8px; }
.qin { width: 72px; padding: 5px 6px; text-align: right; }
.ed-actions { position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); padding-block: 12px; border-top: 1px solid var(--line); z-index: 2; align-items: center; }
details.panel summary { cursor: pointer; }
details.panel[open] summary { margin-bottom: 12px; }
.table-wrap.pk { border: 0; }
.warn-note { border-left: 4px solid var(--warn); }
.note.warn-note { padding: 2px 0 2px 10px; margin: 0 0 10px; color: var(--ink-2); }
.small { font-size: 12.5px; }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.files img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--surface); }
.files span { overflow-wrap: anywhere; }
.thinking { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; }
.spin { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .9s linear infinite; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.sl { display: grid; gap: 6px; }
.slrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.slrow em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--ink-2); }
#toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 60; width: max-content; max-width: min(92vw, 520px); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
#toast.bad { background: var(--crit); color: #fff; }
@media (max-width: 900px) { .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .fgrid { grid-template-columns: minmax(0, 1fr); } .span2 { grid-column: auto; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .spin { animation-duration: 3s; } }
#dp-queue { margin-bottom: 18px; }
#dp-queue small.muted { display: block; }
details.tr { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface-2); }
details.tr summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
details.tr ul { list-style: none; margin: 10px 0 2px; padding: 0; display: grid; gap: 10px; max-height: 340px; overflow: auto; font-size: 13.5px; }
/* Action plan director */
.plan-obj { font-size: 13.5px; color: var(--ink-2); margin: 0 0 10px; }
.meter-row.plan-m { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 6px; }
.pr { padding-block: 10px; border-top: 1px solid var(--line); }
.pr-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; margin-bottom: 6px; }
.pr-head .muted { font-size: 12.5px; }
.pr.carried .pr-head b { color: var(--ink-2); }
.pis { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pi { display: grid; grid-template-columns: 146px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13.5px; }
.pst-wrap { display: inline-flex; align-items: center; gap: 8px; }
.pst-wrap select.pst { width: 124px; }
.pdot { width: 13px; height: 13px; border-radius: 50%; flex: none; border: 1.5px solid transparent; }
.pdot.todo { background: #fff; border-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.pdot.doing { background: var(--warn); }
.pdot.done { background: var(--good); }
.pdot.drop { background: var(--crit); }
.pi small { display: block; color: var(--muted); font-size: 12px; }
.pi.good > span { color: var(--ink-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--good) 60%, transparent); }
select.pst { font-size: 12.5px; padding: 3px 6px; border-radius: 6px; }
.pi.none select.pst { background: var(--surface-2); }
.pi.warn select.pst { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); }
.pi.good select.pst { background: color-mix(in srgb, var(--good) 18%, var(--surface)); }
details.plan-old { margin-top: 10px; font-size: 13.5px; }
details.plan-old summary, details.tp-log summary { cursor: pointer; }
details.plan-old ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.dp-plan { margin-top: 14px; display: grid; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.dplan .field.check { align-items: flex-start; }
.dplan .field.check input { margin-top: 3px; }
.dplan small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.pu { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.dp-prs { margin: 8px 0 0; padding-left: 18px; font-size: 13px; display: grid; gap: 6px; }
.dp-prs ul { margin: 2px 0 0; padding-left: 16px; }
@media (max-width: 640px) { .pi { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.pi.drop > span { color: var(--muted); text-decoration: line-through; }
.pi.drop select.pst { background: transparent; color: var(--muted); }
.plan-pend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 12px; margin-bottom: 12px; border-radius: 8px; border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); font-size: 13.5px; }
/* Tab profil client */
.ctabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 4px; }
.ctabs button { appearance: none; border: 0; background: none; color: var(--ink-2); font: 600 14px var(--font-body, inherit); padding: 10px 14px 11px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.ctabs button small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.ctabs button:hover { color: var(--ink); }
.ctabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.ctabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.ctab-body { display: grid; gap: 18px; }
/* Cashflow */
.cf-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin-bottom: 12px; }
.cf-bar .field { width: 140px; }
.cf-bar .note { flex: 1 1 280px; margin: 0; }
.cf-tbl { min-width: 1080px; font-size: 13px; }
.cf-tbl th:first-child, .cf-tbl td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 150px; text-align: left; }
.cf-tbl tbody th { font-weight: 600; white-space: nowrap; cursor: help; }
.cf-tbl td { padding: 3px 4px; }
.cfi { width: 100%; min-width: 64px; text-align: right; font: 13px/1.3 inherit; padding: 4px 6px; font-variant-numeric: tabular-nums; }
.cfi:disabled { background: transparent; border-color: transparent; }
.cfi::placeholder { color: var(--muted); font-style: italic; }
.cf-tbl tbody th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.cf-grp th, .cf-grp td { background: var(--surface-2) !important; font: 800 12px var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); padding-block: 6px; }
.cf-calc td, .cf-calc th { font-weight: 600; }
.cf-net td, .cf-close td { font-weight: 700; }
.cf-close th, .cf-close td { border-top: 2px solid var(--line); }
.cf-future { color: var(--muted); }
.cf-now { color: var(--ink); }
.cf-paste { margin-top: 14px; }
.cf-paste summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.cf-paste[open] { display: grid; gap: 10px; }
.cf-mini { font-size: 13px; }
.cf-mini td, .cf-mini th { padding: 4px 8px; }
/* Cashflow: paparan ikut HB Strategist */
.cf-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.cf-top .field { width: 140px; }
.cf-h { display: flex; align-items: center; gap: 8px; font: 800 14px var(--font-display); letter-spacing: .03em; text-transform: uppercase; margin: 0 0 12px; color: var(--ink); }
.cf-ico { font-weight: 800; font-size: 15px; }
.cf-ico.in { color: var(--good); }
.cf-ico.out { color: var(--crit); }
.cf-ico.pb { color: var(--link); }
.cf-ico.cs { color: var(--ink-2); }
.cf-view { min-width: 1180px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cf-view thead th { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cf-view th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 210px; text-align: left; }
.cf-view tbody th { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--ink); }
.cf-view td { white-space: nowrap; }
.cf-view .cf-sum { background: var(--surface-2); font-weight: 600; }
.cf-view td.pos { color: var(--good); }
.cf-view td.neg { color: var(--crit); }
.cf-view td.cf-nil { color: var(--muted); }
.cf-open th, .cf-open td { background: color-mix(in srgb, var(--link) 7%, var(--surface)) !important; color: var(--ink-2) !important; }
.cf-indent th { padding-left: 26px; color: var(--ink-2) !important; }
.cf-total th, .cf-total td { font-weight: 700 !important; color: var(--ink) !important; }
.cf-total.in th, .cf-total.in td { background: color-mix(in srgb, var(--good) 13%, var(--surface)) !important; }
.cf-total.out th, .cf-total.out td { background: color-mix(in srgb, var(--crit) 11%, var(--surface)) !important; }
.cf-view { table-layout: fixed; }
.cf-view thead th:nth-child(1) { width: 230px; }
.cf-view thead th:nth-child(2) { width: 120px; }
.cf-view { min-width: 1460px; }
.cf-view td, .cf-view th { padding-inline: 9px; }
/* Garis menegak antara kolum supaya angka setiap bulan tak bercantum */
.cf-view :is(th, td) + :is(th, td), .cf-tbl :is(th, td) + :is(th, td), .cf-mini :is(th, td) + :is(th, td) { border-left: 1px solid var(--line); }
.cf-view .cf-sum + td, .cf-view .cf-sum + th { border-left-color: color-mix(in srgb, var(--ink-2) 35%, transparent); }
/* Cashflow mod edit: kotak sama macam paparan, sel jadi input */
.cf-editing td.cf-in { padding: 3px 4px; }
.cf-editing .cfi { width: 100%; min-width: 0; }
.cf-item { display: flex; align-items: center; gap: 4px; }
.cfl { flex: 1; min-width: 0; font: 500 13px var(--font-body, inherit); padding: 4px 6px; }
.cf-rm { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; width: 26px; height: 26px; line-height: 1; font-size: 16px; cursor: pointer; flex: none; }
.cf-rm:hover { color: var(--crit); border-color: var(--crit); }
.cf-addrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.cf-addrow .note { margin: 0; }
.cf-top .actions { margin: 0; }
.cf-view .cf-indent th { padding-left: 26px; }

/* Menu sisi (main.js renderNav): tab utama di kiri, boleh dibuka dan disorok. Skrin lebar: kandungan beralih ke kanan;
   skrin kecil: menu terapung di atas kandungan dengan latar gelap */
:root { --side-w: 236px; }
body { transition: padding-left .2s ease; }
.side { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); z-index: 60; overflow-y: auto; background: var(--head); color: var(--head-ink); padding: 18px 10px 28px;
  border-right: 1px solid color-mix(in srgb, var(--head-ink) 12%, transparent); transform: translateX(-100%); transition: transform .2s ease; visibility: hidden; }
body.nav-open .side { transform: none; visibility: visible; }
.side-grp + .side-grp { margin-top: 2px; }
.side-it { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 0; background: none; color: var(--head-ink-2); font-weight: 600; font-size: 14px; text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.side-it:hover { color: var(--head-ink); background: color-mix(in srgb, var(--head-ink) 8%, transparent); }
.side-it.on { color: var(--head-ink); background: color-mix(in srgb, var(--gold) 16%, transparent); box-shadow: inset 3px 0 0 var(--gold); }
.side-car { flex: none; transition: transform .15s ease; } .side-it[aria-expanded="true"] .side-car { transform: rotate(90deg); }
.side-sub { display: grid; gap: 1px; margin: 2px 0 8px 14px; padding-left: 10px; border-left: 1px solid color-mix(in srgb, var(--head-ink) 20%, transparent); }
.side-sit { border: 0; background: none; color: var(--head-ink-2); font-size: 13.5px; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.side-sit:hover { color: var(--head-ink); background: color-mix(in srgb, var(--head-ink) 8%, transparent); }
.side-sit.on { color: var(--head-ink); font-weight: 700; background: color-mix(in srgb, var(--head-ink) 12%, transparent); }
.side-it:focus-visible, .side-sit:focus-visible, .nav-tog:focus-visible, .side-x:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.side-back { position: fixed; inset: 0; z-index: 55; background: rgba(5, 10, 25, .5); }
/* Logo, nama sistem dan nota versi dalam menu sisi (Zul, 13 Nov 2026); kandungan penuh skrin dengan bar tajuk ringkas */
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 14px 6px; margin-bottom: 10px; border-bottom: 1px solid color-mix(in srgb, var(--head-ink) 14%, transparent); }
.side-name { display: grid; gap: 1px; min-width: 0; flex: 1; } .side-name b { font: 800 17px var(--font-display); color: var(--head-ink); }
.side-name small { font-size: 11.5px; line-height: 1.35; color: var(--head-ink-2); }
/* Logo Hasbul Brothers (teks putih, menu sisi sentiasa biru gelap) dengan nama sistem HB CONNECT di bawahnya */
.side-logo { display: block; width: 156px; height: auto; margin-bottom: 8px; }
.side-name b { letter-spacing: .1em; }
.side-x { display: grid; place-items: center; width: 30px; height: 30px; flex: none; align-self: flex-start; border: 0; border-radius: 6px; background: none; color: var(--head-ink-2); cursor: pointer; }
.side-x:hover { color: var(--head-ink); background: color-mix(in srgb, var(--head-ink) 10%, transparent); }
.side-foot { margin: 18px 6px 0; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45; color: var(--head-ink-2); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.side-foot b { color: var(--head-ink); }
.pagebar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pagetitle { font: 800 20px/1.2 var(--font-display); color: var(--ink); }
.nav-tog { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
.nav-tog:hover { background: var(--surface-2); }
main.wrap { max-width: none; padding-top: 16px; }
@media (min-width: 1000px) { body.nav-open { padding-left: var(--side-w); } }
@media (prefers-reduced-motion: reduce) { body, .side, .side-car { transition: none; } }
