:root {
  --bg: #0f1115;
  --card: #171a21;
  --text: #e8e8e8;
  --muted: #9aa0a6;
  --accent: #4f8cff;
  --warn: #d98c2b;
  --error: #e05555;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

#login-screen:not([hidden]), #no-access-screen:not([hidden]) {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#login-form, #no-access-screen div {
  background: var(--card);
  padding: 2rem;
  border-radius: 12px;
  width: min(90vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#login-form input, #change-password-form input {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #0d0f13;
  color: var(--text);
}

#login-form button, #change-password-form button, header button {
  padding: 0.6rem;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.error-msg { color: var(--error); font-size: 0.85rem; min-height: 1em; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--card);
}

.header-actions { display: flex; gap: 0.5rem; }

#readonly-banner {
  background: var(--warn);
  color: #1a1a1a;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

#app-content { padding: 1.5rem; }

#version-badge {
  position: fixed;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
}

#toast-container {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--error);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

body.readonly button[data-write="true"] {
  opacity: 0.5;
  pointer-events: none;
}
