/* ═══════════════════════════════════════════
   DESIGN TOKENS — PALETA DE COLORES
   Naranja: #E8722A | Azul oscuro: #2C3E50
   Azul grisáceo: #5D7A94 | Azul claro: #D6E8F4
   Azul brillante: #29A9E1
═══════════════════════════════════════════ */

:root {
  /* Colores primarios */
  --color-primary: #E8722A;
  --color-primary-hover: #d4641e;
  --color-primary-light: #fef0e8;
  --color-primary-alpha: rgba(232, 114, 42, 0.12);

  /* Sidebar / Dark */
  --color-dark: #2C3E50;
  --color-dark-hover: #243444;
  --color-dark-lighter: #364f67;

  /* Azul grisáceo */
  --color-blue-gray: #5D7A94;
  --color-blue-gray-light: #7a9ab0;

  /* Azul claro */
  --color-blue-light: #D6E8F4;
  --color-blue-lighter: #eaf4fb;

  /* Azul brillante (acento) */
  --color-accent: #29A9E1;
  --color-accent-hover: #1a9bd4;
  --color-accent-light: rgba(41, 169, 225, 0.12);

  /* Semánticos */
  --color-success: #27AE60;
  --color-success-light: #eafaf1;
  --color-danger: #E74C3C;
  --color-danger-light: #fdf2f2;
  --color-warning: #F39C12;
  --color-warning-light: #fef9ec;
  --color-info: #29A9E1;
  --color-info-light: #eaf7fc;

  /* Neutros */
  --color-white: #FFFFFF;
  --color-bg: #F5F8FA;
  --color-bg-card: #FFFFFF;
  --color-border: #E2EAF0;
  --color-border-light: #EEF3F7;

  /* Textos */
  --color-text-primary: #1A2633;
  --color-text-secondary: #5D7A94;
  --color-text-muted: #9BB0C0;
  --color-text-inverse: #FFFFFF;

  /* Sidebar */
  --sidebar-bg: #2C3E50;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-active: #FFFFFF;
  --sidebar-active-bg: rgba(232, 114, 42, 0.15);
  --sidebar-active-border: #E8722A;
  --sidebar-hover-bg: rgba(255,255,255,0.06);
  --sidebar-width: 240px;

  /* Header */
  --header-height: 64px;

  /* Tipografía */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 0.6875rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.25rem;

  /* Espaciados */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);

  /* Transiciones */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* TEMA OSCURO */
body.theme-dark {
  --color-bg: #131B24;
  --color-bg-card: #1C2733;
  --color-border: #253040;
  --color-border-light: #1E2A38;
  --color-text-primary: #E8EDF2;
  --color-text-secondary: #8FAEC3;
  --color-text-muted: #526A7F;
  --color-primary-light: rgba(232, 114, 42, 0.12);
  --color-blue-lighter: rgba(41, 169, 225, 0.08);
  --color-success-light: rgba(39, 174, 96, 0.12);
  --color-danger-light: rgba(231, 76, 60, 0.12);
  --color-warning-light: rgba(243, 156, 18, 0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.30);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.35);
}

/* ═══════════════════════════════════════════
   RESET Y BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ═══════════════════════════════════════════
   SCROLLBAR PERSONALIZADA
═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ═══════════════════════════════════════════
   UTILIDADES
═══════════════════════════════════════════ */
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-secondary { color: var(--color-text-secondary) !important; }
.text-accent { color: var(--color-accent) !important; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.visible { display: block !important; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ═══════════════════════════════════════════
   ANIMACIONES
═══════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn var(--transition-slow) ease forwards; }
.animate-scale-in { animation: scaleIn var(--transition-base) ease forwards; }
