.ui-metric-trend,
.ui-performance-badge {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 0.3rem;
    border-radius: var(--radius-pill);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ui-metric-trend {
    min-height: 1.2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.25;
}

.ui-metric-trend strong,
.ui-performance-badge strong {
    color: inherit;
    font-weight: 750;
}

.ui-metric-trend span,
.ui-performance-badge span:not(.ui-performance-badge-dot) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-metric-trend--positive,
.ui-performance-badge--positive {
    border-color: rgba(17, 185, 129, 0.22);
    background: rgba(17, 185, 129, 0.08);
    color: #047857;
}

.ui-metric-trend--negative,
.ui-performance-badge--negative {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(220, 38, 38, 0.07);
    color: #b91c1c;
}

.ui-metric-trend--neutral,
.ui-performance-badge--neutral {
    border-color: var(--divider);
    background: var(--surface);
    color: var(--neutral-perf);
}

.ui-metric-trend.ui-metric-trend--positive,
.ui-metric-trend.ui-metric-trend--negative,
.ui-metric-trend.ui-metric-trend--neutral {
    border-color: transparent;
    background: transparent;
}

.ui-metric-trend--compact > span {
    display: none;
}

.ui-performance-badge {
    min-height: 22px;
    padding: 0 0.55rem;
    border: 1px solid var(--divider);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ui-performance-badge--primary {
    border-color: rgba(18, 69, 252, 0.15);
    background: var(--primary-50);
    color: var(--primary);
}

.ui-performance-badge--inline {
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.ui-performance-badge-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}
