/* 与现有浅色侧栏保持一致；搜索及折叠状态不影响主工作区。 */
.app-shell > .sidebar .nav [hidden] { display: none !important; }
.app-shell > .sidebar .nav-search-tools {
  position: sticky;
  top: -1px;
  z-index: 2;
  grid-column: 1 / -1;
  padding: 2px 2px 8px;
  background: #f0f2f7;
}
.app-shell > .sidebar .nav-search {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #dbe1eb;
  border-radius: 4px;
}
.app-shell > .sidebar .nav-search:focus-within { border-color: #7eaae9; box-shadow: 0 0 0 2px #e3ecfc; }
.app-shell > .sidebar .nav-search > svg { width: 15px; height: 15px; flex: 0 0 15px; fill: none; stroke: #8691a4; stroke-width: 1.7; }
.app-shell > .sidebar .nav-search input {
  width: 100%; min-width: 0; min-height: 32px; padding: 0;
  color: #34445d; background: transparent; border: 0; border-radius: 0;
  outline: 0; box-shadow: none; font: inherit; font-size: 13px;
}
.app-shell > .sidebar .nav-search input::placeholder { color: #8691a4; }
.app-shell > .sidebar .nav-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.app-shell > .sidebar .nav-search-clear {
  width: 23px; height: 26px; flex: 0 0 23px; padding: 0; border: 0;
  color: #7b879a; background: transparent; font-size: 20px; cursor: pointer; border-radius: 3px;
}
.app-shell > .sidebar .nav-search-clear:hover { color: #2865c7; background: #edf2fa; }
.app-shell > .sidebar .nav-group-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; }
.app-shell > .sidebar .nav-group-actions button { min-height: 27px; padding: 0 4px; color: #66758c; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px; }
.app-shell > .sidebar .nav-group-actions button:hover { color: #2865c7; }
.app-shell > .sidebar .nav-search-status { padding: 3px 4px 0; color: #66758c; font-size: 12px; }
.app-shell > .sidebar .nav-search-status:empty { display: none; }
.app-shell > .sidebar .nav-section { min-width: 0; margin-top: 8px; grid-column: 1 / -1; }
.app-shell > .sidebar .nav-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 3px;
  color: #5c6b82; background: transparent; font: inherit; font-size: 13px; font-weight: 500;
  text-align: left; cursor: pointer;
}
.app-shell > .sidebar .nav-group-toggle > span { margin: 0; color: inherit; }
.app-shell > .sidebar .nav-group-toggle:hover { background: #e7ebf3; color: #315f9f; }
.app-shell > .sidebar .nav-group-arrow { width: 6px; height: 6px; margin-right: 3px !important; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.app-shell > .sidebar .nav-group-toggle[aria-expanded="true"] .nav-group-arrow { transform: rotate(45deg); }
.app-shell > .sidebar .nav-section-items { display: grid; gap: 1px; }
.app-shell > .sidebar .nav-section-items .nav-item { padding-left: 16px; }
.app-shell > .sidebar .nav-search-empty { padding: 18px 10px; color: #77859a; line-height: 1.8; font-size: 13px; }
.app-shell > .sidebar .nav button:focus-visible, .app-shell > .sidebar .nav a:focus-visible { outline: 2px solid #7eaae9; outline-offset: -2px; }

/* 窄屏导航入口融入共用页头，菜单在页头下方展开。 */
.app-shell > .topbar .mobile-nav-toggle { display: none; }
@media (max-width: 700px) {
  .app-shell > .topbar {
    flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 8px;
    height: 52px; min-height: 52px; padding: 0 12px;
  }
  .app-shell > .topbar .brand {
    flex: 1 1 auto; width: auto; min-width: 0; min-height: 52px; gap: 7px; padding: 0;
  }
  .app-shell > .topbar .brand .brand-icon {
    flex: 0 0 30px; width: 30px !important; height: 30px !important;
  }
  .app-shell > .topbar .brand strong {
    min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 13px;
  }
  .app-shell > .topbar .top-actions {
    flex: 0 0 auto; flex-wrap: nowrap; gap: 0; margin: 0;
  }
  .app-shell > .topbar .topbar-message { margin-right: 0; }
  .app-shell > .topbar .topbar-account-trigger > span { display: none; }
  .app-shell > .topbar .mobile-nav-toggle {
    position: static; display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 34px; width: 34px; min-width: 34px; height: 34px; min-height: 34px; padding: 0;
    color: #52657e !important; background: transparent !important; border: 0 !important;
    border-radius: 5px !important; cursor: pointer;
  }
  .app-shell > .topbar .mobile-nav-toggle:hover,
  .app-shell > .topbar .mobile-nav-toggle[aria-expanded="true"] {
    color: #2865c7 !important; background: #eef3fb !important;
  }
  .app-shell > .topbar .mobile-nav-toggle:focus-visible {
    outline: 2px solid #7eaae9; outline-offset: 1px;
  }
  .mobile-nav-icon { position: relative; display: block; width: 18px; height: 16px; }
  .mobile-nav-icon > span {
    position: absolute; top: 7px; left: 0; width: 18px; height: 1.7px;
    background: currentColor; border-radius: 2px; transition: transform 170ms ease, opacity 170ms ease;
  }
  .mobile-nav-icon > span:first-child { transform: translateY(-6px); }
  .mobile-nav-icon > span:last-child { transform: translateY(6px); }
  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon > span:first-child { transform: rotate(45deg); }
  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon > span:nth-child(2) { opacity: 0; }
  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-icon > span:last-child { transform: rotate(-45deg); }
  .app-shell > .sidebar {
    z-index: 20; height: 0; min-height: 0; padding: 0; border: 0;
  }
  .app-shell > .sidebar .nav,
  .app-shell > .sidebar.mobile-nav-open .nav {
    position: absolute; z-index: 15; inset: 8px 12px auto; display: grid;
    grid-template-columns: 1fr; max-height: min(65vh, 520px); overflow-y: auto;
    padding: 8px; background: #f0f2f7; border: 1px solid #e4e8f0; border-radius: 5px;
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-6px);
    transition: opacity 170ms ease, transform 170ms ease, visibility 0s linear 170ms;
  }
  .app-shell > .sidebar.mobile-nav-open .nav {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s;
  }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  .app-shell > .sidebar .nav, .mobile-nav-icon > span { transition: none !important; }
}
