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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e2e8f0;
  --muted: #8892a0;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 28px 0 24px;
  margin-bottom: 32px;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}

.logo-icon {
  font-size: 1rem;
  color: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

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

.subtitle {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 6px;
}

.overall-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background 0.3s;
}

.overall-banner.all-good { border-color: #166534; background: #052e16; }
.overall-banner.issues   { border-color: #7f1d1d; background: #2d0d0d; }
.overall-banner.neutral  { border-color: var(--border); }

.banner-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}

#sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}

.site-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
}

.site-card.status-up      { border-left: 3px solid var(--green); }
.site-card.status-down    { border-left: 3px solid var(--red); }
.site-card.status-unknown { border-left: 3px solid var(--muted); }

.site-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.site-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.status-up      .site-dot { background: var(--green); }
.status-down    .site-dot { background: var(--red); animation: blink 1s step-start infinite; }
.status-unknown .site-dot { background: var(--muted); }

@keyframes blink { 50% { opacity: 0; } }

.site-info { flex: 1; min-width: 0; }
.site-info h2 { font-size: 1rem; font-weight: 600; }

.site-url {
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}
.site-url:hover { color: var(--blue); }

.status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.badge-up      { background: #052e16; color: var(--green); border: 1px solid #166534; }
.badge-down    { background: #2d0d0d; color: var(--red);   border: 1px solid #7f1d1d; }
.badge-unknown { background: #1f2937; color: var(--muted); border: 1px solid #374151; }

.site-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stat {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-value { font-size: 0.95rem; font-weight: 600; }

.uptime-val.green  { color: var(--green); }
.uptime-val.yellow { color: var(--yellow); }
.uptime-val.red    { color: var(--red); }
.uptime-na         { color: var(--muted); }

.site-footer {
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { margin-bottom: 20px; font-size: 1.05rem; }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }

footer {
  margin-top: auto;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

@media (max-width: 600px) {
  #sites-grid { grid-template-columns: 1fr; }
  .site-stats { grid-template-columns: repeat(2, 1fr); }
}
