/* ============================================================
   HEALTH — System Status Page
   ============================================================ */

/* --- Overall Status Banner --- */
.health-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  margin-bottom: 1.5rem;
}

.health-banner--ok {
  border-color: #24c792;
  background: rgba(36, 199, 146, 0.08);
}

.health-banner--degraded {
  border-color: var(--secondary);
  background: rgba(255, 176, 0, 0.08);
}

.health-banner--down,
.health-banner--critical {
  border-color: var(--error);
  background: rgba(255, 51, 51, 0.08);
}

.health-banner__icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.health-banner--ok .health-banner__icon {
  color: #24c792;
}

.health-banner--degraded .health-banner__icon {
  color: var(--secondary);
}

.health-banner--down .health-banner__icon,
.health-banner--critical .health-banner__icon {
  color: var(--error);
}

.health-banner__text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.health-banner__label {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.health-banner__desc {
  color: var(--muted);
  font-size: 0.85rem;
}

/* --- Date Range --- */
.health-date-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.health-date-range__label {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.health-date-range__days {
  color: var(--muted);
  font-size: 0.8rem;
}

/* --- Group --- */
.health-group {
  margin-bottom: 2rem;
}

.health-group__header {
  margin-bottom: 1rem;
}

.health-group__name {
  color: var(--secondary);
  font-size: 0.85rem;
  letter-spacing: 2px;
  font-weight: 700;
}

/* --- Component Row --- */
.health-component {
  padding: 1rem 0;
  border-bottom: 1px solid var(--divider);
}

.health-component:last-child {
  border-bottom: none;
}

.health-component__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.health-component__left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.health-component__name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.health-component__uptime {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* --- Status Dot --- */
.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-dot.health-status--ok {
  background: #24c792;
  box-shadow: 0 0 6px rgba(36, 199, 146, 0.5);
}

.health-dot.health-status--degraded {
  background: var(--secondary);
  box-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

.health-dot.health-status--down,
.health-dot.health-status--critical {
  background: var(--error);
  box-shadow: 0 0 6px rgba(255, 51, 51, 0.5);
}

/* --- 90-Day Bar Chart --- */
.health-bars {
  display: flex;
  gap: 1.5px;
  height: 28px;
  align-items: stretch;
}

.health-bar {
  flex: 1;
  min-width: 0;
  border-radius: 2px;
  cursor: default;
  transition: opacity 0.15s;
}

.health-bar:hover {
  opacity: 0.7;
}

.health-bar--ok {
  background: #24c792;
}

.health-bar--degraded {
  background: var(--secondary);
}

.health-bar--down {
  background: var(--error);
}

.health-bar--nodata {
  background: rgba(255, 255, 255, 0.1);
}

/* --- Bar Legend (dates below bar) --- */
.health-bars__legend {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.7rem;
}

/* --- Hover Tooltip --- */
.health-tooltip {
  position: absolute;
  z-index: 50;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.health-tooltip__date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.health-tooltip__status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.health-tooltip__icon {
  font-size: 0.7rem;
}

.health-tooltip__status--ok {
  color: #24c792;
}

.health-tooltip__status--degraded {
  color: var(--secondary);
}

.health-tooltip__status--down,
.health-tooltip__status--critical {
  color: var(--error);
}

.health-tooltip__status--nodata {
  color: var(--muted);
}

.health-tooltip__uptime {
  font-size: 0.75rem;
  color: var(--muted);
}

/* --- Updated timestamp --- */
.health-updated {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .health-banner {
    padding: 1rem;
  }

  .health-banner__label {
    font-size: 0.95rem;
  }

  .health-bars {
    height: 22px;
  }

  .health-component__header {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .health-component__uptime {
    width: 100%;
    text-align: right;
  }
}
