/* F17 / US-074, US-078 — the frame shared by every space: brand, space, menu, account.
   Built only on css/tokens.css; also used by pages with their own design (catalogue, back-office). */
/* ── Shell: brand, space, menu, account ─────────────────────────── */
.fs-shell { position: sticky; top: 0; z-index: 10; background: var(--fs-surface-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--fs-border); box-shadow: var(--fs-shadow-sm); color: var(--fs-text-2); }
.fs-shell__bar { max-width: var(--fs-content); margin: 0 auto; min-height: var(--fs-shell-height); padding: 0 var(--fs-space-4); display: flex; align-items: center; gap: var(--fs-space-4); }
/* Production logo (branding/logo-fleet-sense-170px.png), as on the sign-in screen and the back-office sidebar. */
.fs-brand { display: inline-flex; align-items: center; flex-shrink: 0; color: var(--fs-ink); text-decoration: none; }
.fs-brand img { display: block; width: auto; height: 40px; }
.fs-shell__space { font-size: var(--fs-text-sm); font-weight: 600; color: var(--fs-text-3); padding: var(--fs-space-1) var(--fs-space-3); background: var(--fs-surface-raised); border: 1px solid var(--fs-border); border-radius: var(--fs-radius-pill); }
.fs-shell__account { margin-left: auto; position: relative; }
.fs-shell__toggle { display: none; }
.fs-nav { max-width: var(--fs-content); margin: 0 auto; padding: 0 var(--fs-space-4) var(--fs-space-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--fs-space-1) var(--fs-space-2); }
.fs-nav__group { font-size: var(--fs-text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fs-text-muted); margin-left: var(--fs-space-3); }
.fs-nav__group:first-child { margin-left: 0; }
.fs-nav__link { padding: var(--fs-space-2) var(--fs-space-3); border-radius: var(--fs-radius-sm); color: var(--fs-text-2); text-decoration: none; font-weight: 500; font-size: var(--fs-text-sm); }
.fs-nav__link:hover { background: var(--fs-accent-soft); color: var(--fs-text); }
.fs-nav__link[aria-current="page"] { background: var(--fs-primary-soft); color: var(--fs-primary-strong); font-weight: 600; }
.fs-account summary { list-style: none; cursor: pointer; padding: var(--fs-space-2) var(--fs-space-3); color: var(--fs-text); background: var(--fs-secondary-bg); border: 1px solid var(--fs-border-strong); border-radius: var(--fs-radius-pill); font-size: var(--fs-text-sm); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-account summary::-webkit-details-marker { display: none; }
.fs-menu { position: absolute; right: 0; top: calc(100% + var(--fs-space-2)); min-width: 240px; padding: var(--fs-space-2); background: var(--fs-surface-raised); border: 1px solid var(--fs-border-strong); border-radius: var(--fs-radius-control); box-shadow: var(--fs-shadow-lg); }
.fs-menu__title { margin: var(--fs-space-2) var(--fs-space-3) var(--fs-space-1); font-size: var(--fs-text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fs-text-muted); }
.fs-menu__item { display: block; width: 100%; text-align: left; margin: 0; padding: var(--fs-space-2) var(--fs-space-3); border: 0; border-radius: var(--fs-radius-sm); background: none; color: var(--fs-text); font: inherit; font-size: var(--fs-text-sm); text-decoration: none; cursor: pointer; min-height: 0; }
.fs-menu__item:hover { background: var(--fs-accent-soft); }
.fs-menu__item[aria-current="true"] { font-weight: 600; }
.fs-menu__hint { color: var(--fs-text-muted); font-weight: 400; }
@media (max-width: 720px) {
  .fs-shell__toggle { display: inline-flex; order: 3; margin: 0; padding: var(--fs-space-2) var(--fs-space-3); min-height: 40px; background: var(--fs-secondary-bg); color: var(--fs-text); border: 1px solid var(--fs-border-strong); border-radius: var(--fs-radius-control); }
  .fs-shell__account { order: 2; }
  .fs-shell__space { display: none; }
  .fs-nav { display: none; flex-direction: column; align-items: stretch; padding-bottom: var(--fs-space-3); }
  .fs-nav.is-open { display: flex; }
  .fs-nav__group { margin: var(--fs-space-3) 0 0; }
  .fs-account summary { max-width: 160px; }
}

html[data-space="gestion"] .fs-shell__bar, html[data-space="gestion"] .fs-nav,
html[data-space="admin"] .fs-shell__bar, html[data-space="admin"] .fs-nav { max-width: var(--fs-content-wide); }
html[data-space="admin"] .fs-shell { border-top: 3px solid var(--fs-accent); }
.fs-shell, .fs-shell * { font-family: var(--fs-font-body); line-height: 1.4; }
.fs-shell button { min-height: 0; }
.fs-shell .fs-button { display: inline-flex; align-items: center; min-height: 38px; padding: var(--fs-space-2) var(--fs-space-4); border: 1px solid var(--fs-border-strong); border-radius: var(--fs-radius-control); background: var(--fs-secondary-bg); color: var(--fs-text); font-weight: 600; font-size: var(--fs-text-sm); text-decoration: none; }
.fs-shell .fs-button:hover { background: var(--fs-secondary-hover); border-color: var(--fs-primary-border); color: var(--fs-text); }
.fs-shell :focus-visible { outline: none; box-shadow: var(--fs-focus); }

/* Public pages: the two ways into a private space (driver, fleet manager). */
.fs-shell__entries { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--fs-space-2); }
.fs-shell__entries + .fs-shell__account { margin-left: 0; }
.fs-shell .fs-shell__entry { background: var(--fs-primary); border-color: var(--fs-primary-border); color: var(--fs-text-inverse); }
.fs-shell .fs-shell__entry:hover { background: var(--fs-primary-active); color: var(--fs-text-inverse); }
@media (max-width: 720px) {
  .fs-shell__bar { flex-wrap: wrap; padding-top: var(--fs-space-2); padding-bottom: var(--fs-space-2); }
  .fs-shell__entries { order: 4; width: 100%; margin-left: 0; }
  .fs-shell .fs-shell__entry { flex: 1 1 0; justify-content: center; text-align: center; min-height: 36px; padding: var(--fs-space-1) var(--fs-space-2); font-size: var(--fs-text-xs); line-height: 1.2; }
}

/* UI50-01 (revue UI .50): in Gestion, the screens outside the back-office (Demandes, Sélections, Propositions…)
   show the menu as a left sidebar, like the back-office, with the active organisation on top. */
.fs-nav__org { display: none; }
@media (min-width: 769px) {
  html.fs-with-sidebar body { padding-left: 248px; }
  html.fs-with-sidebar .fs-shell { margin-left: -248px; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--fs-surface); }
  html.fs-with-sidebar .fs-nav { position: fixed; z-index: 9; left: 0; top: var(--fs-shell-height); bottom: 0; width: 248px; max-width: none; margin: 0; padding: var(--fs-space-4) var(--fs-space-3); flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: var(--fs-space-1); overflow-y: auto; background: var(--fs-surface-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-right: 1px solid var(--fs-border); }
  html.fs-with-sidebar .fs-nav__group { margin: var(--fs-space-4) 0 var(--fs-space-1) var(--fs-space-3); }
  html.fs-with-sidebar .fs-nav__org + .fs-nav__group, html.fs-with-sidebar .fs-nav__group:first-child { margin-top: 0; }
  html.fs-with-sidebar .fs-nav__link { padding: var(--fs-space-2) var(--fs-space-3); }
  html.fs-with-sidebar .fs-nav__org { display: block; margin: 0 0 var(--fs-space-4); padding: var(--fs-space-3); font-size: var(--fs-text-xs); color: var(--fs-text-muted); background: var(--fs-surface-raised); border: 1px solid var(--fs-border); border-radius: var(--fs-radius-control); }
  html.fs-with-sidebar .fs-nav__org strong { display: block; margin-top: 2px; font-size: var(--fs-text-sm); color: var(--fs-text); overflow-wrap: anywhere; }
}
@media (max-width: 768px) {
  html.fs-with-sidebar .fs-nav.is-open .fs-nav__org, html.fs-with-sidebar .fs-nav__org { display: block; margin: var(--fs-space-2) 0 0; font-size: var(--fs-text-xs); color: var(--fs-text-muted); }
  html.fs-with-sidebar .fs-nav__org strong { margin-left: var(--fs-space-2); color: var(--fs-text); }
}

/* Réserve qualification .56 : même menu latéral que le back-office (largeur, icônes, couleurs,
   Paramètres et Déconnexion en bas) sur les pages Gestion hors back-office. */
.fs-nav__icon { display: none; }
.fs-nav__foot { display: flex; flex-direction: column; gap: 2px; }
.fs-nav__signout { border: 0; background: none; cursor: pointer; font: inherit; text-align: left; }
@media (min-width: 769px) {
  html.fs-with-sidebar body { padding-left: 224px; }
  html.fs-with-sidebar .fs-shell { margin-left: -224px; }
  html.fs-with-sidebar .fs-nav { width: 224px; gap: 2px; padding: var(--fs-space-3) 12px 0; background: var(--fs-sidebar-bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-right-color: var(--fs-sidebar-border); }
  html.fs-with-sidebar .fs-nav__group { margin: var(--fs-space-4) 0 var(--fs-space-1); padding: 0 10px; color: var(--fs-sidebar-group); font-size: 11px; letter-spacing: .08em; }
  html.fs-with-sidebar .fs-nav__link { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 9px; color: var(--fs-sidebar-text); font-size: 14px; font-weight: 500; line-height: 1.25; white-space: nowrap; }
  html.fs-with-sidebar .fs-nav__link:hover { background: var(--fs-sidebar-hover); color: var(--fs-text); }
  html.fs-with-sidebar .fs-nav__link[aria-current="page"] { background: var(--fs-sidebar-active-bg); color: var(--fs-sidebar-active-text); font-weight: 500; }
  html.fs-with-sidebar .fs-nav__link[aria-current="page"] .fs-nav__icon { color: var(--fs-sidebar-active-icon); }
  html.fs-with-sidebar .fs-nav__icon { display: inline-block; flex: none; width: 22px; overflow: hidden; font-size: 20px; line-height: 1; }
  html.fs-with-sidebar .fs-nav__label { overflow: hidden; text-overflow: ellipsis; }
  html.fs-with-sidebar .fs-shell .fs-nav__signout, html.fs-with-sidebar .fs-nav .fs-nav__signout { width: 100%; margin: 0; padding: 0 10px; justify-content: flex-start; color: var(--fs-sidebar-text); }
  html.fs-with-sidebar .fs-nav__foot { margin: auto -12px 0; padding: var(--fs-space-2) 12px var(--fs-space-3); border-top: 1px solid var(--fs-sidebar-border); position: sticky; bottom: 0; background: var(--fs-sidebar-bg); }
}
@media (max-width: 768px) {
  html.fs-with-sidebar .fs-nav__foot { margin-top: var(--fs-space-3); }
}

/* Q57-01 : même seuil que le back-office (barre latérale dès 769 px). Entre 721 et 768 px, le menu des pages
   Gestion hors back-office se replie derrière « Menu » comme sur mobile, jamais en barre horizontale multiligne. */
@media (min-width: 721px) and (max-width: 768px) {
  html.fs-with-sidebar .fs-shell__toggle { display: inline-flex; order: 3; margin: 0; padding: var(--fs-space-2) var(--fs-space-3); min-height: 40px; background: var(--fs-secondary-bg); color: var(--fs-text); border: 1px solid var(--fs-border-strong); border-radius: var(--fs-radius-control); }
  html.fs-with-sidebar .fs-shell__account { order: 2; }
  html.fs-with-sidebar .fs-nav { display: none; flex-direction: column; align-items: stretch; padding-bottom: var(--fs-space-3); }
  html.fs-with-sidebar .fs-nav.is-open { display: flex; }
  html.fs-with-sidebar .fs-nav__group { margin: var(--fs-space-3) 0 0; }
}

/* FleetSeed : une variante par fond, et symbole lisible en espace réduit. */
.fs-brand .fs-brand-light { display: none; }
html.driver-light:not([data-theme="sombre"]) .fs-brand .fs-brand-dark { display: none; }
html.driver-light:not([data-theme="sombre"]) .fs-brand .fs-brand-light { display: block; }
@media (max-width:480px) { .fs-brand picture img { width: 100px; height: auto; object-fit: contain; } }
