/* ===== DIY Payment Gateway - gaya datar & bersih ===== */
:root {
  --bg: #0a1020;
  --surface: #111a2e;
  --surface-solid: #0f172a;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --accent: 96 165 250;     /* blue-400 */
  --success: 52 211 153;    /* emerald-400 */
  --warn: 251 191 36;       /* amber-400 */
  --danger: 251 113 133;    /* rose-400 */
  --radius: 1rem;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -0.005em;
  line-height: 1.55;
  background-color: var(--bg);
}

::selection { background: rgb(var(--accent) / 0.35); }

/* Angka rapi sejajar (nominal, statistik, tabel) */
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ----- Card ----- */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.glow-hover, .glow-success { }

/* ----- Form ----- */
.label { display: block; margin-bottom: 0.375rem; font-size: 0.8125rem; font-weight: 500; color: rgb(203 213 225); }

.field {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: rgb(241 245 249);
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.field::placeholder { color: rgb(100 116 139); }
.field:hover { border-color: var(--border-strong); }
.field:focus {
  border-color: rgb(var(--accent) / 0.7);
  background: rgba(2, 6, 23, 0.85);
  box-shadow: 0 0 0 3px rgb(var(--accent) / 0.16);
}
.hint { margin-top: 0.375rem; font-size: 0.75rem; color: rgb(100 116 139); }

/* ----- Tombol ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem; font-weight: 600; color: #fff;
  border: 1px solid transparent; border-radius: 0.625rem; cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s var(--ease), background-color 0.2s var(--ease);
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(var(--accent) / 0.35); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; filter: none; }
.btn-primary { background: rgb(37 99 235); }
.btn-success { background: rgb(5 150 105); }
.btn-ghost { background: rgba(148, 163, 184, 0.08); border-color: var(--border); color: rgb(226 232 240); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.14); border-color: var(--border-strong); }
.btn-danger { background: rgba(244, 63, 94, 0.12); border-color: rgb(var(--danger) / 0.3); color: rgb(var(--danger)); }
.btn-danger:hover { background: rgba(244, 63, 94, 0.2); }

/* ----- Tabel ----- */
.table-wrap { overflow-x: auto; border-radius: 0.75rem; }
.data-table { width: 100%; font-size: 0.8125rem; text-align: left; border-collapse: collapse; }
.data-table thead th {
  padding: 0.75rem; font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: rgb(148 163 184); background: rgba(148, 163, 184, 0.06); white-space: nowrap;
}
.data-table tbody tr { border-top: 1px solid var(--border); transition: background-color 0.2s var(--ease); }
.data-table tbody tr:hover { background: rgba(148, 163, 184, 0.05); }

/* ----- Badge status ----- */
.badge { display: inline-block; padding: 0.15rem 0.6rem; font-size: 0.7rem; font-weight: 600; border-radius: 999px; border: 1px solid transparent; }
.badge-paid    { color: rgb(var(--success)); background: rgb(var(--success) / 0.12); border-color: rgb(var(--success) / 0.25); }
.badge-pending { color: rgb(var(--warn));    background: rgb(var(--warn) / 0.12);    border-color: rgb(var(--warn) / 0.25); }
.badge-expired { color: rgb(148 163 184);    background: rgba(148,163,184,.10);       border-color: rgba(148,163,184,.22); }

/* ----- Kode & blok kunci ----- */
.code-chip {
  display: inline-block; max-width: 100%; padding: 0.2rem 0.55rem; overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem;
  color: rgb(var(--warn)); background: rgba(2, 6, 23, 0.7); border: 1px solid var(--border); border-radius: 0.4rem;
}

/* ----- QR ----- */
.qr-frame {
  display: inline-block; padding: 0.875rem; background: #fff; border-radius: 0.875rem;
}

/* ----- Toast ----- */
#toasts { position: fixed; z-index: 80; right: 1rem; top: calc(max(env(safe-area-inset-top, 0px), 2.1rem) + 0.5rem); display: flex; flex-direction: column; gap: 0.5rem; max-width: calc(100vw - 2rem); }
.toast {
  padding: 0.65rem 0.9rem; font-size: 0.8125rem; color: rgb(226 232 240);
  background: #16213a; border: 1px solid var(--border-strong); border-radius: 0.65rem;
  animation: toast-in 0.28s var(--ease) both;
}
.toast-success { border-color: rgb(var(--success) / 0.4); }
.toast-error   { border-color: rgb(var(--danger) / 0.45); }
.toast.leaving { animation: toast-out 0.22s var(--ease) both; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(6px); } }

/* ----- Denyut halus untuk status menunggu ----- */
.pulse-soft { animation: pulse-soft 2.2s ease-in-out infinite; }
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Hormati preferensi pengguna yang mengurangi animasi */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ===== Utilitas ===== */
.is-hidden { display: none !important; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; border-radius: 0.5rem; }
.truncate-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Foto latar (diisi lewat .env: LOGIN_BG_URL / DASHBOARD_BG_URL, host catbox) ===== */
body.has-bg::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background-image: var(--bg-image); background-size: cover; background-position: center;
  animation: bg-in 0.9s var(--ease) both;
}
body.has-bg::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: rgba(10, 16, 32, 0.78);
}
@keyframes bg-in { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }

/* ===== Avatar ===== */
.avatar {
  flex: none; width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  font-weight: 600; color: rgb(var(--accent)); text-transform: uppercase;
  background: rgb(var(--accent) / 0.12); border: 1px solid rgb(var(--accent) / 0.3); border-radius: 999px;
}

/* ===== Kartu saldo + ikon mata ===== */
.balance-amount { margin-top: 0.5rem; font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.sensitive { transition: opacity 0.15s var(--ease), filter 0.15s var(--ease); }
.sensitive.fading { opacity: 0; filter: blur(6px); }

.detail-tile {
  padding: 0.8rem 0.95rem; background: rgba(2, 6, 23, 0.4); border: 1px solid var(--border); border-radius: 0.75rem;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.detail-tile:hover { border-color: var(--border-strong); background: rgba(2, 6, 23, 0.55); }
.tile-label { font-size: 0.72rem; color: rgb(148 163 184); }
.tile-value { margin-top: 0.15rem; font-size: 1.05rem; font-weight: 600; }

.eye-btn {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; cursor: pointer;
  color: rgb(148 163 184); background: transparent; border: 1px solid transparent; border-radius: 999px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.eye-btn:hover { color: rgb(var(--accent)); background: rgb(var(--accent) / 0.1); border-color: rgb(var(--accent) / 0.25); }
.eye-btn:active { transform: scale(0.92); }
.eye-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(var(--accent) / 0.35); }
.eye-btn .eye-body { transform-origin: 12px 12px; transition: transform 0.3s var(--ease); }
.eye-btn .eye-pupil { transition: opacity 0.15s var(--ease); }
.eye-btn .eye-slash { stroke-dasharray: 26; stroke-dashoffset: 26; transition: stroke-dashoffset 0.3s var(--ease) 0.06s; }
.eye-btn.eye-closed .eye-body { transform: scaleY(0.45); }   /* kelopak menutup (tombol tetap terlihat) */
.eye-btn.eye-closed .eye-pupil { opacity: 0; }
.eye-btn.eye-closed .eye-slash { stroke-dashoffset: 0; }

/* ===== Badge hitungan ===== */
.count-badge {
  display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem;
  font-size: 0.65rem; font-weight: 700; color: #fff; background: rgb(244 63 94); border-radius: 999px;
}

/* ===== Chat ===== */
.chat-fab {
  position: fixed; z-index: 60; right: 1rem; bottom: 1rem; width: 3.1rem; height: 3.1rem; display: grid; place-items: center;
  color: #fff; background: rgb(37 99 235); border: 0; border-radius: 999px; cursor: pointer;
}
.chat-fab .count-badge { position: absolute; top: -0.25rem; right: -0.25rem; }
.chat-panel {
  position: fixed; z-index: 70; right: 1rem; bottom: 4.9rem; width: min(calc(100vw - 2rem), 22.5rem); height: min(32rem, calc(100vh - 7rem));
  display: none; flex-direction: column; overflow: hidden; padding: 0;
}
.chat-panel.open { display: flex; animation: toast-in 0.25s var(--ease) both; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; font-weight: 600; }
.chat-body { flex: 1; min-height: 0; padding: 0.8rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.chat-empty { margin: auto; text-align: center; font-size: 0.8rem; color: rgb(100 116 139); }
.chat-msg { max-width: 82%; padding: 0.5rem 0.7rem; font-size: 0.8125rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 0.8rem; animation: toast-in 0.2s var(--ease) both; }
.chat-msg time { display: block; margin-top: 0.15rem; font-size: 0.62rem; opacity: 0.6; }
.chat-mine   { align-self: flex-end; background: rgb(37 99 235 / 0.85); border-bottom-right-radius: 0.25rem; }
.chat-theirs { align-self: flex-start; background: rgba(148, 163, 184, 0.14); border: 1px solid var(--border); border-bottom-left-radius: 0.25rem; }
.chat-form { display: flex; gap: 0.5rem; padding: 0.65rem; border-top: 1px solid var(--border); }
.chat-form .field { flex: 1; }

/* ===== Tema admin (ungu, jelas beda dari user) ===== */
body.admin-theme { --accent: 167 139 250; }
body.admin-theme .btn-primary { background: rgb(124 58 237); }
.admin-tag {
  display: inline-block; padding: 0.1rem 0.5rem; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgb(var(--accent)); background: rgb(var(--accent) / 0.12); border: 1px solid rgb(var(--accent) / 0.3); border-radius: 999px;
}
.tab-nav { display: flex; gap: 0.25rem; padding: 0.3rem; overflow-x: auto; }
.tab-btn {
  flex: none; padding: 0.5rem 0.9rem; font-size: 0.8125rem; font-weight: 500; color: rgb(148 163 184); background: transparent;
  border: 1px solid transparent; border-radius: 0.6rem; cursor: pointer; transition: color 0.2s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab-btn:hover { color: rgb(226 232 240); background: rgba(148, 163, 184, 0.08); }
.tab-btn.active { color: rgb(var(--accent)); background: rgb(var(--accent) / 0.12); border-color: rgb(var(--accent) / 0.3); }
.chat-layout { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .chat-layout { grid-template-columns: 17rem 1fr; } }
.chat-list { max-height: 26rem; overflow-y: auto; }
.chat-item { display: block; width: 100%; padding: 0.65rem 0.8rem; text-align: left; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; transition: background-color 0.2s var(--ease); }
.chat-item:hover, .chat-item.active { background: rgb(var(--accent) / 0.1); }
.thread { display: flex; flex-direction: column; height: 26rem; padding: 0; overflow: hidden; }
.badge-expired.badge-danger, .badge-danger { color: rgb(var(--danger)); background: rgb(var(--danger) / 0.12); border-color: rgb(var(--danger) / 0.28); }

/* ===== Aplikasi merchant: header, navigasi bawah, tampilan (view) ===== */
body.app { padding-bottom: calc(6.2rem + env(safe-area-inset-bottom)); }
.app-header {
  position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem;
  padding: calc(max(env(safe-area-inset-top, 0px), 2.1rem) + 0.45rem) 1rem 0.7rem; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.app-header .avatar { justify-self: start; }
.header-right { justify-self: end; }
.site-title { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-align: center; color: rgb(var(--accent)); white-space: nowrap; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; cursor: pointer;
  color: rgb(var(--accent)); background: rgb(var(--accent) / 0.1); border: 1px solid rgb(var(--accent) / 0.22); border-radius: 0.75rem;
  transition: background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.icon-btn:hover { background: rgb(var(--accent) / 0.18); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .count-badge { position: absolute; top: -0.3rem; right: -0.3rem; }

.view { display: none; }
.view.active { display: block; animation: toast-in 0.28s var(--ease) both; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: space-around;
  padding: 0.35rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
  background: #0d1528; border-top: 1px solid var(--border);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.4rem 0; font-size: 0.66rem; font-weight: 500;
  color: rgb(148 163 184); background: none; border: 0; cursor: pointer; transition: color 0.2s var(--ease);
}
.nav-item:hover { color: rgb(226 232 240); }
.nav-item.active { color: rgb(var(--accent)); }
.nav-fab {
  flex: none; width: 3.5rem; height: 3.5rem; margin: -1.7rem 0.4rem 0; display: grid; place-items: center; color: #fff; cursor: pointer;
  background: rgb(37 99 235); border: 0; border-radius: 1.15rem; box-shadow: 0 0 0 4px #0d1528;
  transition: transform 0.15s var(--ease);
}
.nav-fab:active { transform: scale(0.95); }

/* ===== Kartu saldo versi aplikasi ===== */
.hero-card { padding: 1.25rem; color: #fff; border-radius: 1.25rem; background: rgb(37 99 235); }
.hero-card .badge-paid { color: #fff; background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.28); }

/* ===== Judul bagian ===== */
.card-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; font-weight: 600; }
.card-title svg { color: rgb(var(--accent)); flex: none; }
.section-title { margin-bottom: 0.6rem; font-size: 0.95rem; font-weight: 600; }
.link-btn { font-size: 0.8rem; font-weight: 600; color: rgb(var(--accent)); background: none; border: 0; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ===== Grafik tren 30 hari ===== */
.trend svg { display: block; overflow: visible; touch-action: pan-y; }
.tl-grid { stroke: rgba(148, 163, 184, 0.16); stroke-width: 1; }
.tl-grid-v { stroke: rgba(148, 163, 184, 0.10); }
.tl-text { fill: rgb(148 163 184); font-size: 9px; font-family: inherit; }
.tl-line { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tl-area { stroke: none; }
.tl-in.tl-line { stroke: rgb(59 130 246); } .tl-in.tl-area { fill: rgb(59 130 246 / 0.10); } .tl-in.tl-dot { fill: rgb(59 130 246); }
.tl-out.tl-line { stroke: rgb(239 68 68); } .tl-out.tl-area { fill: rgb(239 68 68 / 0.10); } .tl-out.tl-dot { fill: rgb(239 68 68); }
.tl-cross { stroke: rgba(226, 232, 240, 0.35); stroke-width: 1; stroke-dasharray: 3 3; }
.trend-tip { min-height: 1.1rem; font-size: 0.72rem; color: rgb(148 163 184); }
.trend-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; font-size: 0.75rem; color: rgb(148 163 184); }
.trend-summary { color: rgb(203 213 225); }
.legend-dot { display: inline-block; width: 0.6rem; height: 0.6rem; margin-right: 0.35rem; border-radius: 999px; }
.dot-in { background: rgb(59 130 246); } .dot-out { background: rgb(239 68 68); }

/* ===== Menu cepat ===== */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
.quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.85rem 0.25rem; font-size: 0.78rem; font-weight: 600;
  color: rgb(226 232 240); background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.15s var(--ease);
}
.quick-item:hover { border-color: rgb(var(--accent) / 0.4); }
.quick-item:active { transform: scale(0.96); }
.quick-ico { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; color: rgb(var(--accent)); background: rgb(var(--accent) / 0.12); border-radius: 0.9rem; }

/* ===== Segmen / tab kecil ===== */
.seg { display: flex; gap: 0.25rem; padding: 0.25rem; background: rgba(2, 6, 23, 0.5); border: 1px solid var(--border); border-radius: 0.8rem; }
.seg button {
  flex: 1; padding: 0.5rem 0.4rem; font-size: 0.8rem; font-weight: 500; color: rgb(148 163 184); background: transparent; border: 0; border-radius: 0.6rem; cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.seg button:hover { color: rgb(226 232 240); }
.seg button.active { color: #fff; background: rgb(var(--accent) / 0.22); box-shadow: inset 0 0 0 1px rgb(var(--accent) / 0.3); }

/* ===== Daftar riwayat ===== */
.hist-item {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.75rem; text-align: left; color: inherit; cursor: pointer;
  background: rgba(2, 6, 23, 0.35); border: 1px solid var(--border); border-radius: 0.9rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.hist-item:hover { border-color: rgb(var(--accent) / 0.35); background: rgba(2, 6, 23, 0.55); transform: translateY(-1px); }
.hist-ico { flex: none; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 0.8rem; background: rgb(var(--accent) / 0.12); color: rgb(var(--accent)); }
.hist-ico.out { background: rgb(var(--danger) / 0.12); color: rgb(var(--danger)); }
.hist-main { flex: 1; min-width: 0; }
.hist-amt { text-align: right; flex: none; }

/* ===== Bottom sheet detail ===== */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; display: none; background: rgba(2, 6, 23, 0.7); }
.sheet-backdrop.open { display: block; animation: fade-in 0.2s var(--ease) both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-width: 32rem; max-height: 88vh; margin: 0 auto; padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom)); overflow-y: auto;
  background: #0f1a30; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 1.4rem 1.4rem 0 0;
  transform: translateY(105%); transition: transform 0.32s var(--ease);
}
.sheet.open { transform: none; }
.sheet-grip { width: 2.5rem; height: 0.25rem; margin: -0.4rem auto 1rem; background: var(--border-strong); border-radius: 999px; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.kv span:first-child { color: rgb(148 163 184); }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.status-hero { display: grid; place-items: center; gap: 0.4rem; padding: 0.5rem 0 1rem; text-align: center; }
.status-ico { width: 3.4rem; height: 3.4rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid transparent; }
.status-ico svg { display: block; }
.status-ico .clock-min { transform-origin: 12px 12px; animation: clock-spin 6s linear infinite; }
@keyframes clock-spin { to { transform: rotate(360deg); } }
.status-ico.paid { color: rgb(var(--success)); background: rgb(var(--success) / 0.12); border-color: rgb(var(--success) / 0.3); }
.status-ico.pending { color: rgb(var(--warn)); background: rgb(var(--warn) / 0.12); border-color: rgb(var(--warn) / 0.3); }
.status-ico.expired { color: rgb(148 163 184); background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.25); }
.status-ico.bad { color: rgb(var(--danger)); background: rgb(var(--danger) / 0.12); border-color: rgb(var(--danger) / 0.3); }

/* ===== Animasi sukses (centang + confetti) ===== */
.success-overlay { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 1.5rem; background: rgba(2, 6, 23, 0.84); }
.success-overlay.open { display: grid; animation: fade-in 0.25s var(--ease) both; }
.success-card { position: relative; width: min(100%, 20rem); padding: 2rem 1.5rem 1.5rem; text-align: center; overflow: hidden; animation: pop 0.5s var(--ease) both; }
.check-svg { width: 5.5rem; height: 5.5rem; margin: 0 auto 0.75rem; display: block; }
.check-svg circle { fill: rgb(var(--success) / 0.1); stroke: rgb(var(--success)); stroke-width: 3; stroke-dasharray: 170; stroke-dashoffset: 170; animation: draw 0.65s var(--ease) 0.1s forwards; }
.check-svg path { fill: none; stroke: rgb(var(--success)); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw 0.4s var(--ease) 0.6s forwards; }
.confetti i { position: absolute; top: -0.6rem; width: 0.45rem; height: 0.8rem; border-radius: 2px; opacity: 0; animation: fall 1.8s var(--ease) forwards; }
.confetti i:nth-child(1)  { left: 8%;  background: rgb(var(--success)); animation-delay: 0.30s; }
.confetti i:nth-child(2)  { left: 18%; background: rgb(var(--accent));  animation-delay: 0.45s; }
.confetti i:nth-child(3)  { left: 28%; background: rgb(var(--warn));    animation-delay: 0.35s; }
.confetti i:nth-child(4)  { left: 38%; background: rgb(var(--danger));  animation-delay: 0.55s; }
.confetti i:nth-child(5)  { left: 48%; background: rgb(var(--success)); animation-delay: 0.40s; }
.confetti i:nth-child(6)  { left: 58%; background: rgb(var(--accent));  animation-delay: 0.60s; }
.confetti i:nth-child(7)  { left: 68%; background: rgb(var(--warn));    animation-delay: 0.33s; }
.confetti i:nth-child(8)  { left: 78%; background: rgb(var(--danger));  animation-delay: 0.50s; }
.confetti i:nth-child(9)  { left: 88%; background: rgb(var(--success)); animation-delay: 0.42s; }
.confetti i:nth-child(10) { left: 94%; background: rgb(var(--accent));  animation-delay: 0.58s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.85); } 100% { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(14rem) rotate(260deg); } }

/* ===== Avatar foto ===== */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 5.5rem; height: 5.5rem; font-size: 2rem; border-radius: 1.5rem; }
.chip-btn { padding: 0.45rem 0.8rem; font-size: 0.78rem; font-weight: 600; color: rgb(var(--accent)); background: rgb(var(--accent) / 0.1); border: 1px solid rgb(var(--accent) / 0.25); border-radius: 0.6rem; cursor: pointer; transition: background-color 0.2s var(--ease); }
.chip-btn:hover { background: rgb(var(--accent) / 0.2); }

/* chat panel naik di atas navigasi bawah */
body.app .chat-panel { bottom: 5.2rem; }
.hero-card .eye-btn { color: rgba(255, 255, 255, 0.8); }
.hero-card .eye-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.3); }
.hero-card .balance-amount { color: #fff; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.chips button { padding: 0.55rem 0; font-size: 0.82rem; font-weight: 500; color: rgb(203 213 225); background: rgba(2, 6, 23, 0.45); border: 1px solid var(--border); border-radius: 0.7rem; cursor: pointer; transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.15s var(--ease); }
.chips button:hover { border-color: rgb(var(--accent) / 0.45); background: rgb(var(--accent) / 0.1); }
.chips button:active { transform: scale(0.96); }

/* ===== Halaman dokumentasi API ===== */
.doc-wrap { max-width: 46rem; margin: 0 auto; padding: 1rem; }
.doc-wrap h2 { margin: 1.6rem 0 0.6rem; font-size: 1.05rem; font-weight: 600; color: rgb(191 219 254); }
.doc-wrap p, .doc-wrap li { font-size: 0.85rem; color: rgb(203 213 225); line-height: 1.65; }
.doc-wrap ul { padding-left: 1.2rem; list-style: disc; }
.method { display: inline-block; padding: 0.1rem 0.5rem; margin-right: 0.4rem; font-size: 0.7rem; font-weight: 700; border-radius: 0.4rem; }
.method.post { color: rgb(var(--success)); background: rgb(var(--success) / 0.12); }
.method.get { color: rgb(var(--accent)); background: rgb(var(--accent) / 0.12); }
.endpoint { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; color: rgb(226 232 240); }
.code-box { position: relative; margin: 0.6rem 0; }
.code-block {
  margin: 0; padding: 0.9rem 1rem; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.76rem; line-height: 1.6;
  color: rgb(226 232 240); background: rgba(2, 6, 23, 0.75); border: 1px solid var(--border); border-radius: 0.8rem; white-space: pre;
}
.code-box .copy-code { position: absolute; top: 0.45rem; right: 0.45rem; }
.note { padding: 0.7rem 0.9rem; font-size: 0.8rem; color: rgb(253 224 71); background: rgb(var(--warn) / 0.08); border: 1px solid rgb(var(--warn) / 0.25); border-radius: 0.7rem; }
.doc-wrap table { margin: 0.5rem 0; }
.doc-wrap code.inline { padding: 0.05rem 0.35rem; font-size: 0.78rem; color: rgb(var(--warn)); background: rgba(2, 6, 23, 0.6); border: 1px solid var(--border); border-radius: 0.35rem; }

.doc-wrap ol.steps { padding-left: 1.2rem; list-style: decimal; display: grid; gap: 0.5rem; }

/* Ruang aman di atas (status bar HP) untuk halaman tanpa header khusus */
.safe-spacer { height: max(env(safe-area-inset-top, 0px), 2.1rem); }

/* ===== Foto di atas form Masuk / Daftar (LOGIN_IMAGE_URL) ===== */
.auth-wrap { width: 100%; max-width: 24rem; }
.auth-hero { margin-bottom: 1rem; }
.auth-ph { display: grid; place-items: center; height: 8.5rem; color: rgb(var(--accent)); background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; }
.auth-photo { display: block; width: 100%; max-height: 11rem; margin: 0 auto; object-fit: cover; border-radius: 1rem; border: 1px solid var(--border); }
