:root {
    /* Paleta Púrpura y Verde */
    --primary-color: #6a1b9a;
    /* Púrpura profundo */
    --primary-light: #9c4dcc;
    --primary-dark: #38006b;
    --secondary-color: #00c853;
    /* Verde vibrante */
    --secondary-dark: #009624;

    --bg-color: #f4f5f7;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;

    --success: #00c853;
    --danger: #d32f2f;
    --warning: #fbc02d;
    --na: #9e9e9e;

    --font-family: 'Inter', sans-serif;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Tipografía */
h1,
h2,
h3 {
    font-weight: 600;
    color: var(--primary-dark);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.m-0 {
    margin: 0;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.pb-3 {
    padding-bottom: 1rem;
}

/* Utilidades Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.align-center {
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Nuevo Dashboard auditor */
.dashboard-header-graphs {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {

    .grid-2,
    .dashboard-header-graphs {
        grid-template-columns: 1fr;
    }
}

.w-100 {
    width: 100%;
}

/* SPA Views */
.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.main-header {
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    max-height: 40px;
}

/* Botones */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-family);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f5f5f5;
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
}

.mr-2 {
    margin-right: 0.5rem;
}

/* Botón Flotante para Guardar Avance */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-radius: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-floating:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

/* Inputs y Formularios */
.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.input-group input,
.input-group select,
.input-group textarea {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    transition: var(--transition);
    font-size: 14px;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(156, 77, 204, 0.1);
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f7f8fa;
    background-image: radial-gradient(#d3c4e3 1px, transparent 1px);
    background-size: 30px 30px;
}

.login-box {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    border-top: 4px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 420px;
}

.login-logo {
    margin-bottom: 20px;
}

/* Tarjetas (Cards) */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.card-header {
    background: var(--card-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 20px;
}

.bg-danger {
    background-color: var(--danger) !important;
    color: white !important;
}

.bg-danger h3 {
    color: white !important;
}

.bg-warning {
    background-color: #fff3e0 !important;
}

.bg-warning h3 {
    color: #e65100 !important;
}

/* Checklist Acta */
.section-card {
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.check-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.check-item:last-child {
    border-bottom: none;
}

.check-item:hover {
    background-color: #f9f9fb;
}

.check-num-text-container {
    display: flex;
    margin-bottom: 10px;
}

.check-num {
    flex: 0 0 40px;
    font-weight: 700;
    color: var(--primary-light);
}

.check-text {
    flex: 1;
    font-size: 14px;
}

.check-options {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: white;
    transition: var(--transition);
    border-right: 1px solid var(--border-color);
}

.radio-group label:last-child {
    border-right: none;
}

.radio-group input[type="radio"]:checked+label.lbl-cumple {
    background-color: var(--success);
    color: white;
}

.radio-group input[type="radio"]:checked+label.lbl-nocumple {
    background-color: var(--danger);
    color: white;
}

.radio-group input[type="radio"]:checked+label.lbl-na {
    background-color: var(--na);
    color: white;
}

.hallazgo-container {
    width: 100%;
    margin-top: 10px;
    display: none;
    animation: fadeIn 0.3s;
}

.hallazgo-container textarea {
    width: 100%;
    border-color: #ffcdd2;
    background-color: #ffebee;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Gráficos y Reportes */
.chart-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.score-badge {
    background: var(--primary-color);
    color: white;
    font-size: 24px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(106, 27, 154, 0.3);
}

/* Evaluaciones Grid */
.evaluations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.eval-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: var(--transition);
}

.eval-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.eval-card h4 {
    margin-bottom: 5px;
    color: var(--primary-dark);
}

.eval-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: block;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s forwards;
}

.toast.success {
    background-color: var(--secondary-dark);
    border-left: 4px solid var(--secondary-color);
}

.toast.error {
    background-color: #c62828;
    border-left: 4px solid var(--danger);
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Media Queries - Responsividad */
@media (max-width: 768px) {
    .btn-floating {
        bottom: 20px;
        right: 20px;
        padding: 15px 20px !important;
        font-size: 14px;
        margin: 0 !important;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .check-item {
        flex-direction: column;
    }

    .check-options {
        margin-top: 15px;
        width: 100%;
    }

    .radio-group {
        width: 100%;
        display: flex;
    }

    .radio-group label {
        flex: 1;
        text-align: center;
    }
}

/* Impresión */
@media print {
    body {
        background-color: white;
        color: black;
    }

    .main-header,
    .no-print,
    .btn,
    .view.active:not(#viewReport) {
        display: none !important;
    }

    #viewReport {
        display: block !important;
    }

    .print-container {
        max-width: 100%;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 20px;
        break-inside: avoid;
    }

    .report-header {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-bottom: 30px;
        text-align: center;
    }

    .report-meta {
        margin-top: 10px;
        display: flex;
        justify-content: space-around;
        width: 100%;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
        padding: 10px 0;
        font-size: 12px;
    }

    .table th {
        background-color: #eee !important;
        color: black !important;
    }

    .bg-danger th,
    .bg-warning th {
        background-color: #ddd !important;
        color: black !important;
    }

    .card-header {
        break-after: avoid;
    }

    /* Imprimir backgrounds */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}