/* Atelia — composants (cartes KPI, tableaux, filtres, pastilles, boutons, drawer, toasts, graphes CSS) */

/* ---- Grilles de contenu ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpis.k3 { grid-template-columns: repeat(3, 1fr); }   /* réseau : 2 rangs × 3 cartes étirées */
/* Carte à hauteur bornée + contenu défilable (évite le vide sous une carte voisine plus haute). */
.card-b.scroll-cap { max-height: 300px; overflow: auto; }
.grid { display: grid; gap: 20px; }
.grid.c2 { grid-template-columns: 1fr 336px; }
.grid.c2b { grid-template-columns: 1.4fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2e { grid-template-columns: 1fr 1fr; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .grid.c4 { grid-template-columns: repeat(2, 1fr); } }

/* Bloc dépliant « à la demande » (retours Kenzy #5/#9 : détails secondaires repliés). */
details.disclose { margin: 8px 0; }
details.disclose > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--blue); list-style: none; padding: 6px 0; display: inline-flex; align-items: center; gap: 7px; user-select: none; }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before { content: "\203A"; font-weight: 800; font-size: 15px; line-height: 1; transition: transform .15s ease; }
details.disclose[open] > summary::before { transform: rotate(90deg); }

/* Softphone (console seryz) — repère du front déployé */
.sp-num { width: 100%; font-size: 20px; font-weight: 700; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin: 12px 0; letter-spacing: 1px; color: var(--navy); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.sp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sp-key { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 13px; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--navy); transition: background .12s, border-color .12s; }
.sp-key:hover { background: var(--surface-2); }
.sp-key:focus-visible { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--blue-soft); }

/* Gouttière basse de la zone de contenu : le bouton flottant (copilote / aide) est en
   position fixe au-dessus du contenu et masquait la DERNIÈRE ligne des tableaux — le montant
   « Récupéré » de la dernière ligne disparaissait sous le cercle à 1440 px. On réserve donc
   sous le contenu la hauteur du bouton (22 px de marge + 54 px de cercle) plus un dégagement,
   pour qu'aucune ligne ne puisse jamais passer dessous. */
.content { padding-bottom: 112px; }

/* FAB d'aide (franchiseur) — cercle fixe bas-droite + panneau (repère du front déployé) */
.help-fab { position: fixed; right: 22px; bottom: 22px; width: 54px; height: 54px; border-radius: 50%; background: var(--navy); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 26px rgba(22, 36, 63, .28); z-index: 40; }
.help-fab:hover { background: var(--navy-2, #26375b); }
.help-fab:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.help-panel { position: fixed; right: 22px; bottom: 86px; width: 264px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(22, 36, 63, .22); padding: 12px; z-index: 40; display: flex; flex-direction: column; gap: 6px; animation: atl-viewin .16s ease; }
.help-panel .hp-h { font-weight: 800; font-size: 14px; color: var(--navy); padding: 4px 6px 6px; }
.hp-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--navy); cursor: pointer; font-family: inherit; text-align: left; transition: background .15s; }
.hp-item:hover { background: var(--surface-2); }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid.c2, .grid.c2b, .grid.c3, .grid.c2e, .grid.c4 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } }
/* .kpis.k3 (Vue d'ensemble du franchiseur) : deux classes, elle l'emportait sur la règle ci-dessus ; une colonne sous 640 px (tour 4, L1). */
@media (max-width: 640px) { .kpis.k3 { grid-template-columns: 1fr; } }

/* ---- Carte KPI ---- */
/* Les cartes d'une rangée sont ÉTIRÉES à la même hauteur et leur valeur est ancrée en bas :
   un libellé qui prend deux lignes ne décale plus le chiffre de sa voisine, et le bas des
   rangées reste aligné (défaut relevé depuis que les montants sont écrits en entier). */
.kpi { background: var(--surface); border: none; border-radius: var(--r); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-self: stretch; }
/* Le bloc de libellé réserve DEUX lignes : un libellé long ne descend plus le chiffre de sa
   carte pendant que celui d'à côté reste en haut. Le sous-titre est ancré en bas (margin-top:auto),
   si bien que les valeurs d'une même rangée démarrent à la même hauteur et que les bas s'alignent. */
.kpi .top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; min-height: 34px; }
/* Icônes des cartes statistiques RETIRÉES (retour Saleh) — libellé typographique sobre à la place. */
.kpi .ic { display: none; }
.kpi .lb { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.kpi .val { font-size: 27px; font-weight: 800; letter-spacing: -.6px; color: var(--navy); line-height: 1.1; }
/* Corrections 27/09 · vague C (UX-CONSOLE-AUTRES-8) : un côte à côte rendu dans une tuile n'hérite plus du
   resserrement du grand chiffre (« UberEats », « relevélujusqu'au… ») : badges et notes reprennent un
   espacement normal ; le montant garde le sien, et la ligne de couverture sa graisse de note. */
.kpi .val .pf-cac { letter-spacing: normal; }
.kpi .val .pf-cac-v { letter-spacing: -.6px; }
.kpi .val .pf-cac-partiel { letter-spacing: normal; }
/* Vague 7 : dans une tuile, le montant et sa mention « partiel » restent sur une même ligne
   (Contestations › Récupéré à 1280 : « partiel » ne reste plus seul sous le montant). */
.kpi .val .pf-cac-lignes .pf-cac-v { white-space: nowrap; }
.kpi .val .pf-cac-notes { font-weight: 600; }
.kpi .val.na { color: var(--na); font-weight: 700; letter-spacing: 0; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 4px; display: flex; align-items: center; gap: 6px; }
.kpi .delta { font-weight: 700; }
.kpi .delta.up { color: var(--vert); }
.kpi .delta.down { color: var(--rouge); }
.kpi .delta.flat { color: var(--muted); }
.kpi .sub .brut { color: var(--ink-2); }
/* UX-UX-MAJEURS-CLIENTS-6 · Calendrier : le détail par plateforme reste collé à son total ; le vide passe en bas de la carte. */
.kpis:has(> .kpi[data-guide="cal-kpi-versement"]) .kpi .sub { margin-top: 0; }
/* Affordance cliquable (retour Kenzy A01.1) : chevron PERMANENT (visible au tactile), pas seulement au hover. */
.kpi.clickable { cursor: pointer; position: relative; transition: box-shadow .15s, border-color .15s, transform .12s; }
.kpi.clickable::after { content: "\203A"; position: absolute; top: 12px; right: 14px; font-size: 18px; font-weight: 700; line-height: 1; color: var(--blue); opacity: .55; transition: opacity .15s, transform .15s; }
.kpi.clickable:hover { border-color: var(--blue-bd); box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.kpi.clickable:hover::after { opacity: 1; transform: translateX(2px); }
.kpi.clickable:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- Carte générique ---- */
.card { background: var(--surface); border: none; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { font-size: 14.5px; font-weight: 700; color: var(--navy); margin: 0; }
.card-h .card-sub { font-size: 12px; color: var(--muted); }
.card-h .card-act { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* Le bouton d'action d'un en-tête de carte ne se plie jamais sur deux lignes : c'est le sous-titre qui cède. */
.card-h .card-act .btn { flex: none; white-space: nowrap; }
.card-b { padding: 18px 20px; }
.card-b.flush { padding: 0; }

/* ---- Tableau ---- */
/* Indice de défilement horizontal (Mobbin : tables denses Deel/Zoho/Dub) : ombres de bord
   qui apparaissent quand il reste des colonnes à droite/gauche sur mobile. Pur CSS. */
.tbl-wrap {
  overflow-x: auto;
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left center / 28px 100% no-repeat,
    linear-gradient(to left, var(--surface) 30%, rgba(255,255,255,0)) right center / 28px 100% no-repeat,
    radial-gradient(farthest-side at 0 50%, rgba(22,36,63,.10), rgba(22,36,63,0)) left center / 12px 100% no-repeat,
    radial-gradient(farthest-side at 100% 50%, rgba(22,36,63,.10), rgba(22,36,63,0)) right center / 12px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); text-align: left; padding: 11px 18px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover, .tbl th.sortable.active { color: var(--navy); }
.tbl th.sortable .sort-arr { font-size: 10px; margin-left: 2px; }
.tbl td { font-size: 13px; color: var(--ink-2); padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.tbl tbody tr:last-child td, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td .n { font-variant-numeric: tabular-nums; color: var(--navy); font-weight: 600; }
.tbl td b { color: var(--navy); font-weight: 700; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.tbl tr.row-selected td { background: var(--blue-soft); }
.tbl td .muted, .muted { color: var(--muted); }
.tbl .row-act { border: 1px solid var(--line); background: var(--surface); color: var(--navy); font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.tbl .row-act:hover { background: var(--surface-2); }
.tbl .row-act.done { color: var(--vert); border-color: var(--vert-bd); background: var(--vert-bg); }

/* ---- Filtres / chips / segment ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px; cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
/* Chip actif : TOUT le texte passe en blanc (le compteur restait gris = illisible — retour Saleh). */
.chip.on b, .chip.on small, .chip.on .n, .chip.on .muted, .chip.on span:not(.cd) { color: #fff; }
.chip .cd { width: 7px; height: 7px; border-radius: 50%; }
.chip .cd.red { background: var(--rouge); } .chip .cd.orange { background: var(--orange); } .chip .cd.green { background: var(--vert); } .chip .cd.blue { background: var(--blue); }

.segment { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segment button { border: 0; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.segment button.on { background: var(--accent); color: #fff; }
/* Corrections 27/09 · vague C (UX-S6a-2, UX-RESEAU-6, UX-S1-b-5) : dans le Réseau, avec un restaurant choisi,
   le segment Tous / Succursales / Franchisés est désactivé (sans effet) ; il ne ressemble plus à un segment
   actif. Même atténuation que .chip:disabled : aucune couleur ni forme nouvelle. */
.segment button:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Pastilles / badges sémantiques ---- */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.st.plain::before { display: none; }
.st.blue { color: var(--blue); background: var(--blue-soft); border: 1px solid var(--blue-bd); }
.st.green { color: var(--vert); background: var(--vert-bg); border: 1px solid var(--vert-bd); }
.st.red { color: var(--rouge); background: var(--rouge-bg); border: 1px solid var(--rouge-bd); }
.st.orange { color: var(--orange); background: var(--orange-bg); border: 1px solid var(--orange-bd); }
.st.navy { color: var(--navy); background: #EAECF2; border: 1px solid #DADFEA; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; border-radius: 20px; color: var(--blue); background: var(--blue-soft); }
.pill.orange { color: var(--orange); background: var(--orange-bg); }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #EAECF2; color: var(--navy); }
.tag.succ { background: var(--vert-bg); color: var(--vert); }
.tag.fran { background: var(--blue-soft); color: var(--blue); }

/* ---- Boutons ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 600; padding: 9px 14px; cursor: pointer; background: var(--surface-2); color: var(--ink); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); box-shadow: 0 4px 14px rgba(11,122,67,.24); }
.btn.blue { background: var(--blue-soft); color: var(--blue-strong); border-color: var(--blue-bd); }
.btn.blue:hover { background: #E9DCFB; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--navy); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.outline { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
/* UX-USC-13 · Relevés › Alertes argent : chaque geste tient sur une ligne. */
[data-sk-liste="hub-dlv-alertes"] .btn.sm { white-space: nowrap; }
.btn.danger { background: var(--rouge-bg); color: var(--rouge); border-color: var(--rouge-bd); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Champs de formulaire ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 9px 11px; font-size: 13px; color: var(--ink); font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(36,86,196,.15); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.toggle input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }
.toggle .track { width: 38px; height: 22px; border-radius: 20px; background: #D7DAE3; position: relative; transition: background .15s; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.toggle input:checked + .track { background: var(--vert); }
.toggle input:checked + .track::after { left: 18px; }

/* ---- Drawer / overlay / modale ---- */
.overlay { position: fixed; inset: 0; background: rgba(22,36,63,.32); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.overlay.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--surface); transform: translateX(100%); transition: transform .22s ease; z-index: 41; display: flex; flex-direction: column; }
/* Corrections 27/09 (UX-reseau-01, UX-console-releves-23, UX-console-autres-14, UX-restaurant-01) :
   l'ombre n'existe que tiroir OUVERT. Rangé hors écran, il ne laisse plus de bande grise au bord droit. */
.drawer.open { transform: translateX(0); box-shadow: var(--shadow-drawer); }
.drawer:not(.open) { box-shadow: none; }
.drawer .dh { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.drawer .dh h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--navy); }
.drawer .dh .x { margin-left: auto; border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; color: var(--ink-2); font-size: 16px; }
.drawer .db { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
/* UX-console-releves-24 : arrivé en bas du tiroir, la molette ne fait plus défiler la page derrière. */
.drawer .db { overscroll-behavior: contain; }
/* G9 · la rangée d'action d'un tiroir reste COLLÉE en bas : le corps défile derrière elle,
   le bouton final est lisible sans avoir à faire défiler le panneau jusqu'en bas.
   Elle est POSÉE SUR le tiroir (position: fixed ; le tiroir porte une transform, il est donc
   le bloc conteneur : la barre suit son glissement) et le corps réserve sous son dernier
   champ une hauteur de barre + 16 px. Une fois défilé au bout, le dernier champ est donc
   entièrement visible — auparavant la ligne « Début / Fin » passait sous la barre. */
.drawer .db { padding-bottom: 78px; }
.drawer .db .drawer-actions { position: fixed; left: 0; right: 0; bottom: 0; margin: 16px 0 0; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--line-2); display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; }
/* X4 · le refus d'une saisie dans un tiroir ne DÉSALIGNE pas la rangée de champs : le message
   sort du flux et se pose, pleine largeur, sous la rangée. Les colonnes « Montant (€) » et
   « Validité (jours) » gardent la même ligne de base avec ou sans erreur. Un seul message à la
   fois par rangée (l'écran valide dans l'ordre) : deux messages posés au même endroit se
   recouvriraient. */
.drawer .db .row-champs { position: relative; margin-bottom: 14px; }
.drawer .db .row-champs:has(.field-err), .drawer .db .row-champs:has([data-field-error]) { padding-bottom: 20px; }
.drawer .db .row-champs .field { margin-bottom: 0; }
.drawer .db .row-champs .field-err,
.drawer .db .row-champs [data-field-error] { position: absolute; left: 0; right: 0; top: 100%; }
/* R5 · UN SEUL PATRON DE REFUS DE SAISIE — un message rouge SOUS le champ, la même allure
   partout (tiroir, page pleine, formulaire de paramètres). Deux porteurs, une seule règle :
     .field-err          = la classe, quand un gabarit écrit le message lui-même ;
     [data-field-error]  = l'attribut posé par App.fieldError (screens/shared.js), producteur
                           unique du message ET de l'aria-invalid porté par le champ.
   Aucune valeur n'est redéfinie ailleurs : un refus ne peut plus être gris ici et rouge là. */
.field-err,
[data-field-error] { font-size: 11.5px; font-weight: 700; color: var(--rouge); margin-top: 2px; }
.field-err[hidden] { display: none; }
/* Champ refusé : le marquage suit le message, il ne dépend pas de l'écran qui l'a écrit. */
.field [aria-invalid="true"], input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--rouge); background: var(--rouge-bg); }
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 42; opacity: 0; pointer-events: none; transition: opacity .18s; }
.modal.open { opacity: 1; pointer-events: auto; background: rgba(22,36,63,.32); }
/* Corrections 27/09 (UX-restaurant-02, UX-console-autres-13, UX-console-releves-24) : une fenêtre
   ouverte pose le MÊME voile que les tiroirs (.overlay) sur toute la page, tiroir ouvert compris
   (#modal suit #drawer dans le DOM et passe au-dessus). La carte de bienvenue du guide garde son
   voile propre (guide.css, chargé après). */
/* UX-restaurant-41 (3) : la fenêtre « Donner un retour » imbrique son propre .mbox (.fb-box) dans
   celui d'openModal. Au-dessus de 900 px, le cadre extérieur s'efface : un seul cadre. Sous 900 px,
   responsive.css aplatit déjà l'intérieur (feuille du bas). */
@media (min-width: 901px) {
  .modal > .mbox:has(> .fb-box) { width: auto; max-width: none; padding: 0; background: none; box-shadow: none; }
}
.modal .mbox { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-2); width: 460px; max-width: 92vw; padding: 22px 22px 18px; }
.modal .mbox.wide { width: 640px; }
.modal h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--navy); }
.modal .m-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* Retour visiteur (feedback) */
.fb-box { max-height: 88vh; overflow: auto; }
.fb-lead { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.fb-ctx { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.fb-ctx-t { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 8px; }
.fb-ctx-g { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.fb-r { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; align-items: baseline; }
.fb-r span { color: var(--muted); white-space: nowrap; }
.fb-r b { color: var(--ink); font-weight: 700; text-align: right; }
.fb-sep { height: 1px; background: var(--line); margin: 6px 0 14px; }
.fb-actions-add { margin-top: 4px; }
.fb-store-h { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.fb-store-h b { color: var(--navy); }
.fb-empty { font-size: 12.5px; color: var(--muted); padding: 6px 0 4px; }
.fb-list { display: flex; flex-direction: column; gap: 8px; max-height: 168px; overflow: auto; margin-bottom: 4px; }
.fb-item { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--surface); }
.fb-item-h { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.fb-item-h b { color: var(--navy); }
.fb-item-h .fb-mut { flex: 1; }
.fb-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.fb-del:hover { color: var(--rouge); background: var(--rouge-bg); }
.fb-item-n { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }
@media (max-width: 560px) { .fb-ctx-g { grid-template-columns: 1fr; } }

/* --- Fidélité au front déployé : animations & repères de navigation --- */
@keyframes atl-viewin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#screen.viewin, #fr-screen.viewin { animation: atl-viewin .2s ease; }
.crumb { font-size: 13px; color: var(--muted); white-space: nowrap; margin-right: 6px; }
.crumb b { color: var(--navy); font-weight: 800; }
.topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }   /* topbar pleine (déployé), pas de givré */

/* Barre du haut : UNE seule rangée à 1 280 comme à 1 440 px, guide affiché ou non — et
   RIEN de coupé, rien qui défile en cachette.
   Ce qui cède, dans l'ordre :
     1. la recherche, qui se réduit jusqu'à ne plus montrer que sa loupe ;
     2. les espacements et les rembourrages des pastilles, quand la largeur se resserre.
   Ce qui ne cède JAMAIS : le fil d'Ariane, entier tant qu'il tient (flex-shrink 0 — abrégé
   à 1 440 px alors qu'il avait la place, il annonçait une vue tronquée) ; et le libellé
   d'une pastille (période, périmètre, Mode démo), qui ne se coupe ni ne passe à la ligne.
   Plus aucun défilement horizontal sans barre visible : il faisait disparaître la cloche
   et « Mode démo » hors de l'écran sans le dire. Sous 1 241 px, css/responsive.css garde
   ses DEUX rangées ; on y laisse seulement la recherche se réduire, pour que la deuxième
   rangée tienne en entier. */
.topbar { flex-wrap: nowrap; min-width: 0; }
.topbar .crumb { flex: 0 0 auto; min-width: 0; white-space: nowrap; overflow: visible; text-overflow: clip; }
.topbar .search input { min-width: 0; }
.topbar .spacer { flex: 1 1 0; min-width: 0; }
.topbar .selctl, .topbar .segment, .topbar .icon-btn, .topbar .btn { flex: 0 0 auto; }
.topbar .selctl, .topbar .segment button, .topbar .chip, .topbar .btn { white-space: nowrap; }

/* Desktop (≥ 901 px) : la rangée tient, ou elle se resserre — elle ne défile pas. */
@media (min-width: 901px) {
  .topbar .tb-controls { flex-wrap: nowrap; min-width: 0; overflow: visible; }
  .topbar .tb-controls .search { flex: 1 1 200px; min-width: 34px; max-width: 320px; }
}
/* Desktop resserré : on récupère les pixels sur les espacements et les rembourrages,
   jamais sur un libellé. */
@media (min-width: 901px) and (max-width: 1400px) {
  .topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .topbar .crumb { margin-right: 0; }
  .topbar .tb-controls { gap: 6px; }
  .topbar .selctl { gap: 5px; padding-left: 8px; padding-right: 8px; }
  .topbar .segment { padding: 2px; }
  .topbar .segment button { padding-left: 7px; padding-right: 7px; }
  .topbar .icon-btn { width: 34px; height: 34px; }
}
/* Encore plus serré près du seuil des deux rangées : c'est là que « Mode démo » et la
   cloche partaient hors écran. */
@media (min-width: 901px) and (max-width: 1340px) {
  .topbar .selctl { padding-left: 7px; padding-right: 7px; }
  .topbar .segment button { padding-left: 6px; padding-right: 6px; }
}
/* 1 241 → 1 799 px : sur une seule rangée, la recherche tombait à 34–86 px à 1 280 px et son
   texte d'aide était coupé. Arbitrage de l'orchestrateur (22/09, D16) : la recherche utilisable
   passe avant la rangée unique. Cette bande prend donc le repli en deux rangées (comme sous
   1 241 px, règle de css/responsive.css) ; la rangée unique vaut à partir de 1 800 px, où la
   recherche du franchiseur (la barre la plus chargée) garde son texte d'aide entier. */
@media (min-width: 1241px) and (max-width: 1799px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--topbar-h); row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .topbar .tb-controls { flex: 1 1 100%; }
  .topbar .spacer { display: none; }
}
/* 901 → 1 279 px : la rangée des contrôles passe à la ligne (voir plus bas) ; la recherche n'a
   donc plus à céder jusqu'à la loupe. Elle garde la largeur de son texte d'aide entier
   (« Rechercher un PDV, une commande… », le plus long), au lieu d'un texte coupé net. */
@media (min-width: 901px) and (max-width: 1279px) {
  .topbar .tb-controls .search { flex: 1 1 276px; min-width: 276px; max-width: 320px; }
}
/* 1 280 → 1 799 px, deux rangées : la seconde rangée a la place ; la recherche garde la
   largeur de son texte d'aide entier (« Rechercher un restaurant, une commande… »). */
@media (min-width: 1280px) and (max-width: 1799px) {
  .topbar .tb-controls .search { flex: 1 1 304px; min-width: 304px; max-width: 380px; }
}
/* N14 · K10 · W1 (23/09) : 901 → 1 799 px, la rangée des contrôles PASSE À LA LIGNE au lieu de
   pousser « Mode démo » hors de l'écran (franchiseur à 1 280 px avec un restaurant choisi : il
   débordait de x 1 249 à 1 339). Un contrôle entier descend d'une rangée ; aucun n'est coupé. */
@media (min-width: 901px) and (max-width: 1799px) {
  .topbar .tb-controls { flex-wrap: wrap; row-gap: 8px; }
}
.btn, .chip, .selctl, .cal-cell { transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .12s ease, filter .15s ease; }
@media (prefers-reduced-motion: reduce) { #screen.viewin, #fr-screen.viewin { animation: none; } }
/* Cloche de notifications (repère du front déployé) */
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s ease, border-color .15s ease; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.icon-btn .ibadge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--rouge); color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* ---- Toast ---- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; align-items: center; transition: bottom .18s ease; }
/* X5 · tiroir ouvert : la pile de toasts ne doit recouvrir ni le bouton principal du tiroir ni
   un message d'erreur posé sous un champ. #drawer précède .toasts dans la coque, la règle se
   lit donc sans classe ajoutée en JavaScript.
   · écran assez large : la pile SORT du tiroir et se centre dans l'espace resté à gauche ;
   · écran étroit (le tiroir occupe presque tout) : elle monte au-dessus de la barre d'action. */
.drawer.open ~ .toasts { bottom: 98px; }
@media (min-width: 760px) {
  .drawer.open ~ .toasts { bottom: 20px; transform: translateX(calc(-50% - min(220px, 46vw))); }
  .drawer.open ~ .toasts .toast { max-width: calc(100vw - min(440px, 92vw) - 48px); }
  /* UX-S5-a-7 : en haut, pour ne pas couvrir le bloc utilisateur du bas du menu (même forme que la fenêtre de confirmation). */
  .drawer.open ~ .toasts { top: 12px; bottom: auto; }
}
/* Une fenêtre de confirmation ouverte : le message passe en haut, pour ne jamais couvrir ses boutons (T4, restaurateur). */
.modal.open ~ .toasts { top: 12px; bottom: auto; }
.toast { background: var(--navy); color: #fff; border-radius: 11px; padding: 11px 16px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-2); display: flex; align-items: center; gap: 9px; animation: toastin .2s ease; }
.toast .ti { width: 8px; height: 8px; border-radius: 50%; background: var(--vert-bd); }
.toast.sim .ti { background: var(--orange-bd); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- États honnêtes : note / à venir / vide ---- */
.note { font-size: 12.5px; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; display: flex; align-items: center; gap: 8px; }
.note.err { color: var(--rouge); background: var(--rouge-bg); border-color: var(--rouge-bd); border-style: solid; }
.note.load { color: var(--ink-2); }
.avenir { border-left: 4px solid var(--orange); background: var(--orange-bg); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.avenir .txt b { color: var(--orange); }
.avenir .txt div { font-size: 12px; color: var(--ink-2); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 13.5px; }
.empty svg { width: 30px; height: 30px; opacity: .85; margin-bottom: 10px; color: var(--blue); }
/* ---- Les TROIS gabarits de valeur, visuellement distincts (C1) ----
   .na      « NA »      non mesuré      → gris désaturé, italique, jamais une valeur réelle
   .zero    « 0,00 € »  mesuré et nul   → encre pleine, style NORMAL
   .a-venir « à venir »  période future → pastille orange, ni gris ni italique              */
.na { color: var(--na); font-style: italic; font-weight: 600; }
.zero { color: var(--ink); font-weight: 600; font-style: normal; }
/* Vague 7 : dans une case de tableau, un 0 mesuré s'écrit comme les autres nombres de la ligne
   (même encre, même graisse) : l'œil ne va pas sur les zéros plutôt que sur les valeurs non nulles. */
.tbl td .zero { color: inherit; font-weight: inherit; }
.a-venir { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; font-style: normal;
  letter-spacing: .2px; padding: 2px 8px; border-radius: var(--r-pill); color: var(--orange); background: var(--orange-bg); }
/* Mention « estimée » (D10) : la part estimée ne se confond jamais avec une mesure. */
.estime { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; font-style: normal;
  text-transform: lowercase; letter-spacing: .2px; padding: 1px 7px; margin-left: 5px; border-radius: var(--r-pill);
  color: var(--orange); background: var(--orange-bg); vertical-align: middle; }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, #F0EEE7 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skel 1.2s ease infinite; border-radius: 6px; color: transparent !important; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Graphes CSS ---- */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.spark i { flex: 1; background: var(--blue-soft); border-radius: 3px 3px 0 0; min-height: 3px; }
.spark i.hi { background: var(--blue); }
.bars { display: flex; flex-direction: column; gap: 5px; }
.bar { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; }
.bar .bl { font-size: 12.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .track { height: 8px; background: var(--surface-3); border-radius: 20px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--navy); border-radius: 20px; }
.bar .fill.blue { background: linear-gradient(90deg, var(--blue), #5B8DEF); }
.bar .bv { font-size: 13px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; min-width: 58px; text-align: right; white-space: nowrap; }
.bar.clickable { cursor: pointer; transition: background .12s; }
.bar.clickable:hover { background: var(--surface-2); }
.bar.clickable:hover .bl { color: var(--navy); }
/* Variante « classement » (page Réseau) : numéro de rang devant chaque barre. */
.bars.ranked .bar { grid-template-columns: 26px 150px 1fr auto; }
.bars.ranked .rk { font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.bars.noms .bl, .bars.ranked .bl { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }   /* UI-09 : le nom entier, jamais de points de suspension */
.bars.ranked .bar:nth-child(-n+3) .rk { color: var(--navy); }
.split { display: flex; height: 12px; border-radius: 20px; overflow: hidden; background: var(--line-2); }
.split i { height: 100%; }
.split i.uber { background: var(--vert); } .split i.deliveroo { background: #00998f; }
.split-lg { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.split-lg .k { display: inline-flex; align-items: center; gap: 6px; }
.split-lg .k b { color: var(--navy); }
.split-lg .sw { width: 10px; height: 10px; border-radius: 3px; }
.obj { display: flex; flex-direction: column; gap: 12px; }
.obj .o { display: flex; flex-direction: column; gap: 6px; }
.obj .o-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.obj .o-top b { color: var(--navy); font-weight: 700; }
.obj .track { height: 8px; background: var(--line-2); border-radius: 20px; overflow: hidden; }
.obj .fillo { height: 100%; background: var(--vert); border-radius: 20px; }
.obj .fillo.warn { background: var(--orange); }
.donut { --p: 0; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--navy) calc(var(--p) * 1%), var(--line-2) 0); display: grid; place-items: center; }
.donut .hole { width: 84px; height: 84px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }

/* ---- Entonnoir (remboursement) ---- */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel .fstep { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.funnel .fbar { height: 34px; border-radius: 9px; display: flex; align-items: center; padding: 0 12px; color: #fff; font-weight: 700; font-size: 13px; }
.funnel .fbar.detecte { background: var(--navy); }
.funnel .fbar.conteste { background: #2f4066; }
.funnel .fbar.recupere { background: var(--vert); }
.funnel .fbar.fuite { background: var(--rouge); }
.funnel .fbar.nontraites { background: var(--muted); }
.funnel .fv { font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ---- Onglets ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 700; padding: 9px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }

/* ---- Compte à rebours (fenêtres remboursement) ---- */
.rebours { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rebours svg { margin-top: 2px; flex: 0 0 auto; }   /* UX-S3-4 : l'horloge reste sur la 1re ligne d'une échéance en deux lignes, */
.rebours { text-align: left; }                      /* et le texte coupé se range contre elle (sans effet sur une échéance d'une ligne) */
/* « ok » (échéance lointaine) en neutre : la couleur forte est réservée à l'urgence (retour Kenzy #2). */
.rebours.ok { color: var(--muted); } .rebours.mid { color: var(--orange); } .rebours.hi { color: var(--rouge); } .rebours.forclos { color: var(--muted); text-decoration: line-through; }

/* ---- Calendrier ---- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .cal-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell { position: relative; aspect-ratio: 1 / .82; border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 7px; cursor: pointer; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.cal-cell:hover { border-color: var(--line); background: var(--surface-2); }
.cal-cell.empty { border: 0; background: transparent; cursor: default; }
.cal-cell:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }   /* D13 : jour atteint au clavier */
.cal-cell .cd { font-size: 12px; font-weight: 700; color: var(--navy); }
/* Chiffre € du jour : PLUS GROS, CENTRÉ, sans gras (retour Saleh) — ça « excite » sans surcharger. */
.cal-cell .cv { font-size: 16px; font-weight: 500; color: var(--navy); font-variant-numeric: tabular-nums; margin: auto; width: 100%; text-align: center; }
.cal-cell .cv.muted { font-size: 11px; font-weight: 500; color: var(--muted); }
.cal-cell .cdot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; }
.cal-cell .cdot.green { background: var(--vert); } .cal-cell .cdot.orange { background: var(--orange); } .cal-cell .cdot.red { background: var(--rouge); }

/* ---- Copilote ---- */
.copilot { display: flex; flex-direction: column; gap: 12px; }
.cp-msg { display: flex; gap: 10px; }
.cp-msg .cp-av { width: 30px; height: 30px; border-radius: 9px; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; font-weight: 800; }
.cp-bubble { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; font-size: 13px; color: var(--ink); }
.cp-msg.me { flex-direction: row-reverse; }
.cp-msg.me .cp-bubble { background: var(--blue); border-color: var(--blue); color: #fff; }
.cp-just { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.cp-just b { color: var(--ink-2); }
.cp-suggest { display: flex; flex-wrap: wrap; gap: 8px; }

/* Sélecteur de périmètre PDV (drawer) — retours C16 « filtrer par PDV » / C34 « choisir un PDV ». */
.pp-search { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; margin-bottom: 10px; font-family: var(--font); color: var(--ink); background: var(--surface); box-sizing: border-box; }
.pp-list { display: flex; flex-direction: column; gap: 5px; max-height: 52vh; overflow: auto; }
/* Corrections 27/09 (UX-reseau-02 a, UX-console-autres-19, guide-decouverte-18) : dans un tiroir, la
   liste des restaurants (ou PDV) n'est plus plafonnée : le corps du tiroir (.drawer .db) défile déjà,
   un second défilement coupait les dernières lignes de la liste. La liste des périodes (sans id)
   garde sa règle. */
.drawer #ppList { max-height: none; overflow: visible; }
.pp-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 11px 12px; font-size: 15px; color: var(--ink); cursor: pointer; font-family: var(--font); }
/* Vague 12 : cases du sélecteur de périmètre (console) dans le vert du produit, pas le bleu du navigateur. */
[data-pp-coche] { accent-color: var(--accent); }
.pp-row .cd { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); flex: 0 0 auto; }
.pp-row:hover { background: var(--surface-2); }
.pp-row.on { border-color: var(--accent); background: var(--accent); color: #fff; }
/* UX-reseau-02 (b), UX-console-autres-19 : les badges de plateforme passent TOUJOURS sous le nom,
   alignés sur lui (pastille 8 px + écart 9 px), quelle que soit la longueur du nom. */
.pp-row:has(> .pf-badges) { flex-wrap: wrap; }
.pp-row .pf-badges { flex-basis: 100%; padding-left: 17px; }
.pp-row.on .muted { color: rgba(255,255,255,.82); }
/* Sur la ligne active (fond vert), la pastille d'état garde l'anneau clair des puces actives
   (.pf-puce.on .pf-point) : une pastille verte ne se fond pas dans le fond. */
.pp-row.on .cd { box-shadow: 0 0 0 1.5px var(--surface); }

/* Accueil restaurateur : mini-stats alignées à la même hauteur + accent couleur par bloc
   (retours C01 — D035 « carrés pas à la même hauteur », D036 « plus de code couleur, plus engageant »). */
.fr-root .fr-mini > div { display: flex; flex-direction: column; justify-content: center; min-height: 80px; border-top: 3px solid var(--line); }
.fr-root .fr-mini > div:nth-child(1) { border-top-color: var(--vert); }
.fr-root .fr-mini > div:nth-child(2) { border-top-color: var(--navy); }
.fr-root .fr-mini > div:nth-child(3) { border-top-color: var(--blue); }

/* Visite guidée interactive (retour C39) : feuille montante dans le cadre téléphone, étapes + nav. */
.fr-tour-ov { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; display: flex; justify-content: center; padding: 0 12px calc(env(safe-area-inset-bottom,0px) + 14px); transform: translateY(14px); opacity: 0; transition: transform .28s cubic-bezier(.32,1.06,.42,1), opacity .2s ease; pointer-events: none; }
.fr-tour-ov.show { transform: none; opacity: 1; pointer-events: auto; }
.fr-tour-card { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 34px rgba(22,36,63,.22); padding: 14px 15px; }
.fr-tour-top { display: flex; justify-content: space-between; align-items: center; }
.fr-tour-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--navy); }
.fr-tour-x { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; display: flex; }
.fr-tour-prog { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 6px; }
.fr-tour-title { font-size: 17px; font-weight: 800; color: var(--navy); margin-top: 3px; }
.fr-tour-text { font-size: 14px; color: var(--ink-2); line-height: 1.45; margin-top: 5px; }
.fr-tour-dots { display: flex; gap: 5px; margin: 11px 0; }
.fr-tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.fr-tour-dots span.on { background: var(--navy); }
.fr-tour-nav { display: flex; gap: 8px; }
.fr-tour-nav .fr-btn { flex: 1; margin: 0; }
.fr-tour-nav .fr-btn[disabled] { opacity: .45; pointer-events: none; }

/* D185 : les remplissages de barres (UI.bars/UI.obj) sont des <span> inline → la largeur en %
   était ignorée (barres vides). display:block rétablit le remplissage partout (audit, dashboard…). */
.bar .fill, .obj .fillo { display: block; }

/* Question libre de l'assistant restaurateur (retours C41/C03) : vraie zone de saisie dans la barre glass. */
.fr-inputbar .fr-input { display: flex; align-items: center; gap: 8px; margin: 0; }
.fr-qinput { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.fr-inputbar .send { border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; color: var(--navy); padding: 0; }

/* Softphone avec contact prérempli (retours C32). */
.sp-contact { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; padding: 9px 11px; background: var(--surface-2); border-radius: 12px; }
.sp-contact .av { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; }
.sp-contact b { display: block; font-size: 14px; color: var(--navy); }
.sp-contact span { font-size: 12px; color: var(--muted); }

/* ===== v21 · Réseau : menu qui dit à quoi sert chaque écran, et geste « Demander à Atelia » =====
   Trois besoins : une ligne d'explication sous chaque libellé du menu, un bouton de demande en
   tête de menu, et une pilule flottante qui porte son geste en toutes lettres. */

/* Intitulé du sélecteur d'espace : trois boutons nus ne disaient pas ce qu'ils changeaient. */
.persona-lb { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 0 10px 4px; }

/* Bouton de tête du menu : le premier geste n'est pas une page, c'est une demande. */
.nav-demander { display: flex; align-items: center; gap: 8px; width: calc(100% - 8px); margin: 0 4px 10px; padding: 11px 12px; border: 0; border-radius: 11px; background: var(--navy); color: #fff; font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-align: left; }
.nav-demander:hover { background: var(--navy-2, #26375b); }
.nav-demander:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.nav-demander svg { width: 17px; height: 17px; flex: none; }
.nav-demander span:first-of-type { flex: 1; }
.nav-demander .chev { font-size: 11px; opacity: .85; }

/* Entrée de menu à deux lignes : le libellé, puis ce à quoi l'écran sert. */
.nav a.has-sub { align-items: flex-start; padding-top: 8px; padding-bottom: 8px; }
.nav a.has-sub svg { margin-top: 2px; }
.nav .nav-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.nav .nav-lb { font-size: 13.5px; line-height: 1.25; }
.nav .nav-sub { font-size: 11px; line-height: 1.3; color: var(--muted); font-weight: 500; }
.nav a.on .nav-sub { color: var(--accent); opacity: .82; }
.nav a.has-sub .badge { margin-top: 1px; align-self: flex-start; }

/* Pilule flottante : le rond d'aide portait une bulle muette, la pilule porte le geste. */
.help-fab { width: auto; height: auto; border-radius: 26px; padding: 12px 18px; display: flex; align-items: center; gap: 9px; font-family: inherit; font-size: 13.5px; font-weight: 700; }
.help-fab svg { width: 20px; height: 20px; flex: none; }
.help-panel { width: 300px; max-width: calc(100vw - 32px); max-height: min(70vh, 560px); overflow: auto; }
.hp-item.presta { align-items: flex-start; }
.hp-item.presta svg { margin-top: 2px; flex: none; }
.hp-item .hp-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hp-item .hp-t b { font-size: 12.8px; font-weight: 700; line-height: 1.3; }
.hp-item .hp-t span { font-size: 11px; font-weight: 500; color: var(--muted); }
.hp-sep { height: 1px; background: var(--line); margin: 4px 2px; }

/* Panneau « Demander à Atelia » (tiroir) : une ligne par prestation, délai annoncé dessous. */
.dem-list { display: flex; flex-direction: column; gap: 8px; }
.dem-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-family: inherit; text-align: left; transition: background .15s, border-color .15s; }
.dem-row:hover { background: var(--surface-2); border-color: var(--navy); }
.dem-row .dem-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; flex: none; }
.dem-row .dem-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dem-row .dem-t b { font-size: 13.5px; color: var(--navy); line-height: 1.3; }
.dem-row .dem-t span { font-size: 11.5px; color: var(--muted); }
.dem-row > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

/* Fiche d'un restaurant : les cinq demandes, au-dessus de la ligne de flottaison. */
.fiche-demandes { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.fiche-demandes .fd-h { font-size: 12.5px; font-weight: 800; color: var(--navy); margin-bottom: 9px; }
.fiche-demandes .fd-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.fiche-demandes .fd-btns .btn { flex: 1 1 auto; }
.fiche-demandes .fd-note { font-size: 11.5px; color: var(--muted); margin-top: 9px; }

/* Fil du jour cliquable (vue d'ensemble) : chaque ligne mène au restaurant et à l'acte. */
.fr-row.acte { cursor: pointer; border-radius: 10px; }
.fr-row.acte:hover { background: var(--surface-2); }
.fr-row.acte .fr-go { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.lien-acte { color: var(--accent); font-weight: 700; }
.kpi.clickable:hover .lien-acte { text-decoration: underline; }

/* Tiroirs de rapport du franchiseur : libellé et explication à gauche, valeur à droite (UI-03). */
.fr-row.lecture .fr-t { min-width: 0; }
.fr-row.lecture .lecture-v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; max-width: 52%; }   /* le tiroir fait 440 px : une valeur longue passe à la ligne au lieu d'écraser l'explication */

/* UI-02 · légende de « — » (pas de mesure) : une ligne discrète sous le tableau, la carte ou le groupe de cartes. */
.na-legende { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }
/* RS-51 (27/09) : légende posée dans la sous-ligne d'une tuile : sur sa propre ligne, comme dans les tuiles de l'app. */
.kpi .sub:has(> .na-legende) { flex-wrap: wrap; }
.kpi .sub > .na-legende { flex: 1 0 100%; margin: 2px 0 0; }
.card > .na-legende { padding: 0 20px 14px; margin-top: 10px; }
.kpis + .na-legende, .fr-metrics + .na-legende { margin: -10px 0 16px; }

/* S-08 · dates d'une campagne en puces libellées (Réseau) : Diffusion / Résultats mesurés. */
.puces-dates { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.puce-date { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.puce-date .muted { font-weight: 600; }

/* S-09 · « Avis en attente de réponse » du Réseau : grille de cartes qui occupe la largeur
   (3 colonnes vers 1280, 2 vers 820, 1 à 390). */
.avis-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.avis-grille > .fr-row { flex-direction: column; align-items: stretch !important; gap: 8px !important; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; margin: 0; }
.avis-grille > .fr-row:last-child { border-bottom: 1px solid var(--line-2); }

/* S-12 · deux cartes de premier niveau qui se suivent gardent l'espacement standard des sections
   (20 px, le gap de .grid), sur toutes les pages. Le rythme des listes (avis, suggestions : 12 px) ne change pas. */
#screen > .card + .card, #screen > .card + .note, #screen > .grid + .note { margin-top: 20px; }   /* D-S12 : aussi une carte suivie d'un encadré */

/* Corrections 27/09 · UX-console-releves-17 (demande E-hub-param) : les cases de la grille « À relever »
   sont cliquables ; elles portent le chevron « › » des tuiles cliquables (.kpi.clickable::after, plus
   haut), même caractère, même jeton, même opacité. Le chevron se loge dans la marge droite de la case
   (le bouton déborde déjà de 6 px dans le rembourrage de la cellule),
   pour ne pas allonger la grille (3 px de texte en moins). */
.sk-matrice button.sk-cellule { position: relative; padding-right: 9px; }
.sk-matrice button.sk-cellule::after { content: "\203A"; position: absolute; top: 8px; right: -1px; font-size: 16px; font-weight: 700; line-height: 1; color: var(--blue); opacity: .55; transition: opacity .15s, transform .15s; }
.sk-matrice button.sk-cellule:hover::after, .sk-matrice button.sk-cellule:focus-visible::after { opacity: 1; transform: translateX(2px); }

/* Corrections 27/09 · UX-reseau-17 (6) (demande E-reseau) : une puce désactivée (« Mois suivant › » en
   septembre) ne ressemble plus à une puce active. Même atténuation que .fr-tour-nav .fr-btn[disabled] ;
   le survol ne l'éclaire plus, mais reste possible pour lire son title (la raison). */
.chip:disabled, .chip[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.chip:disabled:hover, .chip[aria-disabled="true"]:hover { background: var(--surface); }

/* Corrections 27/09 · UX-reseau-05 (demande E-campagnes-finance) : sous « Toutes » à 1280, le tableau des
   campagnes du Réseau demandait 1 000 px pour 980 et passait en cartes. Marges intérieures des cases
   resserrées (12 px, 18 px gardés aux deux bords de la carte) : le tableau reste un tableau et chaque puce
   de dates reste entière. Seulement quand le tableau porte des badges de plateforme (Réseau à deux
   plateformes) : le rendu Uber Eats seul (v25c) ne change pas. */
@media (min-width: 640px) {
  [data-table-campagnes]:has(.pf-badge) .tbl th, [data-table-campagnes]:has(.pf-badge) .tbl td { padding-left: 12px; padding-right: 12px; }
  [data-table-campagnes]:has(.pf-badge) .tbl th:first-child, [data-table-campagnes]:has(.pf-badge) .tbl td:first-child { padding-left: 18px; }
  [data-table-campagnes]:has(.pf-badge) .tbl th:last-child, [data-table-campagnes]:has(.pf-badge) .tbl td:last-child { padding-right: 18px; }
}

/* Vague 11 (D54) : calendrier maison de la plage personnalisée (tiroir « Période », console et Réseau).
   Jetons existants seulement ; la sélection reprend la forme de .chip.on / .pp-row.on (fond --accent, texte blanc). */
.cal-plage { margin-top: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-nav .cal-fl { flex: 0 0 auto; width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); color: var(--navy); border-radius: 9px; cursor: pointer; font-family: var(--font); font-size: 16px; line-height: 1; }
.cal-nav .cal-fl:hover:not(:disabled) { background: var(--surface-2); }
.cal-nav .cal-fl:disabled { color: var(--na); background: var(--surface-2); cursor: default; }
.cal-nav .cal-etat { flex: 1 1 auto; min-width: 0; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cal-mois-l { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cal-mois { min-width: 0; }
.cal-mois h4 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--navy); text-align: center; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; }
.cal-g .cal-sj { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 3px 0; }
.cal-j { height: 30px; min-width: 0; padding: 0; border: 0; background: transparent; border-radius: 8px; font-family: var(--font); font-size: 12.5px; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-j:hover:not(:disabled):not(.deb):not(.fin) { background: var(--surface-2); }
.cal-j:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.cal-j.dans { background: var(--accent-soft); border-radius: 0; }
.cal-j.deb, .cal-j.fin { background: var(--accent); color: #fff; font-weight: 700; }
.cal-j.deb { border-radius: 8px 0 0 8px; }
.cal-j.fin { border-radius: 0 8px 8px 0; }
.cal-j.deb.fin { border-radius: 8px; }
.cal-j:disabled { color: var(--na); cursor: default; }
@media (max-width: 560px) {
  .cal-mois-l { grid-template-columns: 1fr; }
  .cal-mois-l .cal-mois:first-child { display: none; }
}
