/* Zen Studio — tenang, padat, kebaca. Satu file CSS, token di :root. */
:root {
  --bg: #f4f3ef; --surface: #ffffff; --surface-2: #f9f8f5; --ink: #1d2422; --mute: #66706c; --line: #e3e1da;
  --accent: #2f7d6d; --accent-ink: #ffffff; --accent-soft: #e3f0ec;
  --good: #2f7d4a; --good-soft: #e5f2e8; --warn: #a36312; --warn-soft: #fbf0dc; --crit: #b23b2e; --crit-soft: #f8e4e1;
  --r: 12px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121614; --surface: #1a201e; --surface-2: #161b19; --ink: #e7ebe9; --mute: #9aa5a0; --line: #2b3431;
    --accent: #5fb8a4; --accent-ink: #0f1513; --accent-soft: #1e3530;
    --good: #6cc48a; --good-soft: #1b3324; --warn: #e2a554; --warn-soft: #3a2c16; --crit: #ef8a7d; --crit-soft: #3d201c; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--mute); }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 700; font-size: 18px; padding: 4px 10px 16px; display: flex; gap: 8px; align-items: center; }
.brand i { width: 14px; height: 14px; border: 3px solid var(--accent); border-radius: 50%; display: inline-block; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.rail .me { margin-top: auto; font-size: 13px; color: var(--mute); padding: 10px; border-top: 1px solid var(--line); }
.rail .me button { margin-top: 6px; }
main { padding: 28px 32px 80px; max-width: 1180px; width: 100%; min-width: 0; }
.grid > * { min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--mute); margin: 2px 0 0; font-size: 14px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 6px; }

/* Mobile: rail jadi bar bawah */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px; border-right: 0; border-top: 1px solid var(--line); z-index: 20; overflow-x: auto; }
  .brand, .rail .me { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; white-space: nowrap; }
  main { padding: 20px 16px 96px; }
}

/* Komponen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .g2, .g3, .g4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .g2, .g3 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fit { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fit .kpi .val { font-size: 19px; overflow-wrap: anywhere; }
.kpi .lab { font-size: 12px; color: var(--mute); font-weight: 600; text-transform: none; }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--mute); }
.big { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.muted { color: var(--mute); } .small { font-size: 13px; } .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:hover { border-color: var(--mute); }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--crit); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; }
.field .help { font-size: 12px; color: var(--mute); }
input, select, textarea { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; width: 100%; }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.crit { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--mute); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
.tblwrap { overflow-x: auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--mute); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.note { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--mute); }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.crit { background: var(--crit-soft); color: var(--crit); } .alert.good { background: var(--good-soft); color: var(--good); }
.empty { padding: 28px; text-align: center; color: var(--mute); }
pre.md { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; max-height: 480px; overflow: auto; }

/* Funnel stage */
.funnel { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.funnel .st { flex: 1; min-width: 92px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-decoration: none; color: var(--ink); }
.funnel .st b { display: block; font-size: 20px; }
.funnel .st span { font-size: 12px; color: var(--mute); }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* Toast & modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 100; font-size: 14px; max-width: calc(100vw - 32px); white-space: pre-line; }
.toast.err { background: var(--crit); color: #fff; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; padding: 20px; width: min(640px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); }
