/* LORS V2.0 — styles communs. Thèmes clair et sombre par variables CSS. */
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root, [data-theme="clair"] {
  --bg: #F4F5F7; --surface: #FFFFFF; --border: #E3E6EB; --chip: #F0F2F5; --track: #E9ECF0;
  --text: #14171C; --muted: #5B6472;
  --accent: #1F5FD1; --accent-hover: #174AA6; --on-accent: #FFFFFF; --accent-soft: #E8EFFC;
  --warn: #A14A06; --warn-soft: #FDF1E3; --ok: #157A3A; --ok-soft: #E6F4EA; --danger: #B42318; --danger-soft: #FDECEA;
  --focus: #1F5FD1;
  color-scheme: light;
}
[data-theme="sombre"] {
  --bg: #0D1015; --surface: #151A21; --border: #262D37; --chip: #202733; --track: #262D37;
  --text: #E8ECF1; --muted: #9AA4B2;
  --accent: #7AA5FF; --accent-hover: #A9C4FF; --on-accent: #0D1015; --accent-soft: #1A2740;
  --warn: #F0A54A; --warn-soft: #2B2013; --ok: #4CC47A; --ok-soft: #12291B; --danger: #F4877D; --danger-soft: #331917;
  --focus: #A9C4FF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; background: var(--bg); color: var(--text); }
h1, h2, h3 { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 600; margin: 0; line-height: 1.2; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-danger { color: var(--danger); } .tone-accent { color: var(--accent); } .tone-muted { color: var(--muted); }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--chip); color: var(--text); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; }
.btn-icon.btn-outline { border-color: var(--border); background: var(--surface); }
.btn-icon:hover { background: var(--chip); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; }
input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="number"], select, textarea {
  min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; width: 100%;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.notice { padding: 12px 14px; border-radius: 10px; margin: 0; font-weight: 500; }
.notice-danger { background: var(--danger-soft); color: var(--danger); }
.chip { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 500; }

/* Coquille : menu + contenu (le menu passe au-dessus sur téléphone) */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 1 1 272px; max-width: 100%; background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-center { justify-content: center; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 18px; }
.brand-mark-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 26px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-family: "Space Grotesk", sans-serif; font-size: 20px; letter-spacing: .04em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav-link:hover { background: var(--chip); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link > span { flex: 1; }
.nav-link.is-soon { color: var(--muted); cursor: default; }
.nav-link.is-soon:hover { background: transparent; }
.nav-link em { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.sync-pill { padding: 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 4px 0 8px; }
.me-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.me-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { font-size: 12px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.topbar-title { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.topbar-title h1 { font-size: 30px; }
.topbar-title p { margin: 0; }
.search { flex: 0 1 360px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.search input { border: 0; padding: 0; min-height: 0; background: transparent; box-shadow: none; }
.search input:disabled { cursor: not-allowed; }
.theme-form { margin: 0; }
[data-theme="clair"] .when-dark, [data-theme="sombre"] .when-light { display: none; }
.when-light, .when-dark { display: inline-flex; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.grow-2 { flex: 2 1 520px; }
.grow-1 { flex: 1 1 300px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { padding: 20px; gap: 8px; }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: "Space Grotesk", sans-serif; font-size: 34px; font-weight: 600; line-height: 1.1; }
.kpi-hint { font-size: 12px; color: var(--muted); }
.empty { margin: 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px; }
.table td { padding: 12px 8px; border-top: 1px solid var(--border); }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.alerts li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--warn-soft); }
.alerts li span { flex: 1; font-weight: 500; }
.alerts li strong { color: var(--warn); font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* Pages simples : connexion, erreurs */
.bare-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px 32px; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.login-card h1 { font-size: 26px; }
.login-card > p { margin: 0; }
.login-card .foot { font-size: 12px; text-align: center; margin-top: 8px; }

@media (max-width: 640px) {
  .main { padding: 20px 16px; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .search { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Lot 2 ---------- */
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sidebar-top .brand { color: var(--text); }
.sidebar-body { display: flex; flex-direction: column; gap: 24px; flex: 1; }
.menu-toggle { display: none; }
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); border-radius: 8px; }
.me-link:hover { color: var(--text); }
@media (max-width: 900px) {
  .sidebar { flex-basis: 100%; padding: 16px; gap: 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .menu-toggle { display: inline-flex; }
  .js .sidebar-body { display: none; }
  .js .sidebar.is-open .sidebar-body { display: flex; }
}
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); font-weight: 500; }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs a.is-active, .tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { min-width: 180px; }
.filters .grow { flex: 1 1 260px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
select { padding-right: 32px; }
textarea { padding: 10px 14px; min-height: 96px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { color: var(--danger); filter: brightness(.97); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.inline-form { display: inline; margin: 0; }
.link-row { color: var(--text); font-weight: 600; }
.link-row:hover { color: var(--accent); }
.badge-pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pill-ok { background: var(--ok-soft); color: var(--ok); } .pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); } .pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-muted { background: var(--chip); color: var(--muted); }

/* Fiche matériel */
.item-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 24px; }
.item-photo { width: 132px; height: 132px; border-radius: 12px; background: var(--chip); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; overflow: hidden; flex: none; }
.item-photo img { width: 100%; height: 100%; object-fit: cover; }
.item-title { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.item-title h2 { font-size: 28px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); }
.item-meta strong { color: var(--text); font-variant-numeric: tabular-nums; }
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.bucket { padding: 18px; gap: 6px; }
.bucket .kpi-value { font-size: 30px; }
.places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.place { padding: 12px; border-radius: 10px; background: var(--chip); display: flex; flex-direction: column; gap: 2px; }
.place small { font-size: 12px; color: var(--muted); }
.place strong { font-size: 22px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.list-plain li:first-child { border-top: 0; }
.list-plain .grow { flex: 1 1 160px; min-width: 0; }
details.panel { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
details.panel > summary { list-style: none; cursor: pointer; min-height: 52px; padding: 0 20px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel[open] > summary { border-bottom: 1px solid var(--border); }
details.panel > .panel-body { padding: 20px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border); font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--chip); flex: none; }
.code { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.secret-box { padding: 14px; border-radius: 10px; background: var(--chip); word-break: break-all; font-family: ui-monospace, monospace; font-size: 13px; user-select: all; }

[hidden] { display: none !important; }
.h-card { font-size: 17px; }
.row-item { display: inline-flex; align-items: center; gap: 10px; }
.notes { margin: 0; color: var(--muted); }
.filters { flex-direction: row; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
input:not([type]), input[type="date"], input[type="file"] { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; width: 100%; }
input[type="file"] { padding: 9px 12px; }
.badge-pill { white-space: nowrap; }
.table td.num .inline-form { display: inline-block; margin: 2px 0 2px 4px; }
.alerts a { color: inherit; flex: 1; font-weight: 500; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-info { background: var(--accent-soft); color: var(--accent); }
.notice .inline-form { margin-left: 8px; }
.nowrap { white-space: nowrap; }
.progress-row { display: flex; align-items: center; gap: 10px; min-width: 160px; }
progress { flex: 1; height: 8px; border: 0; border-radius: 999px; background: var(--track); overflow: hidden; appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--track); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.qty-form { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; margin: 0; }
input.qty { width: 84px; min-height: 36px; padding: 0 8px; text-align: right; }

/* Lot 4 — maintenance */
.field-error { color: var(--danger); font-size: .85rem; font-weight: 500; }
.part-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.part-row .field { margin: 0; }
.part-row .grow { flex: 1 1 260px; }
.part-row input { max-width: 140px; }
.code-states { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.code-state { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.kpi { position: relative; }
.kpi-link { color: inherit; text-decoration: none; }
.kpi-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.kpi:has(.kpi-link):hover { border-color: var(--accent); }

/* Lot 5 — achats */
.qty-form input[name="quantity"] { width: 84px; min-height: 36px; padding: 0 8px; text-align: right; }
.qty-form input[name="unit_price"] { width: 96px; min-height: 36px; padding: 0 8px; text-align: right; }
input.input-sm { width: 110px; min-height: 40px; padding: 0 10px; text-align: right; }
tr.muted td { color: var(--muted); }
.alerts li a { flex: 1; }
.alerts li em { font-style: normal; }

/* Lot 7 — pages publiques, avis */
.public-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 16px; }
.feedback-card { max-width: 560px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.stars { border: 0; padding: 0; margin: 0; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars-title { font-weight: 600; margin: 0 0 -8px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2rem; line-height: 1; color: var(--border); cursor: pointer; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #E8A317; }
.stars input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }
.stars-ro { color: #E8A317; letter-spacing: 1px; white-space: nowrap; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 180px; }
.bars svg { width: 100%; height: 100%; }
.topic-head { display: flex; gap: 12px; align-items: center; }
.topic-head input { font-weight: 600; font-size: 1.05rem; }
.topic-num { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.testimonial h2 { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.elec-chart { width: 100%; height: auto; display: block; }
.elec-chart .bar { fill: var(--accent); }
.elec-chart g:hover .bar { fill: var(--accent-strong, var(--accent)); opacity: .85; }
.elec-chart .bar-val { fill: var(--text); font-size: 11px; font-weight: 600; }
.elec-chart .bar-lab { fill: var(--muted); font-size: 11px; }
.elec-chart .axis { stroke: var(--border); stroke-width: 1; }

.public .bare-main { flex-direction: column; align-items: center; }
.public .login-card { width: 100%; }

/* État de la synchronisation (serveur du local) */
a.sync-pill { text-decoration: none; line-height: 1.35; }
.sync-pill.is-late { background: var(--warn-soft); color: var(--warn); }
.sync-pill.is-error { background: var(--danger-soft); color: var(--danger); }
.sync-pill.is-never { background: var(--surface-2, var(--border)); color: var(--muted); }
.sub-tabs { margin-bottom: 16px; flex-wrap: wrap; }
.pill-lg { font-size: .95rem; padding: 6px 14px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.copy-row input { flex: 1; min-width: 0; }
.sync-big { padding: 12px 16px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 1.05rem; }
.sync-big.is-late { background: var(--warn-soft); color: var(--warn); }
.sync-big.is-error, .sync-big.is-never { background: var(--danger-soft); color: var(--danger); }
.input-time { display: inline-block; width: auto; min-height: 36px; padding: 0 8px; margin: 0 4px; }
input[type="number"].input-time { width: 80px; }
.sync-plan .check { align-items: center; flex-wrap: wrap; }
.notice ol { margin: 8px 0 0 18px; padding: 0; }
input[type="time"].input-time { width: 120px; }

/* Ma journée */
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 22px; }
.today-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.today-block h3 { margin: 0; font-size: 0.95rem; display: flex; align-items: center; gap: 6px; }
.today-block h3 .count { margin-left: auto; background: var(--chip); color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 0.8rem; }
.today-block .list-plain li { padding: 6px 0; }
.today-block > a { align-self: flex-start; }
progress.wide { width: 100%; display: block; flex: none; margin: 8px 0 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* Signature et états des lieux */
.signature-pad { position: relative; border: 1px dashed var(--border); border-radius: 12px; background: #fff; max-width: 900px; }
.signature-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.signature-pad [data-signature-clear] { position: absolute; top: 8px; right: 8px; }
.check-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.check-photos img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.check-sig { max-height: 60px; background: #fff; border-radius: 6px; }
.actions-inline { display: inline-flex; gap: 8px; flex-wrap: wrap; }
tr.inv-ok td { background: var(--ok-soft); }
tr.inv-diff td { background: var(--warn-soft); }

/* Fiche publique (QR code) */
.fiche { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.fiche-head { display: flex; gap: 14px; align-items: center; }
.fiche-head h1 { margin: 0; font-size: 1.35rem; }
.fiche-photo { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }
.fiche-verdict { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-radius: 14px; font-size: 1.1rem; }
.fiche-verdict strong { font-size: 2rem; letter-spacing: .04em; }
.fiche-verdict.is-ok { background: var(--ok-soft); color: var(--ok); }
.fiche-verdict.is-ko { background: var(--danger-soft); color: var(--danger); }
.qr-box { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.qr-box p { margin: 4px 0 0; }
.signature-pad [data-signature-clear] { background: #fff; color: #222; border-color: #bbb; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .badge-pill { min-width: 84px; text-align: center; }
.fiche-report summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 6px 0; }
.fiche-report[open] summary { margin-bottom: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fault-photo { max-width: 320px; max-height: 240px; border-radius: 10px; border: 1px solid var(--border); }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.subnav a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: .9rem; }
.subnav a[aria-current] { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.qr-setup { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.qr-setup svg { border-radius: 10px; background: #fff; padding: 6px; }
ul.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 24px; margin: 8px 0 0; padding-left: 18px; }
.kit-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
