﻿/* Variables de colores */
:root {
    --primary-color: #4c90af;
    --primary-hover-color: #455aa0;
    --background-color: #f0f0f0;
    --text-color: #333;
    --input-border-color: #ccc;
    --input-bg-color: #fff;
    --table-header-bg-color: #f2f2f2;
    --table-row-bg-color: #f9f9f9;
    --remove-button-color: rgb(254, 122, 122);
    --remove-button-hover-color: rgb(152, 58, 58);
    --suggestions-bg-color: white;
    --suggestions-border-color: #ccc;
    --suggestions-hover-bg-color: #f0f0f0;
}



/* Global Styles */
html, body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
} 

/* Asegura que la barra no tenga gaps por márgenes colapsados */
header, nav { margin: 0; padding-top: 0; }
header {
    background-color: var(--primary-color);
    color: white;
    padding: 0px 0;
    position: relative;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

nav ul li {
    display: flex;
    align-items: center; /* Ensure all items are aligned center */
}

nav ul li a {
    text-decoration: none;
    color: white;
    font-weight: bold;
    padding: 10px 15px;
    transition: background-color 0.3s;
    display: flex;
}

nav ul li a:hover {
    background-color: var(--primary-hover-color);
    border-radius: 4px;
}

.menu-toggle {
    display: none;
}

main {
    padding: 2px;
    margin: 20px auto;
    max-width: 99%;
    background-color: var(--input-bg-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: hidden; /* Disable horizontal scrolling for main content */
    height: auto;
}


h1 {
    color: var(--text-color);
    text-align: center;
}

form {
    background-color: var(--input-bg-color);
    padding: 20px;
    margin: 10px auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%;
}


/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center; /* Centra los elementos horizontalmente */
}

.form-group {
    flex: 1;
}

.item1, .item2, .item3, .item4, .item5 {
    flex-basis: 100%;
}

/* En pantallas grandes */
@media (min-width: 900px) {
    .item1, .item2, .item3, .item4, .item5 {
        flex-basis: auto;
    }

    .item1, .item2, .item3, .item4, .item5 {
        flex: 1;
    }

    .form-row .item2 {
        display: flex;
        flex-direction: row; /* Alinea los inputs y el botÃ³n horizontalmente */
        gap: 10px;
    }
    .time-inputs-group {
        display: flex;
        flex-direction: row; /* Alinea los inputs y el botÃ³n horizontalmente */
        gap: 10px;
    }
    .item2 .form-group {
        flex: 1;
    }

    .item2 .auto-completar {
        align-self: center; /* Mantiene el botÃ³n alineado con los inputs */
        width: auto; /* Ajusta el ancho del botÃ³n */
    }

    .item2 .form-group input[type="time"] {
        width: auto; /* Asegura que los inputs se ajusten al contenido */
    }
}

@media (max-width: 900px) { /*time-inputs-group*/
    .form-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 60px auto auto;
        gap: 5px;
        grid-template-areas:
            "item1 item2 item2"
            "item3 item3 item3"
            "item4 item5 item5";
        row-gap: 0px; /* Elimina el espacio entre las filas */
        column-gap: 5px; /* MantÃ©n el espacio entre las columnas, si lo deseas */
    }

    /* ConfiguraciÃ³n de cada item */
    .item1 {
        grid-area: item1;
        gap: 0px;
    }

    .item2 {
        grid-area: item2;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-columns: auto auto; /* Dos columnas de tamaÃ±o automÃ¡tico */
        gap: 10px;
        align-items: center; /* Centrar verticalmente los elementos */
    }


    .time-inputs-group {
        display: flex;
        flex-direction: row;
        gap: 5px; /* Espacio reducido entre los inputs */
        align-items: center;
    }

    .time-inputs-group .form-group {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .item2 .form-group input[type="time"] {
        width: 90px; /* Ancho especÃ­fico para los inputs de time */
    }

    .auto-completar {
        grid-column: span 2; /* Ocupa ambas columnas */
        justify-self: start;
        padding: 4px 8px; /* BotÃ³n mÃ¡s compacto */
        font-size: 14px;
        width: auto; /* No ocupe todo el ancho */
    }

    .item3 {
        grid-area: item3;
    }

    .item4 {
        grid-area: item4;
    }

    .item5 {
        grid-area: item5;
        display: flex;
        align-items: center;
        flex-direction: column;
        gap: 1px;
    }

    /* Ajustes para reducir el tamaÃ±o dentro de cada form-group */
    .form-group {
        font-size: 14px;
    }

    label {
        font-size: 14px;
        display: block;
        margin-bottom: 4px;
    }

    input[type="text"],
    input[type="password"],
    input[type="date"],
    input[type="time"],
    input[type="file"],
    textarea,
    select {
        font-size: 14px;
        padding: 6px;
        margin-bottom: 10px;
        border-radius: 4px;
        box-sizing: border-box;
    }

    button {
        padding: 6px 12px;
        font-size: 14px;
    }
}



/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/



label {
    font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 4px; /* este sirve para el alto de la fecha*/
    margin-bottom: 1px;
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}

button:hover {
    background-color: var(--primary-hover-color);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 14px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table th, table td {
    padding: 5px;
    border: 1px solid var(--input-border-color);
    word-wrap: break-word;
    text-align: left;
    vertical-align: middle; /* Center content vertically */
}

table th {
    background-color: var(--table-header-bg-color);
    font-weight: bold;
}

table tbody tr:nth-of-type(even) {
    background-color: var(--table-row-bg-color);
}

table td input[type="text"],
table td input[type="password"],
table td input[type="date"],
table td input[type="time"],
table td textarea,
table td select {
    box-sizing: border-box;
}

.add-employee {
    display: flex;
    gap: 5px;
    position: relative;
}

#searchEmpleado {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    background-color: var(--input-bg-color);
    color: var(--text-color);
}

.suggestions {
    position: fixed; /* Cambiado a fixed para sacarlo del flujo del contenedor */
    background-color: var(--suggestions-bg-color);
    border: 1px solid var(--suggestions-border-color);
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000; /* Muy alto para que estÃ© encima de todo */
    width: auto; /* Ajuste para que se expanda segÃºn el contenido */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.suggestion-item {
    padding: 8px;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: var(--suggestions-hover-bg-color);
}

.remove-button {
    background-color: var(--remove-button-color);
    color: white;
    border: none;
    cursor: pointer;
    width: 80% !important;
    height: 20px !important;
    margin: auto !important;
    display: block !important;
    position: relative !important;
    padding: 0px 0px 0px 0px !important;
}

.remove-button:hover {
    background-color: var(--remove-button-hover-color);
}

.suggestions {
    position: absolute;
    background-color: var(--suggestions-bg-color);
    border: 1px solid var(--suggestions-border-color);
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.parte-status-label {
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-color);
}

.username {
    font-size: 0.5em;
    color: #ffffff;
    display: block;
    text-align: center;
    margin-top: 5px;
}

.suggestion-item {
    padding: 8px;
    cursor: pointer;
}

.suggestion-item:hover {
    background-color: var(--suggestions-hover-bg-color);
}

.position-relative {
    position: relative;
}

/* Autocompletar Form */
.auto-completar-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 1px;
}

.auto-completar-form {
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
    min-width: auto;
}

.auto-completar-form label {
    font-weight: bold;
}

.auto-completar-form input[type="time"] {
    padding: 4px;
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    width: auto;
}

.auto-completar-form button {
    padding: 5px 10px;
    font-size: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: auto;
}

.auto-completar-form button:hover {
    background-color: var(--primary-hover-color);
}

#calendar {
    width: 100%;
    height: calc(100vh - 150px);
    max-width: 50%; /* Previene que exceda el contenedor */
    margin: 0 auto;
    padding: 20px;

}

.fc-day {
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
}

.fc-day-number {
    font-weight: bold;
}

.fc-day-porcentaje {
    font-size: 14px;
    color: #333;
}

.fc-day-top {
    text-align: center;
    font-weight: bold;
}

.fc-event {
    background-color: #007bff;
    border: none;
    border-radius: 3px;
    color: white;
    font-size: 0.8em;
    padding: 2px;
}

.fc-title {
    font-size: 1em;
    font-weight: bold;
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 0px;
}

#empleadosTable {
    width: 100%;
    overflow-x: auto; /* Allow horizontal scrolling */
    display: block; /* Ensure the table is block-level to allow scrolling */
    max-width: none; /* Disable max-width for better scrolling */
}

#empleadosTable tbody tr {
    padding: 1px;
    font-size: 14px;
    line-height: 1;
    height: 24px;
}

#empleadosTable tbody tr td {
    padding: 1px;
    vertical-align: middle; /* Center content vertically */
}

.remove-button:hover {
    background-color: var(--remove-button-hover-color);
}

.autocomplete-name, .autocomplete-dni,
input[type="time"], input[type="checkbox"],
textarea, select {
    padding: 0 !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    height: 24px !important;
    vertical-align: middle !important; /* Center content vertically */
}

td {
    vertical-align: middle !important;
    text-align: center;
    white-space: nowrap; /* Prevent text from wrapping */
}

td input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: auto !important;
    display: block !important;
    position: relative !important;
}

.dropdown {
    position: relative;
    display: inline-block;
    text-align: left; /* Asegura la alineaciÃ³n a la izquierda */
}

.horizontal-form {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.horizontal-form {
    display: flex;
    flex-direction: column;
}

.horizontal-form label {
    margin-bottom: 5px;
}

.horizontal-form input[type="date"] {
    padding: 8px;
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    box-sizing: border-box;
}

.horizontal-form button[type="submit"] {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.horizontal-form button[type="submit"]:hover {
    background-color: var(--primary-hover-color);
}

.fc .fc-toolbar.fc-header-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.fc .fc-toolbar.fc-header-toolbar .fc-left,
.fc .fc-toolbar.fc-header-toolbar .fc-center,
.fc .fc-toolbar.fc-header-toolbar .fc-right {
    display: flex;
    gap: 10px;
}

/* Specific Column Widths */
#empleadosTable th:nth-child(1),
#empleadosTable td:nth-child(1) {
    min-width: 200px; /* Adjust width as needed */
    max-width: 250px;
    width: 20%; /* Adjust width as needed */
}

#empleadosTable th:nth-child(2),
#empleadosTable td:nth-child(2) {
    width: 10%; /* Adjust width as needed */
}

nav ul.show a {
    color: var(--text-color); /* AsegÃºrate de que este color contraste con el fondo */
    text-align: center; /* Opcional: Para centrar el texto */
    display: block;
    padding: 10px 15px; /* Ajusta el padding segÃºn sea necesario */
    text-decoration: none;
}

@media (max-width: 900px) {
    #calendar {
        width: 100%;
        height: calc(100vh - 150px);
        max-width: 90%; /* Previene que exceda el contenedor */
        margin: 0 auto;
        padding: 20px;
    }

    .fc-view-container {
        height: auto;  /* Asegura que la vista se ajuste automÃ¡ticamente */
    }

    .fc-event, .fc-title {
        font-size: 0.8em;  /* Ajustar el tamaÃ±o de fuente para eventos y tÃ­tulos */
    }

    .fc-toolbar .fc-left, .fc-toolbar .fc-center, .fc-toolbar .fc-right {
        flex-wrap: wrap;  /* Asegura que los botones de la barra de herramientas no se desborden */
        text-align: center;
    }

    .fc-toolbar .fc-left, .fc-toolbar .fc-right {
        width: 100%;
        justify-content: space-around;
    }

    .fc-toolbar .fc-center {
        width: 100%;
        margin-top: 10px;
    } 

/* Asegura que la barra no tenga gaps por márgenes colapsados */
header, nav { margin: 0; padding-top: 0; }
header {
        padding: 1px;
    }

    form {
        padding: 1px 5px;
    }
    .menu-toggle {
        display: block;
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 10px;
        cursor: pointer;
        text-align: center;
        width: 100%;
        font-size: 16px;
    }

    main {
        padding: 0px;
        margin: 0px auto;
        max-width: 100%;
        background-color: var(--input-bg-color);
    }



    .horizontal-form {
        flex-direction: column;
        gap: 1px;
    }

    .auto-completar-form {
        flex-direction: row; /* Cambia la direcciÃ³n del flex a horizontal */
        align-items: center; /* Alinea los items verticalmente al centro */
        justify-content: space-between; /* Espacio uniforme entre los items */
    }

    .auto-completar-form {
        flex: 1; /* Permite que los form-group tomen espacio disponible uniformemente */
        margin-bottom: 0; /* Elimina mÃ¡rgenes inferiores innecesarios */
    }

    .auto-completar-form button {
        flex-shrink: 0;
        margin-top: 0;
        width: 120px !important; /* Ajusta este valor segÃºn lo necesites */
        min-width: 10px; /* Un mÃ­nimo ancho para asegurar visibilidad en pantallas pequeÃ±as */
        padding: 8px 12px; /* Ajuste del padding para asegurar buen tamaÃ±o */
        font-size: 14px; /* TamaÃ±o de fuente ajustado para pantallas pequeÃ±as */
    }

    nav ul {
        display: none; /* Hide the full menu initially */
        flex-direction: column;
        align-items: center;
    }

    nav ul.show {
        display: flex;
        position: absolute;
        background-color: var(--input-bg-color);
        top: 50px;
        left: 0; /* Alinea a la izquierda */
        right: 0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        flex-direction: column;
        padding: 0;
        align-items: flex-start; /* Alinea todos los elementos a la izquierda */
    }

    .dropdown-content {
        left: 0 !important; /* Alinea el dropdown a la izquierda del contenedor principal */
        margin-left: 0 !important; /* Elimina cualquier margen que pueda estar afectando la posiciÃ³n */
        border: 1px solid var(--input-border-color) !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
    }

    nav ul li {
        width: 100%; /* Asegura que todos los elementos ocupen el ancho completo */
        text-align: left; /* Alinea el texto a la izquierda */
    }

    nav ul li a {
        width: 100%; /* AsegÃºrate de que los enlaces ocupen todo el ancho disponible */
        padding: 10px 15px; /* Ajusta el padding para mantener una buena apariencia */
        box-sizing: border-box;
        text-align: left; /* Alinea el texto a la izquierda */
    }

    table th, table td {
        padding: 8px;
    }

    table {
        font-size: 14px;
        table-layout: fixed;
        width: 100%; /* Ensure table takes up the full width */
    }

    /* Adjust column widths for smaller screens */
    #empleadosTable th:nth-child(1),
    #empleadosTable td:nth-child(1) {
        min-width: 100px !important; /* Adjust width as needed */
        max-width: 150px !important;
        width: 18% !important; /* Adjust width as needed */
    }

    #empleadosTable th:nth-child(2),
    #empleadosTable td:nth-child(2) {
        width: 8% !important; /* Adjust width as needed */
    }

    .dropdown-content {
        left: 0 !important; /* Alinea el dropdown a la izquierda del contenedor principal */
        margin-left: 0 !important; /* Elimina cualquier margen que pueda estar afectando la posiciÃ³n */
        width: 100% !important; /* Asegura que el dropdown ocupe el ancho disponible */
    }

}

@media (max-width: 900px) {



    .auto-completar-form {
        gap: 1px; /* Reducimos el espacio entre los elementos */
        flex-direction: row; /* Mantiene la disposiciÃ³n horizontal */
        align-items: center;
        justify-content: space-between;
    }

    .auto-completar-form {
        flex: 1;
        margin-bottom: 1px; /* Reducimos el margen inferior */
    }

    .auto-completar-form button {
        flex-shrink: 0;
        margin-top: 0;
        width: 100px !important; /* Ajustamos el ancho del botÃ³n */
        min-width: 10px;
        padding: 6px 10px; /* Ajustamos el padding del botÃ³n */
        font-size: 12px; /* Reducimos el tamaÃ±o del texto del botÃ³n */
    }

    #frenteTrabajo {
        width: 100%; /* Ajustamos el ancho del select del frente de trabajo */
        padding: 6px; /* Reducimos el padding */
        font-size: 14px; /* Reducimos el tamaÃ±o del texto */
    }

    .horizontal-form button[type="submit"] {
        padding: 8px 12px; /* Reducimos el padding del botÃ³n de submit */
        font-size: 14px; /* Reducimos el tamaÃ±o del texto */
    }


    .auto-completar-form {
        flex-direction: row; /* Mantener la disposiciÃ³n horizontal */
        gap: 4px; /* Reducir el espacio entre los elementos */
        align-items: center; /* Alinear verticalmente los elementos al centro */
        justify-content: space-between; /* Distribuir el espacio uniformemente entre los elementos */
    }

    .auto-completar-form {
        margin-bottom: 0; /* Eliminar el margen inferior */
    }

    .auto-completar-form button {
        padding: 4px 6px; /* Reducir el padding del botÃ³n */
        font-size: 12px; /* Reducir el tamaÃ±o de la fuente del botÃ³n */
    }

    .fc-view-container {
        height: auto;
    }

}



/* Fijar la primera columna de la tabla */
.table-wrapper {
    position: relative;
    overflow-x: auto;
    max-width: 100%; /* Ajusta segÃºn sea necesario */
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table-wrapper th,
.table-wrapper td {
    padding: 8px;
    border: 1px solid var(--input-border-color);
    word-wrap: break-word;
    text-align: left;
    vertical-align: middle;
}

.table-wrapper th:first-child,
.table-wrapper td:first-child {
    position: sticky;
    left: 0;
    z-index: 1; /* Asegura que estÃ© por encima del resto de las columnas */
    background-color: var(--table-header-bg-color); /* Fondo para mantener el estilo visual */
}

.table-wrapper th:first-child {
    z-index: 2; /* Asegura que el encabezado estÃ© por encima de las celdas de la primera columna */
}



/*------------------------------------------------------------------------------------------------------------------------------------------------------waaaa-----------------------------------------------------------------------*/

/* Limitar el ancho de los inputs de archivo y selects */
.subir-archivo-detalle,
.archivosCargadosSelect {
    max-width: 85px;
    display: inline-block;
    vertical-align: middle;
    font-size: 12px; /* TamaÃ±o de texto reducido para mejor alineaciÃ³n */
}

.archivosCargadosSelect {
    max-width: 85px;
    margin-right: 1px;
}

/* Estilos para los enlaces */
.descargarArchivoDetalleLink,
.eliminarArchivoDetalleLink {
    text-decoration: none;
    font-size: 12px;
    margin-right: 1px;
    cursor: pointer;
}

.descargarArchivoDetalleLink {
    color: blue;
}

.eliminarArchivoDetalleLink {
    color: red;
}

/* Asegurar que los enlaces y selects estÃ©n alineados */
.archivosCargadosSelect,
.descargarArchivoDetalleLink,
.eliminarArchivoDetalleLink {
    display: inline-block;
    vertical-align: middle;
}

/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/



@media (max-width: 900px) {
    .table-wrapper {
        animation: scrollHint 1s ease-in-out 2s;
    }

    @keyframes scrollHint {
        0% {
            transform: translateX(0);
        }
        25% {
            transform: translateX(-20px); /* Mueve el contenido 20px hacia la izquierda */
        }
        50% {
            transform: translateX(0); /* Vuelve a la posiciÃ³n original */
        }
        75% {
            transform: translateX(-20px); /* Mueve de nuevo 20px hacia la izquierda */
        }
        100% {
            transform: translateX(0); /* Vuelve a la posiciÃ³n original */
        }
    }

    .form-group.item1 {
        display: flex;
        flex-direction: column;
        justify-content: center; /* Centra verticalmente el contenido */
        height: 100%; /* AsegÃºrate de que el contenedor tenga una altura suficiente */
        gap: 0px;
    }
    .auto-completar button {
        margin-top: 0;
        margin-bottom: 0;
    }
    .auto-completar {
        margin-top: 0;
        margin-bottom: 0;
    }
    .form-group.item2 {
        gap: 0;
    }
    .form-row {
        gap: 1;
    }

    .auto-completar {
        justify-self: center; /* Centra horizontalmente */
        align-self: center; /* Centra verticalmente */
        margin-top: 0; /* Elimina cualquier margen superior */
        margin-bottom: 0; /* Elimina cualquier margen inferior */
        width: auto; /* Asegura que el botÃ³n no ocupe todo el ancho */
    }



    .item2 {
        grid-area: item2;
        display: grid;
        grid-template-columns: 1fr; /* Una columna que ocupa todo el ancho */
        grid-template-rows: auto auto; /* Dos filas: una para los inputs, otra para el botÃ³n */
        gap: 10px; /* Espacio entre filas */
        align-items: center; /* Centra verticalmente los elementos */
    }

    /* Mantener la disposiciÃ³n horizontal de los inputs en la primera fila */
    .time-inputs-group {
        display: flex;
        flex-direction: row;
        gap: 5px; /* Espacio reducido entre los inputs */
        justify-content: center; /* Centrar horizontalmente los inputs */
    }

    .auto-completar {
        justify-self: center; /* Centrar el botÃ³n horizontalmente */
        align-self: center; /* Centrar el botÃ³n verticalmente */
    }


/*------------------------*/



}


/*--------------------------------------------------------------------------------------------------------*/

/* Estilo general del botÃ³n para hacerlo mÃ¡s pequeÃ±o */
.auto-completar button {
    padding: 4px 8px; /* Ajusta el tamaÃ±o del padding para hacerlo mÃ¡s pequeÃ±o */
    font-size: 12px; /* Ajusta el tamaÃ±o de la fuente */
    border-radius: 4px; /* AÃ±ade un poco de curvatura a las esquinas */
    width: auto; /* Permite que el botÃ³n tome un ancho automÃ¡tico */
    height: auto; /* Permite que el botÃ³n ajuste su altura automÃ¡ticamente */
}

.form-row {
    margin-bottom: 4px; /* Reduce la distancia entre form-row y el siguiente elemento */
}

.table-wrapper {
    margin-top: 0; /* Elimina cualquier margen superior adicional */
}
#empleadosTable {
    margin-top: 0; /* Elimina cualquier margen superior de la tabla */
}




body, html {
    height: 100%; /* Asegura que el body y el html ocupen toda la altura de la pantalla */
    margin: 0; /* Elimina cualquier margen por defecto */
}

main {
    display: flex;
    flex-direction: column;
    min-height: 85vh; /* Asegura que el main ocupe toda la altura de la pantalla */
    padding: 1px; /* Espacio interno opcional */
    box-sizing: border-box;
}

#parteDiarioForm {
    flex-grow: 1; /* Permite que el formulario crezca para llenar el espacio disponible */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Opcional: distribuye el contenido dentro del formulario */
    height: 100%; /* Asegura que el formulario ocupe todo el espacio disponible */
}

/* Si es necesario, ajusta la altura de elementos internos */
.table-wrapper {
    flex-grow: 1; /* Permite que la tabla crezca para ocupar el espacio disponible */
    overflow-y: auto; /* Asegura que la tabla tenga scroll si es necesario */
}

/* Ajusta los mÃ¡rgenes de los botones si es necesario */
button {
    margin-top: 3px; /* Ajusta segÃºn sea necesario */
    margin-bottom: 3px; /* Ajusta segÃºn sea necesario */
}

#observaciones_generales {
    height: 50px!important; /* Ajusta este valor para hacer el textarea mÃ¡s alto */
    padding: 1px; /* Aumenta el padding si deseas mÃ¡s espacio interno */
    font-size: 16px; /* Puedes ajustar el tamaÃ±o de la fuente si es necesario */
    box-sizing: border-box; /* Asegura que el padding no afecte el tamaÃ±o total */
    border-radius: 4px; /* MantÃ©n el borde redondeado si lo deseas */
    border: 1px solid #ccc; /* Ajusta el color del borde si es necesario */
}






#parteDiarioForm {
    width: 100%; /* Asegura que el formulario ocupe el 100% del ancho disponible */
    max-width: 100%; /* Asegura que no se extienda mÃ¡s allÃ¡ del ancho disponible */
    box-sizing: border-box; /* Incluye el padding y bordes dentro del ancho total */
    overflow-x: hidden; /* Evita que el formulario se desborde horizontalmente */
}



input[type="file"] {
    height: 20px; /* Fija la altura del input */
    padding: 0px 0px; /* Ajusta el padding para espacio interno */
    line-height: 9px; /* Ajusta la altura de la lÃ­nea para centrar el texto */
    font-size: 10px; /* Ajusta el tamaÃ±o de la fuente */
    box-sizing: border-box; /* Asegura que el padding no afecte el tamaÃ±o total */
}



/* Estilos generales para los enlaces */
a {
    color: #3498db; /* Color de texto */
    text-decoration: none; /* Quitar subrayado */
    font-weight: bold; /* Texto en negrita */
    padding: 5px 10px; /* Espaciado interno */
    border-radius: 5px; /* Bordes redondeados */
    transition: background-color 0.3s ease, color 0.3s ease; /* TransiciÃ³n suave */
}

/* Estilo para enlaces al pasar el cursor por encima */
a:hover {
    background-color: #2980b9; /* Fondo azul al pasar el mouse */
    color: white; /* Color de texto blanco al pasar el mouse */
    text-decoration: underline; /* Subrayado al pasar el mouse */
}

/* Estilo para enlaces en estado activo o visitado */
a:active, a:visited {
    color: #1f618d; /* Color diferente para enlaces visitados o activos */
}

/* Estilos para los botones de navegaciÃ³n de fecha */
.small-button {
    padding: 1px 8px;
    font-size: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 1px; /* Espacio antes del contenedor */
    margin-bottom: 1px; /* Espacio despuÃ©s del contenedor */
}

.small-button:hover {
    background-color: #2980b9;
}

.small-button:focus {
    outline: none;
}


.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--input-bg-color); /* MantÃ©n el mismo color de fondo */
    border: 1px solid var(--input-border-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); /* Consistente con otros menÃºs */
    min-width: 160px;
    z-index: 1;
    left: 0; /* Alinea a la izquierda */
    margin-left: 0; /* Asegura que no haya margen adicional */
}

.dropdown-content a {
    color: black;
    padding: 10px 15px;
    text-align: left; /* Alinea el texto a la izquierda */
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: var(--table-row-bg-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}


.form-group.item1 {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    grid-template-rows: auto auto;
    column-gap: 5px; /* Espacio entre columnas */
    row-gap: 0px; /* Espacio entre filas */
    align-items: center;

    margin-top: 1px; /* Espacio antes del contenedor */
    margin-bottom: 1px; /* Espacio despuÃ©s del contenedor */

    padding-top: 1px; /* Espacio dentro, arriba del contenido */
    padding-bottom: 1px; /* Espacio dentro, abajo del contenido */
}



.main-container {
    margin: 0 auto;
    padding: 1px;
}

.main-narrow {
    max-width: 800px;
}

.main-wide {
    max-width: 1600px;
}

.main-full {
    max-width: 100%;
}

.main-narrow2 {
    max-width: 550px;
}



/* Tabla en pantallas grandes */
table th:nth-child(19),
table td:nth-child(19) {
    min-width: 230px;
    max-width: 410px; /* Ajusta segÃºn sea necesario */
}

/* Responsive para pantallas pequeÃ±as */
@media (max-width: 900px) {
    /* Ajuste especÃ­fico para la columna "Archivos" */
    table th:nth-child(19),
    table td:nth-child(19) {
        min-width: 230px; /* Asegura un mÃ­nimo aceptable en pantallas pequeÃ±as */
    }
    /* Puedes agregar mÃ¡s reglas para ajustar otras columnas si es necesario */
}

/* Restablecer `table-layout` para mayor control de anchos */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    table-layout: auto; /* Asegura que las columnas puedan ajustar su ancho */
}

/* Ajustes para todas las columnas, puedes personalizar mÃ¡s si es necesario */
table th,
table td {
    padding: 0px;
    border: 1px solid var(--input-border-color);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap; /* Evita el wrapping de texto, para mantener las celdas mÃ¡s compactas */
}

/* Para asegurar que el contenido no se salga de los lÃ­mites del contenedor */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}


.fc-day {
    cursor: pointer; /* Cambia el cursor a pointer para toda el Ã¡rea del dÃ­a */
}

.fc-day-top {
    pointer-events: none; /* Desactiva eventos en los elementos del tÃ­tulo para evitar problemas con el clic */
}

.fc-day:hover {
    background-color: rgba(76, 144, 175, 0.2); /* Color de fondo al pasar el cursor */
    transition: background-color 0.3s ease; /* TransiciÃ³n suave */
}


.fc-day-custom {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.fc-day-custom:hover {
    background-color: rgba(76, 144, 175, 0.2);
}

/* Tabla en pantallas grandes
table th:nth-child(1),
table td:nth-child(1) {
    min-width: 130px !important;
    max-width: 500px;
}/* Ajusta segÃºn sea necesario */

/* Tabla en pantallas grandes */
table th:nth-child(2),
table td:nth-child(2) {
    min-width: 50px;
    max-width: 500px; /* Ajusta segÃºn sea necesario */
}

#filterEmpleado {
    width: 100px; /* Ajusta el ancho para alinearse con la tabla */
    height: 22px;
    padding: 0px; /* AÃ±ade algo de padding para mejorar la apariencia */
    margin-top: 0px; /* SeparaciÃ³n del tÃ­tulo de la columna */
    border: 1px solid #ccc; /* Borde para distinguir el input */
    border-radius: 4px; /* Bordes redondeados */
    font-size: 14px; /* TamaÃ±o de fuente para coincidir con otros inputs */
    box-sizing: border-box; /* Incluye padding y borde en el ancho total */
}

/* Estilo de foco para el input de filtro */
#filterEmpleado:focus {
    border-color: #007bff; /* Cambia el color del borde al hacer foco */
    outline: none; /* Elimina el borde predeterminado del navegador */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* AÃ±ade una sombra para destacar */
}

@media (max-width: 900px) {
    #filterEmpleado {
        width: 70px !important; /* Ajusta el ancho para alinearse con la tabla */
        height: 22px;
    }
}

#filterDocumento {
    width: 50px; /* Ajusta el ancho para alinearse con la tabla */
    height: 22px;
    padding: 0px; /* AÃ±ade algo de padding para mejorar la apariencia */
    margin-top: 0px; /* SeparaciÃ³n del tÃ­tulo de la columna */
    border: 1px solid #ccc; /* Borde para distinguir el input */
    border-radius: 4px; /* Bordes redondeados */
    font-size: 14px; /* TamaÃ±o de fuente para coincidir con otros inputs */
    box-sizing: border-box; /* Incluye padding y borde en el ancho total */
}

/* Estilo de foco para el input de filtro */
#filterDocumento:focus {
    border-color: #007bff; /* Cambia el color del borde al hacer foco */
    outline: none; /* Elimina el borde predeterminado del navegador */
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); /* AÃ±ade una sombra para destacar */
}

@media (max-width: 900px) {
    #filterDocumento {
        width: 50px !important; /* Ajusta el ancho para alinearse con la tabla */
        height: 22px;
    }


}


.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-error {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

.alert-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

/* Aplica un efecto de transparencia a toda la fila al pasar el cursor */
#empleadosTable tbody tr:hover {
    background-color: rgba(208, 231, 255, 0.8); /* Azul claro con un poco de transparencia */
}

/* Cambia el fondo de los elementos dentro de la fila al pasar el cursor */
#empleadosTable tbody tr:hover td input,
#empleadosTable tbody tr:hover td textarea,
#empleadosTable tbody tr:hover td select {
    background-color: rgba(208, 231, 255, 0.3); /* Un azul mÃ¡s claro y mÃ¡s transparente */
}

#empleadosTable th a {
    color: black; /* Cambia el color del texto a negro */
    text-decoration: none; /* Elimina el subrayado para que se vea mÃ¡s como un tÃ­tulo */
    cursor: pointer; /* Cambia el cursor al de "pointer" para indicar que es interactivo */
}

/* Highlighting para personas notificadas como ausentes en el modal */
#empleadosTable tbody tr.ausencia-notificada-modal {
    background-color: rgba(255, 243, 205, 0.5) !important; /* Amarillo suave */
    border-left: 3px solid #ff9800; /* Borde naranja */
}

#empleadosTable tbody tr.ausencia-notificada-modal:hover {
    background-color: rgba(255, 243, 205, 0.8) !important;
}

#empleadosTable tbody tr.ausencia-notificada-modal td input,
#empleadosTable tbody tr.ausencia-notificada-modal td textarea,
#empleadosTable tbody tr.ausencia-notificada-modal td select {
    background-color: rgba(255, 243, 205, 0.3);
}




/* Contenedor de los toasts */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Estilo base de los toasts */
.toast {
    padding: 12px 16px;
    margin: 5px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.3s ease-in-out;
    transform: translateX(100%);
    max-width: 400px; /* ðŸ”¥ Permite mensajes mÃ¡s largos */
    white-space: normal; /* ðŸ”¥ Permite mÃºltiples lÃ­neas */
    word-wrap: break-word; /* ðŸ”¥ Divide palabras largas si es necesario */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tipos de notificaciones */
.toast-success {
    background-color: #4aba4a;
}

.toast-error {
    background-color: #ff4d4d;
}

.toast-warning {
    background-color: #ffcc00;
}

.toast-info {
    background-color: #3498db;
}

/* Animaciones */
.toast.show {
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}


/* configs del nav bar */
nav ul#nav-menu .dropdown-content {
    position: absolute;
    z-index: 9999 !important;
}

nav ul#nav-menu .dropdown {
    position: relative;
}


.tooltip-horario {
    position: relative;
}

.tooltip-texto {
    display: none;
    position: absolute;
    top: auto;
    right: 100%;
    left: auto;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 9999;
}

.tooltip-horario:hover .tooltip-texto {
    display: block;
}

/* Mostrar tooltip cuando los inputs de hora tienen foco */
.tooltip-horario:has(input[type="time"]:focus) .tooltip-texto {
    display: block;
}

/* Mostrar tooltip cuando hora de salida tiene foco (controlado por JS) */
.tooltip-horario.show-tooltip .tooltip-texto {
    display: block;
}
.custom-context-menu {
    position: absolute;
    z-index: 100;
    display: none;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    border-radius: 8px;
    width: 260px;
    font-size: 14px;
}

#precarga-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#precarga-form label {
    font-weight: 500;
    margin-bottom: 2px;
}

#precarga-form input[type="date"],
#precarga-form input[type="file"],
#precarga-form button {
    font-size: 13px;
    padding: 5px 8px;
}

#precarga-form hr {
    margin: 6px 0;
    border: none;
    border-top: 1px solid #ddd;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}

#precarga-form input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    padding: 10px 8px;
    height: 38px; /* fuerza altura uniforme */
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ======================
   DataTables: icono Ãºnico de orden
   Reemplaza las dos flechas por una sola en la esquina del tÃ­tulo
   ====================== */
.dataTables_wrapper table.dataTable thead th,
.dataTables_wrapper table.dataTable thead td {
    position: relative;
    padding-right: 24px; /* espacio para el icono */
}
.dataTables_wrapper table.dataTable thead .sorting,
.dataTables_wrapper table.dataTable thead .sorting_asc,
.dataTables_wrapper table.dataTable thead .sorting_desc,
.dataTables_wrapper table.dataTable thead .sorting_asc_disabled,
.dataTables_wrapper table.dataTable thead .sorting_desc_disabled {
    background-image: none !important; /* oculta las flechas por defecto */
}
.dataTables_wrapper table.dataTable thead .sorting::after,
.dataTables_wrapper table.dataTable thead .sorting_asc::after,
.dataTables_wrapper table.dataTable thead .sorting_desc::after {
    content: 'â–¼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    line-height: 1;
    color: #94a3b8; /* gris tenue cuando no hay orden activo */
}
.dataTables_wrapper table.dataTable thead .sorting_asc::after {
    content: 'â–²';
    color: #334155; /* activo */
}
.dataTables_wrapper table.dataTable thead .sorting_desc::after {
    content: 'â–¼';
    color: #334155; /* activo */
}

/* ======================
   Floating Action Button (FAB) para móviles
   ====================== */
#mobile-menu-fab {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#mobile-menu-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#mobile-menu-fab:active {
    transform: scale(0.95);
}

#mobile-menu-fab svg {
    pointer-events: none;
}

/* Estilo del menú contextual cuando está centrado en móvil */
.custom-context-menu.mobile-centered {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10000 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

/* Overlay oscuro detrás del menú en móvil */
#context-menu.mobile-centered::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* ======================
   Fila placeholder (vacía al final de la tabla)
   ====================== */
tr.placeholder-row {
    background-color: #f5f5f5 !important;
    opacity: 0.7;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

tr.placeholder-row:hover {
    opacity: 0.9;
    background-color: #ebebeb !important;
}

tr.placeholder-row input,
tr.placeholder-row select,
tr.placeholder-row textarea {
    background-color: transparent;
    border-color: #ddd;
    font-style: italic;
    color: #999;
}

tr.placeholder-row input::placeholder,
tr.placeholder-row textarea::placeholder {
    color: #aaa;
    font-style: italic;
}

tr.placeholder-row input:focus,
tr.placeholder-row select:focus,
tr.placeholder-row textarea:focus {
    background-color: white;
    font-style: normal;
    color: var(--text-color);
    opacity: 1;
}

/* Ocultar el botón "Añadir empleado" ya que ahora hay fila placeholder automática */
#addEmpleado {
    display: none !important;
}

