/* DRW Tax — token warna di :root, mode gelap dipilih (bukan dibalik otomatis). */
:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e2e1dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7974;
  --accent: #256abf;
  --accent-ink: #ffffff;
  --accent-soft: #e6effb;
  --series-1: #2a78d6;  /* terbayar */
  --series-2: #eb6834;  /* belum lunas */
  --bar: #2a78d6;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-soft: #e3f4e3; --warning-soft: #fdf1d6; --serious-soft: #fbe6dd; --critical-soft: #f8e0e0;
  --status-ink: #0b0b0b;
  --grid: #e8e7e3;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #2f2f2c;
    --text: #ffffff; --text-2: #c3c2b7; --muted: #9a998f;
    --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #1b2a3d;
    --series-1: #3987e5; --series-2: #d95926; --bar: #3987e5;
    --good-soft: #17301a; --warning-soft: #3a2e12; --serious-soft: #3b2418; --critical-soft: #3d1a1a;
    --status-ink: #ffffff; --grid: #2a2a27;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #2f2f2c;
  --text: #ffffff; --text-2: #c3c2b7; --muted: #9a998f;
  --accent: #3987e5; --accent-ink: #ffffff; --accent-soft: #1b2a3d;
  --series-1: #3987e5; --series-2: #d95926; --bar: #3987e5;
  --good-soft: #17301a; --warning-soft: #3a2e12; --serious-soft: #3b2418; --critical-soft: #3d1a1a;
  --status-ink: #ffffff; --grid: #2a2a27;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.boot { padding: 40px; color: var(--muted); }
.hidden { display: none !important; }

/* ── Kerangka ── */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; white-space: nowrap; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav a { padding: 7px 11px; border-radius: 8px; color: var(--text-2); white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.user { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Komponen ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 0; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.kpi { padding: 14px 16px; }
.kpi .label { color: var(--text-2); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .foot { color: var(--muted); font-size: 12px; margin-top: 2px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical); }
.btn.sm { padding: 4px 8px; font-size: 12px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.icon { width: 16px; height: 16px; flex: none; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; flex: none; accent-color: var(--accent); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 550; }
label.f .help { font-weight: 400; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters > * { width: auto; }
.filters input[type=search] { min-width: 220px; }

.table-wrap { overflow-x: auto; overflow-y: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; color: var(--text-2); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td .sub { color: var(--muted); font-size: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 560;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-soft); color: var(--status-ink); } .badge.good .dot { background: var(--good); }
.badge.warning { background: var(--warning-soft); color: var(--status-ink); } .badge.warning .dot { background: var(--warning); }
.badge.serious { background: var(--serious-soft); color: var(--status-ink); } .badge.serious .dot { background: var(--serious); }
.badge.critical { background: var(--critical-soft); color: var(--status-ink); } .badge.critical .dot { background: var(--critical); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 550; }

.alerts { display: flex; flex-direction: column; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
.alert:last-child { border-bottom: 0; }
.alert:hover { background: var(--surface-2); text-decoration: none; }
.alert .sev { flex: none; margin-top: 2px; }
.alert.critical .sev { color: var(--critical); } .alert.serious .sev { color: var(--serious); } .alert.warning .sev { color: var(--warning); }

.note { padding: 12px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: 13px; }
.note.warn { background: var(--warning-soft); }
.note ul { margin: 6px 0 0; padding-left: 18px; }


/* Detail */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: 12px; padding-top: 1px; }
.dl dd { margin: 0; word-break: break-word; }
@media (max-width: 600px) { .dl { grid-template-columns: minmax(0, 1fr); } .dl dd { margin-bottom: 6px; } }

/* Chart */
.chart { position: relative; padding: 8px 16px 12px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 16px 0; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; min-width: 160px; z-index: 5; }
.tip .row { display: flex; justify-content: space-between; gap: 12px; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hbars { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.hbar .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 420px; }
.toast.err { background: var(--critical); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; }

/* Login — split: panel brand (kiri) + kartu (kanan) */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.login-hero { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; padding: 56px 64px;
  background: radial-gradient(1000px 600px at 0% 0%, #1f5fb8 0%, transparent 60%), radial-gradient(800px 600px at 100% 100%, #0e7a6d 0%, transparent 55%), #0b1a33; }
.login-grid { position: absolute; inset: 0; opacity: .14;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%); }
.login-glow { position: absolute; width: 420px; height: 420px; right: -120px; top: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(94,234,212,.28), transparent 65%); filter: blur(10px); }
.login-hero-in { position: relative; max-width: 520px; }
.login-hero .login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 44px; }
.login-hero .logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #3b8cf0, #14b8a6); box-shadow: 0 8px 24px rgba(20,184,166,.35), inset 0 0 0 1px rgba(255,255,255,.25); }
.login-hero .logo .icon { width: 22px; height: 22px; }
.login-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.login-tag { font-size: 12px; color: rgba(255,255,255,.65); }
.login-headline { font-size: 36px; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; margin: 0 0 14px; }
.login-headline .hl { background: linear-gradient(90deg, #7dd3fc, #5eead4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-sub { margin: 0 0 28px; color: rgba(255,255,255,.74); font-size: 15px; line-height: 1.6; }
.login-preview { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 16px 18px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); margin-bottom: 30px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.lp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: rgba(255,255,255,.7); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.lp-head b { font-size: 24px; color: #5eead4; letter-spacing: -.02em; text-transform: none; }
.lp-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 12px; color: rgba(255,255,255,.78); margin: 7px 0; }
.lp-row em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
.lp-track { position: relative; height: 8px; background: rgba(255,255,255,.1); border-radius: 0 4px 4px 0; }
.lp-fill { height: 100%; width: var(--w); background: rgba(147,197,253,.55); border-radius: 0 4px 4px 0; transform-origin: left; animation: lp-grow .9s cubic-bezier(.2,.8,.2,1) var(--d) both; }
.lp-fill.on { background: linear-gradient(90deg, #3b8cf0, #2dd4bf); box-shadow: 0 0 12px rgba(45,212,191,.45); }
.lp-floor { position: absolute; left: 34%; top: -4px; bottom: -4px; border-left: 2px dashed rgba(255,255,255,.55); }
.lp-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: rgba(255,255,255,.65); }
.lp-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.18); }
@keyframes lp-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .lp-fill { animation: none; } }
.login-feat { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.login-feat li { display: flex; gap: 12px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: rgba(255,255,255,.68); }
.login-feat b { color: #fff; font-size: 13.5px; font-weight: 600; }
.login-feat .fi { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #7dd3fc;
  background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.login-main { position: relative; display: grid; justify-items: center; align-items: center; padding: 48px 24px;
  background: radial-gradient(700px 400px at 50% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.login-wrap { width: min(420px, 100%); }
.login-card { padding: 40px 36px; border-radius: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 50px rgba(11,26,51,.12); }
.login-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.login-eyebrow .icon { width: 13px; height: 13px; }
.login h1 { font-size: 26px; margin: 0 0 8px; letter-spacing: -.02em; }
.login-lead { margin: 0 0 24px; color: var(--text-2); line-height: 1.55; }
.btn.primary.login-btn { width: 100%; justify-content: center; padding: 13px 16px; font-size: 15px; border-radius: 11px;
  background: linear-gradient(135deg, #2a78d6, #1f9e8f); border: 0; box-shadow: 0 8px 22px rgba(42,120,214,.32); transition: transform .15s, box-shadow .15s; }
.btn.primary.login-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(42,120,214,.4); filter: none; }
.login-btn .arr { transition: transform .15s; }
.login-btn:hover .arr { transform: translateX(3px); }
.login-err { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin-bottom: 16px; border-radius: 8px;
  background: var(--critical-soft); color: var(--status-ink); font-size: 13px; }
.login-err .icon { color: var(--critical); margin-top: 2px; }
.login-points { list-style: none; margin: 26px 0 0; padding: 20px 0 0; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.login-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.login-points .icon { color: var(--accent); margin-top: 1px; }
.login-points b { color: var(--text); font-weight: 600; }
.login-actions { display: flex; gap: 8px; }
.login-actions .btn { flex: 1; justify-content: center; padding: 10px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 0; }
@media (max-width: 1100px) { .login-hero { padding: 48px 40px; } .login-feat { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 28px 20px 30px; }
  .login-hero .login-brand { margin-bottom: 20px; }
  .login-headline { font-size: 24px; }
  .login-sub { margin: 0 0 18px; font-size: 14px; }
  .login-preview { margin-bottom: 0; }
  .login-feat { display: none; }
  .login-main { align-items: start; padding: 24px 16px 40px; }
  .login-card { padding: 28px 22px; }
}
.doc { max-width: 720px; margin: 40px auto; padding: 0 16px; }
.doc h2 { margin: 20px 0 6px; }

/* ── DRW Tax ── */
.topbar-in { max-width: 1440px; }
.main { max-width: 1440px; }
.nav a { padding: 7px 9px; font-size: 13px; }
.app-foot { display: block; max-width: 1440px; margin: 0 auto; padding: 0 16px 32px; }
.hide-sm { }
@media (max-width: 700px) { .hide-sm { display: none; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
tfoot th { background: var(--surface-2); }
.grid-2 { grid-template-columns: minmax(0, 3fr) minmax(300px, 1.4fr); }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Konteks entitas/tahun */
.ctx { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; }
.ctx-f { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.ctx-f select { min-width: 160px; text-transform: none; font-weight: 500; letter-spacing: 0; }
.ctx-f:first-child select { min-width: 240px; }
.ctx-extra { margin-left: auto; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
@media (max-width: 600px) { .ctx-f, .ctx-f select, .ctx-f:first-child select { width: 100%; min-width: 0; } .ctx-extra { margin-left: 0; } }
.empty-state { text-align: center; padding: 40px 16px; }
.empty-state .btn { margin-top: 8px; }

/* Kartu efisiensi: tiga angka pajak */
.eff-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.eff-head p { margin: 2px 0 0; }
.eff-kpis { display: flex; gap: 10px; }
.eff-kpi { padding: 8px 14px; border-radius: 10px; background: var(--surface-2); min-width: 130px; }
.eff-kpi .label { font-size: 11px; color: var(--text-2); font-weight: 600; }
.eff-kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.eff-kpi.hero { background: var(--accent-soft); }
.eff-kpi.hero .value { color: var(--accent); }
.pbars { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.pbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pbar-track { position: relative; height: 12px; background: var(--surface-2); border-radius: 0 6px 6px 0; margin-top: 5px; }
.pbar-fill { height: 100%; background: color-mix(in srgb, var(--bar) 45%, var(--surface)); border-radius: 0 4px 4px 0; min-width: 2px; }
.pbar-fill.strong { background: var(--bar); }
.pbar-floor { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--text-2); }
.pbar-sub { margin-top: 3px; }
.legend-floor { margin: 12px 0 0; display: flex; gap: 8px; align-items: center; }
.floor-key { display: inline-block; width: 0; height: 14px; border-left: 2px dashed var(--text-2); flex: none; }

/* Insight */
.insights { display: flex; flex-direction: column; gap: 10px; }
.ins { border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.ins.critical { border-left-color: var(--critical); } .ins.serious { border-left-color: var(--serious); }
.ins.warning { border-left-color: var(--warning); } .ins.info { border-left-color: var(--accent); } .ins.good { border-left-color: var(--good); }
.ins-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ins-hemat { margin-left: auto; }
.ins p { margin: 6px 0 0; color: var(--text-2); font-size: 13px; }
.ins ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; text-align: left; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; line-height: 1.35; }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); text-decoration: none; }

/* Ringkasan fiskal samping */
.sticky { position: sticky; top: 72px; }
.sumrow { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 13px; border-bottom: 1px dashed var(--grid); }
.sumrow.b { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }

/* Tabel isian */
table.edit td { padding: 5px 8px; }
table.edit input, table.edit select { padding: 5px 8px; }
table.edit tr.auto td { background: var(--surface-2); }
table.eq input { min-width: 92px; }
table.recon td { padding: 6px 12px; }
table.recon tr.b td { font-weight: 650; }
table.recon tr.tot td { border-top: 2px solid var(--text); }
table.recon tr.sec td { background: var(--surface-2); font-size: 12px; color: var(--text-2); font-weight: 600; }

/* SP2DK */
.item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: var(--surface); }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.expo { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.expo > div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.play { margin-top: 8px; font-size: 13px; }
.play summary { cursor: pointer; color: var(--accent); font-weight: 550; }
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.step:last-child { border-bottom: 0; }
.step input { margin-top: 3px; }
.step.done { opacity: .6; } .step.done b { text-decoration: line-through; }
.step.late { background: var(--critical-soft); }
.files { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.files a { display: inline-flex; gap: 6px; align-items: center; }
.upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.upload > * { width: auto; }

/* Surat */
.letter { background: #fff; color: #111; max-width: 800px; margin: 0 auto; padding: 48px 56px; border: 1px solid var(--border); border-radius: 6px;
  font-family: "Times New Roman", Georgia, serif; font-size: 15px; line-height: 1.6; box-shadow: var(--shadow); }
.letter:focus { outline: 2px solid var(--accent); }
.letter .kop { border-bottom: 3px double #111; padding-bottom: 10px; margin-bottom: 18px; text-align: center; }
.letter .meta-surat td { padding: 0 8px 0 0; border: 0; }
.letter .ttd { margin-top: 32px; }
.letter ol { padding-left: 20px; }
.letter p { margin: 6px 0; }
@media (max-width: 600px) { .letter { padding: 24px 18px; } }

/* Konsultan AI */
.chat-wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .chat-wrap { grid-template-columns: minmax(0, 1fr); } .threads { order: 2; } }
.threads { align-self: start; max-height: 75vh; overflow: auto; }
.tl { display: flex; flex-direction: column; padding: 8px 0; }
.tl-item { display: flex; flex-direction: column; padding: 8px 16px; color: var(--text); cursor: pointer; border-left: 3px solid transparent; font-size: 13px; }
.tl-item:hover { background: var(--surface-2); text-decoration: none; }
.tl-item.active { border-left-color: var(--accent); background: var(--accent-soft); }
.chat { display: flex; flex-direction: column; min-height: 70vh; }
.msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; }
.msg { max-width: 92%; }
.msg.user { align-self: flex-end; }
.msg.user .msg-body { background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 14px 14px 4px 14px; }
.msg.assistant .msg-body { background: var(--surface-2); padding: 12px 16px; border-radius: 14px 14px 14px 4px; }
.msg-meta { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }
.msg-body p { margin: 0 0 8px; } .msg-body p:last-child { margin-bottom: 0; }
.msg-body h2, .msg-body h3, .msg-body h4 { margin: 12px 0 6px; font-size: 15px; }
.msg-body ul, .msg-body ol { margin: 4px 0 8px; padding-left: 20px; }
.msg-body code { background: var(--surface); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.md-table { margin: 8px 0; font-size: 13px; background: var(--surface); }
.md-table th, .md-table td { padding: 6px 8px; }
.typing { animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .4; } }
.ask { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); align-items: flex-end; }
.ask textarea { min-height: 44px; }
.chat-note { padding: 0 12px 10px; margin: 0; }
.chat-empty { margin: auto; text-align: center; max-width: 640px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.logo.big { width: 48px; height: 48px; border-radius: 12px; }
.err-text { color: var(--critical); }
.guide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.guide ul, .guide ol { padding-left: 18px; margin: 8px 0 0; }
.guide li { margin-bottom: 4px; }
@media (max-width: 420px) { .guide { grid-template-columns: minmax(0, 1fr); } }
.checklist { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.checklist .check { align-items: flex-start; }
.checklist input { margin-top: 3px; }
.tip { white-space: nowrap; }

/* Cetak */
@media print {
  .topbar, .foot, .noprint, .ctx, .tabs, .actions, .page-head .actions, #sum, .toasts { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .grid-2 { display: block; }
  .letter { border: 0; box-shadow: none; padding: 0; max-width: none; }
}

/* Struktur grup & data contoh */
td.child { padding-left: 28px; position: relative; }
.tree { position: absolute; left: 12px; color: var(--muted); }
.demo-bar { background: var(--warning-soft); color: var(--status-ink); text-align: center; font-size: 12.5px; font-weight: 550; padding: 7px 16px; border-bottom: 1px solid var(--border); }
