/* ==========================================================================
   Uteam · Layout, navegación y componentes compartidos del rediseño.
   Cargar DESPUÉS de uteam-tokens.css. Solo usa variables --ut-*.
   ========================================================================== */

/* ---- Base ---- */
.ut-app { margin: 0; min-height: 100vh; background: var(--ut-bg); color: var(--ut-text); }
.ut-i { width: 20px; height: 20px; flex: none; }
.ut-skip { position: absolute; left: 8px; top: -64px; z-index: 2000; padding: 12px 16px; border-radius: var(--ut-radius-md);
  background: var(--ut-primary); color: var(--ut-on-primary); font-weight: 600; text-decoration: none; }
.ut-skip:focus { top: 8px; }

/* Las tarjetas de Bootstrap siguen la superficie del tema (pantallas aún no rediseñadas). */
.card { --bs-card-bg: var(--ut-surface); --bs-card-border-color: var(--ut-border); }

/* Botones de Bootstrap en la paleta de marca (pantallas aún no rediseñadas). */
.btn-primary { --bs-btn-bg: var(--ut-primary); --bs-btn-border-color: var(--ut-primary); --bs-btn-color: var(--ut-on-primary);
  --bs-btn-hover-bg: var(--ut-primary-hover); --bs-btn-hover-border-color: var(--ut-primary-hover); --bs-btn-hover-color: var(--ut-on-primary);
  --bs-btn-active-bg: var(--ut-primary-active); --bs-btn-active-border-color: var(--ut-primary-active); --bs-btn-active-color: var(--ut-on-primary);
  --bs-btn-disabled-bg: var(--ut-primary); --bs-btn-disabled-border-color: var(--ut-primary); --bs-btn-focus-shadow-rgb: 53, 56, 205; }
.btn-outline-primary { --bs-btn-color: var(--ut-primary-text); --bs-btn-border-color: var(--ut-primary); --bs-btn-hover-bg: var(--ut-primary);
  --bs-btn-hover-border-color: var(--ut-primary); --bs-btn-hover-color: var(--ut-on-primary); --bs-btn-active-bg: var(--ut-primary-active);
  --bs-btn-active-border-color: var(--ut-primary-active); --bs-btn-active-color: var(--ut-on-primary); --bs-btn-focus-shadow-rgb: 53, 56, 205; }

/* Enlaces con apariencia de botón: Bootstrap pinta a:hover y le ganaría a las clases .ut-btn--*. */
a.ut-btn, a.ut-btn:hover { text-decoration: none; }
a.ut-btn--primary, a.ut-btn--primary:hover { color: var(--ut-on-primary); }
a.ut-btn--secondary, a.ut-btn--secondary:hover { color: var(--ut-text); }
a.ut-btn--danger, a.ut-btn--danger:hover { color: var(--ut-bad); }
.ut-btn--ghost { background: transparent; color: var(--ut-muted); font-weight: 500; font-size: 14px; padding: 0 12px; }
.ut-btn--ghost:hover { background: var(--ut-surface-2); color: var(--ut-text); }
a.ut-btn--ghost, a.ut-btn--ghost:hover { color: var(--ut-muted); }
a.ut-btn--ghost:hover { color: var(--ut-text); }
.ut-btn--lg { min-height: 48px; font-size: 15px; font-weight: 500; }

/* ---- Barra lateral ---- */
.ut-sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 1050; display: flex; flex-direction: column;
  gap: 20px; padding: 16px 12px 20px; overflow-y: auto; box-sizing: border-box; }
.ut-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 8px; }
.ut-brand__id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ut-brand__logo { width: 36px; height: 36px; border-radius: 10px; background: #5458E8; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.ut-brand__name { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.2; }
.ut-brand__sub { font-size: 12px; color: #8A93A6; }
.ut-nav__group { display: flex; flex-direction: column; gap: 2px; }
.ut-nav__item { font-size: 15px; width: 100%; border: 0; background: transparent; font-family: inherit; text-align: left; cursor: pointer; }
.ut-nav__item[aria-current="page"] .ut-i { color: #A9ABFF; }
.ut-nav__item:focus-visible, .ut-nav__close:focus-visible { box-shadow: 0 0 0 3px rgba(169,171,255,.55); }
.ut-nav__foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.ut-nav__foot form { margin: 0; }
.ut-nav__user { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; min-width: 0; }
.ut-nav__user-av { flex: none; width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 600;
  background: #5458E8; color: #fff; }
.ut-nav__user-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ut-nav__user-name { font-size: 14px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-nav__user-role { font-size: 12px; color: #8A93A6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ut-nav__switch { margin-left: auto; width: 40px; height: 24px; border-radius: 999px; background: #33405B; position: relative; flex: none; transition: background .15s; }
.ut-nav__switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; transition: transform .15s; }
.ut-nav__item[aria-pressed="true"] .ut-nav__switch { background: #5458E8; }
.ut-nav__item[aria-pressed="true"] .ut-nav__switch::after { transform: translateX(16px); }
.ut-nav__close { display: none; width: var(--ut-hit); height: var(--ut-hit); border: 0; border-radius: var(--ut-radius-md);
  background: rgba(255,255,255,.06); color: #fff; align-items: center; justify-content: center; cursor: pointer; }
.ut-scrim { position: fixed; inset: 0; background: var(--ut-scrim); z-index: 1040; }
.ut-scrim[hidden] { display: none; }
body.ut-lock { overflow: hidden; }

/* ---- Barra superior (solo móvil) ---- */
.ut-topbar { display: none; align-items: center; gap: 8px; height: 60px; padding: 0 8px; background: var(--ut-surface);
  border-bottom: 1px solid var(--ut-border); position: sticky; top: 0; z-index: 1030; }
.ut-topbar__btn { width: var(--ut-hit); height: var(--ut-hit); border: 0; border-radius: var(--ut-radius-md); background: transparent;
  color: var(--ut-text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ut-topbar__btn:hover { background: var(--ut-surface-2); }
.ut-topbar__title { font-size: 17px; font-weight: 600; }

/* ---- Contenido ---- */
.ut-main { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }
.ut-main--kiosco { margin-left: 0; }
.ut-content { flex: 1; padding: 16px clamp(12px, 2vw, 24px) 20px; }
.ut-main--kiosco .ut-content { padding: 0; }
.ut-footer { padding: 16px clamp(16px, 3vw, 32px); border-top: 1px solid var(--ut-border); font-size: 13px; color: var(--ut-muted); }
.ut-link, .ut-link:visited { color: var(--ut-muted); text-decoration: underline; }
.ut-link:hover { color: var(--ut-text); }

@media (max-width: 991.98px) {
  .ut-sidebar { width: 304px; max-width: 86vw; transform: translateX(-100%); transition: transform .25s ease, box-shadow .25s ease; }
  .ut-sidebar.is-open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }   /* la sombra solo cuando está abierto: cerrado se asomaba en el borde */
  .ut-main { margin-left: 0; }
  .ut-topbar { display: flex; }
  .ut-nav__close { display: flex; }
}

/* ---- Pastillas de estado ---- */
.ut-status { display: flex; flex-wrap: wrap; gap: 8px; }
.ut-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.ut-pill .ut-i { width: 16px; height: 16px; stroke-width: 2.25; }
.ut-pill--ok { background: var(--ut-ok-soft); color: var(--ut-ok); }
.ut-pill--warn { background: var(--ut-warn-soft); color: var(--ut-warn); }
.ut-pill--bad { background: var(--ut-bad-soft); color: var(--ut-bad); }
.ut-pill--neutral { background: var(--ut-surface); color: var(--ut-text-2); border: 1px solid var(--ut-border); }
.ut-dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; flex: none; }
.ut-pulse { animation: ut-pulse 2s ease-in-out infinite; }
@keyframes ut-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- Kiosco · espera ---- */
.ut-kiosk { background: var(--ut-bg); color: var(--ut-text); }
.ut-kiosk__shell { min-height: 100vh; box-sizing: border-box; display: flex; flex-direction: column; padding: 24px clamp(16px, 4vw, 48px); }
.ut-kiosk__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.ut-kiosk__brand { display: flex; align-items: center; gap: 12px; }
.ut-kiosk__logo { width: 40px; height: 40px; border-radius: 10px; background: var(--ut-primary); color: var(--ut-on-primary); display: flex; align-items: center; justify-content: center; }
.ut-kiosk__brand-name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.ut-kiosk__brand-sub { font-size: 13px; color: var(--ut-muted); display: block; }
.ut-kiosk__main { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(32px, 6vw, 96px); padding: 40px 0; }
.ut-kiosk__left { flex: 1 1 380px; max-width: 520px; display: flex; flex-direction: column; gap: 24px; }
.ut-clock-date { font-size: 18px; color: var(--ut-muted); }
.ut-clock-date::first-letter { text-transform: uppercase; }   /* "martes, 20 de octubre" → "Martes, 20 de octubre" */
.ut-clock { display: flex; align-items: baseline; gap: 8px; }
.ut-clock__time { font-size: clamp(64px, 9vw, 104px); line-height: 1; font-weight: 500; letter-spacing: -0.04em; }
.ut-clock__sec { font-size: 28px; color: var(--ut-muted); }
.ut-clock__ampm { font-size: 20px; color: var(--ut-muted); font-weight: 500; }
.ut-kiosk__title { margin: 0; font-size: clamp(28px, 3.2vw, 36px); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
.ut-kiosk__lead { margin: 8px 0 0; font-size: 18px; line-height: 28px; color: var(--ut-text-2); text-wrap: pretty; }
/* "¿Sin tu código?" arriba; los métodos alternos debajo, del mismo ancho (se apilan en pantallas angostas). */
.ut-kiosk__alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding-top: 8px; }
.ut-kiosk__alt-label { grid-column: 1 / -1; font-size: 15px; color: var(--ut-muted); }
.ut-kiosk__alt .ut-btn { width: 100%; }
.ut-kiosk__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--ut-border); }
.ut-kiosk__legal { font-size: 13px; color: var(--ut-muted); }
.ut-kiosk__legal a { color: var(--ut-muted); }

.ut-scan { flex: 0 1 400px; display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 40px 32px;
  border-radius: var(--ut-radius-xl); background: var(--ut-surface); border: 1px solid var(--ut-border); box-shadow: var(--ut-shadow-lg); }
.ut-viewfinder { position: relative; width: 240px; height: 240px; }
.ut-vf-corner { position: absolute; width: 44px; height: 44px; border: 0 solid var(--ut-primary); }
.ut-vf-corner--tl { left: 0; top: 0; border-left-width: 4px; border-top-width: 4px; border-top-left-radius: 14px; }
.ut-vf-corner--tr { right: 0; top: 0; border-right-width: 4px; border-top-width: 4px; border-top-right-radius: 14px; }
.ut-vf-corner--bl { left: 0; bottom: 0; border-left-width: 4px; border-bottom-width: 4px; border-bottom-left-radius: 14px; }
.ut-vf-corner--br { right: 0; bottom: 0; border-right-width: 4px; border-bottom-width: 4px; border-bottom-right-radius: 14px; }
.ut-vf-icon { position: absolute; inset: 40px; display: flex; align-items: center; justify-content: center; color: var(--ut-border-strong); }
.ut-vf-icon .ut-i { width: 120px; height: 120px; stroke-width: 1.25; }
.ut-scanline { position: absolute; left: 20px; right: 20px; top: 20px; height: 3px; border-radius: 3px; background: var(--ut-primary);
  box-shadow: 0 0 16px var(--ut-primary); animation: ut-scan 2.4s ease-in-out infinite; }
@keyframes ut-scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(196px); } }
.ut-scan__status { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; color: var(--ut-primary-text); }
.ut-scan__status .ut-dot { width: 10px; height: 10px; background: var(--ut-primary); }
/* Con cámara: el visor muestra el video (en espejo) dentro de las esquinas, sin ícono de QR ni línea de escaneo. */
.ut-viewfinder--camara { width: 300px; height: 300px; max-width: 100%; }
.ut-viewfinder--camara .ut-vf-icon, .ut-viewfinder--camara .ut-scanline { display: none; }
.ut-vf-video { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: cover;
  border-radius: var(--ut-radius-lg); transform: scaleX(-1); }
video.ut-vf-video { background: var(--ut-surface-2); }   /* el canvas de encima queda transparente */
.ut-vf-corner { z-index: 1; }
.ut-scan__status[data-tono="ok"] { color: var(--ut-ok); }
.ut-scan__status[data-tono="ok"] .ut-dot { background: var(--ut-ok); }
.ut-scan__status[data-tono="warn"] { color: var(--ut-warn); }
.ut-scan__status[data-tono="warn"] .ut-dot { background: var(--ut-warn); }
.ut-scan__status[data-tono="bad"] { color: var(--ut-bad); }
.ut-scan__status[data-tono="bad"] .ut-dot { background: var(--ut-bad); }
/* Método secundario que sigue activo en segundo plano (lector de huella): icono + texto bajo el reloj. */
.ut-kiosk__sec { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; color: var(--ut-muted); }
.ut-kiosk__sec strong { display: block; font-size: 15px; font-weight: 600; color: var(--ut-text); }
.ut-kiosk__sec-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px;
  border-radius: var(--ut-radius-md); background: var(--ut-primary-soft); color: var(--ut-primary-text); }
.ut-kiosk__sec-icon .ut-i { width: 28px; height: 28px; }

/* ---- Kiosco · verificación y acceso denegado ----
   Variables "fuertes" para fondos de franja con texto blanco (no existen en uteam-tokens.css; contraste ≥ 5:1 con #fff). */
:root, [data-bs-theme="light"] { --ut-ok-strong: #067647; --ut-bad-strong: #B42318; --ut-warn-strong: #A15C07; }
[data-bs-theme="dark"] { --ut-ok-strong: #0B7A4B; --ut-bad-strong: #B42318; --ut-warn-strong: #9A5A06; }

.ut-verif__shell { gap: 24px; }
.ut-pop { animation: ut-pop .35s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes ut-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.ut-eyebrow { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

/* Franja de resultado */
.ut-result { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 28px 32px; border-radius: var(--ut-radius-xl); color: #fff; }
.ut-result--ok { background: var(--ut-ok-strong); }
.ut-result--warn { background: var(--ut-warn-strong); }
.ut-result__icon { width: 72px; height: 72px; border-radius: 999px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex: none; }
.ut-result__icon .ut-i { width: 40px; height: 40px; }
.ut-result__body { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ut-result__body .ut-eyebrow { opacity: .9; }
.ut-result__title { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; font-weight: 600; overflow-wrap: anywhere; }
.ut-result__detail { font-size: 18px; }
.ut-result__aside { flex: 0 1 260px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ut-progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.ut-progress__bar { height: 100%; width: 100%; background: #fff; border-radius: 999px; transition: width 1s linear; }
.ut-btn--light { background: #fff; color: var(--ut-ink); font-weight: 600; }
.ut-btn--light:hover:not(:disabled) { background: rgba(255,255,255,.9); }
.ut-btn--light .ut-i { width: 18px; height: 18px; stroke-width: 2; }

/* Tarjeta del empleado y movimientos de hoy */
.ut-verif__grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.ut-emp { flex: 1 1 340px; display: flex; flex-direction: column; gap: 24px; padding: 28px; border-radius: 16px; }
.ut-emp__head { display: flex; align-items: center; gap: 20px; }
.ut-avatar { width: 88px; height: 88px; border-radius: 999px; background: var(--ut-primary-soft); color: var(--ut-primary-text);
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 600; flex: none; overflow: hidden; }
.ut-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ut-emp__id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ut-emp__name { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; overflow-wrap: anywhere; }
.ut-idchip { align-self: flex-start; font-size: 14px; font-weight: 500; padding: 4px 10px; border-radius: var(--ut-radius-sm);
  background: var(--ut-surface-2); border: 1px solid var(--ut-border); }
.ut-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; font-size: 16px; }
.ut-dl dt { color: var(--ut-muted); font-weight: 400; }
.ut-dl dd { margin: 0; font-weight: 500; }

.ut-moves { flex: 2 1 460px; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; }
.ut-moves__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--ut-border); }
.ut-moves__head h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.ut-moves__total { font-size: 14px; color: var(--ut-muted); }
.ut-moves__total strong { color: var(--ut-text); }
.ut-moves__list { list-style: none; margin: 0; padding: 8px 0; }
.ut-moves__item { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--ut-border); }
.ut-moves__item:last-child { border-bottom: 0; }
.ut-moves__time { width: 128px; font-size: 16px; font-weight: 500; }
.ut-moves__method { font-size: 14px; color: var(--ut-muted); }
.ut-moves__now { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ut-primary-text); }
.ut-moves__empty { margin: 0; padding: 24px; color: var(--ut-muted); }
.ut-badge .ut-i { width: 15px; height: 15px; }

/* Acceso denegado (rojo) / registro duplicado (ámbar) */
.ut-denied { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px;
  padding: 56px 24px; border-radius: var(--ut-radius-xl); }
.ut-denied__icon { width: 96px; height: 96px; border-radius: 999px; background: var(--ut-bad-strong); color: #fff; display: flex; align-items: center; justify-content: center; }
.ut-denied__icon .ut-i { width: 48px; height: 48px; }
.ut-denied--warn .ut-denied__icon { background: var(--ut-warn-strong); }
.ut-denied__text { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.ut-denied__text .ut-eyebrow { color: var(--ut-bad); }
.ut-denied--warn .ut-denied__text .ut-eyebrow { color: var(--ut-warn); }
.ut-denied__title { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; font-weight: 600; }
.ut-denied__detail { margin: 0; font-size: 18px; line-height: 28px; color: var(--ut-text-2); }
.ut-denied__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ut-denied__count { font-size: 14px; color: var(--ut-muted); }

@media (max-width: 575.98px) {
  .ut-result { padding: 20px; gap: 16px; }
  .ut-result__icon { width: 56px; height: 56px; }
  .ut-result__icon .ut-i { width: 32px; height: 32px; }
  .ut-emp, .ut-moves__head, .ut-moves__item { padding-left: 20px; padding-right: 20px; }
  .ut-moves__time { width: auto; }
}

.ut-brand__logo img, .ut-kiosk__logo img, .ut-login__logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
