/* Estados de la pantalla conectada al backend (sesion, avisos, detalle de la unidad, resultados por accion y funciones
   no disponibles) y ajustes sobre styles.css (original): filtros, mapa cc-mapa y colapso de filtros por clase. */

#appMessage {
  position: fixed;
  z-index: 40;
  top: 72px;
  left: 50%;
  max-width: min(640px, calc(100vw - 24px));
  margin: 0;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #8a1c27;
  background: #fdf1f2;
  border-left: 4px solid var(--v-danger);
  border-radius: 6px;
  box-shadow: var(--v-shadow-card);
  transform: translateX(-50%);
}
#appMessage.info { color: #0c5460; background: #e8f6f8; border-left-color: #17a2b8; }

/* Filtros colapsados (antes: estilos en linea). */
.alerts-pane.filters-collapsed .filter-accordion { height: 35px; }
.alerts-pane.filters-collapsed .table-shell { top: 55px; height: calc(100vh - 140px); }
.alerts-pane.filters-collapsed .table-body { height: calc(100vh - 227px); }

/* Filtros en tres columnas y dos filas dentro de la altura original: etiquetas en una linea, botones a lo ancho de su
   columna y Sonido/Filtrar alineados con los selectores (antes: anchos fijos de 55px que partian etiquetas y textos). */
.filter-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px 10px; padding: 8px 15px; }
.filter-field label,
.sound-filter > label:first-child { width: auto; min-height: 18px; overflow: hidden; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; }
.multi-trigger { position: relative; display: block; width: 100%; height: 32px; margin-top: 3px; padding: 2px 16px 2px 6px; text-align: left; text-overflow: ellipsis; }
.multi-trigger span { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); }
.multi-menu { top: 53px; }
.filter-field:nth-child(3n) .multi-menu { right: 0; left: auto; }
.sound-filter { position: static; }
.sound-toggle { margin: 7px 0 4px; }
.filter-button { position: static; width: 100%; height: 32px; }
@media (max-width: 620px) {
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-field:nth-child(3n) .multi-menu { right: auto; left: 0; }
  .filter-field:nth-child(2n) .multi-menu { right: 0; left: auto; }
}

.table-body[aria-busy="true"] { opacity: .6; }
.multi-menu .menu-empty { margin: 4px 6px; font-size: 12px; color: var(--v-muted); }

/* Mapa: cc-mapa (Leaflet + OpenStreetMap) en un iframe; el detalle, la nota y el boton de georeferencias van encima. */
.map-frame { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; border: 0; }
/* El detalle es un globo sobre el pin (command4 InfoBubble) que lo sigue (--anchor-x/-y de cc-map:anchor); sin punto, al
   centro, donde queda el pin. El zoom animado de Leaflet dura 0.25 s con esta curva. */
.alert-info { top: auto; left: var(--anchor-x, 50%); bottom: calc(100% - var(--anchor-y, 50%) + 20px); max-height: calc(50% - 32px); transform: translateX(-50%); }
.alert-info.anchor-animate { transition: left .25s cubic-bezier(0, 0, .25, 1), bottom .25s cubic-bezier(0, 0, .25, 1); }
/* Mostrar/Ocultar Georeferencias: OFF en rojo y ON en verde, como command4 (geoshow-off / geoshow-on). */
.geo-toggle { z-index: 4; }
.geo-toggle span { color: #d32f2f; }
.geo-toggle.on span { color: #2e7d32; }
.geo-toggle[aria-busy="true"] { opacity: .6; }
.feature-note { display: block; margin: 6px 0 0; font-size: 11px; line-height: 15px; color: var(--v-muted); }
.map-note { position: absolute; z-index: 4; left: 8px; bottom: 54px; max-width: calc(100% - 140px); margin: 0; padding: 2px 6px; background: rgba(255, 255, 255, .88); border: 1px solid var(--v-border); border-radius: 4px; }
.map-status { position: absolute; z-index: 4; left: 50%; top: 8px; transform: translateX(-50%); margin: 0; padding: 4px 8px; color: #6b4b00; background: #fff8e1; border: 1px solid #f0d58a; border-radius: 4px; }
.map-action[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* Detalle compuesto de la unidad (units/detail): una fila por seccion de su dueno. */
.unit-detail { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--v-border-soft); }
.unit-detail[aria-busy="true"] { opacity: .6; }
.unit-detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; }
.unit-detail dt { font-weight: 700; color: var(--v-label); }
.unit-detail dd { margin: 0; overflow-wrap: anywhere; }
.unit-detail dd.unavailable { color: #8a1c27; }
.detail-notice { margin: 6px 0 0; font-size: 11.5px; color: #6b4b00; }
.alert-info.commands-mode > div { display: none; }

/* Acciones rapidas: mensaje y resultado por accion. */
.message-content { margin-bottom: 6px; }
.message-content textarea { display: block; width: 100%; margin-bottom: 6px; padding: 5px 9px; font: inherit; background: var(--v-input-bg); border: 1px solid var(--v-input-border); border-radius: 6px; resize: vertical; }
.action-results { margin: 8px 0 0; padding: 6px 10px; list-style: none; background: var(--v-th-bg); border-radius: 6px; }
.action-results li { padding: 2px 0; }
.action-results li.done { color: #155724; }
.action-results li.failed { color: #8a1c27; }

.dialog-error { margin: 8px 0 0; padding: 6px 10px; font-size: 12px; color: #8a1c27; background: #fdf1f2; border-left: 4px solid var(--v-danger); border-radius: 6px; }
