/* System Health width isolation + Scheduler3 responsive cards.
 * Keeps the monitoring page inside the real dashboard content box and prevents
 * legacy floats/width rules from stealing the inline-end portion of the page.
 */
#infraHealthPage,
#infraHealthPage > *,
#infraHealthContent,
#systemHealthScheduler3 {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  float: none !important;
  clear: both !important;
}

#infraHealthPage {
  display: block !important;
  overflow: visible !important;
}

#infraHealthContent,
#systemHealthScheduler3 {
  position: relative;
  z-index: 2;
}

#systemHealthScheduler3 {
  overflow: hidden;
}

#systemHealthScheduler3 .s3-system-health__head,
#systemHealthScheduler3 .s3-system-health__grid,
#systemHealthScheduler3 .s3-system-health__foot {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#systemHealthScheduler3 .s3-system-health__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch;
}

#systemHealthScheduler3 .s3-system-health__grid > article {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  overflow: hidden;
}

#systemHealthScheduler3 .s3-system-health__grid .ltr,
#systemHealthScheduler3 .s3-system-health__grid b,
#systemHealthScheduler3 .s3-system-health__grid small,
#systemHealthScheduler3 .s3-system-health__grid span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.s3-health-chip.is-neutral {
  background: #f1f5f9;
  color: #475569;
}

.s3-health-chip.is-warning {
  background: #fff7ed;
  color: #9a3412;
}

/*
 * The fourth legacy infra card was "VPS موتور ۳" and expected machine metrics
 * from the Engine /health payload. Scheduler3 /health now intentionally reports
 * service health only; VPS capacity is sourced from Connector Inventory and is
 * rendered in the unified panel above. Hide the obsolete duplicate card.
 */
#infraHealthContent .infra-grid > article:nth-child(4) {
  display: none !important;
}

@media (max-width: 1280px) {
  #systemHealthScheduler3 .s3-system-health__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  #systemHealthScheduler3 .s3-system-health__grid {
    grid-template-columns: 1fr !important;
  }

  #systemHealthScheduler3 .s3-system-health__head {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
}
