:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2f3d;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #6c9eff;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --purple: #a78bfa;
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

h1 { font-size: 1.5rem; font-weight: 600; }
.subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

button {
  background: var(--accent);
  color: #0f1117;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { opacity: 0.9; }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.stat.warn .stat-value { color: var(--yellow); }
.stat.error .stat-value { color: var(--red); }
.stat.ok .stat-value { color: var(--green); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 0 2rem 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.card.full-width { grid-column: 1 / -1; }

.card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  background: var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 500;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status.running { background: rgba(52,211,153,0.15); color: var(--green); }
.status.stopped { background: rgba(248,113,113,0.15); color: var(--red); }
.status.planned { background: rgba(167,139,250,0.15); color: var(--purple); }
.status.partial { background: rgba(251,191,36,0.15); color: var(--yellow); }
.status.missing { background: rgba(248,113,113,0.15); color: var(--red); }
.status.port_conflict { background: rgba(251,191,36,0.15); color: var(--yellow); }

.empty, .error-msg {
  padding: 2rem 1.25rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.error-msg { color: var(--red); }

.mono { font-family: "Cascadia Code", "Fira Code", monospace; font-size: 0.8rem; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  header { flex-direction: column; gap: 1rem; }
}
