/* Cashback Pro V36.7.1 — sidebar/dashboard separation and light drawer frame. */

/* Short landscape: reserve a full sidebar rail and reflow the dashboard into it.
   This prevents the first KPI column from sitting underneath the fixed sidebar. */
@media (orientation: landscape) and (max-height: 820px) {
  html body main.main-container,
  html body.dashboard-home main.main-container,
  html body.dashboard-tab-mode main.main-container {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 10px 0 calc(var(--v40-sidebar-width, 188px) + 28px) !important;
    padding: 12px 10px 24px !important;
    box-sizing: border-box !important;
  }

  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 {
    margin-left: calc(var(--v40-sidebar-width, 188px) + 28px) !important;
  }

  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 {
    margin-left: 10px !important;
  }

  html body.dashboard-home #seasonal-dashboard,
  html body #seasonal-dashboard.seasonal-dashboard {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 12px !important;
  }

  html body #seasonal-dashboard > .seasonal-main {
    display: block !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  html body #seasonal-dashboard > .seasonal-right { display: none !important; }
  html body #seasonal-dashboard .seasonal-kpis {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  html body #seasonal-dashboard .seasonal-kpi,
  html body #seasonal-dashboard .seasonal-orders {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

/* Portrait/tablet drawer: fully opaque surface so page text cannot bleed through. */
@media (max-width: 980px) and (orientation: portrait) {
  html body #app-sidebar.app-sidebar {
    background: var(--bg-surface, #ffffff) !important;
    background-image: none !important;
    opacity: 1 !important;
    border: 1px solid var(--border-light, #cbd5e1) !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 42px rgba(20, 35, 58, .20) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    isolation: isolate !important;
    overflow: hidden !important;
  }

  html body #app-sidebar #main-tabs-nav {
    background: transparent !important;
    opacity: 1 !important;
  }

  html body #app-sidebar #main-tabs-nav .tab-btn {
    opacity: 1 !important;
  }

  html body #sidebar-backdrop.sidebar-backdrop,
  html body .sidebar-backdrop {
    display: block !important;
    position: fixed !important;
    inset: var(--v36-header-height, 126px) 0 0 0 !important;
    z-index: 1690 !important;
    border: 0 !important;
    background: rgba(16, 28, 48, .18) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
  html body.sidebar-expanded #sidebar-backdrop.sidebar-backdrop,
  html body.sidebar-expanded .sidebar-backdrop {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  html body.sidebar-collapsed #sidebar-backdrop.sidebar-backdrop,
  html body.sidebar-collapsed .sidebar-backdrop {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Stronger, clean frame in the default light appearance. */
body.theme-default.default-light-mode #app-sidebar.app-sidebar {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 14px 36px rgba(35, 53, 78, .16) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
body.theme-default.default-light-mode #app-sidebar .sidebar-heading {
  border-bottom: 1px solid #e2e8f0 !important;
}
