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

:root {
  --navy: #012169;
  --navy-light: #0053A0;
  --accent: #E31837;
  --success: #2E8540;
  --surface: #F5F5F5;
  --card: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
}

.dark {
  --surface: #0A1628;
  --card: #132038;
  --text-primary: #E8ECF1;
  --text-secondary: #8899AA;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #33445566; border-radius: 3px; }

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@keyframes countUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

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

@keyframes checkmark {
  0% { stroke-dashoffset: 50; }
  100% { stroke-dashoffset: 0; }
}

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

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

@keyframes skeletonPulse {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-right { animation: slideInRight 0.4s ease-out forwards; }
.animate-slide-left { animation: slideInLeft 0.4s ease-out forwards; }
.animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-shake { animation: shake 0.5s ease-in-out; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-toast-in { animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-toast-out { animation: toastOut 0.3s ease-in forwards; }

.skeleton {
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200px 100%;
  animation: skeletonPulse 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #1a2d4a 25%, #243b5c 50%, #1a2d4a 75%);
  background-size: 200px 100%;
}

.gradient-bg {
  background: linear-gradient(135deg, #012169 0%, #0053A0 50%, #012169 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

.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);
}

.dark .card-hover:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

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

.frosted-glass {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.85);
}

.dark .frosted-glass {
  background: rgba(10,22,40,0.85);
}

/* Tabular numbers */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* OTP input */
.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #d1d5db;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: transparent;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}
.otp-input:focus {
  border-color: #0053A0;
  box-shadow: 0 0 0 3px rgba(0,83,160,0.2);
}
.dark .otp-input {
  border-color: #334155;
}
.dark .otp-input:focus {
  border-color: #4A9CFF;
  box-shadow: 0 0 0 3px rgba(74,156,255,0.2);
}

/* Donut chart */
.donut-chart {
  transform: rotate(-90deg);
}

/* Mobile bottom nav */
@media (max-width: 767px) {
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }
}

/* Input focus styles */
input:focus, select:focus, textarea:focus {
  outline: none;
}

/* Custom scrollbar for transaction list */
.tx-scroll {
  scrollbar-width: thin;
  scrollbar-color: #33445544 transparent;
}

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