/* ===================== RESET GENERAL ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===================== BODY Y LAYOUT GENERAL ===================== */
html, body {
    height: 100%;
    width: 100%;
    font-family: Arial, sans-serif;
    background-color: #f5f6fa;
    display: flex;
    flex-direction: column;
}

/* ===================== NAVBAR ===================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f8f8;
    padding: 12px 20px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    position: fixed;   /* Fijo arriba */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.logo {
    height: 50px;
    width: auto;
    cursor: pointer;
}

.navbar ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.navbar ul li a {
    color: #000;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar ul li a:hover {
    color: #ffcc00;
}

/* ===================== FOOTER GLOBAL ===================== */
footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 15px 10px;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 -3px 8px rgba(0, 0, 0, 0.2);
    position: fixed;   /* Fijo abajo */
    bottom: 0;
    left: 0;
    width: 100%;
}

/* ===================== MAIN (espaciado para que no se solape) ===================== */
main {
    flex: 1;
    padding-top: 80px;   /* Altura del navbar */
    padding-bottom: 60px; /* Altura del footer */
}

/* ===================== LAYOUT PARA PANTALLAS GRANDES ===================== */
@media (min-height: 700px) {
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    main {
        flex: 1;
    }
}

/* ===================== LOGIN PAGE ===================== */
.login-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: #fff;
    margin-top: 60px; /* Ajuste por navbar fijo */
    margin-bottom: 50px; /* Ajuste por footer fijo */
}

.login-image {
    width: 50%;
    height: 100%;
}

.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-form {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background-color: #fff;
}

.login-form h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    text-align: center;
    font-size: 28px;
}

.login-form form {
    display: flex;
    flex-direction: column;
    width: 80%;
    max-width: 350px;
}

.login-form label {
    margin-bottom: 6px;
    font-weight: bold;
    color: #333;
}

.login-form input {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    border-color: #2c3e50;
    outline: none;
}

.login-form button {
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s;
}

.login-form button:hover {
    background-color: #1a252f;
    transform: translateY(-2px);
}

.login-form p {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}

.login-form p a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: bold;
}

.login-form p a:hover {
    color: #ffcc00;
}

/* ===================== FORMULARIOS FLEXIBLES ===================== */
.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
    margin-top: 60px;
}

/* Título */
.form-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    font-size: 28px;
}

/* Formulario */
.form-container form {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 350px;
}

/* Labels */
.form-container label {
    margin-bottom: 6px;
    font-weight: bold;
    color: #333;
}

/* Inputs */
.form-container input {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-container input:focus {
    border-color: #2c3e50;
    outline: none;
}

/* Botón guardar cambios */
.form-container button {
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s;
    margin-top: 10px;
}

.form-container button:hover {
    background-color: #1a252f;
    transform: translateY(-2px);
}

/* Botón volver al login */
.return-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 18px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s;
    text-align: center;
}

.return-link:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Forzamos a que sea solo texto */
.return-link {
    display: inline-block;
    background: none !important;
    border: none !important;
    color: #2c3e50 !important;  /* Negro/Azul oscuro */
    font-size: 15px;
    font-weight: bold;
    padding: 0 !important;
    margin-top: 10px;
    text-decoration: none !important; /* Quitamos subrayado */
    box-shadow: none !important; /* Quitamos efectos */
    cursor: pointer;
    transition: color 0.3s ease;
}

/* Efecto hover */
.return-link:hover {
    color: #ffcc00 !important; /* Amarillo */
    text-decoration: underline; /* Opcional */
}


/* ===================== HOME PAGE ===================== */
.home-container {
    text-align: center;
    padding: 40px 20px;
    max-width: 1200px;
    margin: auto;
}

/* Bienvenida */
.welcome-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Ajusta la altura según tus necesidades */
}

.welcome-title {
    font-size: 30px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-title {
    text-align: center;
    font-size: 1.5rem;
}
.user-role {
    font-size: 15px;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 12px;
    background-color: #3498db;
    color: white;
    display: inline-block;
    margin-top: 5px;
}

/* Colores dinámicos de roles */
.user-role[data-role="Admin"] {
    background-color: #e74c3c;
}
.user-role[data-role="Usuario"] {
    background-color: #2ecc71;
}
.user-role[data-role="Invitado"] {
    background-color: #f39c12;
}


/* === ESTILOS GENERALES PARA TODOS LOS MODALS === */
.modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%;
    background-color: rgba(0,0,0,0.6); /* Fondo oscuro translúcido */
    justify-content: center; 
    align-items: center; 
}

/* Botón de cerrar (X) */
.close {
    position: absolute;
    top: 12px;
    right: 18px;
    color: #333;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close:hover {
    color: red;
}

/* Animación */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* === MODAL FICHA (Ver ficha) === */
#modalFicha .modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0px 8px 20px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
    text-align: left;
}

#modalFicha h2 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #2c3e50;
    text-align: center;
}

#modalFicha p {
    margin: 10px 0;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

#modalFicha strong {
    color: #34495e;
}

#modalFicha .pdf-container {
    text-align: center;
    margin-top: 20px;
}

/* === MODAL ACTUALIZAR === */
#modalActualizar .modal-content {
    background: #f9f9f9;
    padding: 30px 40px;
    border-radius: 14px;
    width: 550px;
    max-width: 95%;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.35);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
}

#modalActualizar h2 {
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

#modalActualizar form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#modalActualizar label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
}

#modalActualizar input,
#modalActualizar select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}

#modalActualizar .btn-submit {
    background: #007bff;
    color: #fff;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 15px;
    transition: background 0.3s;
}
#modalActualizar .btn-submit:hover {
    background: #0056b3;
}

/* === MODAL CREAR TRABAJADOR === */
#modalCrear .modal-content {
    background: #ffffff;
    padding: 35px 45px;
    border-radius: 16px;
    width: 600px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0px 12px 28px rgba(0,0,0,0.35);
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
}

#modalCrear h2 {
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
}

/* Contenedor del formulario */
#modalCrear .form-agregar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Filas con dos inputs */
#modalCrear .row-form {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

/* Grupos de inputs */
#modalCrear .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#modalCrear .form-group.full-width {
    flex: 100%;
}

/* Labels */
#modalCrear label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 6px;
}

/* Inputs y selects */
#modalCrear input,
#modalCrear select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}

/* Botón Guardar */
#modalCrear .btn-submit {
    background: #28a745;
    color: #fff;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 15px;
    font-weight: bold;
    transition: background 0.3s;
}
#modalCrear .btn-submit:hover {
    background: #218838;
}

/* Scroll en móviles */
#modalCrear::-webkit-scrollbar {
    width: 8px;
}
#modalCrear::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}




/* ===================== RESPONSIVE DESIGN ===================== */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
    }

    .login-image {
        display: none;
    }

    .login-form {
        width: 100%;
        padding: 30px;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }
}

/* ===================== FORMULARIO AGREGAR TRABAJADOR ===================== */
.form-agregar {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    max-width: 750px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease-in-out;
}

/* Filas del formulario */
.row-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Cada campo */
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Etiquetas */
.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

/* Inputs y selects */
.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

/* Efecto al enfocar */
.form-group input:focus,
.form-group select:focus {
    border-color: #007bff;
    outline: none;
}

/* Inputs que ocupan todo el ancho */
.form-group.full-width {
    flex: 100%;
}

/* Botón Guardar */
.btn-submit {
    padding: 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s;
    width: 100%;
    margin-top: 10px;
}

.btn-submit:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
    .row-form {
        flex-direction: column;
    }
}

/* ===================== TABLA DE TRABAJADORES ===================== */
.tabla-container {
    overflow-x: auto;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
}

.tabla-trabajadores {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.tabla-trabajadores thead {
    background-color: #2c3e50;
    color: #fff;
}

.tabla-trabajadores th {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
}

.tabla-trabajadores td {
    padding: 10px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

.btn-tabla:hover {
    transform: translateY(-2px);
}

.sin-datos {
    text-align: center;
    padding: 15px;
    font-size: 14px;
    color: #666;
}

/* ===================== RESPONSIVE DESIGN ===================== */

/* Tablets (pantallas hasta 1024px) */
@media (max-width: 1024px) {
    .navbar ul {
        gap: 12px;
    }

    .login-container {
        flex-direction: column;
        height: auto;
    }

    .login-image {
        width: 100%;
        height: 220px;
    }

    .login-form {
        width: 100%;
        padding: 25px;
    }

    .form-container {
        max-width: 90%;
    }
}

/* Celulares (pantallas hasta 768px) */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-right {
        margin-top: 10px;
    }

    .navbar ul {
        flex-direction: column;
        gap: 8px;
    }

    .login-container {
        flex-direction: column;
    }

    .login-image {
        display: none; /* Ocultamos imagen para ahorrar espacio */
    }

    .login-form {
        width: 100%;
        padding: 20px;
    }

    .tabla-trabajadores {
        font-size: 12px;
    }

    .tabla-trabajadores th, 
    .tabla-trabajadores td {
        padding: 6px;
    }
}

/* Celulares muy pequeños (pantallas hasta 480px) */
@media (max-width: 480px) {
    .login-form h2 {
        font-size: 22px;
    }

    .login-form input, 
    .login-form button {
        font-size: 14px;
        padding: 10px;
    }

    footer {
        font-size: 12px;
        padding: 10px;
    }
}