* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #e6e6ed;
  color: #1a1a2e;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

/* ── Header ─────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 28px;
  color: #6c5ce7;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.3s;
}

.status-indicator.connected {
  background: #00b894;
  box-shadow: 0 0 6px rgba(0,184,148,0.4);
}

.status-indicator.disconnected {
  background: #e17055;
  box-shadow: 0 0 6px rgba(225,112,85,0.4);
}

/* ── Devices Grid ───────────────────────────────── */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: #888;
  font-size: 14px;
}

/* ── Device Card ────────────────────────────────── */
.device-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.device-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

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

.device-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
}

.device-id {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.device-type {
  font-size: 11px;
  background: #f0f0f5;
  padding: 3px 8px;
  border-radius: 6px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ── Toggle Switch ──────────────────────────────── */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f0f0f5;
}

.toggle-label {
  font-size: 13px;
  color: #666;
}

.toggle-state {
  font-size: 13px;
  font-weight: 600;
}

.toggle-state.on {
  color: #00b894;
}

.toggle-state.off {
  color: #e17055;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ddd;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background: #6c5ce7;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* ── Footer ─────────────────────────────────────── */
footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
  text-align: center;
  font-size: 12px;
  color: #999;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 600px) {
  .container {
    padding: 16px;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .devices-grid {
    grid-template-columns: 1fr;
  }
}
