/* RESET Y FUENTES */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #333;
    background-color: #eeeeee; /* Color por defecto si falla la carga */
    /* El margen izquierdo se maneja en style_sidebar.css */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER SUPERIOR */
header {
    background-color: #0d47a1;
    color: white;
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
}

.banner {
    display: block; /* Asegura que sea visible */
    max-width: 100%; /* No se sale de la pantalla */
    height: auto;
    margin: 10px auto 0 auto; /* Centrado horizontal */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
} 
/* CONTENEDOR PRINCIPAL (GRID RESPONSIVE) */
.container {
    display: grid;
    /* MAGIA: Crea columnas de mínimo 300px. Si no caben, bajan de línea */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* TARJETAS */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden; /* Evita que contenido grande rompa la tarjeta */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* TABLAS RESPONSIVAS */
/* Envuelve las tablas para que tengan scroll horizontal en móviles */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* Contenedor especial para tablas o gráficos anchos */
.scroll-x, .card { 
    overflow-x: auto; 
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f9f9f9;
    font-weight: bold;
    color: #555;
}

tr:hover {
    background-color: #f1f1f1;
}

/* ESTILOS DE TEXTO Y UTILIDADES */
.text-success { color: #2e7d32; }
.text-danger { color: #c62828; }
.fw-bold { font-weight: bold; }
.mb-1 { margin-bottom: 5px; }

/* FOOTER */
.footer {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 0.8rem;
    margin-top: auto;
}

/* =========================================
   MEDIA QUERIES (ADAPTACIÓN A MÓVILES)
   ========================================= */
@media (max-width: 768px) {
    header h1 { font-size: 1.2rem; }
    
    .container {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
        padding: 10px;
        gap: 15px;
    }

    .card {
        padding: 15px;
    }

    /* En móvil las tablas necesitan scroll horizontal sí o sí */
    table {
        min-width: 500px; /* Fuerza el scroll si la pantalla es chica */
    }
}
