/* ===== STANDARD ROSSI-SENDON CONSTRUCTION GROUP SIDEBAR V10.9.1 =====
   This mirrors the Operations sidebar:
   gradient #0b1b30 -> #102945
   desktop width 250px
   24px 18px padding
   12px-radius navigation buttons
*/

:root{
  --rossi-sidebar-top:#0b1b30;
  --rossi-sidebar-bottom:#102945;
  --rossi-sidebar-link:#b9cce2;
  --rossi-sidebar-active:rgba(80,170,255,.15);
  --rossi-sidebar-muted:#a9c6e5;
}

/* Same shell/sidebar dimensions and color across standalone pages. */
body[data-required-permission="gallery"] .rossi-gallery-system-sidebar,
body[data-required-permission="marketing"] .sidebar,
body[data-required-permission="accounting"] .sidebar{
  box-sizing:border-box!important;
  width:250px!important;
  min-width:250px!important;
  background:linear-gradient(180deg,var(--rossi-sidebar-top),var(--rossi-sidebar-bottom))!important;
  color:#fff!important;
  padding:24px 18px!important;
  display:flex!important;
  flex-direction:column!important;
  gap:28px!important;
  overflow-y:auto!important;
}

/* Gallery needs a fixed column because its original page did not use app-shell. */
body[data-required-permission="gallery"] .rossi-gallery-system-sidebar{
  position:fixed!important;
  inset:0 auto 0 0!important;
  z-index:80!important;
  box-shadow:none!important;
}

/* Exact logo treatment used on Operations. */
.rossi-standard-sidebar-brand,
body[data-required-permission="marketing"] .sidebar-brand,
body[data-required-permission="accounting"] .sidebar-brand{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:5px!important;
  overflow:hidden!important;
  min-width:0!important;
  padding:4px 6px 14px!important;
}
.rossi-standard-sidebar-brand .brand-logo,
body[data-required-permission="marketing"] .sidebar-logo,
body[data-required-permission="accounting"] .sidebar-logo{
  display:block!important;
  width:100%!important;
  max-width:190px!important;
  height:auto!important;
  max-height:92px!important;
  object-fit:contain!important;
  object-position:left center!important;
  background:transparent!important;
  border-radius:0!important;
  box-shadow:none!important;
  flex:0 0 auto!important;
}
.rossi-standard-sidebar-brand .brand-sub,
body[data-required-permission="marketing"] .sidebar-brand-sub,
body[data-required-permission="accounting"] .sidebar-brand-sub{
  margin-left:2px!important;
  margin-top:2px!important;
  color:var(--rossi-sidebar-muted)!important;
  font-size:12px!important;
}

/* Main permitted-page menu: same look as Operations nav buttons. */
.rossi-global-nav-host{
  margin:0!important;
}
.rossi-global-nav-title{
  display:none!important;
}
.rossi-global-nav-list{
  display:flex!important;
  flex-direction:column!important;
  gap:0!important;
}
.rossi-global-link{
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  min-height:0!important;
  border:0!important;
  background:transparent!important;
  color:var(--rossi-sidebar-link)!important;
  text-align:left!important;
  padding:12px 14px!important;
  border-radius:12px!important;
  font-size:14px!important;
  font-weight:650!important;
  line-height:1.2!important;
  text-decoration:none!important;
  white-space:normal!important;
}
.rossi-global-link:hover{
  background:rgba(255,255,255,.06)!important;
  color:#fff!important;
}
.rossi-global-link.active{
  background:var(--rossi-sidebar-active)!important;
  color:#fff!important;
}

/* Local page-specific tools use the same visual language too. */
body[data-required-permission="marketing"] .sidebar nav,
body[data-required-permission="accounting"] .sidebar nav{
  display:flex!important;
  flex-direction:column!important;
  gap:0!important;
}
body[data-required-permission="marketing"] .sidebar .side-btn,
body[data-required-permission="accounting"] .sidebar .side-btn{
  box-sizing:border-box!important;
  width:100%!important;
  border:0!important;
  background:transparent!important;
  color:var(--rossi-sidebar-link)!important;
  text-align:left!important;
  padding:12px 14px!important;
  border-radius:12px!important;
  font-size:14px!important;
  font-weight:650!important;
  text-decoration:none!important;
}
body[data-required-permission="marketing"] .sidebar .side-btn.active,
body[data-required-permission="accounting"] .sidebar .side-btn.active{
  background:var(--rossi-sidebar-active)!important;
  color:#fff!important;
}

.rossi-sidebar-divider{
  height:1px!important;
  margin:-14px 6px -14px!important;
  background:rgba(255,255,255,.10)!important;
}

body[data-required-permission="marketing"] .sidebar-bottom,
body[data-required-permission="accounting"] .sidebar-bottom,
.rossi-gallery-sidebar-bottom{
  margin-top:auto!important;
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  padding:0!important;
  border:0!important;
}

.rossi-sidebar-logout-btn{
  border:0!important;
  background:transparent!important;
  color:var(--rossi-sidebar-link)!important;
  padding:8px!important;
  font:inherit!important;
  font-size:12px!important;
  font-weight:750!important;
  text-align:left!important;
  cursor:pointer!important;
}
.rossi-sidebar-logout-btn:hover{
  color:#fff!important;
  background:rgba(255,255,255,.06)!important;
}

/* Gallery content lines up with the same 250px desktop sidebar. */
body[data-required-permission="gallery"] > .topbar,
body[data-required-permission="gallery"] > .shell{
  margin-left:250px!important;
  box-sizing:border-box!important;
}

/* The sidebar itself replaces Gallery's old back-to-Operations link. */
.rossi-system-nav-ready body[data-required-permission="gallery"] #operationsLink{
  display:none!important;
}

/* Match Operations responsive behavior. */
@media(max-width:1050px) and (min-width:761px){
  body[data-required-permission="gallery"] .rossi-gallery-system-sidebar,
  body[data-required-permission="marketing"] .sidebar,
  body[data-required-permission="accounting"] .sidebar{
    width:210px!important;
    min-width:210px!important;
  }
  body[data-required-permission="gallery"] > .topbar,
  body[data-required-permission="gallery"] > .shell{
    margin-left:210px!important;
  }
}

@media(max-width:760px){
  body[data-required-permission="gallery"] .rossi-gallery-system-sidebar,
  body[data-required-permission="marketing"] .sidebar,
  body[data-required-permission="accounting"] .sidebar{
    position:static!important;
    inset:auto!important;
    width:100%!important;
    min-width:0!important;
    padding:14px!important;
    gap:12px!important;
    overflow:visible!important;
  }

  body[data-required-permission="gallery"] > .topbar,
  body[data-required-permission="gallery"] > .shell{
    margin-left:0!important;
  }

  .rossi-standard-sidebar-brand,
  body[data-required-permission="marketing"] .sidebar-brand,
  body[data-required-permission="accounting"] .sidebar-brand{
    padding:2px 4px 7px!important;
  }

  .rossi-standard-sidebar-brand .brand-logo,
  body[data-required-permission="marketing"] .sidebar-logo,
  body[data-required-permission="accounting"] .sidebar-logo{
    max-width:155px!important;
    max-height:68px!important;
  }

  .rossi-global-nav-list{
    flex-direction:row!important;
    overflow-x:auto!important;
    gap:3px!important;
    padding-bottom:2px!important;
  }
  .rossi-global-link{
    flex:0 0 auto!important;
    white-space:nowrap!important;
  }

  body[data-required-permission="marketing"] .sidebar nav,
  body[data-required-permission="accounting"] .sidebar nav{
    flex-direction:row!important;
    overflow-x:auto!important;
    gap:3px!important;
  }
  body[data-required-permission="marketing"] .sidebar .side-btn,
  body[data-required-permission="accounting"] .sidebar .side-btn{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    width:auto!important;
  }

  body[data-required-permission="marketing"] .sidebar-bottom,
  body[data-required-permission="accounting"] .sidebar-bottom,
  .rossi-gallery-sidebar-bottom{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    margin-top:2px!important;
    padding-top:10px!important;
    border-top:1px solid rgba(255,255,255,.10)!important;
  }

  .rossi-sidebar-logout-btn,
  body[data-required-permission="marketing"] #logoutBtn,
  body[data-required-permission="accounting"] #logoutBtn{
    flex:0 0 auto!important;
    min-height:38px!important;
    padding:8px 12px!important;
    border-radius:9px!important;
    background:rgba(255,255,255,.06)!important;
  }

  .rossi-sidebar-divider{
    margin:0 2px!important;
  }
}


/* ===== GLOBAL ENGLISH / PORTUGUÊS SWITCH V10.9.3 ===== */
.rossi-global-language-switch{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin:-14px 4px 0;
  padding:4px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:10px;
  background:rgba(255,255,255,.045);
}
.rossi-global-language-switch button{
  min-width:0;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#a9c6e5;
  padding:7px 5px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  font:inherit;
  font-size:8px;
  font-weight:800;
  cursor:pointer;
}
.rossi-global-language-switch button:hover{
  background:rgba(255,255,255,.07);
  color:#fff;
}
.rossi-global-language-switch button.active{
  background:rgba(80,170,255,.18);
  color:#fff;
  box-shadow:inset 0 0 0 1px rgba(100,190,255,.18);
}
.rossi-lang-flag{
  font-size:15px;
  line-height:1;
}

/* Gallery used to have a separate top-right language control.
   Once the global sidebar control is active, hide the duplicate. */
.rossi-global-language-ready body[data-required-permission="gallery"] .language-switcher-prominent{
  display:none!important;
}

@media(max-width:760px){
  .rossi-global-language-switch{
    width:min(330px,100%);
    margin:0;
  }
  .rossi-global-language-switch button{
    min-height:38px;
    font-size:9px;
  }
}

