  /* ---------- barra lateral de secciones (complementa las pestañas de arriba) ---------- */
  :root { --alto-cab: 58px; --ancho-barra: 212px; }
  #barra-lateral { position: fixed; left: 0; top: var(--alto-cab); bottom: 0; z-index: var(--z-nav); width: var(--ancho-barra);
    display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; overflow-y: auto;
    background: linear-gradient(180deg, rgba(18,19,23,.94), rgba(12,13,16,.94)); border-right: 1px solid var(--border);
    transition: width .25s cubic-bezier(.3,.8,.3,1), padding .25s; }
  #btn-barra { justify-content: flex-start; gap: 8px; font-size: 12px; color: var(--text-secondary); background: transparent; border-color: transparent; padding: 6px 8px; }
  #btn-barra:hover { background: rgba(255,255,255,.05); color: var(--text-primary); }
  #barra-enlaces { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
  #barra-enlaces a { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; color: var(--text-secondary);
    text-decoration: none; font-size: 13px; border-left: 2px solid transparent; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
  #barra-enlaces a:hover { background: rgba(255,255,255,.05); color: var(--text-primary); }
  #barra-enlaces a[aria-current="true"] { color: var(--text-primary); background: rgba(245,165,36,.09); border-left-color: var(--accent); }
  #barra-enlaces .grupo { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 6px 9px 2px; }
  /* grupos desplegables: nombre (enlace a su primera página) + flecha; las entradas cuelgan con sangría y se ocultan al cerrar */
  #barra-enlaces .grupo-cab { display: flex; align-items: center; gap: 2px; }
  #barra-enlaces .grupo-cab .grupo-enlace { flex: 1; min-width: 0; }
  #barra-enlaces .grupo-barra.activo-grupo > .grupo-cab .grupo-enlace { color: var(--text-primary); }
  #barra-enlaces .grupo-flecha { flex: none; display: grid; place-items: center; width: 28px; height: 30px; padding: 0; border: 0; border-radius: 8px;
    background: transparent; color: var(--text-muted); cursor: pointer; }
  #barra-enlaces .grupo-flecha:hover { background: rgba(255,255,255,.05); color: var(--text-primary); }
  #barra-enlaces .grupo-flecha .chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
  #barra-enlaces .grupo-barra.abierto > .grupo-cab .chev { transform: rotate(45deg); }
  #barra-enlaces .grupo-hijos { display: none; flex-direction: column; gap: 1px; margin: 1px 0 3px 14px; padding-left: 6px; border-left: 1px solid var(--border); }
  #barra-enlaces .grupo-barra.abierto > .grupo-hijos { display: flex; }
  #barra-enlaces a.hijo { padding: 6px 9px; font-size: 12.5px; }
  #barra-enlaces a.hijo .ico { width: 15px; height: 15px; }
  body.barra-abierta > :is(#alertas-sesgo, #avisos, main) { margin-left: var(--ancho-barra); transition: margin-left .25s cubic-bezier(.3,.8,.3,1); }
  body:not(.barra-abierta) > :is(#alertas-sesgo, #avisos, main) { margin-left: 60px; transition: margin-left .25s cubic-bezier(.3,.8,.3,1); }
  body:not(.barra-abierta) #barra-lateral { width: 60px; padding: 12px 8px; }
  body:not(.barra-abierta) #barra-lateral .texto-barra { display: none; }
  body:not(.barra-abierta) #btn-barra { justify-content: center; padding: 8px; }
  body:not(.barra-abierta) #barra-enlaces a { justify-content: center; padding: 10px 0; border-left-width: 0; border-radius: 10px; }
  body:not(.barra-abierta) #barra-enlaces a .ico { width: 19px; height: 19px; }
  body:not(.barra-abierta) #barra-enlaces a[aria-current="true"] { box-shadow: inset 2px 0 0 var(--accent); }
  /* comprimida: solo iconos; los grupos se ven siempre abiertos (si no, sus entradas serían inalcanzables) y sin flecha */
  body:not(.barra-abierta) #barra-enlaces .grupo-flecha { display: none; }
  body:not(.barra-abierta) #barra-enlaces .grupo-hijos { display: flex; margin: 0; padding: 0; border-left: 0; }
  body:not(.barra-abierta) #barra-enlaces a.hijo { padding: 10px 0; }
  body:not(.barra-abierta) #barra-enlaces a.hijo .ico { width: 19px; height: 19px; }
  .panel, #gamma, .vista-cab { scroll-margin-top: calc(var(--alto-cab) + 12px); }
  #alertas-sesgo:empty, #avisos:empty { margin: 0; }
  @media (max-width: 900px) {
    /* en móvil la barra empieza plegada y, al abrirse, se superpone al contenido (no lo empuja) */
    body > :is(#alertas-sesgo, #avisos, main) { margin-left: 0 !important; }
    body:not(.barra-abierta) #barra-lateral { width: 44px; height: 44px; bottom: auto; border-radius: 0 10px 10px 0; border: 1px solid var(--border); border-left: 0; }
    body:not(.barra-abierta) #barra-enlaces { display: none; }
    body.barra-abierta #barra-lateral { width: min(260px, 80vw); box-shadow: 12px 0 30px -10px rgba(0,0,0,.8); }
    /* móvil: zonas de pulsación de ~40 px para el dedo */
    body.barra-abierta #barra-enlaces a { padding-top: 10px; padding-bottom: 10px; }
    body.barra-abierta #barra-enlaces a.hijo { padding-top: 9px; padding-bottom: 9px; }
    body.barra-abierta #barra-enlaces .grupo-flecha { width: 40px; height: 40px; }
    body:not(.barra-abierta) :is(.vista, #alertas-sesgo, #avisos) { padding-left: 52px; }
  }

  /* filas de indicadores: en móvil se reparten en varias líneas en vez de desbordar */
  .kpis { flex-wrap: wrap; }
  @container vista (max-width: 700px) { .kpis .kpi { min-width: calc(50% - 6px); } .kpis .kpi .v { overflow-wrap: anywhere; } .kpis .kpi .v.grande { font-size: 22px; } }
  .cifras-multi { display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .cifras-multi > span { white-space: nowrap; }
  .cifras-multi > span.principal b { color: var(--accent-2, #f5a524); }
  .stats-total { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 12px; border-radius: 9px; background: rgba(255,255,255,.03); font-size: 13px; margin-bottom: 6px; }
  .stats-tipo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 15px; }
  .stats-tipo .que { font-size: 12px; font-weight: 400; }
  /* ---------- una sola página por secciones ---------- */
  .bloque { display: grid; gap: 18px; scroll-margin-top: calc(var(--alto-cab) + 12px); }
  .bloque + .bloque { margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--border); }
  .bloque > .seccion-cab h2 { font-size: 19px; }
  #barra-enlaces a.sub { padding: 4px 9px 4px 34px; font-size: 12px; color: var(--text-muted); }
  .pestanas-cal { display: flex; gap: 4px; background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px; padding: 3px; width: fit-content; }
  .pestanas-cal button { border: 0; background: transparent; color: var(--text-secondary); padding: 6px 14px; border-radius: 7px; }
  .pestanas-cal button[aria-selected="true"] { background: linear-gradient(180deg, #2c2f36, #24262c); color: var(--text-primary); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
  .cal-lista { display: grid; gap: 6px; }
  .cal-ev { display: grid; grid-template-columns: 52px auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 8px 10px; border-radius: 9px;
    border: 1px solid var(--border); border-left: 3px solid var(--text-muted); font-size: 12.5px; }
  .cal-ev.rojo { border-left-color: var(--critical); background: rgba(208,59,59,.06); }
  .cal-ev.amarillo { border-left-color: #f3c04f; background: rgba(243,192,79,.05); }
  .cal-ev.gris { opacity: .8; }
  .cal-ev .hora { color: var(--text-muted); padding-top: 2px; }
  .cal-ev .n .que { font-size: 12px; }
  .efectos-cal { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }
  .ver-gris { font-size: 12px; color: var(--text-muted); display: inline-flex; gap: 6px; align-items: center; }
  .pre-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .pre-card { border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; background: rgba(255,255,255,.02); font-size: 12.5px; display: grid; gap: 6px; align-content: start; }
  .pre-card.ancha { grid-column: span 2; }
  @container vista (max-width: 700px) { .pre-card.ancha { grid-column: auto; } }
  .pre-card > .t { font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); display: flex; gap: 6px; align-items: center; }
  .pre-gamma { padding: 4px 0; } .pre-gamma + .pre-gamma { border-top: 1px dashed var(--border-2); padding-top: 8px; }
  .pre-niveles { display: flex; flex-wrap: wrap; gap: 4px 14px; } .pre-niveles .tp { color: var(--good-text); } .pre-niveles .sl { color: var(--critical-text); }
  .pre-vix { border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border-2); } .pre-vix b { font-size: 22px; }
  .pre-vix.verde { border-color: rgba(12,163,12,.6); background: rgba(12,163,12,.10); } .pre-vix.amarillo { border-color: rgba(243,192,79,.6); background: rgba(243,192,79,.08); }
  .pre-vix.naranja { border-color: rgba(240,138,60,.65); background: rgba(240,138,60,.10); } .pre-vix.rojo { border-color: rgba(208,59,59,.7); background: rgba(208,59,59,.14); }
  .pre-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
  .pre-lista li { line-height: 1.4; } .pre-lista li.rojo { border-left: 2px solid var(--critical); padding-left: 6px; } .pre-lista li.amarillo { border-left: 2px solid #f3c04f; padding-left: 6px; }
  .pre-sesgo + .pre-sesgo { border-top: 1px dashed var(--border-2); padding-top: 6px; }
  table.mini td { padding: 3px 6px; font-size: 12.5px; }
  .bc-semana li.alto.hawk { border-left: 2px solid var(--critical); padding-left: 6px; background: rgba(208,59,59,.06); }
  .bc-semana li.alto.dove { border-left: 2px solid var(--good); padding-left: 6px; background: rgba(12,163,12,.06); }
  tr.alerta > td { background: rgba(208,59,59,.06); }
  /* micro-animaciones: solo efectos de hover, apertura y cambio de pestaña (no cambian orden ni estructura) */
  @media (prefers-reduced-motion: no-preference) {
    .tarjeta, .sesgo-card, .cb, .kpi, .evento-clave, .decision-tipo, .agenda-bc .ag, .vip-chip, .tono-banco, .alerta-sesgo {
      transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
    .tarjeta:hover, .sesgo-card:hover, .cb:hover, .kpi:hover, .decision-tipo:hover, .evento-clave:hover {
      transform: translateY(-2px); box-shadow: 0 8px 22px -10px rgba(0,0,0,.65); border-color: var(--border-2); }
    .agenda-bc .ag:hover, .tono-banco:hover, .vip-chip:hover { transform: translateY(-1px); border-color: var(--border-2); }
    .panel { transition: border-color .2s ease, box-shadow .2s ease; }
    .panel:hover { border-color: var(--border-2); }
    button:active:not(:disabled) { transform: scale(.97); }
    .selector-bancos button { transition: background .2s, color .2s, border-color .2s, transform .1s; }
    /* desplegables: el contenido entra deslizando */
    details.animar[open] > :not(summary) { animation: desplegar .24s ease-out; }
    @keyframes desplegar { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
    /* cambio de pestaña: la vista entra con un fundido */
    .vista:not(.oculto) { animation: aparecer .28s ease-out; }
    @keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
    .tabs button[aria-selected="true"] { animation: pestaña .25s ease-out; }
    @keyframes pestaña { from { transform: scale(.94); } to { transform: none; } }
    tbody tr:hover > td { background: rgba(255,255,255,.025); }
    .vivo-flash { animation: destello .9s ease-out; }
    @keyframes destello { from { background: rgba(245,165,36,.28); } to { background: transparent; } }
    /* entrada de cada sección: fundido + deslizamiento suave, escalonado */
    .panel.entra { animation: entrar-seccion .5s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
    @keyframes entrar-seccion { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
    /* brillo dorado al aparecer las tarjetas y etiquetas VIP */
    .tarjeta.es-vip { animation: brillo-vip 1.8s ease-out .2s backwards; border-color: rgba(245,197,66,.35); }
    @keyframes brillo-vip { 0% { box-shadow: 0 0 0 0 rgba(245,197,66,0); } 35% { box-shadow: 0 0 26px 2px rgba(245,197,66,.45); } 100% { box-shadow: 0 0 0 0 rgba(245,197,66,0); } }
    .vip { animation: brillo-etiqueta 1.6s ease-out backwards; }
    @keyframes brillo-etiqueta { 0% { box-shadow: 0 0 0 0 rgba(245,165,36,0); } 40% { box-shadow: 0 0 16px 2px rgba(245,165,36,.8); } 100% { box-shadow: 0 0 10px -2px rgba(245,165,36,.7); } }
    .vip-chip { animation: brillo-chip 1.6s ease-out backwards; }
    @keyframes brillo-chip { 40% { box-shadow: 0 0 14px 1px rgba(245,197,66,.45); } }
    /* pulso suave en lo de ALTO IMPACTO */
    .rojo-chip { animation: pulso-rojo 2.4s ease-in-out 3; }
    @keyframes pulso-rojo { 0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,72,.55); } 55% { box-shadow: 0 0 0 5px rgba(229,72,72,0); } }
    .alto-impacto, .cb.alto:not(.dove), .agenda-bc .ag.importante { animation: pulso-caja 3.2s ease-in-out 3; }
    .cb.alto.dove { animation: pulso-verde 3.2s ease-in-out 3; }
    @keyframes pulso-verde { 0%, 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } 50% { box-shadow: 0 0 0 3px rgba(12,163,12,.2); } }
    .rojo-chip.verde-chip { animation-name: pulso-verde-chip; }
    @keyframes pulso-verde-chip { 0%, 100% { box-shadow: 0 0 0 0 rgba(19,138,19,.55); } 55% { box-shadow: 0 0 0 5px rgba(19,138,19,0); } }
    @keyframes pulso-caja { 0%, 100% { box-shadow: 0 0 0 0 rgba(208,59,59,.0), 0 10px 30px -14px rgba(208,59,59,.6); } 50% { box-shadow: 0 0 0 3px rgba(208,59,59,.18), 0 10px 30px -10px rgba(208,59,59,.75); } }
    /* barras de convicción y de acierto que se llenan al aparecer */
    .conviccion .seg i.on { animation: llenar-seg .4s ease-out backwards; }
    .conviccion .seg i.on:nth-child(2) { animation-delay: .12s; } .conviccion .seg i.on:nth-child(3) { animation-delay: .24s; }
    @keyframes llenar-seg { from { transform: scaleX(0); transform-origin: left; } to { transform: none; } }
    .barra-conv i { animation: crecer-barra .8s cubic-bezier(.2,.8,.2,1) backwards; transform-origin: left; }
    @keyframes crecer-barra { from { transform: scaleX(0); } to { transform: none; } }
    /* onda al pulsar botones y tarjetas */
    .ripple-caja { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 0; }
    .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.16); animation: onda .6s ease-out forwards; }
    @keyframes onda { to { transform: scale(1); opacity: 0; } }
    /* pestañas: indicador que se desliza y vista que entra desde el lado de la pestaña elegida */
    .tabs { position: relative; }
    .tabs .indicador-tab { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 7px; pointer-events: none;
      background: linear-gradient(180deg, #2c2f36, #24262c); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 2px 6px rgba(0,0,0,.35);
      transition: transform .32s cubic-bezier(.3,.8,.3,1), width .32s cubic-bezier(.3,.8,.3,1); }
    .tabs.con-indicador button { position: relative; z-index: 1; }
    .tabs.con-indicador button[aria-selected="true"] { background: transparent; box-shadow: none; animation: none; }
    .vista[data-dir="d"]:not(.oculto) { animation: entrar-dcha .32s ease-out; }
    .vista[data-dir="i"]:not(.oculto) { animation: entrar-izq .32s ease-out; }
    @keyframes entrar-dcha { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
    @keyframes entrar-izq { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
  }
  @media (forced-colors: active) { .leyenda i, .tipo::before { forced-color-adjust: none; border: 1px solid CanvasText; } }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
    .persona { transition-duration: .001ms !important; }
  }

