:root {
  color-scheme: dark;
  --bg: #0a0f0a;
  --panel: #10160f;
  --accent: #00ff6a;
  --accent-dim: #66ffa0;
  --danger: #ff4444;
  --text: #d8ffe3;
  --muted: #6b8f76;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Consolas, 'Fira Code', monospace;
  min-height: 100vh;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--accent);
  background: var(--panel);
  flex-wrap: wrap;
  gap: 8px;
}

main#view { padding: 20px; flex: 1; }

button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 14px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 3px;
}
button:hover { background: rgba(0, 255, 106, 0.1); }
button:disabled { opacity: 0.5; cursor: default; }

.login-card {
  margin: auto;
  padding: 32px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--panel);
  width: min(90vw, 360px);
}
.login-card h1 { margin-top: 0; color: var(--accent); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  background: black;
  border: 1px solid var(--muted);
  color: var(--text);
  padding: 10px;
  font-family: inherit;
  border-radius: 3px;
}

.device-table { width: 100%; border-collapse: collapse; overflow-x: auto; display: block; }
.device-table th, .device-table td { text-align: left; padding: 10px; border-bottom: 1px solid #1e2a1e; }
.device-table thead { color: var(--accent-dim); }
.device-row { cursor: pointer; }
.device-row:hover { background: rgba(0, 255, 106, 0.06); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--badge-color, var(--muted));
  color: var(--badge-color, var(--muted));
  font-size: 0.8em;
  text-transform: uppercase;
}

.device-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.device-meta dt { color: var(--muted); }
.device-meta dd { margin: 0; }

.back-button { margin-bottom: 16px; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
