/* Cabeceras ordenables (static/js/ubi-tabla.js → ubiTablaOrdenable, y los
   enlaces de orden en el servidor de la bandeja de tickets). El botón hereda
   la tipografía de la cabecera; solo añade la flecha y el estado activo. */
.ubi-sort-btn,
a.ubi-sort-btn, a.ubi-sort-btn:link, a.ubi-sort-btn:visited {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 5px;
  margin: -2px -4px; padding: 2px 4px; border: 0; border-radius: 5px;
  background: transparent; box-shadow: none;
  font: inherit; letter-spacing: inherit; text-transform: inherit; line-height: inherit;
  color: inherit; text-align: inherit; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: color .15s, background-color .15s;
}
.ubi-sort-btn:hover, a.ubi-sort-btn:hover { color: #0f172a; text-decoration: none; }
.ubi-sort-btn:focus { outline: none; }
.ubi-sort-btn:focus-visible { box-shadow: 0 0 0 3px rgba(55,169,251,.35); }
.ubi-sort-btn:active { transform: translateY(1px); }
.ubi-sort-ico { width: 8px; height: 11px; flex: 0 0 auto; fill: currentColor; opacity: .35; transition: opacity .15s; }
.ubi-sort-btn:hover .ubi-sort-ico, .ubi-sort-btn:focus-visible .ubi-sort-ico { opacity: .7; }

th[aria-sort="ascending"] .ubi-sort-btn, th[aria-sort="descending"] .ubi-sort-btn,
th[aria-sort="ascending"] a.ubi-sort-btn:link, th[aria-sort="descending"] a.ubi-sort-btn:link,
th[aria-sort="ascending"] a.ubi-sort-btn:visited, th[aria-sort="descending"] a.ubi-sort-btn:visited { color: #0072cb; }
th[aria-sort="ascending"] .ubi-sort-ico, th[aria-sort="descending"] .ubi-sort-ico { opacity: 1; }
th[aria-sort="ascending"] .ubi-sort-ico .down, th[aria-sort="descending"] .ubi-sort-ico .up { opacity: .22; }

/* Modo oscuro (paleta «taste»: texto primario #c4cbd6, estado activo #7cc5fd) */
html.dark .ubi-sort-btn:hover, html.dark a.ubi-sort-btn:hover { color: #c4cbd6; }
html.dark th[aria-sort="ascending"] .ubi-sort-btn, html.dark th[aria-sort="descending"] .ubi-sort-btn,
html.dark th[aria-sort="ascending"] a.ubi-sort-btn:link, html.dark th[aria-sort="descending"] a.ubi-sort-btn:link,
html.dark th[aria-sort="ascending"] a.ubi-sort-btn:visited, html.dark th[aria-sort="descending"] a.ubi-sort-btn:visited { color: #7cc5fd; }

@media (prefers-reduced-motion: reduce) {
  .ubi-sort-btn, .ubi-sort-ico { transition: none; }
}
