@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('/fonts/satoshi-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* Relojito: azul eléctrico sobre marino, con coral como toque vivo */
:root {
  --fondo: #f1f4fb; --tarjeta: #ffffff; --campo: #ffffff; --texto: #0f1b3d; --suave: #5a6685;
  --borde: #e0e6f3; --primario: #2f4bff; --primario-hover: #2038e0; --primario-tinta: #ffffff;
  --primario-suave: #e8ecff; --acento: #ff5a36; --ok: #0d8a5d; --ok-fondo: #e3f6ee; --error: #d4351c; --error-fondo: #fdeceb;
  --aviso: #b45309; --aviso-fondo: #fff4e0;
  --lateral: #0c1536; --lateral-texto: #aab6dc; --lateral-linea: rgba(255,255,255,.09);
  --radio: 14px; --radio-int: 10px;
  --sombra: 0 1px 2px rgba(15,27,61,.05), 0 8px 24px -12px rgba(15,27,61,.14);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --fuente: 'Satoshi', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0a1026; --tarjeta: #121a38; --campo: #0d1430; --texto: #eaeefc; --suave: #9aa6c7;
    --borde: #232d52; --primario: #6d83ff; --primario-hover: #8799ff; --primario-tinta: #0a1026;
    --primario-suave: #1a2550; --ok: #4fd1a1; --ok-fondo: #0f2b25; --error: #ff8a77; --error-fondo: #331a1d;
    --aviso: #f5b457; --aviso-fondo: #2e2412; --lateral: #070c1e; --sombra: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 400 1rem/1.55 var(--fuente); -webkit-font-smoothing: antialiased; }
a { color: var(--primario); text-underline-offset: 3px; }
a:hover { color: var(--primario-hover); }
:focus-visible { outline: 3px solid var(--primario); outline-offset: 2px; }

/* Marca */
.marca { display: inline-flex; align-items: center; gap: .6rem; font: 700 1.25rem/1 var(--fuente); letter-spacing: -.02em; color: inherit; text-decoration: none; }
.marca:hover { color: inherit; }
.logo { width: 1.9rem; height: 1.9rem; border-radius: 9px; background: var(--primario); position: relative; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.logo::before { content: ""; position: absolute; inset: 22%; border: 2.5px solid #fff; border-radius: 50%; }
.logo::after { content: ""; position: absolute; left: 50%; top: 32%; width: 2.5px; height: 22%; background: var(--acento); border-radius: 2px; transform: translateX(-50%); }

/* Estructura con menú lateral */
.shell { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); min-height: 100vh; }
.lateral { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem .9rem; background: var(--lateral); color: var(--lateral-texto); overflow-y: auto; }
.lateral .marca { color: #fff; padding: .25rem .5rem; }
.navegacion { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.grupo { margin: 1rem .6rem .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(170,182,220,.6); }
.grupo:first-child { margin-top: 0; }
.navegacion a { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; border-radius: var(--radio-int); color: var(--lateral-texto); text-decoration: none; font-weight: 500; font-size: .9375rem; transition: background-color .15s ease, color .15s ease; }
.navegacion a:hover { background: rgba(255,255,255,.07); color: #fff; }
.navegacion a[aria-current="page"] { background: var(--primario); color: #fff; box-shadow: 0 6px 16px -8px var(--primario); }
.navegacion svg { flex: none; opacity: .9; }
.usuario { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--lateral-linea); }
.quien { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.quien strong { color: #fff; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quien span { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario form { display: contents; }
.usuario button { width: auto; min-height: 0; margin: 0; padding: .5rem .65rem; gap: .4rem; background: rgba(255,255,255,.07); border: 0; color: var(--lateral-texto); font-size: .85rem; font-weight: 500; }
.usuario button:hover { background: rgba(255,255,255,.14); color: #fff; }
.contenido { min-width: 0; display: flex; flex-direction: column; }
main { width: 100%; max-width: 58rem; margin: 0 auto; padding: 2rem 1.5rem 3rem; flex: 1; }
.pie { max-width: 58rem; width: 100%; margin: 0 auto; padding: 0 1.5rem 2rem; font-size: .85rem; color: var(--suave); }
.pie a { color: var(--suave); }

/* Invitado: tarjeta centrada */
body.invitado { background: var(--fondo); }
.cabecera-invitado { display: flex; justify-content: center; padding: clamp(1.5rem, 7vh, 3.5rem) 1rem 0; }
.cabecera-invitado .marca { font-size: 1.6rem; }
body.invitado main { max-width: 30rem; padding-top: 1.5rem; }
body.invitado main:has(.acceso-pantalla) { max-width: 66rem; width: 100%; }
body.invitado .pie { text-align: center; max-width: none; }

/* Tarjetas y texto */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.5rem; margin-top: 1rem; box-shadow: var(--sombra); }
.tarjeta:first-child { margin-top: 0; }
.tarjeta > :first-child { margin-top: 0; }
.tarjeta > :last-child { margin-bottom: 0; }
h1 { font: 700 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.15 var(--fuente); letter-spacing: -.025em; margin: 0 0 .75rem; text-wrap: balance; }
h2 { font: 700 1.125rem/1.25 var(--fuente); letter-spacing: -.015em; margin: 1.75rem 0 .5rem; padding-top: 1.25rem; border-top: 1px solid var(--borde); text-wrap: balance; }
h1 + h2, .tarjeta > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
p, li { text-wrap: pretty; }
ul { padding-left: 1.1rem; }
li { margin: .3rem 0; }
strong { font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { font-weight: 700; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--suave); }
time, .num { font-variant-numeric: tabular-nums; }
.suave { color: var(--suave); }

/* Formularios */
label { display: block; margin: 1rem 0 .35rem; font-weight: 700; font-size: .9rem; }
input, select, textarea { width: 100%; min-height: 46px; padding: .65rem .8rem; border: 1px solid var(--borde); border-radius: var(--radio-int); background: var(--campo); color: var(--texto); font: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
input:hover, select:hover, textarea:hover { border-color: var(--suave); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primario); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primario) 22%, transparent); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--primario); margin-right: .5rem; }
input::placeholder { color: var(--suave); opacity: .7; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 46px; padding: .7rem 1.25rem; margin-top: .85rem; border: 1px solid var(--primario); border-radius: var(--radio-int); background: var(--primario); color: var(--primario-tinta); font: 700 .975rem/1.2 var(--fuente); text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .16s var(--ease), box-shadow .15s ease; }
button:hover, .btn:hover { background: var(--primario-hover); border-color: var(--primario-hover); color: var(--primario-tinta); box-shadow: 0 8px 18px -10px var(--primario); }
button:active, .btn:active { transform: scale(.97); }
button.sec, .btn.sec { background: transparent; color: var(--texto); border-color: var(--borde); box-shadow: none; }
button.sec:hover, .btn.sec:hover { background: var(--primario-suave); border-color: var(--primario); color: var(--primario); }
.btn { width: auto; }
.btn.bloque { width: 100%; }

/* Mensajes */
.error { color: var(--error); font-weight: 500; }
.ok { color: var(--ok); font-weight: 500; }
p.tarjeta.ok, .aviso-ok { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: var(--radio-int); background: var(--ok-fondo); color: var(--ok); font-weight: 500; border: 0; box-shadow: none; }
.modo-soporte { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin: 0 0 1rem; padding: .8rem 1rem; border-radius: var(--radio-int); background: var(--aviso-fondo); color: var(--aviso); }
.modo-soporte button { width: auto; margin: 0; min-height: 38px; padding: .4rem .9rem; }

/* Estado de fichaje */
.estado-actual { display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1rem; padding: .45rem .9rem .45rem .7rem; border-radius: 999px; background: var(--primario-suave); font-size: 1rem; }
.estado-actual::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: var(--suave); flex: none; }
.estado-actual.trabajando { background: var(--ok-fondo); color: var(--ok); }
.estado-actual.trabajando::before { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.estado-actual.en_pausa { background: var(--aviso-fondo); color: var(--aviso); }
.estado-actual.en_pausa::before { background: var(--acento); }
.fichaje { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--borde); font-variant-numeric: tabular-nums; }
.fichaje:last-of-type { border-bottom: 0; }
.fichaje-fila { border-bottom: 1px solid var(--borde); padding: .15rem 0; }
.fichaje-fila .fichaje { border-bottom: 0; padding: .45rem 0 .15rem; }
.corregir summary { cursor: pointer; color: var(--primario); font-size: .85rem; font-weight: 500; padding: .2rem 0 .45rem; width: fit-content; }
.corregir[open] { padding-bottom: .9rem; }
.filtro-mes { display: flex; gap: .5rem; align-items: end; flex-wrap: wrap; margin-bottom: .5rem; }
.filtro-mes label { margin: 0; width: 100%; }
.filtro-mes input { width: auto; flex: 1 1 9rem; }
.filtro-mes button, .filtro-mes .btn { width: auto; margin: 0; }

/* Listas de personas */
.lista { list-style: none; margin: 0; padding: 0; border: 1px solid var(--borde); border-radius: var(--radio-int); overflow: hidden; }
.lista li { margin: 0; border-bottom: 1px solid var(--borde); }
.lista li:last-child { border-bottom: 0; }
.lista a { display: flex; align-items: center; gap: .85rem; padding: .75rem 1rem; color: var(--texto); text-decoration: none; transition: background-color .15s ease; }
.lista a:hover { background: var(--primario-suave); color: var(--texto); }
.avatar { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--primario-suave); color: var(--primario); font-weight: 700; flex: none; }
.nombre { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.etiqueta { padding: .2rem .6rem; border-radius: 999px; background: var(--primario-suave); color: var(--primario); font-size: .78rem; font-weight: 700; text-transform: capitalize; }
.etiqueta.baja { background: var(--error-fondo); color: var(--error); }

/* Acceso */
.acceso { max-width: 26rem; margin: 0 auto; }
.acceso .lema { text-align: center; color: var(--suave); margin: 0 0 .5rem; }
.acceso .tarjeta { padding: 1.75rem; }

@media (max-width: 860px) {
  .shell { display: block; }
  .lateral { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: .75rem; padding: .6rem .75rem; overflow: visible; }
  .lateral .marca { flex: none; }
  .lateral .marca { font-size: 1.1rem; }
  .navegacion { flex-direction: row; align-items: center; gap: .3rem; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
  .navegacion::-webkit-scrollbar { display: none; }
  .grupo, .quien { display: none; }
  .navegacion a { flex: none; padding: .5rem .7rem; font-size: .875rem; }
  .navegacion a svg { display: none; }
  .usuario { padding: 0; border: 0; flex: none; }
  .usuario button svg { display: none; }
  main { padding: 1.25rem 1rem 2rem; }
  .pie { padding: 0 1rem 1.5rem; }
}
@media (hover: none) { button:hover, .btn:hover { background: var(--primario); border-color: var(--primario); box-shadow: none; } button.sec:hover, .btn.sec:hover { background: transparent; border-color: var(--borde); color: var(--texto); } }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0ms !important; } }

/* Pantalla de acceso con panel de marca */
body.invitado:has(.acceso-pantalla) { background: linear-gradient(135deg, #2f4bff 0%, #1a2cc4 45%, #0c1536 100%) fixed; }
body.invitado:has(.acceso-pantalla) .cabecera-invitado .marca { color: #fff; }
.acceso-pantalla { width: 100%; box-sizing: border-box; display: grid; gap: 2rem; align-items: center; max-width: 62rem; margin: 0 auto; padding: 1rem; }
.acceso-hero { color: #fff; position: relative; }
.acceso-hero img { border-radius: 20px; box-shadow: 0 16px 40px rgba(0,0,0,.28); }
.acceso-hero h2 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.1; margin: 1.25rem 0 .75rem; color: #fff; }
.acceso-hero p { color: rgba(255,255,255,.82); font-size: 1.05rem; max-width: 30rem; }
.acceso-hero ul { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .5rem; }
.acceso-hero li { padding-left: 1.6rem; position: relative; color: #fff; font-weight: 600; }
.acceso-hero li::before { content: ""; position: absolute; left: 0; top: .35em; width: .8rem; height: .8rem; border-radius: 50%; background: var(--acento); }
.acceso-pantalla .acceso { width: 100%; max-width: 26rem; margin: 0 auto; }
.acceso-pantalla .tarjeta { box-shadow: 0 24px 60px rgba(0,0,0,.35); }
@media (min-width: 52rem) { .acceso-pantalla { grid-template-columns: 1.1fr 1fr; gap: 4rem; min-height: 70vh; } .acceso-pantalla .acceso { margin: 0 0 0 auto; } }
@media (max-width: 51.99rem) { .acceso-hero ul, .acceso-hero p { display: none; } .acceso-hero { text-align: center; } .acceso-hero h2 { font-size: 1.6rem; margin-top: .75rem; } }

.soporte-lista { list-style: none; padding: 0; margin: 0 0 1rem; }
.soporte-fila { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; margin-bottom: .6rem; }
.soporte-fila form { margin: 0; }
.soporte-fila .soporte-nombre { flex: 1 1 18rem; min-width: 0; }
.soporte-fila button { margin-top: 0; width: auto; height: 100%; }
.soporte-fila .soporte-nombre button { width: 100%; justify-content: flex-start; text-align: left; }

button.sec.b-ok { background: #e7f6ec; color: #11662e; border-color: #8fd0a6; }
button.sec.b-ok:hover { background: #11662e; color: #fff; border-color: #11662e; }
button.sec.b-aviso { background: #fff1e3; color: #9a4a00; border-color: #f0b27a; }
button.sec.b-aviso:hover { background: #d9680a; color: #fff; border-color: #d9680a; }
button.sec.b-peligro { background: #fdeaea; color: #a11818; border-color: #ec9a9a; }
button.sec.b-peligro:hover { background: #c62828; color: #fff; border-color: #c62828; }
button.sec.b-gris { background: #eef0f4; color: #4a5266; border-color: #c7ccd8; }
button.sec.b-gris:hover { background: #4a5266; color: #fff; border-color: #4a5266; }
.soporte-fila form + form { margin-left: .35rem; }
