:root {
  --bg: #0b0d14;
  --sidebar: #07080d;
  --card: #11141c;
  --raised: #1a1e28;
  --line: rgba(238, 240, 245, 0.08);
  --text: #eef0f5;
  --secondary: #a3a9b8;
  --muted: #7a8296;
  --accent: #5b8def;
  --up: #4cc38a;
  --down: #e5484d;
  --pending: #d4a017;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

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

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(76, 195, 138, 0.18);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand .sub {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  max-width: 42rem;
}

.overall {
  text-align: right;
  flex-shrink: 0;
}

.overall .state {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.overall .state.up { color: var(--up); }
.overall .state.down { color: var(--down); }
.overall .meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  min-height: 88px;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.stat .value {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.stat .value.up { color: var(--up); }
.stat .value.down { color: var(--down); }
.stat .hint {
  margin-top: 4px;
  color: var(--secondary);
  font-size: 12px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chip:hover { color: var(--text); border-color: rgba(238,240,245,0.16); }
.chip.active {
  background: var(--raised);
  color: var(--text);
  border-color: rgba(91, 141, 239, 0.45);
}

.chip .count {
  margin-left: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.section {
  margin-bottom: 28px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--secondary);
  letter-spacing: 0;
}

.section-head .sec-meta {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1.4fr) 100px 90px 120px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  min-height: 48px;
  border-top: 1px solid var(--line);
}

.row:first-child { border-top: 0; }
.row:hover { background: var(--raised); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.status-dot.up { background: var(--up); }
.status-dot.down { background: var(--down); }
.status-dot.pending { background: var(--pending); }

.name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kind, .host, .detail {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.kind { color: var(--secondary); }

.detail {
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail.up { color: var(--up); }
.detail.down { color: var(--down); }

.spark {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  height: 18px;
  align-items: flex-end;
}

.spark i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: var(--raised);
  min-height: 3px;
}
.spark i.up { background: rgba(76, 195, 138, 0.85); }
.spark i.down { background: rgba(229, 72, 77, 0.9); }

.footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.error {
  background: rgba(229, 72, 77, 0.08);
  border: 1px solid rgba(229, 72, 77, 0.28);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}

@media (max-width: 800px) {
  .app { padding: 16px 16px 48px; }
  .top { flex-direction: column; }
  .overall { text-align: left; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .row {
    grid-template-columns: 18px minmax(0, 1fr) 72px;
    grid-template-areas:
      "dot name detail"
      "dot kind kind";
  }
  .host, .spark { display: none; }
  .name { grid-area: name; }
  .kind { grid-area: kind; }
  .detail { grid-area: detail; }
}

.row.head {
  min-height: 36px;
  padding-top: 10px;
  padding-bottom: 10px;
  background: var(--sidebar);
  border-top: 0;
}
.row.head .name,
.row.head .kind,
.row.head .host,
.row.head .detail {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
}
.row.head:hover { background: var(--sidebar); }

.row {
  grid-template-columns: 18px minmax(160px, 1.6fr) 88px 64px minmax(160px, 1.1fr);
}
.detail .state-word { font-weight: 500; }
.summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.project-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  max-width: 52rem;
}
.bucket { margin-bottom: 16px; }
.bucket h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.section.project { margin-bottom: 40px; }
