@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Variables de Color --- */
:root {
    --color-primario: #003764; /* Azul Corporativo Unificado */
    --color-primario-hover: #0056b3;
    --color-acento: #1fd458;
    --color-acento-fondo: #f0f4f8;
    --color-acento-texto: #003764;
    --color-texto: #343a40;
    --color-borde: #ced4da;
    --color-blanco: #ffffff;
    --color-error-fondo: #f8d7da;
    --color-error-texto: #721c24;
    --sombra-contenedor: 0 8px 30px rgba(0, 0, 0, 0.2);
}



html {
    min-height: 100%; /* Muy importante para que el body pueda heredar la altura */
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #003764 0%, #001a30 100%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--color-blanco);
    min-height: 100vh;
    text-align: center;
}




.container {
    max-width: 1700px; /* Un ancho máximo para pantallas grandes, se ajustará en las pequeñas */
    margin: 40px auto; /* Añadimos margen para centrar y dar espacio al contenedor */
    padding: 40px;
    background-color: var(--color-blanco);
    border-radius: 8px;
    box-shadow: var(--sombra-contenedor);
    color: var(--color-texto); /* Restablece el color del texto para el contenido */
    overflow: hidden;
    width: 95%;
}

/* --- Tipografía --- */
h1, h2, h3 {
    color: var(--color-primario);
    text-align: center;
    margin-bottom: 1rem;
}
h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
h2 {
    font-size: 1.2rem;
    font-weight: 400;
    color: #6c757d;
    margin-bottom: 2.5rem;
}
h3 {
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 10px;
    margin-top: 25px;
    margin-bottom: 20px;
}

/* --- Formularios --- */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-borde);
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"],:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primario-hover);
    box-shadow: 0 0 0 3px rgba(30, 74, 123, 0.15);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    margin-right: 20px;
    font-weight: normal;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    margin-right: 8px;
}

/* --- Botón Principal --- */
button {
    background-color: #003764;
    color: var(--color-blanco);
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
    margin-top: 0px;
}

button:hover {
    background-color: #0075ff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transform: scale(1.02);
}

.btn-confirm {
    background-color: #2665ae ;
    color: var(--color-blanco);
}

/* --- Mensajes de Alerta --- */
.mensaje {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid transparent;
}

.mensaje.exito {
    background-color: #e6fff6;
    color: #00830a;
    border-color: var(--color-acento);
}

.mensaje.error {
    background-color: var(--color-error-fondo);
    color: var(--color-error-texto);
    border-color: #f5c6cb;
}

/* --- Contenedor de Checkboxes para Columnas --- */
.column-toggle-container {
    display: flex;
    align-items: center; /* Centra verticalmente en una sola línea */
    align-content: center; /* Centra verticalmente si hay varias líneas */
    flex-wrap: wrap;
    margin-bottom: 0.5em;
    padding: 0px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center; /* Alinea verticalmente los checkboxes y el botón */
    flex-wrap: wrap;
    gap: 15px;
}

.column-toggle-container label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.7em;
    font-weight: 500;
}

.status-filter-group {
    display: inline-flex;
    gap: 5px;
}

.status-filter-group input[type="checkbox"]:checked {
    accent-color: #dc3545; /* Rojo para indicar exclusión */
}

.column-toggle-container label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.7em;
    font-weight: 500;
}

/* --- Estilos para Tablas tipo Excel --- */
.table-container {
    overflow: auto;
    border-top: 1px solid rgb(204 204 204);
}

table.excel-style {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8em;
    table-layout: auto;
}

/* Hacemos que todo el bloque de encabezado sea "pegajoso".
   Este es un método más simple y robusto. */
table.excel-style thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

table.excel-style th,
table.excel-style td {
    border: 1px solid #ccc;
    padding: 5px 7px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap; /* Evita que el texto se rompa en varias líneas */
}

table.excel-style thead th {
    background-color: #003764!important;
    color: var(--color-blanco)  ;
    font-weight: 600;
}

table.excel-style:not(.table-is-editing) tbody tr:hover {
    background-color: #ccd6e2;
    color: var(--color-primario);
}

table.excel-style td.cell-selected {
    outline: 2px solid #85b0e2; /* Azul claro para la selección */
    outline-offset: -2px; /* Mantiene el borde dentro de la celda */
    z-index: 2; /* Asegura que el borde sea visible */
}

table.excel-style td.cell-editing,
table.excel-style td.cell-editing:hover {

    outline: 2px solid #0075ff;
    position: relative;
}
/* Clases para feedback de guardado */
.cell-saving { background-color: #fff9c4 !important; transition: background-color 0.2s; }
.cell-saved { background-color: #c8e6c9 !important; transition: background-color 0.2s; }
.cell-error { background-color: #ffcdd2 !important; transition: background-color 0.2s; }

.status-badge {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Cuando una celda de tipo select está en edición, quitamos su padding para que el select la llene */
table.excel-style td.cell-editing[data-type="select"] {
    padding: 0;
}

/* --- Custom Dropdown (para celdas editables) --- */
.custom-dropdown {
    position: relative;
    width: 100%;
    height: 100%;
    font-size: 1em;
}

.custom-dropdown-trigger {
    width: 100%;
    height: 100%;
    padding: 8px 10px;
    background-color: transparent; /* El fondo azul viene de .cell-editing */
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.custom-dropdown-trigger::after {
    display: none; /* Se elimina la flecha del dropdown */
}

.custom-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 1001; /* Por encima de la tabla */
    max-height: 250px;
    overflow-y: auto;
    display: none; /* Oculto por defecto */
    margin-top: 2px;
}

.custom-dropdown-options.open {
    display: block;
}

.custom-dropdown-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
    font-size: 0.9em;
    border-bottom: 1px solid #f5f5f5;
}

.custom-dropdown-option:last-child { border-bottom: none; }

.custom-dropdown-option:hover {
    background-color: #f0f4f8;
    color: var(--color-primario);
}

.custom-dropdown-option.selected {
    background-color: #e6f7ff;
    color: var(--color-primario);
    font-weight: 600;
}

/* --- Search Container --- */
.search-container {
    margin-bottom: 20px;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Darker, more modern overlay */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px); /* Frosted glass effect */
}

.modal-overlay.show {
    display: flex; /* Make the modal visible when the 'show' class is added */
}

.modal-content {
    background-color: var(--color-blanco);
    padding: 40px; /* Increased padding */
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); /* Softer, larger shadow */
    width: 90%;
    max-width: 400px; /* Increased max-width for better content display */
    text-align: center;
    transform: translateY(-20px); /* Slight lift effect */
    opacity: 0;
    animation: modal-fade-in 0.3s forwards ease-out;
}

@keyframes modal-fade-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    color: var(--color-primario); /* Use primary color for heading */
    font-size: 1.8em; /* Larger heading */
    margin-bottom: 15px;
    text-align: center;
}

.modal-content p {
    color: var(--color-texto); /* Use general text color */
    font-size: 1.1em;
    line-height: 1.5;
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px; /* Increased gap between buttons */
    margin-top: 20px;
}

.modal-buttons button {
    padding: 12px 25px; /* Larger buttons */
    border-radius: 8px; /* Slightly more rounded buttons */
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none; /* Remove default button border */
}

.modal-buttons #confirmButton {
    background-color: #28a745; /* Green for confirm */
    color: var(--color-blanco);
}

.modal-buttons #confirmButton:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.modal-buttons #cancelButton {
    background-color: #dc3545; /* Red for cancel */
    color: var(--color-blanco);
}

.modal-buttons #cancelButton:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* --- Table Sorting Styles --- */
table.excel-style thead th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 25px; /* Space for arrow */
    color:white;
}

table.excel-style thead th.sortable::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    opacity: 0.3;
}

table.excel-style thead th.sortable[data-sort-direction="asc"]::after {
    border-bottom-color: #ffffff;
    opacity: 1;
    top: 12px;
}

table.excel-style thead th.sortable[data-sort-direction="desc"]::after {
    border-top-color: white;
    opacity: 1;
}

/* --- Table Filtering Styles --- */
thead .filter-row th {
    padding: 5px 8px;
    background-color: #e9ecef;
}

thead .filter-row input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9em;
}

thead .filter-row input:focus {
    border-color: var(--color-primario-hover);
    outline: none;
}

/* --- Overwrite default filter row display --- */
thead .filter-row {
    display: none; /* Oculto por defecto */
}
thead .filter-row.visible {
    display: table-row;
}

/* --- Dashboard Styles --- */
.dashboard-container {
    padding: 60px; /* Más padding para una sensación más espaciosa */
}

.dashboard-subtitle {
    text-align: center;
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Columnas responsivas */
    gap: 25px; /* Espacio entre las tarjetas */
}

.dashboard-card {
    background-color: var(--color-acento-fondo);
    border: 1px solid var(--color-borde);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--color-texto);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.dashboard-card h3 {
    text-align: center;
    color: var(--color-primario);
    border-bottom: none; 
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #003764;
    font-weight: 600;
}

.dashboard-card p {
    margin: 0;
    font-size: 0.75rem;
    color: #525f7f;
    flex-grow: 1;
    text-align: center;
}

.card-logout {
    background-color: #f8d7da; /* Color de error para el botón de cerrar sesión */
}

.card-logout:hover {
    background-color: #f5c6cb;
}

/* --- Page-specific & Component Styles --- */

/* Modifier for a more compact container on data-heavy pages */
.container--compact {
    max-width: 1900px;
    margin: 20px auto;
    padding: 25px;
    min-height: 85vh;
    background-color: var(--color-blanco);
    color: var(--color-texto);
    border-radius: 12px;
    box-shadow: var(--sombra-contenedor);
}

/* Header for pages with back button and title */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0rem;
}

.page-title-container {
    text-align: center;
    margin-bottom: 0rem;
}



.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0rem;
    margin-top: 0em;
}

.record-counter {
    color: #0075ff;
    font-size: 0.85em;
    margin: 0;
}

.btn-back {
    background-color: #003764;
    color: #ffffff;
    padding: 11px 16px;
    border: 1px solid var(--color-borde);
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background-color: #0075ff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transform: scale(1.02);
}

.btn-logout {
    background-color: #bd2736;
    color: #ffffff;
    padding: 8px 12px; 
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8em;
    transition: all 0.2s ease;
    margin-left: 10px;
}
/* --- Estilos para la página de Login --- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh; /* Altura completa ahora que el body no tiene padding */
}

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

.login-container h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.login-container h2 {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form button {
    margin-top: 10px;
}

/* --- Estilos para el Pie de Página --- */
footer {
    text-align: center;
    padding: 0px;
}


footer p {
    font-family: 'Jersey 10';
    margin: 0;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.login-footer {
    text-align: center;
    padding: 0px;
    color: rgba(255, 255, 255, 0.7);
    margin: 7px;
}

.login-footer p {
    font-family: 'Jersey 10';
    margin: 0;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}
.modal-overlay.show {
    display: flex; /* Make the modal visible when the 'show' class is added */
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.75em;
    margin-top: 0; /* Override default button margin-top */
}

.btn-edit {
    background-color: #17a2b8; /* Blue */
}

.btn-edit:hover {
    background-color: #138496;
}

.btn-delete {
    background-color: #dc3545; /* Red */
}

.btn-delete:hover {
    background-color: #c82333;
}

.form-row {
    display: flex;
    gap: 20px; /* Adjust as needed */
    justify-content: space-between;
}

.form-row .form-group {
    flex: 1;
}

.calendar-day.has-event {
    background-color: #008cff00;
    color: #0a92ff;
    border-radius: 18%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 12px;
    margin: 0 auto;
    border: 1px solid #0a92ff;
}