/* style.css - Estilos para el Dashboard BI */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 20px;
    color: #333;
}

h1 {
    color: #2c3e50;
    text-align: center;
}

/* Contenedor para las Tarjetas de KPI */
.kpi-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 25px;
    flex-basis: 200px; /* Base para cada tarjeta */
    flex-grow: 1;
    text-align: center;
    border-top: 5px solid #3498db;
}

.kpi-card .value {
    font-size: 2.5em;
    font-weight: 700;
    margin: 10px 0;
    color: #2c3e50;
}

.kpi-card .label {
    font-size: 1.1em;
    color: #7f8c8d;
    font-weight: 500;
}

/* Colores específicos para KPIs */
.kpi-card.morosidad { border-top-color: #e74c3c; } /* Rojo */
.kpi-card.morosidad .value { color: #e74c3c; }

.kpi-card.retencion { border-top-color: #2ecc71; } /* Verde */
.kpi-card.retencion .value { color: #2ecc71; }

.kpi-card.desaprobados { border-top-color: #f39c12; } /* Naranja */
.kpi-card.desaprobados .value { color: #f39c12; }

/* Contenedor para los gráficos */
.chart-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 80%;
    max-width: 1000px;
    margin: 20px auto;
}
/* --- CSS para el Encabezado (Agregar a style.css) --- */

.main-header {
    background-color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.main-header .logo {
    font-size: 1.5em;
    font-weight: 700;
    color: #2c3e50;
}

.main-header .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #34495e;
}

.main-header .logout-button {
    background-color: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}

.main-header .logout-button:hover {
    background-color: #c0392b;
}

/* Ajuste para que el h1 no esté tan pegado */
h1 {
    margin-top: 0;
}
/* --- Estilos para los Filtros (Agregar a style.css) --- */

.filter-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.filter-container label {
    font-weight: 500;
    color: #34495e;
    margin-right: 5px;
}

.filter-container select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: #fff;
    cursor: pointer;
    min-width: 200px;
}
/* --- (NUEVO) Estilos para Fila de Gráficos (Agregar a style.css) --- */

.charts-row {
    display: flex;
    flex-wrap: wrap; /* Si no caben, se ponen abajo */
    gap: 20px;
    width: 100%;
    margin: 20px auto;
}

/* Modificamos el chart-container original */
.chart-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    
    /* (NUEVO) Hacemos que compartan espacio */
    flex: 1; /* Permite que crezcan y se encojan */
    
    /* (NUEVO) Definimos un mínimo para que no se aplasten */
    min-width: 400px; 
    
    /* (MODIFICADO) Quitamos el ancho fijo que tenía antes */
    /* width: 80%; */ 
    /* max-width: 1000px; */
    /* margin: 20px auto; */
}
/* --- Estilo para Botón de Importar (Agregar a style.css) --- */
.main-header .import-button {
    background-color: #2ecc71; /* Verde */
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}
.main-header .import-button:hover {
    background-color: #27ae60;
}
/* --- (NUEVO) Estilos para la Matriz de Condición --- */

.table-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin: 20px auto; /* Lo ponemos como un nuevo bloque */
    overflow-x: auto; /* Para que sea responsive en móviles */
}

.bi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.bi-table thead th {
    background-color: #f4f7f6;
    color: #34495e;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e0e6ed;
}

.bi-table tbody tr:nth-child(even) {
    background-color: #f9fbfd;
}

.bi-table tbody tr:hover {
    background-color: #f0f4f8;
}

.bi-table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e6ed;
    color: #555;
}

/* --- (NUEVO) Estilos de la tabla --- */
.bi-table .cell-pagante {
    font-weight: 600;
    color: #27ae60; /* Verde */
}
.bi-table .cell-deudor {
    font-weight: 600;
    color: #c0392b; /* Rojo */
}
.bi-table .cell-aprobado {
    color: #27ae60;
}
.bi-table .cell-desaprobado {
    color: #c0392b;
}
.bi-table .cell-pct {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9em;
}
.bi-table .cell-total {
    font-weight: 600;
}
/* --- Estilo para Botón de Reportes (Agregar a style.css) --- */
.main-header .report-button {
    background-color: #3498db; /* Azul */
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}
.main-header .report-button:hover {
    background-color: #2980b9;
}
/* --- Estilo para Botón de Dashboard (Agregar a style.css) --- */
.main-header .dashboard-button {
    background-color: #9b59b6; /* Morado */
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}
.main-header .dashboard-button:hover {
    background-color: #8e44ad;
}