/**
 * SISTEMA DE VARIABLES UNIFICADO
 * Finance Agent + Gestión de Taller
 *
 * Este archivo contiene todas las variables CSS unificadas para
 * mantener consistencia visual entre ambos módulos del sistema.
 */

:root {
  /* ============================================
     COLORES PRIMARIOS UNIFICADOS
     ============================================ */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-light: #dbeafe;
  --color-primary-dark: #1e40af;

  /* ============================================
     COLORES SECUNDARIOS
     ============================================ */
  --color-secondary: #6366f1;
  --color-secondary-hover: #4f46e5;
  --color-secondary-light: #e0e7ff;

  /* ============================================
     COLORES DE ESTADO
     ============================================ */
  --color-success: #10b981;
  --color-success-hover: #059669;
  --color-success-light: #d1fae5;
  --color-success-dark: #065f46;

  --color-warning: #f59e0b;
  --color-warning-hover: #d97706;
  --color-warning-light: #fef3c7;
  --color-warning-dark: #92400e;

  --color-error: #ef4444;
  --color-error-hover: #dc2626;
  --color-error-light: #fee2e2;
  --color-error-dark: #991b1b;

  --color-info: #3b82f6;
  --color-info-hover: #2563eb;
  --color-info-light: #dbeafe;
  --color-info-dark: #1e40af;

  /* ============================================
     FONDOS - TEMA CLARO (DEFAULT)
     ============================================ */
  --bg-main: #f9fafb;
  --bg-secondary: #f3f4f6;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f9fafb;
  --bg-overlay: rgba(0, 0, 0, 0.5);

  /* ============================================
     TEXTOS - TEMA CLARO
     ============================================ */
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-disabled: #d1d5db;
  --text-on-primary: #ffffff;

  /* ============================================
     BORDES
     ============================================ */
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --border-dark: #d1d5db;
  --border-focus: var(--color-primary);

  /* ============================================
     SOMBRAS
     ============================================ */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* ============================================
     ESPACIADO
     ============================================ */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */

  /* ============================================
     TIPOGRAFÍA UNIFICADA
     ============================================ */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Courier New', monospace;

  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ============================================
     BORDER RADIUS
     ============================================ */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;  /* Círculo */

  /* ============================================
     TRANSICIONES
     ============================================ */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ============================================
     Z-INDEX
     ============================================ */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;

  /* ============================================
     LAYOUT
     ============================================ */
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --header-height: 64px;
  --max-content-width: 1400px;
}

/* ============================================
   TEMA OSCURO
   ============================================ */
[data-theme="dark"] {
  /* Colores primarios (ajustados para mejor contraste) */
  --color-primary: #60a5fa;
  --color-primary-hover: #3b82f6;
  --color-primary-light: #1e3a8a;
  --color-primary-dark: #93c5fd;

  /* Fondos oscuros */
  --bg-main: #0f172a;
  --bg-secondary: #1e293b;
  --bg-surface: #1e293b;
  --bg-sidebar: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --bg-overlay: rgba(0, 0, 0, 0.75);

  /* Textos claros */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-disabled: #64748b;
  --text-on-primary: #0f172a;

  /* Bordes oscuros */
  --border-color: #334155;
  --border-light: #1e293b;
  --border-dark: #475569;

  /* Sombras más sutiles */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);

  /* Estados en tema oscuro */
  --color-success: #22c55e;
  --color-warning: #fbbf24;
  --color-error: #f87171;
  --color-info: #60a5fa;
}

/* ============================================
   COLORES GRISES (Útiles para ambos temas)
   ============================================ */
:root {
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

/* ============================================
   UTILIDADES RÁPIDAS
   ============================================ */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }

.bg-primary { background-color: var(--color-primary) !important; }
.bg-success { background-color: var(--color-success) !important; }
.bg-warning { background-color: var(--color-warning) !important; }
.bg-error { background-color: var(--color-error) !important; }

.border-primary { border-color: var(--color-primary) !important; }
.border-error { border-color: var(--color-error) !important; }
