* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1419;
  color: #e7e9ea;
  min-height: 100vh;
  line-height: 1.5;
}
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: #1a1f26;
  border: 1px solid #2f3336;
  border-radius: 12px;
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.login-card h1 {
  font-size: 22px;
  margin-bottom: 6px;
  color: #e7e9ea;
}
.login-card .sub {
  color: #8b98a5;
  font-size: 14px;
  margin-bottom: 28px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: #8b98a5;
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  background: #0f1419;
  border: 1px solid #2f3336;
  border-radius: 8px;
  color: #e7e9ea;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus { border-color: #1d9bf0; }
.btn {
  width: 100%;
  padding: 12px;
  background: #1d9bf0;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #1a8cd8; }
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error { background: rgba(244, 33, 46, 0.1); color: #ff6b6b; border: 1px solid rgba(244, 33, 46, 0.2); }
.alert-ok { background: rgba(0, 186, 124, 0.1); color: #4ade80; border: 1px solid rgba(0, 186, 124, 0.2); }
.footer-note { text-align: center; margin-top: 20px; font-size: 12px; color: #5a6773; }

/* Dashboard layout */
.topbar {
  background: #1a1f26;
  border-bottom: 1px solid #2f3336;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand { font-size: 18px; font-weight: 600; color: #e7e9ea; }
.topbar-nav { display: flex; gap: 4px; }
.topbar-nav a {
  color: #8b98a5;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.15s;
}
.topbar-nav a:hover { background: #2f3336; color: #e7e9ea; }
.topbar-nav a.active { background: #1d9bf0; color: #fff; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8b98a5;
  font-size: 14px;
}
.topbar-user a { color: #1d9bf0; text-decoration: none; }

.page { padding: 24px; max-width: 1200px; margin: 0 auto; }
.page-title { font-size: 22px; margin-bottom: 20px; color: #e7e9ea; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: #1a1f26;
  border: 1px solid #2f3336;
  border-radius: 10px;
  padding: 20px;
}
.card-title {
  font-size: 13px;
  color: #8b98a5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  font-weight: 600;
}
.card-value { font-size: 22px; color: #e7e9ea; font-weight: 600; }
.card-sub { font-size: 13px; color: #8b98a5; margin-top: 4px; }

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.status-dot.on { background: #00ba7c; box-shadow: 0 0 8px rgba(0,186,124,0.5); }
.status-dot.off { background: #f4212e; }
.status-dot.warn { background: #ffd400; }

.qr-wrap {
  text-align: center;
  padding: 30px;
  background: #fff;
  border-radius: 10px;
  margin: 20px 0;
}
.qr-wrap img { max-width: 300px; height: auto; }

.btn-sm { display: inline-block; padding: 8px 16px; font-size: 13px; width: auto; }
.btn-secondary { background: #2f3336; }
.btn-secondary:hover { background: #3d4148; }
.btn-danger { background: #f4212e; }
.btn-danger:hover { background: #d11a26; }

.empty-state { text-align: center; padding: 40px; color: #8b98a5; }
