:root {
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e6e8ec;
  --text: #1a1d21;
  --text-muted: #5c6470;
  --green: #1f9d55;
  --green-light: #d4f1d8;
  --yellow: #d4a017;
  --red: #c8282a;
  --blue: #2563eb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* Header */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 17px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, #0b1d36 0%, #1e3a6b 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
}
.brand-name { color: var(--text); }
.brand-suffix { color: var(--text-muted); font-weight: 400; }
.topbar-actions {
  font-size: 14px;
  color: var(--text-muted);
}

/* Hero status */
.hero {
  background: var(--green);
  color: #fff;
  padding: 28px 0;
}
.hero.partial { background: var(--yellow); }
.hero.major { background: var(--red); }
.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 600;
}
.hero-icon {
  width: 24px;
  height: 24px;
  background: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}
.hero-icon.partial { color: var(--yellow); }
.hero-icon.major { color: var(--red); }
.hero-meta {
  font-size: 13px;
  opacity: 0.9;
}

/* Section */
section { margin-top: 40px; }
.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* Component card */
.components {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.component {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.component:last-child { border-bottom: none; }
.component-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.component-name {
  font-weight: 500;
  font-size: 15px;
}
.component-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.component-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}
.component-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}
.component-status.degraded { color: var(--yellow); }
.component-status.critical { color: var(--red); }
.component-status.no_data { color: var(--text-muted); }
.component-uptime {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}
.dot.degraded { background: var(--yellow); }
.dot.critical { background: var(--red); }
.dot.no_data { background: #e0e3e8; }

/* 90-day uptime strip */
.strip {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 30px;
  margin-top: 8px;
}
.strip {
  position: relative;
}
.strip-bar {
  flex: 1;
  background: var(--green);
  border-radius: 1px;
  height: 100%;
  min-width: 3px;
  opacity: 0.85;
  cursor: default;
  transition: transform 80ms ease;
  position: relative;
}
.strip-bar:hover {
  opacity: 1;
  transform: scaleY(1.06);
}
/* Instant custom tooltip — replaces the slow native title tooltip.
   Reads from data-tip set on each bar. Positioned above the bar,
   centered, with a small arrow. */
.strip-bar::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1d21;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 60ms ease;
  z-index: 10;
}
.strip-bar::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1a1d21;
  pointer-events: none;
  opacity: 0;
  transition: opacity 60ms ease;
  z-index: 10;
}
.strip-bar:hover::after,
.strip-bar:hover::before {
  opacity: 1;
}
.strip-bar.warn { background: var(--yellow); }
.strip-bar.err { background: var(--red); height: 70%; }
.strip-bar.miss { background: #e0e3e8; }
.strip-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Incident history */
.day {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 12px;
}
.day-date {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}
.day-empty {
  color: var(--text-muted);
  font-size: 13px;
}
.incident-title {
  font-size: 15px;
  font-weight: 600;
  margin: 6px 0 10px;
}
.incident-update {
  padding-left: 14px;
  border-left: 2px solid var(--border);
  margin: 8px 0;
  font-size: 13px;
  color: var(--text);
}
.incident-update strong {
  font-weight: 600;
}
.incident-update.resolved strong { color: var(--green); }
.incident-update.monitoring strong { color: var(--blue); }
.incident-update.identified strong { color: var(--yellow); }
.incident-update.investigating strong { color: var(--red); }
.incident-time {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 8px;
}
.impact-line {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.impact-line strong { color: var(--text); font-weight: 500; }

/* Footer */
footer {
  margin-top: 60px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
footer a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 10px;
}
footer a:hover { color: var(--text); }
