/* Lumen-CommandCenter -- gaya sederhana & ringan: latar terang, kartu putih, satu warna aksen.
   Ikut tema sistem (terang/gelap). Tanpa font eksternal & tanpa gaya inline (CSP style-src 'self'). */

:root {
  --bg:#f5f6f8; --surface:#fff; --surface-2:#f0f2f5; --border:#e2e5ea; --border-soft:#eceef2;
  --text:#1c2230; --text-mute:#5b6577; --text-dim:#8a93a3;
  --accent:#2563eb; --accent-hover:#1d4ed8; --on-accent:#fff;
  --ok:#15803d; --ok-bg:#dcfce7; --warn:#a16207; --warn-bg:#fef3c7; --bad:#b91c1c; --bad-bg:#fee2e2;
  --info:#1d4ed8; --info-bg:#dbeafe; --idle:#64748b; --idle-bg:#e8ebf0;
  --font:system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --mono:ui-monospace,'SF Mono',Menlo,Consolas,monospace;
  --radius:8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#101319; --surface:#181c24; --surface-2:#1f242e; --border:#2b313d; --border-soft:#222833;
    --text:#e8ebf1; --text-mute:#a1a9b8; --text-dim:#6f7888;
    --accent:#4f8cff; --accent-hover:#6b9dff; --on-accent:#0b1220;
    --ok:#4ade80; --ok-bg:#14301f; --warn:#facc15; --warn-bg:#3a2f0b; --bad:#f87171; --bad-bg:#3b1618;
    --info:#7cb0ff; --info-bg:#15264a; --idle:#94a3b8; --idle-bg:#262c38;
    color-scheme: dark;
  }
}

*,*::before,*::after{ box-sizing:border-box; }
html{ background:var(--bg); }
body{ margin:0; background:var(--bg); color:var(--text); font-family:var(--font); font-size:15px; line-height:1.5; }
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
h1,h2,h3{ text-wrap:balance; }
.app{ max-width:1200px; margin:0 auto; padding:0 16px 56px; }
.mono,.num{ font-family:var(--mono); font-variant-numeric:tabular-nums; }
.dim{ color:var(--text-dim); } .mute{ color:var(--text-mute); }

/* ---------- top bar ---------- */
.bar{ display:flex; align-items:center; justify-content:space-between; gap:12px 20px; flex-wrap:wrap;
  padding:14px 0; border-bottom:1px solid var(--border); }
.brand{ display:flex; align-items:center; gap:10px; color:var(--text); }
.brand:hover{ text-decoration:none; }
.brand img{ width:32px; height:32px; display:block; border-radius:6px; }
.brand-text{ display:flex; flex-direction:column; line-height:1.2; }
.wordmark{ font-size:1rem; font-weight:650; }
.brand-sub{ font-size:.75rem; color:var(--text-dim); }
.nav{ display:flex; gap:4px; flex-wrap:wrap; }
.nav a{ font-size:.875rem; color:var(--text-mute); padding:6px 12px; border-radius:6px; }
.nav a:hover{ background:var(--surface-2); color:var(--text); text-decoration:none; }
.nav a[aria-current="page"]{ background:var(--surface-2); color:var(--text); font-weight:600; }
.bar-right{ display:flex; align-items:center; gap:14px; }
.clock{ font-family:var(--mono); font-size:.8125rem; color:var(--text-dim); font-variant-numeric:tabular-nums; }
.who{ text-align:right; line-height:1.2; }
.who a{ color:var(--text); font-size:.875rem; font-weight:500; }
.who-role{ font-size:.6875rem; color:var(--text-dim); }
.linkbtn{ background:none; border:1px solid var(--border); border-radius:6px; color:var(--text-mute); font:inherit;
  font-size:.8125rem; padding:6px 12px; cursor:pointer; }
.linkbtn:hover{ color:var(--text); border-color:var(--text-dim); }

/* ---------- page head ---------- */
.head{ padding:24px 0 16px; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.eyebrow{ font-size:.8125rem; color:var(--text-dim); margin:0 0 4px; }
.head h1{ font-size:1.6rem; font-weight:650; line-height:1.2; margin:0; }
.head-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.head-meta{ font-size:.8125rem; color:var(--text-dim); line-height:1.6; }

/* ---------- buttons & forms ---------- */
.btn{ display:inline-block; background:var(--accent); color:var(--on-accent); border:1px solid transparent; border-radius:6px;
  font:inherit; font-size:.875rem; font-weight:600; padding:8px 16px; cursor:pointer; text-align:center; }
.btn:hover{ background:var(--accent-hover); text-decoration:none; }
.btn.alt{ background:var(--surface); color:var(--text); border-color:var(--border); }
.btn.alt:hover{ background:var(--surface-2); }
.btn.danger{ background:var(--bad); color:#fff; }
.btn[disabled]{ opacity:.55; cursor:wait; }
.field{ margin:0 0 16px; }
.field label{ display:block; font-size:.8125rem; font-weight:600; color:var(--text-mute); margin:0 0 5px; }
.field input,.field select,.field textarea{ width:100%; background:var(--surface); color:var(--text); border:1px solid var(--border);
  border-radius:6px; font:inherit; padding:9px 11px; }
.field textarea{ min-height:96px; resize:vertical; }
.field input:focus,.field select:focus,.field textarea:focus{ outline:2px solid var(--accent); outline-offset:-1px; border-color:var(--accent); }
.field .err{ color:var(--bad); font-size:.8125rem; margin-top:4px; }
.field .hint{ color:var(--text-dim); font-size:.8125rem; margin-top:4px; }
.row2{ display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.notice{ padding:10px 14px; background:var(--info-bg); color:var(--info); border-radius:6px; margin:0 0 16px; }
.notice.bad{ background:var(--bad-bg); color:var(--bad); }
.notice.good{ background:var(--ok-bg); color:var(--ok); }

/* ---------- pills & dots ---------- */
.pill{ display:inline-block; font-size:.75rem; font-weight:600; padding:2px 9px; border-radius:99px;
  background:var(--idle-bg); color:var(--idle); white-space:nowrap; }
.pill.online,.pill.st-active{ background:var(--ok-bg); color:var(--ok); }
.pill.degraded,.pill.st-suspended{ background:var(--warn-bg); color:var(--warn); }
.pill.offline{ background:var(--bad-bg); color:var(--bad); }
.pill.st-installing{ background:var(--info-bg); color:var(--info); }
.pill.unknown,.pill.unmonitored,.pill.revoked,.pill.st-planned,.pill.st-retired,.pill.st-pending,.pill.st-terminated{ background:var(--idle-bg); color:var(--idle); }
.tag{ display:inline-block; font-size:.6875rem; font-weight:600; padding:1px 7px; border-radius:99px; background:var(--info-bg); color:var(--info); vertical-align:middle; }
.note-line{ font-size:.8125rem; margin:10px 0 0; }
.field.check label{ display:flex; align-items:center; gap:8px; font-weight:500; color:var(--text); }
.field.check input{ width:auto; }
.kind{ font-size:.75rem; color:var(--text-dim); }
.dot{ display:inline-block; width:9px; height:9px; margin-right:7px; border-radius:50%; background:var(--idle); vertical-align:middle; }
.dot.online{ background:var(--ok); } .dot.degraded{ background:var(--warn); } .dot.offline{ background:var(--bad); }

/* ---------- ringkasan ---------- */
.stats{ display:grid; grid-template-columns:repeat(5,1fr); gap:12px; }
.stat{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; flex-direction:column; }
.stat .n{ font-size:1.9rem; font-weight:600; line-height:1.1; font-variant-numeric:tabular-nums; }
.stat .l{ font-size:.8125rem; color:var(--text-mute); margin-top:4px; }
.stat .s{ font-size:.75rem; color:var(--text-dim); }
.stat.lime .n{ color:var(--ok); } .stat.amber .n{ color:var(--warn); } .stat.red .n{ color:var(--bad); }
.stat.cobalt .n,.stat.violet .n{ color:var(--accent); }

/* ---------- toolbar / filter ---------- */
.toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:22px 0 12px; }
.chips{ display:flex; gap:6px; flex-wrap:wrap; }
.chip{ background:var(--surface); color:var(--text-mute); border:1px solid var(--border); border-radius:99px; font:inherit;
  font-size:.8125rem; padding:4px 13px; cursor:pointer; }
.chip:hover{ color:var(--text); }
.chip[aria-pressed="true"]{ background:var(--accent); border-color:var(--accent); color:var(--on-accent); font-weight:600; }

/* ---------- kartu site ---------- */
.sites{ display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:12px; }
.site{ display:flex; flex-direction:column; gap:8px; min-height:150px; padding:16px; background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-left:4px solid var(--idle); border-radius:var(--radius); }
.site:hover{ border-color:var(--text-dim); border-left-color:var(--idle); text-decoration:none; }
.site.online{ border-left-color:var(--ok); } .site.degraded{ border-left-color:var(--warn); } .site.offline{ border-left-color:var(--bad); }
.site[hidden]{ display:none; }
.site-top{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
.site h3{ margin:0; font-size:1.125rem; font-weight:600; overflow-wrap:anywhere; }
.site .sub{ color:var(--text-mute); font-size:.875rem; min-height:1.3em; }
.site .ip{ font-family:var(--mono); font-size:.8125rem; color:var(--text-mute); }
.site .health{ margin-top:auto; display:flex; justify-content:space-between; align-items:baseline; gap:8px; font-size:.8125rem; color:var(--text-mute); }
.site .health b{ color:var(--text); font-weight:600; }
.site .ver{ font-family:var(--mono); font-size:.75rem; color:var(--text-dim); }
.empty{ padding:40px 0; color:var(--text-dim); text-align:center; }

/* ---------- panel ---------- */
.cols{ display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:12px; align-items:start; }
.panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px 20px; margin-bottom:12px; }
.panel h2{ margin:0 0 14px; font-size:.9375rem; font-weight:650; }
.kv{ display:grid; grid-template-columns:140px 1fr; gap:8px 16px; margin:0; }
.kv dt{ color:var(--text-dim); font-size:.8125rem; }
.kv dd{ margin:0; overflow-wrap:anywhere; }
.notes{ white-space:pre-wrap; }
table{ width:100%; border-collapse:collapse; }
th{ text-align:left; font-size:.75rem; color:var(--text-dim); font-weight:600; padding:0 12px 8px 0; }
td{ padding:8px 12px 8px 0; border-top:1px solid var(--border-soft); vertical-align:top; overflow-wrap:anywhere; }
.tbl-wrap{ overflow-x:auto; }
td.nw{ white-space:nowrap; }
.timeline{ list-style:none; margin:0; padding:0; }
.timeline li{ display:grid; grid-template-columns:130px 1fr; gap:12px; padding:9px 0; border-top:1px solid var(--border-soft); }
.timeline li:first-child{ border-top:0; }
.timeline .at{ font-family:var(--mono); font-size:.75rem; color:var(--text-dim); }
.timeline .ev b{ font-weight:600; }
.timeline .det{ color:var(--text-mute); font-size:.875rem; overflow-wrap:anywhere; }
.spark{ width:100%; height:84px; display:block; }
.spark polyline{ fill:none; stroke:var(--accent); stroke-width:2; vector-effect:non-scaling-stroke; }
.spark rect.down{ fill:var(--bad); opacity:.4; }
.spark-legend{ font-size:.75rem; color:var(--text-dim); margin-top:6px; }
.feed{ margin-top:24px; }
.feed h2{ font-size:.9375rem; font-weight:650; margin:0 0 8px; }

/* ---------- login & akun ---------- */
.auth{ min-height:100vh; display:grid; place-items:center; padding:24px 16px; }
.auth-box{ width:min(400px,100%); }
.auth-brand{ display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.auth-brand img{ width:44px; height:44px; border-radius:8px; }
.auth-box h1{ font-size:1.5rem; margin:0 0 4px; }
.auth-box .card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; margin-top:16px; }
.qr{ background:#fff; display:inline-block; padding:6px; border-radius:6px; }
.qr svg{ display:block; width:240px; height:240px; max-width:100%; height:auto; aspect-ratio:1; }
.secret{ font-family:var(--mono); letter-spacing:.06em; background:var(--surface-2); border-radius:6px; padding:8px 12px; display:inline-block; user-select:all; }
.code-input{ font-family:var(--mono); font-size:1.5rem; letter-spacing:.3em; text-align:center; }

@media (max-width:1000px){ .stats{ grid-template-columns:repeat(3,1fr); } .cols{ grid-template-columns:1fr; }
  .clock{ display:none; } .nav a{ padding:6px 9px; } }
@media (max-width:600px){
  .stats{ grid-template-columns:repeat(2,1fr); }
  .row2{ grid-template-columns:1fr; } .kv{ grid-template-columns:1fr; gap:2px 0; } .kv dd{ margin-bottom:10px; }
  .timeline li{ grid-template-columns:1fr; gap:2px; }
  .clock{ display:none; }
}
@media (prefers-reduced-motion:reduce){ *{ transition:none !important; animation:none !important; } }
