/* Estilos generales modernizados */
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8fafc;
    color: #334155;
    font-size: 16px;
    line-height: 1.6;
}

/* Encabezado moderno */
header {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    color: #fff;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#imgLogo {
    max-height: 55px;
    height: auto;
}

h1 {
    font-size: 2.2rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.5px;
    line-height: 1;
}

.header-buttons {
    display: flex;
    gap: 1rem;
}

/* Botones mejorados */
.btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background-color: #2563db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #64748b;
}

.btn-secondary:hover {
    background-color: #475569;
}

/* Contador de tiempo gigante */
#workTime {
    font-size: 3.5rem;
    font-weight: 800;
    color: #1e3a8a;
    display: block;
    margin-top: 0.5rem;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem !important;
}

/* Boton Entrada */

.btn-entry {
    background-color: #6ac254;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-entry:hover {
    background-color: #4b9741;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-entry:active {
    transform: translateY(0);
}

.btn-entry-secondary {
    background-color: #64748b;
}

.btn-entry-secondary:hover {
    background-color: #475569;
}

/* Boton Salida */

.btn-exit {
    background-color: #f05757;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-exit:hover {
    background-color: #c24141;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-exit:active {
    transform: translateY(0);
}

.btn-exit-secondary {
    background-color: #64748b;
}

.btn-exit-secondary:hover {
    background-color: #475569;
}

/* Boton Cambio Centro */

.btn-centro {
    background-color: #12a0c4;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-centro:hover {
    background-color: #04728d;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-centro:active {
    transform: translateY(0);
}

.btn-centro-secondary {
    background-color: #64748b;
}

.btn-centro-secondary:hover {
    background-color: #475569;
}

.big-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
}

.small-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* Layout del dashboard modernizado */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tarjetas de información mejoradas */
.user-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: white;
    padding-left: 1.8rem;
    padding-right: 1.8rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    margin-bottom: 1.2rem;
    color: #1e3a8a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.8rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.info-card p {
    margin: 0.8rem 0;
    color: #475569;
}

/* Contenedor de registros */
.records-container {
    background: white;
    padding: 2rem;
    padding-top: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.records-container h2 {
    color: #1e3a8a;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Filtros mejorados */
.filters {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.filters input {
    padding: 0.7rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filters input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Tabla de registros mejorada */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 1rem;
    color: #334155;
    table-layout: fixed;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    word-wrap: break-word;
}

th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: #1e3a8a;
    position: sticky;
    top: 0;
    z-index: 1;
}

tr:hover {
    background-color: #f8fafc;
}

/* Modal mejorado */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
    text-align: center;
}

.modal-content h3 {
    color: #1e3a8a;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content p {
    color: #475569;
    margin-bottom: 2rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.settings-icon {
    cursor: pointer;
    font-size: 1.3em;
    color: #64748b;
    z-index: 11;
    transition: color 0.2s;
    position: static;
    top: auto;
    right: auto;
    margin-left: 10px;
}

.settings-icon:hover {
    color: #1e3a8a;
}

.settings-menu {
    display: none;
    position: absolute;
    top: 48px;
    right: 18px;
    background: linear-gradient(135deg, #f8fafc 80%, #e0e7ef 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.18), 0 1.5px 6px rgba(30, 58, 138, 0.08);
    z-index: 20;
    min-width: 190px;
    padding: 0.5rem 0;
    animation: menuFadeIn 0.25s ease;
    transition: box-shadow 0.2s;
}

.settings-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    right: 24px;
    border-width: 0 8px 10px 8px;
    border-style: solid;
    border-color: transparent transparent #f8fafc transparent;
    filter: drop-shadow(0 2px 2px rgba(30, 58, 138, 0.07));
}

.settings-menu-btn {
    display: block;
    width: 100%;
    padding: 12px 28px 12px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 1.05rem;
    color: #1e3a8a;
    font-weight: 500;
    transition: background 0.18s, color 0.18s, padding 0.18s;
    border-radius: 0;
}

.settings-menu-btn:hover {
    color: #2563eb;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

/* Información del usuario mejorada */
.user-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.user-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.detail-value {
    font-size: 1.05rem;
    color: #334155;
    font-weight: 500;
}

.user-role-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-role-badge.admin {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.user-role-badge.user {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* Navegación de fecha mejorada */
.date-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 0;
    margin: 1.5rem 0;
}

#currentDateDisplay {
    font-size: 1.3em;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    flex-direction: column;
}


#currentDateDisplay:hover {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#currentDateDisplay:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.time-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 500;
}


.records-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.records-header h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0;
}

/* FILTROS BUSQUEDA */
.modo-busqueda-wrapper-btn {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    min-width: 80px;
    min-height: 2.2rem;

    display: flex;
    justify-content: center;
    /* Centrar texto horizontalmente */
    align-items: center;
    /* Centrar texto verticalmente */

    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;

    font-size: 1rem;
    color: #1e3a8a;
    font-weight: 600;
    line-height: 1;
    overflow: visible;
}

.modo-busqueda-wrapper-btn:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.icono-busqueda {
    margin-left: 5px;
}


/* Responsive */
@media (max-width: 768px) {
    .settings-icon {
        font-size: 1.3em;
    }

    .user-info {
        grid-template-columns: 1fr;
    }

    .time-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 0 1rem;
    }

    .big-btn {
        width: 100%;
        padding: 1.5rem 1rem;
        font-size: 1rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .user-details {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }

    .header-buttons {
        width: 100%;
        flex-wrap: wrap;
    }

    .records-header {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        /* espacio entre h3 y botón */
        align-items: flex-start;
        /* opcional, para que quede alineado a la izquierda */
    }

    .modo-busqueda-wrapper-btn {
        justify-content: center;
        min-width: 80px;
        /* opcional: un poco de espacio a la izquierda */
    }
}

@media (max-width: 500px) {
    h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem;
    }

    .info-card {
        padding: 1.2rem;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 430px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .btn {
        font-size: 0.95rem;
        padding: 0.6rem 1.2rem;
    }

    .big-btn {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }

    .header-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filters input {
        font-size: 0.95rem;
    }

    .user-info,
    .user-details {
        grid-template-columns: 1fr;
    }

    .records-container {
        padding: 1rem;
    }

    #currentDateDisplay {
        font-size: 1.1rem;
        padding: 0.6rem 1rem;
    }

    th {
        font-size: 0.65rem;
        padding: 0.5rem;
    }

    td {
        font-size: 0.80rem;
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1.2rem;
    }
}

/* Menú Hamburguesa Estilos */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 2000;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    pointer-events: none;
}

.mobile-menu.active {
    right: 0;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-header {
    padding: 1.5rem;
    background: #1e3a8a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header img {
    height: 40px;
}

.close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.mobile-menu-links {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.mobile-menu-links a {
    padding: 1.2rem 2rem;
    text-decoration: none;
    color: #334155;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-menu-links a:hover {
    background: #f8fafc;
    color: #1e3a8a;
}

.mobile-menu-links hr {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid #e2e8f0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    display: block;
    pointer-events: auto;
}

@media (max-width: 900px) {
    header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.8rem 1.2rem !important;
    }

    .logo-title {
        gap: 0.8rem !important;
    }

    .header-buttons {
        display: none !important;
    }
    
    .menu-toggle {
        display: block !important;
        color: white !important;
    }
    
    h1 {
        font-size: 1.2rem !important;
    }
    
    #workTime {
        font-size: 2.5rem !important;
    }
}