/* ═══════════════════════════════════════════════════════════════════
   iMortifex · Premium SaaS Design System v3.0
   Mobile-First · Telegram Mini App · Fintech Dark
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --gold:      #D4AF37;
  --gold-s:    #FACC15;
  --gold-dim:  rgba(212,175,55,.10);
  --gold-glow: rgba(212,175,55,.18);
  --gold-bd:   rgba(212,175,55,.28);
  --gold-text: #C9A227;
  --red:       #DC2626;
  --red-dim:   rgba(220,38,38,.10);
  --red-bd:    rgba(220,38,38,.28);
  --bg:        #080C11;
  --bg2:       #0A0E14;
  --surface:   #0F1520;
  --card:      #111927;
  --s2:        #162033;
  --s3:        #1B2840;
  --s4:        #1F2E48;
  --b0: rgba(255,255,255,.04);
  --b1: rgba(255,255,255,.08);
  --b2: rgba(255,255,255,.13);
  --b3: rgba(255,255,255,.20);
  --t0:  #F0F4FF;
  --t1:  #C8D4E8;
  --t2:  #8895A8;
  --t3:  #3F4F63;
  --blue:     #3B82F6;
  --blue-dim: rgba(59,130,246,.10);
  --blue-bd:  rgba(59,130,246,.28);
  --ok:       #10B981;
  --ok-dim:   rgba(16,185,129,.10);
  --ok-bd:    rgba(16,185,129,.28);
  --warn:     #F59E0B;
  --warn-dim: rgba(245,158,11,.10);
  --warn-bd:  rgba(245,158,11,.28);
  --err:      #EF4444;
  --err-dim:  rgba(239,68,68,.10);
  --err-bd:   rgba(239,68,68,.28);
  --purple:     #A855F7;
  --purple-dim: rgba(168,85,247,.10);
  --purple-bd:  rgba(168,85,247,.28);
  --sp1: 4px;  --sp2: 8px;   --sp3: 12px;  --sp4: 16px;
  --sp5: 20px; --sp6: 24px;  --sp8: 32px;  --sp10: 40px; --sp12: 48px;
  --px: clamp(14px, 4.5vw, 28px);
  --r-xs: 4px;  --r-sm: 6px;  --r-md: 10px;
  --r-lg: 14px; --r-xl: 18px; --r-2xl: 24px; --r-f: 9999px;
  --font: 'Sora', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --sh-sm:   0 1px 4px rgba(0,0,0,.7);
  --sh-md:   0 4px 24px rgba(0,0,0,.75);
  --sh-lg:   0 12px 48px rgba(0,0,0,.85);
  --sh-gold: 0 0 24px rgba(212,175,55,.14), 0 0 48px rgba(212,175,55,.06);
  --nav-h:  60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --sidebar-w: 220px;
  --ease:   cubic-bezier(.16,1,.3,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); overflow-x: hidden; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--t0); font-family: var(--font); font-size: clamp(13px,3.5vw,14.5px); line-height: 1.55; min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img    { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: var(--font); }
a { color: inherit; text-decoration: none; }
* { word-break: break-word; }
.mono { word-break: break-all; }

/* ── Ambient bg ── */
body::before {
  content: ''; position: fixed; top: -20%; left: -10%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, rgba(212,175,55,.04) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: ''; position: fixed; bottom: -10%; right: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(59,130,246,.04) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* ── Pages ── */
.page { display: none; width: 100%; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
.page.active { display: block; }

/* ── Desktop sidebar (hidden on mobile) ── */
.desktop-sidebar { display: none; }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(8,12,17,.97); border-top: 1px solid var(--b1);
  display: flex; z-index: 100;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--t3); position: relative; transition: color .2s; min-width: 0; padding-top: 6px;
}
.bnav-icon { position: relative; display: flex; align-items: center; justify-content: center; }
.bnav-icon svg { width: 22px; height: 22px; flex-shrink: 0; transition: transform .25s var(--spring); }
.bnav-label { font-size: 10px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; }
.bnav-dot { position: absolute; top: -2px; right: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0; transition: opacity .2s; }
.bnav-item.active { color: var(--gold); }
.bnav-item.active .bnav-icon svg { transform: translateY(-2px) scale(1.1); filter: drop-shadow(0 0 6px rgba(212,175,55,.5)); }
.bnav-item.active .bnav-dot { opacity: 1; }

/* ── Topbar ── */
.topbar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: var(--sp3) var(--px); position: sticky; top: 0; z-index: 50; background: rgba(8,12,17,.97); border-bottom: 1px solid var(--b0); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); min-height: 56px; }
.topbar-brand { display: flex; align-items: center; gap: var(--sp2); min-width: 0; }
.topbar-logo { width: 30px; height: 30px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; border: 1px solid var(--gold-bd); box-shadow: var(--sh-gold); }
.topbar-wordmark { font-size: clamp(15px,4.5vw,18px); font-weight: 800; letter-spacing: -.5px; white-space: nowrap; }
.topbar-dot { color: var(--gold); }
.topbar-greeting { font-size: clamp(10px,2.5vw,12px); color: var(--t2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }

/* ── Page Headers ── */
.page-header { width: 100%; padding: var(--sp5) var(--px) var(--sp4); border-bottom: 1px solid var(--b0); position: sticky; top: 0; z-index: 40; background: rgba(8,12,17,.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.page-header-title { font-size: clamp(18px,5vw,24px); font-weight: 800; letter-spacing: -.6px; }
.page-header-sub   { font-size: 12px; color: var(--t2); margin-top: 3px; }

/* ── Balance Hero ── */
.balance-hero {
  position: relative; padding: var(--sp6) var(--px) var(--sp5); overflow: hidden;
}
.balance-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(212,175,55,.10) 0%, transparent 70%),
              linear-gradient(180deg, var(--surface) 0%, transparent 100%);
  pointer-events: none;
}
.balance-hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 44px 44px; pointer-events: none;
}
.balance-hero-inner { position: relative; z-index: 1; }
.balance-label { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--t2); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: var(--sp3); }
.balance-label-icon { color: var(--gold); font-size: 12px; }
.balance-amount { display: flex; align-items: baseline; gap: var(--sp2); flex-wrap: wrap; }
.balance-number { font-family: var(--mono); font-size: clamp(34px,10vw,52px); font-weight: 800; letter-spacing: -2px; color: var(--t0); line-height: 1; }
.balance-unit   { font-size: clamp(14px,3vw,16px); font-weight: 600; color: var(--t2); letter-spacing: .5px; }
.balance-fiat   { font-size: 13px; color: var(--t2); margin-top: var(--sp1); font-family: var(--mono); }
.balance-actions { display: flex; gap: var(--sp2); margin-top: var(--sp5); flex-wrap: wrap; }

.bal-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: var(--r-f); font-size: 13px; font-weight: 700; transition: all .2s var(--ease); white-space: nowrap; flex-shrink: 0; }
.bal-btn-primary { background: linear-gradient(135deg, var(--gold), var(--gold-s)); color: #08100A; box-shadow: 0 4px 16px rgba(212,175,55,.30); }
.bal-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(212,175,55,.40); }
.bal-btn-primary:active { transform: translateY(0); }
.bal-btn-ghost { background: var(--surface); border: 1px solid var(--b2); color: var(--t1); }
.bal-btn-ghost:hover { background: var(--s2); border-color: var(--b3); }

/* ── Promo/Ticker ── */
.promo-ribbon { display: flex; align-items: center; gap: var(--sp2); padding: 10px var(--px); background: linear-gradient(90deg, rgba(212,175,55,.08), rgba(212,175,55,.04)); border-top: 1px solid var(--gold-bd); border-bottom: 1px solid var(--gold-bd); font-size: 12px; color: var(--gold-text); font-weight: 600; overflow: hidden; }
.promo-ribbon-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex-shrink: 0; box-shadow: 0 0 8px var(--gold); animation: pulse-dot 2s ease infinite; }
@keyframes pulse-dot { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.6; transform:scale(.8); } }

.activity-ticker { display: flex; align-items: center; gap: var(--sp2); padding: 9px var(--px); background: var(--surface); border-bottom: 1px solid var(--b0); font-size: 12px; color: var(--t2); overflow: hidden; }
.ticker-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; animation: pulse-dot 2s ease infinite; }
.ticker-text  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Dashboard Sections ── */
.dash-section { padding: var(--sp5) var(--px) var(--sp3); }
.dash-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp4); gap: var(--sp2); }
.dash-section-title  { font-size: 13px; font-weight: 700; color: var(--t0); letter-spacing: .2px; }
.dash-section-link   { font-size: 12px; color: var(--t2); transition: color .15s; white-space: nowrap; }
.dash-section-link:hover { color: var(--gold); }

/* ── Service Grid ── */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(120px,38vw,150px), 1fr));
  gap: var(--sp2);
}

.service-card {
  display: flex; flex-direction: column; gap: var(--sp2); padding: var(--sp3);
  background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg);
  cursor: pointer; transition: all .2s var(--ease); min-width: 0; position: relative; overflow: hidden;
}
.service-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
.service-card:hover { background: var(--s2); border-color: var(--b1); transform: translateY(-2px); box-shadow: var(--sh-md); }
.service-card:active { transform: translateY(0); }
.service-card.featured { border-color: var(--gold-bd); box-shadow: var(--sh-gold); }
.service-card.off { opacity: .4; cursor: default; pointer-events: none; }

.sc-icon  { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--gold-dim); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.sc-name  { font-size: 12px; font-weight: 700; color: var(--t0); line-height: 1.3; }
.sc-desc  { font-size: 10px; color: var(--t2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; flex: 1; }
.sc-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp1); flex-wrap: wrap; }
.sc-price { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--gold); }
.sc-price small { font-size: 9px; font-family: var(--font); color: var(--t2); }

.service-card-full { display: flex; align-items: center; gap: var(--sp3); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); padding: var(--sp4); cursor: pointer; transition: all .2s; min-width: 0; }
.service-card-full:hover  { background: var(--s2); border-color: var(--b1); }
.service-card-full:active { background: var(--s3); }
.service-card-full.off    { opacity: .4; cursor: default; pointer-events: none; }
.service-card-full .sc-info  { flex: 1; min-width: 0; }
.service-card-full .sc-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

#allProductsList { display: grid; grid-template-columns: 1fr; gap: var(--sp2); padding: var(--sp4) var(--px); }

/* ── Activity Feed ── */
.activity-feed { display: flex; flex-direction: column; gap: var(--sp2); }

/* ── Filter Strip ── */
.filter-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: var(--sp3) var(--px); border-bottom: 1px solid var(--b0); }
.filter-strip::-webkit-scrollbar { display: none; }
.filter-chip { padding: 6px 14px; border-radius: var(--r-f); border: 1px solid var(--b1); background: transparent; color: var(--t2); font-size: 12px; font-weight: 500; white-space: nowrap; flex-shrink: 0; transition: all .15s; }
.filter-chip:hover  { border-color: var(--b2); color: var(--t1); }
.filter-chip.active { background: var(--gold-dim); border-color: var(--gold-bd); color: var(--gold); font-weight: 700; }

/* ── Order Timeline ── */
.order-timeline { display: flex; flex-direction: column; gap: var(--sp2); }

.order-item { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp4) var(--sp3) var(--sp4) calc(var(--sp3) + 10px); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); cursor: pointer; transition: all .15s; position: relative; overflow: hidden; min-width: 0; }
.order-item:hover  { background: var(--s2); border-color: var(--b1); }
.order-item:active { background: var(--s3); }
.order-item::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--b1); }
.order-item[data-status="Done"]::before    { background: var(--ok); }
.order-item[data-status="Process"]::before { background: var(--blue); }
.order-item[data-status="Pending"]::before { background: var(--warn); }
.order-item[data-status="Failed"]::before  { background: var(--err); }
.order-item[data-status="Repeat"]::before  { background: var(--purple); }
.order-item[data-status="Refund"]::before  { background: var(--red); }

.oi-icon  { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--s2); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.oi-body  { flex: 1; min-width: 0; }
.oi-id    { font-family: var(--mono); font-size: 10px; color: var(--t2); }
.oi-name  { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi-imei  { font-family: var(--mono); font-size: 10px; color: var(--t2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi-meta  { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.oi-time  { font-size: 10px; color: var(--t2); }

.detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--b0); gap: var(--sp4); min-width: 0; }
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 12px; color: var(--t2); flex-shrink: 0; }
.detail-val { font-size: 13px; font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.detail-val.mono { font-family: var(--mono); font-size: 11px; }

/* ── Profile ── */
.profile-identity { display: flex; align-items: center; gap: var(--sp4); padding: var(--sp6) var(--px) var(--sp5); border-bottom: 1px solid var(--b0); flex-wrap: wrap; }
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--s2), var(--s3)); border: 2px solid var(--gold-bd); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: var(--gold); box-shadow: var(--sh-gold); }
.profile-avatar-ring { position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--gold-dim); animation: ring-pulse 3s ease-in-out infinite; }
@keyframes ring-pulse { 0%,100% { opacity:.4; transform:scale(1); } 50% { opacity:1; transform:scale(1.04); } }
.profile-meta { flex: 1; min-width: 0; }
.profile-name { font-size: clamp(16px,5vw,20px); font-weight: 800; letter-spacing: -.4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-uid  { font-family: var(--mono); font-size: 11px; color: var(--t2); margin-top: 2px; }
.profile-tier { display: inline-flex; margin-top: 6px; font-size: 10px; font-weight: 700; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-bd); padding: 2px 10px; border-radius: var(--r-f); letter-spacing: .5px; text-transform: uppercase; }

.profile-stats-row { display: flex; align-items: center; padding: var(--sp4) var(--px); border-bottom: 1px solid var(--b0); background: var(--surface); }
.profile-stat { flex: 1; text-align: center; min-width: 0; }
.profile-stat-value { font-family: var(--mono); font-size: clamp(18px,5vw,26px); font-weight: 800; letter-spacing: -1px; }
.profile-stat-label { font-size: 10px; color: var(--t2); margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }
.profile-stat-divider { width: 1px; height: 40px; background: var(--b0); flex-shrink: 0; }

.profile-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp2); padding: var(--sp4) var(--px); }
.profile-action-card { display: flex; flex-direction: column; align-items: center; gap: var(--sp2); padding: var(--sp4) var(--sp2); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); font-size: clamp(10px,3vw,12px); font-weight: 600; color: var(--t1); transition: all .15s; min-width: 0; }
.profile-action-card:hover  { background: var(--s2); border-color: var(--b1); color: var(--t0); transform: translateY(-1px); }
.profile-action-card:active { background: var(--s3); transform: scale(.98); }
.pac-icon        { width: 38px; height: 38px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pac-icon-gold   { background: var(--gold-dim);   color: var(--gold); }
.pac-icon-blue   { background: var(--blue-dim);   color: var(--blue); }
.pac-icon-green  { background: var(--ok-dim);     color: var(--ok); }
.pac-icon-amber  { background: var(--warn-dim);   color: var(--warn); }
.pac-icon-purple { background: var(--purple-dim); color: var(--purple); }
.pac-icon-red    { background: var(--red-dim);    color: var(--red); }
.profile-footer  { text-align: center; padding: var(--sp5) var(--px); font-size: 11px; color: var(--t3); }

/* ── Admin Console ── */
.admin-topbar { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp3) var(--px); border-bottom: 1px solid var(--b0); background: rgba(8,12,17,.97); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(20px); min-height: 56px; }
.admin-back-btn { width: 32px; height: 32px; border-radius: var(--r-md); border: 1px solid var(--b1); background: var(--surface); color: var(--t1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
.admin-back-btn:hover { background: var(--s2); color: var(--t0); }
.admin-topbar-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-topbar-badge { font-size: 9px; font-weight: 800; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-bd); padding: 2px 8px; border-radius: var(--r-f); letter-spacing: 1px; flex-shrink: 0; white-space: nowrap; }

.admin-tab-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: var(--sp2) var(--px); border-bottom: 1px solid var(--b0); background: rgba(10,14,20,.97); position: sticky; top: 56px; z-index: 40; }
.admin-tab-nav::-webkit-scrollbar { display: none; }
.adm-tab-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: var(--r-f); border: 1px solid var(--b1); background: transparent; color: var(--t2); font-size: 11px; font-weight: 500; white-space: nowrap; flex-shrink: 0; transition: all .15s; }
.adm-tab-btn:hover  { border-color: var(--b2); color: var(--t1); }
.adm-tab-btn.active { background: var(--gold-dim); border-color: var(--gold-bd); color: var(--gold); font-weight: 700; }
.adm-tab-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.adm-badge { background: var(--err); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: var(--r-f); }

.adm-tab   { display: none; }
.adm-panel { padding: var(--sp4) var(--px); max-width: 940px; margin: 0 auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px,40vw,190px), 1fr)); gap: var(--sp2); margin-bottom: var(--sp5); }
.kpi-card { background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); padding: var(--sp4); transition: border-color .15s; position: relative; overflow: hidden; }
.kpi-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
.kpi-card:hover { border-color: var(--b1); }
.kpi-card-skeleton { height: 76px; border-radius: var(--r-lg); }
.kpi-value { font-family: var(--mono); font-size: clamp(20px,5.5vw,28px); font-weight: 800; letter-spacing: -1.5px; color: var(--t0); }
.kpi-label { font-size: 11px; color: var(--t2); margin-top: 4px; }
.kpi-accent { color: var(--gold); }
.kpi-ok     { color: var(--ok); }
.kpi-warn   { color: var(--warn); }
.kpi-err    { color: var(--err); }

.adm-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp3); gap: var(--sp2); }
.adm-section-title  { font-size: 13px; font-weight: 700; color: var(--t0); }

.adm-action-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: var(--r-f); border: 1px solid var(--b1); background: transparent; color: var(--t1); font-size: 11px; font-weight: 500; white-space: nowrap; transition: all .15s; }
.adm-action-btn:hover { border-color: var(--b2); color: var(--t0); }
.adm-action-btn-primary { background: var(--gold-dim); border-color: var(--gold-bd); color: var(--gold); }
.adm-action-btn-primary:hover { background: rgba(212,175,55,.2); }

.adm-search-row { margin-bottom: var(--sp3); }
.adm-search { width: 100%; background: var(--surface); border: 1px solid var(--b1); border-radius: var(--r-md); padding: 10px 14px; color: var(--t0); font-size: 13px; outline: none; transition: border-color .15s, background .15s; min-width: 0; }
.adm-search:focus { border-color: var(--gold-bd); background: var(--s2); }
.adm-search::placeholder { color: var(--t3); }
.adm-filter-bar { display: flex; gap: var(--sp2); margin-bottom: var(--sp3); }

.adm-table-wrap { display: flex; flex-direction: column; gap: var(--sp2); }
.adm-row { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp3) var(--sp4); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-md); cursor: pointer; transition: all .15s; min-width: 0; }
.adm-row:hover  { background: var(--s2); border-color: var(--b1); }
.adm-row-info   { flex: 1; min-width: 0; }
.adm-row-id     { font-family: var(--mono); font-size: 10px; color: var(--t2); }
.adm-row-name   { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row-sub    { font-size: 11px; color: var(--t2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row-imei   { font-family: var(--mono); font-size: 10px; color: var(--t2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row-meta   { flex-shrink: 0; text-align: right; }

.adm-product-list { display: flex; flex-direction: column; gap: var(--sp2); }
.adm-product-item { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp4); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); min-width: 0; transition: border-color .15s; }
.adm-product-item:hover { border-color: var(--b1); }
.adm-product-info  { flex: 1; min-width: 0; }
.adm-product-name  { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-product-price { font-family: var(--mono); font-size: 12px; color: var(--gold); margin-top: 2px; }

.topup-card { background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); padding: var(--sp4); margin-bottom: var(--sp2); min-width: 0; transition: border-color .15s; }
.topup-card:hover { border-color: var(--b1); }
.topup-card-header  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--sp3); gap: var(--sp2); }
.topup-card-user    { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.topup-card-uid     { font-family: var(--mono); font-size: 10px; color: var(--t2); margin-top: 2px; }
.topup-card-amount  { font-family: var(--mono); font-size: clamp(16px,5vw,22px); font-weight: 800; color: var(--gold); }
.topup-card-coin    { font-size: 11px; color: var(--t2); }
.topup-card-time    { font-size: 11px; color: var(--t2); margin-top: var(--sp2); }
.topup-card-actions { display: flex; gap: var(--sp2); margin-top: var(--sp3); flex-wrap: nowrap; }
.topup-card-actions > * { flex: 1; min-width: 0; }

.user-row { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp3); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-md); cursor: pointer; transition: all .15s; margin-bottom: var(--sp2); min-width: 0; }
.user-row:hover { background: var(--s2); border-color: var(--b1); }
.user-avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-dim); border: 1px solid var(--gold-bd); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--gold); flex-shrink: 0; }
.user-row-info    { flex: 1; min-width: 0; }
.user-row-name    { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-uid     { font-family: var(--mono); font-size: 10px; color: var(--t2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-balance { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--gold); flex-shrink: 0; }

.voucher-item { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp4); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); margin-bottom: var(--sp2); min-width: 0; }
.voucher-code { font-family: var(--mono); font-size: 14px; font-weight: 700; flex-shrink: 0; }
.voucher-info { flex: 1; min-width: 0; }
.voucher-desc { font-size: 12px; color: var(--t2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp2); }
.status-btn { padding: 10px; border-radius: var(--r-md); border: 1px solid var(--b1); background: transparent; font-size: 12px; font-weight: 600; color: var(--t1); text-align: center; transition: all .15s; }
.status-btn:hover { border-color: var(--b2); color: var(--t0); }
.s-pending:hover { border-color: var(--warn-bd); color: var(--warn); background: var(--warn-dim); }
.s-process:hover { border-color: var(--blue-bd); color: var(--blue); background: var(--blue-dim); }
.s-repeat:hover  { border-color: var(--purple-bd); color: var(--purple); background: var(--purple-dim); }
.s-done:hover    { border-color: var(--ok-bd);    color: var(--ok);    background: var(--ok-dim); }
.s-failed:hover  { border-color: var(--err-bd);   color: var(--err);   background: var(--err-dim); }
.s-refund:hover  { border-color: var(--red-bd);   color: var(--red);   background: var(--red-dim); }

.adm-pager { display: flex; gap: var(--sp2); justify-content: center; margin-top: var(--sp3); flex-wrap: wrap; }

/* ── Modals / Sheets ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 200; display: none; align-items: flex-end; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-overlay.open { display: flex; }
.sheet { width: 100%; background: var(--card); border-radius: var(--r-2xl) var(--r-2xl) 0 0; border-top: 1px solid var(--b1); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--b2) transparent; animation: slideUp .3s var(--ease); padding-bottom: env(safe-area-inset-bottom, 0); }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-bar { width: 36px; height: 4px; border-radius: var(--r-f); background: var(--b2); margin: 14px auto 0; }
.sheet-header { padding: var(--sp4) var(--px); border-bottom: 1px solid var(--b0); }
.sheet-title  { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.sheet-body   { padding: var(--sp4) var(--px); display: flex; flex-direction: column; gap: var(--sp4); }
.sheet-footer { display: flex; flex-direction: column; gap: var(--sp2); padding: var(--sp3) var(--px) calc(var(--sp4) + env(safe-area-inset-bottom, 0)); border-top: 1px solid var(--b0); }

.service-info-block { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp3); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); }

/* ── Forms ── */
.field-group  { display: flex; flex-direction: column; gap: 6px; }
.field-label  { font-size: 10px; font-weight: 700; color: var(--t2); letter-spacing: 1px; text-transform: uppercase; }
.field-input  { width: 100%; background: var(--surface); border: 1px solid var(--b1); border-radius: var(--r-md); padding: 11px 14px; color: var(--t0); font-size: 14px; outline: none; transition: border-color .15s, background .15s; min-width: 0; }
.field-input:focus { border-color: var(--gold-bd); background: var(--s2); }
.field-input::placeholder { color: var(--t3); }
textarea.field-input { resize: vertical; min-height: 80px; }
select.field-input   { cursor: pointer; }
.field-hint { font-size: 11px; color: var(--t2); }
.field-row  { display: flex; gap: var(--sp2); align-items: center; }

.amount-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp2); }
.amount-chip { display: flex; flex-direction: column; align-items: center; padding: var(--sp3) var(--sp2); background: var(--surface); border: 1px solid var(--b1); border-radius: var(--r-lg); font-weight: 700; color: var(--t1); transition: all .15s; cursor: pointer; }
.amount-chip span  { font-family: var(--mono); font-size: 18px; line-height: 1; }
.amount-chip small { font-size: 10px; color: var(--t2); margin-top: 3px; }
.amount-chip:hover { background: var(--s2); border-color: var(--gold-bd); color: var(--gold); }
.amount-chip.sel   { background: var(--gold-dim); border-color: var(--gold-bd); color: var(--gold); box-shadow: var(--sh-gold); }

.payment-options { display: flex; flex-direction: column; gap: var(--sp2); }
.payment-option { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp3) var(--sp4); background: var(--surface); border: 1px solid var(--b1); border-radius: var(--r-lg); cursor: pointer; transition: all .15s; }
.payment-option:hover { border-color: var(--b2); background: var(--s2); }
.payment-option.sel   { border-color: var(--gold-bd); background: var(--gold-dim); }
.payment-option-icon  { font-size: 22px; flex-shrink: 0; }
.payment-option-info  { flex: 1; min-width: 0; }
.payment-option-name  { font-size: 13px; font-weight: 600; }
.payment-option-sub   { font-size: 11px; color: var(--t2); margin-top: 1px; }
.radio-circle { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--b2); flex-shrink: 0; transition: all .15s; }
.payment-option.sel .radio-circle { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 8px rgba(212,175,55,.4); }

.qris-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--sp2); padding: var(--sp4); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); margin-top: var(--sp2); }
.qris-wrap img { max-width: 200px; border-radius: var(--r-md); }
.qris-wrap p   { font-size: 12px; color: var(--t2); text-align: center; }

.summary-block { background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); padding: var(--sp3) var(--sp4); display: flex; flex-direction: column; gap: 2px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; color: var(--t1); border-bottom: 1px solid var(--b0); gap: var(--sp2); }
.summary-row:last-child { border-bottom: none; }
.summary-total { font-weight: 700; color: var(--t0); }
.mono   { font-family: var(--mono); }
.accent { color: var(--gold); }
.ok     { color: var(--ok); }
.voucher-result { font-size: 12px; min-height: 18px; }

/* ── Buttons ── */
.pill-btn { padding: 8px 16px; border-radius: var(--r-f); border: 1px solid var(--gold-bd); background: var(--gold-dim); color: var(--gold); font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; transition: all .15s; }
.pill-btn:hover { background: rgba(212,175,55,.2); }

.btn-primary { width: 100%; padding: 14px var(--px); background: linear-gradient(135deg, var(--gold), var(--gold-s)); border-radius: var(--r-lg); border: none; color: #080C11; font-size: 14px; font-weight: 800; letter-spacing: .2px; transition: all .2s; box-shadow: 0 4px 16px rgba(212,175,55,.25); }
.btn-primary:hover   { filter: brightness(1.06); box-shadow: 0 6px 24px rgba(212,175,55,.35); }
.btn-primary:active  { transform: scale(.99); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.btn-ghost { width: 100%; padding: 13px var(--px); background: transparent; border-radius: var(--r-lg); border: 1px solid var(--b1); color: var(--t2); font-size: 14px; font-weight: 600; transition: all .15s; }
.btn-ghost:hover { background: var(--surface); color: var(--t1); border-color: var(--b2); }

.btn-ok     { background: transparent; border: 1px solid var(--ok-bd);  color: var(--ok);  border-radius: var(--r-md); padding: 8px 14px; font-size: 12px; font-weight: 600; transition: all .15s; }
.btn-ok:hover { background: var(--ok-dim); }
.btn-danger { background: transparent; border: 1px solid var(--err-bd); color: var(--err); border-radius: var(--r-md); padding: 8px 14px; font-size: 12px; font-weight: 600; transition: all .15s; }
.btn-danger:hover { background: var(--err-dim); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-f); letter-spacing: .2px; white-space: nowrap; flex-shrink: 0; }
.b-on     { background: var(--ok-dim);     color: var(--ok);     border: 1px solid var(--ok-bd); }
.b-off    { background: var(--err-dim);    color: var(--err);    border: 1px solid var(--err-bd); }
.b-done   { background: var(--ok-dim);     color: var(--ok);     border: 1px solid var(--ok-bd); }
.b-proc   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue-bd); }
.b-pend   { background: var(--warn-dim);   color: var(--warn);   border: 1px solid var(--warn-bd); }
.b-fail   { background: var(--err-dim);    color: var(--err);    border: 1px solid var(--err-bd); }
.b-repeat { background: var(--purple-dim); color: var(--purple); border: 1px solid var(--purple-bd); }
.b-refund { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red-bd); }
.b-gold   { background: var(--gold-dim);   color: var(--gold);   border: 1px solid var(--gold-bd); }
.b-blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue-bd); }
.b-warn   { background: var(--warn-dim);   color: var(--warn);   border: 1px solid var(--warn-bd); }

/* ── Toast & Loading ── */
.toast-notification { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(calc(-100% - 20px)); background: var(--s3); border: 1px solid var(--b2); border-radius: var(--r-f); padding: 11px 22px; font-size: 13px; font-weight: 500; color: var(--t0); z-index: 999; transition: transform .35s var(--spring); white-space: nowrap; display: flex; align-items: center; gap: 8px; max-width: min(90vw, 400px); overflow: hidden; box-shadow: var(--sh-lg); backdrop-filter: blur(14px); }
.toast-notification.show { transform: translateX(-50%) translateY(0); }
.toast-notification.ok   { border-color: var(--ok-bd); }
.toast-notification.err  { border-color: var(--err-bd); }
.toast-notification.warn { border-color: var(--warn-bd); }

.loading-screen { position: fixed; inset: 0; background: rgba(8,12,17,.88); z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp4); opacity: 0; pointer-events: none; transition: opacity .2s; backdrop-filter: blur(6px); }
.loading-screen.show { opacity: 1; pointer-events: all; }
.loading-screen p    { font-size: 13px; color: var(--t2); }

@keyframes spin { to { transform: rotate(360deg); } }
.loading-spinner { width: 34px; height: 34px; border: 2px solid var(--b1); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; box-shadow: 0 0 20px rgba(212,175,55,.15); }
.spin { width: 20px; height: 20px; border: 2px solid var(--b1); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.shimmer { background: linear-gradient(90deg, var(--surface) 25%, var(--s2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.8s infinite; border-radius: var(--r-md); }

.empty-state { text-align: center; padding: 60px var(--px); color: var(--t2); }
.empty-ico   { font-size: 44px; margin-bottom: var(--sp4); opacity: .3; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--t1); }
.empty-sub   { font-size: 12px; color: var(--t2); margin-top: var(--sp2); }

.alert-box  { border-radius: var(--r-md); padding: 11px 14px; font-size: 12px; line-height: 1.7; margin-bottom: var(--sp4); word-break: break-word; }
.alert-info { background: var(--blue-dim); border: 1px solid var(--blue-bd); color: var(--blue); }
.alert-warn { background: var(--warn-dim); border: 1px solid var(--warn-bd); color: var(--warn); }
.alert-ok   { background: var(--ok-dim);   border: 1px solid var(--ok-bd);   color: var(--ok); }
.alert-err  { background: var(--err-dim);  border: 1px solid var(--err-bd);  color: var(--err); }

.info-box { background: var(--blue-dim); border: 1px solid var(--blue-bd); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: var(--sp3); font-size: 12px; color: var(--blue); line-height: 1.6; word-break: break-word; }
.warn-box { background: var(--warn-dim); border: 1px solid var(--warn-bd); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: var(--sp3); font-size: 12px; color: var(--warn); line-height: 1.6; word-break: break-word; }
.ok-box   { background: var(--ok-dim);   border: 1px solid var(--ok-bd);   border-radius: var(--r-md); padding: 11px 14px; margin-bottom: var(--sp3); font-size: 12px; color: var(--ok);   line-height: 1.6; word-break: break-word; }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--s3); border-radius: var(--r-f); transition: background .2s; cursor: pointer; }
.toggle-track::before { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--t2); transition: transform .2s, background .2s; }
.toggle-switch input:checked + .toggle-track { background: var(--ok-dim); border: 1px solid var(--ok-bd); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); background: var(--ok); }

.rek-info    { background: var(--surface); border: 1px solid var(--b1); border-radius: var(--r-md); padding: var(--sp3) var(--sp4); margin-bottom: var(--sp3); font-size: 12px; color: var(--t2); line-height: 1.7; }
.rek-number  { font-family: var(--mono); font-size: 15px; font-weight: 700; color: var(--t0); }
.rek-name    { font-size: 12px; color: var(--t2); margin-top: 2px; }
#payRekInfo  { font-size: 11px; color: var(--t2); margin-top: var(--sp2); text-align: center; }

.topup-summary { background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-md); padding: var(--sp3) var(--sp4); margin: var(--sp3) 0; display: flex; justify-content: space-between; align-items: center; gap: var(--sp4); flex-wrap: wrap; }
.topup-summary-label { font-size: 11px; color: var(--t2); }
.topup-summary-value { font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--gold); }
.topup-summary-coin  { font-size: 11px; color: var(--t2); }

.insufficient-warn { display: none; background: var(--err-dim); border: 1px solid var(--err-bd); border-radius: var(--r-md); padding: 10px 14px; font-size: 12px; color: var(--err); line-height: 1.6; margin: var(--sp2) 0; }
.orders-list-wrap { padding: var(--sp3) var(--px); display: flex; flex-direction: column; gap: var(--sp2); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
═══════════════════════════════════════════════════════════════ */

@media (min-width: 481px) {
  .service-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .amount-grid  { grid-template-columns: repeat(3, 1fr); }
  .profile-actions-grid { grid-template-columns: repeat(3, 1fr); }
  #allProductsList { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 769px) {
  .page { max-width: 820px; margin: 0 auto; }
  .bottom-nav { max-width: 820px; left: 50%; right: auto; transform: translateX(-50%); width: 820px; border-left: 1px solid var(--b0); border-right: 1px solid var(--b0); border-radius: 16px 16px 0 0; }
  .topbar, .page-header, .admin-topbar { max-width: 820px; margin: 0 auto; }
  .admin-tab-nav { max-width: 820px; margin: 0 auto; top: 56px; }
  .balance-hero { padding: var(--sp8) var(--sp8) var(--sp6); }
  .service-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
  #allProductsList { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .modal-overlay { align-items: center; }
  .sheet { max-width: 540px; margin: 0 auto; border-radius: var(--r-2xl); max-height: 88dvh; }
}

@media (min-width: 1025px) {
  body { display: flex; }

  .bottom-nav { display: none; }

  .desktop-sidebar {
    display: flex !important;
    width: var(--sidebar-w); min-width: var(--sidebar-w);
    min-height: 100dvh;
    background: rgba(8,12,17,.99); border-right: 1px solid var(--b1);
    flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    padding: var(--sp4) 0; overflow-y: auto;
  }
  .sidebar-brand { display: flex; align-items: center; gap: var(--sp2); padding: var(--sp2) var(--sp4) var(--sp5); margin-bottom: var(--sp2); border-bottom: 1px solid var(--b0); }
  .sidebar-logo  { width: 32px; height: 32px; border-radius: var(--r-md); object-fit: cover; border: 1px solid var(--gold-bd); box-shadow: var(--sh-gold); flex-shrink: 0; }
  .sidebar-wordmark { font-size: 16px; font-weight: 800; letter-spacing: -.5px; }
  .sidebar-dot   { color: var(--gold); }
  .sidebar-nav   { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: var(--sp3) var(--sp2); }
  .sidebar-item  { display: flex; align-items: center; gap: var(--sp3); padding: 10px var(--sp3); border-radius: var(--r-md); color: var(--t2); font-size: 13px; font-weight: 500; transition: all .15s; cursor: pointer; white-space: nowrap; }
  .sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }
  .sidebar-item:hover { background: var(--surface); color: var(--t0); }
  .sidebar-item.active { background: var(--gold-dim); border: 1px solid var(--gold-bd); color: var(--gold); font-weight: 600; }
  .sidebar-item.active svg { filter: drop-shadow(0 0 6px rgba(212,175,55,.4)); }
  .sidebar-footer { padding: var(--sp3) var(--sp4); border-top: 1px solid var(--b0); font-size: 11px; color: var(--t3); line-height: 1.6; }
  .sidebar-user { display: flex; align-items: center; gap: var(--sp2); padding: var(--sp3); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); margin: 0 var(--sp2) var(--sp2); }
  .sidebar-user-av { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-dim); border: 1px solid var(--gold-bd); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--gold); flex-shrink: 0; }
  .sidebar-user-info { flex: 1; min-width: 0; }
  .sidebar-user-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-user-bal  { font-family: var(--mono); font-size: 11px; color: var(--gold); }

  #app-content { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }

  .page { max-width: 960px; margin: 0 auto; padding-bottom: 60px; }
  .topbar { position: sticky; left: 0; right: 0; max-width: none; width: 100%; }
  .page-header { position: sticky; left: 0; right: 0; max-width: none; width: 100%; }
  .admin-topbar { position: sticky; left: 0; right: 0; max-width: none; width: 100%; }
  .admin-tab-nav { position: sticky; top: 56px; left: 0; right: 0; max-width: none; width: 100%; }

  .balance-hero { padding: var(--sp10) var(--sp10) var(--sp8); }
  .service-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  #allProductsList { grid-template-columns: repeat(3, 1fr); }

  .btn-primary, .btn-ghost { width: auto; }
  .sheet-footer { flex-direction: row; }
  .sheet-footer > .btn-primary { flex: 1; }
  .sheet-footer > .btn-ghost   { flex: 0 0 auto; width: auto; padding: 13px 24px; }
  .adm-panel { padding: var(--sp5) var(--sp8); }
  .kpi-grid  { grid-template-columns: repeat(4, 1fr); }
  .modal-overlay { align-items: center; }
  .sheet { max-width: 560px; margin: 0 auto; border-radius: var(--r-2xl); max-height: 90dvh; }
}

@media (max-width: 360px) {
  .service-grid  { grid-template-columns: 1fr 1fr; }
  .balance-number { font-size: 28px; }
  .profile-actions-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp1); }
  .profile-action-card  { padding: 10px 4px; gap: var(--sp1); }
  .pac-icon { width: 32px; height: 32px; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .balance-actions { gap: var(--sp1); }
  .bal-btn { padding: 9px 12px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   DB EDITOR — Spreadsheet Live Edit
═══════════════════════════════════════════════════════════════ */

/* Toolbar */
.dbe-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp2); padding: 8px 12px;
  background: rgba(10,14,20,.97); border-bottom: 1px solid var(--b1);
  position: sticky; top: 0; z-index: 30; flex-wrap: wrap;
}
.dbe-toolbar-left  { display: flex; align-items: center; gap: var(--sp2); flex: 1; min-width: 160px; }
.dbe-toolbar-right { display: flex; align-items: center; gap: var(--sp2); flex-shrink: 0; }

.dbe-search-input {
  flex: 1; max-width: 280px; background: var(--surface);
  border: 1px solid var(--b1); border-radius: var(--r-md);
  padding: 7px 12px; color: var(--t0); font-size: 12px;
  outline: none; transition: border-color .15s;
}
.dbe-search-input:focus { border-color: var(--gold-bd); }
.dbe-search-input::placeholder { color: var(--t3); }

.dbe-tool-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--r-md);
  border: 1px solid var(--b1); background: transparent;
  color: var(--t2); font-size: 11px; font-weight: 500;
  white-space: nowrap; transition: all .15s;
}
.dbe-tool-btn:hover { border-color: var(--b2); color: var(--t1); background: var(--surface); }
.dbe-tool-btn svg  { flex-shrink: 0; }

.dbe-status { font-size: 11px; color: var(--t3); white-space: nowrap; font-family: var(--mono); }

/* Table selector tabs */
.dbe-table-tabs {
  display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none;
  padding: 6px 10px; background: var(--card); border-bottom: 1px solid var(--b0);
  position: sticky; top: 41px; z-index: 29;
}
.dbe-table-tabs::-webkit-scrollbar { display: none; }

.dbe-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--r-f);
  border: 1px solid var(--b0); background: transparent;
  color: var(--t3); font-size: 11px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0; transition: all .15s;
}
.dbe-tab:hover  { border-color: var(--b1); color: var(--t2); }
.dbe-tab.active { background: var(--gold-dim); border-color: var(--gold-bd); color: var(--gold); font-weight: 700; }

/* Grid wrapper — horizontally scrollable */
.dbe-grid-wrap { overflow: hidden; }

.dbe-table-wrap {
  overflow-x: auto; overflow-y: auto; max-height: calc(100dvh - 180px);
  scrollbar-width: thin; scrollbar-color: var(--b2) transparent;
}
.dbe-table-wrap::-webkit-scrollbar { width: 5px; height: 5px; }
.dbe-table-wrap::-webkit-scrollbar-track { background: transparent; }
.dbe-table-wrap::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 4px; }

/* The actual table */
.dbe-table {
  width: max-content; min-width: 100%;
  border-collapse: collapse; font-size: 12px;
}

.dbe-th {
  padding: 8px 10px; text-align: left;
  background: var(--card); color: var(--t2);
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  border-bottom: 1px solid var(--b1); white-space: nowrap;
  position: sticky; top: 0; z-index: 10;
}
.dbe-editable-col  { color: var(--gold); }
.dbe-readonly-col  { color: var(--t3); }
.dbe-action-col    { width: 36px; }
.dbe-edit-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-left: 4px; opacity: .7; vertical-align: middle; }

.dbe-tr {
  border-bottom: 1px solid var(--b0);
  transition: background .1s;
}
.dbe-tr:hover { background: var(--surface); }
.dbe-tr:hover .dbe-del-btn { opacity: 1; }

.dbe-td {
  padding: 7px 10px; vertical-align: middle;
  max-width: 240px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  color: var(--t1); position: relative;
}

/* Editable cells */
.dbe-cell-editable {
  cursor: text;
  transition: background .1s;
}
.dbe-cell-editable:hover {
  background: var(--s2);
  outline: 1px solid var(--b2);
  outline-offset: -1px;
}
.dbe-cell-readonly { color: var(--t3); cursor: default; }
.dbe-cell-editing {
  background: var(--s2) !important;
  outline: 2px solid var(--gold-bd) !important;
  outline-offset: -1px; overflow: visible; white-space: normal;
}

/* Save state animation */
.dbe-cell-saving {
  animation: dbe-pulse 0.5s ease infinite alternate;
  outline: 1px solid var(--warn-bd) !important;
}
@keyframes dbe-pulse { from { opacity:.7; } to { opacity:1; } }

.dbe-cell-saved {
  background: rgba(16,185,129,.08) !important;
  outline: 1px solid var(--ok-bd) !important;
  transition: background .4s, outline .4s;
}
.dbe-cell-error {
  background: rgba(239,68,68,.08) !important;
  outline: 1px solid var(--err-bd) !important;
}

/* Inline input */
.dbe-inline-input {
  width: 100%; min-width: 120px; max-width: 300px;
  background: var(--s3); border: none; outline: none;
  color: var(--t0); font-family: var(--font); font-size: 12px;
  padding: 2px 4px; border-radius: 3px; line-height: 1.4;
  resize: none;
}
.dbe-inline-input:focus { background: var(--s4); }

/* Cell value helpers */
.dbe-num { font-family: var(--mono); color: var(--gold-text); }
.dbe-cell-text { max-width: 200px; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Delete button */
.dbe-action-td { text-align: center; padding: 4px; }
.dbe-del-btn {
  opacity: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--r-sm);
  background: transparent; color: var(--t3); font-size: 13px;
  transition: all .15s; border: 1px solid transparent;
}
.dbe-del-btn:hover { background: var(--err-dim); border-color: var(--err-bd); color: var(--err); opacity: 1 !important; }

/* Add row button */
.dbe-add-btn {
  display: flex; align-items: center; gap: 6px;
  margin: 8px 12px; padding: 8px 14px;
  background: transparent; border: 1px dashed var(--b2);
  border-radius: var(--r-md); color: var(--t2); font-size: 12px;
  font-weight: 500; transition: all .15s; width: calc(100% - 24px);
  justify-content: center;
}
.dbe-add-btn:hover { border-color: var(--ok-bd); color: var(--ok); background: var(--ok-dim); }

/* States */
.dbe-loading, .dbe-empty, .dbe-err {
  padding: 40px 20px; text-align: center;
  color: var(--t2); font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.dbe-err { color: var(--err); }

/* Spinner */
.dbe-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--b1); border-top-color: var(--gold);
  border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0;
}

/* ── Admin orders (topup) card ── */
.topup-item { background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-lg); padding: var(--sp4); margin-bottom: var(--sp3); transition: border-color .15s; }
.topup-item:hover { border-color: var(--b1); }
.topup-item-hd { display: flex; justify-content: space-between; align-items: center; gap: var(--sp2); margin-bottom: var(--sp2); }
.topup-name { font-size: 14px; font-weight: 600; }
.topup-id   { font-family: var(--mono); font-size: 10px; color: var(--t2); margin-top: 2px; }
.topup-amt  { font-family: var(--mono); font-size: 20px; font-weight: 800; color: var(--gold); }
.topup-coin { font-size: 11px; color: var(--t2); margin-top: 2px; }
.topup-time { font-size: 11px; color: var(--t2); margin-top: var(--sp2); }
.topup-actions { display: flex; gap: var(--sp2); margin-top: var(--sp3); }

/* ── Admin order row ── */
.order-row { display: flex; align-items: center; gap: var(--sp3); padding: var(--sp3); background: var(--surface); border: 1px solid var(--b0); border-radius: var(--r-md); cursor: pointer; transition: all .15s; margin-bottom: var(--sp2); }
.order-row:hover { background: var(--s2); border-color: var(--b1); }
.order-row-info  { flex: 1; min-width: 0; }
.order-row-id    { font-family: var(--mono); font-size: 10px; color: var(--t2); }
.order-row-prod  { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row-user  { font-size: 11px; color: var(--t2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row-imei  { font-family: var(--mono); font-size: 10px; color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* btn-s (small buttons in topup) */
.btn-s { padding: 8px 12px; border-radius: var(--r-md); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 4px; transition: all .15s; }

