/* Shepherd Suggestion Box — the only stylesheet. Nothing inline anywhere: the CSP
   blocks inline <style> and style=, and a blocked print rule only shows up in the
   print dialog, long after the page looked fine on screen. */

:root {
  --navy: #1b2a4a;
  --ink: #17202e;
  --muted: #5b6675;
  --line: #d8dde5;
  --bg: #f4f6f9;
  --card: #ffffff;
  --accent: #1f6feb;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --danger: #b02a2a;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
a { color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.muted { color: var(--muted); font-size: .875rem; }
.nowrap { white-space: nowrap; }

/* ---------- the employee form: one screen, no scrolling on an iPhone SE ---------- */

.public .form-wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.branch-line { margin: 0 0 .75rem; font-weight: 600; color: var(--navy); }

.prompts {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: .9rem;
}
.prompts li { margin-bottom: .15rem; }

.suggest { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }

.field { display: block; margin-bottom: 1rem; }
.label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: .6rem .65rem;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
textarea { min-height: 8rem; resize: vertical; }

fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
legend { padding: 0; }

.radio {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .1rem 0;
  font-size: .95rem;
}
.radio input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; }

.named summary { cursor: pointer; font-weight: 600; min-height: 44px; padding: .6rem 0; }
.named[open] { margin-bottom: .5rem; }

.btn-primary, .btn-secondary {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: .6rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { width: 100%; background: var(--navy); color: #fff; }
.btn-primary[disabled] { background: var(--muted); cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-link { font: inherit; background: none; border: 0; padding: .35rem 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

.privacy { margin: .5rem 0 0; font-size: .8rem; color: var(--muted); text-align: center; }

.error {
  background: #fdecec;
  border: 1px solid #f0b6b6;
  color: #8a1f1f;
  border-radius: 8px;
  padding: .6rem .75rem;
  margin: 0 0 1rem;
  font-size: .9rem;
}

.site-foot { margin-top: 1.25rem; text-align: center; font-size: .8rem; }
.site-foot a { color: var(--muted); }

/* Honeypot: present in the DOM, off-screen for people, no display:none so naive
   bots that skip hidden fields still fill it. */
.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

.thanks .ref { font-size: 1.05rem; }
.thanks .btn-secondary { width: 100%; text-align: center; }

/* ---------- admin ---------- */

.admin { background: var(--bg); }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  background: var(--navy);
  color: #fff;
  padding: .6rem 1rem;
}
.topbar .brand { font-weight: 700; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.topbar nav a { color: #cfd8e6; text-decoration: none; padding: .25rem 0; }
.topbar nav a.on, .topbar nav a:hover { color: #fff; text-decoration: underline; }
.topbar .logout { margin-left: auto; }
.topbar .btn-link { color: #cfd8e6; }

.badge {
  display: inline-block;
  min-width: 1.3em;
  padding: 0 .35em;
  border-radius: 999px;
  background: #e8b23a;
  color: #2c2000;
  font-size: .75rem;
  font-weight: 700;
  text-align: center;
}

.warn {
  margin: 0;
  padding: .6rem 1rem;
  background: var(--warn-bg);
  color: var(--warn);
  border-bottom: 1px solid #ecd9a8;
  font-size: .875rem;
}

.admin main { padding: 1rem; max-width: 76rem; margin: 0 auto; }

.stats { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; margin: 0 0 1rem; padding: 0; color: var(--muted); font-size: .85rem; }
.stats .n { display: block; font-size: 1.35rem; font-weight: 700; color: var(--navy); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters select, .filters input { width: auto; min-width: 9rem; }
.filters label { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }

.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); font-size: .9rem; display: block; overflow-x: auto; }
.grid thead th { text-align: left; background: #eef1f6; border-bottom: 1px solid var(--line); padding: .5rem .6rem; white-space: nowrap; }
.grid td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; vertical-align: top; }
.grid .msg { min-width: 18rem; }
.grid .empty { color: var(--muted); text-align: center; padding: 1.5rem; }

.pill { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: #eef1f6; font-size: .8rem; }
.pill.new { background: #e4efff; color: #14417a; }
.pill.reviewing { background: var(--warn-bg); color: var(--warn); }
.pill.actioned { background: #e3f4e5; color: #1d6b2a; }
.pill.closed { background: #ecedef; color: var(--muted); }

.message { margin: 0 0 1rem; padding: .85rem 1rem; background: var(--card); border-left: 4px solid var(--navy); white-space: pre-wrap; }

.facts { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: .2rem .9rem; margin: 0 0 1.5rem; font-size: .875rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }

.status-form { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; max-width: 34rem; }
.status-form .btn-primary { width: auto; }

.inline { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0; }
.inline input, .inline select { width: auto; min-width: 6rem; }
.inline.add { margin-top: 1rem; }
.inline.request { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; margin-bottom: .5rem; }
.check { display: flex; align-items: center; gap: .3rem; font-size: .85rem; }
.check input { width: auto; min-height: 0; }

.qr-preview { display: block; width: 100%; max-width: 18rem; height: auto; background: #fff; border: 1px solid var(--line); padding: .5rem; }
.qr-links { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }

/* ---------- the printed poster ----------

   Two hard rules, both learned the hard way:

   1. No text on a colour fill. Browsers skip background graphics unless the person ticks
      "background graphics" in the print dialog, and white text on a dropped-out navy band is an
      unreadable poster. Everything here is dark ink on white; borders and type carry the design,
      because those always print. print-color-adjust asks for the fills, it does not depend on them.
   2. Nothing touches the QR. Framing marks sit outside the 4-module quiet zone. Decoration on a
      code is how a poster ends up looking sharp and scanning from nowhere.                     */

.poster-page {
  background: #fff;
  margin: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.poster {
  --ink: #1b2a4a;
  --mark: #b25a00; /* survives greyscale as a mid tone, so a B&W laser print still reads */
  width: 8.5in;
  height: 11in;
  padding: 0.5in 0.65in 0.45in;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--ink);
  background: #fff;
  border-top: 14pt solid var(--ink);
  border-bottom: 14pt solid var(--ink);
  page-break-after: always;
  break-after: page;
  overflow: hidden;
}
.poster:last-child { page-break-after: auto; break-after: auto; }

.poster-top { margin-bottom: .16in; }

.poster-eyebrow {
  margin: 0 0 .06in;
  font-size: 11pt;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--mark);
}

.poster-head {
  font-size: 58pt;
  line-height: .95;
  margin: 0;
  font-weight: 800;
  letter-spacing: -2px;
  text-transform: uppercase;
}

/* Numerals give the four prompts a rhythm and stop them reading as a wall of text. */
.poster-prompts {
  list-style: none;
  counter-reset: prompt;
  margin: 0 0 .2in;
  padding: .16in 0 0;
  border-top: 2.5pt solid var(--mark);
  width: 100%;
  max-width: 7.2in;
  font-size: 13pt;
  line-height: 1.32;
  text-align: left;
}
.poster-prompts li {
  counter-increment: prompt;
  position: relative;
  padding-left: .44in;
  margin-bottom: .085in;
}
.poster-prompts li::before {
  content: counter(prompt);
  position: absolute;
  left: 0;
  top: -.02in;
  font-size: 21pt;
  font-weight: 800;
  line-height: 1;
  color: var(--mark);
}

/* flex-shrink:0 is a guard, not a fix: nothing may ever squeeze the code below the 3in
   minimum that makes it readable from four feet, however much copy grows above it. */
.poster-scan { margin-top: auto; flex-shrink: 0; }
.qr-frame, .poster-qr { flex-shrink: 0; }

/* Viewfinder brackets — the "scan me" cue, drawn clear of the code. */
.qr-frame {
  position: relative;
  display: inline-block;
  padding: .12in;
  margin: 0 auto;
}
.poster-qr { width: 3.7in; height: 3.7in; display: block; }

.qr-bracket {
  position: absolute;
  width: .34in;
  height: .34in;
  border: 5pt solid var(--ink);
}
.qr-bracket.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.qr-bracket.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.qr-bracket.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.qr-bracket.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.poster-scan-label {
  margin: .09in 0 .1in;
  font-size: 12.5pt;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mark);
}

.poster-url {
  display: inline-block;
  margin: 0;
  padding: .07in .28in;
  border: 3pt solid var(--ink);
  border-radius: 999px;
  font-size: 19pt;
  font-weight: 800;
  letter-spacing: .01em;
}

.poster-anon {
  margin: .16in 0 0;
  padding: .09in 0 0;
  border-top: 2.5pt solid var(--mark);
  width: 100%;
  max-width: 7.2in;
  font-size: 15pt;
  font-weight: 700;
}

.poster-foot {
  margin: .12in 0 0;
  font-size: 10.5pt;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mark);
}

@page { size: letter portrait; margin: 0; }

@media print {
  body.poster-page { background: #fff; }
  .poster {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0.4in 0.6in 0.35in;
  }
  .poster-qr { width: 3.5in; height: 3.5in; }
  .topbar, .filters, .site-foot, .warn { display: none; }
}

.thanks .ack {
  margin: .75rem 0 0;
  padding: .6rem .75rem;
  background: #e9f3ea;
  border: 1px solid #b9d8bd;
  border-radius: 8px;
  font-size: .9rem;
  color: #1d5b28;
}
