:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --border: #dde1e6;
  --text: #1c2128;
  --muted: #5b6472;
  --accent: #2f5fd8;
  --accent-hover: #24469f;
  --danger: #c92a2a;
  --danger-bg: #fdecec;
  --success: #1f7a3f;
  --success-bg: #eaf7ee;
}

* {
  box-sizing: border-box;
}

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

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

header.topbar nav a {
  margin-right: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

header.topbar nav a:hover {
  color: var(--accent);
}

main {
  max-width: 720px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

main.wide {
  max-width: 960px;
}

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

h1 {
  font-size: 1.3rem;
  margin-top: 0;
}

h2 {
  font-size: 1.05rem;
  margin-top: 0;
}

label {
  display: block;
  font-weight: 600;
  margin: 0.85rem 0 0.3rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

button, input[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
}

button:hover, input[type="submit"]:hover {
  background: var(--accent-hover);
}

button.small {
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  margin-top: 0;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #a01f1f;
}

.alert {
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.tag {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.78rem;
  margin: 0.1rem 0.2rem 0.1rem 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.token-reveal {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  word-break: break-all;
  font-size: 0.85rem;
}

form.inline {
  display: inline;
}
