/* NFC de Fábrica — estilo comum da ativação e do painel (balcão: preto, dourado, papel) */
:root {
  --bg: #f4f2ee; --surface: #ffffff; --ink: #16140f; --muted: #6d675c; --line: #e2ddd3;
  --gold: #9a6a00; --gold-strong: #c99300; --on-gold: #16140f;
  --ok: #1f7a3f; --ok-bg: #e3f3e8; --warn: #8a5a00; --warn-bg: #fbf0d6; --bad: #a3261d; --bad-bg: #fbe4e1; --chip: #f0ece4;
  --font: "Archivo", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110f; --surface: #1c1a17; --ink: #f2eee6; --muted: #a39b8c; --line: #322e28;
    --gold: #e8b640; --gold-strong: #e8b640; --on-gold: #16140f;
    --ok: #6fd08f; --ok-bg: #173323; --warn: #f0c560; --warn-bg: #3a2e12; --bad: #ff8a7d; --bad-bg: #3d1a16; --chip: #27241f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: max(16px, env(safe-area-inset-top, 0px)); padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
}
.wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.wrap.wide { max-width: 1180px; }
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top .grow { flex: 1; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.1; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
h2 { margin: 0; font-size: 18px; font-weight: 800; }
h3 { margin: 0; font-size: 15px; font-weight: 800; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 70px; }
input.code { font-family: var(--mono); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: 22px; text-align: center; }
:focus-visible { outline: 2px solid var(--gold-strong); outline-offset: 2px; }
button {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); padding: 11px 16px; min-height: 44px;
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--gold-strong); border-color: var(--gold-strong); color: var(--on-gold); }
button.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.link { border: 0; background: none; padding: 4px 0; min-height: 0; color: var(--gold); text-decoration: underline; }
button.sm { padding: 6px 10px; font-size: 13px; min-height: 34px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.stretch > * { flex: 1 1 auto; }
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chip-btn { padding: 12px 8px; font-size: 14px; text-align: center; }
.chip-btn[aria-pressed="true"] { border-color: var(--gold-strong); box-shadow: 0 0 0 1px var(--gold-strong) inset; background: var(--warn-bg); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); white-space: nowrap; }
.pill.estoque { background: var(--chip); color: var(--muted); }
.pill.ativa { background: var(--ok-bg); color: var(--ok); }
.pill.bloqueada { background: var(--bad-bg); color: var(--bad); }
.msg { font-size: 14px; font-weight: 600; padding: 10px 12px; border-radius: 10px; background: var(--chip); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }
.mono { font-family: var(--mono); letter-spacing: .06em; }
.big-code { font: 800 34px/1 var(--mono); letter-spacing: .2em; text-align: center; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs button { white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.video-box { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 1; max-width: 100%; }
.video-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-box .aim { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.sep { height: 1px; background: var(--line); }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.overlay .card { width: 100%; max-width: 560px; max-height: 100%; overflow: auto; }
details > summary { cursor: pointer; font-weight: 700; }
