/* Dashboard: navy tenang + aksen kuning brand, Poppins, radius kecil, tanpa efek dekoratif. */
:root {
  --bg: #1a2748;
  --bg-2: #16213f;
  --panel: #213159;
  --panel-2: #2a3c69;
  --field: #16213f;
  --glass: rgba(33, 49, 89, .96);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #edf1fa;
  --muted: #95a3c4;
  --soft: #c6d0e8;
  --ink: #1a2748;
  --accent: #f5c84c;
  --accent-2: #f5c84c;
  --btn-ink: #1a2748;
  --warm: #f5c84c;
  --ok: #34d399;
  --bad: #f87171;
  --queued: #fbbf24;
  --work: #60a5fa;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(5, 10, 30, .35);
  --s1: #3987e5; /* seri grafik 1 (biru) — tervalidasi CVD di permukaan panel */
  --s2: #d95926; /* seri grafik 2 (oranye) */
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .brand { font-family: var(--font); font-weight: 600; letter-spacing: -.01em; }
a { color: var(--accent-2); }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.i { width: 1em; height: 1em; vertical-align: -.14em; flex: none; }
.crown { color: var(--accent); }
.small { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- tombol & input ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; text-decoration: none; color: var(--text); font-weight: 500; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .24); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--btn-ink); font-weight: 600; }
.btn.primary:hover { background: #f8d470; border-color: #f8d470; }
.btn.ghost { border-color: transparent; color: var(--soft); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.btn.danger { color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.btn.danger:hover { background: rgba(248, 113, 113, .1); }
.btn:disabled { opacity: .55; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.icon-btn.on { color: var(--warm); }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=email], input:not([type]), select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font-size: 13px;
}
input[type=number] { width: auto; }
textarea { resize: vertical; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(245, 200, 76, .15); }
::placeholder { color: #6f7ea3; }

/* ---------- topbar ---------- */
.topbar { position: fixed; inset: 0 0 auto; z-index: 20; height: 56px; display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--bg-2); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 16px; white-space: nowrap; }
.brand::before { content: "G"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--ink); font-weight: 700; font-size: 15px; }
.brand b { color: var(--text); font-weight: 600; }
.kantor-name { position: relative; padding-left: 16px; font-size: 14px; font-weight: 500; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.kantor-name::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 18px; margin-top: -9px; background: var(--line-2); }
.kantor-name:empty { display: none; }
.summary { display: flex; align-items: center; gap: 18px; font-size: 12px; color: var(--muted); margin-left: auto; }
.summary span { display: flex; align-items: center; gap: 6px; }
.summary span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.summary .ok::before { background: var(--ok); } .summary .run::before { background: var(--work); } .summary .bad::before { background: var(--bad); }
.summary .muted::before { display: none; }
.summary b { color: var(--text); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.summary .muted { padding-left: 18px; border-left: 1px solid var(--line-2); }
.actions { display: flex; align-items: center; gap: 4px; }
.banner { position: fixed; top: 56px; left: 0; right: 0; z-index: 15; padding: 8px 20px; background: #3a3219; color: #f7e3a6; border-bottom: 1px solid rgba(245, 200, 76, .3); font-size: 13px; text-align: center; }
.banner a { color: var(--accent); font-weight: 600; }

/* ---------- panggung 3D ---------- */
.office { overflow: hidden; }
.stage { position: fixed; inset: 0; }
.scene { position: absolute; inset: 0; }
.scene canvas { display: block; touch-action: none; }
.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hint { position: absolute; left: 20px; bottom: 126px; font-size: 11px; color: var(--muted); pointer-events: none; }

.bubble { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; gap: 1px; max-width: 190px;
  padding: 6px 10px 7px; border-radius: 8px; border: 1px solid rgba(26, 39, 72, .08); background: #fff; color: #1a2748; text-align: left;
  box-shadow: 0 4px 14px rgba(5, 10, 30, .28); font: 400 12px/1.35 var(--font); will-change: transform; margin-top: -10px; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble:hover { box-shadow: 0 0 0 2px var(--agent), 0 4px 14px rgba(5, 10, 30, .28); }
.b-name { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #6b7894; }
.b-name b { color: var(--agent); filter: brightness(.72) saturate(1.2); font-weight: 600; }
.b-text { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #b6bfd3; flex: none; display: inline-block; }
[data-status=working] .dot, .working-note .dot { background: var(--ok); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); } 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }

.commands { position: absolute; left: 20px; bottom: 20px; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px; width: min(700px, calc(100vw - 40px));
  background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cmd-form { flex-basis: 100%; display: flex; gap: 6px; margin-top: 6px; }
.cmd-form .btn { padding: 7px 18px; }
.cmd-label { font-size: 11px; font-weight: 500; color: var(--muted); padding: 0 10px 0 6px; white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }
.commands button[data-mode] { display: flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--soft); white-space: nowrap; }
.commands button[data-mode] svg { width: 16px; height: 16px; }
.commands button[data-mode]:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.commands button[aria-pressed=true] { background: rgba(245, 200, 76, .14); border-color: rgba(245, 200, 76, .35); color: var(--accent); }

/* ---------- feed ---------- */
.feed { position: absolute; top: 72px; right: 20px; bottom: 20px; width: 340px; display: flex; flex-direction: column; z-index: 10;
  background: var(--glass); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.feed-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; }
.feed-head .count { background: rgba(96, 165, 250, .16); color: var(--work); font-weight: 600; border-radius: 6px; font-size: 11px; padding: 1px 7px; }
.feed-head .count:empty { display: none; }
.feed-head .chev { margin-left: auto; width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.feed.collapsed { bottom: auto; }
.feed.collapsed .feed-head { border-bottom: 0; }
body:has(.banner:not([hidden])) .feed { top: 108px; }
.feed.collapsed .feed-list { display: none; }
.feed.collapsed .chev { transform: rotate(-90deg); }
.feed-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1; }
.feed-list li + li button { border-top: 1px solid var(--line); }
.feed-list li button { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; column-gap: 10px; row-gap: 1px; padding: 11px 16px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.feed-list li button:hover { background: rgba(255, 255, 255, .04); }
.feed-list .av { grid-row: span 2; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff;
  background: color-mix(in srgb, var(--agent) 70%, #1a2748); }
.feed-list .who { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.feed-list time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; align-self: center; }
.feed-list .what { grid-column: 2 / -1; font-size: 12px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-list .what .badge { margin-right: 6px; vertical-align: 1px; }
.feed-list .empty { padding: 16px; color: var(--muted); font-size: 13px; }

.badge { display: inline-block; font-size: 10.5px; font-weight: 500; padding: 1px 7px; border-radius: 5px; background: rgba(255, 255, 255, .08); color: var(--muted); white-space: nowrap; height: fit-content; }
.badge.done { background: rgba(52, 211, 153, .12); color: var(--ok); }
.badge.failed { background: rgba(248, 113, 113, .12); color: var(--bad); }
.badge.working { background: rgba(96, 165, 250, .14); color: var(--work); }
.badge.queued { background: rgba(251, 191, 36, .12); color: var(--queued); }
.badge.waiting { background: rgba(255, 255, 255, .08); color: var(--muted); }
.deleg { margin: 0 0 8px; font-size: 13px; color: var(--soft); }
.subs { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--field); font-size: 13px; }
.subs b { display: block; margin-bottom: 4px; color: var(--muted); font-weight: 500; }
.sub { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.link { border: 0; background: none; padding: 0; color: var(--accent-2); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- dialog agen ---------- */
.dlg { position: fixed; z-index: 30; top: 72px; bottom: 20px; right: 20px; left: auto; width: 420px; max-width: calc(100vw - 40px); max-height: calc(100dvh - 92px); margin: 0; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); color: var(--text); color: var(--text); box-shadow: var(--shadow); animation: slide-in .2s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }
body:has(.banner:not([hidden])) .dlg { top: 108px; max-height: calc(100dvh - 128px); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 16px; }
.dlg-head p { margin: 0; color: var(--muted); font-size: 12px; }
.chip-color { width: 4px; height: 34px; border-radius: 2px; flex: none; }
.status { margin-left: auto; font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status.working { color: var(--ok); }
.status.working::before { background: var(--ok); animation: pulse 1.3s infinite; }
.dlg-body { min-height: 0; flex: 1; overflow-y: auto; }
.task-form { padding: 16px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.task-form textarea { min-height: 90px; }
.templates { display: flex; flex-wrap: wrap; gap: 6px; }
.templates:empty { display: none; }
.tpl { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); cursor: pointer; font-size: 12px; color: var(--soft); }
.tpl:hover { border-color: var(--accent-2); color: var(--text); }
.handoff-note { background: rgba(245, 200, 76, .1); border: 1px solid rgba(245, 200, 76, .3); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; padding: 7px 10px; border-radius: 8px; }
.file-btn svg { width: 16px; height: 16px; }
.file-btn:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn:focus-within { outline: 2px solid var(--accent-2); }
.file-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.file-list li::before { content: "📎 "; }

.history { padding: 16px; }
.history h3 { margin: 0 0 10px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.task { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: rgba(0, 0, 0, .1); }
.task summary { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; list-style: none; }
.task summary::-webkit-details-marker { display: none; }
.task .t-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.task summary time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.t-body { padding: 0 12px 12px; }
.t-req { white-space: pre-wrap; font-size: 13px; color: var(--soft); background: var(--field); border-radius: 8px; padding: 8px 10px; max-height: 120px; overflow: auto; }
.t-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 13px; }
.result { background: #fff; color: #1a2748; border-radius: 8px; padding: 16px 18px; margin-top: 10px; font-size: 13px; line-height: 1.65; overflow-x: auto; }
.md h1, .md h2, .md h3 { line-height: 1.3; margin: .8em 0 .4em; } .md h1 { font-size: 1.3em; } .md h2 { font-size: 1.15em; } .md h3 { font-size: 1.05em; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 12px; } .md td, .md th { border: 1px solid #dde3f0; padding: 4px 8px; text-align: left; }
.md a { color: #2952c8; } .md code { background: #eef1f8; padding: 1px 4px; border-radius: 4px; }
.t-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.t-actions > button, .t-actions > a, .handoff button { padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text); text-decoration: none; }
.t-actions > button:hover, .t-actions > a:hover, .handoff button:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .24); }
.handoff { display: inline-flex; gap: 4px; margin-left: auto; }
.handoff select { width: auto; padding: 5px 8px; font-size: 13px; }
.revise { display: flex; gap: 6px; margin-top: 8px; align-items: flex-end; }
.error { font: 400 12px/1.5 var(--font); white-space: pre-wrap; background: rgba(248, 113, 113, .1); color: #fecaca; border-radius: 8px; padding: 8px 10px; font-size: 12px; margin: 8px 0 0; overflow-x: auto; }
.working-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.meta { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left-width: 3px; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; animation: rise .25s ease-out; }
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login form { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login .brand { justify-content: center; font-size: 20px; margin-bottom: 6px; color: var(--text); text-decoration: none; }
.login label { font-size: 12px; color: var(--soft); font-weight: 500; display: flex; flex-direction: column; gap: 6px; }
.login .btn.primary { padding: 10px; font-size: 14px; }
.login .switch a { color: var(--accent); font-weight: 600; }
.login .err { color: var(--bad); font-size: 14px; min-height: 1.2em; margin: 0; }
.login .tagline, .login .switch { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- pengaturan ---------- */
.settings .topbar { position: sticky; }
.settings main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }
.tabs { display: flex; gap: 2px; margin: 0 0 28px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-row .grow { flex: 1; min-width: 0; }
.card-row h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-row p { margin: 2px 0 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order { display: flex; flex-direction: column; }
.order button { width: 28px; height: 22px; }
.order svg { width: 16px; height: 16px; }
.num { width: 24px; height: 24px; border-radius: 6px; background: rgba(245, 200, 76, .14); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.pill { font-size: 10.5px; font-weight: 500; padding: 1px 7px; border-radius: 5px; background: rgba(255, 255, 255, .08); color: var(--muted); vertical-align: 2px; }
.pill.on { background: rgba(52, 211, 153, .12); color: var(--ok); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--soft); font-weight: 500; }
.form-grid label small { font-weight: 400; color: var(--muted); }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=color] { width: 48px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--field); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; }
.tpl-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 6px; margin-bottom: 6px; }
.doc-list { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; }
.doc-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-result { font-size: 13px; margin-top: 8px; }
.test-result.ok { color: var(--ok); } .test-result.bad { color: var(--bad); word-break: break-word; }
.table-wrap { overflow-x: auto; }
table.log { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log th, table.log td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.log th { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
table.log td.num-c { text-align: right; font-variant-numeric: tabular-nums; }
table.log th.num-c { text-align: right; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- dashboard admin ---------- */
.admin main { max-width: 1200px; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.adm-head h1 { margin: 0; font-size: 22px; }
.adm-head p { margin: 2px 0 0; font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-2); }
.seg button { border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 6px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed=true] { background: var(--panel-2); color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi.hero { grid-row: span 2; justify-content: center; }
.kpi-l { font-size: 12px; color: var(--muted); }
.kpi-v { font-size: 26px; font-weight: 600; line-height: 1.2; }
.kpi.hero .kpi-v { font-size: 52px; }
.delta { font-size: 12px; }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.adm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-grid .card { margin: 0; min-width: 0; }
.span2 { grid-column: 1 / -1; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.chart-head h2 { margin: 0; font-size: 15px; }
.chart-head p { margin: 2px 0 0; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--soft); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }
.chart { width: 100%; min-height: 220px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; stroke: none; fill: none; } /* jangan warisi gaya ikon global */
.chart .tick { fill: var(--muted); font: 400 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart .base { stroke: rgba(255, 255, 255, .2); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: rgba(255, 255, 255, .05); }
.tview { margin-top: 8px; }
.tview summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.tview .log { margin-top: 8px; }
.tview > div { max-height: 260px; overflow: auto; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.hb-l { color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 12px; }
.hb-t i { display: block; height: 100%; min-width: 2px; background: var(--s1); border-radius: 0 4px 4px 0; }
.hb-v { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.tip { position: absolute; z-index: 50; pointer-events: none; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; min-width: 130px; }
.tip-h { color: var(--muted); margin-bottom: 4px; }
.tip-r { display: flex; align-items: center; gap: 8px; }
.tip-r i { width: 12px; height: 2px; border-radius: 1px; }
.tip-r b { font-size: 14px; font-weight: 600; }
.tip-r span { color: var(--muted); }
body.loading .kpis, body.loading .adm-grid { opacity: .5; transition: opacity .2s; }
.admin-link { color: var(--accent) !important; }

/* ---------- WhatsApp ---------- */
.wa-warn .i { color: var(--accent); margin-right: 4px; }
.wa-warn { background: rgba(245, 200, 76, .07); border-color: rgba(245, 200, 76, .3); color: var(--soft); font-size: 13px; }
.wa-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.wa-dot.open { background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, .15); }
.wa-dot.qr, .wa-dot.connecting { background: var(--queued); animation: blinkwa 1.2s infinite; }
@keyframes blinkwa { 50% { opacity: .35; } }
.wa-qr { display: flex; gap: 24px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.wa-qr img { background: #fff; padding: 10px; border-radius: 8px; }
.wa-qr ol { margin: 0; padding-left: 20px; line-height: 2; color: var(--soft); }
.card-title { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.tema-card .presets { margin: 14px 0 4px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tema-card .form-actions .left { max-width: 420px; }
.kantor-form { display: flex; gap: 10px; align-items: flex-end; }
.kantor-form label { flex: 1; display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 500; color: var(--soft); }
.kantor-form small { font-weight: 400; color: var(--muted); }
.wa-izin { display: flex; gap: 8px; margin-top: 10px; }
.tg-code { color: var(--accent); font: 500 12px ui-monospace, "Cascadia Code", Consolas, monospace; }
.tg-steps { margin: 6px 0 14px; padding-left: 20px; line-height: 1.9; color: var(--soft); }
.wa-help td { white-space: normal; } .wa-help code { color: var(--accent); font: 500 12px ui-monospace, "Cascadia Code", Consolas, monospace; }

/* ---------- onboarding (/mulai) ---------- */
.onboard .topbar { position: sticky; }
.ob { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }
.ob h1 { font-size: clamp(22px, 3vw, 28px); margin: 8px 0 6px; }
.ob .lead { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.ob-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 26px; counter-reset: s; flex-wrap: wrap; }
.ob-steps li { counter-increment: s; display: flex; align-items: center; gap: 8px; padding-right: 14px; color: var(--muted); font-weight: 500; font-size: 13px; }
.ob-steps li::before { content: counter(s); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, .08); font-size: 12px; }
.ob-steps li.on { color: var(--text); } .ob-steps li.on::before { background: var(--accent); color: var(--btn-ink); }
.ob-card { padding: 24px; }
.ob-label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: var(--soft); }
.ob-label input { font-size: 15px; padding: 11px 14px; }
.ob-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.ob-nav .btn { padding: 9px 20px; font-size: 14px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.preset { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; }
.preset:hover { border-color: rgba(255, 255, 255, .28); background: #25375f; }
.preset.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.preset-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: rgba(245, 200, 76, .12); color: var(--accent); font-size: 18px; }
.preset b { font-size: 15px; font-weight: 600; }
.preset-desc { color: var(--muted); font-size: 12px; }
.preset-team { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.preset-team i { font-style: normal; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 5px; background: rgba(255, 255, 255, .06); border-left: 2px solid var(--c); color: var(--soft); }
.ob-count { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ob-agent { padding: 14px 16px; }
.ob-agent-row { display: flex; align-items: flex-end; gap: 10px; }
.ob-agent-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--soft); }
.ob-agent-row .grow { flex: 1; } .ob-agent-row .grow2 { flex: 2; }
.ob-agent-row .check { padding-bottom: 10px; font-size: 18px; }
.ob-agent-row input[type=color] { flex: none; }
.ob-agent details { margin-top: 10px; }
.ob-agent summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 12px; }
.ob-agent details label { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--soft); }
.ob-agent details small { font-weight: 400; color: var(--muted); }
.ob .err { color: var(--bad); min-height: 1.2em; }
.ob-modal { max-width: 500px; width: calc(100vw - 32px); border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); color: var(--text); padding: 30px; box-shadow: var(--shadow); }
.ob-modal::backdrop { background: rgba(10, 18, 40, .7); backdrop-filter: blur(4px); }
.ob-modal-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: rgba(245, 200, 76, .12); color: var(--accent); font-size: 22px; }
.ob-modal h2 { font-size: 18px; margin: 8px 0 12px; }
.ob-modal p { color: var(--soft); margin: 0 0 12px; font-size: 13px; }
.ob-modal code { color: var(--accent); font-weight: 500; }
.ob-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.ob-modal-actions .btn { padding: 9px 16px; }

/* ---------- responsif ---------- */
@media (max-width: 860px) {
  .summary { display: none; }
}
@media (max-width: 720px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand { font-size: 15px; }
  .kantor-name, .hide-sm { display: none; }
  .actions { margin-left: auto; }
  .feed, .feed.collapsed, body:has(.banner:not([hidden])) .feed { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 45vh; }
  .hint { display: none; }
  .commands { left: 10px; right: 10px; bottom: 66px; width: auto; justify-content: space-between; }
  .cmd-label { display: none; }
  .commands button[data-mode] { flex-direction: column; gap: 2px; padding: 5px 6px; }
  .commands button[data-mode] span { font-size: 10px; }
  .toasts { bottom: auto; top: 70px; }
  /* layar sempit: bubble cukup nama + status, teks lengkap ada di dialog */
  .bubble { font-size: 11px; padding: 4px 8px; }
  .bubble .b-text { display: none; }
  .task-form textarea { min-height: 64px; height: 72px; }
  .task-form > .small, .dlg-head p { display: none; }
  .dlg, body:has(.banner:not([hidden])) .dlg { top: auto; left: 0; right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 50dvh; max-height: 50dvh; border-radius: 12px 12px 0 0; }
  .form-grid { grid-template-columns: 1fr; }
  .adm-grid { grid-template-columns: 1fr; } .kpi.hero { grid-row: auto; } .kpi.hero .kpi-v { font-size: 40px; }
  .tpl-row { grid-template-columns: 1fr; }
  .ob-agent-row { flex-wrap: wrap; } .ob-agent-row .grow, .ob-agent-row .grow2 { flex: 1 1 100%; }
  .handoff { margin-left: 0; }
}
