/* Valenzo Admin navigation hierarchy and reference rail — v274 */

/* Desktop and tablet share the same fixed management rail. */
body.admin-modern-active .admin-sidebar {
  position: relative;
  isolation: isolate;
  color-scheme: dark;
}

body.admin-modern-active .admin-sidebar::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 150px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent);
  pointer-events: none;
}

body.admin-modern-active .admin-brand {
  display: flex;
  align-items: center;
  border-color: rgba(148, 163, 184, .14) !important;
}

body.admin-modern-active .admin-brand > span {
  flex: 0 0 56px;
  overflow: hidden;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none;
}

body.admin-modern-active .admin-brand img {
  width: 100%;
  height: 100%;
  display: block;
}

body.admin-modern-active .admin-brand > div {
  min-width: 0;
}

body.admin-modern-active .admin-brand b {
  max-width: 180px;
  overflow: hidden;
  /* Do not rely on transparent WebKit text fill for the brand: older theme
     layers can keep that inherited value after a live theme switch. */
  -webkit-text-fill-color: #e8c36a !important;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}


body.admin-modern-active .admin-brand > div::after {
  display: block;
  max-width: 180px;
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The grouped navigation already carries the section identity; suppress the
   legacy repeated "Valenzo Admin" label between the brand and first group. */
body.admin-modern-active .admin-sidebar-label {
  display: none;
}

body.admin-modern-active .admin-sidebar-label::after {
  content: none !important;
}

body.admin-modern-active .admin-sidebar nav {
  min-height: 0;
  display: block;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

body.admin-modern-active .admin-sidebar nav::-webkit-scrollbar {
  width: 5px;
}

body.admin-modern-active .admin-sidebar nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #294866;
}


body.admin-modern-active .admin-nav-group-title {
  line-height: 1.2;
  text-transform: uppercase;
}

body.admin-modern-active .admin-nav-items {
  display: grid;
}

body.admin-modern-active .admin-sidebar nav button {
  width: 100%;
  display: flex;
  align-items: center;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body.admin-modern-active .admin-sidebar nav button i {
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 0 !important;
  border-radius: 8px;
  background: transparent !important;
  font-style: normal;
  line-height: 1;
}

body.admin-modern-active .admin-sidebar nav button > span {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.admin-modern-active .admin-sidebar nav button::after {
  width: 14px;
  flex: 0 0 14px;
  content: "\203A";
  font-family: Arial, sans-serif;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  transform: translateY(-1px);
  transition: color .16s ease, transform .16s ease;
}

@media (hover: hover) {
  body.admin-modern-active .admin-sidebar nav button:hover:not(.active) {
    color: #fff !important;
  }

  body.admin-modern-active .admin-sidebar nav button:hover::after {
    color: #fff;
    transform: translate(2px, -1px);
  }
}


body.admin-modern-active .admin-sidebar nav button.active i,
html[data-valenzo-theme="light"] body.admin-modern-active .admin-sidebar nav button.active i {
  background: transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

body.admin-modern-active .admin-sidebar nav button.active > span {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}



body.admin-modern-active .admin-sidebar-bottom {
  margin-top: auto;
  border-color: rgba(148, 163, 184, .14) !important;
}

body.admin-modern-active .admin-sidebar-bottom button {
  width: 100%;
  border: 1px solid transparent;
  background: transparent !important;
  cursor: pointer;
}

body.admin-modern-active .admin-sidebar-bottom button i {
  border: 0 !important;
}


@media (hover: hover) {
  body.admin-modern-active .admin-sidebar-bottom button:hover {
    color: #fff !important;
  }
}

/* The workspace theme changes the canvas, never the dark identity rail. */
html[data-valenzo-theme-surface="admin"][data-valenzo-theme="light"] body.admin-modern-active .admin-sidebar {
  border-color: #18314b !important;
}

html[data-valenzo-theme-surface="admin"][data-valenzo-theme="light"] body.admin-modern-active .admin-sidebar :is(.admin-brand small), html[data-valenzo-theme-surface="admin"][data-valenzo-theme="light"] body.admin-modern-active .admin-sidebar :is(.admin-nav-group-title):not(vzb612) {
  color: #9fb0c4 !important;
}



html[data-valenzo-theme-surface="admin"][data-valenzo-theme="light"] body.admin-modern-active .admin-sidebar nav button:not(.active) i {
  background: transparent !important;
}


html[data-valenzo-theme-surface="admin"][data-valenzo-theme="light"] body.admin-modern-active .admin-sidebar nav button.active i {
  background: transparent !important;
}

/* On short desktop screens the rail remains vertical and independently
   scrollable, preserving every destination and the account controls. */
@media (min-width: 700px) and (max-height: 760px) {
  body.admin-modern-active .admin-brand {
    padding-bottom: 9px;
  }


  body.admin-modern-active .admin-sidebar nav {
    padding-top: 7px;
  }



}

/* Mobile keeps the proven, accessible horizontal navigation pattern. */
@media (max-width: 699px) {
  body.admin-modern-active .admin-modern-shell {
    grid-template-columns: 1fr;
  }


  body.admin-modern-active .admin-brand,
  body.admin-modern-active .admin-sidebar-label,
  body.admin-modern-active .admin-sidebar-bottom {
    display: none;
  }

  body.admin-modern-active .admin-sidebar nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: 1px;
    scroll-snap-type: inline proximity;
    scrollbar-width: thin;
    touch-action: pan-x;
  }

  body.admin-modern-active .admin-nav-group {
    display: contents;
  }

  body.admin-modern-active .admin-nav-group-title {
    display: none;
  }

  body.admin-modern-active .admin-nav-items {
    display: contents;
  }

  body.admin-modern-active .admin-sidebar nav button {
    width: auto;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }


  body.admin-modern-active .admin-sidebar nav button::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.admin-modern-active .admin-sidebar *,
  body.admin-modern-active .admin-sidebar *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  body.admin-modern-active .admin-sidebar,
  html[data-valenzo-theme-surface="admin"] body.admin-modern-active .admin-sidebar {
    border-color: CanvasText !important;
    background: Canvas !important;
    color: CanvasText !important;
    box-shadow: none;
    forced-color-adjust: auto;
  }

  body.admin-modern-active .admin-brand b {
    background: none;
  }

  body.admin-modern-active .admin-sidebar :is(.admin-brand small, .admin-nav-group-title, nav button, nav button i, .admin-sidebar-bottom button) {
    color: CanvasText !important;
  }

  body.admin-modern-active .admin-sidebar :is(.admin-brand > div, nav button)::after {
    color: CanvasText !important;
  }


  body.admin-modern-active .admin-sidebar nav button.active :is(i), body.admin-modern-active .admin-sidebar nav button.active :is(span), body.admin-modern-active .admin-sidebar nav button.active::after {
    color: HighlightText !important;
  }
}
