:root {
    --primary-color: #1a237e;
    --secondary-color: #283593;
    --accent-color: #1976D2;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --danger-color: #f44336;
    --light-bg: #f5f7fa;
    --card-bg: white;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-light: #555;
}

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

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

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

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

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

.nav-section-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.nav-item:hover, .nav-item.active {
    background: #e3f2fd;
    border-left-color: var(--accent-color);
}

.nav-item.active {
    font-weight: bold;
    color: var(--primary-color);
}

.panel {
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

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

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

.json-btn.import { background: var(--success-color); color: white; }
.json-btn.export { background: var(--accent-color); color: white; }
.json-btn.print { background: var(--warning-color); color: white; }

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

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

.section-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    border: 3px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.section-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), #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, var(--accent-color), #64B5F6); }
.section-card:nth-child(8)::before { background: linear-gradient(90deg, #C62828, #EF5350); }

.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 var(--border-color);
}

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

.section-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
}

.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: var(--primary-color);
    margin-bottom: 5px;
}

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

textarea.form-control {
    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: var(--danger-color); color: white; }
.risk-level.alto { background-color: var(--warning-color); color: white; }
.risk-level.limitado { background-color: #ffc107; color: black; }
.risk-level.minimo { background-color: var(--success-color); 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 var(--border-color);
}

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

.approval-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 14px;
}

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

.checklist-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.checklist-table th, .checklist-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.checklist-table th {
    background-color: var(--light-bg);
    font-weight: bold;
    color: var(--primary-color);
}

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

.checklist-table tr:hover {
    background-color: #e3f2fd;
}

.score-input {
    width: 60px;
    height: 45px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    background: linear-gradient(135deg, #e3f2fd, #ffffff);
    color: var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.score-input:hover, .score-input:focus {
    border-color: #0d47a1;
    box-shadow: 0 0 10px rgba(25, 118, 210, 0.3);
    transform: scale(1.05);
    outline: none;
}

.score-input:focus {
    box-shadow: 0 0 15px rgba(25, 118, 210, 0.5);
    background: linear-gradient(135deg, #bbdefb, #ffffff);
}

.evidence-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px 15px;
    border: 2px solid #90caf9;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    background: linear-gradient(135deg, #f5f9ff, #ffffff);
    color: var(--text-color);
    resize: vertical;
    transition: all 0.3s ease;
}

.evidence-textarea:hover {
    border-color: #42a5f5;
    box-shadow: 0 2px 8px rgba(66, 165, 245, 0.2);
}

.evidence-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    background: #ffffff;
}

.evidence-textarea::placeholder {
    color: #90a4ae;
    font-style: italic;
}

.section-score {
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
}

.total-score {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background-color: #e3f2fd;
    border-radius: 5px;
}

.mandatory-criteria-section {
    background: #fff8e1;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid #ffd54f;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mandatory-criteria-title {
    font-size: 18px;
    font-weight: bold;
    color: #e65100;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffb74d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mandatory-criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.mandatory-criteria-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #ff9800;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mandatory-criteria-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.mandatory-criteria-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.mandatory-criteria-card-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-top: 2px;
}

.mandatory-criteria-card.checked {
    border-left-color: var(--success-color);
    background-color: #f1f8e9;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.2);
}

.mandatory-criteria-card:not(.checked) {
    border-left-color: #ff9800;
    background-color: #fff8e1;
}

.mandatory-criteria-card-title {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 14px;
}

.mandatory-criteria-card-description {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.mandatory-criteria-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.mandatory-criteria-result-title {
    font-weight: bold;
    color: var(--primary-color);
}

.mandatory-criteria-result-options {
    display: flex;
    gap: 15px;
    align-items: center;
}

.mandatory-criteria-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mandatory-criteria-option:has(input:checked) {
    background-color: #e3f2fd;
    font-weight: bold;
}

.mandatory-criteria-option input {
    width: 16px;
    height: 16px;
}

.dictamen-section {
    background: #e8f5e9;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    border: 2px solid var(--success-color);
}

.dictamen-title {
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #81c784;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dictamen-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.dictamen-option {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--success-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dictamen-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dictamen-option.selected {
    background-color: #c8e6c9;
    border-left-color: #2e7d32;
}

.dictamen-option-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.dictamen-option-title {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 14px;
}

.dictamen-option-description {
    font-size: 13px;
    color: var(--text-light);
}

.version-panel {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid var(--accent-color);
    margin: 10px 0;
}

.version-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.version-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.version-stats {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.checklist-version-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.badge-basico { background: var(--success-color); }
.badge-estandar { background: var(--accent-color); }
.badge-reforzado { background: var(--danger-color); }

.summary-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.summary-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.summary-content {
    display: grid;
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.summary-label {
    font-weight: bold;
    color: var(--text-light);
    font-size: 14px;
}

.summary-value {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 14px;
    text-align: right;
}

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

@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: var(--primary-color) !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;
    }
    
    .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-control {
        padding: 5px 8px !important;
        font-size: 12px !important;
        border: 1px solid #999 !important;
    }
    
    textarea.form-control {
        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;
    }
}