/* Estructura de la app: menú lateral fijo y plegable en escritorio, cajón con fondo oscurecido en celular (hasta 720 px),
   barra superior del celular y enlace para saltar al contenido. El comportamiento está en menu.js. */

.armazon { display: flex; align-items: flex-start; min-height: 100dvh; }
.contenido { flex: 1; min-width: 0; }

.saltar {
  position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none; transition: top .15s;
}
.saltar:focus { top: 12px; }

/* ── Marca (menú, barra del celular e ingreso) ───────────────── */

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px;
  background: var(--brand); color: var(--on-brand); font-size: 16px; font-weight: 700; line-height: 1;
}
.brand-texto { min-width: 0; }
.brand h1, .brand-nombre { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; display: block; }
.brand .tagline { margin-top: 1px; font-size: 11px; font-weight: 500; line-height: 1.25; color: var(--muted); }

/* ── Menú lateral ────────────────────────────────────────────── */

.lateral {
  position: sticky; top: 0; flex: none; align-self: flex-start; display: flex; flex-direction: column; gap: 6px;
  width: var(--menu); height: 100dvh; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line);
  z-index: 30; transition: width .2s ease;
}
.lat-marca { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 14px; }

.ibtn {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.ibtn:hover { color: var(--ink); background: var(--soft); }
.ibtn svg, .lat-item svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ibtn svg { width: 18px; height: 18px; }
.lat-cerrar { display: none; }

/* El relleno con margen negativo deja lugar al anillo de foco, que el overflow recortaría, sin mover nada. */
.lat-nav { display: flex; flex-direction: column; flex: 1; gap: 2px; min-height: 0; overflow-y: auto; padding: 4px; margin: -4px; }
.lat-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px;
  border: 0; border-radius: 12px; background: none; color: var(--muted); cursor: pointer; text-align: left;
  font-family: var(--sans); font-size: 14px; font-weight: 500; transition: color .15s, background .15s;
}
.lat-item svg { flex: none; width: 20px; height: 20px; }
.lat-item:hover { background: var(--soft); color: var(--ink); }
.lat-item.active { background: var(--brand-soft); color: var(--brand-soft-ink); font-weight: 600; }
.lat-grow { flex: 1; }
.lat-sep { height: 1px; margin: 8px 6px; background: var(--line); }

.nav-count {
  display: none; margin-left: auto; padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--am-bg); color: var(--am); font-size: 11px; font-weight: 700; line-height: 1.5;
}
.nav-count.on { display: inline-block; }

.lat-usuario {
  display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 14px 6px 2px; border-top: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}
.lat-inicial {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--vi-bg); color: var(--vi); font-size: 13px; font-weight: 700;
}
.quien { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lat-usuario .btn { margin-left: auto; }

/* ── Plegado (solo escritorio) ───────────────────────────────── */

.armazon.plegado .lateral { width: var(--menu-plegado); }
.armazon.plegado .lbl {          /* el texto sigue disponible para lectores de pantalla */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.armazon.plegado .brand { justify-content: center; }
.armazon.plegado .lat-marca { flex-direction: column; gap: 12px; padding-bottom: 10px; }
.armazon.plegado .lat-plegar svg { transform: rotate(180deg); }
.armazon.plegado .lat-item { justify-content: center; padding: 10px; }
.armazon.plegado .nav-count.on { position: absolute; top: 5px; right: 6px; margin: 0; padding: 0 5px; font-size: 10px; }
.armazon.plegado .lat-usuario { justify-content: center; }
.armazon.plegado .lat-usuario .btn, .armazon.plegado .quien { display: none; }

/* ── Barra superior del celular ──────────────────────────────── */

.movil-barra, .velo { display: none; }

@media (max-width: 720px) {
  .lateral, .armazon.plegado .lateral {
    position: fixed; top: 0; bottom: 0; left: 0; width: 288px; height: auto; transform: translateX(-105%); visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  .armazon.abierto .lateral { transform: none; visibility: visible; box-shadow: var(--shadow-menu); transition-delay: 0s; }
  .armazon.plegado .lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .armazon.plegado .brand { justify-content: flex-start; }
  .armazon.plegado .lat-marca { flex-direction: row; padding-bottom: 14px; }
  .armazon.plegado .lat-item { justify-content: flex-start; padding: 10px 12px; }
  .armazon.plegado .nav-count.on { position: static; margin-left: auto; padding: 1px 8px; font-size: 11px; }
  .armazon.plegado .lat-usuario { justify-content: flex-start; }
  .armazon.plegado .lat-usuario .btn { display: inline-flex; }
  .armazon.plegado .quien { display: block; }
  .lat-plegar { display: none; }
  .lat-cerrar { display: grid; width: 44px; height: 44px; }
  .velo { position: fixed; inset: 0; z-index: 20; background: var(--scrim); }
  .armazon.abierto .velo { display: block; }
  .movil-barra {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .movil-barra .brand { flex: 1; }
  .movil-barra .ibtn { width: 44px; height: 44px; }
  .movil-barra .brand .tagline { display: none; }
  html.menu-abierto, html.menu-abierto body { overflow: hidden; }
}
