/* GateProof app: matches the gateproof.co.za website (forest green, brass, Archivo + IBM Plex Sans) */
:root {
  --green: #1f5b45;
  --green-deep: #174536;
  --brass: #a87b2a;
  --brass-dark: #8d6620;
  --bg: #f3f5f2;
  --surface: #ffffff;
  --ink: #18231e;
  --ink-soft: #2a3a33;
  --muted: #5d6b64;
  --line: #dde3de;
  --ok: #1f7a4a; --ok-bg: #e3f3ea;
  --warn: #9a6400; --warn-bg: #fbf0d9;
  --bad: #b3261e; --bad-bg: #fbe5e3;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 4px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.015em; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.08; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header (white, like the website) */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 72px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.logo b { font-family: var(--display); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav button { background: none; border: 0; padding: 8px 12px; color: var(--muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; }
.nav button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brass); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.who select { width: auto; padding: 6px 8px; }

main { flex: 1; padding: 36px 0 64px; }
.view { display: none; gap: 24px; }
.view.on { display: grid; }

.eyebrow { font-family: var(--display); font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 62ch; margin: 10px 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px; }
.card.tight { padding: 16px; }
.card.dark { background: var(--ink); color: #e9eee9; border-color: var(--ink); }
.card.dark h3 { color: #fff; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.list { display: grid; gap: 12px; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: .88rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; border-top: 3px solid var(--line); }
.tile b { display: block; font-family: var(--display); font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .86rem; }
.tile.ok { border-top-color: var(--green); } .tile.warn { border-top-color: var(--brass); } .tile.bad { border-top-color: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--radius); padding: 11px 18px; font-weight: 600; cursor: pointer; background: var(--brass); color: #fff; text-decoration: none; }
.btn:hover { background: var(--brass-dark); }
.btn.green { background: var(--green); } .btn.green:hover { background: var(--green-deep); }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn.ghost:hover { background: #e8efe9; }
.btn.danger { background: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: .86rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.n { background: var(--line); color: var(--muted); }

label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: #fbfcfb; border-radius: var(--radius); padding: 11px 12px; font-weight: 400; }
input[type="checkbox"] { width: auto; accent-color: var(--green); }
input[type="file"] { padding: 8px; background: var(--surface); }
form.stack, .stack { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: grid; gap: 8px; margin: 12px 0; }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: .9rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.workers { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.worker { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .94rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.off td { opacity: .5; }
.scroll { overflow-x: auto; }

.code { font-family: var(--mono); font-size: 1.9rem; letter-spacing: .16em; font-weight: 600; }
.pass { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.qr { width: 118px; height: 118px; background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: 4px; }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; }

.gatebox { display: grid; gap: 14px; }
.pinin { font-family: var(--mono); font-size: 2.2rem; letter-spacing: .3em; text-align: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { padding: 16px; font-size: 1.4rem; font-family: var(--mono); border-radius: 6px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.verdict { border-radius: 8px; padding: 20px; display: grid; gap: 8px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); border: 2px solid var(--ok); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); border: 2px solid var(--bad); }
.verdict.out { background: var(--warn-bg); color: var(--warn); border: 2px solid var(--warn); }
.verdict h3 { font-size: 1.7rem; color: inherit; }
.verdict .who-line { color: var(--ink); }
.face { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; border: 2px solid currentColor; background: #fff; }

fieldset.wblock { border: 1px solid var(--line); border-radius: 6px; padding: 16px; display: grid; gap: 12px; margin: 0; }
fieldset.wblock legend { font-family: var(--display); font-weight: 700; padding: 0 6px; }

dialog { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 22px; width: min(440px, 92vw); }
dialog::backdrop { background: rgba(10, 20, 15, .5); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 6px; font-weight: 500; max-width: 92vw; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.on { opacity: 1; } .toast.bad { background: var(--bad); }
.empty { color: var(--muted); font-style: italic; }
.narrow { max-width: 440px; }
.big { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; letter-spacing: .06em; }

footer.foot { background: var(--ink); color: #b9c4bd; font-size: .86rem; padding: 22px 0; }
footer.foot a { color: #e2c48a; }
footer.foot .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 560px) {
  .two { grid-template-columns: 1fr; }
  .top .wrap { gap: 10px; }
  .nav { order: 3; width: 100%; }
  .who { width: 100%; justify-content: space-between; }
  .who .btn { padding: 4px 10px; font-size: .8rem; }
  .pass { grid-template-columns: 1fr; }
  main { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
