:root {
  --bg: #070707;
  --card: #0e0e0e;
  --line: #262626;
  --text: #ececec;
  --muted: #8d8d8d;
  --accent: #ff9a52;
  --ok: #6fd39a;
  --warn: #f2c14e;
  --bad: #ff6b6b;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --pixel: "Pixelify Sans", var(--mono);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--mono); }
a { color: var(--ok); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }

.wrap { max-width: 600px; margin: 0 auto; padding: 0 16px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.brand { color: var(--text); font-weight: 600; letter-spacing: .02em; }
.brand .mark { color: var(--accent); }
.langs { display: flex; gap: 6px; }
.langs a { border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; font-size: 12px; color: var(--muted); }
.langs a.on { border-color: var(--accent); color: var(--text); }

.kicker { text-align: center; color: var(--accent); font-size: 12px; letter-spacing: .2em; margin: 0 0 6px; }
h1 { font-family: var(--pixel); font-size: clamp(26px, 7vw, 36px); line-height: 1.15; text-align: center; margin: 0 0 10px; }
h2 { font-family: var(--pixel); font-size: 18px; margin: 0 0 14px; }
.lead { text-align: center; color: var(--muted); margin: 0 auto 24px; max-width: 520px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.rows { padding: 6px 18px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row span { color: var(--muted); }
.row strong { font-weight: 400; text-align: right; }

.status i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 8px; vertical-align: middle; }
.status-active { color: var(--ok); }
.status-inactive { color: var(--muted); }
.status-lost { color: var(--warn); }
.status-disabled { color: var(--bad); }

.banner { border: 1px solid; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.banner-ok { color: var(--ok); background: #6fd39a12; }
.banner-inactive { color: var(--muted); }
.banner-lost { color: var(--warn); background: #f2c14e12; }
.banner-disabled { color: var(--bad); background: #ff6b6b12; }

.product img { width: 100%; border-radius: 10px; display: block; margin-bottom: 12px; }
.product p { margin: 0; }

.cta { display: block; text-align: center; background: var(--accent); color: #140a02; font-weight: 600; border-radius: 14px; padding: 14px; margin-bottom: 16px; }
.cta:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { display: block; text-align: center; border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--text); margin-bottom: 16px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 1px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; padding-bottom: 18px; display: grid; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline b { font-weight: 400; }
.timeline small { color: var(--muted); font-size: 12px; }

.qr-card { text-align: center; }
.qr { width: 190px; margin: 0 auto 10px; background: #fff; border-radius: 10px; padding: 6px; }
.qr svg { display: block; width: 100%; height: auto; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.note { border-left: 2px solid var(--ok); padding: 2px 0 2px 14px; color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.foot { text-align: center; color: #555; font-size: 11px; margin-top: 24px; }

.ledger dl { display: grid; grid-template-columns: 60px 1fr; gap: 4px 12px; margin: 0; font-size: 12px; }
.ledger dt { color: var(--muted); }
.ledger dd { margin: 0; word-break: break-all; }
.ledger.bad { border-color: var(--bad); }

.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; min-width: 0; }

/* ------------------------------------------------ formulaires & admin */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: #050505; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
button, .btn { background: var(--accent); color: #140a02; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; display: inline-block; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-sec { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn-sm { padding: 6px 10px; font-size: 13px; }

.admin .wrap { max-width: 1040px; }
.admin h1 { text-align: left; font-size: 26px; }
.admin-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.admin-nav a { color: var(--muted); }
.admin-nav a.on { color: var(--text); }
.inline { display: inline; margin: 0; }
.link-btn { background: none; color: var(--muted); padding: 0; font-weight: 400; }

.flash { color: var(--ok); border: 1px solid var(--ok); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }
.error { color: var(--bad); border: 1px solid var(--bad); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 24px; font-family: var(--pixel); }
.stat span { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 400; background: var(--card); }
tr:last-child td { border-bottom: 0; }
td.title { white-space: normal; min-width: 160px; }
.pill { border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; font-size: 12px; color: var(--muted); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { color: var(--muted); font-size: 13px; }
.field small { color: #666; font-size: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.side .qr { width: 100%; }
.urlbox { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.urlbox code { flex: 1; background: #050505; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }

.print-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.print-sheet .label { background: #fff; color: #000; border-radius: 8px; padding: 10px; text-align: center; font-size: 11px; }
.print-sheet .label .qr { width: 100%; padding: 0; margin: 0 0 4px; }
@media print {
  body, html { background: #fff; }
  .no-print { display: none !important; }
  .print-sheet .label { border: 1px dashed #bbb; break-inside: avoid; }
}

@media (max-width: 760px) {
  .split, .grid2 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------ écriture NFC */
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.check input { width: auto; }
.nfc-panel .nfc-current { font-size: 22px; margin: 4px 0 14px; }
.nfc-panel .nfc-go { font-size: 17px; padding: 14px 20px; }
.nfc-status { margin: 10px 0 0; font-size: 14px; }
.nfc-status:empty { display: none; }
.nfc-status.wait { color: var(--accent); }
.nfc-status.ok { color: var(--ok); }
.nfc-status.ko { color: var(--bad); }
.nfc-row.current td { background: #ff9a5214; }
button:disabled { opacity: .5; cursor: wait; }
