/* =============================================================
   tokens.css — Sistema de diseño Pay v5
   Paleta: Teal + grafito neutro (banca moderna 2026)
   Soporta tema claro (por defecto) y oscuro (data-theme="dark").
   Todas las decisiones de color/espaciado/tipografía viven aquí.
   ============================================================= */

:root {
  /* ---- Marca: Teal ---- */
  --teal-50: #E6FAF7;
  --teal-100: #C5F2EB;
  --teal-200: #97E7DB;
  --teal-300: #5FD8C8;
  --teal-400: #2DC9B6;
  --teal-500: #0FB5A6;   /* primario */
  --teal-600: #0E9F92;
  --teal-700: #0B7E74;
  --teal-800: #095F58;
  --teal-900: #06433E;

  /* ---- Acento (uso puntual) ---- */
  --accent: #6C5CE7;
  --accent-soft: #ECEAFD;

  /* ---- Semánticos ---- */
  --income: #0E9F92;     /* ingresos: teal sólido */
  --expense: #FF5C5C;    /* gastos */
  --success: #16A34A;
  --warning: #F59E0B;
  --danger: #FF5C5C;
  --info: #3B82F6;

  /* ---- Paleta de categorías (8) ---- */
  --category-first: #0FB5A6;
  --category-second: #6C5CE7;
  --category-third: #F59E0B;
  --category-fourth: #FF5C5C;
  --category-fifth: #3B82F6;
  --category-sixth: #14B8A6;
  --category-seventh: #EC4899;
  --category-eighth: #22C55E;

  /* ---- Superficies y texto (TEMA CLARO) ---- */
  --bg: #FAFAFA;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F4F5;
  --surface-3: #E9EDEF;
  --surface-hover: #F0FCFA;
  --text: #1C2530;
  --text-secondary: #5B6670;
  --text-muted: #8A949C;
  --text-on-primary: #FFFFFF;
  --border: #E3E7EA;
  --border-strong: #CFD6DB;

  /* ---- Primario derivado del tema ---- */
  --primary: var(--teal-500);
  --primary-hover: var(--teal-600);
  --primary-soft: var(--teal-50);
  --on-primary: #FFFFFF;
  --gradient-primary: linear-gradient(135deg, #14C7B7 0%, #0FB5A6 55%, #0E9F92 100%);
  --gradient-card: linear-gradient(135deg, #0FB5A6 0%, #0B7E74 100%);

  /* ---- Sombras (suaves, banca) ---- */
  --shadow-xs: 0 1px 2px rgba(16, 35, 40, 0.06);
  --shadow-sm: 0 2px 8px rgba(16, 35, 40, 0.08);
  --shadow-md: 0 6px 18px rgba(16, 35, 40, 0.10);
  --shadow-lg: 0 14px 36px rgba(16, 35, 40, 0.14);
  --shadow-primary: 0 8px 24px rgba(15, 181, 166, 0.28);

  /* ---- Radios ---- */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* ---- Espaciado (escala 4px) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ---- Tipografía ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.85rem;
  --fs-base: 0.95rem;
  --fs-md: 1.05rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.6rem;
  --fs-2xl: 2.1rem;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extra: 800;

  /* ---- Transiciones ---- */
  --transition-fast: 0.15s ease;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);

  /* ---- Layout ---- */
  --content-max: 560px;       /* mobile-first, contenido centrado */
  --nav-height: 76px;
  --header-height: 64px;
  --z-nav: 900;
  --z-sheet: 1000;
  --z-toast: 1100;
}

/* ============ TEMA OSCURO ============ */
:root[data-theme="dark"] {
  --bg: #0E1417;
  --bg-elevated: #161D21;
  --surface: #161D21;
  --surface-2: #1E272C;
  --surface-3: #27333A;
  --surface-hover: #15302E;
  --text: #E8EDEF;
  --text-secondary: #A9B4BB;
  --text-muted: #6F7C84;
  --border: #27333A;
  --border-strong: #364450;

  --primary: #16C7B7;
  --primary-hover: #2DD4C2;
  --primary-soft: #0E2A28;
  --accent-soft: #211C3E;

  --gradient-card: linear-gradient(135deg, #0E9F92 0%, #095F58 100%);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.6);
  --shadow-primary: 0 8px 24px rgba(15, 181, 166, 0.32);
}

/* Si el usuario no ha elegido tema, respetar el del sistema */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0E1417;
    --bg-elevated: #161D21;
    --surface: #161D21;
    --surface-2: #1E272C;
    --surface-3: #27333A;
    --surface-hover: #15302E;
    --text: #E8EDEF;
    --text-secondary: #A9B4BB;
    --text-muted: #6F7C84;
    --border: #27333A;
    --border-strong: #364450;
    --primary: #16C7B7;
    --primary-hover: #2DD4C2;
    --primary-soft: #0E2A28;
    --accent-soft: #211C3E;
    --gradient-card: linear-gradient(135deg, #0E9F92 0%, #095F58 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.6);
  }
}
