/* C:\Users\vito\Desktop\Qoricancha - anterior funcional\public\css\reportesFinancieros.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #eef1f5; /* Un gris azulado muy claro */
    color: #333;
    line-height: 1.6;
}

.container {
    width: 95%;
    max-width: 1600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.report-header-main {
    text-align: center;
    padding-bottom: 25px;
    margin-bottom: 30px;
    border-bottom: 1px solid #dde2e7;
}

.report-header-main h1 {
    font-size: 2.2em;
    color: #2c3e50; /* Azul oscuro */
    margin-bottom: 20px;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px; /* Espacio antes del título dinámico del reporte */
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Alinea labels a la izquierda */
}

.filter-group label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
    font-weight: 500;
}

.filters-bar select, .filters-bar input {
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95em;
    min-width: 200px;
    background-color: #fff;
}

.filters-bar select:focus, .filters-bar input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.cta-button {
    padding: 10px 25px;
    font-size: 1em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff; /* Azul primario */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cta-button:hover {
    background-color: #0056b3; /* Azul más oscuro */
}
.cta-button:active {
    transform: translateY(1px);
}

#reportDashboard {
    padding-top: 20px;
}

.report-title-section h2 {
    text-align: center;
    font-size: 1.8em;
    color: #17a2b8; /* Un turquesa o color de acento */
    margin-bottom: 30px;
    font-weight: 600;
}

.report-content-area {
    margin-bottom: 40px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}
.kpi-grid.single-row { /* Para cuando solo hay un KPI principal */
    grid-template-columns: 1fr; /* O un ancho fijo si se prefiere */
    justify-items: center;
}


.kpi-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #007bff; /* Borde de acento azul */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}
/* Diferentes colores de borde para las tarjetas KPI */
.kpi-card:nth-child(2n) { border-left-color: #28a745; /* Verde */ }
.kpi-card:nth-child(3n) { border-left-color: #ffc107; /* Amarillo */ }
.kpi-card:nth-child(4n) { border-left-color: #dc3545; /* Rojo */ }

.kpi-card.main-kpi { /* Para KPIs que ocupan toda la fila */
    max-width: 500px; /* O el ancho deseado */
    margin-left: auto;
    margin-right: auto;
}


.kpi-card h4 {
    margin-top: 0;
    font-size: 1em;
    color: #6c757d; /* Gris texto secundario */
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

.kpi-card p {
    font-size: 1.8em;
    font-weight: 700;
    color: #343a40; /* Gris oscuro principal */
    margin-bottom: 0;
}

.chart-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Flexible */
    gap: 30px;
    margin-bottom: 30px;
}

.chart-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    height: 400px; /* Altura base, Chart.js la puede ajustar */
}
.chart-container.large {
    /* Podría usarse para un gráfico que ocupe más espacio si solo hay uno en la fila,
       o si se usa grid-column: span 2; en una grilla de 2 columnas */
    height: 450px;
}
.chart-container.medium {
    height: 380px;
}

.chart-title {
    font-size: 1.2em;
    color: #495057;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}
.no-data-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #888;
    font-style: italic;
}


.table-container-optional {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.07);
    margin-top: 20px;
}
.table-container-optional table {
    width: 100%;
    border-collapse: collapse;
}
.table-container-optional th, .table-container-optional td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}
.table-container-optional th:first-child, .table-container-optional td:first-child {
    text-align: left;
}
.table-container-optional thead th {
    background-color: #f1f3f5;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
}
.table-container-optional tbody tr:hover {
    background-color: #f8f9fa;
}


.loading-spinner, .error-message {
    text-align: center;
    padding: 40px 20px;
}
.error-message p {
    color: #dc3545;
    font-weight: bold;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 6px;
    display: inline-block;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007bff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        width: 100%;
    }
    .filters-bar select, .filters-bar input, .cta-button {
        width: 100%;
        box-sizing: border-box; /* Para que el padding no aumente el ancho */
    }
    .kpi-grid {
        grid-template-columns: 1fr; /* KPIs uno debajo del otro */
    }
    .chart-group {
        grid-template-columns: 1fr; /* Gráficos uno debajo del otro */
    }
    .chart-container {
        height: 350px; /* Ajustar altura en móviles */
    }
}