/* Admin topbar grid — aligns Menu/Logo/Logout like Tech */
body.light.admin .topbar .brand{
  display:grid !important;
  grid-template-columns:90px 1fr auto;
  align-items:center !important;
  justify-items:center;
  padding:0 12px !important;
  column-gap:10px;
  height:120px !important;
}

/* Hide spacer used by old flex layouts */
body.light.admin .topbar .brand .spacer{ display:none !important; }

/* Left button (hamburger/back) */
#btnSidebar, #btnBack{
  grid-column: 1;
  justify-self: start !important;
  height:60px !important;
  min-width:60px !important;
  border-radius:14px !important;
  font-weight:900 !important;
  border:1px solid rgba(0,0,0,.12) !important;
}

/* Make hamburger red like Tech */
#btnSidebar{
  background: var(--techRed) !important;
  color:#fff !important;
  border:1px solid var(--techRed2) !important;
  font-size:24px !important;
  line-height:1 !important;
}
#btnSidebar:hover{ background: var(--techRed2) !important; }

/* Center logo */
.brandMark, .brandImg{
  grid-column: 2;
  justify-self:center !important;
}
.brandImg{
  max-height:92px !important;
  max-width: min(280px, calc(100% - 8px)) !important;
  object-fit:contain !important;
}

/* FIX: su alcune pagine (es. Richieste dipendenti) su mobile il logo può sovrapporsi
   all'area del tasto hamburger rendendolo non cliccabile. */
.brandMark, .brandImg{ pointer-events:none !important; }
#btnSidebar, #btnBack{ position:relative !important; z-index:3 !important; }

/* Logout right */
#btnLogout{
  grid-column: 3;
  justify-self:end !important;
  height:60px !important;
  padding:0 12px !important;
  border-radius:14px !important;
  font-weight:900 !important;
  background:#fff !important;
  border:1px solid var(--techRed2) !important;
  color: var(--techRed2) !important;
}
#btnLogout:hover{ background: rgba(224,0,0,.08) !important; }

/* If a page has only Back + Logo (requests), let grid still work */
body.light.admin .topbar .brand:has(#btnBack):not(:has(#btnLogout)){
  grid-template-columns: 110px 1fr 20px;
}


@media (max-width:520px){
  body.light.admin .topbar .brand{ height:104px !important; min-height:104px !important; }
  .brandImg{ max-height:78px !important; }
  #btnSidebar, #btnBack, #btnLogout{ height:56px !important; }
}
