/* Optional sidebar collapse for the current admin shell. */
html.hub-design-tokens-v1 #appSection .topbar-brand {
  position: relative;
  padding: 12px 52px 8px 14px;
}

html.hub-design-tokens-v1 .hub-sidebar-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hub-color-border);
  border-radius: 7px;
  background: var(--hub-color-surface);
  color: var(--hub-color-text-muted);
  cursor: pointer;
}

html.hub-design-tokens-v1 .hub-sidebar-toggle:hover,
html.hub-design-tokens-v1 .hub-sidebar-toggle:focus-visible {
  color: var(--hub-color-primary);
  border-color: var(--hub-color-primary);
}

html.hub-design-tokens-v1 .hub-sidebar-toggle:focus-visible {
  outline: 2px solid var(--hub-color-primary);
  outline-offset: 2px;
}

/* The same menu stays in the rail: no copied links or alternate permissions.
   Only the overlay animates on hover, so the report width stays unchanged. */
@media (min-width: 1200px) {
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed > .topbar {
    width: 64px;
    flex-basis: 64px;
    overflow: visible;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed > .topbar .topbar-main {
    position: absolute;
    inset: 0 auto 0 0;
    width: 64px;
    max-width: none;
    border-right: 1px solid var(--hub-color-border);
    background: var(--hub-color-surface);
    transition: width 220ms ease, box-shadow 220ms ease;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .hub-sidebar-toggle {
    left: 16px;
    right: auto;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .topbar-brand {
    min-height: 52px;
    padding: 12px 10px 8px 58px;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .topbar-nav-panel {
    scrollbar-width: thin;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .nav-dropdown-toggle {
    height: 18px;
    overflow: hidden;
    white-space: nowrap;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .hub-sidebar-account {
    grid-template-columns: minmax(28px, 1fr) 30px 30px;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .hub-corporate-logo,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .menu-link-copy,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .nav-btn-copy,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .hub-command-button > span,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .hub-command-button > kbd,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .hub-sidebar-user-copy,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .hub-sidebar-account .topbar-icon-btn {
    opacity: 1;
    transition: opacity 150ms ease 60ms;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .hub-corporate-logo,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .menu-link-copy,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .nav-btn-copy,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .hub-command-button > span,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .hub-command-button > kbd,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .hub-sidebar-user-copy,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .hub-sidebar-account .topbar-icon-btn {
    opacity: 0;
    pointer-events: none;
    transition-delay: 0ms;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed:not(.is-sidebar-peeking) .nav-dropdown-toggle {
    background: linear-gradient(var(--hub-color-border), var(--hub-color-border)) 8px center / 17px 1px no-repeat !important;
  }

  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed.is-sidebar-peeking > .topbar .topbar-main {
    width: 252px;
    box-shadow: var(--hub-shadow-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed > .topbar .topbar-main,
  html.hub-design-tokens-v1 #appSection.is-sidebar-collapsed .topbar-main * {
    transition: none !important;
  }
}
