/* ============================================================
   game_topup — mobile only (max-width 440px)
   ============================================================ */
:root {
  --bg: #0f1117;
  --bg2: #151822;
  --card: #1c2030;
  --card2: #242a3f;
  --border: #2c3248;
  --text: #eef0f7;
  --muted: #8b90a5;
  --primary: #7c5cff;
  --primary2: #4f8bff;
  --success: #2fd07c;
  --warning: #ffb020;
  --danger: #ff4d5e;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  background: #0a0c12;
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  padding-bottom: 88px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(15, 17, 23, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.topbar-title .logo { font-size: 20px; }
.icon-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:active { transform: scale(.94); }

/* ---------- Bottom nav ---------- */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 440px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(21, 24, 34, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  border-radius: 12px;
  transition: color .15s;
}
.bottomnav a .nav-ico { font-size: 21px; line-height: 1; }
.bottomnav a.active { color: var(--primary2); background: rgba(79, 139, 255, .12); font-weight: 600; }

/* ---------- View ---------- */
.view { padding: 16px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* ---------- Typography ---------- */
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-label { color: var(--muted); font-size: 12px; }
.card-value { font-weight: 700; font-size: 14px; text-align: right; word-break: break-word; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
  transition: transform .1s, filter .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: 0 8px 22px rgba(124, 92, 255, .35); }
.btn.success { background: var(--success); color: #06250f; }
.btn.danger { background: rgba(255, 77, 94, .15); color: var(--danger); border: 1px solid rgba(255, 77, 94, .35); }
.btn.ghost { background: var(--card2); border: 1px solid var(--border); color: var(--text); }
.btn.block { width: 100%; }
.btn.sm { padding: 9px 12px; font-size: 13px; border-radius: 10px; width: auto; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link {
  background: none; border: none; color: var(--primary2);
  font-size: 14px; font-weight: 600; cursor: pointer; width: 100%;
  text-align: center; padding: 10px;
}

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.input:focus { border-color: var(--primary); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
textarea.input { min-height: 76px; resize: vertical; }
.file-box {
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  background: var(--bg2);
}
.file-box.have { border-color: var(--success); color: var(--success); }

/* ---------- Chips (pilih game / paket) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
}
.chip.active { background: linear-gradient(135deg, var(--primary), var(--primary2)); border-color: transparent; box-shadow: 0 4px 14px rgba(124, 92, 255, .4); }
.pkg { display: block; width: 100%; text-align: left; margin-bottom: 8px; }
.pkg .pkg-nom { font-weight: 700; }
.pkg .pkg-harga { color: var(--primary2); float: right; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: var(--card2);
  border: 1px solid var(--border);
}
.badge.pending    { color: var(--warning); background: rgba(255, 176, 32, .12); border-color: rgba(255, 176, 32, .35); }
.badge.paid, .badge.chip_sent { color: #7fb3ff; background: rgba(79, 139, 255, .12); border-color: rgba(79, 139, 255, .4); }
.badge.processing { color: var(--warning); background: rgba(255, 176, 32, .12); border-color: rgba(255, 176, 32, .35); }
.badge.completed  { color: var(--success); background: rgba(47, 208, 124, .12); border-color: rgba(47, 208, 124, .4); }
.badge.cancelled  { color: var(--muted); background: rgba(139, 144, 165, .12); border-color: rgba(139, 144, 165, .35); }
.badge.rejected   { color: var(--danger); background: rgba(255, 77, 94, .12); border-color: rgba(255, 77, 94, .4); }
.badge.type-topup   { background: rgba(47, 208, 124, .12); color: var(--success); border-color: rgba(47, 208, 124, .4); }
.badge.type-bongkar { background: rgba(79, 139, 255, .12); color: #7fb3ff; border-color: rgba(79, 139, 255, .4); }

/* ---------- Quick actions (home) ---------- */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-card {
  border-radius: 18px;
  padding: 20px 16px;
  color: #fff;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-card .qc-ico { font-size: 30px; }
.quick-card .qc-title { font-weight: 800; font-size: 16px; }
.quick-card .qc-sub { font-size: 12px; opacity: .85; }
.quick-card.topup { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 10px 24px rgba(34, 197, 94, .3); }
.quick-card.bongkar { background: linear-gradient(135deg, #4f8bff, #7c5cff); box-shadow: 0 10px 24px rgba(124, 92, 255, .3); }

/* ---------- Order list ---------- */
.order-item {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--text);
  transition: transform .1s;
}
.order-item:active { transform: scale(.98); }
.order-item .oi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-item .oi-no { font-weight: 800; font-size: 14px; }
.order-item .oi-game { font-size: 13px; color: var(--muted); }
.order-item .oi-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.order-item .oi-price { font-weight: 800; color: var(--primary2); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ''; position: absolute; left: -21px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card2); border: 2px solid var(--primary2);
}
.tl-item .tl-title { font-weight: 700; font-size: 13px; }
.tl-item .tl-note { font-size: 12px; color: var(--muted); }
.tl-item .tl-time { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- Auth ---------- */
.auth { min-height: 88dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 6px; }
.auth-logo {
  width: 76px; height: 76px; border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; margin: 0 auto 18px;
  box-shadow: 0 14px 34px rgba(124, 92, 255, .4);
}
.auth h1 { text-align: center; font-size: 26px; }
.auth .sub { text-align: center; margin-top: 6px; margin-bottom: 26px; }
.auth-brand { color: var(--muted); font-size: 12px; text-align: center; margin-top: 18px; }

/* ---------- Info strip ---------- */
.info-strip {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(124, 92, 255, .1);
  border: 1px solid rgba(124, 92, 255, .3);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.info-strip .ico { font-size: 18px; }
.info-strip .owner-id {
  background: var(--card2); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 8px;
  font-weight: 700; font-size: 14px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 104px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  background: #232a3d;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  max-width: 88%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: rgba(255, 77, 94, .95); }
.toast.success { background: rgba(47, 208, 124, .95); color: #06250f; }

/* ---------- Modal / sheet ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 440px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet .sheet-handle { width: 42px; height: 4px; background: var(--border); border-radius: 4px; margin: 0 auto 16px; }
.sheet-title { font-weight: 800; font-size: 17px; margin-bottom: 14px; }
.sheet .menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 10px;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; text-align: left;
}
.sheet .menu-item:active { transform: scale(.98); }

/* ---------- Proof image ---------- */
.proof-img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  max-height: 320px;
  object-fit: cover;
  background: var(--bg2);
}
.img-zoom {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(0, 0, 0, .9);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.img-zoom img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.img-zoom .close-x { position: absolute; top: 18px; right: 18px; font-size: 26px; color: #fff; background: none; border: none; cursor: pointer; }

/* ---------- Tabs (admin) ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.tabs .tab {
  flex-shrink: 0; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.tabs .tab.active { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; border-color: transparent; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px;
}
.stat .stat-num { font-size: 20px; font-weight: 800; }
.stat .stat-label { font-size: 12px; color: var(--muted); }
.stat.green .stat-num { color: var(--success); }
.stat.blue .stat-num { color: #7fb3ff; }
.stat.warn .stat-num { color: var(--warning); }

/* ---------- Filter pills ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.filter {
  flex-shrink: 0; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.filter.active { background: var(--primary); color: #fff; border-color: transparent; }

/* ---------- Loading & empty ---------- */
.loading { text-align: center; padding: 40px 0; color: var(--muted); font-size: 14px; }
.empty { text-align: center; padding: 44px 0; color: var(--muted); }
.empty .empty-ico { font-size: 44px; margin-bottom: 10px; }

/* ---------- Admin layout ---------- */
.admin-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 440px; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(21, 24, 34, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.admin-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0; color: var(--muted); text-decoration: none;
  font-size: 11px; border-radius: 12px;
}
.admin-nav a .nav-ico { font-size: 21px; }
.admin-nav a.active { color: var(--primary2); background: rgba(124, 92, 255, .12); font-weight: 600; }
.admin-nav a.danger-link { color: var(--danger); }

/* ---------- List item (admin) ---------- */
.crud-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.crud-item .ci-name { font-weight: 700; font-size: 14px; }
.crud-item .ci-sub { font-size: 12px; color: var(--muted); }
.icon-btn.danger { border-color: rgba(255, 77, 94, .35); color: var(--danger); }

/* ---------- Small ---------- */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.money { color: var(--primary2); font-weight: 800; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
