/* Colours are variables so that a distributor's branding can replace them (docs/07, section 4). */
:root {
  --color-background: #f4f5f7;
  --color-surface: #ffffff;
  --color-text: #1c2330;
  --color-muted: #5b6577;
  --color-border: #d5d9e0;
  --color-primary: #1d4ed8;
  --color-primary-text: #ffffff;
  --color-danger: #b42318;
  --color-danger-surface: #fef3f2;
  --color-success: #067647;
  --color-success-surface: #ecfdf3;
  --radius: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--color-text); background: var(--color-background); line-height: 1.5; }
main { max-width: 26rem; margin: 10vh auto 2rem; padding: 0 1rem; }
.brand { font-size: 1.125rem; font-weight: 600; text-align: center; margin-bottom: 1.5rem; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.5rem; }
h1 { font-size: 1.25rem; margin: 0 0 1rem; }
p { margin: 0 0 1rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
input[type="email"], input[type="password"], input[type="text"] { width: 100%; padding: 0.625rem 0.75rem; font: inherit; color: inherit; border: 1px solid var(--color-border); border-radius: var(--radius); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.field { margin-bottom: 1rem; }
.help, .help ul { color: var(--color-muted); font-size: 0.875rem; margin: 0.375rem 0 0; }
.help ul { padding-left: 1.125rem; }
.errorlist { list-style: none; margin: 0.375rem 0 0; padding: 0; color: var(--color-danger); font-size: 0.875rem; }
.notice { border-radius: var(--radius); padding: 0.75rem; margin-bottom: 1rem; }
.notice.error { color: var(--color-danger); background: var(--color-danger-surface); }
.notice.error .errorlist { margin: 0; font-size: inherit; }
.notice.success { color: var(--color-success); background: var(--color-success-surface); }
button { width: 100%; padding: 0.625rem 0.75rem; font: inherit; font-weight: 600; color: var(--color-primary-text); background: var(--color-primary); border: 0; border-radius: var(--radius); cursor: pointer; }
button.secondary { color: var(--color-text); background: transparent; border: 1px solid var(--color-border); }
a { color: var(--color-primary); }
.links { margin: 1rem 0 0; text-align: center; font-size: 0.875rem; }
.muted { color: var(--color-muted); }
a.button { display: block; padding: 0.625rem 0.75rem; font-weight: 600; text-align: center; text-decoration: none; border-radius: var(--radius); }
a.button.secondary { color: var(--color-text); border: 1px solid var(--color-border); }
button.small { width: auto; padding: 0.375rem 0.75rem; font-size: 0.875rem; }
form.spaced { margin-top: 1rem; }
.rows { list-style: none; margin: 0 0 1rem; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius); }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem; }
.rows li + li { border-top: 1px solid var(--color-border); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.05em; overflow-wrap: anywhere; }
.codes { list-style: none; margin: 0 0 1rem; padding: 0.75rem; display: grid; grid-template-columns: 1fr; gap: 0.375rem; border: 1px solid var(--color-border); border-radius: var(--radius); }
.qr { text-align: center; margin-bottom: 1rem; }

/* Management pages: a wide layout with a navigation bar. */
body.wide main { max-width: 64rem; margin-top: 1.5rem; }
body.wide .brand { text-align: left; margin-bottom: 0.75rem; }
nav.console { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; margin-bottom: 1rem; font-size: 0.9375rem; }
nav.console a { text-decoration: none; padding: 0.25rem 0; }
nav.console a.current { font-weight: 600; color: var(--color-text); border-bottom: 2px solid var(--color-primary); }
nav.console .spacer { flex: 1; }
nav.console form { margin: 0; }
.context { color: var(--color-muted); font-size: 0.875rem; margin-bottom: 0.75rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.toolbar input[type="search"] { flex: 1; min-width: 12rem; padding: 0.5rem 0.75rem; font: inherit; border: 1px solid var(--color-border); border-radius: var(--radius); }
.toolbar a.button, .actions a.button { display: inline-block; }
a.button.primary { color: var(--color-primary-text); background: var(--color-primary); }
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
th { font-size: 0.8125rem; color: var(--color-muted); font-weight: 600; }
td.empty { text-align: center; color: var(--color-muted); }
.badge { display: inline-block; padding: 0.0625rem 0.5rem; border-radius: 999px; font-size: 0.8125rem; border: 1px solid var(--color-border); }
.badge.off { color: var(--color-danger); background: var(--color-danger-surface); border-color: transparent; }
.badge.on { color: var(--color-success); background: var(--color-success-surface); border-color: transparent; }
select { width: 100%; padding: 0.625rem 0.75rem; font: inherit; color: inherit; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.actions form { margin: 0; }
.actions button, .narrow button { width: auto; }
button.danger { color: var(--color-danger); background: transparent; border: 1px solid var(--color-danger); }
.narrow { max-width: 28rem; }
section + section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
h2 { font-size: 1.0625rem; margin: 0 0 0.75rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0 0 1rem; }
dl.facts dt { color: var(--color-muted); }
dl.facts dd { margin: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
td.params { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8125rem; overflow-wrap: anywhere; }
