/* =====================================================================
   Menu latéral — refonte page 11 (v3.0.970)
   Bonnes pratiques retenues : panneau resserré, en-tête blanc avec fermeture
   visible, groupes titrés (Accès rapide / Mon activité / Plus), lignes
   compactes (icône + libellé + compteur), page en cours marquée, pas de
   cartes empilées ni de descriptions longues.
   Chargée par base.html après forms.css. Réversible : retirer le <link>.
   ===================================================================== */
html body .contacto-drawer-panel { --cdr-ink: #0D2B3A; --cdr-muted: #5B7684; --cdr-line: #E6EEF1; --cdr-hover: #F1F6F8; --cdr-active: #EAF3F6; }
@media (min-width: 768px) {
  html body .contacto-drawer-panel { width: 400px !important; max-width: 400px !important; }
}

/* En-tête */
html body .contacto-drawer-panel .cdr-head { background: #fff; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--cdr-line); min-height: 56px; }
html body .contacto-drawer-panel .cdr-head__title {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-family: Newsreader, Georgia, serif; font-weight: 500; font-size: 24px; color: var(--cdr-ink);
  letter-spacing: -.01em; text-transform: none;
}
html body .contacto-drawer-panel .cdr-head__title .contacto-badge-pill {
  background: #E71D72 !important; color: #fff !important; box-shadow: none !important;
  font-family: system-ui, sans-serif; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}
html body .contacto-drawer-panel .cdr-close {
  width: 40px; height: 40px; color: var(--cdr-muted); background: transparent; border: 1px solid var(--cdr-line);
}
html body .contacto-drawer-panel .cdr-close:hover { color: var(--cdr-ink); background: var(--cdr-hover); }
html body .contacto-drawer-panel .cdr-close svg { width: 18px; height: 18px; }

/* Bloc utilisateur + recherche : fond blanc, séparateurs fins */
html body .contacto-drawer-panel .cdr-head ~ div.bg-slate-50\/70 { background: #fff !important; padding: 12px 20px !important; }
html body .contacto-drawer-panel .cdr-head ~ div.bg-white.border-b { padding: 4px 20px 12px !important; border-bottom-color: var(--cdr-line) !important; }
html body .contacto-drawer-panel #contacto-menu-search-input { height: 40px !important; border-radius: 10px !important; background: #F6F9FA !important; }

/* Zone défilante */
html body .contacto-drawer-panel .flex-grow.overflow-y-auto { background: #fff !important; padding: 8px 12px 16px !important; }
html body .contacto-drawer-panel .flex-grow.overflow-y-auto > * + * { margin-top: 0 !important; }
html body .contacto-drawer-panel .cdr-group {
  margin: 16px 8px 6px !important; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #7D95A1;
}
html body .contacto-drawer-panel .cdr-group:first-child { margin-top: 6px !important; }

/* Ligne de menu générique */
html body .contacto-drawer-panel :is(.cdr-quick a, .cdr-msg > a, .lp-action, .cdr-drawer > button) {
  display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: flex-start !important;
  gap: 12px !important; width: 100%;
  min-height: 48px; padding: 10px 12px !important; margin: 0 !important;
  border: 0 !important; border-radius: 10px !important; background: transparent !important; box-shadow: none !important;
  color: var(--cdr-ink) !important; text-align: left !important; transform: none !important;
}
html body .contacto-drawer-panel :is(.cdr-quick a, .cdr-msg > a, .lp-action, .cdr-drawer > button):hover { background: var(--cdr-hover) !important; }
html body .contacto-drawer-panel :is(.cdr-quick a, .cdr-msg > a, .lp-action, .cdr-drawer > button):focus-visible { outline: 2px solid #006289; outline-offset: -2px; }

/* Accès rapide : les 2 tuiles deviennent 2 lignes */
html body .contacto-drawer-panel .cdr-quick > .grid { display: block !important; }
html body .contacto-drawer-panel .cdr-quick a > svg { width: 20px !important; height: 20px !important; margin: 0 !important; color: #006289 !important; flex: 0 0 20px; }
html body .contacto-drawer-panel .cdr-quick a > span { font-size: 15px !important; font-weight: 500 !important; color: var(--cdr-ink) !important; }

/* Messagerie : ligne avec compteur */
html body .contacto-drawer-panel .cdr-msg { padding: 0 !important; }
html body .contacto-drawer-panel .cdr-msg > a > div:first-child { gap: 12px !important; flex: 1 1 auto; }
html body .contacto-drawer-panel .cdr-msg > a > div:first-child > div:first-child {
  width: 20px !important; height: 20px !important; background: transparent !important; color: #006289 !important; box-shadow: none !important; transform: none !important;
}
html body .contacto-drawer-panel .cdr-msg > a > div:first-child > div:first-child svg { width: 20px !important; height: 20px !important; color: #006289 !important; }
html body .contacto-drawer-panel .cdr-msg p { font-size: 15px !important; font-weight: 500 !important; color: var(--cdr-ink) !important; }
html body .contacto-drawer-panel .cdr-msg > a > div:last-child > span:not([data-drawer-badge]),
html body .contacto-drawer-panel .cdr-msg > a > div:last-child > svg { display: none !important; }

/* Mon activité : lignes compactes, description et bouton texte retirés */
html body .contacto-drawer-panel .menu-lp-actions { display: flex !important; flex-direction: column !important; gap: 0 !important; margin: 0 !important; }
html body .contacto-drawer-panel .lp-action__media { display: flex !important; align-items: center !important; gap: 12px !important; flex: 1 1 auto; min-width: 0; }
html body .contacto-drawer-panel .lp-action__icon {
  width: 20px !important; height: 20px !important; min-width: 20px !important; padding: 0 !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important; color: #006289 !important;
}
html body .contacto-drawer-panel .lp-action__icon svg { width: 20px !important; height: 20px !important; }
html body .contacto-drawer-panel .lp-action h3 {
  margin: 0 !important; font-family: inherit !important; font-size: 15px !important; font-weight: 500 !important;
  color: var(--cdr-ink) !important; line-height: 1.3 !important; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
html body .contacto-drawer-panel .lp-action__count {
  font-size: 12.5px !important; font-weight: 600 !important; color: var(--cdr-muted) !important;
  background: #F1F5F7; border-radius: 999px; padding: 1px 8px;
}
html body .contacto-drawer-panel .lp-action p,
html body .contacto-drawer-panel .lp-action__cta { display: none !important; }

/* Tiroirs (Plus, Centre superviseur) : en-tête en ligne, sous-liens alignés */
html body .contacto-drawer-panel .cdr-drawer { border: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 10px !important; }
html body .contacto-drawer-panel .cdr-drawer > button > div { gap: 12px !important; }
html body .contacto-drawer-panel .cdr-drawer > button > div > div:first-child {
  width: 20px !important; height: 20px !important; background: transparent !important; border: 0 !important; color: #006289 !important;
}
html body .contacto-drawer-panel .cdr-drawer > button > div > div:first-child svg { width: 20px !important; height: 20px !important; color: #006289 !important; }
html body .contacto-drawer-panel .cdr-drawer > button p:first-child { font-size: 15px !important; font-weight: 500 !important; color: var(--cdr-ink) !important; }
html body .contacto-drawer-panel .cdr-drawer > button p + p { display: none !important; }
html body .contacto-drawer-panel .cdr-drawer > button > svg { margin-left: auto; width: 18px !important; height: 18px !important; }
html body .contacto-drawer-panel .cdr-drawer > div { background: transparent !important; border-top: 0 !important; padding: 0 0 6px !important; }
html body .contacto-drawer-panel .cdr-drawer > div > a, html body .contacto-drawer-panel .cdr-drawer > div > button {
  min-height: 44px; padding: 8px 12px 8px 44px !important; border-radius: 10px; font-size: 14px !important; color: var(--cdr-text, #335566) !important;
}
html body .contacto-drawer-panel .cdr-drawer > div > a:hover, html body .contacto-drawer-panel .cdr-drawer > div > button:hover { background: var(--cdr-hover) !important; color: var(--cdr-ink) !important; }
html body .contacto-drawer-panel .cdr-drawer > div > a span.rounded-full,
html body .contacto-drawer-panel .cdr-drawer > div > a > span.text-xs { display: none !important; }
html body .contacto-drawer-panel .cdr-drawer--admin > button > div > div:first-child,
html body .contacto-drawer-panel .cdr-drawer--admin > button > div > div:first-child svg { color: #B7791F !important; }

/* Page en cours (ajoutée par menu_actif dans base.html) */
html body .contacto-drawer-panel a.is-current.is-current {
  background: var(--cdr-active) !important; box-shadow: inset 3px 0 0 #006289 !important; font-weight: 600 !important;
}
html body .contacto-drawer-panel .is-current :is(h3, p, span) { font-weight: 600 !important; }

/* Bloc utilisateur : nom sur la 1re ligne, Mon compte / Mon profil dessous (le nom n'est plus coupé) */
html body .contacto-drawer-panel .cdr-head + div { flex-wrap: wrap !important; row-gap: 10px !important; }
html body .contacto-drawer-panel .cdr-head + div > div:first-child { flex: 1 1 100% !important; }
html body .contacto-drawer-panel .cdr-head + div > div:first-child p { font-size: 15px !important; font-weight: 600 !important; }
html body .contacto-drawer-panel .cdr-head + div > div:last-child { flex: 1 1 100% !important; display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; }
html body .contacto-drawer-panel .cdr-head + div > div:last-child > a { justify-content: center; min-height: 40px; border-radius: 10px !important; font-size: 13.5px !important; }
html body .contacto-drawer-panel .lp-action__cta::after { display: none !important; }
/* Notifications de l'appareil : même ligne que les autres */
html body .contacto-drawer-panel .cdr-push { padding: 0 !important; }
html body .contacto-drawer-panel .cdr-push > button {
  min-height: 48px; padding: 10px 12px !important; border: 0 !important; border-radius: 10px !important; background: transparent !important; box-shadow: none !important;
}
html body .contacto-drawer-panel .cdr-push > button:hover { background: var(--cdr-hover) !important; }
html body .contacto-drawer-panel .cdr-push > button > div:first-child { gap: 12px !important; }
html body .contacto-drawer-panel .cdr-push > button > div:first-child > span:first-child { width: 20px !important; height: 20px !important; background: transparent !important; }
html body .contacto-drawer-panel .cdr-push > button > div:first-child > span:last-child { font-size: 15px !important; font-weight: 500 !important; color: var(--cdr-ink) !important; }
html body .contacto-drawer-panel .cdr-quick > a { margin-top: 0 !important; }
/* Visiteur : Connexion / Inscription centrés */
html body .contacto-drawer-panel .cdr-head + div > div:last-child > a { display: inline-flex !important; align-items: center !important; justify-content: center !important; text-align: center; padding: 8px 10px !important; }
html body .contacto-drawer-panel .flex-grow.overflow-y-auto > .cdr-group { margin-top: 18px !important; }
html body .contacto-drawer-panel .flex-grow.overflow-y-auto > .cdr-group:first-child { margin-top: 6px !important; }
html body .contacto-drawer-panel .cdr-msg p + p { display: none !important; }
/* Boucle de mesure : cibles ≥ 40 px (pied de menu, boutons du compte) */
html body .contacto-drawer-panel .contacto-drawer-footer :is(a, button) { min-height: 42px !important; display: inline-flex !important; align-items: center !important; }
html body .contacto-drawer-panel .cdr-head + div > div:last-child > a { min-height: 42px !important; }

/* Recherche du menu : x-show pose display:none en ligne, mais les lignes du menu forcent display:flex !important.
   Sans cette règle, « Mes matchs » et « Mes annonces » restaient affichés quel que soit le texte tapé. */
html body .contacto-drawer-panel.contacto-drawer-panel [style*="display: none"] { display: none !important; }
