/* GestLoc coque commune V0 (G63) : menu supérieur, logo (option A), navigation mobile, pied de page, modes de largeur.
   Activation EXPLICITE sur le banc (cookie g63_shell=on ou ?shell=G63). Tout est sous `.gl-ds` ; seules exceptions : les classes d'activation `html.gl-shell-booting` et `body.gl-shell`, posées par gl-shell.js. */

/* — activation : la coque d'origine reste dans le DOM (ses éléments sont déplacés ou masqués), jamais supprimée — */
html.gl-shell-booting nav.navbar, html.gl-shell-booting .mobile-topbar { visibility: hidden; }
body.gl-shell .gl-orig-hidden { display: none !important; }   /* éléments d'origine (menu, barre mobile, pied de page) : masqués, jamais supprimés */
body.gl-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.gl-shell > .main-container { flex: 1 0 auto; width: 100%; }
body.gl-shell[data-gl-width="reg"] > .main-container { max-width: min(calc(100vw - 48px), 1480px); }
body.gl-shell[data-gl-width="form"] > .main-container { max-width: 920px; }
body.gl-shell[data-gl-width="dash"] > .main-container { max-width: 1320px; }
body.gl-shell[data-gl-width="admin"] > .main-container { max-width: 1240px; }
body.gl-shell[data-gl-width="saas"] > .main-container { max-width: 1320px; }
body.gl-shell.modal-open .gl-bottombar { display: none !important; }

/* — barre de navigation — */
.gl-ds.gl-nav { position: sticky; top: 0; z-index: 1030; background: var(--gl-surface); border-bottom: 1px solid var(--gl-line); box-shadow: var(--gl-shadow-1); }
.gl-ds .gl-nav__in { display: flex; align-items: center; gap: var(--gl-s4); height: var(--gl-nav-h); padding: 0 24px; max-width: 1560px; margin: 0 auto; }
.gl-ds .gl-brand { display: flex; align-items: center; flex: none; text-decoration: none; height: var(--gl-nav-h); padding: 0; }
.gl-ds .gl-brand img { display: block; transition: none; transform: none; }
.gl-ds .gl-brand .gl-logo-full { height: 36px; width: auto; max-width: none; } .gl-ds .gl-brand .gl-logo-compact { height: 30px; width: auto; max-width: none; display: none; }
.gl-ds .gl-brand:focus-visible { outline-offset: -2px; border-radius: var(--gl-r2); }
.gl-ds .gl-menu { display: flex; align-items: stretch; gap: 2px; list-style: none; margin: 0; padding: 0; height: var(--gl-nav-h); flex: 1 1 auto; min-width: 0; }
.gl-ds .gl-menu > li { position: relative; display: flex; }
.gl-ds .gl-menu__b { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 0; border-top: 3px solid transparent; border-bottom: 3px solid transparent; background: transparent; color: var(--gl-text); font: 600 var(--gl-fs-14)/1 var(--gl-font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.gl-ds .gl-menu__b:hover { background: var(--gl-surface-2); color: var(--gl-ink); } .gl-ds .gl-menu__b.is-active, .gl-ds .gl-menu__b[aria-current="page"] { color: var(--gl-nuit); border-bottom-color: var(--gl-nuit); background: var(--gl-nuit-50); }
.gl-ds .gl-menu__b .gl-caret { width: 14px; height: 14px; transition: transform .15s; } .gl-ds .gl-menu__b[aria-expanded="true"] .gl-caret { transform: rotate(180deg); }
.gl-ds .gl-menu__b i, .gl-ds .gl-menu__b .fas { width: 18px; text-align: center; font-size: 15px; }
.gl-ds .gl-drop { position: absolute; left: 0; top: 100%; min-width: 280px; max-width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - var(--gl-nav-h) - 16px); max-height: calc(100dvh - var(--gl-nav-h) - 16px); overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid var(--gl-line-strong); border-radius: 0 0 var(--gl-r3) var(--gl-r3); box-shadow: var(--gl-shadow-2); padding: 8px; display: none; z-index: 1040; list-style: none; margin: 0; }
.gl-ds .gl-menu > li.is-open > .gl-drop { display: block; }
.gl-ds .gl-drop--cols.is-long { min-width: 560px; column-count: 2; column-gap: 12px; } .gl-ds .gl-drop--cols.is-long > li, .gl-ds .gl-drop--cols.is-long > .gl-drop__t { break-inside: avoid; }
.gl-ds .gl-drop > li { list-style: none; } .gl-ds .gl-drop hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--gl-line); opacity: 1; }
.gl-ds .gl-drop__t { display: block; list-style: none; padding: 8px 10px 2px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gl-muted); font-weight: 700; }
.gl-ds .gl-drop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--gl-r2); color: var(--gl-text); text-decoration: none; font-size: var(--gl-fs-14); font-weight: 500; background: transparent; white-space: normal; }
.gl-ds .gl-drop a:hover, .gl-ds .gl-drop a:focus-visible { background: var(--gl-nuit-50); color: var(--gl-nuit); } .gl-ds .gl-drop a[aria-current="page"] { background: var(--gl-nuit-50); color: var(--gl-nuit); font-weight: 700; }
.gl-ds .gl-drop a i, .gl-ds .gl-drop a .fas { width: 18px; text-align: center; color: var(--gl-muted); font-size: 14px; flex: none; } .gl-ds .gl-drop a:hover i, .gl-ds .gl-drop a[aria-current="page"] i { color: var(--gl-nuit); }
.gl-ds .gl-drop .badge { margin-left: auto; }
.gl-ds .gl-tools { display: flex; align-items: center; gap: var(--gl-s2); margin-left: auto; list-style: none; padding: 0; margin-bottom: 0; flex: none; }
.gl-ds .gl-tools > li { list-style: none; }
.gl-ds .gl-tools .nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: var(--gl-r2); color: var(--gl-text); font-weight: 600; font-size: var(--gl-fs-13); } .gl-ds .gl-tools .nav-link:hover { background: var(--gl-surface-2); }
.gl-ds .gl-tools .btn { min-height: 36px; font-weight: 600; font-size: var(--gl-fs-13); border-radius: var(--gl-r2); }
.gl-ds .gl-tools .dropdown-menu { border: 1px solid var(--gl-line-strong); border-radius: var(--gl-r3); box-shadow: var(--gl-shadow-2); padding: 8px; max-width: calc(100vw - 16px); max-height: calc(100dvh - var(--gl-nav-h) - 16px); overflow-y: auto; }
.gl-ds .gl-tools .dropdown-item { border-radius: var(--gl-r2); padding: 9px 10px; font-size: var(--gl-fs-14); font-weight: 500; }
.gl-ds .gl-tools img.navbar-user-avatar { width: 30px !important; height: 30px !important; border-radius: 50%; }
.gl-ds .gl-ibtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: var(--gl-r2); background: transparent; color: var(--gl-text); cursor: pointer; } .gl-ds .gl-ibtn:hover { background: var(--gl-surface-2); }
.gl-ds .gl-quick { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--gl-nuit); border-radius: var(--gl-r2); background: var(--gl-nuit); color: #fff; font: 600 var(--gl-fs-13)/1 var(--gl-font); cursor: pointer; text-decoration: none; white-space: nowrap; } .gl-ds .gl-quick:hover { background: var(--gl-nuit-900); border-color: var(--gl-nuit-900); } .gl-ds .gl-quick[disabled] { background: var(--gl-surface-2); border-color: var(--gl-line); color: #64748B; cursor: not-allowed; }
.gl-ds .gl-burger { display: none; }

/* — tiroir mobile — */
.gl-ds.gl-scrim { position: fixed; inset: 0; z-index: 1190; background: rgba(8,17,32,.55); display: none; } .gl-ds.gl-scrim.is-open { display: block; }
.gl-ds.gl-offc { position: fixed; inset: 0 0 0 auto; width: min(340px, 88vw); background: #fff; z-index: 1200; box-shadow: var(--gl-shadow-modal); transform: translateX(100%); transition: transform .2s; display: flex; flex-direction: column; visibility: hidden; }
.gl-ds.gl-offc.is-open { transform: none; visibility: visible; }
.gl-ds .gl-offc__h { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--gl-line); } .gl-ds .gl-offc__b { overflow: auto; padding: 8px; flex: 1; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.gl-ds.gl-offc details { border-bottom: 1px solid var(--gl-line); } .gl-ds.gl-offc summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; font-weight: 700; color: var(--gl-ink); cursor: pointer; list-style: none; } .gl-ds.gl-offc summary::-webkit-details-marker { display: none; }
.gl-ds.gl-offc details a, .gl-ds.gl-offc .gl-offc__link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 40px; color: var(--gl-text); text-decoration: none; } .gl-ds.gl-offc .gl-offc__link { padding-left: 12px; font-weight: 700; color: var(--gl-ink); min-height: 48px; border-bottom: 1px solid var(--gl-line); }
.gl-ds.gl-offc a[aria-current="page"] { background: var(--gl-nuit-50); color: var(--gl-nuit); font-weight: 700; } .gl-ds.gl-offc hr { margin: 4px 12px; border: 0; border-top: 1px solid var(--gl-line); }
.gl-ds.gl-offc .gl-drop__t { padding: 8px 12px 2px 40px; }

/* — barre d'onglets basse (mobile, seulement si ≥ 2 destinations autorisées) — */
.gl-ds.gl-bottombar { display: none; }

/* — pied de page — */
.gl-ds.gl-foot { flex: none; background: var(--gl-nuit); color: rgba(255,255,255,.92); border-top: 3px solid var(--gl-vert); font-size: var(--gl-fs-13); margin-top: var(--gl-s4); }
.gl-ds .gl-foot__in { display: flex; justify-content: space-between; align-items: center; gap: 10px 24px; flex-wrap: wrap; padding: 16px 24px; max-width: 1560px; margin: 0 auto; }
.gl-ds.gl-foot a { color: rgba(255,255,255,.92); text-decoration: underline; text-underline-offset: 3px; } .gl-ds.gl-foot a:hover { color: #fff; } .gl-ds.gl-foot a:focus-visible { outline: 2px solid var(--gl-focus-on-dark); outline-offset: 2px; border-radius: 3px; }
.gl-ds .gl-foot__l { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; } .gl-ds.gl-foot small, .gl-ds .gl-foot__v { color: rgba(255,255,255,.78); font-size: var(--gl-fs-12); }

/* — adaptations — */
@media (max-width: 1399.98px) { .gl-ds .gl-brand .gl-logo-full { display: none; } .gl-ds .gl-brand .gl-logo-compact { display: block; } }
@media (max-width: 1299.98px) { .gl-ds .gl-menu__b { padding: 0 10px; gap: 6px; } }
@media (max-width: 1239.98px) { .gl-ds .gl-menu, .gl-ds .gl-desk { display: none; } .gl-ds .gl-burger { display: inline-flex; } .gl-ds .gl-nav__in { padding: 0 12px; gap: var(--gl-s2); height: 56px; } .gl-ds.gl-nav { --gl-nav-h: 56px; } .gl-ds .gl-brand { height: 56px; } }
.gl-ds .gl-nav__in .gl-quick .gl-quick__t { display: inline; }
@media (max-width: 1799.98px) { .gl-ds .gl-quick .gl-quick__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .gl-ds .gl-quick { width: 40px; padding: 0; justify-content: center; } }
@media (max-width: 575.98px) {
  .gl-ds .gl-nav__in { height: 56px; }
  body.gl-shell.gl-has-bottombar > .main-container { padding-bottom: calc(var(--gl-w-bottombar) + 16px + env(safe-area-inset-bottom)); }
  .gl-ds.gl-bottombar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025; background: #fff; border-top: 1px solid var(--gl-line); box-shadow: 0 -4px 14px rgba(15,23,42,.08); padding-bottom: env(safe-area-inset-bottom); }
  .gl-ds.gl-bottombar a, .gl-ds.gl-bottombar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--gl-w-bottombar); border: 0; background: transparent; color: var(--gl-text); text-decoration: none; font: 600 11px/1.2 var(--gl-font); } .gl-ds.gl-bottombar a[aria-current="page"] { color: var(--gl-nuit); box-shadow: inset 0 3px 0 var(--gl-nuit); background: var(--gl-nuit-50); }
  .gl-ds.gl-foot .gl-foot__in { padding: 14px 16px; flex-direction: column; text-align: center; } .gl-ds .gl-foot__l { justify-content: center; } .gl-ds.gl-foot a { display: inline-block; padding: 8px 4px; }
  body.gl-shell.gl-has-bottombar .gl-ds.gl-foot { margin-bottom: calc(var(--gl-w-bottombar) + env(safe-area-inset-bottom)); }
}

/* — outils déplacés (liste d'origine « navbar-nav ms-auto ») : ligne horizontale, noms masqués quand la place manque — */
.gl-ds .gl-tools { flex-direction: row; flex-wrap: nowrap; align-items: center; padding-left: 0; margin-bottom: 0; }
.gl-ds .gl-tools > li { display: flex; align-items: center; margin: 0; }
.gl-ds .gl-tools .nav-link.dropdown-toggle::after { margin-left: 4px; }
@media (max-width: 1599.98px) { .gl-ds .gl-tools .nav-link > span:not(.badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (max-width: 575.98px) { .gl-ds .gl-tools > li.gl-desk, .gl-ds .gl-tools > li:has(.session-clock) { display: none; } .gl-ds .gl-tools-host { gap: 4px; } }
.gl-ds .gl-drop__t { break-after: avoid; }

/* G63 : les menus déplacés (société, utilisateur) s'ouvrent en surimpression, jamais dans le flux (le survol d'origine ajoute « show » sans Popper). */
.gl-ds .gl-tools > li { position: relative; }
.gl-ds .gl-tools .dropdown-menu { position: absolute !important; top: calc(100% + 6px); right: 0; left: auto; margin: 0; z-index: 1040; min-width: 220px; }
.gl-ds .gl-tools .dropdown-menu:not(.show) { display: none; }

/* G63 : mobile — le sélecteur de société (super-admin) se réduit à son icône ; le texte reste dans l'arbre d'accessibilité (font-size:0). */
@media (max-width: 575.98px) {
  .gl-ds .gl-tools > li.dropdown > .btn.dropdown-toggle { font-size: 0 !important; padding-left: 10px; padding-right: 10px; }
  .gl-ds .gl-tools > li.dropdown > .btn.dropdown-toggle .fas, .gl-ds .gl-tools > li.dropdown > .btn.dropdown-toggle .fa { font-size: 15px; margin: 0 !important; }
  .gl-ds .gl-tools > li.dropdown { margin-right: 0 !important; }
  .gl-ds .gl-tools .dropdown-menu { right: -8px; }
}

/* G63 : sur mobile, la barre d'origine (.mobile-topbar) était FIXE et chaque page compense sa hauteur par une marge propre (78 px) ; la nouvelle barre reprend ce contrat (fixe, hors flux) pour ne pas doubler l'espace. Seulement si la page d'origine avait cette barre. */
@media (max-width: 991.98px) { body.gl-shell.gl-fixedtop .gl-ds.gl-nav { position: fixed; top: 0; left: 0; right: 0; } }
