/* ==========================================================================================================
   Barra superior con menús (rediseño 18-nov-2026) — templates/_pestanas.html
   Una fila: marca · menús de las apps (desplegables con módulos y páginas) · acciones de la cuenta.
   Menos de 1100 px (celular, tableta, ventana angosta): los menús van en un panel lateral (botón ☰).
   Los colores de cada app salen de estilos.css (.esp-administrativo { --app-1 ... }).
   ========================================================================================================== */

/* La fila (reemplaza la barra de dos pisos de antes) */
.tb { backdrop-filter: none; background: rgb(2 3 40 / 0.28); }
.tb-fila { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 0.9rem; padding: 0.55rem 1.5rem; min-height: 4rem; }
@media (min-width: 1600px) { .tb-fila { max-width: 1760px; } }
@media (min-width: 1024px) { .tb-fila { padding-left: 2.25rem; padding-right: 2.25rem; } }

.tb-marca { display: flex; align-items: center; gap: 0.75rem; min-width: 0; color: #fff; text-decoration: none; flex-shrink: 1; }
.tb-marca .marca-logo img { height: 2.15rem; width: auto; }
.tb-titulo { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tb-titulo small { display: flex; align-items: center; gap: 0.4rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(255 255 255 / 0.62); white-space: nowrap; }
.tb-titulo strong { font-size: 1rem; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22rem; }

/* Los menús de las apps. 18-nov-2026, el usuario: "elimina las de arriba" -> en PC ya no van en la barra (las
   opciones se despliegan desde los botones grandes de las apps, más abajo); el bloque solo se usa en el panel ☰ del celular. */
.tb-menu { display: none; }
@media (min-width: 1100px) { .tb-hamburguesa, .tb-velo { display: none !important; } }
.tb-menu-cab { display: none; }
.tb-item { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.8rem; border-radius: 0.7rem; cursor: pointer;
  color: rgb(255 255 255 / 0.84); font-weight: 650; font-size: 0.92rem; text-decoration: none; list-style: none; white-space: nowrap;
  transition: background-color .15s, color .15s; position: relative; user-select: none; }
.tb-item::-webkit-details-marker { display: none; }
.tb-item:hover, .tb-grupo[open] > .tb-item { background: rgb(255 255 255 / 0.11); color: #fff; }
.tb-item.activo { color: #fff; background: rgb(255 255 255 / 0.13); }
.tb-item.activo::after { content: ""; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.18rem; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--esp-a1), var(--esp-a2)); }
.tb-item:focus-visible { outline: 2px solid var(--esp-a2); outline-offset: 2px; }
.tb-ico { display: inline-grid; place-items: center; flex-shrink: 0; }
.tb-ico svg { width: 1.15rem; height: 1.15rem; }
.tb-flecha svg { width: 0.9rem; height: 0.9rem; transition: transform .18s; opacity: 0.75; }
.tb-grupo[open] .tb-flecha svg { transform: rotate(180deg); }
.tb-grupo { position: relative; }

/* El panel que se despliega: los módulos de la app, cada uno con sus páginas */
.tb-panel { position: absolute; top: calc(100% + 0.55rem); left: 0; z-index: 80; width: min(780px, calc(100vw - 2rem));
  background: #fff; color: #1B1E2B; border-radius: 1rem; padding: 0.9rem; text-align: left;
  box-shadow: 0 26px 60px -14px rgb(2 3 40 / 0.5), 0 0 0 1px rgb(4 6 119 / 0.07); animation: tb-entra .16s ease-out; }
.tb-grupo:last-of-type .tb-panel { left: auto; right: 0; }
.tb-panel::before { content: ""; position: absolute; top: -0.6rem; left: 0; right: 0; height: 0.6rem; }   /* el mouse cruza sin cerrarlo */
@keyframes tb-entra { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tb-panel-cab { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.15rem 0.45rem 0.7rem;
  border-bottom: 1px solid #EEF0F6; margin-bottom: 0.6rem; }
.tb-panel-cab strong { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--app-1); }
.tb-resumen { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 700; color: var(--app-1);
  text-decoration: none; padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--app-suave); }
.tb-resumen:hover { filter: brightness(0.96); }
.tb-resumen svg { width: 0.9rem; height: 0.9rem; }
.tb-modulos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
.tb-modulos.uno { grid-template-columns: 1fr; }
.tb-grupo:has(.tb-modulos.uno) .tb-panel { width: min(440px, calc(100vw - 2rem)); }
.tb-modulo { border-radius: 0.8rem; padding: 0.55rem; transition: background-color .12s; }
.tb-modulo:hover { background: var(--app-suave); }
.tb-modulo.activo { background: var(--app-suave); box-shadow: inset 3px 0 0 var(--app-2); }
.tb-modulo-cab { display: flex; align-items: flex-start; gap: 0.7rem; text-decoration: none; color: inherit; }
.tb-modulo-cab .tb-ico { width: 2.25rem; height: 2.25rem; border-radius: 0.65rem; background: var(--app-suave); color: var(--app-1); }
.tb-modulo:hover .tb-modulo-cab .tb-ico, .tb-modulo.activo .tb-modulo-cab .tb-ico { background: #fff; }
.tb-modulo-cab strong { display: block; font-size: 0.93rem; font-weight: 750; color: #12152A; }
.tb-modulo-cab small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.77rem; color: #5B6170; line-height: 1.35; margin-top: 0.1rem; }
.tb-paginas { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.45rem 0 0.1rem 2.95rem; padding: 0; list-style: none; }
.tb-paginas a { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.24rem 0.62rem; border-radius: 999px; text-decoration: none;
  background: #F2F3F9; color: #2C3048; transition: background-color .12s, color .12s; }
.tb-paginas a:hover { background: var(--app-1); color: #fff; }
.tb-paginas a.activa { background: var(--app-1); color: #fff; }

/* Acciones de la derecha */
.tb-acciones { display: flex; align-items: center; gap: 0.45rem; margin-left: auto; flex-shrink: 0; }
.tb-reloj { display: none; }
@media (min-width: 1500px) { .tb-reloj { display: inline-flex; } }
@media (max-width: 1499px) {   /* portátiles de 1280-1440: que quepan los 4 menús, el conteo y la cuenta */
  .tb-titulo strong { max-width: 14rem; }
  .tb-item { padding-left: 0.65rem; padding-right: 0.65rem; }
  .tb-fila { gap: 0.6rem; }
}
.tb-actualizar { padding: 0.5rem !important; }
.tb-globo { background: #ED3139; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; margin-left: 2px; }
.tb-usuario-txt { display: none; }
@media (min-width: 1440px) { .tb-usuario-txt { display: block; } }
.tb-liviano { display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; color: inherit; }
.tb-hamburguesa { display: none; width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; border: 0; cursor: pointer;
  background: rgb(255 255 255 / 0.12); color: #fff; place-items: center; }
.tb-hamburguesa svg { width: 1.4rem; height: 1.4rem; }
.tb-velo { position: fixed; inset: 0; background: rgb(2 3 40 / 0.45); z-index: 9990; }
html.tb-abierto .barra-superior { z-index: 9995; }   /* el panel (dentro de la barra) queda sobre el velo y sobre todo lo demás */
.tb-acciones .nv-envoltura { order: -1; }

/* --------------------------------------------------- Celular, tableta y ventanas angostas: panel lateral */
@media (max-width: 1099px) {
  .tb-fila { padding: 0.5rem 0.9rem; min-height: 3.5rem; gap: 0.6rem; }
  .tb-marca .marca-logo img { height: 1.8rem; }
  .tb-titulo strong { font-size: 0.95rem; max-width: 46vw; }
  .tb-hamburguesa { display: inline-grid; }
  .tb-menu { display: flex; position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 90vw); margin: 0; z-index: 90; flex-direction: column; align-items: stretch;
    gap: 0.15rem; padding: 1rem 0.8rem 2rem; background: #fff; overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(105%); transition: transform .22s ease-out; box-shadow: -18px 0 50px rgb(2 3 40 / 0.35); visibility: hidden; }
  html.tb-abierto .tb-menu { transform: none; visibility: visible; }
  html.tb-abierto body { overflow: hidden; }
  .tb-menu-cab { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #8A8FA3; padding: 0.2rem 0.6rem 0.6rem; }
  .tb-item { color: #1B1E2B; width: 100%; padding: 0.8rem 0.75rem; font-size: 1rem; border-radius: 0.75rem; }
  .tb-item:hover, .tb-grupo[open] > .tb-item { background: #F2F3F9; color: #1B1E2B; }
  .tb-item.activo { background: var(--app-suave, #EEF0FC); color: var(--app-1, #040677); }
  .tb-item.activo::after { display: none; }
  .tb-item .tb-flecha { margin-left: auto; }
  .tb-item .tb-ico { color: var(--app-1, #040677); }
  .tb-menu .tb-panel { position: static; width: auto !important; box-shadow: none; padding: 0.25rem 0 0.6rem; animation: none; border-radius: 0; }
  .tb-menu .tb-panel::before { display: none; }
  .tb-menu .tb-panel-cab { border: 0; margin: 0; padding: 0.1rem 0.4rem 0.4rem 0.75rem; }
  .tb-menu .tb-panel-cab strong { display: none; }
  .tb-modulos { grid-template-columns: 1fr; }
  .tb-paginas a { padding: 0.4rem 0.75rem; font-size: 0.85rem; }   /* dedos: blancos más grandes */
}

/* --------------------------------------------------- Botones grandes de las apps que despliegan sus opciones */
.app-desplegable { position: relative; display: block; min-width: 0; }
.app-desplegable > summary { list-style: none; cursor: pointer; }
.app-desplegable > summary::-webkit-details-marker { display: none; }
.app-desplegable .app-boton-flecha svg { transition: transform .18s; }
.app-desplegable[open] .app-boton-flecha svg { transform: rotate(180deg); }
.app-desplegable[open] > .app-boton { border-color: var(--app-3); }
.app-desplegable.activo > .app-boton { box-shadow: 0 0 0 2px var(--app-3); }
.app-desplegable > .tb-panel { top: calc(100% + 0.6rem); left: 0; z-index: 85; }
.app-desplegable:nth-child(3) > .tb-panel, .app-desplegable:last-child > .tb-panel { left: auto; right: 0; }
.menu-modulos:has(.app-desplegable[open]) { position: relative; z-index: 70; }
/* Celular y tableta: el panel sale como una hoja desde abajo (la fila de botones se desliza de lado y lo recortaría) */
@media (max-width: 1099px) {
  .app-desplegable > .tb-panel { position: fixed; left: 0.5rem; right: 0.5rem; top: auto; bottom: 0.5rem; width: auto; max-height: 72vh;
    overflow-y: auto; overscroll-behavior: contain; z-index: 9996; border-radius: 1.1rem; box-shadow: 0 -10px 60px rgb(2 3 40 / 0.55); }
  .app-desplegable > .tb-panel::before { display: none; }
  .app-desplegable > .tb-panel .tb-modulos { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .tb-titulo small { display: none; }
  .tb-actualizar { display: none !important; }
}

/* ==========================================================================================================
   MODO LIVIANO (rediseño 18-nov-2026, decisión del usuario): en celulares y PC de pocos recursos la decoración
   se ve COMPLETA pero QUIETA (nunca se quita: regla del usuario). Lo prende el script del principio de
   _cabeza.html (html.liviano) según el equipo, o la persona en su menú de cuenta.
   - La decoración (navidad nv-*, halloween hw-*, escena del inicio, camión de carga) queda en su primer cuadro.
   - Lo demás (entradas de tarjetas, transiciones) salta directo al final: se ve todo de una, sin esperar.
   - Sin desenfoques de fondo (backdrop-filter), que en equipos lentos cuestan mucho.
   ========================================================================================================== */
html.liviano [class*="nv-"], html.liviano [class*="nv-"] *, html.liviano [class*="hw-"], html.liviano [class*="hw-"] *,
html.liviano .inicio-foto, html.liviano .inicio-lema, html.liviano .inicio-puntos i, html.liviano .carga-gayco, html.liviano .carga-gayco *,
html.liviano [class*="nv-"]::before, html.liviano [class*="nv-"]::after, html.liviano [class*="hw-"]::before, html.liviano [class*="hw-"]::after {
  animation-play-state: paused !important; }
html.liviano *:not([class*="nv-"], [class*="nv-"] *, [class*="hw-"], [class*="hw-"] *, .inicio-foto, .inicio-lema, .inicio-puntos i, .carga-gayco, .carga-gayco *) {
  animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important; }
html.liviano * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; scroll-behavior: auto !important; }
