/* --- BASES Y VARIABLES --- */
:root {
    --verde-udocba: #99C823;
    --azul-oscuro: #0054a6;
}

body {
    margin: 0;
    padding: 10px;
    background-color: #f0f2f5;
    font-family: 'Segoe UI', 'Montserrat', sans-serif;
}

.container {
    max-width: 100%;
    width: 95%;
    margin: 0 auto;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #1a73e8;
    text-align: center;
    font-size: 24px;
}

/* --- MENÚ (NAVBAR) --- */
.navbar {
    background: #ffffff !important;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand img {
    height: 50px;
    width: auto;
}

.nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 10px 15px !important;
}

.nav-link:hover, .nav-link.active {
    color: var(--verde-udocba) !important;
}

.btn-admin {
    text-decoration: none;
    color: #555;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    transition: 0.3s;
}

/* --- TABLAS Y FORMULARIOS --- */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f8f9fa;
    color: #5f6368;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #eee;
}

td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

input, select {
    padding: 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-sizing: border-box;
}

input[type="text"], #buscar-nombre {
    width: 100%;
}

input:focus, select:focus {
    outline: none;
    border-color: #1a73e8;
}

.form-carga {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px dashed #ccc;
}

.input-group {
    display: flex;
    gap: 10px;
}

/* --- BOTONES --- */
.btn-save {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-save:hover { background: #1557b0; }
.btn-save:disabled { background: #ccc; }

.btn-add {
    background-color: #34a853;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-add:hover { background-color: #2d8e47; }

/* --- FILTROS Y CONTENEDORES --- */
.filtros-container, .filters-container {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid #ddd;
}

.filtro-group { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }

.visitas-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.visita-item {
    background: white;
    border-left: 5px solid var(--verde-udocba);
    padding: 20px;
    border-radius: 0 15px 15px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.visita-item:hover {
    transform: translateX(10px);
    background-color: #f9fff0;
}

/* --- RESPONSIVE GENERAL --- */

@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        padding: 15px;
        border-radius: 8px;
        margin-top: 10px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
}

@media screen and (max-width: 600px) {
    thead { display: none; }

    tr { 
        display: block; 
        margin-bottom: 20px; 
        border: 1px solid #ddd; 
        border-radius: 8px; 
        padding: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    td {
        display: flex; 
        justify-content: space-between; 
        align-items: center;
        text-align: right;
        padding: 10px 5px;
        border-bottom: 1px solid #f0f0f0;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #1a73e8;
        font-size: 0.85em;
        text-align: left;
        margin-right: 10px;
        flex-shrink: 0;
    }

    /* Ajustes específicos para inputs en móvil */
    td input[type="text"] {
        width: 65% !important; 
    }

    td[data-label="Escuela"] {
        background-color: #f8f9fa;
        justify-content: center;
        font-size: 1.1em;
    }
    td[data-label="Escuela"]::before { display: none; }

    td:last-child {
        border-bottom: none;
        padding-top: 20px;
        display: block;
    }

    .btn-save { width: 100%; margin: 0; }

    .visita-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .filters-container, .filtro-group {
        flex-direction: column;
    }
}

/* --- ESTADOS ESPECIALES --- */
tr:has(td[data-label="Fecha"]:not(:contains("-"))) {
    background-color: #f0fff4;
}

tr:has(.export-checkbox:checked) {
    background-color: rgba(153, 200, 35, 0.1) !important;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Asegura que el body ocupe toda la pantalla */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

/* El main crece para ocupar el espacio sobrante, empujando al footer */
main {
    flex: 1;
}

/* Estilo para el footer */
footer {
    background-color: #212529 !important; /* Negro de Bootstrap */
    color: white;
    width: 100%;
    padding: 20px 0;
}

/* Esto quita el fondo blanco de cualquier contenedor dentro del footer */
footer .container, 
footer .container-fluid,
footer p {
    background-color: transparent !important;
    background: none !important;
    box-shadow: none !important; /* Por si tiene la sombra que usas en el resto de la web */
    color: white !important;
    border: none !important;
}

/* Aseguramos que el footer sea negro sólido */
footer {
    background-color: #212529 !important;
    padding: 20px 0;
}