:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #d9dce1;
  --text: #1f2328;
  --muted: #57606a;
  --primary: #2563eb;
  --primary-text: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok-bg: #ecfdf3;
  --ok-text: #027a48;
  --warn-bg: #fffaeb;
  --warn-text: #b54708;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.topbar .who { color: var(--muted); font-size: 0.9rem; }

.container {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 { margin: 0 0 1.5rem; font-size: 1.5rem; }
h2 { margin: 0 0 1rem; font-size: 1.15rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.page-login .card {
  width: 100%;
  max-width: 360px;
  margin: 0;
}

.page-login label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.page-login input[type="text"],
.page-login input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { background: #94a3b8; border-color: #94a3b8; cursor: not-allowed; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:disabled { background: #c2c5cb; border-color: #c2c5cb; cursor: not-allowed; }

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.btn-link:hover { text-decoration: underline; }

.inline { display: inline; }

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.flash-error   { background: var(--danger-bg); color: var(--danger); }
.flash-success { background: var(--ok-bg); color: var(--ok-text); }
.flash-info    { background: #eef4ff; color: #1d4ed8; }

.status {
  padding: 0.8rem 1rem;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.status-ok    { background: var(--ok-bg); color: var(--ok-text); }
.status-warn  { background: var(--warn-bg); color: var(--warn-text); }
.status-error { background: var(--danger-bg); color: var(--danger); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.actions form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.actions small { color: var(--muted); }

.muted { color: var(--muted); }

code {
  background: #eef0f3;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}

.kv {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kv li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding: 0.4rem 0;
}
.kv li:last-child { border-bottom: none; }
.kv span { color: var(--muted); }

.errors {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}
.errors li { margin-bottom: 0.4rem; }
.errors code { margin-right: 0.4rem; }

details summary {
  cursor: pointer;
  margin-top: 0.5rem;
  color: var(--muted);
}
