/* === Layout === */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#layout-root {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#top-menu {
  height: 50px;
  flex-shrink: 0;
  background: #f8f8f8;
  border-bottom: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
}

#layout-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

#side-menu {
  width: 250px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #f5f5f5;
  border-right: 1px solid #ccc;
}

#page-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: white;
}

#footer {
  height: 40px;
  flex-shrink: 0;
  background: #f0f0f0;
  text-align: center;
  line-height: 40px;
  border-top: 1px solid #ccc;
}


/* === Sidebar === */
#side-menu {
  width: 250px;
  background: #f5f5f5;
  border-right: 1px solid #ccc;
  height: calc(100vh - 50px);
  overflow-y: auto;
  transition: transform 0.2s ease-in-out;
}

#side-menu.collapsed {
  transform: translateX(-100%);
}

#sidebarToggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  margin: 10px;
  cursor: pointer;
}

nav#mainSidebar {
  padding: 10px;
}

/* === Page content === */
#page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  background: white;
}

/* === Breadcrumb (unchanged) === */
#breadcrumb ul {
  display: flex;
  gap: 0.5em;
  font-size: 1.25rem;
  font-weight: 500;
  list-style: none;
  padding: 0;
  margin: 0.5em 0;
}
#breadcrumb li::after {
  content: '›';
  margin-left: 0.5em;
  color: #999;
}
#breadcrumb li:last-child::after {
  content: '';
}
#breadcrumb a {
  color: inherit;
  text-decoration: none;
}
#breadcrumb a:hover {
  text-decoration: underline;
}


/* === Responsive === */
@media (max-width: 768px) {
  #side-menu {
    position: absolute;
    top: 50px;
    left: 0;
    z-index: 10;
    height: calc(100vh - 50px);
    background: #fff;
    border-right: 1px solid #ddd;
    transform: translateX(-100%);
  }

  #side-menu.collapsed {
    transform: translateX(0);
  }

  #sidebarToggle {
    display: block;
  }

  #page-content {
    padding: 15px;
  }
}

.menu-membership-switcher {
  width: 100%;
  margin: 0.5rem 0 1rem;
  padding: 0.25rem;
  font-size: 0.875rem;
}

.menu-item {
  display: block;
  padding: 0.5rem 1rem;
  color: #444;
  text-decoration: none;
}

.menu-item.active {
  background-color: #f0f0f0;
  font-weight: bold;
}

#page-body.page-loading,
#detailTabContent.page-loading {
  visibility: hidden;
}

/* Prevent rendering until JS says it's ready */
body[data-page-loading="true"] #page-body,
body[data-page-loading="true"] #detailTabContent {
  visibility: hidden;
}

#loadBlocker {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 9999;
  transition: opacity 0.2s ease;
}
#loadBlocker.fadeOut {
  opacity: 0;
  pointer-events: none;
}
