/* ═══════════════════════════════════════════════
   InvestPro - Main Stylesheet
   Mobile-First Fintech UI
═══════════════════════════════════════════════ */

:root {
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-light: #86efac;
  --green-xlight: #dcfce7;
  --green-grad: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --green-grad2: linear-gradient(135deg, #4ade80 0%, #22c55e 60%, #15803d 100%);
  --gold: #f59e0b;
  --gold-light: #fef3c7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --white: #ffffff;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --card-shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --nav-height: 70px;
  --header-height: 60px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ══════════════════════════════════
   LAYOUT
══════════════════════════════════ */
.page-wrapper {
  padding-bottom: calc(var(--nav-height) + 16px);
  min-height: 100vh;
}

.page-wrapper.no-nav { padding-bottom: 0; }

.container {
  padding: 0 16px;
}

/* ══════════════════════════════════
   TOP HEADER
══════════════════════════════════ */
.top-header {
  background: var(--green-grad);
  padding: 48px 20px 80px;
  position: relative;
  overflow: hidden;
}

.top-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.top-header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -30px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; z-index: 1;
}

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

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: white;
  border: 2px solid rgba(255,255,255,0.4);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-user-info { color: white; }
.header-user-info .greeting { font-size: 12px; opacity: 0.85; }
.header-user-info .username { font-size: 15px; font-weight: 700; }

.header-actions { display: flex; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  position: relative;
  transition: var(--transition);
}

.icon-btn:active { transform: scale(0.92); }

.badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  border: 1.5px solid white;
}

/* ── VIP Badge ── */
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--gold);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
}

/* ══════════════════════════════════
   BALANCE CARD
══════════════════════════════════ */
.balance-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin: -50px 16px 0;
  box-shadow: var(--card-shadow-lg);
  position: relative; z-index: 10;
}

.balance-main {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.balance-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.balance-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}

.balance-amount span { color: var(--green); }

.balance-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.balance-stat {
  text-align: center;
}

.balance-stat .label {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 2px;
}

.balance-stat .value {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}

.balance-stat .value.red { color: var(--red); }

/* ── Action Buttons ── */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 16px 0;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
}

.action-btn.primary {
  background: var(--green-grad);
  color: white;
  box-shadow: 0 4px 14px rgba(34,197,94,0.35);
}

.action-btn.outline {
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--green);
}

.action-btn:active { transform: scale(0.96); }

/* ══════════════════════════════════
   QUICK MENU GRID
══════════════════════════════════ */
.section { margin: 20px 16px 0; }
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.quick-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  transition: var(--transition);
}

.quick-item:active .quick-icon { transform: scale(0.9); }

.quick-icon.green  { background: var(--green-xlight); }
.quick-icon.gold   { background: var(--gold-light); }
.quick-icon.blue   { background: var(--blue-light); }
.quick-icon.red    { background: var(--red-light); }
.quick-icon.purple { background: #f3e8ff; }
.quick-icon.teal   { background: #ccfbf1; }
.quick-icon.orange { background: #fff7ed; }
.quick-icon.pink   { background: #fce7f3; }

.quick-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

/* ══════════════════════════════════
   PRODUCT CARDS
══════════════════════════════════ */
.products-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.products-scroll::-webkit-scrollbar { display: none; }

.product-card {
  min-width: 180px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  position: relative;
  flex-shrink: 0;
  transition: var(--transition);
}

.product-card:active { transform: scale(0.97); }

.product-img {
  width: 100%; height: 80px;
  border-radius: var(--radius-sm);
  background: var(--green-grad2);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin-bottom: 10px;
  overflow: hidden;
}

.product-img img { width: 100%; height: 100%; object-fit: cover; }

.product-tag {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.product-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-cycle {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.product-label { font-size: 11px; color: var(--text-secondary); }
.product-value { font-size: 13px; font-weight: 700; color: var(--text); }
.product-value.green { color: var(--green); }

.buy-btn {
  width: 100%;
  background: var(--green-grad);
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  transition: var(--transition);
}

.buy-btn:active { transform: scale(0.96); }

/* Full-width product list */
.product-list { display: flex; flex-direction: column; gap: 12px; }

.product-list-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  gap: 12px;
  align-items: center;
}

.product-list-img {
  width: 70px; height: 70px;
  border-radius: var(--radius-sm);
  background: var(--green-grad2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.product-list-info { flex: 1; }
.product-list-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.product-list-cycle { font-size: 11px; color: var(--text-light); margin-bottom: 8px; }

.product-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.product-stat { font-size: 11px; }
.product-stat span { color: var(--green); font-weight: 600; }

/* ══════════════════════════════════
   TRANSACTIONS LIST
══════════════════════════════════ */
.tx-list { display: flex; flex-direction: column; gap: 2px; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tx-item:first-child { border-radius: var(--radius) var(--radius) var(--radius-sm) var(--radius-sm); }
.tx-item:last-child  { border-radius: var(--radius-sm) var(--radius-sm) var(--radius) var(--radius); }

.tx-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tx-icon.deposit    { background: var(--green-xlight); }
.tx-icon.withdrawal { background: var(--red-light); }
.tx-icon.commission { background: var(--gold-light); }
.tx-icon.earning    { background: var(--blue-light); }

.tx-info { flex: 1; }
.tx-title { font-size: 14px; font-weight: 600; }
.tx-date  { font-size: 11px; color: var(--text-light); margin-top: 2px; }

.tx-amount { font-size: 15px; font-weight: 700; }
.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--red); }

/* ══════════════════════════════════
   BOTTOM NAVIGATION
══════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 12px;
  cursor: pointer;
  flex: 1;
  transition: var(--transition);
  color: var(--text-light);
  text-decoration: none;
}

.nav-item.active { color: var(--green); }

.nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: var(--transition);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
}

.nav-item:active { transform: scale(0.9); }

/* Center Add Button */
.nav-add {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--green-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: white;
  box-shadow: 0 4px 16px rgba(34,197,94,0.45);
  margin-bottom: 16px;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-add:active { transform: scale(0.9); }

/* ══════════════════════════════════
   AUTH PAGES
══════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.auth-header {
  background: var(--green-grad);
  padding: 60px 24px 80px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.auth-header::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.auth-header::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
}

.auth-logo {
  position: relative; z-index: 1;
  font-size: 36px;
  color: white;
  font-weight: 900;
  letter-spacing: -1px;
}

.auth-logo span { color: var(--green-light); }

.auth-tagline {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-top: 6px;
  position: relative; z-index: 1;
}

.auth-body {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-top: -30px;
  position: relative; z-index: 2;
  padding: 30px 24px 40px;
  flex: 1;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── Form ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
}

.form-control.error { border-color: var(--red); }

.input-group {
  position: relative;
}

.input-group .form-control { padding-right: 48px; }
.input-group .input-icon {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
}

.btn-primary {
  background: var(--green-grad);
  color: white;
  box-shadow: 0 4px 18px rgba(34,197,94,0.38);
}

.btn-primary:active { transform: scale(0.98); }

.btn-outline {
  background: transparent;
  color: var(--green);
  border: 2px solid var(--green);
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-link a { color: var(--green); font-weight: 600; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-light); font-size: 12px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════
   INNER PAGE HEADER
══════════════════════════════════ */
.inner-header {
  background: var(--green-grad);
  padding: 50px 20px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
}

.back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: white;
}

.inner-title { font-size: 18px; font-weight: 700; }
.inner-subtitle { font-size: 12px; opacity: 0.8; margin-top: 2px; }

/* ══════════════════════════════════
   STATUS BADGES
══════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.pending    { background: #fef3c7; color: #92400e; }
.status-badge.approved,
.status-badge.running,
.status-badge.completed  { background: var(--green-xlight); color: var(--green-dark); }
.status-badge.rejected   { background: var(--red-light); color: var(--red); }
.status-badge.processing { background: var(--blue-light); color: var(--blue); }

/* ══════════════════════════════════
   REFERRAL
══════════════════════════════════ */
.referral-banner {
  background: var(--green-grad);
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.referral-banner::after {
  content: '💎';
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 60px;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}

.referral-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.referral-sub   { font-size: 12px; opacity: 0.85; margin-bottom: 16px; }

.referral-code-box {
  background: rgba(255,255,255,0.2);
  border: 1.5px dashed rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.referral-code { font-size: 18px; font-weight: 800; letter-spacing: 2px; }
.copy-btn {
  background: white; color: var(--green);
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 700;
}

.referral-link-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.referral-link-text {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Team stat cards */
.team-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.team-stat-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.team-stat-card .icon { font-size: 24px; margin-bottom: 8px; }
.team-stat-card .value { font-size: 20px; font-weight: 800; color: var(--green); }
.team-stat-card .label { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* Level cards */
.level-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.level-badge {
  width: 44px; height: 44px;
  border-radius: var(--radius-xs);
  background: var(--green-grad);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

/* ══════════════════════════════════
   PROFILE
══════════════════════════════════ */
.profile-hero {
  background: var(--green-grad);
  padding: 60px 20px 30px;
  text-align: center;
  color: white;
}

.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 3px solid rgba(255,255,255,0.5);
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800;
  overflow: hidden;
}

.profile-name { font-size: 20px; font-weight: 800; }
.profile-id   { font-size: 12px; opacity: 0.8; margin-top: 4px; }

.profile-card {
  background: var(--white);
  border-radius: var(--radius);
  margin: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
}

.profile-menu-item:last-child { border-bottom: none; }
.profile-menu-item:active { background: var(--bg); }

.profile-menu-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.profile-menu-text { flex: 1; }
.profile-menu-title { font-size: 14px; font-weight: 600; }
.profile-menu-sub   { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.profile-menu-arrow { color: var(--text-light); font-size: 16px; }

/* ══════════════════════════════════
   RECHARGE / WITHDRAWAL
══════════════════════════════════ */
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.payment-method {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.payment-method.active {
  border-color: var(--green);
  background: var(--green-xlight);
}

.payment-method .icon { font-size: 24px; margin-bottom: 6px; }
.payment-method .label { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.payment-method.active .label { color: var(--green); }

.amount-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.amount-preset {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.amount-preset.active { border-color: var(--green); color: var(--green); background: var(--green-xlight); }

/* File Upload */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.file-upload.has-file { border-color: var(--green); background: var(--green-xlight); }
.file-upload-icon { font-size: 36px; margin-bottom: 8px; }
.file-upload-text { font-size: 13px; color: var(--text-secondary); }
.file-upload input { display: none; }

/* ══════════════════════════════════
   INFO CARD (payment details box)
══════════════════════════════════ */
.info-card {
  background: var(--green-xlight);
  border: 1px solid var(--green-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.info-card .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.info-card .info-row:last-child { margin-bottom: 0; }
.info-card .info-key { color: var(--text-secondary); }
.info-card .info-val { font-weight: 700; color: var(--text); }

/* ══════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 440px;
  pointer-events: none;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease;
  pointer-events: all;
  border-left: 4px solid var(--green);
}

.toast.error  { border-color: var(--red); }
.toast.warning{ border-color: var(--gold); }
.toast.info   { border-color: var(--blue); }

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-size: 14px; font-weight: 700; }
.toast-msg   { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close { color: var(--text-light); font-size: 16px; cursor: pointer; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

/* ══════════════════════════════════
   LOADERS / SPINNERS
══════════════════════════════════ */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner.dark {
  border-color: var(--border);
  border-top-color: var(--green);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000;
  backdrop-filter: blur(2px);
}

.loading-box {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--card-shadow-lg);
}

.loading-box .spinner { margin: 0 auto 12px; }
.loading-box p { font-size: 14px; color: var(--text-secondary); }

/* ══════════════════════════════════
   PROGRESS BAR
══════════════════════════════════ */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: var(--green-grad);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ══════════════════════════════════
   EMPTY STATE
══════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-secondary);
}

.empty-state .icon { font-size: 54px; margin-bottom: 14px; }
.empty-state h3    { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-state p     { font-size: 13px; }

/* ══════════════════════════════════
   CARDS GENERIC
══════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
  margin-bottom: 12px;
}

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

.card-title { font-size: 15px; font-weight: 700; }
.card-link  { font-size: 12px; color: var(--green); font-weight: 600; }

/* ══════════════════════════════════
   COUNTDOWN
══════════════════════════════════ */
.countdown {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.countdown-unit {
  background: var(--green-xlight);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  text-align: center;
  min-width: 48px;
}

.countdown-num { font-size: 20px; font-weight: 800; color: var(--green); line-height: 1; }
.countdown-lbl { font-size: 9px; color: var(--text-light); margin-top: 2px; text-transform: uppercase; }

/* ══════════════════════════════════
   MODALS
══════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}

/* ══════════════════════════════════
   TABS
══════════════════════════════════ */
.tab-bar {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: var(--transition);
  text-align: center;
}

.tab-btn.active {
  background: var(--white);
  color: var(--green);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ══════════════════════════════════
   STAT ROW
══════════════════════════════════ */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-row .label { font-size: 13px; color: var(--text-secondary); }
.stat-row .value { font-size: 14px; font-weight: 700; }

/* ══════════════════════════════════
   ANIMATIONS
══════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.4s ease both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }

/* ══════════════════════════════════
   ADMIN
══════════════════════════════════ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
}

.admin-sidebar {
  width: 240px;
  background: #111827;
  min-height: 100vh;
  padding: 0;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: var(--transition);
}

.admin-logo {
  padding: 20px 24px;
  font-size: 20px;
  font-weight: 900;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  letter-spacing: -0.5px;
}

.admin-logo span { color: var(--green); }

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  color: white;
  background: rgba(255,255,255,0.06);
  border-left-color: var(--green);
}

.admin-nav-link .icon { font-size: 18px; }

.admin-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  background: #f9fafb;
}

.admin-topbar {
  background: white;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: sticky; top: 0; z-index: 100;
}

.admin-topbar-title { font-size: 18px; font-weight: 700; }

.admin-body { padding: 28px; }

.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.admin-stat-info .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.admin-stat-info .value { font-size: 22px; font-weight: 800; }

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.admin-table-card {
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-table-header {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  background: #f9fafb;
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f9fafb; }

.admin-btn {
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.admin-btn.approve { background: var(--green-xlight); color: var(--green-dark); }
.admin-btn.reject  { background: var(--red-light); color: var(--red); }
.admin-btn.view    { background: var(--blue-light); color: var(--blue); }
.admin-btn.edit    { background: var(--gold-light); color: #92400e; }
.admin-btn.delete  { background: var(--red-light); color: var(--red); }

/* Responsive admin */
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════
   UTILITIES
══════════════════════════════════ */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12{ margin-top: 12px; }
.mt-16{ margin-top: 16px; }
.mt-20{ margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12{ margin-bottom: 12px; }
.mb-16{ margin-bottom: 16px; }
.text-center { text-align: center; }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-gold   { color: var(--gold); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11px; }
.font-bold   { font-weight: 700; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Checkbox / toggle */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input { width: 16px; height: 16px; accent-color: var(--green); }
.form-check label { font-size: 13px; color: var(--text-secondary); cursor: pointer; }

/* ══════════════════════════════════
   LIVE MARKET TICKER TAPE
══════════════════════════════════ */
.ticker-wrap {
  width: 100%;
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 10px 0;
  position: relative;
  box-shadow: var(--card-shadow);
}

.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 32px;
  z-index: 2;
  pointer-events: none;
}

.ticker-wrap::before {
  left: 0;
  background: linear-gradient(to right, white, transparent);
}

.ticker-wrap::after {
  right: 0;
  background: linear-gradient(to left, white, transparent);
}

.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: tickerScroll 35s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  cursor: default;
}

.ticker-symbol {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ticker-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.ticker-change {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.ticker-change.up   { color: #16a34a; background: #dcfce7; }
.ticker-change.down { color: #dc2626; background: #fee2e2; }

.ticker-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ticker-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ══════════════════════════════════
   LANGUAGE SWITCHER
══════════════════════════════════ */
.lang-switcher {
  position: relative;
  display: inline-block;
  z-index: 200;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 5px 10px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.lang-btn:hover { background: rgba(255,255,255,0.3); }

.lang-code { font-size: 11px; letter-spacing: 0.5px; }
.lang-arrow { font-size: 10px; transition: transform 0.2s; }
.lang-switcher.open .lang-arrow { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  min-width: 160px;
  overflow: hidden;
  display: none;
  z-index: 999;
  animation: fadeInUp 0.2s ease;
}

.lang-switcher.open .lang-dropdown { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: var(--bg); }
.lang-option-active { background: var(--green-xlight); color: var(--green-dark); font-weight: 700; }
.lang-flag { font-size: 18px; line-height: 1; }
.lang-name { flex: 1; }

/* Auth page lang switcher (light version) */
.lang-btn-light {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* RTL support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .back-btn { transform: scaleX(-1); }
[dir="rtl"] .balance-stat,
[dir="rtl"] .tx-info { text-align: right; }
[dir="rtl"] .bottom-nav { direction: ltr; }
[dir="rtl"] .ticker-track { animation-direction: reverse; }

/* ══════════════════════════════════
   LANGUAGE SWITCHER
══════════════════════════════════ */
.lang-switcher {
  position: relative;
  display: inline-block;
  z-index: 200;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: white;
  transition: var(--transition);
  white-space: nowrap;
}

.lang-btn:hover,
.lang-btn:focus { background: rgba(255,255,255,0.3); outline: none; }

.lang-code { font-size: 11px; letter-spacing: 0.5px; }
.lang-arrow { font-size: 10px; opacity: 0.8; }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  min-width: 160px;
  border: 1px solid var(--border);
  animation: fadeInUp 0.18s ease;
}

.lang-dropdown.open { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.lang-option:last-child { border-bottom: none; }
.lang-option:hover      { background: var(--bg); }

.lang-option-active {
  background: var(--green-xlight);
  color: var(--green-dark);
  font-weight: 700;
}

.lang-flag { font-size: 18px; line-height: 1; }
.lang-name { font-size: 13px; font-weight: 500; }

/* Auth page lang switcher - darker style */
.lang-btn-dark {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.lang-btn-dark:hover { background: var(--white); border-color: var(--green); }

/* RTL support */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .bottom-nav { direction: ltr; } /* keep nav LTR always */
[dir="rtl"] .tx-item    { flex-direction: row-reverse; }
[dir="rtl"] .profile-menu-item { flex-direction: row-reverse; }
[dir="rtl"] .profile-menu-arrow { transform: scaleX(-1); }
[dir="rtl"] .balance-stats { direction: rtl; }
[dir="rtl"] .inner-header  { flex-direction: row-reverse; }
[dir="rtl"] .header-row    { flex-direction: row-reverse; }
[dir="rtl"] .stat-row      { flex-direction: row-reverse; }
[dir="rtl"] .info-row      { flex-direction: row-reverse; }