/* ============================================
   DRP-GAMP CATEGORIZADOR - ESTILOS PRINCIPALES
   ============================================ */

/* === VARIABLES DE COLOR === */
:root {
    --azul-oscuro: #213B50;
    --azul-medio: #405A75;
    --gris-azulado: #AFBDC8;
    --fondo: #EEF3F4;
    --texto: #393939;
    --verde-lima: #C2E03B;
    --blanco: #FFFFFF;

    /* Monitor oscuro */
    --monitor-bg: #1a2332;
    --monitor-card: #252f3f;
    --monitor-border: rgba(255, 255, 255, 0.1);
    --naranja: #FFA500;
    --rojo: #FF6B6B;
}

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

/* === ESTRUCTURA BASE === */
html,
body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--fondo);
    color: var(--texto);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
.header {
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-medio));
    color: var(--blanco);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

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

.header-main {
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

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

.user-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.company-name {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    color: var(--blanco);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 3px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-logout:hover {
    background: var(--verde-lima);
    color: var(--azul-oscuro);
    border-color: var(--verde-lima);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 224, 59, 0.3);
}



/* === CONTENEDOR PRINCIPAL === */
.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* === FOOTER === */
.footer {
    background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--monitor-bg) 100%);
    color: var(--blanco);
    padding: 30px 20px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo h3 {
    color: var(--verde-lima);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-divider {
    width: 100px;
    height: 2px;
    background: var(--verde-lima);
    margin: 20px auto;
    opacity: 0.5;
}

.footer-info {
    margin-top: 20px;
}

.footer-info p {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.footer-info strong {
    color: var(--verde-lima);
    font-weight: 600;
}

.footer-copyright {
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    margin-top: 15px !important;
}

.footer-legal {
    font-size: 0.8rem !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic;
    margin-top: 10px !important;
}

/* ============================================
   PÁGINA DE LOGIN
   ============================================ */
.login-container {
    max-width: 500px;
    margin: 60px auto;
    background: var(--blanco);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    color: var(--azul-oscuro);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

/* ============================================
   PÁGINA DE REGISTRO
   ============================================ */
.registration-container {
    max-width: 900px;
    margin: 0 auto;
}

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    gap: 30px;
}

.step {
    display: flex;
    align-items: center;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 8px;
}

.step.active .step-number {
    background: var(--azul-oscuro);
    color: var(--blanco);
}

.step.completed .step-number {
    background: var(--verde-lima);
    color: var(--azul-oscuro);
}

.form-step {
    background: var(--blanco);
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.form-step h2 {
    color: var(--azul-oscuro);
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

/* ============================================
   ELEMENTOS DE FORMULARIO
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--azul-oscuro);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--azul-medio);
    box-shadow: 0 0 0 3px rgba(64, 90, 117, 0.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

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

/* ============================================
   BOTONES
   ============================================ */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--azul-oscuro);
    color: var(--blanco);
}

.btn-primary:hover {
    background: var(--azul-medio);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 59, 80, 0.2);
}

.btn-secondary {
    background: var(--gris-azulado);
    color: var(--blanco);
}

.btn-secondary:hover {
    background: var(--azul-medio);
}

.btn-success {
    background: var(--verde-lima);
    color: var(--azul-oscuro);
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* ============================================
   PÁGINA DE CATEGORIZACIÓN
   ============================================ */

/* Barra de progreso superior */
.progress-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-bottom: 20px;
    background: var(--blanco);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    z-index: 2;
}

.progress-step.active .step-circle {
    background: var(--azul-oscuro);
    color: var(--blanco);
    box-shadow: 0 0 0 4px rgba(33, 59, 80, 0.2);
}

.progress-step.completed .step-circle {
    background: var(--verde-lima);
    color: var(--azul-oscuro);
}

.step-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: var(--azul-oscuro);
    font-weight: 600;
}

.progress-step.completed .step-label {
    color: var(--verde-lima);
}

.progress-line {
    width: 150px;
    height: 3px;
    background: #e5e7eb;
    margin: 0 -30px;
    margin-top: -28px;
    z-index: 1;
}

.progress-line.completed {
    background: var(--verde-lima);
}

/* Layout de 3 columnas */
.main-content {
    display: grid;
    grid-template-columns: minmax(400px, 1fr) minmax(400px, 1fr) 400px;
    gap: 20px;
    margin-bottom: 40px;
}

.column {
    background: var(--blanco);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    min-height: 850px;
    height: calc(100vh - 320px);
}

/* === COLUMNA 1: PREGUNTAS === */
.questions-column {
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.question-number {
    background: var(--azul-oscuro);
    color: var(--blanco);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.question-category {
    color: var(--azul-medio);
    font-size: 0.9rem;
}

.question-text {
    font-size: 1.5rem;
    color: var(--azul-oscuro);
    margin-bottom: 15px;
    line-height: 1.3;
    font-weight: 600;
}

.question-description {
    color: #6b7280;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.options-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.option-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-item:hover {
    border-color: var(--azul-medio);
    background: var(--blanco);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.option-item.selected {
    border-color: var(--azul-oscuro);
    background: var(--blanco);
    box-shadow: 0 0 0 3px rgba(33, 59, 80, 0.1);
}

.option-title {
    font-weight: 600;
    color: var(--azul-oscuro);
    margin-bottom: 6px;
    font-size: 1rem;
}

.option-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 6px;
}

.option-examples {
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

/* === COLUMNA 2: HELPER === */
.helper-column {
    padding: 30px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
}

.helper-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.helper-avatar {
    width: 40px;
    height: 40px;
    background: var(--azul-oscuro);
    color: var(--blanco);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

.helper-header h3 {
    color: var(--azul-oscuro);
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.help-levels {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.help-level-btn {
    padding: 6px 14px;
    border: 1.5px solid #d1d5db;
    background: var(--blanco);
    color: #6b7280;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.help-level-btn.active {
    background: var(--azul-oscuro);
    color: var(--blanco);
    border-color: var(--azul-oscuro);
}

.help-content {
    background: var(--blanco);
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    overflow-y: auto;
}

.help-content h4 {
    color: var(--azul-oscuro);
    margin-bottom: 15px;
    font-size: 1rem;
}

.help-content strong {
    color: var(--azul-oscuro);
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
}

.help-content small {
    display: block;
    color: #6b7280;
    margin-left: 12px;
    line-height: 1.6;
    font-size: 0.85rem;
}

/* === COLUMNA 3: MONITOR ANALYTICS === */
.monitor-column {
    background: var(--monitor-bg) !important;
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.monitor-header {
    background: linear-gradient(135deg, #2a3445 0%, var(--monitor-bg) 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--monitor-border);
}

.monitor-title {
    color: var(--blanco);
    font-size: 1.1rem;
    font-weight: 600;
}

.status-indicator {
    background: var(--verde-lima);
    color: var(--monitor-bg);
    padding: 5px 14px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Sección Confianza */
.confidence-section {
    background: var(--monitor-card);
    margin: 20px;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--monitor-border);
}

.section-title {
    color: #8892a0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.confidence-display {
    font-size: 3rem !important;
    font-weight: 700;
    color: var(--verde-lima) !important;
    text-align: center;
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(194, 224, 59, 0.5);
}

.confidence-meter {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.confidence-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ffa500 50%, var(--verde-lima) 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.confidence-labels {
    display: flex;
    justify-content: space-between;
    color: #6b7280;
    font-size: 0.7rem;
    margin-bottom: 10px;
}

.confidence-status {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 10px;
}

.confidence-status span {
    margin: 0 10px;
}

/* Sección Predicción */
.prediction-section {
    background: var(--monitor-card);
    margin: 0 20px 20px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--monitor-border);
}

.category-bar {
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
    margin-bottom: 15px;
    color: var(--blanco);
}

.category-bar span:first-child {
    color: #8892a0;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.category-bar span:last-child {
    text-align: right;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Contenedor de la barra de progreso */
.category-progress {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Barra de progreso interna con gradiente universal */
.category-progress-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    
    /* Gradiente único de gris-azulado a verde-lima */
    background: linear-gradient(90deg, 
        var(--gris-azulado) 0%,
        var(--azul-medio) 50%,
        var(--verde-lima) 100%);
}

/* Efecto shimmer animado para todas las barras */
.category-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%);
    animation: shimmer 3s infinite;
}

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

/* Categoría líder (la de mayor porcentaje) */
.category-bar.leading span:first-child {
    color: var(--verde-lima);
    font-size: 0.9rem;
    font-weight: 600;
}

.category-bar.leading span:last-child {
    color: var(--verde-lima);
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(194, 224, 59, 0.3);
}

/* Animación de pulso para la categoría líder */
.category-bar.leading .category-progress-bar {
    animation: pulse 2s ease-in-out infinite;
}

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

/* Estados de las barras según porcentaje */
.category-progress-bar.low {
    opacity: 0.7;
}

.category-progress-bar.medium {
    opacity: 0.85;
}

.category-progress-bar.high {
    opacity: 1;
    box-shadow: 0 0 20px rgba(194, 224, 59, 0.3);
}

/* Sección Ruta de Decisión */
.route-section {
    background: var(--monitor-card);
    margin: 0 20px 20px;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--monitor-border);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.decision-map {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--monitor-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 80px;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--verde-lima);
}

.metrics {
    display: flex;
    justify-content: space-between;
    color: var(--verde-lima);
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 1fr 1fr minmax(350px, 400px);
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .column {
        height: auto;
        min-height: 400px;
        max-height: 600px;
    }

    .monitor-column {
        order: -1;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .footer {
        padding: 20px 15px;
    }

    .footer-logo h3 {
        font-size: 1.1rem;
    }

    .footer-info p {
        font-size: 0.85rem;
    }
}

/* Helper avatar con imagen */
.helper-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--verde-lima);
    background: white;
    padding: 2px;
}

/* Hover effect para la imagen */
.helper-avatar:hover img {
    transform: scale(1.1);
    transition: transform 0.3s ease;
    border-color: var(--azul-medio);
}

/* Mejoras visuales para el helper */
.help-level-content {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.help-level-content::-webkit-scrollbar {
    width: 6px;
}

.help-level-content::-webkit-scrollbar-track {
    background: var(--fondo);
    border-radius: 3px;
}

.help-level-content::-webkit-scrollbar-thumb {
    background: var(--gris-azulado);
    border-radius: 3px;
}

.help-level-content::-webkit-scrollbar-thumb:hover {
    background: var(--azul-medio);
}

/* GLOSARIO STYLES */
.btn-glossary {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--verde-lima);
    color: var(--texto);
}

.btn-glossary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 224, 59, 0.3);
}

/* GLOSARIO - TEXTO OSCURO Y LEGIBLE */
.glossary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--azul-medio);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glossary-container {
    background: #FFFFFF;
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 3px var(--verde-lima), 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 100000;
}

.glossary-header {
    background: var(--azul-oscuro);
    color: #FFFFFF; /* Blanco puro */
    padding: 20px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glossary-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #FFFFFF; /* Blanco puro */
}

.glossary-close {
    background: white;
    color: var(--azul-oscuro);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.glossary-search {
    padding: 20px 30px;
    background: #F8F9FA;
    border-bottom: 3px solid var(--verde-lima);
}

.glossary-search input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #888888; /* Borde más oscuro */
    border-radius: 8px;
    font-size: 16px;
    background: white;
    color: #000000; /* Texto negro */
}

.glossary-search input::placeholder {
    color: #666666; /* Placeholder más oscuro */
}

.glossary-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    background: #FFFFFF;
}

.glossary-category-title {
    color: #213B50; /* Azul oscuro directo */
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--verde-lima);
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1); /* Sombra para mejor legibilidad */
}

.glossary-term {
    background: #F5F5F5; /* Gris claro */
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 5px solid var(--verde-lima);
    border: 1px solid #CCCCCC; /* Borde gris */
}

.glossary-term-header strong {
    color: #000000; /* Negro puro */
    font-size: 18px;
    font-weight: bold;
}

.glossary-acronym {
    color: #213B50; /* Azul oscuro */
    font-style: italic;
    margin-left: 10px;
    font-size: 14px;
    font-weight: normal;
}

.glossary-definition {
    color: #1A1A1A; /* Casi negro */
    line-height: 1.6;
    margin: 10px 0;
    font-size: 15px;
    font-weight: 400;
}

.glossary-context {
    color: #2C3E50; /* Gris oscuro azulado */
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(64, 90, 117, 0.1);
    border-radius: 4px;
    font-weight: 500;
}

.glossary-context strong {
    color: #000000; /* Negro para los títulos */
    font-weight: bold;
}

.glossary-example {
    color: #2C3E50; /* Gris oscuro */
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(194, 224, 59, 0.2);
    border-radius: 4px;
    font-weight: 500;
}

.glossary-example strong {
    color: #000000; /* Negro para los títulos */
    font-weight: bold;
}

.glossary-related {
    color: #405A75; /* Azul medio oscuro */
    font-size: 13px;
    margin-top: 8px;
    font-style: italic;
    font-weight: 500;
}

.glossary-related strong {
    color: #000000;
    font-weight: bold;
}

/* Asegurar que TODO el texto sea oscuro */
.glossary-container * {
    color: #1A1A1A; /* Casi negro por defecto */
}

/* Excepto el header que debe ser blanco */
.glossary-header * {
    color: #FFFFFF !important;
}

/* Y el botón cerrar */
.glossary-close {
    color: var(--azul-oscuro) !important;
}

.glossary-content {
    flex: 1;
    overflow-y: auto !important; /* Forzar scroll */
    overflow-x: hidden;
    padding: 20px 30px;
    background: #FFFFFF;
    max-height: calc(85vh - 200px); /* Altura máxima menos header y search */
}

/* === MODAL DE LOGOUT PERSONALIZADO === */
.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.logout-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.logout-modal {
    background: var(--blanco);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 440px;
    width: 90%;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.logout-modal-overlay.active .logout-modal {
    transform: scale(1);
}

.logout-modal-header {
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-medio));
    color: var(--blanco);
    padding: 24px 30px;
    border-radius: 16px 16px 0 0;
    text-align: center;
}

.logout-modal-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.logout-modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.logout-modal-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

.logout-modal-body {
    padding: 30px;
    text-align: center;
}

.logout-modal-message {
    color: var(--texto);
    font-size: 1.05rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

.logout-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.logout-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.logout-modal-btn-cancel {
    background: var(--gris-azulado);
    color: var(--blanco);
}

.logout-modal-btn-cancel:hover {
    background: var(--azul-medio);
    transform: translateY(-2px);
}

.logout-modal-btn-confirm {
    background: var(--verde-lima);
    color: var(--azul-oscuro);
}

.logout-modal-btn-confirm:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 224, 59, 0.4);
}

/* Responsive para el modal */
@media (max-width: 480px) {
    .logout-modal {
        margin: 20px;
    }
    
    .logout-modal-actions {
        flex-direction: column;
    }
    
    .logout-modal-btn {
        width: 100%;
    }
}   

/* === AUDIT TRAIL TABLE STYLES === */
.audit-trail-container {
    max-width: 1400px;
    margin: 0 auto;
}

.audit-header {
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-medio));
    color: var(--blanco);
    padding: 25px 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.audit-header-content {
   .audit-header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    }
}

.audit-icon {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    flex-shrink: 0;
}

.audit-title h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.audit-title p {
    opacity: 0.9;
    font-size: 1rem;
}

.audit-stats {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
}

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

.stat-number {
    display: block;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--verde-lima);
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Controles y filtros */
.audit-controls {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    align-items: center;
    background: var(--blanco);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.controls-left .filter-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-weight: 600;
    color: var(--azul-oscuro);
}

.filter-value {
    background: var(--verde-lima);
    color: var(--azul-oscuro);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.controls-center {
    justify-self: center;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--fondo);
    border-radius: 25px;
    padding: 8px 15px;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--azul-medio);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
    margin-right: 10px;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

.controls-right {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-select {
    padding: 8px 15px;
    border: 2px solid var(--gris-azulado);
    border-radius: 8px;
    background: var(--blanco);
    color: var(--texto);
    font-size: 0.9rem;
}

/* Tabla principal */
.audit-table-container {
    background: var(--blanco);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 25px;
}

.audit-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

.audit-table thead {
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-medio));
    color: var(--blanco);
}

.audit-table thead th:first-child {
    border-radius: 12px 0 0 0;
}

.audit-table thead th:last-child {
    border-radius: 0 12px 0 0;
}


.audit-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.col-timestamp { width: 140px; }
.col-action { width: 120px; }
.col-description { width: auto; min-width: 300px; }
.col-details { width: 130px; }
.col-ip { width: 120px; }

.audit-table tbody tr {
    border-bottom: 1px solid #e8eef2;
    transition: all 0.3s ease;
    position: relative;
}

.audit-table tbody tr:hover {
    background: linear-gradient(90deg, var(--fondo) 0%, rgba(194, 224, 59, 0.05) 100%);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

.audit-table tbody tr:last-child {
    border-bottom: none;
}

.audit-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 12px;
}

.audit-table tbody tr:last-child td:last-child {
    border-radius: 0 0 12px 0;
}

.audit-table td {
    padding: 15px 12px;
    vertical-align: top;
}

/* Celdas específicas */
.timestamp-cell {
    font-family: monospace;
}

.timestamp-main {
    font-weight: 600;
    color: var(--azul-oscuro);
    font-size: 0.9rem;
}

.timestamp-time {
    font-size: 0.8rem;
    color: var(--azul-medio);
    margin-top: 2px;
}

.action-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-login {
    background: rgba(194, 224, 59, 0.2);
    color: var(--azul-oscuro);
    border: 1px solid var(--verde-lima);
}

.action-logout {
    background: rgba(175, 189, 200, 0.2);
    color: var(--azul-medio);
    border: 1px solid var(--gris-azulado);
}

.description-cell {
    line-height: 1.4;
    color: var(--texto);
}

.details-btn {
    background: var(--azul-medio);
    color: var(--blanco);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.details-btn:hover {
    background: var(--azul-oscuro);
}

.details-btn.expanded {
    background: var(--verde-lima);
    color: var(--azul-oscuro);
}

.details-content {
    margin-top: 10px;
    padding: 12px;
    background: var(--fondo);
    border-radius: 6px;
    border-left: 3px solid var(--verde-lima);
}

.detail-item {
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--texto);
}

.detail-item strong {
    color: var(--azul-oscuro);
}

.no-details {
    color: var(--gris-azulado);
    font-style: italic;
}

.ip-cell {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--azul-medio);
}

.no-events-row {
    text-align: center;
    padding: 40px;
}

.no-events {
    color: var(--azul-medio);
    font-size: 1.1rem;
}

/* Footer */
.audit-footer {
    background: var(--fondo);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--gris-azulado);
}

.audit-footer p {
    margin: 5px 0;
    color: var(--azul-medio);
    font-size: 0.9rem;
}

.audit-footer strong {
    color: var(--azul-oscuro);
}

/* Responsive */
@media (max-width: 1200px) {
    .audit-controls {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .controls-right {
        justify-self: center;
    }
}

@media (max-width: 768px) {
    .audit-header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    }
    
    .audit-stats {
        margin-left: 0;
    }
    
    .audit-table-container {
        overflow-x: auto;
    }
    
    .audit-table {
        min-width: 700px;
    }
    
    .audit-table th,
    .audit-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}

/* === MODAL PROFESIONAL DRP === */
.drp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(33, 59, 80, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drp-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.drp-modal {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(33, 59, 80, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.drp-modal-overlay.show .drp-modal {
    transform: translateY(0);
}

.drp-modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.drp-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 24px;
}

.drp-modal-icon.warning {
    background: rgba(255, 165, 0, 0.15);
    color: #ff8c00;
}

.drp-modal-icon.success {
    background: rgba(194, 224, 59, 0.15);
    color: var(--verde-lima);
}

.drp-modal-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--azul-oscuro);
    margin: 0;
}

.drp-modal-content {
    color: var(--texto);
    line-height: 1.6;
    margin-bottom: 30px;
}

.drp-modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.drp-modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.drp-modal-btn.primary {
    background: var(--azul-oscuro);
    color: white;
}

.drp-modal-btn.primary:hover {
    background: var(--azul-medio);
    transform: translateY(-1px);
}

.drp-modal-btn.secondary {
    background: var(--gris-azulado);
    color: var(--texto);
}

.drp-modal-btn.secondary:hover {
    background: #9AABB6;
}

.drp-modal-btn.success {
    background: var(--verde-lima);
    color: var(--texto);
}

.drp-modal-btn.success:hover {
    background: #A8C632;
}

/* === BOTÓN DE MANUAL === */
.help-button-manual {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #213B50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
}

.help-button-manual:hover {
    background: #C2E03B;
    color: #213B50;
}