/* ==========================================================================
   TEMA — Tokens de diseño
   ==========================================================================

   Este archivo es lo ÚNICO que hay que tocar para cambiarle el aspecto al
   sistema. app.css no tiene ni un color escrito a mano: todo sale de acá.

   Para cambiar la paleta tenés dos caminos:

   1. Editar la rampa `--brand-*` de :root. Son 10 valores.
   2. Poner `palette` en app/Config/Theme.php con una de las alternativas
      definidas más abajo (`indigo`, `violet`). No hay que tocar CSS.

   Bootstrap 5.3 expone sus propias variables (--bs-*) pero, en los
   componentes, las resuelve con colores literales en tiempo de compilación.
   Por eso app.css las reasigna apuntando a estos tokens: es la forma de
   re-teñir Bootstrap sin recompilar Sass ni instalar Node.
   ========================================================================== */

:root {
    /* ----------------------------------------------------------------------
       Color de marca — verde azulado
       Elegido por sobre el azul por defecto de Bootstrap: lee institucional
       y serio, y no se confunde con los enlaces del navegador.
       ---------------------------------------------------------------------- */
    --brand-50:  #f0fdfa;
    --brand-100: #ccfbf1;
    --brand-200: #99f6e4;
    --brand-300: #5eead4;
    --brand-400: #2dd4bf;
    --brand-500: #14b8a6;
    --brand-600: #0d9488;
    --brand-700: #0f766e;
    --brand-800: #115e59;
    --brand-900: #134e4a;

    /* ----------------------------------------------------------------------
       Neutros
       Grises con una pizca de azul. Los grises puros se ven sucios al lado
       de un acento saturado.
       ---------------------------------------------------------------------- */
    --neutral-50:  #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* ----------------------------------------------------------------------
       Colores semánticos
       Nombrados por lo que significan, no por cómo se ven. El día que el
       "peligro" deje de ser rojo, se cambia acá y no en 40 vistas.
       ---------------------------------------------------------------------- */
    --success:      #15803d;
    --success-bg:   #dcfce7;
    --success-text: #14532d;

    --danger:       #b91c1c;
    --danger-bg:    #fee2e2;
    --danger-text:  #7f1d1d;

    --warning:      #b45309;
    --warning-bg:   #fef3c7;
    --warning-text: #78350f;

    --info:         #0369a1;
    --info-bg:      #e0f2fe;
    --info-text:    #0c4a6e;

    /* Verde de marca de Excel: identifica las descargas de planilla. */
    --excel: #1d6f42;

    /* ----------------------------------------------------------------------
       Superficies y texto
       ---------------------------------------------------------------------- */
    --surface:         #ffffff;
    --surface-sunken:  var(--neutral-50);
    --surface-raised:  #ffffff;
    --surface-inverse: var(--neutral-900);

    --border:        var(--neutral-200);
    --border-strong: var(--neutral-300);

    --text:         var(--neutral-800);
    --text-muted:   var(--neutral-500);
    --text-subtle:  var(--neutral-400);
    --text-inverse: #ffffff;

    --link:       var(--brand-700);
    --link-hover: var(--brand-800);

    /* ----------------------------------------------------------------------
       Tipografía
       Stack del sistema: cero descargas, cero parpadeo al cargar la fuente.
       Es la decisión más barata que existe para que una página cargue rápido.
       ---------------------------------------------------------------------- */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
                 Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
                 "Liberation Mono", Menlo, monospace;

    --text-xs:   0.75rem;
    --text-sm:   0.8125rem;
    --text-base: 0.875rem;
    --text-md:   1rem;
    --text-lg:   1.125rem;
    --text-xl:   1.375rem;
    --text-2xl:  1.75rem;

    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semi:   600;
    --weight-bold:   700;

    --leading-tight: 1.25;
    --leading-base:  1.55;

    /* ----------------------------------------------------------------------
       Espaciado — escala de 4px
       ---------------------------------------------------------------------- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* ----------------------------------------------------------------------
       Radios y sombras
       Sombras de baja opacidad y tintadas con el neutro, no negro puro:
       el negro sobre color claro se ve como suciedad.
       ---------------------------------------------------------------------- */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);

    --ring: 0 0 0 3px rgba(13, 148, 136, 0.25);

    /* ----------------------------------------------------------------------
       Layout
       ---------------------------------------------------------------------- */
    --sidebar-width:           250px;
    --sidebar-width-collapsed:  68px;
    --topbar-height:            60px;
    --content-max:            1440px;

    --transition-fast: 120ms ease;
    --transition-base: 200ms ease;

    --z-sidebar: 1030;
    --z-topbar:  1020;
    --z-overlay: 1040;
}

/* ==========================================================================
   Paletas alternativas
   Se activan desde app/Config/Theme.php. Solo redefinen la rampa de marca:
   los neutros, los semánticos y la forma quedan igual.
   ========================================================================== */

[data-palette="indigo"] {
    --brand-50:  #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-300: #a5b4fc;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-800: #3730a3;
    --brand-900: #312e81;

    --ring: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

[data-palette="violet"] {
    --brand-50:  #faf5ff;
    --brand-100: #f3e8ff;
    --brand-200: #e9d5ff;
    --brand-300: #d8b4fe;
    --brand-400: #c084fc;
    --brand-500: #a855f7;
    --brand-600: #9333ea;
    --brand-700: #7e22ce;
    --brand-800: #6b21a8;
    --brand-900: #581c87;

    --ring: 0 0 0 3px rgba(147, 51, 234, 0.25);
}

/* ==========================================================================
   Accesibilidad
   Respetar la preferencia del sistema no es un extra: hay gente que la activa
   porque el movimiento le produce mareo.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0ms;
        --transition-base: 0ms;
    }
}
