.container {
    display: grid;
    grid-template-columns: 350px 1fr;
}

.header {
    grid-column: 1 / -1;
}

.sidebar {
    background: #f5f7fa;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    position: sticky;
    top: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a237e;
}

.nav-section {
    margin-bottom: 25px;
}

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

.nav-item {
    display: block;
    padding: 5px 5px;
    margin-bottom: 5px;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #e3f2fd;
    border-left-color: #1976D2;
}

.nav-item.active {
    background: #e3f2fd;
    border-left-color: #1976D2;
    font-weight: bold;
    color: #1a237e;
}

.json-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.json-btn {
    padding: 5px 5px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.json-btn.import {
    background: #4caf50;
    color: white;
}

.json-btn.export {
    background: #2196f3;
    color: white;
}

.json-btn.print {
    background: #ff9800;
    color: white;
}

.json-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.content {
    overflow-y: auto;
    max-height: calc(100vh - 170px);
}

.canvas-grid {
    display: grid;
    gap: 20px;
}

.section-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #1976D2, #64B5F6);
}

.section-card:nth-child(2)::before { background: linear-gradient(90deg, #388E3C, #66BB6A); }
.section-card:nth-child(3)::before { background: linear-gradient(90deg, #D32F2F, #EF5350); }
.section-card:nth-child(4)::before { background: linear-gradient(90deg, #7B1FA2, #AB47BC); }
.section-card:nth-child(5)::before { background: linear-gradient(90deg, #F57C00, #FFA726); }
.section-card:nth-child(6)::before { background: linear-gradient(90deg, #00897B, #26A69A); }
.section-card:nth-child(7)::before { background: linear-gradient(90deg, #1976D2, #64B5F6); }
.section-card:nth-child(8)::before { background: linear-gradient(90deg, #388E3C, #66BB6A); }
.section-card:nth-child(9)::before { background: linear-gradient(90deg, #D32F2F, #EF5350); }
.section-card:nth-child(10)::before { background: linear-gradient(90deg, #7B1FA2, #AB47BC); }
.section-card:nth-child(11)::before { background: linear-gradient(90deg, #F57C00, #FFA726); }
.section-card:nth-child(12)::before { background: linear-gradient(90deg, #00897B, #26A69A); }

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.section-icon {
    font-size: 20px;
    margin-right: 10px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #1a237e;
}

.section-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 5px;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.checkbox-item input {
    width: auto;
}

.risk-levels {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.risk-level {
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.risk-level.inaceptable { background-color: #f44336; color: white; }
.risk-level.alto { background-color: #ff9800; color: white; }
.risk-level.limitado { background-color: #ffc107; color: black; }
.risk-level.minimo { background-color: #4caf50; color: white; }

.risk-level.selected {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border: 2px solid #333;
}

.approval-section {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.approval-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.approval-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.approval-title {
    font-weight: bold;
    color: #1a237e;
    margin-bottom: 5px;
    font-size: 14px;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
    
    .canvas-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos para impresión */
@media print {
    body {
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .container {
        max-width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        grid-template-columns: 1fr !important;
    }
    
    .header {
        background: #1a237e !important;
        padding: 15px !important;
        margin-bottom: 10px !important;
    }
    
    .header h1 {
        font-size: 24px !important;
        margin-bottom: 5px !important;
    }
    
    .header p {
        font-size: 14px !important;
    }
    
    .back-button, .sidebar, .json-panel, .actions {
        display: none !important;
    }
    
    .content {
        padding: 10px !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .canvas-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .section-card {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
        border-radius: 5px !important;
        padding: 15px !important;
        min-height: auto !important;
        margin-bottom: 10px !important;
        box-shadow: none !important;
        transform: none !important;
    }
    
    .section-card::before {
        height: 3px !important;
    }
    
    .section-header {
        margin-bottom: 10px !important;
        padding-bottom: 5px !important;
    }
    
    .section-title {
        font-size: 14px !important;
    }
    
    .form-group {
        margin-bottom: 10px !important;
    }
    
    .form-group label {
        font-size: 12px !important;
    }
    
    .form-group input, .form-group textarea, .form-group select {
        padding: 5px 8px !important;
        font-size: 12px !important;
        border: 1px solid #999 !important;
    }
    
    .form-group textarea {
        min-height: 60px !important;
    }
    
    .checkbox-group {
        gap: 5px !important;
    }
    
    .checkbox-item {
        font-size: 11px !important;
    }
    
    .risk-levels {
        gap: 5px !important;
    }
    
    .risk-level {
        padding: 3px 6px !important;
        font-size: 10px !important;
    }
    
    .approval-section {
        padding: 10px !important;
    }
    
    .approval-item {
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }
    
    .approval-title {
        font-size: 12px !important;
    }
}