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

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Quicksand:wght@500&display=swap');

:root {
  /* Brand palette — from Velory Next design system */
  --brand-200: hsl(30 32% 94%);   /* #F5EFE9 — page background */
  --brand-300: hsl(30 36% 87%);   /* #EBDFD3 — subtle accents */
  --brand-950: hsl(31 22% 55%);   /* #A38C74 — logo mark */

  --grey-0:    hsl(0 0% 100%);
  --grey-50:   hsl(0 0% 98%);
  --grey-100:  hsl(0 0% 96%);
  --grey-150:  hsl(180 2% 94%);
  --grey-200:  hsl(180 2% 92%);
  --grey-400:  hsl(210 3% 76%);
  --grey-500:  hsl(204 3% 61%);
  --grey-600:  hsl(210 3% 53%);
  --grey-700:  hsl(210 4% 38%);
  --grey-900:  hsl(207 10% 22%);

  /* Semantic */
  --bg:         var(--brand-200);
  --surface:    var(--grey-0);
  --border:     var(--grey-150);
  --text:       var(--grey-900);
  --text-muted: var(--grey-600);

  /* Status colors */
  --success-bg:   hsl(135 33% 96%);
  --success-text: hsl(135 33% 32%);
  --success-dot:  hsl(135 38% 61%);
  --success-border: hsl(135 33% 75%);

  --amber-bg:   hsl(48 100% 96%);
  --amber-text: hsl(23 83% 31%);
  --amber-dot:  hsl(38 92% 50%);
  --amber-border: hsl(46 97% 65%);

  --orange-bg:   hsl(30 85% 96%);
  --orange-text: hsl(30 61% 35%);
  --orange-dot:  hsl(30 85% 64%);
  --orange-border: hsl(30 85% 70%);

  --red-bg:   hsl(0 73% 96%);
  --red-text: hsl(355 47% 36%);
  --red-dot:  hsl(355 78% 67%);
  --red-border: hsl(0 60% 79%);

  --radius-card: 16px;
  --radius-badge: 999px;
  --radius-sm: 8px;

  --font-body:    'Inter', sans-serif;
  --font-heading: 'Quicksand', sans-serif;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-logo {
  height: 32px;
  width: auto;
  color: var(--text);
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-divider {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border);
}

.brand-status {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
}

.last-updated {
  max-width: 760px;
  margin: 10px auto 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: var(--radius-badge);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge--loading        { background: var(--grey-100); color: var(--text-muted); border-color: var(--border); }
.badge--loading::before { background: var(--grey-400); }

.badge--operational    { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.badge--operational::before { background: var(--success-dot); }

.badge--degraded       { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.badge--degraded::before { background: var(--amber-dot); }

.badge--partial_outage { background: var(--orange-bg); color: var(--orange-text); border-color: var(--orange-border); }
.badge--partial_outage::before { background: var(--orange-dot); }

.badge--major_outage,
.badge--down           { background: var(--red-bg); color: var(--red-text); border-color: var(--red-border); }
.badge--major_outage::before,
.badge--down::before   { background: var(--red-dot); }

.badge--unknown        { background: var(--grey-100); color: var(--text-muted); border-color: var(--border); }
.badge--unknown::before { background: var(--grey-400); }

/* ── Main layout ── */
main {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

section h2 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── Component list ── */
.component-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.component-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.component-row:last-child { border-bottom: none; }

.component-name {
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
  color: var(--text);
}

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

.latency {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 54px;
  text-align: right;
  font-weight: 400;
}

/* ── Uptime bars ── */
.uptime-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uptime-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.uptime-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.uptime-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.uptime-bars {
  display: flex;
  gap: 2px;
  height: 32px;
  align-items: stretch;
}

.uptime-bar {
  flex: 1;
  border-radius: 3px;
  cursor: default;
  transition: opacity 0.1s;
}
.uptime-bar:hover { opacity: 0.75; }

.uptime-bar--operational    { background: var(--success-dot); }
.uptime-bar--degraded       { background: var(--amber-dot); }
.uptime-bar--partial_outage { background: var(--orange-dot); }
.uptime-bar--down,
.uptime-bar--major_outage   { background: var(--red-dot); }
.uptime-bar--unknown        { background: var(--grey-200); }

.uptime-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Incident list ── */
.incident-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.incident-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.incident-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.incident-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.incident-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.severity-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-badge);
  background: var(--orange-bg);
  color: var(--orange-text);
  border: 1px solid var(--orange-border);
}

.status-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-badge);
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}
.status-tag--active {
  background: var(--red-bg);
  color: var(--red-text);
  border-color: var(--red-border);
}

.incident-details {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 400;
}

.no-incidents {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ── Skeletons ── */
.skeleton-row {
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.skeleton-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.03) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Error state ── */
.error-msg {
  font-size: 0.82rem;
  color: var(--red-text);
  padding: 12px 18px;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
}

@media (max-width: 520px) {
  header { padding: 16px; }
  main { padding: 0 16px; margin: 24px auto; }
  .component-row { padding: 12px 16px; }
  .incident-card { padding: 14px 16px; }
}
