/* Joomla template-owned native shell. Only the Super User opt-in branch uses it.
   All routine operations still render the untouched legacy shell. */
body.gdb-native-template{min-height:100vh;background:#f4f6fa}
body.gdb-native-template .gdb-app{min-height:100vh;background:#f4f6fa;color:#172033}
body.gdb-native-template .gdb-sidebar{min-height:100vh;min-width:0}
body.gdb-native-template .gdb-native-placeholder{padding:18px 20px;color:#aab3c1;font-size:12px;line-height:1.55}
body.gdb-native-template .gdb-native-placeholder a{display:block;color:#fff;margin-top:10px;text-decoration:underline}
body.gdb-native-template .gdb-native-menu{padding:16px 10px;overflow:auto;min-height:0}
body.gdb-native-template .gdb-native-menu .gdb-nav-item{display:flex;align-items:center;gap:11px;min-height:42px}
body.gdb-native-template .gdb-native-menu .gdb-nav-item:focus-visible{outline:2px solid #fff;outline-offset:-3px}
body.gdb-native-template .gdb-native-menu .gdb-native-separator{font-size:11px;color:#8f9bad;padding:10px 12px 5px}
body.gdb-native-template .gdb-main{min-width:0}
body.gdb-native-template .gdb-native-toolbar:empty{display:none}
body.gdb-native-template .gdb-native-toolbar{padding:0 28px}
body.gdb-native-template .gdb-workspace{width:100%;min-width:0;max-width:none;padding:24px 28px 36px}
body.gdb-native-template .gdb-workspace > :first-child{margin-top:0}
body.gdb-native-template .gdb-topbar{height:76px}
body.gdb-native-template .gdb-page-title{margin-top:0}
@media(max-width:760px){
  body.gdb-native-template .gdb-workspace{padding:16px}
  body.gdb-native-template .gdb-native-toolbar{padding:0 16px}
  body.gdb-native-template .gdb-topbar{padding:0 16px}
}

/* Every authenticated operator can revert to the old sidebar per session. */
body.gdb-native-template .gdb-native-legacy-link{font-size:12px;font-weight:600;color:#34465e;text-decoration:underline;text-underline-offset:3px;margin-inline:auto 18px;white-space:nowrap}
body.gdb-native-template .gdb-native-legacy-link:focus-visible{outline:2px solid #263b5d;outline-offset:3px}
@media(max-width:760px){body.gdb-native-template .gdb-native-legacy-link{font-size:10px;margin-inline:auto 10px}}

/* The sidebar is a fixed-height CSS grid. Unlike nested flex layouts,
   the minmax(0, 1fr) row always constrains the scrolling navigation.
   The menu keeps standard Joomla links, order and ACL filtering. */
body.gdb-native-template .gdb-sidebar{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:76px minmax(0,1fr) auto;
  height:100vh;
  height:100dvh;
  min-height:0;
  max-height:100vh;
  max-height:100dvh;
  overflow:hidden;
}
body.gdb-native-template .gdb-sidebar .gdb-brand{
  min-width:0;
  min-height:0;
  height:76px;
  box-sizing:border-box;
}
body.gdb-native-template .gdb-sidebar-scroll{
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-height:0;
  min-width:0;
  overflow-x:hidden;
  overflow-y:scroll;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:#798597 #1b222e;
}
body.gdb-native-template .gdb-sidebar-scroll::-webkit-scrollbar{width:9px}
body.gdb-native-template .gdb-sidebar-scroll::-webkit-scrollbar-track{background:#1b222e}
body.gdb-native-template .gdb-sidebar-scroll::-webkit-scrollbar-thumb{background:#798597;border:2px solid #1b222e;border-radius:10px}
body.gdb-native-template .gdb-sidebar-scroll .gdb-native-menu{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  margin:0;
  padding:14px 9px 18px;
  overflow:visible;
  display:flex;
  flex-direction:column;
  flex-wrap:nowrap;
  align-items:stretch;
}
body.gdb-native-template .gdb-sidebar-scroll .gdb-native-menu .gdb-nav-item{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  flex:0 0 auto;
  white-space:normal;
}
body.gdb-native-template .gdb-sidebar-scroll .gdb-nav-icon{flex:0 0 24px}
body.gdb-native-template .gdb-sidebar-scroll .gdb-nav-label{
  flex:1 1 auto;
  min-width:0;
  overflow-wrap:break-word;
}
body.gdb-native-template .gdb-sidebar-more{
  width:100%;
  min-height:37px;
  padding:8px 14px;
  border:0;
  border-top:1px solid rgba(255,255,255,.13);
  background:#202936;
  color:#e4e9f1;
  font-family:inherit;
  font-size:12px;
  font-weight:600;
  line-height:1.25;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
body.gdb-native-template .gdb-sidebar-more[hidden]{display:none}
body.gdb-native-template .gdb-sidebar-more:hover{background:#293546}
body.gdb-native-template .gdb-sidebar-more:focus-visible{outline:2px solid #fff;outline-offset:-3px}


/* Joomla messages live inside the workspace on native Gestionale pages.
   The legacy app.css offsets this container by the sidebar width even
   though .gdb-main already reserves that width. Avoid the second offset. */
body.gdb-native-template .gdb-workspace #system-message-container{
  margin-inline:0;
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}
body.gdb-native-template .gdb-workspace #system-message-container joomla-alert,
body.gdb-native-template .gdb-workspace #system-message-container .alert{
  display:block;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  margin-inline:0;
}
