/* Panel horizontal bar charts — compact, top-aligned, readable */
.chart-hbar {
  width: 100%;
}

.chart-hbar .chart-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.chart-bar-item {
  display: grid;
  grid-template-columns: minmax(7.5rem, 32%) 1fr 2.75rem;
  align-items: center;
  gap: 0.65rem 0.75rem;
}

.chart-bar-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #f2f2f2);
  text-align: left;
  line-height: 1.25;
  word-break: break-word;
  min-width: 0;
}

.chart-bar-track {
  height: 22px;
  min-height: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #ff5c1a 0%, #ff8c42 100%);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(255, 92, 26, 0.25);
}

.chart-bar-value {
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #f2f2f2);
  text-align: right;
  line-height: 1;
}

/* Chart cards: do not stretch bars to fill tall grid siblings */
.grid-2 > .card .card-body--chart,
.grid-2 > .card .card-body:has(.chart-hbar) {
  flex: 0 1 auto !important;
  align-self: flex-start;
  width: 100%;
  padding: 1rem 1.25rem 1.125rem !important;
}

.card-body .chart-hbar .chart-bar-container,
.card-body .chart-bar-container {
  flex: 0 0 auto !important;
  justify-content: flex-start !important;
  min-height: unset !important;
}

.chart-bar-item {
  flex-shrink: 0;
}

/* Empty state */
.chart-hbar-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-secondary, #9a9a9a);
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .chart-bar-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .chart-bar-label { grid-column: 1; }
  .chart-bar-track { grid-column: 1; }
  .chart-bar-value { grid-column: 1; text-align: left; }
}
