/* ==========================================================================
   SlimNOC2 — Dashboard com widgets arrastáveis (GridStack)
   ========================================================================== */

.dash-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dash-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.dash-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.dash-tab:hover { color: var(--text); background: var(--bg-surface-2); }
.dash-tab.is-active {
  background: var(--primary-soft);
  color: var(--accent-blue);
  font-weight: 600;
}
.dash-tab__close {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  opacity: .55;
}
.dash-tab__close:hover { opacity: 1; background: var(--danger-soft); color: var(--danger); }

.edit-flag {
  display: none;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 20px;
  background: var(--warning-soft);
  border: 1px solid rgba(245,166,35,.3);
  color: var(--accent-amber);
  font-size: 14px;
  font-weight: 600;
}
.dash.is-editing .edit-flag { display: flex; }

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */
.grid-stack {
  background: transparent;
  margin: 0 -8px;
}

.dash.is-editing .grid-stack {
  background-image:
    linear-gradient(to right, var(--border-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-soft) 1px, transparent 1px);
  background-size: calc(100% / 12) 70px;
  background-position: 8px 0;
  border-radius: var(--radius);
}

.grid-stack-item-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.grid-stack-item-content:hover { border-color: var(--border-strong); }

.dash.is-editing .grid-stack-item-content {
  border-style: dashed;
  border-color: var(--border-strong);
}

.grid-stack > .grid-stack-item > .ui-resizable-handle { z-index: 12; }

/* Placeholder ao arrastar */
.grid-stack > .grid-stack-placeholder > .placeholder-content {
  background: var(--primary-soft);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-lg);
}

.grid-stack-item.ui-draggable-dragging .grid-stack-item-content {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  opacity: .95;
}
.grid-stack-item.ui-resizable-resizing .grid-stack-item-content {
  border-color: var(--primary);
}

/* Alça de redimensionar (canto inferior direito) */
.dash.is-editing .grid-stack > .grid-stack-item > .ui-resizable-handle {
  display: block !important;
}
.dash.is-editing .grid-stack > .grid-stack-item > .ui-resizable-se {
  width: 16px;
  height: 16px;
  right: 4px;
  bottom: 4px;
  background-image: none;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  border-bottom-right-radius: 4px;
  opacity: .7;
  transform: none;
}
.dash:not(.is-editing) .grid-stack > .grid-stack-item > .ui-resizable-handle { display: none !important; }

/* --------------------------------------------------------------------------
   Widget
   -------------------------------------------------------------------------- */
.widget { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.widget__head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: none;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border-soft);
}
.dash.is-editing .widget__head { cursor: move; }

.widget__icon { color: var(--text-dim); flex: none; }
.widget__title {
  font-size: 15px;
  font-weight: 600;
  /*
   * SLIMNOC_HIG_WIDGET_TITLE_V1
   * Com nowrap + ellipsis, títulos longos viravam "Offline há mais de …"
   * (o texto precisa de 187px e só havia 148px). Agora quebram em até
   * duas linhas, preservando o significado do cartão.
   */
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  min-width: 0;
}
.widget__tools {
  margin-left: auto;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: var(--transition);
}
.grid-stack-item-content:hover .widget__tools,
.dash.is-editing .widget__tools { opacity: 1; }

.widget__tool {
  display: grid;
  place-items: center;
  /* SLIMNOC_A11Y_TOUCH_V1 — 26px ficava abaixo do mínimo de 28px
     (desktop) para alvos de toque/clique. */
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}
.widget__tool:hover { background: var(--bg-surface-3); color: var(--text); }
.widget__tool--danger:hover { background: var(--danger-soft); color: var(--danger); }
.widget__tool.edit-only { display: none; }
.dash.is-editing .widget__tool.edit-only { display: grid; }

.widget__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 13px;
}
.widget__body--flush { padding: 0; }
.widget__body--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Widget: métrica grande */
.metric { display: flex; flex-direction: column; height: 100%; justify-content: center; }
.metric__top { display: flex; align-items: center; gap: 12px; }
.metric__value { font-size: 37.5px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.metric__unit { font-size: 17.5px; font-weight: 600; color: var(--text-muted); }
.metric__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.metric__delta--up { background: var(--success-soft); color: var(--accent-green); }
.metric__delta--down { background: var(--danger-soft); color: var(--accent-red); }
.metric__label { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.metric__spark { margin-top: auto; }

/* Tráfego agregado: download e upload separados */
/* SLIMNOC_HIG_TRAFFIC_V1 — com duas colunas fixas em ~66px, "4.57 Gbps"
   (a 24px) saía da coluna e os dois valores se tocavam. As colunas agora
   quebram para linhas separadas quando não cabem lado a lado. */
.metric__traffic { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.metric__traffic-col { flex: 1 1 92px; min-width: 92px; }
.metric__traffic-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-dim);
}
.metric__traffic-label svg { opacity: .8; }
.metric__traffic-value {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.4px;
  margin-top: 5px;
  /* Nunca cortar um valor numérico: se faltar espaço, quebra a unidade
     para a linha de baixo em vez de virar "3.09 G…". */
  white-space: normal;
  overflow-wrap: anywhere;
}
.metric__traffic-value--down { color: var(--accent-green); }
.metric__traffic-value--up { color: var(--info-text); }
.metric__traffic-value .metric__unit { font-size: 13px; }

/* Widgets "Top Roteadores" e "Top Links" */
.cell-unit { font-size: 11.5px; color: var(--text-dim); font-weight: 400; }

/*
 * SLIMNOC_V2_ONU_HISTORY_WIDGETS_V1
 * Widgets clicáveis (Sinal Crítico / Rompimento / Desligada) + tooltip
 * flutuante do sparkline histórico (mesma ideia da v1, tooltip único
 * reaproveitado, position:fixed seguindo o mouse).
 */
.metric--clickable { cursor: pointer; border-radius: 10px; transition: var(--transition); margin: -8px; padding: 8px; }
.metric--clickable:hover { background: var(--bg-surface-2); }
.spark-empty { font-size: 12.5px; color: var(--text-dim); padding-top: 4px; }

.spark-tooltip {
  position: fixed;
  z-index: 400;
  pointer-events: none;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s, transform .12s;
  white-space: nowrap;
}
.spark-tooltip.is-visible { opacity: 1; transform: none; }
.spark-tooltip__title { font-weight: 600; color: var(--text-soft); }
.spark-tooltip__date { color: var(--text-dim); }
.spark-tooltip__value { font-weight: 700; font-size: 14.5px; margin-top: 1px; }

/* Widget: gráficos SVG */
.chart { width: 100%; height: 100%; display: block; }
.chart-wrap { position: relative; flex: 1; min-height: 0; }

/* Widget: relógio */
.clock__time {
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}
.clock__date { font-size: 14.5px; color: var(--text-muted); margin-top: 8px; text-transform: capitalize; }

/* Widget: lista de alertas */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border-soft);
}
.alert-item:last-child { border-bottom: 0; }
.alert-item__sev {
  width: 3px;
  align-self: stretch;
  border-radius: 3px;
  flex: none;
}
.alert-item__sev--crit { background: var(--danger); }
.alert-item__sev--warn { background: var(--warning); }
.alert-item__sev--info { background: var(--primary); }
.alert-item__title { font-size: 14.5px; font-weight: 500; }
.alert-item__meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.alert-item__time { margin-left: auto; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }

/* Widget: tabela compacta */
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table th {
  text-align: left;
  padding: 8px 13px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-inset);
  position: sticky;
  top: 0;
}
.mini-table td {
  padding: 8px 13px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-soft);
  white-space: nowrap;
}
.mini-table tr:last-child td { border-bottom: 0; }

/* Widget: mapa de calor / status POPs */
.pop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 9px;
}
.pop {
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
}
.pop__name { font-size: 13px; font-weight: 600; }
.pop__val { font-size: 18.5px; font-weight: 700; margin-top: 3px; }
.pop__bar { margin-top: 7px; }

/* --------------------------------------------------------------------------
   Modal: adicionar widget
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 18, 0.66);
  backdrop-filter: blur(2px);
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.is-open { display: flex; }

.modal {
  width: min(680px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 180ms ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.modal__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.modal__title { font-size: 17.5px; font-weight: 600; }
.modal__body { padding: 18px; overflow-y: auto; }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
}

.widget-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 11px;
}
.widget-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.widget-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.widget-card__icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--accent-blue);
}
.widget-card__name { font-size: 14.5px; font-weight: 600; }
.widget-card__desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* Estado vazio do dashboard */
.dash-empty {
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.dash-empty h3 { font-size: 17.5px; color: var(--text-soft); margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   Responsivo — celular
   SLIMNOC_V2_MOBILE_LAYOUT_V1

   O GridStack posiciona cada widget com x/y/w/h absolutos pensados pra
   uma grade de 12 colunas — numa tela de celular isso resulta em cards
   minúsculos e picotados. Em vez de reconfigurar o GridStack (mexeria
   no arrastar/redimensionar), força cada item a virar um bloco normal,
   empilhado em 1 coluna e com altura fixa (os widgets internamente já
   são flex/scroll, então continuam funcionando dentro dessa altura).
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .grid-stack { margin: 0; }
  .grid-stack-item {
    position: static !important;
    width: 100% !important;
    transform: none !important;
    margin-bottom: 10px;
  }
  .grid-stack-item-content {
    position: static !important;
    height: 300px !important;
  }
}

/* --------------------------------------------------------------------------
   Filtro de interfaces — Tráfego do Backbone
   SLIMNOC_V2_BACKBONE_FILTER_V1
   -------------------------------------------------------------------------- */
.bb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--bb-color, var(--info-text)) 55%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--bb-color, var(--info-text)) 16%, var(--bg-surface));
  color: var(--bb-color, var(--info-text));
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  white-space: nowrap;
}
.bb-chip:hover {
  filter: brightness(1.15);
  border-color: var(--bb-color, var(--info-text));
}
.bb-chip.is-hidden {
  opacity: .38;
  text-decoration: line-through;
  border-color: var(--border-soft);
  background: var(--bg-surface-2);
}
.bb-chip--action {
  border-color: var(--border-strong);
  background: var(--bg-surface-2);
  color: var(--text-muted);
}
.bb-chip--action:hover {
  color: var(--text);
  background: var(--bg-surface-3);
}
.bb-chip-hint {
  align-self: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 2px;
}

/* --------------------------------------------------------------------------
   Widget Monitoramento Energia Ping
   SLIMNOC_V2_ENERGIA_PING_WIDGET_V1
   -------------------------------------------------------------------------- */
.ep-toggle {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  background: var(--bg-surface-2);
  vertical-align: middle;
  transition: var(--transition);
}
.ep-toggle.is-on {
  background: #22c55e;
  border-color: var(--accent-green);
}
.ep-toggle:hover { border-color: var(--accent-green); }

/* ======================================================================
   SLIMNOC_DASH_DIAG_PORT_V1
   Widget Diagnóstico de porta/VLAN (reusa .router-diagnostic-* de
   pages.css) + estados vazios/loading do widget.
   ====================================================================== */
.widget__loading {
  padding: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.dp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.dp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* SLIMNOC_DASH_WIDGET_FILTER_V1 — filtro do modal Adicionar widget */
.widget-picker__search {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.widget-picker__search:focus {
  outline: none;
  border-color: var(--primary);
}
.widget-picker__empty {
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ======================================================================
   SLIMNOC_DASH_DIAG_PORT_MULTI_V1
   Modal maior (pesquisa de VLANs) + lista com checkboxes.
   ====================================================================== */
#diagPortModal .modal {
  max-width: 900px;
  width: 96%;
}
#diagPortModal .modal__body {
  max-height: 72vh;
  overflow: auto;
}
.dp-if-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0 6px;
  flex-wrap: wrap;
}
.dp-if-list {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  padding: 6px 10px;
}
.dp-if-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}
.dp-if-row:last-child { border-bottom: none; }
.dp-if-row:hover { background: var(--primary-soft); }

/* SLIMNOC_DASH_DIAG_PORT_ALIAS_V1 — comentário da porta/VLAN + checkbox do sistema */
.dp-if-row input[type=checkbox] {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  margin: 0;
}
.dp-if-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dp-if-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-if-alias {
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dp-if-row .badge { flex: 0 0 auto; }

/* SLIMNOC_DASH_DIAG_PORT_DEVLIST_V1 — lista de equipamentos estilizada */
.dp-dev-list {
  max-height: 240px;
  overflow: auto;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface-2);
  padding: 6px 8px;
}
.dp-dev-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  transition: var(--transition);
}
.dp-dev-row:hover { background: var(--primary-soft); }
.dp-dev-row.is-selected { border-color: var(--primary); background: var(--primary-soft); }
.dp-dev-row .badge { flex: 0 0 auto; }
.dp-dev-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ======================================================================
   SLIMNOC_DASH_DIAG_PORT_CARD_V1
   Card compacto do widget: cabe em alturas pequenas, ações alinhadas
   no rodapé (Ver gráfico / Editar / lixeira).
   ====================================================================== */
.widget[data-type=diag-port] .widget__body {
  display: flex;
  overflow: hidden;
  padding: 0;
}
.dp-card {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
}
.dp-card .router-diagnostic-head { padding-right: 0; }
.dp-card .router-diagnostic-head strong { font-size: 13px; }
.dp-card .router-diagnostic-main { margin-top: 6px; }
.dp-card .router-diagnostic-main b { font-size: 19px; }
.dp-card .router-diagnostic-sparkline { height: 26px; margin: 4px 0; }
.dp-card .router-diagnostic-sparkline svg { height: 26px; }
.dp-card .router-diagnostic-facts { gap: 10px; }
.dp-card .dp-actions {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dp-btn-icon {
  padding: 4px 8px;
  line-height: 1;
}

/* ======================================================================
   SLIMNOC_DASH_DIAG_PORT_DROPS_V1
   Padrão de tráfego por horário + gráfico de quedas da porta/VLAN.
   ====================================================================== */
.dp-pattern {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.dp-pattern b { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.dp-pattern.is-low b { color: var(--warning); }
.rd-drop-line {
  stroke: var(--text-soft);
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.rd-drop-band {
  fill: var(--danger);
  opacity: 0.18;
}
.rd-drop-band:hover { opacity: 0.35; }

/* SLIMNOC_DASH_DIAG_PORT_BTN_V1 — botões compactos em uma linha */
.dp-card .dp-actions .btn {
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}
.dp-card .dp-actions .dp-btn-icon {
  padding: 4px 8px;
}

/* SLIMNOC_DASH_DIAG_PORT_FILL_V1 — sparkline elástica: o conteúdo
   preenche a altura do widget (sem sobrar espaço vazio). */
.dp-card .router-diagnostic-sparkline {
  flex: 1 1 auto;
  min-height: 26px;
  height: auto;
  display: flex;
  align-items: center;
}
.dp-card .router-diagnostic-sparkline svg {
  width: 100%;
  height: 100%;
  min-height: 26px;
}

/* SLIMNOC_DASH_DIAG_PORT_FILL_V2 — só a sparkline encolhe; o resto do
   conteúdo (fatos, padrão, ações) nunca é cortado. */
.dp-card .router-diagnostic-head,
.dp-card .router-diagnostic-main,
.dp-card .router-diagnostic-facts,
.dp-card .dp-pattern,
.dp-card .dp-actions {
  flex: 0 0 auto;
}
.dp-card .router-diagnostic-sparkline {
  overflow: hidden;
}


/* SLIMNOC_MODAL_FOOTER_VISIBLE_V1 */
.modal {
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
}
.modal__foot {
  flex: none;
  background: var(--bg-surface);
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

/* ==========================================================================
   SLIMNOC_LAYOUT_CONFLICT_V1 — aviso de versão concorrente do dashboard
   (duas abas/dispositivos). Substitui a sobrescrita silenciosa.
   ========================================================================== */
.dash-conflict {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 166, 35, 0.42);
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 14px;
  font-weight: 600;
}
.dash-conflict__text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 320px;
}
.dash-conflict .btn {
  color: var(--text-soft);
  background: var(--bg-surface);
  border-color: var(--border-strong);
}
.dash-conflict .btn:hover {
  color: var(--text);
  background: var(--bg-surface-2);
}
