.services-health {
    width: 100%;
}

.services-health__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.services-health__kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.services-health-kpi {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 0.85rem;
    background: var(--bs-body-bg);
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.1);
    min-width: 0;
}

.services-health-kpi__label {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}

.services-health-kpi__value {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
}

.services-health-kpi__muted {
    color: var(--bs-secondary-color);
    font-weight: 500;
}

.services-health__section + .services-health__section {
    margin-top: 1.5rem;
}

.services-health__section-title {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.services-health__section-count {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.services-health__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: stretch;
}

.services-health-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.services-health-box__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.75rem 0.9rem;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.services-health-box__body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
}

.services-health-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    flex-shrink: 0;
}

.services-health-status-badge svg {
    width: 1.25rem;
    height: 1.25rem;
}

.services-health-status-badge--healthy {
    color: var(--bs-success);
}

.services-health-status-badge--degraded {
    color: var(--bs-warning);
}

.services-health-status-badge--unhealthy {
    color: var(--bs-danger);
}

.services-health-status-badge--unreachable {
    color: var(--bs-danger);
}

.services-health-status-badge.services-health-status-badge--healthy {
    background: color-mix(in srgb, var(--bs-success) 16%, var(--bs-body-bg));
}

.services-health-status-badge.services-health-status-badge--degraded {
    background: color-mix(in srgb, var(--bs-warning) 22%, var(--bs-body-bg));
}

.services-health-status-badge.services-health-status-badge--unhealthy {
    background: color-mix(in srgb, var(--bs-danger) 14%, var(--bs-body-bg));
}

.services-health-status-badge.services-health-status-badge--unreachable {
    background: color-mix(in srgb, var(--bs-danger) 28%, var(--bs-body-bg));
}

.services-health-status-icon {
    flex-shrink: 0;
    vertical-align: -0.15em;
}

.services-health-box__name {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.services-health-box__version {
    margin-left: auto;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.services-health-box__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.services-health-box__metric {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.services-health-box__metric-label {
    color: var(--bs-secondary-color);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
}

.services-health-box__metric-value {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.services-health-box__url {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.services-health-box__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.services-health-box__error {
    color: var(--bs-danger);
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.services-health-box__empty {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.services-health-deps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0;
    padding: 0.65rem 0 0;
    border-top: 1px dashed var(--bs-border-color);
}

.services-health-dep {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.services-health-dep__name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    font-weight: 600;
}

.services-health-dep__ms {
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.services-health-dep__detail {
    grid-column: 1 / -1;
    color: var(--bs-secondary-color);
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .services-health__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .services-health__list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .services-health__kpis {
        grid-template-columns: 1fr;
    }

    .services-health-box__metrics {
        grid-template-columns: 1fr;
    }
}
