:root{
  --v5-bg:#0b0c10;
  --v5-panel:#12141a;
  --v5-panel2:#181b22;
  --v5-line:#292d36;
  --v5-text:#f5f5f2;
  --v5-muted:#9da3ae;
  --v5-accent:#e7b96a;
  --v5-cyan:#85d2c5;
  --v5-shell-h:72px;
}

/* Shell applicata solo ai moduli interni. */
body.v5-shell-active{
  padding-top:var(--v5-shell-h)!important;
  background-color:var(--v5-bg)!important;
}
body.v5-shell-active > header{
  top:var(--v5-shell-h)!important;
}

#v4-suitebar,
#v4-suitebar *,
#v4-drawer,
#v4-drawer *{
  box-sizing:border-box;
}

#v4-suitebar{
  position:fixed;
  inset:0 0 auto 0;
  z-index:2147483000;
  width:100%;
  height:var(--v5-shell-h);
  display:flex;
  align-items:center;
  gap:14px;
  padding:0 max(18px,env(safe-area-inset-right)) 0 max(18px,env(safe-area-inset-left));
  color:var(--v5-text);
  background:rgba(11,12,16,.96);
  border-bottom:1px solid var(--v5-line);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:0 12px 32px rgba(0,0,0,.18);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
}

#v4-suitebar a{
  text-decoration:none!important;
}

#v4-suitebar .v4-brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--v5-text)!important;
  flex:0 1 auto;
}
#v4-suitebar .v4-brand img{
  display:block!important;
  width:42px!important;
  height:42px!important;
  min-width:42px!important;
  max-width:42px!important;
  max-height:42px!important;
  object-fit:cover!important;
  border-radius:50%!important;
  border:1px solid rgba(255,255,255,.10)!important;
  margin:0!important;
  padding:0!important;
  position:static!important;
  transform:none!important;
}
#v4-suitebar .v4-brand div{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  line-height:1.15;
}
#v4-suitebar .v4-brand strong{
  display:block;
  color:var(--v5-text)!important;
  font-size:15px!important;
  font-weight:700!important;
  letter-spacing:.01em!important;
  white-space:nowrap;
}
#v4-suitebar .v4-brand small{
  display:block;
  margin-top:3px;
  color:var(--v5-muted)!important;
  font-size:10px!important;
  font-weight:500!important;
  letter-spacing:.08em!important;
  white-space:nowrap;
}
#v4-suitebar .v4-title{
  min-width:0;
  max-width:42vw;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--v5-text)!important;
  font-size:14px!important;
  font-weight:700!important;
}
#v4-suitebar .v4-spacer{flex:1 1 auto;min-width:8px}
#v4-suitebar .v4-home,
#v4-suitebar .v4-menu{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto!important;
  min-width:auto!important;
  min-height:40px;
  margin:0!important;
  padding:0 14px!important;
  border:1px solid var(--v5-line)!important;
  border-radius:11px!important;
  background:var(--v5-panel)!important;
  color:var(--v5-text)!important;
  font:600 13px/1 Inter,system-ui,-apple-system,"Segoe UI",sans-serif!important;
  letter-spacing:0!important;
  text-transform:none!important;
  cursor:pointer;
  box-shadow:none!important;
}
#v4-suitebar .v4-home:hover,
#v4-suitebar .v4-menu:hover{
  background:var(--v5-panel2)!important;
  border-color:#3a3f4a!important;
}
#v4-suitebar .v4-menu::before{
  content:"☰";
  margin-right:7px;
  font-size:15px;
  line-height:1;
}

#v4-drawer{
  position:fixed;
  z-index:2147482999;
  top:calc(var(--v5-shell-h) + 10px);
  right:18px;
  width:min(390px,calc(100vw - 36px));
  max-height:calc(100vh - var(--v5-shell-h) - 28px);
  overflow:auto;
  display:none;
  padding:18px;
  color:var(--v5-text);
  background:#101217;
  border:1px solid var(--v5-line);
  border-radius:18px;
  box-shadow:0 28px 80px rgba(0,0,0,.55);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
}
#v4-drawer.on{display:block}
#v4-drawer .v4-group{
  margin:3px 4px 9px;
  color:var(--v5-accent)!important;
  font-size:10px;
  font-weight:700;
  letter-spacing:.18em;
  text-transform:uppercase;
}
#v4-drawer .v4-links{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
  margin-bottom:17px;
}
#v4-drawer .v4-links:last-child{margin-bottom:0}
#v4-drawer a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:9px 11px;
  border-radius:10px;
  color:var(--v5-muted)!important;
  background:transparent;
  text-decoration:none!important;
  font-size:12px;
  font-weight:600;
  line-height:1.25;
}
#v4-drawer a:hover,
#v4-drawer a:focus-visible{
  background:var(--v5-panel2)!important;
  color:var(--v5-text)!important;
  outline:none;
}

/* Ritocchi leggeri e non distruttivi per mantenere coerenza con la dashboard. */
body.v5-shell-active .card,
body.v5-shell-active .panel,
body.v5-shell-active .box,
body.v5-shell-active .section,
body.v5-shell-active .modal-content{
  border-color:var(--v5-line)!important;
  box-shadow:none!important;
}

@media(max-width:760px){
  :root{--v5-shell-h:64px}
  #v4-suitebar{gap:8px;padding-left:10px;padding-right:10px}
  #v4-suitebar .v4-brand img{
    width:38px!important;height:38px!important;min-width:38px!important;max-width:38px!important;max-height:38px!important
  }
  #v4-suitebar .v4-brand div{display:none}
  #v4-suitebar .v4-title{display:block!important;max-width:calc(100vw - 220px);font-size:12px!important}
  #v4-suitebar .v4-home,
  #v4-suitebar .v4-menu{min-height:38px;padding:0 10px!important;font-size:12px!important}
  #v4-suitebar .v4-menu::before{margin-right:0}
  #v4-suitebar .v4-menu{font-size:0!important}
  #v4-suitebar .v4-menu::before{font-size:17px}
  #v4-drawer{top:calc(var(--v5-shell-h) + 8px);right:10px;width:calc(100vw - 20px);padding:14px}
}

@media(max-width:460px){
  #v4-suitebar .v4-title{display:none!important}
  #v4-suitebar .v4-home{font-size:0!important;width:40px!important;padding:0!important}
  #v4-suitebar .v4-home::before{content:"⌂";font-size:20px}
  #v4-drawer .v4-links{grid-template-columns:1fr}
}
