.health-page {
  display: grid;
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

.health-header,
.health-actions,
.health-overview,
.health-overview-state,
.health-overview-counts,
.health-section > header,
.health-service-main,
.health-service-metrics,
.health-disk {
  display: flex;
  align-items: center;
}

.health-header {
  justify-content: space-between;
  gap: 18px;
}

.health-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--color-accent-hover);
  font-size: 11px;
  font-weight: 800;
}

.health-header h1,
.health-header p,
.health-section h2,
.health-section p,
.health-service h3,
.health-service p {
  margin: 0;
}

.health-header h1 {
  font-size: 26px;
  line-height: 1.2;
}

.health-header p,
.health-section p,
.health-service p {
  color: var(--color-muted);
}

.health-header p {
  margin-top: 3px;
}

.health-actions {
  gap: 10px;
}

.health-auto-refresh {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-muted);
  font-size: 13px;
  cursor: pointer;
}

.health-auto-refresh input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-accent);
}

.health-refresh {
  gap: 7px;
}

.health-refresh svg,
.health-section-icon svg,
.health-overview-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.health-refresh.is-loading svg {
  animation: health-spin 0.8s linear infinite;
}

.health-overview {
  min-height: 82px;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-success);
  border-radius: 7px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.health-overview.is-warning { border-left-color: var(--color-warning); }
.health-overview.is-critical { border-left-color: var(--color-danger); }

.health-overview-state {
  gap: 12px;
}

.health-overview-icon,
.health-section-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--color-accent-hover);
  background: rgba(0, 157, 165, 0.1);
}

.health-overview-icon {
  width: 44px;
  height: 44px;
  color: var(--color-success);
  background: rgba(21, 150, 106, 0.1);
}

.health-overview.is-warning .health-overview-icon { color: var(--color-warning); background: rgba(217, 145, 24, 0.1); }
.health-overview.is-critical .health-overview-icon { color: var(--color-danger); background: rgba(200, 72, 72, 0.1); }

.health-overview-state strong,
.health-overview-state span {
  display: block;
}

.health-overview-state strong {
  font-size: 17px;
}

.health-overview-state span {
  margin-top: 2px;
  color: var(--color-muted);
  font-size: 12px;
}

.health-overview-counts {
  align-self: stretch;
}

.health-overview-counts > span {
  min-width: 94px;
  display: grid;
  place-content: center;
  padding: 0 18px;
  border-left: 1px solid var(--color-border);
  text-align: center;
}

.health-overview-counts strong {
  font-size: 20px;
  line-height: 1.1;
}

.health-overview-counts small {
  margin-top: 3px;
  color: var(--color-muted);
}

.health-section {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.health-section > header {
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--color-border);
}

.health-section-icon {
  width: 34px;
  height: 34px;
}

.health-section h2 {
  font-size: 15px;
}

.health-section > header p {
  font-size: 12px;
}

.health-service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.health-service {
  min-width: 0;
  min-height: 83px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
}

.health-service:nth-child(odd) {
  border-right: 1px solid var(--color-border);
}

.health-service:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.health-service:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  border-right: 0;
}

.health-service-main {
  min-width: 0;
  gap: 10px;
}

.health-service-main > div {
  min-width: 0;
}

.health-service h3 {
  font-size: 14px;
}

.health-service p {
  overflow: hidden;
  margin-top: 1px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 4px rgba(21, 150, 106, 0.1);
}

.health-service.is-warning .health-status-dot { background: var(--color-warning); box-shadow: 0 0 0 4px rgba(217, 145, 24, 0.1); }
.health-service.is-critical .health-status-dot { background: var(--color-danger); box-shadow: 0 0 0 4px rgba(200, 72, 72, 0.1); }
.health-service.is-inactive .health-status-dot { background: var(--color-muted); box-shadow: 0 0 0 4px rgba(104, 116, 129, 0.1); }

.health-status-label {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--color-success);
  background: rgba(21, 150, 106, 0.1);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.health-service.is-warning .health-status-label { color: #9a6100; background: rgba(217, 145, 24, 0.12); }
.health-service.is-critical .health-status-label { color: var(--color-danger); background: rgba(200, 72, 72, 0.1); }
.health-service.is-inactive .health-status-label { color: var(--color-muted); background: rgba(104, 116, 129, 0.1); }

.health-service-metrics {
  justify-content: flex-end;
  gap: 16px;
}

.health-service-metrics > span {
  min-width: 58px;
  text-align: right;
}

.health-service-metrics small,
.health-service-metrics strong {
  display: block;
  white-space: nowrap;
}

.health-service-metrics small {
  color: var(--color-muted);
  font-size: 10px;
}

.health-service-metrics strong {
  max-width: 150px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.health-disk {
  min-width: 170px;
  justify-content: flex-end;
  gap: 10px;
}

.health-disk > span {
  width: 105px;
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-border);
}

.health-disk i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--color-success);
  transition: width 0.25s ease;
}

.health-service.is-warning .health-disk i { background: var(--color-warning); }
.health-service.is-critical .health-disk i { background: var(--color-danger); }

@keyframes health-spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .health-service {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .health-service-metrics,
  .health-disk {
    justify-content: flex-start;
    padding-left: 19px;
  }

  .health-service-metrics > span { text-align: left; }
}

@media (max-width: 760px) {
  .health-header,
  .health-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .health-actions {
    width: 100%;
    justify-content: space-between;
  }

  .health-overview-counts {
    width: 100%;
  }

  .health-overview-counts > span {
    min-width: 0;
    flex: 1;
    padding: 8px;
    border-top: 1px solid var(--color-border);
  }

  .health-service-list {
    grid-template-columns: 1fr;
  }

  .health-service,
  .health-service:nth-child(odd),
  .health-service:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .health-service:last-child { border-bottom: 0; }
}

@media (max-width: 460px) {
  .health-actions,
  .health-auto-refresh {
    align-items: stretch;
    flex-direction: column;
  }

  .health-auto-refresh { flex-direction: row; }
  .health-refresh { justify-content: center; }
  .health-service-main { align-items: flex-start; }
  .health-status-label { margin-top: -2px; }
  .health-service-metrics { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .health-refresh.is-loading svg { animation: none; }
}
