/* Dasar bersama: reset, tombol, input, chip, menu, modal, toast */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(94, 230, 214, .28); }

/* scrollbar tipis */
* { scrollbar-width: thin; scrollbar-color: rgba(160, 180, 255, .16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(160, 180, 255, .14); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- merek ---- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 26px; height: 26px; }
.brand b { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .14em; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.eyebrow i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--fire); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 10px var(--fire-glow); }

/* avatar maskot dalam lingkaran gelap */
.avatar { border-radius: 50%; background: radial-gradient(120% 120% at 50% 20%, #1a2140 0%, #0b1022 70%); overflow: hidden; flex: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }

/* ---- tombol ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none;
  font-weight: 500; font-size: 13.5px; transition: background .18s var(--ease), border-color .18s var(--ease), color .18s, box-shadow .18s;
}
.btn:hover { background: rgba(160, 180, 255, .06); border-color: rgba(160, 180, 255, .3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--fire); border-color: var(--fire); color: #04211f; font-weight: 600; box-shadow: 0 0 0 0 var(--fire-glow); }
.btn.primary:hover { background: var(--fire-core); border-color: var(--fire-core); box-shadow: 0 0 24px -4px var(--fire-glow); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(160, 180, 255, .06); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.warn { color: var(--ember); }

/* ---- input ---- */
.input {
  width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-2);
  padding: 0 12px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: rgba(94, 230, 214, .55); }
.input::placeholder { color: var(--dim); }

/* ---- chip / badge ---- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); font: 500 11.5px/1 var(--font-mono); color: var(--muted); white-space: nowrap;
}
.chip.fire { color: var(--fire); border-color: rgba(94, 230, 214, .35); background: var(--fire-soft); }
.chip.ember { color: var(--ember); border-color: rgba(255, 179, 92, .35); background: var(--ember-soft); }
.chip .plus { color: var(--fire); }
.chip .minus { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.live { background: var(--fire); box-shadow: 0 0 0 3px rgba(94, 230, 214, .14); }
.dot.down { background: var(--ember); }

/* ---- menu popover ---- */
.pop {
  position: absolute; z-index: 60; min-width: 220px; background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow-pop); padding: 6px; animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop .item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none;
  text-align: left; cursor: pointer; color: var(--text); font-size: 13px; text-decoration: none;
}
.pop .item:hover, .pop .item.active { background: rgba(160, 180, 255, .07); }
.pop .item svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.pop .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.pop .head { padding: 8px 10px 6px; }

/* ---- modal ---- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(3, 4, 9, .72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 22px; animation: popIn .2s var(--ease); max-height: calc(100vh - 32px); overflow: auto; }
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ---- toast ---- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--surface-2); border-radius: 12px; padding: 11px 14px; box-shadow: var(--shadow-pop); font-size: 13.5px; display: flex; gap: 10px; align-items: center; animation: popIn .2s var(--ease); }
.toast.err { box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 179, 92, .35); }
.toast.err::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); flex: none; }
.toast.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fire); flex: none; }

/* bar atas situs untuk halaman publik (galeri, app) */
.sitebar { height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(6, 7, 13, .8); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.sitebar nav { display: flex; gap: 4px; margin-left: 8px; }
.sitebar nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 13.5px; }
.sitebar nav a:hover, .sitebar nav a[aria-current] { color: var(--text); background: rgba(160, 180, 255, .06); }
.sitebar .grow { flex: 1; }
@media (max-width: 560px) { .sitebar { padding: 0 16px; gap: 10px; } .sitebar nav { display: none; } }
