/* TikTime: tablero oscuro. Un solo archivo de estilos para las tres pantallas. */

:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b202b;
  --line: #262d3a;
  --text: #e9ecf2;
  --muted: #97a1b2;
  --live: #ff3b5c;
  --break: #f5b13d;
  --done: #3ecf8e;
  --short: #ff8a4c;
  --info: #35c8d6;
  --idle: #6b7586;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h2 { font-size: 1rem; font-weight: 600; }
a { color: var(--info); }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 32px);
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
}

.topbar-user {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-actions { display: flex; gap: 8px; }

/* ---------- Estructura ---------- */

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px) clamp(16px, 4vw, 32px) 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.5vw, 24px);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- Botones y campos ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:hover:not(:disabled) { border-color: #3a4456; background: #222938; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 0.85rem; }

.btn-live { background: var(--live); border-color: var(--live); color: #fff; }
.btn-live:hover:not(:disabled) { background: #ff5673; border-color: #ff5673; }
.btn-break { border-color: var(--break); color: var(--break); }
.btn-return { border-color: var(--info); color: var(--info); }
.btn-danger { border-color: color-mix(in srgb, var(--live) 55%, transparent); color: #ff8fa1; }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--live) 16%, transparent); border-color: var(--live); }
.btn-primary { background: var(--text); border-color: var(--text); color: #0b0d12; }
.btn-primary:hover:not(:disabled) { background: #fff; border-color: #fff; }

label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--muted); }

input[type="text"], input[type="password"], input[type="date"], select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.check { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: 0.9rem; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--info); }

.form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.form-row > label { flex: 1 1 160px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.segmented button {
  min-height: 32px;
  padding: 4px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- Estados ---------- */

.badge {
  --c: var(--idle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.st-SinIniciar { --c: var(--idle); }
.st-EnDirecto { --c: var(--live); }
.st-Refrigerio { --c: var(--break); }
.st-JornadaCompletada { --c: var(--done); }
.st-JornadaIncompleta { --c: var(--short); }

.st-EnDirecto.badge::before { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .st-EnDirecto.badge::before { animation: none; }
}

/* ---------- Cronómetros ---------- */

.timers {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin: 18px 0;
}

.timer {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.timer-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timer-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 7vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.timer-break .timer-value { font-size: clamp(1.7rem, 5vw, 2.6rem); color: var(--break); }
.timer-break.is-over .timer-value { color: var(--short); }
.timer-note { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress > div {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--live);
  transition: width 0.4s linear;
}

.progress.is-done > div { background: var(--done); }

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.actions .btn { min-height: 56px; font-size: 0.95rem; letter-spacing: 0.02em; }

.result {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 600;
}

.result.is-done { border-color: color-mix(in srgb, var(--done) 50%, transparent); color: var(--done); }
.result.is-short { border-color: color-mix(in srgb, var(--short) 50%, transparent); color: var(--short); }

/* ---------- Listas y tablas ---------- */

.marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.marks li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.marks time { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

th, td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.is-short { color: var(--short); }
td.is-extra { color: var(--done); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- Panel en vivo ---------- */

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.worker-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: 12px;
  background: var(--bg);
}

.worker-card h3 { font-size: 1rem; overflow-wrap: anywhere; }
.worker-card .timer-value { font-size: 2rem; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 0.85rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.conn.is-on::before { background: var(--done); }

/* ---------- Acceso ---------- */

.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.login-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(32px, 5vw, 64px);
  background:
    radial-gradient(900px 520px at 0% 0%, color-mix(in srgb, var(--live) 9%, transparent), transparent 70%),
    var(--surface);
  border-right: 1px solid var(--line);
}

.brand-mark { width: 28px; height: 28px; color: var(--live); flex: none; }
.brand-lg { font-size: 1.3rem; }
.brand-lg .brand-mark { width: 34px; height: 34px; }

.login-pitch { display: grid; gap: 14px; max-width: 30rem; }

.login-pitch h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.login-pitch p { color: var(--muted); font-size: 1.02rem; max-width: 27rem; }

.login-sample {
  display: grid;
  gap: 10px;
  width: min(380px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.login-sample-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.login-sample .timer-value { font-size: 2.6rem; }
.login-sample .facts { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }

.login-main {
  display: grid;
  place-items: center;
  padding: 32px clamp(16px, 5vw, 56px);
}

.login-card { width: min(400px, 100%); display: grid; gap: 22px; }
.login-brand-mobile { display: none; }
.login-head { display: grid; gap: 6px; }
.login-head h2 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
.login-panel, .login-card form { display: grid; gap: 16px; }

.login-foot {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.segmented-fill { display: grid; grid-template-columns: 1fr 1fr; }
.segmented-fill button { min-height: 38px; }

.btn-block { width: 100%; min-height: 46px; }

.field-with-action { position: relative; display: block; }
.field-with-action input { padding-right: 84px; }

.field-action {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 30px;
  padding: 2px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.field-action:hover { color: var(--text); background: var(--surface-2); }
.field-action:focus-visible { outline: 2px solid var(--info); outline-offset: 1px; }

.login-card input[type="text"], .login-card input[type="password"] { min-height: 46px; background: var(--surface); }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-aside { display: none; }
  .login-brand-mobile { display: flex; }
}

.camera {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.camera video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; }
.camera.is-on { background: #000; }
.camera.is-on video { opacity: 1; }

/* Reposo: silueta en lugar de un recuadro negro */
.camera-idle {
  position: absolute;
  inset: 0 0 44px 0;
  display: grid;
  place-items: center;
  color: var(--idle);
}

.camera-idle svg { width: 88px; height: 88px; }
.camera.is-on .camera-idle { display: none; }

/* Encendida: marco guía para centrar el rostro */
.camera-frame {
  position: absolute;
  inset: 12% 24% 22% 24%;
  border: 2px solid color-mix(in srgb, var(--text) 70%, transparent);
  border-radius: 46% / 40%;
  display: none;
}

.camera.is-on .camera-frame { display: block; }

.camera-hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.camera.is-on .camera-hint { border-top-color: transparent; background: rgba(0, 0, 0, 0.6); color: var(--text); }

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.9rem;
}

.notice.is-error { border-color: color-mix(in srgb, var(--live) 55%, transparent); color: #ff8fa1; }
.notice.is-ok { border-color: color-mix(in srgb, var(--done) 55%, transparent); color: var(--done); }

.secret {
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
  user-select: all;
  overflow-wrap: anywhere;
}

/* ---------- Diálogos ---------- */

dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog form, .dialog-body { display: grid; gap: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  font-weight: 600;
}

.toast.is-error { border-color: var(--live); color: #ff8fa1; }

/* ---------- Tablet y celular ---------- */

@media (max-width: 860px) {
  .timers { grid-template-columns: 1fr; }
  .actions { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .topbar-user { order: 3; width: 100%; margin-left: 0; }
  .topbar-actions { margin-left: auto; }
  .actions { grid-template-columns: 1fr; }
  .form-row > label, .form-row > .btn { flex: 1 1 100%; }
}

/* ---------- Login: ritmo cian y rosa ---------- */
.login-page { --live: #fe2c55; --info: #25f4ee; --line: #292a35; background: #08090d; }
.login-page .login-shell { position: relative; isolation: isolate; overflow: hidden; }
.login-page .login-shell::before, .login-page .login-shell::after { content: ""; position: absolute; z-index: -1; width: 450px; height: 450px; border-radius: 50%; pointer-events: none; filter: blur(85px); opacity: .12; animation: login-glow 14s ease-in-out infinite alternate; }
.login-page .login-shell::before { background: var(--info); top: -180px; left: -120px; }
.login-page .login-shell::after { background: var(--live); right: -180px; bottom: -140px; animation-delay: -7s; }
.login-page .login-aside { position: relative; background: linear-gradient(145deg, #ffffff03, transparent); gap: 28px; }
.login-page .brand-mark { color: var(--info); filter: drop-shadow(3px 2px 0 var(--live)); }
.login-page .brand-lg { font-size: 1.6rem; letter-spacing: -.06em; }
.login-eyebrow { color: var(--info); font-size: .68rem; font-weight: 800; letter-spacing: .2em; }
.login-page .login-pitch { gap: 20px; }
.login-page .login-pitch h1 { font-size: clamp(3rem, 5.5vw, 5.4rem); line-height: 1; letter-spacing: -.065em; }
.login-page .login-pitch h1 span { color: #fff; text-shadow: -3px 0 var(--info), 3px 2px var(--live); }
.login-orbit { position: relative; width: 130px; height: 130px; margin: 4px 0; border: 1px solid #25f4ee35; border-radius: 50%; background: radial-gradient(circle, #25f4ee0c, transparent 70%); }
.orbit-clock { position: absolute; inset: 12px; border-radius: 50%; background: #101219; box-shadow: -5px 0 20px #25f4ee15, 5px 0 20px #fe2c551a; }
.orbit-clock svg { width: 100%; height: 100%; fill: none; stroke: var(--info); stroke-width: 2; stroke-linecap: round; }
.orbit-clock .clock-hour { stroke: #fff; stroke-width: 3; transform: rotate(45deg); transform-origin: 50px 50px; }
.orbit-clock .clock-minute { stroke: var(--live); transform-origin: 50px 50px; animation: login-spin 18s linear infinite; }
.orbit-clock .clock-center { fill: #fff; stroke: none; }
.orbit-dot { position: absolute; inset: -1px; animation: login-spin 9s linear infinite; border-radius: 50%; }
.orbit-dot::before { content: ""; position: absolute; top: -4px; left: calc(50% - 4px); width: 8px; height: 8px; background: var(--live); border-radius: 50%; box-shadow: 0 0 16px var(--live); }
.login-page .login-sample { background: #101219d9; border-color: #25f4ee25; border-left: 3px solid var(--info); transform: rotate(-2deg); }
.login-page .login-sample .timer-value { color: #fff; text-shadow: 2px 0 #fe2c5560; }
.login-page .login-sample .progress > div { background: linear-gradient(90deg, var(--info), var(--live)); }
.login-page .login-card { width: min(460px, 100%); padding: clamp(22px, 3vw, 36px); background: #111219dc; border: 1px solid #ffffff12; border-radius: 24px; box-shadow: 0 24px 80px #0005; animation: login-enter .7s ease-out both; }
.login-page .login-head { gap: 10px; }
.login-page .login-head h2 { font-size: clamp(1.6rem, 2.5vw, 2rem); line-height: 1.15; letter-spacing: -.05em; }
.heading-dot { color: var(--live); }
.login-page .segmented { padding: 5px; border-radius: 12px; }
.login-page .segmented button { font-size: .82rem; transition: color .2s, background .2s; }
.login-page .segmented button[aria-selected="true"] { background: #25f4ee12; color: var(--info); box-shadow: inset 0 -2px var(--info); }
.login-page .login-panel { animation: login-enter .3s ease-out both; }
.login-page .login-card input { background: #0b0c11; border-radius: 12px; min-height: 50px; transition: border-color .2s, box-shadow .2s; }
.login-page .login-card input:focus { border-color: var(--info); box-shadow: 0 0 0 4px #25f4ee0a; }
.login-page .btn-block { min-height: 50px; border-radius: 12px; transition: transform .2s, box-shadow .2s, background .2s; }
.login-page .btn-primary, .login-page .btn-live { background: var(--live); border-color: var(--live); color: #fff; box-shadow: -3px 3px 0 var(--info); }
.login-page .btn-block:hover:not(:disabled) { background: #ff4067; border-color: #ff4067; transform: translateY(-2px); box-shadow: -4px 5px 0 var(--info), 0 8px 28px #fe2c5520; }
.login-page .btn-block:active:not(:disabled) { transform: translateY(1px); box-shadow: -1px 1px 0 var(--info); }
.login-page .btn-block:disabled { opacity: .8; }
.button-label { display: inline-flex; gap: 12px; align-items: center; }
.button-spinner { display: none; width: 18px; height: 18px; border: 2px solid #ffffff40; border-top-color: var(--info); border-right-color: #fff; border-radius: 50%; animation: login-spin .7s linear infinite; }
.is-loading .button-spinner { display: inline-block; }
.login-page .camera { background: radial-gradient(ellipse at center, #25f4ee09, #0b0c11 75%); border-radius: 16px; }
.login-page .camera-idle { color: var(--info); }
.login-page .camera-idle svg { filter: drop-shadow(3px 1px 0 #fe2c5570); }
.login-page .camera-frame { border-color: var(--info); box-shadow: 0 0 20px #25f4ee20; }
.login-page .camera.is-scanning::after { content: ""; position: absolute; top: 15%; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, transparent, var(--info), transparent); box-shadow: 0 0 18px var(--info); animation: login-scan 2s ease-in-out infinite alternate; pointer-events: none; }
@keyframes login-spin { to { transform: rotate(360deg); } }
@keyframes login-glow { to { transform: translate(70px, 50px) scale(1.15); } }
@keyframes login-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes login-scan { to { top: 72%; } }
@media (max-width: 900px) { .login-page .login-main { padding: 28px 16px; } .login-page .login-brand-mobile { margin-bottom: 6px; } }
@media (prefers-reduced-motion: reduce) { .login-page *, .login-page *::before, .login-page *::after { animation: none !important; transition: none !important; } }

/* Barras decorativas: movimiento desde que se abre el acceso. */
.login-rhythm { display: grid; justify-items: center; gap: 12px; padding: 4px 0 2px; }
.rhythm-bars { display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; }
.rhythm-bars span { width: 7px; height: 44px; border-radius: 999px; background: var(--info); box-shadow: 0 0 14px #25f4ee30; transform: scaleY(.3); animation: rhythm-bounce 1.2s ease-in-out infinite; }
.rhythm-bars span:nth-child(even) { background: var(--live); box-shadow: 0 0 14px #fe2c5530; }
.rhythm-bars span:nth-child(2) { animation-delay: -.4s; }
.rhythm-bars span:nth-child(3) { animation-delay: -.8s; }
.rhythm-bars span:nth-child(4) { animation-delay: -.2s; }
.rhythm-bars span:nth-child(5) { animation-delay: -.6s; }
.rhythm-bars span:nth-child(6) { animation-delay: -1s; }
.rhythm-bars span:nth-child(7) { animation-delay: -.3s; }
.rhythm-bars span:nth-child(8) { animation-delay: -.7s; }
.rhythm-bars span:nth-child(9) { animation-delay: -.9s; }
.rhythm-caption { color: var(--muted); font-size: .6rem; font-weight: 700; letter-spacing: .24em; }
.rhythm-track { width: 112px; height: 3px; overflow: hidden; border-radius: 999px; background: #ffffff0a; }
.rhythm-track span { display: block; height: 100%; width: 45%; border-radius: inherit; background: linear-gradient(90deg, var(--info), var(--live)); animation: rhythm-slide 1.8s ease-in-out infinite; }
@keyframes rhythm-bounce { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@keyframes rhythm-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(240%); } }

/* Entrada escalonada, partículas y respuesta al cursor. */
.login-page .login-aside > .brand { animation: login-enter .55s ease-out both; }
.login-page .login-pitch { animation: login-enter .7s .12s ease-out both; }
.login-page .login-card { position: relative; isolation: isolate; animation-delay: .18s; }
.login-page .login-card > .login-brand-mobile { animation: login-enter .5s ease-out both; }
.login-page .login-card > .login-head { animation: login-enter .6s .3s ease-out both; }
.login-page .login-card > .segmented { animation: login-enter .6s .4s ease-out both; }
.login-page .login-card::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: radial-gradient(220px circle at var(--cursor-x, 50%) var(--cursor-y, 50%), #25f4ee12, transparent 75%); opacity: 0; transition: opacity .3s; }
.login-page .login-card.has-pointer::before { opacity: 1; }
.login-particles { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.login-particles span { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--info); box-shadow: 0 0 12px #25f4ee60; animation: particle-drift 12s ease-in-out infinite alternate; opacity: .4; }
.login-particles span:nth-child(1) { left: 8%; top: 24%; }
.login-particles span:nth-child(2) { left: 23%; top: 72%; animation-delay: -4s; background: var(--live); }
.login-particles span:nth-child(3) { left: 42%; top: 16%; animation-delay: -7s; }
.login-particles span:nth-child(4) { left: 55%; top: 83%; animation-delay: -2s; background: var(--live); }
.login-particles span:nth-child(5) { left: 69%; top: 12%; animation-delay: -9s; }
.login-particles span:nth-child(6) { left: 87%; top: 65%; animation-delay: -5s; background: var(--live); }
.login-particles span:nth-child(7) { left: 94%; top: 30%; animation-delay: -3s; }
.login-particles span:nth-child(8) { left: 35%; top: 90%; animation-delay: -8s; background: var(--live); }
.login-success { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: #08090df5; backdrop-filter: blur(10px); }
.success-content { display: grid; justify-items: center; gap: 18px; text-align: center; animation: login-enter .35s ease-out both; }
.success-content h2 { font-size: clamp(1.5rem, 5vw, 2rem); letter-spacing: -.04em; }
.success-content p { color: var(--muted); }
.success-check { width: 88px; height: 88px; fill: none; stroke: var(--info); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 18px #25f4ee40); }
.success-check circle { stroke: #25f4ee35; }
.success-check path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: success-draw .45s .12s ease-out forwards; }
@keyframes particle-drift { to { transform: translate(18px, -45px); opacity: .75; } }
@keyframes success-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .login-page *, .login-page *::before, .login-page *::after { animation: none !important; transition: none !important; }
  .success-check path { stroke-dashoffset: 0; }
  .login-page .login-card::before { display: none; }
}

/* Ayudas de acceso. */
.login-page .caps-warning { color: var(--break); }
.login-page .remember-user { color: var(--muted); font-size: .82rem; align-items: center; }
.login-page .remember-user input { margin: 0; flex: none; }
.login-page .face-recovery { display: flex; flex-wrap: wrap; gap: 8px; }
.login-page .face-recovery .btn { flex: 1 1 130px; font-size: .82rem; }

/* Iluminación opcional mediante la pantalla, solo durante el escaneo. */
.login-page .light-help { display: grid; gap: 10px; padding: 12px; border: 1px solid #f5b13d40; border-radius: 12px; background: #f5b13d09; color: var(--break); }
.login-page .light-help .btn { color: var(--text); }
.login-page.screen-light .login-shell { background: #fff; }
.login-page.screen-light .login-aside { visibility: hidden; }
.login-page.screen-light .login-particles { display: none; }
.login-page.screen-light .login-shell::before, .login-page.screen-light .login-shell::after { display: none; }
.login-page.screen-light .login-card { background: #111219; box-shadow: 0 0 0 12px #fff; }
@media (max-width: 900px) {
  .login-page.screen-light .login-main { padding: 48px 28px; }
  .login-page.screen-light .login-card { padding: 20px; }
}

/* Acceso por teclado y pantallas pequeñas. */
.login-page button:focus-visible { outline: 2px solid var(--info); outline-offset: 4px; }
.login-page .connection-status { color: var(--break); padding: 10px 12px; border: 1px solid #f5b13d40; border-radius: 10px; }
@media (max-width: 520px) {
  .login-page .login-card input[type="text"], .login-page .login-card input[type="password"] { font-size: 16px; }
  .login-page .login-main { padding: 20px 16px; }
  .login-page .login-card { gap: 18px; }
  .login-page .segmented button { min-height: 44px; }
}
@media (max-height: 650px) {
  .login-page .login-main { align-items: start; }
  .login-page .login-rhythm { gap: 6px; }
  .login-page .rhythm-bars { height: 32px; }
  .login-page .rhythm-bars span { height: 28px; }
}

/* ---------- Workspace: panel administrativo y jornada ---------- */
.app-page { --bg: #080a0f; --surface: #11151e; --surface-2: #191e29; --line: #252b38; --live: #fe2c55; --info: #25f4ee; --text: #f2f4f8; --muted: #a0aabc; --radius: 20px; background: radial-gradient(ellipse at 90% 0, #fe2c5508, transparent 45%), radial-gradient(ellipse at 5% 20%, #25f4ee06, transparent 40%), var(--bg); }
.app-page .topbar { padding: 16px clamp(16px, 4vw, 40px); gap: 20px; background: #080a0ff2; border-bottom-color: #ffffff0b; backdrop-filter: blur(18px); }
.app-page .brand { font-size: 1.4rem; letter-spacing: -.055em; }
.app-logo { width: 32px; height: 32px; flex: none; color: var(--info); filter: drop-shadow(2px 2px 0 var(--live)); }
.app-brand-label { font-size: .62rem; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-weight: 500; letter-spacing: .01em; margin-left: 4px; }
.app-page .topbar-user { font-size: .82rem; color: var(--text); }
.app-page .page { width: min(1360px, 100%); gap: 24px; padding-top: 36px; padding-bottom: 60px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 2px 8px; }
.workspace-heading > div { display: grid; gap: 9px; }
.workspace-eyebrow { color: var(--info); font-size: .65rem; font-weight: 750; letter-spacing: .2em; }
.workspace-heading h1 { font-size: clamp(1.7rem, 3.3vw, 2.7rem); line-height: 1.15; letter-spacing: -.05em; font-weight: 750; text-wrap: balance; }
.workspace-heading .muted { font-size: .9rem; }
.workspace-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: .72rem; white-space: nowrap; }
.workspace-tag > span { color: var(--info); font-size: 1.1rem; }
.app-page .stack { gap: 24px; }
.app-page .panel { padding: clamp(20px, 3vw, 28px); border-color: #ffffff0c; box-shadow: 0 8px 30px #0002; }
.app-page .panel-head { margin-bottom: 22px; }
.app-page .panel-head h2 { font-size: 1.08rem; letter-spacing: -.025em; }
.app-page .conn { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .72rem; }
.app-page .segmented { background: #0d1017; border-color: #ffffff0d; padding: 4px; border-radius: 12px; }
.app-page .segmented button { min-height: 38px; border-radius: 9px; font-size: .83rem; transition: background .2s, color .2s; }
.app-page .segmented button[aria-pressed="true"] { background: #25f4ee12; color: var(--info); box-shadow: inset 0 -2px var(--info); }
.app-page .segmented button:hover { color: var(--text); }
.app-page button:focus-visible { outline: 2px solid var(--info); outline-offset: 3px; }
.app-page .btn { border-radius: 11px; min-height: 44px; transition: background .2s, border-color .2s, transform .2s; }
.app-page .btn:hover:not(:disabled) { transform: translateY(-1px); }
.app-page .btn-sm { min-height: 36px; font-size: .75rem; }
.app-page .btn-primary { color: #071215; background: var(--info); border-color: var(--info); }
.app-page .btn-primary:hover:not(:disabled) { background: #73fff9; border-color: #73fff9; box-shadow: 0 4px 18px #25f4ee16; }
.app-page .btn-live { background: var(--live); border-color: var(--live); box-shadow: 0 4px 20px #fe2c5515; }
.app-page .btn-live:hover:not(:disabled) { background: #ff456b; border-color: #ff456b; }
.app-page input[type="text"], .app-page input[type="password"], .app-page input[type="date"], .app-page select { min-height: 44px; background: #0b0e15; border-radius: 11px; font-size: 16px; }
.app-page label { gap: 8px; font-size: .8rem; }
.team-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.overview-card { --accent: #cad3e4; position: relative; padding: 20px 22px; display: grid; gap: 5px; border: 1px solid #ffffff0b; border-radius: 16px; background: linear-gradient(135deg, #ffffff03, transparent), var(--surface); }
.overview-card::before { content: ""; position: absolute; top: 22px; right: 20px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.overview-label { font-size: .75rem; color: var(--muted); padding-right: 14px; }
.overview-card strong { font-size: 2rem; line-height: 1.4; letter-spacing: -.06em; color: var(--accent); font-variant-numeric: tabular-nums; }
.overview-card .small { font-size: .68rem; }
.overview-cyan { --accent: var(--info); }
.overview-amber { --accent: var(--break); }
.overview-green { --accent: var(--done); }
.app-page .live-grid { gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.app-page .worker-card { padding: 22px; background: #0a0e15; border: 1px solid var(--line); border-top: 2px solid var(--c); border-radius: 16px; gap: 16px; }
.worker-card-heading { display: flex; gap: 12px; align-items: center; }
.worker-card-heading h3 { font-size: .95rem; }
.worker-avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--c); font-size: .73rem; font-weight: 750; background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 20%, transparent); }
.app-page .badge { padding: 5px 10px; font-size: .74rem; }
.app-page .worker-card .timer-value { font-size: clamp(2rem, 3vw, 2.7rem); letter-spacing: -.06em; }
.app-page .timer-label { font-size: .65rem; letter-spacing: .1em; }
.app-page .progress { height: 6px; background: #ffffff08; }
.app-page .progress > div { background: linear-gradient(90deg, var(--info), #18bdb9); }
.app-page .progress.is-done > div { background: var(--done); }
.app-page .facts { border-top: 1px solid #ffffff09; padding-top: 14px; gap: 7px 12px; font-size: .78rem; }
.app-page .facts dd { color: #d6deec; }
.app-page .notice { border-radius: 12px; background: #0b0e15; padding: 12px 14px; }
.app-page .notice.is-error { background: #fe2c5506; }
.app-page .account-form { padding: 16px; background: #0a0e15; border: 1px solid #ffffff08; border-radius: 14px; }
.app-page .table-wrap { border-color: #ffffff0c; border-radius: 14px; scrollbar-color: #394357 #0b0e15; }
.app-page table { font-size: .82rem; }
.app-page th { padding: 14px 16px; font-size: .64rem; background: #0b1019; letter-spacing: .07em; color: #a5b3c9; }
.app-page td { padding: 14px 16px; border-bottom-color: #ffffff07; }
.app-page tbody tr:nth-child(even) { background: #ffffff02; }
.app-page tbody tr:hover { background: #25f4ee05; }
.app-page td .btn { margin: 3px 2px; }
.app-page .day-panel { border-top: 2px solid var(--info); }
.app-page .timers { grid-template-columns: 1.7fr 1fr; gap: 18px; margin: 24px 0; }
.app-page .timer { padding: clamp(20px, 3vw, 32px); gap: 12px; border-radius: 16px; border-color: #ffffff09; background: #0a0e15; }
.app-page .timer-work { background: radial-gradient(ellipse at 90% 0, #25f4ee0b, transparent 60%), #0a0e15; }
.app-page .timer-work .timer-value { color: var(--info); font-size: clamp(2.5rem, 6.5vw, 5rem); letter-spacing: -.055em; }
.app-page .timer-break { background: radial-gradient(ellipse at 90% 0, #f5b13d08, transparent 60%), #0a0e15; }
.app-page .timer-break .timer-value { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; }
.app-page .timer-note { font-size: .8rem; }
.app-page .actions .btn { min-height: 56px; font-size: .82rem; letter-spacing: 0; }
.app-page .marks { position: relative; gap: 10px; }
.app-page .marks li { position: relative; padding: 14px 16px 14px 32px; border-color: #ffffff08; background: #0a0e15; font-size: .83rem; }
.app-page .marks li::before { content: ""; position: absolute; left: 14px; top: 20px; height: 6px; width: 6px; border-radius: 50%; background: var(--info); }
.app-page dialog { width: min(500px, calc(100vw - 32px)); padding: 28px; border: 1px solid #25f4ee25; border-radius: 20px; box-shadow: 0 30px 100px #0008; }
.app-page dialog::backdrop { background: #03060bbf; backdrop-filter: blur(5px); }
.app-page dialog h2 { font-size: 1.3rem; letter-spacing: -.035em; }
.app-page .toast { border-radius: 14px; }
@media (prefers-reduced-motion: no-preference) { .app-page .workspace-heading { animation: workspace-enter .4s ease-out both; } .app-page .page > .panel, .app-page .page > .stack { animation: workspace-enter .5s .06s ease-out both; } }
@keyframes workspace-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1000px) { .app-page .topbar { gap: 12px; } .app-brand-label { display: none; } .workspace-tag { display: none; } }
@media (max-width: 860px) { .app-page .timers { grid-template-columns: 1fr; } .team-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .app-page .topbar { position: relative; } .admin-page #viewTabs { order: 4; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); } .app-page .topbar-user { margin-left: auto; } .app-page .page { padding-top: 24px; } .app-page .workspace-heading h1 { font-size: 1.8rem; } .app-page .topbar-actions { margin-left: 0; } }
@media (max-width: 520px) { .app-page .topbar-user { order: initial; width: auto; font-size: .75rem; } .app-page .topbar-actions { width: 100%; } .app-page .topbar-actions .btn { flex: 1; } .app-page .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .app-page .panel { padding: 18px; } .team-overview { gap: 10px; } .overview-card { padding: 16px; } .overview-card::before { right: 14px; top: 19px; } .overview-card .small { font-size: .65rem; } .app-page .panel-head { gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .app-page *, .app-page *::before, .app-page *::after { animation: none !important; transition: none !important; } }
