/* JL Tool Manager — colours, type and layout taken from the Access forms (modJLUI / form designs). */
:root {
  --navy: #0d2339;          /* nav + page header (RGB 13,35,57) */
  --navy-2: #1f425e;        /* nav hover */
  --navy-line: #344d63;
  --ink: #192c41;           /* body text */
  --ink-2: #182b3e;
  --muted: #627485;
  --muted-2: #a9b7c5;
  --page: #f4f6f9;
  --card: #ffffff;
  --line: #dae1e9;
  --line-2: #cfd8e2;
  --blue: #0066be;          /* primary */
  --blue-hover: #005aaa;
  --blue-press: #004b91;
  --blue-soft: #e0edfa;
  --field: #ecf2ff;
  --green: #1a8b43;         /* confirm */
  --green-hover: #147436;
  --green-tile: #1f8f4b;
  --amber: #f5b826;
  --red: #be313b;
  --red-hover: #a62430;
  --purple: #60529a;
  --grey-btn: #e0e6ed;
  --grey-btn-hover: #d2dae3;
  --ok-bg: #def3e5;  --ok-fg: #196c36;
  --warn-bg: #fff2cc; --warn-fg: #794f00;
  --bad-bg: #fde2e4;  --bad-fg: #a81c22;
  --info-bg: #e0edfa; --info-fg: #0056a3;
  --repair-bg: #ffe9d2; --repair-fg: #93500f;
  --neutral-bg: #eaedf1; --neutral-fg: #627485;
  --nav-w: 232px;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(13, 35, 57, .08), 0 4px 14px rgba(13, 35, 57, .06);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); }
body { font-size: 14px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--blue); }

/* ---- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 18px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--blue); color: #fff; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; transition: background .12s, box-shadow .12s;
}
.btn:hover { background: var(--blue-hover); }
.btn:active { background: var(--blue-press); }
.btn:focus-visible { outline: 3px solid rgba(0, 102, 190, .35); outline-offset: 1px; }
.btn.secondary { background: var(--grey-btn); color: var(--ink); }
.btn.secondary:hover { background: var(--grey-btn-hover); }
.btn.green { background: var(--green); }
.btn.green:hover { background: var(--green-hover); }
.btn.red { background: var(--red); }
.btn.red:hover { background: var(--red-hover); }
.btn.big { min-height: 52px; font-size: 16px; padding: 10px 24px; }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--grey-btn) !important; color: #627485 !important; cursor: not-allowed; }
.btn img { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; color: var(--blue); font-weight: 700; cursor: pointer; padding: 0; text-transform: uppercase; font-size: 13px; }

/* ---- form fields ------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.field > label.strong { color: var(--ink); font-weight: 700; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: #fff; color: var(--ink-2); outline: none;
}
textarea { min-height: 64px; resize: vertical; }
input.primary, select.primary, textarea.primary { background: var(--field); border-color: var(--blue); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 102, 190, .18); }
input.scan { font-size: 20px; min-height: 52px; background: var(--field); border-color: var(--blue); }
input[readonly], textarea[readonly] { background: #f7f9fb; }
.req::after { content: " *"; color: var(--red); }

/* ---- app shell ---------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav { background: var(--navy); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 18px; border-bottom: 1px solid var(--navy-line); }
.brand img { width: 40px; height: 40px; }
.brand .jl { color: #1e88ff; font-weight: 900; font-size: 28px; letter-spacing: -.02em; line-height: 1; }
.brand .tm { font-weight: 800; font-size: 13px; line-height: 1.1; letter-spacing: .03em; }
.navlist { padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.navbtn {
  display: grid; grid-template-columns: 30px 22px 1fr; align-items: center; gap: 8px;
  width: 100%; min-height: 46px; padding: 6px 10px 6px 6px; border: 0; border-radius: var(--radius);
  background: transparent; color: #fff; font-weight: 700; font-size: 15px; text-align: left; cursor: pointer;
}
.navbtn:hover { background: var(--navy-2); }
.navbtn.active { background: var(--blue); }
.navbtn .key { font-size: 11px; font-weight: 600; color: var(--muted-2); border: 1px solid var(--navy-line); border-radius: 4px; text-align: center; padding: 1px 0; }
.navbtn.active .key { color: #fff; border-color: rgba(255, 255, 255, .5); }
.navbtn img { width: 20px; height: 20px; }
.navspacer { flex: 1; }
.profile { border-top: 1px solid var(--navy-line); margin: 0 14px; padding: 14px 4px 18px; display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.profile img { width: 32px; height: 32px; opacity: .9; }
.profile .who { font-weight: 700; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.profile .role { color: var(--muted-2); font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.pagehead { background: var(--navy); color: #fff; min-height: 72px; padding: 12px 28px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20; }
.pagehead h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; line-height: 1.1; }
.pagehead h1.mixed { text-transform: none; }
.pagehead .grow { flex: 1; }
.content { padding: 22px 28px 28px; flex: 1; }
.subtitle { color: var(--muted); margin: 0 0 14px; }
.menu-toggle { display: none; }

/* ---- messages ------------------------------------------------------------------ */
.msg { border-radius: var(--radius); padding: 9px 14px; font-size: 14px; background: var(--info-bg); color: var(--info-fg); }
.msg.ok { background: var(--ok-bg); color: var(--ok-fg); }
.msg.warn { background: var(--warn-bg); color: var(--warn-fg); }
.msg.bad { background: var(--bad-bg); color: var(--bad-fg); font-weight: 700; }
.pagehead .msg { flex: 1 1 380px; max-width: 760px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; }

/* ---- cards & layout ---------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 16px 18px; }
.card h2, .card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--ink); }
.card h2.blue, .section-title { color: var(--blue); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 8px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1 1 220px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 14px; }
.right { margin-left: auto; }

/* ---- chips ----------------------------------------------------------------------- */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--neutral-bg); color: var(--neutral-fg); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip.bad { background: var(--bad-bg); color: var(--bad-fg); }
.chip.info { background: var(--info-bg); color: var(--info-fg); }
.chip.repair { background: var(--repair-bg); color: var(--repair-fg); }

/* ---- data grids ---------------------------------------------------------------------- */
.gridwrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: auto; box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid thead th { position: sticky; top: 0; background: #e2e7ec; color: var(--navy); text-align: left; font-weight: 700; padding: 9px 10px; white-space: nowrap; z-index: 1; border-bottom: 1px solid var(--line-2); }
table.grid tbody td { padding: 8px 10px; border-bottom: 1px solid #edf1f5; vertical-align: middle; }
table.grid tbody tr:nth-child(even) td { background: #fafbfd; }
table.grid tbody tr { cursor: default; }
table.grid tbody tr.clickable { cursor: pointer; }
table.grid tbody tr.clickable:hover td { background: #eef5fd; }
table.grid tbody tr.sel td { background: #d9e9fa !important; }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid td.tn { font-weight: 700; white-space: nowrap; }
table.grid td.act { width: 1%; white-space: nowrap; text-align: right; }
table.grid .empty td { text-align: center; color: var(--muted); padding: 26px; background: #fff !important; }
.rowbtn { min-width: 36px; height: 32px; border: 0; border-radius: 5px; font-weight: 800; font-size: 18px; cursor: pointer; background: var(--blue); color: #fff; }
.rowbtn.x { background: var(--grey-btn); color: var(--ink); }
.rowbtn.x:hover { background: #f6c9cd; color: var(--bad-fg); }
.qtybtn { border: 1px solid var(--blue); background: var(--field); color: var(--blue); border-radius: 5px; font-weight: 700; padding: 2px 10px; cursor: pointer; }

/* ---- home ------------------------------------------------------------------------- */
.counters { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.counter { min-width: 128px; padding: 6px 12px; border-left: 1px solid var(--navy-line); }
.counter .n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.counter .l { font-size: 12px; color: #d3dce6; }
.counter .sub { font-size: 11px; color: var(--muted-2); }
.counter.alert .n { color: #ff9aa2; }
.counter.amber .n { color: #ffd166; }
.home { position: relative; flex: 1; }
.home::before { content: ""; position: absolute; inset: 0; background: url(img/workshop.jpg) center / cover no-repeat; opacity: .55; pointer-events: none; }
.home > * { position: relative; }
.quick { background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px 18px; box-shadow: var(--shadow); }
.quick h2 { margin: 0 0 10px; font-size: 18px; color: var(--ink-2); }
.quick .row input { flex: 1 1 320px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 24px; }
.tile {
  position: relative; min-height: 178px; border: 0; border-radius: 10px; color: #fff; font-size: 20px; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(13, 35, 57, .18); transition: transform .1s, filter .1s;
}
.tile:hover { transform: translateY(-2px); filter: brightness(1.05); }
.tile img { width: 64px; height: 64px; }
.tile .badge { position: absolute; top: 12px; right: 14px; background: rgba(255, 255, 255, .92); color: var(--bad-fg); font-size: 13px; padding: 2px 9px; border-radius: 999px; }
.tile.blue { background: var(--blue); }
.tile.green { background: var(--green-tile); }
.tile.amber { background: var(--amber); color: var(--ink); }
.tile.red { background: var(--red); }
.tile.light { background: var(--blue-soft); color: var(--ink); }
.tile.purple { background: var(--purple); }

/* ---- booking -------------------------------------------------------------------- */
.steps { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--muted); }
.step img { width: 32px; height: 32px; }
.step.active { color: var(--blue); }
.step.done { color: var(--ok-fg); }
.step-arrow { color: #a7bdc5; font-size: 26px; padding: 0 6px; }
.personcards { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; }
.find-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; }
.find-row img { width: 44px; height: 44px; }
.selected { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; }
.selected .ph { width: 84px; height: 84px; border-radius: 8px; background: #f0f4f8; display: grid; place-items: center; overflow: hidden; }
.selected .ph img { max-width: 100%; max-height: 100%; }
.selected .nm { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.15; }
.selected .meta { color: var(--ink); font-size: 13px; }
.selected .acts { display: flex; flex-direction: column; gap: 8px; }
.scanrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: end; margin-top: 16px; }
.foot { display: grid; grid-template-columns: 200px 200px 1fr minmax(260px, 340px); gap: 12px; align-items: end; margin-top: 14px; }
.foot.ret { grid-template-columns: 260px 1fr minmax(240px, 320px); }
.queuewrap { margin-top: 12px; min-height: 220px; max-height: calc(100vh - 520px); }
.condsel { width: auto; min-height: 32px; padding: 3px 6px; }

/* ---- tool details ------------------------------------------------------------------ */
.details { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
.photo { width: 100%; aspect-ratio: 4/3; background: #f0f3f7; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.kv { display: grid; grid-template-columns: 150px 1fr 150px 1fr; gap: 8px 12px; align-items: center; }
.kv .k { color: var(--ink-2); font-size: 13px; }
.kv .v { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; min-height: 34px; overflow-wrap: anywhere; }
.kv .v.big { font-size: 20px; font-weight: 800; }
.kv .wide { grid-column: span 3; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-top: 16px; flex-wrap: wrap; }
.tab { border: 0; background: none; padding: 9px 16px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tabpanel { padding-top: 10px; }

/* ---- modal ------------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(13, 35, 57, .55); display: flex; align-items: flex-start; justify-content: center; padding: 3vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--page); border-radius: 10px; width: min(1100px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); display: flex; flex-direction: column; max-height: 94vh; }
.modal.narrow { width: min(560px, 100%); }
.modal.mid { width: min(820px, 100%); }
.modal.wide { width: min(1320px, 100%); }
.modal-head { background: var(--navy); color: #fff; padding: 14px 20px; border-radius: 10px 10px 0 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.modal-head h2 { margin: 0; font-size: 22px; font-weight: 800; text-transform: uppercase; }
.modal-head .grow { flex: 1; }
.modal-head .sub { color: #c9d4df; font-size: 13px; flex-basis: 100%; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px 16px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* ---- login --------------------------------------------------------------------------- */
.login { min-height: 100vh; display: flex; flex-direction: column; background: #0b1d30; }
.login-top { background: linear-gradient(90deg, #072a63, #0b4fb3); color: #fff; padding: 14px 32px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); position: relative; z-index: 2; }
.login-top img { width: 46px; height: 46px; }
.wordmark { display: flex; flex-direction: column; }
.wordmark .t { font-size: 30px; font-weight: 900; letter-spacing: .01em; line-height: 1; }
.wordmark .t b { color: #2f8fff; }
.wordmark .tag { font-size: 11px; letter-spacing: .38em; color: #d7e4f6; margin-top: 4px; }
.login-stage { flex: 1; position: relative; display: grid; place-items: center; padding: 6vh 16px; overflow: hidden; }
.login-stage::before { content: ""; position: absolute; inset: 0; background: url(img/workshop.jpg) center / cover; filter: saturate(1.15); }
.login-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(225, 236, 250, .86) 0%, rgba(225, 236, 250, .55) 38%, rgba(7, 42, 99, .18) 100%); }
.login-gear { position: absolute; left: -110px; top: 50%; width: 420px; transform: translateY(-50%); opacity: .5; z-index: 1; }
.login-card { position: relative; z-index: 2; width: min(460px, 100%); background: rgba(255, 255, 255, .97); border-radius: 14px; padding: 26px 30px 24px; box-shadow: 0 18px 50px rgba(7, 42, 99, .28); }
.login-card .logo { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 4px; }
.login-card .logo img { width: 52px; height: 52px; }
.login-card .logo .t { font-size: 28px; font-weight: 900; color: #0c1f3a; }
.login-card .logo .t b { color: #1a73e8; }
.login-card .tagline { text-align: center; font-size: 10px; letter-spacing: .4em; color: #5f7186; margin: 0 0 20px; display: flex; align-items: center; gap: 10px; }
.login-card .tagline::before, .login-card .tagline::after { content: ""; flex: 1; height: 1px; background: #c7d2de; }
.login-card label { font-weight: 700; color: #0c1f3a; font-size: 14px; display: block; margin: 12px 0 6px; }
.idfield { display: grid; grid-template-columns: 44px 1fr; align-items: center; border: 1.5px solid #3b82e6; background: #eaf2ff; border-radius: 8px; overflow: hidden; }
.idfield img { width: 26px; height: 26px; margin: 0 auto; opacity: .7; }
.idfield input { border: 0; background: transparent; min-height: 48px; font-size: 18px; box-shadow: none !important; }
.login-card input[type=password] { min-height: 48px; font-size: 18px; background: #eaf2ff; border: 1.5px solid #3b82e6; border-radius: 8px; }
.login-card .go { width: 100%; margin-top: 16px; min-height: 50px; font-size: 16px; background: linear-gradient(180deg, #1673ea, #0a55c7); }
.or { display: flex; align-items: center; gap: 12px; color: #8aa1b5; font-size: 12px; margin: 16px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: #d3dce6; }
.card-btn { width: 100%; min-height: 48px; border: 0; border-radius: 8px; background: #e6e9f0; color: #0c1f3a; font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; gap: 14px; cursor: pointer; }
.card-btn:hover { background: #dce1ea; }
.login-msg { margin-top: 14px; }

/* ---- reports ---------------------------------------------------------------------------- */
.reportcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.reportcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); cursor: pointer; text-align: left; }
.reportcard:hover { border-color: var(--blue); }
.reportcard img { width: 44px; height: 44px; }
.reportcard .t { font-weight: 800; font-size: 16px; text-transform: uppercase; color: var(--ink); }
.reportcard .d { color: var(--muted); }
.reportcard .o { color: var(--blue); font-weight: 700; margin-top: auto; font-size: 13px; }
.report-doc { background: #fff; color: #111; padding: 22px 26px; border: 1px solid var(--line); border-radius: 6px; }
.report-doc h1 { font-size: 18px; margin: 0; }
.report-doc .gen { color: #555; font-size: 12px; margin-bottom: 10px; }
.report-doc table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-doc th { text-align: left; border-bottom: 2px solid #333; padding: 4px 6px; }
.report-doc td { border-bottom: 1px solid #ddd; padding: 4px 6px; vertical-align: top; }

/* ---- receipts (80 mm / 58 mm thermal paper) ------------------------------------------------- */
.receipt-preview { background: #eef1f4; border-radius: 8px; padding: 16px; max-height: 58vh; overflow: auto; }
.receipt { width: 302px; background: #fff; color: #000; font-family: Arial, "Segoe UI", sans-serif; font-size: 13px; line-height: 1.3; padding: 14px 12px 12px;
  margin: 0 auto; box-shadow: 0 1px 6px rgba(0, 0, 0, .15); }
.receipt.p58 { width: 210px; font-size: 12px; }
.receipt .r-brand { text-align: center; font-weight: 800; font-size: 18px; letter-spacing: .5px; }
.receipt .r-title { text-align: center; font-weight: 800; font-size: 14px; }
.receipt .r-when { text-align: center; font-size: 12px; margin-bottom: 6px; }
.receipt .r-meta { border-top: 2px solid #000; border-bottom: 2px solid #000; padding: 4px 0; }
.receipt .r-kv { display: flex; gap: 6px; }
.receipt .r-kv span { flex: 0 0 62px; }
.receipt .r-kv b { overflow-wrap: anywhere; }
.receipt .r-item { border-bottom: 1px dashed #000; padding: 6px 0; }
.receipt .r-tool { font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.receipt .r-desc { margin-bottom: 2px; }
.receipt .r-loc { font-size: 16px; }
.receipt .r-loc span, .receipt .r-shelf span { font-size: 12px; padding-top: 3px; }
.receipt .r-loc b, .receipt .r-shelf b { font-weight: 800; text-transform: uppercase; }
.receipt .r-att { font-weight: 800; margin-top: 3px; }
.receipt .r-foot { text-align: center; font-size: 11px; margin-top: 8px; overflow-wrap: anywhere; }
.checkrow { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 8px; cursor: pointer; }
.checkrow input { width: 18px; height: 18px; margin: 0; }

/* ---- misc ------------------------------------------------------------------------------------ */
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 300; max-width: 460px; box-shadow: var(--shadow); }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { color: var(--muted); padding: 24px; text-align: center; }
.result-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.result-btns button { min-height: 52px; border-radius: 8px; border: 2px solid transparent; font-weight: 800; font-size: 16px; cursor: pointer; }
.r-pass { background: var(--ok-bg); color: var(--ok-fg); } .r-pass.on { background: #1c8b45; color: #fff; border-color: var(--ok-fg); }
.r-fail { background: var(--bad-bg); color: var(--bad-fg); } .r-fail.on { background: #be2731; color: #fff; border-color: var(--bad-fg); }
.r-adj { background: var(--warn-bg); color: var(--warn-fg); } .r-adj.on { background: #f5b51e; color: var(--warn-fg); border-color: var(--warn-fg); }
.quickcal { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.quickcal button { background: var(--navy); border: 1px solid var(--navy-line); color: #fff; border-radius: 6px; min-width: 112px; padding: 6px 12px; cursor: pointer; text-align: center; font-weight: 700; font-size: 12px; }
.quickcal button b { display: block; font-size: 22px; line-height: 1.1; }
.quickcal button.on { background: var(--blue); border-color: var(--blue); }
.quickcal button:hover { background: #1b7acf; }
.actionpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.actionpick button { min-height: 46px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--grey-btn); font-weight: 800; cursor: pointer; color: var(--ink); }
.actionpick button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.actionpick button:disabled { opacity: .45; cursor: not-allowed; }
.roleinfo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.roleinfo div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.roleinfo b { display: block; color: var(--blue); }
.demo-banner { background: #fff2cc; color: #5b3d00; font-size: 13px; padding: 6px 14px; text-align: center; border-bottom: 1px solid #f0d58a; }

/* ---- barcode scanning ------------------------------------------------------------------------ */
input[data-scan] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 16'%3E%3Cg fill='%237a8796'%3E%3Crect x='0' width='2' height='16'/%3E%3Crect x='3' width='1' height='16'/%3E%3Crect x='5' width='3' height='16'/%3E%3Crect x='9' width='1' height='16'/%3E%3Crect x='11' width='2' height='16'/%3E%3Crect x='14' width='1' height='16'/%3E%3Crect x='16' width='3' height='16'/%3E%3Crect x='20' width='2' height='16'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 22px 16px; padding-right: 42px;
}
.scanflash { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 400; background: var(--navy); color: #fff; padding: 8px 18px; border-radius: 20px;
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow); pointer-events: none; animation: scanflash 1.8s ease forwards; }
@keyframes scanflash { 0% { opacity: 0; transform: translate(-50%, 8px); } 10% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---- responsive ---------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .tiles, .reportcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personcards, .details { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot.ret { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 130px 1fr; }
  .kv .wide { grid-column: span 1; }
}
@media (max-width: 860px) {
  :root { --nav-w: 0px; }
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; z-index: 90; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .menu-toggle { display: inline-flex; background: transparent; border: 1px solid var(--navy-line); color: #fff; border-radius: 6px; padding: 6px 10px; font-size: 20px; cursor: pointer; }
  .pagehead { padding: 10px 14px; }
  .pagehead h1 { font-size: 22px; }
  .content { padding: 14px; }
  .tiles, .reportcards, .grid2, .grid3, .roleinfo { grid-template-columns: 1fr; }
  .tile { min-height: 120px; }
  .scanrow { grid-template-columns: 1fr; }
  .foot, .foot.ret { grid-template-columns: 1fr; }
  .counter { min-width: 96px; }
  .selected { grid-template-columns: 64px 1fr; }
  .selected .acts { grid-column: span 2; flex-direction: row; }
}

/* ---- printing: only the report or receipt being printed --------------------------------- */
@media screen { #print-area { display: none; } }
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .report-doc { border: 0; padding: 0; }
  /* 72 mm / 48 mm are the printable widths of 80 mm / 58 mm receipt rolls */
  .receipt { width: 72mm; box-shadow: none; padding: 1mm 1mm 4mm; }
  .receipt.p58 { width: 48mm; }
  @page { margin: 10mm; }
}
