/* Correctif interface ciblé : menu latéral, décalage contenu, logo et logs sécurité.
   Aucun traitement métier n'est modifié. */
:root{
  --anras-green:#1F7A4C;
  --anras-green-dark:#16603A;
  --anras-green-soft:#DFF3E8;
  --sidebar-width:315px;
}

/* Menu latéral vert professionnel */
.sidebar,
#appSidebar{
  background:linear-gradient(180deg,var(--anras-green),#185f3d)!important;
  color:#fff!important;
  border-right:0!important;
  box-shadow:18px 0 45px rgba(15,23,42,.20)!important;
}
.sidebar .brand,
#appSidebar .brand{
  color:#fff!important;
  border-bottom:1px solid rgba(255,255,255,.18)!important;
}
.sidebar .nav-link,
#appSidebar .nav-link{
  color:#f8fffB!important;
}
.sidebar .nav-link i,
#appSidebar .nav-link i{
  color:#dff3e8!important;
}
.sidebar .nav-link:hover,
#appSidebar .nav-link:hover{
  background:var(--anras-green-dark)!important;
  color:#fff!important;
}
.sidebar .nav-link.active,
#appSidebar .nav-link.active{
  background:var(--anras-green-soft)!important;
  color:var(--anras-green-dark)!important;
}
.sidebar .nav-link.active i,
#appSidebar .nav-link.active i{
  color:var(--anras-green-dark)!important;
}
.sidebar .user-card,
#appSidebar .user-card{
  background:rgba(255,255,255,.12)!important;
  border:1px solid rgba(255,255,255,.20)!important;
  color:#fff!important;
}
.sidebar .user-card .text-white-50,
#appSidebar .user-card .text-white-50{
  color:rgba(255,255,255,.75)!important;
}

/* Bouton menu discret : flèche, toujours à gauche */
.top-menu-btn{
  position:fixed!important;
  left:10px!important;
  top:18px!important;
  z-index:1100!important;
  width:38px!important;
  height:38px!important;
  border-radius:999px!important;
  padding:0!important;
  background:var(--anras-green)!important;
  color:#fff!important;
  border:2px solid #fff!important;
  box-shadow:0 8px 20px rgba(15,23,42,.20)!important;
}
.top-menu-btn i{font-size:1rem!important;line-height:1!important;}
.top-menu-btn:hover{background:var(--anras-green-dark)!important;color:#fff!important;}

/* Laisse de l'espace au bouton dans le header */
.modern-topbar{padding-left:58px!important;}

/* Logo ANRAS miniature dans le bloc application interne */
.topbar-app-icon{
  background:#fff!important;
  border:1px solid #e5e7eb!important;
  overflow:hidden!important;
  display:grid!important;
  place-items:center!important;
}
.topbar-app-icon img{
  max-width:34px!important;
  max-height:34px!important;
  width:auto!important;
  height:auto!important;
  object-fit:contain!important;
}

/* Décalage professionnel du contenu quand le menu est ouvert sur ordinateur */
body.drawer-open .content{
  margin-left:var(--sidebar-width)!important;
  width:calc(100% - var(--sidebar-width))!important;
  transition:margin-left .22s ease,width .22s ease!important;
}
body:not(.drawer-open) .content{
  margin-left:0!important;
  width:100%!important;
  transition:margin-left .22s ease,width .22s ease!important;
}
body.drawer-open .modern-topbar{
  width:calc(100% - var(--sidebar-width) - 44px)!important;
}

/* Le menu reste masqué/affiché par la classe drawer-open malgré les anciens scripts */
body:not(.drawer-open) #appSidebar{
  transform:translateX(-112%)!important;
}
body.drawer-open #appSidebar{
  transform:translateX(0)!important;
}

/* Logs sécurité : tableau lisible, non invisible, responsive */
body.security-logs-page .table,
.security-logs-table,
#securityLogsTable,
table.security-logs{
  width:100%!important;
  table-layout:auto!important;
  background:#fff!important;
  color:#111827!important;
}
body.security-logs-page .table th,
body.security-logs-page .table td,
.security-logs-table th,
.security-logs-table td,
#securityLogsTable th,
#securityLogsTable td,
table.security-logs th,
table.security-logs td{
  color:#111827!important;
  background:#fff!important;
  vertical-align:middle!important;
  white-space:normal!important;
  word-break:break-word!important;
  max-width:360px!important;
}
body.security-logs-page .table thead th,
.security-logs-table thead th,
#securityLogsTable thead th,
table.security-logs thead th{
  background:#f0fdf4!important;
  color:#14532d!important;
  font-weight:800!important;
  border-bottom:1px solid #bbf7d0!important;
}
body.security-logs-page .table-responsive,
.security-logs-wrapper{
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch!important;
  border-radius:14px!important;
  border:1px solid #e5e7eb!important;
  background:#fff!important;
}

@media(max-width:900px){
  body.drawer-open .content,
  body:not(.drawer-open) .content{
    margin-left:0!important;
    width:100%!important;
  }
  body.drawer-open .modern-topbar{width:auto!important;}
  .top-menu-btn{
    left:8px!important;
    right:auto!important;
    top:14px!important;
  }
  .modern-topbar{padding-left:52px!important;}
}

@media(max-width:600px){
  body.security-logs-page .table th,
  body.security-logs-page .table td,
  .security-logs-table th,
  .security-logs-table td,
  #securityLogsTable th,
  #securityLogsTable td{
    font-size:.78rem!important;
    padding:.45rem!important;
    min-width:110px!important;
  }
}


/* Correctif demandé : un seul bouton de menu, uniquement la flèche à gauche */
.mobile-menu-open-btn,
#mobileMenuOpenBtn,
.sidebar-close-btn,
#sidebarCloseBtn{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}
.top-menu-btn,
#topMenuBtn{
  left:10px!important;
  right:auto!important;
}
@media(max-width:900px){
  .top-menu-btn,
  #topMenuBtn{
    left:8px!important;
    right:auto!important;
  }
}
