/* Prastix staff portal. No inline styles anywhere (the content security policy forbids them). */

@font-face { font-family: "Atkinson Next"; src: url("../fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/atkinson-hyperlegible-next-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/atkinson-hyperlegible-next-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Mono"; src: url("../fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ink: #18212b;
  --ink-2: #4a5563;
  --line: #d9dee5;
  --line-2: #eceff3;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --brand: #e05a12;
  --brand-ink: #a83f05;
  --brand-soft: #fdeee4;
  --ok: #17663f;
  --ok-soft: #e3f3ea;
  --warn: #7a5000;
  --warn-soft: #fff3d6;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --dev: #0b6f6b;
  --uat: #8a5a00;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(24, 33, 43, .06), 0 2px 8px rgba(24, 33, 43, .04);
  --font: "Atkinson Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf1;
    --ink-2: #a9b3bf;
    --line: #34404d;
    --line-2: #26303a;
    --bg: #11171d;
    --surface: #18212b;
    --brand: #f07a36;
    --brand-ink: #ff9a5c;
    --brand-soft: #3a2316;
    --ok: #6cd39c;
    --ok-soft: #173326;
    --warn: #f2c460;
    --warn-soft: #3a2e12;
    --bad: #ff8b80;
    --bad-soft: #3d1c1a;
    --dev: #4fd1c5;
    --uat: #f2c460;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
}
a { color: var(--brand-ink); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin-top: 2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; max-width: 68ch; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: .5rem; }

/* The environment strip: the one loud thing, so Dev or UAT is never mistaken for live. */
.env { display: flex; gap: .75rem; align-items: center; padding: .3rem 1rem; font-size: .85rem; font-weight: 600; color: #fff; }
.env-dev { background: var(--dev); }
.env-uat { background: var(--uat); }
.env-local { background: #5b4bc4; }
@media (prefers-color-scheme: dark) { .env { color: #11171d; } }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 1rem; max-width: 1200px; margin: 0 auto; padding: .7rem 1rem; }
.wordmark { font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.wordmark span { color: var(--brand); }
.top-nav { display: flex; gap: .25rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.top-nav a, .top-nav button { color: var(--ink-2); text-decoration: none; padding: .35rem .6rem; border-radius: var(--radius-sm); font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.top-nav a:hover, .top-nav button:hover { background: var(--line-2); color: var(--ink); }
.top-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Page with an optional side menu */
.shell { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 4rem; display: grid; gap: 2rem; }
.shell.with-side { grid-template-columns: 220px minmax(0, 1fr); }
@media (max-width: 800px) { .shell.with-side { grid-template-columns: 1fr; gap: 1rem; } }
.side h2 { font-size: .8rem; color: var(--ink-2); font-weight: 600; margin: 0 0 .5rem; }
.side .org-name { font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; }
.side nav { display: flex; flex-direction: column; gap: 2px; margin-top: 1rem; }
.side nav a { color: var(--ink); text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius-sm); border-left: 3px solid transparent; }
.side nav a:hover { background: var(--line-2); }
.side nav a[aria-current="page"] { background: var(--brand-soft); border-left-color: var(--brand); font-weight: 600; }
@media (max-width: 800px) { .side nav { flex-direction: row; flex-wrap: wrap; } .side nav a { border-left: 0; border-bottom: 3px solid transparent; } .side nav a[aria-current="page"] { border-bottom-color: var(--brand); } }
main { min-width: 0; }
.page-head { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: .25rem 0 0; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stat { font-size: 1.6rem; font-weight: 700; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .65rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: .85rem; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }

/* Forms */
form.stack { display: grid; gap: 1rem; max-width: 34rem; }
.field { display: grid; gap: .3rem; }
label { font-weight: 600; }
.hint { color: var(--ink-2); font-size: .875rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #9aa4b1; border-radius: var(--radius-sm); padding: .55rem .7rem; width: 100%; min-height: 2.75rem;
}
input.code { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .25em; max-width: 12rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--brand); }
.error-text { color: var(--bad); font-size: .9rem; font-weight: 600; }
[aria-invalid="true"] { border-color: var(--bad) !important; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { flex: 1 1 14rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .95rem/1 var(--font); padding: .7rem 1.1rem; min-height: 2.75rem; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #11171d; } .btn-primary:hover { background: #ff9a5c; } }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: #9aa4b1; }
.btn-secondary:hover { background: var(--line-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-small { padding: .4rem .7rem; min-height: 2.2rem; font-size: .875rem; }
.btn-link { background: none; border: 0; color: var(--brand-ink); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.btn-sso { width: 100%; background: var(--surface); color: var(--ink); border-color: #9aa4b1; }
.btn-sso:hover { background: var(--line-2); }

/* Messages */
.flash { border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1.25rem; border-left: 4px solid; }
.flash-ok { background: var(--ok-soft); border-color: var(--ok); }
.flash-warn { background: var(--warn-soft); border-color: var(--warn); }
.flash-bad { background: var(--bad-soft); border-color: var(--bad); }
.flash ul { margin: .25rem 0 0; padding-left: 1.2rem; }

/* Tags */
.tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-bad { background: var(--bad-soft); color: var(--bad); }
.tag-brand { background: var(--brand-soft); color: var(--brand-ink); }

/* Lists of organisations */
.org-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.org-list a { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.org-list a:hover { border-color: var(--brand); }
.org-list .name { font-weight: 700; }

/* Modules */
.module { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.module:last-child { border-bottom: 0; }
.module form { display: inline; }
.module .controls { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* Two-step setup */
.qr { background: #fff; padding: .75rem; border-radius: var(--radius-sm); display: inline-block; border: 1px solid var(--line); }
.qr svg { display: block; width: 200px; height: 200px; }
.codes { font-family: var(--mono); display: grid; grid-template-columns: repeat(2, max-content); gap: .4rem 1.5rem; padding: 1rem; background: var(--bg); border-radius: var(--radius-sm); margin: 0 0 1rem; list-style: none; }
.record { font-family: var(--mono); background: var(--bg); padding: .6rem .8rem; border-radius: var(--radius-sm); word-break: break-all; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 0; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; }

/* Sign-in pages */
.auth { min-height: 100vh; display: grid; place-items: start center; padding: 6vh 1rem 2rem; }
.auth-card { width: 100%; max-width: 26rem; }
.auth-card .wordmark { display: block; text-align: center; font-size: 1.9rem; margin-bottom: 1.5rem; }
.auth-card .panel { padding: 1.75rem; }
.or { display: flex; align-items: center; gap: .75rem; color: var(--ink-2); font-size: .875rem; margin: 1.25rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sso-buttons { display: grid; gap: .6rem; }

/* Pagination */
nav[role="navigation"] { margin-top: 1rem; }
.pager { display: flex; gap: .5rem; align-items: center; }

/* Organisation holding website */
.site { min-height: 100vh; display: grid; place-items: center; padding: 2rem; text-align: center; }
.site h1 { font-size: clamp(2rem, 6vw, 3.5rem); }

/* Compact forms inside table cells (e.g. changing someone's role). */
td .inline-form { flex-wrap: nowrap; align-items: center; }
td .inline-form select { width: auto; min-width: 9.5rem; min-height: 2.2rem; padding: .35rem .5rem; }
h1 + .sso-buttons, h1 + form.stack { margin-top: 1rem; }
.panel .mono, .panel code { overflow-wrap: anywhere; }
.panel .inline-form select { width: auto; }
.email-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font); margin: 0; }
