:root {
  color-scheme: dark;
}

body {
  margin: 0;
  background: #0d1117;
  color: #c9d1d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */

.topbar {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1.5rem;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topbar-title h1 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: -0.01em;
}

.topbar-caption {
  margin: 0;
  padding-left: 1.2rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: #8b949e;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-live {
  background: #3fb950;
  animation: pulse 1.8s ease-out infinite;
}

.status-error {
  background: #f85149;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(63, 185, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
  }
}

/* Stat cards */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #161b22;
  border: 1px solid #30363d;
  border-left: 3px solid #30363d;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.stat-border-green {
  border-left-color: #3fb950;
}

.stat-border-yellow {
  border-left-color: #d29922;
}

.stat-border-red {
  border-left-color: #f85149;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8b949e;
}

.stat-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: #c9d1d9;
}

.stat-accent {
  color: #58a6ff;
}

.stat-good {
  color: #3fb950;
}

.stat-bad {
  color: #f85149;
}

/* Panels */

.panel {
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: #0d1117;
}

.panel-error {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  border-color: rgba(248, 81, 73, 0.4);
  background: rgba(248, 81, 73, 0.06);
}

.panel-error-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.panel-error h2 {
  color: #f85149;
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.endpoint {
  color: #8b949e;
  margin: 0 0 0.3rem;
  word-break: break-all;
}

.error-detail {
  color: #f85149;
  margin: 0;
}

.dim {
  color: #6e7681;
  font-style: italic;
}

/* Consumer list */

.consumer-list {
  display: flex;
  flex-direction: column;
}

.consumer-row {
  padding: 0.55rem 0.15rem 0.7rem;
  border-bottom: 1px solid #161b22;
}

.consumer-row:last-child {
  border-bottom: none;
}

.consumer-row:hover {
  background: #12161c;
}

.row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 0.75rem;
}

.row-id {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
  flex: 1 1 auto;
}

.consumer-name {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: #e6edf3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 3ch;
  flex-shrink: 1;
}

.row-meta {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 999;
}

.meta-item b {
  font-weight: 600;
  color: #c9d1d9;
}

.meta-alert {
  color: #f85149;
}

.meta-alert b {
  color: #f85149;
}

.row-stats {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  margin-left: auto;
}

.row-idle {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.7rem;
}

.row-chart {
  margin-top: 0.3rem;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 30px;
}

.pill {
  display: inline-block;
  min-width: 1.7rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.pill-green {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
}

.pill-yellow {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}

.pill-red {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}

.pill-muted {
  background: rgba(139, 148, 158, 0.12);
  color: #6e7681;
}

.backlog-green {
  color: #3fb950;
}

.backlog-yellow {
  color: #d29922;
}

.backlog-red {
  color: #f85149;
}
