/* Tokens de Quipu — docs/diseno.md. Claro por defecto, oscuro del sistema
   y override manual con [data-theme="light"|"dark"]. */
:root {
  color-scheme: light;

  /* Paleta andina (valores exactos del brief) */
  --bg: #F6EFE3;
  --surface: #FFFBF3;
  --ink: #2E2118;
  --ink-muted: #7A6A5A;
  --primary: #1F5F7A;
  --expense: #B5472F;
  --income: #4F7A3D;
  --accent: #E0A526;
  --border: #E4D7C2;

  /* Derivados de superficie y estado */
  --surface-2: #F1E7D6;
  --surface-3: #E9DCC7;
  --ink-soft: #665647;
  --surface-raised: #FFFDF8;
  --on-primary: #FFFBF3;
  --on-expense: #FFFBF3;
  --on-income: #FFFBF3;
  --danger: #9C2F1C;
  --warning: #8A5A08;
  --focus: #1F5F7A;
  --overlay: rgba(46, 33, 24, 0.48);
  --shadow-color: 46 33 24;
  --shadow-1: 0 1px 2px rgb(var(--shadow-color) / 0.08), 0 6px 18px rgb(var(--shadow-color) / 0.06);
  --shadow-2: 0 2px 4px rgb(var(--shadow-color) / 0.1), 0 20px 44px rgb(var(--shadow-color) / 0.14);

  /* Categorías en el orden fijo de docs/diseno.md */
  --cat-alimentos: #E0A526;
  --cat-transporte: #1F5F7A;
  --cat-actividades: #6B3F7A;
  --cat-educacion: #3E7C6B;
  --cat-estetica: #C46A8A;
  --cat-objetos: #8A6A4B;
  --cat-salud: #B5472F;
  --cat-legales: #5B6B7A;
  --cat-varios: #A89F91;

  /* Categorías de ingreso (reutilizan la paleta) */
  --cat-sueldo: #4F7A3D;
  --cat-venta: #3E7C6B;
  --cat-regalo: #C46A8A;
  --cat-otros: #A89F91;

  /* Escala de espacio: 4 px */
  --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;
  --space-16: 64px;

  /* Radios y tipografía */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --leading-tight: 1.15;
  --leading: 1.5;

  /* Layout y movimiento */
  --frame-w: 480px;
  --aside-w: 320px;
  --nav-h: 76px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 140ms;
  --dur: 200ms;
  --dur-sheet: 280ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1C1510;
    --surface: #2A2018;
    --ink: #F1E7D8;
    --ink-muted: #B5A58F;
    --primary: #4FA3C2;
    --expense: #E0735A;
    --income: #86B56E;
    --accent: #F0BC47;
    --border: #43362A;
    --surface-2: #35291F;
    --surface-3: #403226;
    --ink-soft: #C9BBA7;
    --surface-raised: #30251C;
    --on-primary: #0E2028;
    --on-expense: #2A0F09;
    --on-income: #14230E;
    --danger: #F08A72;
    --warning: #F0BC47;
    --focus: #F0BC47;
    --overlay: rgba(0, 0, 0, 0.62);
    --shadow-color: 0 0 0;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.28), 0 8px 22px rgb(0 0 0 / 0.2);
    --shadow-2: 0 2px 4px rgb(0 0 0 / 0.32), 0 24px 50px rgb(0 0 0 / 0.36);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1C1510;
  --surface: #2A2018;
  --ink: #F1E7D8;
  --ink-muted: #B5A58F;
  --primary: #4FA3C2;
  --expense: #E0735A;
  --income: #86B56E;
  --accent: #F0BC47;
  --border: #43362A;
  --surface-2: #35291F;
  --surface-3: #403226;
  --ink-soft: #C9BBA7;
  --surface-raised: #30251C;
  --on-primary: #0E2028;
  --on-expense: #2A0F09;
  --on-income: #14230E;
  --danger: #F08A72;
  --warning: #F0BC47;
  --focus: #F0BC47;
  --overlay: rgba(0, 0, 0, 0.62);
  --shadow-color: 0 0 0;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.28), 0 8px 22px rgb(0 0 0 / 0.2);
  --shadow-2: 0 2px 4px rgb(0 0 0 / 0.32), 0 24px 50px rgb(0 0 0 / 0.36);
}

:root[data-theme="light"] {
  color-scheme: light;
}
