/* ==========================================================================
   WealthWave Dark Glassmorphism & Futuristic Neon Theme
   Reference: Deep Obsidian, Ambient Glowing Orbs, Frosted Glass & Neon Accents
   ========================================================================== */

:root, .dark {
  /* Core Theme Colors */
  --background: 222 47% 6%;           /* #070B13 deep obsidian dark */
  --foreground: 210 40% 98%;          /* #F8FAFC crisp white */
  --card: 222 40% 9%;                 /* #0D1321 dark frosted glass */
  --card-foreground: 210 40% 98%;     /* #F8FAFC */
  --popover: 222 42% 8%;              /* #0A0F1B */
  --popover-foreground: 210 40% 98%;
  
  /* Neon Brand Accents (WealthWave Cyan & Violet) */
  --primary: 187 96% 48%;             /* #06B6D4 electric cyan */
  --primary-foreground: 222 47% 6%;
  --secondary: 222 30% 13%;           /* #121A2C */
  --secondary-foreground: 210 40% 98%;
  --muted: 222 28% 12%;               /* #101726 */
  --muted-foreground: 215 20% 65%;    /* #94A3B8 soft slate blue */
  --accent: 270 85% 65%;              /* #A855F7 neon violet */
  --accent-foreground: 0 0% 100%;
  --destructive: 350 89% 60%;         /* #F43F5E neon rose */
  --destructive-foreground: 0 0% 100%;
  
  /* Borders and Rings */
  --border: 222 25% 17%;              /* rgba(255,255,255,0.08) */
  --input: 222 25% 16%;
  --ring: 187 96% 48%;
  --radius: 1.25rem;
  
  /* Sidebar Specifics */
  --sidebar-background: 222 45% 7%;   /* #090E18 */
  --sidebar-foreground: 210 40% 98%;
  --sidebar-primary: 187 96% 48%;
  --sidebar-primary-foreground: 222 47% 6%;
  --sidebar-accent: 222 30% 13%;
  --sidebar-accent-foreground: 210 40% 98%;
  --sidebar-border: 222 25% 15%;
  --sidebar-ring: 187 96% 48%;
  
  /* Brand Gradients & Shadows */
  --grad-brand: linear-gradient(135deg, #06B6D4 0%, #3B82F6 50%, #8B5CF6 100%);
  --neu-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  --neu-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.45);
}

/* Theme-aware foundation. The app's existing theme toggle only needs to switch html.dark/html.light. */
html {
  color-scheme: dark;
  background-color: hsl(var(--background));
  transition: background-color 250ms ease-out, color 250ms ease-out;
}

  html.light {
  color-scheme: light;
  }

  /* Toast transition styling */
  [data-sonner-toast], [role="status"], [role="alert"], .toast, .notification {
    transition: opacity 220ms ease-out, transform 220ms ease-out !important;
  }


html.light body {
  background-color: hsl(var(--background)) !important;
  color: hsl(var(--foreground)) !important;
}

html.light body::before {
  background: radial-gradient(circle at 35% 35%, rgba(6, 182, 212, 0.12) 0%, rgba(139, 92, 246, 0.09) 45%, transparent 70%);
}

html.light body::after {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.08) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 75%);
}

body {
  background-color: #070B13 !important;
  color: #F8FAFC !important;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Atmospheric Glowing Ambient Orbs (1:1 with reference) */
body::before {
  content: "";
  position: fixed;
  top: 14%;
  left: 50%;
  transform: translate(-50%, -10%);
  width: 540px;
  max-width: 92vw;
  height: 540px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(6, 182, 212, 0.22) 0%, rgba(139, 92, 246, 0.18) 45%, rgba(7, 11, 19, 0) 70%);
  filter: blur(52px);
  pointer-events: none;
  z-index: 0;
  animation: atmosphericPulse 14s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  bottom: 12%;
  right: 8%;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(6, 182, 212, 0.08) 50%, rgba(7, 11, 19, 0) 75%);
  filter: blur(65px);
  pointer-events: none;
  z-index: 0;
}

@keyframes atmosphericPulse {
  0% { transform: translate(-50%, -10%) scale(1); }
  50% { transform: translate(-49%, -6%) scale(1.06); }
  100% { transform: translate(-51%, -8%) scale(0.98); }
}

#root {
  position: relative;
  z-index: 1;
}

/* Light mode surfaces keep the same glass hierarchy without dark overrides leaking through. */
html.light header.fixed {
  background: rgba(255, 255, 255, 0.82) !important;
  border-bottom-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 4px 20px rgba(51, 65, 85, 0.1) !important;
}

html.light .card-neu,
html.light .bg-card,
html.light aside.bg-sidebar,
html.light .wealthwave-hero-card {
  background: rgba(255, 255, 255, 0.82) !important;
  color: hsl(var(--card-foreground)) !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
  box-shadow: 0 16px 36px rgba(51, 65, 85, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

html.light .text-white,
html.light .text-slate-50,
html.light .text-slate-100,
html.light .text-gray-50,
html.light .text-gray-100 {
  color: hsl(var(--foreground)) !important;
}

html.light .text-slate-300,
html.light .text-slate-400,
html.light .text-gray-400 {
  color: hsl(var(--muted-foreground)) !important;
}

/* Glassmorphism Header */
header.fixed {
  background: rgba(9, 14, 24, 0.78) !important;
  backdrop-filter: blur(24px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Glassmorphism Cards */
.card-neu,
.bg-card,
aside.bg-sidebar {
  background: rgba(14, 20, 34, 0.75) !important;
  backdrop-filter: blur(24px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 16px 36px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.1) !important;
  border-radius: 1.25rem !important;
}

.card-neu:hover,
.bg-card:hover {
  border-color: rgba(6, 182, 212, 0.32) !important;
  box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.7), 0 0 24px rgba(6, 182, 212, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}

/* WealthWave Hero Balance Card */
.wealthwave-hero-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.85) 0%, rgba(15, 23, 42, 0.75) 100%) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 1.5rem !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
  position: relative;
  overflow: hidden;
}

.wealthwave-hero-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(139, 92, 246, 0.15) 50%, transparent 70%);
  filter: blur(24px);
  pointer-events: none;
}

/* Quick Action Grid (Send, Receive, Pay, Invest 1:1 match) */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .quick-action-grid {
    gap: 1.25rem;
  }
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  border-radius: 1.25rem;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: transparent !important;
}

.quick-action-card:hover {
  transform: translateY(-4px);
}

.quick-action-card:active {
  transform: scale(0.95);
}

.quick-action-icon-box {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1.15rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.5rem;
  transition: all 0.25s ease;
  position: relative;
}

@media (min-width: 640px) {
  .quick-action-icon-box {
    width: 3.85rem;
    height: 3.85rem;
    border-radius: 1.25rem;
  }
}

/* 1. Send / Cari OTR (Rose / Pink Neon) */
.quick-action-card:nth-child(1) .quick-action-icon-box {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(217, 70, 239, 0.25)) !important;
  border: 1px solid rgba(244, 63, 94, 0.45) !important;
  color: #FDA4AF !important;
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
.quick-action-card:nth-child(1):hover .quick-action-icon-box {
  border-color: rgba(244, 63, 94, 0.8) !important;
  box-shadow: 0 12px 30px rgba(244, 63, 94, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

/* 2. Receive / Kalkulator (Emerald / Mint Neon) */
.quick-action-card:nth-child(2) .quick-action-icon-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(20, 184, 166, 0.25)) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  color: #6EE7B7 !important;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
.quick-action-card:nth-child(2):hover .quick-action-icon-box {
  border-color: rgba(16, 185, 129, 0.8) !important;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

/* 3. Pay / Cek Kontrak (Violet / Purple Neon) */
.quick-action-card:nth-child(3) .quick-action-icon-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.25)) !important;
  border: 1px solid rgba(139, 92, 246, 0.45) !important;
  color: #C4B5FD !important;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
.quick-action-card:nth-child(3):hover .quick-action-icon-box {
  border-color: rgba(139, 92, 246, 0.8) !important;
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

/* 4. Invest / Rekap Taksasi (Cyan / Electric Blue Neon) */
.quick-action-card:nth-child(4) .quick-action-icon-box {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.25)) !important;
  border: 1px solid rgba(6, 182, 212, 0.45) !important;
  color: #67E8F9 !important;
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
.quick-action-card:nth-child(4):hover .quick-action-icon-box {
  border-color: rgba(6, 182, 212, 0.8) !important;
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.quick-action-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #E2E8F0;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Floating Bottom Navigation Pill Dock (1:1 with reference) */
nav.fixed.left-3.right-3.bottom-3 {
  background: rgba(12, 17, 30, 0.85) !important;
  backdrop-filter: blur(28px) saturate(210%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(210%) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 9999px !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 30px rgba(6, 182, 212, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 8px 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 4px !important;
}

nav.fixed > a {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  width: 20% !important;
  padding: 6px 2px !important;
  gap: 4px !important;
  border-radius: 0.85rem !important;
}

nav.fixed > a > span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}

nav.fixed > a.-mt-7 {
  flex-basis: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 6px !important;
}

@media (max-width: 380px) {
  nav.fixed.left-3.right-3.bottom-3 {
    left: 10px;
    right: 10px;
    padding-inline: 7px !important;
  }

  nav.fixed.left-3.right-3.bottom-3 > a {
    font-size: 0.65rem;
  }
}

nav .grad-brand {
  background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 50%, #8B5CF6 100%) !important;
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* Sidebar Menu Organization & Grouping */
.sidebar-category-header {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.55);
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-category-header svg {
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.7;
}

/* Sleek Menu Link Items */
aside a,
aside button {
  border-radius: 0.85rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

aside a:hover,
aside button:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #FFFFFF !important;
}

/* Active Nav Indicator */
aside a[class*="bg-primary/10"],
aside a.active-link {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.18) 0%, rgba(6, 182, 212, 0.04) 100%) !important;
  border-left: 3px solid #06B6D4 !important;
  color: #38BDF8 !important;
  font-weight: 700 !important;
}

/* Precision bottom navigation: equal hit areas, safe-area aware spacing, centered dock */
nav.fixed.left-3.right-3.bottom-3 {
  width: min(calc(100vw - 28px), 480px);
  box-sizing: border-box;
  padding: 8px !important;
  gap: 2px !important;
  bottom: max(14px, env(safe-area-inset-bottom)) !important;
}

nav.fixed.left-3.right-3.bottom-3 > a {
  box-sizing: border-box;
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 52px;
  padding: 6px 3px !important;
  gap: 3px !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center;
}

nav.fixed.left-3.right-3.bottom-3 > a > svg,
nav.fixed.left-3.right-3.bottom-3 > a > span:first-child {
  flex: 0 0 auto;
}

nav.fixed.left-3.right-3.bottom-3 > a > span:last-child {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 380px) {
  nav.fixed.left-3.right-3.bottom-3 {
    width: calc(100vw - 20px);
    left: 10px;
    right: 10px;
    padding: 7px !important;
  }

  nav.fixed.left-3.right-3.bottom-3 > a {
    min-height: 50px;
    padding-inline: 2px !important;
    font-size: 0.65rem;
  }
}

@keyframes wealthwaveFadeThrough {
  0% { opacity: 0.9; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes wealthwaveShimmer {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(110%); }
}

@keyframes wealthwavePress {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.96); }
}

/* Fade through the active view, then reveal destination content from below. */
main,
[data-page],
.page-content {
  animation: wealthwaveFadeThrough 250ms ease-out both;
}

main > * {
  animation: wealthwaveFadeThrough 250ms ease-out both;
}

main > *:nth-child(1) { animation-delay: 0ms; }
main > *:nth-child(2) { animation-delay: 40ms; }
main > *:nth-child(3) { animation-delay: 80ms; }
main > *:nth-child(4) { animation-delay: 120ms; }
main > *:nth-child(5) { animation-delay: 160ms; }
main > *:nth-child(6) { animation-delay: 200ms; }

/* Use on loading cards/text blocks; dimensions come from the existing layout. */
.skeleton,
.shimmer-active,
[data-skeleton="true"],
.loading-skeleton,
.animate-pulse {
  position: relative;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12) !important;
  color: transparent !important;
  border-color: transparent !important;
  isolation: isolate;
}

.skeleton::after,
.shimmer-active::after,
[data-skeleton="true"]::after,
.loading-skeleton::after,
.animate-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.04) 30%, rgba(125, 211, 252, 0.2) 50%, rgba(255, 255, 255, 0.04) 70%, transparent 100%);
  transform: translateX(-110%);
  animation: wealthwaveShimmer 1.6s ease-in-out infinite;
}

nav.fixed a,
nav.fixed button,
button,
a[role="button"] {
  -webkit-tap-highlight-color: transparent;
  transition: transform 250ms ease-out, background-color 250ms ease-out, color 250ms ease-out, box-shadow 250ms ease-out;
}

nav.fixed a:active,
nav.fixed button:active,
button:active,
a[role="button"]:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  main, [data-page], .page-content, main > *,
  .skeleton::after, .shimmer-active::after, [data-skeleton="true"]::after,
  .loading-skeleton::after, .animate-pulse::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Form Inputs & Controls */
input, select, textarea {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #F8FAFC !important;
  border-radius: 0.85rem !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.2s ease !important;
}

input:focus, select:focus, textarea:focus {
  border-color: #06B6D4 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Primary Action Buttons */
button.bg-primary,
.btn-primary {
  background: linear-gradient(135deg, #06B6D4 0%, #0284C7 100%) !important;
  color: #070B13 !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

button.bg-primary:hover,
.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(6, 182, 212, 0.55) !important;
  transform: translateY(-1px);
}

/* Tabular figures for numbers */
.tabular-nums, table, [class*="text-2xl"], [class*="text-xl"] {
  font-variant-numeric: tabular-nums;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 11, 19, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.4);
}

/* ==========================================================================
   PWA & iOS Safari Installation UI Styles
   ========================================================================== */
#pwa-install-trigger {
  position: fixed;
  bottom: 84px;
  right: 16px;
  z-index: 9999;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.pwa-floating-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(13, 19, 33, 0.95) 0%, rgba(18, 26, 44, 0.95) 100%);
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 9999px;
  padding: 8px 16px 8px 10px;
  color: #F8FAFC;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.pwa-floating-btn:hover {
  border-color: rgba(6, 182, 212, 0.8);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 28px rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
}

.pwa-icon-glow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
  color: #070B13;
  display: grid;
  place-items: center;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.6);
  flex-shrink: 0;
}

.pwa-icon {
  width: 18px;
  height: 18px;
}

.pwa-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.pwa-btn-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.pwa-btn-sub {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 2px;
}

.pwa-close-x {
  font-size: 18px;
  line-height: 1;
  color: #64748B;
  padding: 4px;
  margin-left: 4px;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s;
}

.pwa-close-x:hover {
  color: #F8FAFC;
}

/* Modal Backdrop */
.pwa-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 16px;
  animation: pwaFadeIn 0.25s ease;
}

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

.pwa-modal-card {
  width: 100%;
  max-width: 440px;
  background: #0D1321;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(6, 182, 212, 0.2);
  border-radius: 24px;
  padding: 24px;
  color: #F8FAFC;
  position: relative;
  animation: pwaZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaZoom {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pwa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pwa-app-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-app-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
}

.pwa-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.pwa-modal-sub {
  font-size: 11px;
  color: #06B6D4;
  margin: 2px 0 0 0;
  font-weight: 600;
}

.pwa-modal-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}
.pwa-modal-close:hover {
  color: #FFFFFF;
}

.pwa-steps {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pwa-step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px 14px;
}

.pwa-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
  color: #070B13;
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.pwa-step-content {
  flex: 1;
}

.pwa-step-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 4px 0;
}

.pwa-step-desc {
  font-size: 11px;
  color: #94A3B8;
  margin: 0;
  line-height: 1.5;
}

.pwa-inline-icon {
  display: inline-flex;
  vertical-align: middle;
  padding: 2px 4px;
  background: rgba(6, 182, 212, 0.15);
  color: #06B6D4;
  border-radius: 4px;
  margin: 0 2px;
}

.pwa-ios-benefits {
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pwa-benefit-item {
  font-size: 11px;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pwa-benefit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06B6D4;
  box-shadow: 0 0 6px #06B6D4;
}

.pwa-done-btn {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
  color: #070B13;
  font-weight: 800;
  font-size: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
  transition: all 0.2s;
}

.pwa-done-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ==========================================================================
   Smooth Page Transitions & Staggered Reveal
   1. Fade Through & Staggered Reveal: 250ms ease-out duration.
   2. Cascading entry for headers, cards, tables, and lists (40ms stagger).
   ========================================================================== */

@keyframes fadeThroughReveal {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes staggerItemUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-transition-container {
  animation: fadeThroughReveal 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform;
}

/* Staggered Reveal for child elements: headers, cards, grid items, and lists */
.page-transition-container > * {
  animation: staggerItemUp 250ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-transition-container > *:nth-child(1) {
  animation-delay: 0ms;
}

.page-transition-container > *:nth-child(2) {
  animation-delay: 40ms;
}

.page-transition-container > *:nth-child(3) {
  animation-delay: 80ms;
}

.page-transition-container > *:nth-child(4) {
  animation-delay: 120ms;
}

.page-transition-container > *:nth-child(5) {
  animation-delay: 160ms;
}

.page-transition-container > *:nth-child(6) {
  animation-delay: 200ms;
}

.page-transition-container > *:nth-child(n+7) {
  animation-delay: 240ms;
}

/* Sub-card staggered reveal within grids and panels */
.page-transition-container .grid > *,
.page-transition-container .space-y-4 > *,
.page-transition-container .space-y-3\.5 > * {
  animation: staggerItemUp 250ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-transition-container .grid > *:nth-child(1),
.page-transition-container .space-y-4 > *:nth-child(1) {
  animation-delay: 40ms;
}

.page-transition-container .grid > *:nth-child(2),
.page-transition-container .space-y-4 > *:nth-child(2) {
  animation-delay: 80ms;
}

.page-transition-container .grid > *:nth-child(3),
.page-transition-container .space-y-4 > *:nth-child(3) {
  animation-delay: 120ms;
}

.page-transition-container .grid > *:nth-child(4),
.page-transition-container .space-y-4 > *:nth-child(4) {
  animation-delay: 160ms;
}

.page-transition-container .grid > *:nth-child(n+5),
.page-transition-container .space-y-4 > *:nth-child(n+5) {
  animation-delay: 200ms;
}

/* ==========================================================================
   Micro-Interactions for Menu & Buttons
   Scale 0.96 on active / pressed, smooth transition back to 1.0 on release.
   ========================================================================== */

/* Menu items (sidebar, header buttons, bottom navigation, standard buttons) */
nav a,
nav button,
aside a,
aside button,
button,
[role="button"],
.btn-interaction {
  transition: transform 140ms cubic-bezier(0.2, 0, 0, 1), background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease !important;
}

nav a:active,
nav button:active,
aside a:active,
aside button:active,
button:active:not(:disabled),
[role="button"]:active:not([aria-disabled="true"]),
.btn-interaction:active {
  transform: scale(0.96) !important;
}

/* Sidebar navigation links specific micro-bounce */
aside a:hover,
nav a:hover {
  transition: transform 160ms ease-out;
}

/* Bottom mobile navigation buttons micro-bounce */
nav.fixed a:active,
nav.fixed button:active {
  transform: scale(0.94) !important;
}

/* ==========================================================================
   Shimmer Skeleton Loading with Moving Luminous Gradient Wave
   Left-to-right gradient sweep matching cards and text layout.
   ========================================================================== */

@keyframes shimmerWave {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-skeleton,
.skeleton-box,
[data-skeleton] {
  display: inline-block;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(6, 182, 212, 0.12) 20%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(168, 85, 247, 0.12) 80%,
    rgba(255, 255, 255, 0.04) 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: shimmerWave 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

/* Card Skeleton Layout */
.skeleton-card {
  background: rgba(13, 19, 33, 0.75) !important;
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.skeleton-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(6, 182, 212, 0.07) 35%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(168, 85, 247, 0.07) 65%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmerWave 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  pointer-events: none;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(6, 182, 212, 0.14) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmerWave 1.6s infinite;
}

.skeleton-title {
  height: 20px;
  width: 45%;
  border-radius: 8px;
  margin-bottom: 12px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(6, 182, 212, 0.22) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: shimmerWave 1.6s infinite;
}

/* Transform generic spinner pages into polished shimmer loaders */
.min-h-\[60vh\]:has(.animate-spin) {
  position: relative;
  background: transparent !important;
}

/* Toast Enhanced Notification Timing & Glow */
[data-sonner-toast],
[role="status"],
[role="alert"],
.toast-glass {
  background: rgba(13, 19, 33, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.7), 0 0 16px rgba(6, 182, 212, 0.25) !important;
  border-radius: 1rem !important;
  color: #F8FAFC !important;
}

/* Ensure toast close button is always readily visible */
[toast-close],
button[toast-close] {
  opacity: 0.8 !important;
  transition: opacity 120ms ease, transform 120ms ease !important;
}

[toast-close]:hover,
button[toast-close]:hover {
  opacity: 1 !important;
  transform: scale(1.1) !important;
}



/* ==========================================================================
   Desktop & Laptop Fixed Sidebar - Precision Stacking & Interactivity
   Resolves unresponsive clicks, scrolling, and stacking issues on laptops
   ========================================================================== */
aside {
  position: relative;
  z-index: 38 !important;
  pointer-events: auto !important;
}

aside.bg-sidebar,
aside[class*="bg-sidebar"] {
  background: rgba(12, 18, 32, 0.96) !important;
  backdrop-filter: blur(24px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.5) !important;
  z-index: 38 !important;
  pointer-events: auto !important;
  border-radius: 0 !important;
  border-top: none !important;
  border-left: none !important;
  border-bottom: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.09) !important;
}

html.light aside.bg-sidebar,
html.light aside[class*="bg-sidebar"] {
  background: rgba(255, 255, 255, 0.95) !important;
  border-right-color: rgba(148, 163, 184, 0.28) !important;
  box-shadow: 4px 0 24px rgba(51, 65, 85, 0.12) !important;
  border-radius: 0 !important;
}

/* Fixed Desktop & Laptop Sidebar */
@media (min-width: 1024px) {
  aside.hidden.lg\:flex,
  aside[class*="lg:flex"] {
    display: flex !important;
    position: fixed !important;
    top: 68px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 248px !important;
    height: calc(100vh - 68px) !important;
    z-index: 38 !important;
    pointer-events: auto !important;
    border-radius: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  main {
    padding-left: 248px !important;
    position: relative !important;
    z-index: 10 !important;
  }
}

/* Ensure all link items, buttons, and icons in the sidebar receive clicks and hovers */
aside a,
aside button,
aside [role="button"],
aside .overflow-y-auto a,
aside .overflow-y-auto button {
  position: relative !important;
  z-index: 39 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  display: flex !important;
}

aside a:hover,
aside button:hover {
  background: rgba(6, 182, 212, 0.12) !important;
  color: #FFFFFF !important;
  transform: translateX(3px) !important;
}

aside a:active,
aside button:active {
  transform: scale(0.98) !important;
}

/* Active Nav Indicator */
aside a[class*="bg-primary/10"],
aside a.active-link {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.22) 0%, rgba(6, 182, 212, 0.05) 100%) !important;
  border-left: 3px solid #06B6D4 !important;
  color: #38BDF8 !important;
  font-weight: 700 !important;
}

/* Category headers in sidebar */
.sidebar-category-header {
  user-select: none;
  pointer-events: none;
}

/* Scrollbar on sidebar: easily visible and scrollable */
aside .overflow-y-auto {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(6, 182, 212, 0.35) transparent !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  pointer-events: auto !important;
}

aside .overflow-y-auto::-webkit-scrollbar {
  width: 5px !important;
}

aside .overflow-y-auto::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.35) !important;
  border-radius: 9999px !important;
}

aside .overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.7) !important;
}

/* Mobile drawer aside */
div[class*="fixed inset-0"] > aside,
.lg\:hidden aside {
  z-index: 55 !important;
  pointer-events: auto !important;
  border-radius: 0 1.25rem 1.25rem 0 !important;
}


/* --------------------------------------------------------------------------
   Smart Taksasi light-mode compatibility
   The application toggle removes `.dark` and persists `darkMode=false`.
   Keep the same WealthWave hierarchy without letting the dark foundation
   remain hard-coded on body and modal surfaces.
   -------------------------------------------------------------------------- */
html.light,
html:not(.dark) {
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222 47% 11%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 42%;
  --border: 214 32% 86%;
  --input: 214 32% 82%;
  --sidebar-background: 222 47% 99%;
  --sidebar-foreground: 222 47% 11%;
  color-scheme: light;
  background-color: hsl(var(--background));
}

html.light body,
html:not(.dark) body {
  background: #f4f7fb !important;
  color: hsl(var(--foreground)) !important;
}

html.light body::before,
html:not(.dark) body::before {
  background: radial-gradient(circle at 35% 35%, rgba(6, 182, 212, 0.10) 0%, rgba(139, 92, 246, 0.07) 45%, transparent 70%);
}

html.light body::after,
html:not(.dark) body::after {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.07) 0%, rgba(6, 182, 212, 0.04) 50%, transparent 75%);
}

html.light header.fixed,
html:not(.dark) header.fixed {
  background: rgba(255, 255, 255, 0.86) !important;
  border-bottom-color: rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 4px 20px rgba(51, 65, 85, 0.10) !important;
  color: hsl(var(--foreground)) !important;
}

html.light .card-neu,
html.light .bg-card,
html.light aside.bg-sidebar,
html.light .wealthwave-hero-card,
html:not(.dark) .card-neu,
html:not(.dark) .bg-card,
html:not(.dark) aside.bg-sidebar,
html:not(.dark) .wealthwave-hero-card {
  background: rgba(255, 255, 255, 0.88) !important;
  color: hsl(var(--card-foreground)) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 16px 36px rgba(51, 65, 85, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html.light .text-white,
html.light .text-slate-50,
html.light .text-slate-100,
html.light .text-gray-50,
html.light .text-gray-100,
html:not(.dark) .text-white,
html:not(.dark) .text-slate-50,
html:not(.dark) .text-slate-100,
html:not(.dark) .text-gray-50,
html:not(.dark) .text-gray-100 {
  color: hsl(var(--foreground)) !important;
}

html.light .text-slate-300,
html.light .text-slate-400,
html.light .text-gray-400,
html:not(.dark) .text-slate-300,
html:not(.dark) .text-slate-400,
html:not(.dark) .text-gray-400 {
  color: hsl(var(--muted-foreground)) !important;
}

html.light .mih-backdrop,
html:not(.dark) .mih-backdrop {
  background: rgba(226, 232, 240, 0.78) !important;
}

html.light .mih,
html:not(.dark) .mih {
  background: rgba(248, 250, 252, 0.97) !important;
  color: hsl(var(--foreground)) !important;
  border-color: rgba(6, 182, 212, 0.30) !important;
  box-shadow: 0 24px 80px rgba(51, 65, 85, 0.24) !important;
}

html.light .mih-card,
html:not(.dark) .mih-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

html.light .mih-card h3,
html:not(.dark) .mih-card h3,
html.light .mih-close,
html:not(.dark) .mih-close,
html.light .mih select,
html:not(.dark) .mih select,
html.light .mih button,
html:not(.dark) .mih button {
  color: hsl(var(--foreground)) !important;
}

html.light .mih-close,
html:not(.dark) .mih-close,
html.light .mih select,
html:not(.dark) .mih select,
html.light .mih button,
html:not(.dark) .mih button {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.42) !important;
}

html.light .mih button.primary,
html:not(.dark) .mih button.primary {
  background: #06b6d4 !important;
  color: #06202a !important;
  border-color: #22d3ee !important;
}

html.light .mih-preview,
html:not(.dark) .mih-preview {
  border-color: rgba(148, 163, 184, 0.32) !important;
}

html.light .mih-preview th,
html:not(.dark) .mih-preview th {
  background: #e0f2fe !important;
  color: #075985 !important;
}

html.light .mih-preview th,
html.light .mih-preview td,
html:not(.dark) .mih-preview th,
html:not(.dark) .mih-preview td {
  border-bottom-color: rgba(148, 163, 184, 0.28) !important;
}
