/* Hoy: el resumen de Selección arriba (cifras compactas que abren lo que cuentan, lo que necesita a una persona, lo de hoy y lo que hace Sofía)
   y, debajo, lo de siempre en bloques plegables. Mismos tokens que el resto de Sofía. */

/* ---------- El resumen de Selección ---------- */
.hoy-sel { container: hoysel / inline-size; gap: var(--e4); padding: var(--e4) var(--e5); }
.hoy-sel h2 { font-size: var(--paso-2); }
.hoy-sel h3 { font-size: var(--paso-1); font-weight: 300; margin: 0 0 var(--e2); }
.hoy-sel h3 b { font-weight: 800; }

.hoy-indicadores { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(8.75rem, 1fr)); gap: var(--e2); }
.hoy-indicadores > li { display: flex; min-width: 0; }
.hoy-indicador {
  position: relative; flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 0.1rem; align-items: baseline; align-content: start;   /* la cifra arriba y su nombre debajo: el nombre usa todo el ancho de la celda y no se corta */
  padding: 0.6rem 0.8rem; border: 1px solid var(--ln); border-radius: 0.9rem; background: var(--r1); color: var(--tx); text-decoration: none;
  transition: border-color 0.18s, background-color 0.18s;
}
a.hoy-indicador:hover { border-color: var(--tx); background: var(--r3); }
a.hoy-indicador:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
.hoy-ind-valor { font-size: 1.55rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hoy-ind-texto { font-size: var(--paso--1); font-weight: 600; line-height: 1.25; color: var(--tx-2); }
.hoy-ind-detalle { grid-column: 1 / -1; margin-top: 0.15rem; font-size: 0.75rem; line-height: 1.3; color: var(--tx-3); overflow-wrap: anywhere; }
/* Lo que pide a una persona o está detenido: la raya inclinada de la marca, y la cifra en fuerte */
.hoy-indicador[data-alerta] { border-color: var(--bd); }
.hoy-indicador[data-alerta]::before { content: ""; position: absolute; top: 0.55rem; right: 0.6rem; width: 3px; height: 0.95rem; background: var(--amarillo); transform: skewX(-22deg); border-radius: 1px; }

.hoy-sel-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e4) var(--e5); padding-top: var(--e3); border-top: 1px solid var(--ln); }
.hoy-sel-col { min-width: 0; display: flex; flex-direction: column; }
@container hoysel (min-width: 34rem) { .hoy-sel-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hoy-sel-registro { grid-column: 1 / -1; } }
@container hoysel (min-width: 62rem) { .hoy-sel-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); } .hoy-sel-registro { grid-column: auto; } }

.hoy-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hoy-lista > li + li { border-top: 1px solid var(--ln); }
.hoy-prio, .hoy-act {
  display: flex; align-items: center; gap: var(--e2); min-height: 2.5rem; padding: 0.45rem 0.35rem; margin-inline: -0.35rem; border-radius: 0.7rem;
  color: var(--tx); text-decoration: none; font-size: var(--paso--1); line-height: 1.35; transition: background-color 0.16s;
}
.hoy-prio:hover, .hoy-act:hover { background: var(--r3); }
.hoy-prio:focus-visible, .hoy-act:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.hoy-prio > .icono:first-child { width: 1.05rem; height: 1.05rem; color: var(--tx-2); }
.hoy-prio > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.hoy-prio > .icono:last-child { width: 0.95rem; height: 0.95rem; color: var(--tx-3); transition: translate 0.2s var(--salida); }
.hoy-prio:hover > .icono:last-child { translate: 3px 0; color: var(--tx); }
.hoy-mas { margin-top: var(--e1); }
.hoy-mas > summary { cursor: pointer; font-size: var(--paso--1); font-weight: 700; color: var(--tx-2); padding: 0.45rem 0; list-style: none; }
.hoy-mas > summary::-webkit-details-marker { display: none; }
.hoy-mas > summary::after { content: " ▾"; }
.hoy-mas[open] > summary::after { content: " ▴"; }
.hoy-act-hora { flex: none; min-width: 4.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hoy-act-datos { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.hoy-act-datos > b, .hoy-act-datos > small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hoy-act-datos > small { color: var(--tx-3); font-size: 0.75rem; }
.hoy-enlace { margin-top: 0; padding-top: var(--e3); }   /* el enlace queda junto a su lista: ninguna columna se estira para igualar a la vecina */

/* ---------- «Qué está haciendo Sofía» (también lo usa Actividades) ---------- */
.registro { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 17.5rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--bd) transparent; }
.registro-linea { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.3rem 0.4rem; padding: 0.4rem 0; border-bottom: 1px solid var(--ln); font-size: var(--paso--1); line-height: 1.4; }
.registro-linea:last-child { border-bottom: 0; }
.registro-hora { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tx); }
.registro-sep { flex: none; color: var(--tx-3); }
.registro-texto { flex: 1 1 12rem; min-width: 0; color: var(--tx-2); text-decoration: none; overflow-wrap: anywhere; }
a.registro-texto:hover { color: var(--tx); text-decoration: underline; text-underline-offset: 0.2em; }
.registro-linea[data-nuevo] { animation: registro-nuevo 2.4s ease-out 1; }
@keyframes registro-nuevo { from { background: color-mix(in srgb, var(--amarillo) 32%, transparent); } to { background: transparent; } }
.registro-vacio { padding: var(--e2) 0; color: var(--tx-2); font-size: var(--paso--1); }
.registro-pie { display: flex; align-items: center; gap: 0.4rem; margin-top: var(--e2); font-size: 0.75rem; }
.registro-pie .icono { width: 0.9rem; height: 0.9rem; flex: none; }
.registro-pie[data-error] { color: var(--tx); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .registro-linea[data-nuevo] { animation: none; } }

/* ---------- Personal y fechas: las tarjetas urgentes fluyen en columnas según el ancho REAL del bloque ----------
   Antes cada nivel (vencidos, hoy, próximos…) tenía una cuadrícula con un número fijo de columnas: con dos tarjetas en tres columnas quedaba la mitad derecha vacía.
   Ahora los niveles y sus tarjetas corren en columnas de ancho natural: cuantas caben en el contenedor, cada tarjeta con su altura, sin estirarse y sin huecos a la derecha.
   No depende del ancho de la ventana: con el menú lateral abierto o cerrado, el bloque mide lo suyo (con dos columnas en una tableta, con cuatro en una pantalla ancha). */
.hoy-grupo-cuerpo { container: hoycuerpo / inline-size; }
.hoy-grupo-cuerpo > .hoy-tarjetas:not([hidden]) { display: block; columns: 19rem; column-gap: var(--e4); orphans: 1; widows: 1; }
@container hoycuerpo (min-width: 100rem) { .hoy-grupo-cuerpo > .hoy-tarjetas:not([hidden]) { columns: 21rem; } }
.hoy-tarjetas > .hoy-nivel { display: block; margin-bottom: var(--e4); }
.hoy-tarjetas > .hoy-nivel > .hoy-nivel-titulo { break-after: avoid; margin-bottom: var(--e3); }
.hoy-tarjetas > .hoy-nivel > .rejilla.tarjetas { display: block; }
.hoy-tarjetas > .hoy-nivel > .rejilla.tarjetas > .hoja { break-inside: avoid; margin-bottom: var(--e3); }
.hoy-tarjetas > .hoy-nivel > .rejilla.tarjetas > .hoja:last-child { margin-bottom: 0; }
.hoy-tarjetas > :is(.hoja, .hoy-plegable, .fila-flex, .hoy-resto) { break-inside: avoid; margin-bottom: var(--e4); }
/* «Lo que viene» y el aviso «Y N más» ocupan todo el ancho, debajo de las columnas de tarjetas: así la lista de fechas conserva sus dos columnas y no se vuelve una tira angosta */
.hoy-tarjetas > :is(.hoja.card-lista, .fila-flex, .hoy-resto) { column-span: all; }

/* ---------- Los bloques plegables de lo de siempre ---------- */
.hoy-grupo { border: 1px solid var(--ln); border-radius: var(--radio); background: var(--r1); }
.hoy-grupo > summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--e1) var(--e3); min-height: 3.25rem; padding: 0.7rem var(--e5) 0.7rem var(--e4);
  list-style: none; cursor: pointer; position: relative; border-radius: var(--radio);
}
.hoy-grupo > summary::-webkit-details-marker { display: none; }
.hoy-grupo > summary::after { content: ""; position: absolute; right: var(--e4); top: 50%; width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--tx-2); border-bottom: 2px solid var(--tx-2); rotate: 45deg; translate: 0 -75%; transition: rotate 0.2s var(--salida); }
.hoy-grupo[open] > summary::after { rotate: -135deg; translate: 0 -25%; }
.hoy-grupo > summary:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
.hoy-grupo > summary:hover { background: var(--r3); }
.hoy-grupo-titulo { font-size: var(--paso-1); font-weight: 300; letter-spacing: -0.02em; }
.hoy-grupo-titulo b { font-weight: 800; }
.hoy-grupo-linea { font-size: var(--paso--1); color: var(--tx-2); min-width: 0; overflow-wrap: anywhere; }
.hoy-grupo[open] > summary { border-bottom: 1px solid var(--ln); border-radius: var(--radio) var(--radio) 0 0; }
.hoy-grupo-cuerpo { display: flex; flex-direction: column; gap: var(--e4); padding: var(--e4); }
.hoy-grupo-cuerpo > .modo-hoy { align-self: flex-start; }
.hoy-grupo .hoja { background: var(--fondo); }
.hoy-grupo .hoja.ya { background: var(--ya-fondo); }
@media (prefers-reduced-motion: reduce) { .hoy-grupo > summary::after { transition: none; } }

@media (max-width: 599px) {
  .hoy-sel { padding: var(--e4); }
  .hoy-indicadores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hoy-indicador { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--e2); row-gap: 0; }   /* en el celular, la cifra al lado de su nombre ahorra altura */
  .hoy-ind-valor { font-size: 1.4rem; }
  .hoy-grupo-cuerpo { padding: var(--e3); }
  .hoy-grupo > summary { padding-left: var(--e3); }
  .registro { max-height: 15rem; }
}
