:root {
  --text: #1d2125;
  --muted: #5b6470;
  --line: #d6dbe1;
  --surface: #ffffff;
  --page: #f4f6f8;
  --accent: #1f5fbf;
  --error: #b3261e;
  --notice: #8a5a00;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--page);
}

body { margin: 0; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 600; }

main {
  max-width: 560px;
  margin: 32px auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.stack { display: grid; gap: 16px; }

label { display: grid; gap: 6px; font-weight: 500; }

.hint { font-weight: 400; color: var(--muted); font-size: 0.9rem; }

input, select {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 18px; height: 18px; margin: 0; padding: 0; }

button {
  font: inherit;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  justify-self: start;
}

button.link { background: none; color: var(--accent); padding: 0; }

.bar form { margin: 0; }

.error, .field-error { color: var(--error); }

.field-error { font-weight: 400; font-size: 0.9rem; }

.notice { color: var(--notice); font-weight: 500; }

.key code {
  display: block;
  padding: 16px;
  font-size: 1.3rem;
  letter-spacing: 0.05em;
  background: var(--page);
  border: 1px dashed var(--line);
  border-radius: 6px;
  user-select: all;
}

dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }

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

dd { margin: 0; }

a { color: var(--accent); }

/* M7 admin pages */
.menu { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.menu a { text-decoration: none; font-weight: 500; }

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

h2 { font-size: 1.1rem; margin-top: 28px; }

.search { display: flex; gap: 8px; margin-bottom: 8px; }
.search input { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr.faded td { color: var(--muted); }
td form { margin: 0; }

.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.85rem; background: var(--page); }
.status-active, .status-processed { background: #e3f4e8; color: #17672e; }
.status-revoked, .status-failed { background: #fbe4e2; color: var(--error); }
.status-received { background: #fff2d6; color: var(--notice); }

.actions { display: grid; gap: 12px; }
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline input[type="text"] { min-width: 280px; }
button.danger { background: var(--error); }

code.details { font-size: 0.8rem; word-break: break-word; white-space: pre-wrap; }

.nowrap { white-space: nowrap; }
