@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

/* =========================================================
   1. Jetons — système de design « Récif » (mode clair uniquement, D32)
   Valeurs reprises de « Systeme de design Recif.dc.html ». Les noms
   historiques (--bg, --s1, --acc…) sont conservés ; les ajouts portent
   les dégradés, les rayons, l'ombre des menus et les couleurs de domaine.
   ========================================================= */
:root {
  color-scheme: light;
  /* Neutres chauds */
  --bg: #f8f5ef; --s1: #ffffff; --s2: #f3eee5; --s3: #efebe4;
  --bd: #ebe4d8; --bd2: #d9d1c3; --bd-soft: #f0eadf; --row-bd: #f3eee5;
  --tx: #0b2233; --tx2: #53636f; --tx3: #5d6b75; --tx-body: #24435a;
  /* Marque et structure */
  --deep: #0b2233; --night: #143550; --cta: #0b2233; --cta-h: #143550;
  --acc: #0f77b8; --acc-h: #0b659d; --on-acc: #ffffff; --acc-tx: #0d67a0; --acc-bg: #e7f1f8;
  --sea: #5cb9f0; --turquoise: #17aea6; --rail-tx: #7d9aae;
  /* Sémantique (texte / fond / bordure d'alerte) */
  --ok: #13734f; --ok-bg: #dcf4ea; --ok-bd: #b9e0cf;
  --warn: #8a5a00; --warn-bg: #fdf0d5; --warn-bd: #f0d79c; --warn-chip: #f7dfa6;
  --err: #b4261e; --err-bg: #fde8e7; --err-bd: #f6c9c2; --err-h: #931b12;
  --info: #0d5f93; --info-bg: #e2f0fb; --info-bd: #bcd9ee;
  --muted: #53636f; --muted-bg: #e9eef2;
  --active: #0b659d; --active-bg: rgb(15 119 184 / 12%);
  --urgent: #d93036;
  --todo-flag: #e9b04e; --todo-bg: #fffaf0;
  --row-hover: #f3f8fb; --row-selected: rgb(15 119 184 / 7%);
  /* Couleurs de domaine (pastille, fond, texte) */
  --dom-sec: #0f6fb8; --dom-sec-bg: #e2effa; --dom-sec-tx: #0d5f93;
  --dom-port: #17aea6; --dom-port-bg: #ddf3ef; --dom-port-tx: #0b6c66;
  --dom-peche: #1f8a5b; --dom-peche-bg: #dff2e8; --dom-peche-tx: #16603f;
  --dom-aff: #4f5bd5; --dom-aff-bg: #e7e9fb; --dom-aff-tx: #3a43a8;
  /* Dégradés (emplacements validés uniquement) */
  --grad-lagon: linear-gradient(120deg, #0f6fb8, #17aea6);
  --grad-kpi-1: linear-gradient(135deg, #0f6fb8, #1593bd);
  --grad-kpi-2: linear-gradient(135deg, #1488c4, #17aea6);
  --grad-kpi-3: linear-gradient(135deg, #0d5ea8, #13a0b0);
  --grad-next: linear-gradient(135deg, #0b2233 0%, #0f5f9e 60%, #139a9e 100%);
  --grad-halo: radial-gradient(120% 140% at 100% 0%, rgb(23 174 166 / 22%) 0%, rgb(15 111 184 / 14%) 40%, transparent 72%);
  --grad-rule: linear-gradient(180deg, #0f6fb8, #17aea6);
  /* Formes */
  --r-menu: 6px; --r-field: 12px; --r-modal: 14px; --r-pop: 16px; --r-card: 20px; --r-head: 22px; --r-pill: 999px;
  --shadow: none;
  --shadow-pop: 0 16px 48px rgb(11 34 51 / 18%);
  --shadow-modal: 0 24px 64px rgb(11 34 51 / 30%);
  --shadow-kpi: 0 10px 24px rgb(15 111 184 / 22%);
  --focus: #f5c04e; --focus-ring: #0b2233;
  --field-focus: 0 0 0 3px rgb(15 119 184 / 15%);
  /* Surfaces historiques */
  --input: #ffffff; --side: #ffffff; --section-alt: #f3eee5; --header: #fffdf9; --footer: #f9fbfc;
  --band: #0b2233; --band-edge: transparent;
  --font: 'Figtree', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* =========================================================
   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: 15px/1.55 var(--font); }
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: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: 0; }
a { color: var(--acc-tx); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--acc-h); 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; }
.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; }
.payment-picker .field > select[multiple] { width: 100%; min-height: 110px; padding: 10px; background-image: none; }
.payment-picker__menu { position: relative; }
.payment-picker__trigger { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 10px 14px; border: 1px solid var(--bd2); border-radius: 8px; background: var(--input); cursor: pointer; list-style: none; font-weight: 650; }
.payment-picker__trigger::-webkit-details-marker { display: none; }
.payment-picker__trigger::after { content: '⌄'; color: var(--tx2); font-size: 21px; line-height: 1; }
.payment-picker__menu[open] .payment-picker__trigger { border-color: var(--acc); border-radius: 8px 8px 0 0; }
.payment-picker__search { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--bd); border-top: 0; background: var(--input); }
.payment-picker__list { max-height: 280px; overflow-y: auto; border: 1px solid var(--bd); border-top: 0; border-radius: 0 0 8px 8px; background: var(--s1); }
.payment-picker__option { display: flex; justify-content: space-between; width: 100%; min-height: 44px; padding: 10px 13px; border: 0; border-bottom: 1px solid var(--bd); background: transparent; text-align: left; }
.payment-picker__option:hover, .payment-picker__option[aria-pressed='true'] { background: var(--acc-bg); }
.payment-picker__option[aria-pressed='true']::after { content: '✓'; margin-left: 14px; color: var(--acc-tx); font-weight: 800; }
.payment-picker__option[hidden] { display: none; }
.payment-picker__selected { margin-top: 6px; color: var(--tx2); font-size: 13px; }
.association-batch-form .card__body { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.association-batch-form .field { min-width: 0; }
.association-batch-form .field input, .association-batch-form .field select,
.association-batch-form .btn { min-width: 0; max-width: 100%; }
.association-batch-form .btn { white-space: normal; }
.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; }
.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__pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: var(--tx2); }
/* Barre de filtres des registres (Récif) : recherche, puces « + Filtre » ouvrant un menu, tri. */
.escort-register__filters { display: grid; gap: 8px; }
.escort-register__filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13px; }
.escort-register__filter-row .list-search { flex: 0 1 260px; }
.escort-register__filter-row .list-search input { width: 100%; height: 32px; padding: 0 12px 0 32px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--s2); font-size: 13.5px; }
.escort-register__filter-row .list-search input:focus { border-color: var(--acc); background: var(--s1); outline: none; box-shadow: var(--field-focus); }
.escort-register__choice-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.escort-register__filter-row .filter-chip { padding: 4px 12px; border-radius: var(--r-pill); font-size: 13px; cursor: pointer; list-style: none; }
.escort-register__filter-row .filter-chip::-webkit-details-marker { display: none; }
.escort-register__filter-row .filter-chip--add { border: 1px dashed #cfc5b4; background: transparent; color: var(--tx2); }
.escort-register__filter-row .filter-chip.is-active { border: 1px solid transparent; background: var(--info-bg); color: var(--info); font-weight: 600; }
.escort-register__filter-row .filter-menu__panel .form-field select, .escort-register__filter-row .filter-menu__panel .form-field input { min-height: 40px; padding: 0 12px; border: 1px solid var(--bd2); border-radius: var(--r-field); font-size: 14px; }
.escort-register__filter-row .filter-menu__panel .form-field label { color: var(--tx2); font-size: 12.5px; font-weight: 600; }
.escort-register__date-filters { width: 300px; }
.filter-chips__clear { font-weight: 600; text-decoration: none; }
.escort-register__filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--tx2); }
.list-sort { display: inline-flex; align-items: center; gap: 6px; }
.list-sort select { height: 32px; padding: 0 30px 0 10px; border: 1px solid var(--bd); border-radius: var(--r-pill); background-color: var(--s1); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2353636f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-position: right 10px center; background-size: 14px; background-repeat: no-repeat; color: var(--tx); font-size: 13px; font-weight: 600; }
@media (max-width: 719px) {
  .escort-register__filter-row .list-search { flex: 1 1 100%; }
  .escort-register__filter-row .list-search input { height: 44px; }
  .escort-register__filter-row .filter-chip { padding: 9px 14px; }
  .escort-register__filter-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .escort-register__filter-row .filter-menu__panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 80px; z-index: 45; width: auto; box-shadow: 0 -8px 40px rgb(11 34 51 / 25%); }
}
.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: 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 (Récif)
   Communs à toutes les procédures : aucun nom propre à l'Escorte.
   ========================================================= */

/* Boutons : pilule, 3 tailles (sm 32 · md 40 · lg 44), un seul bouton plein par zone. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px; border: 1px solid var(--bd2); border-radius: var(--r-pill); background: var(--s1); color: var(--tx); font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s, transform .15s; }
.btn:hover { background: var(--s2); border-color: var(--tx3); color: var(--tx); }
.btn--secondary { background: var(--s1); border-color: var(--bd2); color: var(--tx); }
.btn--primary { background: var(--cta); border-color: var(--cta); color: #fff; }
.btn--primary:hover { background: var(--cta-h); border-color: var(--cta-h); color: #fff; }
.btn--accent { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn--accent:hover { background: var(--acc-h); border-color: var(--acc-h); color: #fff; }
.btn--new { background: var(--grad-lagon); border: 0; color: #fff; font-weight: 700; box-shadow: 0 6px 16px rgb(15 119 184 / 25%); }
.btn--new:hover { background: var(--grad-lagon); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--acc-tx); }
.btn--ghost:hover { background: rgb(15 119 184 / 9%); border-color: transparent; color: var(--acc-h); }
.btn--danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn--danger:hover { background: var(--err-h); border-color: var(--err-h); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--s2); border-color: var(--bd-soft); color: var(--tx3); cursor: not-allowed; }
.btn.is-loading { opacity: .8; pointer-events: none; }
.btn.is-loading::before { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btn-spin .8s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 44px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--s2); }
.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 : 44 px, rayon 12, libellé au-dessus, aide puis erreur à la place de l'aide. */
.field { display: grid; gap: 6px; align-content: start; }
.field__label { font-size: 13.5px; font-weight: 600; }
.field__label .optional { color: var(--tx2); font-weight: 400; }
.field__label .required { color: var(--err); }
.field__help { color: var(--tx2); font-size: 12.5px; }
.field__error { display: flex; align-items: center; gap: 6px; color: var(--err); font-size: 12.5px; font-weight: 600; }
.field__counter { justify-self: end; color: var(--tx2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field select,
.field textarea,
.control { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--bd2); border-radius: var(--r-field); background-color: var(--input); color: var(--tx); font-size: 15px; }
.field textarea, textarea.control { min-height: 92px; padding: 10px 14px; resize: vertical; }
.field input[type="file"] { width: 100%; min-height: 92px; padding: 12px; border: 1.5px dashed var(--bd2); border-radius: var(--r-field); background: var(--bg); font-size: 14px; }
.field select, select.control { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2353636f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-position: right 14px center; background-size: 16px 16px; background-repeat: no-repeat; }
.field select[multiple], select.control[multiple] { padding: 8px 14px; background-image: none; }
.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: none; border: 2px solid var(--acc); box-shadow: var(--field-focus); }
.field input:disabled, .field select:disabled, .field textarea:disabled, .control:disabled { border-color: var(--bd-soft); background: var(--bg); color: var(--tx3); }
.field--error input, .field--error select, .field--error textarea, .field--error .phone-control { border: 1.5px solid var(--err) !important; }
.phone-control { display: flex; overflow: hidden; min-height: 44px; border: 1px solid var(--bd2); border-radius: var(--r-field); background: var(--input); }
.phone-control__prefix { display: grid; place-items: center; padding: 0 12px; border-right: 1px solid var(--bd); background: var(--bg); color: var(--tx2); font-weight: 600; }
.field .phone-control input { border: 0 !important; border-radius: 0; background: transparent; box-shadow: none !important; }
.phone-control:focus-within { border: 2px solid var(--acc); box-shadow: var(--field-focus); }
.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: var(--r-field); 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; }
.rights-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.rights-group { display: grid; align-content: start; gap: 4px; min-width: 0; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--bd); border-radius: var(--r-pop); background: var(--s1); }
.rights-group legend { padding: 0 4px; color: var(--tx); font-size: 14px; font-weight: 700; }
.choice--disabled { opacity: .5; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; font-size: 14.5px; }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--acc); flex: none; }
.form { display: grid; gap: 22px; }
.form__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-note { color: var(--tx2); font-size: 13.5px; }

/* Récapitulatif d'erreurs en tête de formulaire */
.error-summary { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--err-bd); border-radius: var(--r-pop); background: var(--err-bg); }
.error-summary h2 { color: var(--err); font-size: 14.5px; }
.error-summary ul { padding-left: 18px; color: var(--tx-body); font-size: 14px; }
.error-summary a { color: var(--err); font-weight: 600; }

/* Alertes (bloc dans la page) */
.alert { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--info-bd); border-radius: var(--r-pop); background: var(--info-bg); color: var(--info); }
.alert > svg { width: 20px; height: 20px; }
.alert__body { display: grid; gap: 2px; min-width: 0; }
.alert__title { font-size: 14.5px; font-weight: 700; color: inherit; }
.alert__text { color: var(--tx-body); font-size: 14px; }
.alert__text p + p { margin-top: 4px; }
.alert__action { color: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; }
.alert--ok { border-color: var(--ok-bd); background: var(--ok-bg); color: var(--ok); }
.alert--warn { border-color: var(--warn-bd); background: var(--warn-bg); color: var(--warn); }
.alert--err { border-color: var(--err-bd); background: var(--err-bg); color: var(--err); }

/* Messages flash : toasts en bas à droite (6 s ; les erreurs restent jusqu'à fermeture). */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--r-pop); background: var(--deep); color: #fff; box-shadow: var(--shadow-pop); font-size: 14px; }
.toast__icon { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; }
.toast__icon svg { width: 14px; height: 14px; }
.toast__icon--success { background: #5fc6a6; color: var(--deep); }
.toast__icon--error, .toast__icon--warning { background: #f08a7c; color: var(--deep); }
.toast__icon--info, .toast__icon--debug { background: var(--sea); color: var(--deep); }
.toast p { flex: 1; min-width: 0; padding-top: 1px; }
.toast a { color: var(--sea); font-weight: 600; }
.toast__close { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--rail-tx); font-size: 18px; line-height: 1; }
.toast__close:hover { color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }

/* Message dans la page (ancien gabarit) : même rendu que les alertes Récif. */
.messages { display: grid; gap: 10px; }
.message { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--info-bd); border-radius: var(--r-pop); background: var(--info-bg); color: var(--tx-body); font-size: 14px; }
.message > svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--info); }
.message--success { border-color: var(--ok-bd); background: var(--ok-bg); }
.message--success > svg { color: var(--ok); }
.message--warning { border-color: var(--warn-bd); background: var(--warn-bg); }
.message--warning > svg { color: var(--warn); }
.message--error { border-color: var(--err-bd); background: var(--err-bg); }
.message--error > svg { color: var(--err); }

/* Statuts : pastille + point, variantes sémantiques. */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; 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--active { background: var(--active-bg); color: var(--active); }
.status--muted { background: var(--muted-bg); color: var(--muted); }
/* Compteurs, étiquettes de rôle et de version */
.count { display: inline-grid; place-items: center; min-width: 20px; padding: 0 7px; border-radius: var(--r-pill); background: var(--warn-bg); color: var(--warn); font-size: 11.5px; font-weight: 800; line-height: 18px; font-variant-numeric: tabular-nums; }
.count--urgent { background: var(--urgent); color: #fff; font-weight: 700; }
.role-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-pill); background: rgb(15 119 184 / 9%); color: var(--acc-tx); font-size: 12px; font-weight: 600; white-space: nowrap; }
.role-tag--neutral { background: var(--s2); color: var(--tx-body); }

/* Badges procédure (domaine), origine (carré) et type de demandeur (pastille) */
.procedure-badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--r-pill); background: var(--dom-sec-bg); color: var(--dom-sec-tx); font-size: 13px; font-weight: 800; white-space: nowrap; text-decoration: none; }
.procedure-badge__dot { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--dom-sec); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.procedure-badge--sm { padding-block: 3px; font-size: 12.5px; }
.procedure-badge--sm .procedure-badge__dot { width: 20px; height: 20px; font-size: 9.5px; }
.procedure-badge--port { background: var(--dom-port-bg); color: var(--dom-port-tx); }
.procedure-badge--port .procedure-badge__dot { background: var(--dom-port); }
.procedure-badge--peche { background: var(--dom-peche-bg); color: var(--dom-peche-tx); }
.procedure-badge--peche .procedure-badge__dot { background: var(--dom-peche); }
.procedure-badge--aff { background: var(--dom-aff-bg); color: var(--dom-aff-tx); }
.procedure-badge--aff .procedure-badge__dot { background: var(--dom-aff); }
.origin-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid #cfe1ee; border-radius: 8px; color: var(--info); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.origin-badge svg { width: 14px; height: 14px; }
.origin-badge--partner { border-color: #e6dfd3; color: var(--tx3); }
.requester-type { display: inline-flex; padding: 2px 10px; border-radius: var(--r-pill); background: var(--s3); color: #3f5361; font-size: 12.5px; font-weight: 700; }
.requester-type--person { background: #f6ecdc; color: #7a4a00; }

/* Cartes et panneaux : bordure seule, rayon 20. */
.card { border: 1px solid var(--bd); border-radius: var(--r-card); background: var(--s1); box-shadow: none; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--bd-soft); }
.card__head h2, .card__head h3 { font-size: 17px; }
.card__head small { color: var(--tx2); font-size: 13px; }
.card__body { display: grid; gap: 16px; padding: 20px; }
.card--alt { background: var(--s2); }
.card--warm { border-color: var(--warn-bd); background: #fffaf1; }
.card--dark { border: 0; background: var(--grad-next); color: #fff; }
.card--dark .card__head { border-color: rgb(255 255 255 / 14%); }
.card--dark .muted, .card--dark small { color: #c9dceb; }
.kicker { color: var(--tx3); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.facts { display: grid; grid-template-columns: minmax(130px, 160px) 1fr; gap: 0 12px; font-size: 14.5px; }
.facts dt, .facts dd { padding: 9px 0; border-bottom: 1px solid #f0f4f7; }
.facts dt { color: var(--tx2); }
.facts dd { font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts dt:nth-last-child(2), .facts dd:last-child { border-bottom: 0; }
.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: var(--r-pop); }
.activity-row__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.activity-row form { margin: 0; }

/* Carte « Prochaine action » (dégradé sombre) */
.next-action { display: grid; gap: 10px; padding: 18px 20px; border-radius: var(--r-card); background: var(--grad-next); color: #fff; }
.next-action__eyebrow { color: #bfe3f2; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.next-action__title { font-size: 17px; font-weight: 700; }
.next-action__text { color: #d8e8f2; font-size: 14px; }
.next-action .btn { justify-self: start; background: #fff; border-color: #fff; color: var(--deep); }
.next-action .btn:hover { background: #e7f1f8; }

/* Compteurs (tuiles à dégradé) */
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.kpi-tile { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: var(--r-card); background: var(--grad-kpi-1); color: #fff; box-shadow: var(--shadow-kpi); text-decoration: none; transition: transform .18s; }
a.kpi-tile:hover { color: #fff; transform: translateY(-3px) rotate(-.4deg); }
.kpi-tile:nth-child(4n+1) { background: var(--grad-next); }
.kpi-tile:nth-child(4n+2) { background: var(--grad-kpi-1); }
.kpi-tile:nth-child(4n+3) { background: var(--grad-kpi-2); }
.kpi-tile:nth-child(4n+4) { background: var(--grad-kpi-3); }
.kpi-tile__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgb(255 255 255 / 20%); }
.kpi-tile__icon svg { width: 20px; height: 20px; }
.kpi-tile__value { font-size: 32px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-tile__label { font-size: 13.5px; opacity: .92; }

/* En-tête de page : halo + filet vertical de 6 px */
.page-header { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; overflow: hidden; padding: 22px 26px; border: 1px solid var(--bd); border-radius: var(--r-card); background: var(--s1); }
.page-header::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--grad-rule); }
.page-header::after { content: ''; position: absolute; inset: 0 0 0 auto; width: 55%; background: var(--grad-halo); pointer-events: none; }
.page-header > * { position: relative; z-index: 1; }
.page-header__main { display: grid; gap: 6px; min-width: 0; flex: 1 1 420px; }
.page-header__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--tx2); font-size: 13px; }
.page-header h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.page-header__lead { max-width: 75ch; color: #3f5361; font-size: 14.5px; }
.page-header__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-header--hero { border-radius: var(--r-head); padding: 20px 24px; }
.page-header--hero h1 { font-size: 28px; }

/* Ancien en-tête simple (pages non refondues) */
.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: 13px; font-weight: 500; }
.crumbs a { color: var(--tx2); text-decoration: none; }
.crumbs a:hover { color: var(--acc-tx); text-decoration: underline; }

/* Onglets de statut (pastilles à compteur) */
.status-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--bd-soft); font-size: 13.5px; font-weight: 600; }
.status-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--r-pill); color: var(--tx2); text-decoration: none; }
.status-tabs a:hover { background: var(--s2); color: var(--tx); }
.status-tabs .count { background: var(--s2); color: var(--tx2); font-weight: 600; }
.status-tabs a[aria-current="page"] { background: var(--deep); color: #fff; }
.status-tabs a[aria-current="page"] .count { background: rgb(255 255 255 / 18%); color: #fff; }
.status-tabs a.is-todo:not([aria-current="page"]) { background: var(--warn-bg); color: var(--warn); }
.status-tabs a.is-todo:not([aria-current="page"]) .count { background: var(--warn-chip); color: var(--warn); }

/* Barre d'outils de liste : recherche, puces de filtres, tri */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--bd-soft); font-size: 13px; }
.list-search { position: relative; flex: 0 1 260px; }
.list-search svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; color: var(--tx3); transform: translateY(-50%); }
.list-search input { width: 100%; height: 32px; padding: 0 10px 0 30px; border: 1px solid var(--bd); border-radius: var(--r-field); background: var(--s1); font-size: 13.5px; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: var(--r-menu); background: var(--info-bg); color: var(--info); font-weight: 600; text-decoration: none; }
.filter-chip__remove { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: inherit; font-size: 14px; line-height: 1; text-decoration: none; }
.filter-chip__remove:hover { background: rgb(13 95 147 / 12%); }
.filter-chip--add { padding: 3px 10px; border: 1px dashed var(--bd2); background: transparent; color: var(--tx2); font-weight: 500; cursor: pointer; list-style: none; }
.filter-chip--add::-webkit-details-marker { display: none; }
.filter-menu { position: relative; }
.filter-menu__panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 10px; width: 280px; padding: 12px; border: 1px solid var(--bd); border-radius: var(--r-pop); background: var(--s1); box-shadow: var(--shadow-pop); }
.filter-menu__actions { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--row-bd); }
.list-toolbar__end { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--tx2); }

/* Ancienne liste de puces (répertoire) */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--tx2); font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: var(--r-menu); background: var(--info-bg); color: var(--info); font-size: 13.5px; font-weight: 600; }
.chip a { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: inherit; text-decoration: none; }
.chip a:hover { background: rgb(13 95 147 / 12%); }
.chip svg { width: 12px; height: 12px; }

/* État vide, sans résultat, erreur */
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 40px 24px; text-align: center; color: var(--tx2); font-size: 14px; }
.empty-state__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--s2); color: var(--tx2); }
.empty-state__icon svg { width: 24px; height: 24px; }
.empty-state strong { color: var(--tx); font-size: 16px; }
.empty-state p { max-width: 360px; }
.empty-state .btn { margin-top: 4px; }
.empty-state--error .empty-state__icon { width: 44px; height: 44px; background: var(--err-bg); color: var(--err); }
.empty-state--compact { padding: 28px 24px; }

/* Squelette de chargement (même hauteur que les lignes) */
.skeleton { display: block; height: 10px; border-radius: 4px; background: var(--bd-soft); animation: skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton--pill { height: 18px; border-radius: var(--r-pill); background: var(--row-bd); }
@keyframes skeleton-pulse { 50% { opacity: .55; } }

/* Tableaux : en-têtes en capitales, lignes de 54 px, ligne « à traiter » marquée. */
.table-wrap { position: relative; overflow-x: auto; }
/* L'en-tête d'un tableau posé en tête de carte épouse ses coins arrondis (le fond de l'en-tête dépassait à 1440 px).
   Sous un en-tête de carte (``.card__head``, titre...), le tableau n'est pas premier enfant : aucun arrondi au milieu. */
.card > .table-wrap:first-child { border-radius: var(--r-card) var(--r-card) 0 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table caption { padding: 0; text-align: left; }
.data-table th { position: sticky; top: 0; z-index: 1; padding: 0; border-bottom: 1px solid var(--bd-soft); background: var(--s1); color: var(--tx3); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table th > span, .data-table th > a { display: flex; align-items: center; gap: 6px; padding: 10px 16px; }
.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 { height: 54px; padding: 6px 16px; border-bottom: 1px solid var(--row-bd); vertical-align: middle; }
.data-table tbody tr { transition: background-color .12s; }
.data-table tbody tr:hover td { background: var(--row-hover); }
.data-table tbody tr.is-todo td { background: var(--todo-bg); }
.data-table tbody tr.is-todo td:first-child { box-shadow: inset 3px 0 0 var(--todo-flag); }
.data-table tbody tr.is-selected td { background: var(--row-selected); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .sub { display: block; color: var(--tx2); font-size: 12.5px; overflow-wrap: anywhere; }
.data-table .nowrap { white-space: nowrap; }
.data-table .ref { color: var(--acc-tx); font-weight: 700; text-decoration: none; }
.data-table .ref:hover { text-decoration: underline; }
.data-table .cell-action { width: 1%; text-align: right; white-space: nowrap; }
.data-table tr[data-preview-url] { cursor: pointer; }
.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: linear-gradient(135deg, #1f86d6, #19b3a6); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.avatar--company { border-radius: 12px; background: #eef5fa; color: var(--info); }
.avatar--admin { background: var(--ok-bg); color: var(--ok); }
.row-link { font-weight: 600; white-space: nowrap; }

/* Pagination : lignes par page, position, Précédent / Suivant */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 16px; border-top: 1px solid var(--bd-soft); color: var(--tx2); font-size: 13px; }
.pagination__size { display: flex; align-items: center; gap: 8px; }
.pagination__size-options { display: flex; overflow: hidden; border: 1px solid var(--bd); border-radius: var(--r-pill); }
.pagination__size-options a, .pagination__size-options span { padding: 4px 10px; color: var(--tx); font-weight: 600; text-decoration: none; }
.pagination__size-options [aria-current="true"] { background: var(--deep); color: #fff; }
.pagination__nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pagination__nav a, .pagination__nav .is-disabled { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--bd2); border-radius: var(--r-pill); color: var(--tx); font-weight: 600; text-decoration: none; }
.pagination__nav a:hover { background: var(--s2); }
.pagination__nav .is-disabled { border-color: var(--bd-soft); color: var(--tx3); }
.pagination__nav strong { color: var(--tx); }

/* Chronologie (verticale) et étapes (horizontales) */
.timeline { display: grid; margin: 0; padding: 0; list-style: none; }
.timeline__item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; }
.timeline__rail { display: flex; flex-direction: column; align-items: center; }
.timeline__dot { width: 12px; height: 12px; margin-top: 4px; border: 2px solid var(--bd); border-radius: 50%; background: var(--s1); }
.timeline__line { flex: 1; width: 2px; margin-top: 2px; background: var(--bd); }
.timeline__item:last-child .timeline__line { background: transparent; }
.timeline__body { display: grid; padding-bottom: 10px; }
.timeline__label { color: var(--tx3); font-size: 14px; font-weight: 500; }
.timeline__when { color: var(--tx3); font-size: 12.5px; }
.timeline__item--done .timeline__dot { border-color: var(--ok); background: var(--ok); }
.timeline__item--done .timeline__line { background: var(--ok); }
.timeline__item--done .timeline__label { color: var(--tx); }
.timeline__item--current .timeline__dot { border-color: var(--todo-flag); }
.timeline__item--current .timeline__label { color: var(--warn); font-weight: 700; }
.steps { display: grid; grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.steps__item { position: relative; display: grid; justify-items: center; gap: 4px; padding: 0 6px; text-align: center; }
.steps__item::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: #e0d8ca; z-index: 0; }
.steps__item:first-child::before { display: none; }
.steps__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border: 3px solid #e0d8ca; border-radius: 50%; background: var(--s1); color: #fff; font-size: 12px; font-weight: 800; }
.steps__label { color: var(--tx3); font-size: 13px; font-weight: 600; }
.steps__when { color: var(--tx3); font-size: 12px; }
.steps__item--done::before, .steps__item--current::before { background: var(--turquoise); }
.steps__item--done .steps__dot { border-color: var(--turquoise); background: var(--turquoise); }
.steps__item--done .steps__label { color: var(--tx); }
.steps__item--current .steps__dot { border-color: #0f6fb8; }
.steps__item--current .steps__label { color: var(--tx); font-weight: 800; }

/* Modale (<dialog> natif) */
.modal { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--r-modal); background: var(--s1); color: var(--tx); box-shadow: var(--shadow-modal); }
.modal::backdrop { background: rgb(11 34 51 / 45%); }
.modal--confirm { width: min(440px, calc(100vw - 32px)); }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 0; }
.modal__titles { display: grid; gap: 4px; flex: 1; min-width: 0; }
.modal__title { font-size: 18px; }
.modal__subtitle { color: var(--tx2); font-size: 13.5px; }
.modal__close { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%; background: var(--s2); color: var(--tx); }
.modal__close svg { width: 15px; height: 15px; }
.modal__body { display: grid; gap: 14px; padding: 18px 22px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--bd-soft); background: var(--footer); }
.modal form { display: contents; }
.modal__danger-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--err-bg); color: var(--err); }
.modal__danger-icon svg { width: 22px; height: 22px; }
/* Sans <dialog> (ou sans JS), le contenu reste affiché en place, comme une carte. */
.no-dialog .modal:not([open]) { position: static; display: block; width: auto; box-shadow: none; border: 1px solid var(--bd); }

/* Panneau d'aperçu (lecture seule, 420 px à droite) */
.preview-panel { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgb(11 34 51 / 18%); }
.preview-panel[hidden] { display: none; }
.preview-panel__sheet { display: flex; flex-direction: column; width: min(420px, 100vw); height: 100%; overflow-y: auto; background: var(--s1); box-shadow: var(--shadow-pop); }
.preview-panel__head { position: sticky; top: 0; display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--bd-soft); background: var(--s1); }
.preview-panel__head > div { flex: 1; min-width: 0; }
.preview-panel__body { display: grid; gap: 16px; padding: 18px 20px 24px; }
.preview-panel__foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--bd-soft); background: var(--footer); }

/* Carte du demandeur */
.requester-card { display: grid; gap: 12px; }
.requester-card__id { display: flex; align-items: center; gap: 12px; }
.requester-card__avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: #eef5fa; color: var(--info); font-size: 13px; font-weight: 800; }
.requester-card__avatar--person { border-radius: 50%; }
.requester-card__name { font-weight: 700; }

/* Section de formulaire numérotée et récapitulatif collant */
.form-section { display: grid; gap: 16px; padding: 22px 24px; border-top: 1px solid var(--bd-soft); }
.form-section:first-child { border-top: 0; }
.form-section__head { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; }
.form-section__index { grid-row: span 2; color: var(--acc-tx); font-size: 13px; font-weight: 800; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.form-section__head h2 { font-size: 18px; }
.form-section__head p { color: var(--tx2); font-size: 13.5px; }
.form-section__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 20px; }
@media (min-width: 720px) { .form-section__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-section__grid .is-wide { grid-column: 1 / -1; } }
.recap-panel { display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--r-card); background: var(--grad-next); color: #fff; }
.recap-panel__title { color: #bfe3f2; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.recap-panel__list { display: grid; gap: 10px; margin: 0; }
.recap-panel__list > div { display: grid; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid rgb(255 255 255 / 14%); }
.recap-panel__list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.recap-panel__list dt { color: #bfe3f2; font-size: 12px; }
.recap-panel__list dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.recap-panel__list dd.is-empty { color: #c9dceb; font-weight: 400; }
.recap-panel__total { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.recap-panel .btn { background: #fff; border-color: #fff; color: var(--deep); }
@media (min-width: 960px) { .recap-panel--sticky { position: sticky; top: 132px; } }

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

/* =========================================================
   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
   ========================================================= */
/* Coque Récif : rail nuit 72 px + panneau blanc 216 px, header 64 px, onglets de procédure. */
.staff-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 100vh; }
.staff-sidebar { position: sticky; top: 0; z-index: 30; display: flex; height: 100vh; }
.staff-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; padding: 14px 0; background: var(--deep); }
.staff-rail .brand { margin-bottom: 12px; }
.staff-rail .brand__logo { width: 34px; height: 34px; border-radius: 10px; }
.staff-rail__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; padding: 9px 0 8px; border-radius: 14px; color: var(--rail-tx); font-size: 10.5px; font-weight: 700; text-align: center; text-decoration: none; transition: background-color .15s, color .15s; }
.staff-rail__item svg { width: 21px; height: 21px; }
.staff-rail__item:hover, .staff-rail__item[aria-current="page"], .staff-rail__item.is-shown { background: var(--night); color: #fff; }
.staff-rail__item:focus-visible { outline: 3px solid #5fb8f0; outline-offset: 2px; box-shadow: none; }
.staff-rail__count { position: absolute; top: 4px; right: 5px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-pill); background: var(--focus); color: var(--deep); font-size: 10px; font-weight: 800; box-shadow: 0 0 0 2px var(--deep); }
.staff-rail__count.is-urgent { background: var(--urgent); color: #fff; }
.staff-rail__spacer { flex: 1; }
.staff-rail__avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #1f86d6, #19b3a6); color: #fff; font-size: 13px; font-weight: 800; }
.staff-panel { display: flex; flex-direction: column; gap: 2px; width: 216px; height: 100vh; overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--bd); background: var(--s1); }
.staff-panel[hidden] { display: none; }
.staff-panel__head { display: flex; align-items: center; gap: 8px; padding: 2px 8px 4px; }
.staff-panel__head > div { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.2; }
.staff-panel__title { font-size: 17px; font-weight: 800; }
.staff-panel__space { color: var(--tx3); font-size: 12px; overflow-wrap: anywhere; }
.staff-panel__collapse { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--tx3); font-size: 15px; font-weight: 700; }
.staff-panel__collapse:hover { background: var(--s2); }
.staff-panel__filter { height: 36px; margin: 8px 0 4px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--s2); font-size: 13px; font-weight: 500; }
.staff-panel__filter:focus { border-color: var(--acc); background: var(--s1); outline: none; }
.staff-panel__group { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 8px 4px; color: var(--tx3); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.staff-panel__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dom-sec); }
.staff-panel__dot--port { background: var(--dom-port); }
.staff-panel__dot--peche { background: var(--dom-peche); }
.staff-panel__dot--aff { background: var(--dom-aff); }
.staff-panel__item { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 10px; border-radius: 10px; color: var(--tx); font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color .15s; }
.staff-panel__item > span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-panel__item:hover { background: var(--row-hover); color: var(--tx); }
.staff-panel__item[aria-current="page"] { background: var(--acc-bg); color: var(--info); font-weight: 800; }
.staff-panel__item:focus-visible { outline: 3px solid var(--acc); outline-offset: -1px; box-shadow: none; }
.staff-panel__item[hidden] { display: none; }
.staff-panel__ext { color: var(--tx3); font-size: 12px; }
.staff-shell.is-collapsed .staff-panel { display: none; }

.staff-workspace { display: flex; flex-direction: column; min-width: 0; }
.staff-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--bd); background: var(--header); }
.staff-topbar__brand { display: none; }
.staff-topbar__title { display: none; }
.staff-search { position: relative; flex: 1 1 auto; max-width: 460px; margin: 0; }
.staff-search > svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; color: var(--tx3); transform: translateY(-50%); pointer-events: none; }
.staff-search input { width: 100%; height: 40px; padding: 0 40px 0 38px; border: 2px solid transparent; border-radius: var(--r-pill); background: var(--s2); color: var(--tx); font-size: 14px; }
.staff-search input::placeholder { color: var(--tx3); }
.staff-search input:focus { border-color: #1593bd; background: var(--s1); outline: none; }
.staff-search__key { position: absolute; right: 12px; top: 50%; padding: 1px 6px; border: 1px solid #e6dfd3; border-radius: 5px; background: var(--s1); color: var(--tx3); font: 500 11px var(--mono); transform: translateY(-50%); }
.staff-topbar__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-menu { position: relative; }
.header-menu > summary { list-style: none; cursor: pointer; }
.header-menu > summary::-webkit-details-marker { display: none; }
.header-menu > summary.btn--new svg:last-child { width: 13px; height: 13px; }
.header-bell { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 1px solid #e6dfd3; border-radius: var(--r-pill); background: var(--s1); font-size: 13px; font-weight: 600; }
.header-bell svg { width: 18px; height: 18px; }
.header-menu[open] > .header-bell, .header-menu[open] > .header-profile { background: var(--s2); }
.header-profile { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: var(--r-pill); }
.header-profile svg { width: 13px; height: 13px; color: var(--tx2); }
.header-menu__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; overflow: hidden; border: 1px solid var(--bd); border-radius: 18px; background: var(--s1); box-shadow: var(--shadow-pop); }
.header-menu__panel--new { width: 300px; padding: 8px; border-radius: var(--r-pop); }
.header-menu__entry { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; color: var(--tx); text-decoration: none; }
.header-menu__entry:hover { background: var(--row-hover); color: var(--tx); }
.header-menu__entry-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #eef5fa; color: #0f6fb8; }
.header-menu__entry:first-child .header-menu__entry-icon { background: var(--grad-lagon); color: #fff; }
.header-menu__entry-icon svg { width: 18px; height: 18px; }
.header-menu__entry strong { display: block; font-size: 14px; }
.header-menu__entry small { display: block; color: var(--tx3); font-size: 12.5px; }
.header-menu__panel--bell { width: 380px; }
.bell__tabs { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--bd-soft); font-size: 13px; font-weight: 700; }
.bell__tabs a { padding: 5px 12px; border-radius: var(--r-pill); color: var(--tx2); text-decoration: none; }
.bell__tabs a.is-active { background: var(--deep); color: #fff; }
.bell__tabs form { margin-left: auto; }
.bell__tabs .link-button { font-size: 13px; text-decoration: none; }
.bell__list { margin: 0; padding: 0; list-style: none; }
.bell__item form { margin: 0; }
.bell__item button { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid #f4efe6; background: var(--s1); text-align: left; }
.bell__item.is-unread button { background: #f5fafd; }
.bell__item button:hover { background: var(--row-hover); }
.bell__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: #eef5fa; color: #0f6fb8; }
.bell__icon svg { width: 18px; height: 18px; }
.bell__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bell__title { font-size: 14px; font-weight: 600; }
.bell__item.is-unread .bell__title { font-weight: 800; }
.bell__body { overflow: hidden; color: var(--tx2); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.bell__when { color: var(--tx3); font-size: 12px; }
.bell__empty { display: grid; justify-items: center; gap: 6px; padding: 32px 20px; color: var(--tx2); font-size: 13px; text-align: center; }
.bell__empty strong { color: var(--tx); font-size: 14.5px; }
.bell__empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.bell__empty-icon svg { width: 20px; height: 20px; }
.bell__empty-icon--unread { background: var(--info-bg); color: var(--info); }
.bell__all { display: block; padding: 12px; color: var(--acc-tx); font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.header-menu__panel--profile { width: 280px; }
.profile-menu__id { display: flex; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(120deg, #e8f2fb, #e2f5f2); }
.profile-menu__id > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.profile-menu__id strong { font-size: 15px; overflow-wrap: anywhere; }
.profile-menu__id small { color: var(--tx2); font-size: 12.5px; overflow-wrap: anywhere; }
.profile-menu__role { align-self: flex-start; margin-top: 4px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--s1); color: #0b6c8f; font-size: 11.5px; font-weight: 700; }
.avatar--lg { width: 44px; height: 44px; }
.profile-menu__links { display: flex; flex-direction: column; padding: 6px; font-size: 14px; }
.profile-menu__links a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--tx); text-decoration: none; }
.profile-menu__links a:hover { background: var(--row-hover); }
.profile-menu__links svg { width: 17px; height: 17px; color: var(--tx2); }
.profile-menu__links span { flex: 1; }
.profile-menu__links small { color: var(--tx3); font-size: 12px; }
.profile-menu__logout { margin: 0; padding: 6px; border-top: 1px solid var(--bd-soft); }
.profile-menu__logout button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--err); font-size: 14px; font-weight: 700; text-align: left; }
.profile-menu__logout button:hover { background: var(--err-bg); }
.profile-menu__logout svg { width: 17px; height: 17px; }

.procedure-tabs { position: sticky; top: 64px; z-index: 15; padding: 0 16px; border-bottom: 1px solid var(--bd); background: var(--header); }
.procedure-tabs__list { display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.procedure-tabs__list::-webkit-scrollbar { display: none; }
.procedure-tabs a { display: inline-flex; flex: none; align-items: center; gap: 7px; height: 52px; margin-bottom: -1px; padding: 0 14px; border-bottom: 3px solid transparent; color: var(--tx2); font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.procedure-tabs a:hover { color: var(--tx); }
.procedure-tabs a[aria-current="page"] { border-bottom-color: var(--acc); color: var(--tx); font-weight: 800; }

.staff-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; padding: 24px 28px 32px; }
.staff-tabbar { display: none; }
.staff-sheet { display: none; }

@media (max-width: 1199px) {
  .staff-panel { display: none; }
  .staff-shell.is-panel-open .staff-panel:not([hidden]) { position: absolute; left: 72px; top: 0; display: flex; box-shadow: var(--shadow-pop); }
}
@media (min-width: 1200px) {
  .staff-shell.is-collapsed .staff-panel { display: none; }
}
@media (max-width: 719px) {
  .staff-shell { grid-template-columns: minmax(0, 1fr); }
  .staff-sidebar { display: none; }
  .staff-topbar { height: 56px; gap: 6px; padding: 0 12px 0 16px; }
  .staff-topbar__brand { display: inline-flex; }
  .staff-topbar__title { display: inline; }
  .staff-topbar__brand .brand__logo { width: 28px; height: 28px; border-radius: 8px; }
  .staff-topbar__brand { flex: 1; align-items: center; gap: 8px; color: var(--tx); text-decoration: none; }
  .staff-topbar__title { font-size: 16px; }
  .staff-search { flex: 0 0 44px; max-width: none; margin-left: auto; }
  .staff-search > svg { left: 13px; width: 20px; height: 20px; color: var(--tx); }
  .staff-search input { height: 44px; padding: 0 0 0 44px; border: 0; background: transparent; color: transparent; cursor: pointer; }
  .staff-search input::placeholder { color: transparent; }
  .staff-search:focus-within { position: absolute; left: 8px; right: 8px; z-index: 5; }
  .staff-search:focus-within input { padding-left: 40px; border: 2px solid #1593bd; background: var(--s1); color: var(--tx); cursor: text; }
  .staff-search:focus-within input::placeholder { color: var(--tx3); }
  .staff-search__key { display: none; }
  .staff-topbar__end { margin-left: 0; gap: 4px; }
  .staff-topbar .btn--new { width: 44px; padding: 0; font-size: 0; gap: 0; }
  .staff-topbar .btn--new svg:first-child { width: 18px; height: 18px; }
  .staff-topbar .btn--new svg:last-child { display: none; }
  .header-bell { width: 44px; height: 44px; justify-content: center; padding: 0; border: 0; border-radius: 12px; background: transparent; position: relative; }
  .header-bell .count { position: absolute; top: 5px; right: 2px; font-size: 10.5px; line-height: 16px; }
  .header-profile { padding: 0; }
  .header-profile .avatar { width: 32px; height: 32px; font-size: 12px; }
  .header-profile > svg { display: none; }
  .header-menu__panel { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; max-height: calc(100vh - 140px); overflow-y: auto; }
  .procedure-tabs { top: 56px; padding: 0 8px; }
  .procedure-tabs a { height: 48px; padding: 0 12px; font-size: 14px; }
  .staff-main { padding: 16px 16px 96px; }
  .staff-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); height: 66px; padding-bottom: env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--bd); background: var(--header); }
  .staff-tabbar > a, .staff-tabbar__more > summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--tx2); font-size: 11.5px; font-weight: 700; text-decoration: none; list-style: none; cursor: pointer; }
  .staff-tabbar__more > summary::-webkit-details-marker { display: none; }
  .staff-tabbar__more > summary { height: 100%; }
  .staff-tabbar__icon { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: var(--r-pill); }
  .staff-tabbar__icon svg { width: 21px; height: 21px; }
  .staff-tabbar__icon .count { position: absolute; top: -4px; left: 26px; font-size: 10px; line-height: 15px; }
  .staff-tabbar > a[aria-current="page"], .staff-tabbar__more[open] > summary { color: var(--tx); }
  .staff-tabbar > a[aria-current="page"] .staff-tabbar__icon, .staff-tabbar__more[open] .staff-tabbar__icon { background: linear-gradient(120deg, #d9ebf8, #d6f1ec); }
  .staff-tabbar__more[open]::before { content: ''; position: fixed; inset: 0 0 66px; background: rgb(11 34 51 / 40%); }
  .staff-tabbar__more[open] .staff-sheet { position: fixed; left: 0; right: 0; bottom: 66px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 10px 16px 20px; border-radius: 24px 24px 0 0; background: var(--header); }
  .staff-sheet__handle { align-self: center; width: 40px; height: 4px; margin-bottom: 8px; border-radius: 2px; background: #e0d8ca; }
  .staff-sheet .staff-panel__group { padding: 10px 8px 2px; }
  .staff-sheet__item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: var(--tx); font-size: 15px; text-decoration: none; text-align: left; width: 100%; }
  .staff-sheet__item[aria-current="page"] { background: var(--acc-bg); font-weight: 700; }
  .staff-sheet__item > span:nth-child(2) { flex: 1; }
  .staff-sheet__icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #eef5fa; color: #0f6fb8; }
  .staff-sheet__icon svg { width: 18px; height: 18px; }
  .staff-sheet form { margin: 0; }
  .staff-sheet__logout { color: var(--err); font-weight: 700; }
}

/* 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 .nav-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; }

  .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; }
  .list-card .data-table--cards td:first-child { padding-left: 0; padding-right: 104px; }
}

@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) {
}

@media (max-width: 340px) {
}

@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; }

/* Cibles tactiles mobiles d'au moins 44 px (Récif). */
@media (max-width: 720px) {
  .btn, .btn--sm { min-height: 44px; }
  .toasts { right: 16px; bottom: 84px; }
  .page-header { padding: 18px 18px 18px 22px; }
  .page-header h1 { font-size: 24px; }
  .page-header__actions, .page-header__actions .btn { width: 100%; }
  .modal__foot .btn { flex: 1 1 auto; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; border-bottom: 0; }
  .facts dd { padding-top: 2px; }
  .pagination__nav { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* Gabarit de liste Récif : compteurs compacts, carte de liste, lignes en cartes sous 900 px. */
.kpi-tiles--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-tiles--compact .kpi-tile { gap: 0; padding: 14px 18px; border-radius: 18px; }
.kpi-tiles--compact .kpi-tile__value { font-size: 26px; }
.kpi-tiles--compact .kpi-tile__label { font-size: 13px; }
.kpi-tiles--compact > li:nth-child(1) .kpi-tile { background: var(--grad-kpi-1); }
.kpi-tiles--compact > li:nth-child(2) .kpi-tile { background: var(--grad-kpi-2); }
.kpi-tiles--compact > li:nth-child(3) .kpi-tile { background: var(--grad-kpi-3); }
.kpi-tiles > li { list-style: none; min-width: 0; }
.kpi-tiles > li > .kpi-tile { height: 100%; }
.list-card { overflow: hidden; }
.list-card > .status-tabs + .escort-register__filters, .list-card > .escort-register__filters { border-bottom: 1px solid var(--bd-soft); }
.list-card .data-table th:first-child > span, .list-card .data-table td:first-child { padding-left: 18px; }
@media (max-width: 899px) {
  .kpi-tiles--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .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 { position: relative; padding: 14px 16px; border-bottom: 1px solid var(--row-bd); }
  .data-table--cards td { height: auto; padding: 2px 0; border: 0; }
  .data-table--cards td.cell-action { position: absolute; right: 16px; top: 14px; width: auto; padding: 0; }
  .data-table--cards tbody tr:hover td { background: none; }
}
@media (max-width: 480px) {
  .kpi-tiles--compact .kpi-tile { padding: 12px; }
  .kpi-tiles--compact .kpi-tile__value { font-size: 22px; }
  .kpi-tiles--compact .kpi-tile__label { font-size: 12px; }
}
.list-card .data-table--cards td[data-label]::before { content: none; }

.list-filters__errors { padding: 0 16px 12px; }
@media (max-width: 719px) {
  .status-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .status-tabs::-webkit-scrollbar { display: none; }
  .status-tabs a { flex: none; }
}
.todo-label { color: var(--warn); font-weight: 700; }

/* Dossier d'une procédure (maquette Escorte 1a, gabarit de dossier commun). */
.case-header { display: grid; gap: 18px; align-items: stretch; }
.case-header__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
/* Le menu « Plus » déborde sur la frise : sans cela, la frise (même niveau) le recouvre et bloque les clics. */
.case-header__top { z-index: 3; }
.case-header .page-header__lead { font-size: 15px; }
.case-header .page-header__actions form { margin: 0; }
.case-more__panel { width: 280px; padding: 6px; border-radius: var(--r-pop); }
.case-more__group { margin: 0; padding: 10px 10px 4px; color: var(--tx3); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.case-more__panel form { margin: 0; }
.case-more__item { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--tx); font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; }
.case-more__item:hover { background: var(--row-hover); color: var(--tx); }
.case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.case-layout__main, .case-layout__side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.facts--two-cols { grid-template-columns: 140px minmax(0, 1fr) 140px minmax(0, 1fr); column-gap: 14px; padding: 6px 20px 14px; }
.facts--two-cols dt:nth-last-child(2), .facts--two-cols dd:last-child { border-bottom: 1px solid #f0f4f7; }
.card__foot { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--bd-soft); font-size: 13.5px; font-weight: 700; }
.card__foot a { text-decoration: none; }
.case-note { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; }
.case-note--warn { background: var(--warn-bg); color: #5c3d00; }
.case-note--info { background: var(--info-bg); color: var(--info); }
.case-supplement { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--row-bd); }
.case-supplement:last-child { padding-bottom: 0; border-bottom: 0; }
.case-supplement__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.case-supplement__head h3 { font-size: 15px; }
.case-supplement__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.case-supplement__payment { margin: 0; color: var(--tx2); font-size: 13.5px; }
.case-exchanges .status-tabs { border-bottom: 1px solid var(--bd-soft); }
.case-thread { display: grid; gap: 12px; padding: 16px 20px; }
.js [data-tabs] .case-thread[hidden] { display: none; }
.case-thread__ticket { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--row-bd); }
.case-thread__subject { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.bubble { display: grid; gap: 3px; justify-self: start; max-width: 75%; }
.bubble__meta { color: var(--tx3); font-size: 12.5px; }
.bubble__meta strong { color: var(--tx); }
.bubble__text { margin: 0; padding: 10px 14px; border-radius: 16px; background: var(--s2); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.bubble--mine { justify-self: end; text-align: right; }
.bubble--mine .bubble__text { background: #e6f2fb; text-align: left; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin: 0; }
.composer textarea { flex: 1; min-height: 46px; padding: 12px 16px; border: 1px solid var(--bd2); border-radius: 16px; background: var(--s1); font-size: 14px; resize: vertical; }
.composer textarea:focus { outline: none; border: 2px solid var(--acc); box-shadow: var(--field-focus); }
.composer .btn { min-height: 46px; }
.next-action__rows { display: grid; gap: 6px; margin: 0; }
.next-action__rows > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.next-action__rows dt { color: #c9dceb; }
.next-action__rows dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.next-action form { margin: 4px 0 0; }
.next-action .btn--block { background: #fff; border-color: #fff; color: var(--deep); font-weight: 800; }
.case-side-card { display: grid; gap: 8px; padding: 16px 18px; }
.case-side-card h2 { font-size: 15px; }
.case-request { display: grid; gap: 8px; padding: 16px 18px; }
.case-request h2 { font-size: 15px; }
.case-request p { margin: 0; color: #3f5361; font-size: 13.5px; }
.case-request .btn { justify-self: start; }
.case-feedbacks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.case-feedbacks li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-feedbacks small { display: block; color: var(--tx2); font-size: 12px; }
.action-tile { display: grid; grid-template-columns: 36px minmax(0, 1fr) 14px; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; color: var(--tx); text-decoration: none; transition: background-color .15s; }
.action-tile:hover { background: var(--row-hover); color: var(--tx); }
.action-tile__sym { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #eef5fa; color: #0f6fb8; font-size: 12px; font-weight: 800; }
.action-tile strong { display: block; font-size: 14px; }
.action-tile small { display: block; color: var(--tx3); font-size: 12.5px; }
.modal__help { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--row-hover); color: #3f5361; font-size: 13.5px; line-height: 1.5; }
/* Sans JavaScript : la modale s'ouvre par son ancre (#id) et se ferme par « Annuler ». */
html:not(.js) dialog.modal:target { position: fixed; top: 8vh; left: 50%; z-index: 70; display: block; transform: translateX(-50%); }
@media (max-width: 1099px) {
  .case-layout { grid-template-columns: minmax(0, 1fr); }
  .facts--two-cols { grid-template-columns: 140px minmax(0, 1fr); }
}
@media (max-width: 719px) {
  .case-header .page-header__actions { width: 100%; }
  .case-header .page-header__actions > *, .case-header .page-header__actions form .btn { width: 100%; }
  .case-more { width: 100%; }
  .case-more > summary { width: 100%; }
  .facts--two-cols { grid-template-columns: 1fr; padding: 6px 16px 12px; }
  .steps { grid-template-columns: repeat(var(--steps, 5), minmax(64px, 1fr)); overflow-x: auto; padding-bottom: 4px; }
  .steps__label { font-size: 12px; }
  .bubble { max-width: 90%; }
  .composer { flex-direction: column; align-items: stretch; }
}
.card__head > div { flex: 1 1 260px; min-width: 0; }
.card__head > div small { display: block; }
.data-table td.num strong, .data-table .num strong { white-space: nowrap; }
.data-table td[data-label="PDF"] { white-space: nowrap; }

/* Formulaires de procédure (maquette Escorte 3a) : sections en cartes, récapitulatif collant. */
.form-page-head { display: grid; gap: 4px; }
.form-page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-layout--single { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.form-layout__main { display: grid; gap: 16px; min-width: 0; margin: 0; }
.card.form-section { padding: 22px 24px; border-top: 1px solid var(--bd); border-radius: var(--r-head); }
.card.form-section .form-section__head { grid-template-columns: 40px 1fr; align-items: center; column-gap: 14px; }
.card.form-section .form-section__index { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--grad-lagon); color: #fff; font-size: 15px; letter-spacing: 0; }
.form-actions-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; }
.form-actions-bar .form-note { flex: 1 1 260px; margin: 0; color: #3f5361; }
.recap-panel--inline .recap-panel__list > div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid rgb(255 255 255 / 12%); }
.recap-panel--inline .recap-panel__list dt { color: #c9dceb; font-size: 14px; }
.recap-panel--inline .recap-panel__list dd { font-size: 14px; text-align: right; }
.recap-panel__heading { font-size: 17px; }
.recap-panel__note { margin: 0; color: #c9dceb; font-size: 12.5px; }
.recap-panel--sticky { top: 140px; }
.field--changed input, .field--changed select, .field--changed textarea { border: 2px solid #1593bd !important; box-shadow: 0 0 0 4px rgb(21 147 189 / 14%); }
.field--changed .field__label::after { content: ' · modifié'; color: #0b6c8f; font-weight: 600; }
@media (max-width: 959px) {
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .recap-panel--sticky { position: static; }
}
@media (max-width: 719px) {
  .card.form-section { padding: 18px 16px; }
  .form-actions-bar .form__actions { width: 100%; flex-direction: column-reverse; }
  .form-actions-bar .form__actions .btn { width: 100%; }
}
.btn--new:disabled { background: var(--s2); box-shadow: none; color: var(--tx3); transform: none; }

/* Suivi d'une soumission vers Service Public (maquette Escorte details 9a / 9b). */
.narrow-page { display: grid; gap: 14px; max-width: 760px; }
.track-card { display: grid; gap: 12px; padding: 18px 20px; }
.track-card h2 { font-size: 15px; }
.track-card p { margin: 0; color: #3f5361; font-size: 14px; }
.track-card__meta { font-size: 14px; }
.track-card__key { margin: 0; color: var(--tx2); font-size: 12.5px; }
.track { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.track__item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; font-size: 14px; }
.track__dot { width: 14px; height: 14px; margin-top: 3px; border: 3px solid #e0d8ca; border-radius: 50%; background: var(--s1); }
.track__body { display: flex; flex-direction: column; }
.track__help { color: var(--tx2); font-size: 13px; }
.track__when { color: var(--tx3); font-size: 12.5px; }
.track__item--done .track__dot { border-color: var(--turquoise); background: var(--turquoise); }
.track__item--current .track__dot { border-color: #f0b44c; }
.track__item--failed .track__dot { border-color: var(--err); background: var(--err-bg); }
.track__item--future { color: var(--tx3); }
.list-card__title { padding: 16px 18px 0; font-size: 17px; }
.list-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--bd-soft); }
.list-card__head .list-card__title { padding: 0; }
.list-card__head p { margin: 4px 0 0; font-size: 13.5px; }
.list-card__summary { margin: 0; padding: 10px 18px; border-bottom: 1px solid var(--bd-soft); color: var(--tx2); font-size: 13px; }
.list-card__summary strong { color: var(--tx); }
.list-card .escort-register__local-filter { padding: 12px 18px; border-bottom: 1px solid var(--bd-soft); }
.list-card .escort-register__local-filter select { min-height: 40px; padding: 0 12px; border: 1px solid var(--bd2); border-radius: var(--r-field); }
.payment-guide > div { border-radius: var(--r-pop); border-left-width: 4px; }
.pay-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--tx3); }
.pay-steps li { padding-top: 8px; border-top: 4px solid #e6dfd3; }
.pay-steps li.is-active { border-top-color: transparent; border-image: var(--grad-lagon) 1; color: var(--tx); font-weight: 800; }
.recap-panel__alert { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgb(253 232 231 / 92%); color: var(--err); font-size: 13.5px; font-weight: 600; }
.card__head-links { display: flex; flex-wrap: wrap; gap: 8px; }
.decision-card { border-color: var(--bd); }
.decision-card__form { display: grid; gap: 12px; margin: 0; }
.case-side-card form { margin: 0; }
.card__body h3 { font-size: 14px; }

/* Statistiques (maquette Escorte 4a). */
.stats-page { gap: 16px; }
.stats-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stats-kpis .kpi { gap: 2px; padding: 16px 18px; border: 0; border-radius: 18px; background: var(--grad-kpi-1); color: #fff; box-shadow: var(--shadow-kpi); }
.stats-kpis .kpi:nth-child(1) { background: var(--grad-next); }
.stats-kpis .kpi:nth-child(3) { background: var(--grad-kpi-2); }
.stats-kpis .kpi:nth-child(4) { background: var(--grad-kpi-3); }
.stats-kpis .kpi span { order: 2; color: #fff; opacity: .92; font-size: 13px; }
.stats-kpis .kpi strong { order: 1; font-size: 30px; font-weight: 800; }
.stats-kpis .kpi small { order: 3; color: #fff; opacity: .8; font-size: 12px; }
.stats-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stats-side { display: grid; gap: 16px; }
.stats-chart-card { border-radius: var(--r-head); }
.stats-split { display: flex; height: 14px; overflow: hidden; border-radius: var(--r-pill); background: var(--s2); }
.stats-split__part--1 { background: #e9b04e; }
.stats-split__part--2 { background: #0d5f93; }
.stats-split__part--3 { background: #0f77b8; }
.stats-split__part--4 { background: #13734f; }
.stats-split__part--5 { background: #5d6b75; }
.stats-split__part--6 { background: #b4261e; }
.stats-split__part--7 { background: #b8c1c8; }
.stats-split__key { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; vertical-align: middle; }
.stats-status-table td { height: 40px; }
.stats-bars__fill { background: var(--grad-lagon); }
.stats-bars__track { height: 8px; border-radius: var(--r-pill); }
.stats-summary { border-left: 0; border-radius: var(--r-pop); background: var(--info-bg); }
@media (max-width: 1099px) { .stats-layout { grid-template-columns: minmax(0, 1fr); } }
.stats-page .table-scroll table, .stats-status-table { min-width: 0; }
.stats-chart-card .table-scroll { max-width: 100%; }
