/* Andres de Oro */

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    height: 100%;
    height: -webkit-fill-available;
}

/* Prevenir zoom en inputs de iOS */
input, textarea, select {
    font-size: 16px !important;
}

@supports (-webkit-touch-callout: none) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

:root {
    --ngh-teal: #1B7F8E;
    --ngh-red: #C41E3A;
    --ngh-blue: #367CA3;
    --ngh-white: #FFFFFF;

    /* Variantes de colores */
    --teal-light: #E0F2F4;
    --teal-dark: #0D5F6D;
    --red-light: #FFE5E9;
    --red-dark: #A01629;

    --success: #2E7D32;
    --warning: #ED6C02;
    --error: #D32F2F;
    --info: #0288D1;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #E9ECEF;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --border: #DEE2E6;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-md: rgba(0, 0, 0, 0.12);
    --shadow-lg: rgba(0, 0, 0, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fix global para mobile - Prevenir overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body * {
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    overflow: hidden;
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}


.screen {
    display: none;
    width: 100vw;
    height: 100vh;
}

.screen.active {
    display: flex;
}

/* ===============================================
   WELCOME SCREEN - Pantalla de Bienvenida
   =============================================== */

#welcome-screen {
    flex-direction: column;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

/* Header Fijo con Logo y Botón */
.welcome-header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 200;
}

.welcome-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.welcome-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.brand-text h1 {
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin: 0 0 4px 0;
    letter-spacing: 0.5px;
}

.brand-text p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
}

.btn-access-system {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: white;
    color: var(--ngh-teal);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.btn-access-system:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.95);
}

.btn-access-system:active {
    transform: translateY(0);
}

.btn-access-system svg {
    transition: transform 0.3s ease;
}

.btn-access-system:hover svg {
    transform: translateX(4px);
}

/* Contenido Scrollable */
.welcome-content-scroll {
    margin-top: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 10;
}

.welcome-content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 40px 60px 40px;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.welcome-hero-section {
    text-align: center;
    margin-bottom: 60px;
    padding: 50px 40px;
    background:
        linear-gradient(135deg, rgba(27, 127, 142, 0.92) 0%, rgba(54, 124, 163, 0.90) 100%),
        url('assets/welcome-images/hero-medical.jpg') center/cover no-repeat;
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow);
    border: 1px solid rgba(27, 127, 142, 0.1);
    position: relative;
    overflow: hidden;
}

.welcome-hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-30px, -30px) scale(1.1);
    }
}

.section-title {
    font-size: 38px;
    font-weight: 800;
    color: white;
    margin: 0 0 24px 0;
    letter-spacing: -0.5px;
    text-align: center;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.welcome-hero-section .section-title {
    color: white;
}

.hero-description {
    font-size: 17px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.95);
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.hero-description strong {
    color: white;
    font-weight: 700;
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
}

.hero-description strong::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.hero-description:hover strong::after {
    transform: scaleX(1);
}

/* Títulos de otras secciones (no hero) */
.welcome-section h2 {
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Secciones Generales */
.welcome-section {
    margin-bottom: 60px;
}

.welcome-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--ngh-blue);
    text-align: center;
    margin: 0 0 32px 0;
}

/* Módulos de Servicios - Accordion */
.services-section {
    margin-bottom: 60px;
}

.service-accordion {
    background: var(--bg-primary);
    border-radius: 18px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 2px solid var(--border);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.service-accordion:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(27, 127, 142, 0.15);
    border-color: var(--ngh-teal);
}

.accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.08) 0%, rgba(54, 124, 163, 0.04) 100%);
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.accordion-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.accordion-header:hover::before {
    left: 100%;
}

.accordion-header:hover {
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.12) 0%, rgba(54, 124, 163, 0.08) 100%);
    padding-left: 32px;
}

.accordion-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: white;
    color: var(--ngh-teal);
    border-radius: 12px;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-number::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: white;
    z-index: -1;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 0.4s ease;
}

.accordion-header:hover .accordion-number {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 24px rgba(27, 127, 142, 0.5);
}

.accordion-header:hover .accordion-number::after {
    opacity: 0.6;
}

.accordion-header h3 {
    flex: 1;
    font-size: 21px;
    font-weight: 700;
    color: white;
    margin: 0;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.accordion-header:hover h3 {
    color: white;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.accordion-icon {
    font-size: 36px;
    font-weight: 300;
    color: white;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.accordion-header:hover .accordion-icon {
    color: white;
    transform: scale(1.2);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.accordion-header.active .accordion-icon {
    transform: rotate(45deg) scale(1.1);
    color: white;
}

.accordion-header.active .accordion-number {
    transform: rotate(-5deg);
    box-shadow: 0 6px 24px rgba(27, 127, 142, 0.6);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.98);
}

.accordion-content.active {
    max-height: 2000px;
    padding: 24px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode .accordion-content {
    background: rgba(42, 42, 42, 0.98);
}

.submodules-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.submodule-item {
    background: linear-gradient(135deg, rgba(54, 124, 163, 0.08) 0%, rgba(27, 127, 142, 0.08) 100%);
    border-radius: 12px;
    padding: 18px 24px;
    border-left: 4px solid var(--ngh-blue);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.submodule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(27, 127, 142, 0.1), transparent);
    transition: left 0.5s ease;
}

.submodule-item:hover::before {
    left: 100%;
}

.submodule-item:hover {
    transform: translateX(8px) scale(1.02);
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.12) 0%, rgba(54, 124, 163, 0.08) 100%);
    border-left-color: var(--ngh-teal);
    border-left-width: 6px;
    box-shadow: 0 4px 16px rgba(27, 127, 142, 0.15);
}

.submodule-item strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--ngh-blue);
    display: block;
    margin-bottom: 6px;
}

.submodule-item p,
.submodule-item span {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

/* Team Section */
.team-section {
    margin-bottom: 60px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.team-member {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 2px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.team-member:hover {
    box-shadow: 0 12px 40px rgba(27, 127, 142, 0.15);
    transform: translateY(-8px);
    border-color: var(--ngh-teal);
}

.member-image {
    width: 100%;
    height: 260px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    margin: 0;
    position: relative;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transition: transform 0.5s ease;
    filter: grayscale(20%);
}

.team-member:hover .member-image img {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.member-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(27, 127, 142, 0.6), transparent);
}

.team-member > div:not(.member-image),
.team-member > .member-role,
.team-member > h4,
.team-member > p {
    padding-left: 24px;
    padding-right: 24px;
}

.member-role {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 20px 0 14px 24px;
    box-shadow: 0 4px 12px rgba(27, 127, 142, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.team-member:hover .member-role {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(27, 127, 142, 0.4);
}

.team-member h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin: 0 0 10px 0;
}

.team-member p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0 0 24px 0;
}

/* Sección Misión y Visión */
.mission-vision {
    margin-bottom: 60px;
}

.mv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
}

.mv-card {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(27, 127, 142, 0.03) 100%);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mv-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--ngh-teal), var(--ngh-blue));
}

.mv-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(27, 127, 142, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transition: all 0.6s ease;
}

.mv-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(27, 127, 142, 0.15);
    border-color: rgba(27, 127, 142, 0.2);
}

.mv-card:hover::after {
    transform: translate(-20%, -20%) scale(1.5);
}

.mv-title {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 18px 0;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.mv-card:hover .mv-title {
    transform: translateX(8px);
}

.mv-card p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Sección Valores */
.values-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin: 0 0 8px 0;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.value-item {
    background: linear-gradient(135deg, var(--bg-primary) 0%, rgba(27, 127, 142, 0.02) 100%);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.value-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(27, 127, 142, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.value-item:hover::before {
    width: 300px;
    height: 300px;
}

.value-item:hover {
    border-color: var(--ngh-teal);
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 40px rgba(27, 127, 142, 0.15);
}

.value-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: grayscale(0.3);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.value-item:hover .value-icon {
    transform: scale(1.2) rotateY(360deg);
    filter: grayscale(0);
}

.value-item strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.value-item:hover strong {
    color: var(--ngh-blue);
    transform: scale(1.05);
}

.value-item p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Footer de Contacto */
.welcome-footer-section {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 4px 12px var(--shadow);
    border-top: 3px solid var(--ngh-teal);
}

.footer-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin: 0 0 20px 0;
    text-align: center;
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    margin-bottom: 20px;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.contact-detail svg {
    color: var(--ngh-teal);
    flex-shrink: 0;
}

.footer-nit {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0 0 8px 0;
}


/* Animaciones de entrada */

/* Responsive para Welcome Screen */
@media (max-width: 968px) {
    .welcome-header-content {
        padding: 16px 28px;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    .brand-text h1 {
        font-size: 20px;
    }

    .brand-text p {
        font-size: 12px;
    }

    .btn-access-system {
        font-size: 15px;
        padding: 12px 24px;
    }

    .welcome-content-wrapper {
        padding: 32px 28px 48px 28px;
    }

    .section-title {
        font-size: 30px;
    }

    .accordion-header {
        padding: 16px 20px;
    }

    .accordion-number {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .accordion-header h3 {
        font-size: 18px;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .welcome-header-content {
        padding: 14px 20px;
        flex-direction: column;
        gap: 16px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
    }

    .brand-text h1 {
        font-size: 18px;
    }

    .brand-text p {
        font-size: 11px;
    }

    .btn-access-system {
        width: 100%;
        justify-content: center;
        font-size: 14px;
        padding: 12px 20px;
    }

    .welcome-content-scroll {
        margin-top: 140px;
    }

    .welcome-content-wrapper {
        padding: 24px 20px 40px 20px;
    }

    .welcome-hero-section {
        padding: 28px 16px;
        margin-bottom: 40px;
    }

    .section-title {
        font-size: 26px;
        margin-bottom: 16px;
    }

    .hero-description {
        font-size: 15px;
    }

    .welcome-section,
    .mission-vision,
    .values-section {
        margin-bottom: 40px;
    }

    .welcome-section h2 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .accordion-header {
        padding: 18px 20px;
    }

    .accordion-number {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .accordion-header h3 {
        font-size: 17px;
    }

    .accordion-icon {
        font-size: 28px;
    }

    .accordion-content.active {
        padding: 20px;
    }

    .submodule-item {
        padding: 14px 16px;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .team-member {
        padding: 20px;
    }

    .mv-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .mv-card {
        padding: 24px 20px;
    }

    .mv-title {
        font-size: 20px;
    }

    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }

    .welcome-footer-section {
        padding: 24px 20px;
    }

    .contact-grid {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .welcome-header-content {
        padding: 12px 16px;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
    }

    .brand-text h1 {
        font-size: 16px;
    }

    .brand-text p {
        font-size: 10px;
    }

    .btn-access-system {
        font-size: 13px;
        padding: 10px 16px;
    }

    .welcome-content-scroll {
        margin-top: 130px;
    }

    .welcome-content-wrapper {
        padding: 20px 16px 32px 16px;
    }

    .welcome-hero-section {
        padding: 24px 16px;
        margin-bottom: 32px;
    }

    .section-title {
        font-size: 22px;
    }

    .hero-description {
        font-size: 14px;
    }

    .welcome-section h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .accordion-header {
        padding: 16px;
    }

    .accordion-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .accordion-header h3 {
        font-size: 16px;
    }

    .accordion-icon {
        font-size: 26px;
    }

    .accordion-content.active {
        padding: 16px;
    }

    .submodule-item {
        padding: 12px 14px;
    }

    .submodule-item strong {
        font-size: 14px;
    }

    .team-member {
        padding: 16px;
    }

    .member-role {
        font-size: 11px;
        padding: 5px 12px;
    }

    .team-member h4 {
        font-size: 16px;
    }

    .team-member p {
        font-size: 13px;
    }

    .mv-card {
        padding: 20px 16px;
    }

    .mv-title {
        font-size: 18px;
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    .value-item {
        padding: 16px;
    }

    .welcome-footer-section {
        padding: 20px 16px;
    }

    .footer-content h3 {
        font-size: 18px;
    }

    .contact-detail {
        font-size: 13px;
    }

    .footer-nit {
        font-size: 12px;
    }
}

/* Dark mode para Welcome Screen */
body.dark-mode #welcome-screen {
    background: #1a1a1a;
}

body.dark-mode .welcome-header-fixed {
    background: linear-gradient(135deg, #0D5F6D 0%, #1a5c78 100%);
}

body.dark-mode .btn-access-system {
    background: rgba(255, 255, 255, 0.95);
    color: var(--ngh-teal);
}

body.dark-mode .btn-access-system:hover {
    background: white;
}

body.dark-mode .welcome-hero-section,
body.dark-mode .service-accordion,
body.dark-mode .mv-card,
body.dark-mode .value-item,
body.dark-mode .welcome-footer-section,
body.dark-mode .team-member {
    background: #2a2a2a;
    border-color: #404040;
}

body.dark-mode .accordion-header {
    background: linear-gradient(135deg, rgba(13, 95, 109, 0.3) 0%, rgba(13, 95, 109, 0.1) 100%);
}

body.dark-mode .accordion-header:hover {
    background: linear-gradient(135deg, rgba(13, 95, 109, 0.4) 0%, rgba(13, 95, 109, 0.2) 100%);
}

body.dark-mode .accordion-content.active {
    border-top-color: #404040;
}

body.dark-mode .submodule-item {
    background: #1a1a1a;
}

body.dark-mode .section-title,
body.dark-mode .welcome-section h2,
body.dark-mode .accordion-header h3,
body.dark-mode .mv-title,
body.dark-mode .footer-content h3,
body.dark-mode .team-member h4 {
    color: #1B7F8E;
}

body.dark-mode .submodule-item strong,
body.dark-mode .value-item h3 {
    color: #1B7F8E;
}

body.dark-mode .hero-description,
body.dark-mode .submodule-item p,
body.dark-mode .submodule-item span,
body.dark-mode .mv-card p,
body.dark-mode .value-item p,
body.dark-mode .team-member p {
    color: #e0e0e0;
}

body.dark-mode .contact-detail {
    color: #e0e0e0;
}

body.dark-mode .footer-nit {
    color: #a0a0a0;
}


#login-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--teal-dark) 50%, var(--ngh-blue) 100%);
    position: relative;
    overflow: hidden;
}

#login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse-gradient 8s ease-in-out infinite;
}

@keyframes pulse-gradient {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.login-container {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    z-index: 1;
    animation: slideIn 0.5s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    display: block;
    filter: drop-shadow(0 4px 8px var(--shadow));
}

.login-header h1 {
    color: var(--ngh-teal);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--ngh-teal);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(27, 127, 142, 0.1);
}

/* Password input con botón de visibilidad */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 48px;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.08) 0%, rgba(54, 124, 163, 0.08) 100%);
    border: 1.5px solid rgba(27, 127, 142, 0.2);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ngh-teal);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    width: 36px;
    height: 36px;
}

.btn-toggle-password:hover {
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.15) 0%, rgba(54, 124, 163, 0.15) 100%);
    border-color: var(--ngh-teal);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 2px 8px rgba(27, 127, 142, 0.2);
}

.btn-toggle-password:active {
    transform: translateY(-50%) scale(0.98);
    box-shadow: 0 1px 4px rgba(27, 127, 142, 0.3);
}

.btn-toggle-password svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
    transition: all 0.3s ease;
}

.btn-toggle-password:hover svg {
    stroke-width: 3;
    filter: drop-shadow(0 0 2px rgba(27, 127, 142, 0.3));
}

/* Animación cuando cambia el icono */
.btn-toggle-password .eye-icon,
.btn-toggle-password .eye-off-icon {
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(27, 127, 142, 0.3);
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 127, 142, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    margin-top: 20px;
    padding: 14px 16px;
    background: var(--red-light);
    color: var(--ngh-red);
    border-radius: 10px;
    border-left: 4px solid var(--ngh-red);
    font-size: 14px;
    font-weight: 500;
}

.error-message.hidden {
    display: none;
}

.login-footer {
    margin-top: 28px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Dark Mode Toggle en Login */
.btn-back-to-welcome {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.btn-back-to-welcome:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(-4px);
}

.btn-back-to-welcome:active {
    transform: translateX(-2px);
}

.btn-back-to-welcome svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-back-to-welcome:hover svg {
    transform: translateX(-4px);
}

.btn-dark-mode-login {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.btn-dark-mode-login:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.btn-dark-mode-login:active {
    transform: scale(0.95);
}

.btn-dark-mode-login svg {
    width: 20px;
    height: 20px;
}

#chat-screen {
    flex-direction: column;
}

.chat-header {
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px var(--shadow);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 2px 4px var(--shadow));
}

.header-info h2 {
    font-size: 22px;
    color: var(--ngh-teal);
    margin-bottom: 4px;
    font-weight: 700;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--error);
    animation: pulse-status 2s infinite;
}

.status-dot.online {
    background: var(--success);
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.header-right {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.btn-icon:hover {
    background: var(--teal-light);
    border-color: var(--ngh-teal);
    color: var(--ngh-teal);
    transform: translateY(-2px);
}

.btn-icon.btn-logout:hover {
    background: var(--red-light);
    border-color: var(--ngh-red);
    color: var(--ngh-red);
}

.btn-icon.saved {
    background: var(--green-light);
    border-color: var(--ngh-green);
    color: var(--ngh-green);
    cursor: not-allowed;
}

.btn-icon.saved:hover {
    background: var(--green-light);
    border-color: var(--ngh-green);
    color: var(--ngh-green);
    transform: none;
}

.btn-menu {
    display: none;
}

/* Menú móvil del header */
.btn-header-menu {
    display: none;
}

.header-buttons-desktop {
    display: flex;
    gap: 10px;
}

.header-menu-dropdown {
    position: absolute;
    top: 70px;
    right: 10px;
    width: 240px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow-lg);
    border: 2px solid var(--border);
    z-index: 1000;
    overflow: hidden;
}

.header-menu-dropdown.hidden {
    display: none;
}

.menu-item {
    width: 100%;
    padding: 14px 18px;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--teal-light);
    color: var(--ngh-teal);
}

.menu-item.menu-item-logout:hover {
    background: var(--red-light);
    color: var(--ngh-red);
}

.menu-item svg {
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

.chat-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 100vw;
}

.sidebar {
    width: 320px;
    background: var(--bg-primary);
    border-right: 2px solid var(--border);
    overflow-y: auto;
    padding: 24px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section h3 {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h3::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--ngh-teal);
    border-radius: 2px;
}

.patient-data,
.attached-files,
.classification {
    font-size: 14px;
}

.no-data {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-align: center;
}

.patient-data-item {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border-left: 3px solid var(--ngh-teal);
    transition: all 0.2s ease;
}

.patient-data-item:hover {
    background: var(--teal-light);
}

.patient-data-label {
    font-weight: 700;
    color: var(--ngh-teal);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.patient-data-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.classification-pending {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.classification-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.classification-result {
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid;
}

.classification-result.risk-low {
    background: #E8F5E9;
    color: #2E7D32;
    border-color: #2E7D32;
}

.classification-result.risk-medium {
    background: #FFF3E0;
    color: #EF6C00;
    border-color: #EF6C00;
}

.classification-result.risk-high {
    background: #FFEBEE;
    color: #C62828;
    border-color: #C62828;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ajustar contenido cuando el panel está abierto */
.chat-main.panel-open {
    margin-right: 550px;
}

@media (max-width: 1400px) {
    .chat-main.panel-open {
        margin-right: 450px;
    }
}

@media (max-width: 1200px) {
    .chat-main.panel-open {
        margin-right: 400px;
    }
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

.welcome-message {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.welcome-logo {
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
    filter: drop-shadow(0 8px 16px var(--shadow));
}

.welcome-message h3 {
    color: var(--ngh-teal);
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 700;
}

.welcome-message > p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

.welcome-instructions {
    background: var(--bg-primary);
    padding: 24px 32px;
    border-radius: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    text-align: left;
    border-top: 4px solid var(--ngh-teal);
}

.welcome-instructions h4 {
    color: var(--ngh-teal);
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 700;
}

.welcome-instructions ul {
    list-style: none;
    padding: 0;
}

.welcome-instructions li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    color: var(--text-primary);
    font-size: 14px;
}

.welcome-instructions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--ngh-teal);
    font-weight: bold;
    font-size: 16px;
}

.message {
    display: flex;
    gap: 14px;
    max-width: 75%;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 18px;
    box-shadow: 0 2px 8px var(--shadow);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    border: 2px solid white;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--text-secondary), var(--text-primary));
    border: 2px solid white;
}

.message-content {
    background: var(--bg-primary);
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    color: white;
    border: none;
}

.message-text {
    line-height: 1.6;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: 15px;
    width: 100%;
}

.message.user .message-text {
    color: white;
}

/* Estilos para archivos adjuntos en mensajes */
.message-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.file-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.file-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.file-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.attached-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-thumbnail-small {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--ngh-teal);
    flex-shrink: 0;
}

.attached-file-item .file-icon {
    font-size: 20px;
}

.attached-file-item .file-name {
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-image-thumbnail {
    max-width: 300px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    display: block;
}

.message-image-thumbnail:hover {
    transform: scale(1.02);
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.file-download-btn {
    background: rgba(27, 127, 142, 0.8);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-download-btn:hover {
    background: rgba(27, 127, 142, 1);
    transform: scale(1.1);
}

.file-download-btn:active {
    transform: scale(0.95);
}

/* Modal de vista previa de PDF */
.pdf-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.pdf-preview-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pdf-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1B7F8E;
    color: white;
    border-radius: 12px 12px 0 0;
}

.pdf-preview-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.pdf-preview-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pdf-preview-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.pdf-preview-iframe {
    flex: 1;
    border: none;
    width: 100%;
}

.word-preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    background: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.word-preview-content p {
    margin-bottom: 12px;
}

.word-preview-content h1,
.word-preview-content h2,
.word-preview-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #1B7F8E;
}

.word-preview-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.word-preview-content table td,
.word-preview-content table th {
    border: 1px solid #ddd;
    padding: 8px;
}

.word-preview-content img {
    max-width: 100%;
    height: auto;
}

/* Dark mode para archivos adjuntos */
body.dark-mode .message.user .file-badge {
    background: rgba(79, 195, 247, 0.1);
    border-color: rgba(79, 195, 247, 0.2);
}

body.dark-mode .message.user .file-badge:hover {
    background: rgba(79, 195, 247, 0.15);
    border-color: rgba(79, 195, 247, 0.3);
}

/* Estilos para respuestas formateadas de la IA - Formato médico compacto */
.nefarca-header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 0;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--teal-light);
}

.nivel-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    color: white;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(27, 127, 142, 0.3);
}

.riesgo-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.riesgo-badge.riesgo-Bajo,
.riesgo-badge.riesgo-bajo,
.riesgo-badge.riesgo-Mínimo,
.riesgo-badge.riesgo-mínimo,
.riesgo-badge.riesgo-muy-bajo,
.riesgo-badge.riesgo-muy-Bajo {
    background: #E8F5E9;
    color: #2E7D32;
    border: 2px solid #2E7D32;
}

.riesgo-badge.riesgo-Moderado,
.riesgo-badge.riesgo-moderado,
.riesgo-badge.riesgo-Bajo-moderado,
.riesgo-badge.riesgo-bajo-moderado {
    background: #FFF3E0;
    color: #EF6C00;
    border: 2px solid #EF6C00;
}

.riesgo-badge.riesgo-Moderado-alto,
.riesgo-badge.riesgo-moderado-alto {
    background: #FFE0B2;
    color: #E65100;
    border: 2px solid #E65100;
}

.riesgo-badge.riesgo-Alto,
.riesgo-badge.riesgo-alto,
.riesgo-badge.riesgo-Crítico,
.riesgo-badge.riesgo-crítico,
.riesgo-badge.riesgo-muy-alto,
.riesgo-badge.riesgo-muy-Alto {
    background: #FFEBEE;
    color: #C62828;
    border: 2px solid #C62828;
}

.section-subtitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--ngh-blue);
    margin: 12px 0 6px 0;
    padding: 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conduct-item {
    margin: 2px 0;
    padding-left: 24px;
    line-height: 1.4;
    font-size: 14px;
    position: relative;
}

.conduct-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--ngh-blue);
    font-weight: bold;
    font-size: 16px;
}

.message-text strong {
    color: var(--ngh-teal);
    font-weight: 600;
}

/* Estilos para títulos de secciones dentro de mensajes */
.message-text h3.section-subtitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--ngh-blue);
    margin: 16px 0 8px 0;
    padding: 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    text-align: left !important; /* Forzar alineación a la izquierda */
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.input-area {
    background: var(--bg-primary);
    border-top: 2px solid var(--border);
    padding: 20px 28px;
    box-shadow: 0 -2px 8px var(--shadow);
}

.attached-files-preview {
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 0;
    width: 100%;
    position: relative;
}

.file-preview-item {
    background: var(--teal-light);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 2px solid var(--ngh-teal);
    font-weight: 500;
    color: var(--teal-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-preview-remove {
    cursor: pointer;
    color: var(--ngh-red);
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.2s;
}

.file-preview-remove:hover {
    transform: scale(1.2);
}

.file-preview-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--ngh-teal);
    flex-shrink: 0;
    display: block;
    background: white;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.btn-attach {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-attach:hover {
    background: var(--teal-light);
    border-color: var(--ngh-teal);
    color: var(--ngh-teal);
    transform: translateY(-2px);
}

.btn-attach-form {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-attach-form:hover {
    background: var(--teal-light);
    border-color: var(--ngh-teal);
    color: var(--ngh-teal);
    transform: translateY(-2px);
}

#message-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    max-height: 200px;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

#message-input::placeholder {
    color: var(--text-secondary);
}

#message-input:focus {
    outline: none;
    border-color: var(--ngh-teal);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(27, 127, 142, 0.1);
}

.btn-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(27, 127, 142, 0.3);
}

.btn-send:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(27, 127, 142, 0.4);
}

.btn-send:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px var(--shadow-lg);
    min-width: 300px;
}

.loader {
    width: 56px;
    height: 56px;
    border: 5px solid var(--border);
    border-top-color: var(--ngh-teal);
    border-right-color: var(--ngh-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-text {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--ngh-teal);
    border-radius: 5px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--teal-dark);
}

@media (max-width: 968px) {
    .sidebar {
        width: 280px;
    }

    .message {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 32px 24px;
        max-width: 90%;
        margin: 0 20px;
    }

    .login-logo {
        width: 90px;
        height: 90px;
    }

    .login-header h1 {
        font-size: 26px;
    }

    .btn-back-to-welcome {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .btn-back-to-welcome:hover {
        background: rgba(255, 255, 255, 0.98);
    }

    .btn-dark-mode-login {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .btn-dark-mode-login:hover {
        background: rgba(255, 255, 255, 0.98);
    }

    .btn-dark-mode-login svg {
        width: 18px;
        height: 18px;
    }

    /* Mostrar menú móvil, ocultar botones desktop */
    .btn-header-menu {
        display: flex;
    }

    .header-buttons-desktop {
        display: none !important;
    }

    .btn-menu {
        display: flex;
        margin-right: 8px;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        height: 100vh;
        z-index: 100;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px var(--shadow-md);
    }

    .sidebar.open {
        left: 0;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .header-left {
        gap: 12px;
    }

    .header-logo {
        width: 40px;
        height: 40px;
    }

    .header-info h2 {
        font-size: 18px;
    }

    .status-indicator {
        font-size: 12px;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
    }

    .messages-container {
        padding: 16px;
        gap: 16px;
    }

    .welcome-message {
        margin: 20px auto;
    }

    .welcome-logo {
        width: 90px;
        height: 90px;
    }

    .welcome-message h3 {
        font-size: 22px;
    }

    .welcome-message > p {
        font-size: 14px;
    }

    .welcome-instructions {
        padding: 20px 24px;
    }

    .message {
        max-width: 90%;
        width: auto;
    }

    .message.assistant {
        max-width: 90%;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .message-content {
        padding: 12px 16px;
    }

    .message-text {
        font-size: 14px;
    }

    .input-area {
        padding: 12px 16px;
    }

    .btn-attach,
    .btn-send {
        width: 44px;
        height: 44px;
    }

    #message-input {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 56px;
        max-height: 180px;
    }
}

/* Fix crítico para mobile - FORZAR word wrap */
@media (max-width: 768px) {
    .message-text {
        white-space: normal !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
        max-width: 100% !important;
        width: auto !important;
    }

    .message-content {
        max-width: 100% !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .message {
        max-width: 95% !important;
        width: auto !important;
    }
}

@media (max-width: 480px) {
    .btn-back-to-welcome {
        top: 10px;
        left: 10px;
        padding: 10px 16px;
        font-size: 14px;
        gap: 6px;
    }

    .btn-back-to-welcome span {
        display: none;
    }

    .btn-back-to-welcome svg {
        width: 18px;
        height: 18px;
    }

    .login-container {
        padding: 28px 20px;
        margin: 0 16px;
    }

    .login-logo {
        width: 80px;
        height: 80px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 13px;
    }

    .btn-back-to-welcome {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .btn-back-to-welcome:hover {
        background: rgba(255, 255, 255, 0.98);
    }

    .btn-dark-mode-login {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    .btn-dark-mode-login:hover {
        background: rgba(255, 255, 255, 0.98);
    }

    .btn-dark-mode-login svg {
        width: 16px;
        height: 16px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 16px;
    }

    .btn-primary {
        padding: 14px;
        font-size: 15px;
    }

    .chat-header {
        padding: 10px 12px;
    }

    .header-left {
        gap: 10px;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    .header-info h2 {
        font-size: 16px;
    }

    .status-indicator {
        font-size: 11px;
    }

    .status-dot {
        width: 8px;
        height: 8px;
    }

    .header-right {
        gap: 6px;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }

    .btn-icon svg {
        width: 18px;
        height: 18px;
    }

    .messages-container {
        padding: 12px;
        gap: 12px;
    }

    .welcome-message {
        margin: 16px auto;
    }

    .welcome-logo {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }

    .welcome-message h3 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .welcome-message > p {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .welcome-instructions {
        padding: 16px 20px;
    }

    .welcome-instructions h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .welcome-instructions li {
        font-size: 13px;
        padding: 8px 0;
        padding-left: 24px;
    }

    .message {
        max-width: 95%;
        gap: 10px;
    }

    .message.assistant {
        margin-right: auto;
    }

    .message.user {
        margin-left: auto;
    }

    .message-content {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: anywhere;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .message-content {
        padding: 10px 14px;
        border-radius: 14px;
    }

    .message-text {
        font-size: 13px;
        line-height: 1.5;
    }

    .message-time {
        font-size: 11px;
        margin-top: 4px;
    }

    .input-area {
        padding: 10px 12px;
    }

    .input-container {
        gap: 8px;
    }

    .btn-attach,
    .btn-send {
        width: 40px;
        height: 40px;
    }

    .btn-attach svg,
    .btn-send svg {
        width: 18px;
        height: 18px;
    }

    #message-input {
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 10px;
        min-height: 52px;
        max-height: 160px;
    }

    .file-preview-item {
        padding: 8px 12px;
        font-size: 12px;
    }

    .sidebar {
        width: 260px;
        left: -260px;
        padding: 16px;
    }

    .sidebar-section {
        margin-bottom: 20px;
    }

    .sidebar-section h3 {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .patient-data-item {
        padding: 10px;
        margin-bottom: 10px;
    }

    .patient-data-label {
        font-size: 10px;
    }

    .patient-data-value {
        font-size: 13px;
    }

    .classification-result {
        padding: 12px;
        font-size: 14px;
    }

    .modal-content {
        padding: 32px 24px;
        min-width: auto;
        width: 85%;
        max-width: 300px;
    }

    .loader {
        width: 48px;
        height: 48px;
        border-width: 4px;
    }

    #loading-text {
        font-size: 14px;
    }
}

/* ===============================================
   MEJORAS COSMÉTICAS - Spinner y Animaciones
   =============================================== */

/* Typing Indicator con spinner animado */
.typing-indicator .message-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.typing-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--ngh-teal);
    border-radius: 50%;
    animation: spin-typing 0.8s linear infinite;
}

@keyframes spin-typing {
    to { transform: rotate(360deg); }
}

/* Animación de aparición de mensajes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: slideIn 0.3s ease-out;
}

/* Pulso en el badge de clasificación */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(27, 127, 142, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(27, 127, 142, 0);
    }
}

.classification-badge {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Historial de Conversaciones - Dropdown */
.history-dropdown {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 400px;
    max-height: 600px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border);
}

.history-dropdown.hidden {
    display: none;
}

.history-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    border-radius: 10px 10px 0 0;
}

.history-dropdown-header h3 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.btn-close-history {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.btn-close-history:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.conversation-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
    padding: 16px;
}

.conversation-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--ngh-teal);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.conversation-item:hover {
    background: var(--teal-light);
    transform: translateX(4px);
}

.conversation-item.active {
    background: var(--teal-light);
    border-left-color: var(--ngh-blue);
    font-weight: 600;
}

.conversation-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.conversation-item-date {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.conversation-item-delete {
    color: var(--ngh-red);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.conversation-item-delete:hover {
    background: var(--red-light);
    transform: scale(1.2);
}

.conversation-item-preview {
    font-size: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
}

.conversation-item-badge.badge-low {
    background: #E8F5E9;
    color: #2E7D32;
}

.conversation-item-badge.badge-medium {
    background: #FFF3E0;
    color: #EF6C00;
}

.conversation-item-badge.badge-high {
    background: #FFEBEE;
    color: #C62828;
}

/* Búsqueda y Filtros en Historial */
.history-search-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.history-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.history-search-input:focus {
    outline: none;
    border-color: var(--ngh-teal);
    box-shadow: 0 0 0 3px rgba(27, 127, 142, 0.1);
}

.history-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--teal-light);
    border-color: var(--ngh-teal);
}

.filter-btn.active {
    background: var(--ngh-teal);
    color: white;
    border-color: var(--ngh-teal);
}

/* Responsive para historial dropdown */
@media (max-width: 768px) {
    .history-dropdown {
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 70vh;
    }

    .conversation-history {
        max-height: calc(70vh - 70px);
    }
}

@media (max-width: 480px) {
    .history-dropdown {
        top: 75px;
        right: 5px;
        left: 5px;
        max-height: 80vh;
        width: calc(100vw - 10px);
    }

    .history-dropdown-header h3 {
        font-size: 14px;
    }

    .conversation-history {
        max-height: calc(80vh - 100px);
        padding: 12px;
    }
}

/* Modal de Estadísticas */
.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.stats-modal.hidden {
    display: none;
}

.stats-modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 2px solid var(--border);
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    border-radius: 14px 14px 0 0;
}

.stats-modal-header h2 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.btn-close-stats {
    background: none;
    border: none;
    color: white;
    font-size: 36px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    line-height: 1;
}

.btn-close-stats:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.stats-modal-body {
    padding: 32px;
}

/* Selector de Mes */
.month-selector-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.month-selector-section label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.month-selector {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.month-selector:focus {
    outline: none;
    border-color: var(--ngh-teal);
    box-shadow: 0 0 0 3px rgba(27, 127, 142, 0.1);
}

.btn-export-report {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--ngh-teal);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-export-report:hover {
    background: var(--ngh-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 127, 142, 0.3);
}

.btn-export-report svg {
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.stats-section {
    margin-bottom: 32px;
}

.stats-section h3 {
    font-size: 18px;
    color: var(--ngh-teal);
    margin-bottom: 16px;
    font-weight: 700;
}

.nefarca-chart,
.timeline-chart {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid var(--border);
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.chart-label {
    min-width: 80px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-bar-bg {
    flex: 1;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    border-radius: 8px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

/* Estilos para tarjetas de estadísticas adicionales */
.stat-card-secondary .stat-value {
    color: var(--ngh-blue);
}

.stat-card-warning .stat-value {
    color: #ED6C02;
}

/* Estilos para secciones de estadísticas */
.stats-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-section h3 svg {
    flex-shrink: 0;
}

/* Gráfico de Medicamentos */
.medications-chart {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid var(--border);
}

.medication-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.medication-rank {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--ngh-teal), var(--ngh-blue));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.medication-info {
    flex: 1;
    min-width: 0;
}

.medication-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.medication-bar-bg {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.medication-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ngh-teal), var(--ngh-blue));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.medication-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--ngh-teal);
    flex-shrink: 0;
    min-width: 40px;
    text-align: right;
}

/* Gráfico de Síntomas */
.symptoms-chart {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid var(--border);
}

.symptom-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.symptom-item:hover {
    transform: translateX(4px);
    background: var(--bg-primary);
}

.symptom-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.symptom-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.symptom-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--ngh-teal);
}

.symptom-percentage {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Gráfico de Tendencias */
.trend-chart {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid var(--border);
}

.trend-chart-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding: 20px 0;
}

.trend-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.trend-bar-column {
    width: 100%;
    background: var(--bg-tertiary);
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all 0.5s ease;
    min-height: 20px;
}

.trend-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--ngh-blue), var(--ngh-teal));
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: height 0.6s ease;
}

.trend-bar-value {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.trend-bar-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
}

/* Mapa de Calor */
.heatmap-chart {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid var(--border);
    overflow-x: auto;
}

.heatmap-table {
    width: 100%;
    min-width: 600px;
    border-collapse: separate;
    border-spacing: 4px;
}

.heatmap-table th {
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.heatmap-table td {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.heatmap-table td:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
}

.heatmap-cell-0 {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.heatmap-cell-low {
    background: rgba(46, 125, 50, 0.2);
    color: #2E7D32;
}

.heatmap-cell-medium {
    background: rgba(237, 108, 2, 0.2);
    color: #ED6C02;
}

.heatmap-cell-high {
    background: rgba(196, 30, 58, 0.2);
    color: #C41E3A;
}

.heatmap-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Modo Oscuro */
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

body.dark-mode .chat-header {
    background: #2a2a2a;
    border-bottom-color: #404040;
}

body.dark-mode .message.assistant .message-content {
    background: #2a2a2a;
    border-color: #404040;
}

/* Dark mode para títulos de secciones dentro de mensajes */
body.dark-mode .message-text h3.section-subtitle {
    color: #4FC3F7; /* Azul más claro para dark mode */
}

body.dark-mode .welcome-message {
    background: #2a2a2a;
}

/* Dark mode para Login Screen */
body.dark-mode #login-screen {
    background: linear-gradient(135deg, #0D5F6D 0%, #0a4a55 50%, #1a5c78 100%);
}

body.dark-mode .login-container {
    background: #1a1a1a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .login-header h1 {
    color: #1B7F8E;
}

body.dark-mode .subtitle {
    color: #a0a0a0;
}

body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .form-group input {
    background: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .form-group input::placeholder {
    color: #666;
}

body.dark-mode .form-group input:focus {
    border-color: #1B7F8E;
    background: #333;
}

body.dark-mode .login-footer {
    border-top-color: #404040;
}

body.dark-mode .login-footer p {
    color: #a0a0a0;
}

body.dark-mode .error-message {
    background: rgba(196, 30, 58, 0.15);
    border-left-color: #C41E3A;
}

/* Dark mode para selector de mes */
body.dark-mode .month-selector {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-mode .month-selector option {
    background: #2a2a2a;
    color: #e0e0e0;
}

/* Dark mode para input de mensajes */
body.dark-mode #message-input {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #404040;
}

body.dark-mode #message-input::placeholder {
    color: #666;
}

body.dark-mode #message-input:focus {
    background: #333;
    border-color: #1B7F8E;
}

@media (max-width: 768px) {
    .stats-modal-content {
        width: 95%;
        max-width: calc(100vw - 20px);
        max-height: 90vh;
        margin: 10px;
    }

    .stats-modal-header {
        padding: 16px 20px;
    }

    .stats-modal-header h2 {
        font-size: 20px;
    }

    .stats-modal-body {
        padding: 16px;
    }

    .month-selector-section {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .month-selector-section label {
        font-size: 13px;
    }

    .month-selector {
        width: 100%;
        font-size: 13px;
        padding: 8px 12px;
    }

    .btn-export-report {
        width: 100%;
        justify-content: center;
        font-size: 13px;
        padding: 10px 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 28px;
    }

    .nefarca-chart,
    .timeline-chart {
        padding: 16px;
    }

    .chart-bar {
        gap: 8px;
        margin-bottom: 10px;
    }

    .chart-label {
        min-width: 50px;
        font-size: 12px;
    }

    .chart-bar-bg {
        height: 28px;
    }

    .chart-bar-fill {
        padding: 0 8px;
        font-size: 12px;
    }

    /* Responsivo para nuevos gráficos */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stats-section h3 {
        font-size: 16px;
    }

    .stats-section h3 svg {
        width: 16px;
        height: 16px;
    }

    .medications-chart,
    .symptoms-chart,
    .trend-chart,
    .heatmap-chart {
        padding: 16px;
    }

    .medication-rank {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .medication-name {
        font-size: 13px;
    }

    .medication-count {
        font-size: 16px;
        min-width: 35px;
    }

    .symptom-item {
        padding: 10px 12px;
    }

    .symptom-name {
        font-size: 13px;
    }

    .symptom-count {
        font-size: 14px;
    }

    .symptom-percentage {
        font-size: 11px;
        padding: 3px 6px;
    }

    .trend-chart-container {
        height: 150px;
        gap: 8px;
    }

    .trend-bar-value {
        font-size: 11px;
    }

    .trend-bar-label {
        font-size: 10px;
    }

    .heatmap-table {
        min-width: 500px;
    }

    .heatmap-table th,
    .heatmap-table td {
        padding: 8px 4px;
        font-size: 11px;
    }

    .heatmap-legend {
        flex-wrap: wrap;
        gap: 10px;
    }

    .legend-item {
        font-size: 11px;
    }

    .legend-color {
        width: 16px;
        height: 16px;
    }
}

/* ===============================================
   NUEVAS SECCIONES PROFESIONALES
   =============================================== */

/* Subtítulo de sección */
.section-subtitle {
    text-align: left;
    font-size: 16px;
    color: var(--text-secondary);
    margin: 20px 0 12px 0;
    line-height: 1.6;
}

/* ===============================================
   SECCIÓN DE CREDENCIALES Y MEMBRESÍAS
   =============================================== */

.credentials-section {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

.credentials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.credential-item {
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.04) 0%, rgba(54, 124, 163, 0.02) 100%);
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.credential-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(27, 127, 142, 0.08), transparent);
    transition: left 0.6s ease;
}

.credential-item:hover::before {
    left: 100%;
}

.credential-item:hover {
    transform: translateY(-4px);
    border-color: var(--ngh-teal);
    box-shadow: 0 8px 28px rgba(27, 127, 142, 0.15);
}

.credential-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px auto;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    border-radius: 14px;
    transition: transform 0.3s ease;
}

.credential-icon svg {
    stroke: white;
}

.credential-item:hover .credential-icon {
    transform: scale(1.1) rotate(5deg);
}

.credential-item h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin: 0 0 12px 0;
}

.credential-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ===============================================
   SECCIÓN DEL PROTOCOLO NEFARCA
   =============================================== */

.protocol-section {
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.03) 0%, rgba(54, 124, 163, 0.02) 100%);
    border-radius: 20px;
    padding: 50px 40px;
    border: 1px solid rgba(27, 127, 142, 0.1);
}

.protocol-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 50px;
    align-items: center;
}

.protocol-content h2 {
    margin-bottom: 8px;
}

.protocol-subtitle {
    font-size: 20px;
    font-weight: 600;
    color: var(--ngh-blue);
    margin: 0 0 20px 0;
}

.protocol-description {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.protocol-features {
    display: grid;
    gap: 20px;
}

.protocol-feature {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid var(--ngh-teal);
    transition: all 0.3s ease;
}

.protocol-feature:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-left-color: var(--ngh-blue);
}

.feature-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    color: white;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
}

.feature-content h4 {
    font-size: 17px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin: 0 0 8px 0;
}

.feature-content p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.protocol-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.protocol-badge {
    width: 240px;
    height: 240px;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 40px rgba(27, 127, 142, 0.3);
    position: relative;
    animation: float 6s ease-in-out infinite;
}

.protocol-badge::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    opacity: 0.2;
    filter: blur(20px);
}

.badge-inner {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.badge-inner svg {
    stroke: white;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.badge-inner p {
    font-size: 16px;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-inner strong {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ===============================================
   SECCIÓN DE EQUIPO DIRECTIVO
   =============================================== */

.leadership-section {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
}

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.leader-card {
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.02) 0%, rgba(54, 124, 163, 0.01) 100%);
    border-radius: 16px;
    padding: 32px;
    border: 2px solid var(--border);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.leader-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(27, 127, 142, 0.05), transparent);
    transition: left 0.6s ease;
}

.leader-card:hover::before {
    left: 100%;
}

.leader-card:hover {
    transform: translateY(-6px);
    border-color: var(--ngh-teal);
    box-shadow: 0 12px 40px rgba(27, 127, 142, 0.15);
}

.leader-photo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.leader-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--ngh-teal);
    box-shadow: 0 8px 24px rgba(27, 127, 142, 0.2);
    position: relative;
    transition: transform 0.3s ease;
}

.leader-card:hover .leader-photo {
    transform: scale(1.05);
}

.leader-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}

/* Ajuste para foto de Juan Garcés */
.leader-card:nth-child(2) .leader-photo img {
    object-position: center top;
}

.photo-placeholder {
    display: none;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ngh-teal) 0%, var(--ngh-blue) 100%);
    align-items: center;
    justify-content: center;
}

.photo-placeholder svg {
    stroke: white;
    opacity: 0.7;
}

.leader-info {
    text-align: center;
}

.leader-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--ngh-teal);
    margin: 0 0 8px 0;
}

.leader-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ngh-blue);
    margin: 0 0 24px 0;
}

.leader-credentials {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.credential-badge {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 10px;
    border-left: 3px solid var(--ngh-teal);
    transition: all 0.3s ease;
}

.credential-badge:hover {
    transform: translateX(4px);
    background: rgba(27, 127, 142, 0.05);
    border-left-color: var(--ngh-blue);
}

.credential-badge svg {
    flex-shrink: 0;
    stroke: var(--ngh-teal);
    margin-top: 2px;
}

.credential-badge span {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===============================================
   RESPONSIVE - NUEVAS SECCIONES
   =============================================== */

@media (max-width: 1024px) {
    .credentials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .protocol-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .protocol-visual {
        order: -1;
    }

    .protocol-badge {
        width: 200px;
        height: 200px;
    }

    .leadership-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .credentials-section,
    .protocol-section,
    .leadership-section {
        padding: 40px 24px;
    }

    .credentials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .protocol-badge {
        width: 180px;
        height: 180px;
    }

    .badge-inner svg {
        width: 60px;
        height: 60px;
    }

    .badge-inner p {
        font-size: 14px;
    }

    .badge-inner strong {
        font-size: 20px;
    }

    .leader-photo {
        width: 140px;
        height: 140px;
    }

    .leadership-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .leader-card {
        padding: 24px;
    }

    .protocol-container {
        gap: 30px;
    }

    .protocol-features {
        gap: 16px;
    }

    .protocol-feature {
        padding: 16px;
        gap: 16px;
    }

    .feature-number {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .section-subtitle {
        font-size: 15px;
        margin: -12px auto 32px auto;
    }
}

@media (max-width: 480px) {
    .credentials-section,
    .protocol-section,
    .leadership-section {
        padding: 32px 20px;
        border-radius: 16px;
    }

    .leader-photo {
        width: 120px;
        height: 120px;
    }

    .leader-name {
        font-size: 20px;
    }

    .leader-title {
        font-size: 15px;
    }

    .credential-badge {
        padding: 10px 14px;
        gap: 10px;
    }

    .credential-badge span {
        font-size: 13px;
    }

    .protocol-subtitle {
        font-size: 18px;
    }

    .protocol-description {
        font-size: 15px;
    }
}

/* ============================================
   DECORACIÓN NAVIDEÑA MEJORADA
   ============================================ */

.christmas-decorations {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    overflow: hidden;
}

/* Ocultar decoraciones cuando el chat está activo */
body:has(#chat-screen.active) .christmas-decorations,
body:has(#chat-screen.active) .christmas-lights-string,
body:has(#chat-screen.active) .christmas-frost-overlay {
    display: none;
}

/* Efecto de escarcha sutil en los bordes */
.christmas-frost-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at top left, rgba(200, 230, 255, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at top right, rgba(200, 230, 255, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at bottom left, rgba(200, 230, 255, 0.1) 0%, transparent 35%),
        radial-gradient(ellipse at bottom right, rgba(200, 230, 255, 0.1) 0%, transparent 35%);
}

/* ===== COPOS DE NIEVE (3 CAPAS) ===== */
.snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.snowflake {
    position: absolute;
    top: -5%;
    width: 30px;
    height: 30px;
    animation: snowfall linear infinite, snowRotate 4s linear infinite;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.9)) drop-shadow(0 0 15px rgba(200,230,255,0.6));
}

.snowflake::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23ffffff' stroke='%23e0f2ff' stroke-width='2'%3E%3Cline x1='50' y1='10' x2='50' y2='90' /%3E%3Cline x1='10' y1='50' x2='90' y2='50' /%3E%3Cline x1='25' y1='25' x2='75' y2='75' /%3E%3Cline x1='25' y1='75' x2='75' y2='25' /%3E%3Ccircle cx='50' cy='10' r='5' /%3E%3Ccircle cx='50' cy='90' r='5' /%3E%3Ccircle cx='10' cy='50' r='5' /%3E%3Ccircle cx='90' cy='50' r='5' /%3E%3Ccircle cx='25' cy='25' r='4' /%3E%3Ccircle cx='75' cy='75' r='4' /%3E%3Ccircle cx='25' cy='75' r='4' /%3E%3Ccircle cx='75' cy='25' r='4' /%3E%3Ccircle cx='50' cy='50' r='6' /%3E%3C/g%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Capa 1 - Fondo (más pequeños, más lentos) */
.snowflakes-layer-1 {
    z-index: 100;
}

.snowflakes-layer-1 .snowflake {
    opacity: 0.85;
}

.snowflakes-layer-1 .snowflake:nth-child(1) { left: 3%; animation-duration: 20s, 4s; animation-delay: 0s; }
.snowflakes-layer-1 .snowflake:nth-child(2) { left: 12%; animation-duration: 22s, 3.5s; animation-delay: 3s; }
.snowflakes-layer-1 .snowflake:nth-child(3) { left: 20%; animation-duration: 19s, 4.2s; animation-delay: 6s; }
.snowflakes-layer-1 .snowflake:nth-child(4) { left: 30%; animation-duration: 21s, 3.8s; animation-delay: 2s; }
.snowflakes-layer-1 .snowflake:nth-child(5) { left: 42%; animation-duration: 23s, 4.5s; animation-delay: 5s; }
.snowflakes-layer-1 .snowflake:nth-child(6) { left: 54%; animation-duration: 20s, 3.2s; animation-delay: 8s; }
.snowflakes-layer-1 .snowflake:nth-child(7) { left: 65%; animation-duration: 22s, 4.8s; animation-delay: 4s; }
.snowflakes-layer-1 .snowflake:nth-child(8) { left: 76%; animation-duration: 21s, 3.6s; animation-delay: 7s; }
.snowflakes-layer-1 .snowflake:nth-child(9) { left: 84%; animation-duration: 19s, 4.1s; animation-delay: 1s; }
.snowflakes-layer-1 .snowflake:nth-child(10) { left: 91%; animation-duration: 23s, 3.9s; animation-delay: 9s; }
.snowflakes-layer-1 .snowflake:nth-child(11) { left: 96%; animation-duration: 20s, 4.3s; animation-delay: 5.5s; }
.snowflakes-layer-1 .snowflake:nth-child(12) { left: 8%; animation-duration: 22s, 3.7s; animation-delay: 11s; }

/* Capa 2 - Media (tamaño medio, velocidad media) */
.snowflakes-layer-2 {
    z-index: 101;
}

.snowflakes-layer-2 .snowflake {
    opacity: 0.9;
    transform: scale(1.5);
}

.snowflakes-layer-2 .snowflake:nth-child(1) { left: 7%; animation-duration: 14s, 5s; animation-delay: 1s; }
.snowflakes-layer-2 .snowflake:nth-child(2) { left: 18%; animation-duration: 16s, 4.5s; animation-delay: 4s; }
.snowflakes-layer-2 .snowflake:nth-child(3) { left: 28%; animation-duration: 13s, 5.2s; animation-delay: 2s; }
.snowflakes-layer-2 .snowflake:nth-child(4) { left: 39%; animation-duration: 15s, 4.8s; animation-delay: 6s; }
.snowflakes-layer-2 .snowflake:nth-child(5) { left: 51%; animation-duration: 14s, 5.5s; animation-delay: 3s; }
.snowflakes-layer-2 .snowflake:nth-child(6) { left: 63%; animation-duration: 16s, 4.2s; animation-delay: 5s; }
.snowflakes-layer-2 .snowflake:nth-child(7) { left: 74%; animation-duration: 15s, 5.8s; animation-delay: 7s; }
.snowflakes-layer-2 .snowflake:nth-child(8) { left: 85%; animation-duration: 14s, 4.6s; animation-delay: 2s; }
.snowflakes-layer-2 .snowflake:nth-child(9) { left: 93%; animation-duration: 13s, 5.1s; animation-delay: 8s; }
.snowflakes-layer-2 .snowflake:nth-child(10) { left: 45%; animation-duration: 16s, 4.9s; animation-delay: 10s; }

/* Capa 3 - Frente (más grandes, más rápidos) */
.snowflakes-layer-3 {
    z-index: 102;
}

.snowflakes-layer-3 .snowflake {
    opacity: 1;
    transform: scale(2.2);
}

.snowflakes-layer-3 .snowflake:nth-child(1) { left: 5%; animation-duration: 9s, 6s; animation-delay: 0s; }
.snowflakes-layer-3 .snowflake:nth-child(2) { left: 18%; animation-duration: 10s, 5.5s; animation-delay: 2s; }
.snowflakes-layer-3 .snowflake:nth-child(3) { left: 32%; animation-duration: 8s, 6.2s; animation-delay: 4s; }
.snowflakes-layer-3 .snowflake:nth-child(4) { left: 47%; animation-duration: 11s, 5.8s; animation-delay: 1s; }
.snowflakes-layer-3 .snowflake:nth-child(5) { left: 61%; animation-duration: 9s, 6.5s; animation-delay: 3s; }
.snowflakes-layer-3 .snowflake:nth-child(6) { left: 75%; animation-duration: 10s, 5.2s; animation-delay: 5s; }
.snowflakes-layer-3 .snowflake:nth-child(7) { left: 88%; animation-duration: 8s, 6.8s; animation-delay: 2.5s; }
.snowflakes-layer-3 .snowflake:nth-child(8) { left: 95%; animation-duration: 11s, 5.6s; animation-delay: 6s; }

@keyframes snowfall {
    0% {
        top: -5%;
        transform: translateX(0);
    }
    25% {
        transform: translateX(25px);
    }
    50% {
        transform: translateX(-25px);
    }
    75% {
        transform: translateX(18px);
    }
    100% {
        top: 105%;
        transform: translateX(0);
    }
}

@keyframes snowRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== LUCES NAVIDEÑAS ===== */
.christmas-lights-string {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 250;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 8%,
            rgba(50, 50, 50, 0.4) 8%,
            rgba(50, 50, 50, 0.4) 10%
        ),
        linear-gradient(to bottom, rgba(26, 92, 46, 0.4) 0%, rgba(26, 92, 46, 0.2) 50%, transparent 100%);
}

.christmas-lights-string::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        #2d5016 0px,
        #2d5016 10px,
        #1a3a0f 10px,
        #1a3a0f 20px
    );
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    z-index: -1;
}

.christmas-light {
    width: 22px;
    height: 28px;
    border-radius: 40% 40% 50% 50%;
    position: relative;
    animation: lightGlow 1.2s ease-in-out infinite;
    box-shadow: 0 0 40px currentColor, 0 0 60px currentColor, 0 0 100px currentColor;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.christmas-light::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.christmas-light::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 8px;
    background: #2d5016;
}

.light-red {
    background: radial-gradient(circle, #FF0040 0%, #DC143C 70%, #A0102A 100%);
    color: #FF0040;
}

.light-gold {
    background: radial-gradient(circle, #FFED4E 0%, #FFD700 70%, #D4AF37 100%);
    color: #FFED4E;
}

.light-green {
    background: radial-gradient(circle, #4AFF4A 0%, #2ECC40 70%, #2d5016 100%);
    color: #4AFF4A;
}

.light-blue {
    background: radial-gradient(circle, #00E5FF 0%, #00A7E1 70%, #0074A0 100%);
    color: #00E5FF;
}

/* Delays individuales para cada luz */
.christmas-light:nth-child(1) { animation-delay: 0s; }
.christmas-light:nth-child(2) { animation-delay: 0.2s; }
.christmas-light:nth-child(3) { animation-delay: 0.4s; }
.christmas-light:nth-child(4) { animation-delay: 0.1s; }
.christmas-light:nth-child(5) { animation-delay: 0.6s; }
.christmas-light:nth-child(6) { animation-delay: 0.3s; }
.christmas-light:nth-child(7) { animation-delay: 0.8s; }
.christmas-light:nth-child(8) { animation-delay: 0.5s; }
.christmas-light:nth-child(9) { animation-delay: 0.7s; }
.christmas-light:nth-child(10) { animation-delay: 0.2s; }
.christmas-light:nth-child(11) { animation-delay: 0.9s; }
.christmas-light:nth-child(12) { animation-delay: 0.4s; }
.christmas-light:nth-child(13) { animation-delay: 0.1s; }
.christmas-light:nth-child(14) { animation-delay: 0.6s; }
.christmas-light:nth-child(15) { animation-delay: 0.3s; }

@keyframes lightGlow {
    0%, 100% {
        opacity: 1;
        filter: brightness(2.5) saturate(1.5);
        transform: scale(1.15);
    }
    50% {
        opacity: 0.85;
        filter: brightness(1.2) saturate(1.2);
        transform: scale(0.95);
    }
}

/* ===== ÁRBOLES DE NAVIDAD ===== */
.christmas-tree {
    position: fixed;
    pointer-events: none;
    z-index: 11;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    animation: gentleFloat 8s ease-in-out infinite;
}

.tree-left-1 {
    bottom: 3%;
    left: 1%;
}

.tree-right-1 {
    bottom: 3%;
    right: 1%;
    animation-delay: 1.5s;
}

.ornament-glow {
    animation: ornamentShine 2s ease-in-out infinite;
}

@keyframes ornamentShine {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.7;
        filter: brightness(1.5) drop-shadow(0 0 3px currentColor);
    }
}

/* ===== REGALOS ===== */
.christmas-gifts-stack {
    position: fixed;
    pointer-events: none;
    z-index: 11;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
    animation: gentleFloat 7s ease-in-out infinite;
}

.gift-stack-left {
    bottom: 22%;
    left: 2%;
    animation-delay: 0.5s;
}

.gift-stack-right {
    bottom: 38%;
    right: 2%;
    animation-delay: 2s;
}

/* ===== PERSONAJES ===== */
.christmas-character {
    position: fixed;
    pointer-events: none;
    z-index: 11;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
    animation: characterFloat 6s ease-in-out infinite;
}

.santa-big {
    top: 20%;
    right: 2%;
    animation-delay: 1s;
}

.snowman-big {
    bottom: 42%;
    left: 2%;
    animation-delay: 2.5s;
}

@keyframes characterFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-12px) rotate(2deg);
    }
    66% {
        transform: translateY(-8px) rotate(-2deg);
    }
}

/* ===== CAMPANAS ===== */
.christmas-bells {
    position: fixed;
    pointer-events: none;
    z-index: 11;
    animation: bellSwing 4s ease-in-out infinite;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
}

.bells-left {
    top: 12%;
    left: 2%;
}

@keyframes bellSwing {
    0%, 100% {
        transform: rotate(-8deg);
    }
    50% {
        transform: rotate(8deg);
    }
}

/* ===== ESTRELLAS BRILLANTES ===== */
.sparkle {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #FFD700;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: sparkleAnim 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 110;
    box-shadow: 0 0 20px #FFD700, 0 0 40px #FFD700, 0 0 60px #FFD700;
}

.sparkle-1 { top: 15%; left: 10%; animation-delay: 0s; }
.sparkle-2 { top: 35%; right: 8%; animation-delay: 0.5s; }
.sparkle-3 { top: 50%; left: 5%; animation-delay: 1s; }
.sparkle-4 { top: 65%; right: 10%; animation-delay: 1.5s; }
.sparkle-5 { top: 25%; left: 7%; animation-delay: 0.7s; }
.sparkle-6 { top: 55%; right: 5%; animation-delay: 1.2s; }
.sparkle-7 { top: 75%; left: 8%; animation-delay: 0.3s; }
.sparkle-8 { top: 85%; right: 8%; animation-delay: 1.8s; }

@keyframes sparkleAnim {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg);
    }
}

/* ===== BASTONES DE CARAMELO ===== */
.candy-cane {
    position: fixed;
    pointer-events: none;
    z-index: 11;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: caneSwing 5s ease-in-out infinite;
}

.cane-1 {
    top: 35%;
    left: 2%;
    animation-delay: 0s;
}

.cane-2 {
    top: 60%;
    right: 2%;
    animation-delay: 1.5s;
    transform: scaleX(-1);
}

@keyframes caneSwing {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* ===== ACEBO DECORATIVO ===== */
.holly {
    position: fixed;
    pointer-events: none;
    z-index: 11;
    opacity: 0.9;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
    animation: gentleFloat 9s ease-in-out infinite;
}

.holly-1 {
    top: 10%;
    left: 8%;
    animation-delay: 0.5s;
}

.holly-2 {
    bottom: 10%;
    right: 8%;
    animation-delay: 2s;
}

@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .christmas-tree,
    .christmas-character,
    .christmas-gifts-stack,
    .christmas-bells,
    .candy-cane,
    .holly {
        transform: scale(0.55);
    }

    .tree-left-1 { left: -5%; bottom: 1%; }
    .tree-right-1 { right: -5%; bottom: 1%; }
    .santa-big { right: -5%; top: 16%; }
    .snowman-big { left: -5%; bottom: 38%; }
    .gift-stack-left { left: -3%; bottom: 18%; }
    .gift-stack-right { right: -3%; bottom: 33%; }
    .bells-left { left: -3%; top: 9%; }
    .cane-1 { left: -2%; top: 33%; }
    .cane-2 { right: -2%; top: 58%; }
    .holly-1 { left: 2%; top: 7%; }
    .holly-2 { right: 2%; bottom: 6%; }

    .christmas-light {
        width: 9px;
        height: 12px;
    }

    .sparkle {
        width: 3px;
        height: 3px;
    }

    .sparkle-1 { left: 3%; }
    .sparkle-2 { right: 2%; }
    .sparkle-3 { left: 1%; }
    .sparkle-4 { right: 3%; }
    .sparkle-5 { left: 2%; }
    .sparkle-6 { right: 1%; }
    .sparkle-7 { left: 2%; }
    .sparkle-8 { right: 2%; }
}


/* ========================================
   SISTEMA HÍBRIDO: FORMULARIO + CHAT
   ======================================== */

/* Formulario Estructurado */
.structured-form-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}

.form-header h3 {
    font-size: 20px;
    color: #1B7F8E;
    margin: 0 0 8px 0;
}

.form-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.nefarca-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Fila de campos (edad, sexo, estancia) */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-field label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-field input,
.form-field select {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: #1B7F8E;
}

/* Secciones de lista dinámica */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-section textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    resize: vertical;
    transition: border-color 0.2s;
}

.form-section textarea:focus {
    outline: none;
    border-color: #1B7F8E;
    box-shadow: 0 0 0 3px rgba(27, 127, 142, 0.1);
}

.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.list-item input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.list-item input:focus {
    outline: none;
    border-color: #1B7F8E;
}

.btn-remove-item {
    width: 36px;
    height: 36px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-remove-item:hover {
    background: #cc0000;
}

.btn-add-item {
    align-self: flex-start;
    padding: 8px 16px;
    background: #f0f0f0;
    color: #1B7F8E;
    border: 2px dashed #1B7F8E;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-item:hover {
    background: #1B7F8E;
    color: white;
    border-style: solid;
}

/* Botón de Clasificar */
.btn-classify {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #1B7F8E 0%, #367CA3 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(27, 127, 142, 0.3);
}

.btn-classify:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 127, 142, 0.4);
}

.btn-classify:active {
    transform: translateY(0);
}

/* Panel de Resultado Deslizable desde la Derecha */
.result-panel {
    position: fixed;
    top: 100px;
    right: 0;
    width: 550px;
    max-width: 90vw;
    height: calc(100vh - 120px);
    background: #FAFAFA;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    border-left: 1px solid #E0E0E0;
}

/* Cuando está minimizado, se esconde a la derecha */
.result-panel.minimized {
    transform: translateX(calc(100% - 40px));
}

/* Pestaña lateral (siempre visible) */
.result-panel-tab {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: #1B7F8E;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.result-panel-tab:hover {
    background: #16676e;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
}

.result-panel-tab svg {
    color: white;
    opacity: 0.9;
}

/* Contenido del panel */
.result-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-panel-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 14px;
    background: white;
}

/* Estilos mejorados para el contenido del panel */
.result-panel-body h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1B7F8E;
    margin: 24px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #E0E0E0;
    text-align: left;
}

.result-panel-body strong {
    color: #2C3E50;
    font-weight: 600;
}

.result-panel-body .conduct-item {
    margin: 8px 0;
    padding: 10px 12px 10px 32px;
    background: #F8F9FA;
    border-left: 3px solid #1B7F8E;
    border-radius: 4px;
}

.result-panel-body .conduct-item::before {
    left: 12px;
    font-size: 16px;
}

/* Botón Flotante del Chat (Estilo WhatsApp) */
.btn-float-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1B7F8E 0%, #367CA3 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(27, 127, 142, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.btn-float-chat:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(27, 127, 142, 0.5);
}

.btn-float-chat:active {
    transform: scale(0.95);
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Modal del Chat */
.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.chat-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.chat-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    max-height: 700px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1B7F8E 0%, #367CA3 100%);
    color: white;
    flex-shrink: 0;
}

.chat-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.btn-close-chat-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-chat-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chat-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-modal-body .messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.chat-modal-body .input-area {
    flex-shrink: 0;
    padding: 16px;
    border-top: 2px solid #e0e0e0;
    background: #f9f9f9;
}

/* Chat Desplegable */
.chat-collapsible-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 70vh;
}

.chat-collapsible-section.collapsed {
    max-height: auto;
}

.chat-collapsible-section.collapsed .chat-content {
    display: none;
}

.btn-toggle-chat {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.1) 0%, rgba(54, 124, 163, 0.1) 100%);
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #1B7F8E;
    transition: background 0.2s;
}

.btn-toggle-chat:hover {
    background: linear-gradient(135deg, rgba(27, 127, 142, 0.15) 0%, rgba(54, 124, 163, 0.15) 100%);
}

.btn-toggle-chat span {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chevron-icon {
    transition: transform 0.3s ease;
}

.chat-collapsible-section:not(.collapsed) .chevron-icon {
    transform: rotate(180deg);
}

.chat-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(70vh - 60px);
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .structured-form-section {
        padding: 16px;
    }

    .btn-classify {
        font-size: 14px;
        padding: 12px 20px;
    }

    /* Panel de resultado en móviles - ocupa toda la pantalla */
    .result-panel {
        top: 60px;
        right: -100vw;
        width: 100vw;
        height: calc(100vh - 60px);
    }

    .result-panel.open {
        right: 0;
    }

    .result-panel.minimized {
        right: calc(-100vw + 50px);
    }

    .result-panel-tab {
        left: -50px;
    }

    .result-panel-body {
        padding: 16px;
    }

    /* Modal del chat en móviles */
    .chat-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    /* Botón flotante en móviles */
    .btn-float-chat {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Dark Mode */
body.dark-mode .structured-form-section,
body.dark-mode .chat-collapsible-section {
    background: #2d2d2d;
}

/* Panel de resultado - modo oscuro */
body.dark-mode .result-panel-content {
    background: #2d2d2d;
}

body.dark-mode .result-panel-body {
    background: #242424;
    color: #e0e0e0;
}

body.dark-mode .chat-modal-content {
    background: #2d2d2d;
}

body.dark-mode .chat-modal-body .input-area {
    background: #242424;
    border-top-color: #444;
}

body.dark-mode .chat-modal-body .messages-container {
    background: #2d2d2d;
}

body.dark-mode .form-header h3 {
    color: #4db8c9;
}

body.dark-mode .form-subtitle,
body.dark-mode .section-label,
body.dark-mode .form-field label {
    color: #e0e0e0;
}

body.dark-mode .form-field input,
body.dark-mode .form-field select,
body.dark-mode .list-item input,
body.dark-mode .form-section textarea {
    background: #1a1a1a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .btn-toggle-chat {
    background: linear-gradient(135deg, rgba(77, 184, 201, 0.15) 0%, rgba(77, 184, 201, 0.1) 100%);
    color: #4db8c9;
}

body.dark-mode .btn-add-item {
    background: #1a1a1a;
    color: #4db8c9;
    border-color: #4db8c9;
}
