/* Asistencia (Anti-Fraude) - kiosco control de asistencia. Cargado como ir.attachment. v3.0 */
/* Reset */
                * { margin: 0; padding: 0; box-sizing: border-box; }
                
                body {
                    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
                    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
                    min-height: 100vh;
                    color: #fff;
                    overflow-x: hidden;
                }
                
                .kiosk-container { min-height: 100vh; display: flex; flex-direction: column; }
                #kioskContent { flex: 1; display: flex; flex-direction: column; }
                
                .kiosk-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.1); }
                .proyecto-info { display: flex; align-items: center; gap: 15px; }
                .proyecto-logo { width: 50px; height: 50px; border-radius: 12px; background: linear-gradient(135deg, #f59e0b, #d97706); display: flex; align-items: center; justify-content: center; font-size: 24px; }
                .proyecto-codigo { font-size: 12px; color: #fbbf24; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
                .proyecto-nombre { font-size: 18px; font-weight: 600; }
                .seguridad-badge { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(34,197,94,0.2); border-radius: 20px; font-size: 11px; color: #4ade80; }
                .seguridad-badge svg { width: 14px; height: 14px; }
                .fecha-hora { text-align: right; }
                .fecha { font-size: 13px; color: rgba(255,255,255,0.6); text-transform: capitalize; }
                .hora { font-size: 32px; font-weight: 300; font-family: monospace; }
                
                .kiosk-stats { display: flex; justify-content: center; gap: 15px; padding: 20px; background: rgba(0,0,0,0.2); }
                .stat-card { background: rgba(255,255,255,0.08); border-radius: 12px; padding: 15px 30px; text-align: center; min-width: 120px; }
                .stat-en-obra { border-left: 3px solid #4ade80; }
                .stat-salida { border-left: 3px solid #60a5fa; }
                .stat-total { border-left: 3px solid #fbbf24; }
                .stat-numero { font-size: 36px; font-weight: 700; }
                .stat-en-obra .stat-numero { color: #4ade80; }
                .stat-salida .stat-numero { color: #60a5fa; }
                .stat-total .stat-numero { color: #fbbf24; }
                .stat-label { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 6px; text-transform: uppercase; }
                
                .kiosk-main { flex: 1; display: flex; justify-content: center; align-items: center; padding: 30px; }
                .identificacion-area { width: 100%; max-width: 450px; }
                
                .scan-icon { display: flex; flex-direction: column; align-items: center; padding: 50px; background: rgba(255,255,255,0.03); border: 2px dashed rgba(255,255,255,0.2); border-radius: 20px; cursor: pointer; transition: all 0.3s; }
                .scan-icon:hover { background: rgba(255,255,255,0.08); border-color: #4ade80; }
                .scan-icon svg { color: rgba(255,255,255,0.5); margin-bottom: 15px; animation: pulse 2s infinite; }
                @keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
                .scan-text { font-size: 18px; color: rgba(255,255,255,0.7); }
                .scan-subtext { font-size: 13px; color: rgba(255,255,255,0.4); margin-top: 8px; }
                
                .busqueda-container { background: rgba(255,255,255,0.08); border-radius: 20px; padding: 25px; }
                .busqueda-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
                .busqueda-header h3 { font-size: 18px; }
                .btn-cerrar { width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(255,255,255,0.1); color: white; font-size: 20px; cursor: pointer; }
                .input-busqueda { width: 100%; padding: 14px 18px; font-size: 16px; border: 2px solid rgba(255,255,255,0.15); border-radius: 12px; background: rgba(0,0,0,0.3); color: white; outline: none; }
                .input-busqueda:focus { border-color: #4ade80; }
                .input-busqueda::placeholder { color: rgba(255,255,255,0.4); }
                .resultados-busqueda { margin-top: 15px; max-height: 350px; overflow-y: auto; }
                .busqueda-hint { text-align: center; padding: 25px; color: rgba(255,255,255,0.4); }
                
                .resultado-empleado { display: flex; align-items: center; padding: 12px; background: rgba(255,255,255,0.05); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
                .resultado-empleado:hover { background: rgba(255,255,255,0.12); transform: translateX(4px); }
                .resultado-empleado.estado-en-obra { border-left: 3px solid #4ade80; }
                .resultado-empleado.estado-salida { border-left: 3px solid #60a5fa; }
                .empleado-avatar { width: 45px; height: 45px; border-radius: 50%; overflow: hidden; margin-right: 12px; }
                .empleado-avatar img { width: 100%; height: 100%; object-fit: cover; }
                .avatar-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; }
                .empleado-info { flex: 1; }
                .empleado-nombre { font-size: 15px; font-weight: 600; }
                .empleado-cargo { font-size: 12px; color: rgba(255,255,255,0.5); }
                .empleado-estado { font-size: 11px; color: #4ade80; margin-top: 3px; }
                .empleado-arrow { color: rgba(255,255,255,0.3); }
                
                .pantalla-verificacion { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(135deg, #1e3a5f, #0f172a); }
                .verificacion-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.2); }
                .btn-volver { padding: 10px 20px; background: rgba(255,255,255,0.1); border: none; border-radius: 8px; color: white; cursor: pointer; }
                .verificacion-steps { display: flex; gap: 8px; }
                .step-indicator { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.2); }
                .step-indicator.active, .step-indicator.completed { background: #4ade80; }
                .step-indicator.active { transform: scale(1.2); }
                .verificacion-content { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; }
                
                .empleado-card { background: rgba(255,255,255,0.05); border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 30px; border: 1px solid rgba(255,255,255,0.1); }
                .empleado-card-foto { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 15px; overflow: hidden; border: 3px solid rgba(255,255,255,0.2); }
                .empleado-card-foto img { width: 100%; height: 100%; object-fit: cover; }
                .empleado-card-nombre { font-size: 20px; font-weight: 600; }
                .empleado-card-cargo { font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 4px; }
                .empleado-card-proyecto { display: inline-block; margin-top: 12px; padding: 6px 14px; background: rgba(251,191,36,0.2); border-radius: 20px; font-size: 12px; color: #fbbf24; }
                
                .camera-container { width: 100%; max-width: 350px; }
                .camera-title { text-align: center; margin-bottom: 20px; }
                .camera-title h3 { font-size: 22px; margin-bottom: 8px; }
                .camera-title p { font-size: 14px; color: rgba(255,255,255,0.6); }
                .camera-frame { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: 50%; overflow: hidden; border: 4px solid rgba(255,255,255,0.3); box-shadow: 0 0 0 8px rgba(74,222,128,0.2); }
                .camera-frame video, .camera-frame img { width: 100%; height: 100%; object-fit: cover; }
                .camera-frame.capturing { animation: flash 0.3s; }
                @keyframes flash { 50% { box-shadow: 0 0 0 20px rgba(255,255,255,0.8); } }
                .camera-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.7); }
                .camera-overlay.hidden { display: none; }
                .camera-instructions { text-align: center; margin-top: 20px; font-size: 14px; color: rgba(255,255,255,0.6); }
                .camera-instructions svg { display: block; margin: 0 auto 10px; color: #4ade80; }
                .btn-capture { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 280px; margin: 25px auto 0; padding: 16px; border: none; border-radius: 14px; font-size: 18px; font-weight: 600; cursor: pointer; }
                .btn-capture-foto { background: linear-gradient(135deg, #4ade80, #22c55e); color: white; box-shadow: 0 8px 30px rgba(74,222,128,0.4); }
                .btn-capture:disabled { opacity: 0.5; cursor: not-allowed; }
                
                .pin-container { text-align: center; max-width: 300px; }
                .pin-title h3 { font-size: 22px; margin-bottom: 8px; }
                .pin-title p { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 25px; }
                .pin-display { display: flex; justify-content: center; gap: 12px; margin-bottom: 25px; }
                .pin-digit { width: 50px; height: 60px; border-radius: 12px; background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 600; }
                .pin-digit.filled { background: rgba(74,222,128,0.2); border-color: #4ade80; }
                .pin-digit.error { background: rgba(239,68,68,0.2); border-color: #ef4444; animation: shake 0.3s; }
                @keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
                .pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 240px; margin: 0 auto; }
                .pin-key { height: 60px; border-radius: 12px; border: none; background: rgba(255,255,255,0.1); color: white; font-size: 24px; cursor: pointer; }
                .pin-key:active { transform: scale(0.95); }
                .pin-key.delete { background: rgba(239,68,68,0.2); }
                .pin-skip { margin-top: 20px; padding: 12px 24px; background: transparent; border: 1px solid rgba(255,255,255,0.2); border-radius: 10px; color: rgba(255,255,255,0.6); cursor: pointer; }
                
                .confirmacion-container { text-align: center; max-width: 400px; }
                .confirmacion-icon { width: 100px; height: 100px; border-radius: 50%; background: linear-gradient(135deg, #4ade80, #22c55e); display: flex; align-items: center; justify-content: center; margin: 0 auto 25px; box-shadow: 0 10px 40px rgba(74,222,128,0.4); }
                .confirmacion-icon svg { width: 50px; height: 50px; color: white; }
                .confirmacion-icon.salida { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 10px 40px rgba(245,158,11,0.4); }
                .confirmacion-titulo { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
                .confirmacion-mensaje { font-size: 16px; color: rgba(255,255,255,0.7); margin-bottom: 30px; }
                .confirmacion-detalles { background: rgba(255,255,255,0.05); border-radius: 16px; padding: 20px; text-align: left; }
                .detalle-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
                .detalle-row:last-child { border-bottom: none; }
                .detalle-label { color: rgba(255,255,255,0.5); font-size: 14px; }
                .detalle-valor { font-weight: 600; font-size: 14px; }
                .verificacion-badges { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
                .verificacion-badge { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 20px; font-size: 12px; }
                .verificacion-badge.success { background: rgba(74,222,128,0.2); color: #4ade80; }
                .verificacion-badge svg { width: 14px; height: 14px; }
                .btn-confirmar-registro { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 320px; margin: 30px auto 0; padding: 18px; border: none; border-radius: 14px; font-size: 18px; font-weight: 700; cursor: pointer; text-transform: uppercase; }
                .btn-entrada { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; box-shadow: 0 10px 40px rgba(34,197,94,0.4); }
                .btn-salida { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; box-shadow: 0 10px 40px rgba(245,158,11,0.4); }
                .btn-confirmar-registro:disabled { opacity: 0.6; cursor: not-allowed; }
                
                .pantalla-exito { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 30px; text-align: center; }
                .pantalla-exito.entrada { background: linear-gradient(135deg, #065f46, #064e3b); }
                .pantalla-exito.salida { background: linear-gradient(135deg, #78350f, #451a03); }
                .exito-animation { width: 150px; height: 150px; margin-bottom: 30px; }
                .exito-animation svg { width: 100%; height: 100%; animation: pop 0.5s; }
                @keyframes pop { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
                .exito-titulo { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
                .exito-nombre { font-size: 24px; color: rgba(255,255,255,0.9); }
                .exito-hora { font-size: 48px; font-weight: 300; font-family: monospace; margin: 20px 0; }
                .exito-proyecto { font-size: 16px; color: rgba(255,255,255,0.7); }
                .exito-resumen { background: rgba(0,0,0,0.2); border-radius: 16px; padding: 20px 30px; margin-top: 30px; }
                .exito-resumen-titulo { font-size: 14px; color: rgba(255,255,255,0.5); margin-bottom: 10px; }
                .exito-resumen-horas { font-size: 36px; font-weight: 700; color: #4ade80; }
                
                .pantalla-personal { min-height: 100vh; padding: 20px; }
                .personal-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
                .personal-header h2 { flex: 1; font-size: 22px; }
                .personal-contador { text-align: center; padding: 30px; background: rgba(255,255,255,0.05); border-radius: 16px; margin-bottom: 25px; }
                .contador-numero { display: block; font-size: 64px; font-weight: 700; color: #4ade80; }
                .contador-texto { font-size: 16px; color: rgba(255,255,255,0.6); }
                .personal-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
                .personal-item { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.05); border-radius: 12px; padding: 15px; border-left: 3px solid #4ade80; }
                .personal-item-foto { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; }
                .personal-item-foto img { width: 100%; height: 100%; object-fit: cover; }
                .personal-item-nombre { font-size: 14px; font-weight: 600; }
                .personal-item-hora { font-size: 12px; color: rgba(255,255,255,0.5); }
                
                .kiosk-footer { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px; background: rgba(0,0,0,0.3); }
                .btn-ver-personal { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; color: white; cursor: pointer; }
                .footer-info { display: flex; align-items: center; gap: 15px; font-size: 11px; color: rgba(255,255,255,0.4); }
                .gps-status { display: flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 12px; background: rgba(74,222,128,0.1); color: #4ade80; }
                .gps-status.error { background: rgba(239,68,68,0.1); color: #ef4444; }
                .gps-status svg { width: 12px; height: 12px; }
                
                .toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
                .toast { padding: 14px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; margin-bottom: 10px; transform: translateX(120%); transition: transform 0.3s; }
                .toast-show { transform: translateX(0); }
                .toast-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
                .toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
                .toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
                
                .pantalla-cargando { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; }
                .spinner-grande { width: 50px; height: 50px; border: 3px solid rgba(255,255,255,0.1); border-top-color: #4ade80; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
                @keyframes spin { to { transform: rotate(360deg); } }
                .spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; }
                
                .pantalla-error { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; text-align: center; padding: 40px; }
                .pantalla-error svg { color: #ef4444; margin-bottom: 20px; }
                .pantalla-error h2 { font-size: 24px; margin-bottom: 12px; }
                .pantalla-error p { color: rgba(255,255,255,0.6); }
                .error-ayuda { margin-top: 30px; padding: 20px; background: rgba(255,255,255,0.05); border-radius: 12px; }
                .error-ayuda code { display: block; margin-top: 10px; padding: 10px; background: rgba(0,0,0,0.3); border-radius: 6px; color: #fbbf24; }
                
                @media (max-width: 768px) {
                    .kiosk-header { flex-direction: column; gap: 15px; text-align: center; }
                    .proyecto-info { justify-content: center; }
                    .fecha-hora { text-align: center; }
                    .kiosk-stats { flex-wrap: wrap; }
                    .stat-card { flex: 1; min-width: 90px; padding: 12px 15px; }
                    .stat-numero { font-size: 28px; }
                    .camera-frame { width: 240px; height: 240px; }
                }
