/* ===================== RESET GENERAL ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================== BODY Y LAYOUT GENERAL ===================== */
html, body {
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    color: #2c3e50;
}

/* ===================== NAVBAR ===================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f8f8;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #ddd;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.navbar:hover {
    background-color: #fafafa;
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.logo {
    height: 50px;
    width: auto;
    cursor: pointer;
}

.navbar ul {
    display: flex;
    list-style: none;
    gap: 20px;
    flex-wrap: wrap;
}

.navbar ul li a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.2s ease;
}

.navbar ul li a:hover {
    color: #ffcc00;
    transform: scale(1.05);
}

/* ===================== 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;
    bottom: 0;
    left: 0;
    width: 100%;
}

/* ===================== MAIN (espaciado para que no se solape) ===================== */
main {
    flex: 1;
    padding-top: 80px;
    padding-bottom: 60px;
}

/* ===================== LOGIN PAGE ===================== */
.login-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: #fff;
    margin-top: 60px;
    margin-bottom: 50px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

.login-image {
    width: 50%;
    height: 100%;
}
.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.login-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.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: 8px;
    font-size: 15px;
    transition: all 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.login-form input:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 5px rgba(44,62,80,0.4);
}

.login-form button {
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
.login-form button:hover {
    background-color: #1a252f;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.login-form p {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}
.login-form p a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}
.login-form p a:hover {
    color: #ffcc00;
}

/* ===================== FORMULARIOS FLEXIBLES ===================== */
.form-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
    margin-top: 60px;
}

.form-container h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    font-size: 28px;
}

.form-container form {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 350px;
}

.form-container label {
    margin-bottom: 6px;
    font-weight: bold;
    color: #333;
}

.form-container input {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease, box-shadow 0.3s ease;
}
.form-container input:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 5px rgba(44,62,80,0.3);
}

.form-container button {
    padding: 12px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 10px;
}
.form-container button:hover {
    background-color: #1a252f;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ===================== HOME PAGE ===================== */
.home-container {
    text-align: center;
    padding: 40px 20px;
    max-width: 1200px;
    margin: auto;
}

.welcome-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
}
.welcome-title {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.form-title {
    text-align: center;
    font-size: 1.5rem;
}

/* ===================== USER ROLE ===================== */
.user-role {
    font-size: 16px;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
    color: #fff; /* Letra blanca para contraste */
    background: linear-gradient(135deg, #e74c3c, #c0392b); /* Rojo degradado */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Sombra para destacar */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); /* Brillo y profundidad */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-role[data-role="Usuario"] {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.user-role[data-role="Invitado"] {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff; /* Asegurar contraste */
}

.user-role:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}
/* ===================== 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);
    justify-content: center;
    align-items: center;
}

.close {
    position: absolute;
    top: 12px;
    right: 18px;
    color: #333;
    font-size: 26px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close:hover {
    color: red;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ===================== MODAL FICHA ===================== */
#modalFicha .modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 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: 0 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: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
#modalActualizar .btn-submit:hover {
    background: #0056b3;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,91,187,0.3);
}

/* ===================== 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: 0 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;
}
#modalCrear .form-agregar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
#modalCrear .row-form {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
#modalCrear .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
#modalCrear .form-group.full-width {
    flex: 100%;
}
#modalCrear label {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 6px;
}
#modalCrear input,
#modalCrear select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}
#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: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}
#modalCrear .btn-submit:hover {
    background: #218838;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(33,131,56,0.3);
}
#modalCrear::-webkit-scrollbar {
    width: 8px;
}
#modalCrear::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

/* ===================== FORMULARIO AGREGAR TRABAJADOR ===================== */
.form-agregar {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 20px 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;
}
.row-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}
.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease, box-shadow 0.3s ease;
}
.form-group input:focus,
.form-group select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}
.form-group.full-width {
    flex: 100%;
}
.btn-submit {
    padding: 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    width: 100%;
    margin-top: 10px;
}
.btn-submit:hover {
    background-color: #0056b3;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0,91,187,0.3);
}

/* ===================== 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;
}
.tabla-trabajadores tbody tr:hover {
    background-color: #e0e4ea; /* un poco más gris para mejor contraste */
    transition: background 0.3s ease;
}
.btn-tabla:hover {
    transform: translateY(-2px) scale(1.02);
}
.sin-datos {
    text-align: center;
    padding: 15px;
    font-size: 14px;
    color: #666;
}

/* ===================== RESPONSIVE DESIGN ===================== */
@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%; }
}
@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; }
    .login-form { width: 100%; padding: 20px; }
    .tabla-trabajadores { font-size: 12px; }
    .tabla-trabajadores th, .tabla-trabajadores td { padding: 6px; }
}
@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; }
    .form-container { padding: 20px; }
    .form-container h2 { font-size: 24px; }
    .btn-submit { font-size: 14px; padding: 10px; }
    .tabla-trabajadores { font-size: 11px; }
}
