/* SAMAMI v83: one authoritative rail palette, not another full copy of
 * old light/dark sidebar rules. v66 inverse-navigation tokens were swapped:
 * it set DARK mode to a light #f3f7fc surface. Fix at their source token API.
 * Records, status filters, and project/document drill-down navigation survive.
 */
html[data-samami-theme="dark"] #root .samami-enterprise-shell {
  --sam-nav-inverse-bg:#0d2132;
  --sam-nav-inverse-ink:#edf5fc;
  --sam-nav-inverse-muted:#bed1e2;
  --sam-nav-inverse-edge:#33536b;
  --sam-nav-inverse-control:#1a3951;
  --sam-nav-inverse-selected:#285b81;
  --sam-nav-inverse-active:#fff;
  --sam-nav-inverse-focus:#f3c26b;
}
/* Dark-mode token styling should apply uniformly to desktop, mobile drawer,
 * header, nested rail and profile footer, including when old CSS sets
 * an explicit background-color instead of consuming a variable. */
html[data-samami-theme="dark"] #root .samami-enterprise-shell :is(
  .samami-app-sidebar,.samami-mobile-sidebar-layer > aside,
  .samami-sidebar-content.samami-sidebar-glass,
  .samami-sidebar-brand,.samami-sidebar-brand-row,
  .samami-sidebar-official-brand,
  .samami-sidebar-nav.samami-sidebar-workspaces,
  .samami-sidebar-footer.samami-sidebar-profile-zone
) {
  background-color:var(--sam-nav-inverse-bg)!important;
  color:var(--sam-nav-inverse-ink)!important;
  border-color:var(--sam-nav-inverse-edge)!important;
}
html[data-samami-theme] #root .samami-enterprise-shell .samami-sidebar-nav .samami-workspace-rail-label {
  white-space:normal!important;
  text-overflow:clip!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  line-height:1.5!important;
  min-width:0!important;
  flex:1 1 auto!important;
}
html[data-samami-theme] #root .samami-enterprise-shell .samami-sidebar-nav .samami-rail-section-toggle {
  min-height:44px!important;
  height:auto!important;
}
/* Remove ONLY redundant inter-page menus already owned by the sidebar.
 * Preserve operational filters, quotation/pricing tools and dossier tabs. */
html[data-samami-theme] #root .samami-enterprise-shell .sam-world-section-nav[aria-label="بخش‌های مالی"],
html[data-samami-theme] #root .samami-enterprise-shell .sam-sales-family-nav,
html[data-samami-theme] #root .samami-enterprise-shell .sam-sales-integrated-nav {
  display:none!important;
}
