@charset "UTF-8";

/* ==========================================================================
   BAYARLINK — Design System v3
   --------------------------------------------------------------------------
   Ditulis ulang karena versi sebelumnya dikeluhkan buram dan tidak nyaman
   di ponsel. Tiga sebabnya konkret, semuanya dibuang di sini:

     1. backdrop-filter: blur(16px) di topbar — isi halaman lewat di
        belakangnya sambil diburamkan. Sekarang latarnya solid.
     2. Fraunces dengan sumbu SOFT + WONK — huruf yang memang dirancang
        supaya lunak. Diganti Space Grotesk yang bertepi tegas.
     3. --ink-faint kontrasnya 3.13, di bawah ambang WCAG 4.5. Seluruh
        palet dihitung ulang; nilai terendah sekarang 4.7.

   Arah barunya: Bayarlink itu infrastruktur uang untuk kreator, jadi
   rasanya harus seperti aplikasi pembayaran — terang, tegas, langsung.
   Hijau "lunas" dijadikan warna utama, bukan sekadar warna status,
   karena seluruh produk ini soal dibayar.

   Ditulis mobile-first: aturan dasar untuk ponsel, layar besar
   hanya menambahkan lewat min-width.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKEN
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  --bg:            #ffffff;
  --surface:       #ffffff;
  --surface-2:     #f3f6f9;
  --surface-3:     #e7edf3;
  --border:        #dde5ec;
  --border-strong: #b6c3cf;

  --ink:       #0d1117;
  --ink-soft:  #495563;
  --ink-faint: #5e6b7a;

  --accent:        #00c566;
  --accent-strong: #00a855;
  --accent-ink:    #00713c;
  --accent-wash:   #e4faf0;
  --accent-line:   #9fe9c3;
  --on-accent:     #05130a;

  --hot:      #ff4b2b;
  --hot-ink:  #c62a16;
  --hot-wash: #ffece8;

  --warn:      #b26a00;
  --warn-wash: #fff4e0;
  --info:      #0b6e8a;
  --info-wash: #e2f4fa;

  --good:      var(--accent-ink);
  --good-wash: var(--accent-wash);

  /* Panel gelap (kwitansi, saldo, baris total). Dipisah dari --ink
     karena --ink berbalik jadi nyaris putih di mode malam — kalau
     dipakai sebagai latar, isinya jadi putih di atas putih. */
  --panel:          #0d1117;
  --on-panel:       #ffffff;
  --on-panel-soft:  rgba(255, 255, 255, .68);
  --on-panel-faint: rgba(255, 255, 255, .6);
  --on-panel-line:  rgba(255, 255, 255, .16);

  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(13, 17, 23, .06);
  --shadow-md: 0 2px 4px rgba(13, 17, 23, .06), 0 6px 16px rgba(13, 17, 23, .07);
  --shadow-lg: 0 8px 20px rgba(13, 17, 23, .1), 0 20px 48px rgba(13, 17, 23, .1);
  --ring: 0 0 0 3px var(--accent-wash);

  --font-display: "Space Grotesk", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --sidebar-w: 244px;
  --topbar-h: 60px;
  --tabbar-h: 62px;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0a0e12;
  --surface:       #131a22;
  --surface-2:     #1b242e;
  --surface-3:     #243040;
  --border:        #27333f;
  --border-strong: #3d4d5c;

  --ink:       #edf2f7;
  --ink-soft:  #a7b4c2;
  --ink-faint: #8593a2;

  --accent:        #00e27a;
  --accent-strong: #00c566;
  --accent-ink:    #4ff0a3;
  --accent-wash:   #0d2b1d;
  --accent-line:   #1d5638;
  --on-accent:     #04170c;

  --hot:      #ff6b4f;
  --hot-ink:  #ff8f78;
  --hot-wash: #2e1410;

  --warn:      #e8a33c;
  --warn-wash: #2c2110;
  --info:      #4fc3e8;
  --info-wash: #0f2831;

  --panel:          #05080b;
  --on-panel:       #edf2f7;
  --on-panel-soft:  #a7b4c2;
  --on-panel-faint: #8593a2;
  --on-panel-line:  rgba(255, 255, 255, .12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, .5), 0 6px 16px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, .6), 0 20px 48px rgba(0, 0, 0, .45);
  --ring: 0 0 0 3px rgba(0, 226, 122, .22);
}

/* --------------------------------------------------------------------------
   2. DASAR
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  /* 16px di ponsel. Di bawah itu Safari iOS memperbesar halaman
     setiap kali kolom isian disentuh. */
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  color: var(--ink);
}

h1 { font-size: clamp(1.6rem, 6vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 4.5vw, 1.85rem); }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .9em; letter-spacing: -.02em; }

.amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}

/* --------------------------------------------------------------------------
   3. TANDA MERK — motif kotak pencari QR
   -------------------------------------------------------------------------- */
/* Logo sekarang berkas gambar (/images/logoijo.png), bukan bentuk CSS.
   object-fit: contain menjaga gambar tidak gepeng kalau rasionya tidak
   persis persegi, dan kotaknya tetap 34x34 supaya tata letak topbar
   tidak bergeser. */
.mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
  flex: none;
  display: block;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--ink);
}

.brand--sm { font-size: 16.5px; gap: 8px; }
.brand--sm .mark { width: 30px; height: 30px; border-radius: 8px; }

/* --------------------------------------------------------------------------
   4. KERANGKA
   -------------------------------------------------------------------------- */
.shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  /* Solid. Ini sumber keluhan "buram". */
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__spacer { flex: 1; min-width: 0; }

/* Topbar area admin memuat satu tombol lebih banyak. Di 360px muatannya
   tidak cukup, jadi nama merk boleh menyusut dan label tombol
   disembunyikan — ikonnya sendiri sudah cukup jelas. */
.topbar .brand { min-width: 0; overflow: hidden; }
.topbar .brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .badge { flex: none; }

.hide-xs { display: none; }

.main { padding: 18px 14px calc(var(--tabbar-h) + 28px); }

.page-head { margin-bottom: 18px; }

.page-head__eyebrow {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 5px;
}

.page-head p { color: var(--ink-soft); margin-top: 8px; font-size: 14.5px; max-width: 60ch; }
.page-head__actions { margin-top: 14px; }

/* --------------------------------------------------------------------------
   5. LACI SAMPING
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 95;
  width: min(282px, 84vw);
  padding: 16px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  translate: -100% 0;
  transition: translate .26s var(--ease);
}

.sidebar.is-open { translate: 0 0; }

.side-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 16px 12px 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
}

.side-link svg { width: 20px; height: 20px; flex: none; stroke-width: 2; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.is-active { background: var(--accent-wash); color: var(--accent-ink); font-weight: 700; }

.side-link--admin {
  border: 1.5px solid var(--accent-line);
  color: var(--accent-ink);
  font-weight: 700;
  margin-top: 4px;
}

.side-link--danger { color: var(--hot-ink); margin-top: auto; }
.side-link--danger:hover { background: var(--hot-wash); }

.side-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--r-pill);
}

.balance {
  background: var(--panel);
  border-radius: var(--r-lg);
  padding: 15px 16px;
  margin-bottom: 8px;
}

.balance__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--on-panel-faint);
}

.balance__value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  color: var(--accent);
  margin-top: 2px;
}

/* Bilah impersonasi — sengaja mencolok dan menempel di atas layar.
   Admin harus selalu sadar sedang melihat sebagai orang lain; kalau
   sampai lupa, catatan dukungan bisa tertukar. */
.impersonate-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: var(--warn-wash);
  border-bottom: 2px solid var(--warn);
  color: var(--warn);
  font-size: 13.5px;
  font-weight: 600;
}

.impersonate-bar__text { display: flex; align-items: center; gap: 8px; min-width: 0; }
.impersonate-bar svg { width: 17px; height: 17px; flex: none; }
.impersonate-bar strong { font-weight: 800; }

@media (min-width: 1000px) {
  .impersonate-bar { position: fixed; top: var(--topbar-h); left: var(--sidebar-w); right: 0; }
  .main--impersonating { padding-top: calc(var(--topbar-h) + 88px); }
}

/* --------------------------------------------------------------------------
   6. BILAH BAWAH — navigasi utama di ponsel
   Menu terpenting ditaruh dalam jangkauan ibu jari, bukan disembunyikan
   di balik ikon hamburger di pojok atas.
   -------------------------------------------------------------------------- */
.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  z-index: 70;
  height: var(--tabbar-h);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar__item {
  flex: 1;
  /* Tanpa min-width:0, label panjang seperti "Ringkasan" menolak
     menyusut dan mendorong bilah melewati layar 320px. */
  min-width: 0;
  padding-inline: 2px;
  background: none;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-faint);
  position: relative;
}

.tabbar__item svg { width: 21px; height: 21px; stroke-width: 2; flex: none; }

.tabbar__item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabbar__item.is-active { color: var(--accent-ink); }

.tabbar__item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   7. TOMBOL
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .14s var(--ease), border-color .14s var(--ease), transform .1s var(--ease);
}

.btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.btn:active { transform: scale(.985); }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); }

.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover { background: var(--ink-soft); }

.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--ink-faint); }

.btn--good { background: var(--accent-strong); color: var(--on-accent); }
.btn--bad  { background: var(--hot); color: #fff; }
.btn--bad:hover { filter: brightness(.92); }

.btn--sm { min-height: 40px; padding: 8px 14px; font-size: 13.5px; }
.btn--sm svg { width: 16px; height: 16px; }
.btn--lg { min-height: 54px; padding: 15px 26px; font-size: 16.5px; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink-soft);
  cursor: pointer;
  flex: none;
}

.icon-btn svg { width: 20px; height: 20px; stroke-width: 2; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle svg { transition: transform .35s var(--ease), opacity .2s var(--ease); }
.theme-toggle .icon-moon { position: absolute; }

:root:not([data-theme="dark"]) .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(.5); }

/* --------------------------------------------------------------------------
   8. KARTU
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  min-width: 0;
}

.card--flush { padding: 0; overflow: hidden; }
.card--pad-lg { padding: 20px; }

.card__head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.card__title { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.card__sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 3px; overflow-wrap: anywhere; }

.grid { display: grid; gap: 12px; }

/* minmax(0, 1fr), bukan 1fr.
   Track "1fr" punya minimum otomatis sebesar min-content, jadi satu
   anak yang lebar — grafik 31 batang, tabel, teks panjang tanpa spasi —
   memaksa seluruh kolom melebar melewati layar, dan semua kartu di
   dalamnya ikut terseret keluar. Ini penyebab tunggal kartu-kartu yang
   meluber di ponsel. */
.grid--2, .grid--3, .grid--main { grid-template-columns: minmax(0, 1fr); }

/* Anak grid dan flex dasarnya min-width:auto, yang menolak menyusut
   di bawah lebar isinya. Dinolkan supaya isi yang bisa digulir
   (grafik, tabel) benar-benar menggulir, bukan mendorong tata letak. */
.grid > * { min-width: 0; }
/* Dua kolom sejak ponsel — empat kartu angka bertumpuk menghabiskan
   satu layar penuh tanpa alasan. */
.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
}

.stat__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  color: var(--accent-ink);
  margin-bottom: 10px;
}

.stat__icon svg { width: 18px; height: 18px; stroke-width: 2.1; }
.stat__icon--good { background: var(--accent-wash); color: var(--accent-ink); }
.stat__icon--cool { background: var(--info-wash);   color: var(--info); }
.stat__icon--bad  { background: var(--hot-wash);    color: var(--hot-ink); }

.stat__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5.5vw, 1.6rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.stat__note { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }

/* --------------------------------------------------------------------------
   9. KWITANSI — elemen khas Bayarlink
   -------------------------------------------------------------------------- */
.receipt {
  position: relative;
  min-width: 0;
  background: var(--panel);
  color: var(--on-panel);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px;
  overflow: hidden;
}

.receipt::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--accent);
}

.receipt .stat__label { color: var(--on-panel-faint); }

.receipt__tear {
  height: 12px;
  background: radial-gradient(circle at 6px 0, transparent 0 6px, var(--panel) 6.5px) repeat-x;
  background-size: 12px 12px;
  margin-top: -1px;
}

.receipt__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 14px;
}

.receipt__row + .receipt__row { border-top: 1px dashed var(--on-panel-line); }
.receipt__row dt { color: var(--on-panel-soft); }
.receipt__row dd { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

.receipt__total {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 9vw, 2.4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  color: var(--accent);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

/* Versi terang untuk halaman pembeli */
.receipt--light { background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-bottom: 0; }
.receipt--light .stat__label { color: var(--ink-faint); }
.receipt--light .receipt__row + .receipt__row { border-top-color: var(--border); }
.receipt--light .receipt__row dt { color: var(--ink-soft); }
.receipt--light .receipt__total { color: var(--ink); }
.receipt--light + .receipt__tear { background-image: radial-gradient(circle at 6px 0, transparent 0 6px, var(--surface) 6.5px); }

/* --------------------------------------------------------------------------
   10. FORMULIR
   -------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field__label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.field__hint { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  /* Tetap 16px: di bawah itu Safari iOS memperbesar halaman saat fokus. */
  font-size: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: var(--ring);
}

.textarea { resize: vertical; min-height: 104px; line-height: 1.55; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23495563' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a7b4c2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6l4 4 4-4'/></svg>");
}

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }

.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 14.5px; padding: 6px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent-strong); cursor: pointer; flex: none; margin-top: 1px; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }

.choice__box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px;
  text-align: center;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color .14s var(--ease), background-color .14s var(--ease);
}

.choice input:checked + .choice__box {
  border-color: var(--accent-strong);
  border-width: 2px;
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.choice input:focus-visible + .choice__box { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   11. PEMBERITAHUAN
   -------------------------------------------------------------------------- */
.notice {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  border: 1px solid;
  border-left-width: 4px;
  font-size: 14.5px;
  margin-bottom: 14px;
}

.notice svg { flex: none; width: 19px; height: 19px; margin-top: 2px; }
.notice--ok   { background: var(--accent-wash); border-color: var(--accent-strong); color: var(--accent-ink); }
.notice--bad  { background: var(--hot-wash);    border-color: var(--hot);  color: var(--hot-ink); }
.notice--warn { background: var(--warn-wash);   border-color: var(--warn); color: var(--warn); }
.notice--info { background: var(--info-wash);   border-color: var(--info); color: var(--info); }
.notice a { text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------------------------
   12. LENCANA
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge--pending  { background: var(--warn-wash);   color: var(--warn); }
.badge--approved { background: var(--info-wash);   color: var(--info); }
.badge--success, .badge--paid, .badge--active { background: var(--accent-wash); color: var(--accent-ink); }
.badge--rejected, .badge--failed, .badge--blocked { background: var(--hot-wash); color: var(--hot-ink); }
.badge--expired, .badge--closed { background: var(--surface-3); color: var(--ink-soft); }
.badge--admin { background: var(--panel); color: var(--accent); }
.badge--plain::before { display: none; }

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   13. TABEL
   --------------------------------------------------------------------------
   Akar keluhan "tidak responsive": tabel lama dipatok min-width 640px,
   jadi di ponsel harus digeser mendatar dan kolom terakhir — yang justru
   paling penting — tidak terlihat.

   Di bawah 760px tiap baris berubah jadi kartu bertumpuk. Nama kolomnya
   diambil dari atribut data-label pada masing-masing sel.
   -------------------------------------------------------------------------- */
.table-wrap { width: 100%; min-width: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }

.table thead { display: none; }

.table tbody tr {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.table tbody td {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  /* Boleh turun baris: label panjang seperti "Rata-rata / transaksi"
     tidak boleh memaksa kartunya melebar melewati layar. */
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 5px 0;
  text-align: right;
}

.table tbody td::before {
  content: attr(data-label);
  flex: 0 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
}

.table tbody td:first-child {
  display: block;
  text-align: left;
  font-weight: 700;
  font-size: 15.5px;
  padding-bottom: 9px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.table tbody td:first-child::before { display: none; }

.table tbody td:has(.btn-row),
.table tbody td:has(> .btn),
.table tbody td:has(> form) {
  display: block;
  text-align: left;
  padding-top: 10px;
  margin-top: 5px;
  border-top: 1px solid var(--border);
}

.table tbody td:has(.btn-row)::before,
.table tbody td:has(> .btn)::before,
.table tbody td:has(> form)::before { display: block; margin-bottom: 7px; }

.table tfoot tr {
  display: block;
  background: var(--panel);
  color: var(--on-panel);
  border-radius: var(--r-lg);
  padding: 12px 14px;
}

.table tfoot td {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 4px 0;
  text-align: right;
}

.table tfoot td::before {
  content: attr(data-label);
  flex: 0 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--on-panel-faint);
  text-align: left;
}

.table tfoot td:first-child { font-family: var(--font-display); font-weight: 700; }
.table tfoot td:first-child::before { display: none; }
.table tfoot .good { color: var(--accent); }
.table tfoot .muted { color: var(--on-panel-soft); }

.table .num { font-variant-numeric: tabular-nums; font-weight: 700; }
.table__meta { font-size: 13px; color: var(--ink-soft); font-weight: 400; }

/* --------------------------------------------------------------------------
   14. PAGINATION
   -------------------------------------------------------------------------- */
.pager { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.pager__count { font-size: 13.5px; color: var(--ink-soft); text-align: center; }
.pager__count strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.pager__list { display: flex; align-items: center; gap: 5px; list-style: none; padding: 0; flex-wrap: wrap; justify-content: center; }

.pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.pager__btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.pager__btn--num { padding: 8px 10px; font-variant-numeric: tabular-nums; }
.pager__btn.is-current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pager__btn.is-disabled { opacity: .38; pointer-events: none; }
.pager__gap { padding: 0 3px; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   15. KEADAAN KOSONG
   -------------------------------------------------------------------------- */
.empty { text-align: center; padding: 36px 18px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); }

.empty__icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 14px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  color: var(--accent-ink);
}

.empty__icon svg { width: 25px; height: 25px; stroke-width: 1.9; }
.empty h3 { margin-bottom: 5px; }
.empty p { color: var(--ink-soft); max-width: 38ch; margin: 0 auto 16px; font-size: 14.5px; }

/* --------------------------------------------------------------------------
   16. KARTU TAUTAN
   -------------------------------------------------------------------------- */
.link-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 15px; }

.link-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.link-card__url { font-size: 13.5px; color: var(--ink-soft); overflow-wrap: anywhere; margin-top: 7px; }

.link-card__price {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  white-space: nowrap;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.pill svg { width: 14px; height: 14px; stroke-width: 2.2; }
.pill--good { background: var(--accent-wash); color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   17. SARINGAN
   -------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.chip {
  min-height: 42px;
  padding: 9px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.search-box { position: relative; flex: 1 1 100%; }
.search-box .input { padding-left: 42px; }

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  translate: 0 -50%;
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  color: var(--ink-faint);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   18. GRAFIK
   -------------------------------------------------------------------------- */
.chart { display: flex; align-items: stretch; gap: 4px; height: 150px; padding-top: 10px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; min-width: 0; }

/* Kolom dibuat grid dua baris: baris pertama menampung batang, baris
   kedua labelnya. Tanpa tinggi yang pasti di sini, height persen pada
   batang tidak punya acuan dan seluruh grafik gepeng jadi garis. */
.chart__col {
  flex: 1;
  min-width: 15px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  justify-items: center;
  gap: 6px;
}

.chart__bar { width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); align-self: end; }
.chart__col:hover .chart__bar { background: var(--accent-strong); }
.chart__label { font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   19. OBROLAN
   -------------------------------------------------------------------------- */
.chat {
  height: 340px;
  min-width: 0;
  overflow-y: auto;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.bubble--mine { align-self: flex-end; background: var(--accent-wash); border-color: var(--accent-line); }
.bubble--admin { border-color: var(--accent-strong); border-left-width: 3px; }
.bubble a { color: var(--accent-ink); text-decoration: underline; }
.bubble__who { font-size: 12px; font-weight: 800; color: var(--accent-ink); margin-bottom: 2px; }
.bubble__time { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }

.bubble__quote {
  border-left: 3px solid var(--accent);
  padding: 4px 9px;
  margin-bottom: 6px;
  background: var(--surface-2);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   20. LAPIS ATAS
   -------------------------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  width: 100%;
  background: rgba(13, 17, 23, .5);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s;
}

.backdrop.is-open { opacity: 1; visibility: visible; }

/* Di ponsel dialog naik dari bawah — lebih dekat ke ibu jari. */
.modal {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 100;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  translate: 0 100%;
  visibility: hidden;
  transition: translate .26s var(--ease), visibility .26s;
}

.modal.is-open { translate: 0 0; visibility: visible; }

.modal::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  margin: -6px auto 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 14px);
  translate: -50% 8px;
  z-index: 200;
  width: max-content;
  max-width: calc(100vw - 28px);
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s var(--ease), translate .2s var(--ease), visibility .2s;
}

.toast.is-open { opacity: 1; visibility: visible; translate: -50% 0; }

/* --------------------------------------------------------------------------
   21. HALAMAN PUBLIK
   -------------------------------------------------------------------------- */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.public-nav__links { display: flex; align-items: center; gap: 6px; min-width: 0; }

/* Menu Beranda/Tentang/Bukti bayar/Kontak disembunyikan di ponsel —
   semuanya masih ada di footer. Tapi "Masuk" dan "Daftar" bukan menu,
   melainkan tindakan utama, jadi keduanya tetap tampil sebagai tombol. */
.public-nav__link { display: none; }

@media (max-width: 480px) {
  /* Dirapatkan supaya Masuk dan Daftar muat berjajar tanpa mendorong logo. */
  .public-nav { padding-inline: 12px; gap: 6px; }
  .public-nav__links { gap: 5px; }
  .public-nav__links .btn--sm { padding-inline: 13px; }
  .public-nav .icon-btn { width: 40px; height: 40px; }
}

@media (max-width: 400px) {
  /* Di bawah 400px ketiganya tidak muat sekaligus. Sakelar tema yang
     dilepas, bukan tombol Masuk: temanya tetap mengikuti setelan
     sistem, sedangkan tanpa tombol Masuk pengguna lama kehilangan
     jalan masuk sama sekali. */
  .public-nav .theme-toggle { display: none; }
  .public-nav__links .btn--sm { padding-inline: 12px; font-size: 13px; }
}

.public-main { padding-bottom: 40px; }

.wrap, .wrap--narrow, .wrap--form { width: 100%; padding-inline: 14px; margin-inline: auto; }

.hero { padding: 28px 0 36px; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  background: var(--accent-wash);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent-ink);
  margin-bottom: 14px;
}

.hero__eyebrow svg { width: 15px; height: 15px; }
.hero h1 em { font-style: normal; color: var(--accent-ink); }
.hero__lead { font-size: 16px; color: var(--ink-soft); margin: 14px 0 22px; max-width: 54ch; }

.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px 18px; }

.public-footer { border-top: 1px solid var(--border); padding: 24px 0; background: var(--surface-2); color: var(--ink-soft); font-size: 14px; }

/* ==========================================================================
   22. LAYAR LEBIH BESAR — hanya menambahkan
   ========================================================================== */

@media (min-width: 600px) {
  .hide-xs { display: inline; }
  .main { padding: 22px 22px calc(var(--tabbar-h) + 30px); }
  .card { padding: 20px; }
  .card--pad-lg { padding: 26px; }
  .grid { gap: 14px; }
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-card { padding: 28px; }
  .wrap { max-width: 1160px; padding-inline: 22px; }
  .wrap--narrow { max-width: 720px; padding-inline: 22px; }
  .wrap--form { max-width: 460px; padding-inline: 22px; }
  .search-box { flex: 1 1 240px; max-width: 340px; }
  .hero { padding: 44px 0 52px; }
  .hero__lead { font-size: 17px; }

  .page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 24px;
  }

  .page-head__actions { margin-top: 0; }
  .pager { flex-direction: row; justify-content: space-between; }
  .pager__count { text-align: left; }

  .modal {
    inset: 50% auto auto 50%;
    translate: -50% -50%;
    width: min(480px, calc(100% - 32px));
    border-radius: var(--r-xl);
    padding: 24px;
    scale: .97;
    opacity: 0;
    transition: opacity .22s var(--ease), scale .22s var(--ease), visibility .22s;
  }

  .modal.is-open { translate: -50% -50%; scale: 1; opacity: 1; }
  .modal::before { display: none; }
}

/* Tabel kembali jadi tabel */
@media (min-width: 760px) {
  .table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
  }

  .table { font-size: 14px; }
  .table thead { display: table-header-group; }
  .table tbody { display: table-row-group; }

  .table th {
    text-align: left;
    padding: 12px 15px;
    background: var(--surface-2);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-faint);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }

  .table th.right { text-align: right; }

  .table tbody tr { display: table-row; border: 0; border-radius: 0; padding: 0; margin: 0; }
  .table tbody tr:hover { background: var(--surface-2); }

  .table tbody td,
  .table tbody td:first-child,
  .table tbody td:has(.btn-row),
  .table tbody td:has(> .btn),
  .table tbody td:has(> form) {
    display: table-cell;
    text-align: left;
    vertical-align: middle;
    padding: 13px 15px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    font-size: inherit;
    font-weight: inherit;
  }

  .table tbody td::before { display: none; }
  .table tbody td.num { text-align: right; font-weight: 700; }
  .table tbody tr:last-child td { border-bottom: 0; }

  .table tfoot { display: table-footer-group; }
  .table tfoot tr { display: table-row; background: var(--surface-2); color: inherit; border-radius: 0; padding: 0; }

  .table tfoot td {
    display: table-cell;
    padding: 13px 15px;
    text-align: left;
    border-top: 2px solid var(--border-strong);
  }

  .table tfoot td::before { display: none; }
  .table tfoot td.num { text-align: right; }
  .table tfoot .good { color: var(--accent-ink); }
  .table tfoot .muted { color: var(--ink-soft); }
}

/* Desktop: sidebar tetap, bilah bawah hilang */
@media (min-width: 1000px) {
  .tabbar { display: none; }

  .topbar { position: fixed; inset: 0 0 auto 0; padding: 0 22px; }
  .menu-btn { display: none; }

  .sidebar {
    top: var(--topbar-h);
    width: var(--sidebar-w);
    translate: 0 0;
    z-index: 50;
    padding: 18px 12px;
  }

  .main {
    margin-left: var(--sidebar-w);
    padding: calc(var(--topbar-h) + 26px) 26px 60px;
    max-width: 1280px;
  }

  .grid { gap: 16px; }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .choice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .public-nav { padding: 10px 22px; }

  .public-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: var(--r-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-soft);
  }

  .public-nav__link:hover { background: var(--surface-2); color: var(--ink); }

  .toast { bottom: 22px; }

  .stat { padding: 18px; transition: border-color .16s var(--ease); }
  .stat:hover { border-color: var(--border-strong); }
  .link-card { transition: border-color .16s var(--ease); }
  .link-card:hover { border-color: var(--border-strong); }

  .chart { height: 180px; }
}

/* --------------------------------------------------------------------------
   23. UTILITAS
   -------------------------------------------------------------------------- */
.stack   { display: flex; flex-direction: column; min-width: 0; }
.stack > * { min-width: 0; }
.row     { display: flex; align-items: center; }
.between { justify-content: space-between; }
.wrap-x  { flex-wrap: wrap; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 14px; } .gap-4 { gap: 22px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.good  { color: var(--accent-ink); }
.bad   { color: var(--hot-ink); }
.small { font-size: 13.5px; }
.tiny  { font-size: 12.5px; }
.bold  { font-weight: 700; }
.center { text-align: center; }
.right  { text-align: right; }
.hide   { display: none !important; }
.break  { overflow-wrap: anywhere; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal { animation: reveal .32s var(--ease) both; }
.reveal:nth-child(2) { animation-delay: .04s; }
.reveal:nth-child(3) { animation-delay: .08s; }
.reveal:nth-child(4) { animation-delay: .12s; }

@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
