/* ============================================================
   RPENNY — Global Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&family=Nunito:wght@400;600;700;800;900&family=Baloo+2:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --gold:         #F4B400;
  --gold-light:   #FFD740;
  --gold-dark:    #E5A800;
  --blue:         #5DADE2;
  --blue-light:   #85C1E9;
  --blue-dark:    #2E86C1;
  --mint:         #58D68D;
  --mint-light:   #82E0AA;
  --mint-dark:    #27AE60;
  --lavender:     #A569BD;
  --coral:        #F1948A;
  --coral-dark:   #E74C3C;
  --soft-white:   #FAFBFF;
  --bg:           #F0F4FF;
  --bg-card:      #FFFFFF;
  --text:         #1A1D2E;
  --text-muted:   #6B7280;
  --text-light:   #9CA3AF;
  --border:       #E5E7EB;
  --shadow:       0 4px 24px rgba(93,173,226,0.10);
  --shadow-hover: 0 8px 40px rgba(93,173,226,0.20);
  --shadow-card:  0 2px 16px rgba(26,29,46,0.08);
  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    24px;
  --radius-xl:    32px;
  --transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main:    'Poppins', sans-serif;
  --font-fun:     'Baloo 2', cursive;
  --font-round:   'Nunito', sans-serif;
  --grad-gold:    linear-gradient(135deg, #F4B400 0%, #FF9800 100%);
  --grad-blue:    linear-gradient(135deg, #5DADE2 0%, #2E86C1 100%);
  --grad-mint:    linear-gradient(135deg, #58D68D 0%, #27AE60 100%);
  --grad-purple:  linear-gradient(135deg, #A569BD 0%, #7D3C98 100%);
  --grad-coral:   linear-gradient(135deg, #F1948A 0%, #E74C3C 100%);
  --grad-hero:    linear-gradient(135deg, #1A1D2E 0%, #2D3561 50%, #1A6B8A 100%);
  --grad-card:    linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
}

[data-theme="dark"] {
  --bg:           #0F1117;
  --bg-card:      #1A1D2E;
  --text:         #F0F4FF;
  --text-muted:   #9CA3AF;
  --border:       #2D3561;
  --shadow-card:  0 2px 16px rgba(0,0,0,0.4);
}

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

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

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.heading-fun { font-family: var(--font-fun); }
.heading-round { font-family: var(--font-round); }

.text-gradient {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-blue {
  background: var(--grad-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm { max-width: 720px; }
.container-lg { max-width: 1400px; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.card-glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
}

.card-gradient-gold {
  background: var(--grad-gold);
  color: #fff;
  border: none;
}

.card-gradient-blue {
  background: var(--grad-blue);
  color: #fff;
  border: none;
}

.card-gradient-mint {
  background: var(--grad-mint);
  color: #fff;
  border: none;
}

.card-body { padding: 24px; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--border); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before { left: 100%; }

.btn-primary {
  background: var(--grad-gold);
  color: #fff;
  box-shadow: 0 4px 20px rgba(244,180,0,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(244,180,0,0.5);
}

.btn-blue {
  background: var(--grad-blue);
  color: #fff;
  box-shadow: 0 4px 20px rgba(93,173,226,0.4);
}

.btn-blue:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(93,173,226,0.5); }

.btn-mint {
  background: var(--grad-mint);
  color: #fff;
  box-shadow: 0 4px 20px rgba(88,214,141,0.4);
}

.btn-mint:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(88,214,141,0.5); }

.btn-purple {
  background: var(--grad-purple);
  color: #fff;
  box-shadow: 0 4px 20px rgba(165,105,189,0.4);
}

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

.btn-outline:hover { background: var(--gold); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 40px; font-size: 1.1rem; }
.btn-xl { padding: 20px 56px; font-size: 1.2rem; border-radius: 60px; }

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: 50%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

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

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

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg-card);
  color: var(--text);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(93,173,226,0.15);
}

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

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

.form-error {
  font-size: 0.8rem;
  color: var(--coral-dark);
  margin-top: 4px;
  display: none;
}

.input-group {
  position: relative;
}

.input-group .form-control { padding-left: 48px; }

.input-group .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
}

/* ── Badges / Pills ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-gold { background: rgba(244,180,0,0.15); color: var(--gold-dark); }
.badge-blue { background: rgba(93,173,226,0.15); color: var(--blue-dark); }
.badge-mint { background: rgba(88,214,141,0.15); color: var(--mint-dark); }
.badge-coral { background: rgba(241,148,138,0.15); color: var(--coral-dark); }
.badge-purple { background: rgba(165,105,189,0.15); color: var(--lavender); }
.badge-success { background: rgba(88,214,141,0.15); color: #1a8a4a; }
.badge-pending { background: rgba(244,180,0,0.15); color: #B8860B; }
.badge-danger { background: rgba(231,76,60,0.15); color: #C0392B; }

/* ── Progress Bars ──────────────────────────────────────── */
.progress {
  height: 10px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 50px;
  background: var(--grad-gold);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.progress-bar.blue { background: var(--grad-blue); }
.progress-bar.mint { background: var(--grad-mint); }
.progress-bar.purple { background: var(--grad-purple); }

/* ── Avatar / Image Circles ─────────────────────────────── */
.avatar {
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-gold);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-xs  { width: 28px;  height: 28px;  font-size: 0.7rem; }
.avatar-sm  { width: 36px;  height: 36px;  font-size: 0.85rem; }
.avatar-md  { width: 48px;  height: 48px;  font-size: 1rem; }
.avatar-lg  { width: 64px;  height: 64px;  font-size: 1.4rem; }
.avatar-xl  { width: 96px;  height: 96px;  font-size: 2rem; }
.avatar-2xl { width: 128px; height: 128px; font-size: 2.5rem; }

/* ── Stats Cards ────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 8px;
}

.stat-change.up { color: var(--mint-dark); }
.stat-change.down { color: var(--coral-dark); }

/* ── Navigation ─────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(255,255,255,0.98);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-fun);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
}

.navbar-brand .logo-icon {
  width: 40px; height: 40px;
  background: var(--grad-gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  background: rgba(93,173,226,0.1);
  color: var(--blue-dark);
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-text {
  font-family: var(--font-fun);
  font-size: 1.4rem;
  font-weight: 800;
}

.sidebar-section {
  padding: 20px 16px 8px;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  padding: 0 8px;
  margin-bottom: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  position: relative;
}

.sidebar-link:hover {
  background: rgba(93,173,226,0.08);
  color: var(--blue-dark);
}

.sidebar-link.active {
  background: var(--grad-blue);
  color: #fff;
  box-shadow: 0 4px 16px rgba(93,173,226,0.35);
}

.sidebar-link .link-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--coral-dark);
  color: #fff;
  font-size: 0.7rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Main Layout ────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 24px;
  padding-top: 88px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Grid System ────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Wallet Card ────────────────────────────────────────── */
.wallet-card {
  background: var(--grad-hero);
  border-radius: var(--radius-lg);
  padding: 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

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

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

.wallet-balance {
  font-size: 3rem;
  font-weight: 900;
  font-family: var(--font-fun);
  margin: 8px 0;
}

.wallet-label {
  font-size: 0.85rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Task Cards ─────────────────────────────────────────── */
.task-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 2px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.task-card:hover {
  border-color: var(--blue);
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.task-icon-wrap {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(244,180,0,0.12);
  color: var(--gold-dark);
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── XP / Level Bar ─────────────────────────────────────── */
.xp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-badge {
  min-width: 36px; height: 36px;
  background: var(--grad-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── Streak Display ─────────────────────────────────────── */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  color: #fff;
  padding: 6px 14px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.streak-fire {
  animation: fireFlicker 1s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  from { transform: scale(1) rotate(-5deg); }
  to   { transform: scale(1.15) rotate(5deg); }
}

/* ── Coin Animation ─────────────────────────────────────── */
.coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--grad-gold);
  border-radius: 50%;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(244,180,0,0.4);
}

/* ── Floating Coins ─────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-20px) rotate(5deg); }
}

@keyframes floatReverse {
  0%, 100% { transform: translateY(-10px) rotate(0deg); }
  50%       { transform: translateY(10px) rotate(-5deg); }
}

.floating { animation: float 4s ease-in-out infinite; }
.floating-reverse { animation: floatReverse 5s ease-in-out infinite; }
.floating-slow { animation: float 6s ease-in-out infinite; }

/* ── Pet Display ────────────────────────────────────────── */
.pet-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pet-emoji {
  font-size: 6rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.15));
  cursor: pointer;
  transition: transform 0.2s;
}

.pet-emoji:hover { transform: scale(1.1); }

.pet-speech-bubble {
  background: #fff;
  border-radius: 16px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  position: relative;
  margin-bottom: 16px;
  max-width: 200px;
  text-align: center;
}

.pet-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

/* ── Saving Jar ─────────────────────────────────────────── */
.saving-jar {
  position: relative;
  width: 80px;
  height: 100px;
  margin: 0 auto;
}

.jar-body {
  width: 70px;
  height: 80px;
  border: 4px solid var(--gold);
  border-radius: 0 0 20px 20px;
  position: absolute;
  bottom: 0;
  left: 5px;
  overflow: hidden;
  background: rgba(255,255,255,0.5);
}

.jar-fill {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  background: linear-gradient(180deg, rgba(244,180,0,0.4) 0%, rgba(244,180,0,0.8) 100%);
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.jar-lid {
  width: 80px;
  height: 20px;
  background: var(--grad-gold);
  border-radius: 8px;
  position: absolute;
  top: 0;
  left: 0;
}

/* ── Achievement / Badge Card ───────────────────────────── */
.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  border-radius: var(--radius);
  text-align: center;
  border: 2px solid var(--border);
  background: var(--bg-card);
  transition: var(--transition);
}

.badge-card.earned {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(244,180,0,0.05) 0%, rgba(255,255,255,1) 100%);
}

.badge-card.locked {
  filter: grayscale(0.7);
  opacity: 0.6;
}

.badge-icon-wrap {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
  position: relative;
}

.badge-icon-wrap.earned::after {
  content: '✓';
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  background: var(--mint);
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
}

/* ── Notifications ──────────────────────────────────────── */
.notification-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.notification-item:hover { background: var(--bg); }
.notification-item.unread { background: rgba(93,173,226,0.06); }

.notification-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px;
  flex-shrink: 0;
}

/* ── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: var(--transition);
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 28px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1.2rem; font-weight: 700; }

.modal-body { padding: 24px 28px; }
.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── Toast Notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  border-left: 4px solid var(--blue);
  min-width: 300px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.4,0,0.2,1);
}

.toast.success { border-left-color: var(--mint); }
.toast.error   { border-left-color: var(--coral-dark); }
.toast.warning { border-left-color: var(--gold); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* ── Bottom Nav (Mobile) ────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 500;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-light);
  transition: var(--transition);
  cursor: pointer;
}

.bottom-nav-item.active { color: var(--blue); }
.bottom-nav-item .nav-icon { font-size: 1.2rem; }

/* ── Loading Skeleton ───────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { background-position: -200px 0; }
  100%       { background-position: calc(200px + 100%) 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(229,231,235,0.5) 50%, var(--border) 75%);
  background-size: 200px 100%;
  animation: skeleton-pulse 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Confetti Canvas ────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ── Utility Classes ────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.1rem; }
.text-xl     { font-size: 1.3rem; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.rounded     { border-radius: var(--radius-sm); }
.rounded-lg  { border-radius: var(--radius); }
.rounded-xl  { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 50px; }
.hidden { display: none !important; }
.visible { display: block !important; }
.opacity-50 { opacity: 0.5; }

/* ── Responsive Breakpoints ─────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,0.2); }
  .main-content { margin-left: 0; padding-bottom: 80px; }
  .bottom-nav { display: block; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .main-content { padding: 16px; padding-top: 80px; padding-bottom: 88px; }
  .wallet-balance { font-size: 2.2rem; }
  .page-title { font-size: 1.4rem; }
  .modal { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .btn-xl { padding: 16px 40px; font-size: 1rem; }
}

/* ── Scrollbar Styling ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ── Selection ──────────────────────────────────────────── */
::selection { background: rgba(93,173,226,0.2); color: var(--text); }
