/* Estilos para el Modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: var(--primary-color);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

/* Estilos para el formulario de registro de riesgos */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.full-width {
    grid-column: 1 / -1;
}

.btn-warning {
    background-color: transparent;
    color: #f57c00;
    border: 1px solid #f57c00;
}

.btn-warning:hover {
    background-color: #f57c00;
    color: white;
}

.btn-danger {
    background-color: transparent;
    color: #c62828;
    border: 1px solid #c62828;
}

.btn-danger:hover {
    background-color: #c62828;
    color: white;
}

.btn-icon {
    padding: 5px 8px;
    font-size: 16px;
}

/* Estilos para la sección de metodología */
.methodology-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
}

.methodology-text {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.methodology-matrix {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    background: #1a237e;
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.matrix-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    padding: 5px;
}

.matrix-cell.header {
    background: #1a237e;
    color: white;
    font-size: 12px;
}

.matrix-cell.impact-header {
    background: #283593;
    color: white;
}

.matrix-cell.probability-header {
    background: #283593;
    color: white;
}

.matrix-cell.risk-low {
    background: #4caf50;
    color: white;
}

.matrix-cell.risk-medium {
    background: #ffc107;
    color: black;
}

.matrix-cell.risk-high {
    background: #f44336;
    color: white;
}

.info-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;    
}

.info-panel {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.info-panel h3 {
    color: #1a237e;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-panel ul {
    list-style: none;
    padding-left: 0;
}

.info-panel li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.5;
    font-size: 14px;
}

.info-panel li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #1976D2;
    font-weight: bold;
}

/* Estilos para la tabla de riesgos registrados */
.table-toolbar {
    margin-bottom: 20px;
    text-align: right;
}

.risk-matrix {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.risk-matrix th, .data-table th {
    background: #1a237e;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-size: 14px;
    position: sticky;
    top: 0;
}

.risk-matrix td, .data-table td {
    padding: 10px 8px;
    border: 1px solid #e0e0e0;
    font-size: 13px;
    vertical-align: top;
}

.risk-matrix tr:nth-child(even) {
    background-color: #f9f9f9;
}

.risk-matrix tr:hover {
    background-color: #f0f7ff;
}

.risk-id {
    width: 50px;
    text-align: center;
    font-weight: bold;
}

.risk-description {
    width: 200px;
}

.risk-category {
    width: 120px;
}

.risk-dimension {
    width: 150px;
}

.risk-probability, .risk-impact, .risk-rating, .risk-level {
    width: 80px;
    text-align: center;
}

.risk-controls {
    width: 150px;
}

.risk-effectiveness {
    width: 120px;
}

.risk-additional {
    width: 150px;
}

.risk-responsible {
    width: 120px;
}

.risk-status {
    width: 100px;
}

.risk-actions {
    width: 120px;
    text-align: center;
}

.risk-level-bajo {
    background-color: #4caf50;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.risk-level-medio {
    background-color: #ffc107;
    color: black;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.risk-level-alto {
    background-color: #f44336;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    padding: 4px 8px;
}

.actions-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;    
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.action-card:nth-child(1)::before { background: linear-gradient(90deg, #4caf50, #66bb6a); }
.action-card:nth-child(2)::before { background: linear-gradient(90deg, #ffc107, #ffd54f); }
.action-card:nth-child(3)::before { background: linear-gradient(90deg, #f44336, #ef5350); }

.action-title {
    font-size: 16px;
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-list {
    list-style: none;
    padding-left: 0;
}

.action-list li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.5;
    font-size: 14px;
}

.action-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #1976D2;
    font-weight: bold;
    font-size: 18px;
}

/* Media Queries para responsividad */
@media (max-width: 1200px) {
    .methodology-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .info-panels, .actions-section {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}