
.nav-submenu--nested {
  padding-left: 12px;
  border-left: 2px solid rgba(255,255,255,0.06);
  margin-left: 16px;
}

/* Static HTML export — navigation links */
.sidebar-nav a.nav-item,
.sidebar-nav a.nav-sub-item {
  text-decoration: none;
}

.sidebar-nav a.nav-item {
  color: inherit;
}

.sidebar-nav a.nav-sub-item {
  color: inherit;
}

/* ——— Smooth main area when sidebar width changes ——— */
.main-content {
  transition: margin-left 0.28s ease;
}

/* ——— Desktop: collapsible sidebar (icon rail) ——— */
.sidebar-collapse-btn {
  order: 3;
  margin-left: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--r-md, 8px);
  background: rgba(107, 33, 214, 0.12);
  color: var(--text-s);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, transform 0.28s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(107, 33, 214, 0.22);
  color: var(--text-p);
}

.sidebar-collapse-btn:focus-visible {
  outline: 2px solid rgba(107, 33, 214, 0.55);
  outline-offset: 2px;
}

.sidebar-logo {
  flex-wrap: nowrap;
}

.sidebar-logo .logo-mark {
  order: 1;
}

.sidebar-logo .logo-text {
  order: 2;
  flex: 1;
  min-width: 0;
}

html[data-sidebar-collapsed='true'] {
  --sidebar-w: 76px;
}

html[data-sidebar-collapsed='true'] .sidebar-logo {
  flex-direction: column;
  padding: 16px 10px 14px;
  gap: 10px;
}

html[data-sidebar-collapsed='true'] .sidebar-collapse-btn {
  order: 2;
  margin-left: 0;
  transform: rotate(180deg);
}

html[data-sidebar-collapsed='true'] .logo-mark {
  order: 1;
}

html[data-sidebar-collapsed='true'] .logo-text {
  display: none;
}

html[data-sidebar-collapsed='true'] .nav-section-label,
html[data-sidebar-collapsed='true'] .nav-label,
html[data-sidebar-collapsed='true'] .nav-arrow,
html[data-sidebar-collapsed='true'] .health-tag,
html[data-sidebar-collapsed='true'] .nav-submenu,
html[data-sidebar-collapsed='true'] .live-dot {
  display: none !important;
}

html[data-sidebar-collapsed='true'] .nav-item,
html[data-sidebar-collapsed='true'] .sidebar-nav a.nav-item {
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
  margin-left: 6px;
  margin-right: 6px;
}

html[data-sidebar-collapsed='true'] .nav-item.active::before,
html[data-sidebar-collapsed='true'] .sidebar-nav a.nav-item.active::before {
  display: none;
}

html[data-sidebar-collapsed='true'] .nav-icon {
  margin: 0;
}

html[data-sidebar-collapsed='true'] .nav-item .nav-badge,
html[data-sidebar-collapsed='true'] .sidebar-nav a.nav-item .nav-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  padding: 1px 5px;
  font-size: 9px;
  min-width: 16px;
  text-align: center;
}

html[data-sidebar-collapsed='true'] .user-card .user-info,
html[data-sidebar-collapsed='true'] .user-card .bi-three-dots-vertical {
  display: none !important;
}

html[data-sidebar-collapsed='true'] .user-card {
  justify-content: center;
  padding: 10px 8px;
}

html[data-sidebar-collapsed='true'] .nav-item.has-sub,
html[data-sidebar-collapsed='true'] .sidebar-nav a.nav-item {
  position: relative;
}

@media (max-width: 991.98px) {
  html[data-sidebar-collapsed='true'] {
    --sidebar-w: 256px;
  }

  .sidebar-collapse-btn {
    display: none !important;
  }
}

/* ——— Topbar: expandable search (tablet/desktop) ——— */
.topbar-search-wrap {
  max-width: 360px;
  min-width: 0;
  gap: 6px;
}

.topbar-search-expandable {
  flex: 1;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: max-width 0.32s ease, opacity 0.22s ease, margin 0.22s ease;
  margin-left: 0;
}

.topbar-search-wrap.is-search-open .topbar-search-expandable {
  max-width: 320px;
  opacity: 1;
  pointer-events: auto;
  margin-left: 0;
}

.topbar-search-wrap.is-search-open .topbar-search-trigger {
  background: rgba(107, 33, 214, 0.15);
  border-color: var(--border-c);
  color: var(--text-p);
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .topbar-search-wrap {
    max-width: none;
    flex: 1 1 200px;
    order: 3;
    width: 100%;
  }

  .topbar-actions {
    order: 2;
    margin-left: auto;
  }
}

/* Mobile search sheet under topbar */
.topbar-search-mobile-sheet {
  padding: 0 14px 12px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-s);
  animation: mimeSheetIn 0.22s ease;
}

.topbar-search-mobile-sheet[hidden] {
  display: none !important;
}

@keyframes mimeSheetIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ——— Notification / messages dropdowns ———
   Never set display:flex on .dropdown-menu without .show — it overrides Bootstrap’s
   display:none and leaves the panel permanently visible (“stuck”). */
.topbar .dropdown-menu.mime-notify-dropdown {
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  background: var(--bg-card);
  border: 1px solid var(--border-s) !important;
  border-radius: var(--r-lg, 12px);
  overflow: hidden;
}

.topbar .dropdown-menu.mime-notify-dropdown.show {
  display: flex !important;
  flex-direction: column;
}

.mime-notify-header {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-p);
  border-bottom: 1px solid var(--border-s);
  flex-shrink: 0;
}

.mime-notify-header .mime-notify-mark-read {
  font-size: 11px;
  color: var(--mime-cyan-b) !important;
  text-decoration: none !important;
  border: none;
  background: none !important;
  cursor: pointer;
  box-shadow: none !important;
}

.mime-notify-header .mime-notify-mark-read:hover {
  text-decoration: underline;
  color: var(--text-p);
}

.mime-notify-list {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.mime-notify-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-s);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.mime-notify-item:last-child {
  border-bottom: none;
}

.mime-notify-item:hover {
  background: rgba(107, 33, 214, 0.08);
}

.mime-notify-item.unread {
  background: rgba(107, 33, 214, 0.05);
}

.mime-notify-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mime-cyan-b);
  flex-shrink: 0;
  margin-top: 5px;
}

.mime-notify-item:not(.unread) .mime-notify-dot {
  visibility: hidden;
  width: 8px;
}

.mime-notify-body {
  min-width: 0;
}

.mime-notify-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-p);
  line-height: 1.35;
}

.mime-notify-meta {
  font-size: 11px;
  color: var(--text-m);
  margin-top: 3px;
  line-height: 1.4;
}

.mime-notify-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-s);
  font-size: 12px;
  flex-shrink: 0;
  background: rgba(107, 33, 214, 0.04);
}

.mime-notify-footer-link {
  color: var(--mime-cyan-b);
  font-weight: 500;
}

.mime-notify-footer-link:hover {
  color: var(--text-p);
}

[data-theme='light'] .topbar .dropdown-menu.mime-notify-dropdown {
  box-shadow: 0 12px 40px rgba(22, 16, 48, 0.12) !important;
}
