/* Lavar Supplier Register. One stylesheet, system fonts, no external requests.
   Brand tokens and the header follow the Lavar e-PTW (LAVAR blue #0C55A3 measured from the logo). */
:root {
  /* brand (e-PTW) */
  --brand: #0c55a3;
  --brand-hover: #084682;
  --brand-tint: #e8f0f8;
  --brand-tint-2: #d3e3f3;
  --grey: #707070;
  --grey-light: #b8b8b8;
  /* text and surfaces */
  --ink: #1f262e;
  --ink-2: #3a4450;
  --muted: #62666b;
  --line: #dde1e6;
  --line-2: #eef1f4;
  --line-strong: #b8b8b8;
  --bg: #f5f7fa;
  --card: #fff;
  --focus: #2f7bc8;
  /* status */
  --ok: #1b7444; --ok-bg: #e3f4ea;
  --warn: #8a5200; --warn-bg: #fff4d6;
  --pend: #0c55a3; --pend-bg: #e8f0f8;
  --bad: #b42318; --bad-bg: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}
* { box-sizing: border-box; }
/* A jump to #something (a Settings card after a save, a rule, a row of the review grid) stops below
   the sticky header, never under it; on a phone the header is up to three lines tall. */
html { scroll-padding-top: 76px; }
@media (max-width: 600px) { html { scroll-padding-top: 128px; } }
body { margin: 0; line-height: 1.5; font-size: 15px; background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: .95rem; margin-top: 1.4em; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 .8em; }
::selection { background: var(--brand-tint-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.red { color: var(--bad); } .amber { color: var(--warn); } .green { color: var(--ok); } .pendtext { color: var(--pend); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.inline { display: inline; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 1280px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }

/* header: the logo is drawn on white, so the bar is white with a hairline (as the e-PTW) */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); }
.topin { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 60px; flex-wrap: wrap; max-width: 1280px; padding-top: 8px; padding-bottom: 8px; }
.topbar a { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; color: var(--ink); }
.brand-logo { display: block; height: 36px; width: auto; aspect-ratio: 504 / 133; flex: none; }
.brand .title { font-weight: 600; font-size: 1rem; color: var(--ink); padding-left: 14px; border-left: 1px solid var(--line-strong); line-height: 1.1; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: .93rem; }
.nav a { color: var(--ink-2); padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--brand); }
.nav a[aria-current="page"] { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.nav a.btn { color: #fff; border: 0; padding: 7px 14px; }
.nav .who { color: var(--muted); font-size: .85rem; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.foot { border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .82rem; padding: 18px 0; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 10px; padding: 10px 18px; min-height: 42px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { background: var(--brand-hover); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .86rem; min-height: 34px; }
.btn-ghost { background: #fff; color: var(--brand); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--brand-tint); color: var(--brand-hover); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.busy { opacity: .75; cursor: progress; }
.btn:disabled { cursor: progress; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; align-content: start; }
.field label, .filters label { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.field.check label, label.check { font-weight: 500; display: flex; gap: 8px; align-items: flex-start; }
/* The box style is for text-like controls only. A radio button or checkbox never takes it: given
   width 100% and a 42 px minimum height it stretches and drifts away from its label. :where()
   keeps this rule's weight at a bare `input`, so any later rule still narrows it. */
input:where(:not([type="checkbox"], [type="radio"])), select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 11px; width: 100%; min-height: 42px; }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--brand); flex: none; }
input:where(:not([type="checkbox"], [type="radio"])):focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-2); outline: none; }
.req { color: var(--bad); margin-left: 2px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
fieldset.flags { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; display: grid; gap: 8px; }
fieldset.flags legend { font-weight: 600; font-size: .88rem; color: var(--ink-2); padding: 0 6px; }
[hidden] { display: none !important; }
.unit { display: flex; align-items: center; gap: 6px; }
.unit input { width: 90px; }
.ai-tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; background: #efe7fb; color: #5b2fa8; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.narrow { max-width: 560px; margin: 8px auto 18px; }
.card.narrow.wideish { max-width: 760px; }
.cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.cols > .card { margin-bottom: 0; }
.cols + .card { margin-top: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead h1 { margin-bottom: .2em; }
.pagehead p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .76rem; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.pagehead .actions { margin: 0; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.prose { max-width: 760px; margin: 0 auto; }
.lede { font-size: 1.08rem; color: var(--ink-2); }
.inlineform { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inlineform label { flex: 1; min-width: 220px; display: grid; gap: 5px; font-weight: 600; font-size: .88rem; color: var(--ink-2); }

/* notices */
.notice { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid; font-size: .93rem; }
.notice ul { margin: 0; padding-left: 18px; }
/* a notice shown where the browser lands: in a Settings card, the mapping section, a grid row */
details.card > .notice { margin: 12px 0 0; }
.tbl.batchgrid tr.noticerow td { padding: 8px 5px 0; border: 0; }
.tbl.batchgrid tr.noticerow .notice { margin: 0; }
.n-ok { background: var(--ok-bg); border-color: #b9dfc5; color: #0f5129; }
.n-warn { background: var(--warn-bg); border-color: #f0d3a3; color: #6e3d00; }
.n-err { background: var(--bad-bg); border-color: #f1bdb7; color: #7d1810; }
.n-info { background: var(--brand-tint); border-color: var(--brand-tint-2); color: #0a3a6b; }

/* status */
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.badge.big { font-size: 1rem; padding: 6px 16px; }
.s-cleared.badge { background: var(--ok-bg); color: var(--ok); border-color: #b9dfc5; }
.s-expiring.badge { background: var(--warn-bg); color: var(--warn); border-color: #f0d3a3; }
.s-pending.badge { background: var(--pend-bg); color: var(--pend); border-color: var(--brand-tint-2); }
.s-not_cleared.badge { background: var(--bad-bg); color: var(--bad); border-color: #f1bdb7; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.s-cleared { background: var(--ok); } .dot.s-expiring { background: #d98b0b; } .dot.s-pending { background: var(--pend); } .dot.s-not_cleared { background: var(--bad); }
.tick { color: var(--ok); font-weight: 700; font-size: .85rem; }
.dstat { font-size: .78rem; font-weight: 600; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.d-verified { background: var(--ok-bg); color: var(--ok); } .d-submitted { background: var(--pend-bg); color: var(--pend); }
.d-draft { background: var(--line-2); color: var(--muted); } .d-rejected { background: var(--bad-bg); color: var(--bad); }

.reasons { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 7px; }
.reasons li { display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; }
.reasons .ic { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; margin-top: 1px; }
.lv-block .ic { background: var(--bad-bg); color: var(--bad); }
.lv-pending .ic { background: var(--pend-bg); color: var(--pend); }
.lv-warn .ic { background: var(--warn-bg); color: var(--warn); }
.lv-note .ic { background: var(--line-2); color: var(--muted); }
.lv-note { color: var(--ink-2); }
.reasons .rule { font-size: .78rem; color: var(--muted); }
.ok-line { color: var(--ok); font-weight: 600; }

/* chips & filters */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chips a { text-decoration: none; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .87rem; }
.chips a b { margin-left: 4px; color: var(--ink); }
.chips a.on { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-hover); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; min-width: 140px; flex: 1; }
.filters label:has(.unit) { flex: 0 0 auto; min-width: 0; }
.filters .btn { flex: none; }

/* asset rows */
.assetlist { display: grid; gap: 8px; }
.assetrow { display: grid; grid-template-columns: 140px minmax(0, 1fr) 220px 200px; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.assetrow:hover { border-color: var(--brand-tint-2); }
.ar-title { font-weight: 650; text-decoration: none; color: var(--ink); }
.ar-title:hover { color: var(--brand); text-decoration: underline; }
.ar-sub { color: var(--muted); font-size: .86rem; }
.ar-why { font-size: .84rem; color: var(--ink-2); margin-top: 3px; }
.ar-vendor { font-size: .9rem; }
.ar-vendor a { color: var(--ink); text-decoration: none; }
.ar-due { font-size: .88rem; }

/* passport */
.passhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 14px; flex-wrap: wrap; }
.passhead.s-cleared { border-left-color: var(--ok); } .passhead.s-expiring { border-left-color: #d98b0b; }
.passhead.s-pending { border-left-color: var(--pend); } .passhead.s-not_cleared { border-left-color: var(--bad); }
.passhead h1 { margin-bottom: .25em; }
.passhead .cap { font-weight: 500; color: var(--muted); font-size: 1.1rem; }
.passhead p { margin: 0; }
.passstatus { text-align: right; display: grid; gap: 6px; justify-items: end; }
.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 7px 14px; margin: 0; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv.compact { font-size: .86rem; margin-bottom: 12px; }
.meter { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.meter label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--ink-2); width: 120px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.tbl tbody th { font-weight: 600; color: var(--ink-2); width: 34%; }
/* a due table colours the date and its day count only, in the status colours */
.duetable tr.due-overdue td:nth-child(2), .duetable tr.due-overdue td:nth-child(3) { color: var(--bad); font-weight: 600; }
.duetable tr.due-soon td:nth-child(2), .duetable tr.due-soon td:nth-child(3) { color: var(--warn); font-weight: 600; }
.tbl tr.changed { background: #fff8e8; }
.evidence td:first-child { width: 30%; }
.evidence.company { margin-top: 10px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; }
.tile b { font-size: 1.7rem; line-height: 1.1; }
.tile span { color: var(--muted); font-size: .86rem; }
.tile.s-cleared { border-top-color: var(--ok); } .tile.s-expiring { border-top-color: #d98b0b; }
.tile.s-pending { border-top-color: var(--pend); } .tile.s-not_cleared { border-top-color: var(--bad); }
.todo { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; font-size: .92rem; }
.todo li { padding-left: 14px; border-left: 3px solid var(--line); }
.todo li.lv-block { border-color: var(--bad); } .todo li.lv-warn { border-color: #d98b0b; }
.steps ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.steps li.done { color: var(--muted); text-decoration: line-through; }

/* document review */
.review { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pv { position: sticky; top: 76px; }
/* No border-radius on the PDF frame: a rounded clip blanks Chrome's out-of-process PDF viewer (seen 2026-10-13). */
.preview { width: 100%; height: calc(100vh - 150px); min-height: 420px; border: 1px solid var(--line); background: #fff; }
img.preview { height: auto; max-height: calc(100vh - 150px); border-radius: var(--radius); object-fit: contain; }
.verdict .actions { margin: 6px 0 0; }

/* landing */
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 36px; align-items: center; padding: 26px 0 34px; }
.hero h1 { font-size: 2.3rem; line-height: 1.12; letter-spacing: -.02em; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-card { display: grid; gap: 10px; }
.mini { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 3px; box-shadow: var(--shadow); }
.mini .badge { justify-self: start; }
.mini small { color: var(--muted); }
.legend { display: grid; gap: 8px; margin: 14px 0 20px; }
.legend .badge { min-width: 112px; text-align: center; margin-right: 8px; }
.rulebox { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }
.rulebox:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint-2); }
.rulebox p { margin: 0 0 4px; }

/* dossier (print) */
.dossier { max-width: 860px; margin: 0 auto; background: #fff; padding: 28px 34px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.dossier h1 { font-size: 1.35rem; }
.dossier h2 { font-size: 1rem; margin-top: 1.4em; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.dhead { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: .85rem; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 16px; color: var(--ink-2); }
.dhead > div:first-child { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dlogo { height: 26px; width: auto; aspect-ratio: 504 / 133; }
.tbl.sign td { color: var(--muted); font-size: .8rem; height: 42px; vertical-align: bottom; border-bottom: 1px solid var(--line); }
@media print {
  body { background: #fff; font-size: 12px; }
  .no-print, .topbar, .foot { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .dossier { border: 0; padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
  .tbl th, .tbl td { padding: 5px 6px; }
}

/* narrow screens */
@media (max-width: 900px) {
  .assetrow { grid-template-columns: 1fr auto; grid-template-areas: "main status" "vendor due"; }
  .ar-status { grid-area: status; justify-self: end; align-self: start; }
  .ar-main { grid-area: main; }
  .ar-vendor { grid-area: vendor; }
  .ar-due { grid-area: due; text-align: right; }
  .ar-vendor:empty { display: none; }
  .cols, .review, .hero, .grid3 { grid-template-columns: 1fr; }
  .pv { position: static; }
  .preview { height: 70vh; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  .brand-logo { height: 28px; }
  .brand { gap: 10px; }
  .brand .title { padding-left: 10px; font-size: .95rem; }
  .nav .who { display: none; }
  .topin { min-height: 56px; gap: 10px; }
  .nav { gap: 12px; font-size: .88rem; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.75rem; }
  .card { padding: 16px; }
  .passstatus { text-align: left; justify-items: start; }
  /* a machine in a fleet list: name and status on the first line, the next due date under them */
  .assetrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main status" "vendor vendor" "due due"; gap: 8px 12px; }
  .ar-due { text-align: left; }
  .filters label { min-width: 46%; }
  .tbl { font-size: .84rem; }
  .tbl th, .tbl td { padding: 7px 6px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}

/* Tables at phone width. A table built for the phone (.stack) turns each row into a block with
   each cell under its column name (data-label); any other table scrolls inside its own box, so a
   table never makes the page wider than the screen. */
@media (max-width: 600px) {
  .tbl:not(.register, .batchgrid, .stack) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: auto; }
  .tbl.stack thead { display: none; }
  .tbl.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl.stack tr:first-child { padding-top: 0; }
  .tbl.stack td { border: 0; padding: 2px 0; white-space: normal; text-align: left; }
  .tbl.stack td:empty { display: none; } /* no label over nothing */
  .tbl.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  /* the machine record's evidence: name and check on one line, then what is on file, then links */
  .tbl.evidence tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; }
  .tbl.evidence td { width: auto !important; }
  .tbl.evidence td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .tbl.evidence td:nth-child(2), .tbl.evidence td:nth-child(4) { grid-column: 1 / -1; }
  /* a company: name and status on one line, the counts beside each other */
  .tbl.companies tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .tbl.companies td.co-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .tbl.companies td:nth-child(2), .tbl.companies td:nth-child(3) { grid-column: 1 / -1; }
  .tbl.companies td.num a { display: inline-block; min-width: 40px; padding: 4px 0; font-weight: 600; }
  .tbl.users .rolepick { display: flex; gap: 8px; flex-wrap: wrap; }
  /* a due item: what, when and in how many days on one line, the basis under it */
  .tbl.duetable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 12px; }
  .tbl.duetable td.num::after { content: " days"; }
  .tbl.duetable td:nth-child(4) { grid-column: 1 / -1; }
  .dossier { padding: 18px 16px; }
}

/* settings */
.rolepick select { width: auto; min-height: 34px; padding: 4px 8px; }
.compgrid td { vertical-align: middle; }
.compgrid input[type="number"] { max-width: 120px; }

/* the registers: the search box first, then one table; at phone width each row is a card */
.lookup { margin: 0 0 16px; }
.lookup label { display: block; font-weight: 700; font-size: .9rem; color: var(--ink-2); margin-bottom: 6px; }
.lookup-row { display: flex; gap: 8px; }
.lookup input[type="search"] { font-size: 1.15rem; min-height: 50px; padding: 10px 14px; border-width: 2px; border-color: var(--brand); }
.lookup .btn { min-height: 50px; flex: none; }
.filterbox { margin-bottom: 14px; }
.filterbox > summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; padding: 4px 0 8px; }
.filterbox .filters { margin-bottom: 0; }
.regwrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.tbl.register { font-size: .88rem; }
/* At 1280 px all ten equipment columns fit their box: headings and text wrap onto more lines, a
   date never breaks, and the Tick column keeps room for its badge. Narrower than that the table
   scrolls inside .regwrap; at phone width it turns into cards (below). */
.tbl.register th, .tbl.register td { padding: 8px 8px; }
.tbl.register thead th { background: var(--line-2); vertical-align: bottom; }
.tbl.register td { overflow-wrap: break-word; }
.tbl.register td.datecell, .tbl.register td[data-label="Plates"] { white-space: nowrap; } /* a date or a plate reads on one line */
.tbl.register td.tickcell { min-width: 150px; }
.tbl.register tbody tr:hover td { background: #fafbfd; }
.tbl.register .reclink { font-weight: 650; color: var(--ink); text-decoration: none; }
.tbl.register .reclink:hover { color: var(--brand); text-decoration: underline; }
.pid { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; color: var(--muted); letter-spacing: .02em; }
.eyebrow .pid, p .pid { display: inline; }
.tickcell .until { display: block; font-size: .8rem; color: var(--ink-2); margin-top: 3px; }
.tickcell .why { display: block; font-size: .78rem; color: var(--ink-2); margin-top: 3px; white-space: normal; max-width: 280px; }
.na { color: var(--muted); font-style: italic; }
.tbl.register.queue td { white-space: normal; }

@media (max-width: 760px) {
  .lookup input[type="search"] { font-size: 1.05rem; }
  .regwrap { background: none; border: 0; overflow: visible; }
  .tbl.register, .tbl.register tbody, .tbl.register tr, .tbl.register td { display: block; width: 100%; }
  .tbl.register thead { display: none; }
  .tbl.register tr { background: #fff; border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius); margin-bottom: 10px; padding: 8px 12px; }
  .tbl.register tr.row-cleared { border-left-color: var(--ok); } .tbl.register tr.row-expiring { border-left-color: #d98b0b; }
  .tbl.register tr.row-pending { border-left-color: var(--pend); } .tbl.register tr.row-not_cleared { border-left-color: var(--bad); }
  /* the column name on the left, everything in the cell on the right, however many parts it has */
  .tbl.register td { display: grid; grid-template-columns: 42% minmax(0, 1fr); column-gap: 8px; border: 0; padding: 3px 0; white-space: normal; }
  .tbl.register td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; grid-column: 1; grid-row: 1 / span 6; }
  .tbl.register td > * { grid-column: 2; justify-self: start; }
  .tbl.register td::before { white-space: normal; } /* a date cell keeps its date on one line, not its label */
  .tbl.register td.num { text-align: left; }
  .tbl.register td.tickcell { min-width: 0; }
  .tbl.register tbody tr:hover td { background: none; }
}

/* the one-screen check and the person record */
.checkdoc .review { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.checkdoc .pv { position: static; }
.checkdoc .preview { height: 520px; min-height: 0; }
.checkdoc .verdict { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.tbl.fields tbody th { width: 40%; }
.checklist { margin: 8px 0; padding-left: 18px; }
.acceptbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; border-color: var(--brand); box-shadow: 0 -2px 10px rgba(16, 24, 40, .08); }
.acceptbar p { margin: 0; flex: 1; min-width: 220px; }
.certblock { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 12px; }
.certblock:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.certhead { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); margin-top: 0; }
.passstatus > div { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
@media (max-width: 900px) {
  .checkdoc .review { grid-template-columns: 1fr; }
  .checkdoc .preview { height: 60vh; }
  .passstatus > div { justify-content: flex-start; }
}

/* outbox */
.mailbody, .mailtext { white-space: pre-wrap; overflow-wrap: anywhere; font: .93rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 0; }
.mailhtml { display: block; width: 100%; min-height: 360px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* bulk upload: the review grid. At 1280 px a row's values fit the card on one line, with its
   certificates and what to check on the line below; between phone and laptop width the grid
   scrolls inside its own box (the page never does); at phone width each row is a card. */
.gridwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tbl.batchgrid { font-size: .84rem; table-layout: fixed; min-width: 980px; }
.tbl.batchgrid th { background: var(--line-2); vertical-align: bottom; padding: 7px 5px; }
.tbl.batchgrid th .sub { display: block; }
.tbl.batchgrid td { padding: 6px 5px; }
.tbl.batchgrid :is(input:where(:not([type="checkbox"], [type="radio"])), select) { width: 100%; min-width: 0; min-height: 34px; padding: 5px 6px; font-size: .84rem; border-radius: 6px; }
.tbl.batchgrid .gf + .gf { margin-top: 5px; }
.tbl.batchgrid .gv { display: block; overflow-wrap: anywhere; }
/* column widths: the first row of a fixed table sets them */
.batchgrid th.c-row { width: 11%; }
/* equipment: a date input needs about 88 px for dd/mm/yyyy, the type select about 220 px for its longest type */
.g-equipment th.c-equipment { width: 19%; } .g-equipment th.c-model { width: 14%; } .g-equipment th.c-plate { width: 11%; } .g-equipment th.c-capacity { width: 10%; }
.g-equipment th:is(.c-inspection_date, .c-next_inspection, .c-mot, .c-insurance) { width: 8.75%; }
.g-personnel th.c-row { width: 11%; } .g-personnel th.c-name { width: 22%; } .g-personnel th.c-competency { width: 19%; }
.g-personnel th:is(.c-training_date, .c-validity, .c-site) { width: 11%; } .g-personnel th.c-refresher { width: 15%; }
input.bad, select.bad { border-color: var(--bad); background: var(--bad-bg); }
.tbl.batchgrid .edited { border-color: var(--brand); background: var(--brand-tint); }
.tbl.batchgrid .guess { border-color: #d98b0b; background: var(--warn-bg); }
.tbl.batchgrid tbody.brow tr:first-child td { border-bottom: 0; }
.tbl.batchgrid tbody.brow td { box-shadow: none; }
.tbl.batchgrid tbody.b-attention td:first-child { box-shadow: inset 4px 0 var(--bad); }
.tbl.batchgrid tbody.b-ready td:first-child { box-shadow: inset 4px 0 var(--ok); }
.tbl.batchgrid tbody.b-saved td:first-child { box-shadow: inset 4px 0 var(--pend); }
/* the row's second line: its certificates, then what to check, held in view if the grid scrolls */
.tbl.batchgrid tr.issuerow td { padding-top: 0; border-bottom: 1px solid var(--line); }
.issuebox { position: sticky; left: 10px; max-width: calc(100vw - 96px); display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: flex-start; }
.rowcerts { flex: 0 1 380px; min-width: 0; overflow-wrap: anywhere; display: grid; gap: 4px; }
.rowcheck { flex: 1 1 420px; min-width: 0; }
.rowcerts::before, .rowcheck::before { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.rowcerts::before { content: "Certificates"; }
.rowcheck::before { content: "What to check"; }
.filelist { display: grid; gap: 10px; margin-bottom: 12px; }
.fileitem { border: 1px solid var(--line); border-left: 4px solid #d98b0b; border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }
.filehead { overflow-wrap: anywhere; }
.fileact { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.fileact label { flex: 1; min-width: 200px; display: grid; gap: 4px; font-weight: 600; color: var(--ink-2); }
.notice, .issues li { overflow-wrap: anywhere; }
.tbl.batchgrid td.rowref { padding-left: 10px; }
.bpill { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.p-ready { background: var(--ok-bg); color: var(--ok); } .p-attention { background: var(--bad-bg); color: var(--bad); } .p-saved { background: var(--pend-bg); color: var(--pend); }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .84rem; }
.card > .issues { margin-bottom: 14px; }
.issues li { padding-left: 8px; border-left: 3px solid var(--line); }
.issues li.lv-block { border-color: var(--bad); color: #7d1810; }
.issues li.lv-warn { border-color: #d98b0b; }
.issues li.lv-note { color: var(--ink-2); }
.issues li.lv-ok { border-color: var(--ok); color: var(--ok); }
label.drop { display: flex; gap: 4px; align-items: center; color: var(--muted); margin-top: 4px; font-weight: 500; }
progress { width: 100%; height: 14px; accent-color: var(--brand); }
.progress-count { font-size: 1.15rem; }
details.card > summary { cursor: pointer; }
.sheetmap { border-top: 1px solid var(--line-2); padding-top: 12px; margin-top: 12px; }
.mapgrid select { min-height: 34px; padding: 4px 8px; }
/* phone: each row of the review grid is a card, every field on its own line with its name beside
   it, every control full width and tall enough for a thumb */
@media (max-width: 760px) {
  .gridwrap { overflow: visible; }
  .tbl.batchgrid, .tbl.batchgrid tbody, .tbl.batchgrid tr, .tbl.batchgrid td { display: block; width: 100%; }
  .tbl.batchgrid { min-width: 0; table-layout: auto; font-size: .9rem; }
  .tbl.batchgrid thead { display: none; }
  .tbl.batchgrid tbody.brow { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; }
  .tbl.batchgrid tbody.b-attention { border-left-color: var(--bad); } .tbl.batchgrid tbody.b-ready { border-left-color: var(--ok); } .tbl.batchgrid tbody.b-saved { border-left-color: var(--pend); }
  .tbl.batchgrid tbody.brow td, .tbl.batchgrid tr.issuerow td { padding: 0; border: 0; box-shadow: none; }
  .tbl.batchgrid td.rowref { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 0 0 6px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
  .tbl.batchgrid label.drop { margin: 0 0 0 auto; min-height: 40px; padding: 0 4px; }
  .tbl.batchgrid .gf, .tbl.batchgrid .gf + .gf { display: grid; gap: 3px; margin: 10px 0 0; }
  .tbl.batchgrid .gf::before { content: attr(data-label); color: var(--ink-2); font-size: .82rem; font-weight: 600; line-height: 1.25; }
  .tbl.batchgrid tbody.brow td:first-child { box-shadow: none; }
  .tbl.batchgrid :is(input:where(:not([type="checkbox"], [type="radio"])), select) { min-height: 42px; font-size: 1rem; }
  .issuebox { position: static; max-width: none; display: grid; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
  .rowcerts, .rowcheck { flex: none; }
  .tbl.batchgrid .takeoff { min-height: 36px; padding: 0 6px; }
  .tbl.batchgrid :is(.rowcert, .issues) a { display: inline-block; padding: 6px 0; }
}
@media (max-width: 600px) {
  .batchtiles .tile b { font-size: 1.3rem; }
  /* On a phone the confirm bar sits at the end of the page instead of covering the grid. */
  .acceptbar { position: static; }
}
.p-nothing { background: var(--line-2); color: var(--muted); }

/* A8: the name on a competency certificate beside the person, on the check screen. */
.holdername mark { background: #fde3a7; color: inherit; padding: 0 3px; border-radius: 3px; font-weight: 600; }
