/* W42.24 (t958) : en-tête commun West Finance (feuille chargée par brand_head(), _brand.php : toutes les pages).
   1. Barre, marque et bouton de l'accueil W42.22 / W42.23-r1 (déplacés depuis accueil.css, valeurs inchangées) : accueil et /login.
   2. Espace connecté (.ws-as-header de _app_shell.php) : même style sombre, même marque (ws_marque, _entete.php), accent #FACC15 ;
      actions de droite (Synchroniser, Abonnement, compte) inchangées. app-shell.css (gelé) n'est pas modifié : surcharges par spécificité.
   Aucun style inline, aucun script. */
.ws-w4222-head { position: sticky; top: 0; z-index: 50; }
.ws-w4222-nav { background: rgba(10,10,10,.8); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.ws-w4222-in { max-width: 80rem; margin: 0 auto; padding: 0 1rem; height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
@media (min-width: 640px) { .ws-w4222-in { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .ws-w4222-in { padding: 0 2rem; } }
.ws-w4222-brand { display: inline-flex; align-items: center; gap: .75rem; min-height: 44px; color: #fff; text-decoration: none; }
.ws-w4222-logo { width: 2.5rem; height: 2.5rem; object-fit: contain; display: block; flex: none; filter: drop-shadow(0 10px 15px rgba(250,204,21,.2)); transition: transform .2s; }
.ws-w4222-brand:hover .ws-w4222-logo { transform: scale(1.05); }
.ws-w4222-name { display: block; font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: #fff; white-space: nowrap; }
.ws-w4222-sub { display: block; margin-top: .2rem; font-size: 10px; color: #9ca3af; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.ws-w4222-act { display: flex; align-items: center; gap: 1rem; flex: none; }
.ws-w4222-btn { position: relative; display: inline-flex; align-items: center; min-height: 44px; border-radius: .75rem; padding: 1px; overflow: hidden; text-decoration: none; }
.ws-w4222-btn::before { content: ""; position: absolute; inset: 0; border-radius: .75rem; background: linear-gradient(90deg, #fde047, #FACC15, #f5b301); }
.ws-w4222-btn span { position: relative; display: flex; align-items: center; gap: .5rem; padding: .625rem 1.25rem; border-radius: .75rem; background: #0A0A0A; font-size: .875rem; font-weight: 600; color: #fff; white-space: nowrap; }
.ws-w4222-btn svg { color: #FACC15; transition: transform .2s; flex: none; }
.ws-w4222-btn:hover svg, .ws-w4222-btn:focus-visible svg { transform: translateX(4px); }
.ws-w4222-btn:focus-visible { outline: 2px solid #FACC15; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .ws-w4222-btn::before { animation: ws-w4222-pulse 4s cubic-bezier(.4,0,.6,1) 3; } }
@keyframes ws-w4222-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .ws-w4222-logo, .ws-w4222-btn svg { transition: none; } .ws-w4222-brand:hover .ws-w4222-logo, .ws-w4222-btn:hover svg { transform: none; } }
/* mobile (comme West Ops) : une ligne, liens masqués sous 768 px, sous-titre masqué et bouton resserré sous 480 px */
@media (max-width: 479px) {
  .ws-w4222-brand { gap: .5rem; }
  .ws-w4222-sub { display: none; }
  .ws-w4222-name { font-size: 1.05rem; }
  .ws-w4222-btn span { padding: .5rem .75rem; font-size: .8125rem; gap: .35rem; }
}

/* W42.29 (t972) : liens d'ancre (ex-accueil.css) — visibles dès 768 px, comme l'accueil. */
.ws-w4222-links { display: none; align-items: center; gap: 2rem; font-size: .875rem; font-weight: 500; color: #d1d5db; }
.ws-w4222-links a { min-height: 44px; display: inline-flex; align-items: center; color: inherit; text-decoration: none; transition: color .2s; }
.ws-w4222-links a:hover, .ws-w4222-links a:focus-visible { color: #FACC15; }
@media (min-width: 768px) { .ws-w4222-links { display: flex; } }

/* W42.29 (t972) : champs auth lisibles (fond distinct du fond de page #0A0A0A, texte contrasté, autofill navigateur). */
.ws-auth-field {
  background-color: #1a1a1f !important;
  color: #f3f4f6 !important;
  border: 1px solid #333 !important;
  caret-color: #FACC15;
  -webkit-text-fill-color: #f3f4f6;
}
.ws-auth-field::placeholder { color: #9ca3af; opacity: 1; }
.ws-auth-field:focus, .ws-auth-field:focus-visible {
  border-color: #FACC15 !important;
  outline: none;
}
.ws-auth-field:-webkit-autofill,
.ws-auth-field:-webkit-autofill:hover,
.ws-auth-field:-webkit-autofill:focus,
.ws-auth-field:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 40px #1a1a1f inset !important;
  box-shadow: 0 0 0 40px #1a1a1f inset !important;
  -webkit-text-fill-color: #f3f4f6 !important;
  caret-color: #FACC15;
  transition: background-color 99999s ease-out 0s;
}
select.ws-auth-field option { background: #1a1a1f; color: #f3f4f6; }

/* ===== 2. Espace connecté : en-tête de la coquille (_app_shell.php) ===== */
/* Hauteur de la barre de l'accueil (5rem ; 4rem sous 480 px) : --ws-as-h place aussi la colonne latérale (top) et le menu Patrimoine. */
html:root { --ws-as-h: 5rem; }
@media (max-width: 479px) { html:root { --ws-as-h: 4rem; } }
header.ws-as-header {
    min-height: var(--ws-as-h); padding: 0 1rem; gap: 1rem;
    background: rgba(10,10,10,.8); border-bottom: 1px solid rgba(255,255,255,.08); box-shadow: 0 20px 50px rgba(0,0,0,.4);
    isolation: isolate;
}
/* flou d'arrière-plan sur un pseudo-élément : un backdrop-filter sur le <header> ferait de lui le bloc conteneur des éléments fixed qu'il contient */
header.ws-as-header::before { content: ""; position: absolute; inset: 0; z-index: -1; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); pointer-events: none; }
@media (min-width: 640px) { header.ws-as-header { padding: 0 1.5rem; } }
@media (min-width: 1024px) { header.ws-as-header { padding: 0 2rem; } }
header.ws-as-header .ws-as-header-actions { min-width: 0; }
header.ws-as-header .ws-w4222-brand { min-width: 0; }
header.ws-as-header .ws-as-iconbtn { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
@media (hover: hover) { header.ws-as-header .ws-as-iconbtn:hover { background: rgba(250,204,21,.12); color: #fde047; } }
header.ws-as-header .ws-as-iconbtn:focus-visible, header.ws-as-header .ws-w4222-brand:focus-visible { outline: 2px solid #FACC15; outline-offset: 2px; }
/* W48.4 : titre « West Finance » de la coquille — même police et même taille que le tableau de bord,
   quelle que soit la pile CSS (app.min.css pose Inter sur html ; west.min.css pose system-ui).
   Les tailles déjà en vigueur sur le dashboard sont reprises ici, plus spécifiques. */
header.ws-as-header .ws-w4222-name { font-family: Inter, sans-serif; font-size: 1.25rem; }
/* 390 px : une ligne, sous-titre masqué (règle 479 px ci-dessus), le bouton Abonnement reste visible en icône
   (dash-sync.css le masquait sous 400 px) ; rien ne déborde. */
@media (max-width: 479px) {
  header.ws-as-header { padding: 0 .75rem; gap: .5rem; }
  header.ws-as-header .ws-as-header-actions { gap: .375rem; }
  header.ws-as-header .ws-w4222-name { font-size: 1rem; }
}
@media (max-width: 399.98px) { header.ws-as-header .ws-hdr-abo.ws-hdr-abo { display: flex !important; } }
@media (max-width: 339.98px) { header.ws-as-header .ws-w4222-name { display: none; } }

/* ===== W42.25 (t959) — menu de gauche replié (bureau ≥ 1280 px ; app-shell.css / app-shell.js inchangés) =====
   Bug : au repli, display:none sur les titres de groupe et les libellés faisait remonter les icônes (164 px au lieu de 205 px
   pour la première). Les libellés et titres restent dans le flux, en fondu (opacity), et gardent leur hauteur : les icônes
   restent au même niveau qu'en mode déplié, centrées dans la colonne de 80 px. La colonne glisse vers la gauche (width),
   le contenu suit (margin-left / width). Transitions seulement après un clic sur le bouton (html.ws-as-anime, posée par
   ws-entete-h.js) : pas d'animation au chargement d'une page déjà repliée. Mobile (< 1280 px) : volet coulissant inchangé. */
@media (min-width: 1280px) {
  html body.sidebar-is-collapsed #mainSidebar .ws-as-link { justify-content: flex-start; padding-left: 17px; padding-right: 0; overflow: hidden; }
  html body.sidebar-is-collapsed #mainSidebar .ws-as-link span:not(.ws-as-dot),
  html body.sidebar-is-collapsed #mainSidebar .ws-as-group-title { display: block; opacity: 0; pointer-events: none; }
  html body.sidebar-is-collapsed #mainSidebar .ws-as-link span.ws-as-dot:not([hidden]) { display: block; }
  html body.sidebar-is-collapsed #mainSidebar .ws-as-group-title { overflow: hidden; }
  html body.sidebar-is-collapsed #mainSidebar .ws-as-lock { position: absolute; left: 34px; bottom: 4px; width: auto; font-size: .6rem; }
  html.ws-as-anime #mainSidebar { transition: width .28s ease; }
  html.ws-as-anime .ws-as-main, html.ws-as-anime #mainContentArea { transition: margin-left .28s ease, width .28s ease; }
  html.ws-as-anime #mainSidebar .ws-as-link { transition: background .15s, color .15s, padding .28s ease; }
  html.ws-as-anime #mainSidebar .ws-as-link span:not(.ws-as-dot),
  html.ws-as-anime #mainSidebar .ws-as-group-title { transition: opacity .2s ease; }
}
@media (min-width: 1280px) and (prefers-reduced-motion: reduce) {
  html.ws-as-anime #mainSidebar, html.ws-as-anime .ws-as-main, html.ws-as-anime #mainContentArea,
  html.ws-as-anime #mainSidebar .ws-as-link, html.ws-as-anime #mainSidebar .ws-as-link span,
  html.ws-as-anime #mainSidebar .ws-as-group-title { transition: none; }
}

/* W45.3 : cibles tactiles et navigation publique mobile, sans toucher au routeur. */
header.ws-as-header .ws-as-iconbtn,
header.ws-as-header #wsUserMenuBtn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; flex-shrink: 0; }
.ws-public-mobile { display: none; position: relative; }
.ws-public-mobile summary { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; cursor: pointer; list-style: none; border: 1px solid #333; border-radius: .75rem; color: #FACC15; font-size: 1.4rem; }
.ws-public-mobile summary::-webkit-details-marker { display: none; }
.ws-public-mobile summary:focus-visible, .ws-public-mobile a:focus-visible { outline: 2px solid #FACC15; outline-offset: 2px; }
.ws-public-mobile-links { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 13rem; padding: .5rem; border: 1px solid #333; border-radius: .75rem; background: #121212; box-shadow: 0 12px 30px #0008; }
.ws-public-mobile-links a { display: flex; align-items: center; min-height: 44px; padding: .5rem .75rem; color: #fff; text-decoration: none; }
.ws-public-mobile-links a:hover { color: #fde047; }
@media (max-width: 767.98px) {
  .ws-public-mobile { display: block; position: static; flex: 0 0 auto; }
  .ws-public-mobile-links { top: 100%; right: 1rem; z-index: 2; }
  /* Une seule ligne : logo (rétrécissable), bouton Se connecter, burger. Pas de retour à la ligne. */
  .ws-w4222-in { flex-wrap: nowrap; height: auto; min-height: 5rem; padding-top: .5rem; padding-bottom: .5rem; gap: .5rem; }
  .ws-w4222-in > .ws-w4222-brand { flex: 1 1 auto; min-width: 0; margin-right: 0; }
  .ws-w4222-in > .ws-w4222-brand > span { min-width: 0; overflow: hidden; }
  .ws-w4222-in > .ws-w4222-brand .ws-w4222-name { overflow: hidden; text-overflow: ellipsis; }
  .ws-w4222-act { flex: 0 1 auto; width: auto; min-width: 0; justify-content: flex-end; }
  .ws-w4222-btn { flex: 0 1 auto; min-width: 44px; max-width: 100%; }
  .ws-w4222-btn span { padding: .5rem .6rem; font-size: .8125rem; gap: .3rem; max-width: 100%; overflow: hidden; }
  .ws-w4222-btn span { display: inline-flex; min-width: 0; }
  .ws-w4222-btn .ws-w4222-btn-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  header.ws-as-header { gap: .25rem; padding-left: .5rem; padding-right: .5rem; }
  header.ws-as-header .ws-as-header-actions { gap: .25rem; }
  header.ws-as-header .ws-w4222-brand { gap: .35rem; }
  header.ws-as-header .ws-w4222-logo { width: 32px; height: 32px; }
}
@media (max-width: 479px) {
  .ws-w4222-in { padding-left: .75rem; padding-right: .75rem; gap: .375rem; }
  .ws-w4222-logo { width: 32px; height: 32px; }
  .ws-w4222-btn span { padding: .45rem .5rem; font-size: .75rem; gap: .25rem; }
}

/* W46.8 (t1152) : après PJAX depuis dashboard, flex-1 (1 1 0%) ramenait le main
   à sa min-height malgré son contenu débordant ; body restait haut d'un viewport et
   ses éléments sticky sortaient avec lui. Conserver la hauteur intrinsèque du contenu
   et empêcher son rétrécissement. Surcharge commune : app-shell.css/js restent gelés. */
body > #mainContentArea { flex: 1 0 auto; }
