/* PALETA DE COLORES OFICIAL UAGro SGC */
:root {
    --azul-profundo: #0D1B2A;
    --rojo-academico: #E63946;
    --azul-acero: #1B263B;
    --gris-platino: #E0E1DD;
    --verde-exito: #2ECC71;
    --uagro-red-hover: #C0392B; 
    --input-bg: #F8F9FA;          
}

/* RESET GENERAL Y ESTRUCTURA STICKY FOOTER */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%; /* Obligatorio para que el body sepa cuánto es el 100% */
}

body {
    background-color: var(--azul-profundo); 
    font-family: 'Roboto', sans-serif;
    color: var(--gris-platino); 
    line-height: 1.6;
    display: flex;
    flex-direction: column; 
    min-height: 100vh;
}

/* CONTENEDOR QUE EMPUJA EL FOOTER */
.flex-content {
    flex: 1 0 auto; 
    display: flex;
    flex-direction: column;
    width: 100%;
}

.contenedor {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    text-align: center;
}

/* TÍTULOS */
h1 {
    font-family: 'Montserrat', sans-serif;
    color: var(--gris-platino); 
    font-size: clamp(1.5rem, 5vw, 28px); 
    font-weight: 700; 
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* 1. AJUSTE PARA EL PANEL DE GESTIÓN (ICONOS DE INICIO) */
.panel-grid {
    display: flex;
    flex-wrap: wrap; /* Permite que bajen en móvil */
    justify-content: center;
    gap: 20px;
    padding: 20px;
    width: 100%;
}

.modulo-card {
    flex: 1 1 250px; /* Tamaño base sugerido */
    max-width: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
}

/* 2. FORMULARIOS Y TARJETAS DE REPORTES */
/* Ajustado para que no se vean gigantes y sean responsivos */
form, .form-card, .event-list-card {
    background-color: var(--azul-acero); 
    width: 100%;
    max-width: 500px; /* Evita que crezca demasiado en pantallas grandes */
    margin: 0 auto;
    padding: clamp(15px, 5vw, 35px);
    border-radius: 15px;
    text-align: left;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* CONTENEDOR DE REPORTES (Main Container) */
.main-container {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding: 10px;
}

/* 3. TABLAS RESPONSIVAS */
.tabla-container, .table-responsive {
    overflow-x: auto; 
    background: white;
    border-radius: 8px;
    width: 100%;
    margin-top: 20px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #333;
    min-width: 600px; 
}

/* 4. FOOTER SIEMPRE AL FINAL */
.footer-uagro {
    flex-shrink: 0; 
    background-color: white;
    color: #333;
    padding: 20px 0;
    text-align: center;
    width: 100%;
    font-size: 14px;
    font-weight: bold;
}

/* ==========================================
   SECCIÓN DE RESPONSIVIDAD (ARREGLO MÓVIL)
   ========================================== */
@media (max-width: 768px) {
    .contenedor {
        width: 95%;
        margin: 15px auto;
    }

    /* En móviles, los elementos de reportes se apilan verticalmente */
    .main-container {
        flex-direction: column;
        align-items: center;
    }

    /* Forzamos que las tarjetas ocupen el ancho total real del celular */
    .event-list-card, .form-card {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px;
    }

    /* Panel de Gestión: Iconos uno debajo de otro */
    .panel-grid {
        flex-direction: column;
        align-items: center;
    }

    .modulo-card {
        width: 100%;
        max-width: 100%;
    }

    /* Inputs y botones adaptados para pantallas táctiles */
    input, select, .btn-acceder {
        font-size: 16px;
        padding: 12px; 
    }

    .btn-acceder {
        width: 100%;
        text-align: center;
        padding: 15px;
    }
}