/* ===================================
   SANNA CLÍNICA BELÉN - PORTAL WEB
   Sistema Integral de Atención Ambulatoria
   =================================== */

/* === ROOT VARIABLES === */
:root {
    /* ========================================
       PALETA DE COLORES SEMÁNTICA - MEJORADA
       ======================================== */
    
    /* Verde SANNA - Color Primario */
    --color-primary: #00A859;
    --color-primary-light: #00C96D;
    --color-primary-dark: #008847;
    --color-primary-50: #E8F5E9;
    --color-primary-100: #C8E6C9;
    
    /* Colores Corporativos Legacy (mantener compatibilidad) */
    --color-verde-principal: #00A859;
    --color-verde-claro: #00C96D;
    --color-verde-oscuro: #008847;
    
    /* Colores Secundarios - Sistema Semántico */
    --color-secondary: #6A1B9A;      /* Morado - Gestión */
    --color-secondary-light: #8E24AA;
    --color-secondary-dark: #4A148C;
    
    /* Colores Funcionales */
    --color-info: #2196F3;           /* Azul - Información / Mapas */
    --color-info-light: #64B5F6;
    --color-info-dark: #1976D2;
    
    --color-success: #4CAF50;        /* Verde - Éxito / KPIs positivos */
    --color-success-light: #81C784;
    --color-success-dark: #388E3C;
    
    --color-warning: #FFC107;        /* Amarillo - Advertencia */
    --color-warning-light: #FFD54F;
    --color-warning-dark: #FFA000;
    
    --color-danger: #F44336;         /* Rojo - Error / Crítico */
    --color-danger-light: #EF5350;
    --color-danger-dark: #D32F2F;
    
    /* Escala de Grises Mejorada */
    --color-gray-50: #FAFAFA;
    --color-gray-100: #F5F5F5;
    --color-gray-200: #EEEEEE;
    --color-gray-300: #E0E0E0;
    --color-gray-400: #BDBDBD;
    --color-gray-500: #9E9E9E;
    --color-gray-600: #757575;
    --color-gray-700: #616161;
    --color-gray-800: #424242;
    --color-gray-900: #212121;
    
    /* Colores Base */
    --color-negro: #212121;
    --color-blanco: #FFFFFF;
    --color-gris: #757575;           /* Legacy */
    --color-gris-claro: #F5F5F5;     /* Legacy */
    
    /* ========================================
       TIPOGRAFÍA - SISTEMA DUAL
       ======================================== */
    
    /* Fuente Display - Títulos y Headers */
    --font-display: 'Montserrat', 'Helvetica Neue', -apple-system, sans-serif;
    
    /* Fuente Body - Contenido y Párrafos */
    --font-body: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Fuente Monoespaciada - Códigos */
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    
    /* Legacy (mantener compatibilidad) */
    --font-principal: 'Montserrat', sans-serif;
    
    /* Escala Tipográfica */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    
    /* Peso de Fuentes */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* ========================================
       ESPACIADO - SISTEMA CONSISTENTE
       ======================================== */
    
    --space-xs: 0.25rem;     /* 4px */
    --space-sm: 0.5rem;      /* 8px */
    --space-md: 1rem;        /* 16px */
    --space-lg: 1.5rem;      /* 24px */
    --space-xl: 2rem;        /* 32px */
    --space-2xl: 3rem;       /* 48px */
    --space-3xl: 4rem;       /* 64px */
    --space-4xl: 6rem;       /* 96px */
    
    /* ========================================
       SOMBRAS MEJORADAS
       ======================================== */
    
    --sombra-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --sombra-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --sombra-suave: 0 2px 10px rgba(0, 0, 0, 0.1);
    --sombra-media: 0 4px 20px rgba(0, 0, 0, 0.15);
    --sombra-fuerte: 0 8px 30px rgba(0, 0, 0, 0.2);
    --sombra-xl: 0 12px 40px rgba(0, 0, 0, 0.25);
    
    /* Sombras de Colores */
    --sombra-primary: 0 4px 15px rgba(0, 168, 89, 0.3);
    --sombra-secondary: 0 4px 15px rgba(106, 27, 154, 0.3);
    --sombra-info: 0 4px 15px rgba(33, 150, 243, 0.3);
    --sombra-danger: 0 4px 15px rgba(244, 67, 54, 0.3);
    
    /* ========================================
       TRANSICIONES Y ANIMACIONES
       ======================================== */
    
    --transicion: all 0.3s ease;
    --transicion-rapida: all 0.15s ease;
    --transicion-lenta: all 0.5s ease;
    --transicion-suave: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ========================================
       BORDER RADIUS
       ======================================== */
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-2xl: 25px;
    --radius-full: 9999px;
    
    /* ========================================
       Z-INDEX SCALE
       ======================================== */
    
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* === RESET Y BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-gray-900);
    line-height: 1.6;
    background-color: var(--color-blanco);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tipografía para títulos */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: 1.2;
    color: var(--color-gray-900);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   ACCESIBILIDAD - WCAG AA
   ======================================== */

/* Skip Navigation */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--space-md) var(--space-xl);
    text-decoration: none;
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    z-index: 9999;
    border-radius: 0 0 var(--radius-md) 0;
    transition: var(--transicion-rapida);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-warning);
    outline-offset: 2px;
}

/* Focus States Mejorados */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Focus para elementos interactivos */
.nav-link:focus-visible,
.card-btn:focus-visible,
.download-btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(0, 168, 89, 0.1);
}

/* Mejorar contraste en badges - WCAG AA */
.badge,
.result-category,
.result-matches {
    /* Asegurar contraste mínimo 4.5:1 */
    font-weight: var(--font-semibold);
}

/* ========================================
   SISTEMA DE BOTONES JERÁRQUICO
   ======================================== */

/* Base común para todos los botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-display);
    font-weight: var(--font-semibold);
    font-size: var(--text-base);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transicion);
    line-height: 1.5;
    text-align: center;
}

/* Botón Primary - Acción principal */
.btn-primary,
.card-btn {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    box-shadow: var(--sombra-primary);
}

.btn-primary:hover,
.card-btn:hover {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    box-shadow: 0 6px 20px rgba(0, 168, 89, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active,
.card-btn:active {
    transform: translateY(0);
    box-shadow: var(--sombra-sm);
}

/* Botón Secondary - Acción secundaria */
.btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    box-shadow: var(--sombra-sm);
}

.btn-secondary:hover {
    background: var(--color-primary-50);
    border-color: var(--color-primary-dark);
    color: var(--color-primary-dark);
    box-shadow: var(--sombra-md);
    transform: translateY(-2px);
}

/* Botón Ghost - Acción terciaria */
.btn-ghost {
    background: transparent;
    color: var(--color-primary);
    border: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--color-primary-50);
    color: var(--color-primary-dark);
}

/* Botón Danger - Acciones críticas */
.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-light) 100%);
    color: white;
    box-shadow: var(--sombra-danger);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--color-danger-dark) 0%, var(--color-danger) 100%);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
    transform: translateY(-2px);
}

/* Botón Info - Información */
.btn-info {
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-info-light) 100%);
    color: white;
    box-shadow: var(--sombra-info);
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--color-info-dark) 0%, var(--color-info) 100%);
    transform: translateY(-2px);
}

/* Tamaños de botones */
.btn-sm {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--text-lg);
}

/* Botón con icono */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-icon i {
    font-size: 1.1em;
}

/* ========================================
   MEJORAS EN TABLAS
   ======================================== */

/* Zebra Striping Mejorado */
.tasks-table tbody tr:nth-child(even),
.roles-table tbody tr:nth-child(even),
.escalation-table tbody tr:nth-child(even) {
    background: var(--color-gray-50);
}

/* Hover State Mejorado */
.tasks-table tbody tr:hover,
.roles-table tbody tr:hover,
.escalation-table tbody tr:hover {
    background: var(--color-primary-50);
    box-shadow: inset 0 0 0 2px var(--color-primary-light);
    cursor: pointer;
    transition: var(--transicion-rapida);
}

/* Sticky Headers */
.tasks-table thead,
.roles-table thead,
.escalation-table thead {
    position: sticky;
    top: 80px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Mejorar fila activa */
.tasks-table tbody tr:focus-within,
.roles-table tbody tr:focus-within,
.escalation-table tbody tr:focus-within {
    background: var(--color-info-light);
    box-shadow: 0 0 0 3px var(--color-info);
}

/* === HEADER & NAVIGATION === */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 20px rgba(0, 168, 89, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 4px solid transparent;
    border-image: linear-gradient(to right, var(--color-verde-claro), var(--color-verde-principal), var(--color-verde-oscuro)) 1;
}

.main-nav {
    padding: 0.75rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === BRAND SECTION === */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transicion);
}

.brand-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: var(--transicion);
    filter: drop-shadow(0 2px 8px rgba(0, 168, 89, 0.15));
}

.brand-logo:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(0, 168, 89, 0.25));
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-tagline {
    font-size: 0.75rem;
    color: var(--color-gris);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.2;
}

/* === MENU TOGGLE (MOBILE) === */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: linear-gradient(135deg, var(--color-verde-principal) 0%, var(--color-verde-claro) 100%);
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 168, 89, 0.3);
    transition: var(--transicion);
}

.menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 168, 89, 0.4);
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--color-blanco);
    border-radius: 2px;
    transition: var(--transicion);
}

.menu-toggle.active {
    background: linear-gradient(135deg, var(--color-verde-oscuro) 0%, var(--color-verde-principal) 100%);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* === NAVIGATION MENU === */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--color-negro);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transicion);
    cursor: pointer;
    border-radius: 10px;
    position: relative;
}

.nav-link i:not(.arrow) {
    font-size: 1rem;
    color: var(--color-verde-principal);
    transition: var(--transicion);
}

.nav-link span {
    transition: var(--transicion);
}

.nav-link:hover {
    background-color: rgba(0, 168, 89, 0.08);
    color: var(--color-verde-principal);
    transform: translateY(-2px);
}

.nav-link:hover i:not(.arrow) {
    transform: scale(1.1);
}

/* Active state */
.nav-item.active .nav-link {
    background-color: rgba(0, 168, 89, 0.12);
    color: var(--color-verde-principal);
}

/* === DROPDOWN STYLES === */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle .arrow {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
    color: var(--color-gris);
}

.dropdown.active .dropdown-toggle .arrow {
    transform: rotate(180deg);
    color: var(--color-verde-principal);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    min-width: 250px;
    list-style: none;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
    display: none;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    display: block;
}

.dropdown-menu li {
    padding: 0;
    margin: 2px 0;
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.dropdown-menu li a i {
    font-size: 1rem;
    color: #00a859;
    width: 20px;
    text-align: center;
}

.dropdown-menu li a span {
    flex: 1;
}

.dropdown-menu li a:hover {
    background: #f0fdf4;
    color: #00a859;
}

.dropdown-menu li a:hover i {
    transform: scale(1.1);
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 168, 89, 0.2), transparent);
    margin: 0.5rem 0;
}

/* === SEARCH BUTTON === */
.nav-item-search {
    margin-left: 0.5rem;
}

.btn-search {
    background: linear-gradient(135deg, var(--color-verde-principal) 0%, var(--color-verde-claro) 100%);
    color: var(--color-blanco) !important;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 168, 89, 0.3);
    font-weight: 600;
}

.btn-search i {
    color: var(--color-blanco) !important;
}

.btn-search:hover {
    background: linear-gradient(135deg, var(--color-verde-oscuro) 0%, var(--color-verde-principal) 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 168, 89, 0.4);
}

.btn-search span {
    color: var(--color-blanco);
}

/* === HEADER SCROLL EFFECT === */
.main-header.scrolled {
    box-shadow: 0 6px 30px rgba(0, 168, 89, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
}

.main-header.scrolled .nav-link {
    padding: 0.65rem 1.15rem;
}

.main-header.scrolled .brand-logo img {
    height: 35px;
}

/* === HERO SECTION - ESTILO PWC === */
.hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, #00A859 0%, #00C96D 50%, #00A859 100%);
    overflow: hidden;
    margin-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, rgba(0, 168, 89, 0.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0, 168, 89, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0, 168, 89, 0.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0, 168, 89, 0.05) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    color: white;
}

.hero-badge {
    display: inline-block;
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 25px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    font-family: 'Montserrat', sans-serif;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
}

.btn-hero-primary {
    display: inline-block;
    padding: 16px 40px;
    background: white;
    color: #00A859;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

.btn-hero-secondary {
    display: inline-block;
    padding: 16px 40px;
    background: transparent;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid white;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-hero-secondary:hover {
    background: white;
    color: #00A859;
    transform: translateY(-3px);
}

.hero-stats {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* === BOTONES ESTILO PWC === */
.card-btn-pwc {
    display: inline-block;
    padding: 12px 28px;
    background: transparent;
    color: var(--color-negro);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--color-negro);
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.card-btn-pwc:hover {
    background: var(--color-negro);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* === SEARCH MODAL === */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    background-color: var(--color-blanco);
    border-radius: 15px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--sombra-fuerte);
}

.search-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-gris);
    transition: var(--transicion);
}

.search-close:hover {
    color: var(--color-verde-principal);
}

.search-modal-content h2 {
    color: var(--color-verde-principal);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

#searchInput {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-gris-claro);
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-principal);
    transition: var(--transicion);
}

#searchInput:focus {
    outline: none;
    border-color: var(--color-verde-principal);
}

#searchResults {
    margin-top: 1.5rem;
}

/* Resumen de búsqueda */
.search-summary {
    background: linear-gradient(135deg, #00A859 0%, #00C96D 100%);
    color: white;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 168, 89, 0.25);
}

.search-summary i {
    font-size: 1.3rem;
}

.search-query {
    font-weight: 600;
    color: #FFF3E0;
}

/* Contenedor de resultados */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Item de resultado */
.search-result-item {
    padding: 1.5rem;
    border-radius: 12px;
    background: white;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.4s ease;
}

.search-result-item:hover {
    border-color: #00A859;
    box-shadow: 0 8px 25px rgba(0, 168, 89, 0.15);
    transform: translateY(-3px);
}

/* Header del resultado */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #6A1B9A 0%, #8E24AA 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.result-category i {
    font-size: 0.9rem;
}

.result-matches {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #FFF3E0;
    color: #E65100;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.result-matches i {
    font-size: 0.85rem;
}

/* Título del resultado */
.result-title {
    color: #00A859;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.result-title mark {
    background: linear-gradient(135deg, #FFEB3B 0%, #FFF59D 100%);
    color: #1B5E20;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

/* Descripción del resultado */
.result-description {
    color: #616161;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.result-description mark {
    background: linear-gradient(135deg, #FFEB3B 0%, #FFF59D 100%);
    color: #1B5E20;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Enlace del resultado */
.result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #00A859;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.result-link:hover {
    color: #00C96D;
    gap: 0.8rem;
}

.result-link i {
    transition: transform 0.3s ease;
}

.result-link:hover i {
    transform: translateX(5px);
}

/* Sin resultados */
.search-no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #757575;
}

.search-no-results i {
    font-size: 4rem;
    color: #BDBDBD;
    margin-bottom: 1rem;
}

.search-no-results p {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.search-no-results strong {
    color: #424242;
}

/* Hint de búsqueda */
.search-hint {
    color: #9E9E9E;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-verde-principal);
    color: var(--color-blanco);
    border-radius: 15px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* === MAIN CONTENT === */
.main-content {
    margin-top: 80px;
    padding-top: 0;
}

/* ========================================
   HERO SECTIONS MEJORADOS - PATRONES SVG
   ======================================== */

/* Patrón SVG Base para todos los Hero */
.hero-pattern {
    position: relative;
    overflow: hidden;
}

.hero-pattern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 800px;
    height: 800px;
    opacity: 0.08;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.3)" stroke-width="1"/></pattern></defs><rect width="800" height="800" fill="url(%23grid)"/><circle cx="400" cy="400" r="300" fill="none" stroke="rgba(255,255,255,0.2)" stroke-width="2"/><circle cx="400" cy="400" r="200" fill="none" stroke="rgba(255,255,255,0.2)" stroke-width="2"/><circle cx="400" cy="400" r="100" fill="none" stroke="rgba(255,255,255,0.2)" stroke-width="2"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    transform: rotate(15deg);
    animation: heroFloat 20s ease-in-out infinite;
}

/* Patrón específico para Mapa Técnico */
.mapa-hero::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><linearGradient id="grad1" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:rgba(255,255,255,0.3)"/><stop offset="100%25" style="stop-color:rgba(255,255,255,0.1)"/></linearGradient></defs><path d="M100,200 L300,100 L500,200 L700,150 L700,400 L500,450 L300,350 L100,450 Z" fill="url(%23grad1)" stroke="rgba(255,255,255,0.4)" stroke-width="3"/><circle cx="100" cy="200" r="20" fill="rgba(255,255,255,0.5)"/><circle cx="300" cy="100" r="20" fill="rgba(255,255,255,0.5)"/><circle cx="500" cy="200" r="20" fill="rgba(255,255,255,0.5)"/><circle cx="700" cy="150" r="20" fill="rgba(255,255,255,0.5)"/></svg>');
}

/* Patrón específico para Feedback */
.feedback-hero::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><linearGradient id="grad2" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:rgba(255,255,255,0.3)"/><stop offset="100%25" style="stop-color:rgba(255,255,255,0.1)"/></linearGradient></defs><path d="M200,300 Q250,200 400,250 T600,300 Q650,350 600,400 T400,450 Q250,400 200,300" fill="url(%23grad2)" stroke="rgba(255,255,255,0.4)" stroke-width="3"/><circle cx="400" cy="300" r="15" fill="rgba(255,255,255,0.6)"/><circle cx="350" cy="330" r="12" fill="rgba(255,255,255,0.6)"/><circle cx="450" cy="330" r="12" fill="rgba(255,255,255,0.6)"/></svg>');
}

/* Patrón específico para Supervisión */
.supervision-hero::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><linearGradient id="grad3" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:rgba(255,255,255,0.3)"/><stop offset="100%25" style="stop-color:rgba(255,255,255,0.1)"/></linearGradient></defs><circle cx="400" cy="400" r="150" fill="url(%23grad3)" stroke="rgba(255,255,255,0.4)" stroke-width="3"/><path d="M400,250 L400,400 L500,350" stroke="rgba(255,255,255,0.6)" stroke-width="4" fill="none" stroke-linecap="round"/><circle cx="400" cy="400" r="10" fill="rgba(255,255,255,0.8)"/></svg>');
}

/* Patrón específico para Competencias */
.competencias-hero::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><linearGradient id="grad4" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:rgba(255,255,255,0.3)"/><stop offset="100%25" style="stop-color:rgba(255,255,255,0.1)"/></linearGradient></defs><polygon points="400,100 500,300 400,500 300,300" fill="url(%23grad4)" stroke="rgba(255,255,255,0.4)" stroke-width="3"/><circle cx="400" cy="100" r="15" fill="rgba(255,255,255,0.6)"/><circle cx="500" cy="300" r="15" fill="rgba(255,255,255,0.6)"/><circle cx="400" cy="500" r="15" fill="rgba(255,255,255,0.6)"/><circle cx="300" cy="300" r="15" fill="rgba(255,255,255,0.6)"/></svg>');
}

/* Patrón específico para Protocolos */
.protocolo-hero::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><linearGradient id="grad5" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:rgba(255,255,255,0.3)"/><stop offset="100%25" style="stop-color:rgba(255,255,255,0.1)"/></linearGradient></defs><rect x="200" y="200" width="400" height="400" rx="20" fill="url(%23grad5)" stroke="rgba(255,255,255,0.4)" stroke-width="3"/><line x1="250" y1="300" x2="550" y2="300" stroke="rgba(255,255,255,0.5)" stroke-width="3"/><line x1="250" y1="400" x2="550" y2="400" stroke="rgba(255,255,255,0.5)" stroke-width="3"/><line x1="250" y1="500" x2="450" y2="500" stroke="rgba(255,255,255,0.5)" stroke-width="3"/></svg>');
}

/* Animación flotante para patrones */
@keyframes heroFloat {
    0%, 100% {
        transform: rotate(15deg) translateY(0);
    }
    50% {
        transform: rotate(15deg) translateY(-30px);
    }
}

/* Hero sections con clases actualizadas */
.mapa-hero,
.feedback-hero,
.supervision-hero,
.competencias-hero,
.protocolo-hero,
.mof-hero {
    position: relative;
    overflow: hidden;
}

/* Aplicar el patrón base a todos los heroes que no tienen específico */
.mof-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 800px;
    height: 800px;
    opacity: 0.08;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><linearGradient id="gradMof" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" style="stop-color:rgba(255,255,255,0.3)"/><stop offset="100%25" style="stop-color:rgba(255,255,255,0.1)"/></linearGradient></defs><circle cx="400" cy="400" r="250" fill="url(%23gradMof)" stroke="rgba(255,255,255,0.4)" stroke-width="3"/><circle cx="400" cy="250" r="60" fill="rgba(255,255,255,0.3)"/><circle cx="300" cy="450" r="50" fill="rgba(255,255,255,0.3)"/><circle cx="500" cy="450" r="50" fill="rgba(255,255,255,0.3)"/><circle cx="250" cy="350" r="40" fill="rgba(255,255,255,0.3)"/><circle cx="550" cy="350" r="40" fill="rgba(255,255,255,0.3)"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    transform: rotate(15deg);
    animation: heroFloat 20s ease-in-out infinite;
}

.content-section {
    padding: 4rem 0;
}

.content-section:nth-child(even) {
    background-color: var(--color-gris-claro);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-icon {
    font-size: 3rem;
    color: var(--color-verde-principal);
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-verde-principal);
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--color-gris);
}

/* === CARDS GRID === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.protocol-card {
    background-color: var(--color-blanco);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--sombra-suave);
    transition: var(--transicion);
    opacity: 0;
    transform: translateY(30px);
}

.protocol-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.protocol-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--sombra-fuerte);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-number {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--color-verde-principal);
    color: var(--color-blanco);
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
}

.card-header i {
    font-size: 2rem;
    color: var(--color-verde-claro);
}

.protocol-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-negro);
    margin-bottom: 1rem;
}

.protocol-card p {
    color: var(--color-gris);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--color-verde-principal);
    color: var(--color-blanco);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transicion);
}

.card-btn:hover {
    background-color: var(--color-verde-oscuro);
    transform: translateX(5px);
}

/* === FOOTER === */
.main-footer {
    background-color: var(--color-negro);
    color: var(--color-blanco);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--color-verde-claro);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.footer-section h4 {
    color: var(--color-verde-claro);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-tagline {
    font-style: italic;
    color: var(--color-gris);
    margin-top: 0.5rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--color-gris);
    text-decoration: none;
    transition: var(--transicion);
}

.footer-links a:hover {
    color: var(--color-verde-claro);
    padding-left: 5px;
}

.footer-section p {
    color: var(--color-gris);
    margin-bottom: 0.5rem;
}

.footer-section i {
    color: var(--color-verde-claro);
    margin-right: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: var(--color-gris);
    font-size: 0.9rem;
}

/* === ANIMATION CLASSES === */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === UTILITY CLASSES === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }