/*
 * Tablero de seguimiento de los informes de avance (App\Livewire\InformesAvance\TableroSeguimiento, docs/INFORMES_AVANCE.md
 * §11.11). Hoja propia registrada con FilamentAsset (el CSS compilado de Filament no trae las clases de Tailwind
 * necesarias). Usa las variables de color del panel; modo oscuro, pantallas angostas e impresión al final. Prefijo tsg-.
 *
 * Resaltado: las sedes del usuario en azul (--tsg-resaltada) con ● y negrita; las demás en gris; la Universidad en tinta.
 * Semáforos y motivos llevan siempre icono y texto, nunca solo color.
 */
.tsg { display: flex; flex-direction: column; gap: 1rem; min-width: 0; --tsg-resaltada: #2a78d6; --tsg-otra: #a8a7a0; --tsg-universidad: #2b2b29; }
.tsg p { margin: 0; }
.tsg-cuerpo { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; transition: opacity .15s; }
.tsg-atenuado { opacity: .55; pointer-events: none; }
.tsg .tsg-oculto { display: none !important; }
.tsg-tarjeta { background: #fff; border-radius: .75rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid rgba(var(--gray-950), .06); scroll-margin-top: 5rem; }
.tsg-seccion { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .85rem; min-width: 0; }
.tsg-tenue { color: rgb(var(--gray-500)); font-size: .82rem; }
.tsg-vacio { padding: 1rem; font-size: .875rem; color: rgb(var(--gray-500)); }
.tsg-nota { font-size: .78rem; color: rgb(var(--gray-500)); }
.tsg-enlace { color: rgb(var(--primary-600)); font-size: .82rem; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.tsg-enlace:hover { text-decoration: underline; }
.tsg-chip { display: inline-block; margin-left: .25rem; padding: 0 .4rem; border-radius: 999px; font-size: .7rem; font-weight: 600; background: rgba(var(--gray-500), .14); color: rgb(var(--gray-700)); }
.tsg-subtitulo { margin: .75rem 0 0; font-size: .85rem; font-weight: 600; color: rgb(var(--gray-700)); }
.tsg-aviso { display: flex; gap: .5rem; align-items: flex-start; padding: .6rem .85rem; border-radius: .5rem; font-size: .85rem; background: rgba(59, 130, 246, .1); color: rgb(var(--gray-800)); }
.tsg-cargando-inicial { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 12rem; padding: 1.5rem; border-radius: .75rem; background: #fff; border: 1px solid rgba(var(--gray-950), .06); color: rgb(var(--gray-500)); font-size: .9rem; }
.tsg-giro { width: 1.25rem; height: 1.25rem; animation: tsg-girar 1s linear infinite; }
@keyframes tsg-girar { to { transform: rotate(360deg); } }

/* Encabezado (pestaña del Escritorio) */
.tsg-intro h2 { margin: 0; font-size: 1.05rem; font-weight: 600; color: rgb(var(--gray-950)); }

/* Filtros y acciones: una fila para todo lo que hay debajo */
.tsg-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .85rem; padding: .85rem 1rem; border-radius: .75rem; background: #fff; border: 1px solid rgba(var(--gray-950), .06); }
.tsg-campo { display: flex; flex-direction: column; gap: .2rem; font-size: .75rem; font-weight: 600; color: rgb(var(--gray-600)); }
.tsg-campo select { min-width: 8rem; max-width: 18rem; padding: .4rem 2rem .4rem .65rem; border-radius: .5rem; border: 1px solid rgb(var(--gray-300)); background-color: #fff; font-size: .875rem; font-weight: 400; color: rgb(var(--gray-950)); }
.tsg-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
.tsg-cargando { align-items: center; gap: .35rem; font-size: .8rem; color: rgb(var(--gray-500)); }
.tsg-boton, .tsg-boton-sec { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .75rem; border-radius: .5rem; font-size: .82rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tsg-boton { background: rgb(var(--primary-600)); color: #fff; border: 1px solid rgb(var(--primary-600)); }
.tsg-boton:hover { background: rgb(var(--primary-500)); }
.tsg-boton-sec { background: #fff; color: rgb(var(--gray-700)); border: 1px solid rgb(var(--gray-300)); }
.tsg-boton-sec:hover { background: rgb(var(--gray-50)); }
.tsg-boton-sec:disabled { opacity: .6; cursor: wait; }
.tsg-segmentado { display: inline-flex; border: 1px solid rgb(var(--gray-300)); border-radius: .5rem; overflow: hidden; }
.tsg-segmentado button { display: inline-flex; align-items: center; gap: .25rem; padding: .35rem .65rem; font-size: .8rem; font-weight: 500; background: #fff; border: 0; border-right: 1px solid rgb(var(--gray-300)); color: rgb(var(--gray-700)); cursor: pointer; }
.tsg-segmentado button:last-child { border-right: 0; }
.tsg-segmentado button.tsg-activo { background: rgb(var(--primary-600)); color: #fff; }
.tsg-segmentado-chico button { padding: .15rem .5rem; font-size: .72rem; }
.tsg-segmentado button:focus-visible, .tsg-boton:focus-visible, .tsg-boton-sec:focus-visible { outline: 2px solid rgb(var(--primary-500)); outline-offset: 2px; }

.tsg-meta { font-size: .8rem; color: rgb(var(--gray-600)); }
.tsg-leyenda-resaltado { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .8rem; color: rgb(var(--gray-700)); }
.tsg-leyenda-resaltado > span { display: inline-flex; align-items: center; gap: .35rem; }
.tsg-muestra { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; }
.tsg-muestra-resaltada { background: var(--tsg-resaltada); }
.tsg-muestra-otras { background: var(--tsg-otra); }
.tsg-muestra-universidad { background: var(--tsg-universidad); border-radius: 2px; height: .25rem; width: 1rem; }
.tsg-marca { color: var(--tsg-resaltada); margin-right: .15rem; }

/* Índice de secciones (fijo arriba al desplazarse) */
.tsg-indice { position: sticky; top: 4rem; z-index: 5; display: flex; gap: .35rem; overflow-x: auto; padding: .4rem; border-radius: .75rem; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border: 1px solid rgba(var(--gray-950), .06); }
.tsg-indice a { flex: none; padding: .3rem .65rem; border-radius: .5rem; font-size: .8rem; font-weight: 500; color: rgb(var(--gray-700)); text-decoration: none; white-space: nowrap; }
.tsg-indice a:hover { background: rgba(var(--primary-500), .1); color: rgb(var(--primary-700)); }

/* Cabecera de cada bloque */
.tsg-cabecera { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .5rem 1rem; }
.tsg-cabecera-texto { flex: 1 1 24rem; min-width: 0; }
.tsg-cabecera h3 { margin: 0; font-size: .98rem; font-weight: 600; color: rgb(var(--gray-950)); }
.tsg-cabecera p { margin-top: .15rem; }
.tsg-cabecera-acciones { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* Resumen ejecutivo */
.tsg-kpis { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.tsg-kpi { display: flex; flex-direction: column; gap: .25rem; padding: .8rem 1rem; border-radius: .65rem; border: 1px solid rgb(var(--gray-200)); background: rgba(var(--gray-500), .03); }
.tsg-kpi-titulo { display: flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: rgb(var(--gray-500)); }
.tsg-kpi-valor { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; font-size: 1.75rem; font-weight: 700; line-height: 1.15; color: rgb(var(--gray-950)); }
.tsg-kpi-valor .tsg-delta { font-size: .8rem; }
.tsg-kpi-detalle { font-size: .78rem; color: rgb(var(--gray-600)); }
.tsg-kpi-mias { font-size: .82rem; color: rgb(var(--gray-700)); padding-top: .25rem; border-top: 1px dashed rgb(var(--gray-200)); }
.tsg-narrativa { margin: 0; padding: .75rem 1rem .75rem 2rem; border-radius: .65rem; background: rgba(var(--primary-500), .05); font-size: .9rem; line-height: 1.5; color: rgb(var(--gray-800)); display: flex; flex-direction: column; gap: .35rem; }
.tsg-cambios { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; }

/* Cambio frente a la comparación y semáforos (siempre con texto) */
.tsg-delta { display: block; font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; color: rgb(var(--gray-500)); white-space: nowrap; }
.tsg-kpi .tsg-delta { display: inline; }
.tsg-delta-bien { color: #067a06; }
.tsg-delta-mal { color: rgb(var(--danger-600)); }
.tsg-semaforo { display: inline-flex; align-items: center; gap: .2rem; font-weight: 600; font-size: .8rem; }
.tsg-tono-verde, .tsg-tono-bien { color: #067a06; }
.tsg-tono-amarillo, .tsg-tono-atencion { color: rgb(var(--warning-700)); }
.tsg-tono-rojo, .tsg-tono-critico { color: rgb(var(--danger-600)); }

/* Gráficas */
.tsg-graficas-2 { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .tsg-graficas-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.tsg-figura { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.tsg-figura figcaption { font-size: .8rem; font-weight: 600; color: rgb(var(--gray-700)); }
.tsg-figcaption-acciones { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; }
.tsg-grafica { width: 100%; min-width: 0; min-height: 8rem; }

/* Tablas */
.tsg-tabla-envoltura { overflow-x: auto; min-width: 0; }
.tsg-tabla { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.tsg-tabla th, .tsg-tabla td { padding: .4rem .55rem; text-align: left; border-bottom: 1px solid rgb(var(--gray-100)); vertical-align: top; }
.tsg-tabla thead th { font-size: .74rem; font-weight: 600; color: rgb(var(--gray-600)); background: rgba(var(--gray-500), .05); vertical-align: bottom; }
.tsg-tabla tbody th { font-weight: 500; color: rgb(var(--gray-900)); white-space: nowrap; }
.tsg-tabla .tsg-num { text-align: right; white-space: nowrap; }
.tsg-tabla .tsg-pocos { color: rgb(var(--gray-500)); }
.tsg-tabla sup { margin-left: .1rem; cursor: help; }
.tsg-fila-universidad > th, .tsg-fila-universidad > td { font-weight: 700; background: rgba(var(--gray-500), .07); }
.tsg-fila-grupo > th, .tsg-fila-grupo > td { font-weight: 600; background: rgba(42, 120, 214, .06); }
.tsg-tabla tr.tsg-resaltada > th, .tsg-tabla tr.tsg-resaltada > td { background: rgba(42, 120, 214, .07); }
.tsg-tabla tr.tsg-resaltada > th { font-weight: 700; }
.tsg-tabla-alertas tbody th { white-space: normal; min-width: 16rem; }
.tsg-alerta-nombre { display: block; font-weight: 400; font-size: .78rem; color: rgb(var(--gray-600)); }
.tsg-motivos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.tsg-motivo { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .45rem; border-radius: .35rem; font-size: .74rem; font-weight: 600; background: rgba(var(--gray-500), .1); }
.tsg-motivo.tsg-tono-critico { background: rgba(208, 59, 59, .1); }
.tsg-motivo.tsg-tono-atencion { background: rgba(250, 178, 25, .16); }
.tsg-interruptor { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: rgb(var(--gray-700)); cursor: pointer; }
.tsg-interruptor input { border-radius: .25rem; }
.tsg-sin-resultados { font-size: .85rem; color: rgb(var(--gray-500)); }

/* Detalle de una fila o un segmento (partials/tablero-detalle) */
.tsg-pista-detalle { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: rgb(var(--gray-600)); }
.tsg-fila-detalle { font-size: inherit; font-weight: inherit; text-align: left; }
.tsg-dialogo { width: min(76rem, calc(100vw - 2rem)); max-width: none; height: min(52rem, calc(100vh - 2rem)); max-height: none; margin: auto; padding: 0; border: 0; border-radius: .9rem; background: #fff; color: rgb(var(--gray-950)); box-shadow: 0 24px 60px rgba(0,0,0,.28); overflow: hidden; }
.tsg-dialogo::backdrop { background: rgba(15, 15, 18, .5); backdrop-filter: blur(2px); }
.tsg-dialogo[open] { animation: tsg-aparecer .16s ease-out; }
@keyframes tsg-aparecer { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .tsg-dialogo[open] { animation: none; } }
.tsg-dialogo-marco { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tsg-dialogo-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem .75rem; border-bottom: 1px solid rgb(var(--gray-200)); }
.tsg-dialogo-titulos { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tsg-dialogo-titulos h2 { margin: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.tsg-dialogo-titulos h2:focus { outline: none; }
.tsg-dialogo-alcance { font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: rgb(var(--gray-500)); }
.tsg-dialogo-cerrar { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: .5rem; background: none; color: rgb(var(--gray-500)); cursor: pointer; }
.tsg-dialogo-cerrar:hover { background: rgba(var(--gray-500), .12); color: rgb(var(--gray-800)); }
.tsg-dialogo-cerrar:focus-visible, .tsg-detalle-grupo:focus-visible, .tsg-detalle-orden:focus-visible, .tsg-fila-detalle:focus-visible, .tsg-detalle-tabla a:focus-visible, .tsg-detalle-tabla:focus-visible { outline: 2px solid rgb(var(--primary-500)); outline-offset: 1px; }
.tsg-dialogo-estado { display: flex; align-items: center; justify-content: center; gap: .5rem; flex: 1; padding: 2rem; font-size: .9rem; color: rgb(var(--gray-500)); }
.tsg-dialogo-contenido { display: flex; flex-direction: column; flex: 1; gap: .7rem; min-height: 0; padding: .85rem 1.25rem 0; }
.tsg-detalle-barra { display: flex; gap: 2px; height: .6rem; flex: none; }
.tsg-detalle-barra span { flex-basis: 0; min-width: 3px; }
.tsg-detalle-barra span:first-child { border-radius: 4px 0 0 4px; }
.tsg-detalle-barra span:last-child { border-radius: 0 4px 4px 0; }
.tsg-detalle-controles { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem .75rem; flex: none; }
.tsg-detalle-grupos { display: flex; flex-wrap: wrap; gap: .35rem; }
.tsg-detalle-grupo { display: inline-flex; align-items: center; gap: .35rem; min-height: 2rem; padding: .2rem .65rem; border: 1px solid rgb(var(--gray-300)); border-radius: 999px; background: #fff; font-size: .8rem; color: rgb(var(--gray-700)); cursor: pointer; }
.tsg-detalle-grupo:hover { background: rgb(var(--gray-50)); }
.tsg-detalle-grupo strong { font-variant-numeric: tabular-nums; color: rgb(var(--gray-950)); }
.tsg-detalle-grupo[aria-pressed="true"] { border-color: rgb(var(--gray-800)); box-shadow: inset 0 0 0 1px rgb(var(--gray-800)); color: rgb(var(--gray-950)); font-weight: 600; }
.tsg-detalle-muestra { flex: none; display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; }
.tsg-detalle-buscar { display: inline-flex; align-items: center; gap: .4rem; padding: 0 .6rem; border: 1px solid rgb(var(--gray-300)); border-radius: .5rem; color: rgb(var(--gray-500)); }
.tsg-detalle-buscar:focus-within { border-color: rgb(var(--primary-500)); box-shadow: 0 0 0 1px rgb(var(--primary-500)); }
.tsg-detalle-buscar input { width: 14rem; padding: .35rem 0; border: 0; background: none; font-size: .85rem; color: rgb(var(--gray-950)); box-shadow: none; outline: none; }
.tsg-detalle-buscar input:focus { box-shadow: none; }
.tsg-detalle-tabla { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid rgb(var(--gray-200)); border-radius: .5rem; }
.tsg-detalle-tabla .tsg-tabla thead th { position: sticky; top: 0; z-index: 1; padding: 0; background: rgb(var(--gray-50)); box-shadow: inset 0 -1px 0 rgb(var(--gray-200)); white-space: nowrap; }
.tsg-detalle-orden { display: inline-flex; align-items: center; gap: .3rem; width: 100%; padding: .45rem .55rem; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.tsg-num .tsg-detalle-orden { justify-content: flex-end; }
.tsg-detalle-orden:hover { color: rgb(var(--gray-950)); }
.tsg-detalle-flecha { width: .6rem; font-size: .68rem; }
/* El color de la fila es el de su grupo en la gráfica: raya a la izquierda; pastilla con muestra y texto, nunca solo color */
.tsg-detalle-fila > :first-child { box-shadow: inset 4px 0 0 var(--tono, transparent); padding-left: .8rem; }
.tsg-detalle-fila:hover > td { background: rgba(var(--gray-500), .06); }
.tsg-detalle-tabla .tsg-tabla td { color: rgb(var(--gray-800)); }
.tsg-detalle-codigo { font-weight: 600; white-space: nowrap; color: rgb(var(--primary-600)); text-decoration: none; }
.tsg-detalle-codigo:hover { text-decoration: underline; }
.tsg-detalle-proyecto { min-width: 16rem; max-width: 26rem; }
.tsg-pastilla { display: inline-flex; align-items: center; gap: .3rem; padding: .05rem .5rem .05rem .4rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; color: rgb(var(--gray-800)); background: color-mix(in srgb, var(--tono) 16%, transparent); }
.tsg-pastilla::before { content: ""; flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--tono); }
.tsg-dialogo-pie { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 1.25rem; }

/* Versión ejecutiva */
.tsg-ejecutiva-graficas { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Pantallas angostas */
@media (max-width: 640px) {
    .tsg-seccion { padding: .85rem; }
    .tsg-acciones { margin-left: 0; }
    .tsg-campo select { min-width: 0; max-width: 100%; }
    .tsg-kpi-valor { font-size: 1.5rem; }
    .tsg-ejecutiva-graficas { grid-template-columns: minmax(0, 1fr); }
    .tsg-dialogo { width: 100vw; height: 100dvh; border-radius: 0; }
    .tsg-dialogo-cabecera, .tsg-dialogo-contenido, .tsg-dialogo-pie { padding-left: .85rem; padding-right: .85rem; }
    .tsg-detalle-buscar, .tsg-detalle-buscar input { width: 100%; }
    .tsg-detalle-proyecto { min-width: 11rem; }
}

/* Modo oscuro */
.dark .tsg { --tsg-resaltada: #3987e5; --tsg-otra: #6b6a66; --tsg-universidad: #f0efec; }
.dark .tsg-tarjeta, .dark .tsg-filtros, .dark .tsg-cargando-inicial { background: rgb(var(--gray-900)); border-color: rgba(255,255,255,.1); }
.dark .tsg-indice { background: rgba(24, 24, 27, .92); border-color: rgba(255,255,255,.1); }
.dark .tsg-cabecera h3, .dark .tsg-kpi-valor, .dark .tsg-intro h2, .dark .tsg-tabla tbody th { color: #fff; }
.dark .tsg-campo select, .dark .tsg-boton-sec, .dark .tsg-segmentado button { background-color: rgb(var(--gray-800)); border-color: rgb(var(--gray-700)); color: rgb(var(--gray-100)); }
.dark .tsg-segmentado { border-color: rgb(var(--gray-700)); }
.dark .tsg-segmentado button.tsg-activo { background: rgb(var(--primary-600)); color: #fff; }
.dark .tsg-kpi { border-color: rgb(var(--gray-700)); background: rgba(255,255,255,.02); }
.dark .tsg-kpi-mias { border-color: rgb(var(--gray-700)); color: rgb(var(--gray-300)); }
.dark .tsg-narrativa, .dark .tsg-aviso { color: rgb(var(--gray-200)); }
.dark .tsg-meta, .dark .tsg-leyenda-resaltado, .dark .tsg-kpi-detalle, .dark .tsg-alerta-nombre, .dark .tsg-indice a, .dark .tsg-interruptor, .dark .tsg-figura figcaption { color: rgb(var(--gray-300)); }
.dark .tsg-tabla th, .dark .tsg-tabla td { border-color: rgba(255,255,255,.06); }
.dark .tsg-tabla thead th { color: rgb(var(--gray-300)); }
.dark .tsg-delta-bien, .dark .tsg-tono-verde, .dark .tsg-tono-bien { color: #4ade80; }
.dark .tsg-delta-mal, .dark .tsg-tono-rojo, .dark .tsg-tono-critico { color: #f87171; }
.dark .tsg-tono-amarillo, .dark .tsg-tono-atencion { color: #fbbf24; }
.dark .tsg-chip { color: rgb(var(--gray-200)); }
.dark .tsg-dialogo { background: rgb(var(--gray-900)); color: #fff; color-scheme: dark; }
.dark .tsg-dialogo-cabecera { border-color: rgb(var(--gray-700)); }
.dark .tsg-dialogo-titulos h2, .dark .tsg-detalle-grupo strong, .dark .tsg-detalle-buscar input { color: #fff; }
.dark .tsg-dialogo-cerrar:hover { color: #fff; }
.dark .tsg-detalle-grupo { background: rgb(var(--gray-800)); border-color: rgb(var(--gray-700)); color: rgb(var(--gray-200)); }
.dark .tsg-detalle-grupo:hover { background: rgb(var(--gray-700)); }
.dark .tsg-detalle-grupo[aria-pressed="true"] { border-color: #fff; box-shadow: inset 0 0 0 1px #fff; color: #fff; }
.dark .tsg-detalle-buscar, .dark .tsg-detalle-tabla { border-color: rgb(var(--gray-700)); }
.dark .tsg-detalle-tabla .tsg-tabla thead th { background: rgb(var(--gray-800)); box-shadow: inset 0 -1px 0 rgb(var(--gray-700)); }
.dark .tsg-detalle-orden:hover, .dark .tsg-detalle-tabla .tsg-tabla td { color: rgb(var(--gray-100)); }
.dark .tsg-pastilla { color: rgb(var(--gray-100)); background: color-mix(in srgb, var(--tono) 28%, transparent); }
.dark .tsg-detalle-codigo { color: rgb(var(--primary-400)); }
.dark .tsg-pista-detalle { color: rgb(var(--gray-300)); }

/* Impresión (versión ejecutiva): solo el contenido, sin el menú ni la barra del panel */
@media print {
    @page { size: A4 landscape; margin: 12mm; }
    .fi-sidebar, .fi-topbar, .tsg-no-imprimir, .tsg-indice { display: none !important; }
    .fi-main, .fi-main-ctn, .fi-page { padding: 0 !important; margin: 0 !important; max-width: none !important; }
    .fi-layout, .fi-main-ctn { display: block !important; }
    body { background: #fff !important; }
    .tsg-tarjeta { box-shadow: none; break-inside: avoid; border-color: #ddd; }
    .tsg-seccion { padding: .5rem 0; }
    .tsg-narrativa { background: none; padding-left: 1.25rem; }
    .tsg-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tsg-ejecutiva-graficas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tsg-tabla { font-size: 9pt; }
    .tsg-delta-bien { color: #067a06 !important; }
}

/* Icono de los motivos de alerta (texto siempre presente; el icono refuerza el tono) */
.tsg-motivo::before { flex: none; display: inline-grid; place-items: center; width: .95rem; height: .95rem; border-radius: 50%; font-size: .62rem; font-weight: 800; line-height: 1; color: #fff; }
.tsg-motivo.tsg-tono-critico::before { content: "✕"; background: #d03b3b; }
.tsg-motivo.tsg-tono-atencion::before { content: "!"; background: #c98500; }
