/* Kitroom look and feel: Sheq Safety branding (black, white, greys, brushed gold).
   Archivo Black stands in for Swis721 Black for headings, Inter for body text. */
:root {
  --black: #0E0507;
  --white: #FFFFFF;
  --grey-1: #ECECED;
  --grey-2: #d9d9db;
  --grey-3: #b9b9bc;
  --grey-4: #737476;
  --muted: #4f5053;
  --ink-soft: #2b2c2e;
  --gold-solid: #b8862b;
  --gold-light: #f0d084;
  --drawer-open: #e9c977;
  --ok: #1d6b3a;
  --ok-bg: #e7f2ea;
  --bad: #a3271b;
  --bad-bg: #fbeae7;
  --gold: linear-gradient(115deg, #7d5a1c 0%, #c99a3e 22%, #f2d58c 38%, #b8862b 55%, #e9c977 72%, #8f6a24 100%);
  --gold-text: linear-gradient(115deg, #9a7022 0%, #d8ad52 35%, #f0d084 50%, #b8862b 70%);
  --head: "Archivo Black", "Arial Black", Arial, sans-serif;
  --body: Inter, Arial, Helvetica, sans-serif;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(14, 5, 7, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.5 var(--body); color: var(--black); background: var(--grey-1); min-height: 100vh; }
a { color: var(--black); }
a:hover { color: var(--grey-4); }
img { max-width: 100%; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gold { background: var(--gold); }
.goldtext { background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: 3px solid var(--gold-solid); outline-offset: 2px; }
h1[tabindex="-1"]:focus { outline: none; }

/* ---- Header ---------------------------------------------------------------------------- */
.topbar { background: var(--white); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 32px; border-bottom: 1px solid var(--grey-2); position: relative; }
.topbar.nouser { grid-template-columns: auto; }
.topbar > .brand { justify-self: start; }
.topuser { justify-self: end; display: flex; align-items: center; gap: 8px; }
.topuser .signout { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 14px; min-height: 44px; border-radius: 10px; border: 0; background: transparent; color: var(--black); cursor: pointer; }
.topuser .signout:hover, .topnav a:hover, .topnav button:hover { background: var(--grey-1); }
.topnav .navsignout { display: none; }
.burger { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--grey-2); background: var(--white); cursor: pointer; align-items: center; justify-content: center; padding: 0; }
.burgerlines { display: flex; flex-direction: column; gap: 4px; width: 20px; }
.burgerlines span { display: block; height: 2px; background: var(--black); border-radius: 1px; transition: transform .2s, opacity .2s; }
.topbar.open .burgerlines span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.topbar.open .burgerlines span:nth-child(2) { opacity: 0; }
.topbar.open .burgerlines span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--black); }
.brand img { width: 52px; height: 52px; display: block; }
.wordmark { font-family: var(--head); font-size: 24px; letter-spacing: 0.5px; }
.topnav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; justify-content: center; }
.topnav a, .topnav button { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 14px; min-height: 44px; border-radius: 10px; border: 0; background: transparent; color: var(--black); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; }
.topnav a.on, .topnav a.on:hover { background: var(--black); color: var(--white); }
@media (min-width: 1360px) { .topnav a, .topnav button { padding: 10px 10px; } }
@media (max-width: 1359px) {
  .topbar { grid-template-columns: auto 1fr; }
  .burger { display: inline-flex; }
  .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 16px 16px; background: var(--white); border-bottom: 6px solid var(--gold-solid); box-shadow: 0 12px 24px rgba(0,0,0,.12); }
  .topbar.open .topnav { display: flex; }
  .topnav a, .topnav button { width: 100%; justify-content: flex-start; font-size: 16px; }
}
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--black); color: var(--gold-light); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.goldbar { height: 6px; background: var(--gold); }

/* ---- Layout ---------------------------------------------------------------------------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > main { flex: 1 0 auto; }
main { padding: 32px 16px 56px; display: flex; justify-content: center; }
.sitefoot { flex-shrink: 0; background: var(--black); color: var(--grey-2); border-top: 4px solid var(--gold); padding: 18px 32px 22px; text-align: center; font-size: 13px; line-height: 1.6; }
.sitefoot p { margin: 0; max-width: 1100px; margin-inline: auto; }
.sitefoot p:first-child { color: var(--white); font-weight: 600; }
.sitefoot-details { opacity: .85; overflow-wrap: anywhere; }
.wrap { width: 100%; max-width: 1160px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.wrap.narrow { max-width: 980px; }
.col-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-side { flex: 1 1 290px; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spread { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

h1, .h1 { font-family: var(--head); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0; }
h2, .h2 { font-family: var(--head); font-weight: 400; font-size: 24px; line-height: 1.15; margin: 0; }
h3, .h3 { font-weight: 700; font-size: 17px; margin: 0; }
.lead { margin: 0; font-size: 16px; color: var(--muted); }
.small { font-size: 13px; color: var(--muted); }
p { margin: 0; }

.card { background: var(--white); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card.tight { padding: 16px 20px; gap: 10px; }
.card.dark { background: var(--black); color: var(--white); }
.card.dark p { color: #d8d8da; }
.card.tip { border-top: 6px solid var(--gold-solid); }
.tip-title { font-family: var(--head); font-size: 16px; }

/* ---- Buttons --------------------------------------------------------------------------- */
.btn { font: inherit; font-weight: 700; font-size: 15px; padding: 11px 18px; min-height: 48px; border-radius: 12px; border: 2px solid var(--black); background: var(--white); color: var(--black); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--grey-1); color: var(--black); }
.btn.primary { font-family: var(--head); font-weight: 400; letter-spacing: 0.5px; text-transform: uppercase; background: var(--black); color: var(--white); border-color: var(--black); box-shadow: 0 3px 0 var(--gold-solid); }
.btn.primary:hover { background: #2a1d20; color: var(--white); }
.btn.goldbtn { font-family: var(--head); font-weight: 400; letter-spacing: 0.5px; text-transform: uppercase; background: var(--gold); border: 0; color: var(--black); }
.btn.link { border: 0; background: transparent; text-decoration: underline; padding: 10px 4px; font-weight: 600; }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: var(--bad); color: var(--white); border-color: var(--bad); }
.btn.danger:hover { background: #7f1d14; color: var(--white); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.wrap > .back, .wrap > .steps { flex-basis: 100%; }
.back { align-self: flex-start; font: inherit; font-size: 15px; font-weight: 600; padding: 10px 0; min-height: 44px; background: transparent; border: 0; color: var(--black); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }

/* ---- Forms ----------------------------------------------------------------------------- */
form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 12px 14px; border: 1px solid var(--grey-3); border-radius: 10px; background: var(--white); color: var(--black); width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-weight: 400; color: #5e5f62; font-size: 13px; }
.field.short input { max-width: 220px; text-transform: uppercase; }
.field.short input::placeholder { text-transform: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--grey-3); border-radius: 12px; cursor: pointer; font-weight: 400; }
.choice:has(input:checked) { border-color: var(--black); background: #fbf8f1; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--black); flex: 0 0 auto; }
.choice strong { display: block; font-size: 15px; }
.choice span.hint { display: block; font-size: 13px; color: #5e5f62; line-height: 1.45; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.checks label { display: flex; gap: 10px; align-items: center; font-weight: 400; font-size: 15px; padding: 10px 12px; border: 1px solid var(--grey-2); border-radius: 10px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--black); }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.steps span { padding: 8px 14px; border-radius: 20px; background: var(--white); color: var(--muted); font-size: 14px; font-weight: 600; }
.steps span.on { background: var(--black); color: var(--white); }
.steps span.done { background: var(--ok-bg); color: var(--ok); }

/* ---- Messages -------------------------------------------------------------------------- */
.msg { padding: 12px 16px; border-radius: 12px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: var(--white); color: var(--ink-soft); border-left: 6px solid var(--gold-solid); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--black); color: var(--white); padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; z-index: 50; max-width: calc(100% - 32px); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px; background: var(--grey-1); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.gold { background: var(--gold); color: var(--black); }
.pill.off { background: var(--bad-bg); color: var(--bad); }

/* ---- The cabinet (setup drawers) ------------------------------------------------------- */
.progress { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.progress strong { font-size: 15px; }
.meter { flex: 1 1 240px; height: 14px; background: var(--grey-1); border-radius: 7px; overflow: hidden; }
.meter div { height: 14px; border-radius: 7px; background: var(--gold); transition: width 0.6s ease; }
.cabinet { background: var(--black); border-radius: 18px; padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.drawer { text-align: left; font: inherit; color: var(--black); background: var(--white); border: 0; border-radius: 12px; padding: 0; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; min-height: 172px; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.drawer:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--gold-solid); color: var(--black); }
.drawer .front { background: var(--drawer-open); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.drawer .front span:first-child { font-family: var(--head); font-size: 13px; letter-spacing: 1px; }
.drawer .handle { width: 44px; height: 8px; border-radius: 4px; background: var(--black); opacity: 0.85; }
.drawer.done .front { background: var(--black); color: var(--gold-light); }
.drawer.done .handle { background: var(--gold); opacity: 1; }
.drawer .inside { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.drawer .inside strong { font-size: 17px; }
.drawer .inside .hint { font-size: 14px; color: var(--muted); line-height: 1.45; }
.drawer .status { margin-top: auto; font-size: 13px; font-weight: 700; }
.drawer.done .status { color: var(--ok); }

/* ---- Lists ----------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--white); border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--grey-2); }
.item .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item .who strong { font-size: 16px; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--grey-1); padding: 2px 8px; border-radius: 6px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group-title { font-size: 13px; font-weight: 700; letter-spacing: 0.6px; color: var(--muted); text-transform: uppercase; }
.stores { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 2px dashed var(--grey-3); border-radius: 12px; background: var(--white); }

/* ---- Welcome / sign in ----------------------------------------------------------------- */
.welcome { width: 100%; max-width: 980px; display: flex; flex-wrap: wrap; background: var(--white); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.welcome .pitch { flex: 1 1 360px; background: var(--black); color: var(--white); padding: 44px 36px; display: flex; flex-direction: column; gap: 20px; justify-content: center; }
.welcome .pitch .big { font-family: var(--head); font-size: 40px; line-height: 1.05; }
.welcome .pitch p { font-size: 17px; line-height: 1.55; color: #d8d8da; }
.bullets { display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: #d8d8da; }
.bullets div { display: flex; gap: 10px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; background: var(--gold); flex: 0 0 auto; }
.welcome .door { flex: 1 1 360px; padding: 36px 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.welcome .door > img { width: 190px; height: auto; display: block; align-self: center; mix-blend-mode: multiply; }
#login { min-height: 460px; }
#login iframe { width: 100% !important; height: 460px !important; min-height: 460px; border: 0; }

/* ---- Slip preview ---------------------------------------------------------------------- */
.slip { background: var(--white); border: 1px solid var(--grey-2); border-radius: 8px; padding: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 3px solid var(--black); }
.slip .from { display: flex; gap: 14px; align-items: flex-start; }
.slip .from img { width: 110px; height: auto; display: block; mix-blend-mode: multiply; }
.slip .from div { display: flex; flex-direction: column; font-size: 13px; color: var(--ink-soft); line-height: 1.45; white-space: pre-line; }
.slip .from strong { font-size: 17px; color: var(--black); white-space: normal; }
.slip .what { text-align: right; font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 4px; }
.slip .what strong { font-family: var(--head); font-weight: 400; font-size: 18px; color: var(--black); }

/* ---- Celebration ----------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(14, 5, 7, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.cheer { width: 100%; max-width: 600px; background: var(--white); border-radius: 18px; padding: 44px 32px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; box-shadow: var(--shadow); animation: pop 0.35s ease-out; }
.medal { width: 120px; height: 120px; border-radius: 60px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 8px var(--black); background: var(--gold); }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confetti { position: fixed; top: -12px; width: 10px; height: 16px; z-index: 45; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { 85% { opacity: 1; } to { transform: translateY(100vh) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .cheer { animation: none; } .meter div, .drawer { transition: none; } }

/* ---- Stock ------------------------------------------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tiles .card strong.h2 { font-size: 24px; overflow-wrap: anywhere; }
select.picker { font: inherit; font-weight: 600; padding: 10px 14px; border: 2px solid var(--black); border-radius: 12px; background: var(--white); max-width: 100%; }
.tablewrap { overflow-x: auto; background: var(--white); border-radius: 12px; border: 1px solid var(--grey-2); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.grid th { text-align: left; background: var(--black); color: var(--white); font-weight: 600; padding: 10px 12px; position: sticky; top: 0; }
table.grid td { padding: 9px 12px; border-bottom: 1px solid var(--grey-2); vertical-align: middle; }
table.grid td.num, table.grid th:nth-child(n+4) { text-align: right; }
table.grid tbody tr:hover { background: #fbf8f1; }

/* ---- Self-test ------------------------------------------------------------------------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 10px 0; border-top: 1px solid var(--grey-2); display: flex; gap: 10px; align-items: flex-start; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .brand img { width: 40px; height: 40px; }
  .wordmark { font-size: 20px; }
  .topuser .signout { display: none; }
  .topnav .navsignout { display: inline-flex; border-top: 1px solid var(--grey-2); border-radius: 0; margin-top: 4px; }
  .avatar { display: none; }
  main { padding: 20px 16px 40px; }
  h1, .h1 { font-size: 26px; }
  .card { padding: 18px; }
  .welcome .pitch { padding: 32px 22px; }
  .welcome .pitch .big { font-size: 32px; }
  .welcome .door { padding: 28px 18px; }
  .slip .what { text-align: left; }
}
@media print {
  .topbar, .goldbar, .col-side, .no-print, .sitefoot { display: none !important; }
  body { background: var(--white); }
}

/* ---- Counter ---- */
.grow { flex: 1 1 260px; }
.scanbox input { font-size: 20px; letter-spacing: 0.5px; }
.person .avatar.big { width: 56px; height: 56px; border-radius: 28px; font-size: 18px; }
.tightstack { gap: 2px; }
.tightrow { gap: 6px; margin-top: 4px; }
.right { text-align: right; align-items: flex-end; }
.small.bad, .bad { color: var(--bad); }
.qty { width: 76px; font: inherit; font-size: 16px; padding: 8px 10px; border: 2px solid var(--grey-2, #d9d9dc); border-radius: 10px; }
details.more { border-top: 1px solid var(--grey-2, #e4e4e6); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 600; font-size: 15px; }
details.more[open] summary { margin-bottom: 12px; }
.card.inset { background: var(--grey-1); padding: 18px; }
.plainlist { margin: 0; padding-left: 18px; }
.modal { position: fixed; inset: 0; background: rgba(28, 27, 29, 0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modalcard { width: 100%; max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; }
.sigpad { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 2px solid var(--black); border-radius: 12px; touch-action: none; background: #fff; cursor: crosshair; }
.slip table.grid { width: 100%; min-width: 0; }
.slip .slipmeta { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.slipmeta > div { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; }
.signlines { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 24px; margin-top: 28px; }
.signlines > div { display: flex; flex-direction: column; gap: 6px; }
.signlines .line { display: block; border-bottom: 2px solid var(--black); height: 44px; }
@media (max-width: 560px) { .signlines { grid-template-columns: 1fr; } }
@media print {
  .topbar, .goldbar, .noprint, .toast, .col-side, .sitefoot { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .card.slip { box-shadow: none; padding: 0; }
  .wrap { max-width: none; }
}
.sizepick { font: inherit; font-size: 14px; margin-top: 6px; padding: 6px 8px; border: 2px solid var(--grey-2, #d9d9dc); border-radius: 10px; max-width: 100%; }
table.grid.desk { min-width: 640px; }
@media (max-width: 640px) {
  table.grid.desk { min-width: 0; }
  table.grid.desk thead { display: none; }
  table.grid.desk tr { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--grey-2); align-items: center; }
  table.grid.desk td { border: 0; padding: 0; text-align: left !important; }
  table.grid.desk td:first-child { grid-column: 1 / -1; }
  table.grid.desk td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
}
table.grid.topup { min-width: 640px; }
table.grid tr.grouprow td { background: var(--grey-1); padding-top: 12px; }
@media (max-width: 640px) {
  table.grid.topup { min-width: 0; }
  table.grid.topup thead { display: none; }
  table.grid.topup tr { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--grey-2); align-items: center; }
  table.grid.topup td { border: 0; padding: 0; text-align: left !important; }
  table.grid.topup td:first-child { grid-column: 1 / -1; }
}
.card.watch { border-left: 6px solid var(--bad); }
.item.off { opacity: 0.55; }

/* Stock counts */
.pill.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }
input.reason { width: 100%; max-width: 320px; margin-top: 6px; font: inherit; font-size: 14px; padding: 6px 8px; border: 2px solid var(--grey-2, #d9d9dc); border-radius: 8px; }
@media (max-width: 640px) { input.reason { max-width: none; } }
input.reason.needs { border-color: var(--bad); }

/* Top-up lines: both codes and every stock figure labelled */
.codes { margin-top: 2px; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.4px; vertical-align: 1px; }
.tag.brand { background: var(--black); color: var(--gold); }
.tag.plain { background: var(--grey-1); color: var(--muted); border: 1px solid var(--grey-2, #d9d9dc); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 8px; border-radius: 8px; background: var(--grey-1); font-size: 12px; }
.chip .chip-label { color: var(--muted); }
.chip.warn { background: var(--bad-bg); }
.chip.warn strong { color: var(--bad); }
p.because { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--text, inherit); max-width: 62ch; }
ol.steps { margin: 8px 0; padding-left: 20px; line-height: 1.5; }
ol.steps li { margin: 4px 0; }

.reasoncount { color: #8a2a1e; }
.reasoncount.ok { color: #2e6b34; }
.narrowmodal { max-width: 520px; }

/* Compact slips: 80 mm thermal or dot-matrix */
.compactslips { display: flex; flex-direction: column; gap: 12px; }
.compactslip { font-family: "Courier New", Courier, monospace; font-size: 12px; line-height: 1.35; background: #fff; color: #000; border: 1px dashed #bbb; padding: 10px; white-space: pre; overflow-x: auto; margin: 0; }
.compact-thermal, .compact-dotmatrix { width: max-content; max-width: 100%; }
.cutline { font-family: monospace; font-size: 11px; color: #777; text-align: center; }
@media print {
  body.print-thermal .compactslip, body.print-dotmatrix .compactslip { border: 0; padding: 0; }
  body.print-thermal .compactslip { font-size: 10.5px; }
  body.print-dotmatrix .compactslip { font-size: 11px; }
  body.print-thermal .cutline, body.print-dotmatrix .cutline { color: #000; page-break-inside: avoid; }
  body.print-thermal .sitefoot, body.print-dotmatrix .sitefoot, body.print-thermal .goldbar, body.print-dotmatrix .goldbar { display: none; }
}
@page thermal { size: 80mm auto; margin: 3mm; }
@page dotmatrix { margin: 8mm; }
@media print { body.print-thermal main { page: thermal; } body.print-dotmatrix main { page: dotmatrix; } }

/* Go-live additions: bell, tiles, products */
.bellbtn { position: relative; background: transparent; border: 0; font-size: 20px; cursor: pointer; padding: 4px 8px; line-height: 1; }
.bellcount { position: absolute; top: -4px; right: -2px; background: var(--bad); color: var(--white); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 6px; min-width: 18px; text-align: center; }
.item.unread { border-left: 4px solid var(--gold-solid); }
.tile { background: var(--white); border: 1px solid var(--grey-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile strong.h2 { font-size: 22px; overflow-wrap: anywhere; }
.tile.warn { border-color: var(--gold-solid); background: #fdf6e6; }
.tile.bad { border-color: var(--bad); background: var(--bad-bg); }
.productpic { width: 100%; border-radius: 12px; background: var(--white); border: 1px solid var(--grey-2); }
.infolink { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--grey-3); font-size: 12px; font-weight: 700; text-decoration: none; color: var(--muted); }
.infolink:hover { border-color: var(--gold-solid); color: var(--black); }
@media print { .bellbtn { display: none; } }
.toolgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.tool { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--grey-2); border-radius: 12px; text-decoration: none; background: var(--white); }
.tool:hover { border-color: var(--gold-solid); }

/* Setup area: contract lines, matrix grid, user roles */
tr.hit td { background: var(--gold-light); }
.matrixwrap { max-height: 70vh; overflow: auto; }
table.matrix { border-collapse: separate; border-spacing: 0; }
table.matrix { width: auto; min-width: 0; }
table.matrix th.sticky { position: sticky; left: 0; z-index: 2; min-width: 190px; text-align: left; }
table.matrix tbody th.sticky { background: var(--white); color: var(--black); font-weight: 700; border-bottom: 1px solid var(--grey-2); }
table.matrix thead th { position: sticky; top: 0; z-index: 1; text-align: left; }
table.matrix thead th.sticky { z-index: 3; }
table.matrix th.rot { height: 150px; vertical-align: bottom; padding: 4px 2px; }
table.matrix th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 145px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
table.matrix td { padding: 2px; text-align: center; }
.cell { min-width: 64px; min-height: 36px; border: 1px solid var(--grey-1, #ddd); background: transparent; border-radius: 6px; font: inherit; font-size: 13px; color: var(--muted, #777); cursor: pointer; }
.cell.set { color: var(--black, #111); font-weight: 700; background: var(--ok-bg, #e8f5ec); }
.cell.group { background: var(--gold, #f2c230); color: var(--black, #111); }
.cell:disabled { cursor: default; }
.cell:focus-visible { outline: 3px solid var(--gold-solid); outline-offset: 1px; }
.permlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-height: 50vh; overflow: auto; }
.permgroup { border: 1px solid var(--grey-1, #ddd); border-radius: 8px; padding: 8px 12px; margin: 0; }
.permgroup legend { font-weight: 700; padding: 0 4px; }

/* Store transfers: a tick box with its words on one line */
.checkline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.checkline input[type=checkbox] { width: auto; }

/* ---- Printed approval slip ---- */
.approvalslip { gap: 14px; }
.approvalslip svg { max-width: 100%; height: auto; }
.slipbox { display: flex; flex-direction: column; gap: 4px; }
.slipline { border-bottom: 1px solid var(--ink, #1c1b1d); height: 34px; }
@media print {
  .approvalslip { font-size: 12pt; }
  .approvalslip table.grid td { padding: 6px 8px; }
}


/* ---- Grouped menu (head office) and your own menu ---- */
.navgroup { position: relative; }
.navgroupbtn .caret { margin-left: 6px; font-size: 11px; transition: transform .15s; }
.navgroup.open .navgroupbtn .caret { transform: rotate(180deg); }
.topnav .navgroupbtn.on { background: var(--black); color: var(--white); }
.navmenu { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 230px; flex-direction: column; gap: 2px; padding: 8px; background: var(--white); border: 1px solid var(--grey-2); border-top: 4px solid var(--gold-solid); border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.14); }
.navgroup.open .navmenu { display: flex; }
.navmenu a, .navmenu button { font: inherit; font-size: 14px; font-weight: 600; padding: 10px 12px; min-height: 40px; border-radius: 8px; border: 0; background: transparent; color: var(--black); text-decoration: none; cursor: pointer; display: flex; align-items: center; text-align: left; width: 100%; }
.navmenu a:hover, .navmenu button:hover { background: var(--grey-1); }
.navmenu a.on, .navmenu a.on:hover { background: var(--black); color: var(--white); }
.usergroup .navmenu { left: auto; right: 0; }
.usermenuname { padding: 6px 12px 8px; border-bottom: 1px solid var(--grey-2); margin-bottom: 4px; }
.avatarbtn { border: 0; cursor: pointer; padding: 0; }
.avatarbtn:focus-visible, .navgroupbtn:focus-visible { outline: 3px solid var(--gold-solid); outline-offset: 2px; }
.topnav .navmine { display: none; }
@media (max-width: 1359px) {
  /* In the burger panel the groups are headings with their pages listed under them. */
  .navgroup { width: 100%; }
  .navgroupbtn { pointer-events: none; color: var(--muted, #6b6b70) !important; background: transparent !important; font-size: 12px !important; text-transform: uppercase; letter-spacing: .6px; min-height: 32px !important; padding: 12px 14px 4px !important; }
  .navgroupbtn .caret { display: none; }
  .topnav .navmenu { display: flex; position: static; box-shadow: none; border: 0; padding: 0 0 6px; min-width: 0; }
  .topnav .navmenu a { font-size: 16px; min-height: 44px; }
  .topnav .navmine { display: inline-flex; border-top: 1px solid var(--grey-2); border-radius: 0; margin-top: 4px; }
}
@media (max-width: 640px) {
  .usergroup { display: none; }
}

/* ---- Card test (0.4.3) ---------------------------------------------------------------------- */
.msg.warn { background: #fff5e0; color: #7a5100; border-left: 6px solid var(--gold-solid); }
.nfcpulse { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.nfcpulse.hidden { display: none; }
.nfcdot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold-solid); animation: nfcpulse 1.2s ease-in-out infinite; flex: none; }
@keyframes nfcpulse { 0%, 100% { transform: scale(0.7); opacity: 0.5; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nfcdot { animation: none; } }
table.cardids { width: 100%; border-collapse: collapse; font-size: 14px; }
table.cardids th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 10px 6px 0; white-space: nowrap; }
table.cardids td { padding: 6px 10px 6px 0; border-top: 1px solid var(--grey-2); }
table.cardids td.code { font-family: "DejaVu Sans Mono", ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
ol.cardtestlog { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
ol.cardtestlog .logline { padding: 8px 10px; border-radius: 10px; background: var(--grey-1); border-left: 5px solid var(--grey-3); }
ol.cardtestlog .logline.ok { border-left-color: var(--ok); }
ol.cardtestlog .logline.warn { border-left-color: var(--gold-solid); }
ol.cardtestlog .logline.bad { border-left-color: var(--bad); background: var(--bad-bg); }
details.card > summary { cursor: pointer; font-weight: 600; }
ol.steps-plain { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); }
table.cardids th .pill { margin-top: 4px; }
table.cardids td.code { text-align: right; }
details.cardsays > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
dl.cardinfo { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; font-size: 14px; }
dl.cardinfo dt { color: var(--muted); }
dl.cardinfo dd { margin: 0; }
ol.records { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
ol.records .reccontent { margin-top: 4px; padding: 8px 10px; background: var(--grey-1); border-radius: 8px; white-space: pre-wrap; word-break: break-word; }
ol.records .reccontent.code { font-family: "DejaVu Sans Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* Fit for duty: a red bar on every screen until the person working has confirmed (2 Dec 2026). */
.shiftbar { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; background: var(--bad); color: #fff; font-size: 15px; text-align: center; }
.shiftbar .btn { background: #fff; color: var(--bad); border-color: #fff; }
@media print { .shiftbar { display: none; } }

/* Choosing sizes for a count, and several sizes in one stock change (2 Dec 2026). */
.picklist { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line, #ddd); border-radius: 6px; padding: 8px; margin: 8px 0; }
.picklist .choice { padding: 4px 0; }
.adjline { border-bottom: 1px dashed var(--line, #ddd); padding-bottom: 8px; }
