:root {
  --bg: #14171c; --card: #1d222a; --text: #e6e9ee; --muted: #8b93a1; --accent: #4c8dff;
  --on: #2ecc71; --off: #e5484d; --wait: #f5a524; --unk: #5b6370;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
.wrap { max-width: 720px; margin: 0 auto; padding: 20px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
h1 { font-size: 1.4rem; margin: 0; }
nav a { color: var(--accent); text-decoration: none; margin-left: 16px; }
nav a:hover { text-decoration: underline; }

.card { display: flex; align-items: center; gap: 14px; background: var(--card); padding: 14px 16px; border-radius: 10px; margin-bottom: 10px; }
.info { flex: 1; min-width: 0; }
.name { font-weight: 600; }
.meta { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

.lamp { width: 14px; height: 14px; border-radius: 50%; background: var(--unk); flex: none; }
.lamp.on { background: var(--on); box-shadow: 0 0 8px var(--on); }
.lamp.off { background: var(--off); }
.lamp.waking { background: var(--wait); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

button { font: inherit; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { background: #2a303a; color: var(--muted); cursor: default; }
button.danger { background: #3a2226; color: #ff8b90; }
button.ghost { background: #2a303a; color: var(--text); }

form { display: grid; gap: 12px; background: var(--card); padding: 16px; border-radius: 10px; margin-bottom: 24px; }
label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
input { font: inherit; padding: 9px 10px; border-radius: 8px; border: 1px solid #333a46; background: #12151a; color: var(--text); width: 100%; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.msg { min-height: 1.3em; font-size: .9rem; }
.msg.err { color: var(--off); }
.msg.ok { color: var(--on); }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.card input { max-width: 200px; }
