:root {
  --bg: #0a0f0d;
  --bg-card: #111815;
  --bg-card-hover: #16201c;
  --border: #1e2a25;
  --border-light: #2a3a33;
  --text: #e8f0ec;
  --text-muted: #8a9a93;
  --text-dim: #5a6a63;
  --brand: #059669;
  --brand-light: #10b981;
  --brand-glow: rgba(5, 150, 105, 0.15);
  --operational: #10b981;
  --operational-bg: rgba(16, 185, 129, 0.08);
  --degraded: #f59e0b;
  --degraded-bg: rgba(245, 158, 11, 0.08);
  --down: #ef4444;
  --down-bg: rgba(239, 68, 68, 0.08);
  --not-configured: #6b7280;
  --not-configured-bg: rgba(107, 114, 128, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(5, 150, 105, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(5, 150, 105, 0.04), transparent);
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* Header */
.header { margin-bottom: 32px; }

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: white;
  box-shadow: 0 4px 16px var(--brand-glow);
}

.header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-light);
  background: var(--brand-glow);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover {
  border-color: var(--brand);
  color: var(--brand-light);
  background: var(--brand-glow);
}
.btn-icon.spinning svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Status Banner */
.status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s;
}

.status-banner.operational {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, var(--operational-bg), var(--bg-card));
}

.status-banner.degraded {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, var(--degraded-bg), var(--bg-card));
}

.status-banner.down {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, var(--down-bg), var(--bg-card));
}

.status-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--border);
}

.status-banner.operational .status-banner-icon {
  background: rgba(16, 185, 129, 0.15);
}
.status-banner.degraded .status-banner-icon {
  background: rgba(245, 158, 11, 0.15);
}
.status-banner.down .status-banner-icon {
  background: rgba(239, 68, 68, 0.15);
}

.status-banner-icon svg {
  width: 24px;
  height: 24px;
}

.status-banner h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-banner p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-banner-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  white-space: nowrap;
}

/* Spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border-light);
  border-top-color: var(--brand-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Sections */
.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-header h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Component Grid */
.component-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Component Card */
.component {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.component:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.component-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.3s;
}

.component-dot.operational {
  background: var(--operational);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.component-dot.degraded {
  background: var(--degraded);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.component-dot.down {
  background: var(--down);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: pulse 2s infinite;
}

.component-dot.not_configured {
  background: var(--not-configured);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.component-name {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.component-status {
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  padding: 3px 10px;
  border-radius: 20px;
}

.component-status.operational {
  color: var(--operational);
  background: var(--operational-bg);
}

.component-status.degraded {
  color: var(--degraded);
  background: var(--degraded-bg);
}

.component-status.down {
  color: var(--down);
  background: var(--down-bg);
}

.component-status.not_configured {
  color: var(--not-configured);
  background: var(--not-configured-bg);
}

.component-latency {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  min-width: 60px;
  text-align: right;
}

/* Endpoint Card */
.endpoint-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.endpoint-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.endpoint-row:last-child {
  border-bottom: none;
}

.endpoint-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 120px;
}

.endpoint-url {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brand-light);
  background: transparent;
  flex: 1;
  word-break: break-all;
}

/* Footer */
.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer p {
  font-size: 12px;
  color: var(--text-dim);
}

.footer-muted {
  margin-top: 2px;
}

.footer-right {
  display: flex;
  gap: 20px;
}

.footer-right a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-right a:hover {
  color: var(--brand-light);
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 20px 16px 40px;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .status-banner {
    flex-wrap: wrap;
  }

  .status-banner-time {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }

  .component {
    padding: 12px 14px;
  }

  .component-latency {
    display: none;
  }

  .endpoint-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .endpoint-label {
    min-width: auto;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
