:root {
  --navy: #0A1628;
  --royal: #1B3A6B;
  --emerald: #10B981;
  --crimson: #EF4444;
  --gold: #D4A843;
  --light-bg: #F8FAFC;
  --white: #FFFFFF;
  --dark-slate: #111827;
  --charcoal: #1F2937;
  --text-light: #111827;
  --text-dark: #F9FAFB;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--light-bg);
  color: var(--text-light);
  overflow-x: hidden;
}

body.dark-mode {
  background: var(--dark-slate);
  color: var(--text-dark);
}

.font-display { font-family: 'Playfair Display', serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(27,58,107,0.3); border-radius: 3px; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes checkmark {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes confettiDrop {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}

.animate-fade { animation: fadeIn 0.4s ease-out forwards; }
.animate-fade-scale { animation: fadeInScale 0.3s ease-out forwards; }
.animate-slide-left { animation: slideInLeft 0.4s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.5s ease-out forwards; }
.animate-pulse { animation: pulse 1.5s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-checkmark { animation: checkmark 0.6s ease-out forwards; }
.animate-bell { animation: bellShake 0.5s ease-out; }

.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }
.stagger-5 { animation-delay: 0.25s; opacity: 0; }
.stagger-6 { animation-delay: 0.3s; opacity: 0; }
.stagger-7 { animation-delay: 0.35s; opacity: 0; }
.stagger-8 { animation-delay: 0.4s; opacity: 0; }

/* Card hover effect */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Button press */
.btn-press {
  transition: transform 0.1s ease;
}
.btn-press:active {
  transform: scale(0.97);
}

/* Gradient backgrounds */
.grad-navy { background: linear-gradient(135deg, #0A1628 0%, #1B3A6B 100%); }
.grad-teal { background: linear-gradient(135deg, #0E7490 0%, #14B8A6 100%); }
.grad-purple { background: linear-gradient(135deg, #6D28D9 0%, #A78BFA 100%); }
.grad-gold { background: linear-gradient(135deg, #D4A843 0%, #F6D97A 100%); }
.grad-login { background: linear-gradient(160deg, #050D1B 0%, #0A1628 30%, #1B3A6B 100%); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.dark-mode .skeleton {
  background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
  background-size: 200% 100%;
}

/* OTP inputs */
.otp-input {
  width: 48px; height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 2px solid #374151;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: #F9FAFB;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.otp-input:focus {
  border-color: #D4A843;
  box-shadow: 0 0 0 3px rgba(212,168,67,0.2);
}

/* Toggle switch */
.toggle-track {
  width: 44px; height: 24px;
  border-radius: 12px;
  background: #374151;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-track.active { background: #10B981; }
.toggle-knob {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: white;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-track.active .toggle-knob { transform: translateX(20px); }

/* Toast */
.toast-enter {
  animation: slideUp 0.3s ease-out forwards;
}

/* Chart tooltip */
.chart-tooltip {
  position: absolute;
  background: rgba(10,22,40,0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  pointer-events: none;
  white-space: nowrap;
  z-index: 50;
}

/* Sidebar active */
.nav-active {
  border-left: 3px solid var(--gold);
  background: rgba(212,168,67,0.08);
}

/* Mobile bottom nav */
@media (max-width: 768px) {
  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--navy);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Hide scrollbar for horizontal scroll */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Ensure inputs in dark mode look good */
.dark-mode input, .dark-mode select, .dark-mode textarea {
  color-scheme: dark;
}

/* Confetti piece */
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiDrop 1.5s ease-in forwards;
}