/* =========================================
   CONTENEDOR PRINCIPAL (tarjeta)
   ========================================= */
.wppt-marcacion-wrapper,
.wppt-marcacion-datos,
.wppt-marcacion-progreso,
.wppt-marcacion-boton {
    box-sizing: border-box;
}

/* Envolvemos todo visualmente: asumimos un wrapper padre.
   Si no lo tienes, aplica un contenedor con esta clase */
.wppt-marcacion-wrapper {
    max-width: 100%;        /* antes: 520px — ahora usa todo el sidebar */
    margin: 20px 0;         /* antes: 20px auto — sin centrado */
    padding: 20px;          /* antes: 24px — un poco menos para sidebar angosto */
    background: #ffffff;
    border-radius: 14px;    /* antes: 16px — ligeramente más compacto */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    box-sizing: border-box; /* ⚠️ importante: evita desbordes por padding */
}

/* =========================================
   CABECERA DE DATOS
   ========================================= */
.wppt-marcacion-datos {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 12px;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eef0f3;
}

.wppt-marcacion-datos strong {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wppt-marcacion-datos .wppt-marcacion-fecha {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    font-size: 13px;
    color: #6b7280;
    text-transform: capitalize;
    font-weight: 500;
}

.wppt-marcacion-datos .wppt-marcacion-hora {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    font-size: 22px;
    font-weight: 700;
    color: #3b82f6;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    align-self: center;
}

/* =========================================
   MARCADOR DE PROGRESO
   ========================================= */
.wppt-marcacion-progreso {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
    position: relative;
    padding: 8px 4px 20px;
    margin-bottom: 20px;
}

/* Línea conectora de fondo */
.wppt-marcacion-progreso::before {
    content: "";
    position: absolute;
    top: 28px; /* centro de los puntos (8px padding + 20px radio) */
    left: 12.5%;
    right: 12.5%;
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    z-index: 0;
}

/* =========================================
   ETAPA INDIVIDUAL
   ========================================= */
.wppt-marcacion-etapa {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
    min-width: 0;
}

/* =========================================
   PUNTO / CÍRCULO
   ========================================= */
.wppt-marcacion-punto {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    background: #ffffff;
    border: 3px solid #d1d5db;
    color: #9ca3af;
    transition: all 0.3s ease;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Completado — verde */
.wppt-marcacion-etapa.completado .wppt-marcacion-punto {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

/* Actual — azul pulsante */
.wppt-marcacion-etapa.actual .wppt-marcacion-punto {
    background: #ffffff;
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    animation: wppt-pulse 1.8s infinite;
}

/* Pendiente — gris */
.wppt-marcacion-etapa.pendiente .wppt-marcacion-punto {
    background: #ffffff;
    border-color: #d1d5db;
    color: #9ca3af;
}

/* =========================================
   TEXTOS DE LA ETAPA
   ========================================= */
.wppt-marcacion-etapa strong {
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.wppt-marcacion-etapa small {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    line-height: 1.2;
    min-height: 14px;
}

.wppt-marcacion-etapa.completado strong { color: #059669; }
.wppt-marcacion-etapa.actual strong    { color: #3b82f6; }

/* =========================================
   BOTÓN DE ACCIÓN
   ========================================= */
.wppt-marcacion-boton {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    font-family: inherit;
}

.wppt-marcacion-boton:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.wppt-marcacion-boton:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.wppt-marcacion-boton:disabled,
.wppt-marcacion-boton.cargando {
    background: #9ca3af;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    opacity: 0.8;
}

/* =========================================
   ANIMACIÓN PULSO
   ========================================= */
@keyframes wppt-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.45); }
    70%  { box-shadow: 0 0 0 12px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    .wppt-marcacion-wrapper {
        padding: 18px 14px;
        margin: 12px;
        border-radius: 14px;
    }

    .wppt-marcacion-datos strong { font-size: 15px; }
    .wppt-marcacion-datos .wppt-marcacion-hora { font-size: 19px; }

    .wppt-marcacion-progreso {
        padding: 6px 0 16px;
        gap: 2px;
    }

    .wppt-marcacion-progreso::before {
        top: 22px;
        left: 11%;
        right: 11%;
        height: 2px;
    }

    .wppt-marcacion-punto {
        width: 32px;
        height: 32px;
        font-size: 12px;
        border-width: 2.5px;
    }

    .wppt-marcacion-etapa strong {
        font-size: 10.5px;
        margin-top: 8px;
    }

    .wppt-marcacion-etapa small { font-size: 10.5px; }

    .wppt-marcacion-boton {
        padding: 13px 16px;
        font-size: 13px;
        border-radius: 10px;
    }
}

/* =========================================
   MODO OSCURO
   ========================================= */
@media (prefers-color-scheme: dark) {
    .wppt-marcacion-wrapper {
        background: #1f2937;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }

    .wppt-marcacion-datos {
        border-bottom-color: #374151;
    }

    .wppt-marcacion-datos strong { color: #f3f4f6; }
    .wppt-marcacion-datos .wppt-marcacion-fecha { color: #9ca3af; }

    .wppt-marcacion-progreso::before { background: #374151; }

    .wppt-marcacion-etapa strong { color: #e5e7eb; }
    .wppt-marcacion-etapa small  { color: #9ca3af; }

    .wppt-marcacion-etapa.pendiente .wppt-marcacion-punto {
        background: #1f2937;
        border-color: #4b5563;
        color: #6b7280;
    }

    .wppt-marcacion-etapa.actual .wppt-marcacion-punto {
        background: #1f2937;
    }
}


/* <historial_marcaciones> */
/* <historial_marcaciones> */
/* Estilos del botón, modal y selector de quincenas del historial personal. */

/* ---------- Botón principal ---------- */
.wppt-marcacion-historial-boton {
    margin-top: 12px;
    padding: 4px 0;

    background: transparent;
    border: 0;
    color: #6b8299;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(107, 130, 153, 0.5);

    cursor: pointer;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.wppt-marcacion-historial-boton:hover {
    color: #3d5a75;
    text-decoration-color: #3d5a75;
}

.wppt-marcacion-historial-boton:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 3px;
    border-radius: 3px;
}

/* ---------- Modal (overlay a pantalla completa, sí o sí) ---------- */
.wppt-marcacion-historial-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 20px !important;
    max-width: 100%;

    background: rgba(0, 0, 0, 0.65) !important;
    z-index: 2147483647 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    overflow: auto !important;
    box-sizing: border-box !important;
}

.wppt-marcacion-historial-modal[hidden] {
    display: none !important;
}

.wppt-marcacion-historial-contenido {
    width: 100%;
    max-width: 100%;
    max-height: 100%;

    background: #fff;
    padding: 20px;

    box-sizing: border-box;
    border-radius: 10px;

    /* Importante: quitar min-height: 100vh */
}

/* Padding interno SOLO donde quieres: cabecera, quincenas y lista */


.wppt-marcacion-historial-lista {
    padding: 0 20px 20px 20px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}


/* ---------- Cabecera ---------- */
.wppt-marcacion-historial-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    padding-bottom: 15px;
}

.wppt-marcacion-historial-cabecera strong {
    font-size: 18px;
    color: #1d2327;
}

.wppt-marcacion-historial-cerrar {
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #50575e;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.wppt-marcacion-historial-cerrar:hover {
    background: #f0f0f1;
    color: #1d2327;
}

.wppt-marcacion-historial-cerrar:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* <tabs_quincenas> */
/* <tabs_quincenas> */
/* Muestra las quincenas del trabajador con el mismo estilo de pestañas del administrador. */

.wppt-marcacion-historial-quincenas {
    display: flex;
    align-items: flex-end;
    padding-left: .5em;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #c3c4c7;
}

.wppt-marcacion-quincena {
    margin-bottom: -1px;
    padding: 8px 12px;    
    border: 1px solid #c3c4c7;
    border-bottom: 1px solid #c3c4c7;
    border-radius: 0;
    background: #e0e0e0;
    color: #2c3338;
    cursor: pointer;
    font-size: 13px;
}

.wppt-marcacion-quincena:hover {
    background: #f0f0f1;
    color: #1d2327;
}

.wppt-marcacion-quincena.activo {
    border-bottom-color: #fff;
    background: #fff;
    color: #1d2327;
    font-weight: 500;
}

.wppt-marcacion-quincena:focus,
.wppt-marcacion-quincena:focus-visible {
    outline: none;
    box-shadow: none;
}

/* </tabs_quincenas> */


/* ---------- Lista vacía / mensaje ---------- */
.wppt-marcacion-historial-lista p {
    margin: 0;
    padding: 30px 0;
    text-align: center;
    color: #8c8f94;
    font-style: italic;
}


/* ---------- Tabla dentro de la lista ---------- */
.wppt-marcacion-historial-lista table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
   
}

.wppt-marcacion-historial-lista thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f6f7f7;
    color: #1d2327;
    font-weight: 600;
    text-align: left;
    padding: 12px 14px;
    border-bottom: 2px solid #dcdcde;
    white-space: nowrap;
}

.wppt-marcacion-historial-lista tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f1;
    color: #2c3338;
    white-space: nowrap;
}

.wppt-marcacion-historial-lista tbody tr:hover {
    background: #f6f7f7;
}

.wppt-marcacion-historial-lista tbody tr:last-child td {
    border-bottom: 0;
}


/* ---------- Scrollbars sutiles ---------- */
.wppt-marcacion-historial-lista::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.wppt-marcacion-historial-lista::-webkit-scrollbar-thumb {
    background: #c3c4c7;
    border-radius: 5px;
}
.wppt-marcacion-historial-lista::-webkit-scrollbar-thumb:hover {
    background: #a7aaad;
}
.wppt-marcacion-historial-lista::-webkit-scrollbar-track {
    background: #f0f0f1;
}

/* </historial_marcaciones> */

/* <tabla_historial> */
/* Da formato a la tabla personal de marcaciones dentro del modal. */

.wppt-marcaciones-trabajador-historial {
    width: 100%;
    overflow-x: auto;
}

.wppt-marcaciones-trabajador-historial table {
    width: 100%;
    border-collapse: collapse;
    
}

.wppt-marcaciones-trabajador-historial th,
.wppt-marcaciones-trabajador-historial td {
    padding: 10px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    vertical-align: middle;
}

.wppt-marcaciones-trabajador-historial th {
    font-weight: 600;
    background: #f5f5f5;
}

.wppt-marcaciones-trabajador-historial td > span {
    display: block;
}

.wppt-marcacion-tolerancia {
    color: #2271b1;
    background: #f0f6fc;
    border: 1px solid #c5d9ed;    
    padding-left: 4px;
    padding-right: 4px;
}

.wppt-marcacion-jornada {
    white-space: nowrap;
}

.wppt-jornada-horas {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 3px 6px;
    align-items: center;
}

.wppt-jornada-separador {
    text-align: center;
}

.wppt-marcacion-refrigerio {
    white-space: nowrap;
}

.wppt-marcacion-no-laborable {
    color:  #dc3545;
    
}

.wppt-saldo-positivo {
    color: #198754;
}

.wppt-saldo-negativo {
    color: #dc3545;
}

.wppt-marcacion-estado-celda {
    white-space: nowrap;
}


.wppt-estado-no-marco {
    color: #d63638;
    font-weight: 600;
}

/* <scroll_historial> */
/* Limita la altura del historial y permite desplazamiento vertical. */

.wppt-marcacion-historial-lista {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 6px;
}

/* </scroll_historial> */

/* </tabla_historial> */

/* <historial_responsive> */
/* Ajusta el historial personal para pantallas pequeñas. */

@media (max-width: 768px) {

    .wppt-marcacion-historial-modal {
        padding: 10px;
    }

    .wppt-marcacion-historial-contenido {
        width: 100%;
        max-height: 95vh;
        padding: 12px;
    }

    .wppt-marcacion-historial-quincenas {
        gap: 5px;
    }

    .wppt-marcacion-quincena {
        flex: 1;
        padding: 8px 6px;
        font-size: 13px;
    }

    .wppt-marcaciones-trabajador-historial table {
        min-width: 650px;
    }

    .wppt-marcaciones-trabajador-historial th,
    .wppt-marcaciones-trabajador-historial td {
        padding: 8px;
        font-size: 13px;
    }
}

/* </historial_responsive> */