/* gp-menu-m19.css — M19-a « menu principal » (maquette MAQUETTE_menu_principal v2, mesures ± 2 px ; hauteurs en content-box comme la
   maquette : en-tête 56 + 1, pied 52 + 1). Jetons M1 (cit-ds.css), clair et sombre. Limité à .sidebar.m19 (posé par js/gp-menu-m19.js).
   Retour arrière : retirer ce fichier et js/gp-menu-m19.js d'app.html.
   03/10 (Omar : « le menu ne se replie toujours pas ») : règles valables dans TOUS les habillages (html:root, même spécificité que l'ancien
   html[data-skin="ios"]) — en habillage « classique » le repli ne s'appliquait pas.
   03/10 16:15 (menu5, Omar) : ≥ 1200 px le menu est toujours en pleine largeur et ce sont les SECTIONS qui se replient (voir « menu5 » plus bas). */
:root, .cit-theme-clair { --m19-ligne: #dcdce1; --m19-sep: #ececf0; --m19-actif: #e1ecfb; --m19-avatar: #1c3f7a; --m19-barre: #c7c7cc; }
:root[data-theme="dark"], .cit-theme-sombre { --m19-ligne: #3a3a3c; --m19-sep: #2c2c2e; --m19-actif: #16304f; --m19-avatar: #2c5aa0; --m19-barre: #48484a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --m19-ligne: #3a3a3c; --m19-sep: #2c2c2e; --m19-actif: #16304f; --m19-avatar: #2c5aa0; --m19-barre: #48484a; } }

/* ── le menu : 256 px épinglé, rail de 60 px sinon (écran de bureau) ── */
html:root .sidebar.m19 { background: var(--cit-surface); border-right: 1px solid var(--m19-ligne); color: var(--cit-text); padding: 0; box-shadow: none;
  display: flex; flex-direction: column; font-size: 13px; position: relative; transition: none; }
@media (min-width: 769px) {
  html:root .sidebar.m19.m19-epingle { width: 256px; box-sizing: content-box; overflow: hidden; }
  html:root .sidebar.m19.m19-replie { width: 60px; box-sizing: content-box; overflow: visible; }
  html:root .sidebar.m19.m19-epingle .m19-rail { display: none; }
  html:root .sidebar.m19.m19-replie .m19-panneau { display: none; position: absolute; left: 0; top: 0; bottom: 0; z-index: 1200; border-right: 1px solid var(--m19-ligne);
    box-shadow: 10px 0 34px rgba(0, 0, 0, 0.18); }
  html:root .sidebar.m19.m19-replie.m19-ouvert .m19-panneau { display: flex; animation: m19-entree .15s ease-out; }
}
@media (max-width: 768px) { html:root .sidebar.m19 { display: none; } }   /* 28/09 : petit écran = pas de menu latéral (barre du bas d'app.css), comme avant M19 — sinon le menu prenait toute la hauteur et poussait la page hors de l'écran */
@keyframes m19-entree { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
html:root .sidebar.m19 .m19-reserve { display: none !important; }

/* ── rail : logo + une icône par groupe (Q3) ── */
.sidebar.m19 .m19-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sidebar.m19 .m19-rail-logo { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--cit-accent); color: #ffffff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.sidebar.m19 .m19-rail-btn { width: 40px; height: 34px; flex-shrink: 0; border: 0; border-radius: 8px; background: transparent; color: var(--cit-text2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sidebar.m19 .m19-rail-btn[hidden] { display: none; }
.sidebar.m19 .m19-rail-btn:hover { background: var(--cit-fill); color: var(--cit-text); }
.sidebar.m19 .m19-rail-btn.is-actif { background: var(--m19-actif); color: var(--cit-accent-text); }
.sidebar.m19 .m19-rail-btn svg { width: 18px; height: 18px; }

/* ── menu complet ── */
.sidebar.m19 .m19-panneau { width: 256px; box-sizing: border-box; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--cit-surface); }
html:root .sidebar.m19 .sidebar-logo { height: 56px; box-sizing: content-box; flex-shrink: 0; display: flex; flex-direction: row; align-items: center; gap: 10px;
  padding: 0 14px; margin: 0; border-bottom: 1px solid var(--m19-sep); }
html:root .sidebar.m19 .sidebar-logo .logo-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--cit-accent); color: #ffffff;
  font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; box-shadow: none; }
html:root .sidebar.m19 .sidebar-logo > div:not(.logo-icon) { flex-grow: 1; min-width: 0; display: block; }
html:root .sidebar.m19 .sidebar-logo .logo-text { font-weight: 700; font-size: 14px; color: var(--cit-text); line-height: 18px; }
html:root .sidebar.m19 .sidebar-logo .logo-sub { font-size: 11px; color: var(--cit-text2); line-height: 14px; }
html:root .sidebar.m19 .sidebar-toggle { width: 28px; height: 28px; flex-shrink: 0; border-radius: 7px; border: 0; background: var(--cit-fill); color: var(--cit-text2);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; margin: 0; cursor: pointer; }
html:root .sidebar.m19 .sidebar-toggle[aria-pressed="true"] { color: var(--cit-accent-text); }

/* liste : défile seule, barre visible (SPEC) ; marges de la maquette 4 / 14 / 8 / 8 */
/* barre de 5 px dans la marge de droite (14 = 9 + 5) : entrées de 234 px comme la maquette ; pas de « scrollbar-width » (sinon Chrome
   ignore la barre fine et prend 15 px) */
.sidebar.m19 .m19-liste { flex: 1 1 auto; min-height: 0; overflow-y: scroll; padding: 4px 9px 8px 8px; }
.sidebar.m19 .m19-liste::-webkit-scrollbar { width: 5px; }
.sidebar.m19 .m19-liste::-webkit-scrollbar-track { background: transparent; }
.sidebar.m19 .m19-liste::-webkit-scrollbar-thumb { background: var(--m19-barre); border-radius: 3px; }
html:root .sidebar.m19 .m19-groupe { padding: 0; margin: 0; }
html:root .sidebar.m19 .m19-groupe.m19-vide { display: none !important; }
html:root .sidebar.m19 .nav-item.m19-sans-droit { display: none !important; }   /* droits : entrée venue d'une section cachée pour ce rôle (gp-menu-m19.js, droits()) */
html:root .sidebar.m19 .nav-item[data-m19] > .nav-label { display: none !important; }   /* ancien libellé (<span class="nav-label">) : remplacé par .m19-nom, gardé dans la page */
html:root .sidebar.m19 .nav-section > .nav-label.m19-titre { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 3px; margin: 0;
  font: 600 11px/14px var(--ios-font, system-ui); letter-spacing: 0.4px; text-transform: uppercase; color: var(--cit-text2); cursor: default; background: none; }
html:root .sidebar.m19 .nav-section > .nav-label.m19-titre::before, html:root .sidebar.m19 .nav-section > .nav-label.m19-titre::after { display: none; content: none; }
/* ── menu5 (03/10 16:15, Omar) : sections repliables en pleine largeur (≥ 1200 px, classe m19-sections posée par le JS) ──
   titre = ligne de 30 px (icône du groupe, nom, compteur cumulé, chevron) ; corps replié = display none ; dépliement 150 ms (JS) + fondu */
/* recette [POSTE] 11:40 (PX_Menu_Sections) : titre de section 34 px, 12 px / 700, gris #5b6475 */
html:root .sidebar.m19 .m19-sec > .nav-label.m19-titre { gap: 8px; justify-content: flex-start; padding: 0 8px; height: 34px; margin-top: 4px; border-radius: 7px; cursor: default;
  font: 700 12px/16px var(--ios-font, system-ui); color: #5b6475; }
html:root[data-theme="dark"] .sidebar.m19 .m19-sec > .nav-label.m19-titre { color: #a7aebb; }
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-ico { width: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--cit-text2); }
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-ico svg { width: 15px; height: 15px; }
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-nom { flex-grow: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* M76 (04/10, PX_Menu_Sections) : compteur cumulé BLEU (#0a66d6), ROUGE (#d93025) à partir de « 99+ » ; pastille 18 px, coins 9, 11 px gras */
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-cpt { min-width: 22px; height: 18px; padding: 0 6px; border-radius: 9px; background: #0a66d6; color: #ffffff; font-size: 11px; font-weight: 700;
  line-height: 18px; letter-spacing: 0; text-transform: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-cpt.is-rouge { background: #d93025; }
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-cpt[hidden] { display: none !important; }
/* M76 : section survolée = carte légèrement surélevée (fond de surface, ombre 0 6px 18px, coins 9) */
html:root .sidebar.m19.m19-sections .m19-sec.is-survol { background: var(--cit-surface); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14); border-radius: 9px; margin: 2px -2px; padding: 0 2px; }
html:root[data-theme="dark"] .sidebar.m19.m19-sections .m19-sec.is-survol { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-chev { display: none; width: 14px; flex-shrink: 0; color: var(--cit-text3); }
html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-chev svg { display: block; transition: transform .15s ease-out; }
html:root .sidebar.m19.m19-sections .m19-sec > .m19-titre { cursor: pointer; }
html:root .sidebar.m19.m19-sections .m19-sec > .m19-titre:hover { background: var(--cit-fill); color: var(--cit-text); }
html:root .sidebar.m19.m19-sections .m19-sec > .m19-titre:focus-visible { outline: 2px solid var(--cit-accent); outline-offset: -2px; }
html:root .sidebar.m19.m19-sections .m19-sec > .m19-titre .m19-sec-chev { display: inline-flex; }
html:root .sidebar.m19.m19-sections .m19-sec.is-ouvert > .m19-titre .m19-sec-chev svg { transform: rotate(90deg); }
html:root .sidebar.m19.m19-sections .m19-sec.is-actif > .m19-titre { color: var(--cit-accent-text); }
html:root .sidebar.m19.m19-sections .m19-sec.is-actif > .m19-titre .m19-sec-ico { color: var(--cit-accent-text); }
html:root .sidebar.m19.m19-sections .m19-sec:not(.is-ouvert) > .m19-sec-corps { display: none; }
html:root .sidebar.m19.m19-sections .m19-sec.is-ouvert > .m19-sec-corps { animation: m19-deplie .15s ease-out; }
html:root .sidebar.m19 .m19-sec-corps { padding-left: 0; }
@keyframes m19-deplie { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html:root .sidebar.m19.m19-sections .m19-sec.is-ouvert > .m19-sec-corps, html:root .sidebar.m19 .m19-sec > .m19-titre .m19-sec-chev svg { animation: none; transition: none; } }
html:root .sidebar.m19 .sidebar-toggle[hidden] { display: none !important; }   /* bouton d'épingle : seulement en fenêtre étroite (JS) */
html:root .sidebar.m19 .nav-item { display: flex; align-items: center; gap: 8px; height: 25px; min-height: 0 !important; width: auto !important; padding: 0 8px !important; margin: 0 !important;
  border-radius: 7px; font: 400 13px/25px var(--ios-font, system-ui) !important; color: var(--cit-text); background: transparent; box-shadow: none; cursor: pointer; text-decoration: none; }
html:root .sidebar.m19 .nav-item:hover { background: var(--cit-fill); color: var(--cit-text); }
html:root .sidebar.m19 .nav-item.active { background: var(--m19-actif); color: var(--cit-accent-text); font-weight: 600 !important; }
html:root .sidebar.m19 .nav-item.active::before { display: none; }
html:root .sidebar.m19 .nav-item .m19-ico { width: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--cit-text2); }
html:root .sidebar.m19 .nav-item.active .m19-ico { color: var(--cit-accent-text); }
html:root .sidebar.m19 .nav-item .m19-ico svg { width: 16px; height: 16px; color: inherit; opacity: 1; }
html:root .sidebar.m19 .nav-item .m19-nom { flex-grow: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* compteurs (maquette : rouges, bleus sur l'entrée active) */
html:root .sidebar.m19 #nav-aaffecter-count, html:root .sidebar.m19 .m19-compteur { min-width: 18px; height: 16px; padding: 0 5px !important; border-radius: 8px !important;
  background: #d70015 !important; color: #ffffff !important; font-size: 10px !important; font-weight: 700 !important; line-height: 16px !important; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; }
html:root .sidebar.m19 #nav-aaffecter-count[style*="display:none"], html:root .sidebar.m19 #nav-aaffecter-count[style*="display: none"] { display: none !important; }
html:root .sidebar.m19 .nav-item.active #nav-aaffecter-count, html:root .sidebar.m19 .nav-item.active .m19-compteur { background: var(--cit-accent) !important; }
/* M76 (04/10, PX_Menu_Sections) — en pleine largeur avec sections : entrées SANS icône, lignes de 30 px, texte 13,5 px décalé de 33 px sous l'icône du titre ;
   compteur d'entrée = nombre bleu en texte (11 px gras), pas de pastille ; entrée active = fond bleu pâle, texte bleu, 600 */
html:root .sidebar.m19.m19-sections .m19-sec .nav-item[data-m19] { height: 30px; padding: 0 10px 0 33px !important; gap: 9px; font: 400 13.5px/30px var(--ios-font, system-ui) !important; }
html:root .sidebar.m19.m19-sections .m19-sec .nav-item[data-m19] .m19-ico { display: none; }
html:root .sidebar.m19.m19-sections .m19-sec .nav-item[data-m19] .m19-compteur, html:root .sidebar.m19.m19-sections .m19-sec .nav-item[data-m19] #nav-aaffecter-count {
  min-width: 0; height: auto; padding: 0 !important; border-radius: 0 !important; background: transparent !important; color: var(--cit-accent-text) !important; font-size: 11px !important; line-height: 30px !important; margin-left: auto; }
html:root .sidebar.m19.m19-sections .m19-sec .nav-item[data-m19].active { background: #dbe8fb; color: #0a58c2; font-weight: 600 !important; }   /* recette [POSTE] : graisse 600 */
html:root[data-theme="dark"] .sidebar.m19.m19-sections .m19-sec .nav-item[data-m19].active { background: var(--m19-actif); color: var(--cit-accent-text); }
/* contre-recette [BUREAU] 14:25 (PX_Menu_Sections) : « Ce matin », entrée hors section = lien de 34 px, 13,5 px, marge 0 10 px, écart 9, icône 16 */
html:root .sidebar.m19.m19-sections .m19-groupe[data-groupe="Accueil"] > .nav-item[data-m19] { height: 34px; padding: 0 10px !important; gap: 9px; font: 400 13.5px/34px var(--ios-font, system-ui) !important; }
html:root .sidebar.m19.m19-sections .m19-groupe[data-groupe="Accueil"] > .nav-item[data-m19].active { font-weight: 600 !important; }

/* pied : avatar, nom, rôle, « ⋯ » */
html:root .sidebar.m19 .m19-pied { height: 52px; box-sizing: content-box; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-top: 1px solid var(--m19-sep); }
html:root .sidebar.m19 .m19-pied .sidebar-user { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 0; margin: 0;
  border: 0; background: transparent; }
html:root .sidebar.m19 .m19-pied .sidebar-avatar, html:root .sidebar.m19 .m19-pied .user-avatar { width: 30px; height: 30px; flex-shrink: 0; border-radius: 15px;
  background: var(--m19-avatar); color: #ffffff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
html:root .sidebar.m19 .m19-pied .sidebar-user > div:not(.sidebar-avatar):not(.user-avatar) { display: block; min-width: 0; }
html:root .sidebar.m19 .m19-pied .sidebar-user-name { font-weight: 600; font-size: 13px; color: var(--cit-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:root .sidebar.m19 .m19-pied .sidebar-user-role { font-size: 11px; color: var(--cit-text2); }
.sidebar.m19 .m19-points { width: 28px; height: 28px; flex-shrink: 0; border: 0; border-radius: 7px; background: transparent; color: var(--cit-text3); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sidebar.m19 .m19-points:hover { background: var(--cit-fill); color: var(--cit-text); }
.m19-pop { position: fixed; z-index: 6000; min-width: 220px; background: var(--cit-surface); color: var(--cit-text); border: 1px solid var(--cit-border); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); padding: 6px; font-size: 13px; }
.m19-pop button { display: flex; align-items: center; width: 100%; min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.m19-pop button:hover { background: var(--cit-fill); }
.m19-pop button.is-danger { color: var(--cit-danger-text); }
