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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background-image: url('fondo titulo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 40px;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

header > * {
    position: relative;
    z-index: 1;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo {
    height: 120px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
}

.header-text {
    flex: 1;
    text-align: left;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    padding: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.subtitle {
    font-size: 1em;
    opacity: 0.95;
    line-height: 1.6;
    max-width: 900px;
    margin: 0;
    margin-top: 0;
    text-align: left;
    padding: 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Contenedor de menú y descripción del caso */
.menu-caso-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    padding: 20px;
    background: #f8f9ff;
    border-bottom: 2px solid #e0e8ff;
}

/* Menú vertical de navegación */
.menu-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    max-width: 100%;
    margin: 0;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    justify-content: flex-start;
}

.menu-btn:hover {
    border-color: #FF6B35;
    color: #FF6B35;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.2);
}

.menu-btn.active {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border-color: #FF6B35;
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.menu-icon {
    font-size: 1.3em;
}

.menu-text {
    font-size: 1em;
}

/* Menú dropdown y submenú */
.menu-item-dropdown {
    position: relative;
}

.menu-btn-dropdown {
    position: relative;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.submenu {
    display: none;
    margin-top: 5px;
    padding-left: 20px;
    flex-direction: column;
    gap: 5px;
}

.submenu.active {
    display: flex;
}

.submenu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f8f9ff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: flex-start;
}

.submenu-btn:hover {
    border-color: #FF6B35;
    color: #FF6B35;
    background: #fff5f0;
    transform: translateX(5px);
}

.submenu-btn.active {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border-color: #FF6B35;
    box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

/* Tabs Navigation */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.tab-content h2 {
    color: #000000;
    margin-bottom: 30px;
    font-size: 2em;
}

/* Campo de descripción del caso - Global (al lado del menú) */
.caso-container-global {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e0e8ff;
    margin: 0;
}

.caso-container-global h3 {
    color: #000000;
    margin-bottom: 10px;
    font-size: 1.3em;
}

/* Campo de descripción del caso - Dentro de sección (mantener por compatibilidad) */
.caso-container {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #e0e8ff;
}

.caso-container h3 {
    color: #000000;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.caso-descripcion-texto {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.caso-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    transition: border-color 0.3s ease;
    line-height: 1.6;
}

.caso-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Resumen del caso en análisis */
.caso-resumen {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #e0e8ff;
}

.caso-resumen h3 {
    color: #000000;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.caso-resumen p {
    color: #333;
    line-height: 1.8;
    font-size: 1.05em;
    white-space: pre-wrap;
}

/* Categorías Grid */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.categoria-card {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.categoria-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.categoria-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.icono {
    font-size: 2.5em;
}

.categoria-header h3 {
    color: #667eea;
    font-size: 1.5em;
}

.descripcion {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.5;
}

.form-factor {
    margin-bottom: 20px;
}

.factor-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.factor-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-agregar {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.btn-agregar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    background: linear-gradient(135deg, #FF5722 0%, #FF6B35 100%);
}

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

/* Factores Lista */
.factores-lista {
    margin-top: 20px;
}

.factor-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.factor-texto {
    flex: 1;
    line-height: 1.6;
}

.factor-fecha {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

.btn-eliminar {
    background: #1a1a1a;
    color: white;
    border: 2px solid #FF6B35;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-eliminar:hover {
    background: #000000;
    border-color: #FF8C42;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.3);
    transform: translateY(-1px);
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3);
}

.stat-value {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Resumen Categorías */
.resumen-categoria {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.resumen-categoria h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resumen-factor {
    padding: 10px;
    margin: 8px 0;
    background: white;
    border-radius: 5px;
    padding-left: 20px;
}

/* Exportar */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.export-card {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.export-card h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.export-card p {
    color: #666;
    margin-bottom: 20px;
}

.btn-export {
    padding: 12px 30px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    background: linear-gradient(135deg, #FF5722 0%, #FF6B35 100%);
}

.vista-previa {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
}

.vista-previa h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.vista-previa pre {
    background: white;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    border: 1px solid #ddd;
}

.sin-datos {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.2em;
}

/* Sección Lluvia de Problemas */
.section-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.05em;
    line-height: 1.6;
}

.problemas-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}

.problema-card {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.problema-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.problema-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.icono-problema {
    font-size: 2.5em;
}

.problema-header h3 {
    color: #000000;
    font-size: 1.5em;
    margin: 0;
}

.problema-descripcion {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.5;
}

.form-problema {
    margin-bottom: 20px;
}

.problema-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
    line-height: 1.6;
}

.problema-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-agregar-problema {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.btn-agregar-problema:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    background: linear-gradient(135deg, #FF5722 0%, #FF6B35 100%);
}

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

.problemas-lista {
    margin-top: 20px;
}

.problema-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.problema-texto {
    flex: 1;
    line-height: 1.6;
}

.problema-fecha {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

/* Sección Análisis FODA */
.foda-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
}

.foda-card {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.foda-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.foda-fortalezas {
    border-left: 5px solid #2ecc71;
}

.foda-fortalezas:hover {
    border-color: #2ecc71;
}

.foda-oportunidades {
    border-left: 5px solid #3498db;
}

.foda-oportunidades:hover {
    border-color: #3498db;
}

.foda-debilidades {
    border-left: 5px solid #f39c12;
}

.foda-debilidades:hover {
    border-color: #f39c12;
}

.foda-amenazas {
    border-left: 5px solid #e74c3c;
}

.foda-amenazas:hover {
    border-color: #e74c3c;
}

.foda-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.foda-icono {
    font-size: 2.5em;
}

.foda-header h3 {
    color: #000000;
    font-size: 1.5em;
    margin: 0;
}

.foda-descripcion {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
    line-height: 1.5;
}

.form-foda {
    display: none;
    margin-bottom: 20px;
}

.foda-input {
    display: none;
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
    line-height: 1.6;
}

.foda-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-agregar-foda {
    display: none;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.btn-agregar-foda:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
    background: linear-gradient(135deg, #FF5722 0%, #FF6B35 100%);
}

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

.foda-lista {
    margin-top: 20px;
}

.foda-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.foda-texto {
    flex: 1;
    line-height: 1.6;
}

.foda-fecha {
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

/* Sección Matriz Decisional del MINSAL */
.matriz-agregar-container {
    display: none;
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #e0e0e0;
}

.matriz-agregar-container h3 {
    color: #000000;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.debilidades-container {
    margin-bottom: 30px;
}

.debilidad-card {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-left: 5px solid #667eea;
    transition: all 0.3s ease;
}

.debilidad-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.debilidad-header h4 {
    color: #667eea;
    font-size: 1.2em;
}

.debilidad-texto {
    color: #333;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    line-height: 1.6;
    font-size: 1.05em;
}

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

.criterio-eval {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.criterio-eval label {
    display: block;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.criterio-help {
    font-size: 0.8em;
    color: #666;
    margin: 5px 0;
    line-height: 1.4;
}

.criterio-select {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.criterio-select:focus {
    outline: none;
    border-color: #667eea;
}

.puntaje-total {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border-radius: 8px;
    font-size: 1.2em;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.puntaje-numero {
    font-size: 1.5em;
    font-weight: bold;
}

.matriz-tabla-container {
    margin-top: 40px;
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.matriz-tabla-container h3 {
    color: #000000;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.matriz-tabla-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.matriz-tabla {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.matriz-tabla thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.matriz-tabla th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

.matriz-tabla td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.matriz-tabla tbody tr:hover {
    background: #f5f5f5;
}

.matriz-tabla tbody tr:last-child td {
    border-bottom: none;
}

.matriz-prioritario {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ffc107;
    margin-top: 20px;
}

.matriz-prioritario h4 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.matriz-prioritario p {
    color: #856404;
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
}

/* Sección Diagrama de Ishikawa */
.ishikawa-problema-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #e0e0e0;
}

.ishikawa-problema-container h3 {
    color: #FF6B35;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.ishikawa-help {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.problema-principal-display {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.problema-principal-display h4 {
    margin: 0;
    font-size: 1.1em;
}

.problema-principal-display > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.problema-principal-display p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
}

.ishikawa-causas-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #e0e0e0;
}

.ishikawa-causas-container h3 {
    color: #FF6B35;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.causa-principal-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    margin-bottom: 10px;
}

.causa-principal-input:focus {
    outline: none;
    border-color: #FF6B35;
}

.causas-principales-lista {
    margin-top: 20px;
}

.causa-principal-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-left: 5px solid #FF6B35;
    transition: all 0.3s ease;
}

.causa-principal-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.causa-principal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.causa-principal-header h4 {
    color: #FF6B35;
    font-size: 1.2em;
    margin: 0;
}

.subcausas-container {
    margin-top: 15px;
}

.subcausas-container h5 {
    color: #666;
    font-size: 1em;
    margin-bottom: 10px;
}

.form-subcausa {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.subcausa-input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
}

.subcausa-input:focus {
    outline: none;
    border-color: #FF6B35;
}

.btn-agregar-subcausa {
    padding: 10px 20px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.btn-agregar-subcausa:hover {
    background: linear-gradient(135deg, #FF5722 0%, #FF6B35 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4);
}

.subcausas-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subcausa-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    border-left: 3px solid #FF6B35;
    gap: 10px;
}

.subcausa-item label {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.subcausa-item span {
    flex: 1;
    color: #333;
    font-size: 0.95em;
}

.subcausa-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FF6B35;
    flex-shrink: 0;
}

.subcausa-checkbox-diagrama {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #FF6B35;
    flex-shrink: 0;
}

.subcausa-texto-container {
    margin-top: 10px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    animation: expandir 0.3s ease-out;
}

@keyframes expandir {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.subcausa-texto-expandido {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9em;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s ease;
}

.subcausa-texto-expandido:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

.subcausa-texto-expandido::placeholder {
    color: #999;
    font-style: italic;
}

.btn-eliminar-small {
    background: #1a1a1a;
    color: white;
    border: 2px solid #FF6B35;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-eliminar-small:hover {
    background: #000000;
    border-color: #FF8C42;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.3);
    transform: translateY(-1px);
}

/* Visualización del Diagrama */
.diagrama-container {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
    border: 2px solid #e0e0e0;
}

.diagrama-container h3 {
    color: #FF6B35;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.btn-actualizar-diagrama {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-actualizar-diagrama:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-actualizar-diagrama:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.btn-dashboard-ishikawa {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-dashboard-ishikawa:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
    background: linear-gradient(135deg, #FF8C42 0%, #FF6B35 100%);
}

.btn-dashboard-ishikawa:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
}

/* Estilos para el modal del dashboard */
.dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dashboard-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.dashboard-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.dashboard-modal-header h2 {
    color: #333;
    margin: 0;
    font-size: 1.8em;
}

.dashboard-close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.dashboard-close-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.dashboard-modal-body {
    color: #333;
}

.dashboard-causa-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #FF6B35;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dashboard-causa-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dashboard-causa-titulo {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.dashboard-causa-principal {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

.dashboard-causa-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.dashboard-info-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.dashboard-info-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dashboard-info-value {
    font-size: 1em;
    color: #333;
    word-wrap: break-word;
}

.dashboard-info-value:empty::before {
    content: "No especificado";
    color: #999;
    font-style: italic;
}

.dashboard-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.dashboard-empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.dashboard-empty-text {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.dashboard-empty-subtext {
    font-size: 0.9em;
    color: #bbb;
}

.diagrama-ishikawa {
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    padding: 40px 30px;
    border-radius: 12px;
    min-height: 600px;
    position: relative;
    overflow-x: auto;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    scroll-behavior: smooth;
}

.diagrama-ishikawa::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.diagrama-ishikawa::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.diagrama-ishikawa::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.diagrama-ishikawa::-webkit-scrollbar-thumb:hover {
    background: #FF8C42;
}

.diagrama-wrapper {
    position: relative;
    min-width: 1000px;
    min-height: 600px;
    margin: 0 auto;
    padding: 20px;
    background: transparent;
}

.diagrama-cabeza {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    min-height: 130px;
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4), 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.diagrama-cabeza:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.5), 0 6px 12px rgba(0, 0, 0, 0.15);
}

.cabeza-contenido {
    width: 100%;
}

.cabeza-contenido h4 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cabeza-contenido p {
    margin: 0;
    font-size: 1em;
    line-height: 1.7;
    text-align: center;
    word-wrap: break-word;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.diagrama-linea-central {
    position: absolute;
    right: 320px;
    top: 50%;
    width: calc(100% - 640px);
    min-width: 400px;
    height: 5px;
    background: linear-gradient(to right, #FF6B35 0%, #FF8C42 50%, #1a1a1a 100%);
    transform: translateY(-50%);
    z-index: 5;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.espinas-container {
    position: absolute;
    left: 20px;
    top: 0;
    width: calc(100% - 640px);
    min-width: 400px;
    height: 100%;
    padding: 40px 0;
}

.espina {
    position: absolute;
    display: flex;
    align-items: center;
    min-height: 60px;
    width: 100%;
    left: 0;
}

.linea-espina {
    width: 200px;
    height: 4px;
    background: linear-gradient(to right, #FF6B35 0%, #FF8C42 100%);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    transition: width 0.3s ease, box-shadow 0.3s ease;
}

.espina:hover .linea-espina {
    width: 220px;
    box-shadow: 0 3px 6px rgba(255, 107, 53, 0.4);
}

.linea-espina::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid #764ba2;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.causa-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 26px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05em;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    margin-left: 20px;
    transition: all 0.3s ease;
    min-width: 160px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.causa-box:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.subcausas-espina {
    position: absolute;
    left: 240px;
    top: 0;
    width: 380px;
    height: 100%;
    padding: 8px 0;
    overflow: visible;
}

.subcausa-line {
    position: relative;
    display: flex;
    align-items: center;
    margin: 4px 0;
    transition: transform 0.2s ease;
}

.subcausa-line:hover {
    transform: translateX(3px);
}

.subcausa-line::before {
    content: '';
    width: 120px;
    height: 3px;
    background: linear-gradient(to right, #999 0%, #bbb 100%);
    margin-right: 12px;
    flex-shrink: 0;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: width 0.2s ease, background 0.2s ease;
}

.subcausa-line:hover::before {
    width: 140px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
}

.subcausa-box {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.95em;
    color: #333;
    white-space: normal;
    word-wrap: break-word;
    max-width: 250px;
    min-width: 180px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    line-height: 1.5;
    font-weight: 500;
}

.subcausa-box:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3), 0 2px 5px rgba(0, 0, 0, 0.1);
    transform: translateX(4px) translateY(-2px);
    background: #f8f9ff;
}

.subcausa-box label {
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.subcausa-box input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.subcausa-box span {
    flex: 1;
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    color: #666;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .categorias-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #e0e0e0;
        border-right: none;
    }
    
    .tab-btn.active {
        border-bottom-color: #e0e0e0;
        border-left: 3px solid #667eea;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .problemas-container {
        grid-template-columns: 1fr;
    }
    
    .categorias-grid {
        grid-template-columns: 1fr;
    }
    
    .foda-container {
        grid-template-columns: 1fr;
    }
    
    .criterios-evaluacion {
        grid-template-columns: 1fr;
    }
    
    .matriz-tabla-wrapper {
        overflow-x: scroll;
    }
    
    .diagrama-ishikawa {
        padding: 30px 20px;
        min-width: 700px;
        min-height: 500px;
    }
    
    .diagrama-wrapper {
        min-width: 700px;
        min-height: 500px;
    }
    
    .diagrama-cabeza {
        width: 220px;
        padding: 20px;
        right: 10px;
    }
    
    .cabeza-contenido h4 {
        font-size: 1em;
    }
    
    .cabeza-contenido p {
        font-size: 0.85em;
    }
    
    .diagrama-linea-central {
        right: 230px;
        width: calc(100% - 480px);
        min-width: 300px;
    }
    
    .espinas-container {
        left: 10px;
        width: calc(100% - 480px);
        min-width: 300px;
        padding: 20px 0;
    }
    
    .linea-espina {
        width: 140px;
    }
    
    .causa-box {
        padding: 12px 18px;
        font-size: 0.9em;
        min-width: 120px;
    }
    
    .subcausas-espina {
        left: 160px;
    }
    
    .subcausa-box {
        max-width: 180px;
        min-width: 120px;
        font-size: 0.85em;
        padding: 8px 12px;
    }
    
    .menu-caso-container {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .menu-horizontal {
        margin-bottom: 20px;
    }
    
    .menu-btn {
        padding: 12px 20px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .header-logo {
        height: 80px;
    }
    
    .header-text {
        text-align: center;
        width: 100%;
    }
    
    header h1 {
        text-align: center;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }
    
    .subtitle {
        text-align: center;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }
}


