/**
 * Spark design tokens — consumed by UI Shell and custom modules.
 * Theme Style loads this first so overrides stay predictable.
 */
:root {
  /* Brand & surfaces */
  --spark-color-primary: #6366f1;
  --spark-color-primary-hover: #4f46e5;
  --spark-color-accent: #22d3ee;
  --spark-color-surface: #ffffff;
  --spark-color-surface-muted: #f8fafc;
  --spark-color-border: rgba(15, 23, 42, 0.08);
  --spark-color-text: #0f172a;
  --spark-color-text-muted: #64748b;
  --spark-color-success: #10b981;
  --spark-color-success-soft: rgba(16, 185, 129, 0.12);
  --spark-color-warning: #f59e0b;
  --spark-color-warning-soft: rgba(245, 158, 11, 0.14);
  --spark-color-danger: #ef4444;
  --spark-color-danger-soft: rgba(239, 68, 68, 0.12);
  --spark-color-info: #0ea5e9;
  --spark-color-info-soft: rgba(14, 165, 233, 0.12);

  /* Radius & shadow */
  --spark-radius-sm: 6px;
  --spark-radius-md: 10px;
  --spark-radius-lg: 14px;
  --spark-radius-xl: 18px;
  /* Shadows: slate-tinted, single light source (down + soft ambient) */
  --spark-shadow-card: 0 1px 0 rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05),
    0 10px 32px rgba(15, 23, 42, 0.07);
  --spark-shadow-elevated: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 20px 44px rgba(15, 23, 42, 0.11);
  --spark-shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.11), 0 14px 42px rgba(99, 102, 241, 0.13);
  --spark-shadow-inner-soft: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --spark-ring-focus: 0 0 0 3px rgba(99, 102, 241, 0.24);
  --spark-ring-focus-muted: 0 0 0 2px rgba(15, 23, 42, 0.08);

  /* Type */
  --spark-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --spark-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --spark-text-xs: 0.75rem;
  --spark-text-sm: 0.8125rem;
  --spark-text-md: 0.9375rem;
  --spark-text-lg: 1.125rem;
  --spark-leading-tight: 1.25;
  --spark-leading-normal: 1.5;

  /* Motion */
  --spark-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spark-duration-fast: 140ms;
  --spark-duration-normal: 240ms;
  --spark-duration-slow: 360ms;
  --spark-ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);

  /* Chrome */
  --spark-top-progress-height: 3px;
  --spark-top-progress-bg: rgba(15, 23, 42, 0.06);
  --spark-top-progress-fill: var(--spark-color-primary);

  /* Chart (defaults; UI Shell may override per card) */
  --spark-chart-grid: rgba(15, 23, 42, 0.06);
  --spark-chart-text: var(--spark-color-text-muted);

  --spark-blur-glass: 12px;

  /* Decorative */
  --spark-gradient-ribbon: linear-gradient(
    90deg,
    var(--spark-color-primary) 0%,
    var(--spark-color-accent) 50%,
    rgba(99, 102, 241, 0.4) 100%
  );
}

/* Slightly softer defaults in dark-ish admin backgrounds */
body.admin {
  --spark-color-surface: #ffffff;
  --spark-color-surface-muted: #f1f5f9;
}
