/* ============================================
   Auto Motion PRO - World-Class Design System
   v2.0 - Premium UI/UX with Animations
   Inspired by Figma, Vercel, Linear, Stripe
   ============================================ */

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

:root {
  /* Core palette */
  --bg: #f8fafc;
  --panel: #ffffff;
  --card: #f1f5f9;
  --border: #e2e8f0;
  --ink: #0f172a;
  --muted: #475569;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --white: #ffffff;
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --yellow: #eab308;
  --yellow-light: #fef9c3;
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;

  /* Animation tokens */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.15s;
  --dur-normal: 0.3s;
  --dur-slow: 0.5s;
  --dur-slower: 0.8s;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.04);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 16px;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ============================================
   SCROLLBAR - Premium slim style
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 9999px;
  border: 2px solid var(--bg);
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover { background: var(--slate-900); }

/* ============================================
   SELECTION
   ============================================ */
::selection {
  background: var(--slate-900);
  color: var(--white);
}

/* ============================================
   ANIMATIONS - Keyframes Library
   ============================================ */

/* Fade entrance */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Slide up entrance */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Slide down entrance */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Slide in from left */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Scale in entrance */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Scale in with bounce (spring) */
@keyframes scaleInBounce {
  0% { opacity: 0; transform: scale(0.8); }
  60% { opacity: 1; transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Blur entrance */
@keyframes blurIn {
  from { opacity: 0; filter: blur(12px); transform: scale(1.04); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

/* Stagger reveal - for lists/grids */
@keyframes staggerReveal {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Pulse glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
}

/* Pulse dot */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Shimmer (skeleton loading) */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Float slow */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-12px) rotate(2deg); }
  66% { transform: translateY(6px) rotate(-1deg); }
}

/* Rotate gradient */
@keyframes rotateGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Count up */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Celebration bounce */
@keyframes celebrate {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Confetti fall */
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Ripple effect */
@keyframes ripple {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(4); opacity: 0; }
}

/* Gradient shift */
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Spin */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Wiggle */
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* Progress bar fill */
@keyframes progressFill {
  from { width: 0%; }
  to { width: var(--target-width, 100%); }
}

/* Typewriter cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Ring expand */
@keyframes ringExpand {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ============================================
   ANIMATION UTILITY CLASSES
   ============================================ */
.anim-fade-in { animation: fadeIn var(--dur-slow) var(--ease-out-expo) both; }
.anim-slide-up { animation: slideUp var(--dur-slow) var(--ease-out-expo) both; }
.anim-slide-down { animation: slideDown var(--dur-slow) var(--ease-out-expo) both; }
.anim-slide-left { animation: slideInLeft var(--dur-slow) var(--ease-out-expo) both; }
.anim-slide-right { animation: slideInRight var(--dur-slow) var(--ease-out-expo) both; }
.anim-scale-in { animation: scaleIn var(--dur-normal) var(--ease-spring) both; }
.anim-scale-bounce { animation: scaleInBounce var(--dur-slow) var(--ease-spring) both; }
.anim-blur-in { animation: blurIn var(--dur-slow) var(--ease-out-expo) both; }

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

/* Scroll reveal */
.scroll-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--dur-slow) var(--ease-out-expo), transform var(--dur-slow) var(--ease-out-expo);
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   GLASSMORPHISM
   ============================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* ============================================
   GRADIENT MESH BACKGROUNDS
   ============================================ */
.gradient-mesh {
  background:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.08), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.08), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(22, 163, 74, 0.06), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(234, 179, 8, 0.06), transparent 50%),
    var(--bg);
}

.gradient-mesh-dark {
  background:
    radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.15), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.15), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(22, 163, 74, 0.1), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(234, 179, 8, 0.1), transparent 50%),
    var(--slate-900);
}

.gradient-text {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-600) 50%, var(--slate-900) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s var(--ease-smooth) infinite;
}

.gradient-text-purple {
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 50%, var(--purple) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s var(--ease-smooth) infinite;
}

/* ============================================
   HEADER - Glassmorphism sticky nav
   ============================================ */
.clean-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--dur-normal) var(--ease-smooth);
}
.clean-header.scrolled {
  box-shadow: var(--shadow-sm);
}

/* ============================================
   BUTTONS - Premium with micro-interactions
   ============================================ */
.btn-primary {
  background: var(--white);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0px var(--ink);
  transition: all var(--dur-fast) var(--ease-out-expo);
  cursor: pointer;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover {
  background: var(--slate-100);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px var(--ink);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--ink);
}

/* Ripple effect on buttons */
.btn-primary::after, .btn-dark::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.btn-primary:active::after, .btn-dark:active::after {
  width: 300px; height: 300px;
}

.btn-dark {
  background: var(--slate-900);
  color: var(--white);
  border: 2px solid var(--slate-900);
  cursor: pointer;
  font-weight: 700;
  transition: all var(--dur-fast) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}
.btn-dark:hover {
  background: var(--slate-800);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
}
.btn-dark:active { transform: translateY(0); }

.btn-outline {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--slate-300);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--dur-fast) var(--ease-out-expo);
}
.btn-outline:hover {
  background: var(--slate-50);
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Gradient button */
.btn-gradient {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-700) 100%);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: all var(--dur-fast) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}
.btn-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-smooth);
}
.btn-gradient:hover::before { opacity: 1; }
.btn-gradient span { position: relative; z-index: 1; }
.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

/* Glow button */
.btn-glow {
  background: var(--slate-900);
  color: var(--white);
  border: 2px solid var(--slate-900);
  cursor: pointer;
  font-weight: 700;
  transition: all var(--dur-normal) var(--ease-out-expo);
  position: relative;
}
.btn-glow:hover {
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1), 0 0 30px rgba(15, 23, 42, 0.2);
  transform: translateY(-2px);
}

/* ============================================
   CARDS - Premium with hover lift
   ============================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-normal) var(--ease-out-expo);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-active {
  border: 2px solid var(--ink);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

/* Card with gradient border on hover */
.card-gradient-hover {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  transition: all var(--dur-normal) var(--ease-out-expo);
}
.card-gradient-hover::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--purple), var(--blue), var(--green));
  opacity: 0;
  z-index: -1;
  transition: opacity var(--dur-normal) var(--ease-smooth);
}
.card-gradient-hover:hover::before { opacity: 1; }
.card-gradient-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   BADGES - With subtle animation
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  transition: transform var(--dur-fast) var(--ease-smooth);
}
.badge:hover { transform: scale(1.05); }
.badge-dark { background: var(--slate-900); color: var(--white); }
.badge-light { background: var(--slate-100); color: var(--slate-900); border: 1px solid var(--slate-300); }
.badge-green { background: var(--green-light); color: #166534; border: 1px solid #bbf7d0; }
.badge-red { background: var(--red-light); color: #991b1b; border: 1px solid #fecaca; }
.badge-yellow { background: var(--yellow-light); color: #854d0e; border: 1px solid #fde68a; }
.badge-blue { background: var(--blue-light); color: #1e40af; border: 1px solid #93c5fd; }
.badge-purple { background: var(--purple-light); color: #6b21a8; border: 1px solid #c4b5fd; }

/* Live badge with pulsing dot */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono';
  background: var(--green-light);
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge-live .live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulseDot 2s ease-in-out infinite;
}

/* ============================================
   TABLES - Premium with row animations
   ============================================ */
.table-clean {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table-clean thead tr {
  border-bottom: 1px solid var(--border);
  color: var(--slate-500);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
}
.table-clean th { padding: 10px 8px; text-align: left; letter-spacing: 0.05em; }
.table-clean td { padding: 12px 8px; }
.table-clean tbody tr {
  border-bottom: 1px solid var(--border);
  transition: all var(--dur-fast) var(--ease-smooth);
}
.table-clean tbody tr:hover {
  background: var(--slate-50);
  transform: translateX(2px);
}

/* ============================================
   INPUTS - With focus glow
   ============================================ */
.input-clean {
  width: 100%;
  background: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all var(--dur-fast) var(--ease-out-expo);
}
.input-clean:focus {
  border-color: var(--ink);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}
.input-clean::placeholder { color: var(--slate-400); }

.select-clean {
  width: 100%;
  background: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out-expo);
}
.select-clean:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

/* Floating label input */
.floating-label {
  position: relative;
}
.floating-label input,
.floating-label select {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--slate-300);
  border-radius: 12px;
  padding: 18px 14px 8px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all var(--dur-fast) var(--ease-out-expo);
}
.floating-label label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--slate-400);
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease-out-expo);
}
.floating-label input:focus,
.floating-label input:not(:placeholder-shown) {
  border-color: var(--ink);
}
.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

/* ============================================
   KPI CARDS - With animated counter
   ============================================ */
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-normal) var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--slate-900), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out-expo);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.kpi-card:hover::before { transform: scaleX(1); }

.kpi-label { font-size: 12px; color: var(--slate-500); font-weight: 500; margin-bottom: 6px; }
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}
.kpi-sub { font-size: 11px; color: var(--slate-600); margin-top: 4px; }
.kpi-trend-up { color: var(--green); }
.kpi-trend-down { color: var(--red); }

/* KPI card with accent */
.kpi-accent-green { border-top: 3px solid var(--green); }
.kpi-accent-blue { border-top: 3px solid var(--blue); }
.kpi-accent-purple { border-top: 3px solid var(--purple); }
.kpi-accent-yellow { border-top: 3px solid var(--yellow); }

/* ============================================
   TOAST - Premium slide-in
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px) scale(0.9);
  opacity: 0;
  transition: all var(--dur-slow) var(--ease-spring);
  pointer-events: none;
  max-width: 400px;
}
.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.toast .toast-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--green-light); color: var(--green); }
.toast.error .toast-icon { background: var(--red-light); color: var(--red); }
.toast.info .toast-icon { background: var(--blue-light); color: var(--blue); }

/* ============================================
   MODAL - Premium with blur & scale
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn var(--dur-normal) var(--ease-smooth);
}
.modal-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  animation: scaleInBounce var(--dur-slow) var(--ease-spring) both;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--slate-100) 0%,
    var(--slate-200) 50%,
    var(--slate-100) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-card { height: 100px; border-radius: 16px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }

/* ============================================
   SPINNER - Premium dual ring
   ============================================ */
.spinner {
  width: 40px;
  height: 40px;
  position: relative;
}
.spinner::before,
.spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}
.spinner::before {
  border-top-color: var(--slate-900);
  animation: spin 0.8s var(--ease-smooth) infinite;
}
.spinner::after {
  border-bottom-color: var(--slate-300);
  animation: spin 1.2s var(--ease-smooth) infinite reverse;
}

/* Small spinner */
.spinner-sm { width: 20px; height: 20px; }
.spinner-sm::before { border-width: 2px; }
.spinner-sm::after { border-width: 2px; }

/* ============================================
   PROGRESS BAR - Animated fill
   ============================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--slate-200);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--slate-900), var(--slate-700));
  border-radius: 9999px;
  transition: width var(--dur-slow) var(--ease-out-expo);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

/* Circular progress */
.circular-progress {
  position: relative;
  width: 120px;
  height: 120px;
}
.circular-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.circular-progress .progress-ring {
  fill: none;
  stroke: var(--slate-200);
  stroke-width: 8;
}
.circular-progress .progress-ring-fill {
  fill: none;
  stroke: var(--slate-900);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease-out-expo);
}

/* ============================================
   DIVIDER - Gradient
   ============================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--slate-200), transparent);
  border: none;
  margin: 24px 0;
}

/* ============================================
   LAYOUT HELPERS
   ============================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.col-span-7 { grid-column: span 7; }
.col-span-5 { grid-column: span 5; }
.col-span-8 { grid-column: span 8; }
.col-span-4 { grid-column: span 4; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-12 { grid-template-columns: 1fr; }
  .col-span-7, .col-span-5, .col-span-8, .col-span-4 { grid-column: span 1; }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.text-2xl { font-size: 32px; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-center { text-align: center; }
.text-slate-500 { color: var(--slate-500); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-900 { color: var(--ink); }
.text-green-600 { color: var(--green); }
.text-red-600 { color: var(--red); }
.text-blue-600 { color: var(--blue); }
.text-purple-600 { color: var(--purple); }
.bg-slate-50 { background: var(--slate-50); }
.bg-slate-100 { background: var(--slate-100); }
.bg-slate-900 { background: var(--slate-900); color: var(--white); }
.bg-green-50 { background: var(--green-light); }
.bg-red-50 { background: var(--red-light); }
.bg-blue-50 { background: var(--blue-light); }
.bg-purple-50 { background: var(--purple-light); }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border); }
.border-slate-900 { border: 2px solid var(--ink); }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.w-full { width: 100%; }
.hidden { display: none; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }

/* Cursor pointer */
.cursor-pointer { cursor: pointer; }

/* Truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Transition defaults */
.transition-all { transition: all var(--dur-normal) var(--ease-out-expo); }
.transition-transform { transition: transform var(--dur-normal) var(--ease-out-expo); }

/* ============================================
   FLOATING ELEMENTS
   ============================================ */
.float-anim { animation: float 4s ease-in-out infinite; }
.float-slow-anim { animation: floatSlow 6s ease-in-out infinite; }

/* ============================================
   PAGE TRANSITION
   ============================================ */
.page-enter {
  animation: slideUp var(--dur-slower) var(--ease-out-expo) both;
}

/* ============================================
   CONFETTI
   ============================================ */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 10000;
  pointer-events: none;
  animation: confettiFall 3s linear forwards;
}
.confetti:nth-child(1) { left: 10%; background: var(--purple); animation-delay: 0s; }
.confetti:nth-child(2) { left: 20%; background: var(--blue); animation-delay: 0.1s; }
.confetti:nth-child(3) { left: 30%; background: var(--green); animation-delay: 0.2s; }
.confetti:nth-child(4) { left: 40%; background: var(--yellow); animation-delay: 0.3s; }
.confetti:nth-child(5) { left: 50%; background: var(--red); animation-delay: 0.4s; }
.confetti:nth-child(6) { left: 60%; background: var(--purple); animation-delay: 0.5s; }
.confetti:nth-child(7) { left: 70%; background: var(--blue); animation-delay: 0.6s; }
.confetti:nth-child(8) { left: 80%; background: var(--green); animation-delay: 0.7s; }
.confetti:nth-child(9) { left: 90%; background: var(--yellow); animation-delay: 0.8s; }
.confetti:nth-child(10) { left: 15%; background: var(--red); animation-delay: 0.9s; }

/* ============================================
   ACCORDION
   ============================================ */
.accordion-item {
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.accordion-header {
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--dur-fast) var(--ease-smooth);
}
.accordion-header:hover { background: var(--slate-50); }
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-out-expo);
}
.accordion-item.open .accordion-content { max-height: 500px; }
.accordion-item.open .accordion-arrow { transform: rotate(180deg); }
.accordion-arrow { transition: transform var(--dur-normal) var(--ease-smooth); }

/* ============================================
   TABS - Underline animation
   ============================================ */
.tabs-underline {
  display: flex;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.tab-item {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-500);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-smooth);
  position: relative;
}
.tab-item.active { color: var(--ink); }
.tab-item::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--ink);
  transition: transform var(--dur-normal) var(--ease-spring);
}
.tab-item.active::after { transform: translateX(-50%) scaleX(1); }
.tab-item:hover { color: var(--ink); }

/* ============================================
   TOOLTIP
   ============================================ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--slate-900);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-smooth);
  z-index: 1000;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ============================================
   DOT INDICATOR
   ============================================ */
.dot-indicator {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.dot-green { background: var(--green); animation: pulseDot 2s infinite; }
.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-slate { background: var(--slate-400); }

/* ============================================
   CODE BLOCK
   ============================================ */
.code-block {
  background: var(--slate-900);
  color: var(--slate-300);
  border-radius: 12px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  overflow-x: auto;
  position: relative;
}
.code-block::before {
  content: '';
  position: absolute;
  top: 12px; left: 12px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 18px 0 0 #ffbd2e, 36px 0 0 #27c93f;
}

/* ============================================
   SWITCH TOGGLE
   ============================================ */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--slate-300);
  border-radius: 9999px;
  transition: background var(--dur-normal) var(--ease-smooth);
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--dur-normal) var(--ease-spring);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-slider { background: var(--slate-900); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
