body { 
    font-family: "Segoe UI", sans-serif; 
    background: #f2f4f8; 
    margin: 0; 
    padding: 0; 
    color: #333; /* Color de texto base */
}

/* Contenedor principal para centrar el contenido */
.content {
    width: 95%;         
    max-width: 1800px;    
    margin: 20px auto;  
    padding: 0;         
    box-sizing: border-box;
}

.header { 
    background: #004080; 
    padding: 15px; 
    text-align: center; 
    margin-bottom: 20px; 
}
.header a { 
    color: #fff; 
    margin: 0 20px; 
    text-decoration: none; 
    font-weight: 600; 
}
.header a:hover { 
    text-decoration: underline; 
}

h2 { 
    text-align: center; 
    color: #004080; 
    font-weight: 700; 
    margin: 25px 0; 
}

/* Formularios - Ajustado para centrar y respetar el max-width del content */
form { 
    background: white; 
    padding: 25px; 
    border-radius: 10px; 
    max-width: 650px; /* Un poco más pequeño que el .content para verse bien */
    margin: 20px auto; /* Centra el formulario */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

label { 
    display: block; 
    margin-top: 12px; 
    font-weight: 600; 
    color: #333; 
}
input, select { 
    width: 100%; 
    padding: 10px; 
    margin-top: 6px; 
    border-radius: 6px; 
    border: 1px solid #ccc; 
    box-sizing: border-box; 
    font-size: 15px; 
}
button { 
    margin-top: 20px; 
    padding: 12px; 
    background: #004080; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 16px; 
    width: 100%; 
    transition: background-color 0.3s ease; /* Suaviza el hover */
}
button:hover { 
    background: #0066cc; 
}

/* Alertas - Usan el max-width del content */
.alert { 
    padding: 15px; 
    margin-bottom: 20px; 
    border: 1px solid transparent; 
    border-radius: 4px; 
    max-width: 650px; /* Igual que el formulario para consistencia */
    margin: 20px auto; 
    font-weight: 600; 
}
.alert.success { 
    color: #155724; 
    background-color: #d4edda; 
    border-color: #c3e6cb; 
}
.alert.error { 
    color: #721c24; 
    background-color: #f8d7da; 
    border-color: #f5c6cb; 
}

/* Contenedor de la tabla - Se centra dentro del .content */
.table-container { 
    overflow-x: auto; /* Permite scroll horizontal si la tabla es muy ancha */
    background: white; 
    border-radius: 10px; 
    padding: 15px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
    max-width: 100%; /* Ocupa el 100% del .content */
    margin: 20px auto; /* Centra dentro del .content */
}
table { 
    border-collapse: collapse; 
    width: 100%; 
    font-size: 14px; 
}
th, td { 
    border: 1px solid #ddd; 
    padding: 10px; 
    text-align: left; 
    vertical-align: top; /* Alinea el texto en la parte superior de la celda */
}
th { 
    background: #004080; 
    color: white; 
    font-weight: 600; 
    white-space: nowrap; /* Evita que los encabezados se rompan en varias líneas */
}
tr:nth-child(even) td { 
    background: #f9fbfd; 
}
tr:hover td { 
    background: #e6f0ff; 
}

/* Formulario de búsqueda - Se centra dentro del .content */
.search-form { 
    max-width: 600px; 
    margin: 0 auto 20px auto; 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex; 
    align-items: center; 
    gap: 10px; 
    flex-wrap: wrap; /* Permite que los elementos se envuelvan en pantallas pequeñas */
}
.search-form label {
    margin-top: 0; /* Ajusta el margen de la etiqueta dentro del form flex */
}
.search-form input[type=text] { 
    flex: 1; /* Permite que el input ocupe el espacio disponible */
}

p.message {
    text-align:center;
    font-style:italic;
    color:#666;
    margin-top: 20px;
}

/* --- Media Queries para responsividad --- */
@media (max-width: 768px) {
     .header {
        flex-direction: column; /* Apila la navegación y la info de usuario */
        gap: 15px;
        padding: 15px 10px;
    }
    .header-nav {
        flex-wrap: wrap; /* Permite que los enlaces se vayan a una segunda línea si no caben */
        justify-content: center;
        gap: 5px 10px; /* Espacio vertical y horizontal entre enlaces */
    }
    .header a {
        margin: 0; /* Quitamos el margen fijo */
        padding: 5px 8px; /* Hacemos los botones un poco más pequeños */
    }
    .user-greeting {
        display: none; /* Ocultamos el saludo "Hola, Administrador!" para ahorrar espacio */
    }

    /* --- Arreglo para el Dashboard --- */
    .stats-container {
        flex-direction: column; /* Apila las tarjetas de estadísticas verticalmente */
    }

    /* --- Ajustes generales que ya tenías --- */
    .content {
        width: 100%;
        padding: 0 5px; /* Menos padding en los bordes */
    }
    h2 {
        font-size: 1.5em; /* Títulos un poco más pequeños */
    }
    form, .alert, .search-form {
        width: 95%;
        max-width: 100%; /* Hacemos que ocupe casi todo el ancho */
    }
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    /* --- Mejora para las tablas --- */
    th, td {
        padding: 6px;
        font-size: 11px; /* Hacemos la letra de la tabla más pequeña */
        line-height: 1.3;
    }
    .actions {
        gap: 5px; /* Reducimos el espacio entre los iconos de acción */
    }

    .menu-container {
        width: 90%; /* Ocupa el 90% del ancho de la pantalla */
    }
    .menu-container h1 {
        font-size: 2em; /* Hacemos el título un poco más pequeño */
        margin-bottom: 30px;
    }
    .menu-button {
        display: block;  /* Hace que cada botón ocupe una línea completa */
        width: 100%;     /* Ocupa todo el ancho disponible */
        margin: 0 0 15px 0; /* Quita los márgenes laterales y añade espacio debajo */
        box-sizing: border-box; /* Asegura que el padding no desborde el botón */
    }
}

.action-icon {
    font-size: 20px; /* Tamaño del ícono */
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease;
}

.action-icon:hover {
    transform: scale(1.2); /* Efecto de zoom al pasar el mouse */
}

.action-icon-btn {
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #333;
    transition: transform 0.2s ease;
}

.action-icon-btn:hover {
    transform: scale(1.2);
}

.actions form {
    margin: 0;
    padding: 0;
    box-shadow: none;
    background: none;
}

.login-body {
    background-color: #888d9bff; /* Fondo oscuro base */

    background-image: url("data:image/svg+xml,%3Csvg width='400' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='50' y='150' font-family='Arial, sans-serif' font-size='50' font-weight='bold' fill='%23333333' opacity='0.4' transform='rotate(-25 150 150)'%3ECENTRO%3C/text%3E%3C/svg%3E");

    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.login-container {
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

.login-card {
    background-color: #1e1e1e;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container h2 {
    color: #ffffff;
    margin: 10px 0 0 0;
}

.login-card .alert {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.login-card label {
    color: #bbbbbb;
}

.login-card input {
    background-color: #333333;
    border: 1px solid #555555;
    color: #ffffff;
}

.login-card input:focus {
    outline: none;
    border-color: #007bff;
}

.login-card button {
    background-color: #007bff;
    border: none;
    transition: background-color 0.3s ease;
}

.login-card button:hover {
    background-color: #0056b3;
}

.logout-btn {
    background-color: #e75b10ff;
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: bold;
}

.back-link {
    display: inline-block;
    margin-bottom: 25px;
    color: #007bff; /* Color azul para que sea visible */
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- NUEVOS ESTILOS PARA LA TABLA DE REPORTE DETALLADO --- */
.table-container .asesor-header {
    background-color: #e9ecef; /* Un gris claro para resaltar el asesor */
    color: #333;
    font-size: 1.1em;
}

.table-container .detalle-dia td:first-child {
    border: none; /* Oculta el borde de la primera celda para la sangría */
}

.table-container .detalle-dia {
    background-color: #f8f9fa; /* Un fondo muy sutil para las filas de detalle */
}

.table-container tfoot .total-general {
    background-color: #343a40; /* Fondo oscuro para el total general */
    color: white;
    font-size: 1.2em;
    text-align: right;
}

.table-container tfoot .total-general th {
    text-align: right;
    padding-right: 10px;
}
.table-container tfoot .total-general th:first-child {
    text-align: left;
}

/* Estilos para la nueva página de reportes */
.report-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.date-filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.date-filter-form label {
    margin: 0;
    font-weight: 600;
}

.date-filter-form input[type="date"] {
    width: auto;
    padding: 8px;
}

.date-filter-form button {
    width: auto;
    padding: 8px 15px;
    margin: 0;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.page-link, .page-info {
    font-weight: bold;
    color: #004080;
    text-decoration: none;
}

.page-link {
    padding: 8px 15px;
    border: 1px solid #004080;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.page-link:hover {
    background-color: #004080;
    color: white;
}

.page-link.disabled {
    color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

tfoot .subtotal-pagina {
    background-color: #e9ecef;
    font-weight: bold;
}

/* --- ESTILOS COMPLETOS PARA LA PÁGINA DE LOGIN --- */
.login-body {
    background-image: url('../images/wallpaper-centro.jpg'); /* Ruta a tu imagen de fondo */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-container {
    background: rgba(20, 20, 30, 0.85); /* Fondo oscuro semi-transparente */
    padding: 40px 35px;
    border-radius: 20px; /* Bordes bien redondeados */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(5px); /* Efecto "vidrio esmerilado" */
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    max-width: 380px;
    width: 90%;
}

.login-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Overlay negro con 50% de opacidad */
    z-index: -1; 
}

.login-logo {
    max-width: 220px; /* Tamaño del logo */
    height: auto;
    margin-bottom: 30px; /* Espacio entre el logo y el formulario */
}


.form-group input[type="text"],
.form-group input[type="password"] {
    width: calc(100% - 25px); /* Ajusta el ancho, restando el padding */
    padding: 10px;
    margin-bottom: 15px;
    border: 0.5px solid #575555ff;
    border-radius: 4px;
    box-sizing: border-box; /* Incluye padding en el ancho */
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #ff6600ff; /* Color del botón */
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[class="action-icon-btn"]:hover {
    background-color: #55e004ff;
}

/* Estilos para los mensajes flash (opcional, ajusta colores si es necesario) */
.flashes {
    list-style-type: none;
    padding: 0;
    margin-bottom: 20px;
}

.flashes li {
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: bold;
    text-align: center;
}

.flashes .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flashes .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Hacemos que el header use Flexbox para alinear todo */
.header {
    display: flex;
    justify-content: space-between; /* Empuja los elementos a los extremos */
    align-items: center;
    padding: 7px 40px; /* Ajusta el padding para que no esté pegado a los bordes */
}

/* Contenedor para los enlaces de navegación */
.header-nav {
    display: flex;
    gap: 15px; /* Espacio entre los enlaces */
}

/* Contenedor para el saludo y el botón de logout */
.header-user-info {
    display: flex;
    align-items: center;
    gap: 15px; /* Espacio entre el saludo y el botón */
}

.user-greeting {
    color: #f0f0f0; /* Un color de texto claro que contraste con el fondo oscuro */
    font-size: 0.9em;
    font-weight: italic;
}

.btn-secondary {
    padding: 10px 15px;
    background-color: #6c757d; /* Un color gris secundario */
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px; /* Un poco más pequeño que el botón principal */
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.stats-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-card {
    background-color: white;
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.stat-card h3 {
    margin-top: 0;
    color: #555;
    font-size: 1em;
}

.stat-card p {
    font-size: 2.2em;
    font-weight: 700;
    color: #004080;
    margin-bottom: 0;
}

.hub-title {
    text-align: center;
    margin-bottom: 40px;
    margin-top: 20px;
}
.hub-title h2 {
    font-size: 2.8em;
    font-weight: 900;
    color: #333;
    display: inline-block;
    margin: 0 15px;
    vertical-align: middle;
}
.hub-title .hub-emoji {
    font-size: 3em;
    vertical-align: middle;
}
.hub-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.hub-card {
    background-color: #ff6a00; /* Color naranja como en tu ejemplo */
    padding: 35px 55px;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}
.hub-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}
.hub-card h3 {
    color: white;
    margin: 0;
    font-size: 1.6em;
    font-weight: 700;
}

/* Contenedor de la tabla - Se centra dentro del .content */
.table-container { 
    overflow: auto; /* CAMBIO: Usamos 'auto' para ambos scrolls */
    max-height: 70vh; /* NUEVO: Altura máxima del 70% de la pantalla */
    background: white; 
    border-radius: 10px; 
    padding: 15px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
    max-width: 100%;
    margin: 20px auto;
}

table { 
    border-collapse: collapse; 
    width: 100%; 
    font-size: 14px; 
}

th, td { 
    border: 1px solid #ddd; 
    padding: 10px; 
    text-align: left; 
    vertical-align: top;
}

th { 
    background: #004080; 
    color: white; 
    font-weight: 600; 
    white-space: nowrap;
    
    /* --- NUEVO: ESTO HACE LA MAGIA DEL ENCABEZADO FIJO --- */
    position: sticky; /* Permite que el encabezado se "pegue" */
    top: -1px;        /* Lo pega en la parte superior del contenedor */
    z-index: 10;      /* Se asegura de que esté por encima de las filas */
}

/* Estilo para filas activas (fondo verde claro) */
tr.fila-activa td {
    background-color: #e8f5e9 !important; /* Verde suave con !important */
}

tr.fila-activa:hover td {
    background-color: #c8e6c9 !important; /* Verde más oscuro al pasar el mouse */
}

/* Estilo para filas inactivas (fondo rojo claro) */
tr.fila-inactiva td {
    background-color: #ffebee !important; /* Rojo suave con !important */
    color: #c62828 !important;
    opacity: 1;
}

/* El enlace dentro de las filas inactivas */
tr.fila-inactiva a {
    color: #c62828 !important;
    text-decoration: line-through;
}

/* Hover para las filas inactivas */
tr.fila-inactiva:hover td {
    background-color: #ffcdd2 !important;
}


