/* Portal de distribuidores de Hostelum (WOW-279).
   Estética «dashboard de producto» (referencia que eligió Jan: Flux
   Dashboard): modo oscuro, paneles translúcidos tipo cristal, menú lateral,
   barras y progreso animados. Los degradados son SIEMPRE los de la marca
   Hostelum —el del logo: negro, azul #2575e6, menta #39d39a—, nunca otros.
   Primero el móvil: el distribuidor lo abre delante del hotelero. */
:root {
  --fondo: #070b14;
  --fondo-2: #0c1322;
  --panel: rgba(255, 255, 255, .045);
  --panel-borde: rgba(255, 255, 255, .09);
  --panel-hover: rgba(255, 255, 255, .07);
  --text: #e8eef9;
  --muted: #8b98b3;
  --line: rgba(255, 255, 255, .08);
  --blue: #2575e6;
  --blue-claro: #5b9bf3;
  --menta: #39d39a;
  --green: #39d39a;
  --amber: #f5b13d;
  --red: #f26b6b;
  --grad: linear-gradient(90deg, #030404 -11%, #2575e6 50%, #39d39a 100%);
  --grad-suave: linear-gradient(90deg, #2575e6 0%, #39d39a 100%);
  --grad-hero: linear-gradient(115deg, #030404 -15%, #1b5ec2 35%, #2575e6 60%, #39d39a 120%);
  --radio: 16px;
}
* { box-sizing: border-box; }
html { background: var(--fondo); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(37, 117, 230, .18), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(57, 211, 154, .10), transparent 60%),
    var(--fondo);
  background-attachment: fixed;
}
a { color: var(--blue-claro); text-decoration: none; }
a:hover { color: #fff; }
svg { width: 18px; height: 18px; flex: none; }

/* ---------- marco: lateral + contenido ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
  padding: 18px 14px; background: rgba(7, 11, 20, .72); border-right: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow-y: auto;
}
.marca { display: flex; align-items: center; gap: 8px; padding: 4px 8px 14px; color: #fff; }
.marca img { height: 22px; }
.marca span { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.menu-grupo { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #5d6a85; padding: 12px 10px 4px; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: #b4c0d6; font-size: 13.5px; font-weight: 500; position: relative; }
.menu a:hover { background: var(--panel-hover); color: #fff; }
.menu a.activo { color: #fff; background: linear-gradient(90deg, rgba(37, 117, 230, .28), rgba(57, 211, 154, .10)); }
.menu a.activo::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-suave); }
.lateral-pie { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--grad-suave); flex: none; }
.lateral-pie .quien { min-width: 0; font-size: 12px; line-height: 1.3; }
.lateral-pie .quien div:first-child { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-pie .quien div + div { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral-pie a { color: var(--muted); margin-left: auto; display: flex; }
.lateral-pie a:hover { color: #fff; }

.contenido { min-width: 0; display: flex; flex-direction: column; }
.arriba { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(7, 11, 20, .6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.arriba-titulo { font-size: 13px; color: var(--muted); }
.arriba-titulo b { color: #fff; font-weight: 500; }
.arriba .boton-alta { margin-left: auto; }
.menu-boton { display: none; background: var(--panel); border: 1px solid var(--panel-borde); color: #fff; border-radius: 10px; padding: 6px 12px; font: inherit; }

.hoja { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 28px 56px; }
.hoja-sola { max-width: 420px; padding-top: 12vh; }

h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; color: #fff; }
h2 { font-size: 14.5px; font-weight: 600; margin: 0; color: #fff; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.leyenda { color: #6c7894; font-size: 12px; margin-top: 14px; }
.gris { color: var(--muted); font-size: 12px; }

/* ---------- cristal ---------- */
.tarjeta, .cifra, .acceso {
  background: var(--panel); border: 1px solid var(--panel-borde); border-radius: var(--radio);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .6);
}
.tarjeta { margin-bottom: 18px; animation: subir .5s ease both; }
.tarjeta > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tarjeta .cuerpo { padding: 18px; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.cifra { padding: 16px 18px; transition: transform .2s, border-color .2s; animation: subir .5s ease both; }
.cifra:nth-child(2) { animation-delay: .05s; } .cifra:nth-child(3) { animation-delay: .1s; } .cifra:nth-child(4) { animation-delay: .15s; } .cifra:nth-child(5) { animation-delay: .2s; }
.cifra:hover { transform: translateY(-2px); border-color: rgba(57, 211, 154, .35); }
.cifra-cabeza { display: flex; justify-content: space-between; align-items: center; }
.cifra-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--menta); background: rgba(57, 211, 154, .1); border: 1px solid rgba(57, 211, 154, .18); }
.cifra-ico svg { width: 16px; height: 16px; }
.cifra .rotulo { color: var(--muted); font-size: 12px; }
.cifra .valor { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; color: #fff; }
.cifra .nota { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

/* ---------- hero (degradado Hostelum) ---------- */
.hero {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; padding: 26px 28px; margin-bottom: 18px; border-radius: 20px;
  background: var(--grad-hero); position: relative; overflow: hidden; color: #fff; animation: subir .5s ease both;
  box-shadow: 0 24px 60px -28px rgba(37, 117, 230, .8);
}
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 220px at 90% 0%, rgba(255, 255, 255, .18), transparent 70%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 28px; }
.hero-eyebrow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .8); margin-bottom: 6px; }
.hero-frase { font-size: 16px; margin: 6px 0 4px; color: rgba(255, 255, 255, .92); }
.hero-frase b { font-weight: 600; color: #fff; }
.hero .progreso { background: rgba(255, 255, 255, .22); }
.hero .progreso > span { background: #fff; box-shadow: 0 0 18px rgba(255, 255, 255, .6); }
.hero .progreso-pie { color: rgba(255, 255, 255, .8); }
.hero-lado { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.hero-dato { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(3, 4, 4, .22); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px); }
.hero-dato span { font-size: 12px; color: rgba(255, 255, 255, .8); }
.hero-dato b { font-weight: 600; white-space: nowrap; }

/* ---------- progreso y barras (animadas) ---------- */
.progreso { position: relative; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); margin: 16px 0 6px; }
.progreso > span { display: block; height: 100%; width: var(--ancho, 0); border-radius: 999px; background: var(--grad-suave); animation: crecer 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.progreso.escalones i { position: absolute; top: -3px; width: 3px; height: 16px; margin-left: -1.5px; border-radius: 2px; background: #fff; opacity: .5; }
.progreso-pie, .escalones-pie { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.escalones-pie .logrado { color: var(--menta); }
.barras { display: grid; gap: 10px; }
.barra-fila { display: grid; grid-template-columns: 56px 1fr 110px; gap: 12px; align-items: center; }
.barra-pista { height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.barra-pista > span { display: block; height: 100%; width: var(--ancho, 0); min-width: 4px; border-radius: 999px; background: var(--grad-suave); animation: crecer 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.barra-fila:nth-child(2) .barra-pista > span { animation-delay: .06s; } .barra-fila:nth-child(3) .barra-pista > span { animation-delay: .12s; }
.barra-fila:nth-child(4) .barra-pista > span { animation-delay: .18s; } .barra-fila:nth-child(5) .barra-pista > span { animation-delay: .24s; } .barra-fila:nth-child(6) .barra-pista > span { animation-delay: .3s; }
@keyframes crecer { from { width: 0; } }
@keyframes subir { from { transform: translateY(8px); } } /* sin opacidad: si el navegador frena la animación, el contenido se ve igual */

/* ---------- tablas ---------- */
.tabla { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: #6c7894; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: rgba(255, 255, 255, .025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nw { white-space: nowrap; }

.estado { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #56627a; }
.estado.verde::before { background: var(--menta); box-shadow: 0 0 8px rgba(57, 211, 154, .7); }
.estado.ambar::before { background: var(--amber); }
.estado.rojo::before { background: var(--red); }
.estado.azul::before { background: var(--blue-claro); }
.estado .punto { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.estado:has(.punto)::before { display: none; }
tr.fila-actual td { background: rgba(37, 117, 230, .1); }

/* ---------- formularios ---------- */
form .campo { margin-bottom: 12px; }
.campo label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.campo input, .campo select, .campo textarea {
  width: 100%; border: 1px solid var(--panel-borde); border-radius: 10px; padding: 9px 11px; font: inherit;
  background: rgba(255, 255, 255, .04); color: var(--text); color-scheme: dark;
}
.campo select option { background: var(--fondo-2); }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 117, 230, .25); }
.fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.marcas { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 12px; }
.marcas label { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text); }
input[type=checkbox] { accent-color: var(--menta); }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--panel-borde); background: var(--panel); color: var(--text); border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.boton:hover { border-color: rgba(255, 255, 255, .25); color: #fff; background: var(--panel-hover); }
.boton.primario { background: var(--blue); border: 0; color: #fff; box-shadow: none; }
.boton.primario:hover { background: #1f66cc; color: #fff; }
.boton.boton-claro { background: #fff; color: #0c1322; border-color: #fff; }
.boton.peligro { color: var(--red); }
.boton.mini { padding: 4px 10px; font-size: 12px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filtros .campo { margin: 0; min-width: 150px; }
details summary { color: var(--muted); }

.aviso { border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; border: 1px solid var(--panel-borde); background: var(--panel); }
.aviso-success { border-color: rgba(57, 211, 154, .4); background: rgba(57, 211, 154, .08); }
.aviso-error { border-color: rgba(242, 107, 107, .45); background: rgba(242, 107, 107, .08); }
.vacio { color: var(--muted); padding: 18px; }
.lista-datos { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; margin: 0; }
.lista-datos dt { color: var(--muted); font-size: 12px; }
.lista-datos dd { margin: 0; }

/* ---------- acceso (login, contraseña) ---------- */
.acceso { padding: 28px; }
.acceso .logo { border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 8px; margin-bottom: 20px; background: var(--grad); }
.acceso .logo img { height: 22px; }
.acceso .logo span { color: rgba(255, 255, 255, .85); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- programa ---------- */
.tarjeta > header h2 { display: flex; align-items: center; gap: 8px; }
.tarjeta > header h2 svg { color: var(--menta); }
.programa-nivel { border-top: 3px solid var(--nivel, var(--blue)); }
.nivel-cabeza { display: flex; gap: 14px; align-items: center; }
.nivel-insignia { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--nivel); flex: none;
  background: color-mix(in srgb, var(--nivel) 18%, transparent); border: 1px solid color-mix(in srgb, var(--nivel) 45%, transparent); box-shadow: 0 0 30px -6px var(--nivel); }
.nivel-insignia svg { width: 28px; height: 28px; }
.nivel-nombre { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: #fff; }
.frase-clave { font-size: 15px; margin: 12px 0 6px; }
.frase-clave strong { font-weight: 600; color: var(--menta); }
.reto + .reto { border-top: 1px solid var(--line); }
.reto-cabeza { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; color: #fff; }
.numero-grande { font-size: 32px; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.numero-grande span { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.liga { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.liga > div { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; padding: 7px 12px; font-size: 13px; border-top: 1px solid var(--line); color: var(--muted); }
.liga > div:first-child { border-top: 0; }
.liga > div.yo { background: linear-gradient(90deg, rgba(37, 117, 230, .25), rgba(57, 211, 154, .12)); color: #fff; }
.logros { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.logro { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: rgba(255, 255, 255, .02); }
.logro svg { width: 22px; height: 22px; opacity: .45; }
.logro.ok { color: var(--text); border-color: rgba(57, 211, 154, .35); background: rgba(57, 211, 154, .07); }
.logro.ok svg { color: var(--menta); opacity: 1; filter: drop-shadow(0 0 6px rgba(57, 211, 154, .6)); }

/* ---------- móvil ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; z-index: 20; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .25s; }
  .lateral.abierto { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .menu-boton { display: block; }
  .arriba { padding: 12px 14px; }
  .hoja { padding: 16px 14px 48px; }
  .dos, .hero { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .lista-datos { grid-template-columns: 1fr; }
  .lista-datos dd { margin-bottom: 6px; }
  .barra-fila { grid-template-columns: 48px 1fr 92px; }
  .cifras { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cifra .valor { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.aviso-pendiente { border-color: rgba(57, 211, 154, .35); background: linear-gradient(90deg, rgba(37, 117, 230, .14), rgba(57, 211, 154, .10)); }
.aviso-pendiente b { color: #fff; font-weight: 600; }
.acceso h1 { margin-bottom: 6px; }

/* ---------- registro público ---------- */
.hoja-sola:has(.registro) { max-width: 1060px; padding-top: 6vh; }
.hoja-sola:has(.condiciones) { max-width: 760px; padding-top: 6vh; }
.registro { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.registro-hero { display: block; margin: 0; }
.registro-hero h1 { font-size: 30px; line-height: 1.15; margin: 4px 0 10px; }
.registro-niveles { display: grid; gap: 8px; margin: 16px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); }
.check input { margin-top: 3px; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.condiciones h2 { margin: 18px 0 6px; }
.condiciones p { color: #c4cee0; }
@media (max-width: 900px) { .registro { grid-template-columns: 1fr; } }

/* ---------- verificación en dos pasos ---------- */
.mfa-alta { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.mfa-qr { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 8px; }
.codigos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
code { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.codigos code { text-align: center; padding: 8px; }
@media (max-width: 900px) { .mfa-alta { grid-template-columns: 1fr; } }
/* Controles sueltos (dentro de tablas, sin .campo): mismo aspecto oscuro. */
table select, table input:not([type=checkbox]) { border: 1px solid var(--panel-borde); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; background: rgba(255, 255, 255, .04); color: var(--text); color-scheme: dark; }
table select option { background: var(--fondo-2); }

.aviso-vista-bo { border-color: rgba(245, 177, 61, .5); background: rgba(245, 177, 61, .1); position: sticky; top: 64px; z-index: 4; }
