/* ==========================================================================
   DASHBOARD CORPORATIVO PROCESO ACTUAL VS PROPUESTA GI-NAOS
   Estilos CSS Modular, Flexbox/Grid, Animaciones y Paleta Corporativa
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Saira:wght@300;400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   1. VARIABLES GLOBAL Y BRANDING NAOS
   -------------------------------------------------------------------------- */
:root {
    --color-primary: #1247B3;         /* Azul Principal */
    --color-primary-light: #3377FF;   /* Azul Claro (Resaltados / Hover) */
    --color-navy: #052566;            /* Azul Marino (Sidebar / Header) */
    --color-accent: #FF530D;          /* Naranja (Alertas / Riesgos / CTA) */
    --color-accent-hover: #E04400;
    --color-gray-light: #F4F6FB;      /* Fondo General */
    --color-gray-border: #E2E8F0;     /* Bordes finos */
    --color-gray-medium: #808080;     /* Texto secundario */
    --color-text: #333333;            /* Texto principal */
    --color-card-bg: #FFFFFF;         /* Fondos blancos */

    --font-main: 'Saira', sans-serif;
    --shadow-soft: 0 10px 25px rgba(5, 37, 102, 0.06);
    --shadow-hover: 0 14px 30px rgba(18, 71, 179, 0.12);
    --radius-card: 14px;
    --radius-btn: 8px;
    --transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --------------------------------------------------------------------------
   2. REINICIO & ESTRUCTURA GENERAL
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-main);
    background-color: var(--color-gray-light);
    color: var(--color-text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.dashboard-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   3. SIDEBAR LATERAL DE NAVEGACIÓN
   -------------------------------------------------------------------------- */
.sidebar {
    width: 280px;
    background-color: var(--color-navy);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.75rem 1.25rem;
    z-index: 50;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-logo {
    max-width: 160px;
    height: auto;
    filter: brightness(0) invert(1);
    margin-bottom: 0.5rem;
}

.sidebar-subtitle {
    color: var(--color-primary-light);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 1.2rem 0 0.4rem 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    width: 100%;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.nav-item.active {
    background-color: var(--color-primary);
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(18, 71, 179, 0.4);
}

.nav-item.highlight-item {
    border: 1px solid rgba(255, 83, 13, 0.4);
}

.nav-item.highlight-item.active {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 4px 15px rgba(255, 83, 13, 0.4);
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 10px;
    color: #FFFFFF;
}

.user-badge svg {
    color: var(--color-primary-light);
    width: 24px;
    height: 24px;
}

.user-role {
    font-weight: 600;
    font-size: 0.88rem;
}

.user-status {
    font-size: 0.75rem;
    color: var(--color-gray-medium);
}

/* --------------------------------------------------------------------------
   4. WRAPPER PRINCIPAL & ENCABEZADO SUPERIOR
   -------------------------------------------------------------------------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-header {
    height: 80px;
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--color-gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    flex-shrink: 0;
}

.header-title h1 {
    color: var(--color-navy);
    font-size: 1.5rem;
    font-weight: 700;
}

.header-title p {
    color: var(--color-gray-medium);
    font-size: 0.9rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-chip.warning {
    background-color: #FFF3E0;
    color: #E65100;
}

.status-chip.success {
    background-color: #E8F5E9;
    color: #2E7D32;
}

/* --------------------------------------------------------------------------
   5. ÁREA DE CONTENIDO MODULAR & ANIMACIONES
   -------------------------------------------------------------------------- */
.content-area {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    position: relative;
}

.module-content {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.module-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.section-intro {
    margin-bottom: 2rem;
}

.section-intro h2 {
    color: var(--color-navy);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.section-intro p {
    color: var(--color-gray-medium);
    font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   6. MÓDULO 1: ESTADÍSTICAS Y MÉTRICAS
   -------------------------------------------------------------------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-gray-border);
}

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

.metric-user {
    font-weight: 600;
    color: var(--color-navy);
    font-size: 1.1rem;
}

.icon-primary { color: var(--color-primary); }
.icon-warning { color: var(--color-accent); }
.icon-danger { color: #D32F2F; }

.metric-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.metric-value.warning { color: var(--color-accent); }
.metric-value.danger { color: #D32F2F; }

.metric-label {
    font-size: 0.85rem;
    color: var(--color-gray-medium);
    margin-bottom: 1rem;
}

.metric-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--color-gray-light);
    border-radius: 10px;
    overflow: hidden;
}

.metric-bar {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 10px;
}

.metric-bar.warning { background-color: var(--color-accent); }
.metric-bar.danger { background-color: #D32F2F; }

/* Gráfica Personalizada */
.chart-container-box {
    background: var(--color-card-bg);
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-gray-border);
}

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

.box-header h3 {
    color: var(--color-navy);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-accent {
    background: rgba(18, 71, 179, 0.1);
    color: var(--color-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.custom-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.row-name {
    width: 150px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
}

.row-track {
    flex: 1;
    height: 36px;
    background-color: var(--color-gray-light);
    border-radius: 8px;
    overflow: hidden;
}

.row-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 1rem;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: width 1s ease-in-out;
}

.fill-primary { background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light)); }
.fill-warning { background: linear-gradient(90deg, #FF9800, var(--color-accent)); }
.fill-danger { background: #D32F2F; min-width: 80px; }

.key-message-card {
    display: flex;
    gap: 1.25rem;
    background-color: #FFF4F0;
    border: 1px solid rgba(255, 83, 13, 0.3);
    border-left: 5px solid var(--color-accent);
    padding: 1.25rem;
    border-radius: 10px;
}

.key-icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
}

.key-text h4 {
    color: var(--color-accent);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.key-text p {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   7. TARJETAS DE MÓDULOS (GRIDS Y ESTILOS)
   -------------------------------------------------------------------------- */
.cards-grid {
    display: grid;
    gap: 1.75rem;
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
    background: var(--color-card-bg);
    border-radius: var(--radius-card);
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-gray-border);
    position: relative;
    transition: var(--transition);
}

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

.card-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.card-tag.danger {
    background-color: #FFEBEE;
    color: #C62828;
}

.card-tag.warning {
    background-color: #FFF3E0;
    color: #E65100;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon.danger {
    background-color: #FFEBEE;
    color: #C62828;
}

.card-icon.warning {
    background-color: #FFF3E0;
    color: #E65100;
}

.card h3 {
    color: var(--color-navy);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Flujo visual en tarjetas */
.flow-step-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--color-gray-light);
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.step-pill {
    background: #FFFFFF;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.step-pill.admin {
    background: var(--color-accent);
    color: #FFFFFF;
}

/* Listas con Viñeta Naranja */
.styled-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.styled-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.bullet-icon-orange {
    width: 12px;
    height: 12px;
    background: var(--color-accent);
    border-radius: 50%;
    display: inline-block;
    margin-top: 5px;
    flex-shrink: 0;
}

.bullet-icon-blue {
    width: 14px;
    height: 14px;
    background-image: url('1X1-NAOS.png');
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    margin-top: 4px;
    flex-shrink: 0;
}

.status-badge-outline {
    display: inline-block;
    border: 1px solid var(--color-gray-medium);
    color: var(--color-gray-medium);
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge-outline.red {
    border-color: #D32F2F;
    color: #D32F2F;
    background: #FFF5F5;
}

.status-badge-outline.orange {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: #FFF9F5;
}

/* --------------------------------------------------------------------------
   8. MÓDULO 4: LA SOLUCIÓN (PROPUESTA DE VALOR & MARCA DE AGUA)
   -------------------------------------------------------------------------- */
#module-4 {
    position: relative;
}

/* Marca de Agua Corporal Sutil con 1X1-NAOS.png */
.watermark-bg {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 350px;
    height: 350px;
    background-image: url('1X1-NAOS.png');
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.05;
    pointer-events: none;
}

.badge-solution {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(18, 71, 179, 0.1);
    color: var(--color-primary);
    font-weight: 700;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.card-solution {
    border-top: 4px solid var(--color-primary);
}

.card-icon.solution {
    background-color: rgba(18, 71, 179, 0.08);
    color: var(--color-primary);
}

.card-icon.solution-orange {
    background-color: rgba(255, 83, 13, 0.1);
    color: var(--color-accent);
}

.card-solution.highlight-border {
    border-top: 4px solid var(--color-accent);
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFDFB 100%);
}

.cta-box-inner {
    margin-top: 1rem;
    background: var(--color-accent);
    color: #FFFFFF;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(255, 83, 13, 0.25);
}

/* --------------------------------------------------------------------------
   9. RESPONSIVIDAD (TABLETS Y MÓVILES)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .dashboard-layout {
        flex-direction: column;
        height: 100vh;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 1.25rem 1.5rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .sidebar-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .sidebar-logo {
        max-width: 130px;
        margin-bottom: 0;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-section-title {
        display: none;
    }

    .nav-item {
        white-space: nowrap;
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
        flex-shrink: 0;
        width: auto;
    }

    .sidebar-footer {
        display: none;
    }

    .main-wrapper {
        height: auto;
        overflow: visible;
    }

    .top-header {
        height: auto;
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-title h1 {
        font-size: 1.3rem;
    }

    .header-title p {
        font-size: 0.85rem;
    }

    .content-area {
        padding: 1.25rem 1.5rem 2.5rem 1.5rem;
        overflow: visible;
    }

    .grid-3, .grid-2, .metrics-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .chart-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .row-name {
        width: 100%;
    }

    .row-track {
        width: 100%;
    }

    .watermark-bg {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 1rem;
    }

    .nav-item {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .top-header {
        padding: 1rem;
    }

    .content-area {
        padding: 1rem 1rem 2rem 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .metric-value {
        font-size: 2.2rem;
    }

    .flow-step-box {
        flex-wrap: wrap;
        justify-content: center;
    }
}
