/* =====================================================================
   L'Infernal Trail - Gestion Logistique et Village — styles
   Clair / sombre selon le réglage de l'appareil.
   Charte L'Infernal Trail : orange #F49933 (logo #EE7C00), noir #030304,
   nuances #FFC583 #FFB15A #D57709 #A85902. Police Poppins (licence OFL).
   L'orange vif sert aux aplats (boutons, repères) avec un texte noir ;
   l'orange foncé sert aux textes et liens (lisible sur fond clair).
   Les couleurs de statut (vert, rouge, bleu, violet, jaune…) ne changent pas.
   ===================================================================== */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #f7f6f4;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --text: #1a1918;
  --muted: #67645f;
  --line: #e7e3dd;
  --accent: #9a5100;
  --accent-ink: #030304;
  --accent-soft: #ffedd6;
  --brand: #f08410;
  --brand-strong: #ee7c00;
  --brand-hover: #f49933;
  --brand-ink: #030304;
  --ok: #1f7a4d;
  --ok-soft: #e4f3ea;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --ko: #b42318;
  --ko-soft: #fbe6e4;
  --focus: #2563eb;
  --lv1-bg: #fef6d8; --lv1-ink: #7a5a00; --lv1-line: #f0d77a;
  --lv2-bg: #e3f4e8; --lv2-ink: #1f6b3f; --lv2-line: #9fd5b1;
  --lv3-bg: #efe7fb; --lv3-ink: #5b21b6; --lv3-line: #c9b3ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1c1b1a;
    --surface-2: #242321;
    --text: #efede9;
    --muted: #a8a49d;
    --line: #34312d;
    --accent: #ffb15a;
    --accent-ink: #030304;
    --accent-soft: #33240f;
    --brand: #f28a1c;
    --brand-strong: #ee7c00;
    --brand-hover: #f49933;
    --brand-ink: #030304;
    --ok: #4cc38a;
    --ok-soft: #1b3226;
    --warn: #e3b341;
    --warn-soft: #36301b;
    --ko: #f47067;
    --ko-soft: #3b1f1d;
    --focus: #7aa2ff;
    --lv1-bg: #3a3218; --lv1-ink: #f0cf62; --lv1-line: #6b5a22;
    --lv2-bg: #183424; --lv2-ink: #6fd69c; --lv2-line: #2f6a45;
    --lv3-bg: #2c2140; --lv3-ink: #c4a8f5; --lv3-line: #57408a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 12px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.lead { color: var(--muted); max-width: 70ch; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ----------------------------------------------------------- Bandeau */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-top: 3px solid var(--brand-strong);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.brand-logo { display: block; flex: none; line-height: 0; }
.brand-logo img { display: block; height: 34px; width: auto; }
.simple-brand .brand-logo img { height: 44px; }
.brand .brand-name, .simple-brand .brand-name { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 14px; }
@media (max-width: 420px) { .topbar .brand-logo img, .expo-top .brand-logo img { height: 34px; width: 34px; border-radius: 7px; } }
.env-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.edition-picker select { max-width: 240px; }
.user-menu { position: relative; }
.user-menu summary { cursor: pointer; list-style: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 220px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  display: grid; gap: 8px;
}
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ----------------------------------------------------------- Structure */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: 16px 12px; }
.sidebar > summary { display: none; }
.sidebar ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; }
.sidebar a, .nav-soon { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.sidebar a:has(> .nav-ico), .nav-soon:has(> .nav-ico) { display: flex; align-items: center; gap: 10px; }
.nav-ico { flex: none; color: var(--muted); }
.sidebar a:hover .nav-ico { color: var(--text); }
.sidebar a.active .nav-ico, .sidebar a.open .nav-ico { color: var(--brand-strong); }
.nav-soon .nav-ico { opacity: .7; }
/* Modules à venir : date sous le nom */
.nav-soon > span > small { display: block; font-size: 11px; line-height: 1.2; margin-top: 1px; }
.nav-soon:has(> .nav-ico) { align-items: flex-start; }
.nav-soon:has(> .nav-ico) > .nav-ico { margin-top: 2px; }
.nav-signaler { display: none; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand); }
.nav-soon { color: var(--muted); }
.sidebar ul.nav-sub { margin: 2px 0 4px 18px; padding-left: 8px; border-left: 2px solid var(--line); }
.sidebar ul.nav-sub a, .sidebar ul.nav-sub .nav-soon { padding: 5px 10px; font-size: .93em; }
.sidebar a.open { font-weight: 600; color: var(--accent); }
.nav-soon small { font-size: 11px; }
.nav-title { margin: 16px 10px 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
main { padding: 24px 32px 48px; max-width: 1560px; width: 100%; margin: 0 auto; }
.footer { padding: 16px; text-align: center; border-top: 1px solid var(--line); }
.footer-simple { width: 100%; align-self: end; border-top: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .sidebar > summary { display: block; cursor: pointer; padding: 6px 4px; font-weight: 600; }
  main { padding: 16px 16px 40px; }
  .brand-name { display: none; }
  .edition-picker select { max-width: 150px; }
  .topbar { gap: 8px; padding: 8px 12px; }
  .env-long { display: none; }
  .sidebar { padding: 4px 12px; }
  .sidebar > summary { padding: 8px 4px; }
}
@media (max-width: 420px) {
  .edition-picker select { max-width: 110px; }
  .user-menu summary { padding: 6px 8px; }
}
.env-badge { white-space: nowrap; }
.env-short { display: none; }
@media (max-width: 860px) { .env-short { display: inline; } }

/* ------------------------------------------------------------ Pages simples */
body.simple { display: grid; min-height: 100vh; grid-template-rows: 1fr auto; justify-items: center; }
.simple-main { width: 100%; max-width: 760px; padding: 48px 16px; }
.simple-brand { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 600; margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; max-width: 420px; margin: 0 auto; box-shadow: var(--shadow); }
.card.wide { max-width: 760px; }

/* -------------------------------------------------------------- Blocs */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel-warn { border-color: var(--warn); }
.cards { gap: 16px; }
.cards > .panel { margin-bottom: 0; }
.cards { margin-bottom: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.breadcrumb { margin: 0 0 4px; font-size: 13px; }
.breadcrumb a { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
fieldset.field + fieldset.field, .field + fieldset.field { margin-top: 4px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.empty { color: var(--muted); padding: 16px 0; }

/* ------------------------------------------------------------ Messages */
.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.notice-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-soft); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-error { background: var(--ko-soft); color: var(--ko); }
.notice code { background: transparent; }

/* ---------------------------------------------------------- Formulaires */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.form.narrow { max-width: 420px; }
.field { display: grid; gap: 6px; min-width: 0; }
fieldset.field { border: 0; padding: 0; margin: 0; }
legend, label { font-weight: 600; font-size: 14px; }
legend { margin-bottom: 6px; padding: 0; }
input, select, textarea {
  width: 100%;
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px;
  min-height: 40px;
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); flex: none; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; padding: 3px 0; }
.check-list { display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.hint { color: var(--muted); font-size: 13px; margin: 0; font-weight: 400; }
.copy-field { margin-top: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.actions-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.filters .field { min-width: 150px; }

/* --------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
}
.btn { transition: background-color .15s ease, border-color .15s ease, transform .05s ease; }
/* Survol : léger reflet orangé ; clic : plus marqué */
.btn:hover { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.btn:active { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); border-color: var(--brand); transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:active { background: #d57709; border-color: #d57709; }
.btn[disabled], .btn[aria-disabled="true"] { transform: none; }
.btn-warn { color: var(--warn); border-color: var(--warn); }
.btn-danger { color: var(--ko); border-color: var(--ko); }
.btn-small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-microsoft { width: 100%; background: var(--surface); border-color: var(--line); color: var(--text); white-space: nowrap; font-size: 15px; padding-top: 13px; padding-bottom: 13px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; }
.ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; }
.ms-logo i:nth-child(4) { background: #ffb900; }
.separator { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.separator::before, .separator::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.connexion-mdp { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.connexion-mdp > summary { cursor: pointer; text-align: center; color: var(--accent); font-size: 14px; font-weight: 500; list-style: none; padding: 6px 0; }
.connexion-mdp > summary::-webkit-details-marker { display: none; }
.connexion-mdp > summary::after { content: " ▾"; }
.connexion-mdp[open] > summary::after { content: " ▴"; }
.connexion-mdp > summary:hover { text-decoration: underline; }
.connexion-mdp[open] > summary { margin-bottom: 8px; }
.connexion-mdp + .center, .card > .hint.center { margin-bottom: 12px; }

/* -------------------------------------------------------------- Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; }
.panel .table-wrap { border: 0; margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th.right, .table td.right { text-align: right; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table.compact th, .table.compact td { padding: 7px 10px; }
.table select { min-height: 34px; padding: 5px 8px; }
.matrix td:first-child { font-weight: 600; white-space: nowrap; }
.matrix select { min-width: 120px; }

/* ------------------------------------------------------ Statuts, badges */
.status, .badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.status-actif, .badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.status-invite { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.status-suspendu { background: var(--ko-soft); color: var(--ko); border-color: transparent; }
.status-cloture { background: var(--surface-2); color: var(--muted); }
.level { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 9px; border-radius: 99px; border: 1px solid transparent; }
/* Couleurs des niveaux de droits : aucun (neutre), lecture (jaune), écriture (vert), validation (violet) */
.level-0 { color: var(--muted); font-weight: 400; }
.level-1, select.lv-1 { background: var(--lv1-bg); color: var(--lv1-ink); border-color: var(--lv1-line); }
.level-2, select.lv-2 { background: var(--lv2-bg); color: var(--lv2-ink); border-color: var(--lv2-line); }
.level-3, select.lv-3 { background: var(--lv3-bg); color: var(--lv3-ink); border-color: var(--lv3-line); }
select.lv-1, select.lv-2, select.lv-3 { font-weight: 600; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--brand); font-weight: 600; }
.count { font-size: 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 16px; font-size: 13px; }
.legend dt { font-weight: 600; }
.legend dd { margin: 0 12px 0 0; color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; margin: 16px 0; }
.pager .btn { min-width: 38px; justify-content: center; }
.pager-current { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
details.json summary { cursor: pointer; color: var(--muted); }
details.json pre { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 8px; border-radius: 6px; max-width: 520px; overflow: auto; }

/* ----------------------------------------------------------------- Accueil */
.countdown { display: inline-flex; align-items: baseline; gap: 8px; background: var(--accent-soft); color: var(--accent); padding: 8px 14px; border-radius: var(--radius); font-weight: 600; }
.countdown span { font-size: 26px; }
.roadmap { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; max-width: 760px; }
.roadmap li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.roadmap .badge { margin-left: auto; }
.roadmap li.done { border-color: var(--ok); }
.steps { max-width: 760px; display: grid; gap: 6px; }

/* ------------------------------------------------------------ Contrôles */
.summary { padding: 12px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; font-weight: 600; margin: 12px 0 8px; }
.summary-ok { border-left-color: var(--ok); }
.summary-warn { border-left-color: var(--warn); }
.summary-ko { border-left-color: var(--ko); }
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.checklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.checklist li { display: flex; gap: 12px; align-items: baseline; padding: 9px 14px; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .dot { width: 1.2em; font-weight: 700; flex: none; }
.checklist .label { flex: 1 1 auto; }
.checklist .detail { color: var(--muted); font-size: 13px; text-align: right; }
.check-ok .dot { color: var(--ok); }
.check-warn .dot { color: var(--warn); }
.check-ko .dot { color: var(--ko); }
@media (max-width: 560px) { .checklist li { flex-wrap: wrap; } .checklist .detail { text-align: left; flex-basis: 100%; padding-left: 2em; } }
.checks-box { margin: 12px 0 20px; }
.checks-box > summary { cursor: pointer; font-weight: 600; }

/* ------------------------------------------------ Étape 2 : référentiels */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 800px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.tile { display: grid; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--brand); }
.tile strong { font-size: 16px; color: var(--accent); }
.tile span { font-weight: 600; }
.tile small { color: var(--muted); }
.static { margin: 0; padding: 9px 0; font-weight: 600; }
.check-inline { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.pole-row, .qualif-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; padding: 3px 0; }
.qualif-row { grid-template-columns: minmax(0, 1.4fr) 150px auto; }
.qualif-row input[type="date"], .pole-row input { min-height: 34px; padding: 5px 8px; }
.qualif-family { margin: 12px 0 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.qualif-family:first-of-type { margin-top: 0; }
@media (max-width: 560px) { .pole-row, .qualif-row { grid-template-columns: minmax(0, 1fr); } }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-form input:not([type="checkbox"]):not([type="radio"]) { width: auto; min-width: 0; flex: 1 1 160px; min-height: 34px; padding: 5px 8px; }
.row-form .num, .num { flex: 0 0 76px !important; width: 76px; }
.row-form .w-sm { flex: 0 1 130px !important; }
.list-values { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.place-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 6px 16px; }
.inline-edit summary { cursor: pointer; color: var(--muted); margin-top: 8px; }
.inline-edit .filters { margin-top: 10px; }
.upload-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.upload-form .field { flex: 1 1 200px; }
.upload-form input[type="file"] { padding: 6px; }
.inline-form { display: inline; }
.archive-form { margin: 8px 0 24px; }
.page-head h2 { margin: 0; }

/* Organigramme */
.org-chart { overflow-x: auto; padding: 8px 0 24px; }
.org-chart ul { list-style: none; margin: 0; padding: 0; }
.org-root { display: flex; flex-direction: column; gap: 16px; }
.org-chart li { position: relative; }
.org-chart li > ul { margin-left: 28px; padding-left: 18px; border-left: 2px solid var(--line); display: grid; gap: 10px; padding-top: 10px; }
.org-chart li > ul > li::before { content: ""; position: absolute; left: -18px; top: 26px; width: 16px; border-top: 2px solid var(--line); }
.org-card { display: inline-grid; gap: 1px; min-width: 240px; max-width: 360px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; }
.org-vacant { border-left-color: var(--warn); }
.org-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.org-name { font-weight: 600; }
.org-vacant .org-name { color: var(--warn); font-style: italic; }
.org-pole, .org-tel { font-size: 13px; color: var(--muted); }
.org-edit { font-size: 12px; justify-self: start; }

/* Impression (annuaire, organigramme) */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .no-print, .topbar, .sidebar, .footer, .notice { display: none !important; }
  .print-only { display: block; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  .table-wrap { border: 0; overflow: visible; }
  .table th, .table td { padding: 4px 6px; border-bottom: 1px solid #ccc; }
  .table th { background: #eee; color: #000; }
  a { color: #000; text-decoration: none; }
  .org-card { border: 1px solid #999; border-left: 4px solid #000; break-inside: avoid; }
  tr { break-inside: avoid; }
}
.help-box { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--focus); border-radius: var(--radius); padding: 10px 16px; margin: 0 0 16px; max-width: 900px; }
.help-box summary { cursor: pointer; font-weight: 600; }
.help-box p, .help-box ul { margin: 8px 0; }
.help-box li { margin: 4px 0; }
.section-archives { margin-top: 24px; }
.archived-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; margin: 8px 0 0; }
.section-archives summary { cursor: pointer; }

/* Champs obligatoires */
.req { color: var(--ko); font-weight: 700; }

/* Nom cliquable (ouvre une fiche résumée) */
.link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }

/* Fiche résumée d'un contact (fenêtre par-dessus la page) */
.contact-card { width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.contact-card::backdrop { background: rgba(0, 0, 0, .45); }
.contact-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.contact-card-head h2 { margin: 0 0 2px; font-size: 20px; }
.close-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.close-btn:hover { background: var(--accent-soft); }
.contact-card-body { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 12px; }
.contact-card-body dt { color: var(--muted); font-size: 13px; }
.contact-card-body dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .contact-card-body { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .contact-card-body dd { margin-bottom: 8px; }
}

/* Mode aperçu (administrateur qui teste la vue d'un rôle ou d'un compte) */
.preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; background: #5b21b6; color: #fff; font-size: 14px; }
.preview-bar .btn { background: #fff; color: #5b21b6; border-color: #fff; }
.preview-bar form { margin: 0; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.rights-table td, .rights-table th { text-align: center; }
.rights-table td:first-child, .rights-table th:first-child { text-align: left; }

/* Bouton « Signaler » présent sur toutes les pages */
.report-btn {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30;
  padding: 9px 16px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18); cursor: pointer;
}
.report-btn:hover { background: var(--accent-soft); color: var(--accent); }
main { padding-bottom: 88px; }
.report-card { width: min(560px, calc(100vw - 32px)); }
.report-card textarea { width: 100%; }
.count-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 700; text-align: center; }
.retour-nouveau { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.retour-en_cours { background: var(--lv1-bg); color: var(--lv1-ink); border-color: var(--lv1-line); }
.retour-traite { background: var(--lv2-bg); color: var(--lv2-ink); border-color: var(--lv2-line); }
.retour-refuse { color: var(--muted); }
.badge-bug { background: var(--ko-soft); color: var(--ko); border-color: transparent; }
.retour-texte { white-space: normal; overflow-wrap: anywhere; }
.retour-reponse { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid var(--line); }
.retour-capture { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }

/* Champs de date : sur iPhone, Safari leur impose une largeur fixe qui déborde */
input[type="date"], input[type="datetime-local"], input[type="time"] {
  -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
@media (max-width: 560px) {
  .filters .field { min-width: 0; flex: 1 1 140px; }
}
.report-card fieldset { border: 0; padding: 0; margin: 0; }
.report-card legend { font-weight: 600; margin-bottom: 4px; }
.report-card .check-inline { display: grid; gap: 4px; }
.pager-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 8px 0 16px; }
.pager-bar .pager { margin: 0; }
.per-page { display: flex; align-items: center; gap: 8px; margin: 0; }
.per-page select { width: auto; min-height: 34px; padding: 4px 8px; }
@media (max-width: 560px) {
  .pager { gap: 4px; }
  .pager .btn { min-width: 32px; padding-left: 8px; padding-right: 8px; }
  .footer { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* Accueil administrateur : avancement et nouveautés */
.progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 14px; border: 0; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 4px 0 8px; box-shadow: inset 0 0 0 1px var(--line); }
.progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 99px; }
.progress::-webkit-progress-value { background: var(--ok); border-radius: 99px; }
.progress::-moz-progress-bar { background: var(--ok); border-radius: 99px; }
.suivi details { margin-top: 8px; }
.suivi .roadmap { margin: 10px 0 0; }
.roadmap li.doing { border-color: var(--warn); }
.news-title { margin: 14px 0 4px; font-size: 14px; }
.news-title:first-of-type { margin-top: 0; }
.news { margin: 0 0 4px; padding-left: 20px; }
.news li { margin: 2px 0; }

/* iPhone : un champ en dessous de 16 px déclenche un zoom automatique qui oblige à faire glisser la page */
@media (max-width: 860px) {
  input, select, textarea { font-size: 16px; }
}

/* Accueil administrateur : état des contrôles */
.health { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ok); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 16px; }
.health-warn { border-left-color: var(--warn); }
.health-ko { border-left-color: var(--ko); background: var(--ko-soft); }
.health-head { display: flex; align-items: center; gap: 14px; }
.health-head > div { display: grid; gap: 2px; }
.health-head strong { font-size: 17px; }
.health-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; font-weight: 700; color: #fff; background: var(--ok); }
.health-warn .health-icon { background: var(--warn); }
.health-ko .health-icon { background: var(--ko); }
.health .checklist { margin: 12px 0 0; }
.health-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.health-actions form { margin: 0; }

/* Imports */
.import-steps { max-width: 900px; padding-left: 20px; margin: 0 0 16px; }
.import-steps li { margin: 4px 0; }
.import-counts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.count-box { padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.count-box strong { font-size: 18px; margin-right: 4px; }
.count-ok { border-left: 4px solid var(--ok); }
.count-warn { border-left: 4px solid var(--warn); }
.count-ko { border-left: 4px solid var(--ko); }
.import-table select { min-width: 190px; }
tr.import-erreur td { background: color-mix(in srgb, var(--ko-soft) 60%, transparent); }
tr.import-doublon td { background: color-mix(in srgb, var(--warn-soft) 60%, transparent); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.menu-btn { position: relative; }
.menu-btn > summary { list-style: none; }
.menu-btn > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; min-width: 260px; display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.menu-panel a { padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.menu-panel a:hover { background: var(--surface-2); }

/* Fusion de doublons */
.fusion-table th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 600; }
.fusion-table thead .keep { color: var(--ok); }
.fusion-table thead .drop { color: var(--ko); }
.fusion-table tr.diff td { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.fusion-table label.check { align-items: flex-start; }
.fusion-table label.check input { margin-top: 3px; }
.badge-warn-soft { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-size: 11px; }

/* ===================================================== Village exposants */
.notice-info { background: color-mix(in srgb, var(--focus) 10%, var(--surface)); color: var(--text); border-color: color-mix(in srgb, var(--focus) 30%, transparent); }
.notice-info .inline-form { display: inline; margin-left: 8px; }
.text-ko { color: var(--ko); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); font-weight: 600; }
.char-counter { margin: 4px 0 0; text-align: right; }
.mt { margin-top: 12px; }
.field.grow { flex: 1 1 260px; }
.w-xs { width: 90px; }
.tabs { display: flex; flex-wrap: nowrap; gap: 4px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x; border-bottom: 1px solid var(--line); margin: 0 0 16px; scrollbar-width: none; scroll-behavior: smooth; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 14px; margin-bottom: 0; white-space: nowrap; flex: 0 0 auto; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: 14px; }
/* Flèches quand les onglets dépassent la largeur */
.tabs-scroller { position: relative; margin: 0 0 16px; }
.tabs-scroller .tabs { margin: 0; }
.tabs-arrow { position: absolute; top: 0; bottom: 1px; width: 34px; border: 0; padding: 0; cursor: pointer; font-size: 20px; line-height: 1; color: var(--text); z-index: 2; }
.tabs-arrow[hidden] { display: none; }
.tabs-arrow.prev { left: 0; background: linear-gradient(to right, var(--bg) 60%, transparent); text-align: left; padding-left: 4px; }
.tabs-arrow.next { right: 0; background: linear-gradient(to left, var(--bg) 60%, transparent); text-align: right; padding-right: 4px; }
.tabs-arrow:focus-visible { outline: 2px solid var(--focus); }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 13px; }
.chip b { font-weight: 700; color: var(--muted); }
.chip { transition: background-color .15s ease, border-color .15s ease; }
a.chip:not(.active):hover { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.active b { color: var(--brand-ink); }
/* Couleurs des statuts de dossier */
.st-gris { background: var(--surface-2); color: var(--muted); }
.st-jaune { background: var(--lv1-bg); color: var(--lv1-ink); border-color: var(--lv1-line); }
.st-bleu { background: color-mix(in srgb, var(--focus) 14%, var(--surface)); color: #1d4ed8; border-color: transparent; }
@media (prefers-color-scheme: dark) { .st-bleu { color: #93b4f5; } }
.st-violet { background: var(--lv3-bg); color: var(--lv3-ink); border-color: var(--lv3-line); }
.st-vert { background: var(--lv2-bg); color: var(--lv2-ink); border-color: var(--lv2-line); }
.st-vert-fonce { background: var(--ok); color: #fff; border-color: var(--ok); }
.st-rouge { background: var(--ko-soft); color: var(--ko); border-color: transparent; }
.status-lg { font-size: 14px; padding: 5px 14px; }
.badge-new { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-size: 11px; padding: 0 7px; }
/* En-tête et chiffres clés du dossier */
.dossier-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; }
.dossier-head h1 { margin-bottom: 2px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; margin: 14px 0 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 2px; }
.kpi span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi strong { font-size: 16px; overflow-wrap: anywhere; }
.kpi em { font-style: normal; font-size: 12px; color: var(--warn); font-weight: 600; }
.group-row th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.total-row th { font-size: 16px; border-top: 2px solid var(--line); }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 10px 0; z-index: 5; }
/* Pièces */
.piece { border-left: 5px solid var(--line); }
.piece-validee { border-left-color: var(--ok); }
.piece-deposee { border-left-color: var(--warn); }
.piece-refusee { border-left-color: var(--ko); }
.piece-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.piece-st-manquante { background: var(--surface-2); color: var(--muted); }
.piece-st-deposee { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.piece-st-validee { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.piece-st-refusee { background: var(--ko-soft); color: var(--ko); border-color: transparent; }
.piece-st-dispensee { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.piece-dispensee { opacity: .8; }
.piece-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.piece-actions input[type="file"] { max-width: 260px; }
.piece-actions input:not([type]), .piece-actions input[name="motif_refus"] { flex: 1 1 180px; width: auto; }
.piece-actions select, .piece-actions input[type="date"] { width: auto; }
/* Paramètres */
.param-row { padding: 14px 16px; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.param-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 8px; }
.param-checks .btn { margin-left: auto; }
.table input.w-xs, .table select { min-height: 34px; padding: 5px 8px; }
.field-value { margin: 6px 0 0; font-weight: 600; }

/* Tableau de bord du village */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--text); font-size: 14px; }
.seg a:not(.active):hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.seg a.active { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.kpis-big .kpi strong { font-size: 24px; line-height: 1.2; }
.kpis-big .kpi small { font-size: 12px; }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--brand); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; margin-bottom: 14px; }
.dash-grid > .panel { margin: 0; min-width: 0; }
.dash-grid h2 { font-size: 16px; margin: 0 0 10px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 14px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 0 4px 4px 0; transition: width .4s ease; }
.bar-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-value small { color: var(--muted); }
.soon-panel { border-style: dashed; }

/* Camemberts : 8 couleurs de catégories (validées daltonisme, clair et sombre) ; 0 = non renseigné */
:root { --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #4a3aa7; --cat-8: #e34948; --cat-0: #b9b7b0; }
@media (prefers-color-scheme: dark) {
  :root { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; --cat-8: #e66767; --cat-0: #5c5a55; }
}
.pie-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pie { width: 140px; height: 140px; flex: 0 0 auto; }
.pie path, .pie circle { stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; }
.pie path:hover, .pie circle:hover { opacity: .85; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1 1 160px; min-width: 0; font-size: 14px; }
.pie-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-value small { color: var(--muted); }
.pie-s0 { fill: var(--cat-0); background: var(--cat-0); }
.pie-s1 { fill: var(--cat-1); background: var(--cat-1); }
.pie-s2 { fill: var(--cat-2); background: var(--cat-2); }
.pie-s3 { fill: var(--cat-3); background: var(--cat-3); }
.pie-s4 { fill: var(--cat-4); background: var(--cat-4); }
.pie-s5 { fill: var(--cat-5); background: var(--cat-5); }
.pie-s6 { fill: var(--cat-6); background: var(--cat-6); }
.pie-s7 { fill: var(--cat-7); background: var(--cat-7); }
.pie-s8 { fill: var(--cat-8); background: var(--cat-8); }
.hint-box { margin-top: 10px; }
.hint-box summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.hint-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
tr.muted td { color: var(--muted); }

/* Choix des colonnes d'une liste */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.list-head > p { margin: 0; }
.col-picker { position: relative; }
.col-picker > summary { list-style: none; cursor: pointer; }
.col-picker > summary::-webkit-details-marker { display: none; }
.col-picker-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 12px 14px; }
.col-picker-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 8px 0 12px; }
@media (max-width: 640px) { .col-picker-panel { left: 0; right: auto; } }
@media (max-width: 380px) { .col-picker-list { grid-template-columns: 1fr; } }

/* Garde-fous téléphone : rien ne doit élargir la page (seuls les tableaux défilent, dans leur cadre) */
.table-wrap { position: relative; }
select, input, textarea { max-width: 100%; }
main h1, main h2, .panel, .kpi, .notice, .lead, .breadcrumb, dd { overflow-wrap: anywhere; }
.filters > .field, .grid-2 > *, .grid-3 > *, .param-grid > * { min-width: 0; }

.refus-form { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.refus-form input { min-width: 0; flex: 1 1 180px; }

.storage-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.storage-head h2 { margin: 0; }
.storage .kpis { margin: 12px 0; }

/* ---------------------------------------------------------------- Espace exposant */
body.exposant { background: var(--bg); }
.expo-top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--surface); border-top: 3px solid var(--brand-strong); border-bottom: 1px solid var(--line); }
.expo-titre strong { padding-left: 14px; border-left: 1px solid var(--line); font-weight: 600; }
.expo-top div { display: grid; line-height: 1.25; }
.expo-top .env-badge { margin-left: auto; }
.expo-main { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
.expo-main h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.expo-accueil { white-space: normal; }
.field-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; counter-reset: step; }
.steps li { counter-increment: step; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 14px; border: 1px solid var(--line); }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--line); color: var(--text); font-size: 12px; font-weight: 700; }
.steps li.done { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }
.steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.steps li.current { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.steps li.current::before { background: var(--brand); color: var(--brand-ink); }
.formule-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 10px; margin-bottom: 12px; }
.formule-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.formule-card input { justify-self: start; }
.formule-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.formule-prix { font-weight: 700; font-size: 18px; }
.expo-piece { border-left: 4px solid var(--line); padding: 10px 12px; margin: 0 0 10px; background: var(--surface-2); border-radius: 8px; }
.recap tr.total td { border-top: 2px solid var(--line); }

.expo-acces { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -4px 0 12px; }
.expo-acces select { font-size: 14px; padding: 4px 8px; }

.formule-card { font-weight: 400; }
.formule-card strong { font-weight: 700; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Parcours validation → signature */
.st-orange { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.st-bleu-clair { background: #e8f1fd; color: #1e4f8f; border-color: #bcd4f5; }
@media (prefers-color-scheme: dark) { .st-bleu-clair { background: #1a2a40; color: #9cc3f5; border-color: #2c4a70; } }
.parcours { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; }
.parcours li { position: relative; display: grid; gap: 2px; padding: 0 0 14px 28px; border-left: 2px solid var(--line); margin-left: 8px; }
.parcours li:last-child { border-left-color: transparent; padding-bottom: 0; }
.parcours li::before { content: ""; position: absolute; left: -9px; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.parcours li.done::before { content: "✓"; display: grid; place-items: center; font-size: 11px; color: #fff; background: var(--ok); border-color: var(--ok); }
.parcours li.warn::before { content: "!"; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--warn); border-color: var(--warn); }
.parcours li.done { border-left-color: var(--ok); }

.expo-etape { border: 2px solid var(--brand); }
.signature-pad { display: block; width: 100%; max-width: 600px; height: auto; aspect-ratio: 3 / 1; border: 2px dashed var(--line); border-radius: var(--radius); background: #fff; touch-action: none; cursor: crosshair; }
.signature-pad.signature-manquante { border-color: var(--ko, #b42318); }
.expo-top .expo-logout { margin-left: auto; }
.lien-copie { width: 100%; margin-top: 6px; font-family: ui-monospace, monospace; font-size: 13px; }
.expo-accueil-card { max-width: 560px; margin: 0 auto; }
.expo-top .env-badge + .expo-logout { margin-left: 0; }
@media (max-width: 520px) {
  .expo-top { flex-wrap: wrap; padding: 12px 16px; row-gap: 8px; }
  .expo-top .env-badge { margin-left: 0; }
  .expo-top .expo-logout { margin-left: auto; }
}
/* Espace exposant : formulaire unique, champs obligatoires, barre d'enregistrement */
.req { color: var(--ko); font-weight: 700; }
.field-error { margin: 4px 0 0; color: var(--ko); font-size: 13px; }
input.champ-erreur, select.champ-erreur, textarea.champ-erreur { border-color: var(--ko); box-shadow: 0 0 0 1px var(--ko); }
fieldset.champ-erreur, .expo-piece.champ-erreur { border: 1px solid var(--ko); border-radius: var(--radius); padding: 8px 10px; }
fieldset.formule-cards { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
fieldset.formule-cards.champ-erreur { border: 1px solid var(--ko); padding: 8px; }
.expo-form fieldset.field { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.expo-form fieldset.field.champ-erreur { border: 1px solid var(--ko); padding: 8px 10px; }
.expo-form legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.choix-nombre { display: flex; flex-wrap: wrap; gap: 8px; }
.choix-nombre label { position: relative; }
.choix-nombre input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix-nombre span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 600; cursor: pointer; }
.choix-nombre input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.choix-nombre input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.expo-reste { margin: 4px 0 8px; padding-left: 20px; }
.expo-reste li { margin: 2px 0; }
.expo-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -4px 16px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -6px 18px rgba(0, 0, 0, .08); }
.expo-dialog { width: min(520px, calc(100vw - 32px)); }
.expo-dialog .num { width: 72px; }
[hidden] { display: none !important; }
.expo-dialog th { white-space: nowrap; }
.expo-form .formule-cards { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.table th, .table td { overflow-wrap: normal; word-break: normal; }
.table th { white-space: nowrap; }
.expo-acces { margin-top: 8px; }
.expo-remise { border-left: 4px solid var(--ok, #1a7f37); }

/* Rythme vertical des panneaux : titres, explications, grilles de champs, avertissements bien espacés */
.panel > h2 { margin: 0 0 10px; }
.panel > h2 + .hint, .panel > h2 + .small { margin-top: -2px; }
.panel:not(.form) > .hint, .panel:not(.form) > p { margin: 0 0 14px; }
.panel:not(.form) > .grid-2, .panel:not(.form) > .grid-3, .panel:not(.form) > .field, .panel:not(.form) > fieldset { margin: 0 0 16px; }
.panel:not(.form) > .notice { margin: 0 0 16px; }
.panel:not(.form) > .check, .panel:not(.form) > label.check { margin: 0 0 12px; }
.panel:not(.form) > h3 { margin: 18px 0 8px; }
.panel > :last-child { margin-bottom: 0; }
.form > .notice { margin: 0; }
.field-hint { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.field > label, .field > .field-label, .field > legend { line-height: 1.35; }
.hint, .panel .small.muted { line-height: 1.5; }
.panel > .table-wrap + .hint, .panel > .table-wrap + p { margin-top: 10px; }
.panel > form + .table-wrap, .panel > form + .notice, .panel > form + p, .panel > .table-wrap + form { margin-top: 16px; }
.field-value { margin: 0; font-weight: 400; } .field > .field-label { color: var(--muted); font-size: 13px; }
/* Modèles d'e-mails */
.modele-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .modele-grid { grid-template-columns: minmax(0, 1fr); } }
.modele-corps { font-family: inherit; line-height: 1.5; }
.modele-vars { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
.modele-vars dd { margin: 0; color: var(--muted); }
.modele-apercu { background: #fff; color: #1d1d1b; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.modele-apercu a { display: inline-block; background: #f08410; color: #030304; padding: 10px 18px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.modele-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.modele-versions summary { cursor: pointer; font-size: 14px; }
.modele-version-texte { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--surface-2); padding: 10px; border-radius: var(--radius); margin: 6px 0 8px; }
/* Tri des colonnes */
.tri-lien { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tri-lien:hover, .tri-lien.actif { color: var(--text); }
.tri-fleche { font-size: 10px; opacity: .45; }
.tri-lien.actif .tri-fleche { opacity: 1; color: var(--accent); }
th.right .tri-lien { justify-content: flex-end; }
.check-col { width: 32px; }
tr.fichier-a-nettoyer td { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.mb { margin-bottom: 16px; }
.champ-erreur-bloc { outline: 1px solid var(--ko); outline-offset: 6px; border-radius: var(--radius); }

/* Paramètres du village : parcours « Préparer le village » */
.prep { max-width: 980px; }
.prep h2 { margin-bottom: 4px; }
.prep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.prep-head progress { flex: 1 1 200px; height: 10px; accent-color: var(--ok, #2f7d4f); }
.prep-list { list-style: none; margin: 8px 0 0; padding: 0; }
.prep-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(120px, 220px) 90px; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.prep-list li:first-child { border-top: 0; }
.prep-avances li { grid-template-columns: minmax(0, 1fr) minmax(80px, 220px); }
.prep-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prep-txt a { font-weight: 600; }
.prep-num { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.prep-list li.ok .prep-num { background: var(--ok, #2f7d4f); border-color: var(--ok, #2f7d4f); color: var(--surface); }
.prep-list li.todo .prep-etat { color: var(--warn); font-weight: 600; }
.prep-list li .btn { justify-self: end; }
.prep-steps a { position: relative; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.prep-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.prep-dot.ok { background: var(--ok, #2f7d4f); border-color: var(--ok, #2f7d4f); color: var(--surface); }
.kicker { margin: 4px 0 0; text-transform: uppercase; letter-spacing: .05em; }
.prep-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.param-dialog { width: min(560px, calc(100vw - 32px)); }
.param-dialog .actions-bar { flex-wrap: wrap; }
.param-dialog .actions-bar .btn-danger { margin-left: auto; }
@media (max-width: 640px) {
  .prep-list li { grid-template-columns: 32px minmax(0, 1fr); }
  .prep-list li .prep-etat { grid-column: 2; }
  .prep-list li .btn { display: none; }
  .prep-avances li { grid-template-columns: minmax(0, 1fr); }
}
.tabs .tab-count { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--line); font-size: .85em; text-align: center; }

/* Accessibilité : lien d'évitement (visible au clavier), mouvements réduits */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 1000; padding: 8px 14px; background: var(--surface); color: var(--text); border: 2px solid var(--focus); border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Pages légales */
.legal { max-width: 860px; }
.legal h2 { margin-top: 28px; }
.legal ul { padding-left: 20px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 32px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.footer-legal { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
.notice a { color: inherit; text-decoration: underline; }
.danger-zone { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.danger-zone p { margin: 0; }
.expo-sur-mesure { margin: 12px 0 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.expo-sur-mesure summary { cursor: pointer; font-weight: 600; }
.expo-sur-mesure[open] summary { margin-bottom: 8px; }

/* Notifications : cloche et liste */
.notif-menu summary { display: inline-flex; align-items: center; gap: 4px; }
.notif-menu .bell { display: block; }
.notif-menu .count-badge { font-size: 11px; min-width: 18px; }
.notif-panel { width: min(360px, calc(100vw - 24px)); }
.notif-panel-head { margin: 0 0 8px; }
.notif-list { list-style: none; margin: 0 0 12px; padding: 0; }
.notif-list li { border-top: 1px solid var(--line); }
.notif-list li:first-child { border-top: 0; }
.notif-list a { display: grid; gap: 2px; padding: 10px 4px; color: var(--text); text-decoration: none; }
.notif-list a:hover .notif-titre { text-decoration: underline; }
.notif-list li.non-lu .notif-titre { font-weight: 700; }
.notif-list li.non-lu .notif-titre::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--brand-strong); vertical-align: middle; }
.notif-list li.lu .notif-titre strong { font-weight: 500; }
.notif-list-compact a { padding: 8px 2px; }
.a-traiter { list-style: none; margin: 0; padding: 0; }
.a-traiter li { border-top: 1px solid var(--line); }
.a-traiter li:first-child { border-top: 0; }
.a-traiter a { display: flex; align-items: center; gap: 12px; padding: 10px 2px; color: var(--text); text-decoration: none; }
.a-traiter a:hover span:last-child { text-decoration: underline; }
.a-traiter .nb { min-width: 34px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.a-traiter .nb.urgent { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.notif-titre { display: flex; flex-direction: column; gap: 1px; }
.notif-titre strong { font-weight: 600; }
.notif-list li.non-lu .notif-titre strong { font-weight: 700; }
.notif-list li.non-lu .notif-titre::before { display: none; }
.notif-list li.non-lu .notif-titre strong::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--brand-strong); vertical-align: middle; }
.notif-qui { font-size: 14px; font-weight: 400; color: var(--text); }
@media (max-width: 640px) {
  .notif-menu { position: static; }
  .notif-menu .notif-panel { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; max-height: calc(100vh - 80px); overflow: auto; z-index: 50; }
}
.banniere-apercu { display: block; width: 100%; max-width: 560px; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: 0 0 8px; }

/* Accueil */
.raccourcis { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.section-title { margin: 28px 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.barre-statuts { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 10px 0 12px; gap: 2px; }
.barre-statuts span { flex: 1 1 0; min-width: 6px; border: 0; background: currentColor !important; opacity: .75; }
.liste-statuts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.liste-statuts a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.liste-statuts a:hover strong { text-decoration: underline; }
.echeances { list-style: none; margin: 0; padding: 0; }
.echeances li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.echeances li:first-child { border-top: 0; }
.echeance-date { min-width: 120px; font-weight: 700; display: flex; flex-direction: column; }
.echeance-date small { font-weight: 400; color: var(--muted); }
.a-traiter li.silencieux { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.a-traiter li.silencieux > a:first-child { flex: 1; min-width: 0; }
.activite { list-style: none; margin: 0 0 8px; padding: 0; }
.activite li { padding: 6px 0; border-top: 1px solid var(--line); }
.activite li:first-child { border-top: 0; }
.kpis-3 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 12px; }
.nouveautes-version > summary { cursor: pointer; }
.nouveautes-version[open] > summary { margin-bottom: 14px; }

/* Comptabilité */
.compta-liste { display: grid; gap: 12px; }
.compta-ligne .compta-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.compta-ligne h2 { margin: 0 0 2px; font-size: 18px; }
.compta-montant { margin: 0; font-size: 20px; font-weight: 700; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.compta-form { margin-top: 10px; }
.w-full { width: 100%; }
.w-md { width: 100%; max-width: 420px; }
.code-acces { font-size: 24px; letter-spacing: .15em; }
.simple-main { min-width: 0; box-sizing: border-box; }
.simple-main .tabs { max-width: 100%; }

/* Campagnes d'e-mails */
.campagne-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .campagne-grille { grid-template-columns: minmax(0, 1fr); } }
.campagne-apercu { position: sticky; top: 12px; }
.apercu-mail { background: #fff; color: #1d1d1b; border: 1px solid #e4e2dc; border-radius: 10px; overflow: hidden; font-family: "Poppins", "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.55; }
.apercu-banniere { display: block; width: 100%; height: auto; }
.apercu-entete { margin: 0; padding: 16px 18px 0; color: #6b6a66; }
.apercu-sujet { margin: 0; padding: 14px 18px 6px; font-size: 19px; font-weight: 600; }
.apercu-corps { padding: 6px 18px 20px; overflow-wrap: anywhere; }
.apercu-corps p { margin: 0 0 14px; }
.apercu-btn span { display: inline-block; background: #f08410; color: #030304; padding: 12px 20px; border-radius: 8px; font-weight: 600; }
.apercu-pied { font-size: 12px; color: #6b6a66; margin-top: 24px !important; }
.sources { display: grid; gap: 8px; margin: 0 0 16px; }
.source { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.source summary { cursor: pointer; font-weight: 600; }
.source[open] summary { margin-bottom: 10px; }
.cases { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.envoi-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.panel-inner { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.panel-inner h3 { margin: 0 0 6px; font-size: 16px; }
.envoi-progression progress { width: 100%; height: 14px; }
.liste-pieces { list-style: none; padding: 0; margin: 0 0 12px; }
.liste-pieces li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.liste-pieces li:first-child { border-top: 0; }
.annuaire-wrap { max-height: 420px; overflow: auto; }
.annuaire-wrap thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* =====================================================================
   Effet verre (option de « Mon profil ») — fond topographique, bandeau,
   menu et fenêtres translucides, barre d'onglets sur téléphone.
   Le contenu (tableaux, formulaires, textes) reste sur des cartes pleines
   pour rester lisible. Sans l'option, rien de ce qui suit ne s'applique.
   ===================================================================== */
body.verre {
  --radius: 14px;
  --bg: #f3f0eb;
  --glass: color-mix(in srgb, var(--surface) 66%, transparent);
  --glass-strong: color-mix(in srgb, var(--surface) 84%, transparent);
  --glass-line: rgba(255, 255, 255, .7);
  --glass-edge: rgba(60, 40, 15, .10);
  --glass-shadow: 0 10px 34px rgba(60, 35, 5, .09), 0 1px 2px rgba(60, 35, 5, .05);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .75);
  --glass-blur: blur(20px) saturate(170%);
  --topo: rgba(110, 80, 45, .13);
  --halo-1: rgba(240, 132, 16, .16);
  --halo-2: rgba(255, 197, 131, .26);
  --shadow: 0 1px 2px rgba(60, 35, 5, .04), 0 6px 20px rgba(60, 35, 5, .05);
  background:
    radial-gradient(55vmax 45vmax at 105% -5%, var(--halo-1), transparent 62%),
    radial-gradient(50vmax 40vmax at -5% 105%, var(--halo-2), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  body.verre {
    --bg: #0f0f0f;
    --glass: color-mix(in srgb, var(--surface) 62%, transparent);
    --glass-strong: color-mix(in srgb, var(--surface) 86%, transparent);
    --glass-line: rgba(255, 255, 255, .09);
    --glass-edge: rgba(255, 255, 255, .06);
    --glass-shadow: 0 12px 36px rgba(0, 0, 0, .45);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .07);
    --topo: rgba(255, 225, 190, .075);
    --halo-1: rgba(240, 132, 16, .13);
    --halo-2: rgba(168, 89, 2, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
/* Courbes de niveau, à peine visibles, fixes derrière tout le contenu */
body.verre::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--topo);
  -webkit-mask: url("img/topo.svg") center / cover no-repeat;
  mask: url("img/topo.svg") center / cover no-repeat;
}

/* Surfaces en verre */
.verre .topbar,
.verre .sidebar,
.verre .user-menu-panel,
.verre .contact-card,
.verre .report-btn,
.verre .sticky-actions,
.verre .expo-top,
.verre .expo-savebar,
.verre .tabbar {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-color: var(--glass-line);
  box-shadow: var(--glass-shadow), var(--glass-hi);
}
.verre .expo-top { border-top-color: var(--brand-strong); border-bottom: 1px solid var(--glass-edge); }
.verre .expo-savebar { border: 1px solid var(--glass-line); background: var(--glass-strong); }
.verre .topbar { border-top-color: var(--brand-strong); border-bottom: 1px solid var(--glass-edge); box-shadow: 0 4px 24px rgba(60, 35, 5, .05), var(--glass-hi); }
.verre .user-menu-panel, .verre .contact-card { background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 16px; }
.verre .contact-card::backdrop { background: rgba(10, 8, 5, .28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.verre .report-btn { border: 1px solid var(--glass-line); }
.verre .sticky-actions { padding: 10px 12px; border: 1px solid var(--glass-line); border-radius: 14px; }
.verre .footer { border-top: 0; }

/* Cartes de contenu : pleines, coins plus doux, ombre légère */
.verre .panel, .verre .tile, .verre .kpi, .verre .card { border-color: var(--glass-edge); box-shadow: var(--shadow); }
.verre .btn, .verre input:not([type="checkbox"]):not([type="radio"]), .verre select, .verre textarea { border-radius: 10px; }
.verre .sidebar a, .verre .nav-soon { border-radius: 10px; }

/* Ordinateur : menu de gauche flottant */
@media (min-width: 861px) {
  .verre .shell { grid-template-columns: 256px minmax(0, 1fr); }
  .verre .sidebar {
    position: sticky; top: 72px; align-self: start;
    margin: 12px 0 16px 12px; max-height: calc(100vh - 88px); overflow: auto;
    border: 1px solid var(--glass-line); border-radius: 18px;
  }
}

/* Téléphone : barre d'onglets en bas, menu complet en panneau */
.tabbar { display: none; }
@media (max-width: 860px) {
  .verre:has(.tabbar) { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .verre .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; z-index: 40; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 6px; border: 1px solid var(--glass-line); border-radius: 22px;
  }
  .tabbar a, .tabbar button {
    display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px; padding: 4px 2px;
    border: 0; border-radius: 16px; background: none; color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 500; letter-spacing: -.01em;
    text-decoration: none; cursor: pointer; min-width: 0;
  }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar .nav-ico { width: 22px; height: 22px; color: inherit; }
  .tabbar a[aria-current="page"], .tabbar a.actif, .tabbar button[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
  .tabbar a[aria-current="page"] .nav-ico, .tabbar a.actif .nav-ico, .tabbar button[aria-expanded="true"] .nav-ico { color: var(--brand-strong); }
  .verre .sidebar > summary { display: none; }
  .verre .sidebar:not([open]) { display: none; }
  .verre .sidebar[open] {
    position: fixed; z-index: 39; left: 8px; right: 8px; bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    max-height: min(70vh, calc(100vh - 160px)); overflow: auto; padding: 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--glass-line); border-radius: 20px;
  }
  /* « Signaler » rangé dans le menu */
  .verre:has(.tabbar) .report-btn { display: none; }
  .verre .nav-signaler {
    display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 9px 10px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: left;
  }
}

/* « Réduire la transparence » (Mac, iPhone…) ou navigateur sans flou : surfaces pleines */
@media (prefers-reduced-transparency: reduce) {
  .verre .topbar, .verre .sidebar, .verre .user-menu-panel, .verre .contact-card, .verre .report-btn, .verre .sticky-actions, .verre .tabbar, .verre .sidebar[open] {
    background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .verre .topbar, .verre .sidebar, .verre .user-menu-panel, .verre .contact-card, .verre .report-btn, .verre .sticky-actions, .verre .tabbar, .verre .sidebar[open] { background: var(--surface); }
}
@media print { body.verre { background: #fff; } body.verre::before, .tabbar { display: none !important; } }

/* ------------------------------------------------------- Carte des provenances */
.carte-panel { padding: 12px; }
.carte-panel { scroll-margin-top: 80px; }
.carte-entete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; padding: 4px 6px 6px; }
.carte-entete h2 { margin: 0 0 8px; }
.carte-filtres { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.carte-filtres .field { margin: 0; min-width: 140px; }
.carte-filtres select { min-height: 36px; padding-top: 4px; padding-bottom: 4px; }
.carte-infos { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 4px 6px 10px; }
.carte-infos p { margin: 0; }
.carte-liste { margin: 12px 6px 0; }
.carte-liste > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.carte-noms { list-style: none; margin: 0; padding: 0; }
.carte-noms li + li { margin-top: 2px; }
.carte-source { margin: 10px 6px 0; }
/* Thème sombre : fond de carte assombri (couleurs inversées, teintes conservées) */
@media (prefers-color-scheme: dark) { .carte .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); } }
.carte-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; }
.carte-legende li { display: inline-flex; align-items: center; gap: 6px; }
.pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.pastille-exposant { background: var(--cat-1); }
.pastille-partenaire { background: var(--cat-2); }
.pastille-mixte { background: var(--cat-7); }
.pastille-base { background: var(--brand-strong); box-shadow: 0 0 0 2px var(--brand-ink); }
.carte { height: 560px; border-radius: 12px; overflow: hidden; background: var(--surface-2); z-index: 0; }
@media (max-width: 860px) { .carte { height: 420px; } }
.carte .leaflet-popup-content-wrapper, .carte .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.carte .leaflet-popup-content { margin: 12px 14px; font: 14px/1.45 "Poppins", system-ui, sans-serif; }
.carte .leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.carte-bulle ul { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; }
.carte-bulle li { margin: 2px 0; }
.carte .leaflet-control-zoom a { background: var(--surface); color: var(--text); border-color: var(--line); }
.carte .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); }
.carte .leaflet-control-attribution a { color: var(--accent); }
.carte .leaflet-tooltip { font-family: "Poppins", system-ui, sans-serif; }
.carte.leaflet-container a { color: var(--accent); }
.carte.leaflet-container .leaflet-control-zoom a { color: var(--text); }

/* ------------------------------------------------------- Règles d'affichage */
.panel-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.panel-head-actions h2 { margin: 0; }
.regle-conditions { display: grid; gap: 6px; }
.regle-critere { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); }
.regle-critere > summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.regle-critere[open] > summary { margin-bottom: 8px; }
.regle-critere .check-inline { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.regles-dossier > summary { cursor: pointer; }
.regles-dossier ul { margin: 10px 0 6px; padding-left: 0; list-style: none; display: grid; gap: 6px; }

/* ------------------------------------------------------- Jour J */
.jourj-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.jourj-grid .panel { display: flex; flex-direction: column; }
.jourj-grid .actions-bar { margin-top: auto; padding-top: 8px; }
.jourj-chiffres { margin: 0 0 8px; padding-left: 18px; }
