* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111318;
  color: #e8e8ea;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: #1a1d24;
  border-bottom: 1px solid #2a2e38;
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
}

.back-link {
  color: #8ab4f8;
  text-decoration: none;
}

button {
  background: #2a2e38;
  color: #e8e8ea;
  border: 1px solid #3a3f4b;
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

button:hover {
  background: #343a47;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.login-card {
  max-width: 320px;
  margin: 4rem auto;
  padding: 2rem;
  background: #1a1d24;
  border-radius: 12px;
  border: 1px solid #2a2e38;
}

.login-card h1 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #a7abb5;
}

input {
  background: #111318;
  border: 1px solid #3a3f4b;
  border-radius: 6px;
  padding: 0.5rem;
  color: #e8e8ea;
}

.error {
  color: #f28b82;
  font-size: 0.9rem;
}

.device-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.device-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  background: #1a1d24;
  border: 1px solid #2a2e38;
  border-radius: 10px;
  color: #e8e8ea;
  text-decoration: none;
}

.device-list .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5f6368;
  flex-shrink: 0;
}

.device-list.online .dot,
li.online .dot {
  background: #34a853;
}

li.offline .dot {
  background: #5f6368;
}

.device-list .id {
  font-weight: 600;
  flex: 1;
}

.device-list .status {
  font-size: 0.8rem;
  color: #a7abb5;
}

video {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  background: #000;
}

#status {
  color: #a7abb5;
  font-size: 0.9rem;
}
