/* ===== Thème Nature & Pro (flat & contrasté, logo principal agrandi + séparation marquée) ===== */
:root{
  --green-900:#0e3a22;
  --green-800:#13502c;
  --green-700:#1a6b3a;
  --green-600:#2a7f45;
  --green-500:#3c9154;
  --green-300:#9fd7b2;
  --leaf:#7cc26a;
  --cream:#f4f8f5;
  --text-on-dark:#ffffff;
  --text-muted:#cfe7d7;
  --ink:#102a19;
  --line:rgba(255,255,255,.12);
  --line-dark:rgba(0,0,0,.08);

  /* Séparation marquée */
  --sep-green: rgba(26, 107, 58, 0.55);
  --shadow-green-strong: 0 16px 36px rgba(20,60,40,.32);
}

/* NAVBAR PRINCIPALE */
.navbar{
  background: var(--green-900);
  height: 100px;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  padding: 0 20px;
  border-bottom: 1px solid rgba(20, 60, 40, 0.25);
  box-shadow: 0 3px 10px rgba(20,60,40,0.18);
  display: flex;
  align-items: center;
}

.navbar-brand{
  display:flex;
  align-items:center;
  text-decoration:none;
  color: var(--text-on-dark);
  min-width:0;
}

/* Logos */
.brand-logos{ display:flex; align-items:center; gap:10px; }
.logo-main{
  height:110px; width:auto; object-fit:contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.logo-secondary{
  height:75px; width:auto; object-fit:contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.12));
}

/* Titre */
.company-info{ display:block; margin-left:15px; }
.company-name{
  color: var(--text-on-dark);
  font-weight:800; letter-spacing:.04em; text-transform:uppercase;
  line-height:1; font-size:clamp(18px,2.2vw,26px);
  white-space:nowrap; text-shadow:0 1px 0 rgba(0,0,0,.12);
}

/* Droite */
.greeting{
  color: var(--text-on-dark);
  max-width:160px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  margin-right:.25rem;
}

/* Burger */
.navbar-toggler{ border:none; background:none; margin-left:.25rem; }
.navbar-toggler-icon{
  display:inline-block; width:1.6rem; height:1.6rem;
  background-repeat:no-repeat; background-position:center; background-size:100% 100%;
}
.navbar-toggler:not(.open) .navbar-toggler-icon{
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.9)' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
.navbar-toggler.open .navbar-toggler-icon{
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.9)' stroke-width='2' d='M7 7l16 16M23 7L7 23'/%3E%3C/svg%3E");
}

/* SOUS-NAV : séparation marquée (ombre verte + bande d’accent) */
.subnav{
  background:#ffffff;
  position:fixed;
  top:100px;
  width:100%;
  z-index:1001; /* au-dessus de l’overlay */
  display:flex;
  justify-content:center;
  height:40px;
  padding:6px 0;
  font-weight:700;
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;

  scrollbar-width:none;           /* Firefox */
  border-bottom:1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow-green-strong);
}
.subnav::-webkit-scrollbar{ display:none; }  /* Chrome/Safari */

.subnav::after{
  content:"";
  position:absolute; left:0; bottom:-3px;
  width:100%; height:3px;
  background: linear-gradient(90deg, #1a6b3a 0%, #3c9154 100%);
  pointer-events:none;
}

.subnav .navbar-nav{ flex-wrap:nowrap; }
.subnav .nav-item{ white-space:nowrap; }
.subnav .nav-link{
  color:var(--ink);
  margin:0 12px; text-decoration:none; font-size:0.95rem;
  padding-bottom:6px; border-bottom:2px solid transparent;
  transition:color .15s ease,border-color .15s ease,transform .15s ease;
}
.subnav .nav-link:hover,
.subnav .nav-link.active{
  color:var(--green-700);
  border-bottom-color:var(--leaf);
  transform:translateY(-1px);
}

/* SIDEBAR */
.sidebar{
  height:100%; width:0; position:fixed; z-index:1002; top:0; right:0;
  background:#0f2f1d; overflow-x:hidden; transition:.4s; padding-top:60px; white-space:nowrap;
  box-shadow:-8px 0 20px rgba(0,0,0,.25); border-left:1px solid rgba(255,255,255,.06);
}
.sidebar.active{ width:280px; }
.sidebar a{
  padding:10px 24px 10px 32px; text-decoration:none; font-size:1.05rem;
  color:var(--text-muted); display:block; transition:.2s;
}
.sidebar a:hover{ color:#fff; }
.sidebar .closebtn{ position:absolute; top:8px; right:24px; font-size:36px; color:#fff; text-decoration:none; }
.sidebar .logout{ position:absolute; bottom:20px; left:0; width:100%; color:#ffd1d1; }

/* Overlays */
#overlay{
  position:fixed; display:none; inset:0; background-color:rgba(0,0,0,0.45); z-index:1000;
}
#overlay.active{ display:block; }
#subNavOverlay{
  display:none; position:fixed; top:147px; left:0; /* 100 + 44 + 3 */
  width:100%; height:calc(100% - 147px);
  background-color:rgba(0,0,0,0.45); z-index:1000;
}
#subNavOverlay.active{ display:block; }

/* NAV items */
.navbar-nav{ display:flex; flex-direction:row; margin-left:auto; align-items:center; }
.navbar-nav .nav-item{ margin-left:15px; }
.navbar-brand, .nav-link{ padding:0; }

/* ===== Responsive ===== */
@media (max-width:992px){
  .logo-main{ height:85px; }
  .logo-secondary{ height:65px; }
  .company-name{ font-size:clamp(15px,2.4vw,20px); }
  .navbar{ height:95px; }
  .subnav{ top:95px; }
  #subNavOverlay{ top:142px; height:calc(100% - 142px); }
  body{ padding-top:142px; }
}

@media (max-width:830px){
  .company-info{ display:none; }

  /* Sous-nav mobile : fond clair uniforme, pas d’ombre pour éviter l’effet foncé avec l’overlay */
  .subnav{
    display:none; flex-direction:column; top:100px; left:0; width:100%;
    height:auto; padding:0; background:#ffffff;
    box-shadow:none;                                   /* <-- supprime l’ombre en mobile */
    border-top:1px solid rgba(0,0,0,0.08);
    border-bottom:2px solid var(--green-700);
  }
  .subnav.show{ display:flex !important; }

  .subnav .navbar-nav{ flex-direction:column; align-items:flex-start; width:100%; }
  .subnav .nav-item{
    width:100%; border-bottom:1px solid rgba(0,0,0,0.08);
    padding:14px 20px; margin:0; background:#f7f9f8;
  }
  .subnav .nav-item:first-child{ border-top:1px solid rgba(0,0,0,0.1); }
  .subnav .nav-link{ color:#102a19; width:100%; text-align:left; font-size:18px; border-bottom-color:transparent; }
  .subnav .nav-link:hover{ background-color:#e9f3ed; color:#0e3a22; }

  .subnav::after{ bottom:0; } /* bande d’accent visible sans déborder */
  .navbar-toggler{ background:none; }
  body{ padding-top:100px; }
}

@media (max-width:420px){
  .logo-secondary{ display:none; }
}

@media (max-width:920px){
  .greeting{ display:none; }
}

/* Espace sous navigation */
body{
  padding-top:147px; /* 100 navbar + 44 subnav + 3 bande */
  background-color:var(--cream);
}

/* Focus */
a:focus-visible, button:focus-visible{
  outline:2px solid var(--leaf);
  outline-offset:2px;
}
