/* Componentes de la familia para apps Jinja (sin React). Replica el kit web/ con HTML plano.
   Va después de familia.css y antes del CSS propio; sólo usa sus variables (nada de colores sueltos). */

/* ---------- Tipografía: Inter variable autoalojada (latin + latin-ext), sin CDN ---------- */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fuentes/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fuentes/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Medidas compartidas (mismas que el @theme del kit React) ---------- */
:root {
  --fuente: "Inter Variable", "InterVariable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fuente-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radio-sm: 0.375rem;
  --radio-md: 0.5rem;
  --radio-lg: 0.75rem;
  --radio-xl: 1rem;
  --ancho-contenido: 80rem;
  --ancho-lateral: 15rem;
}

/* color-scheme alinea scrollbars y controles nativos con el tema activo. */
:root {
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
::before,
::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--fondo);
}
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1,
h2,
h3,
h4,
p,
figure,
dl,
dd {
  margin: 0;
}
h1 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
}
h2 {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
}
h3,
h4 {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}
a {
  color: var(--acento-fuerte);
  text-underline-offset: 0.2em;
}
a:not([class]):hover {
  text-decoration: underline;
}
code,
kbd,
pre {
  font-family: var(--fuente-mono);
  font-size: 0.875em;
}
hr {
  border: 0;
  border-top: 1px solid var(--borde);
  margin: 1rem 0;
}
img,
svg {
  vertical-align: middle;
}

/* Foco visible en todo elemento interactivo: nunca `outline: none` sin sustituto. */
:focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 2px;
}

/* ---------- Utilidades mínimas de disposición ---------- */
.pila {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pila--lg {
  gap: 1.5rem;
}
.fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.fila--entre {
  justify-content: space-between;
}
.empuja {
  margin-left: auto;
}

/* ---------- Estructura: barra lateral (md+) o barra inferior (móvil) con UN solo <nav class="nav"> ---------- */
.shell {
  display: flex;
  min-height: 100dvh;
  background: var(--fondo);
  color: var(--texto);
}
.shell__cuerpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

/* Contenido: en móvil deja sitio a la barra inferior y a la zona segura del iPhone. */
.contenido {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: var(--ancho-contenido);
  margin-inline: auto;
  padding: 1rem 1rem calc(5rem + env(safe-area-inset-bottom));
}

/* Barra superior: marca en móvil (la lateral no existe), título, acciones y selector de tema. */
.barra-superior {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: calc(3.5rem + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 1rem 0;
  border-bottom: 1px solid var(--borde);
  background: var(--panel);
}
.barra-superior__marca {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-weight: 600;
  color: var(--texto);
  text-decoration: none;
}
.barra-superior__marca svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--acento);
}
.barra-superior__titulo {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--texto);
}
.barra-superior__acciones {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navegación. Móvil: barra fija abajo con pestañas (icono sobre etiqueta); más de 5 destinos hacen scroll lateral. */
.nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  display: flex;
  overflow-x: auto;
  border-top: 1px solid var(--borde);
  background: var(--panel);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav__grupo {
  display: contents;
}
.nav .nav__marca,
.nav .nav__titulo {
  display: none;
}
.nav a {
  display: flex;
  flex: 1 0 4.5rem;
  min-height: 3.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0 0.25rem;
  font-size: 11px;
  font-weight: 500;
  color: var(--quieto);
  text-decoration: none;
  transition: color 0.15s;
}
.nav a svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.nav a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav a[aria-current="page"] {
  color: var(--acento-fuerte);
}

/* Escritorio (md = 48rem, igual que Tailwind): barra lateral fija con grupos y filas. */
@media (min-width: 48rem) {
  .contenido {
    padding: 1.5rem;
  }
  .nav {
    position: sticky;
    inset: 0 auto auto 0;
    z-index: auto;
    flex: 0 0 var(--ancho-lateral);
    flex-direction: column;
    gap: 1.25rem;
    width: var(--ancho-lateral);
    height: 100dvh;
    overflow-x: visible;
    overflow-y: auto;
    border-top: 0;
    border-right: 1px solid var(--borde);
    padding: 0 0.5rem 0.5rem;
  }
  .nav__grupo {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .nav a {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.75rem;
    min-height: 2.5rem;
    padding: 0.5rem;
    border-radius: var(--radio-md);
    font-size: 0.875rem;
    color: var(--texto);
    transition: background-color 0.15s, color 0.15s;
  }
  .nav a svg {
    width: 1rem;
    height: 1rem;
  }
  .nav a:hover {
    background: var(--fondo-sutil);
  }
  .nav a[aria-current="page"] {
    background: color-mix(in srgb, var(--acento) 10%, transparent);
    color: var(--acento-fuerte);
  }
  .nav .nav__marca {
    display: flex;
    gap: 0.5rem;
    height: 3.5rem;
    min-height: 0;
    padding: 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
  }
  .nav .nav__marca:hover {
    background: transparent;
  }
  .nav .nav__marca svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--acento);
  }
  .nav .nav__titulo {
    display: block;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    color: var(--quieto);
  }
  .barra-superior__marca {
    display: none;
  }
}

/* ---------- Tarjeta ---------- */
.tarjeta {
  border: 1px solid var(--borde);
  border-radius: var(--radio-lg);
  background: var(--panel);
}
.tarjeta__cabecera {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
}
.tarjeta__titulo {
  font-size: 0.875rem;
  line-height: 1;
  font-weight: 600;
  color: var(--texto);
}
.tarjeta__descripcion {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--quieto);
}
.tarjeta__cuerpo {
  padding: 1rem;
}
.tarjeta__cabecera + .tarjeta__cuerpo {
  padding-top: 0;
}
.tarjeta__pie {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

/* ---------- Botón: 44 px en móvil, 36 px desde md; <a>, <button> o <input type=submit> ---------- */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--radio-md);
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--texto);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s, filter 0.15s;
}
.boton:hover {
  text-decoration: none;
}
.boton svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.boton:disabled,
.boton[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}
.boton--primario {
  background: var(--acento);
  color: var(--sobre-acento);
}
.boton--primario:hover {
  filter: brightness(1.1);
}
.boton--secundario {
  background: var(--panel-elevado);
  border-color: var(--borde);
  color: var(--texto);
}
.boton--secundario:hover {
  border-color: var(--borde-fuerte);
}
.boton--fantasma {
  color: var(--texto);
}
.boton--fantasma:hover {
  background: var(--panel-elevado);
}
.boton--peligro {
  background: var(--rojo);
  color: var(--sobre-peligro);
}
.boton--peligro:hover {
  filter: brightness(1.1);
}
.boton--icono {
  width: 2.75rem;
  padding: 0;
}
@media (min-width: 48rem) {
  .boton {
    height: 2.25rem;
  }
  .boton--icono {
    width: 2.25rem;
  }
}
/* Después del @media para que gane en cualquier ancho: el kit React también deja «pequeño» en 28 px. */
.boton--pequeno {
  height: 1.75rem;
  padding: 0 0.625rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

/* ---------- Campos: 44 px y 16 px de letra en móvil (con menos, iOS hace zoom); 36 px y 14 px desde md ---------- */
:where(
    input:not(
        [type="checkbox"],
        [type="radio"],
        [type="range"],
        [type="file"],
        [type="color"],
        [type="submit"],
        [type="button"],
        [type="reset"],
        [type="image"],
        [type="hidden"]
      )
  ),
:where(select),
:where(textarea) {
  display: block;
  width: 100%;
  height: 2.75rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio-md);
  background: var(--entrada-fondo);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--texto);
}
:where(textarea) {
  height: auto;
  min-height: 5.5rem;
  padding-block: 0.5rem;
  resize: vertical;
}
:where(input)::placeholder,
:where(textarea)::placeholder {
  color: var(--quieto);
  opacity: 1;
}
/* Flecha del select dibujada con degradados para poder usar variables (un SVG en data: no puede). */
:where(select:not([multiple])) {
  appearance: none;
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--quieto) 50%),
    linear-gradient(135deg, var(--quieto) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 50%, calc(100% - 0.8rem) 50%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
}
:where(select[multiple]) {
  height: auto;
}
:where(input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
:where(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--rojo);
}
@media (min-width: 48rem) {
  :where(
      input:not(
          [type="checkbox"],
          [type="radio"],
          [type="range"],
          [type="file"],
          [type="color"],
          [type="submit"],
          [type="button"],
          [type="reset"],
          [type="image"],
          [type="hidden"]
        )
    ),
  :where(select),
  :where(textarea) {
    height: 2.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
  }
  :where(textarea) {
    height: auto;
  }
  :where(select[multiple]) {
    height: auto;
  }
}

/* Casilla y radio: control nativo teñido con el acento; la fila `.opcion` da el área táctil de 44 px. */
input[type="checkbox"],
input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--acento);
}
.opcion {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--texto);
}
@media (min-width: 48rem) {
  .opcion {
    min-height: 2.25rem;
  }
}

/* Interruptor: <input type="checkbox" role="switch">. Se ve de 20 px; el ::after amplía el área táctil a 44 px. */
input[type="checkbox"][role="switch"] {
  appearance: none;
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  border: 1px solid var(--borde);
  border-radius: 9999px;
  background: var(--entrada-fondo);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
input[type="checkbox"][role="switch"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.125rem;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border-radius: 9999px;
  background: white;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--texto) 30%, transparent);
  transition: transform 0.15s;
}
input[type="checkbox"][role="switch"]::after {
  content: "";
  position: absolute;
  inset: -0.75rem -0.25rem;
}
input[type="checkbox"][role="switch"]:checked {
  background: var(--acento);
  border-color: var(--acento);
}
input[type="checkbox"][role="switch"]:checked::before {
  transform: translateX(1rem);
}
input[type="checkbox"][role="switch"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Campo = etiqueta + control + ayuda + error. El error pinta el borde del control en rojo. */
.campo {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.campo > label,
.campo__etiqueta {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--texto);
}
.campo__ayuda {
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--quieto);
}
.campo__error {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--rojo-fuerte);
}
.campo--error :where(input, select, textarea) {
  border-color: var(--rojo);
}

/* ---------- Tabla densa con cifras tabulares; el envoltorio contiene el scroll lateral en móvil ---------- */
.tabla-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.tabla {
  width: 100%;
  border-collapse: collapse;
  caption-side: bottom;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.tabla th {
  height: 2.5rem;
  padding: 0 0.5rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--quieto);
}
.tabla thead tr {
  border-bottom: 1px solid var(--borde);
}
.tabla td {
  padding: 0.5rem;
  vertical-align: middle;
  color: var(--texto);
}
.tabla tbody tr {
  border-bottom: 1px solid var(--borde);
  transition: background-color 0.15s;
}
.tabla tbody tr:last-child {
  border-bottom: 0;
}
.tabla tbody tr:hover {
  background: var(--fondo-sutil);
}
.tabla tfoot td {
  border-top: 1px solid var(--borde);
  background: var(--fondo-sutil);
  font-weight: 500;
}
.tabla caption {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--quieto);
}
.tabla .num {
  text-align: right;
  white-space: nowrap;
}
/* Tabla compacta: menos relleno vertical. */
.tabla--densa td {
  padding-block: 0.25rem;
}
/* Encabezado ordenable: el <th> lleva aria-sort y su botón .tabla__orden dibuja la flecha según ese valor. */
.tabla__orden {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.75rem;
  margin-inline: -0.25rem;
  padding: 0 0.25rem;
  border: 0;
  border-radius: var(--radio-sm);
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}
.tabla__orden:hover {
  color: var(--texto);
}
.tabla__orden::after {
  content: "\2195";
  opacity: 0.6;
}
.tabla th[aria-sort="ascending"] .tabla__orden::after {
  content: "\2191";
  opacity: 1;
}
.tabla th[aria-sort="descending"] .tabla__orden::after {
  content: "\2193";
  opacity: 1;
}
.tabla th[aria-sort="ascending"],
.tabla th[aria-sort="descending"] {
  color: var(--texto);
}
.tabla th.num .tabla__orden {
  flex-direction: row-reverse;
}
@media (min-width: 48rem) {
  .tabla__orden {
    min-height: 2rem;
  }
}

/* ---------- Chip / insignia: píldora con tono (por defecto neutro) ---------- */
.chip,
.insignia {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  background: var(--entrada-fondo);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--quieto);
}
a.chip,
button.chip {
  border: 0;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.chip--acento,
.insignia--acento {
  background: color-mix(in srgb, var(--acento) 15%, transparent);
  color: var(--acento-fuerte);
}
.chip--verde,
.insignia--verde {
  background: color-mix(in srgb, var(--verde) 15%, transparent);
  color: var(--verde-fuerte);
}
.chip--ambar,
.insignia--ambar {
  background: color-mix(in srgb, var(--ambar) 15%, transparent);
  color: var(--ambar-fuerte);
}
.chip--rojo,
.insignia--rojo {
  background: color-mix(in srgb, var(--rojo) 15%, transparent);
  color: var(--rojo-fuerte);
}
.chip--neutro,
.insignia--neutro {
  background: var(--entrada-fondo);
  color: var(--quieto);
}

/* ---------- KPI: en móvil, chip en fila (etiqueta | cifra); desde sm (40rem), tarjeta en columna ---------- */
.kpis {
  display: grid;
  gap: 0.5rem;
}
@media (min-width: 40rem) {
  .kpis {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
  }
}
.kpi {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio-lg);
  background: var(--panel);
  font: inherit;
  text-align: left;
  color: inherit;
  text-decoration: none;
}
a.kpi,
button.kpi {
  cursor: pointer;
  transition: border-color 0.15s;
}
a.kpi:hover,
button.kpi:hover {
  border-color: var(--borde-fuerte);
}
.kpi--activo,
.kpi[aria-pressed="true"] {
  border-color: var(--acento);
}
.kpi__etiqueta {
  font-size: 10px;
  line-height: 1rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--quieto);
}
.kpi__cifra {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.kpi__valor {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--texto);
}
.kpi__delta {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}
.kpi__delta--arriba {
  color: var(--verde-fuerte);
}
.kpi__delta--arriba::before {
  content: "\2191\00a0";
}
.kpi__delta--abajo {
  color: var(--rojo-fuerte);
}
.kpi__delta--abajo::before {
  content: "\2193\00a0";
}
@media (min-width: 40rem) {
  .kpi {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
  }
  .kpi__etiqueta {
    font-size: 0.75rem;
  }
  .kpi__valor {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

/* ---------- Barra proporcional: --valor es un porcentaje (p. ej. 42%). ----------
   Un atributo style="--valor:42%" cuenta como estilo en línea: con CSP sin 'unsafe-inline'
   usa <progress class="barra-prop" value max> o fija --valor desde JS (style.setProperty). */
.barra-prop {
  --barra: var(--acento);
  display: block;
  width: 100%;
  min-width: 3rem;
  height: 0.5rem;
  overflow: hidden;
  border: 0;
  border-radius: 9999px;
  background: var(--entrada-fondo);
  appearance: none;
}
div.barra-prop::before {
  content: "";
  display: block;
  height: 100%;
  width: clamp(0%, var(--valor, 0%), 100%);
  border-radius: inherit;
  background: var(--barra);
}
progress.barra-prop::-webkit-progress-bar {
  background: var(--entrada-fondo);
}
progress.barra-prop::-webkit-progress-value {
  border-radius: 9999px;
  background: var(--barra);
}
progress.barra-prop::-moz-progress-bar {
  border-radius: 9999px;
  background: var(--barra);
}
.barra-prop--verde {
  --barra: var(--verde);
}
.barra-prop--ambar {
  --barra: var(--ambar);
}
.barra-prop--rojo {
  --barra: var(--rojo);
}

/* ---------- Estado vacío (y su variante de error) ---------- */
.vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 4rem 1.5rem;
  border: 1px dashed var(--borde);
  border-radius: var(--radio-lg);
  text-align: center;
}
.vacio > svg {
  width: 2rem;
  height: 2rem;
  color: var(--quieto);
}
.vacio__titulo {
  font-weight: 500;
  color: var(--texto);
}
.vacio__texto {
  max-width: 24rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--quieto);
}
.vacio--error {
  padding-block: 2.5rem;
  border-style: solid;
  border-color: color-mix(in srgb, var(--rojo) 30%, transparent);
  background: color-mix(in srgb, var(--rojo) 5%, transparent);
}
.vacio--error > svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--rojo);
}

/* ---------- Aviso en línea: info (azul), éxito (verde), error (rojo) ---------- */
.aviso {
  --tono: var(--azul);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--tono) 30%, transparent);
  border-radius: var(--radio-lg);
  background: color-mix(in srgb, var(--tono) 5%, transparent);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--texto);
}
.aviso > svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--tono);
}
.aviso--info {
  --tono: var(--azul);
}
.aviso--exito {
  --tono: var(--verde);
}
.aviso--alerta {
  --tono: var(--ambar);
}
.aviso--error {
  --tono: var(--rojo);
}
.aviso__titulo {
  font-weight: 600;
  color: var(--texto);
}

/* ---------- Migas de pan: <nav class="migas" aria-label="Migas de pan"><ol>; la página actual lleva aria-current="page" ---------- */
.migas ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--quieto);
}
.migas li {
  display: inline-flex;
  align-items: center;
}
.migas li + li::before {
  content: "\203A";
  margin-inline: 0.5rem;
}
.migas a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--quieto);
  text-decoration: none;
}
.migas a:hover {
  color: var(--texto);
}
.migas [aria-current="page"] {
  font-weight: 500;
  color: var(--texto);
}
@media (min-width: 48rem) {
  .migas a {
    min-height: 1.5rem;
  }
}

/* ---------- Paginación: <nav class="paginacion"><ul> con enlaces .boton; la página actual lleva aria-current="page" ---------- */
.paginacion ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.paginacion [aria-current="page"] {
  border-color: var(--acento);
  background: var(--panel-elevado);
  color: var(--acento-fuerte);
}
.paginacion__puntos {
  display: inline-flex;
  width: 2.25rem;
  justify-content: center;
  color: var(--quieto);
}

/* ---------- Selector de tema: botón [data-selector-tema] (tema.js); muestra el icono de la preferencia actual ---------- */
[data-selector-tema] [data-tema-icono] {
  display: none;
}
[data-selector-tema][data-preferencia="claro"] [data-tema-icono="claro"],
[data-selector-tema][data-preferencia="oscuro"] [data-tema-icono="oscuro"],
[data-selector-tema]:not([data-preferencia="claro"], [data-preferencia="oscuro"]) [data-tema-icono="sistema"] {
  display: inline-block;
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
