:root {
  --gold: #D4AF37;
  --gold-light: #F5D96B;
  --gold-dark: #A07810;
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --card: #16161f;
  --card2: #1e1e2a;
  --border: #2a2a3a;
  --text: #f0f0f0;
  --text2: #a0a0b0;
  --text3: #606070;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --gold-glow: 0 0 20px rgba(212,175,55,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 80px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ======== SCROLLBAR ======== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ======== LAYOUT ======== */
.container { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.page-wrap { max-width: 480px; margin: 0 auto; }

/* ======== TOPBAR ======== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 480px; margin: 0 auto;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }

/* ======== BOTTOM NAV ======== */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex; z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px 8px;
  color: var(--text3); font-size: 0.65rem; gap: 4px;
  transition: color .2s;
}
.nav-item.active { color: var(--gold); }
.nav-item svg { width: 22px; height: 22px; }

/* ======== MARQUEE ======== */
.marquee-wrap {
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
  padding: 6px 0; overflow: hidden;
}
.marquee-track {
  display: flex; white-space: nowrap;
  animation: marquee 25s linear infinite;
}
.marquee-text { font-size: 0.75rem; font-weight: 600; color: #000; padding: 0 32px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ======== CARDS ======== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.card-gold {
  background: linear-gradient(135deg, #1a1500 0%, #2a2000 50%, #1a1500 100%);
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  box-shadow: var(--gold-glow);
}

/* ======== BALANCE CARD ======== */
.balance-card {
  background: linear-gradient(135deg, #12100a 0%, #221a00 40%, #12100a 100%);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: var(--radius); padding: 20px 16px;
  box-shadow: var(--gold-glow);
  margin: 12px 16px;
}
.balance-label { font-size: 0.75rem; color: var(--gold-light); opacity: 0.8; margin-bottom: 4px; }
.balance-amount { font-size: 1.8rem; font-weight: 700; color: var(--gold); letter-spacing: -0.5px; }
.balance-sub { font-size: 0.75rem; color: var(--text2); margin-top: 4px; }
.balance-actions { display: flex; gap: 8px; margin-top: 14px; }
.balance-btn {
  flex: 1; padding: 10px; border-radius: var(--radius-sm);
  font-size: 0.8rem; font-weight: 600; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.balance-btn.primary { background: var(--gold); color: #000; }
.balance-btn.outline { background: transparent; border: 1px solid var(--gold-dark); color: var(--gold); }

/* ======== MENU GRID ======== */
.menu-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; padding: 4px 0; }
.menu-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: var(--radius-sm);
  background: var(--card2); color: var(--text);
  font-size: 0.65rem; text-align: center;
  transition: all .15s;
}
.menu-item:active { transform: scale(0.95); }
.menu-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

/* ======== BANNER SLIDER ======== */
.banner-wrap { overflow: hidden; border-radius: var(--radius); margin: 0 16px 12px; }
.banner-track { display: flex; transition: transform .4s ease; }
.banner-item { min-width: 100%; }
.banner-item img { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius); }
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.banner-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all .2s; }
.banner-dot.active { width: 18px; border-radius: 3px; background: var(--gold); }

/* ======== SECTION TITLE ======== */
.section-title {
  font-size: 0.85rem; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 12px 16px 6px;
}
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px; }
.section-header .see-all { font-size: 0.75rem; color: var(--gold); }

/* ======== PRODUCT CARD ======== */
.product-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 8px; }
.product-card {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: flex; gap: 12px; align-items: center;
  transition: border-color .2s;
}
.product-card:active { border-color: var(--gold-dark); }
.product-img {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--bg3);
  flex-shrink: 0;
}
.product-info { flex: 1; min-width: 0; }
.product-name { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.product-price { font-size: 1rem; font-weight: 700; color: var(--gold); }
.product-meta { font-size: 0.7rem; color: var(--text2); margin-top: 4px; }
.product-profit { font-size: 0.75rem; color: var(--success); font-weight: 600; }
.badge-category {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.65rem; font-weight: 700;
}
.badge-biasa   { background: rgba(59,130,246,.15); color: #60a5fa; }
.badge-medium  { background: rgba(212,175,55,.15); color: var(--gold); }
.badge-high    { background: rgba(239,68,68,.15); color: #f87171; }

/* ======== FORMS ======== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 14px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.9rem; outline: none; transition: border-color .2s;
}
.form-control:focus { border-color: var(--gold-dark); }
.form-control::placeholder { color: var(--text3); }
.input-group { position: relative; }
.input-group .form-control { padding-right: 44px; }
.input-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text3); }

/* ======== BUTTONS ======== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 700; transition: all .15s;
  width: 100%; text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-gold { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #000; }
.btn-outline { background: transparent; border: 1px solid var(--gold-dark); color: var(--gold); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: var(--card2); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ======== AUTH PAGES ======== */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; padding: 24px 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.08) 0%, transparent 60%), var(--bg);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-text { font-size: 2rem; font-weight: 900; color: var(--gold); letter-spacing: -1px; }
.auth-logo-sub { font-size: 0.75rem; color: var(--text2); }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 24px 20px; }
.auth-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.auth-sub { font-size: 0.8rem; color: var(--text2); margin-bottom: 20px; }

/* ======== ALERTS ======== */
.alert {
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 0.85rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.2); color: var(--success); }
.alert-danger  { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.2);  color: var(--danger); }
.alert-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.2); color: var(--warning); }
.alert-info    { background: rgba(59,130,246,.12);  border: 1px solid rgba(59,130,246,.2);  color: var(--info); }

/* ======== TOAST ======== */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; width: 90%; max-width: 360px; }
.toast {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 0.85rem; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow); margin-bottom: 8px;
  animation: toast-in .3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }
@keyframes toast-in { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }

/* ======== MODAL ======== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 500; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: var(--bg2); border-radius: 20px 20px 0 0;
  padding: 20px 16px 32px; width: 100%; max-width: 480px;
  transform: translateY(100%); transition: transform .3s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-backdrop.open .modal-sheet { transform: translateY(0); }
.modal-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }

/* ======== VIP BADGE ======== */
.vip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700;
}
.vip-0 { background: rgba(205,127,50,.15); color: #cd7f32; border: 1px solid rgba(205,127,50,.3); }
.vip-1 { background: rgba(192,192,192,.15); color: #c0c0c0; border: 1px solid rgba(192,192,192,.3); }
.vip-2 { background: rgba(255,215,0,.15);   color: #ffd700; border: 1px solid rgba(255,215,0,.3); }
.vip-3 { background: rgba(229,228,226,.15); color: #e5e4e2; border: 1px solid rgba(229,228,226,.3); }

/* ======== TRANSACTION LIST ======== */
.trx-list { display: flex; flex-direction: column; gap: 1px; }
.trx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--card);
  border-bottom: 1px solid var(--border);
}
.trx-icon {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.trx-info { flex: 1; min-width: 0; }
.trx-label { font-size: 0.85rem; font-weight: 600; }
.trx-date  { font-size: 0.7rem; color: var(--text3); margin-top: 2px; }
.trx-amount { font-size: 0.9rem; font-weight: 700; }
.trx-amount.credit { color: var(--success); }
.trx-amount.debit  { color: var(--danger); }

/* ======== STATUS BADGES ======== */
.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
}
.status-pending   { background: rgba(245,158,11,.15); color: var(--warning); }
.status-paid,
.status-approved  { background: rgba(34,197,94,.15);  color: var(--success); }
.status-rejected,
.status-failed    { background: rgba(239,68,68,.15);   color: var(--danger); }
.status-expired   { background: rgba(96,96,112,.15);   color: var(--text3); }

/* ======== TABS ======== */
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto; }
.tab-item {
  padding: 10px 14px; font-size: 0.8rem; font-weight: 600;
  color: var(--text3); border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all .2s;
}
.tab-item.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ======== STATS ROW ======== */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0 16px 12px; }
.stat-box {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  text-align: center;
}
.stat-value { font-size: 1rem; font-weight: 700; color: var(--gold); }
.stat-label { font-size: 0.65rem; color: var(--text3); margin-top: 2px; }

/* ======== PIN INPUT ======== */
.pin-row { display: flex; gap: 10px; justify-content: center; margin: 16px 0; }
.pin-dot {
  width: 48px; height: 52px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--gold); transition: border-color .2s;
}
.pin-dot.filled { border-color: var(--gold-dark); background: rgba(212,175,55,.07); }
.pin-hidden { position: absolute; opacity: 0; width: 0; height: 0; }

/* ======== MINING CARD ======== */
.mining-card {
  background: radial-gradient(ellipse at 50% 0%, rgba(212,175,55,0.1), transparent 70%), var(--card);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: var(--radius); padding: 20px 16px; text-align: center;
}
.mining-icon { font-size: 3rem; margin-bottom: 8px; }
.mining-profit { font-size: 2rem; font-weight: 700; color: var(--gold); }
.mining-timer { font-size: 0.85rem; color: var(--text2); margin-top: 4px; }
.mining-progress {
  height: 6px; background: var(--border); border-radius: 3px; margin: 12px 0;
  overflow: hidden;
}
.mining-progress-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width .5s;
}

/* ======== DAILY BONUS ======== */
.bonus-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; padding: 0 16px 12px; }
.bonus-day {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 4px;
  text-align: center; font-size: 0.7rem;
}
.bonus-day.claimed { border-color: var(--success); background: rgba(34,197,94,.07); }
.bonus-day.today   { border-color: var(--gold); box-shadow: 0 0 10px rgba(212,175,55,.15); }
.bonus-day-num { font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.bonus-day-amt { color: var(--text2); font-size: 0.65rem; }

/* ======== CHAT ======== */
.chat-messages { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 0.85rem; line-height: 1.4;
}
.chat-bubble.user  { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #000; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble.admin { background: var(--card2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-time { font-size: 0.65rem; color: var(--text3); margin-top: 4px; text-align: right; }
.chat-input-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 10px 12px; display: flex; gap: 8px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.chat-input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 10px 14px; color: var(--text); font-size: 0.85rem; outline: none; }
.chat-send { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #000; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ======== FLOATING CS BUTTON ======== */
.fab-cs {
  position: fixed; bottom: 88px; right: 16px;
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  box-shadow: 0 4px 16px rgba(212,175,55,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; z-index: 200;
  animation: pulse-fab 2s infinite;
}
@keyframes pulse-fab { 0%,100% { box-shadow: 0 4px 16px rgba(212,175,55,.4); } 50% { box-shadow: 0 4px 28px rgba(212,175,55,.7); } }

/* ======== ADMIN ======== */
.admin-body { background: #0d0d14; padding-bottom: 20px; }
.admin-sidebar {
  position: fixed; top: 0; left: 0; width: 240px; height: 100vh;
  background: var(--bg2); border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 300; padding: 0 0 20px;
}
.admin-main { margin-left: 240px; padding: 20px; min-height: 100vh; }
@media(max-width:768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  color: var(--text2); font-size: 0.85rem; transition: all .15s;
}
.admin-nav-item:hover, .admin-nav-item.active { color: var(--gold); background: rgba(212,175,55,.06); }
.admin-topbar {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text3); font-weight: 600; background: var(--bg3); }
.admin-table tr:hover td { background: rgba(212,175,55,.03); }
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 20px; }
.admin-stat { background: var(--card2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.admin-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--gold); }
.admin-stat-label { font-size: 0.75rem; color: var(--text3); margin-top: 4px; }

/* ======== LOADING / SKELETON ======== */
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-wave { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======== EMPTY STATE ======== */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.empty-desc { font-size: 0.8rem; color: var(--text3); }

/* ======== QUICK AMOUNTS ======== */
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.quick-amount {
  padding: 7px 14px; border-radius: 20px;
  background: var(--card2); border: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600; color: var(--text2);
  transition: all .15s;
}
.quick-amount:active, .quick-amount.selected { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,.07); }

/* ======== PROGRESS BAR ======== */
.progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); transition: width .4s; }

/* ======== UTILS ======== */
.text-gold  { color: var(--gold); }
.text-muted { color: var(--text3); }
.text-sm    { font-size: 0.8rem; }
.text-xs    { font-size: 0.7rem; }
.text-center { text-align: center; }
.fw-bold   { font-weight: 700; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
