/* Finance design system ---------------------------------------------------------------
   Tokens (light + dark), layout, components, motion. No build step.
   Contrast: text/muted on surface >= 4.5:1 in both themes (WCAG AA).
   Motion: disabled under prefers-reduced-motion and when <html data-motion="reduce">. */

@font-face { font-family: "Geist"; src: url("../vendor/geist-1.7.2/Geist-Variable.dfa48d5a8537.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../vendor/geist-1.7.2/GeistMono-Variable.308360d8a547.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* Colour tokens: exactly the reference design (docs/desain/*.dc.html), light and dark. */
:root {
  color-scheme: light;
  --bg: #F5F6FA; --surface: #FFFFFF; --surface2: #EEF0F6; --border: #E2E5EE;
  --text: #0E1428; --muted: #5A6377;
  --accent: #3451C6; --accent-soft: #E6EAFB; --accent-ink: #FFFFFF;
  --ok: #0F7A5C; --ok-soft: #E1F3EC;
  --warn: #9A4D07; --warn-soft: #FCEFDD;
  --danger: #B42318; --danger-soft: #FDE8E6;
  --info: #2A6FD6; --info-soft: #E6EFFD;
  --chart2: #A9B7F0; --lane: #FAFBFD;
  --shadow: 0 1px 2px rgba(13,27,42,.05), 0 10px 28px rgba(13,27,42,.06);
  --violet: #6B4FD8; --violet-soft: #EFEAFD;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0E1C; --surface: #111729; --surface2: #182036; --border: #263050;
  --text: #E7EAF4; --muted: #96A0BA;
  --accent: #8FA6FF; --accent-soft: #1A2448; --accent-ink: #0A0E1C;
  --ok: #3DD9A4; --ok-soft: #0F2E27;
  --warn: #F5A524; --warn-soft: #33250D;
  --danger: #FF7A6E; --danger-soft: #3A1715;
  --info: #7CB3FF; --info-soft: #14233D;
  --chart2: #3B4C8C; --lane: #0D1222;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.35);
  --violet: #B49CFF; --violet-soft: #1F1838;
}
/* No saved choice ("Ikuti sistem"): follow the device. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0A0E1C; --surface: #111729; --surface2: #182036; --border: #263050;
    --text: #E7EAF4; --muted: #96A0BA;
    --accent: #8FA6FF; --accent-soft: #1A2448; --accent-ink: #0A0E1C;
  --ok: #3DD9A4; --ok-soft: #0F2E27;
    --warn: #F5A524; --warn-soft: #33250D;
    --danger: #FF7A6E; --danger-soft: #3A1715;
    --info: #7CB3FF; --info-soft: #14233D;
    --chart2: #3B4C8C; --lane: #0D1222;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px rgba(0,0,0,.35);
    --violet: #B49CFF; --violet-soft: #1F1838;
  }
}

/* Component aliases (older names) derived from the reference tokens, plus layout scale. */
:root {
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --surface-2: var(--surface2);
  --surface-3: color-mix(in srgb, var(--surface2) 70%, var(--border));
  --border-strong: color-mix(in srgb, var(--border) 65%, var(--muted));
  --text-2: color-mix(in srgb, var(--text) 82%, var(--muted));
  --primary: var(--accent); --primary-soft: var(--accent-soft); --primary-text: var(--accent-ink);
  --primary-hover: color-mix(in srgb, var(--accent) 85%, var(--text));
  --success: var(--ok); --success-soft: var(--ok-soft);
  --warning: var(--warn); --warning-soft: var(--warn-soft);
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --shadow-xs: var(--shadow); --shadow-sm: var(--shadow);
  --shadow-md: var(--shadow), 0 16px 40px -12px color-mix(in srgb, var(--text) 18%, transparent);
  --shadow-lg: var(--shadow), 0 30px 70px -20px color-mix(in srgb, var(--text) 30%, transparent);
  --glow: none;

  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --sidebar: 232px; --sidebar-collapsed: 68px; --topbar: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 120ms; --t: 200ms; --t-slow: 420ms;
}

/* Base -------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 14.5px/1.55 var(--font); color: var(--text); background: var(--bg);
  font-feature-settings: "cv11", "ss01", "tnum" 0; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: 1.25; letter-spacing: -.012em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; margin-top: var(--s-6); }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 var(--s-3); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.ok { color: var(--success); } .error { color: var(--danger); } .warn { color: var(--warning); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r); box-shadow: var(--shadow-md); }
.skip-link:focus { left: 8px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }
kbd { font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); color: var(--text-2); }

/* App shell ---------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; transition: grid-template-columns var(--t-slow) var(--ease); }
.shell[data-collapsed="true"] { grid-template-columns: var(--sidebar-collapsed) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-3); background: var(--surface); border-right: 1px solid var(--border); overflow: hidden;
  view-transition-name: sidebar;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px; color: var(--text); font-weight: 700; white-space: nowrap; }
.sidebar .brand img { height: 28px; width: auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px;
  background: linear-gradient(135deg, #3d8bff, #1d64d8 55%, #6440c8); box-shadow: 0 6px 16px -6px #1d64d8; flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: var(--s-2); }
.nav-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: var(--s-3) 10px var(--s-1); white-space: nowrap; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: var(--r);
  color: var(--text-2); font-weight: 520; white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:active { transform: scale(.98); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--primary); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.nav a[aria-current="page"] .count { background: var(--primary); color: var(--primary-text); }
.shell[data-collapsed="true"] .nav a span, .shell[data-collapsed="true"] .nav-label,
.shell[data-collapsed="true"] .brand .brand-text, .shell[data-collapsed="true"] .sidebar-foot span,
.shell[data-collapsed="true"] .nav .count { opacity: 0; pointer-events: none; }
.nav a span, .nav-label, .brand-text { transition: opacity var(--t) var(--ease); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-6); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.topbar .crumbs strong { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; min-width: 240px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-trigger:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.search-trigger kbd { margin-left: auto; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: var(--s-6) var(--s-6) var(--s-10); view-transition-name: content; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Buttons ------------------------------------------------------------------------------ */
.btn, button {
  --bg-btn: var(--primary); --fg-btn: var(--primary-text);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  font: 600 13.5px/1 var(--font); color: var(--fg-btn); background: var(--bg-btn); border: 1px solid transparent; border-radius: var(--r);
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none; position: relative; overflow: hidden;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgb(255 255 255 / .12);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease);
}
.btn:hover, button:hover { background: var(--primary-hover); text-decoration: none; box-shadow: var(--shadow-sm); }
.btn:active, button:active { transform: translateY(1px) scale(.985); }
.btn.secondary, button.secondary { --bg-btn: var(--surface); --fg-btn: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover, button.secondary:hover { background: var(--surface-2); }
.btn.ghost, button.ghost { --bg-btn: transparent; --fg-btn: var(--text-2); box-shadow: none; }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger, button.danger { --bg-btn: var(--danger); --fg-btn: #fff; }
.btn.danger:hover, button.danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn.sm, button.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon-only, button.icon-only { width: 36px; padding: 0; }
.btn.link, button.link { --bg-btn: transparent; --fg-btn: var(--primary); height: auto; padding: 0; box-shadow: none; }
button[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgb(255 255 255 / .35); animation: ripple .55s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* Forms --------------------------------------------------------------------------------- */
label { display: block; font-weight: 560; font-size: 13px; color: var(--text-2); margin: 0 0 6px; }
.field { margin-bottom: var(--s-4); }
.field .help { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: var(--shadow-xs);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
textarea { height: auto; padding: 10px 12px; min-height: 90px; }
input[type=file] { padding: 8px 6px; height: auto; min-height: 40px; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: 12.5px; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-4); }
.filters label { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.filters select, .filters input { min-width: 130px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 120px; height: 32px; }
.inline { display: inline; }

/* Cards & stats ---------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: var(--s-5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; }
.card.interactive { transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); }
.card.interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); text-decoration: none; }
.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid > *, .grid-2 > * { min-width: 0; } /* let tables scroll inside cards instead of widening the page */
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stat { position: relative; overflow: hidden; padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); color: inherit; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 550; }
.stat .v { font-size: 26px; font-weight: 720; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12.5px; margin-top: 4px; color: var(--muted); }
.stat .glyph { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat.success .glyph { background: var(--success-soft); color: var(--success); }
.stat.warning .glyph { background: var(--warning-soft); color: var(--warning); }
.stat.violet .glyph { background: var(--violet-soft); color: var(--violet); }
.stat::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--primary) 10%, transparent), transparent); pointer-events: none; }
.hero { position: relative; border-radius: var(--r-xl); padding: var(--s-6); margin-bottom: var(--s-5); overflow: hidden;
  background: var(--glow), var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.hero h1 { font-size: 26px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--violet)); transform-origin: left; animation: grow 900ms var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* Tables ----------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr { transition: background var(--t-fast) var(--ease); }
tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
tbody tr:last-child td { border-bottom: 0; }
tr.total td { font-weight: 700; background: var(--surface-2); }
tr.group td { font-weight: 650; color: var(--text-2); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.row-link { cursor: pointer; }
.cell-actions { white-space: nowrap; text-align: right; }

/* Badges ----------------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--text-2); background: var(--surface-3); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.info { color: var(--info); background: var(--info-soft); }
.badge.violet { color: var(--violet); background: var(--violet-soft); }

/* Alerts / messages --------------------------------------------------------------------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: var(--s-4); }
.alert.success { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-soft); color: var(--success); }
.alert.error, .alert.danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); color: var(--danger); }
.alert.warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-soft); color: var(--warning); }

/* Tabs ----------------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: var(--s-4); }
.tabs a, .tabs button { --bg-btn: transparent; --fg-btn: var(--muted); height: 30px; padding: 0 12px; border-radius: 8px; box-shadow: none; font-weight: 600; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; }
.tabs a:hover, .tabs button:hover { background: var(--surface); color: var(--text); }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* Empty state & skeleton ------------------------------------------------------------- */
.empty { text-align: center; padding: var(--s-10) var(--s-6); color: var(--muted); }
.empty .glyph { width: 52px; height: 52px; margin: 0 auto var(--s-3); border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: var(--r-sm); min-height: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 65%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.loading-veil { display: none; }
.htmx-request .loading-veil, body.is-loading .loading-veil { display: block; }
body.is-loading .content > :not(.loading-veil) { opacity: .45; transition: opacity var(--t) var(--ease); }
.loading-veil { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 90; pointer-events: none; }

/* Top progress bar (navigation + uploads) --------------------------------------------- */
#progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 100; background: linear-gradient(90deg, var(--primary), var(--violet));
  box-shadow: 0 0 12px var(--primary); transition: width .25s var(--ease), opacity .4s var(--ease); opacity: 0; }
#progress.active { opacity: 1; }

/* Toasts ----------------------------------------------------------------------------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); animation: toast-in var(--t-slow) var(--ease-spring) both; }
.toast.leaving { animation: toast-out var(--t) var(--ease) both; }
.toast .icon { margin-top: 1px; }
.toast.success .icon { color: var(--success); } .toast.error .icon { color: var(--danger); } .toast.info .icon { color: var(--info); } .toast.warning .icon { color: var(--warning); }
.toast .close { margin-left: auto; --bg-btn: transparent; --fg-btn: var(--muted); height: 24px; width: 24px; padding: 0; box-shadow: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* Modal / drawer (native <dialog>) ------------------------------------------------------ */
dialog { border: 0; padding: 0; color: var(--text); background: transparent; max-width: calc(100vw - 32px); }
dialog::backdrop { background: rgb(6 10 18 / .5); backdrop-filter: blur(3px); animation: fade-in var(--t) var(--ease); }
dialog .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.modal[open] .panel { width: min(560px, calc(100vw - 32px)); animation: pop-in var(--t-slow) var(--ease-spring); }
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; }
dialog.drawer .panel { height: 100%; width: min(460px, 100vw); border-radius: 0; border-width: 0 0 0 1px; }
dialog.drawer[open] .panel { animation: slide-in var(--t-slow) var(--ease); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.panel-head h3 { margin: 0; }
.panel-body { padding: var(--s-5); overflow-y: auto; }
.panel-foot { display: flex; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); background: var(--surface-2); }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }

/* Command palette --------------------------------------------------------------------- */
.palette[open] { margin-top: 12vh; }
.palette .panel { width: min(620px, calc(100vw - 32px)); }
.palette input[type=search] { height: 52px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; font-size: 16px; padding: 0 18px; background: transparent; }
.palette input[type=search]:focus { box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.palette li a, .palette li button { --bg-btn: transparent; --fg-btn: var(--text-2); display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r); box-shadow: none; font-weight: 520; text-decoration: none; justify-content: flex-start; }
.palette li .hint { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.palette li[aria-selected="true"] a, .palette li[aria-selected="true"] button { background: var(--primary-soft); color: var(--primary); }
.palette .group { padding: 8px 12px 4px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.palette .foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 12px; }

/* Menus ------------------------------------------------------------------------------ */
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px; padding: 6px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); transform-origin: top right; }
.menu-panel a, .menu-panel button { --bg-btn: transparent; --fg-btn: var(--text-2); display: flex; width: 100%; justify-content: flex-start; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px; box-shadow: none; font-weight: 520; text-decoration: none; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); color: var(--text); }
.menu-panel .sep { height: 1px; background: var(--border); margin: 6px 2px; }
.menu-panel .who { padding: 8px 10px; }
.menu-panel .who strong { display: block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--info); background: var(--info-soft); flex: none; }
.switch { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong); transition: background var(--t-fast); flex: none; margin-left: auto; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform var(--t) var(--ease-spring); }
[aria-checked="true"] > .switch { background: var(--primary); }
[aria-checked="true"] > .switch::after { transform: translateX(14px); }
.transition-pop { animation: pop-in var(--t) var(--ease-spring); }

/* Auth pages ------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s-6); background: var(--bg); }
.auth .card { width: min(420px, 100%); padding: var(--s-8); box-shadow: var(--shadow-lg); animation: pop-in var(--t-slow) var(--ease-spring) both; }
.auth .logo { display: block; margin: 0 auto var(--s-5); max-width: 200px; height: auto; }
.auth h1 { font-size: 22px; text-align: center; }
.auth .lede { text-align: center; color: var(--muted); margin-bottom: var(--s-6); }
.auth button[type=submit] { width: 100%; height: 42px; margin-top: var(--s-2); }
.otp-input { text-align: center; letter-spacing: .5em; font: 700 22px/1 var(--mono); height: 52px !important; }
.qr { display: grid; place-items: center; padding: var(--s-4); border-radius: var(--r-lg); background: #fff; margin: var(--s-4) auto; width: max-content; box-shadow: var(--shadow-sm); }

/* Review / matching -------------------------------------------------------------------- */
.candidate { padding: var(--s-4) var(--s-5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); margin-bottom: var(--s-3);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.candidate:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow-md); }
.candidate .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.score { font: 700 12px/1 var(--mono); padding: 4px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.decision { border-left: 3px solid var(--success); }
.matched-flash { animation: matched 1.6s var(--ease) both; }
@keyframes matched {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 55%, transparent); background: var(--success-soft); }
  60% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: none; }
}
.amount-hero { font-size: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
details.disclosure { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); margin-bottom: var(--s-3); }
details.disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: var(--s-4) var(--s-5); font-weight: 600; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon.chev { margin-left: auto; transition: transform var(--t) var(--ease); }
details.disclosure[open] > summary .icon.chev { transform: rotate(180deg); }
details.disclosure > .body { padding: 0 var(--s-5) var(--s-5); }

/* Upload ------------------------------------------------------------------------------ */
.dropzone { display: grid; place-items: center; gap: 6px; padding: var(--s-8); text-align: center; border: 2px dashed var(--border-strong); border-radius: var(--r-xl);
  background: var(--surface); color: var(--muted); transition: border-color var(--t), background var(--t), transform var(--t) var(--ease); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); transform: scale(1.005); }
.dropzone .glyph { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-progress { margin-top: var(--s-4); }
.upload-progress .bar > i { animation: none; transition: width .2s linear; width: 0; }
.upload-progress .bar.indeterminate > i { width: 40% !important; animation: indeterminate 1.1s var(--ease) infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* Charts ----------------------------------------------------------------------------- */
.chart-box { position: relative; height: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Entrance motion -------------------------------------------------------------------- */
.reveal { animation: reveal var(--t-slow) var(--ease) both; }
.reveal:nth-child(2) { animation-delay: 40ms; } .reveal:nth-child(3) { animation-delay: 80ms; } .reveal:nth-child(4) { animation-delay: 120ms; }
.reveal:nth-child(5) { animation-delay: 160ms; } .reveal:nth-child(6) { animation-delay: 200ms; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } }
tbody.stagger tr { animation: reveal 360ms var(--ease) both; }
tbody.stagger tr:nth-child(-n+12) { animation-delay: calc(var(--i, 0) * 18ms); }

/* View transitions (cross-document + htmx boosted swaps) */
@view-transition { navigation: auto; }
::view-transition-old(content) { animation: vt-out 160ms var(--ease) both; }
::view-transition-new(content) { animation: vt-in 260ms var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* Reduced motion: system setting or the profile toggle --------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important;
}
html[data-motion="reduce"]::view-transition-old(*), html[data-motion="reduce"]::view-transition-new(*) { animation: none !important; }

/* Responsive -------------------------------------------------------------------------- */
.mobile-only { display: none; }
@media (max-width: 900px) {
  .shell, .shell[data-collapsed="true"] { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform var(--t-slow) var(--ease); box-shadow: var(--shadow-lg); }
  .shell[data-mobile-open="true"] .sidebar { transform: none; }
  .shell[data-mobile-open="true"]::after { content: ""; position: fixed; inset: 0; z-index: 50; background: rgb(6 10 18 / .45); }
  .shell[data-collapsed="true"] .nav a span, .shell[data-collapsed="true"] .nav-label, .shell[data-collapsed="true"] .brand-text { opacity: 1; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none !important; }
  .topbar { padding: 0 var(--s-4); }
  .search-trigger { min-width: 0; }
  .search-trigger .label { display: none; }
  .content { padding: var(--s-4) var(--s-4) var(--s-8); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  h1 { font-size: 21px; }
  .stat .v { font-size: 22px; }
  .toasts { right: 16px; left: 16px; width: auto; }
}

/* Design system page ---------------------------------------------------------------------- */
.swatch { border-radius: var(--r); border: 1px solid var(--border); overflow: hidden; }
.swatch i { display: block; height: 56px; }
.swatch div { padding: 8px 10px; font-size: 12px; }
.ds-section { margin-bottom: var(--s-8); }

[x-cloak] { display: none !important; }

/* ---- Stage 3: approvals, attachments, journal lines ---- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.steps li.done { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: var(--success-soft); }
.steps li.current { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.att-row { display: flex; align-items: flex-start; gap: 10px; }
.att-row > .icon { flex: none; margin-top: 2px; color: var(--muted); }
.att-row a { overflow-wrap: anywhere; }
.att-row.voided a { text-decoration: line-through; color: var(--muted); }
.att-form { flex-wrap: wrap; }
.att-form input[type="file"] { max-width: 100%; }
.menu-inline { position: relative; }
.menu-inline > summary { list-style: none; cursor: pointer; }
.menu-inline > summary::-webkit-details-marker { display: none; }
.menu-inline[open] > form { margin-top: 6px; }
.lines-table td { padding: 6px 8px; vertical-align: middle; }
.lines-table select, .lines-table input { width: 100%; min-width: 0; }
.lines-table input.num, input.num { text-align: right; font-variant-numeric: tabular-nums; }
.balance-note { margin: 0; font-weight: 600; }
.balance-note.ok { color: var(--success); }
.balance-note.warn { color: var(--warning); }
.kpi-row { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: var(--s-4); }
.aging-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.aging-bar > i { display: block; height: 100%; transform-origin: left; animation: grow-x var(--t-slow) var(--ease) both; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .aging-bar > i { animation: none; } }
html[data-motion="reduce"] .aging-bar > i { animation: none; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid > * { min-width: 0; }
.form-grid .field.wide { grid-column: 1 / -1; }
.field .sub { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.field-error { display: block; margin-top: 4px; color: var(--danger); font-size: 13px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field .req { color: var(--danger); }
.field.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.field.check input { margin-top: 3px; width: auto; }
.due-list { display: grid; gap: 8px; }
.due-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.due-item.overdue { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.due-item .grow { flex: 1; min-width: 0; }
.due-item .sub, .att-row .sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
/* KPI cards on stage-3 pages: <div class="card stat"><div class="card-body">label / value / sub */
.stat > .card-body { padding: 0; display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 1; }
.stat > .card-body > .muted { font-size: 13px; font-weight: 550; }
.stat > .card-body > strong { font-size: 22px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat > .card-body > .sub { display: block; color: var(--muted); font-size: 12.5px; }

/* ==== Reference design layer (docs/desain/*.dc.html) ======================================
   Overrides the components above so every page matches the reference: Geist, mono numbers,
   accent-soft navigation, 10px controls, 14px cards with --shadow, hover lift, staggered rise,
   growing bars. Motion is decorative only: nothing waits for an animation. */
body { font: 14px/1.55 var(--font); font-feature-settings: normal;
  transition: background-color .35s ease, color .35s ease; }
.num, td.num, th.num, .mono, kbd, code { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
a:hover { color: var(--text); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }

/* Sidebar & navigation */
.sidebar { padding: 20px 14px; gap: 14px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  box-shadow: none; font-size: 16px; font-weight: 700; }
.sidebar .brand { font-size: 15px; letter-spacing: -.01em; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; padding: 16px 12px 6px; }
.nav a { height: auto; padding: 9px 12px; border-radius: 9px; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background-color .15s, color .15s; }
.nav a:hover { background: var(--surface2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a[aria-current="page"]::before { display: none; }
.nav .count, .nav a[aria-current="page"] .count { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.who-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface2); min-width: 0; }
.who-card .av { width: 34px; height: 34px; flex: none; border-radius: 999px; background: var(--info-soft); color: var(--info);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.who-card .who-text { display: flex; flex-direction: column; min-width: 0; }
.who-card strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-card span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.shell[data-collapsed="true"] .who-card .who-text { display: none; }

/* Topbar */
.topbar { height: 68px; background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: transparent; padding: 0 32px; }
.search-trigger { height: 40px; border-radius: 10px; min-width: 280px; max-width: 520px; flex: 1 1 320px; font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.ibtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: none;
  transition: background-color .15s, transform .15s, border-color .15s; }
.ibtn:hover { background: var(--surface2); border-color: var(--accent); box-shadow: none; }
.ibtn:active { transform: scale(.94); }
.ibtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.content { padding: 20px 32px 48px; max-width: 1360px; }

/* Buttons */
.btn, button { height: 40px; padding: 0 16px; border-radius: 10px; font: 600 14px/1 var(--font); gap: 8px; box-shadow: none;
  border: 1px solid var(--accent); transition: transform .12s, background-color .15s, border-color .15s, box-shadow .2s; }
.btn:hover, button:hover { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn:active, button:active { transform: scale(.97); }
.btn.secondary, button.secondary, .btn.ghost, button.ghost { --bg-btn: var(--surface); --fg-btn: var(--text); border-color: var(--border); }
.btn.secondary:hover, button.secondary:hover, .btn.ghost:hover, button.ghost:hover { background: var(--surface2); border-color: var(--accent); box-shadow: none; color: var(--text); }
.btn.danger, button.danger { border-color: var(--danger); }
.btn.danger:hover, button.danger:hover { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.btn.sm, button.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.icon-only, button.icon-only { width: 40px; }
.btn.link, button.link { border: 0; }
.tabs { border-radius: 11px; background: var(--surface2); }
.tabs a, .tabs button { border: 0; height: auto; padding: 8px 14px; color: var(--muted); }
.tabs a:hover, .tabs button:hover { color: var(--text); background: transparent; box-shadow: none; }
.tabs [aria-selected="true"], .tabs [aria-current="page"], .tabs [aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
.cta:hover { color: var(--text); }
.cta .icon { transition: transform .2s; }
.cta:hover .icon { transform: translateX(3px); }

/* Forms */
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=date], input[type=month],
input[type=search], input[type=file], select, textarea { height: 40px; border-radius: 10px; border-color: var(--border); box-shadow: none; }
textarea { height: auto; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Cards, stats, tables */
.card, .stat, .table-wrap, .hero { border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .22s var(--ease), border-color .22s, background-color .35s; }
.lift:hover, .stat:hover, .card.interactive:hover { transform: translateY(-3px); border-color: var(--accent); }
.hero { background: var(--surface); }
.stat::after { display: none; }
.stat .v, .stat > .card-body > strong { font-family: var(--mono); font-weight: 600; font-size: 28px; }
.bar { height: 6px; background: var(--surface2); }
.bar > i { background: var(--accent); animation: growx 1s var(--ease) both; }
thead th { background: var(--surface); color: var(--muted); font-weight: 600; }
tbody tr:hover { background: var(--surface2); }
.badge.success { color: var(--accent); background: var(--accent-soft); }

/* Motion from the reference */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise, .reveal { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.barx { transform-origin: left; animation: growx 1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes growy { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bary { transform-origin: bottom; animation: growy .8s cubic-bezier(.2,.7,.2,1) both; transition: filter .15s; }
.bary:hover { filter: brightness(1.15); }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.6); opacity: 0; } }
.ping { animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite; }
@media (prefers-reduced-motion: reduce) {
  .rise, .reveal, .barx, .bary, .ping, .lift, .stat, .card { animation: none !important; transition: none !important; }
}
html[data-motion="reduce"] .rise, html[data-motion="reduce"] .reveal, html[data-motion="reduce"] .barx,
html[data-motion="reduce"] .bary, html[data-motion="reduce"] .ping { animation: none !important; }
html[data-motion="reduce"] .lift:hover, html[data-motion="reduce"] .stat:hover { transform: none; }

@media (max-width: 760px) {
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 40px; }
  .search-trigger { min-width: 0; }
  h1 { font-size: 24px; }
}

/* Review queue (reference: AntrianReview.dc.html) */
.queue-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.queue-head > :first-child { flex: 1 1 320px; display: flex; flex-direction: column; }
.queue-progress { min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.queue-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.queue-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.queue-filters .tabs { margin: 0; }
.queue-filters .tabs a { gap: 6px; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface2); color: var(--muted); }
.queue { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.queue-list { flex: 1 1 340px; min-width: 0; overflow: hidden; max-height: calc(100vh - 220px); overflow-y: auto; position: sticky; top: 84px; }
.queue-list-head { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.queue-detail { flex: 2 1 520px; min-width: 0; }
.tx { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; color: inherit; text-decoration: none;
  border-left: 3px solid transparent; border-bottom: 1px solid var(--border); transition: background-color .15s, border-color .15s; }
.tx:hover { background: var(--surface2); color: inherit; }
.tx.sel { background: var(--accent-soft); border-left-color: var(--accent); }
.tx-top { display: flex; align-items: center; gap: 8px; }
.tx .src { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface2); color: var(--text); }
.tx .num.muted { font-size: 12px; }
.tx .amt { font-size: 15px; font-weight: 600; }
.tx .grow, .qp-actions .grow { flex: 1; }
.tx-sender { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-reason { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.tx-reason i { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.k-kuat { color: var(--accent); } .k-selisih { color: var(--warn); } .k-kosong { color: var(--danger); } .k-lemah { color: var(--info); }
@keyframes tx-out { to { opacity: 0; transform: translateX(40px); max-height: 0; padding-top: 0; padding-bottom: 0; } }
.tx.out { animation: tx-out .42s cubic-bezier(.4,0,.2,1) forwards; max-height: 120px; overflow: hidden; pointer-events: none; }
.queue-empty { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.queue-empty .glyph { width: 44px; height: 44px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.queue-pane { padding: 22px; display: flex; flex-direction: column; gap: 20px; }
.qp-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qp-amount { display: flex; flex-direction: column; gap: 6px; }
.qp-amount .big { font-size: 32px; font-weight: 600; letter-spacing: -.02em; text-align: left; }
.pill-kind { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 999px; }
.pill-kind.k-kuat { background: var(--accent-soft); } .pill-kind.k-selisih { background: var(--warn-soft); }
.pill-kind.k-kosong { background: var(--danger-soft); } .pill-kind.k-lemah { background: var(--info-soft); }
.qp-block { display: flex; flex-direction: column; gap: 10px; }
.qp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.qp-desc { font-size: 13px; line-height: 1.6; padding: 12px 14px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border); overflow-wrap: anywhere; text-align: left; white-space: normal; }
.cand { padding: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); transition: border-color .2s, transform .2s; }
.cand.top { border-color: var(--accent); }
.cand:hover { border-color: var(--accent); transform: translateY(-2px); }
.cand-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cand-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 14px; }
.cand-title .num { text-align: left; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; padding: 3px 8px; border-radius: 6px; }
.chip-ok { background: var(--accent-soft); color: var(--accent); }
.chip-warn { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--info); }
.cand-score { width: 120px; display: flex; flex-direction: column; gap: 6px; }
.score-hi { background: var(--accent) !important; } .score-mid { background: var(--warn) !important; } .score-lo { background: var(--danger) !important; }
.qp-none { padding: 16px; border-radius: 12px; border: 1px dashed var(--border); font-size: 14px; line-height: 1.5; color: var(--muted); }
.qp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.kbd-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .queue-list { position: static; max-height: 420px; } }
@media (prefers-reduced-motion: reduce) { .tx.out { animation: none; display: none; } }
html[data-motion="reduce"] .tx.out { animation: none; display: none; }

/* Role dashboard (reference: Main.dc.html) */
.dash { display: flex; flex-direction: column; gap: 24px; }
.dash-hello { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dash-hello > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.dash-hello h1 { margin: 0; font-size: 30px; text-wrap: balance; }
.dash-hello .tabs { margin: 0; }
.dash-tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.task { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.task h2 { margin: 0 0 4px; }
.task p { margin: 0; font-size: 13px; line-height: 1.5; }
.task-top { display: flex; align-items: center; gap: 10px; }
.task-no { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.task-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.kpi > .muted:first-child { font-size: 13px; font-weight: 500; }
.kpi-v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; text-align: left; }
.dash-row { display: flex; flex-wrap: wrap; gap: 16px; }
.dash-row > .card { min-width: 0; }
.dash-chart { flex: 3 1 520px; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.dash-recon { flex: 2 1 340px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dash-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.dash-card-head h2, .dash-recon h2 { margin: 0 0 2px; }
.dash-card-head .muted { font-size: 13px; }
.vbars { display: flex; gap: 10px; height: 220px; }
.vbars-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; padding-bottom: 20px; }
.vbars-plot { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.vbars-area { flex: 1 1 auto; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--border);
  background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% 50%; }
.vbars-area .bary { flex: 1 1 0; min-height: 2px; border-radius: 5px 5px 2px 2px; background: var(--chart2); }
.vbars-area .bary.today { background: var(--accent); }
.vbars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.stackbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface2); }
.recon-legend { display: flex; flex-direction: column; gap: 4px; }
.recon-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; font-size: 14px; transition: background-color .15s; }
.recon-row:hover { background: var(--surface2); }
.recon-row i { width: 10px; height: 10px; border-radius: 3px; }
.recon-row .grow { flex: 1; }
.dash-accounts { flex: 3 1 520px; padding: 8px 0; display: flex; flex-direction: column; }
.acc-scroll { overflow-x: auto; }
.acc-list { min-width: 560px; display: flex; flex-direction: column; }
.acc-row { display: grid; grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 10px 20px; border-top: 1px solid var(--border); transition: background-color .15s; }
.acc-row:hover { background: var(--surface2); }
.acc-code { width: 36px; height: 36px; border-radius: 10px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.acc-name { display: flex; flex-direction: column; min-width: 0; }
.acc-name strong { font-size: 14px; font-weight: 600; }
.acc-name .muted { font-size: 12px; }
.acc-pill { justify-self: start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.acc-pill.ok { background: var(--accent-soft); color: var(--accent); }
.acc-pill.warn { background: var(--warn-soft); color: var(--warn); }
.acc-pill .dot { position: relative; width: 7px; height: 7px; }
.acc-pill .dot span { position: absolute; inset: 0; border-radius: 999px; background: currentColor; }
.acc-pill.ok .dot .ping { animation: none; opacity: 0; }
.acc-bal { font-size: 14px; font-weight: 600; }
.dash-activity { flex: 2 1 340px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.activity { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.activity li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.activity li > i { flex: none; margin-top: 7px; width: 8px; height: 8px; border-radius: 999px; }
.activity li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; line-height: 1.45; }
.activity strong { font-weight: 600; }
.tone-ok { background: var(--accent); } .tone-info { background: var(--info); } .tone-warn { background: var(--warn); }
@media (max-width: 760px) { .dash-hello h1 { font-size: 24px; } }

/* Alur kerja tim (reference: AlurKerja.dc.html) */
.wf { display: flex; flex-direction: column; gap: 24px; }
.wf-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.wf-intro { flex: 1 1 420px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wf-intro h1 { margin: 0; font-size: 30px; text-wrap: balance; }
.wf-intro p { margin: 0; max-width: 68ch; font-size: 15px; line-height: 1.6; }
.wf-head .tabs { margin: 0; }
.wf-scroll { overflow-x: auto; padding-bottom: 4px; }
.wf-board { min-width: 1080px; display: flex; flex-direction: column; gap: 14px; }
.wf-grid { display: grid; grid-template-columns: 200px repeat(3, minmax(0, 1fr)); gap: 14px; }
.wf-cadence { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; font-size: 13px; }
.wf-lane { padding: 14px; border-radius: 16px; background: var(--lane); border: 1px solid var(--border); transition: opacity .35s ease, filter .35s ease; }
.wf-lane.dim { opacity: .32; filter: saturate(.4); }
.wf-role { display: flex; flex-direction: column; gap: 8px; padding: 6px 4px; }
.wf-role strong { font-size: 16px; font-weight: 600; }
.wf-role .muted { font-size: 13px; line-height: 1.45; }
.wf-av { width: 38px; height: 38px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.tone-av-info { background: var(--info-soft); color: var(--info); }
.tone-av-accent { background: var(--accent-soft); color: var(--accent); }
.tone-av-warn { background: var(--warn-soft); color: var(--warn); }
.tone-av-plain { background: var(--surface2); color: var(--text); }
.wf-col { display: flex; flex-direction: column; }
.wf-link { width: 2px; height: 14px; margin-left: 24px; background: var(--accent); opacity: .5; transform-origin: top; animation: growy-top .5s ease both; }
@keyframes growy-top { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.wf-step { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px;
  transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s; }
.wf-step:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.wf-step .muted { font-size: 13px; line-height: 1.5; }
.wf-step-top { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.3; }
.wf-no { flex: none; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.wf-handoff { font-size: 12px; font-weight: 600; color: var(--info); }
.chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface2); color: var(--text); text-decoration: none; }
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.wf-empty { min-height: 60px; border-radius: 12px; border: 1px dashed var(--border); }
.wf-rules { display: flex; flex-wrap: wrap; gap: 14px; }
.wf-rules .card { flex: 1 1 260px; min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.wf-rules .muted { font-size: 13px; line-height: 1.5; }
html[data-motion="reduce"] .wf-link, html[data-motion="reduce"] .wf-lane { animation: none; transition: none; }
@media (prefers-reduced-motion: reduce) { .wf-link, .wf-lane, .wf-step { animation: none; transition: none; } }

/* Setup wizard, onboarding checklist, help panel (siap-pakai) */
.wizard { list-style: none; margin: 0; padding: 0; counter-reset: wz; }
.wz-step { padding: 0; }
.wz-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; }
.wz-head > div { flex: 1; min-width: 0; }
.wz-head h2 { margin: 0 0 4px; font-size: 16px; }
.wz-head p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.wz-no { flex: none; width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-family: var(--mono); background: var(--surface2); color: var(--muted); }
.wz-step.done .wz-no { background: var(--accent-soft); color: var(--accent); }
.wz-body { padding: 0 20px 18px 64px; display: flex; flex-direction: column; gap: 12px; }
.wz-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checks li.ok .icon { color: var(--accent); }
.checks li.todo .icon { color: var(--danger); }
.checks li a { color: var(--text); }
.todo-row td { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.sub.warn { color: var(--warn); }
.onboard { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.onboard-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.onboard-head > div:first-child { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; }
.onboard-head h2 { margin: 0; font-size: 16px; }
.onboard-progress { display: flex; align-items: center; gap: 10px; flex: 1 1 200px; max-width: 320px; }
.onboard-progress .bar { flex: 1; }
.onboard-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.onboard-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); }
.onboard-list li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.onboard-list li > div .muted { font-size: 12.5px; line-height: 1.45; }
.onboard-list li a { color: var(--text); }
.onboard-list li.done strong { color: var(--muted); text-decoration: line-through; }
.onboard-check { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); background: var(--surface2); border: 0; }
.onboard-list li.done .onboard-check { color: var(--accent); background: var(--accent-soft); }
button.onboard-check { padding: 0; }
.help-panel { min-width: 320px; max-width: min(420px, calc(100vw - 32px)); }
.help-title { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 4px; }
.help-title .muted { font-size: 13px; line-height: 1.5; }
.help-steps { margin: 4px 0 6px; padding: 0 10px 0 28px; font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.help-steps li::marker { color: var(--accent); font-weight: 600; }
@media (max-width: 760px) { .wz-body { padding-left: 20px; } .help-panel { position: fixed; left: 16px; right: 16px; top: 72px; min-width: 0; } }

/* ==== Polish layer (tahap 5) ===============================================================
   One type scale, an 8px spacing grid (4px half-steps for tight inline gaps), numbers always
   right-aligned in Geist Mono, sticky table headers, every component state, skeletons,
   tooltips and inline validation. Colours stay the reference tokens (docs/desain/). */
:root {
  --fs-11: 11px; --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-16: 16px; --fs-20: 20px;
  --fs-24: 24px; --fs-28: 28px; --fs-32: 32px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 40px; --sp-8: 48px;
  --row-h: 44px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
/* Typography: four heading sizes, comfortable body, tight letter-spacing on large text. */
h1 { font-size: var(--fs-28); line-height: 1.2; letter-spacing: -.025em; font-weight: 700; }
h2 { font-size: var(--fs-16); line-height: 1.35; font-weight: 600; margin-top: var(--sp-5); }
h3 { font-size: var(--fs-14); font-weight: 600; }
.page-head { margin-bottom: var(--sp-5); gap: var(--sp-3) var(--sp-4); align-items: flex-end; }
.page-head .sub { font-size: var(--fs-14); line-height: 1.55; max-width: 72ch; margin-top: var(--sp-1); }
.eyebrow, .nav-label { font-size: var(--fs-11); }
small, .sub, td .sub, .field .sub, .help { font-size: var(--fs-12); line-height: 1.45; }

/* Spacing on the 8px grid. */
.content { padding: var(--sp-5) var(--sp-6) var(--sp-8); }
.card-body { padding: var(--sp-5); }
.card-head { padding: var(--sp-4) var(--sp-5); min-height: 56px; }
.panel-foot { padding: var(--sp-4) var(--sp-5); gap: var(--sp-2); }
.stack { gap: var(--sp-4); }
.grid, .grid-2 { gap: var(--sp-4); }
.form-grid { gap: var(--sp-4) var(--sp-5); }
.field { margin-bottom: var(--sp-4); }
.form-grid .field { margin-bottom: 0; }
label { margin-bottom: var(--sp-2); font-size: var(--fs-13); }
.alert { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); border-radius: 12px; margin-bottom: var(--sp-4); line-height: 1.5; }
.alert > .icon { margin-top: 2px; }
.alert.info { border-color: color-mix(in srgb, var(--info) 35%, transparent); background: var(--info-soft); color: var(--text); }
.alert.warning, .alert.error, .alert.danger, .alert.success { color: var(--text); }
.alert.warning > .icon { color: var(--warn); }
.alert.error > .icon, .alert.danger > .icon { color: var(--danger); }
.alert.success > .icon { color: var(--accent); }
.alert.info > .icon { color: var(--info); }

/* Numbers: every money/count cell right-aligned, monospaced, tabular. */
.num, td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-v, .stat .v, .stat > .card-body > strong, .amount-hero, .qp-amount .big { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.num .sub { font-family: var(--font); }

/* Tables: sticky header inside the scroll box, clear totals, hover/focus rows. */
.table-wrap { max-height: min(78vh, 1200px); overflow: auto; overscroll-behavior: contain; }
table { font-size: var(--fs-13); }
th, td { padding: 10px var(--sp-4); height: var(--row-h); }
thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); font-size: var(--fs-11); letter-spacing: .06em;
  box-shadow: inset 0 -1px 0 var(--border); border-bottom: 0; }
tfoot th, tfoot td { position: sticky; bottom: 0; background: var(--surface2); font-weight: 700; z-index: 1; }
tr.total td { background: var(--surface2); font-weight: 700; }
tr.grand td { font-size: var(--fs-14); border-top: 2px solid var(--text); background: var(--surface2); }
col.code { width: 88px; }
.stat .v.neg { color: var(--danger); } .stat .v.pos { color: var(--accent); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
tbody tr:focus-within { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
td a { font-weight: 500; }
.cell-actions > * + * { margin-left: var(--sp-2); }

/* Buttons and controls: every state. */
.btn, button { min-height: 40px; }
.btn.sm, button.sm { min-height: 32px; }
.btn:focus-visible, button:focus-visible, a:focus-visible, [role=tab]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: var(--focus); }
button[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
button[aria-busy="true"] { cursor: progress; opacity: .85; }
button[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input:disabled, select:disabled, textarea:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input[readonly] { background: var(--surface2); }
.field.has-error input, .field.has-error select, .field.has-error textarea, input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error, .errorlist { color: var(--danger); font-size: var(--fs-12); margin-top: var(--sp-1); }
.field.is-valid input, .field.is-valid select { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }

/* Badges: one height. */
.badge { height: 24px; padding: 0 10px; font-size: var(--fs-12); gap: 6px; }
.badge.warning { color: var(--warn); background: var(--warn-soft); }

/* Empty states with a clear action. */
.empty { padding: var(--sp-7) var(--sp-5); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.empty h3 { font-size: var(--fs-16); margin: var(--sp-2) 0 0; }
.empty p { max-width: 48ch; margin: 0 auto var(--sp-2); line-height: 1.55; }

/* Skeleton sweep while a boosted page loads. */
body.is-loading .content { position: relative; }
body.is-loading .content::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; z-index: 5; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  background-size: 50% 100%; background-repeat: no-repeat; animation: sweep 1.1s ease-in-out infinite; }
@keyframes sweep { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Tooltip for chart bars and any [data-tip]. */
.tip { position: fixed; z-index: 120; pointer-events: none; padding: 6px 10px; border-radius: 8px; font-size: var(--fs-12); line-height: 1.4;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap;
  font-family: var(--mono); opacity: 0; transition: opacity .12s; }
.tip.on { opacity: 1; }

/* Feedback flash after an action. */
@keyframes flash-ok { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.flash-ok { animation: flash-ok 1.2s ease-out; }

/* Phones: one column, motion toggle lives in the profile menu, search collapses to an icon. */
@media (max-width: 760px) {
  .content { padding: var(--sp-4) var(--sp-4) var(--sp-7); }
  h1 { font-size: var(--fs-24); }
  .top-actions > .ibtn[aria-pressed] { display: none; }
  .topbar { gap: var(--sp-2); }
  .search-trigger { flex: 0 0 40px; width: 40px; min-width: 40px; padding: 0; justify-content: center; }
  .search-trigger kbd { display: none; }
  .page-head { margin-bottom: var(--sp-4); }
  .card-body { padding: var(--sp-4); }
  .card-head { padding: var(--sp-3) var(--sp-4); }
  th, td { padding: 8px var(--sp-3); }
  .kpi-v, .stat .v { font-size: var(--fs-24); }
  .queue-filters input[type=search] { min-width: 0 !important; flex: 1 1 160px; }
  .wz-head { padding: var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) { button[aria-busy="true"]::after, body.is-loading .content::before { animation: none; } }
html[data-motion="reduce"] button[aria-busy="true"]::after, html[data-motion="reduce"] body.is-loading .content::before { animation: none; }

/* Polish: dashboard details found in the review screenshots. */
.activity .num, .activity li > div .muted { text-align: left; }
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 760px) {
  .dash-kpis { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .kpi { padding: var(--sp-4); }
  .kpi-v { font-size: var(--fs-20); }
  .acc-list { min-width: 0; }
  .acc-row { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "code name bal" "code pill pill"; row-gap: 6px; padding: var(--sp-3) var(--sp-4); }
  .acc-row > .acc-code { grid-area: code; }
  .acc-row > .acc-name { grid-area: name; }
  .acc-row > .acc-pill { grid-area: pill; }
  .acc-row > .acc-bal { grid-area: bal; }
  .crumbs > span:not(:last-child), .crumbs > svg { display: none; }
}

/* Polish: findings from the automatic review (contrast, overflow, tap targets). */
h1, h2, .page-head > div, code, .mono { overflow-wrap: anywhere; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
/* Danger buttons: white on the light-red dark-theme token was 2.5:1; use dark ink there. */
:root[data-theme="dark"] .btn.danger, :root[data-theme="dark"] button.danger { --fg-btn: #2A0905; color: #2A0905; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .btn.danger, :root:not([data-theme]) button.danger { --fg-btn: #2A0905; color: #2A0905; } }
/* Breadcrumb on the translucent topbar: solid enough to keep AA. */
.topbar .crumbs, .topbar .crumbs a { color: var(--text-2); }
.topbar { background: color-mix(in srgb, var(--bg) 94%, transparent); }
/* Stat cards from older pages: same scale as the dashboard KPIs, no inline font sizes win. */
.stat .v { font-size: var(--fs-24); font-weight: 600; letter-spacing: -.02em; }
/* Phones: 40px tap targets for controls people press with a thumb. */
@media (max-width: 760px) {
  .cta, .chip, .tabs a, .tabs button { min-height: 40px; display: inline-flex; align-items: center; }
  input[type=checkbox], input[type=radio] { width: 32px; height: 32px; }
  .public-head { flex-wrap: wrap; }
  .public-head nav { flex-wrap: wrap; width: 100%; justify-content: flex-start; }
  .btn.sm, button.sm { min-height: 40px; padding: 0 14px; }
  .nav a { min-height: 44px; }
  td a, .menu-panel a, .menu-panel button { min-height: 40px; }
  .ibtn { width: 40px; height: 40px; }
}

/* Polish: remaining small tap targets found by the review (390px). */
.onboard-list li > div > a { display: block; padding: 2px 0; }
@media (max-width: 760px) {
  .onboard-list li > div > a { min-height: 40px; display: flex; align-items: center; }
  [role=tab] { min-height: 40px; }
  .crumbs > a:not(:last-child) { display: none; }
}

/* Polish: review queue and filter tabs on phones. */
.tabs a, .tabs button { white-space: nowrap; }
@media (max-width: 760px) {
  .tabs { width: 100%; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .queue-filters { gap: var(--sp-2); }
  .queue-filters form.inline-form { width: 100%; display: grid; grid-template-columns: 1fr; gap: var(--sp-2); }
  .queue-filters form.inline-form select, .queue-filters form.inline-form input { width: 100%; min-width: 0 !important; }
  .queue-head { gap: var(--sp-3); }
  .queue-progress { width: 100%; }
  .kbd-hint { display: none; }
  .qp-actions > .btn, .qp-actions > button, .qp-actions > a { flex: 1 1 100%; justify-content: center; }
  .queue-pane { padding: var(--sp-4); }
  .qp-amount .big { font-size: var(--fs-28); }
}

/* Main list + side form: the list gets about two thirds. */
.split-main { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); align-items: start; }
.split-main > * { min-width: 0; }
@media (max-width: 1100px) { .split-main { grid-template-columns: 1fr; } }

/* Polish: summary cards and wide tables on phones (aging, reports, lists). */
@media (max-width: 760px) {
  .grid:has(> .stat), .kpi-row { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .grid:has(> .stat) > .stat:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .grid > .stat { padding: var(--sp-4); }
  .stat .v, .stat > .card-body > strong { font-size: var(--fs-16); }
  .table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 9.5rem; box-shadow: 1px 0 0 var(--border); }
  .table-wrap thead th:first-child { z-index: 3; }
  .table-wrap tr.total td:first-child, .table-wrap tr.group td:first-child { background: var(--surface2); }
  .table-wrap td[colspan] { position: static; min-width: 0; box-shadow: none; }
}

/* .num is also used for mono text blocks; only table cells and amounts must not wrap. */
.num.qp-desc { white-space: normal; text-align: left; overflow-wrap: anywhere; }
.num.vbars-x, .num.task-no, .num.wf-no, .num.pill { text-align: inherit; }
.num.vbars-x { text-align: left; }
.num.kpi-v, .qp-amount .num.big { text-align: left; }
@media (max-width: 760px) { .checks li a { min-height: 40px; display: inline-flex; align-items: center; } }

/* Glossary: terms explained for business owners ({% istilah %}) */
abbr.term { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--accent); cursor: help; }
.glossary { display: grid; gap: 12px; margin: 0; }
.glossary > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.glossary > div:last-child { border-bottom: 0; }
.glossary dt { font-weight: 600; margin: 0 0 4px; }
.glossary dd { margin: 0; color: var(--muted); max-width: 72ch; }

/* Public pages (landing, pricing, legal) */
.public { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); overflow-x: clip; }
.public *, .public *::before, .public *::after { box-sizing: border-box; }
.public-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; max-width: 1120px; width: 100%; margin: 0 auto; }
.public-head .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 700; }
.public-head .brand img { height: 28px; }
.public-head nav { display: flex; align-items: center; gap: 16px; }
.public-head nav a { color: inherit; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; }
.public-head nav a.btn { color: var(--accent-ink); }
.public-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 24px 64px; }
.public-foot { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.public-foot a { color: inherit; display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; }
.public-foot > span { display: inline-flex; align-items: center; min-height: 40px; }
.hero { text-align: center; padding: 56px 0 40px; max-width: 760px; margin: 0 auto; }
.hero.compact { padding: 24px 0 16px; }
.hero .eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 12.5px; margin: 0 0 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px; }
.hero .lede { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.features .card-body .icon { width: 28px; height: 28px; color: var(--accent); }
.features h2 { font-size: 17px; margin: 12px 0 6px; }
.features p { color: var(--muted); margin: 0; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pricing .card.active { outline: 2px solid var(--accent); }
.pricing .price { font-size: 24px; font-weight: 700; margin: 4px 0 8px; }
.pricing ul { padding-left: 18px; margin: 8px 0 0; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h1 { margin: 8px 0 4px; }
.legal h2 { font-size: 17px; margin: 24px 0 6px; }
.legal p { color: var(--muted); line-height: 1.6; }
.quick-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.quick-start .step { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.quick-start .step.done { border-color: var(--success); }
.quick-start .step .no { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.quick-start .step.done .no { background: var(--success-soft, var(--accent-soft)); color: var(--success); }

/* Super-admin tenant table: action forms wrap instead of forcing a wide row. */
.superadmin-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 360px; }
.superadmin-actions form { display: inline-flex; gap: 4px; align-items: center; }

/* Sandbox tenant: unmistakable banner above everything. */
.sandbox-banner { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; background: #B45309; color: #fff; font-size: 13.5px; }
[data-theme="dark"] .sandbox-banner { background: #92400E; }
.sandbox-banner .icon { width: 16px; height: 16px; }

/* 3D visuals (tahap 7) ------------------------------------------------------------------
   Scenes render into .viz containers; without WebGL / with reduced motion the container shows
   its [data-viz-fallback] and the page's table takes over. */
.viz { position: relative; overflow: hidden; }
.viz canvas { display: block; }
.viz-fallback { display: grid; place-items: center; height: 100%; padding: var(--s-4); text-align: center; }
.viz-fallback[hidden], .empty[hidden] { display: none; }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); font-size: 12.5px; max-width: 280px; color: var(--text); }
.viz-tip strong { font-size: 13px; }
.auth { position: relative; isolation: isolate; }
.auth .card { position: relative; z-index: 1; background: var(--surface); }
/* Ambient light field (CSS only): two soft colour washes painted as the container's own
   background (no extra layer, so they can never sit above the content), drifting very slowly
   by animating background-position; still with less motion. */
.ambient { background-color: var(--bg);
  background-image:
    radial-gradient(60% 55% at 50% 50%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(55% 50% at 50% 50%, color-mix(in srgb, var(--violet) 16%, transparent), transparent 70%);
  background-repeat: no-repeat; background-attachment: fixed;
  background-size: 90% 90%, 80% 80%; background-position: 10% 20%, 90% 85%;
  animation: ambient-drift 48s ease-in-out infinite alternate; }
:root:not([data-theme="dark"]) .ambient { background-image:
    radial-gradient(60% 55% at 50% 50%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(55% 50% at 50% 50%, color-mix(in srgb, var(--violet) 9%, transparent), transparent 70%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .ambient { background-image:
    radial-gradient(60% 55% at 50% 50%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%),
    radial-gradient(55% 50% at 50% 50%, color-mix(in srgb, var(--violet) 16%, transparent), transparent 70%); } }
@keyframes ambient-drift { from { background-position: 10% 20%, 90% 85%; } to { background-position: 30% 40%, 70% 60%; } }
html[data-motion="reduce"] .ambient { animation: none; }
@media (prefers-reduced-motion: reduce) { .ambient { animation: none !important; } }
.dash-flow { height: 340px; }
.dash-flow[data-viz="static"] { height: auto; min-height: 72px; }
.dash-flow-table { border-top: 1px solid var(--border); }
.dash-flow-table table { margin: 0; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.map-key { font-weight: 600; }
.map-card { overflow: hidden; }
.map-stage { height: min(68vh, 640px); background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%); }
.map-stage[data-viz="static"], .map-stage[data-viz="empty"] { height: auto; min-height: 200px; display: grid; place-items: center; }
.map-stage:focus-visible { box-shadow: inset var(--ring); border-radius: 0; }
.import-stage { margin-top: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); }
.import-stage[hidden] { display: none; }
.import-viz { height: 200px; }
.import-viz[data-viz="static"], .import-viz[data-viz="2d"] { height: 0; }
.import-stats { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 16px; font-size: 13.5px; }
.import-counter { font: 700 28px/1 var(--mono); color: var(--accent); min-width: 48px; }
.import-file { flex: 1 1 100%; font-size: 12.5px; overflow-wrap: anywhere; }
.forecast-stage { height: 420px; margin-bottom: var(--s-3); }
.forecast-stage[hidden] { display: none; }
.onboard-ilus { width: 112px; height: 84px; flex: none; }
.onboard-ilus[data-viz="static"], .onboard-ilus[data-viz="2d"] { display: grid; place-items: center; }
@media (max-width: 760px) { .onboard-ilus { display: none !important; } .dash-flow { height: 280px; } .map-stage { height: 60vh; } .forecast-stage { height: 320px; } }

/* Success moment: confetti canvas + card. */
.celebrate { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 60%, transparent); animation: fade-in .25s both; }
.celebrate.leaving { animation: fade-out .25s both; }
.celebrate canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebrate-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 32px; max-width: min(420px, calc(100vw - 32px)); text-align: center;
  border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop-in .55s var(--ease-spring) both; }
.celebrate-card strong { font-size: 18px; }
.celebrate-card .muted { font-size: 13.5px; }
.celebrate-card button { margin-top: 8px; }
.celebrate-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.celebrate-check .icon { width: 30px; height: 30px; stroke-width: 2.5; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

/* CSS-3D illustration for empty states (no WebGL): a cube that turns slowly. */
.ilus { width: 76px; height: 76px; margin: 0 auto var(--s-3); perspective: 420px; }
.ilus .cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-22deg) rotateY(-28deg); animation: ilus-spin 14s linear infinite; }
.ilus .cube i { position: absolute; inset: 16px; border-radius: 10px; background: color-mix(in srgb, var(--accent-soft) 85%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); display: grid; place-items: center; color: var(--accent); backface-visibility: hidden; }
.ilus .cube .f1 { transform: translateZ(22px); } .ilus .cube .f2 { transform: rotateY(180deg) translateZ(22px); }
.ilus .cube .f3 { transform: rotateY(90deg) translateZ(22px); } .ilus .cube .f4 { transform: rotateY(-90deg) translateZ(22px); }
.ilus .cube .f5 { transform: rotateX(90deg) translateZ(22px); } .ilus .cube .f6 { transform: rotateX(-90deg) translateZ(22px); }
@keyframes ilus-spin { from { transform: rotateX(-22deg) rotateY(0deg); } to { transform: rotateX(-22deg) rotateY(360deg); } }
html[data-motion="reduce"] .ilus .cube { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .ilus .cube { animation: none !important; } }
.queue-empty .ilus { margin-bottom: 0; }

/* Landing page (premium, calm) --------------------------------------------------------- */
.public { position: relative; }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 40px 0 56px; }
.lp-hero-copy h1 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.06; letter-spacing: -.025em; margin: 0 0 18px; text-wrap: balance; }
.lp-hero-copy .lede { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 24px; max-width: 54ch; }
.lp-hero-copy .hero-actions { justify-content: flex-start; }
.lp-proof { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; }
.lp-proof li { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
.lp-proof .icon { color: var(--accent); }
.lp-window { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.lp-window-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.lp-window-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.lp-window-bar em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--muted); }
.lp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; }
.lp-kpis .stat { padding: 12px 14px; box-shadow: none; }
.lp-kpis .stat .v { font-size: 20px; margin-top: 4px; }
.lp-kpis .stat .delta { font-size: 11.5px; }
.lp-queue { padding: 0 14px 14px; }
.lp-queue-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; padding: 6px 2px 8px; }
.lp-row { display: grid; grid-template-columns: 38px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; font-size: 12.5px; background: var(--surface);
  opacity: 0; transform: translateY(6px); animation: lp-row-in .7s var(--ease) both; animation-delay: calc(.35s + var(--i) * .55s); }
.lp-row .src { font: 600 11px/1 var(--mono); color: var(--muted); }
.lp-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-row .badge { animation: lp-badge-in .5s var(--ease-spring) both; animation-delay: calc(.9s + var(--i) * .55s); }
@keyframes lp-row-in { to { opacity: 1; transform: none; } }
@keyframes lp-badge-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.lp-section { padding: 40px 0 8px; }
.lp-section-head { max-width: 640px; margin: 0 0 24px; }
.lp-section-head h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; margin: 0 0 10px; }
.lp-section-head .lede { color: var(--muted); font-size: 16px; margin: 0; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; counter-reset: step; }
.lp-steps li { display: flex; gap: 14px; padding: 20px; }
.lp-steps .no { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.lp-steps h3 { margin: 4px 0 6px; font-size: 16px; }
.lp-steps p { margin: 0; color: var(--muted); line-height: 1.55; }
.lp-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lp-roles .card { padding: 18px; }
.lp-roles strong { display: block; margin-bottom: 6px; }
.lp-roles p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.lp-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px; margin: 48px 0 8px; border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.lp-cta h2 { margin: 0 0 6px; font-size: 22px; }
.lp-cta p { margin: 0; }
/* Sections below the fold reveal as they scroll in (class .in from app.js); no bounce. */
.lp-section .reveal, .lp-cta.reveal { animation: none; opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.lp-section .reveal.in, .lp-cta.reveal.in { opacity: 1; transform: none; }
html[data-motion="reduce"] .lp-section .reveal, html[data-motion="reduce"] .lp-cta.reveal, html[data-motion="reduce"] .lp-row, html[data-motion="reduce"] .lp-row .badge { opacity: 1; transform: none; animation: none; }
@media (prefers-reduced-motion: reduce) { .lp-section .reveal, .lp-cta.reveal, .lp-row, .lp-row .badge { opacity: 1 !important; transform: none !important; animation: none !important; } }
@media (max-width: 900px) { .lp-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; } .lp-kpis { grid-template-columns: 1fr 1fr; } .lp-kpis .stat:last-child { grid-column: span 2; } }
@media (max-width: 760px) { .lp-row { grid-template-columns: 34px 1fr auto; } .lp-row .num { display: none; } }

/* Calmer global motion: shorter reveals, no bounce on cards. */
.rise, .reveal { animation-duration: .45s; }
.lift:hover, .stat:hover, .card.interactive:hover { transform: translateY(-2px); }
.lp-kpis .stat .v, .lp-kpis .stat .delta { display: block; }
.lp-kpis .stat .delta { margin-top: 2px; }
/* The ambient background lives inside .public-main (its own stacking context): a negative
   z-index puts it under the main content, and the header/footer sit above main. */
.public { isolation: isolate; }

/* Premium data scenes (tahap 7b) ------------------------------------------------------- */
/* HTML labels drawn over the 3D canvas (CSS2DRenderer). */
.viz-labels { font: 12.5px/1.3 var(--font); color: var(--text); }
.viz-label { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; white-space: nowrap; pointer-events: none; }
.viz-label-col, .viz-label-axis, .viz-label-title, .viz-label-legend { animation: fade-in .7s var(--ease) both; }
.viz-label-col { white-space: normal; } .viz-label-col strong { font-size: 12.5px; font-weight: 650; line-height: 1.2; }
.viz-label-col span { font-size: 11.5px; color: var(--muted); }
.viz-label-axis span { font: 500 11.5px/1 var(--mono); color: var(--muted); }
.viz-label-title strong { font-size: 14px; }
.viz-label-legend { flex-direction: row; gap: 6px; font-size: 11.5px; color: var(--muted); }
.viz-label-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin: 0 2px 0 6px; }
.viz-label-tip { align-items: flex-start; text-align: left; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); transform: translateY(-50%); }
.viz-label-tip strong { font-size: 12.5px; } .viz-label-tip span { font-size: 12px; } .viz-label-tip .muted { font-size: 11.5px; }
/* Peta: stage + side panel. */
.map-card { position: relative; }
.map-panel { position: absolute; top: 16px; right: 16px; z-index: 3; width: min(300px, calc(100% - 32px)); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: pop-in .35s var(--ease) both; }
.map-panel[hidden] { display: none; }
.map-panel strong { font-size: 15px; margin-top: 6px; }
.map-panel .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@media (max-width: 760px) { .map-panel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; } }
/* Aliran kas as a Sankey (SVG). */
.dash-flow[data-viz="2d"] { height: auto; }
.sankey { display: block; width: 100%; height: auto; max-height: 420px; font-family: var(--font); }
.sankey .sk-name { font-size: 13px; font-weight: 600; fill: var(--text); }
.sankey .sk-sub { font-size: 11.5px; fill: var(--muted); } .sankey .sk-sub.warn { fill: var(--warn); }
.sankey .sk-total { font-size: 18px; font-weight: 700; fill: var(--text); font-variant-numeric: tabular-nums; }
.sankey .sk-node.stale .sk-name { fill: var(--muted); }
.sankey .sk-ribbon, .sankey .sk-node, .sankey .sk-dot { transition: opacity .25s var(--ease); }
.sankey.focus .sk-ribbon:not(.on), .sankey.focus .sk-dot:not(.on), .sankey.focus .sk-node:not(.on):not(.sk-pool) { opacity: .25; }
.sankey .sk-node:focus-visible { outline: none; } .sankey .sk-node:focus-visible rect:first-child { stroke: var(--accent); stroke-width: 2; }

/* Roles & permissions (Fase 1) ---------------------------------------------------------- */
.perm-grid th, .perm-grid td { text-align: center; }
.perm-grid th:first-child, .perm-grid td:first-child { text-align: left; }
.perm-cell input { width: 18px; height: 18px; accent-color: var(--accent); }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 520px; }
.perm-chips .chip { display: inline-flex; flex-direction: column; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; line-height: 1.3; }
.perm-chips .chip em { font-style: normal; color: var(--muted); font-size: 11px; }

/* Brand logo (inline SVG: letters follow currentColor, infinity follows --accent) */
.sidebar .brand svg.brand-logo { height: 26px; width: auto; display: block; }
.sidebar .brand img.brand-mini { display: none; width: 30px; height: 30px; border-radius: 9px; }
.shell[data-collapsed="true"] .sidebar .brand svg.brand-logo { display: none; }
.shell[data-collapsed="true"] .sidebar .brand img.brand-mini { display: block; }
.public-head .brand svg.brand-logo { height: 26px; width: auto; display: block; }
.auth .logo-inline { display: flex; justify-content: center; }
.auth .logo-inline svg { width: 150px; height: auto; }
@media (max-width: 900px) {
  .shell[data-collapsed="true"] .sidebar .brand svg.brand-logo { display: block; }
  .shell[data-collapsed="true"] .sidebar .brand img.brand-mini { display: none; }
}
