:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --border: #2a2e38;
  --text: #e8e9ec;
  --muted: #9aa0ab;
  --accent: #4f8cff;
  --green: #34c759;
  --red: #ff453a;
  --yellow: #ffd60a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
}

h1 {
  font-size: 1.3rem;
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}

.subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 14px 0 6px;
}

input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #11131a;
  color: var(--text);
  font-size: 1rem;
}

input:focus { outline: 2px solid var(--accent); }

button {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: #2a2e38; }
button.danger { background: var(--red); }

.error {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 10px;
  min-height: 1em;
}

.dash { max-width: 480px; }

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.status-row:last-child { border-bottom: none; }
.status-row .label { color: var(--muted); }
.status-row .value { font-weight: 600; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }
.dot.warn { background: var(--yellow); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.actions button { margin-top: 0; }
.actions .full { grid-column: 1 / -1; }

.waiting { text-align: center; padding: 20px 0; color: var(--muted); font-size: 0.9rem; }

.history { margin-top: 16px; font-size: 0.78rem; color: var(--muted); }
.history div { padding: 2px 0; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.topbar button { width: auto; margin: 0; padding: 8px 14px; font-size: 0.8rem; }
