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

/* ── Design tokens ── */
:root {
  --yellow:      #FFCC00;
  --yellow-d:    #E6B800;
  --yellow-text: #1A1000;
  --sidebar-bg:  #111827;
  --sidebar-txt: #9CA3AF;
  --sidebar-act: #FFCC00;
  --bg:          #F3F4F6;
  --surface:     #FFFFFF;
  --border:      #E5E7EB;
  --text:        #111827;
  --muted:       #6B7280;
  --green:       #059669;
  --green-bg:    #ECFDF5;
  --green-bdr:   #A7F3D0;
  --red:         #DC2626;
  --red-bg:      #FEF2F2;
  --red-bdr:     #FECACA;
  --blue:        #2563EB;
  --blue-bg:     #EFF6FF;
  --blue-bdr:    #BFDBFE;
  --amber-bg:    #FFFBEB;
  --amber-bdr:   #FDE68A;
  --amber-text:  #92400E;
  --mono:        'JetBrains Mono', 'Courier New', monospace;
  --r:           12px;
  --r-sm:        8px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── App shell ── */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--yellow);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -.01em;
}

.brand-sub {
  font-size: 10px;
  color: var(--sidebar-txt);
  margin-top: 1px;
}

.sidebar-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(156,163,175,.5);
  padding: 16px 16px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-txt);
  text-decoration: none;
  border-radius: 0;
  transition: background .12s, color .12s;
  border-left: 3px solid transparent;
}

.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link.active {
  background: rgba(255,204,0,.1);
  color: var(--yellow);
  border-left-color: var(--yellow);
}

.nav-link .nav-icon { font-size: 15px; width: 18px; text-align: center; }

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.wallet-pill {
  background: rgba(255,204,0,.1);
  border: 1px solid rgba(255,204,0,.2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.wallet-pill-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,204,0,.6);
  margin-bottom: 3px;
}

.wallet-pill-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: -.02em;
}

.wallet-pill-sub {
  font-size: 10px;
  color: rgba(255,204,0,.5);
  margin-top: 1px;
}

.signout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sidebar-txt);
  text-decoration: none;
  padding: 6px 0;
  transition: color .12s;
}

.signout-link:hover { color: #fff; }

/* ── Top bar ── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--yellow-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.user-info { text-align: right; }
.user-phone { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role  { font-size: 10px; color: var(--muted); }

/* ── Main content ── */
.main-content { padding: 24px; overflow-x: hidden; }

/* ── Wallet card ── */
.wallet-card {
  background: linear-gradient(135deg, #FFCC00 0%, #F0A500 100%);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}

.wallet-card::after {
  content: '';
  position: absolute;
  bottom: -60px; right: 60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}

.wc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.wc-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(26,16,0,.6);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.wc-icon {
  width: 26px;
  height: 26px;
  background: rgba(26,16,0,.12);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.wc-label {
  font-size: 11px;
  color: rgba(26,16,0,.55);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.wc-amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--yellow-text);
  letter-spacing: -.03em;
  margin-bottom: 14px;
}

.wc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wc-phone { font-size: 13px; font-weight: 600; color: rgba(26,16,0,.7); font-family: var(--mono); }
.wc-since { font-size: 10px; color: rgba(26,16,0,.45); letter-spacing: .05em; text-transform: uppercase; }

/* ── Content grid ── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.card:last-child { margin-bottom: 0; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.card-sub   { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.sec { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

/* ── Stat cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.green::before  { background: var(--green); }
.stat-card.red::before    { background: var(--red); }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.purple::before { background: #7C3AED; }

.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
}
.stat-icon.yellow { background: #FFFBEB; }
.stat-icon.green  { background: var(--green-bg); }
.stat-icon.red    { background: var(--red-bg); }
.stat-icon.blue   { background: var(--blue-bg); }
.stat-icon.purple { background: #F5F3FF; }

.stat-val   { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 2px; }
.stat-label { font-size: 11px; color: var(--muted); }
.stat-val.yellow { color: var(--yellow-d); }
.stat-val.green  { color: var(--green); }
.stat-val.red    { color: var(--red); }
.stat-val.blue   { color: var(--blue); }
.stat-val.purple { color: #7C3AED; }

/* ── Form elements ── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field:last-of-type { margin-bottom: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 13px;
  outline: none;
  width: 100%;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--yellow-d);
  background: #FFFDF2;
}
.field .hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── Amount input ── */
.amount-input-wrap {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color .15s;
}
.amount-input-wrap:focus-within { border-color: var(--yellow-d); background: #FFFDF2; }
.amount-prefix { font-size: 14px; font-weight: 700; color: var(--muted); }
.amount-input-wrap input {
  border: none; background: transparent; font-size: 18px; font-weight: 700;
  color: var(--text); outline: none; width: 100%; padding: 0;
}

/* ── Amount presets ── */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.prs {
  padding: 5px 12px; font-size: 12px; font-weight: 600;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 100px; cursor: pointer; color: var(--muted);
  transition: all .12s; font-family: inherit;
}
.prs:hover { border-color: var(--yellow-d); color: var(--text); }
.prs.sel   { background: var(--yellow); border-color: var(--yellow-d); color: var(--yellow-text); }

/* ── Network selector ── */
.net-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.net-opt {
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  transition: all .12s;
  position: relative;
}
.net-opt:hover { border-color: #ccc; }
.net-opt.active { border-color: var(--yellow-d); background: #FFFDF2; }
.net-opt.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.net-logo { font-size: 26px; margin-bottom: 5px; }
.net-name { font-size: 11px; font-weight: 700; color: var(--text); }
.net-badge {
  position: absolute; top: 4px; right: 4px;
  font-size: 8px; font-weight: 700; padding: 2px 5px;
  border-radius: 100px; letter-spacing: .04em;
}
.net-badge.active { background: var(--green-bg); color: var(--green); }
.net-badge.soon   { background: var(--border); color: var(--muted); }

/* ── Slide to send ── */
.slide-wrap {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  height: 52px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
}
.slide-track {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--yellow);
  border-radius: 100px;
  transition: width .15s;
  min-width: 52px;
}
.slide-knob {
  position: absolute;
  left: 4px; top: 4px;
  width: 44px; height: 44px;
  background: var(--yellow-text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: left .15s;
  z-index: 2;
}
.slide-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}

/* ── Primary button ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; font-size: 14px; font-weight: 700;
  border-radius: var(--r-sm); border: none; cursor: pointer;
  font-family: inherit; text-decoration: none; transition: all .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--yellow); color: var(--yellow-text); width: 100%; padding: 14px; font-size: 15px; border-radius: 100px; }
.btn-primary:hover { background: var(--yellow-d); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: #E9EAEB; }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-bdr); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-sm); }

/* ── Status badges ── */
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 100px; letter-spacing: .04em; text-transform: uppercase; }
.badge-pending    { background: var(--amber-bg);  color: var(--amber-text); border: 1px solid var(--amber-bdr); }
.badge-processing { background: var(--blue-bg);   color: var(--blue);       border: 1px solid var(--blue-bdr); }
.badge-completed  { background: var(--green-bg);  color: var(--green);      border: 1px solid var(--green-bdr); }
.badge-failed     { background: var(--red-bg);    color: var(--red);        border: 1px solid var(--red-bdr); }
.badge-partial    { background: #F5F3FF; color: #7C3AED; border: 1px solid #DDD6FE; }

/* ── Toasts ── */
.toast {
  padding: 12px 16px; border-radius: var(--r-sm); font-size: 13px;
  font-weight: 500; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px;
}
.toast-ok   { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bdr); }
.toast-err  { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-bdr); }
.toast-info { background: var(--blue-bg);  color: var(--blue);  border: 1px solid var(--blue-bdr); }
.toast-warn { background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-bdr); }

/* ── Transaction rows ── */
.txn-list { display: flex; flex-direction: column; }
.txn-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.txn-row:last-child { border-bottom: none; }
.txn-row:hover { background: #FAFAFA; margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
.txn-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--amber-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.txn-info { flex: 1; }
.txn-title { font-size: 13px; font-weight: 600; }
.txn-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--mono); }
.txn-right { text-align: right; }
.txn-amount { font-size: 13px; font-weight: 700; }
.txn-time   { font-size: 10px; color: var(--muted); margin-top: 3px; }

/* ── Progress bar ── */
.prog-bar { height: 4px; background: var(--border); border-radius: 100px; overflow: hidden; margin: 8px 0; }
.prog-fill { height: 100%; background: var(--yellow); border-radius: 100px; transition: width .5s; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  background: var(--bg); padding: 9px 12px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #FAFAFA; cursor: pointer; }

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; gap: 0; }
.tab {
  padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s;
}
.tab.active { color: var(--text); border-bottom-color: var(--yellow-d); }
.tab:hover  { color: var(--text); }

/* ── Modal ── */
.modal-bg { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:999; align-items:center; justify-content:center; }
.modal-bg.show { display:flex; }
.modal { background:var(--surface); border-radius:14px; padding:1.5rem; max-width:400px; width:90%; }
.modal h3 { font-size:16px; font-weight:700; margin-bottom:8px; }
.modal p  { font-size:13px; color:var(--muted); margin-bottom:14px; line-height:1.6; }
.modal-btns { display:flex; gap:8px; }

/* ── Login ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 1rem; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px 40px; width: 100%; max-width: 420px; }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-logo-icon { width: 40px; height: 40px; background: var(--yellow); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.login-logo-text { font-size: 18px; font-weight: 800; color: var(--text); }
.login-logo-text span { color: var(--yellow-d); }
.login-heading { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -.02em; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

/* ── Bottom nav (mobile) ── */
.bottom-nav { position:fixed; bottom:0; left:0; right:0; background:var(--surface); border-top:1px solid var(--border); display:none; z-index:200; padding-bottom:env(safe-area-inset-bottom); }
.bnav-item { flex:1; display:flex; flex-direction:column; align-items:center; padding:8px 4px 6px; text-decoration:none; color:var(--muted); transition:color .12s; }
.bnav-item.active { color:var(--yellow-d); }
.bnav-icon { font-size:20px; }
.bnav-label { font-size:10px; font-weight:600; margin-top:3px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  body { padding-bottom: 70px; }
  .content-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 16px; }
}
