/**
 * Control Horario Empleados - Frontend CSS
 */

/* ==========================================================================
   Variables y reset
   ========================================================================== */
:root {
    --che-primary: #2563eb;
    --che-secondary: #64748b;
    --che-success: #10b981;
    --che-warning: #f59e0b;
    --che-danger: #ef4444;
    --che-dark: #1e293b;
    --che-light: #f8fafc;
    --che-border: #e2e8f0;
    --che-radius: 12px;
    --che-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --che-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Widget de fichaje v2 - Rediseñado
   ========================================================================== */
.che-fichaje-widget-v2 {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Header del empleado v2 */
.che-empleado-header-v2 {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--che-border);
}

.che-empleado-avatar-container {
    flex-shrink: 0;
}

.che-empleado-foto-v2 {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--che-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.che-empleado-avatar-v2 {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--che-primary), #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.che-empleado-info-v2 {
    flex: 1;
    min-width: 0;
}

.che-empleado-nombre-v2 {
    margin: 0 0 6px 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--che-dark);
    line-height: 1.2;
}

.che-empleado-departamento-v2 {
    margin: 0;
    font-size: 15px;
    color: var(--che-secondary);
    font-weight: 500;
}

/* Reloj v2 */
.che-reloj-wrapper-v2 {
    text-align: center;
    margin-bottom: 28px;
    padding: 32px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.che-fecha-actual-v2 {
    font-size: 15px;
    opacity: 0.95;
    margin-bottom: 12px;
    text-transform: capitalize;
    font-weight: 500;
}

.che-reloj-v2 {
    font-size: 56px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Estado actual v2 */
.che-estado-actual-v2 {
    margin-bottom: 28px;
}

.che-estado-card {
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

/* Opciones v2 */
.che-opciones-v2 {
    margin-bottom: 28px;
}

.che-opcion-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.che-opcion-group-v2 {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.che-opcion-group-v2 label {
    font-size: 14px;
    font-weight: 600;
    color: var(--che-dark);
}

.che-select-v2,
.che-input-v2 {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--che-border);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.che-select-v2:focus,
.che-input-v2:focus {
    outline: none;
    border-color: var(--che-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Geolocalización v2 */
.che-geolocalizacion-v2 {
    margin-bottom: 28px;
}

.che-geo-status-v2 {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--che-light);
    border-radius: 10px;
    font-size: 14px;
    color: var(--che-secondary);
    border: 1px solid var(--che-border);
}

.che-geo-icon-v2 {
    font-size: 22px;
}

/* Botón principal v2 */
.che-btn-fichar-v2 {
    width: 100%;
    padding: 24px;
    background: linear-gradient(135deg, var(--che-primary) 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
    margin-bottom: 20px;
}

.che-btn-fichar-v2:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
}

.che-btn-fichar-v2:active:not(:disabled) {
    transform: translateY(-1px);
}

.che-btn-fichar-v2:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.che-btn-fichar-v2.che-btn-entrada {
    background: linear-gradient(135deg, var(--che-success) 0%, #059669 100%);
}

.che-btn-fichar-v2.che-btn-salida {
    background: linear-gradient(135deg, var(--che-danger) 0%, #dc2626 100%);
}

.che-btn-icon-v2 {
    font-size: 32px;
}

.che-btn-text-v2 {
    font-size: 22px;
}

/* Botones de pausa v2 */
.che-pausas-grid-v2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.che-btn-pausa-v2 {
    padding: 18px 20px;
    background: white;
    border: 2px solid var(--che-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.che-btn-pausa-v2:hover {
    border-color: var(--che-primary);
    background: var(--che-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.che-btn-pausa-v2 .pausa-icon {
    font-size: 28px;
}

.che-btn-pausa-v2 .pausa-text {
    font-size: 14px;
    color: var(--che-dark);
}

.che-btn-pausa-especial {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
}

.che-btn-pausa-especial:hover {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border-color: #fb923c;
}

/* Mensajes v2 */
.che-mensaje-v2 {
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    font-size: 15px;
}

.che-loading-v2 {
    text-align: center;
    padding: 20px;
    color: var(--che-secondary);
    font-size: 15px;
}

/* Historial toggle */
.che-historial-toggle-wrapper {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px dashed var(--che-border);
}

.che-btn-toggle-historial {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid var(--che-border);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--che-dark);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.che-btn-toggle-historial:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: var(--che-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.che-btn-toggle-historial .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Sección de historial */
.che-historial-section {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px solid var(--che-border);
}

.che-historial-header {
    margin-bottom: 20px;
}

.che-historial-header h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: var(--che-dark);
}

.che-historial-filtros {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.che-date-input {
    flex: 1;
    min-width: 120px;
    max-width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--che-border);
    border-radius: 8px;
    font-size: 14px;
    color: #000000 !important;
    background: white;
    -webkit-text-fill-color: #000000 !important;
    box-sizing: border-box;
}

.che-date-input:focus {
    outline: none;
    border-color: var(--che-primary);
}

.che-date-input::-webkit-datetime-edit,
.che-date-input::-webkit-datetime-edit-fields-wrapper,
.che-date-input::-webkit-datetime-edit-text,
.che-date-input::-webkit-datetime-edit-month-field,
.che-date-input::-webkit-datetime-edit-day-field,
.che-date-input::-webkit-datetime-edit-year-field {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

.che-date-input::-webkit-calendar-picker-indicator {
    filter: invert(0);
    cursor: pointer;
}

.che-btn-filtrar {
    padding: 10px 20px;
    background: var(--che-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    white-space: nowrap;
}

.che-btn-filtrar:hover {
    background: #1e40af;
    transform: translateY(-1px);
}

.che-historial-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

.che-historial-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.che-historial-table thead {
    background: var(--che-dark);
    color: white;
}

.che-historial-table th,
.che-historial-table td {
    padding: 14px 12px;
    text-align: left;
    font-size: 14px;
}

.che-historial-table tbody tr {
    border-bottom: 1px solid var(--che-border);
}

.che-historial-table tbody tr:hover {
    background: var(--che-light);
}

.che-historial-table tbody tr:last-child {
    border-bottom: none;
}

.che-badge-presencial {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 600;
}

.che-badge-teletrabajo {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
}

.che-badge-mixta {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
}

.che-badge-domicilio {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f3e8ff;
    color: #6b21a8;
    font-size: 12px;
    font-weight: 600;
}

.che-empty-historial {
    text-align: center;
    padding: 40px 20px;
    color: var(--che-secondary);
    font-size: 15px;
}

.che-error-historial {
    text-align: center;
    padding: 20px;
    color: var(--che-danger);
    background: #fee2e2;
    border-radius: 8px;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .che-fichaje-widget-v2 {
        padding: 24px 20px;
    }
    
    .che-empleado-header-v2 {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .che-empleado-foto-v2,
    .che-empleado-avatar-v2 {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    .che-empleado-nombre-v2 {
        font-size: 22px;
    }
    
    .che-reloj-v2 {
        font-size: 48px;
        letter-spacing: 4px;
    }
    
    .che-opcion-row {
        grid-template-columns: 1fr;
    }
    
    .che-pausas-grid-v2 {
        grid-template-columns: 1fr;
    }
    
    .che-btn-fichar-v2 {
        padding: 20px;
        font-size: 20px;
    }
    
    .che-btn-icon-v2 {
        font-size: 28px;
    }
    
    .che-btn-text-v2 {
        font-size: 20px;
    }
    
    .che-historial-filtros {
        flex-direction: column;
    }
    
    .che-date-input {
        width: 100%;
    }
    
    .che-btn-filtrar {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .che-fichaje-widget-v2 {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    .che-empleado-nombre-v2 {
        font-size: 20px;
    }
    
    .che-reloj-wrapper-v2 {
        padding: 24px 20px;
    }
    
    .che-reloj-v2 {
        font-size: 42px;
    }
    
    .che-historial-table th,
    .che-historial-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Widget de fichaje - ORIGINAL (mantener para compatibilidad)
   ========================================================================== */
.che-fichaje-widget {
    max-width: 500px;
    margin: 0 auto;
    padding: 32px;
    background: white;
    border-radius: var(--che-radius);
    box-shadow: var(--che-shadow-lg);
}

/* Header del empleado */
.che-empleado-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--che-border);
}

.che-empleado-foto {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--che-primary);
}

.che-empleado-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--che-primary), var(--che-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.che-empleado-info h3 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--che-dark);
}

.che-empleado-departamento {
    margin: 0;
    font-size: 14px;
    color: var(--che-secondary);
    font-weight: 500;
}

/* Reloj */
.che-reloj-container {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--che-radius);
    color: white;
}

.che-fecha-actual {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.che-reloj {
    font-size: 48px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

/* Estado actual */
.che-estado-actual {
    margin-bottom: 24px;
}

.che-estado-card {
    padding: 20px;
    border-radius: var(--che-radius);
    text-align: center;
}

.che-estado-sin_fichar {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
}

.che-estado-trabajando {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #bbf7d0;
}

.che-estado-en_pausa {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fde68a;
}

.che-estado-completado {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border: 2px solid #e9d5ff;
}

.che-estado-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.che-estado-mensaje {
    font-size: 18px;
    font-weight: 600;
    color: var(--che-dark);
    margin-bottom: 8px;
}

.che-estado-detalle {
    font-size: 14px;
    color: var(--che-secondary);
    margin-top: 4px;
}

/* Opciones */
.che-opciones {
    margin-bottom: 24px;
}

.che-opcion-group {
    margin-bottom: 16px;
}

.che-opcion-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--che-dark);
}

.che-select,
.che-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--che-border);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.che-select:focus,
.che-input:focus {
    outline: none;
    border-color: var(--che-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Geolocalización */
.che-geolocalizacion {
    margin-bottom: 24px;
}

.che-geo-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--che-light);
    border-radius: 8px;
    font-size: 14px;
    color: var(--che-secondary);
}

.che-geo-icon {
    font-size: 20px;
}

.che-geo-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    color: #166534;
}

.che-geo-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Botón principal de fichaje */
.che-btn-fichar {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--che-primary) 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: var(--che-radius);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--che-shadow);
}

.che-btn-fichar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--che-shadow-lg);
}

.che-btn-fichar:active:not(:disabled) {
    transform: translateY(0);
}

.che-btn-fichar:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.che-btn-fichar.che-btn-entrada {
    background: linear-gradient(135deg, var(--che-success) 0%, #059669 100%);
}

.che-btn-fichar.che-btn-salida {
    background: linear-gradient(135deg, var(--che-danger) 0%, #dc2626 100%);
}

.che-btn-icon {
    font-size: 28px;
}

/* Botones de pausa */
.che-pausas-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.che-btn-pausa {
    padding: 12px;
    background: white;
    border: 2px solid var(--che-border);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.che-btn-pausa:hover {
    border-color: var(--che-primary);
    background: var(--che-light);
    transform: translateY(-2px);
}

.che-btn-pausa-justificada {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
}

.che-btn-pausa-justificada:hover {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border-color: #fb923c;
}

/* Mensajes */
.che-mensaje {
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    text-align: center;
    font-weight: 500;
}

.che-msg-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.che-msg-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.che-msg-info {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    color: #075985;
}

/* ==========================================================================
   Widget de historial
   ========================================================================== */
.che-historial-widget {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
    background: white;
    border-radius: var(--che-radius);
    box-shadow: var(--che-shadow-lg);
}

.che-historial-header {
    margin-bottom: 32px;
}

.che-historial-header h3 {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--che-dark);
}

.che-filtros {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.che-input-date {
    padding: 10px 12px;
    border: 2px solid var(--che-border);
    border-radius: 8px;
    font-size: 14px;
}

.che-btn-secondary {
    padding: 10px 24px;
    background: var(--che-secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.che-btn-secondary:hover {
    background: var(--che-dark);
}

/* Resumen */
.che-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.che-resumen-item {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--che-radius);
    border: 2px solid var(--che-border);
    text-align: center;
}

.che-resumen-label {
    display: block;
    font-size: 14px;
    color: var(--che-secondary);
    margin-bottom: 8px;
}

.che-resumen-valor {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--che-dark);
}

/* Tabla */
.che-tabla-responsive {
    overflow-x: auto;
}

.che-tabla {
    width: 100%;
    border-collapse: collapse;
}

.che-tabla thead {
    background: var(--che-dark);
    color: white;
}

.che-tabla th,
.che-tabla td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--che-border);
}

.che-tabla tbody tr:hover {
    background: var(--che-light);
}

.che-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.che-badge-presencial {
    background: #dbeafe;
    color: #1e40af;
}

.che-badge-teletrabajo {
    background: #f3e8ff;
    color: #6b21a8;
}

.che-badge-mixta {
    background: #fef3c7;
    color: #92400e;
}

.che-badge-domicilio {
    background: #fed7aa;
    color: #9a3412;
}

.che-badge-abierto {
    background: #dcfce7;
    color: #166534;
}

.che-badge-cerrado {
    background: #e0f2fe;
    color: #075985;
}

/* Loading y empty states */
.che-loading {
    text-align: center;
    padding: 40px;
    color: var(--che-secondary);
}

.che-empty {
    text-align: center;
    padding: 40px;
    color: var(--che-secondary);
    font-style: italic;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .che-fichaje-widget,
    .che-historial-widget {
        padding: 20px;
    }
    
    .che-reloj {
        font-size: 36px;
    }
    
    .che-pausas-container {
        grid-template-columns: 1fr;
    }
    
    .che-resumen {
        grid-template-columns: 1fr;
    }
}



/* === Fichaje por PIN (frontend) === */

.che-fichaje-pin-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.che-fichaje-pin-card {
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    padding: 24px 22px 26px;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.che-fichaje-pin-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
    text-align: center;
}

.che-alert {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.che-alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.che-alert-success {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.che-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.che-fichaje-pin-form {
    margin-top: 10px;
}

.che-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.che-field-group label {
    font-size: 0.9rem;
    color: #4b5563;
    font-weight: 500;
}

.che-field-group input[type="password"] {
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.che-field-group input[type="password"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.che-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

.che-actions-doble {
    justify-content: space-between;
}

.che-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 9px 18px;
    font-weight: 600;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.che-btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.che-btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.45);
}

.che-btn-entrada {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(22, 163, 74, 0.3);
}

.che-btn-entrada:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(22, 163, 74, 0.4);
}

.che-btn-salida {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.3);
}

.che-btn-salida:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(220, 38, 38, 0.4);
}

.che-empleado-resumen {
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 4px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.che-empleado-nombre {
    margin: 0 0 2px;
    color: #0f172a;
}

.che-empleado-puesto {
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 640px) {
    .che-fichaje-pin-card {
        margin-inline: 10px;
        padding: 20px 16px 22px;
    }
}



/* === Panel de administración frontend === */

.che-admin-panel-wrapper {
    margin: 24px 0;
    display: flex;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.che-admin-panel-card {
    width: 100%;
    max-width: 1180px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    padding: 22px 22px 26px;
}

.che-admin-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
}

.che-admin-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 10px;
}

.che-admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
    gap: 20px;
    align-items: flex-start;
}

.che-admin-col {
    min-width: 0;
}

.che-admin-col-form {
    border-right: 1px dashed #e2e8f0;
    padding-right: 14px;
}

.che-admin-col-list {
    padding-left: 4px;
}

.che-admin-form .che-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin-bottom: 8px;
}

.che-admin-form .che-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.che-admin-form .che-field-group label {
    font-size: 0.85rem;
    color: #4b5563;
    font-weight: 500;
}

.che-admin-form input[type="text"],
.che-admin-form input[type="email"],
.che-admin-form input[type="date"],
.che-admin-form input[type="time"],
.che-admin-form input[type="password"],
.che-admin-form select,
.che-admin-form textarea {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 7px 10px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.che-admin-form textarea {
    resize: vertical;
}

.che-admin-form input:focus,
.che-admin-form select:focus,
.che-admin-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.che-admin-form .che-actions-form {
    margin-top: 10px;
    justify-content: flex-start;
}

.che-admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.che-admin-search form {
    display: flex;
    gap: 8px;
}

.che-admin-search input[type="text"] {
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    padding: 7px 12px;
    font-size: 0.9rem;
    min-width: 220px;
}

.che-btn-secondary {
    background: #0f172a;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
}

.che-btn-secondary:hover {
    background: #020617;
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.45);
}

.che-admin-stats {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: #475569;
}

.che-admin-stats span strong {
    color: #0f172a;
}

.che-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.che-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.che-table th,
.che-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

.che-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #0f172a;
}

.che-table tr:last-child td {
    border-bottom: none;
}

.che-row-baja {
    background: #fef2f2;
}

.che-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.che-btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: #e5e7eb;
    color: #111827;
    font-weight: 500;
    transition: background-color 0.12s ease, transform 0.12s ease;
}

.che-btn-xs:hover {
    background: #d4d4d8;
    transform: translateY(-0.5px);
}

.che-btn-warning {
    background: #f97316;
    color: #ffffff;
}

.che-btn-warning:hover {
    background: #ea580c;
}

.che-btn-success {
    background: #16a34a;
    color: #ffffff;
}

.che-btn-success:hover {
    background: #15803d;
}

.che-btn-danger {
    background: #dc2626;
    color: #ffffff;
}

.che-btn-danger:hover {
    background: #b91c1c;
}

.che-historial-mini {
    margin-top: 16px;
}

.che-historial-mini h4 {
    margin: 0 0 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

.che-table-compact th,
.che-table-compact td {
    padding: 5px 8px;
}

/* Responsive admin layout */
@media (max-width: 960px) {
    .che-admin-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .che-admin-col-form {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px dashed #e2e8f0;
        padding-bottom: 14px;
        margin-bottom: 14px;
    }
    .che-admin-col-list {
        padding-left: 0;
    }
    .che-admin-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .che-admin-panel-card {
        padding: 18px 14px 20px;
    }
    .che-admin-form .che-field-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .che-admin-search input[type="text"] {
        min-width: 0;
        width: 100%;
    }
}



/* Ajustes para resumen de empleado en fichaje PIN */

.che-empleado-resumen {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.che-empleado-resumen-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.che-empleado-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #e5e7eb;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.che-empleado-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.che-empleado-avatar--placeholder {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}

.che-empleado-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.che-empleado-estado {
    margin: 0;
    font-size: 0.85rem;
    color: #0f172a;
}

.che-empleado-hora {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 0.8rem;
    color: #64748b;
}

.che-hora-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

.che-hora-valor {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}

.che-estado-info-text {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

/* Responsive ajuste para móvil */
@media (max-width: 640px) {
    .che-empleado-resumen {
        flex-direction: column;
        align-items: flex-start;
    }
    .che-empleado-hora {
        align-items: flex-start;
    }
}



/* Campo modalidad y ayuda de geolocalización */

.che-field-modalidad {
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: #4b5563;
}

.che-field-modalidad > span {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.che-field-modalidad label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
    font-weight: 500;
    cursor: pointer;
}

.che-field-modalidad input[type="radio"] {
    transform: translateY(1px);
}

.che-geo-help {
    margin-top: 4px;
    font-size: 0.78rem;
    color: #6b7280;
}

/* Pausas en fichaje PIN */
.che-pausas-separator {
    height: 1px;
    background: #e2e8f0;
    margin: 14px 0 10px;
}

.che-pausas-container-pin {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.che-btn-pausa-pin {
    padding: 12px 16px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.che-btn-pausa-pin:hover {
    border-color: #2563eb;
    background: #f8fafc;
    transform: translateY(-2px);
    color: #1e293b;
}

.che-btn-pausa-justificada {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fed7aa;
    color: #92400e;
}

.che-btn-pausa-justificada:hover {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border-color: #fb923c;
    color: #92400e;
}

@media (max-width: 640px) {
    .che-pausas-container-pin {
        grid-template-columns: 1fr;
    }
    
    .che-btn-pausa-pin {
        font-size: 15px;
        padding: 14px 18px;
        color: #1e293b;
        font-weight: 600;
    }
    
    .che-date-input {
        font-size: 16px;
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
    }
    
    .che-btn-toggle-historial-pin {
        font-size: 15px;
        padding: 14px 20px;
        color: #1e293b;
    }
}

/* Botón toggle historial en PIN */
.che-btn-toggle-historial-pin {
    width: 100%;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.che-btn-toggle-historial-pin:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

.che-btn-toggle-historial-pin .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Mensajes para empleados */
.che-mensajes-empleado {
    margin-bottom: 20px;
}

.che-mensaje-item {
    display: flex;
    gap: 16px;
    padding: 18px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 2px solid;
    background: white;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.che-mensaje-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.che-mensaje-info {
    border-color: #2563eb;
    background: white;
}

.che-mensaje-info .che-mensaje-icono {
    color: #2563eb;
}

.che-mensaje-aviso {
    border-color: #f59e0b;
    background: white;
}

.che-mensaje-aviso .che-mensaje-icono {
    color: #f59e0b;
}

.che-mensaje-urgente {
    border-color: #dc2626;
    background: white;
}

.che-mensaje-urgente .che-mensaje-icono {
    color: #dc2626;
}

.che-mensaje-mantenimiento {
    border-color: #7c3aed;
    background: white;
}

.che-mensaje-mantenimiento .che-mensaje-icono {
    color: #7c3aed;
}

.che-mensaje-prioridad-alta {
    animation: pulse-priority-sutil 2s infinite;
}

@keyframes pulse-priority-sutil {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
    }
    50% {
        box-shadow: 0 6px 20px rgba(220, 38, 38, 0.25);
    }
}

.che-mensaje-icono {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
}

.che-mensaje-content {
    flex: 1;
    min-width: 0;
}

.che-mensaje-titulo {
    font-weight: 600;
    font-size: 16px;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.3;
}

.che-mensaje-texto {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    font-weight: 400;
}

/* Tabs de historial */
.che-historial-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--che-border);
}

.che-tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--che-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.che-tab-btn:hover {
    color: var(--che-primary);
}

.che-tab-btn.active {
    color: var(--che-primary);
    border-bottom-color: var(--che-primary);
}

/* Resumen de vacaciones */
.che-vacaciones-resumen {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    color: var(--che-dark);
    border: 2px solid #bbf7d0;
}

.che-vacaciones-resumen strong {
    font-size: 20px;
    color: #166534;
}

/* Badges de estado de vacaciones */
.che-badge-estado-pendiente {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 600;
}

.che-badge-estado-aprobado {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
}

.che-badge-estado-rechazado {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 12px;
    font-weight: 600;
}
