/* Reseteo básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    /* overflow: hidden;   /* Evita el scroll global */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Header arriba, Main abajo */
    overflow-y: auto;
    margin: 0;
}

.header {
    background-color: #5E0905;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 5%;
    position: relative;
    height: 70px;
}

.header_QR {
    background-color: #5E0905;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    height: 70px;
}

#contenedor-homepage {
    flex-grow: 1;
    /* Esto hace que el main ocupe todo el espacio hasta el final */
    display: flex;
    /* Para que las columnas se pongan una al lado de la otra */
    height: calc(100vh - 70px);
}

.mi-logo-contenedor {
    cursor: default;
}

.logo-menu {
    max-width: 100%;
    /* Evita que la imagen se salga de su contenedor */
    height: auto;
    /* Mantiene la proporción original */
    width: 100%;
    /* Tamaño base para escritorio */
    padding-right: 200px;
}

.logo-menu_QR {
    max-width: 100%;
    /* Evita que la imagen se salga de su contenedor */
    height: auto;
    /* Mantiene la proporción original */
    width: 100%;
    /* Tamaño base para escritorio */
}

.logo-movil {
    display: none;
}

.logo-movil_QR {
    display: none;
}

.imageQR {
    display: block;
    margin: 30px auto;
}

#reloj {
    margin: auto;
    text-align: center;
    color: #D13815;
    font-weight: bold;
    font-size: clamp(20px, 4vw, 30px);
    /* Tamaño mínimo, ideal y máximo */
}

.relojH3 {
    color: #D13815;
    text-align: center;
    font-size: clamp(20px, 4vw, 30px);
    /* Tamaño mínimo, ideal y máximo */
    margin-top: 0;
    margin-bottom: 0;
}

.h1_Reloj {
    color: #D13815;
    text-align: center;
    font-size: clamp(20px, 4vw, 30px);
    /* Tamaño mínimo, ideal y máximo */
    margin: 0 20px 0 20px;
}

.overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 1);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: wait;
    /* Cambia el cursor para indicar espera */
}

.overlay p {
    color: #D13815;
    font-size: clamp(14px, 3, 2vw, 24px);
    /* Tamaño mínimo, ideal y máximo */
    font-weight: bold;
    margin-top: 20px;
    text-align: center;
    letter-spacing: 1px;
    /* Mejora la lectura */
}

.overlay_movil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: wait;
    /* Cambia el cursor para indicar espera */
}

.overlay_movil p {
    color: #D13815;
    font-size: clamp(14px, 3, 2vw, 24px);
    /* Tamaño mínimo, ideal y máximo */
    font-weight: bold;
    margin-top: 20px;
    text-align: center;
    letter-spacing: 1px;
    /* Mejora la lectura */
}

.modal-overlay {
    position: fixed; 
    top: 0 !important; 
    left: 0 !important; 
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important; 
    height: 100% !important;
    background: rgba(0,0,0,0.1); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    filter: none !important;
    z-index: 9999 !important;
}
.modal-content {
    background: white; 
    color: #666666;
    padding: 1rem; 
    border-radius: 4px; 
    text-align: center;
    border: 1px solid #D13815; 
    max-width: 450px; 
    box-shadow: 0 0px 15px rgba(0,0,0,0.2);
}

.modal-content h3 { 
    margin: 1rem;   
    color: #D13815;
}

.modal-content p {
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 2rem;
}

.loader-gif {
    width: 100px;
    /* Ajusta el tamaño según tu GIF */
    height: auto;
}

.menu {
    list-style: none;
    display: flex;
}

.menu a {
    text-decoration: none;
    color: white;
    transition: color 0.3s;
}

li:hover .hamburger,
li:hover a {
    color: #f4a261;
    transition: color 0.3s ease;
    /* Opcional: para que el cambio sea suave */
}

.menu li {
    cursor: pointer;
}


.menu-toggle {
    display: none;
    /* Ocultar checkbox */
}


.menu-item-has-dropdown {
    position: relative;
    /* Necesario para que el dropdown se alinee justo debajo */
    display: inline-block;
    /* Posicionamiento del padre */
}

.dropdown {
    display: none;
    position: absolute;
    padding-top: 10px;
    border-top: 10px solid transparent;
    right: 0;
    left: auto;
    background-color: #5E0905;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 10px 0;
    min-width: 100%;
    width: max-content;
    z-index: 1000;
}

.dropdown .user-mobile {
    display: none;
}

.menu-item-has-dropdown:hover .dropdown {
    display: block;
    animation: fadeIn 0.3s ease;
}

.menu-item-has-dropdown:hover .hamburger,
.menu-item-has-dropdown:hover>a {
    color: #f4a261;
}

.dropdown li a {
    white-space: nowrap;
    padding: 8px 15px;
    display: block;
    color: white;
    text-decoration: none;
}

.dropdown li a:hover {
    background-color: #5E0905;
    color: #f4a261;
}

.contenedor-principal {
    display: flex;
    width: 100%;
    /* Activa el modo de columnas */
    height: 100vh;
    /* Hace que el main ocupe toda la altura de la pantalla */
}

.columna-izquierda,
.columna-derecha {
    width: 50%;
    /* Cada columna ocupa la mitad del ancho */
}

.columna-izquierda {
    background-image: url('/images/pictureQR01.png');
    height: 100%;
    background-size: cover;
    /* La imagen cubre todo el div sin deformarse */
    background-position: center;
    /* Centra la imagen en el espacio disponible */
    background-repeat: no-repeat;
}

.columna-derecha {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
        url('/images/logo01.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 80%;
    display: flex;
    /* Activa el contenedor flexible */
    justify-content: center;
    /* Centro horizontal */
    height: 100%;
    align-items: flex-start;
    padding-top: 130px;
}

.contenedor-formulario {
    display: none;
    flex-direction: column;
    width: 400px;
    outline: none;
}

.contenedor-formulario.mostrar {
    width: 400px;
    display: flex;
}

.fila-botones {
    display: flex;
    /* Alinea los hijos en horizontal */
    gap: 3px;
    /* Espacio exacto entre los dos botones */
    width: 100%;
    /* Ocupa todo el ancho del formulario */
    /* margin-top: 10px;    /* Separación respecto a los inputs */
    justify-content: flex-end;
}

.contenedor-formulario h3 {
    margin-top: 0;
    margin-left: 25px;
    color: #5E0905;
}

.formulario {
    width: 350px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0px 0px 16px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.formularioAlta {    
    margin: 0 auto;
    min-width: 350px;
    padding: 20px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0px 0px 16px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.fila-mixta-buscar {
    display: flex;
    gap: 5px;
    align-items: flex-end; 
}

.fila-mixta-buscar button {  
    margin-bottom: 20px;     
}

.fila-mixta {
    display: flex;
    gap: 15px; 
}

.fila-mixta-password{
    display: flex;
    gap: 15px; 
    align-items: center;
    margin-bottom: 15px;
}

.formularioFiltro {
    width: 100%;
    padding: 20px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    /* Permite el salto a la segunda fila */
    gap: 15px;
    justify-content: center;
}

.formularioFiltroBtn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    /* Permite el salto a la segunda fila */    
    justify-content: center;
}

button {
    background-color: #ff821c;
    color: white;
    text-align: center;
    font-size: 18px;
    box-sizing: border-box;
    width: 130px;
    height: 35px;
    padding: 8px 18px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: #D13815;
}

button.btFichaje {
    background-color: #ff821c;
    color: white;
    text-align: center;
    font-size: 18px;
    box-sizing: border-box;
    width: 150px;
    height: auto;
    padding: 8px 18px;
    margin: 7px;
    border-radius: 5px;
}

button.btFichaje:hover {
    background-color: #D13815;
}

.formulario button {
    background-color: #ff821c;
    color: white;
    text-align: center;
    font-size: 18px;
    box-sizing: border-box;
    width: 130px;
    height: 35px;
    padding: 8px, 18px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

.formulario button:hover {
    background-color: #D13815;
}

.formulario button.btFichajeK {
    background-color: #ff821c;
    color: white;
    text-align: center;
    font-size: 20px;
    box-sizing: border-box;
    width: 200px;
    height: auto;
    padding: 8px 18px;
    border-radius: 5px;
}

.formulario button.btFichajeK:hover {
    background-color: #D13815;
}

.fila-mixta-password .form-group-crud {
    flex: 1;
    margin-bottom: 0 !important; 
}

.form-group {
    position: relative;
    /* Contenedor de referencia para el label */
    margin-bottom: 20px;
}

.form-group-crud {
    position: relative;
    /* Contenedor de referencia para el label */
    margin-bottom: 10px;
}

.form-group-filtro {
    position: relative;
    /* Contenedor de referencia para el label */
}

.form-group-select {
    position: relative;
    margin-bottom: 10px;
}

.form-group-select::after {
    content: '\25BC';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #8a94ac;
    pointer-events: none;
    z-index: 10;
}

.form-control {
    width: 100%;
    height: 60px;
    /* Input alto */
    padding: 24px 15px 5px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    outline: none;
}

.form-control-select {
    width: 100%;
    height: 60px;
    padding: 24px 40px 5px 15px; 
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-color: #ffffff;
}

.readonly-style {
    background-color: #f5f5f5 !important;      
    cursor: not-allowed;                  
    pointer-events: none;                 
}

.input-id {
    width: 140px;
}

.input-dni {
    width: 120px;
}

.input-nombre {
    width: 250px;
}

.input-nombre-dep {
    width: 400px;
}

.input-password {
    width: 250px;
}

.input-apellidos {
    width: 310px;
}

.input-departamento {
    width: 310px;
}

.control-label {
    position: absolute;
    font-size: 18px;
    color: #8a94ac;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    /* El clic pasa al input */
}

.form-control:focus+.control-label,
.form-control:not(:placeholder-shown)+.control-label {
    top: 8px;
    /* Sube el label */
    font-size: 18px;
    color: #ff821c;
    /* Cambia el color */
    transform: translateY(0);
    /* Quita el centrado vertical para que flote arriba */
}

.control-label-select {
    position: absolute;
    font-size: 18px;
    color: #8a94ac;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;    
    z-index: 11;
}

.form-control-select:focus ~ .control-label-select,
.form-control-select.has-value ~ .control-label-select {
    top: 8px;
    font-size: 18px; 
    color: #ff821c; 
    transform: translateY(0);
}

.form-control-select:not(:focus):not(.has-value) ~ .control-label-select {
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #8a94ac;
}

.alert-style {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 250px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    font-size: 18px;
    margin: 15px;
    position: absolute;
    top: 100px;
}

.contenedor-alertas-crud {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column; 
    align-items: center;   
}

.alert-style-crud-ko {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 350px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    font-size: 18px;
    box-sizing: border-box;     
    text-align: center;   
}

.alert-style-crud-ok {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 350px;
    background-color: #DCFCE7;
    color: darkgreen;
    border-radius: 5px;
    border: 1px solid #10B981;
    font-size: 18px;
    box-sizing: border-box;   
    text-align: center; 
}

.info-style-crud {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 350px;
    background-color: #fff4e6;
    color: #D13815;
    border-radius: 5px;
    border: 1px solid #E8967E;
    font-size: 18px;
    box-sizing: border-box;   
    text-align: center;     
}

.logout-style {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 250px;
    background-color: #DCFCE7;
    color: darkgreen;
    border-radius: 5px;
    border: 1px solid #10B981;
    font-size: 18px;
    margin: 15px;
    position: absolute;
    top: 100px;
}

.alert-style p {
    margin: 0;
    /* Quita el margen que desalinea */
    text-align: center;
}

.logout-style p {
    margin: 0;
    /* Quita el margen que desalinea */
    text-align: center;
}

.alert-style span {
    margin: 0;
    display: flex;
    /* Ayuda a que el emoji se comporte como bloque */
    align-items: center;
}

.logout-style span {
    margin: 0;
    display: flex;
    /* Ayuda a que el emoji se comporte como bloque */
    align-items: center;
}

.icono-check {
    color: darkgreen;
    /* Verde */
    font-size: 20px;
    font-weight: bold;
}

.toggleEmoji {
    position: absolute;
    right: 10px;
    cursor: pointer;
    top: 17px;
    filter: "grayscale(100%)";
    opacity: "0.3";
    pointer-events: "none";
}

.contenedor-adminPrivPage {
    width: 100%;
    min-height: calc(100vh - 70px);
    /* Para que siga llenando la pantalla */
    background-size: cover;
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
        url('/images/pictureQR01.png');
    align-items: flex-start;
}

.contenedor-adminPage {
    width: 100%;
    min-height: calc(100vh - 70px);
    /* Para que siga llenando la pantalla */
    background-size: cover;
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
        url('/images/pictureQR01.png');
    align-items: flex-start;
    padding-top: 50px;
}

.contenedor-adminPage_movil {
    width: 100%;
    min-height: calc(100vh - 70px);
    /* Para que siga llenando la pantalla */
    background-size: cover;
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
        url('/images/pictureQR01.png');
    align-items: flex-start;
    padding-top: 20px;
}

.contenedor-noLogin {
    display: flex;
    /* Activa el modo flexible */
    flex-direction: column;
    /* Apila los elementos en vertical */
    align-items: center;
    /* Centra los elementos horizontalmente */
    padding-top: 50px;
    gap: 10px;
    /* Crea espacio uniforme entre los elementos */
    text-align: center;
    /* Asegura que el texto interno también se centre */
}

.contenedor-noLogin button {
    margin-top: 30px;
    width: 180px;
}

.error {
    color: crimson;
    font-weight: bold;
    text-align: center;
}

.error_movil {
    color: crimson;
    font-weight: bold;
    text-align: center;
    margin-top: 25px;
}

.correcto {
    color: darkgreen;
    font-weight: bold;
    text-align: center;
}

.correcto_movil {
    color: darkgreen;
    font-weight: bold;
    text-align: center;
    margin-top: 25px;
}

.contenedor-salir {
     text-align: center; 
     margin-top: 20px;
}

.escondido {
    display: none;
}

.visible {
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

.iconoScale {
    transition: transform 0.3s ease;
}

.iconoScale:hover {
    transform: scale(1.1);
}

.h3_eleMenu::after {
    content: attr(data-text);
    height: 0;
    visibility: hidden;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    font-weight: 800;
}

.h3_eleMenu:hover {
    font-weight: 700;
}

.h3_eleMenu {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-weight: 400;
    color: #D13815;
}

.secContenido {
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.contenedorCabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 10px 0 10px 0;
}

.secMenu,
.spacer {
    flex: 1;
}

.spacer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.spacer>button.btFichaje {
    margin: 0;
}

.tituloCabecera {
    flex: 2;
    text-align: center;
    margin: 0;
}

.cajasPrincipales {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
}

.cajasPrincipales .content {
    border-radius: 4px;
    height: 100%;
    padding: 1.5rem;
    text-align: center;
    background: #fff;
    box-shadow: 0 0 4px 1px rgba(0, 0, 0, .025);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cajasPrincipales section {
    width: 270px;
    margin: 15px;
}

.cajasPrincipales .content .icon {
    font-size: 5rem;
}

/*
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}
*/

.cajasAdminTrabFilter {
    background-color: white;
    border-radius: 4px;
    width: 85%;
    margin: 20px auto 10px auto;
    display: flex;
    flex-wrap: wrap;
    padding: 3px 20px 20px 20px;
}

.cajasAdminTrabFilter h2 {
    width: 100%;
    text-align: center;
    color: #D13815;
}

.cajasAdminTrabTable {
    background-color: white;
    border-radius: 4px;
    width: 85%;
    margin: 0 auto 20px auto;
    padding: 20px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Suavizado para móviles */
    box-sizing: border-box;
}

.cajasAdminTrabTable table {
    width: 100%;
    max-width: 100%;
    min-width: 950px;
    color: #666666;
    border-spacing: 0;
}

.cajasAdminTrabTable table th {
    color: white;
    background: #D13815;
    height: 40px;
    font-weight: 400;
}

.cajasAdminTrabTable table td {
    border-bottom: 1px solid #ddd;
    padding: 4px;
}

.cajasAdminTrabTable table th,
.cajasAdminTrabTable table td {
    text-align: center;
    vertical-align: middle;
}

.cajasAdminTrabTable tr:hover td {
    background-color: #fff4e6;
    transition: background-color 0.2s;
}

.dropdown-table {
    display: none;
    position: absolute;
    right: 66%;
    top: 15%;
    left: auto;
    background-color: white;
    color: #666666;
    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 150px;
    width: max-content;
    z-index: 9999 !important;
}

.celda-menu {
    position: relative;
    overflow: visible !important;
}

.btnAcciones:hover+.dropdown-table {
    display: block !important;
}

.dropdown-table:hover {
    display: block !important;
}

.dropdown-table li a {
    white-space: nowrap;
    border-radius: 4px;
    padding: 8px 15px;
    margin: 4px;
    display: block;
    color: #666666;
    text-decoration: none;
}

.dropdown-table li a:hover {
    background-color: #fff4e6;
    ;
}

.dropdown-table ul {
    list-style: none !important;
}

.dropdown-table li {
    list-style: none;
}

.tablaTrabajadores tr:nth-last-child(-n+2) .dropdown-table {
    top: auto;
    bottom: 15%;
}

/* --- 1. FORMATO HORIZONTAL (FLEX) PARA 1, 2 o 3 FILAS --- */
.tablaTrabajadores tbody tr:first-child:last-child .dropdown-table ul,
.tablaTrabajadores tbody tr:first-child:nth-last-child(2) .dropdown-table ul,
.tablaTrabajadores tbody tr:first-child:nth-last-child(2) ~ tr .dropdown-table ul,
.tablaTrabajadores tbody tr:first-child:nth-last-child(3) .dropdown-table ul,
.tablaTrabajadores tbody tr:first-child:nth-last-child(3) ~ tr .dropdown-table ul {
    display: flex !important;
    flex-direction: row !important;
    gap: 5px;
    padding: 5px;
}

/* --- 2. POSICIONAMIENTO PARA 1 FILA --- */
.tablaTrabajadores tbody tr:first-child:last-child .dropdown-table {
    width: max-content !important;
    min-width: auto !important;
    right: 66% !important; 
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
}

/* --- 2. POSICIONAMIENTO PARA 2 o 3 FILAS --- */
.tablaTrabajadores tbody tr:first-child:nth-last-child(2) .dropdown-table,
.tablaTrabajadores tbody tr:first-child:nth-last-child(2) ~ tr .dropdown-table,
.tablaTrabajadores tbody tr:first-child:nth-last-child(3) .dropdown-table,
.tablaTrabajadores tbody tr:first-child:nth-last-child(3) ~ tr .dropdown-table {
    width: max-content !important;
    min-width: auto !important;
    right: 66% !important; /* Lo lanza a la izquierda del botón */
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
}

.tablaTrabajadores tbody tr:first-child:last-child .dropdown-table li a,
.tablaTrabajadores tbody tr:first-child:nth-last-child(2) .dropdown-table li a,
.tablaTrabajadores tbody tr:first-child:nth-last-child(2) ~ tr .dropdown-table li a,
.tablaTrabajadores tbody tr:first-child:nth-last-child(3) .dropdown-table li a,
.tablaTrabajadores tbody tr:first-child:nth-last-child(3) ~ tr .dropdown-table li a {
    padding: 5px 12px !important;
    margin: 0 !important;
}

.btnAcciones {
    width: 35px !important;
    height: 35px !important;
    padding: 0 !important;
    background: none;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 1.5rem;
    line-height: 0;
    cursor: pointer;
    color: #555;
    box-sizing: border-box;
}

.btnAcciones:hover {
    color: #000;
    background-color: #ff821c;
    border-radius: 50% !important;
    outline: none;
}

.tablaTrabajadores {
    font-size: 16px;    
}

.tablaTrabajadores th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;    
    text-align: center;
    /* Mantiene el texto centrado en la celda */
}

.tablaTrabajadores th.no-sort {
    cursor: default;
}

/* El triángulo ahora fluye con el texto */
.tablaTrabajadores th:not(.no-sort)::after {
    content: '\25B2';
    /* Triángulo arriba */
    display: inline-block;
    margin-left: 8px;
    /* Espacio exacto entre el nombre y el icono */
    font-size: 0.7rem;
    vertical-align: middle;
    opacity: 0;
    /* Casi invisible cuando no está ordenado */
    transition: transform 0.2s, opacity 0.2s;
}

/* Hover: lo mostramos un poquito más */
.tablaTrabajadores th:not(.no-sort):hover::after {
    opacity: 0.5;
}

/* Columna activa: Ascendente */
.tablaTrabajadores th.sort-asc::after {
    content: '\25B2';
    opacity: 1;
    color: white;
}

/* Columna activa: Descendente */
.tablaTrabajadores th.sort-desc::after {
    content: '\25BC';
    /* Triángulo abajo */
    opacity: 1;
    color: white;
}

.btn-pag {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #555;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;    
    font-size: 0.85rem;
    width: 120px;
}

.btn-pag:hover {
    background-color: #fff4e6;
    color: #D13815;
    border-color: #D13815;
}

.info-paginacion {
    display: flex;
    justify-content: center; 
    align-items: center;  
    flex-direction: column;   
    position: relative;      
    width: 100%;   
    margin-top: 20px;
}

.botones-paginacion {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.contador-resultados {
    text-align: center;
    color: #D13815;
    font-size: 0.95rem;
}

.navegacion-fecha {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;    
    padding: 12px;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
}

.info-fecha-texto {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #D13815;
}

.triangulo-nav {
    color: #ff821c;
    font-size: 18px; 
    cursor: pointer;
    user-select: none; /* Evita que se seleccione el texto al hacer click rápido */
}    

.triangulo-nav:hover {
    color: #D13815;
    transform: scale(1.2); 
}

.triangulo-nav.triangulo-disabled {
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.input-calendario-nav {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 5px 10px;    
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #D13815;
    background-color: #f9f9f9;
    cursor: pointer;
    outline: none;    
    user-select: none; /* evita seleccionar texto */
    -webkit-user-select: none;
    caret-color: transparent;    /* Oculta la rayita de escribir */
    -webkit-tap-highlight-color: transparent;
}

.input-calendario-nav:hover,
.input-calendario-nav:focus {
    border-color: #D13815;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.incidencia-disabled {
    color: #ccc; 
    cursor: not-allowed; 
    padding: 5px 12px; 
    display: block; 
    pointer-events: none
}

.fila-con-incidencia {
    color: #D13815; 
    font-weight: 500;
}

.falta-fichaje {
    color: #D13815; 
    font-weight: 500;
}

/* --- ESTRUCTURA Y BORDES --- */

.tablaTrabajadoresFichajes {
    border-collapse: collapse; /* Une las celdas: elimina el 'aire' invisible entre ellas */
    border-spacing: 0;        
    width: 700px !important; 
    min-width: 0 !important; 
    max-width: 700px !important;
    margin: 0 auto; 
    table-layout: fixed; 
    font-size: 16px;
}

.tablaTrabajadoresFichajes th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;    
    text-align: center;    
}

.tablaTrabajadoresFichajes th.no-sort {
    cursor: default;
}

/* El triángulo ahora fluye con el texto */
.tablaTrabajadoresFichajes th:not(.no-sort)::after {
    content: '\25B2';
    /* Triángulo arriba */
    display: inline-block;
    margin-left: 8px;
    /* Espacio exacto entre el nombre y el icono */
    font-size: 0.7rem;
    vertical-align: middle;
    opacity: 0;
    /* Casi invisible cuando no está ordenado */
    transition: transform 0.2s, opacity 0.2s;
}

/* Hover: lo mostramos un poquito más */
.tablaTrabajadoresFichajes th:not(.no-sort):hover::after {
    opacity: 0.5;
}

/* Columna activa: Ascendente */
.tablaTrabajadoresFichajes th.sort-asc::after {
    content: '\25B2';
    opacity: 1;
    color: white;
}

/* Columna activa: Descendente */
.tablaTrabajadoresFichajes th.sort-desc::after {
    content: '\25BC';
    /* Triángulo abajo */
    opacity: 1;
    color: white;
}

/* 1. Base: Quitamos bordes internos por defecto */
.tablaTrabajadoresFichajes td {
    padding: 8px;
    border-bottom: none !important;
    border-top: none !important;
    background-clip: padding-box; /* fondo cubre toda la celda sin fisuras */
}

/* 2. Bloque del día (La celda con el rowspan) */
.tablaTrabajadoresFichajes td[rowspan] {
    border-bottom: 1px solid #ddd !important;         
    vertical-align: middle;
}

/* 3. Divisoria: Solo al final de cada día y en la última fila de la tabla */
.tablaTrabajadoresFichajes tr.fin-dia td,
.tablaTrabajadoresFichajes tr:last-child td {
    border-bottom: 1px solid #ddd !important;
}

/* --- EFECTOS DE SOMBREADO --- */

/* 4. Sombreado de TODO el bloque del día al pasar el ratón */
/* Aplicamos el color a las CELDAS cuando el TBODY tiene el hover */
.tablaTrabajadoresFichajes tbody.bloque-dia:hover td {
    background-color: #fff4e6 !important;     
}

/* Forzamos que la celda del día (rowspan) también cambie al mismo color */
.tablaTrabajadoresFichajes tbody.bloque-dia:hover td[rowspan] {
    background-color: #fff4e6 !important;
}

.positivo {
    color: darkgreen;    
}

.negativo {
    color: crimson;     
}

.tablaTrabajadoresFichajes td.positivo,
.tablaTrabajadoresFichajes td.negativo {
    vertical-align: middle;
    text-align: center;             
}

.contenedorDatos {
    display: flex;
    justify-content: center; 
    width: 100%;  
}

.datosTrabajador {        
    padding: 10px 20px;
    border-radius: 8px;    
    width: 400px;       
    background-color: #f9f9f9;
    box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.1);
}

.datosTrabajador p {
    margin: 10px 0; /* Espacio entre cada línea */
    font-size: 16px;
    color: #333;
}

.datosTrabajador strong {
    color: #ff821c;
}

.SaldoPositivo {
    background-color: darkgreen; 
    color: white !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;    
}

.SaldoNegativo {
    background-color: #D13815; 
    color: white !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;    
}

/********************************************************************************************/

@media screen and (max-width: 768px) {

    .logo-menu {
        display: none;
    }

    .logo-menu_QR {
        display: none;
    }

    .logo-movil {
        display: block;
        max-width: 100%;
        /* Evita que la imagen se salga de su contenedor */
        height: auto;
        /* Mantiene la proporción original */
        width: 100%;
        /* Tamaño base para escritorio (ajústalo a tu gusto) */
        padding-right: 50px;
    }

    .logo-movil_QR {
        display: block;
        max-width: 100%;
        /* Evita que la imagen se salga de su contenedor */
        height: auto;
        /* Mantiene la proporción original */
        width: 100%;
        /* Tamaño base para escritorio (ajústalo a tu gusto) */
    }

    .menu li>a {
        display: none;
    }

    .menu li .hamburger {
        display: inline-block;
        padding: 10px;
        /* Crea un área de hover más grande */
        cursor: pointer;
    }

    .menu li:hover .dropdown {
        display: block;
    }

    .dropdown li a {
        display: block !important;
    }

    .dropdown .user-mobile {
        display: block;
        cursor: default;
        padding: 8px 15px;
    }

    .columna-izquierda {
        display: none;
    }

    /* Aseguramos que la columna derecha ocupe todo el ancho disponible */
    .columna-derecha {
        width: 100%;
        min-height: calc(100vh - 70px);
        /* Para que siga llenando la pantalla */
        background-size: cover;
        background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
            url('/images/pictureQR01.png');
        align-items: flex-start;
        padding-top: 130px;
    }

    .cajasAdminTrabFilter {
        width: 100%;
    }

    .cajasAdminTrabTable {
        width: 100%;
    }

    .datosTrabajador {
        width: 100%;
    }

    .secMenu img {
        height: 2.5rem !important;
        width: 2.5rem !important;
    }

    .tituloCabecera {
        font-size: 1.1rem;
    }

    .form-group-filtro {
        width: 100%;
    }

    .input-id {
        width: 100%;
    }

    .input-dni {
        width: 100%;
    }

    .input-nombre {
        width: 100%;
    }

    .input-nombre-dep {
        width: 100%;
    }

    .input-password {
        width: 100%;
    }

    .input-apellidos {
        width: 100%;
    }

    .input-departamento {
        width: 100%;
    }

    .tituloCabecera .texto-largo {
        display: none; 
    }
    
    .tituloCabecera {
        font-size: 1.2rem; 
        text-align: center;
    }

    .fila-mixta {
        display: flex;   
        flex-direction: column; 
        gap: 0;
    }

    .fila-mixta-password {
        display: flex;   
        flex-direction: column; 
        align-items: flex-start;
        gap: 0;
    }

    .fila-mixta-password .form-group-crud {
        width: 100%;             
    }

    .input-password {
        width: 100% !important;  
    }

    .fila-mixta-password button {        
        margin-bottom: 5px;
    }

    .spacer>button.btFichaje {
        font-size: 0;
        width: 100px;
        height: auto;
    }

    .spacer>button.btFichaje::after {
        content: "Nuevo Trab";
        font-size: 18px;
    }

    .spacer>.btFichaje.btn-admin::after {
        content: "Nuevo Admin";
    }

    .spacer>.btFichaje.btn-dep::after {
        content: "Nuevo Dep";
    }

    .spacer>.btFichaje.btn-volver::after {
        content: "Volver";
    }

    .spacer>.btFichaje.btn-perfil::after {
        content: "Cambiar Pass";
    }

    .fila-mixta-buscar .form-group-crud {
        flex-grow: 1; 
    }

}

/********************************************************************************************/

@media screen and (max-width: 500px) { 

    .spacer>button.btFichaje {
        font-size: 0;
        width: 100px;
        height: auto;
    }

    .spacer>button.btFichaje::after {
        content: "Nuevo Trab";
        font-size: 18px;
    }

    .spacer>.btFichaje.btn-admin::after {
        content: "Nuevo Admin";
    }

    .spacer>.btFichaje.btn-dep::after {
        content: "Nuevo Dep";
    }

    .spacer>.btFichaje.btn-volver::after {
        content: "Volver";
    }

    .spacer>.btFichaje.btn-perfil::after {
        content: "Cambiar Pass";
    }

    .formularioAlta {        
        min-width: 0;         
        width: 100%;         
    }

    .info-style-crud {        
        min-width: 0;         
        width: 100%;         
    }

    .alert-style-crud-ok {        
        min-width: 0;         
        width: 100%;         
    }

    .alert-style-crud-ko {        
        min-width: 0;         
        width: 100%;         
    }

}

/********************************************************************************************/

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}