:root {
  --bg: #0f1116;
  --panel: #171a21;
  --panel2: #1f2430;
  --accent: #f97316;
  --accent2: #38bdf8;
  --text: #e5e7eb;
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #111827, #0b0f1a 65%);
  color: var(--text);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px;
}

.page.auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.card {
  background: var(--panel);
  padding: 32px;
  border-radius: 16px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.topbar a {
  color: var(--accent2);
  text-decoration: none;
}

.user {
  display: flex;
  align-items: center;
  gap: 16px;
}

h1, h2 {
  margin: 0 0 8px 0;
}

.muted {
  color: var(--muted);
  margin: 0 0 16px 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2b3140;
  background: var(--panel2);
  color: var(--text);
}

.form select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2b3140;
  background: var(--panel2);
  color: var(--text);
}

.form button, .btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #0b0f1a;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn.google {
  background: var(--accent2);
}

.divider {
  margin: 16px 0;
  text-align: center;
  color: var(--muted);
}

.alert {
  background: #7f1d1d;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.panel {
  background: var(--panel);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #212636;
}

.panel.span-2 {
  grid-column: span 2;
}

.metric {
  font-size: 42px;
  font-weight: 700;
}

.meta {
  color: var(--muted);
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.edge-cards {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.edge-card {
  border: 1px solid #2b3140;
  border-radius: 12px;
  padding: 12px;
  background: #141923;
}

.edge-card.is-online {
  border-color: #14532d;
}

.edge-card.is-offline {
  border-color: #7f1d1d;
}

.edge-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.edge-pill {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1f2937;
  color: #cbd5e1;
}

.edge-card-body {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #2b3140;
  font-size: 14px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.logs {
  max-height: 280px;
  overflow: auto;
  font-size: 14px;
}

.log-row {
  padding: 6px 0;
  border-bottom: 1px dashed #2b3140;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .panel.span-2 {
    grid-column: span 1;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .card {
    width: 100%;
  }
}
