/* Desktop collapsible sidebar — does not affect the mobile overlay drawer */

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  overflow-x: clip;
}

.hub-app-frame {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

.hub-main-column {
  display: flex;
  min-width: 0;
  flex: 1 1 0%;
  min-height: 100vh;
  flex-direction: column;
}

#hub-desktop-sidebar {
  --hub-sidebar-expanded: 18rem; /* Tailwind w-72 */
  --hub-sidebar-collapsed: 4.25rem; /* 68px */
  width: var(--hub-sidebar-expanded);
  transition: width 0.2s ease;
  overflow: hidden;
}

html.hub-sidebar-collapsed #hub-desktop-sidebar {
  width: var(--hub-sidebar-collapsed);
}

.hub-sidebar-header {
  flex-shrink: 0;
  border-bottom: 1px solid rgb(226 232 240);
  padding: 1.25rem 1.5rem;
}

.hub-sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hub-sidebar-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hub-sidebar-avatar {
  height: 3rem;
  width: 3rem;
  border-radius: 999px;
  transition: width 0.2s ease, height 0.2s ease;
}

.hub-sidebar-cabinet {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: rgb(100 116 139);
  white-space: nowrap;
}

.hub-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem;
  border-radius: 0.75rem;
  color: rgb(51 65 85);
  background: transparent;
}

.hub-sidebar-toggle:hover {
  background: rgb(241 245 249);
}

.hub-sidebar-toggle-label {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.hub-sidebar-toggle-expand,
html.hub-sidebar-collapsed .hub-sidebar-toggle-collapse {
  display: none;
}

html.hub-sidebar-collapsed .hub-sidebar-toggle-expand {
  display: inline-flex;
  align-items: center;
}

#hub-desktop-sidebar .hub-sidebar-toggle {
  display: inline-flex;
}

#mobile-nav-drawer .hub-sidebar-toggle {
  display: none !important;
}

.hub-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.hub-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.5rem;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.hub-nav-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.hub-nav-svg {
  width: 1.25rem;
  height: 1.25rem;
}

.hub-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-nav-chevron {
  margin-left: auto;
  display: inline-flex;
}

.hub-nav-nested {
  margin-top: 0.25rem;
  padding-left: 0.75rem;
}

.hub-sidebar-tooltip {
  position: fixed;
  z-index: 80;
  display: none;
  max-width: 16rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  background: rgb(15 23 42);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 4px 12px rgb(15 23 42 / 0.18);
}

.hub-sidebar-tooltip.is-visible {
  display: block;
}

@media (min-width: 1024px) {
  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-sidebar-header {
    padding: 0.75rem 0.5rem;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-sidebar-header-row {
    flex-direction: column;
    justify-content: flex-start;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-sidebar-avatar {
    height: 2.25rem;
    width: 2.25rem;
    font-size: 0.7rem;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-sidebar-cabinet,
  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-nav-section,
  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-nav-label,
  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-nav-chevron,
  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-sidebar-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-nav-summary {
    display: none;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-sidebar-scroll {
    padding: 0.75rem 0.5rem;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar nav > div,
  html.hub-sidebar-collapsed #hub-desktop-sidebar .space-y-1,
  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-nav-nested,
  html.hub-sidebar-collapsed #hub-desktop-sidebar details {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-nav-item {
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    margin-inline: auto;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  html.hub-sidebar-collapsed #hub-desktop-sidebar .hub-nav-item.is-active {
    background: rgb(15 23 42);
    color: #fff;
  }
}

@media (max-width: 1023px) {
  #hub-desktop-sidebar {
    width: 18rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #hub-desktop-sidebar,
  .hub-sidebar-avatar {
    transition: none;
  }
}
