/* Mika — armazón de la sesión iniciada (rediseño R3 y R7, 2026-11-03): barra lateral y barra superior del zip. Tramo 5d.
   Solo aplica con body.con-lateral (lateral.js): tablero, asistente, planes, usuarios y novedades. El editor, la portada
   y el acceso siguen con la cabecera de siempre. Escritorio: columna de 225 px; móvil: barra de pestañas abajo.
   Medidas y colores salen de .sidebar, .side-nav, .topbar y .breadcrumb del zip (styles.css y product.css). */
.migas, .boton-buscar, .boton-avatar { display: none; }
body.con-lateral { display: grid; grid-template-columns: 225px minmax(0, 1fr); grid-template-rows: auto 1fr auto; height: auto; min-height: 100%; }
body.con-lateral > .barra { grid-column: 2; grid-row: 1; min-height: 82px; padding: 0 38px; gap: 10px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 90%, var(--bg)); }
body.con-lateral > main { grid-column: 2; grid-row: 2; min-width: 0; }
body.con-lateral > .pie-app { grid-column: 2; grid-row: 3; }
body.con-lateral > .lateral { grid-column: 1; grid-row: 1 / span 3; }
body.con-lateral .barra .marca, body.con-lateral .barra__lema, body.con-lateral .barra__centro:empty,
body.con-lateral .barra__acciones:empty, body.con-lateral .barra__cuenta > :not(.barra__creditos) { display: none; }

/* Barra superior: migas a la izquierda; lupa, créditos, accesibilidad, tema y avatar a la derecha (el orden del zip) */
body.con-lateral .migas { display: flex; align-items: center; flex: 1; gap: 12px; flex-wrap: wrap; order: 1; font-size: .81rem; min-width: 0; color: var(--muted); }
.migas a { color: var(--muted); text-decoration: none; min-height: 24px; }
.migas a:hover { text-decoration: underline; }
.migas strong { color: var(--primary); font-weight: 500; }
.migas__sep { color: var(--muted); }
body.con-lateral .boton-buscar { display: inline-flex; order: 2; width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 50%; flex: none; }
body.con-lateral .boton-buscar:hover { background: var(--soft); }
body.con-lateral .barra__cuenta { order: 3; margin-left: 0; gap: 10px; }
body.con-lateral .barra__cuenta::after { content: ""; height: 24px; width: 1px; background: var(--line); margin: 0 4px; }
body.con-lateral .barra__creditos { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .8rem; font-weight: 400; white-space: nowrap; }
body.con-lateral .barra__creditos svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.con-lateral #boton-accesibilidad { order: 4; margin-left: 0; }
body.con-lateral #boton-tema { order: 5; margin-left: 0; }
body.con-lateral .boton-avatar:not([hidden]) { display: inline-grid; order: 6; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; border-radius: 50%; }

.avatar { width: 34px; height: 34px; flex: none; background: var(--soft); border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--primary); font-size: .8rem; font-weight: 600; }

/* Columna lateral */
.lateral { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: 29px 20px 32px; background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--soft) 20%, var(--card)));
  border-right: 1px solid var(--line); overflow-y: auto; }
.lateral .lateral__marca { display: grid; justify-items: start; gap: 4px; color: var(--ink); text-decoration: none; padding: 0 13px; }
.lateral__marca img { width: 140px; height: auto; }
.lateral__marca small { font-size: .8rem; color: var(--muted); margin-left: 1px; }
.lateral__nav { display: grid; gap: 9px; margin-top: 38px; }
.lateral a, .lateral button { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 13px 15px; border-radius: 9px; border: 1px solid transparent;
  color: var(--ink); text-decoration: none; font-size: .84rem; background: none; text-align: left; width: 100%; position: relative;
  transition: background .2s, color .2s, border-color .2s; }
.lateral a:hover, .lateral button:hover { background: var(--soft); }
.lateral a[aria-current="page"] { color: var(--primary); background: var(--soft); font-weight: 650; box-shadow: 0 4px 12px rgba(99, 70, 255, .02);
  border-color: color-mix(in srgb, var(--primary) 13%, var(--line)); }
.lateral a[aria-current="page"]::before { content: ""; height: 16px; width: 2px; background: var(--primary); position: absolute; left: 1px; border-radius: 5px; }
.lateral svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lateral__pie { margin-top: auto; display: grid; gap: 12px; padding-top: 16px; }
.lateral__pie > a, .lateral__pie > button { font-size: .8rem; padding: 10px; }
.lateral__cuenta { gap: 10px; }
.lateral__nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lateral__cuenta .lateral__flecha { width: 15px; height: 15px; margin-left: auto; }

/* Menú de la cuenta */
.menu-cuenta { position: fixed; z-index: 60; min-width: 200px; display: grid; padding: 6px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(35, 22, 63, .14); }
.menu-cuenta[hidden] { display: none; }
.menu-cuenta button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left; font-size: .85rem; }
.menu-cuenta button:hover { background: var(--soft); }

/* Poca altura (portátiles, barras del navegador): la columna se compacta y, si aun así no cabe, hace scroll propio con «Salir» alcanzable */
@media (min-width: 861px) and (max-height: 800px) {
  .lateral { padding: 16px 16px 12px; overscroll-behavior: contain; }
  .lateral__nav { margin-top: 16px; gap: 4px; }
  .lateral a, .lateral button { padding-block: 6px; }
  .lateral__pie { gap: 4px; padding-top: 8px; }
}

@media (max-width: 860px) {
  body.con-lateral { grid-template-columns: minmax(0, 1fr); padding-bottom: 72px; }
  body.con-lateral > .barra, body.con-lateral > main, body.con-lateral > .pie-app { grid-column: 1; }
  body.con-lateral > .barra { min-height: 0; padding: .6rem 1rem; }
  body.con-lateral > .lateral { grid-column: 1; grid-row: auto; }
  body.con-lateral .barra .marca { display: block; }
  body.con-lateral .migas, body.con-lateral .boton-buscar { display: none; }
  body.con-lateral .barra__cuenta { margin-left: auto; }
  body.con-lateral .barra__cuenta::after { display: none; }
  .lateral { position: fixed; inset: auto 0 0 0; z-index: 40; height: 68px; flex-direction: row; gap: 0; padding: 0 .25rem; background: var(--card);
    border-right: 0; border-top: 1px solid var(--line); overflow: visible; }
  .lateral .lateral__marca, .lateral__pie > :not(#lateral-salir) { display: none; }
  .lateral__nav, .lateral__pie { display: contents; }
  .lateral a, .lateral button { flex: 1 1 0; flex-direction: column; justify-content: center; gap: .15rem; padding: 0 .1rem; font-size: .72rem;
    min-width: 0; text-align: center; width: auto; min-height: 56px; border-radius: 0; }
  .lateral a[aria-current="page"] { box-shadow: inset 0 3px 0 var(--coral); border-color: transparent; }
  .lateral a[aria-current="page"]::before { display: none; }
}
@media (max-width: 480px) {
  body.con-lateral > .barra { padding-inline: .75rem; }
  body.con-lateral .barra__creditos { padding-inline: 8px; }
  body.con-lateral .barra__creditos svg { display: none; }
}

/* Objetivos táctiles de 44 px en las pantallas con armazón (el enlace «Volver», las migas y los botones chicos de la lista) */
body.con-lateral .volver { display: inline-flex; align-items: center; min-height: 44px; }
body.con-lateral .migas a { display: inline-flex; align-items: center; min-height: 44px; }
body.con-lateral .boton--chico { min-height: 44px; }
body.con-lateral .filtro-estado button, body.con-lateral .periodo button { min-height: 44px; }
body.con-lateral .tablero__enlaces a { min-height: 44px; }
