.app-switcher-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  width: 100%;
}

.app-switcher-sidebar {
  flex-shrink: 0;
  width: 220px;
  border-right: 1px solid #e0e0e0;
  background: #f8f9fb;
  padding: 16px 12px;
  box-sizing: border-box;
}

.app-switcher-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-switcher-sidebar-section-label {
  margin: 0 0 8px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-switcher-sidebar-toggle {
  width: 24px;
  height: 24px;
  margin: 0 4px 8px 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.app-switcher-sidebar-toggle:hover {
  background: #eef2f7;
  color: #0f172a;
}

.app-switcher-sidebar-panel {
  background: transparent;
  padding: 0;
  min-height: 0;
}

.app-switcher-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Override Vue app global nav styles (static/app.css sets nav { background: #333 }) */
  background: transparent;
  font-family: inherit;
  font-weight: inherit;
  text-transform: none;
}

.app-switcher-sidebar .app-switcher-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 500;
  color: #475569;
  text-transform: none;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.app-switcher-sidebar-link-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.app-switcher-sidebar .app-switcher-sidebar-link:hover,
.app-switcher-sidebar .app-switcher-sidebar-link:focus,
.app-switcher-sidebar .app-switcher-sidebar-link:active {
  background: #eef2f7;
  color: #0f172a;
  text-decoration: none;
  outline: none;
}

.app-switcher-sidebar .app-switcher-sidebar-link--active,
.app-switcher-sidebar .app-switcher-sidebar-link--active:hover,
.app-switcher-sidebar .app-switcher-sidebar-link--active:focus,
.app-switcher-sidebar .app-switcher-sidebar-link--active:active {
  background: #e8effc;
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.app-switcher-sidebar--collapsed {
  width: 76px;
  padding: 12px 8px;
}

.app-switcher-sidebar--collapsed .app-switcher-sidebar-header {
  justify-content: center;
}

.app-switcher-sidebar--collapsed .app-switcher-sidebar-section-label {
  display: none;
}

.app-switcher-sidebar--collapsed .app-switcher-sidebar-toggle {
  margin: 0 0 10px;
}

.app-switcher-sidebar--collapsed .app-switcher-sidebar-nav {
  align-items: center;
  gap: 8px;
}

.app-switcher-sidebar--collapsed .app-switcher-sidebar-link {
  justify-content: center;
  gap: 0;
  width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 8px;
  border-radius: 12px;
}

.app-switcher-sidebar--collapsed .app-switcher-sidebar-link span {
  display: none;
}

.app-switcher-sidebar--collapsed .app-switcher-sidebar-link-icon {
  width: 22px;
  height: 22px;
}

.app-switcher-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

body.app-switcher-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.app-switcher-layout > .app-switcher-shell {
  flex: 1;
}

body.app-switcher-layout--vue {
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-switcher-shell--vue {
  --app-switcher-navbar-height: 50px;
  min-height: 100vh;
}

.app-switcher-shell--vue .app-switcher-sidebar {
  padding: 0;
}

.app-switcher-shell--vue .app-switcher-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--app-switcher-navbar-height);
  min-height: var(--app-switcher-navbar-height);
  padding: 0 12px;
  border-bottom: 1px solid #e0e0e0;
  box-sizing: border-box;
  text-decoration: none;
}

.app-switcher-shell--vue .app-switcher-sidebar-brand-icon {
  display: block;
  width: auto;
  height: 40px;
  max-width: 100%;
  object-fit: contain;
}

.app-switcher-shell--vue .app-switcher-sidebar-header {
  padding: 16px 12px 0;
}

.app-switcher-shell--vue .app-switcher-sidebar-panel {
  padding: 0 12px 16px;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed {
  padding: 0;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed .app-switcher-sidebar-brand {
  padding: 0 8px;
  text-align: center;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed .app-switcher-sidebar-brand-icon {
  width: auto;
  height: 32px;
  margin: 0 auto;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed .app-switcher-sidebar-header {
  padding: 10px 8px 0;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed .app-switcher-sidebar-toggle {
  margin: 0 0 10px;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed .app-switcher-sidebar-nav {
  gap: 8px;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed .app-switcher-sidebar-link {
  width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 12px;
}

.app-switcher-shell--vue .app-switcher-sidebar--collapsed .app-switcher-sidebar-link-icon {
  width: 22px;
  height: 22px;
}

.app-switcher-main--vue {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

.app-switcher-app-root {
  flex: 1;
  min-width: 0;
}

/* Vue apps render their own header logo; hide it when the sidebar brand is shown */
body.app-switcher-layout--vue #logoImage,
body.app-switcher-layout--vue .navbar a:has(> #logoImage) {
  display: none !important;
}

@media (max-width: 720px) {
  .app-switcher-shell {
    flex-direction: column;
  }

  .app-switcher-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 12px 12px;
  }

  .app-switcher-sidebar-section-label {
    padding: 0 8px;
    margin-bottom: 12px;
    font-size: 16px;
  }

  .app-switcher-sidebar-toggle {
    margin-bottom: 12px;
  }

  .app-switcher-sidebar-panel {
    background: transparent;
    min-height: 0;
    padding: 0;
    overflow-x: auto;
  }

  .app-switcher-sidebar-nav {
    flex-direction: row;
    gap: 8px;
    min-width: max-content;
  }

  .app-switcher-sidebar-link {
    gap: 10px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 15px;
    white-space: nowrap;
    background: transparent;
    color: #475569;
  }

  .app-switcher-sidebar-link-icon {
    width: 22px;
    height: 22px;
  }

  .app-switcher-sidebar--collapsed {
    width: 100%;
    padding: 12px;
  }

  .app-switcher-sidebar--collapsed .app-switcher-sidebar-header {
    justify-content: space-between;
  }

  .app-switcher-sidebar--collapsed .app-switcher-sidebar-section-label {
    display: block;
  }

  .app-switcher-sidebar--collapsed .app-switcher-sidebar-panel {
    overflow-x: auto;
  }

  .app-switcher-sidebar--collapsed .app-switcher-sidebar-nav {
    flex-direction: row;
    min-width: max-content;
  }

  .app-switcher-sidebar--collapsed .app-switcher-sidebar-link {
    width: auto;
    min-height: 0;
  }

  .app-switcher-sidebar--collapsed .app-switcher-sidebar-link span {
    display: none;
  }

  .app-switcher-shell--vue .app-switcher-sidebar {
    padding: 0;
  }

  .app-switcher-shell--vue .app-switcher-sidebar-brand {
    height: var(--app-switcher-navbar-height, 50px);
    min-height: var(--app-switcher-navbar-height, 50px);
    padding: 0 12px;
  }

  .app-switcher-shell--vue .app-switcher-sidebar-brand-icon {
    width: auto;
    height: 40px;
  }

  .app-switcher-shell--vue .app-switcher-sidebar-header {
    padding: 12px 12px 0;
  }

  .app-switcher-shell--vue .app-switcher-sidebar-section-label {
    padding: 0 8px;
    margin-bottom: 12px;
    font-size: 16px;
  }

  .app-switcher-shell--vue .app-switcher-sidebar-panel {
    padding: 0 12px 12px;
    overflow-x: auto;
  }

  .app-switcher-shell--vue .app-switcher-sidebar-nav {
    flex-direction: row;
    gap: 8px;
    min-width: max-content;
  }

  .app-switcher-shell--vue .app-switcher-sidebar-link {
    white-space: nowrap;
    padding: 8px 12px;
  }
}

.app-shell-body {
  flex: 1;
  min-height: 0;
}

.app-shell-main {
  flex: 1;
  min-width: 0;
}

.app-shell-body--with-sidebar {
  display: flex;
  align-items: stretch;
}

.app-shell-body--with-sidebar .app-switcher-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: calc(100vh - 52px);
}

@media (max-width: 720px) {
  .app-shell-body--with-sidebar {
    flex-direction: column;
  }

  .app-shell-body--with-sidebar .app-switcher-sidebar {
    position: static;
    width: 100%;
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    overflow: visible;
  }
}
