/* ============================================================
   Tabs — componente ÚNICO de pestañas (portal y módulos).
   ------------------------------------------------------------
   Barra sticky justo debajo de la appbar. El estado activo NO
   depende solo del color: subrayado de 3px + peso de fuente 800.
   Texto inactivo #4a5a6e sobre blanco = 7.5:1; activo, la variante
   --module-accent-ink de cada área (≥4.5:1 sobre blanco).
   ============================================================ */
:root{ --tabs-h:48px; }

nav.tabs{
  position:sticky;top:var(--ab-h,56px);z-index:50;
  background:var(--surface,#fff);border-bottom:1px solid var(--line,#e2e8f1);
  box-shadow:0 1px 0 rgba(20,40,70,.04);
}
.tabs-inner{
  max-width:1280px;margin:0 auto;padding:0 14px;
  display:flex;align-items:stretch;gap:2px;min-height:var(--tabs-h);
}

.tab{
  appearance:none;border:0;background:none;cursor:pointer;font:inherit;
  display:flex;flex-direction:column;justify-content:center;gap:1px;
  color:var(--ink-soft,#4a5a6e);font-size:14px;font-weight:500;
  padding:0 14px;min-height:var(--tabs-h);white-space:nowrap;
  border-bottom:3px solid transparent;margin-bottom:-1px;
  transition:color .15s,background .15s;
}
/* La subetiqueta también es texto: --ink-faint (#8a98ab) se queda en 2.9:1
   sobre blanco, así que va con el gris AA de la appbar. */
.tab .tab-sub{font-size:10.5px;font-weight:500;color:var(--ab-muted,#5f6d80);letter-spacing:.01em}
.tab:hover{color:var(--ink,#16202e);background:var(--surface-2,#f7f9fc)}
.tab:active{background:#eef2f7}
.tab[aria-selected="true"]{
  color:var(--module-accent-ink,#2f5fb3);font-weight:600;
  border-bottom-color:var(--module-accent,#2f5fb3);
}
.tab[aria-selected="true"] .tab-sub{color:var(--module-accent-ink,#2f5fb3)}
.tab:focus-visible{outline:2px solid var(--ab-ring,#4c8dff);outline-offset:-3px;border-radius:6px}

/* Menú «Más»: desbordamiento controlado por encima de 5 pestañas.
   Todas las pestañas existen siempre en el tablist; en escritorio las
   excedentes se ocultan y se alcanzan por el menú. La activa nunca es
   una excedente (el componente la promociona), así que el tablist
   siempre expone la pestaña seleccionada. */
@media (min-width:640px){
  .tab[data-extra="1"]{display:none}
}
.tab-more{margin-left:auto;display:flex;align-items:stretch}
.tab-more>button{margin-left:6px;flex-direction:row;align-items:center}
.tab-more>button[aria-expanded="true"]{background:var(--surface-2,#f7f9fc);color:var(--ink,#16202e)}
.tab-more .tab-chev{display:inline-block;margin-left:6px;font-size:10px;opacity:.7}

/* Los paneles ya usan .view/.view.active de cada hoja de módulo. */
.view:focus{outline:none}
.view:focus-visible{outline:2px solid var(--ab-ring,#4c8dff);outline-offset:4px;border-radius:8px}

/* ---------------- Móvil: tira con scroll-snap y máscaras ---------------- */
@media (max-width:639px){
  :root{--tabs-h:44px}
  .tabs-inner{
    padding:0 12px;gap:0;
    overflow-x:auto;scroll-snap-type:x proximity;overscroll-behavior-x:contain;
    scrollbar-width:none;-ms-overflow-style:none;
    -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 14px,#000 calc(100% - 14px),transparent 100%);
            mask-image:linear-gradient(90deg,transparent 0,#000 14px,#000 calc(100% - 14px),transparent 100%);
  }
  .tabs-inner::-webkit-scrollbar{display:none}
  .tab{scroll-snap-align:center;padding:0 12px;font-size:13.5px}
  .tab .tab-sub{display:none}
  /* en la tira caben todas: no hace falta el menú «Más» */
  .tab-more{display:none}
}

@media (prefers-reduced-motion:reduce){
  .tab{transition:none}
  .tabs-inner{scroll-behavior:auto}
}
