/* Automatec Gestion Affaires v7.44 — corrections ciblées de navigation.
   Thème GRIS : seule la navigation est anthracite (#121820).
   Thème CLAIR : sous-menus et états de survol/focus lisibles.
   Thème SOMBRE : aucun changement. */

/* A. GRIS : menu latéral, barre supérieure et sous-menus associés sombres.
   Règles renforcées pour écraser les dégradés des pages métier. */
html[data-theme="light"][data-theme-variant="gray"] .app-sidebar,
html[data-theme="light"][data-theme-variant="gray"] .app-topbar,
html[data-theme="light"][data-theme-variant="gray"] body[class*="page-theme-"] .app-sidebar,
html[data-theme="light"][data-theme-variant="gray"] body.page-theme-technicien .app-sidebar {
  background:#121820 !important;
  border-color:#354354 !important;
  box-shadow:0 3px 15px rgba(13,20,32,.16);
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-brand-row {
  border-bottom-color:#354354 !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-brand,
html[data-theme="light"][data-theme-variant="gray"] .sidebar-brand-text strong {
  color:#fff !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-brand-text small,
html[data-theme="light"][data-theme-variant="gray"] .topbar-context {
  color:#c1ccd9 !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-link:not(.active):not(.sidebar-link-attention) {
  color:#e7edf6 !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-link:not(.active):not(.sidebar-link-attention):is(:hover,:focus-visible) {
  background:#283649 !important;
  color:#fff !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-toggle {
  background:#273548 !important;
  color:#fff !important;
}
html[data-theme="light"][data-theme-variant="gray"] .topbar-action,
html[data-theme="light"][data-theme-variant="gray"] .topbar-user,
html[data-theme="light"][data-theme-variant="gray"] .topbar-user-name,
html[data-theme="light"][data-theme-variant="gray"] .topbar-logout {
  color:#f4f7fc !important;
}
html[data-theme="light"][data-theme-variant="gray"] .topbar-action:is(:hover,:focus-visible),
html[data-theme="light"][data-theme-variant="gray"] .topbar-user:is(:hover,:focus-visible) {
  background:#283649 !important;
  border-color:#526176 !important;
  color:#fff !important;
}
/* Statut réseau lisible sur la barre anthracite ; alerte hors ligne préservée. */
html[data-theme="light"][data-theme-variant="gray"] .topbar-network:not(.is-offline) {
  color:#d5dfeb !important;
}
html[data-theme="light"][data-theme-variant="gray"] .topbar-global-search input {
  background:#263345 !important;
  color:#f4f7fc !important;
  border-color:#46576c !important;
}
html[data-theme="light"][data-theme-variant="gray"] .topbar-global-search input::placeholder {
  color:#c5d0df !important;
}
html[data-theme="light"][data-theme-variant="gray"] .topbar-global-search button { color:#edf3fc !important; }
html[data-theme="light"][data-theme-variant="gray"] .sidebar-flyout {
  background:#1b2635 !important;
  border-color:#47566d !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-flyout-link:not(.active):not(.sidebar-flyout-attention) {
  background:transparent !important;
  color:#e7edf6 !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-flyout-link:not(.active):is(:hover,:focus-visible) {
  background:#32435a !important;
  color:#fff !important;
}
html[data-theme="light"][data-theme-variant="gray"] .sidebar-flyout-link.active {
  background:#2364aa !important;
  color:#fff !important;
}
/* Préserver le bleu, violet, orange ou turquoise de l'onglet sélectionné. */
html[data-theme="light"][data-theme-variant="gray"] .sidebar-link.active:hover,
html[data-theme="light"][data-theme-variant="gray"] .sidebar-group.active>.sidebar-link:hover {
  color:#fff !important;
  filter:brightness(.94);
}

/* B. CLAIR : seuls les menus et sous-menus sont concernés ; le reste du thème
   clair de la v7.43 reste identique. */
html[data-theme="light"][data-theme-variant="light"] .sidebar-flyout {
  background:#fff !important;
  border-color:#b5c3d4 !important;
  box-shadow:0 14px 32px rgba(30,46,68,.16);
}
html[data-theme="light"][data-theme-variant="light"] .sidebar-flyout-link:not(.active):not(.sidebar-flyout-attention) {
  background:transparent !important;
  color:#23354d !important;
}
html[data-theme="light"][data-theme-variant="light"] .sidebar-flyout-link:not(.active):is(:hover,:focus-visible) {
  background:#e5eef9 !important;
  color:#142947 !important;
}
html[data-theme="light"][data-theme-variant="light"] .sidebar-flyout-link.active,
html[data-theme="light"][data-theme-variant="light"] .sidebar-flyout-link.active:is(:hover,:focus-visible) {
  background:#2367b5 !important;
  color:#fff !important;
}
/* Un onglet actif ne doit jamais pâlir au survol ni au focus clavier. */
html[data-theme="light"][data-theme-variant="light"] .sidebar-link.active:not(.sidebar-link-attention):is(:hover,:focus-visible),
html[data-theme="light"][data-theme-variant="light"] .sidebar-group.active>.sidebar-link:is(:hover,:focus-visible) {
  background:linear-gradient(90deg,#1f5da8,#246dc2) !important;
  color:#fff !important;
}
/* Conserver l'accent de navigation des pages métier (devis, chantiers). */
html[data-theme="light"][data-theme-variant="light"] body:is(.page-theme-devis,.page-theme-fiche-devis,.page-theme-chiffrage,.page-theme-chantiers,.page-theme-fiche-chantier) .sidebar-link.active:not(.sidebar-link-attention):is(:hover,:focus-visible) {
  background:linear-gradient(90deg,rgba(var(--page-accent-rgb),.95),rgba(var(--page-accent-rgb),.68)) !important;
  color:#fff !important;
}
html[data-theme="light"][data-theme-variant="light"] body.page-theme-technicien .sidebar-link.active:not(.sidebar-link-attention):is(:hover,:focus-visible) {
  background:linear-gradient(90deg,#0f9f92,#0d9488) !important;
  color:#fff !important;
}
/* Ne pas casser les onglets attention orange du menu. */
html[data-theme="light"][data-theme-variant="light"] .sidebar-link.sidebar-link-attention.active:is(:hover,:focus-visible),
html[data-theme="light"][data-theme-variant="light"] .sidebar-group.active>.sidebar-link.sidebar-link-attention:is(:hover,:focus-visible) {
  background:linear-gradient(90deg,#b45309,#d97706) !important;
  color:#fff !important;
}
/* Survol d'une entrée ordinaire : fond clair = texte foncé. */
html[data-theme="light"][data-theme-variant="light"] .sidebar-link:not(.active):not(.sidebar-link-attention):is(:hover,:focus-visible),
html[data-theme="light"][data-theme-variant="light"] .sidebar-group:not(.active)>.sidebar-link:not(.sidebar-link-attention):is(:hover,:focus-visible) {
  background:#e5eef9 !important;
  color:#193454 !important;
}
/* C. Bouton de fermeture du sélecteur de thème, identique dans les 3 modes. */
.theme-choice-panel .theme-choice-close {
  display:grid;
  place-items:center;
  padding:0;
  width:32px;
  height:32px;
  flex:0 0 32px;
  text-align:center;
  line-height:1;
}
.theme-choice-panel .theme-choice-close > span {
  display:block;
  line-height:1;
  transform:translateY(-1px);
}
