body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

.container {
    background-color: #fff;
    padding: 20px;
    border-radius: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
}

h1, h2 {
    color: rgba(170, 44, 76, 1);;
    text-align: center;
}

h2 {
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    margin-top: 25px;
}

.main-header {
    display: flex;
    justify-content: center; /* <-- CAMBIO: Esto centra el grupo de logos */
    align-items: center;     /* Esto los mantiene alineados horizontalmente */
    gap: 30px;               /* <-- NUEVO: Esto añade la separación entre ellos */
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.logo-container img {
    max-height: 80px; /* Reducimos el valor para hacerlos más pequeños */
    width: auto;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="date"],
input[type="tel"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 10px;
    border: 2px solid rgba(170, 44, 76, 1);;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 16px;
    font-family: Arial, sans-serif;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background-color:#0056b3;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 26px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color:rgba(170, 44, 76, 1) ;
}

.folio {
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 1.2em;
}

/* Reglas para el selector de fecha */
.date-selector {
    display: flex;
    gap: 28px;
}

.date-selector select {
    flex-grow: 1;
}

/* Estilos para la página de Login */
.login-body {
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    background-color: #fff;
    padding: 70px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.login-container h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.login-container p {
    margin-bottom: 25px;
    color: #666;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

/* ===================================== */
/* === ESTILOS PARA EL PANEL DE ADMIN === */
/* ===================================== */

.panel-container {
    width: 95%;
    max-width: 1400px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-form {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    flex-wrap: wrap;
}

.filter-form input,
.filter-form select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Estilos genéricos para botones */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    text-align: center;
}

.btn-primary { background-color: #007bff; }
.btn-primary:hover { background-color: #0056b3; }

.btn-success { background-color: #28a745; }
.btn-success:hover { background-color: #1e7e34; }

.btn-logout { background-color: #dc3545; }
.btn-logout:hover { background-color: #b02a37; }

/* Contenedor y estilos de la tabla */
.table-container {
    overflow-x: auto; /* IMPORTANTE: Para responsividad en móviles */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

thead {
    background-color: #f2f2f2;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #f1f1f1;
}

/* ===================================== */
/* === ESTILOS RESPONSIVOS PARA MÓVIL === */
/* ===================================== */

/* Se aplicará a pantallas con un ancho máximo de 768px (tablets y celulares) */
@media (max-width: 768px) {

    /* Hacemos que el cuerpo no tenga tanto padding lateral en móviles */
    body {
        padding: 10px;
    }

    /* Reducimos el padding en las tarjetas principales para dar más espacio al contenido */
    .container,
    .login-container,
    .panel-container {
        padding: 20px;
    }

    /* Ajustamos el tamaño de los títulos para que no sean tan grandes */
    h1 {
        font-size: 1.5em;
    }
    h2 {
        font-size: 1.2em;
    }

    /* ===== INICIO DE LA MODIFICACIÓN PARA LA FECHA ===== */
    /* Hacemos los selectores de fecha más compactos para que quepan en una línea */
    .date-selector {
        gap: 8px; /* Reducimos la separación entre los campos */
    }

    .date-selector select {
        padding: 10px 5px;  /* Reducimos el padding horizontal para hacerlos más angostos */
        font-size: 14px;    /* Hacemos la letra un poco más pequeña */
    }
    /* ===== FIN DE LA MODIFICACIÓN PARA LA FECHA ===== */


    /* Hacemos que los filtros y botones del panel de admin se apilen */
    .filter-bar {
        flex-direction: column;
        align-items: stretch; /* Hacemos que los elementos ocupen todo el ancho */
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    /* Reducimos el padding en las celdas de la tabla para que quepa más información */
    th, td {
        padding: 8px;
        font-size: 12px;
    }
}

/* --- Estilos para la Validación con JavaScript --- */
.error-message-js {
    color: #dc3545; /* Un color rojo para la alerta */
    font-size: 13px;
    font-weight: bold;
    margin-top: 5px;
    height: 16px; /* Le damos una altura fija para evitar que el formulario "salte" cuando aparece el mensaje */
}

/* --- ESTILOS PARA LA PÁGINA DE INICIO (index.php) --- */

.welcome-card {
    background-color: #fff;
    padding:60px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.welcome-card .subtitle {
    font-size: 1.1em;
    color: #6c757d;
    max-width: 600px;
    margin: 10px auto 30px auto;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Espacio entre los botones */
    margin-top: 20px;
}

.action-btn {
    display: block;
    padding: 20px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    text-align: left;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.action-btn .btn-title {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
}

.action-btn .btn-description {
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 1em;
    opacity: 0.9;
}

.action-btn.btn-primary {
    background-color: rgba(170, 44, 76, 1); /* Rosa Mexicano */
}

.action-btn.btn-secondary {
    background-color: #003c7d; /* Azul del estilo anterior */
}


/* --- ESTILOS PARA LA PÁGINA DE CONSULTA Y RESULTADOS --- */

.qr-scanner-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.btn-secondary {
    background-color: #6c757d;
    border: none;
    color: white;
    padding: 10px 19px;
    border-radius: 5px;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #003c7d;
}

.result-card {
    line-height: 1.8;
}

.result-card hr {
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* --- Estilos para el enlace de Regresar --- */

.return-link-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.return-link {
    font-family: 'Lato', sans-serif;
    font-weight: bold;
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s;
}

.return-link:hover {
    color: #343a40;
    text-decoration: underline;
}

/* --- Estilos para el enlace de regreso al Menú Principal --- */

.main-header {
    /* Aseguramos que los 3 elementos se alineen correctamente */
    justify-content: space-between;
}

.return-home-container {
    display: flex;
    align-items: center;
}

.return-home-link {
    font-family: 'Lato', sans-serif;
    font-weight: bold;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.6em;
    transition: color 0.2s;
}

.return-home-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* --- Estilos para la Navegación del Panel --- */

.admin-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.admin-nav .nav-link {
    padding: 10px 15px;
    text-decoration: none;
    font-weight: bold;
    color: #6c757d;
    border-bottom: 3px solid transparent;
}

.admin-nav .nav-link:hover {
    color: #0056b3;
}

.admin-nav .nav-link.active {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

/* --- Estilo para Mensajes de Éxito --- */
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
