/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-secondary: #1e293b;
  --border: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-glow: #06b6d4;
  --primary-fg: #ffffff;
  --success: #22c55e;
  --warning: #f59e0b;
  --destructive: #ef4444;
  --gradient: linear-gradient(135deg, #3b82f6, #06b6d4);
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.light {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-secondary: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  font-family: inherit;
}
input,
textarea,
select {
  font-family: inherit;
}

/* ===== UTILITIES ===== */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-primary {
  background: var(--gradient);
  color: var(--primary-fg);
  border: none;
}
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}
.text-success {
  color: var(--success);
}
.text-warning {
  color: var(--warning);
}
.text-destructive {
  color: var(--destructive);
}
.text-primary {
  color: var(--primary);
}
.text-muted {
  color: var(--text-muted);
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Desktop sidebar */
.sidebar {
  display: none;
  width: 240px;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px;
  font-size: 20px;
  font-weight: 700;
}
.sidebar nav {
  flex: 1;
  padding: 0 12px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.sidebar nav a:hover {
  color: var(--text);
  background: var(--bg-secondary);
}
.sidebar nav a.active {
  background: var(--gradient);
  color: var(--primary-fg);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.sidebar nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  width: 100%;
  transition: all 0.2s;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-secondary);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Mobile top bar */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 40;
}
.mobile-header h1 {
  font-size: 18px;
  font-weight: 700;
}
.mobile-header button {
  padding: 8px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  transition: all 0.2s;
}
.mobile-header button:hover {
  color: var(--text);
  background: var(--bg-secondary);
}
.mobile-header button svg,
.mobile-theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Bottom nav */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 6px 0;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 16px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}
.bottom-nav a:hover,
.bottom-nav a.active {
  color: var(--primary);
}
.bottom-nav a svg {
  width: 20px;
  height: 20px;
}

/* Main content */
.main-content {
  flex: 1;
  padding-bottom: 72px;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .sidebar {
    display: flex;
  }
  .mobile-header {
    display: none;
  }
  .bottom-nav {
    display: none;
  }
  .main-content {
    margin-left: 240px;
    padding-bottom: 24px;
  }
}

/* ===== PAGE CONTAINER ===== */
.page {
  padding: 16px;
  max-width: 896px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .page {
    padding: 24px;
  }
}

/* ===== BALANCE CARDS ===== */
.balance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .balance-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.balance-card {
  padding: 16px;
}
.balance-card .label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.balance-card .label svg {
  width: 14px;
  height: 14px;
}
.balance-card .value {
  font-size: 24px;
  font-weight: 700;
}

/* ===== CAROUSEL ===== */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 2.2/1;
  margin-bottom: 20px;
}
@media (min-width: 768px) {
  .carousel {
    aspect-ratio: 3/1;
  }
}
.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  transition:
    opacity 0.4s,
    transform 0.4s;
  opacity: 0;
  transform: translateX(50px);
}
.carousel-slide.active {
  opacity: 1;
  transform: translateX(0);
}
.carousel-slide h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
@media (min-width: 768px) {
  .carousel-slide h2 {
    font-size: 30px;
  }
}
.carousel-slide p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
}
.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  transition: all 0.3s;
  cursor: pointer;
}
.carousel-dot.active {
  background: #fff;
  width: 20px;
}

/* ===== DASHBOARD GRID ===== */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.quick-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.quick-grid a:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: var(--bg-secondary);
}
.quick-grid .icon-wrap {
  padding: 10px;
  border-radius: 50%;
  background: var(--bg-secondary);
}
.quick-grid .icon-wrap svg {
  width: 20px;
  height: 20px;
}
.quick-grid span {
  font-size: 12px;
  font-weight: 500;
}

/* ===== ACTIVITY LIST ===== */
.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 8px;
}
.activity-item .info p:first-child {
  font-size: 14px;
  font-weight: 500;
}
.activity-item .info p:last-child {
  font-size: 12px;
  color: var(--text-muted);
}
.activity-item .amount {
  font-size: 14px;
  font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--bg-secondary);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-full {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== FORM ELEMENTS ===== */
.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

/* ===== DIALOG/MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  transform: scale(0.95);
  transition: transform 0.3s;
}
.modal-overlay.show .modal {
  transform: scale(1);
}
.modal-header {
  margin-bottom: 8px;
}
.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== SPINNER (Lucky Draw) ===== */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.spinner-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--primary);
  z-index: 2;
}
.spinner-wheel-wrap {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Support page icon cards */
.support-icon-card svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

/* Agent page large icon */
.agent-icon svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

/* Modal header icon */
.modal-header h3 svg {
  width: 20px;
  height: 20px;
}

/* ===== PLAN CARDS ===== */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .plans-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.plan-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.plan-card.featured {
  border-color: var(--primary);
}
.plan-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: var(--gradient);
  color: #fff;
}
.plan-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.plan-card .price {
  font-size: 28px;
  font-weight: 700;
  margin: 12px 0;
}
.plan-card .price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
.plan-features {
  list-style: none;
  margin: 16px 0;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-muted);
}
.plan-features li svg {
  width: 16px;
  height: 16px;
  color: var(--success);
  flex-shrink: 0;
}

/* ===== PROFILE ===== */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.stat-card {
  padding: 16px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 20px;
  font-weight: 700;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== MISC ===== */
.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.warning-box svg {
  width: 16px;
  height: 16px;
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 2px;
}
.warning-box p {
  font-size: 12px;
  color: var(--text-muted);
}
.copy-box {
  display: flex;
  align-items: center;
  gap: 8px;
}
.copy-box code {
  flex: 1;
  font-size: 12px;
  background: var(--bg-secondary);
  padding: 8px;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-box button svg {
  width: 14px;
  height: 14px;
}
.method-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.amount-presets {
  display: flex;
  gap: 8px;
}
.amount-presets button {
  flex: 1;
}
.space-y > * + * {
  margin-top: 16px;
}
.space-y-sm > * + * {
  margin-top: 12px;
}
.space-y-xs > * + * {
  margin-top: 8px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}
.menu-list {
  list-style: none;
}
.menu-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.menu-list li:hover {
  background: var(--bg-secondary);
}
.menu-list li:last-child {
  border-bottom: none;
}
.menu-list .menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-list .menu-left svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.menu-list .menu-right svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.faq-item {
  padding: 16px;
  cursor: pointer;
}
.faq-item h4 {
  font-size: 14px;
  font-weight: 600;
}
.faq-item p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  display: none;
}
.faq-item.open p {
  display: block;
}
.tier-card {
  padding: 16px;
  margin-bottom: 12px;
}
.tier-card h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.tier-card ul {
  list-style: none;
}
.tier-card ul li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}
.tier-card ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
}
.referral-box {
  padding: 16px;
  text-align: center;
}
.referral-box .code {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  margin: 12px 0;
}
.team-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
}
.team-member .member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.team-member .member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}
.download-card {
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.download-card svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
}
.download-card h3 {
  font-size: 18px;
  font-weight: 600;
}
.download-card p {
  font-size: 13px;
  color: var(--text-muted);
}
.download-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .download-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.check-icon svg {
  width: 16px;
  height: 16px;
}
