/* ==========================================================
   ALEPH — UX/UI PRODUCT LAYER v14
   Mejora jerarquía visual, operación diaria, voz y accesos.
   No altera reglas dosimétricas ni criterios regulatorios.
   ========================================================== */
:root{
  --ux-navy:#0b1730;
  --ux-blue:#2563eb;
  --ux-cyan:#0891b2;
  --ux-green:#10b981;
  --ux-surface:#ffffff;
  --ux-soft:#f8fafc;
  --ux-line:#dbe3ee;
}

/* Cabecera / navegación */
.bio-portal #view-dashboard>header{background:linear-gradient(115deg,#0b1730 0%,#0f2747 58%,#0b3a4b 100%)}
.ux-icon-btn{position:relative;width:38px;height:38px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.08);transition:.18s ease}
.ux-icon-btn:hover{background:rgba(255,255,255,.16);transform:translateY(-1px)}
.ux-notification-badge{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#ef4444;color:#fff;border:2px solid #0f2747;font-size:9px;font-weight:900;display:flex;align-items:center;justify-content:center}
.ux-notification-menu{position:absolute;right:0;top:46px;width:min(360px,calc(100vw - 24px));background:#fff;color:#0f172a;border:1px solid #dbe3ee;border-radius:16px;box-shadow:0 24px 65px rgba(15,23,42,.22);overflow:hidden;z-index:80}
.ux-notification-item{width:100%;display:flex;gap:11px;align-items:flex-start;padding:11px 13px;text-align:left;border-top:1px solid #eef2f7;transition:.15s ease}
.ux-notification-item:hover{background:#f8fafc}
.ux-notification-item:first-child{border-top:0}
.ux-notification-icon{width:32px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex:none}

/* Inicio / resumen individual */
.ux-worker-home{position:relative;overflow:hidden;background:linear-gradient(130deg,#0b1730 0%,#113b62 56%,#0b6b72 100%);border-radius:20px;color:#fff;box-shadow:0 18px 45px rgba(15,23,42,.16);padding:22px;margin-bottom:16px}
.ux-worker-home::after{content:"";position:absolute;width:280px;height:280px;border-radius:50%;right:-90px;top:-150px;background:radial-gradient(circle,rgba(52,211,153,.30),rgba(52,211,153,0) 68%);pointer-events:none}
.ux-worker-home-grid{display:grid;grid-template-columns:minmax(0,1.3fr) repeat(3,minmax(130px,.7fr));gap:12px;align-items:stretch;position:relative;z-index:1}
.ux-worker-home-intro{padding:3px 8px 3px 0;display:flex;flex-direction:column;justify-content:center}
.ux-worker-kicker{display:inline-flex;align-items:center;gap:7px;font-size:9px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#a7f3d0}
.ux-worker-title{font-size:1.25rem;font-weight:900;line-height:1.15;margin-top:8px;letter-spacing:-.02em}
.ux-worker-explanation{font-size:11px;color:#dbeafe;line-height:1.55;margin-top:8px;max-width:520px}
.ux-worker-metric{background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.14);border-radius:15px;padding:13px;backdrop-filter:blur(5px)}
.ux-worker-metric-label{font-size:9px;color:#cbd5e1;text-transform:uppercase;font-weight:800;letter-spacing:.04em}
.ux-worker-metric-value{font-size:1.2rem;font-weight:900;margin-top:6px;line-height:1.15}
.ux-worker-metric-sub{font-size:9px;color:#bfdbfe;margin-top:5px;line-height:1.35}
.ux-worker-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:13px}
.ux-worker-action{min-height:38px;padding:0 12px;border-radius:10px;font-size:10px;font-weight:800;display:inline-flex;align-items:center;gap:7px;transition:.16s ease;border:1px solid rgba(255,255,255,.2)}
.ux-worker-action-primary{background:#fff;color:#0f3f86}.ux-worker-action-primary:hover{background:#eff6ff}
.ux-worker-action-secondary{background:rgba(255,255,255,.08);color:#fff}.ux-worker-action-secondary:hover{background:rgba(255,255,255,.16)}

/* Barra de acciones del responsable */
.ux-admin-link{background:#eff6ff!important;color:#1d4ed8!important;border:1px solid #bfdbfe!important}
.ux-admin-link:hover{background:#dbeafe!important}

/* Voz: estado inequívoco */
.ux-voice-state{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid #dbe3ee;background:linear-gradient(90deg,#f8fafc,#f0fdf4);min-height:42px}
.ux-voice-state[data-state="idle"]{display:none}
.ux-voice-state[data-state="listening"]{background:linear-gradient(90deg,#ecfdf5,#f0fdfa)}
.ux-voice-state[data-state="busy"]{background:linear-gradient(90deg,#fffbeb,#fff7ed)}
.ux-voice-state[data-state="speaking"]{background:linear-gradient(90deg,#eff6ff,#eef2ff)}
.ux-voice-wave{display:flex;align-items:center;gap:2px;height:20px;width:30px;justify-content:center}
.ux-voice-wave i{width:3px;height:7px;background:#10b981;border-radius:999px;display:block;transform-origin:center}
.ux-voice-state[data-state="listening"] .ux-voice-wave i,.ux-voice-state[data-state="speaking"] .ux-voice-wave i{animation:uxWave .8s ease-in-out infinite alternate}
.ux-voice-state[data-state="listening"] .ux-voice-wave i:nth-child(2),.ux-voice-state[data-state="speaking"] .ux-voice-wave i:nth-child(2){animation-delay:.12s}.ux-voice-state[data-state="listening"] .ux-voice-wave i:nth-child(3),.ux-voice-state[data-state="speaking"] .ux-voice-wave i:nth-child(3){animation-delay:.24s}.ux-voice-state[data-state="listening"] .ux-voice-wave i:nth-child(4),.ux-voice-state[data-state="speaking"] .ux-voice-wave i:nth-child(4){animation-delay:.36s}
.ux-voice-state[data-state="busy"] .ux-voice-wave i{background:#f59e0b;animation:uxPulse .9s ease-in-out infinite}
.ux-voice-state[data-state="speaking"] .ux-voice-wave i{background:#2563eb}
.ux-voice-state-copy strong{display:block;font-size:10px;color:#0f172a}.ux-voice-state-copy span{display:block;font-size:9px;color:#64748b;margin-top:1px}
@keyframes uxWave{from{transform:scaleY(.6)}to{transform:scaleY(2.1)}}@keyframes uxPulse{0%,100%{opacity:.45}50%{opacity:1}}

/* Confirmación de datos críticos detectados por voz */
.ux-critical-review{border:1px solid #bae6fd;background:#f0f9ff;border-radius:12px;padding:10px;color:#0f172a;box-shadow:0 4px 12px rgba(2,132,199,.07)}
.ux-critical-chip{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:#e0f2fe;color:#075985;border:1px solid #bae6fd;font-size:10px;font-weight:900;margin:3px 4px 0 0}
.ux-critical-actions{display:flex;gap:6px;margin-top:9px}.ux-critical-actions button{min-height:32px;padding:0 10px;border-radius:8px;font-size:9px;font-weight:800}

/* Mejoras de jerarquía de ficha */
.bio-portal #panel-trabajador>.bio-panel{box-shadow:0 12px 35px rgba(15,23,42,.06)}
.bio-portal #semaphore-bar-container .bio-gradient-annual{box-shadow:inset 0 1px 2px rgba(15,23,42,.12)}

/* Estado del sistema en admin */
.ux-system-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.ux-system-card{border:1px solid #dbe3ee;border-radius:14px;padding:12px;background:#fff}
.ux-system-card .dot{width:9px;height:9px;border-radius:999px;display:inline-block;margin-right:6px}.ux-system-card[data-ok="1"] .dot{background:#10b981;box-shadow:0 0 0 4px rgba(16,185,129,.1)}.ux-system-card[data-ok="0"] .dot{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.1)}

@media (max-width:1023px){.ux-worker-home-grid{grid-template-columns:1fr 1fr}.ux-worker-home-intro{grid-column:1/-1}.ux-system-grid{grid-template-columns:1fr 1fr}}
@media (max-width:767px){
  .ux-worker-home{padding:15px;border-radius:15px;margin-bottom:12px}
  .ux-worker-home-grid{grid-template-columns:1fr 1fr;gap:8px}
  .ux-worker-home-intro{padding:0;grid-column:1/-1}
  .ux-worker-title{font-size:1rem}.ux-worker-explanation{font-size:10px}
  .ux-worker-metric{padding:10px;border-radius:12px}.ux-worker-metric-value{font-size:1rem}
  .ux-worker-actions{display:grid;grid-template-columns:1fr 1fr}.ux-worker-action{justify-content:center;padding:0 8px}
  .ux-notification-menu{position:fixed;top:62px;left:10px;right:10px;width:auto;max-height:68dvh;overflow:auto}
  .ux-system-grid{grid-template-columns:1fr}
}
@media (max-width:420px){.ux-worker-home-grid{grid-template-columns:1fr}.ux-worker-actions{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){.ux-voice-wave i{animation:none!important}}
