/* Cashback Pro V36.7.164 — desktop sidebar-aware content centering.
   Desktop only: keep the category control reachable, reserve a real sidebar rail,
   and center page content inside the remaining workspace (including the dashboard). */
@media (min-width: 1100px) {
  :root {
    --v164-sidebar-width: clamp(232px, 19vw, 286px);
    --v164-desktop-header: var(--v36-header-height, 104px);
  }

  /* The category control remains visible while the page scrolls. */
  html body .header-menu-row {
    position: fixed !important;
    top: calc(var(--v164-desktop-header) + 8px) !important;
    left: 18px !important;
    right: auto !important;
    z-index: 1805 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }
  html body .header-menu-row .mobile-menu-toggle {
    display: inline-flex !important;
    position: relative !important;
    z-index: 1 !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 8px 13px !important;
    pointer-events: auto !important;
    white-space: nowrap !important;
  }

  /* Place the navigation below the fixed category button. */
  html body #app-sidebar.app-sidebar {
    position: fixed !important;
    top: calc(var(--v164-desktop-header) + 56px) !important;
    bottom: 14px !important;
    left: 18px !important;
    right: auto !important;
    width: var(--v164-sidebar-width) !important;
    min-width: 0 !important;
    max-width: var(--v164-sidebar-width) !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    z-index: 1700 !important;
  }
  html body #app-sidebar > #main-tabs-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    align-items: stretch !important;
  }
  html body #app-sidebar #main-tabs-nav .tab-btn {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }

  /* Expanded: all content, including the homepage, gets a narrower workspace.
     Auto margins center it within the area to the right of the sidebar. */
  html body.sidebar-expanded main.main-container,
  html body.dashboard-home.sidebar-expanded main.main-container,
  html body.dashboard-tab-mode.sidebar-expanded main.main-container {
    width: min(calc(100vw - var(--v164-sidebar-width) - 76px), 1680px) !important;
    max-width: 1680px !important;
    min-width: 0 !important;
    margin-left: calc(18px + var(--v164-sidebar-width) + 24px + max(0px, (100vw - var(--v164-sidebar-width) - 76px - 1680px) / 2)) !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Collapsed: reclaim the full desktop canvas and center it on screen. */
  html body.sidebar-collapsed main.main-container,
  html body.dashboard-home.sidebar-collapsed main.main-container,
  html body.dashboard-tab-mode.sidebar-collapsed main.main-container {
    width: min(calc(100vw - 48px), 1680px) !important;
    max-width: 1680px !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* The dashboard has its own legacy centering rules; explicitly bind it to
     the same available workspace so it never stays full-width under the menu. */
  html body.dashboard-home.sidebar-expanded #seasonal-dashboard.seasonal-dashboard {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }
  html body.dashboard-home.sidebar-expanded #seasonal-dashboard > .seasonal-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}
