:root { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #060a06;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  padding: 24px;
}
main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(480px, 100%);
  padding: 28px 22px;
  border-radius: 16px;
  background: rgba(6, 10, 6, 0.72);
  border: 1px solid rgba(74, 222, 128, 0.15);
  backdrop-filter: blur(6px);
}
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
h1.wordmark {
  font-family: "Russo One", sans-serif;
  font-size: 28px;
  text-align: center;
  margin: 0 0 8px;
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.45);
}
h2.subtitle {
  font-size: 14px;
  font-weight: 500;
  color: #7a7a7a;
  text-align: center;
  margin: 0 0 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
input[type="text"], input[type="password"] {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #141414;
  color: #fff;
  font-size: 15px;
}
button, a.btn {
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  background: #14251a;
  color: #4ade80;
  border: 1px solid #1f3d29;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
}
button:hover, a.btn:hover {
  background: #1a3322;
  border-color: #2c5b3c;
}
.error {
  color: #f87171;
  font-size: 14px;
  text-align: center;
  min-height: 18px;
}
#device-list, #users-list, #user-devices-list, #inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#device-list:not(:empty), #users-list:not(:empty),
#user-devices-list:not(:empty), #inbox-list:not(:empty) {
  margin-bottom: 4px;
}
.device-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #141414;
  border: 1px solid #2a2a2a;
}
.device-row .label {
  font-weight: 600;
  word-break: break-word;
}
.device-row .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.device-row button.danger {
  background: #251414;
  color: #f87171;
  border: 1px solid #3d1f1f;
  padding: 8px 12px;
  font-size: 13px;
  width: auto;
}
.device-row button {
  padding: 8px 12px;
  font-size: 13px;
  width: auto;
}
.add-device-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.add-device-form input {
  flex: 1;
  min-width: 0;
}
.add-device-form button {
  width: 48px;
  flex-shrink: 0;
  padding: 0;
  font-size: 18px;
}
.add-device-form button.confirm {
  color: #4ade80;
}
.add-device-form button.cancel {
  background: #251414;
  color: #f87171;
  border: 1px solid #3d1f1f;
}
#rain {
  position: fixed;
  inset: 0;
  display: block;
  z-index: -1;
}
nav.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
nav.admin-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #7a7a7a;
  border: 1px solid #2a2a2a;
  background: transparent;
}
nav.admin-nav a.active {
  color: #4ade80;
  border-color: #1f3d29;
  background: #14251a;
}
.device-row form {
  display: inline;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}
.modal {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 20px;
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.modal svg {
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  max-width: 100%;
  height: auto;
}
#qr-canvas-wrap {
  align-self: center;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #14251a;
  color: #4ade80;
  border: 1px solid #1f3d29;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
