:root {
  --bs-font-sans-serif: 'DM Sans', sans-serif;
  --bs-body-font-family: 'DM Sans', sans-serif;
  
  /* ========================================
     SISTEMA DE DISEÑO MACRO
     Basado en Manual de Marca Oficial
     ======================================== */
  
  /* TONOS DE AZUL - Paleta principal de marca */
  /* PANTONE 2748 C - Azul Empresas / ID Empresas */
  --azul-empresas: #00237C;
  --azul-oscuro: #00237C;
  
  /* PANTONE 2935 C (primario) / 300 C (secundario) - AZUL MACRO */
  --azul-macro: #0039E3;
  
  /* PANTONE 2727 C */
  --azul-2d5fff: #2D5FFF;
  
  /* PANTONE 2718 C */
  --azul-5a89ff: #5A89FF;
  
  /* PANTONE 2707 C */
  --azul-celeste: #CFE3FF;
  
  /* PANTONE 656 C */
  --azul-claro: #E9F3FF;
  
  /* BOOTSTRAP OVERRIDES - Aplicar azul macro a componentes Bootstrap */
  --bs-primary: #0039E3;
  --bs-primary-rgb: 0, 57, 227;
  --bs-primary-text-emphasis: #001459;
  --bs-primary-bg-subtle: #ccd6fc;
  --bs-primary-border-subtle: #99adf9;
  
  /* COLORES IDENTITARIOS POR SEGMENTO */
  /* Individuos - PANTONE 231 C */
  --individuos-principal: #FF7DCB;
  --individuos-secundario: #E9F3FF; /* PANTONE 656 C */
  
  /* Agro - PANTONE 7481 C */
  --agro-principal: #24BA4E;
  --agro-secundario: #E7F2EB; /* PANTONE 7541 C */
  
  /* Empresas - PANTONE 2748 C */
  --empresas-principal: #00237C;
  --empresas-secundario: #EDEEEF; /* PANTONE 663 C */
  
  /* COLORES DE TEXTO - PANTONE 446 C */
  --texto-gris: #343F49;
  --texto-azul: #0039E3;
  --texto-blanco: #FFFFFF;
  
  /* ALIASES PARA COMPATIBILIDAD */
  --primary: var(--azul-macro);
  --primary-dark: var(--azul-empresas);
  --primary-light: var(--azul-2d5fff);
  
  --secondary: #f4ca43;
  --secondary-dark: #d4a823;
  
  --accent: var(--individuos-principal);
  
  --success: var(--agro-principal);
  --error: #ff6b7a;
  --warning: #ffa726;
  --info: var(--azul-celeste);
  
  /* ESCALA DE GRISES */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: var(--texto-gris);
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* FONDOS Y TEXTOS */
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-dark: var(--azul-empresas);
  --text-primary: var(--texto-azul);
  --text-secondary: var(--texto-gris);
  --text-light: var(--gray-400);
  
  /* Bordes y sombras */
  --border-color: var(--gray-200);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* 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 */
  --font-family: 'DM Sans', sans-serif;
  --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: 2rem;     /* 32px */
  --font-size-4xl: 2.5rem;   /* 40px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Transiciones */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Máximos anchos */
  --max-width-sm: 640px;
  --max-width-md: 768px;
  --max-width-lg: 1024px;
  --max-width-xl: 1280px;
  --max-width-2xl: 1536px;
  
  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-tooltip: 500;
}

/* Reset básico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Override Bootstrap font defaults */
.btn, .form-control, .form-label, .navbar, .nav-link, 
.card, .modal, .alert, .badge, .dropdown-menu {
  font-family: 'DM Sans', sans-serif;
}

/* Utilidades de texto */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-light); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

/* Utilidades de display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* Contenedor principal */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

@media (min-width: 640px) {
  .container { max-width: var(--max-width-sm); }
}

@media (min-width: 768px) {
  .container { max-width: var(--max-width-md); }
}

@media (min-width: 1024px) {
  .container { max-width: var(--max-width-lg); }
}

@media (min-width: 1280px) {
  .container { max-width: var(--max-width-xl); }
}
