:root { --g: #2f7d32; --gd: #1f5a22; --bg: #f4f6f3; --ink: #1d231d; --mut: #667066; --line: #dde3dc; --warn: #b3261e; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--gd); }
main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }

.top { background: var(--g); color: #fff; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: .06em; }
.brand span { font-weight: 400; }
.tag { opacity: .85; font-size: 14px; }
.foot { text-align: center; color: var(--mut); font-size: 13px; padding: 20px 16px 30px; border-top: 1px solid var(--line); }

h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 4px; }
h1 small, h2 small { color: var(--mut); font-weight: 400; font-size: .6em; }
.empty { text-align: center; color: var(--mut); padding: 40px 0; }

/* Liste publique */
.search { width: 100%; padding: 12px 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.cat h2 { font-size: 18px; margin: 22px 0 10px; padding-bottom: 4px; border-bottom: 2px solid var(--g); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cards a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; height: 100%; }
.cards a:hover { border-color: var(--g); }
.cards img, .noimg { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #e7ece6; }
.cards .t { display: block; font-weight: 600; padding: 8px 10px 0; }
.cards .s { display: block; color: var(--mut); font-size: 13px; padding: 0 10px 10px; }

/* Fiche */
.fiche { max-width: 640px; margin: 0 auto; }
.crumb { color: var(--mut); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.sub { color: var(--mut); margin: 0 0 12px; }
.photo { width: 100%; border-radius: 12px; display: block; margin: 8px 0 14px; }
.actions { display: grid; gap: 10px; margin: 14px 0; }
.btn { display: inline-block; text-align: center; background: var(--g); color: #fff; text-decoration: none; border: 0; border-radius: 10px; padding: 13px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--gd); }
.btn.alt { background: #33413a; }
.btn.ghost { background: #fff; color: var(--gd); border: 1px solid var(--line); }
.btn.danger { background: var(--warn); }
.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px 12px; margin: 14px 0; }
.box h2 { font-size: 17px; margin: 12px 0 6px; }
.box ol, .box ul { margin: 0; padding-left: 22px; }
.box li { margin: 5px 0; }
.box.warn { border-color: #f0c7c3; background: #fff7f6; }
.box.warn h2 { color: var(--warn); }
.box.help .btn { width: 100%; }

/* Admin */
.adm { background: #fff; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 10px 16px; max-width: 980px; margin: 0 auto; }
.adm a { text-decoration: none; font-weight: 600; }
.r { margin-left: auto; }
.flash { background: #e6f3e6; border: 1px solid #b9dcb9; padding: 8px 12px; border-radius: 8px; }
.err { background: #fdecea; border: 1px solid #f3c1bc; color: var(--warn); padding: 8px 12px; border-radius: 8px; }
.cath { font-size: 16px; margin: 22px 0 6px; color: var(--gd); }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: #f0f3ef; font-weight: 600; color: var(--mut); }
.tbl tr.off td { opacity: .5; }
.miss { color: var(--warn); font-weight: 600; }
.nowrap { white-space: nowrap; }

.form fieldset { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; padding: 12px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form legend { font-weight: 700; padding: 0 6px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.form label small, legend small { font-weight: 400; color: var(--mut); }
.form input:not([type=checkbox]), .form select, .form textarea { font: inherit; font-weight: 400; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; }
.form .w2, .form .file { grid-column: 1 / -1; }
.form .chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.file span { font-weight: 600; width: 100%; }
.qrurl { margin: 0; font-size: 14px; }
.pickgrp { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pickgrp strong { width: 100%; }
.bar { display: flex; align-items: center; gap: 16px; }
.hint { color: var(--mut); font-size: 14px; }
.login { max-width: 340px; margin: 40px auto; display: grid; gap: 10px; }
.login input { font: inherit; padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 640px) { .form fieldset { grid-template-columns: 1fr; } .tbl th:nth-child(5), .tbl td:nth-child(5) { display: none; } }

/* Étiquettes */
.sheet { display: grid; background: #fff; margin: 20px auto; width: 210mm; }
.sheet.grand { grid-template-columns: repeat(2, 105mm); grid-auto-rows: 74.25mm; }
.sheet.moyen { grid-template-columns: repeat(3, 70mm); grid-auto-rows: 42.4mm; }
.sheet.petit { grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37.1mm; }
.lbl { border: 1px dashed #ccc; overflow: hidden; display: flex; flex-direction: column; break-inside: avoid; }
.lh { background: var(--g); color: #fff; font-weight: 800; letter-spacing: .08em; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lh span { font-weight: 400; }
.lb { flex: 1; display: flex; align-items: center; gap: 3mm; padding: 2mm 3mm; min-height: 0; }
.qr { height: 100%; aspect-ratio: 1; cursor: pointer; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.lt { min-width: 0; line-height: 1.15; }
.lt .k { text-transform: uppercase; font-size: .7em; letter-spacing: .06em; color: var(--mut); }
.lt .n { font-weight: 700; margin: .5mm 0; overflow-wrap: anywhere; }
.lt .r { font-size: .8em; }
.lt .u { font-size: .62em; font-family: ui-monospace, Menlo, Consolas, monospace; color: #1f5a22; margin-top: 1mm; overflow-wrap: break-word; line-height: 1.2; }
.lt .p { font-size: .72em; margin-top: 1.5mm; color: #333; }
.grand .lh { font-size: 15pt; padding: 2mm; } .grand .lt { font-size: 13pt; }
.moyen .lh { font-size: 9pt; padding: 1mm; }  .moyen .lt { font-size: 8.5pt; }
.petit .lh { font-size: 8pt; padding: .7mm; } .petit .lt { font-size: 7.5pt; } .petit .lt .p { display: none; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .top, .foot, .adm, .noprint { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { margin: 0; }
  .lbl { border-color: transparent; }
}
.resume { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: #f3f7f2; border: 1px dashed #b9d3b9; border-radius: 10px; padding: 10px 12px; }
.resume p { width: 100%; margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; border-bottom: 2px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; font-weight: 600; border-radius: 8px 8px 0 0; color: var(--mut); }
.tabs a.on { background: var(--g); color: #fff; }
.tabs a small { opacity: .75; font-weight: 400; }
.intro { margin: 0 0 10px; }

/* Étiquette publicitaire robots */
.lbl.promo { border: 0; background: linear-gradient(150deg, #2f7d32 0%, #1f5a22 70%, #17451a 100%); color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; position: relative; }
.promo .pr-top { display: flex; justify-content: center; align-items: center; padding: 2.4mm 3.5mm .6mm; }
.promo .pr-logo { display: block; width: 92%; height: auto; }
.promo .pr-brand { font-weight: 800; letter-spacing: .07em; }
.promo .pr-brand span { font-weight: 400; }
.promo .pr-tag { display: inline-block; background: #ffd54a; color: #1d231d; font-weight: 700; border-radius: 10mm; padding: .4mm 2.2mm; white-space: nowrap; margin-bottom: 1.2mm; }
.promo .pr-body { flex: 1; display: flex; gap: 3mm; align-items: center; padding: 2mm 3.5mm; min-height: 0; }
.promo .pr-qr { background: #fff; border-radius: 2.5mm; padding: 1.2mm 1.2mm .5mm; flex: none; box-sizing: border-box; }
.promo .pr-qr .qr { width: 100%; height: auto; aspect-ratio: 1; }
.grand .promo .pr-qr { width: 36mm; } .moyen .promo .pr-qr { width: 23mm; } .petit .promo .pr-qr { width: 21mm; }
.promo .pr-scan { color: #1f5a22; font-weight: 800; text-align: center; line-height: 1.3; }
.promo .pr-txt { min-width: 0; line-height: 1.15; }
.promo .pr-h { font-weight: 800; color: #ffd54a; line-height: 1.05; }
.promo .pr-list { list-style: none; margin: 1.6mm 0; padding: 0; }
.promo .pr-list li::before { content: "✓ "; color: #ffd54a; font-weight: 800; }
.promo .pr-mode { font-weight: 700; margin-top: 1mm; }
.promo .pr-u { font-family: ui-monospace, Menlo, Consolas, monospace; opacity: .85; }
.promo .pr-bot { background: rgba(0,0,0,.22); padding: 1.4mm 3.5mm; font-weight: 800; letter-spacing: .02em; }
.promo .pr-bot span { font-weight: 400; opacity: .85; }
.grand .promo .pr-brand { font-size: 13pt; } .grand .promo .pr-tag { font-size: 7.5pt; } .grand .promo .pr-h { font-size: 14pt; }
.grand .promo .pr-list { font-size: 9pt; } .grand .promo .pr-mode { font-size: 8.5pt; } .grand .promo .pr-u { font-size: 7pt; }
.grand .promo .pr-scan { font-size: 7.5pt; } .grand .promo .pr-bot { font-size: 11pt; }
.moyen .promo .pr-top, .petit .promo .pr-top { padding: 1.2mm 2.5mm .2mm; }
.moyen .promo .pr-body, .petit .promo .pr-body { padding: 1mm 2.5mm; gap: 2mm; }
.moyen .promo .pr-brand, .petit .promo .pr-brand { font-size: 8pt; } .moyen .promo .pr-tag, .petit .promo .pr-tag { font-size: 5pt; padding: .2mm 1.5mm; }
.moyen .promo .pr-h, .petit .promo .pr-h { font-size: 9pt; } .moyen .promo .pr-list, .petit .promo .pr-list { font-size: 6pt; margin: .8mm 0; }
.moyen .promo .pr-mode, .moyen .promo .pr-u, .petit .promo .pr-mode, .petit .promo .pr-u { display: none; }
.moyen .promo .pr-scan, .petit .promo .pr-scan { font-size: 5pt; } .moyen .promo .pr-bot, .petit .promo .pr-bot { font-size: 7pt; padding: .8mm 2.5mm; }
