/* ProdID-Check: light sky blue, white cards, brass-gold outlines, signal red for reports. */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500&family=Instrument+Sans:wght@400;500;600&display=swap");

:root {
  --chalk: #eaf4fd; --paper: #ffffff; --ink: #0e2742; --ink-2: #44586f; --steel: #bcd6ee;
  --thread: #a97f2e; --signal: #b8261e; --signal-tint: #f8e7e5; --ok: #1d6a50; --ok-tint: #e3f0ea;
  --on-ink: #ffffff; --sky: #0b6fc2; --sky-2: #095a9e; --sky-soft: #cfe6fa;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--chalk); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2, h3 { margin: 0; font-weight: 500; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--thread); outline-offset: 2px; }

/* ---------- top bar and tabs (staff screens) ---------- */
header.top { display: flex; align-items: center; gap: 14px; padding: 14px clamp(16px, 4vw, 40px); background: var(--paper); color: var(--ink); border-bottom: 2px solid var(--thread); box-shadow: 0 6px 20px -12px rgba(11,111,194,.35); }
.mark { display: flex; align-items: center; gap: 10px; font: 600 22px/1 var(--display); letter-spacing: .01em; flex: 1; }
.mark svg { width: 30px; height: 35px; flex: none; }
#who { font-size: 15px; font-weight: 500; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header.top button.link { color: var(--sky); opacity: 1; }

nav.tabs { display: flex; gap: 4px; padding: 0 clamp(16px, 4vw, 40px); background: var(--paper); border-bottom: 1px solid var(--steel); overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button { flex: none; padding: 14px 14px 12px; background: none; color: var(--ink-2); border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-weight: 500; }
nav.tabs button:hover { color: var(--ink); }
nav.tabs button[aria-current="page"] { color: var(--sky); border-bottom-color: var(--thread); }
nav.tabs button { border-radius: 0; background: none; border-top: 0; border-left: 0; border-right: 0; }
nav.tabs button:hover { background: none; }

main { max-width: 980px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 96px; }

/* ---------- sheets (one task each) ---------- */
.card { background: var(--paper); border: 1.5px solid var(--thread); border-radius: 14px; padding: clamp(18px, 3vw, 32px); margin: 0 0 24px; }
.card h2 { font: 700 clamp(24px, 3.4vw, 32px)/1.15 var(--display); margin-bottom: 10px; }
.card.narrow { max-width: 460px; margin-inline: auto; }
.card form { max-width: 560px; }
.hint { color: var(--ink-2); font-size: 14px; max-width: 62ch; margin: 0 0 18px; }
.sub { font-weight: 600; margin: 22px 0 8px; }

/* ---------- forms ---------- */
label { display: block; margin: 0 0 16px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
label.check { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; font-weight: 400; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; min-height: 44px; font: 400 16px var(--sans); color: var(--ink); background: #f6fafe; border: 1.5px solid var(--steel); border-radius: 12px; }
input:focus, select:focus { border-color: var(--sky); outline: 2px solid var(--thread); outline-offset: 0; }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sky); flex: none; }
input[type=file] { padding: 9px; }

button { min-height: 44px; padding: 10px 22px; font: 600 15px var(--sans); color: var(--on-ink); background: var(--sky); border: 2px solid var(--thread); border-radius: 999px; cursor: pointer; }
button:hover { background: var(--sky-2); filter: none; }
button:active { transform: translateY(1px); }
button.secondary, button[data-scan], #unflagBtn { color: var(--sky); background: #fff; border-color: var(--thread); }
button.secondary:hover, button[data-scan]:hover, #unflagBtn:hover { background: var(--sky-soft); }
button.danger { background: var(--signal); border-color: var(--signal); color: #fff; }
button.danger:hover { background: #8f1d17; }
button.link { min-height: 0; padding: 4px 0; background: none; color: var(--sky); border: 0; border-radius: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
button[data-scan] { min-height: 36px; margin-top: 8px; padding: 6px 14px; font-size: 14px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- messages ---------- */
.status { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 3px; font-size: 15px; font-weight: 500; box-shadow: 0 6px 24px rgb(0 0 0 / .28); }
.status:empty { display: none; }
.status.ok { background: var(--ok); color: #fff; }
.status.bad { background: var(--signal); color: #fff; }

/* ---------- codes: a stitched label ---------- */
.code { display: inline-block; margin-top: 14px; padding: 12px 18px; font: 500 20px/1.35 var(--mono); letter-spacing: .06em; word-break: break-all; background: var(--chalk); outline: 1.5px dashed var(--thread); outline-offset: -6px; }
.qr { width: 168px; margin: 14px 0 6px; padding: 10px; background: #fff; border: 1px solid var(--steel); }
.qr svg { display: block; width: 100%; height: auto; }

/* ---------- tables, pills, timeline ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 8px 10px; font-weight: 600; font-size: 13px; color: var(--ink-2); border-bottom: 2px solid var(--thread); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--steel); vertical-align: middle; }
td.mono, .mono { font: 400 13px var(--mono); letter-spacing: .03em; white-space: nowrap; }
tr:hover td { background: color-mix(in srgb, var(--chalk) 70%, transparent); }
tr.flagged td { background: var(--signal-tint); }
td.empty { color: var(--ink-2); padding: 28px 10px; text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--steel); }
.pill.registered::before { background: var(--ink-2); }
.pill.dispatched::before { background: var(--thread); }
.pill.in_store::before { background: var(--ink); }
.pill.sold::before { background: var(--ok); }
.pill.flag { color: var(--signal); }
.pill.flag::before { background: var(--signal); }

.alert { padding: 12px 14px; margin: 12px 0; border-radius: 0 10px 10px 0; border-left: 4px solid var(--signal); background: var(--signal-tint); font-weight: 500; }
.facts { margin: 14px 0; padding: 0; list-style: none; }
.facts li { padding: 8px 0; border-bottom: 1px solid var(--steel); }
.facts b { display: inline-block; min-width: 132px; font-weight: 600; color: var(--ink-2); }
.timeline { margin: 14px 0 0; padding: 0 0 0 18px; list-style: none; border-left: 2px solid var(--steel); }
.timeline li { position: relative; padding: 0 0 14px 14px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); border: 2px solid var(--thread); }
.timeline time { display: block; font-size: 12px; color: var(--ink-2); }

video { width: 100%; max-width: 320px; margin-top: 8px; border-radius: 3px; }
.photos img { width: 100%; max-width: 240px; margin: 6px 6px 0 0; border: 1px solid var(--steel); }

/* ---------- public verify page: the hangtag ---------- */
body.verify { min-height: 100vh; background: linear-gradient(180deg, #d4eafc 0%, var(--chalk) 60%); }
.stage { max-width: 520px; margin: 0 auto; padding: 28px 16px 72px; }
.brandline { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 78px; font: 600 20px var(--display); color: var(--ink); }
.brandline svg { width: 26px; height: 30px; }

.tag { position: relative; margin: 0 auto 36px; max-width: 400px; padding: 52px 30px 34px; background: var(--paper); border: 2px solid var(--thread); border-radius: 18px; box-shadow: 0 1px 0 var(--steel), 0 18px 40px -20px rgb(20 28 60 / .35); text-align: center; }
.tag::before { content: ""; position: absolute; top: 16px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--chalk); border: 1px solid var(--steel); box-shadow: inset 0 2px 3px rgb(0 0 0 / .18); }
.tag::after { content: ""; position: absolute; top: -52px; left: 50%; width: 74px; height: 70px; margin-left: -37px; border: 2px solid var(--thread); border-bottom: 0; border-radius: 74px 74px 0 0; }
.tag .stitch { position: absolute; inset: 9px; border: 1.5px dashed var(--steel); border-radius: 4px; pointer-events: none; }
.tag > * { position: relative; }
.tag h1 { font: 700 clamp(28px, 7vw, 34px)/1.12 var(--display); margin-bottom: 8px; }
.tag .hint { margin: 0 auto 20px; }
.tag form { margin: 0 auto; max-width: none; text-align: left; }
.tag input#code { text-align: center; font: 500 16px var(--mono); letter-spacing: .06em; }
.tag button[type=submit] { width: 100%; }

#result { margin-top: 26px; padding-top: 24px; border-top: 1.5px dashed var(--steel); }
#result[hidden] { display: none; }
.seal { display: block; width: 92px; height: 92px; margin: 0 auto 12px; }
.seal.stamp { animation: stamp .42s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes stamp { from { transform: scale(1.5) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .seal.stamp { animation: none; } }
.verdict { margin: 0 0 6px; font: 600 26px/1.15 var(--display); }
.verdict.yes { color: var(--ok); } .verdict.no { color: var(--signal); }
#result h2 { font: 600 24px/1.2 var(--display); margin: 14px 0 4px; }
#result p { margin: 6px 0; }
.tag.is-reported { border-top: 6px solid var(--signal); }
.tag.is-reported::after { border-color: var(--signal); }

.owner-tools { max-width: 400px; margin: 0 auto; }
.owner-tools details { border-top: 1px solid var(--steel); }
.owner-tools details:last-child { border-bottom: 1px solid var(--steel); }
.owner-tools summary { cursor: pointer; padding: 16px 4px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.owner-tools summary::-webkit-details-marker { display: none; }
.owner-tools summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--ink-2); }
.owner-tools details[open] summary::after { content: "–"; }
.owner-tools .body { padding: 0 4px 22px; }
.owner-tools .body > p.hint { margin-bottom: 16px; }

@media (max-width: 560px) {
  .facts b { display: block; min-width: 0; }
  .tag { padding-inline: 20px; }
}
#lookupOut { margin-top: 14px; }

sup.copy { font: 400 .5em/1 var(--sans); margin-left: 2px; vertical-align: super; opacity: .8; }
footer.legal { max-width: 980px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 36px; font-size: 12.5px; color: var(--ink-2); text-align: center; }
body.verify footer.legal { max-width: 520px; padding-inline: 16px; }

.print-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.print-row select { max-width: 230px; }
#printArea { display: none; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  html, body { background: #fff !important; margin: 0; }
  #printArea { display: block !important; }
  #printArea img { display: block; image-rendering: pixelated; }
}
.custom-size input { width: 90px; }

dialog#scanDlg { width: min(640px, 94vw); max-height: 92vh; overflow: auto; padding: 22px; border: 2px solid var(--thread); border-radius: 18px; background: var(--paper); color: var(--ink); }
dialog#scanDlg::backdrop { background: rgb(27 37 71 / .55); }
.scan-head { display: flex; justify-content: space-between; align-items: center; }
.scan-head h2 { margin: 0; }
.scan-modes { display: flex; gap: 8px; margin: 12px 0; }
.scan-modes button { flex: 1; color: var(--sky); background: #fff; border-color: var(--thread); }
.scan-modes button[aria-pressed="true"] { color: #fff; background: var(--sky); }
#scanIn { width: 100%; box-sizing: border-box; font: 500 20px var(--mono); padding: 16px; margin-bottom: 12px; }
.scan-log { list-style: none; margin: 14px 0 0; padding: 0; font-size: 15px; }
.scan-log li { padding: 8px 10px; border-left: 4px solid var(--steel); margin-bottom: 6px; background: rgb(0 0 0 / .03); }
.scan-log li.ok { border-color: var(--ok); } .scan-log li.bad { border-color: var(--signal); color: var(--signal); }
.scan-log time { color: var(--steel-text, #5b6070); margin-right: 10px; font: 13px var(--mono); }
.scan-head .link { color: var(--sky); border-color: var(--thread); }

pre.snippet { margin: 6px 0 14px; padding: 12px 14px; overflow-x: auto; font: 13px/1.5 var(--mono); background: rgb(0 0 0 / .05); border-left: 3px solid var(--thread); white-space: pre-wrap; word-break: break-all; }
.code.key { word-break: break-all; font-size: 14px; }

.brandbar { text-align: center; margin: -8px 0 34px; padding-bottom: 14px; border-bottom: 1px solid var(--steel); }
.brandbar small { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.brandbar strong { display: block; margin-top: 4px; font: 600 30px/1.1 var(--display); color: var(--ink); }
.badge-preview { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; }
.badge-preview > div { padding: 18px; border: 1px solid var(--steel); }
.badge-preview .on-dark { background: #1B2547; }
.badge-preview img { display: block; height: 56px; width: auto; }

/* ---------- verify page: camera scan ---------- */
.scan-btn { width: 100%; margin-bottom: 14px; }
#scanPanel { margin-bottom: 14px; }
#scanVideo { width: 100%; max-height: 52vh; background: #000; object-fit: cover; border: 2px solid var(--thread); border-radius: 12px; }

/* ---------- suspicious goods reports ---------- */
textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; min-height: 88px; font: 400 16px var(--sans); color: var(--ink); background: #f6fafe; border: 1.5px solid var(--steel); border-radius: 12px; resize: vertical; }
textarea:focus { border-color: var(--sky); outline: 2px solid var(--thread); outline-offset: 0; }
.sus-item { border: 1.5px solid var(--steel); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 8px; }
.sus-item.is-new { border-color: var(--sky); border-left-width: 5px; }
.sus-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.sus-head select { width: auto; margin: 0 0 0 auto; min-height: 36px; padding: 6px 10px; }
.sus-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.sus-photo { width: 140px; height: 140px; object-fit: cover; border: 1px solid var(--steel); background: var(--chalk); cursor: zoom-in; }
.loc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 14px 0; }
.loc-row button { width: auto; }

.report-open { width: 100%; margin-top: 18px; }
#sOut { margin-top: 14px; }
