:root {
  --background: 216 33% 97%;
  --foreground: 222 34% 14%;
  --primary: 215 88% 52%;
  --secondary: 271 80% 58%;
  --muted: 215 24% 92%;
  --destructive: 0 78% 58%;
  --border: 215 25% 84%;
  --card: 0 0% 100%;

  --shadow-sm: 0 8px 20px hsla(220, 50%, 20%, 0.08);
  --shadow-md: 0 18px 40px hsla(220, 55%, 18%, 0.12);
  --shadow-lg: 0 28px 70px hsla(220, 60%, 14%, 0.16);

  --transition-fast: 140ms ease;
  --transition-smooth: 260ms cubic-bezier(0.2, 0.8, 0.2, 1);

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
}

.dark {
  --background: 225 30% 8%;
  --foreground: 210 33% 96%;
  --primary: 211 92% 62%;
  --secondary: 271 84% 68%;
  --muted: 223 22% 16%;
  --destructive: 0 82% 64%;
  --border: 223 18% 24%;
  --card: 223 24% 12%;

  --shadow-sm: 0 8px 18px hsla(220, 70%, 2%, 0.28);
  --shadow-md: 0 18px 40px hsla(220, 70%, 2%, 0.36);
  --shadow-lg: 0 30px 70px hsla(220, 70%, 2%, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, hsla(215, 88%, 52%, 0.12), transparent 32%),
    radial-gradient(circle at top right, hsla(271, 80%, 58%, 0.10), transparent 28%),
    hsl(var(--background));
}

#root {
  min-height: 100vh;
}

.card-surface {
  background: linear-gradient(180deg, hsla(0, 0%, 100%, 0.92), hsla(0, 0%, 100%, 0.86));
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.dark .card-surface {
  background: linear-gradient(180deg, hsla(223, 24%, 14%, 0.92), hsla(223, 24%, 12%, 0.88));
}

.glow-ring {
  position: relative;
}

.glow-ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, hsla(215, 88%, 52%, 0.34), hsla(271, 80%, 58%, 0.18));
  z-index: -1;
  filter: blur(18px);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.glow-ring:hover::after {
  opacity: 1;
}

.grid-pattern {
  background-image:
    linear-gradient(hsla(215, 20%, 60%, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, hsla(215, 20%, 60%, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
}

.metric-positive {
  color: hsl(145 72% 36%);
}

.metric-negative {
  color: hsl(var(--destructive));
}

.metric-neutral {
  color: hsl(var(--foreground));
  opacity: 0.75;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: hsla(220, 20%, 50%, 0.24);
  border-radius: 999px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

button,
a {
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

button:active {
  transform: translateY(1px) scale(0.995);
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: hsl(var(--muted));
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.52), transparent);
  animation: shimmer 1.3s infinite;
}

.dark .skeleton::after {
  background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.12), transparent);
}

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