:root {
  --bg: #0f172a;
  --card: #111827;
  --accent: #22c55e;
  --danger: #ef4444;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #1f2937;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 20%, #1f2937, #0f172a 55%);
  color: var(--text);
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar nav a {
  margin-left: 12px;
  padding: 6px 10px;
  border-radius: 6px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  background: var(--muted);
}
.dot.online { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.dot.offline { background: var(--danger); }

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

label { display: block; font-size: 0.9rem; color: var(--muted); }
input {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
}

button {
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  background: #1f2937;
  color: var(--text);
  border: 1px solid var(--border);
}
button.primary { background: linear-gradient(90deg, #22c55e, #16a34a); color: #041008; border: none; }
button.danger { background: linear-gradient(90deg, #ef4444, #b91c1c); }
button:hover { opacity: 0.95; }

.connector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.connector-card .actions {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.meta dt { color: var(--muted); font-size: 0.85rem; }
.meta dd { margin: 0; }

.logs-table { width: 100%; border-collapse: collapse; }
.logs-table th, .logs-table td { border: 1px solid var(--border); padding: 8px; vertical-align: top; }
.logs-table pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

.badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #1f2937;
  border: 1px solid var(--border);
}

.link { color: var(--accent); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
}
.modal h3 { margin-top: 0; margin-bottom: 8px; }
.modal p { margin: 0 0 12px 0; color: var(--text); }

@media (max-width: 640px) {
  .card-header { flex-direction: column; align-items: flex-start; }
  .actions { flex-direction: column; }
}
