/* =======================================================
   GENERALES
======================================================= */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #bccbd2;
    color: #222;
    height: 100%;
}

img {
    max-width: 100%;
    height: auto;
}


/* =======================================================
   HEADER / NAVBAR
======================================================= */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1a202c;
    padding: 15px 40px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

header .logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

header .logo img {
    width: 80px;
}

header .logo h2 {
    margin: 0;
    font-size: 1.5em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s;
    font-weight: 600;
}

nav a:hover {
    background: #ff8c42;
}


/* =======================================================
   MENÚ DESPLEGABLE
======================================================= */
/* Lista del menú horizontal */
nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center;
}

/* Enlaces del menú principal */
nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background 0.3s;
    font-weight: 600;
    display: block;
}

nav > ul > li > a:hover {
    background: #ff8c42; /* Naranja al pasar el mouse */
}

/* --- MENÚ DESPLEGABLE (Dropdown) --- */
nav ul li.menu {
    position: relative;
}

/* El cuadro que aparece */
nav ul li.menu ul.ContenidoMenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a202c;
    min-width: 240px; /* Un poco más ancho para el scroll */
    padding: 0; /* Quitamos padding para que el scroll pegue al borde */
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2000;
    flex-direction: column;
    
    /* --- AGREGADO PARA EL SCROLL --- */
    max-height: 300px; /* Altura máxima antes de hacer scroll */
    overflow-y: auto;  /* Activa el scroll vertical */
    overflow-x: hidden; /* Oculta scroll horizontal */
}

/* Estilo de la barra de desplazamiento (Opcional - Webkit) */
nav ul li.menu ul.ContenidoMenu::-webkit-scrollbar {
    width: 8px;
}
nav ul li.menu ul.ContenidoMenu::-webkit-scrollbar-track {
    background: #1a202c; 
}
nav ul li.menu ul.ContenidoMenu::-webkit-scrollbar-thumb {
    background: #555; 
    border-radius: 4px;
}
nav ul li.menu ul.ContenidoMenu::-webkit-scrollbar-thumb:hover {
    background: #ff8c42; 
}

/* Mostrar al pasar el mouse */
nav ul li.menu:hover ul.ContenidoMenu {
    display: flex;
}

nav ul li.menu ul.ContenidoMenu li {
    width: 100%;
    display: block;
}

nav ul li.menu ul.ContenidoMenu li a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: normal;
    font-size: 0.9rem;
}

nav ul li.menu ul.ContenidoMenu li:last-child a {
    border-bottom: none;
}

nav ul li.menu ul.ContenidoMenu li a:hover {
    background: #ff8c42;
    padding-left: 25px;
}


/* =======================================================
  CONTENIDO PRINCIPAL
======================================================= */
main {
    padding: 30px 20px;
}

.contenedor-reporte {
    max-width: 900px;
    margin: 0 auto;
    background-color: #f4f4f4;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* =======================================================
   FORMULARIO
======================================================= */
form {
    display: flex;
    flex-direction: column;
}

fieldset {
    border: 1px solid #ddd;
    padding: 25px;
    border-radius: 5px;
    background-color: white;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

legend {
    font-weight: bold;
    color: #1a202c;
    padding: 0 10px;
}

.controles-superiores {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    margin-bottom: 10px;
}

input[type="text"],
input[type="date"],
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}


/* =======================================================
   TABLA
======================================================= */
.caja-resultados {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow-x: auto;
    min-height: 200px;
}

.caja-resultados table {
    width: 100%;
    border-collapse: collapse;
}

.caja-resultados th,
.caja-resultados td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
}

.caja-resultados th {
    background-color: #f9f9f9;
    font-weight: 700;
}


/* =======================================================
    BOTÓN
======================================================= */
.btn-generar {
    display: block;
    width: 150px;
    padding: 12px;
    background-color: #ff8c42;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 30px auto 0;
    border-bottom: 3px solid #d9702e;
    transition: all 0.2s ease;
}

.btn-generar:hover {
    background-color: #f77d2d;
    transform: translateY(-2px);
}
fieldset {
    border: 1px solid #ddd;
    padding: 25px;
    border-radius: 5px;
    background-color: #fff;
    margin-bottom: 25px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* =======================================================
    FOOTER
======================================================= */
footer {
    background: #1a202c;
    color: white;
    padding: 40px 20px;
    margin-top: 40px;
    text-align: center;
}

.footer-sections {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    text-align: left;
    max-width: 1200px;
    margin: 0 auto;
}


/* =======================================================
   RESPONSIVE REAL — COMO EL PANEL ADMIN
======================================================= */

/* Tablets */
@media (max-width: 992px) {
    header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    nav ul {
        gap: 10px;
    }

    .controles-superiores {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    fieldset {
        grid-template-columns: 1fr;
    }
}

