* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: #020617;
  border-bottom: 1px solid #1e293b;
}

h1 {
  margin: 0;
  font-size: 28px;
}

header p {
  margin: 6px 0 0;
  color: #94a3b8;
}

button {
  background: #2563eb;
  color: white;
  border: 0;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 20px 32px;
}

.summary-card {
  background: #1e293b;
  padding: 16px;
  border-radius: 14px;
  font-weight: bold;
  text-align: center;
}

.summary-card.alive {
  border: 1px solid #22c55e;
}

.summary-card.dead {
  border: 1px solid #ef4444;
}

main {
  padding: 0 32px 32px;
}

h2 {
  color: #f8fafc;
  margin-top: 24px;
}

.graph {
  position: relative;
  min-height: 520px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 260px;
}

.node {
  position: relative;
  z-index: 2;
  background: #1e293b;
  border-radius: 18px;
  padding: 18px;
  min-height: 190px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.35);
}

.node.alive {
  border: 2px solid #22c55e;
}

.node.dead {
  border: 2px solid #ef4444;
}

.node-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-icon {
  font-size: 34px;
}

.node h3 {
  margin: 0;
}

.ip {
  color: #94a3b8;
  margin-top: 4px;
}

.badge {
  margin-left: auto;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
}

.badge.alive {
  background: #14532d;
  color: #86efac;
}

.badge.dead {
  background: #7f1d1d;
  color: #fecaca;
}

.services {
  margin-top: 18px;
}

.service {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #0f172a;
  border: 1px solid #334155;
}

.service:hover {
  background: #172554;
}

.service.alive {
  border-left: 4px solid #22c55e;
}

.service.dead {
  border-left: 4px solid #ef4444;
}

.service small {
  color: #94a3b8;
}

.service.muted {
  color: #64748b;
  cursor: default;
}

.lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.edge {
  stroke-width: 4;
  stroke-dasharray: 10 8;
}

.edge.alive {
  stroke: #22c55e;
}

.edge-label {
  fill: #cbd5e1;
  font-size: 14px;
}

.standalone {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 20;
  justify-content: center;
  align-items: center;
}

.modal-content {
  width: 80%;
  height: 75%;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 18px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  background: #111827;
  border-bottom: 1px solid #334155;
}

.modal-header h3 {
  margin: 0;
}

pre {
  margin: 0;
  padding: 20px;
  height: calc(100% - 64px);
  overflow: auto;
  color: #d1d5db;
  background: #020617;
  font-size: 13px;
  line-height: 1.5;
}
