/* =====================================================================
   LEVRARD — Barre de navigation supérieure  (navbar.css)
   ---------------------------------------------------------------------
   Restyle UNIQUEMENT la .navbar_top (fond ardoise, icônes Font Awesome,
   recherche en pilule, zone utilisateur). Chargée APRÈS general.css.
   Neutre pour le reste du logiciel — retirer le <link> pour revenir
   à l'ancien rendu.
   ===================================================================== */

:root {
  --nav-bg:        #22262e;   /* ardoise foncé (au lieu du noir pur) */
  --nav-icon:      #c9ced6;   /* icônes au repos */
  --nav-icon-hover:#ffffff;   /* icônes au survol */
  --nav-divider:   rgba(255,255,255,.12);
  --nav-hover-bg:  rgba(255,255,255,.08);
  --nav-text:      #e6e8eb;
  --nav-muted:     #9aa1ac;
  --nav-brand:     #b50021;
  --nav-exit:      #d80c31;
  --nav-exit-dark: #b50021;
}

/* —— La barre + ses deux colonnes : on force l'ardoise par-dessus les
      styles inline (couleur_navbar = #000) —— */
.navbar_top,
.navbar_top #navbar_left,
.navbar_top #navbar_right {
  background-color: var(--nav-bg) !important;
  border-bottom: 1px solid rgba(0,0,0,.25) !important;
  color: var(--nav-text) !important;
}
.navbar_top #navbar_left,
.navbar_top #navbar_right { border-bottom: 0 !important; }
.navbar_top { padding: 0 8px !important; gap: 4px; flex-wrap: nowrap !important; }
#navbar_left { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

/* —— Boutons icônes (ex-.button_image PNG) —— */
.navbar_top .button_image {
  height: 38px !important;
  width: 38px !important;
  line-height: 38px !important;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  color: var(--nav-icon) !important;
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.navbar_top .button_image:hover {
  background: var(--nav-hover-bg) !important;
  color: var(--nav-icon-hover) !important;
}
.navbar_top .button_image > i { font-size: 18px; margin: 0; color: inherit; }
.navbar_top .button_image img { filter: brightness(0) invert(1); opacity: .82; }
.navbar_top .button_image:hover img { opacity: 1; }

/* —— Bouton menu (hamburger) —— */
.navbar_top .hide_menu {
  background: transparent !important;
  border: 0 !important;
  width: 40px; height: 40px;
  border-radius: 8px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background-color .12s ease;
}
.navbar_top .hide_menu:hover { background: var(--nav-hover-bg) !important; }
.navbar_top .hide_menu > i { margin-top: 0 !important; font-size: 19px; color: var(--nav-icon) !important; }

/* —— Séparateur vertical léger —— */
.navbar_top .nav-sep {
  width: 1px;
  height: 22px;
  background: var(--nav-divider);
  margin: 0 5px;
  flex: 0 0 auto;
}

/* —— Bouton « Demander congés » : outline discret —— */
.navbar_top .navbar-conges-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 34px !important;
  width: auto !important;
  padding: 0 12px !important;
  background: transparent !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 8px !important;
  color: var(--nav-text) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  line-height: 1 !important;
  transition: background-color .12s ease, border-color .12s ease;
}
.navbar_top .navbar-conges-btn:hover {
  background: var(--nav-hover-bg) !important;
  border-color: rgba(255,255,255,.4) !important;
}

/* —— Icône « valider les absences » + pastille compteur —— */
.navbar_top .nav-absence-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  background: var(--nav-exit);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--nav-bg);
}

/* —— Raccourci appel : champ « ID » blanc avec icône AI dedans
   (même traitement que la recherche : pilule blanche, flex) —— */
.navbar_top .navbar-mobile-hidden > .input-group {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  overflow: hidden;
  height: 36px;
}
.navbar_top .navbar-mobile-hidden > .input-group:focus-within {
  border-color: var(--nav-brand);
  box-shadow: 0 0 0 3px rgba(181,0,33,.15);
}
.navbar_top #shortcutInterSessionId {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  height: 34px !important;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #1f2329 !important;
  font-size: 13px;
  padding-left: 12px !important;
}
.navbar_top #shortcutInterSessionId::placeholder { color: #9aa1ac; }
.navbar_top #shortcutInterSessionId + .input-group-addon {
  flex: 0 0 auto;
  background: #fff !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #6b7280 !important;
  padding: 10px 25px!important;
  font-size: 14px;
}
.navbar_top #shortcutInterSessionId + .input-group-addon:hover { color: var(--nav-brand) !important; }

/* —— Recherche rapide : pilule intégrée au fond sombre —— */
.navbar_top .search-nav-bar { display: flex; justify-content: center; flex: 1 1 auto; min-width: 150px; }
.navbar_top .search-nav-bar .input-group { min-width: 150px; }
/* zone droite : ne rétrécit pas, reste visible en bout de barre */
.navbar_top #navbar_right { flex: 0 0 auto; float: none !important; }
.navbar_top .search-nav-bar .input-group {
  background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}
.navbar_top .search-nav-bar .form-control {
  height: 34px !important;
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #1f2329 !important;
  border-radius: 8px 0 0 8px !important;
  padding-left: 12px !important;
}
.navbar_top .search-nav-bar .form-control::placeholder { color: #9aa1ac; }
.navbar_top .search-nav-bar .input-group:focus-within {
  border-color: var(--nav-brand);
  box-shadow: 0 0 0 3px rgba(181,0,33,.15);
}
.navbar_top .search-nav-bar .input-group-btn .btn,
.navbar_top .search-nav-bar .btn-default {
  background: #fff !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #6b7280 !important;
  height: 34px !important;
}
.navbar_top .search-nav-bar .btn-default:hover { color: var(--nav-brand) !important; }

/* —— Zone utilisateur (nom + déconnexion) ——
   IMPORTANT : on NE touche PAS au margin-right:250px de general.css.
   La .navbar_top fait width:100% mais démarre à x=250 (padding-left de
   #wrapper pour le menu gauche), donc elle déborde de 250px à droite du
   viewport. Le margin-right:250px ramène la déconnexion dans l'écran,
   collée au bord droit visible. */
.navbar_top #navbar_right_button {
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar_top .navbar-user-name {
  color: var(--nav-text) !important;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
/* Bouton déconnexion : bloc ROUGE pleine hauteur en bout de barre
   (vraie séparation, coins droits, glyphicon d'origine conservé) */
.navbar_top #navbar_right_button { gap: 0; }
.navbar_top .button_exit {
  height: 45px !important;
  width: 52px !important;
  border: 0 !important;
  border-left: 1px solid rgba(0,0,0,.25) !important;
  border-radius: 0 !important;
  background: var(--nav-exit) !important;
  margin-left: 12px;
  transition: background-color .12s ease;
}
.navbar_top .button_exit:hover { background: var(--nav-exit-dark) !important; }

/* =====================================================================
   MOBILE — garde-fou : on force à nouveau le masquage des éléments
   .navbar-mobile-hidden. Nos règles .navbar_top .button_image /
   .navbar-conges-btn (spécificité 0,2,0 avec !important) écrasaient
   sinon le display:none d'origine (0,1,0). Ici même spécificité mais
   placée APRÈS → reprend la priorité. Aligné sur le breakpoint 768px
   de general.css.
   ===================================================================== */
@media only screen and (max-width: 768px) {
  /* On garde : menu hamburger + RECHERCHE RAPIDE + bouton DÉCONNEXION.
     On masque : icônes actions, congés, absences, raccourci appel, nom.
     Ordre visuel FORCÉ (order + margin-left:auto) : hamburger, recherche,
     puis déconnexion tout à droite — indépendant du float/DOM. */
  .navbar_top { display: flex !important; flex-wrap: nowrap !important; align-items: center; }

  .navbar_top #navbar_left { order: 1; flex: 0 0 auto; }
  .navbar_top #navbar_left > * { display: none !important; }
  .navbar_top #navbar_left > a#menu-toggle { display: inline-flex !important; }

  .navbar_top .search-nav-bar { order: 2; flex: 1 1 auto; min-width: 0; padding: 0 6px !important; }
  .navbar_top .search-nav-bar .input-group { max-width: none !important; }

  /* zone droite : déconnexion tout à droite, nom masqué */
  .navbar_top #navbar_right {
    order: 3;
    display: flex !important;
    align-items: center;
    flex: 0 0 auto;
    float: none !important;
    margin-left: auto;
  }
  .navbar_top #navbar_right_button { margin-right: 0 !important; gap: 0; }
  .navbar_top .navbar-user-name { display: none !important; }
}
