/* Base: reinicio, tipografía, logo y armazón en 2 pisos (U-1, desde diseno/sistema.css aprobado el 2026-11-19). */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--letra); font-size: var(--t-m); line-height: 1.45;
  background: var(--sup-0); color: var(--texto); -webkit-font-smoothing: antialiased;
}
[data-tema] { color: var(--texto); background: var(--sup-0); }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--texto); }
h1 { font-size: var(--t-xxl); } h2 { font-size: var(--t-l); } h3 { font-size: var(--t-m); }
p { margin: 0; }
a { color: var(--acento); }
svg { flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--foco); }
::selection { background: var(--seleccion-fondo); color: var(--seleccion-texto); }
input, textarea { caret-color: var(--acento); }
.oculto { display: none !important; }
.mut { color: var(--texto-2); }
.tenue { color: var(--texto-3); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--letra-mono); }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: var(--borde-fuerte) transparent; }

/* ---------- Logo y marca ---------- */
.logo { width: 34px; height: 34px; border-radius: var(--radio-s); display: grid; place-items: center; flex: none; }
.logo-ico { position: relative; display: block; width: 100%; height: 100%; }
.logo-ico::before, .logo-ico::after {
  content: ""; position: absolute; inset: -11%;
  -webkit-mask: url('/logo-a.png') center / contain no-repeat;
  mask: url('/logo-a.png') center / contain no-repeat;
  background: var(--logo-a);
}
.logo-ico::after {
  -webkit-mask-image: url('/logo-b.png');
  mask-image: url('/logo-b.png');
  background: var(--marca-acento);
}
.wm { font-weight: 800; letter-spacing: -0.035em; line-height: 1; color: var(--texto); }
.wm i { font-style: normal; color: var(--marca-acento); }

/* ---------- Armazón en 2 pisos  ---------- */
.armazon { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; background: var(--sup-0); }
.barra-sup {
  position: sticky; top: 0; z-index: 50; height: var(--alto-barra); min-height: var(--alto-barra);
  padding: 0 var(--e-5); background: var(--sup-2); border-bottom: 1px solid var(--borde); box-shadow: var(--sombra-1);
  display: flex; align-items: center; justify-content: space-between; gap: var(--e-3);
}
.barra-izq { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; flex: none; line-height: 1; }
.barra-izq .logo { width: 32px; height: 32px; }
.barra-titulo { font-size: 18px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; line-height: 1;
  display: inline-flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texto); }
.abrev { background: var(--acento); color: var(--acento-texto); font-size: var(--t-xs); font-weight: 800; height: 24px;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
  padding: 0 9px; border-radius: var(--radio-xs); letter-spacing: .05em; white-space: nowrap; flex: none; }

.barra-centro { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center;
  justify-content: center; pointer-events: none; max-width: calc(100% - 540px); min-width: 0; }
.barra-centro > * { pointer-events: auto; }
.hud-mando { height: 38px; border-radius: var(--radio-redondo); background: var(--sup-3); border: 1px solid var(--borde-fuerte);
  padding: 3px var(--e-2); display: flex; align-items: center; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.hud-mando::-webkit-scrollbar { display: none; }
.hud-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--texto-2);
  border-radius: var(--radio-redondo); height: var(--alto-chico); padding: 0 10px; font-size: var(--t-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; cursor: pointer; white-space: nowrap;
  transition: background var(--transicion), color var(--transicion); }
.hud-btn:hover { background: var(--sup-hover); color: var(--texto); }
.hud-val { font-family: var(--letra-mono); font-size: var(--t-s); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-val.ambar { color: var(--est-ambar); }
.hud-val.pendiente { color: var(--est-pendiente); }
.hud-val.curso { color: var(--est-hecho); }
.hud-val.atrasado { color: var(--peligro); }

.centro-srv { display: grid; text-align: center; line-height: 1.25; }
.centro-srv-titulo { font-size: var(--t-s); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--texto); }
.centro-srv-sub { font-size: var(--t-2xs); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--texto-2); }

.usuario { display: inline-flex; align-items: center; gap: 10px; flex: none; position: relative; line-height: 1; }
.hud-search-trigger { display: inline-flex; align-items: center; gap: 7px; height: var(--alto-chico); padding: 0 10px;
  border-radius: var(--radio-s); border: 1px solid var(--borde-fuerte); background: var(--sup-1);
  color: var(--texto-2); font-size: var(--t-s); font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background var(--transicion), color var(--transicion), border-color var(--transicion); }
.hud-search-trigger:hover { background: var(--sup-3); color: var(--texto); border-color: var(--texto-3); }
.hud-search-trigger svg { width: 15px; height: 15px; }
.vivo { width: 8px; height: 8px; border-radius: 50%; background: var(--texto-3); flex: none; }
.vivo.on { background: var(--vivo); box-shadow: 0 0 0 3px var(--vivo-halo); }
.reporta-txt { font-size: var(--t-xs); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; height: 32px; line-height: 1; }
.reporta-txt .rol-etq { color: var(--texto-3); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.reporta-txt .quien { color: var(--texto); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.puntos-barra { width: 32px; height: 32px; border: 1px solid var(--borde-fuerte); border-radius: var(--radio-s);
  background: var(--sup-1); color: var(--texto); display: inline-grid; place-items: center; cursor: pointer; padding: 0;
  transition: background var(--transicion), border-color var(--transicion); }
.puntos-barra:hover { background: var(--sup-3); border-color: var(--texto-3); }
.puntos-barra svg { width: 18px; height: 18px; }

.barra-pestanas { min-height: var(--alto-pestanas); position: sticky; top: var(--alto-barra); z-index: 40;
  background: var(--sup-1); border-bottom: 1px solid var(--borde); padding: 0 var(--e-4);
  display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.barra-pestanas::-webkit-scrollbar { display: none; }
.nav-tab { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: 12px 12px 10px;
  border-bottom: 2px solid transparent; color: var(--texto-2); white-space: nowrap;
  transition: color var(--transicion), border-color var(--transicion), background var(--transicion); }
.nav-tab svg { width: 16px; height: 16px; }
.nav-tab:hover { color: var(--texto); background: var(--sup-hover); }
.nav-tab.activo { color: var(--texto); border-bottom-color: var(--acento); }

.contenido { padding: 14px var(--e-5) var(--e-5); display: grid; gap: 14px; max-width: 100%; min-width: 0; align-content: start; }
kbd { font-family: var(--letra-mono); font-size: var(--t-2xs); font-weight: 600; color: var(--texto-3); background: var(--sup-2);
  border: 1px solid var(--borde); border-bottom-width: 2px; border-radius: var(--radio-xs); padding: 1px 5px; line-height: 1.4; }

@media (max-width: 1120px) {
  .barra-centro { position: static; transform: none; max-width: none; flex: 1 1 auto; min-width: 0; }
  .hud-lbl-largo { display: none; }
  .hud-lbl-corto { display: inline; }
  .hud-mando { gap: 3px; padding: 2px 4px; height: 34px; }
  .hud-btn { padding: 0 7px; gap: 4px; font-size: 10.5px; }
  .reporta-txt { display: none; }
}
@media (max-width: 960px) {
  .barra-sup { padding: 0 var(--e-3); gap: var(--e-2); }
  .barra-titulo { font-size: 16px; }
  .centro-srv { display: none; }
  .barra-pestanas { padding: 0 var(--e-3); }
  .nav-tab { padding: 10px 9px 8px; gap: 5px; }
  .contenido { padding: 12px var(--e-3) 28px; gap: 12px; }
}
@media (max-width: 760px) {
  .barra-sup { height: auto; flex-wrap: wrap; padding: var(--e-2) var(--e-3); gap: var(--e-2); }
  .barra-izq { flex: 1; }
  .barra-izq .barra-izq { flex: none; } /* el enlace del logo dentro de la barra (p. ej. /resultados) no se encoge */
  .barra-izq > .centro-srv-sub { display: none; } /* en celular el nombre ya está en la hoja */
  .barra-titulo { font-size: var(--t-l); }
  .barra-centro { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .hud-search-trigger kbd { display: none; }
  .barra-pestanas { top: 0; padding: 0 10px; }
  .contenido { padding: 14px var(--e-3) 40px; gap: var(--e-3); }
}

/* ===== Local 20-nov: estilo del 19-nov restaurado. Abajo, solo lo que agregaron versiones posteriores
   (funciones nuevas y variables que faltaban); nada de aquí cambia una regla de arriba. ===== */
body.sheet-abierto { overflow: hidden; }
#app, .armazon, .acceso { width: 100%; max-width: 100%; min-width: 0; overflow-x: clip; }
button, a, select, input, textarea { touch-action: manipulation; }
.hud-btn:active { transform: scale(0.96); }
.hud-lbl-corto { display: none; }
.puntos-barra, .barra-ico-btn {
  width: 34px; height: 34px; border: 1px solid var(--borde); border-radius: var(--radio-s);
  background: var(--sup-1); color: var(--texto); display: inline-grid; place-items: center; cursor: pointer; padding: 0;
  transition: background var(--transicion), border-color var(--transicion), transform var(--transicion);
}
.puntos-barra:hover, .barra-ico-btn:hover { background: var(--sup-2); border-color: var(--borde-fuerte); }
.puntos-barra:active, .barra-ico-btn:active { transform: scale(0.93); }
.barra-ico-btn.activo { background: var(--acento-suave); border-color: var(--acento-borde); color: var(--acento); }
.puntos-barra svg, .barra-ico-btn svg { width: 18px; height: 18px; }
.contenido > * { min-width: 0; max-width: 100%; }
.dock-movil { display: none; }
@media (max-width: 768px) {
  .barra-sup {
    min-height: calc(50px + var(--seguro-sup));
    height: auto;
    flex-wrap: wrap;
    padding: calc(var(--seguro-sup) + 7px) 12px 7px;
    gap: 6px;
  }
  .barra-izq { flex: 1 1 auto; gap: 8px; }
  .barra-izq .logo { width: 26px; height: 26px; }
  .barra-izq .barra-izq { flex: none; }
  .barra-izq > .centro-srv-sub { display: none; }
  .barra-titulo { font-size: 16px; }
  .puntos-barra, .barra-ico-btn { width: 36px; height: 36px; border-radius: 11px; }
  .barra-centro { order: 3; flex-basis: 100%; width: 100%; justify-content: stretch; }
  .hud-mando {
    width: 100%; height: 32px; padding: 2px;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
    border-radius: 10px; background: var(--sup-2); border: 1px solid var(--borde); box-shadow: none;
    overflow: hidden;
  }
  .hud-btn {
    flex-direction: row; justify-content: center; align-items: center; gap: 4px;
    height: 100%; padding: 0 3px; border-radius: 8px;
    background: var(--sup-1); font-size: 10px; font-weight: 700; letter-spacing: .01em; text-transform: uppercase;
  }
  .hud-btn .hud-val { font-size: 12.5px; line-height: 1; }
  .hud-lbl-largo { display: none; }
  .hud-lbl-corto { display: inline; overflow: hidden; text-overflow: ellipsis; }
  .hud-search-trigger kbd { display: none; }
  .armazon.con-dock .barra-pestanas { display: none; }
  .barra-pestanas { top: 0; padding: 0 10px; }
  .contenido { padding: 10px 12px calc(24px + var(--seguro-inf)); gap: 10px; }
  .armazon.con-dock .contenido { padding-bottom: calc(84px + var(--seguro-inf)); }
  .dock-movil {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: center;
    gap: 2px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + var(--seguro-inf));
    z-index: 70;
    height: 58px;
    padding: 4px;
    border-radius: 18px;
    background: var(--sup-vidrio);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--borde-fuerte);
    box-shadow: var(--sombra-dock);
  }
  .dock-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: 100%; border: 0; border-radius: 13px; background: transparent;
    color: var(--texto-2); text-decoration: none; cursor: pointer; padding: 3px 2px;
    font-size: 10px; font-weight: 650; letter-spacing: .01em; line-height: 1;
    transition: background var(--transicion), color var(--transicion), transform var(--transicion);
    min-width: 0;
  }
  .dock-item svg { width: 19px; height: 19px; transition: transform var(--transicion); }
  .dock-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .dock-item:active { transform: scale(0.91); }
  .dock-item.activo {
    background: var(--acento-suave);
    color: var(--acento);
    font-weight: 750;
    box-shadow: inset 0 0 0 1px var(--acento-borde);
  }
  .dock-item.activo svg { transform: translateY(-1px); }
}
.lanzador-lista { display: grid; gap: 6px; padding: 4px 0 6px; }
.lanzador-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radio-m);
  border: 1px solid var(--borde); background: var(--sup-1); color: var(--texto);
  text-decoration: none; text-align: left; cursor: pointer;
  font-size: var(--t-m); font-weight: 650;
  transition: background var(--transicion), border-color var(--transicion), transform var(--transicion);
}
.lanzador-item:active { transform: scale(0.98); }
.lanzador-item.activo { border-color: var(--acento-borde); background: var(--acento-suave); color: var(--acento); }
.lanzador-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--sup-2); color: var(--acento);
}
.lanzador-item.activo .lanzador-ico { background: var(--acento); color: var(--acento-texto); }
.lanzador-ico svg { width: 18px; height: 18px; }
.lanzador-txt { display: grid; gap: 1px; flex: 1; min-width: 0; }
.lanzador-txt span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lanzador-sub { font-size: var(--t-xs); font-weight: 450; color: var(--texto-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lanzador-flecha { width: 16px; height: 16px; color: var(--texto-3); flex: none; }
.vivo-puente { border: 0; padding: 0; cursor: pointer; position: relative; background: var(--texto-3); }
.vivo-puente::after { content: ''; position: absolute; inset: -10px; }
.vivo-puente.on { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.26); }
.vivo-puente.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.24); }
.vivo-puente.oculto { display: none; }
.hud-btn.activo {
  background: var(--acento-suave);
  color: var(--acento);
  box-shadow: inset 0 0 0 1px var(--acento-borde);
}
@media (min-width: 769px) and (max-width: 1024px) {
  .hud-mando { max-width: 100%; justify-content: center; }
  .barra-izq .logo { width: 28px; height: 28px; }
  .barra-titulo { font-size: 15.5px; }
  .barra-pestanas { mask-image: linear-gradient(to right, #000 94%, transparent 100%); -webkit-mask-image: linear-gradient(to right, #000 94%, transparent 100%); }
}
