/* ============================================
   UTTAR ECOMMERCE — Design System CSS
   "The Sovereign Ledger" - Stitch Design System
   Primary: #006b32  Secondary: #0A2540  Gold: #FFD700
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ---- CSS Variables (Vibrant Premium Theme) ---- */
:root {
  --primary:           #059669; /* Vibrant Emerald */
  --primary-glow:      rgba(5, 150, 105, 0.4);
  --primary-gradient:  linear-gradient(135deg, #059669 0%, #10b981 100%);
  --secondary:         #0f172a; /* Deep Navy */
  --secondary-accent:  #3b82f6; /* Sapphire Blue */
  --tertiary:          #fbbf24; /* Amber Gold */
  
  --surface:           #f8fafc;
  --surface-glass:     rgba(255, 255, 255, 0.85); /* For glassmorphism */
  --surface-low:       #f1f5f9;
  --surface-card:      #ffffff;
  
  --on-surface:        #1e293b;
  --on-surface-var:    #475569;
  --outline:           #94a3b8;
  --outline-var:       #e2e8f0;

  --radius-xl:         1.25rem;
  --radius-2xl:        1.75rem;

  --shadow-premium:    0 15px 35px rgba(0, 0, 0, 0.05), 0 5px 15px rgba(0, 0, 0, 0.03);
  --shadow-neon:       0 0 20px var(--primary-glow);

  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;
  --transition:   cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes glow {
  0% { box-shadow: 0 0 5px var(--primary-glow); }
  50% { box-shadow: 0 0 20px var(--primary-glow); }
  100% { box-shadow: 0 0 5px var(--primary-glow); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-glow { animation: glow 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-slideUp { animation: slideInUp 0.6s var(--transition) forwards; }

.glass-card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-premium);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; }
ul { list-style: none; }

/* ---- Typography ---- */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--on-surface); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
.display-lg { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; }
.display-md { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
.data { font-family: var(--font-data); }
.label-sm { font-family: var(--font-data); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.grid { display: grid; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; } .gap-2 { gap: 0.5rem; } .gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; } .gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--primary-gradient); color: #fff;
  box-shadow: 0 4px 15px rgba(0,107,50,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,107,50,0.4);
  filter: brightness(1.05);
}
.btn-secondary {
  background: rgba(0,107,50,0.08); color: var(--primary);
  border: 1.5px solid rgba(0,107,50,0.2);
}
.btn-secondary:hover { background: rgba(0,107,50,0.14); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--on-surface-var);
  border: 1.5px solid var(--outline-var);
}
.btn-ghost:hover { background: var(--surface-high); color: var(--on-surface); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.6rem; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ---- Cards & Glassmorphism ---- */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--outline-var);
  transition: transform 0.4s var(--transition), box-shadow 0.4s var(--transition);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}
.card-glass {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ---- Form Elements ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; font-size: 0.85rem; font-weight: 500;
  color: var(--on-surface-var); margin-bottom: 0.4rem;
}
.form-control {
  width: 100%; padding: 0.85rem 1rem;
  background: var(--surface-high); border: 1.5px solid transparent;
  border-radius: var(--radius-md); font-family: var(--font-body);
  font-size: 0.9rem; color: var(--on-surface);
  transition: all var(--transition); outline: none;
}
.form-control:focus {
  background: var(--surface-lowest); border-color: rgba(0,107,50,0.35);
  box-shadow: 0 0 0 3px rgba(0,107,50,0.08);
}
.form-control::placeholder { color: var(--outline); }
.form-control.is-invalid { border-color: var(--error); }
.form-error { color: var(--error); font-size: 0.8rem; margin-top: 0.3rem; display: block; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236d7b6d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.5rem; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.65rem; border-radius: var(--radius-full);
  font-family: var(--font-data); font-size: 0.7rem; font-weight: 600;
}
.badge-success  { background: var(--success-light); color: var(--success); }
.badge-warning  { background: var(--warning-light); color: var(--warning); }
.badge-danger   { background: var(--error-container); color: var(--error); }
.badge-primary  { background: rgba(0,107,50,0.12); color: var(--primary); }
.badge-info     { background: rgba(10,37,64,0.1); color: var(--secondary); }
.badge-gold     { background: rgba(255,215,0,0.2); color: #7d6400; }

/* ---- Navigation ---- */
.navbar {
  background: rgba(255,255,255,0.9); backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(188,202,187,0.3);
  position: sticky; top: 0; z-index: 100;
  padding: 0.9rem 0;
}
.nav-logo {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 800;
  background: var(--primary-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.5rem 0.85rem; border-radius: var(--radius-md);
  font-size: 0.88rem; font-weight: 500; color: var(--on-surface-var);
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: rgba(0,107,50,0.08); color: var(--primary);
}
.nav-link.active { font-weight: 600; }

/* ---- Sidebar Layout ---- */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; min-height: 100vh;
  background: var(--surface-lowest); border-right: 1px solid rgba(188,202,187,0.3);
  padding: 1.5rem 1rem; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.sidebar-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
  background: var(--primary-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  padding: 0.5rem 0.75rem; margin-bottom: 2rem;
}
.sidebar-nav { flex: 1; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.8rem 1.25rem; border-radius: var(--radius-lg);
  color: #64748b; font-size: 0.95rem; font-weight: 500;
  transition: all var(--transition); text-decoration: none;
  margin-bottom: 0.25rem;
}
.sidebar-nav-item:hover { background: #f1f5f9; color: var(--primary); }
.sidebar-nav-item.active { 
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-weight: 700;
  border-left: 4px solid #10b981;
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.05);
  animation: float 3s ease-in-out infinite;
}
.sidebar-nav-item.active svg { color: #10b981; transform: scale(1.1); }
.sidebar-nav-item:active { transform: scale(0.98); }
.sidebar-nav-item.active svg { opacity: 1; }
.sidebar-section { font-size: 0.7rem; font-weight: 700; color: var(--outline); text-transform: uppercase; letter-spacing: 0.1em; padding: 0.5rem 0.85rem; margin: 1rem 0 0.25rem; }
.sidebar-footer { padding-top: 1rem; border-top: 1px solid rgba(188,202,187,0.3); }
.main-content { flex: 1; padding: 2rem; min-width: 0; }
.page-header { margin-bottom: 2rem; }
.page-title { font-size: 1.75rem; font-weight: 800; }
.page-subtitle { font-size: 0.9rem; color: var(--outline); margin-top: 0.25rem; }

/* ---- Stat Cards ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--surface-lowest); border-radius: var(--radius-xl);
  padding: 1.5rem; box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
  transition: all var(--transition);
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--primary-gradient);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-label { font-family: var(--font-data); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--outline); margin-bottom: 0.5rem; }
.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--on-surface); line-height: 1; margin-bottom: 0.25rem; }
.stat-value.money::before { content: '₹'; font-size: 1.1rem; vertical-align: top; margin-top: 0.2rem; display: inline-block; }
.stat-icon { position: absolute; top: 1.2rem; right: 1.2rem; opacity: 0.1; }
.stat-change { font-size: 0.78rem; color: var(--success); font-weight: 500; display: flex; align-items: center; gap: 0.25rem; }
.stat-change.up { color: #4ade80; }
.stat-change.down { color: #f87171; }

/* ---- Premium Dashboard Elements ---- */
.dashboard-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.dash-user-hello { font-size: 1.5rem; font-weight: 800; color: var(--secondary); letter-spacing: -0.02em; }
.dash-user-sub { font-size: 0.9rem; color: var(--outline); margin-top: 0.2rem; }

.stat-card-v2 {
  background: var(--surface-lowest); border-radius: var(--radius-xl);
  padding: 1.25rem; box-shadow: var(--shadow-sm); 
  border: 1px solid rgba(188,202,187,0.25);
  position: relative; overflow: hidden; transition: all var(--transition);
}
.stat-card-v2:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card-v2.primary { background: var(--primary-gradient); color: #fff; border: none; }
.stat-card-v2.primary .stat-label, .stat-card-v2.primary .stat-value { color: #fff; }
.stat-card-v2.primary .stat-icon { color: #fff; opacity: 0.2; }

.card-icon-box {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,107,50,0.08); color: var(--primary); margin-bottom: 1rem;
}
.stat-card-v2.primary .card-icon-box { background: rgba(255,255,255,0.15); color: #fff; }

.trend-badge {
  padding: 0.2rem 0.6rem; border-radius: var(--radius-full);
  font-size: 0.7rem; font-weight: 700; background: rgba(74,222,128,0.15); color: #22c55e;
}
.trend-badge.up { background: rgba(74,222,128,0.15); color: #22c55e; }
.trend-badge.down { background: rgba(248,113,113,0.15); color: #ef4444; }

.identity-card {
  background: linear-gradient(145deg, #0A2540 0%, #031a0c 100%);
  border-radius: var(--radius-xl); padding: 1.75rem; color: #fff;
  position: relative; overflow: hidden; min-height: 280px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.identity-card::after {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
}
.id-badge {
  padding: 0.35rem 0.85rem; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; background: rgba(255,215,0,0.2); color: var(--tertiary);
  border: 1px solid rgba(255,215,0,0.3); width: fit-content;
}

.mission-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.mission-label { font-size: 0.85rem; font-weight: 700; color: var(--secondary); }
.mission-val { font-size: 0.8rem; font-weight: 600; color: var(--primary); }
.progress-v2 { height: 10px; background: var(--surface-high); border-radius: 5px; overflow: hidden; margin-bottom: 1.25rem; }
.progress-bar-v2 { height: 100%; border-radius: 5px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

.activity-item {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 0;
  border-bottom: 1px solid rgba(188,202,187,0.2);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: 0.88rem; font-weight: 700; color: var(--secondary); }
.activity-time { font-size: 0.7rem; color: var(--outline); text-transform: uppercase; margin-top: 0.1rem; }

/* ---- Product Cards ---- */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.product-card {
  background: var(--surface-lowest); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: all var(--transition); cursor: pointer;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.product-card-img { aspect-ratio: 1; overflow: hidden; position: relative; background: var(--surface-high); }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-slow); }
.product-card:hover .product-card-img img { transform: scale(1.06); }
.product-card-badge { position: absolute; top: 0.75rem; left: 0.75rem; }
.product-card-body { padding: 1rem; }
.product-card-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card-price { font-family: var(--font-data); font-weight: 700; font-size: 1.05rem; color: var(--primary); }
.product-card-price .original { text-decoration: line-through; color: var(--outline); font-size: 0.8rem; margin-left: 0.4rem; font-weight: 400; }
.product-card-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.product-card-actions .btn { flex: 1; font-size: 0.8rem; padding: 0.55rem; }

/* ---- Tables ---- */
.table-wrap { background: var(--surface-lowest); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; }
.table th { background: var(--surface-low); font-family: var(--font-data); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--outline); padding: 1rem 1.25rem; text-align: left; }
.table td { padding: 1rem 1.25rem; font-size: 0.88rem; border-bottom: 1px solid rgba(188,202,187,0.2); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(0,107,50,0.02); }

/* ---- Alerts / Flash ---- */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-md); margin-bottom: 1.5rem; font-size: 0.9rem; display: flex; align-items: center; gap: 0.75rem; }
.alert-success { background: var(--success-light); color: var(--success); border-left: 3px solid var(--success); }
.alert-error   { background: var(--error-container); color: var(--error); border-left: 3px solid var(--error); }
.alert-warning { background: var(--warning-light); color: var(--warning); border-left: 3px solid var(--warning); }

/* ---- Transactions ---- */
.tx-list { display: flex; flex-direction: column; gap: 0.5rem; }
.tx-item {
  display: flex; align-items: center; gap: 1rem; padding: 1rem;
  background: var(--surface-lowest); border-radius: var(--radius-lg);
  transition: background var(--transition);
}
.tx-item:hover { background: var(--surface-low); }
.tx-icon {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tx-icon.credit { background: var(--success-light); color: var(--success); }
.tx-icon.debit  { background: var(--error-container); color: var(--error); }
.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-date { font-size: 0.75rem; color: var(--outline); }
.tx-amount { font-family: var(--font-data); font-weight: 700; font-size: 0.95rem; }
.tx-amount.credit { color: var(--success); }
.tx-amount.debit  { color: var(--error); }

/* ---- Network Tree ---- */
.network-level {
  display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
  padding: 1rem; background: var(--surface-low); border-radius: var(--radius-lg);
}
.network-level-label { font-family: var(--font-data); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--outline); margin-bottom: 0.5rem; }
.member-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 0.75rem; background: var(--surface-lowest);
  border-radius: var(--radius-lg); text-align: center; min-width: 80px;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.member-avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  overflow: hidden; border: 2px solid rgba(0,107,50,0.2);
}
.member-name { font-size: 0.72rem; font-weight: 600; color: var(--on-surface); }
.member-rank { font-size: 0.65rem; color: var(--outline); }

/* ---- Progress ---- */
.progress { height: 6px; background: rgba(188,202,187,0.3); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary-gradient); border-radius: var(--radius-full); transition: width 1s ease; }

/* ---- Hero Section ---- */
.hero {
  min-height: 90vh; display: flex; align-items: center;
  background: linear-gradient(135deg, #031a0c 0%, #052e16 50%, #0A2540 100%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(0,135,64,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(255,215,0,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero-content { color: #fff; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,215,0,0.15); border: 1px solid rgba(255,215,0,0.3);
  color: var(--tertiary); padding: 0.4rem 1rem; border-radius: var(--radius-full);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.05em;
  margin-bottom: 1.5rem; backdrop-filter: blur(10px);
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; color: #fff;
}
.hero-title .accent { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-desc { font-size: 1.1rem; color: rgba(255,255,255,0.75); max-width: 550px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #fff; }
.hero-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.hero-visual { position: relative; }
.hero-card {
  background: rgba(255,255,255,0.08); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-xl);
  padding: 1.5rem; color: #fff;
}

/* ---- Sections ---- */
.section { padding: 5rem 0; }
.section-alt { background: var(--surface-low); }
.section-label { font-family: var(--font-data); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--primary); margin-bottom: 0.75rem; }
.section-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 1rem; }
.section-desc { color: var(--on-surface-var); font-size: 1.05rem; max-width: 600px; }

/* ---- Feature Cards ---- */
.feature-card {
  padding: 2rem; background: var(--surface-lowest);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: rgba(0,107,50,0.1); display: flex; align-items: center;
  justify-content: center; margin-bottom: 1.25rem; color: var(--primary);
}
.feature-title { font-weight: 700; margin-bottom: 0.5rem; }
.feature-desc { font-size: 0.9rem; color: var(--on-surface-var); }

/* ---- Auth Pages ---- */
.auth-page {
  min-height: 100vh; display: flex;
  background: linear-gradient(135deg, #031a0c 0%, #052e16 60%, #0A2540 100%);
  position: relative;
}
.auth-page::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(0,135,64,0.2) 0%, transparent 60%);
  pointer-events: none;
}
.auth-panel {
  background: var(--surface-lowest); width: 460px; min-height: 100vh;
  padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 1;
}
.auth-visual {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 3rem; position: relative; z-index: 1;
}
.auth-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem;
  background: var(--primary-gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 2.5rem; display: block;
}
.auth-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--on-surface-var); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--outline-var); }
.auth-divider span { font-size: 0.8rem; color: var(--outline); }
.auth-link { color: var(--primary); font-weight: 600; }
.auth-link:hover { text-decoration: underline; }

/* ---- Wallet Balance Card ---- */
.wallet-card {
  background: linear-gradient(135deg, #052e16 0%, #006b32 50%, #008740 100%);
  border-radius: var(--radius-xl); padding: 2rem; color: #fff;
  position: relative; overflow: hidden;
}
.wallet-card::before {
  content: ''; position: absolute; bottom: -30px; right: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.wallet-card::after {
  content: ''; position: absolute; top: -40px; right: 40px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.wallet-label { font-family: var(--font-data); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; margin-bottom: 0.5rem; }
.wallet-balance { font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; margin-bottom: 0.5rem; }
.wallet-balance::before { content: '₹'; font-size: 1.5rem; vertical-align: top; margin-top: 0.5rem; display: inline-block; }
.wallet-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.wallet-stat-label { font-size: 0.72rem; opacity: 0.65; }
.wallet-stat-value { font-family: var(--font-data); font-weight: 700; font-size: 1.1rem; }

/* ---- Rank Bar ---- */
.rank-bar {
  background: var(--surface-lowest); border-radius: var(--radius-xl);
  padding: 1.5rem; border-left: 4px solid var(--primary);
}
.rank-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem; border-radius: var(--radius-full);
  font-family: var(--font-data); font-size: 0.78rem; font-weight: 700;
  background: rgba(255,215,0,0.15); color: #7d6400;
  border: 1px solid rgba(255,215,0,0.3);
}

/* ---- Deposit Form ---- */
.deposit-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.method-btn {
  padding: 1rem; border-radius: var(--radius-lg); text-align: center;
  border: 2px solid var(--outline-var); cursor: pointer;
  transition: all var(--transition); background: var(--surface-lowest);
}
.method-btn:hover, .method-btn.selected {
  border-color: var(--primary); background: rgba(0,107,50,0.06);
}
.method-btn.selected { box-shadow: 0 0 0 3px rgba(0,107,50,0.15); }

/* ---- Checkout ---- */
.checkout-layout { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; }
.order-summary { background: var(--surface-lowest); border-radius: var(--radius-xl); padding: 1.5rem; box-shadow: var(--shadow-sm); position: sticky; top: 90px; }
.order-total-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; font-size: 0.9rem; }
.order-total-row.grand { font-weight: 700; font-size: 1.1rem; border-top: 1px solid rgba(188,202,187,0.3); margin-top: 0.5rem; padding-top: 1rem; }

/* ---- Animations ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes countUp { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,107,50,0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(0,107,50,0); }
}

.animate-fadeInUp  { animation: fadeInUp 0.5s ease both; }
.animate-fadeIn    { animation: fadeIn 0.4s ease both; }
.animate-float     { animation: float 3s ease-in-out infinite; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.30s; }

/* Skeleton Loading */
.skeleton { background: linear-gradient(90deg, var(--surface-high) 25%, var(--surface-low) 50%, var(--surface-high) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-md); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .checkout-layout { grid-template-columns: 1fr; }
  .order-summary { position: static; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 1rem; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .hero-title { font-size: 2.2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-panel { width: 100%; min-height: auto; }
  .auth-visual { display: none; }
  .deposit-methods { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
}

/* ---- Mobile Bottom Nav ---- */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(20px);
  border-top: 1px solid rgba(188,202,187,0.3);
  padding: 0.5rem;
  display: none;
  grid-template-columns: repeat(5, 1fr);
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.5rem; border-radius: var(--radius-md);
  font-size: 0.65rem; font-weight: 600; color: var(--on-surface-var);
  transition: all var(--transition);
}
.mobile-nav-item.active, .mobile-nav-item:hover { color: var(--primary); }
.mobile-nav-item.active { background: rgba(0,107,50,0.08); }
@media (max-width: 768px) {
  .mobile-nav { display: grid; }
  .main-content { padding-bottom: 5rem; }
}

/* ---- Utility ---- */
.text-primary { color: var(--primary); }
.text-muted   { color: var(--outline); }
.text-gold    { color: var(--tertiary-dark); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.fw-bold   { font-weight: 700; }
.fw-medium { font-weight: 500; }
.font-data { font-family: var(--font-data); }
.font-display { font-family: var(--font-display); }
.rounded-full { border-radius: var(--radius-full); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.p-4 { padding: 1rem; } .p-6 { padding: 1.5rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.overflow-hidden { overflow: hidden; }
/* ---- Team Sandbox (Tree View) ---- */
.sandbox-viewport {
  background: var(--surface-low);
  background-image: 
    linear-gradient(rgba(0,107,50,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,107,50,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--outline-var);
  padding: 3rem;
  overflow: auto;
  min-height: 500px;
  position: relative;
  display: flex;
  justify-content: center;
}

.tree, .tree ul, .tree li { list-style: none; margin: 0; padding: 0; position: relative; }
.tree { display: flex; justify-content: center; width: fit-content; }
.tree ul { display: flex; padding-top: 2rem; }

.tree li { 
  display: flex; flex-direction: column; align-items: center; 
  padding: 0 0.5rem; flex: 1; min-width: 140px; 
}

/* Horizontal connectors */
.tree li::before, .tree li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  width: 50%; height: 2rem; border-top: 2px solid #cbd5e1;
}
.tree li::after { left: 50%; border-left: 2px solid #cbd5e1; }

/* Remove extra connectors */
.tree li:only-child::after, .tree li:only-child::before { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: none; }
.tree li:last-child::before { border-right: 2px solid #cbd5e1; border-radius: 0 5px 0 0; }
.tree li:first-child::after { border-radius: 5px 0 0 0; }

/* Vertical connectors to children */
.tree ul::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 0; height: 2rem; border-left: 2px solid #cbd5e1;
}

.tree-node-wrapper {
  background: var(--surface-lowest);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  min-width: 120px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid rgba(188,202,187,0.3);
  z-index: 2;
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
}
.tree-node-wrapper:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,107,50,0.1); border-color: var(--primary); }

.tree-node-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: #10b981; color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem;
  position: relative;
}
.tree-node-rank {
  position: absolute; bottom: -6px; right: -6px;
  padding: 0.15rem 0.4rem; border-radius: var(--radius-full);
  font-size: 0.55rem; font-weight: 800; background: #fbbf24; color: #7d5100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.4);
}

.tree-node-name { font-size: 0.8rem; font-weight: 700; color: var(--secondary); margin-bottom: 0.1rem; }
.tree-node-id { font-size: 0.65rem; color: var(--outline); font-family: var(--font-data); font-weight: 600; }

.tree-empty-slot {
  width: 120px; padding: 1.25rem 0.75rem;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  color: #94a3b8;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  transition: all var(--transition);
  background: rgba(255,255,255,0.4);
  cursor: pointer;
}
.tree-empty-slot:hover { border-color: var(--primary); color: var(--primary); background: rgba(0,107,50,0.03); }
.tree-empty-slot .plus-icon { width: 32px; height: 32px; border-radius: 50%; border: 1px dashed currentColor; display: flex; align-items: center; justify-content: center; }

/* ---- Modal System ---- */
.modal {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
  align-items: center; justify-content: center; padding: 2rem;
  animation: fadeIn 0.3s ease;
}
.modal.open { display: flex; }
.modal-content {
  background: var(--surface-lowest); border-radius: var(--radius-xl);
  max-width: 600px; width: 100%; position: relative; padding: 2.5rem;
  animation: fadeInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}
.modal-close { position: absolute; top: 1.25rem; right: 1.25rem; cursor: pointer; color: var(--outline); font-size: 1.5rem; }

/* ---- ATM ID Card Styling ---- */
.atm-card {
  width: 450px; height: 280px; 
  background: linear-gradient(145deg, #0A2540 0%, #031a0c 100%);
  border-radius: 16px; margin: 0 auto 2rem; position: relative;
  overflow: hidden; box-shadow: 0 40px 80px rgba(0,0,0,0.4);
  color: #fff; text-align: left; padding: 1.5rem;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; justify-content: space-between;
}
.atm-card::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 250px; height: 250px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.15) 0%, transparent 70%);
}
.atm-chip {
  width: 42px; height: 32px; background: linear-gradient(135deg, #FFD700 0%, #c8a900 100%);
  border-radius: 6px; margin-bottom: 0.5rem; position: relative;
}
.atm-chip::after {
  content: ''; position: absolute; inset: 4px; border: 1px solid rgba(0,0,0,0.1); border-radius: 2px;
}
.atm-logo { font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; gap: 0.4rem; color: #fff; }
.atm-user-box { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.5rem; }
.atm-avatar {
  width: 80px; height: 80px; border-radius: 12px; background: #fff; padding: 2px; flex-shrink: 0;
}
.atm-avatar img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.atm-name { font-size: 1.25rem; font-weight: 800; line-height: 1.1; }
.atm-id { font-size: 0.8rem; font-weight: 600; font-family: var(--font-data); opacity: 0.7; letter-spacing: 0.05em; margin-top: 0.2rem; }
.atm-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.atm-rank {
  padding: 0.3rem 0.75rem; border-radius: var(--radius-full);
  font-size: 0.6rem; font-weight: 800; background: rgba(255,215,0,0.15); color: var(--tertiary);
  border: 1px solid rgba(255,215,0,0.3);
}
.atm-meta { font-size: 0.7rem; font-weight: 700; opacity: 0.5; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Professional Digital ID Card ---- */
.associate-id-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 2rem; border-bottom: 1px solid var(--outline-var);
  background: #fff; border-radius: 1.5rem 1.5rem 0 0;
}
.associate-id-card {
  width: 540px; 
  height: 340px; 
  background: #fff; border-radius: 12px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.15);
  margin: 0 auto; overflow: hidden; position: relative;
  border: 1px solid var(--outline-var);
  display: flex; flex-direction: column;
}
.id-card-header {
  background: #0f172a; padding: 1rem 1.75rem; color: #fff;
  position: relative; border-bottom: 3.5px solid #fbbf24;
  display: flex; justify-content: space-between; align-items: center;
}
.id-card-logo-box { display: flex; flex-direction: column; line-height: 1.1; }
.id-card-logo-pt1 { font-size: 1.15rem; font-weight: 900; letter-spacing: -0.01em; }
.id-card-logo-pt2 { font-size: 1.15rem; font-weight: 900; color: #10b981; letter-spacing: -0.01em; }
.id-card-tagline { font-size: 0.52rem; font-weight: 700; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 1px; }
.id-card-shield { color: #fbbf24; opacity: 0.9; }

.id-card-body { 
  padding: 1.25rem 2rem; display: flex; gap: 2rem; position: relative; flex-grow: 1; align-items: center; 
  background: white;
  background-image: radial-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 15px 15px; background-attachment: local;
}
.id-card-body::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.id-card-divider {
  width: 2px; height: 120px; background: linear-gradient(to bottom, transparent, #fbbf24, transparent);
  opacity: 0.5; margin: 0 0.5rem;
}

.id-card-photo-box { flex-shrink: 0; position: relative; width: 105px; z-index: 2; }
.id-card-photo {
  width: 105px; height: 120px; border-radius: 10px;
  background: #f8fafc; box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  overflow: hidden; border: 3px solid #fff;
}
.id-card-photo img { width: 100%; height: 100%; object-fit: cover; }

.id-card-info { flex-grow: 1; text-align: left; display: flex; flex-direction: column; justify-content: center; z-index: 2; }
.id-field-group { margin-bottom: 0.4rem; }
.id-field-label { font-size: 0.45rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0px; }
.id-field-value { font-size: 0.9rem; font-weight: 900; color: #0f172a; line-height: 1.1; }
.id-field-value.highlight { color: #059669; }

.id-card-seal {
  position: absolute; bottom: 1.25rem; right: 2rem;
  width: 50px; height: 50px; opacity: 0.1;
  border: 2px solid #059669; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-15deg); font-size: 0.5rem; font-weight: 900;
  color: #059669; text-transform: uppercase; text-align: center;
  pointer-events: none;
}

.id-card-footer {
  background: #0f172a; padding: 0.75rem 1.75rem; border-top: 3.5px solid #fbbf24;
  text-align: center; color: #fff; font-size: 0.45rem; font-weight: 700;
  line-height: 1.4; text-transform: uppercase; letter-spacing: 0.03em;
}



/* ---- Rewards Plan & Matrix ---- */
.rank-hero {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
  margin-bottom: 2rem;
}
.rank-hero::before {
  content: ''; position: absolute; top: -50px; right: -50px;
  width: 250px; height: 250px; background: rgba(255,255,255,0.1);
  border-radius: 50%; filter: blur(50px);
}
.rank-hero-label {
  display: inline-block; padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.2); border-radius: 20px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em;
  margin-bottom: 1rem; text-transform: uppercase;
}
.rank-hero-title { font-family: var(--font-display); font-size: 2.75rem; font-weight: 900; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }
.rank-hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.rank-hero-stat-card { background: rgba(0,0,0,0.15); padding: 1.25rem; border-radius: var(--radius-lg); backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.1); }
.rank-hero-stat-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; opacity: 0.8; margin-bottom: 0.4rem; }
.rank-hero-stat-value { font-size: 1.5rem; font-weight: 800; }

.rank-next-target { position: absolute; right: 2.5rem; top: 3.5rem; text-align: right; }
.rank-next-icon { font-size: 2.5rem; opacity: 0.5; margin-bottom: 0.5rem; }
.rank-next-name { font-size: 1.25rem; font-weight: 800; color: #fff; margin-bottom: 0.2rem; }
.rank-next-team { font-size: 0.85rem; opacity: 0.8; font-weight: 600; }

/* Matrix Table Colors */
.matrix-row-L1, .matrix-row-L2, .matrix-row-L3, .matrix-row-L4, .matrix-row-L5 { background: #fff; }
.matrix-row-L6, .matrix-row-L7, .matrix-row-L8 { background: #f0f9ff; } /* Light blue */
.matrix-row-L9, .matrix-row-L10 { background: #fffbeb; } /* Light yellow */
.matrix-row-L11, .matrix-row-L12 { background: #f0fdf4; } /* Light green */
.matrix-row-L13, .matrix-row-L14, .matrix-row-L15 { background: #fdf2f8; } /* Light pink/purple */

.matrix-badge-you {
  background: #10b981; color: #fff; font-size: 0.55rem; font-weight: 800;
  padding: 0.1rem 0.5rem; border-radius: 10px; margin-left: 0.5rem;
  vertical-align: middle; display: inline-block; margin-top: -2px;
}
.matrix-active-row { outline: 2.5px solid #10b981; outline-offset: -2.5px; position: relative; z-index: 10; }
.matrix-active-row::after {
  content: ''; position: absolute; left: 0; top: 0; width: 5px; height: 100%; background: #10b981;
}

.table-responsive { width: 100%; overflow-x: auto; border-radius: var(--radius-xl); border: 1px solid var(--outline-var); box-shadow: var(--shadow-sm); }
.matrix-table { width: 100%; border-collapse: collapse; min-width: 1000px; background: #fff; }
.matrix-table th { background: var(--surface-low); padding: 1.25rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--outline-var); }
.matrix-table td { padding: 1.25rem 1rem; border-bottom: 1px solid rgba(226, 232, 240, 0.5); font-size: 0.85rem; font-weight: 600; color: #334155; }
.matrix-table .rank-name { color: #1e293b; font-weight: 800; font-size: 0.9rem; }
.matrix-table .rank-level { color: #94a3b8; font-family: var(--font-data); font-size: 0.75rem; }
.matrix-table .text-bonus { color: #10b981; }
.matrix-table .text-prize { color: var(--secondary); }

/* Matrix Row Hover Interaction */
.matrix-table tbody tr {
  cursor: pointer;
  transition: transform 0.4s var(--transition), box-shadow 0.4s var(--transition), background 0.4s var(--transition);
}
.matrix-table tbody tr:hover {
  transform: scale(1.02) translateX(5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  background: white !important;
  z-index: 50;
  position: relative;
}

/* Detail Modal Components */
.detail-modal-header { text-align: left; margin-bottom: 1.25rem; border-bottom: 1.5px solid var(--outline-var); padding-bottom: 1rem; position: relative; }
.detail-lvl-badge { background: #f8fafc; border: 1px solid var(--outline-var); padding: 0.25rem 0.65rem; border-radius: 20px; font-size: 0.65rem; font-weight: 800; color: #64748b; margin-bottom: 0.5rem; display: inline-block; }
.detail-rank-title { font-size: 1.75rem; font-weight: 900; color: var(--secondary); margin: 0; letter-spacing: -0.02em; }

.detail-section-label { font-size: 0.65rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.75rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.detail-card { background: #f8fafc; padding: 1rem; border-radius: 1rem; border: 1px solid rgba(226, 232, 240, 0.6); transition: all 0.3s ease; }
.detail-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.detail-card-val { font-size: 1.5rem; font-weight: 900; color: var(--secondary); line-height: 1; margin-bottom: 0.25rem; }
.detail-card-lbl { font-size: 0.6rem; font-weight: 700; color: #64748b; text-transform: uppercase; }

.detail-payout-row { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-radius: 1rem; margin-bottom: 0.75rem; border: 1.5px solid transparent; transition: all 0.3s ease; }
.detail-payout-row.income { background: #f0fdf4; border-color: #dcfce7; }
.detail-payout-row.bonus { background: #fffbeb; border-color: #fef3c7; }
.detail-payout-row.prize { background: #f0f9ff; border-color: #e0f2fe; }

.detail-payout-info { text-align: left; }
.detail-payout-title { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; margin-bottom: 0.1rem; }
.detail-payout-title.income { color: #059669; }
.detail-payout-title.bonus { color: #d97706; }
.detail-payout-title.prize { color: #2563eb; }
.detail-payout-desc { font-size: 0.65rem; color: #64748b; font-weight: 600; }
.detail-payout-val { font-size: 1.25rem; font-weight: 900; color: var(--secondary); }

/* ---- Mega Rewards Grid ---- */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.reward-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--outline-var);
  transition: all 0.4s var(--transition);
  position: relative;
}
.reward-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.1);
}

.reward-img-wrapper {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #f1f5f9;
}
.reward-img-wrapper img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--transition);
}
.reward-card:hover .reward-img-wrapper img { transform: scale(1.1); }

.reward-overlay-top {
  position: absolute; top: 1rem; left: 1rem; right: 1rem;
  display: flex; justify-content: space-between; align-items: flex-start;
  z-index: 10;
}
.reward-lvl-badge {
  background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px);
  color: #fff; padding: 0.35rem 0.75rem; border-radius: 8px;
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.05em;
  text-align: left; line-height: 1.2;
}
.reward-lvl-badge span { display: block; opacity: 0.7; font-size: 0.55rem; margin-bottom: 2px; }

.reward-status-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2.5px solid #10b981; color: #10b981;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  z-index: 10;
}
.reward-status-circle.locked { border-color: #cbd5e1; color: #94a3b8; }

.reward-title-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  padding: 2.5rem 1rem 1rem;
  color: #fff; text-transform: uppercase; font-weight: 900; font-size: 1rem;
  letter-spacing: 0.02em; text-align: left;
}

.reward-footer { padding: 1.25rem 1rem; text-align: center; }
.reward-status-btn {
  width: 100%; padding: 0.75rem; border-radius: 12px;
  background: #f0fdf4; color: #10b981; font-size: 0.7rem; font-weight: 800;
  border: 1px solid #dcfce7; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.reward-status-btn.locked {
  background: #f8fafc; color: #94a3b8; border-color: #e2e8f0;
}

@media (max-width: 1024px) { .reward-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .reward-grid { grid-template-columns: 1fr; } }

/* ---- Dashboard Dashboard Top & Layout ---- */
.dashboard-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
}
.dash-user-hello { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--secondary); letter-spacing: -0.02em; }
.dash-user-sub { font-size: 0.85rem; color: var(--on-surface-var); margin-top: 0.2rem; }

/* ---- Dashboard Stats Grid ---- */
.dash-stats-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem;
}
.stat-card-primary {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff; padding: 1.5rem; border-radius: 1.25rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
  position: relative; overflow: hidden;
}
.stat-card-v2 {
  background: var(--surface-card); padding: 1.25rem; border-radius: 1.25rem;
  border: 1px solid var(--outline-var);
  box-shadow: 0 6px 15px rgba(0,0,0,0.02); display: flex; flex-direction: column;
}
.card-icon-box {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}

/* ---- Dashboard Mini ID Preview (ATM Style) ---- */
.dash-id-preview {
  background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
  border-radius: 1.25rem; position: relative; overflow: hidden;
  box-shadow: 0 15px 35px rgba(2, 44, 34, 0.2);
  color: #fff; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  aspect-ratio: 1.58 / 1; display: flex; flex-direction: column;
}
.dash-id-preview::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 12px 12px; pointer-events: none;
}
.dash-id-preview:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 20px 45px rgba(2, 44, 34, 0.4); }

.dash-id-header { 
  padding: 1rem 1.25rem 0.5rem; display: flex; justify-content: space-between; align-items: center; 
  z-index: 1;
}

.dash-id-body { 
  flex-grow: 1; display: grid; grid-template-columns: 80px 1px 1fr; gap: 0.75rem; padding: 0.5rem 1.25rem 1rem;
  z-index: 1;
}

.dash-id-avatar { 
  width: 80px; height: 100px; border-radius: 8px; background: rgba(255,255,255,0.1); 
  border: 1px solid rgba(255,255,255,0.1); padding: 2px; overflow: hidden;
}

.dash-id-divider {
  width: 1px; height: 100%; background: linear-gradient(to bottom, transparent, #fbbf24, transparent);
  opacity: 0.5;
}

.dash-id-details { display: flex; flex-direction: column; justify-content: center; gap: 0.25rem; }

.dash-id-rank-badge {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
  color: #fcd34d; font-size: 0.6rem; font-weight: 800;
  padding: 0.2rem 0.5rem; border-radius: 4px; border: 1px solid rgba(251, 191, 36, 0.3);
  display: inline-block; width: fit-content; text-transform: uppercase;
}

.dash-id-seal-mini {
  position: absolute; bottom: 1rem; right: 1rem; opacity: 0.15; transform: rotate(-15deg);
}

/* ---- Mission Progress ---- */
.mission-row { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.8rem; font-weight: 600; }
.mission-label { color: var(--on-surface-var); }
.mission-val { color: var(--secondary); font-weight: 800; }
.progress-v2 { background: var(--surface-low); border-radius: 20px; height: 10px; overflow: hidden; }
.progress-bar-v2 { height: 100%; border-radius: 20px; }

/* ---- Activity Feed ---- */
.activity-feed { display: flex; flex-direction: column; gap: 1rem; }
.activity-item { display: flex; gap: 1rem; align-items: flex-start; }
.activity-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-body { flex-grow: 1; border-bottom: 1px solid var(--surface-low); padding-bottom: 1rem; }
.activity-item:last-child .activity-body { border-bottom: none; padding-bottom: 0; }
.activity-title { font-size: 0.85rem; font-weight: 600; color: var(--secondary); margin-bottom: 0.2rem; }
.activity-time { font-size: 0.7rem; color: var(--outline); font-weight: 500; }

/* ============================================
   RESPONSIVE / MOBILE STYLES
   ============================================ */

/* --- Mobile Bottom Navigation Bar --- */
.mobile-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(188,202,187,0.3);
  padding: 0.4rem 0.5rem 0.6rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: color 0.2s ease;
}
.mobile-nav-item.active {
  color: #059669;
}
.mobile-nav-item.active svg {
  color: #059669;
}

/* ---- Tablet (max-width: 1024px) ---- */
@media (max-width: 1024px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .dashboard-top {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }
  .checkout-layout {
    grid-template-columns: 1fr !important;
  }
  .auth-panel {
    width: 100% !important;
    min-height: auto !important;
    padding: 2rem 1.5rem !important;
  }
  .auth-visual {
    display: none !important;
  }
}

/* ---- Mobile (max-width: 768px) ---- */
@media (max-width: 768px) {

  /* Show mobile bottom nav, hide sidebar */
  .mobile-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  .sidebar {
    display: none !important;
  }

  /* Main content takes full width */
  .app-layout {
    flex-direction: column;
  }
  .main-content {
    padding: 1.25rem 1rem 5.5rem !important; /* bottom padding for mobile nav */
    width: 100% !important;
  }

  /* Dashboard top header */
  .dashboard-top {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem;
    margin-bottom: 1.5rem !important;
  }
  .dashboard-top > div:last-child {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  .dashboard-top > div:last-child .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    justify-content: center;
  }
  .dash-user-hello {
    font-size: 1.25rem !important;
  }

  /* Stats grid */
  .dash-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .stat-card-primary {
    padding: 1.5rem !important;
  }
  .stat-card-primary > div:nth-child(2) {
    font-size: 2rem !important;
  }

  /* Page header */
  .page-title {
    font-size: 1.35rem !important;
  }

  /* Tables horizontal scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table th,
  .table td {
    padding: 0.75rem 0.85rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap;
  }

  /* Cards reduce padding */
  .card {
    padding: 1.25rem !important;
    border-radius: 1rem !important;
  }

  /* Wallet card */
  .wallet-balance {
    font-size: 2.25rem !important;
  }

  /* Product grid */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  .product-card-body {
    padding: 0.75rem !important;
  }
  .product-card-name {
    font-size: 0.8rem !important;
  }

  /* Hero section */
  .hero {
    min-height: auto !important;
    padding: 5rem 0 3rem !important;
  }
  .hero-title {
    font-size: 2.25rem !important;
  }
  .hero-desc {
    font-size: 0.95rem !important;
  }
  .hero-stats {
    gap: 1.25rem !important;
    margin-top: 2rem !important;
  }
  .hero-stat-value {
    font-size: 1.4rem !important;
  }
  .hero-stat-label {
    font-size: 0.7rem !important;
  }
  .hero-visual {
    margin-top: 1.5rem;
  }

  /* Section spacing */
  .section {
    padding: 3rem 0 !important;
  }
  .section-title {
    font-size: 1.5rem !important;
  }

  /* Feature cards */
  .feature-card {
    padding: 1.25rem !important;
  }

  /* Deposit methods */
  .deposit-methods {
    grid-template-columns: 1fr !important;
  }

  /* Auth */
  .auth-page {
    flex-direction: column !important;
  }
  .auth-panel {
    width: 100% !important;
    min-height: 100vh;
    padding: 2rem 1.5rem !important;
  }
  .auth-visual {
    display: none !important;
  }
  .auth-title {
    font-size: 1.4rem !important;
  }

  /* Alerts */
  .alert {
    font-size: 0.82rem !important;
    padding: 0.85rem 1rem !important;
  }

  /* Store filter bar */
  .store-filter-bar {
    flex-direction: column !important;
    padding: 1rem !important;
    gap: 0.75rem !important;
  }
  .store-filter-bar > div,
  .store-filter-bar > select,
  .store-filter-bar > input {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Store hero */
  .store-hero {
    padding: 1.75rem 1.25rem !important;
    border-radius: 1rem !important;
  }
  .store-hero h1 {
    font-size: 1.6rem !important;
  }

  /* Checkout */
  .checkout-layout {
    grid-template-columns: 1fr !important;
  }
  .order-summary {
    position: static !important;
  }

  /* Landing nav */
  .nav-links {
    display: none !important;
  }
}

/* ---- Small phones (max-width: 480px) ---- */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem !important;
  }
  .hero-title {
    font-size: 1.85rem !important;
  }
  .hero-actions {
    flex-direction: column !important;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100% !important;
    justify-content: center;
  }
  .hero-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 1rem !important;
  }
  .stat-card-v2 {
    padding: 1rem !important;
  }
  .dash-user-hello {
    font-size: 1.1rem !important;
  }
  .mobile-nav {
    padding: 0.35rem 0.25rem 0.5rem;
  }
  .mobile-nav-item {
    font-size: 0.6rem;
    padding: 0.2rem 0.35rem;
  }
  .mobile-nav-item svg {
    width: 18px;
    height: 18px;
  }
}
