/* Menu lateral padrao do Dashboard para todas as abas/sub-abas. */
:root{
  --caio-dashboard-sidebar-width:248px;
  --caio-dashboard-sidebar-bg-1:rgba(4,17,22,.96);
  --caio-dashboard-sidebar-bg-2:rgba(2,9,12,.98);
  --caio-dashboard-sidebar-text:#f4fff8;
  --caio-dashboard-sidebar-muted:rgba(225,244,236,.68);
  --caio-dashboard-sidebar-border:rgba(131,255,206,.14);
  --caio-dashboard-menu-text:rgba(239,252,246,.84);
  --caio-dashboard-menu-hover:rgba(255,255,255,.055);
  --caio-dashboard-menu-active:linear-gradient(135deg,rgba(17,233,130,.26),rgba(17,233,130,.10));
}

/* Primeira pintura do menu compacto: usa o estado lido no inicio do <head>. */
@media(min-width:901px){
  html.caio-sidebar-collapsed body.caio-emerald-ui{
    --caio-dashboard-sidebar-width:64px !important;
    --docs-sidebar-width:64px !important;
  }

  html.caio-sidebar-collapsed body.caio-emerald-ui #appShell,
  html.caio-sidebar-collapsed body.caio-emerald-ui #appShell.hidden,
  html.caio-sidebar-collapsed body.caio-emerald-ui #appShell.app-shell,
  html.caio-sidebar-collapsed body.caio-emerald-ui #appShell.radar-shell{
    grid-template-columns:64px minmax(0,1fr) !important;
  }

  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar,
  html.caio-sidebar-collapsed body.caio-emerald-ui aside.sidebar{
    width:64px !important;
    min-width:64px !important;
    max-width:64px !important;
    flex:0 0 64px !important;
    padding-left:6px !important;
    padding-right:6px !important;
    overflow-x:hidden !important;
  }

  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .grouped-nav,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .nav{
    padding-left:0 !important;
    padding-right:0 !important;
    align-items:center !important;
  }

  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .nav-item,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .nav-subitem,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .menu-group-toggle,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar a[data-page],
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar button[data-page]{
    width:42px !important;
    min-width:42px !important;
    max-width:42px !important;
    height:38px !important;
    min-height:38px !important;
    margin-left:auto !important;
    margin-right:auto !important;
    padding:0 !important;
    justify-content:center !important;
    gap:0 !important;
    font-size:0 !important;
    overflow:hidden !important;
    white-space:nowrap !important;
  }

  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .caio-menu-label,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .menu-text,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .menu-title-safe,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .menu-chevron,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .menu-group-items,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .sidebar-label,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .user-info,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .logout-button,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar-foot{
    display:none !important;
  }

  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar-logo,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .brand-mini,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .brand-logo-shell{
    width:52px !important;
    min-width:52px !important;
    max-width:52px !important;
    height:76px !important;
    min-height:76px !important;
    overflow:hidden !important;
  }

  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar-logo img,
  html.caio-sidebar-collapsed body.caio-emerald-ui .sidebar .brand-logo{
    width:50px !important;
    min-width:0 !important;
    max-width:50px !important;
    max-height:58px !important;
    object-fit:contain !important;
    filter:none !important;
  }
}

@media(min-width:901px){
  html body.caio-emerald-ui #appShell,
  html body.caio-emerald-ui #appShell.app-shell,
  html body.caio-emerald-ui #appShell.radar-shell,
  html body.caio-emerald-ui .app-shell,
  html body.caio-emerald-ui .radar-shell{
    grid-template-columns:var(--caio-dashboard-sidebar-width) minmax(0,1fr) !important;
  }
}

html body.caio-emerald-ui .sidebar,
html body.caio-emerald-ui aside.sidebar{
  box-sizing:border-box !important;
  width:var(--caio-dashboard-sidebar-width) !important;
  min-width:var(--caio-dashboard-sidebar-width) !important;
  max-width:var(--caio-dashboard-sidebar-width) !important;
  flex:0 0 var(--caio-dashboard-sidebar-width) !important;
  padding:18px 12px !important;
  background:linear-gradient(180deg,var(--caio-dashboard-sidebar-bg-1),var(--caio-dashboard-sidebar-bg-2)) !important;
  background-image:linear-gradient(180deg,var(--caio-dashboard-sidebar-bg-1),var(--caio-dashboard-sidebar-bg-2)) !important;
  background-color:rgba(2,9,12,.98) !important;
  border-right:1px solid var(--caio-dashboard-sidebar-border) !important;
  box-shadow:20px 0 52px rgba(0,0,0,.32) !important;
  color:var(--caio-dashboard-sidebar-text) !important;
}

html body.caio-emerald-ui .sidebar-top,
html body.caio-emerald-ui .sidebar-logo,
html body.caio-emerald-ui .sidebar .brand,
html body.caio-emerald-ui .sidebar .brand-mini,
html body.caio-emerald-ui .sidebar .brand-logo-shell{
  background:transparent !important;
  background-image:none !important;
  border:0 !important;
  box-shadow:none !important;
}

html body.caio-emerald-ui .sidebar-logo,
html body.caio-emerald-ui .sidebar .brand-mini,
html body.caio-emerald-ui .sidebar .brand-logo-shell{
  height:92px !important;
  min-height:92px !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:0 !important;
  overflow:visible !important;
}

html body.caio-emerald-ui .sidebar-logo img,
html body.caio-emerald-ui .sidebar .brand-logo{
  width:196px !important;
  max-width:196px !important;
  max-height:78px !important;
  height:auto !important;
  object-fit:contain !important;
  display:block !important;
  filter:drop-shadow(0 12px 24px rgba(0,0,0,.24)) !important;
}

html body.caio-emerald-ui .sidebar .grouped-nav,
html body.caio-emerald-ui .sidebar .nav,
html body.caio-emerald-ui .sidebar-nav{
  flex:1 1 auto !important;
  display:flex !important;
  flex-direction:column !important;
  width:100% !important;
  min-height:0 !important;
  gap:6px !important;
  padding:8px 0 14px !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  background:transparent !important;
}

html body.caio-emerald-ui .sidebar .nav-item,
html body.caio-emerald-ui .sidebar .nav-subitem,
html body.caio-emerald-ui .sidebar .menu-group-toggle,
html body.caio-emerald-ui .sidebar a[data-page],
html body.caio-emerald-ui .sidebar button[data-page]{
  box-sizing:border-box !important;
  min-height:42px !important;
  height:auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:10px !important;
  width:100% !important;
  max-width:100% !important;
  padding:10px 12px !important;
  border-radius:8px !important;
  border:1px solid transparent !important;
  background:transparent !important;
  background-image:none !important;
  box-shadow:none !important;
  color:var(--caio-dashboard-menu-text) !important;
  -webkit-text-fill-color:var(--caio-dashboard-menu-text) !important;
  font-size:14px !important;
  font-weight:650 !important;
  line-height:1.2 !important;
  letter-spacing:0 !important;
  text-align:left !important;
  text-decoration:none !important;
  white-space:normal !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

html body.caio-emerald-ui .sidebar .nav-item:hover,
html body.caio-emerald-ui .sidebar .nav-subitem:hover,
html body.caio-emerald-ui .sidebar .menu-group-toggle:hover,
html body.caio-emerald-ui .sidebar a[data-page]:hover,
html body.caio-emerald-ui .sidebar button[data-page]:hover{
  transform:translateX(2px) !important;
  background:var(--caio-dashboard-menu-hover) !important;
  background-image:none !important;
  border-color:rgba(130,255,205,.14) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

html body.caio-emerald-ui .sidebar .nav-item.active,
html body.caio-emerald-ui .sidebar .nav-subitem.active,
html body.caio-emerald-ui .sidebar [data-page].active:not(.menu-group-toggle),
html body.caio-emerald-ui .sidebar [aria-current="page"],
html body.caio-emerald-ui .sidebar .menu-group:has(.nav-subitem.active) > .menu-group-toggle,
html body.caio-emerald-ui .sidebar .submenu .active,
html body.caio-emerald-ui .sidebar .menu-dropdown .active,
html body.caio-emerald-ui .sidebar .group-content .active,
html body.caio-emerald-ui .sidebar .menu-children .active,
html body.caio-emerald-ui .sidebar .accordion-content .active{
  background:var(--caio-dashboard-menu-active) !important;
  background-image:var(--caio-dashboard-menu-active) !important;
  border-color:rgba(17,233,130,.34) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  box-shadow:0 0 0 1px rgba(17,233,130,.06),0 14px 34px rgba(17,233,130,.12) !important;
}

html body.caio-emerald-ui .sidebar .nav-item::before,
html body.caio-emerald-ui .sidebar .nav-item::after,
html body.caio-emerald-ui .sidebar .nav-subitem::before,
html body.caio-emerald-ui .sidebar .nav-subitem::after,
html body.caio-emerald-ui .sidebar .menu-group-toggle::before,
html body.caio-emerald-ui .sidebar .menu-group-toggle::after,
html body.caio-emerald-ui .sidebar .menu-group::before,
html body.caio-emerald-ui .sidebar .menu-group::after{
  content:none !important;
  display:none !important;
}

html body.caio-emerald-ui .sidebar .menu-group,
html body.caio-emerald-ui .sidebar .accordion,
html body.caio-emerald-ui .sidebar .nav-group{
  box-sizing:border-box !important;
  width:100% !important;
  max-width:100% !important;
  display:block !important;
  margin:0 !important;
  padding:0 !important;
  border-radius:16px !important;
  background:rgba(255,255,255,.045) !important;
  background-image:none !important;
  border:1px solid rgba(255,255,255,.065) !important;
  box-shadow:none !important;
  overflow:hidden !important;
}

html body.caio-emerald-ui .sidebar .menu-group.open{
  background:rgba(255,255,255,.055) !important;
  border-color:rgba(118,220,151,.12) !important;
}

html body.caio-emerald-ui .sidebar .submenu,
html body.caio-emerald-ui .sidebar .menu-group-items,
html body.caio-emerald-ui .sidebar .menu-dropdown,
html body.caio-emerald-ui .sidebar .group-content,
html body.caio-emerald-ui .sidebar .menu-children,
html body.caio-emerald-ui .sidebar .accordion-content{
  gap:4px !important;
  padding:4px 7px 8px !important;
  margin:0 !important;
  background:transparent !important;
  background-image:none !important;
  border:0 !important;
  box-shadow:none !important;
}

html body.caio-emerald-ui .sidebar .menu-group.open .menu-group-items{
  display:flex !important;
  flex-direction:column !important;
  visibility:visible !important;
  opacity:1 !important;
  pointer-events:auto !important;
}

html body.caio-emerald-ui .sidebar .menu-group:not(.open) .menu-group-items,
html body.caio-emerald-ui .sidebar .menu-group-items[hidden]{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}

html body.caio-emerald-ui .sidebar span,
html body.caio-emerald-ui .sidebar strong,
html body.caio-emerald-ui .sidebar a,
html body.caio-emerald-ui .sidebar button{
  color:inherit !important;
  -webkit-text-fill-color:inherit !important;
}

html body.caio-emerald-ui .sidebar small{
  color:var(--caio-dashboard-sidebar-muted) !important;
  -webkit-text-fill-color:var(--caio-dashboard-sidebar-muted) !important;
}

html body.caio-emerald-ui .sidebar .caio-menu-label,
html body.caio-emerald-ui .sidebar .menu-title-safe{
  flex:1 1 auto !important;
  min-width:0 !important;
  max-width:100% !important;
  width:auto !important;
  display:block !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:normal !important;
}

html body.caio-emerald-ui .sidebar .menu-chevron{
  margin-left:auto !important;
  flex:0 0 auto !important;
  color:rgba(236,255,241,.84) !important;
  -webkit-text-fill-color:rgba(236,255,241,.84) !important;
}

html body.caio-emerald-ui .sidebar-foot{
  flex:0 0 auto !important;
  margin-top:auto !important;
  padding:14px 0 0 !important;
  border-top:1px solid rgba(148,255,207,.12) !important;
  background:transparent !important;
  box-shadow:none !important;
}

html body.caio-emerald-ui .sidebar .user-card,
html body.caio-emerald-ui .sidebar-user{
  margin:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
  width:100% !important;
  box-sizing:border-box !important;
  border-radius:8px !important;
  padding:14px !important;
  display:flex !important;
  flex-direction:column !important;
  gap:10px !important;
  background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.03)) !important;
  background-image:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.03)) !important;
  border:1px solid rgba(148,255,207,.14) !important;
  box-shadow:0 18px 48px rgba(0,0,0,.34) !important;
  color:var(--caio-dashboard-sidebar-text) !important;
}

html body.caio-emerald-ui .sidebar-user-row,
html body.caio-emerald-ui .user-chip{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  min-width:0 !important;
}

html body.caio-emerald-ui .sidebar-user-avatar,
html body.caio-emerald-ui .user-chip > span{
  width:34px !important;
  height:34px !important;
  min-width:34px !important;
  border-radius:999px !important;
  display:grid !important;
  place-items:center !important;
  background:linear-gradient(135deg,#21d66f,#13a855) !important;
  background-image:linear-gradient(135deg,#21d66f,#13a855) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  font-size:12px !important;
  font-weight:900 !important;
}

html body.caio-emerald-ui .sidebar .logout-btn,
html body.caio-emerald-ui .sidebar .sidebar-logout-btn,
html body.caio-emerald-ui .sidebar .btn-soft,
html body.caio-emerald-ui .sidebar .btn-full{
  height:40px !important;
  min-height:40px !important;
  border-radius:8px !important;
  background:rgba(255,255,255,.025) !important;
  background-image:none !important;
  border:1px solid rgba(148,255,207,.22) !important;
  color:var(--caio-dashboard-sidebar-text) !important;
  -webkit-text-fill-color:var(--caio-dashboard-sidebar-text) !important;
  box-shadow:none !important;
  font-weight:800 !important;
}

@media(max-width:900px){
  html body.caio-emerald-ui #appShell,
  html body.caio-emerald-ui #appShell.app-shell,
  html body.caio-emerald-ui #appShell.radar-shell,
  html body.caio-emerald-ui .app-shell,
  html body.caio-emerald-ui .radar-shell{
    grid-template-columns:minmax(0,1fr) !important;
  }

  html body.caio-emerald-ui .sidebar{
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    position:relative !important;
    min-height:auto !important;
  }
}

/* RADAR/Mocoes/Requerimentos final shell lock: every sidebar track uses the same dashboard width. */
@media(min-width:901px){
  html body.caio-emerald-ui #appShell.hidden,
  html body.caio-emerald-ui #appShell.app-shell.hidden,
  html body.caio-emerald-ui #appShell.radar-shell.hidden,
  html body.caio-emerald-ui.mocoes-page-body #appShell,
  html body.caio-emerald-ui.requerimentos-page-body #appShell,
  html body.caio-emerald-ui.radar-page #appShell{
    grid-template-columns:var(--caio-dashboard-sidebar-width) minmax(0,1fr) !important;
  }

  html body.caio-emerald-ui.mocoes-page-body,
  html body.caio-emerald-ui.requerimentos-page-body{
    --docs-sidebar-width:var(--caio-dashboard-sidebar-width) !important;
  }
}

/* Final width/color lock: all pages and submenus must use the Dashboard sidebar contract. */
@media(min-width:901px){
  html body.caio-emerald-ui,
  html body.caio-emerald-ui.mocoes-page-body,
  html body.caio-emerald-ui.requerimentos-page-body,
  html body.caio-emerald-ui.radar-page{
    --caio-dashboard-sidebar-width:248px !important;
    --docs-sidebar-width:248px !important;
  }

  html body.caio-emerald-ui #appShell,
  html body.caio-emerald-ui #appShell.hidden,
  html body.caio-emerald-ui #appShell.app-shell,
  html body.caio-emerald-ui #appShell.app-shell.hidden,
  html body.caio-emerald-ui #appShell.radar-shell,
  html body.caio-emerald-ui #appShell.radar-shell.hidden,
  html body.caio-emerald-ui .app-shell,
  html body.caio-emerald-ui .radar-shell,
  html body.caio-emerald-ui.mocoes-page-body #appShell.app-shell,
  html body.caio-emerald-ui.requerimentos-page-body #appShell.app-shell,
  html body.caio-emerald-ui.radar-page #appShell.radar-shell{
    grid-template-columns:248px minmax(0,1fr) !important;
  }

  html body.caio-emerald-ui .sidebar,
  html body.caio-emerald-ui aside.sidebar,
  html body.caio-emerald-ui.mocoes-page-body .sidebar,
  html body.caio-emerald-ui.requerimentos-page-body .sidebar,
  html body.caio-emerald-ui.radar-page .sidebar{
    width:248px !important;
    min-width:248px !important;
    max-width:248px !important;
    flex:0 0 248px !important;
    box-sizing:border-box !important;
    background:linear-gradient(180deg,var(--caio-dashboard-sidebar-bg-1),var(--caio-dashboard-sidebar-bg-2)) !important;
    background-image:linear-gradient(180deg,var(--caio-dashboard-sidebar-bg-1),var(--caio-dashboard-sidebar-bg-2)) !important;
    background-color:rgba(2,9,12,.98) !important;
  }

  html body.caio-emerald-ui .sidebar .grouped-nav,
  html body.caio-emerald-ui .sidebar .nav,
  html body.caio-emerald-ui .sidebar-nav,
  html body.caio-emerald-ui .sidebar .menu-group,
  html body.caio-emerald-ui .sidebar .accordion,
  html body.caio-emerald-ui .sidebar .nav-group,
  html body.caio-emerald-ui .sidebar .nav-item,
  html body.caio-emerald-ui .sidebar .nav-subitem,
  html body.caio-emerald-ui .sidebar .menu-group-toggle,
  html body.caio-emerald-ui .sidebar a[data-page],
  html body.caio-emerald-ui .sidebar button[data-page],
  html body.caio-emerald-ui .sidebar .submenu,
  html body.caio-emerald-ui .sidebar .menu-group-items,
  html body.caio-emerald-ui .sidebar .menu-dropdown,
  html body.caio-emerald-ui .sidebar .group-content,
  html body.caio-emerald-ui .sidebar .menu-children,
  html body.caio-emerald-ui .sidebar .accordion-content,
  html body.caio-emerald-ui .sidebar .user-card,
  html body.caio-emerald-ui .sidebar-user{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }
}
