.app-sidebar .theme-nav-parent {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-sidebar .theme-nav-parent::-webkit-details-marker { display: none; }
.app-sidebar .theme-nav-parent::after {
  content: "";
  width: .45rem;
  height: .45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-inline: .75rem .25rem;
}
.app-sidebar details[open] > .theme-nav-parent::after { transform: rotate(45deg); }
.app-sidebar .theme-nav-parent:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: -2px; }
.app-sidebar .theme-nav-branch:not([open]) > .nav { display: none; }

.app-sidebar .theme-nav-section:not([open]) > .theme-nav-section-content { display: none; }
.app-sidebar .theme-nav-section > summary { min-height: 36px; margin-block: .25rem; }

/* Indent every submenu level clearly beneath its parent. */
.app-sidebar .theme-nav-section-content,
.app-sidebar .theme-nav-branch > .nav {
  margin-inline-start: 1rem !important;
}

/* Staff profile controls remain available in either display mode. */
.admin-profile-menu { position: fixed; bottom: max(.75rem, env(safe-area-inset-bottom)); left: max(.75rem, env(safe-area-inset-left)); z-index: 1035; }
.admin-profile-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 2px; border: 1px solid var(--tblr-border-color); border-radius: 50%; color: var(--tblr-body-color); background: var(--tblr-bg-surface); cursor: pointer; }
.admin-profile-toggle:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 2px; }
.admin-profile-menu .dropdown-menu { min-width: 210px; }
.admin-profile-menu form { margin: 0; }
.admin-profile-menu .dropdown-item { min-height: 44px; }
.admin-profile-menu .dropdown-item[name="domain"] { padding-inline-start: calc(var(--tblr-dropdown-item-padding-x) + 1ch); }

/* Parent text navigates; the adjacent disclosure area controls its children. */
.app-sidebar .theme-nav-branch > summary { padding: 0; }
.app-sidebar .theme-nav-branch > summary > a { flex: 1; min-width: 0; margin: 0; }
.app-sidebar .theme-nav-branch > summary::after { margin-inline: .75rem; flex-shrink: 0; }
.app-sidebar .theme-nav-heading { display: flex; align-items: stretch; }
.app-sidebar .theme-nav-heading-link { flex: 1; min-width: 0; margin: 0; }
.app-sidebar .theme-nav-heading > .accordion-button { width: 44px; flex: 0 0 44px; justify-content: center; padding-inline: .5rem; }
.app-sidebar .theme-nav-heading > .accordion-button .accordion-button-toggle { margin: 0; }

/* Keep menu labels readable; narrow screens scroll the management table. */
.menu-maintenance-table { min-width: 48rem; table-layout: auto; }
.menu-maintenance-table th, .menu-maintenance-table td { overflow-wrap: normal; word-break: normal; }
.menu-maintenance-table th:first-child, .menu-maintenance-table td:first-child { min-width: 14rem; }
.menu-maintenance-table th:nth-child(2), .menu-maintenance-table td:nth-child(2) { min-width: 12rem; }

/* Keep the current display name aligned with the profile picture. */
.admin-profile-menu { display: flex; align-items: center; gap: .5rem; max-width: calc(100vw - 2rem); }
.admin-profile-toggle { flex: 0 0 44px; }
.admin-profile-name { min-width: 0; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 992px) {
  .admin-profile-name { max-width: calc(var(--sm-sidebar-width, 14rem) - 5rem); }
}
@media (max-width: 991.98px) {
  html[data-ui-theme="administration"] .app-shell .footer { padding-left: calc(68px + 8rem + .5rem); }
}

.tenant-user-toggle { display: flex; align-items: center; gap: .5rem; padding: 2px; border: 0; border-radius: .25rem; color: inherit; background: transparent; cursor: pointer; min-height: 44px; }
.tenant-user-toggle:focus-visible { outline: 2px solid var(--tblr-primary); outline-offset: 2px; }
.tenant-user-name { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-user-menu form { margin: 0; }
.tenant-user-menu .dropdown-item { min-height: 44px; }
@media (max-width: 575.98px) { .tenant-user-name { display: none; } }

.menu-tree-label { display: inline-block; }
