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

body {
  background: #171717;
  color: #e5e5e5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: #21c45d;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e5e5e5;
}

.header h1 span {
  font-weight: 400;
  color: #737373;
}

.global-status {
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #2a2a2a;
  background: #1e1e1e;
}

.global-status.green {
  border-color: #21c45d;
  background: rgba(33, 196, 93, 0.1);
  color: #21c45d;
}

.global-status.yellow {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.1);
  color: #eab308;
}

.global-status.red {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Stale banner */
.stale-banner {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.stale-banner.warning {
  display: block;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid #eab308;
  color: #eab308;
}

.stale-banner.critical {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #ef4444;
}

/* Category */
.category {
  margin-bottom: 1.5rem;
}

.category-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #737373;
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

/* Service row */
.service-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  transition: background 0.15s;
}

.service-row:hover {
  background: #252525;
}

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.up {
  background: #21c45d;
  box-shadow: 0 0 6px rgba(33, 196, 93, 0.5);
}

.status-dot.degraded {
  background: #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.5);
}

.status-dot.down {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.status-dot.unknown {
  background: #737373;
  box-shadow: 0 0 6px rgba(115, 115, 115, 0.3);
}

/* Service info */
.service-info {
  flex: 1;
  min-width: 0;
}

.service-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e5e5;
}

.service-domain {
  font-size: 0.75rem;
  color: #737373;
  display: none;
}

.service-row:hover .service-domain {
  display: inline;
}

.service-meta {
  font-size: 0.7rem;
  color: #737373;
  margin-left: 0.25rem;
}

/* Uptime bar */
.uptime-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.uptime-bar {
  display: flex;
  gap: 1px;
  height: 24px;
  width: 200px;
}

.uptime-bar .segment {
  flex: 1;
  border-radius: 2px;
  min-width: 2px;
}

.uptime-bar .segment.up {
  background: #21c45d;
}

.uptime-bar .segment.degraded {
  background: #eab308;
}

.uptime-bar .segment.down {
  background: #ef4444;
}

.uptime-bar .segment.unknown {
  background: #2a2a2a;
}

.uptime-pct {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  width: 48px;
  text-align: right;
  flex-shrink: 0;
}

.uptime-pct.perfect {
  color: #21c45d;
}

.uptime-pct.bad {
  color: #ef4444;
}

.uptime-pct.ok {
  color: #e5e5e5;
}

/* Footer */
.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2a2a;
  font-size: 0.75rem;
  color: #737373;
  text-align: center;
}

/* Server metrics (admin) */
.server-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.75rem;
}

.metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #737373;
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.5rem;
}

.metric-progress {
  height: 4px;
  background: #2a2a2a;
  border-radius: 2px;
  overflow: hidden;
}

.metric-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.metric-progress-fill.green {
  background: #21c45d;
}

.metric-progress-fill.yellow {
  background: #eab308;
}

.metric-progress-fill.red {
  background: #ef4444;
}

/* Server reachability (admin) */
.server-reachability {
  margin-bottom: 1.5rem;
}

.reachability-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.65rem 0.75rem;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
}

.reachability-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.reachability-label {
  color: #737373;
}

/* Responsive */
@media (max-width: 640px) {
  .header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .service-row {
    flex-wrap: wrap;
  }

  .uptime-container {
    width: 100%;
    padding-left: 1.75rem;
  }

  .uptime-bar {
    flex: 1;
    width: auto;
  }

  .server-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .reachability-row {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}
