@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* =========================================================
   1. Jetons
   Deux palettes complètes, communes au site public et à l'espace GRM :
   jour (clair) et nuit (bleu océan profond). Sans choix enregistré,
   la plateforme suit la préférence du système.
   ========================================================= */
:root {
  color-scheme: light;
  --bg: #f4f7f9; --s1: #ffffff; --s2: #eef3f6; --s3: #e2ebf1;
  --bd: #d5e0e7; --bd2: #b3c5d2;
  --tx: #0b2233; --tx2: #4f6677; --tx3: #7a90a0;
  --acc: #0f77b8; --acc-h: #0b659d; --on-acc: #ffffff; --acc-tx: #0d67a0; --acc-bg: rgb(15 119 184 / 9%);
  --ok: #17704f; --ok-bg: #e2f3ec;
  --warn: #7f5200; --warn-bg: #fbefd2;
  --err: #b42318; --err-bg: #fdece9;
  --info: #0d5f93; --info-bg: #e3f0f9;
  --muted-bg: #e9eef2;
  --focus: #f5c04e; --focus-ring: #0b2233;
  --shadow: 0 1px 2px rgb(11 34 51 / 6%), 0 8px 24px rgb(11 34 51 / 6%);
  --input: #ffffff; --side: #ffffff; --section-alt: #e7eff4;
  --cta: #0b2233; --cta-h: #143550;
  --band: #0b2233; --band-edge: transparent;
  --sea: #5cb9f0; --deep: #0b2233;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #0b2233; --s1: #0f2b40; --s2: #143550; --s3: #1a4060;
  --bd: #224c69; --bd2: #2d5d7e;
  --tx: #eaf2f7; --tx2: #a9c3d3; --tx3: #7d9aae;
  --acc: #0f77b8; --acc-h: #1587cf; --on-acc: #ffffff; --acc-tx: #5cb9f0; --acc-bg: rgb(92 185 240 / 14%);
  --ok: #5fc6a6; --ok-bg: rgb(95 198 166 / 14%);
  --warn: #e9b04e; --warn-bg: rgb(233 176 78 / 14%);
  --err: #f08a7c; --err-bg: rgb(240 138 124 / 13%);
  --info: #8dc6ee; --info-bg: rgb(141 198 238 / 13%);
  --muted-bg: rgb(169 195 211 / 12%);
  --focus-ring: transparent;
  --shadow: none;
  --input: #0b2233; --side: #081b29; --section-alt: #0f2b40;
  --cta: #0f77b8; --cta-h: #1587cf;
  --band: #07192a; --band-edge: #224c69;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b2233; --s1: #0f2b40; --s2: #143550; --s3: #1a4060;
  --bd: #224c69; --bd2: #2d5d7e;
  --tx: #eaf2f7; --tx2: #a9c3d3; --tx3: #7d9aae;
  --acc: #0f77b8; --acc-h: #1587cf; --on-acc: #ffffff; --acc-tx: #5cb9f0; --acc-bg: rgb(92 185 240 / 14%);
  --ok: #5fc6a6; --ok-bg: rgb(95 198 166 / 14%);
  --warn: #e9b04e; --warn-bg: rgb(233 176 78 / 14%);
  --err: #f08a7c; --err-bg: rgb(240 138 124 / 13%);
  --info: #8dc6ee; --info-bg: rgb(141 198 238 / 13%);
  --muted-bg: rgb(169 195 211 / 12%);
  --focus-ring: transparent;
  --shadow: none;
  --input: #0b2233; --side: #081b29; --section-alt: #0f2b40;
  --cta: #0f77b8; --cta-h: #1587cf;
  --band: #07192a; --band-edge: #224c69;
}

/* =========================================================
   2. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--tx); font: 16px/1.6 'Public Sans', Arial, sans-serif; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
.activity-log, .review-list, .portal-list, .step-list { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
a { color: var(--acc-tx); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
table { color: inherit; font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--focus-ring); border-radius: 2px; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--focus); color: #0b2233; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.muted { color: var(--tx2); }
.stack { display: grid; gap: 16px; align-content: start; }

/* Parcours escorte : formulaires et tableaux lisibles sur petits écrans. */
.filter-bar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.filter-bar .form-field, .form-field { display: grid; gap: 6px; min-width: 0; }
.escort-register__tabs { display: flex; overflow-x: auto; gap: 6px; border-bottom: 1px solid var(--bd); }
.payment-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.payment-guide > div { padding: 14px 16px; border: 1px solid var(--bd); border-left: 4px solid var(--acc); border-radius: 8px; background: var(--s1); }
.payment-guide__title, .escort-register__section-title { font-size: 17px; }
.payment-guide p { color: var(--tx2); font-size: 14.5px; }
.page-band p a { color: inherit; }
.escort-register__local-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.escort-register__local-filter .form-field { flex: 0 1 260px; }
.staff-main > .escort-register__tabs { margin-bottom: 18px; }
.escort-register__tabs a { flex: none; padding: 11px 16px; color: var(--tx2); font-weight: 650; text-decoration: none; border-bottom: 3px solid transparent; }
.escort-register__tabs a:hover, .escort-register__tabs a[aria-current="page"] { color: var(--acc-tx); border-bottom-color: var(--acc); }
.escort-register__toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--tx2); }
.escort-register__toolbar strong { color: var(--tx); }
.escort-register.page-section { padding-top: 22px; }
.escort-register__filters { display: grid; gap: 16px; padding: 16px 18px 0; border: 1px solid var(--bd); border-radius: 8px; background: var(--s1); }
.escort-register__filter-row { display: flex; align-items: end; justify-content: space-between; gap: 18px 12px; }
.escort-register__date-filters, .escort-register__choice-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 6px; min-width: 0; }
.escort-register__date-filters { flex: 0 0 auto; flex-wrap: nowrap; }
.escort-register__choice-filters { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; margin-left: auto; }
.escort-register__date-filters .form-field { flex: 0 0 140px; }
.escort-register__date-filters .escort-register__date-kind { flex-basis: 130px; }
.escort-register__choice-filters .form-field { flex: 0 1 130px; }
.escort-register__filters .form-field label { font-size: 12px; line-height: 1.25; }
.escort-register__filters .form-field input, .escort-register__filters .form-field select { min-height: 38px; padding: 6px 9px; font-size: 13px; }
.escort-register__filter-actions { display: flex; align-items: center; gap: 5px; padding-bottom: 1px; }
.escort-register__filter-actions .btn, .escort-register__table-tools .btn { min-height: 38px; padding: 7px 10px; font-size: 13px; white-space: nowrap; }
.escort-register__table-tools { display: flex; align-items: end; justify-content: flex-end; gap: 8px; padding: 12px 0; border-top: 1px solid var(--bd); }
.escort-register__table-tools .escort-register__search { width: min(100%, 300px); }
.escort-register__table-tools .escort-register__sort { width: 150px; }
.escort-register__pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--tx2); }
.escort-register__subline { display: block; margin-top: 3px; color: var(--tx2); }
.escort-register--demands .table-scroll table { min-width: 1080px; }
.escort-register--invoices .table-scroll table { min-width: 1590px; }
.escort-register--virements .table-scroll table { min-width: 1240px; }
.escort-register .table-scroll { scrollbar-color: var(--bd2) transparent; }
.escort-register .form-error { color: var(--err); }
.form-field label { font-size: 14px; font-weight: 600; color: var(--tx2); }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--bd2); border-radius: 6px; background: var(--input); }
.form-field textarea { min-height: 100px; resize: vertical; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.table-scroll th, .table-scroll td { padding: 12px 14px; border-bottom: 1px solid var(--bd); text-align: left; vertical-align: middle; }
.table-scroll th { background: var(--s2); color: var(--tx2); font-weight: 600; white-space: nowrap; }
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll tbody tr:hover { background: var(--acc-bg); }
.table-scroll td { overflow-wrap: anywhere; }
.stack > .card, .card__body > .table-scroll { min-width: 0; }
.escorte-page .card__body form { display: grid; gap: 10px; justify-items: start; }
.escorte-page .card__body form input:not([type="hidden"]), .escorte-page .card__body form textarea { width: min(100%, 600px); min-height: 44px; padding: 9px 12px; border: 1px solid var(--bd2); border-radius: 6px; background: var(--input); }
.escorte-page .card__body form textarea { min-height: 100px; resize: vertical; }
.escorte-page .card__body form label { color: var(--tx2); font-size: 14px; font-weight: 600; }
.escorte-page .card__body form .btn { width: auto; }

/* Formulaire de demande/modification d'escorte : sections + récapitulatif en direct */
.escorte-form-layout { display: grid; gap: 24px; align-items: start; }
.escorte-recap { align-self: start; }
.escorte-recap .card__body { gap: 14px; }
.escorte-recap h2 { font-size: 16px; }
.escorte-recap__list { display: grid; gap: 10px; margin: 0; }
.escorte-recap__list > div { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--bd); }
.escorte-recap__list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.escorte-recap__list dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--tx2); }
.escorte-recap__list dd { margin: 0; font-size: 15px; font-weight: 600; color: var(--tx); word-break: break-word; }
.escorte-recap__list dd.is-empty { color: var(--tx2); font-weight: 400; }
@media (min-width: 960px) {
  .escorte-form-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .escorte-recap { position: sticky; top: 24px; }
}
@media (max-width: 600px) { .filter-bar { grid-template-columns: minmax(0, 1fr); } .filter-bar .btn { width: 100%; } }
@media (max-width: 1380px) { .escort-register__filter-row { align-items: stretch; flex-direction: column; } .escort-register__date-filters, .escort-register__choice-filters { flex-wrap: wrap; } .escort-register__choice-filters { justify-content: flex-end; margin-left: 0; } }
@media (max-width: 600px) { .escort-register__filters { padding-inline: 12px; } .escort-register__date-filters .form-field, .escort-register__choice-filters .form-field { flex: 1 1 calc(50% - 4px); } .escort-register__choice-filters { justify-content: flex-start; } .escort-register__filter-actions { width: 100%; } .escort-register__filter-actions .btn { flex: 1; } .escort-register__table-tools { flex-wrap: wrap; } .escort-register__table-tools .escort-register__search { flex: 1 1 100%; max-width: none; } .escort-register__table-tools .escort-register__sort { flex: 1 1 140px; width: auto; } }
@media (max-width: 860px) { .table-scroll .data-table--cards { min-width: 0; } }
@media (max-width: 860px) { .escort-register .table-scroll .data-table--cards { min-width: 0; } }

/* =========================================================
   3. Composants
   ========================================================= */

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--bd2); border-radius: 6px; background: var(--s1); color: var(--tx); font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn:hover { background: var(--s2); border-color: var(--tx3); }
.btn--primary { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.btn--primary:hover { background: var(--acc-h); border-color: var(--acc-h); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--tx2); }
.btn--ghost:hover { background: var(--s2); color: var(--tx); border-color: transparent; }
.btn--danger { background: transparent; border-color: var(--err); color: var(--err); }
.btn--danger:hover { background: var(--err-bg); border-color: var(--err); }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn--lg { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.btn--block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.link-button { padding: 0; border: 0; background: none; color: var(--acc-tx); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Champs */
.field { display: grid; gap: 6px; align-content: start; }
.field__label { font-size: 15px; font-weight: 600; }
.field__label .optional { color: var(--tx2); font-weight: 400; }
.field__help { color: var(--tx2); font-size: 14px; }
.field__error { color: var(--err); font-size: 14.5px; font-weight: 600; }
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea,
.control { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--bd2); border-radius: 6px; background-color: var(--input); color: var(--tx); font-size: 16px; }
.field textarea { min-height: 96px; resize: vertical; }
.field select, select.control { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--tx2) 50%), linear-gradient(135deg, var(--tx2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:hover, .field select:hover, .field textarea:hover, .control:hover { border-color: var(--tx3); }
.field input:focus, .field select:focus, .field textarea:focus, .control:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus-ring); box-shadow: none; }
.field--error { padding-left: 14px; border-left: 4px solid var(--err); }
.field--error input, .field--error select, .field--error textarea, .field--error .phone-control { border-color: var(--err) !important; }
.phone-control { display: flex; overflow: hidden; border: 1.5px solid var(--bd2); border-radius: 6px; background: var(--input); }
.phone-control__prefix { display: grid; place-items: center; padding: 0 12px; border-right: 1.5px solid var(--bd2); background: var(--s2); color: var(--tx2); font-weight: 600; }
.field .phone-control input { border: 0 !important; border-radius: 0; background: transparent; }
.phone-control:focus-within { outline: 3px solid var(--focus); border-color: var(--focus-ring); }
.field .phone-control input:focus { outline: none; }
.password-control { position: relative; }
.field .password-control input { padding-right: 52px; }
.password-toggle { position: absolute; top: 50%; right: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; transform: translateY(-50%); border: 0; border-radius: 6px; background: transparent; color: var(--tx2); cursor: pointer; }
.password-toggle svg { width: 22px; height: 22px; }
.password-toggle:hover { color: var(--tx); }
.password-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.password-toggle__hide, .password-toggle[aria-pressed="true"] .password-toggle__show { display: none; }
.password-toggle[aria-pressed="true"] .password-toggle__hide { display: grid; }
.choices { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; }
.choices legend { margin-bottom: 6px; padding: 0; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; font-size: 15.5px; }
.choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--acc); flex: none; }
.form { display: grid; gap: 22px; }
.form__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.form-note { color: var(--tx2); font-size: 14px; }

/* Récapitulatif d'erreurs */
.error-summary { display: grid; gap: 8px; padding: 16px 18px; border: 3px solid var(--err); border-radius: 8px; background: var(--err-bg); }
.error-summary h2 { font-size: 17px; color: var(--tx); }
.error-summary ul { padding-left: 18px; }
.error-summary a { color: var(--err); font-weight: 600; }

/* Messages */
.messages { display: grid; gap: 10px; }
.message { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--bd); border-left-width: 5px; border-radius: 8px; background: var(--s1); font-size: 15px; }
.message svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.message--success { border-left-color: var(--ok); }
.message--success svg { color: var(--ok); }
.message--error { border-left-color: var(--err); }
.message--error svg { color: var(--err); }
.message--warning { border-left-color: var(--warn); }
.message--warning svg { color: var(--warn); }
.message--info svg, .message--debug svg { color: var(--info); }
.message--info, .message--debug { border-left-color: var(--info); }

/* Statuts */
.status { display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 13.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status--ok { background: var(--ok-bg); color: var(--ok); }
.status--warn { background: var(--warn-bg); color: var(--warn); }
.status--err { background: var(--err-bg); color: var(--err); }
.status--info { background: var(--info-bg); color: var(--info); }
.status--muted { background: var(--muted-bg); color: var(--tx2); }
.status--muted::before { background: transparent; border: 1.5px solid currentColor; }

/* Cartes et panneaux */
.card { border: 1px solid var(--bd); border-radius: 10px; background: var(--s1); box-shadow: var(--shadow); }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--bd); }
.card__head small { color: var(--tx2); font-size: 13.5px; }
.card__body { display: grid; gap: 16px; padding: 20px; }
.card--alt { background: var(--s2); }
.kicker { color: var(--tx2); font-size: 13.5px; font-weight: 600; }
.facts { display: grid; grid-template-columns: minmax(140px, 190px) 1fr; gap: 10px 18px; font-size: 15px; }
.facts dt { color: var(--tx2); }
.facts dd { overflow-wrap: anywhere; }
.activity-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--bd); border-radius: 8px; }
.activity-row__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.activity-row form { margin: 0; }

/* État vide */
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 40px 20px; text-align: center; color: var(--tx2); }
.empty-state svg { width: 32px; height: 32px; color: var(--tx3); margin-bottom: 4px; }
.empty-state strong { color: var(--tx); font-size: 17px; }

/* Tableaux */
.table-wrap { position: relative; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 0; border-bottom: 1px solid var(--bd); background: var(--s2); color: var(--tx2); font-size: 13.5px; font-weight: 600; text-align: left; white-space: nowrap; }
.data-table th > span, .data-table th > a { display: flex; align-items: center; gap: 6px; padding: 11px 14px; }
.data-table th > a { color: inherit; text-decoration: none; }
.data-table th > a:hover { color: var(--tx); }
.data-table th svg { width: 12px; height: 12px; opacity: .5; }
.data-table th[aria-sort] { color: var(--tx); }
.data-table th[aria-sort] svg { opacity: 1; color: var(--acc-tx); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--bd); vertical-align: middle; }
.data-table tbody tr:hover td { background: var(--acc-bg); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .sub { display: block; color: var(--tx2); font-size: 13.5px; overflow-wrap: anywhere; }
.data-table .nowrap { white-space: nowrap; }
.person { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.person strong { overflow-wrap: anywhere; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--s3); color: var(--tx); font-size: 13px; font-weight: 700; flex: none; }
.avatar--company { background: var(--acc-bg); color: var(--acc-tx); }
.avatar--admin { background: var(--ok-bg); color: var(--ok); }
.row-link { font-weight: 600; white-space: nowrap; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--bd); color: var(--tx2); font-size: 14.5px; }
.pagination__pages { display: flex; flex-wrap: wrap; gap: 4px; }
.pagination__pages a, .pagination__pages span { display: grid; place-items: center; min-width: 38px; min-height: 38px; padding: 0 10px; border-radius: 6px; color: var(--tx); font-weight: 500; text-decoration: none; }
.pagination__pages a:hover { background: var(--s2); }
.pagination__pages [aria-current="page"] { background: var(--acc); color: var(--on-acc); font-weight: 700; }
.pagination__pages .is-disabled { color: var(--tx3); }

/* Puces de filtres */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--tx2); font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 12px; border: 1px solid var(--bd2); border-radius: 999px; background: var(--s3); color: var(--tx); font-size: 14px; }
.chip a { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--tx2); text-decoration: none; }
.chip a:hover { background: var(--bd2); color: var(--tx); }
.chip svg { width: 12px; height: 12px; }

/* Bascule jour / nuit */
.theme-toggle { display: inline-flex; flex: none; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--bd2); border-radius: 999px; background: var(--s2); color: var(--tx2); }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { border-color: var(--tx3); color: var(--tx); }
.theme-toggle__option { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; transition: background-color .2s, color .2s; }
.theme-toggle svg { width: 17px; height: 17px; }
:root:not([data-theme="dark"]) .theme-toggle__option--light,
:root[data-theme="dark"] .theme-toggle__option--dark { background: var(--acc); color: #fff; }

/* Code à usage unique */
.one-time { display: grid; gap: 12px; padding: 22px; border: 2px dashed var(--acc-tx); border-radius: 10px; background: var(--acc-bg); }
.one-time__code { font-size: clamp(24px, 4vw, 34px); font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.one-time__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* En-tête de page */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head__lead { max-width: 70ch; margin-top: 6px; color: var(--tx2); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { margin-bottom: 6px; color: var(--tx2); font-size: 14px; font-weight: 500; }
.crumbs a { color: var(--tx2); }

/* =========================================================
   4. Site public
   ========================================================= */
.site-header { position: relative; z-index: 10; border-bottom: 1px solid var(--bd); background: var(--s1); }
.site-header__inner { display: flex; align-items: center; gap: 16px; min-height: 78px; }
.site-header__inner .site-nav { margin-left: auto; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--tx); text-decoration: none; }
.brand__logo { width: 38px; height: 38px; flex: none; }
.brand__text strong { display: block; font-size: 18px; line-height: 1.1; letter-spacing: .02em; }
.brand__text small { display: block; color: var(--tx2); font-size: 12.5px; line-height: 1.3; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.site-nav a, .site-nav .nav-button { padding: 8px 12px; border: 0; border-radius: 6px; background: none; color: var(--tx2); font-size: 15px; font-weight: 500; text-decoration: none; }
.site-nav a:hover, .site-nav .nav-button:hover { background: var(--s2); color: var(--tx); }
.site-nav a[aria-current="page"] { border-radius: 0; box-shadow: inset 0 -2px 0 var(--acc); color: var(--tx); }
.site-nav .nav-cta { margin-left: 6px; background: var(--cta); color: #fff; font-weight: 600; }
.site-nav .nav-cta:hover { background: var(--cta-h); color: #fff; }
.site-nav form { margin: 0; }
.nav-toggle { display: none; }

.site-main { display: block; }
.site-notices { padding-top: 20px; }

.page-band { position: relative; overflow: hidden; border-bottom: 1px solid var(--band-edge); background: var(--band); color: #fff; }
.page-band::before { content: ''; position: absolute; inset: 0; opacity: .6; background: radial-gradient(circle at 85% 10%, #1f5a85 0, transparent 40%), repeating-linear-gradient(0deg, transparent 0 54px, #ffffff0a 55px 56px); pointer-events: none; }
.page-band .wrap { position: relative; padding-block: 44px 48px; }
.page-band h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.025em; }
.page-band p { max-width: 62ch; margin-top: 10px; color: #d3e3ee; font-size: 17px; }
.page-band .crumbs, .page-band .crumbs a { color: #a9c6da; }
.eyebrow { display: flex; align-items: center; gap: 11px; color: var(--acc-tx); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow__line { width: 24px; height: 1px; background: currentColor; }
.eyebrow--light { color: var(--sea); }

.page-section { padding-block: 40px 64px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 48px; align-items: start; }
.split-layout__aside { display: grid; gap: 14px; color: var(--tx2); }
.split-layout__aside h2 { color: var(--tx); }
.split-layout__aside strong { color: var(--tx); }
.form-panel { padding: clamp(20px, 3vw, 32px); }
.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.access-grid .card__body { padding: clamp(20px, 3vw, 30px); gap: 18px; }
.confirmation { display: grid; gap: 14px; max-width: 680px; padding: 32px; border-top: 5px solid var(--ok); }
.confirmation h1 { font-size: clamp(24px, 3vw, 30px); }

/* Accueil (structure historique conservée) */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--band-edge); background: var(--band); color: #fff; }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .6; background: radial-gradient(circle at 78% 22%, #1f5a85 0, transparent 44%), repeating-linear-gradient(0deg, transparent 0 54px, #ffffff0a 55px 56px); pointer-events: none; }
.hero__grid { position: relative; display: grid; grid-template-columns: 1.06fr .94fr; align-items: center; gap: clamp(36px, 5vw, 72px); min-height: 560px; padding-block: 72px 84px; }
.hero__copy { max-width: 640px; }
.hero h1 { margin: 22px 0; font-size: clamp(40px, 5.2vw, 64px); line-height: 1.06; letter-spacing: -.035em; }
.hero h1 em { display: block; color: var(--sea); font-style: normal; }
.hero__lead { max-width: 530px; color: #d3e3ee; font-size: 17.5px; line-height: 1.7; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 26px; }
.hero__note { max-width: 470px; padding-left: 14px; border-left: 2px solid #6e9bb8; color: #afc6d6; font-size: 14px; }
.btn--sea { background: var(--sea); border-color: var(--sea); color: #06243a; }
.btn--sea:hover { background: #86ccf5; border-color: #86ccf5; }
.btn--outline-light { background: transparent; border-color: #7fa6c0; color: #fff; }
.btn--outline-light:hover { background: #ffffff12; border-color: #fff; }
.hero__graphic { position: relative; display: grid; place-items: center; min-height: 400px; }
.hero__graphic::before { content: ''; position: absolute; width: min(450px, 100%); aspect-ratio: 1; border: 1px solid #ffffff20; border-radius: 50%; box-shadow: 0 0 0 52px #ffffff06, 0 0 0 104px #ffffff04; }
.hero__graphic::after { content: ''; position: absolute; top: 38px; right: 75px; width: 11px; height: 11px; border-radius: 50%; background: var(--sea); box-shadow: 0 0 0 7px rgb(92 185 240 / 18%); }
.chart-card { position: relative; width: min(440px, 100%); padding: 26px 28px; border: 1px solid #ffffff30; border-radius: 14px; background: rgb(20 53 80 / 94%); box-shadow: 0 25px 70px rgb(3 16 27 / 50%); transform: rotate(-3deg); }
.chart-card__top { display: flex; justify-content: space-between; gap: 15px; color: #b5d3e6; font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.chart-card__route { position: relative; display: flex; align-items: center; justify-content: space-between; height: 133px; padding-inline: 8px; }
.chart-card__route::before { content: ''; position: absolute; left: 9px; right: 9px; top: 50%; height: 2px; background: linear-gradient(90deg, var(--sea), #5e86a2); }
.route-point { position: relative; width: 15px; height: 15px; border: 3px solid var(--sea); border-radius: 50%; background: #143550; box-shadow: 0 0 0 6px rgb(92 185 240 / 14%); }
.route-point--first, .route-point--fourth { width: 19px; height: 19px; background: var(--sea); }
.chart-card__labels { display: flex; justify-content: space-between; gap: 8px; color: #d2e4ef; font-size: 12px; }
.chart-card__footer { display: flex; align-items: center; gap: 11px; margin-top: 29px; padding-top: 17px; border-top: 1px solid #ffffff27; color: #b7cddb; font-size: 13px; }
.chart-card__symbol { color: var(--sea); font-size: 19px; }
.hero__coordinates { position: absolute; right: 0; bottom: 6px; color: #98b6ca; font-size: 11px; letter-spacing: .15em; }
.section { padding-block: 88px; }
.section__intro { max-width: 580px; margin-bottom: 36px; }
.section h2 { margin: 14px 0; font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -.02em; }
.section__intro > p:last-child, .path-grid__aside { color: var(--tx2); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.service-card { display: flex; flex-direction: column; min-height: 260px; padding: 27px; border: 1px solid var(--bd); border-radius: 9px; background: var(--s1); transition: border-color .18s, transform .18s; }
.service-card:hover { transform: translateY(-3px); border-color: var(--bd2); }
.service-card__index { color: var(--acc-tx); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.service-card h3 { margin: 22px 0 12px; font-size: 21px; }
.service-card p { color: var(--tx2); font-size: 15px; }
.service-card__status { margin-top: auto; padding-top: 17px; border-top: 1px solid var(--bd); color: var(--acc-tx); font-size: 12.5px; font-weight: 700; }
.section--muted { background: var(--section-alt); }
.path-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 7vw, 88px); }
.path-grid__aside { max-width: 400px; }
.step-list { padding: 0; list-style: none; }
.step-list li { display: flex; gap: 21px; padding: 20px 0; border-bottom: 1px solid var(--bd); }
.step-list li:first-child { padding-top: 0; }
.step-list li > span { flex: 0 0 42px; color: var(--acc-tx); font-size: 16px; font-weight: 800; }
.step-list h3 { margin-bottom: 6px; font-size: 17px; }
.step-list p { color: var(--tx2); font-size: 15px; }

.site-footer { border-top: 1px solid var(--bd); background: var(--s1); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; min-height: 88px; padding-block: 20px; color: var(--tx2); font-size: 14px; }
.site-footer strong { color: var(--tx); }

/* Espace société */
.portal-list { display: grid; gap: 16px; }
.portal-list .stats-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; padding: 0; list-style: none; }
.portal-list .stats-tiles li { min-width: 0; }
.portal-list .stats-tiles a { display: grid; align-content: center; min-height: 92px; padding: 12px 14px; border: 1px solid var(--bd); border-radius: 8px; background: var(--s2); color: var(--tx2); font-size: 13px; font-weight: 600; line-height: 1.35; text-decoration: none; }
.portal-list .stats-tiles a:hover { border-color: var(--acc); background: var(--acc-bg); }
.portal-list .stats-tiles strong { color: var(--tx); font-size: 25px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.portal-list .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* =========================================================
   5. Espace GRM
   ========================================================= */
.staff-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.staff-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; border-right: 1px solid var(--bd); background: var(--side); }
.staff-sidebar .brand { padding: 18px 20px 16px; border-bottom: 1px solid var(--bd); }
.staff-nav { display: grid; gap: 2px; padding: 12px 10px; }
.staff-nav__group { padding: 14px 10px 6px; color: var(--tx3); font-size: 12.5px; font-weight: 600; }
.staff-nav a, .staff-nav__future { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 6px; color: var(--tx2); font-size: 15px; font-weight: 500; text-decoration: none; }
.staff-nav a:hover { background: var(--s1); color: var(--tx); }
.staff-nav a[aria-current="page"] { background: var(--s2); box-shadow: inset 3px 0 0 var(--acc-tx); color: var(--tx); }
.staff-nav svg { width: 18px; height: 18px; flex: none; }
.staff-nav__count { margin-left: auto; padding: 0 7px; border-radius: 10px; background: var(--acc); color: var(--on-acc); font-size: 12px; font-weight: 700; line-height: 20px; }
.staff-nav__future { opacity: .55; }
.staff-nav__future small { margin-left: auto; font-size: 11.5px; white-space: nowrap; }
.staff-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding: 14px 16px; border-top: 1px solid var(--bd); font-size: 14px; }
.staff-identity > div { min-width: 0; flex: 1; }
.staff-identity strong { overflow-wrap: anywhere; }
.staff-identity small { display: block; color: var(--tx2); font-size: 13px; }
.staff-identity form { flex: 1 0 100%; margin: 0; }
.staff-identity form .btn { width: 100%; justify-content: flex-start; border-color: var(--bd); }
.staff-workspace { min-width: 0; }
.staff-topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; min-height: 62px; padding: 0 28px; border-bottom: 1px solid var(--bd); background: var(--bg); }
.staff-topbar__brand { display: none; }
.staff-search { position: relative; flex: 0 1 420px; margin: 0; }
.staff-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; color: var(--tx3); transform: translateY(-50%); pointer-events: none; }
.staff-search input { width: 100%; min-height: 40px; padding: 8px 12px 8px 36px; border: 1.5px solid var(--bd2); border-radius: 6px; background: var(--s1); color: var(--tx); font-size: 15px; }
.staff-search input:focus { outline: 3px solid var(--focus); outline-offset: 0; }
.staff-topbar__end { display: flex; align-items: center; gap: 16px; margin-left: auto; color: var(--tx2); font-size: 14px; }
.staff-topbar__end a { color: var(--tx2); }
.staff-topbar__logout { display: none; margin: 0; }
.staff-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; min-width: 0; padding: 28px 28px 48px; }
.staff-tabbar { display: none; }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { display: grid; align-content: start; gap: 4px; padding: 16px 18px; border: 1px solid var(--bd); border-radius: 10px; background: var(--s1); color: var(--tx); text-decoration: none; }
a.kpi:hover { border-color: var(--bd2); background: var(--s2); }
.kpi span { color: var(--tx2); font-size: 14px; font-weight: 500; }
.kpi strong { font-size: 34px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.kpi small { color: var(--tx2); font-size: 13.5px; }
a.kpi small { color: var(--acc-tx); font-weight: 600; }
.kpi--alert { border-color: var(--err); }
.kpi--alert strong { color: var(--err); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.activity-log li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 20px; border-top: 1px solid var(--bd); font-size: 14.5px; }
.activity-log li:first-child { border-top: 0; }
.activity-log__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--s2); color: var(--tx2); }
.activity-log__icon svg { width: 15px; height: 15px; }
.activity-log__icon--ok { background: var(--ok-bg); color: var(--ok); }
.activity-log__icon--warn { background: var(--warn-bg); color: var(--warn); }
.activity-log__icon--err { background: var(--err-bg); color: var(--err); }
.activity-log small { display: block; color: var(--tx2); font-size: 13.5px; }
.activity-log time { color: var(--tx2); font-size: 13.5px; white-space: nowrap; }
.quick-links { display: grid; gap: 10px; }
.quick-links .btn { justify-content: space-between; }

/* File d'inscription */
.review-list { display: grid; }
.review-item { display: grid; gap: 12px; padding: 18px 20px; border-top: 1px solid var(--bd); }
.review-item:first-child { border-top: 0; }
.review-item__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; }
.review-item__head h2, .review-item__head h3 { font-size: 17px; }
.review-item__head span:not(.status) { color: var(--tx2); font-size: 14px; }
.review-item__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 18px; font-size: 14.5px; }
.review-item__facts dt { color: var(--tx2); font-size: 13.5px; }
.review-item__facts dd { overflow-wrap: anywhere; }
.review-item__actions { display: grid; gap: 14px; justify-items: start; padding-top: 4px; }
.review-item__approve { display: flex; flex-wrap: wrap; gap: 10px; }
.review-item__actions form { margin: 0; }
.reject-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; width: min(560px, 100%); padding-top: 14px; border-top: 1px dashed var(--bd); }
.reject-form .field { flex: 1 1 260px; }
.reject-form .field input { min-height: 38px !important; padding-block: 6px !important; font-size: 15px !important; }

/* Répertoire */
.filters { display: grid; gap: 14px; padding: 16px; }
.filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filters__grid .field--wide { grid-column: span 2; }
.filters .field__label { color: var(--tx2); font-size: 13.5px; }
.filters .field input:not([type="checkbox"]), .filters .field select { min-height: 42px; padding-block: 8px; font-size: 15px; }
.filters__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.member-table .person small { display: block; overflow-wrap: anywhere; }
.activity-row--compact { padding: 4px 0; border: 0; }
.ticket-message { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--bd2); background: var(--s2); overflow-wrap: anywhere; }
.ticket-reply { padding: 10px 14px; border: 1px solid var(--bd); border-radius: 8px; overflow-wrap: anywhere; }
.ticket-reply--system { border-style: dashed; color: var(--tx2); }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--acc); color: #fff; font-size: 12px; font-weight: 700; }
.notification-list { margin: 0; padding: 0; list-style: none; }
.notification-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--bd); overflow-wrap: anywhere; }
.notification-item:first-child { border-top: 0; }
.notification-item--unread { border-left: 4px solid var(--acc); }
.notification-item p { margin: 4px 0; color: var(--tx2); }
.activity-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.filters__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--bd); color: var(--tx2); font-size: 14.5px; }
.result-bar strong { color: var(--tx); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* Formulaire en sections : titre à gauche, champs en grille sur toute la largeur */
/* disposition pilotée par la largeur de la carte (la barre latérale GRM varie) : trois colonnes ou une, jamais deux avec un champ orphelin */
.form-sheet { display: grid; overflow: hidden; container: sheet / inline-size; }
.form-sheet__errors { padding: 24px clamp(20px, 3vw, 36px) 0; }
.form-sheet__section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px clamp(28px, 4vw, 56px); padding: clamp(24px, 3vw, 36px); border-top: 1px solid var(--bd); }
.form-sheet > .form-sheet__section:first-of-type { border-top: 0; }
.form-sheet__head { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-content: start; }
.form-sheet__index { grid-row: span 2; padding-top: 1px; color: var(--acc-tx); font-size: 13px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.form-sheet__head h2 { font-size: 18px; }
.form-sheet__head p { color: var(--tx2); font-size: 14px; }
.form-sheet__body { display: grid; gap: 20px; }
.form-sheet__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 18px clamp(24px, 3vw, 36px); border-top: 1px solid var(--bd); background: var(--s2); }
.form-sheet__actions .form__actions { margin-left: auto; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px 24px; align-items: start; }
/* erreur et aide passent sous la saisie : les champs d'une même ligne restent alignés */
.form-grid .field > input, .form-grid .field > textarea, .form-grid .field > select, .form-grid .phone-control { order: 1; }
.form-grid .field__error { order: 2; }
.form-grid .field__help { order: 3; }
.form-grid__full { grid-column: 1 / -1; }
.form-grid__full .field textarea { min-height: 76px; }

/* Encadré de consignes */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--bd); border-left: 4px solid var(--info); border-radius: 8px; background: var(--info-bg); font-size: 15px; }
.notice > svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--info); }
.notice strong { display: block; margin-bottom: 4px; }
.notice ul { display: grid; gap: 3px; padding-left: 18px; color: var(--tx2); }
.notice b { color: var(--tx); font-weight: 600; }

/* Choix multiples en tuiles */
.tile-choices { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.tile-choices legend { margin-bottom: 10px; padding: 0; }
.tile-choices__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container sheet (min-width: 700px) {
  .form-grid, .tile-choices__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container sheet (min-width: 1040px) {
  .form-sheet__section { grid-template-columns: 200px minmax(0, 1fr); }
}
.tile-choice { display: flex; align-items: flex-start; gap: 12px; min-height: 64px; padding: 14px 16px; border: 1.5px solid var(--bd2); border-radius: 8px; background: var(--input); cursor: pointer; transition: border-color .15s, background-color .15s; }
.tile-choice:hover { border-color: var(--tx3); }
.tile-choice input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--acc); flex: none; }
.tile-choice__text { display: grid; gap: 2px; }
.tile-choice__text strong { font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.tile-choice__text small { color: var(--tx2); font-size: 13.5px; }
.tile-choice:has(input:checked) { border-color: var(--acc); background: var(--acc-bg); box-shadow: inset 0 0 0 1px var(--acc); }
.tile-choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.field--error .tile-choice { border-color: var(--err); }

/* =========================================================
   6. Adaptation mobile
   ========================================================= */
@media (max-width: 1100px) {
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .review-item__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .wrap { width: calc(100% - 32px); }
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; }
  .js .site-header .theme-toggle { margin-left: auto; }
  .js .site-header.is-open .site-nav { position: absolute; left: 0; right: 0; top: 100%; display: grid; justify-content: stretch; gap: 2px; padding: 8px 16px 16px; border-bottom: 1px solid var(--bd); background: var(--s1); box-shadow: var(--shadow); }
  .site-nav .nav-cta { margin: 6px 0 0; text-align: center; }
  .site-header__inner { min-height: 66px; }
  .hero__grid, .path-grid, .service-grid, .split-layout, .access-grid, .two-cols { grid-template-columns: 1fr; }
  .hero__grid { min-height: 0; padding-block: 44px 52px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__graphic { min-height: 300px; }
  .hero__graphic::before { width: 300px; }
  .hero__graphic::after { right: 24px; }
  .section { padding-block: 52px; }
  .service-card { min-height: 0; }
  .split-layout { gap: 24px; }
  .page-band .wrap { padding-block: 32px 36px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }

  .staff-shell { grid-template-columns: 1fr; }
  .staff-sidebar { display: none; }
  .staff-topbar { padding: 0 16px; }
  .staff-topbar__brand { display: inline-flex; }
  .staff-topbar__brand .brand__logo { width: 30px; height: 30px; }
  .staff-search { display: none; }
  .staff-topbar__logout { display: block; }
  .staff-topbar__end > a { display: none; }
  .staff-main { padding: 20px 16px 96px; }
  .staff-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; overflow-x: auto; scrollbar-width: thin; padding-bottom: env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--bd); background: var(--side); }
  .staff-tabbar a { display: grid; flex: 1 0 64px; justify-items: center; align-content: center; gap: 2px; min-height: 62px; padding-inline: 3px; color: var(--tx2); font-size: 11px; font-weight: 500; text-decoration: none; }
  .staff-tabbar a[aria-current="page"] { color: var(--acc-tx); }
  .staff-tabbar svg { width: 21px; height: 21px; }
  .filters__grid .field--wide { grid-column: 1 / -1; }
  .filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-item__facts { grid-template-columns: 1fr; }

  /* le tableau des utilisateurs devient une liste de fiches */
  .data-table--cards thead { display: none; }
  .data-table--cards, .data-table--cards tbody, .data-table--cards tr, .data-table--cards td { display: block; }
  .data-table--cards tr { padding: 14px 16px; border-bottom: 1px solid var(--bd); }
  .data-table--cards td { padding: 3px 0; border: 0; }
  .data-table--cards td[data-label]::before { content: attr(data-label) " : "; color: var(--tx2); font-size: 13.5px; }
  .data-table--cards td.cell-person { margin-bottom: 4px; }
  .data-table--cards td.cell-action { margin-top: 6px; }
  .data-table--cards tbody tr:hover td { background: none; }
}

@media (max-width: 520px) {
  .kpi strong { font-size: 28px; }
  .filters { padding: 12px; }
  .filters__grid { gap: 10px; }
  .filters__buttons, .filters__buttons .btn { flex: 1 1 auto; }
  .page-head__actions, .page-head__actions .btn { width: 100%; }
  .form-sheet__actions .form__actions { flex-direction: column-reverse; width: 100%; }
  .form-sheet__actions .btn { width: 100%; }
  .notice { padding: 14px; }
}

@media (max-width: 400px) {
  .staff-topbar { gap: 10px; padding: 0 12px; }
  .staff-topbar__end { gap: 10px; }
  .staff-topbar__end > .avatar { display: none; }
}

@media (max-width: 340px) {
  .staff-topbar__brand .brand__text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Champ et bouton sur une ligne, repliés sur petit écran. */
.inline-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-actions input { flex: 1 1 14rem; min-width: 0; }

/* Statistiques Escorte : graphiques SVG rendus par le serveur. */
.stats-chart { margin: 0; }
.stats-chart svg { display: block; width: 100%; height: auto; max-height: 320px; }
.stats-chart__axis { stroke: var(--bd2); stroke-width: 1; }
.stats-chart__grid { stroke: var(--bd); stroke-width: 1; stroke-dasharray: 3 4; }
.stats-chart__label { fill: var(--tx2); font-size: 11px; }
.stats-chart__line { fill: none; stroke: var(--acc, #0f77b8); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.stats-chart__line--b { stroke: var(--tx2); stroke-width: 2; stroke-dasharray: 6 5; }
.stats-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; color: var(--tx2); font-size: 13px; }
.stats-legend span::before { content: ''; display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 3px solid var(--acc, #0f77b8); }
.stats-legend .stats-legend__b::before { border-top: 2px dashed var(--tx2); }
.stats-bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.stats-bars li { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.stats-bars__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-bars__track { height: 10px; border-radius: 5px; background: var(--s2); overflow: hidden; }
.stats-bars__fill { display: block; height: 100%; border-radius: 5px; background: var(--acc, #0f77b8); }
.stats-bars__value { color: var(--tx2); font-size: 13px; white-space: nowrap; }
@media (max-width: 600px) { .stats-bars li { grid-template-columns: 1fr auto; } .stats-bars__track { grid-column: 1 / -1; } }

/* Filtres groupés (composant commun) : choix principal segmenté, champs dépendants, groupe facultatif repliable. */
.listing-filters--grouped { gap: 14px; padding: 16px 18px; }
.listing-filters__groups { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px 24px; }
.listing-filters__group { min-width: 0; margin: 0; padding: 0; border: 0; }
.listing-filters__group > legend, .listing-filters__group > summary { margin-bottom: 8px; padding: 0; color: var(--tx); font-size: 13px; font-weight: 700; }
.listing-filters__group > summary { cursor: pointer; }
.listing-filters__group--comparaison { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--bd); }
.listing-filters__fields { display: flex; flex-wrap: wrap; align-items: start; gap: 10px 12px; }
.listing-filters__fields .form-field { flex: 1 1 11rem; max-width: 18rem; }
.listing-filters__fields .field__help { color: var(--tx2); font-size: 12px; }
.listing-filters__actions { justify-content: flex-end; }
.listing-filters__alert { margin: 0; }
.listing-filters__choice { flex-basis: 100%; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--bd2); border-radius: 8px; overflow: hidden; max-width: 100%; }
.segmented__option { position: relative; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-left: 1px solid var(--bd2); background: var(--s1); color: var(--tx); font-size: 13px; font-weight: 600; cursor: pointer; }
.segmented__option:first-child { border-left: 0; }
.segmented__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented__option:has(input:checked) { background: var(--acc); color: var(--on-acc); }
.segmented__option:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: -3px; }
/* Masque un champ seulement si le choix qui le rend utile n'est pas coché ; sans :has(), tout reste visible. */
.listing-filters--grouped:has(input[name="periode"]:checked):not(:has(input[name="periode"][value="mois"]:checked)) [data-depends="periode:mois"],
.listing-filters--grouped:has(input[name="periode"]:checked):not(:has(input[name="periode"][value="semestre"]:checked)) [data-depends="periode:semestre"],
.listing-filters--grouped:has(input[name="periode"]:checked):not(:has(input[name="periode"][value="annee"]:checked)) [data-depends="periode:annee"],
.listing-filters--grouped:has(input[name="periode"]:checked):not(:has(input[name="periode"][value="personnalisee"]:checked)) [data-depends="periode:personnalisee"],
.listing-filters--grouped:not(:has(input[name="comparer"][value="autre"]:checked)) [data-depends="comparer:autre"] { display: none; }
.stats-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border-left: 3px solid var(--acc); border-radius: 6px; background: var(--acc-bg); }
.stats-summary p { margin: 0; }
.stats-chart__bar--a { fill: var(--acc); }
.stats-chart__bar--b { fill: var(--tx2); opacity: .45; }
.stats-chart__value { fill: var(--tx); font-size: 11px; font-weight: 600; }
.stats-chart__point--a { fill: var(--acc); }
.stats-chart__point--b { fill: var(--tx2); }
.stats-chart__axis-title { font-size: 11px; }
.empty-note { margin: 0; padding: 24px 16px; border: 1px dashed var(--bd2); border-radius: 8px; color: var(--tx2); text-align: center; }
@media (max-width: 760px) {
  .listing-filters__groups { grid-template-columns: 1fr; }
  .listing-filters__fields .form-field { flex-basis: 100%; max-width: none; }
  .segmented { width: 100%; }
  .segmented__option { flex: 1 1 45%; justify-content: center; border-top: 1px solid var(--bd2); }
  .listing-filters__actions .btn { flex: 1; }
}
.stats-legend--barres span::before { width: 12px; height: 12px; border: 0; border-radius: 2px; background: var(--acc); }
.stats-legend--barres .stats-legend__b::before { background: var(--tx2); opacity: .45; }
/* Graphique lisible sur petit écran : largeur minimale et défilement dans son propre cadre. */
.stats-chart { overflow-x: auto; }
.stats-chart svg { min-width: 560px; }
