/* ============================================================
   La navigation dans les pages : trois formes, une par rôle (p217, 30 nov. 2026 ; avant : p167, 26 nov.).
   Pierre, 30/11 : « Le souligné fin est très bien… je veux que ce soit le menu principal… et autre chose en sous-menu, plus fin »
   (la maquette du sous-menu fin, variante B) ; « Arrondi, on garde pour les filtres ».
     1. LE MENU PRINCIPAL — la page (Siège social · Agences · Commerciaux…) : un texte souligné fin. Les onglets venus du menu
        (.h-tabs / .h-tab, includes/menu_perso.php) et toute barre de premier niveau d'une page : .so.so-menu (sousOnglets 'menu').
        13,5 px gris, l'actif en gras avec un trait de 2 px sous le mot (posé sur le filet de la barre) ; 24 px entre les entrées.
        Les compteurs : les pastilles du menu de gauche (18 px, tons r / o / v).
     2. LE SOUS-MENU — la partie d'une page (Vue d'ensemble · Cycle de vente…) : .so.so-nav (sousOnglets 'nav'). Des petites
        capitales espacées, séparées par « / », sans fond ni cadre ni trait ; l'actif en noir et en gras.
     3. LES FILTRES ET CHOIX D'AFFICHAGE (période, état, agence, groupe, « Leads pertinents / Tous ») : .so, le défaut. Arrondis :
        un conteneur gris doux de rayon 20 px, le choix actif en blanc cerclé d'un filet (jamais noir). Une rangée de filtres d'une
        liste (états avec leur nombre) : .so.so-pas, des pastilles séparées, l'active noire. Un select à côté : select.so-sel.
   Partout : pas de cadre après un clic (le contour n'apparaît qu'au clavier, :focus-visible) ; l'état actif se lit sans la
   couleur (gras et trait, capitales grasses, fond blanc cerclé).
     .so          la barre (role="tablist") ; chaque enfant direct est un sous-onglet (role="tab", aria-selected) — .so-i le dit
                  quand la barre est rendue par sousOnglets() ; so-hors : un enfant qui n'en est pas un (un bouton d'action à côté)
     .so-menu     rôle 1 ; .so-nav : rôle 2 ; sans modificateur : rôle 3
     .so-pa       la pastille de couleur d'un sous-onglet (--so-c : sa couleur ; classes de série pro, ven, ca, cam, ao)
     .so-nb       un compteur (.r rouge, .o ambre, .v vert) — les compteurs existants sont gardés
     .so-ic       une icône (ou un <i class="ti …"> direct)
     .so-bloc     variante du rôle 3 : la barre prend toute la largeur (les sous-onglets se partagent la place)
   À 400 px, chaque barre défile horizontalement DANS elle-même (jamais la page) ; le choix actif est ramené en vue.
   Le comportement (clavier : flèches, Début, Fin, Entrée ; aria-selected ; défilement) : assets/js/onglets.js.
   Rendu PHP : sousOnglets($items, $actif, $o) — includes/onglets.php. Préfixe so- : aucun autre nom de l'application ne le porte.
   ============================================================ */

/* ---- partout : le contour seulement au clavier (plus de cadre noir après un clic) ---- */
button:focus:not(:focus-visible),a:focus:not(:focus-visible),summary:focus:not(:focus-visible),[role=tab]:focus:not(:focus-visible),[tabindex]:focus:not(:focus-visible){outline:none}

/* ============ 3. le défaut : les filtres et choix d'affichage, arrondis ============ */
.so{display:flex;flex-wrap:nowrap;align-items:stretch;gap:0;box-sizing:border-box;width:max-content;max-width:100%;min-width:0;
  margin:0;padding:2px;list-style:none;background:#F7F6F4;border:1px solid #E5E2DE;border-radius:20px;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scroll-padding:0 24px;vertical-align:middle}
.so::-webkit-scrollbar{display:none}
.so.so-bloc{width:100%}
.so.so-bloc>:not(.so-hors){flex:1 0 auto;justify-content:center}
/* un indice discret quand la barre déborde : le bord qui cache des sous-onglets s'estompe */
.so[data-so-deb~=d]{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
.so[data-so-deb~=g]{-webkit-mask-image:linear-gradient(90deg,transparent,#000 28px);mask-image:linear-gradient(90deg,transparent,#000 28px)}
.so[data-so-deb~=g][data-so-deb~=d]{-webkit-mask-image:linear-gradient(90deg,transparent,#000 28px,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,transparent,#000 28px,#000 calc(100% - 28px),transparent)}
.so>:not(.so-hors){flex:0 0 auto;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:flex-start;gap:6px;margin:0;
  border:0;border-radius:18px;background:none;box-shadow:none;font-family:inherit;font-size:12.5px;font-weight:400;line-height:1.4;letter-spacing:0;text-transform:none;
  padding:4px 11px;min-height:0;height:auto;width:auto;color:#6B6864;white-space:nowrap;text-decoration:none;cursor:pointer;
  -webkit-user-select:none;user-select:none;transition:none}
.so>:not(.so-hors):hover{color:#1A1917;background:none}
.so>:not(.so-hors)[aria-selected=true],.so>:not(.so-hors)[aria-pressed=true],.so>:not(.so-hors)[aria-current=page],.so>:not(.so-hors)[aria-current=true],
.so>:not(.so-hors):is(.on,.actif,.active,.act,.sel,.cur,.courant,.is-active,.selected),.so>:not(.so-hors):has(>input[type=radio]:checked){background:#fff;color:#1A1917;box-shadow:0 0 0 1px #E5E2DE;font-weight:600}
.so>:not(.so-hors):focus{outline:none}
.so>:not(.so-hors):focus-visible{outline:2px solid #1A1917;outline-offset:-2px}
.so>[disabled],.so>[aria-disabled=true]{opacity:.45;cursor:default}
.so>*>input[type=radio]{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
/* un bouton d'action posé dans la barre, qui n'est pas un sous-onglet */
.so>.so-hors{flex:0 0 auto;margin-left:6px}
/* la pastille de couleur (celle des séries : Prospection, Vente, CA signé, CA mensuel moyen, Appels d'offres) */
.so-pa{display:inline-block;width:10px;height:10px;border-radius:2px;flex-shrink:0;background:var(--so-c,var(--gr-serie,#2F5FB3))}
.so-pa.pro{background:var(--gr-pro,#2A78D6)}.so-pa.ven{background:var(--gr-ven,#D55181)}.so-pa.ca{background:var(--gr-ca,#5B3A99)}.so-pa.cam{background:var(--gr-cam,#94551F)}.so-pa.ao{background:var(--gr-ao,#C98500)}
/* le compteur : gris par défaut ; rouge, ambre, vert selon le sens (les mêmes tons que les pastilles du menu) */
.so .so-nb,.so>*>.nb{display:inline-block;min-width:16px;padding:0 5px;border-radius:8px;font-size:10px;font-weight:600;line-height:16px;text-align:center;
  font-variant-numeric:tabular-nums;background:#EDEBE8;color:#4A4844}
.so .so-nb.r,.so>*>.nb.r,.so>*>.nb-r{background:#FCEBEA;color:#A8322B}
.so .so-nb.o,.so>*>.nb.o,.so>*>.nb-o{background:#FBF0DC;color:#8A5A00}
.so .so-nb.v,.so>*>.nb.v,.so>*>.nb-v{background:#E6F4EC;color:#1E7A45}
/* l'icône */
.so>*>i,.so .so-ic{font-size:14px;line-height:1;flex-shrink:0}
.so>*>svg{width:14px;height:14px;flex-shrink:0}

/* 3 bis. une rangée de FILTRES d'une liste (Tous · En cours 16 · En retard 3…) : des pastilles séparées, l'active noire, le nombre
   après le mot en graisse 600 ; elle passe à la ligne sur ordinateur et défile dans sa largeur sur téléphone. .so.so-pas */
.so.so-pas{flex-wrap:wrap;gap:6px;width:auto;padding:0;background:none;border:0;border-radius:0;overflow:visible}
.so.so-pas>:not(.so-hors){gap:6px;padding:5px 13px;border:1px solid #E5E2DE;border-radius:20px;background:#fff;color:#3D3B37;font-size:12.5px;line-height:1.35;box-shadow:none}
.so.so-pas>:not(.so-hors):hover{border-color:#CFCBC5;color:#1A1917;background:#fff}
.so.so-pas>:not(.so-hors)[aria-selected=true],.so.so-pas>:not(.so-hors)[aria-pressed=true],.so.so-pas>:not(.so-hors)[aria-current=page],.so.so-pas>:not(.so-hors)[aria-current=true],
.so.so-pas>:not(.so-hors):is(.on,.actif,.active,.act,.sel,.cur,.courant,.is-active,.selected){background:#1A1917;border-color:#1A1917;color:#fff;font-weight:600;box-shadow:none}
.so.so-pas>*>b,.so.so-pas .so-nb,.so.so-pas>*>.nb,.so.so-pas>*>.n{display:inline;min-width:0;margin:0;padding:0;border-radius:0;background:none;font-size:inherit;font-weight:600;line-height:inherit;color:inherit;opacity:.75}
.so.so-pas>*>b:empty,.so.so-pas>*>.n:empty{display:none}
.so.so-pas>:not(.so-hors):focus-visible{outline:2px solid #1A1917;outline-offset:1px}
/* un sélecteur posé avec les filtres (Appels, Emails, tri) : arrondi, comme eux. select.so-sel */
select.so-sel{-webkit-appearance:none;appearance:none;box-sizing:border-box;max-width:100%;margin:0;font-family:inherit;font-size:12.5px;font-weight:400;line-height:1.35;color:#3D3B37;cursor:pointer;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%236B6864' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  border:1px solid #E5E2DE;border-radius:20px;padding:5px 28px 5px 13px;height:auto}
select.so-sel:hover{border-color:#CFCBC5}
select.so-sel:focus{outline:none}select.so-sel:focus-visible{outline:2px solid #1A1917;outline-offset:1px}

/* ============ 1. le menu principal : souligné fin ============ */
.h-tabs,.so.so-menu{display:flex;flex-wrap:nowrap;align-items:stretch;gap:24px;box-sizing:border-box;width:auto;max-width:100%;min-width:0;padding:0;
  background:none;border:0;border-radius:0;box-shadow:inset 0 -1px 0 #E5E2DE;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.h-tabs{margin:0 0 16px}
.h-tabs::-webkit-scrollbar{display:none}
.h-tab,.so.so-menu>:not(.so-hors){flex:0 0 auto;box-sizing:border-box;display:inline-flex;align-items:center;gap:7px;margin:0;padding:10px 0 9px;
  border:0;border-bottom:2px solid transparent;border-radius:0;background:none;box-shadow:none;font-family:inherit;font-size:13.5px;font-weight:400;line-height:1.35;
  letter-spacing:0;text-transform:none;color:#6B6864;white-space:nowrap;text-decoration:none;cursor:pointer;min-height:0;height:auto;width:auto}
.h-tab:hover,.so.so-menu>:not(.so-hors):hover{color:#1A1917;background:none}
.h-tab.on,.so.so-menu>:not(.so-hors)[aria-selected=true],.so.so-menu>:not(.so-hors)[aria-pressed=true],.so.so-menu>:not(.so-hors)[aria-current=page],.so.so-menu>:not(.so-hors)[aria-current=true],
.so.so-menu>:not(.so-hors):is(.on,.actif,.active,.act,.sel,.cur,.courant,.is-active,.selected){color:#1A1917;font-weight:600;border-bottom-color:#1A1917;background:none;box-shadow:none}
.h-tab:focus,.so.so-menu>:not(.so-hors):focus{outline:none}
.h-tab:focus-visible,.so.so-menu>:not(.so-hors):focus-visible{outline:2px solid #1A1917;outline-offset:-2px;border-radius:3px}
.h-tabs[hidden],.h-tab[hidden]{display:none}
.h-tab .nb,.so.so-menu .so-nb,.so.so-menu>*>.nb{display:inline-block;box-sizing:border-box;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#F0EEEA;color:#6B6864;
  font-size:10.5px;font-weight:600;line-height:18px;text-align:center;font-variant-numeric:tabular-nums;letter-spacing:0}
.h-tab .nb-r,.so.so-menu .so-nb.r,.so.so-menu>*>.nb.r,.so.so-menu>*>.nb-r{background:#FBE9E8;color:#B4322F}
.h-tab .nb-o,.so.so-menu .so-nb.o,.so.so-menu>*>.nb.o,.so.so-menu>*>.nb-o{background:#FAEEDA;color:#8A5A00}
.h-tab .nb-v,.so.so-menu .so-nb.v,.so.so-menu>*>.nb.v,.so.so-menu>*>.nb-v{background:#E1F5EE;color:#085041;font-weight:500}
.h-tab .nb+.nb{margin-left:-3px}
.so.so-menu>*>i,.so.so-menu .so-ic{font-size:15px}
.so.so-menu[data-so-deb]{-webkit-mask-image:none;mask-image:none}

/* ============ 2. le sous-menu : petites capitales (variante B) ============ */
.so.so-nav{display:flex;align-items:baseline;gap:0;width:auto;padding:0;background:none;border:0;border-radius:0;box-shadow:none}
.h-tabs+.so.so-nav,.so.so-menu+.so.so-nav{margin-top:12px}
.so.so-nav>:not(.so-hors){gap:5px;padding:3px 0;border:0;border-radius:0;background:none;box-shadow:none;font-size:10.5px;font-weight:500;line-height:1.5;
  letter-spacing:.09em;text-transform:uppercase;color:#8A8781}
.so.so-nav>:not(.so-hors):hover{color:#1A1917;background:none}
.so.so-nav>:not(.so-hors)[aria-selected=true],.so.so-nav>:not(.so-hors)[aria-pressed=true],.so.so-nav>:not(.so-hors)[aria-current=page],.so.so-nav>:not(.so-hors)[aria-current=true],
.so.so-nav>:not(.so-hors):is(.on,.actif,.active,.act,.sel,.cur,.courant,.is-active,.selected),.so.so-nav>:not(.so-hors):has(>input[type=radio]:checked){color:#1A1917;font-weight:700;background:none;box-shadow:none}
/* « / » entre deux entrées visibles : sur chaque entrée qui en a une visible avant elle (les balises ne changent pas) */
.so.so-nav>:not(.so-hors):not([hidden])~:not(.so-hors):not([hidden])::before{content:"/";display:inline-block;margin:0 4px 0 9px;color:#D3CFC9;font-weight:400;letter-spacing:0}
.so.so-nav>:not(.so-hors):focus-visible{outline:2px solid #1A1917;outline-offset:1px;border-radius:2px}
/* les compteurs : un petit nombre après le mot, le ton en couleur de texte (sans fond) */
.so.so-nav .so-nb,.so.so-nav>*>.nb,.so.so-nav>*>.n,.so.so-nav>*>b{display:inline;min-width:0;padding:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;
  font-size:10.5px;font-weight:600;line-height:inherit;letter-spacing:.02em;font-family:inherit;color:#6B6864}
.so.so-nav .so-nb.r,.so.so-nav>*>.nb.r,.so.so-nav>*>.nb-r{color:#B4322F;background:none}
.so.so-nav .so-nb.o,.so.so-nav>*>.nb.o,.so.so-nav>*>.nb-o{color:#8A5A00;background:none}
.so.so-nav .so-nb.v,.so.so-nav>*>.nb.v,.so.so-nav>*>.nb-v{color:#085041;background:none}
.so.so-nav>*>i,.so.so-nav .so-ic{font-size:12px}
.so.so-nav>*>svg{width:12px;height:12px}
.so.so-nav .so-pa{width:7px;height:7px;align-self:center}

/* sur téléphone : des cibles un peu plus hautes, la barre défile en elle-même */
@media (max-width:760px){
  .so>:not(.so-hors){padding:6px 11px}
  .so.so-nav>:not(.so-hors){padding:6px 0}
  .h-tab,.so.so-menu>:not(.so-hors){padding:10px 0 9px}
  .h-tabs,.so.so-menu{gap:20px}
  .so.so-pas{flex-wrap:nowrap;overflow-x:auto}
  .so.so-pas>:not(.so-hors){padding:6px 13px}
}
@media print{.so{display:none}}
