.makerspace-dashboard-react-chart {
  min-height: 280px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.makerspace-dashboard-react-chart__status {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 1px dashed #c7ced6;
  border-radius: 6px;
  color: #5f6b7a;
  font-size: 0.95rem;
  background: #fff;
  padding: 1rem;
}

.makerspace-dashboard-react-chart__status--error {
  border-color: #b91c1c;
  color: #991b1b;
  background: #fef2f2;
}

.makerspace-dashboard-react-chart__status--empty {
  border-style: solid;
  color: #475569;
}

.makerspace-dashboard-react-chart canvas {
  max-width: 100%;
}

.makerspace-dashboard-range-selector {
  border: 1px solid #d7e3f4;
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  background: linear-gradient(120deg, rgba(226, 232, 240, 0.5), rgba(241, 245, 249, 0.9));
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.makerspace-dashboard-range-selector legend {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
  margin: 0;
}

.makerspace-dashboard-range-selector__pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.makerspace-dashboard-range-selector__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.7);
  color: #334155;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.makerspace-dashboard-range-selector__pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.makerspace-dashboard-range-selector__pill:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.95);
  color: #1d4ed8;
}

.makerspace-dashboard-range-selector__pill.is-active {
  border-color: rgba(59, 130, 246, 0.8);
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.makerspace-dashboard-range-selector__pill.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.makerspace-dashboard-range-selector__pill.is-loading {
  cursor: progress;
  opacity: 0.7;
}

.makerspace-dashboard-range-selector__pill:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.makerspace-dashboard-range-selector__pending {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #475569;
}

.makerspace-dashboard-range-selector__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.5);
  border-top-color: transparent;
  animation: makerspace-dashboard-spin 0.8s linear infinite;
}

.makerspace-dashboard-react-chart__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.35;
}

.makerspace-dashboard-react-chart__table th,
.makerspace-dashboard-react-chart__table td {
  border: 1px solid #d0d7de;
  padding: 0.5rem 0.75rem;
}

.makerspace-dashboard-react-chart__table th {
  background: #475569;
  color: #ffffff;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.makerspace-dashboard-react-chart__table caption {
  text-align: left;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.makerspace-dashboard-react-chart__children {
  display: grid;
  gap: 1rem;
}

.makerspace-dashboard-react-chart__children--two-up {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Prevent two-up containers from squeezing tabular chart renderings. */
.makerspace-dashboard-react-chart__children--two-up > .makerspace-dashboard-react-chart__table {
  grid-column: 1 / -1;
}

.makerspace-dashboard-react-chart__canvas--funnel {
  display: flex;
  align-items: center;
}

.makerspace-funnel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.makerspace-funnel__stage {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.makerspace-funnel__bar {
  border-radius: 999px;
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.makerspace-funnel__bar-label {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-weight: 600;
  gap: 1rem;
}

.makerspace-funnel__value {
  font-size: 1.05rem;
}

.makerspace-funnel__helper {
  font-size: 0.85rem;
  color: #475569;
}

@keyframes makerspace-dashboard-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
