diff --git a/backend/app/repositories/access_repository.py b/backend/app/repositories/access_repository.py index 0039595..498f24f 100644 --- a/backend/app/repositories/access_repository.py +++ b/backend/app/repositories/access_repository.py @@ -442,7 +442,8 @@ class AccessRepository: COALESCE(d.Documento, '') AS Documento, pat.Valor AS Patente, lot.Valor AS LoteCodigo, - COALESCE(cch.Valor, '0') AS CacheoSalida + COALESCE(cch.Valor, '0') AS CacheoSalida, + (SELECT COUNT(*) FROM tckper WHERE TicketID = t.TicketID) AS CantidadOcupantes FROM tck t LEFT JOIN mdl m ON t.ModuloIngresoID = m.ModuloID LEFT JOIN tckper tp ON t.TicketID = tp.TicketID @@ -451,7 +452,7 @@ class AccessRepository: LEFT JOIN tckprx pat ON t.TicketID = pat.TicketID AND pat.PropiedadID = 4 LEFT JOIN tckprx lot ON t.TicketID = lot.TicketID AND lot.PropiedadID = 7 LEFT JOIN tckprx cch ON t.TicketID = cch.TicketID AND cch.PropiedadID = 6 - ORDER BY t.FechaHoraIngreso DESC + ORDER BY t.FechaHoraIngreso DESC, tp.RolID ASC """ with db_session() as conn: cursor = conn.cursor(as_dict=True) diff --git a/backend/app/services/access_service.py b/backend/app/services/access_service.py index 909a2bc..73ae847 100644 --- a/backend/app/services/access_service.py +++ b/backend/app/services/access_service.py @@ -282,7 +282,7 @@ class AccessService: lote_codigo=f.get("LoteCodigo"), modulo_ingreso=str(f.get("ModuloIngreso") or "Módulo Desconocido"), fecha_ingreso=f_ing_str, - ocupantes=1, + ocupantes=int(f.get("CantidadOcupantes") or 1), cacheo_salida=str(f.get("CacheoSalida") or "0") == "1", ) ) diff --git a/frontend/index.html b/frontend/index.html index 70a7a5a..503d92b 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -12,7 +12,8 @@ - + + OnEverControl — Puesto de Control diff --git a/frontend/public/apple-touch-icon.png b/frontend/public/apple-touch-icon.png new file mode 100644 index 0000000..a9715cc Binary files /dev/null and b/frontend/public/apple-touch-icon.png differ diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json index d360e08..f87de5c 100644 --- a/frontend/public/manifest.json +++ b/frontend/public/manifest.json @@ -1,12 +1,16 @@ { + "id": "/", "name": "OnEverControl — Puesto de Control", "short_name": "OnEverControl", - "description": "Cliente Web Reducido de Puesto de Control de Garita en Red Local", + "description": "Sistema Web de Puesto de Control de Garita y Control de Accesos", "start_url": "/", + "scope": "/", "display": "standalone", "orientation": "any", "background_color": "#0f172a", "theme_color": "#0284c7", + "prefer_related_applications": false, + "categories": ["business", "utilities"], "icons": [ { "src": "/favicon.ico", @@ -14,9 +18,22 @@ "type": "image/x-icon" }, { - "src": "/logo_mini.png", - "sizes": "192x192 512x512", - "type": "image/png" + "src": "/pwa-192x192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/pwa-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any" + }, + { + "src": "/pwa-maskable-512x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" } ] } diff --git a/frontend/public/pwa-192x192.png b/frontend/public/pwa-192x192.png new file mode 100644 index 0000000..e8fccf5 Binary files /dev/null and b/frontend/public/pwa-192x192.png differ diff --git a/frontend/public/pwa-512x512.png b/frontend/public/pwa-512x512.png new file mode 100644 index 0000000..cbb85fc Binary files /dev/null and b/frontend/public/pwa-512x512.png differ diff --git a/frontend/public/pwa-maskable-512x512.png b/frontend/public/pwa-maskable-512x512.png new file mode 100644 index 0000000..e4f26cb Binary files /dev/null and b/frontend/public/pwa-maskable-512x512.png differ diff --git a/frontend/public/sw.js b/frontend/public/sw.js index 468772d..147d26a 100644 --- a/frontend/public/sw.js +++ b/frontend/public/sw.js @@ -2,12 +2,16 @@ // Service Worker para OnEverControl PWA // Permite instalación en Android / Windows y aceleración de carga en red local // ============================================================================== -const CACHE_NAME = 'onevercontrol-v0.6.2'; +const CACHE_NAME = 'onevercontrol-v0.6.3'; const STATIC_ASSETS = [ '/', '/index.html', '/manifest.json', '/favicon.ico', + '/pwa-192x192.png', + '/pwa-512x512.png', + '/pwa-maskable-512x512.png', + '/apple-touch-icon.png', '/logo_mini.png', '/logo_os.png', '/icons/puesto-control.ico', diff --git a/frontend/src/components/modals/ExitVerificationModal.tsx b/frontend/src/components/modals/ExitVerificationModal.tsx index a869134..33790c0 100644 --- a/frontend/src/components/modals/ExitVerificationModal.tsx +++ b/frontend/src/components/modals/ExitVerificationModal.tsx @@ -39,31 +39,20 @@ export const ExitVerificationModal: React.FC = ({ setFeedback(null); try { const data = await accessApi.getTicketOccupants(ticket.ticket_id); - setOcupantesOriginales(data); - // Por defecto, el conductor titular siempre se incluye en los que egresan - const conductor = data.find((o) => o.rol_id === 1) || { - persona_id: ticket.persona_id, - documento: ticket.documento, - apellido: ticket.apellido, - nombre: ticket.nombre, - rol_id: 1, - es_menor: false, - rol_nombre: 'Conductor', - }; - setVerificados([conductor]); + // REGLA CLAVE DE ESCRITORIO (pct_view.py:2953): + // El conductor titular NUNCA es un acompañante. Se filtra estrictamente por RolID != 1 y PersonaID != ticket.persona_id + const soloAcompanantes = data.filter( + (o) => + o.rol_id !== 1 && + o.persona_id !== ticket.persona_id && + o.documento.trim() !== ticket.documento.trim() + ); + setOcupantesOriginales(soloAcompanantes); + // Por defecto sugerimos que todos los acompañantes que ingresaron egresan con el vehículo + setVerificados(soloAcompanantes); } catch { - // Fallback con el conductor titular del ticket - const conductor: TicketOccupant = { - persona_id: ticket.persona_id, - documento: ticket.documento, - apellido: ticket.apellido, - nombre: ticket.nombre, - rol_id: 1, - es_menor: false, - rol_nombre: 'Conductor', - }; - setOcupantesOriginales([conductor]); - setVerificados([conductor]); + setOcupantesOriginales([]); + setVerificados([]); } finally { setIsLoading(false); } @@ -78,38 +67,60 @@ export const ExitVerificationModal: React.FC = ({ if (!isOpen || !ticket) return null; const pidsVerificados = new Set(verificados.map((v) => v.persona_id)); - const ocupantesQuePermanecen = ocupantesOriginales.filter((o) => !pidsVerificados.has(o.persona_id)); + const docsVerificados = new Set(verificados.map((v) => v.documento.trim())); + const ocupantesQuePermanecen = ocupantesOriginales.filter( + (o) => !pidsVerificados.has(o.persona_id) && !docsVerificados.has(o.documento.trim()) + ); // Verificar persona por DNI (escaneado o tipeado) const handleVerifyDni = (rawDni: string) => { const cleanDni = rawDni.trim().replace(/[^0-9]/g, ''); if (!cleanDni) return; - // 1. Buscar entre los ocupantes originales del vehículo + // A. Si se escanea o tipea el DNI del Conductor Titular + if (cleanDni === ticket.documento.trim().replace(/[^0-9]/g, '')) { + setFeedback({ + text: `ℹ️ ${ticket.apellido}, ${ticket.nombre} es el Conductor Titular del vehículo (ya está autorizado a egresar).`, + type: 'info', + }); + setDniInput(''); + return; + } + + // B. Buscar entre los acompañantes originales del vehículo const encontradoOriginal = ocupantesOriginales.find( - (o) => o.documento.trim() === cleanDni || o.documento.includes(cleanDni) + (o) => o.documento.trim().replace(/[^0-9]/g, '') === cleanDni ); if (encontradoOriginal) { - if (pidsVerificados.has(encontradoOriginal.persona_id)) { - setFeedback({ text: `ℹ️ ${encontradoOriginal.apellido}, ${encontradoOriginal.nombre} ya fue verificado para salir.`, type: 'info' }); + if ( + pidsVerificados.has(encontradoOriginal.persona_id) || + docsVerificados.has(encontradoOriginal.documento.trim()) + ) { + setFeedback({ + text: `ℹ️ ${encontradoOriginal.apellido}, ${encontradoOriginal.nombre} ya fue verificado para salir.`, + type: 'info', + }); } else { setVerificados((prev) => [...prev, encontradoOriginal]); - setFeedback({ text: `✓ ${encontradoOriginal.apellido}, ${encontradoOriginal.nombre} verificado correctamente.`, type: 'success' }); + setFeedback({ + text: `✓ Acompañante ${encontradoOriginal.apellido}, ${encontradoOriginal.nombre} verificado correctamente.`, + type: 'success', + }); } setDniInput(''); return; } - // 2. Si no es original, verificar si ya está agregado como externo - const yaAgregado = verificados.find((v) => v.documento === cleanDni); + // C. Si no es original, verificar si ya está en la lista de egreso + const yaAgregado = verificados.find((v) => v.documento.trim().replace(/[^0-9]/g, '') === cleanDni); if (yaAgregado) { - setFeedback({ text: `ℹ️ DNI ${cleanDni} ya está en la lista de salida.`, type: 'info' }); + setFeedback({ text: `ℹ️ DNI ${cleanDni} ya está en la lista de acompañantes que salen.`, type: 'info' }); setDniInput(''); return; } - // 3. Agregar como acompañante externo que egresa en este vehículo + // D. Incorporar como acompañante externo que egresa en este vehículo const nuevoExt: TicketOccupant = { persona_id: 0, documento: cleanDni, @@ -120,50 +131,51 @@ export const ExitVerificationModal: React.FC = ({ rol_nombre: 'Externo / Peatón', }; setVerificados((prev) => [...prev, nuevoExt]); - setFeedback({ text: `✓ DNI ${cleanDni} incorporado a la salida del vehículo.`, type: 'success' }); + setFeedback({ text: `✓ DNI ${cleanDni} incorporado como acompañante a la salida del vehículo.`, type: 'success' }); setDniInput(''); }; const handleQuitarVerificado = (personaId: number, documento: string) => { - // No permitir quitar al conductor titular - const target = verificados.find((v) => v.persona_id === personaId && v.documento === documento); - if (target?.rol_id === 1) { - setFeedback({ text: '⚠️ No puede quitar al conductor titular de la salida.', type: 'warn' }); - return; - } - setVerificados((prev) => prev.filter((v) => !(v.persona_id === personaId && v.documento === documento))); - setFeedback({ text: 'Acompañante retirado de la salida. Permanecerá dentro del predio.', type: 'info' }); + setVerificados((prev) => + prev.filter((v) => !(v.persona_id === personaId && v.documento === documento)) + ); + setFeedback({ + text: 'Acompañante retirado de la salida. Permanecerá dentro del predio como peatón.', + type: 'warn', + }); }; const handleVerificarTodos = () => { setVerificados(ocupantesOriginales); - setFeedback({ text: '✓ Todos los ocupantes originales fueron marcados para salir.', type: 'success' }); + setFeedback({ text: '✓ Todos los acompañantes originales fueron marcados para salir.', type: 'success' }); }; const handleCameraScanSuccess = (data: DNIParsedResult) => { handleVerifyDni(data.documento); }; - // Confirmar la salida atómica definitiva + // Confirmar la salida definitiva const handleConfirmExit = async () => { if (!moduloSalidaId) { - setFeedback({ text: '⚠️ Debe seleccionar una barrera de salida.', type: 'warn' }); + setFeedback({ text: '⚠️ Debe seleccionar una barrera o módulo de salida.', type: 'warn' }); return; } setIsConfirming(true); try { - const pidsPermanecen = ocupantesQuePermanecen.map((o) => o.persona_id).filter((id) => id > 0); - const acompanantesDTO: Companion[] = verificados - .filter((v) => v.rol_id !== 1) - .map((v) => ({ - documento: v.documento, - apellido: v.apellido, - nombre: v.nombre, - sexo: 'M', - es_menor: v.es_menor, - rol_id: v.rol_id, - })); + const pidsPermanecen = ocupantesQuePermanecen + .map((o) => o.persona_id) + .filter((id) => id > 0); + + // Los acompañantes que salen son solo los de la lista verificados + const acompanantesDTO: Companion[] = verificados.map((v) => ({ + documento: v.documento, + apellido: v.apellido, + nombre: v.nombre, + sexo: 'M', + es_menor: v.es_menor, + rol_id: v.rol_id || 2, + })); const isConductor = Boolean(ticket.patente && ticket.patente.trim()); @@ -178,7 +190,12 @@ export const ExitVerificationModal: React.FC = ({ integrantes_verificados: acompanantesDTO, }); - let msg = `Salida registrada exitosamente para ${ticket.apellido} (${ticket.patente || 'Peatón'}) con ${verificados.length} ocupante(s).`; + let msg = `Salida registrada exitosamente para el conductor ${ticket.apellido} (${ticket.patente || 'Vehicular'})`; + if (verificados.length > 0) { + msg += ` con ${verificados.length} acompañante(s).`; + } else { + msg += ` (sin acompañantes).`; + } if (pidsPermanecen.length > 0) { msg += ` ${pidsPermanecen.length} acompañante(s) permanecen en el predio como peatones.`; } @@ -200,27 +217,27 @@ export const ExitVerificationModal: React.FC = ({ left: 0, right: 0, bottom: 0, - backgroundColor: 'rgba(2, 6, 23, 0.85)', - backdropFilter: 'blur(4px)', + backgroundColor: 'rgba(2, 6, 23, 0.82)', + backdropFilter: 'blur(5px)', zIndex: 9998, display: 'flex', alignItems: 'center', justifyContent: 'center', - padding: '1rem', + padding: '0.75rem', }} >
@@ -235,15 +252,14 @@ export const ExitVerificationModal: React.FC = ({ justifyContent: 'space-between', }} > -
+
🚗

- Verificación de Salida Vehicular e Integrantes + Verificación de Salida Vehicular y Acompañantes

- Ticket #{ticket.ticket_id} • Vehículo: {ticket.patente || 'Peatonal'} • Conductor:{' '} - {ticket.apellido}, {ticket.nombre} (DNI: {ticket.documento}) + Ticket #{ticket.ticket_id} • Destino: Lote {ticket.lote_codigo || 'S/D'} • Ingreso: {ticket.fecha_ingreso}
@@ -256,45 +272,120 @@ export const ExitVerificationModal: React.FC = ({
- {/* Alerta de Cacheo Obligatorio de Salida / Baúl (Requisito de Seguridad) */} + {/* ── 1. BANNER DESTACADO DEL CONDUCTOR TITULAR (EGRESA POR DEFINICIÓN) ── */} +
+
+
+ 🚗 +
+
+
+ Conductor Titular del Vehículo (Egresa) +
+
+ {ticket.apellido}, {ticket.nombre}{' '} + + (DNI: {ticket.documento}) + +
+
+
+ +
+
+
Patente
+
+ {ticket.patente || 'S/D'} +
+
+ + ✓ Conductor Autorizado + +
+
+ + {/* Alerta de Cacheo Obligatorio de Salida */} {ticket.cacheo_salida && (
- 🚨 + 🚨
- + CONTROL DE GUARDIA: CACHEO A LA SALIDA OBLIGATORIO -
+
Este vehículo tiene registrado cacheo obligatorio al egresar. Inspeccione el baúl y habitáculo antes de autorizar la apertura.
)} - {/* Input Rápido de DNI y Escáner Activo */} + {/* Input Rápido de DNI para Escaneo de Acompañantes */}
-
+
⚡ - - Lector de DNI / Documento Activo — Ingrese o escanee DNI de quienes están saliendo + + Verificación de Acompañantes por DNI / Escáner + + + (Escanee el documento o ingrese el DNI de cada persona que sale en el vehículo)
@@ -303,12 +394,13 @@ export const ExitVerificationModal: React.FC = ({ e.preventDefault(); handleVerifyDni(dniInput); }} + className="quick-dni-form" style={{ display: 'flex', gap: '0.5rem' }} > setDniInput(e.target.value)} autoFocus @@ -319,32 +411,34 @@ export const ExitVerificationModal: React.FC = ({ className="btn btn-secondary" onClick={() => setCameraOpen(true)} title="Escanear con cámara" - style={{ minHeight: '44px', padding: '0 1rem' }} + style={{ minHeight: '44px', padding: '0 0.85rem', whiteSpace: 'nowrap' }} > 📷 Cámara - + {ocupantesOriginales.length > 0 && ( + + )} {feedback && (
= ({ : feedback.type === 'error' ? 'var(--status-danger)' : 'var(--status-info)', + border: `1px solid ${ + feedback.type === 'success' + ? 'var(--status-success)' + : feedback.type === 'warn' + ? 'var(--status-warning)' + : feedback.type === 'error' + ? 'var(--status-danger)' + : 'var(--status-info)' + }`, }} > {feedback.text} @@ -371,8 +474,9 @@ export const ExitVerificationModal: React.FC = ({ )}
- {/* Paneles Duales: Ingresaron Originales vs Verificados para Salir */} + {/* Paneles Duales: Acompañantes que Ingresaron vs Verificados para Salir */}
= ({ overflowY: 'auto', }} > - {/* Panel Izquierdo: Originales */} + {/* Panel Izquierdo: Acompañantes Originales */}
-
-

- 📋 Ingresaron con este Vehículo ({ocupantesOriginales.length}) +
+

+ 📋 Acompañantes que Ingresaron ({ocupantesOriginales.length})

Quienes no verifiquen permanecerán adentro con ticket peatonal. @@ -404,14 +508,22 @@ export const ExitVerificationModal: React.FC = ({
{isLoading ? ( -
Cargando ocupantes...
+
Cargando datos...
+ ) : ocupantesOriginales.length === 0 ? ( +
+
ℹ️
+ Vehículo sin acompañantes registrados +
+ El conductor ingresó solo. Si viaja acompañado ahora, ingrese el DNI arriba. +
+
) : (
{ocupantesOriginales.map((oc, idx) => { - const isVerif = pidsVerificados.has(oc.persona_id); + const isVerif = pidsVerificados.has(oc.persona_id) || docsVerificados.has(oc.documento.trim()); return (
= ({ padding: '0.65rem 0.85rem', backgroundColor: 'var(--bg-surface)', borderRadius: '6px', - border: `1px solid ${isVerif ? 'var(--status-success)' : 'var(--border-subtle)'}`, + border: `1px solid ${isVerif ? 'var(--status-success)' : 'var(--border)'}`, }} >
-
+
{oc.apellido}, {oc.nombre || ''}{' '} (DNI: {oc.documento})
- - {oc.rol_id === 1 ? '🚗 Conductor Titular' : oc.es_menor ? '👶 Menor' : '👤 Acompañante'} + + {oc.es_menor ? '👶 Menor de Edad' : '👤 Acompañante'}
@@ -438,7 +550,7 @@ export const ExitVerificationModal: React.FC = ({ className={`badge ${isVerif ? 'badge-success' : 'badge-warning'}`} style={{ fontSize: '0.75rem' }} > - {isVerif ? '✅ Verificado' : '⏳ Permanece'} + {isVerif ? '✅ Sale' : '⏳ Permanece'}
); @@ -448,78 +560,83 @@ export const ExitVerificationModal: React.FC = ({
- {/* Panel Derecho: Verificados para Salir */} + {/* Panel Derecho: Acompañantes Verificados para Salir */}
-
+

- ✅ Personas Verificadas para Salir ({verificados.length}) + ✅ Acompañantes que Salen con el Vehículo ({verificados.length})

- Egresan en este vehículo al abrir la barrera. + Egresan junto al conductor titular al abrir la barrera.
-
- {verificados.map((v, idx) => ( -
-
-
- {v.apellido}, {v.nombre || ''}{' '} - - (DNI: {v.documento}) + {verificados.length === 0 ? ( +
+
🚗
+ Solo egresa el Conductor Titular +
+ No hay acompañantes verificados para este egreso vehicular. +
+
+ ) : ( +
+ {verificados.map((v, idx) => ( +
+
+
+ {v.apellido}, {v.nombre || ''}{' '} + + (DNI: {v.documento}) + +
+ + {v.rol_nombre || (v.es_menor ? 'Menor' : 'Acompañante')}
- - {v.rol_id === 1 ? '🚗 Conductor Titular' : v.rol_nombre || 'Acompañante'} - -
- {v.rol_id !== 1 ? ( - ) : ( - - Titular - - )} -
- ))} -
+
+ ))} +
+ )}
@@ -529,19 +646,24 @@ export const ExitVerificationModal: React.FC = ({ style={{ padding: '1rem 1.25rem', backgroundColor: 'var(--bg-surface)', - borderTop: '1px solid var(--border-subtle)', + borderTop: '1px solid var(--border)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', + flexWrap: 'wrap', + gap: '0.75rem', }} >
-
- Total que egresan: {verificados.length} persona(s) +
+ Total que egresan:{' '} + + 1 Conductor + {verificados.length} Acompañante(s) ({verificados.length + 1} personas) +
{ocupantesQuePermanecen.length > 0 && (
- ⚠️ {ocupantesQuePermanecen.length} acompañante(s) permanecerán en el predio como peatones. + ⚠️ {ocupantesQuePermanecen.length} acompañante(s) permanecerán en el predio con ticket peatonal.
)}
@@ -558,18 +680,18 @@ export const ExitVerificationModal: React.FC = ({ style={{ minHeight: '46px', fontWeight: 700, - padding: '0 1.75rem', + padding: '0 1.5rem', backgroundColor: 'var(--status-danger)', - color: '#fff', + color: '#ffffff', }} > {isConfirming - ? 'Procesando...' + ? 'Procesando egreso...' : Boolean(ticket?.patente && ticket.patente.trim()) - ? `🚗 Confirmar Salida y Abrir Barrera (${verificados.length})` + ? `🚗 Abrir Barrera y Confirmar Egreso (${verificados.length > 0 ? `Conductor + ${verificados.length}` : 'Solo Conductor'})` : esAccesoPeatonal - ? `🚶 Confirmar Salida (Habilitar Molinete/Puerta) (${verificados.length})` - : `🚶 Confirmar Salida Peatonal (${verificados.length})`} + ? `🚶 Habilitar Paso Peatonal` + : `🚶 Confirmar Salida Peatonal`}
diff --git a/frontend/src/styles/base.css b/frontend/src/styles/base.css index 8cda522..e09bf50 100644 --- a/frontend/src/styles/base.css +++ b/frontend/src/styles/base.css @@ -284,17 +284,27 @@ button:disabled, .btn:disabled, .touch-button:disabled { } /* ============================================================================== - ADAPTABILIDAD Y MULTIORIENTACIÓN (Tablets Samsung Galaxy Tab y Móviles) + ADAPTABILIDAD Y MULTIORIENTACIÓN (Móviles y Tablets Samsung Galaxy Tab A9/A11) ============================================================================== */ @media (max-width: 960px), (orientation: portrait) and (max-width: 1024px) { .cockpit-grid { display: flex !important; flex-direction: column !important; + width: 100% !important; + overflow-x: hidden !important; } .cockpit-entry-col { + width: 100% !important; max-width: 100% !important; + min-width: 0 !important; border-right: none !important; border-bottom: 1px solid var(--border-subtle) !important; + padding: 1rem !important; + } + .cockpit-predio-col { + width: 100% !important; + max-width: 100% !important; + min-width: 0 !important; } .portrait-tabs-bar { display: flex !important; @@ -302,6 +312,35 @@ button:disabled, .btn:disabled, .touch-button:disabled { .portrait-tab-hidden { display: none !important; } + + /* Modales en dispositivos móviles y tablets */ + .modal-dual-grid { + grid-template-columns: 1fr !important; + } + .modal-responsive-card { + max-width: 96vw !important; + max-height: 94vh !important; + } +} + +@media (max-width: 640px) { + .header-actions { + gap: 0.35rem !important; + } + .header-actions .btn { + min-height: 36px !important; + padding: 0 0.5rem !important; + font-size: 0.8rem !important; + } + .header-meta-info { + display: none !important; + } + .mobile-stack-grid { + grid-template-columns: 1fr !important; + } + .quick-dni-form { + flex-direction: column !important; + } } @media (min-width: 961px) and (orientation: landscape) { diff --git a/frontend/src/styles/tokens.css b/frontend/src/styles/tokens.css index dd74f04..49cd14d 100644 --- a/frontend/src/styles/tokens.css +++ b/frontend/src/styles/tokens.css @@ -1,18 +1,18 @@ /* ============================================================================== OnEver Design System - Tokens de Diseño Oficiales Fiel réplica de styles/design_system.py (OnEverDesignSystem) - Paleta Dark / Light, Tipografía 'Segoe UI' / 'Roboto', Bordes 10px + Paleta Dark / Light con Contrastes WCAG AA+ y Soporte Responsive ============================================================================== */ :root { - /* --- PALETA DARK (Por defecto) --- */ - --bg-main: #0F172A; - --bg-sidebar: #020617; - --text-1: #E0E6ED; - --text-2: #9CA3AF; - --text-3: #6B7280; - --border: #374151; - --divider: #1F2937; + /* --- PALETA DARK (Por defecto - Modo Nocturno Garita) --- */ + --bg-main: #0B1120; + --bg-sidebar: #1E293B; + --text-1: #F8FAFC; + --text-2: #CBD5E1; + --text-3: #94A3B8; + --border: #334155; + --divider: #1E293B; --blue-base: #2563EB; --blue-hover: #3B82F6; --success: #10B981; @@ -21,19 +21,19 @@ --warning: #F59E0B; --selection-bg: #2563EB; --selection-text: #FFFFFF; - --hover-bg: #23283E; - --input-bg: #1E293B; + --hover-bg: #1E293B; + --input-bg: #0F172A; --btn-text: #FFFFFF; --sidebar-icon: #FFFFFF; /* Aliases Semánticos de Compatibilidad */ --bg-app: var(--bg-main); --bg-surface: var(--bg-sidebar); - --bg-surface-elevated: var(--input-bg); - --bg-surface-highlight: var(--hover-bg); + --bg-surface-elevated: #334155; + --bg-surface-highlight: #273549; - --border-subtle: var(--divider); - --border-strong: var(--border); + --border-subtle: #1E293B; + --border-strong: #475569; --text-primary: var(--text-1); --text-secondary: var(--text-2); @@ -42,22 +42,26 @@ --brand-primary: var(--blue-base); --color-primary: var(--blue-base); --color-primary-hover: var(--blue-hover); + --accent: #38BDF8; + --accent-primary: var(--blue-base); --color-success: var(--success); - --status-success: var(--success); - --color-success-bg: rgba(16, 185, 129, 0.15); + --status-success: #34D399; + --status-success-bg: rgba(16, 185, 129, 0.18); + --color-success-bg: var(--status-success-bg); --color-danger: var(--danger); - --status-danger: var(--danger); - --color-danger-bg: rgba(239, 68, 68, 0.15); + --status-danger: #F87171; + --status-danger-bg: rgba(239, 68, 68, 0.2); + --color-danger-bg: var(--status-danger-bg); --color-warning: var(--warning); - --status-warning: var(--warning); - --status-warning-bg: rgba(245, 158, 11, 0.15); + --status-warning: #FBBF24; + --status-warning-bg: rgba(245, 158, 11, 0.2); --color-info: #38BDF8; --status-info: #38BDF8; - --status-info-bg: rgba(56, 189, 248, 0.15); + --status-info-bg: rgba(56, 189, 248, 0.18); /* Touch Targets y Ergonomía */ --touch-min-size: 48px; @@ -77,40 +81,40 @@ --font-size-2xl: 1.5rem; /* Sombras */ - --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35); - --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.45); - --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5); + --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4); + --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5); + --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.6); } -/* --- PALETA LIGHT (OnEverDesignSystem Light) --- */ +/* --- PALETA LIGHT (OnEverDesignSystem Light - Alto Contraste y Nitidez) --- */ [data-theme="light"] { - --bg-main: #FFFFFF; - --bg-sidebar: #F4F5F6; - --text-1: #212327; - --text-2: #50565E; - --text-3: #808893; - --border: #DEE0E3; - --divider: #EFEFF0; - --blue-base: #006FFF; - --blue-hover: #338BFF; - --success: #38CC65; - --danger: #F0383B; - --danger-hover: #FF7B80; - --warning: #F5A524; - --selection-bg: #EBEFFF; - --selection-text: #006FFF; - --hover-bg: #F3F4F6; + --bg-main: #F1F5F9; + --bg-sidebar: #FFFFFF; + --text-1: #0F172A; + --text-2: #334155; + --text-3: #64748B; + --border: #CBD5E1; + --divider: #E2E8F0; + --blue-base: #0284C7; + --blue-hover: #0369A1; + --success: #16A34A; + --danger: #DC2626; + --danger-hover: #B91C1C; + --warning: #B45309; + --selection-bg: #E0F2FE; + --selection-text: #0369A1; + --hover-bg: #E2E8F0; --input-bg: #FFFFFF; --btn-text: #FFFFFF; - --sidebar-icon: #374151; + --sidebar-icon: #334155; --bg-app: var(--bg-main); --bg-surface: var(--bg-sidebar); - --bg-surface-elevated: var(--input-bg); - --bg-surface-highlight: var(--hover-bg); + --bg-surface-elevated: #F8FAFC; + --bg-surface-highlight: #E2E8F0; - --border-subtle: var(--divider); - --border-strong: var(--border); + --border-subtle: #E2E8F0; + --border-strong: #94A3B8; --text-primary: var(--text-1); --text-secondary: var(--text-2); @@ -119,24 +123,28 @@ --brand-primary: var(--blue-base); --color-primary: var(--blue-base); --color-primary-hover: var(--blue-hover); + --accent: #0284C7; + --accent-primary: var(--blue-base); --color-success: var(--success); - --status-success: var(--success); - --color-success-bg: rgba(56, 204, 101, 0.15); + --status-success: #15803D; + --status-success-bg: rgba(22, 163, 74, 0.12); + --color-success-bg: var(--status-success-bg); --color-danger: var(--danger); - --status-danger: var(--danger); - --color-danger-bg: rgba(240, 56, 59, 0.15); + --status-danger: #B91C1C; + --status-danger-bg: rgba(220, 38, 38, 0.12); + --color-danger-bg: var(--status-danger-bg); --color-warning: var(--warning); - --status-warning: var(--warning); - --status-warning-bg: rgba(245, 165, 36, 0.15); + --status-warning: #B45309; + --status-warning-bg: rgba(217, 119, 6, 0.14); - --color-info: #0284C7; - --status-info: #0284C7; - --status-info-bg: rgba(2, 132, 199, 0.15); + --color-info: #0369A1; + --status-info: #0369A1; + --status-info-bg: rgba(2, 132, 199, 0.12); - --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08); - --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1); - --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.12); + --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08); + --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1); + --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.12); } diff --git a/frontend/src/views/ControlPostView.tsx b/frontend/src/views/ControlPostView.tsx index 6c5dfcc..abd279b 100644 --- a/frontend/src/views/ControlPostView.tsx +++ b/frontend/src/views/ControlPostView.tsx @@ -600,8 +600,8 @@ export const ControlPostView: React.FC = () => {
{/* Acciones de Operador */} -
- +
+ 👤 Operador: {user?.username} @@ -706,14 +706,14 @@ export const ControlPostView: React.FC = () => {
)} - {/* Barra de pestañas responsive para tablets en modo vertical */} + {/* Barra de pestañas responsive para tablets en modo vertical y móviles */}
@@ -722,14 +722,19 @@ export const ControlPostView: React.FC = () => { onClick={() => setPortraitTab('entry')} style={{ flex: 1, - padding: '0.6rem', - border: 'none', - borderRadius: '6px', - backgroundColor: portraitTab === 'entry' ? 'var(--accent-primary)' : 'transparent', - color: portraitTab === 'entry' ? '#fff' : 'var(--text-secondary)', + padding: '0.65rem', + border: portraitTab === 'entry' ? '1px solid var(--brand-primary)' : '1px solid var(--border)', + borderRadius: '8px', + backgroundColor: portraitTab === 'entry' ? 'var(--brand-primary)' : 'var(--bg-app)', + color: portraitTab === 'entry' ? '#ffffff' : 'var(--text-primary)', fontWeight: 700, cursor: 'pointer', fontSize: '0.9rem', + minHeight: '44px', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + gap: '0.4rem', }} > 🚗 Registrar Ingreso @@ -739,14 +744,19 @@ export const ControlPostView: React.FC = () => { onClick={() => setPortraitTab('predio')} style={{ flex: 1, - padding: '0.6rem', - border: 'none', - borderRadius: '6px', - backgroundColor: portraitTab === 'predio' ? 'var(--accent-primary)' : 'transparent', - color: portraitTab === 'predio' ? '#fff' : 'var(--text-secondary)', + padding: '0.65rem', + border: portraitTab === 'predio' ? '1px solid var(--brand-primary)' : '1px solid var(--border)', + borderRadius: '8px', + backgroundColor: portraitTab === 'predio' ? 'var(--brand-primary)' : 'var(--bg-app)', + color: portraitTab === 'predio' ? '#ffffff' : 'var(--text-primary)', fontWeight: 700, cursor: 'pointer', fontSize: '0.9rem', + minHeight: '44px', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + gap: '0.4rem', }} > 📋 En Predio ({activeTickets.length}) @@ -1675,7 +1685,7 @@ export const ControlPostView: React.FC = () => { COLUMNA 2: TICKETS ACTIVOS Y EGRESOS DEL PREDIO ======================================================================= */}
{ backgroundColor: 'var(--bg-surface)', borderRadius: 'var(--radius-md)', boxShadow: 'var(--shadow-sm)', - border: '1px solid var(--border-subtle)', + border: '1px solid var(--border)', + flexWrap: 'wrap', + gap: '0.75rem', }} > -
+
{ fontSize: '1.1rem', minWidth: '95px', textAlign: 'center', + border: `1px solid ${t.patente ? 'var(--status-info)' : 'var(--status-warning)'}`, }} > {t.patente || 'PEATÓN'}
-
+
{t.apellido}, {t.nombre}{' '} - + (DNI: {t.documento})
-
- Destino: Lote {t.lote_codigo || 'S/D'} • Ingreso:{' '} - {t.fecha_ingreso} ({t.modulo_ingreso}) +
+ + Destino: Lote {t.lote_codigo || 'S/D'} • Ingreso: {t.fecha_ingreso} ({t.modulo_ingreso}) + + {t.ocupantes > 1 && ( + + 👥 {t.ocupantes} personas + + )} {t.cacheo_salida && ( {