:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e7ebf2;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: #eaf1ff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --ok-bg: #ecfdf5;
  --ok-ink: #047857;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 6px 20px rgba(15, 23, 42, 0.045);
  --container: 760px;
}

* { box-sizing: border-box; }

/* Jaminan: atribut `hidden` selalu menang atas `display` apa pun yang diset
   selector lain di bawah (mis. `.modal-overlay{display:flex}`), tanpa ini
   elemen ber-hidden bisa tetap kelihatan karena CSS penulis mengalahkan
   default browser untuk [hidden]. */
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1600px 1000px at 18% 0%, rgba(37,99,235,0.10), rgba(37,99,235,0) 60%),
    radial-gradient(1400px 1000px at 100% 100%, rgba(37,99,235,0.08), rgba(37,99,235,0) 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
}

button, input, select { font: inherit; }

/* Angka pakai lebar digit seragam (tabular) supaya rapi & tidak "goyang"
   saat animasi hitung atau dibaca sekilas. */
.stat-num, .metric-num, .status-quota, #status-quota, #status-price,
.pb-phone, .pay-amount strong, #pay-total, .voucher-code, .chip .cnt,
#metric-total, #stat-total, #stat-success {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.icon { width: 20px; height: 20px; flex-shrink: 0; display: block; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 12px; height: 12px; }

/* ---------- navbar ---------- */
.navbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.navbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  min-width: 0;
}
.brand-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-icon .icon { width: 16px; height: 16px; }
.nav-history {
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  flex-shrink: 0;
}
.nav-history:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 68px 20px 64px;
  text-align: center;
}
.hero-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 15px;
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.hero-badge .icon { width: 14px; height: 14px; }

.hero-inner { position: relative; z-index: 1; max-width: var(--container); margin: 0 auto; }
.hero h1 {
  font-size: 44px;
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  color: var(--muted);
  font-size: 16.5px;
  margin: 0 auto 36px;
  max-width: 480px;
}

.check-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  text-align: left;
}
.check-row { display: flex; gap: 10px; align-items: stretch; }
.phone-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.phone-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: #fff; }
.cc {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  white-space: nowrap;
  color: var(--muted);
}
.cc span { color: var(--ink); font-weight: 700; font-size: 14px; }
.cc .chevron { color: var(--muted-2); }
.flag-id {
  flex-shrink: 0;
  border-radius: 2px;
  outline: 1px solid rgba(15, 23, 42, 0.12);
  outline-offset: -1px;
}
.divider-v { width: 1px; background: var(--line); margin: 10px 0; flex-shrink: 0; }
.phone-field input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  padding: 13px 14px 13px 6px;
  min-width: 0;
  width: 100%;
  color: var(--ink);
}
.btn-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
}
.btn-check:hover { background: var(--accent-2); }
.btn-check:active { transform: translateY(1px); }
.btn-check:disabled { opacity: 0.55; cursor: not-allowed; }

.check-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 14px;
}
.check-hint:empty { display: none; }
.check-hint::before {
  content: '';
  width: 14px; height: 14px; flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* card "sisa slot / harga" di bawah form cek nomor */
.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 17px 22px;
  margin-top: 18px;
  text-align: left;
}
.status-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.status-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.status-icon .icon { width: 16px; height: 16px; }
.status-text { color: var(--muted); font-size: 13.5px; }
.status-text strong { color: var(--ink); font-weight: 800; }
.status-right { display: flex; align-items: baseline; gap: 6px; flex-shrink: 0; }
.status-right strong { font-size: 19px; font-weight: 800; color: var(--ink); }
.status-muted { color: var(--muted); font-size: 12.5px; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.stat-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(15,23,42,0.08); }
.stat-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon .icon { width: 19px; height: 19px; }
.stat-icon-blue { background: var(--accent-soft); color: var(--accent); }
.stat-icon-amber { background: #fff4e0; color: #d97706; }
.stat-num { font-size: 21px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- result ---------- */
.result-wrap { max-width: var(--container); margin: 24px auto 0; padding: 0 20px 48px; }

/* Banner profil biru (ala kartu kontak) */
.profile-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
  padding: 20px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.profile-banner::after {
  content: '';
  position: absolute;
  right: -40px; top: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.14), rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.pb-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pb-avatar {
  position: relative;
  width: 66px; height: 66px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.55);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px; color: #fff;
}
.pb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-avatar.is-initials { background: rgba(255,255,255,0.22); }
.pb-dot {
  position: absolute;
  right: 2px; bottom: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2.5px solid #1d4ed8;
}
.pb-info { min-width: 0; }
.pb-name {
  font-size: 22px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.pb-phone-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.pb-phone { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.92); }
.pb-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,0.18);
  color: #fff; cursor: pointer;
  transition: background-color 0.15s ease;
}
.pb-copy:hover { background: rgba(255,255,255,0.3); }
.pb-copy.copied { background: #22c55e; }
.pb-badge {
  display: inline-block;
  margin-top: 10px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
}
.pb-actions { display: flex; gap: 10px; flex-shrink: 0; }
.pb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700; font-size: 13.5px;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease, transform 0.05s ease;
}
.pb-btn:active { transform: translateY(1px); }
.pb-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pb-btn-white { background: #fff; color: var(--accent-2); }
.pb-btn-white:hover { background: #eef4ff; }
.pb-btn-ghost { background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.pb-btn-ghost:hover { background: rgba(255,255,255,0.28); }

.result-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow);
  margin: -12px 14px 0;
  padding: 22px 20px 20px;
}
.result-meta { color: var(--muted); font-size: 12.5px; }
.txn-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 6px 6px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.txn-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.txn-id {
  font-family: ui-monospace, "Courier New", monospace;
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--accent-2);
}
.txn-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: none; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  cursor: pointer;
}
.txn-copy:hover { background: #dbe6ff; }
.txn-copy.copied { background: #16a34a; color: #fff; }

.profile-extra {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.profile-extra:empty { display: none; }
.pe-item {
  display: flex; flex-direction: column; gap: 2px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}
.pe-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.pe-v { font-size: 14px; font-weight: 600; word-break: break-word; }

.block-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  margin: 20px 0 10px;
}

.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid #dbe6ff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
.chip .cnt {
  background: #fff;
  color: var(--accent-2);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11.5px;
}
.tags-empty { color: var(--muted); font-style: italic; font-size: 13.5px; }

.notice {
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 4px 0 8px;
}
.notice.error { background: var(--danger-bg); color: var(--danger); }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }

.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
.spinner-dark { border-color: rgba(37,99,235,0.25); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- modal pembayaran ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 60;
}
.modal {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  width: 100%; max-width: 400px;
  padding: 24px 22px;
  max-height: 92vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: none; border-radius: 8px;
  background: #f1f5f9; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.modal-close:hover { background: #e2e8f0; color: var(--ink); }
.modal-title { font-size: 18px; font-weight: 800; margin: 0 0 2px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* langkah 1: pilih metode pembayaran */
#pay-choice { display: flex; flex-direction: column; gap: 10px; }
.pay-method {
  display: flex; align-items: center; gap: 13px;
  width: 100%;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pay-method:hover { border-color: var(--accent); background: var(--accent-soft); }
.pay-method-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.pay-method-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pay-method-text strong { font-size: 14.5px; color: var(--ink); }
.pay-method-text small { font-size: 12.5px; color: var(--muted); }
.pay-method-chevron { color: var(--muted-2); flex-shrink: 0; }

.pay-back {
  display: inline-flex; align-items: center; gap: 5px;
  border: none; background: none; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 0; margin-bottom: 14px;
}
.pay-back:hover { color: var(--accent); }

.pay-amount {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent-soft);
  border: 1px solid #dbe6ff;
  border-radius: var(--radius-md);
  padding: 12px 16px; margin-bottom: 16px;
}
.pay-amount span { color: var(--muted); font-size: 13px; }
.pay-amount strong { font-size: 20px; font-weight: 800; color: var(--accent-2); }
.pay-qr {
  display: flex; align-items: center; justify-content: center;
  min-height: 240px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}
.pay-qr img { width: 240px; height: 240px; max-width: 100%; height: auto; display: block; }
.pay-qr-loading { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pay-status {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 14px; color: var(--ink);
  margin-bottom: 12px;
}
.dot-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.pay-retry-link {
  border: none; background: none; cursor: pointer;
  color: var(--accent); font-weight: 700; font-size: 14px;
  padding: 0; text-decoration: underline;
}
.pay-retry-link:hover { color: var(--accent-2); }
@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
.pay-hint { color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; margin: 0; }
.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: var(--ink);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.modal-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: #fff; }
.btn-check.full { width: 100%; padding: 13px; }

@media (max-width: 560px) {
  .navbar-inner { padding: 10px 16px; }
  .hero { padding: 40px 16px 36px; }
  .hero-badge { font-size: 11.5px; padding: 6px 12px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 14.5px; margin-bottom: 26px; }
  .check-card { padding: 16px; }
  .check-row { flex-direction: column; }
  .btn-check { padding: 13px; }
  .status-card { padding: 12px 14px; gap: 8px; flex-wrap: nowrap; }
  .status-left { gap: 8px; }
  .status-icon { width: 26px; height: 26px; }
  .status-icon .icon { width: 14px; height: 14px; }
  .status-text { font-size: 12px; }
  .status-right { gap: 3px; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
  .status-right strong { font-size: 15px; }
  .status-muted { font-size: 10.5px; }
  .stats { gap: 10px; }
  .stat-card { flex-direction: column; text-align: center; padding: 16px 10px; gap: 8px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 11px; }
  .result-wrap { padding-left: 16px; padding-right: 16px; }
  .profile-banner { flex-direction: column; align-items: stretch; text-align: left; padding: 18px; gap: 16px; }
  .pb-avatar { width: 56px; height: 56px; }
  .pb-name { font-size: 19px; }
  .pb-phone { font-size: 13.5px; }
  .pb-actions { width: 100%; flex-direction: column; }
  .pb-actions .pb-btn { width: 100%; justify-content: center; white-space: nowrap; }
  .result-body { margin-left: 10px; margin-right: 10px; }
}

@media (max-width: 340px) {
  .cc span { display: none; }
}

/* ======================================================================
   ADMIN PANEL
   ====================================================================== */
.admin-body { background: var(--bg); }

/* ---------- login / setup ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 400px at 50% -120px, #dbe9ff 0%, rgba(219,233,255,0) 65%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: center;
}
.auth-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  margin: 0 auto 16px;
}
.auth-logo .icon { width: 22px; height: 22px; }
.auth-title { font-size: 19px; font-weight: 800; margin: 0 0 2px; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.auth-hint { text-align: left; margin-bottom: 14px; }
.auth-input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #f8fafc; margin-bottom: 10px;
  color: var(--ink);
}
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: #fff; }

/* ---------- topbar ---------- */
.admin-topbar {
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.admin-topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.admin-topbar-actions { display: flex; gap: 8px; }
.btn-pill {
  display: inline-flex; align-items: center;
  background: none; color: var(--muted); text-decoration: none;
  cursor: pointer; font-size: 12.5px; font-weight: 600;
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px;
}
.btn-pill:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- layout: sidebar + konten ---------- */
.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.admin-sidebar {
  width: 236px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 12px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.admin-nav-item .icon { flex-shrink: 0; }
.admin-nav-item span { flex: 1; min-width: 0; white-space: nowrap; }
.admin-nav-item:hover { background: #f8fafc; color: var(--ink); }
.admin-nav-item.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 700; }

.admin-content { flex: 1; min-width: 0; }
.admin-page-head { margin-bottom: 22px; }
.admin-page-head h1 { font-size: 22px; margin: 0 0 4px; font-weight: 800; letter-spacing: -0.01em; }
.admin-page-head p { color: var(--muted); font-size: 13.5px; margin: 0; }

.admin-stats { margin-top: 0; margin-bottom: 0; grid-template-columns: repeat(2, minmax(0, 260px)); }
.admin-page + .admin-page { margin-top: 0; }
.admin-page .panel + .panel { margin-top: 18px; }

/* ---------- panel (kartu konten) ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}
.panel + .panel { margin-top: 0; }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { font-size: 15px; margin: 0 0 3px; font-weight: 700; }
.panel-head p { color: var(--muted); font-size: 12.5px; margin: 0; }
.panel-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; border: none; cursor: pointer; border-radius: 10px; padding: 11px 18px;
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none;
}
.btn:hover { opacity: 0.93; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn.secondary { background: #f8fafc; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 7px 12px; font-size: 13px; font-weight: 500; border-radius: 8px; }
.btn.danger { background: var(--danger-bg); color: var(--danger); }

.tabs { display: flex; gap: 22px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 8px 2px; font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap; flex-shrink: 0;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select {
  padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: #f8fafc; color: var(--ink);
}
.form-grid input:focus, .form-grid select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: #fff; }

.generate-link-wrap { word-break: break-all; margin: 0 0 8px; }
.generate-link-wrap a { color: var(--accent-2); font-size: 13px; }

.accounts-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px;
}
.account-row.active { border-color: var(--accent); background: var(--accent-soft); }
.account-info { min-width: 0; }
.account-info .name { font-weight: 700; overflow-wrap: anywhere; }
.account-info .phone { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.account-actions { display: flex; gap: 6px; flex-shrink: 0; }
.voucher-summary { margin-bottom: 8px; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; margin-left: 6px;
}
.hint { color: var(--muted); font-size: 12.5px; }

.captcha-img { width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }

/* voucher */
.voucher-create { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.voucher-count-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.voucher-count-field input {
  width: 110px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: #f8fafc;
}
.voucher-count-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: #fff; }
.voucher-list { display: flex; flex-direction: column; gap: 7px; }
.voucher-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.voucher-row.used { opacity: 0.55; }
.voucher-code { font-family: ui-monospace, "Courier New", monospace; font-weight: 700; letter-spacing: 0.03em; flex: 1; }
.voucher-state { font-size: 11.5px; font-weight: 700; color: var(--ok-ink); }
.voucher-row.used .voucher-state { color: var(--muted); }
.voucher-new { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.voucher-new code {
  font-family: ui-monospace, "Courier New", monospace;
  background: var(--accent-soft); color: var(--accent-2);
  padding: 5px 10px; border-radius: 8px; font-weight: 700; letter-spacing: 0.03em;
}

/* riwayat pengecekan */
.history-list { display: flex; flex-direction: column; gap: 7px; max-height: 420px; overflow-y: auto; }
.history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.history-main { display: flex; align-items: center; gap: 8px; }
.history-id {
  font-family: ui-monospace, "Courier New", monospace;
  font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em; color: var(--accent-2);
}
.history-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.history-badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.history-badge.fail { background: var(--danger-bg); color: var(--danger); }
.history-sub { grid-column: 1 / 2; color: var(--muted); font-size: 12px; }
.history-row .btn.ghost { grid-row: 1 / 3; align-self: center; }

/* backup & restore */
.restore-file-input {
  display: block; width: 100%;
  padding: 10px 12px; border-radius: 9px; border: 1px dashed var(--line);
  background: #f8fafc; color: var(--muted); font-size: 13px;
}

@media (max-width: 860px) {
  /* Di bawah lebar tablet, sidebar jadi menu vertikal full-width (bukan
     scroll horizontal) — komponen menu-nya sama persis dengan desktop,
     jadi label sepanjang apa pun ("Backup & Restore") tetap dapat ruang
     penuh, tidak pernah terpotong atau dipaksa mengecil. */
  .admin-shell { flex-direction: column; gap: 16px; }
  .admin-sidebar { width: 100%; position: static; }
}

@media (max-width: 560px) {
  .admin-topbar-inner { padding: 10px 16px; }
  .admin-topbar-actions a.btn-pill { display: none; } /* logo brand sudah link ke halaman publik */
  .admin-shell { padding: 18px 16px 48px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 18px; }
  .panel-head-row { flex-direction: column; align-items: stretch; }
  .panel-head-row .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
  .account-row { flex-direction: column; align-items: stretch; }
  .account-actions { width: 100%; }
  .account-actions .btn { flex: 1; }
  .voucher-create { align-items: stretch; }
  .voucher-create .btn { width: 100%; }
  .voucher-row { flex-wrap: wrap; }
  .history-row { grid-template-columns: 1fr; }
  .tabs { gap: 16px; }
  .history-row .btn.ghost { grid-row: auto; justify-self: start; }
}
