/* 
 * Fix Admin Header - Make it Fixed Position
 * This CSS ensures the admin header stays fixed at the top when scrolling
 */

/* Force all headers to be fixed position */
.top-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 50 !important;
  height: 52px !important;
}

/* Ensure all user types get proper top padding for fixed header */
body.admin-user .kb-main,
body.customer-user .kb-main,
body.store-owner-user .kb-main,
body.driver-user .kb-main {
  padding-top: 68px !important; /* 52px header + 16px spacing */
}

/* Desktop layout adjustments */
@media (min-width: 768px) {
  body.admin-user .kb-main,
  body.customer-user .kb-main,
  body.store-owner-user .kb-main,
  body.driver-user .kb-main {
    padding-top: 68px !important;
    padding-left: 236px !important; /* Sidebar width */
  }
}

/* Mobile layout adjustments */
@media (max-width: 767px) {
  body.admin-user .kb-main,
  body.customer-user .kb-main,
  body.store-owner-user .kb-main,
  body.driver-user .kb-main {
    padding-top: 68px !important;
  }
  
  /* Non-admin users need bottom padding for bottom nav */
  body.customer-user .kb-main,
  body.store-owner-user .kb-main,
  body.driver-user .kb-main {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
  }
  
  /* Admins don't have bottom nav */
  body.admin-user .kb-main {
    padding-bottom: 16px !important;
  }
}

/* Ensure header content is properly positioned */
.top-bar > div {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Fix any z-index issues */
.top-bar {
  z-index: 9999 !important;
}

/* Ensure glass effect works with fixed positioning */
.top-bar.glass {
  background: rgba(255,255,255,0.72) !important;
  backdrop-filter: saturate(180%) blur(20px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
  border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

/* Ensure overdue header works with fixed positioning */
.top-bar.overdue-header {
  background: #dc2626 !important;
  backdrop-filter: none !important;
  border-bottom: none !important;
}

/* Fix sidebar positioning with fixed header */
#kb-sidebar {
  top: 52px !important;
  height: calc(100vh - 52px) !important;
}

/* Ensure toast notifications appear below fixed header */
.toast {
  top: 64px !important; /* 52px header + 12px spacing */
  z-index: 10000 !important;
}

/* Ensure notification panel appears below fixed header */
#notif-panel {
  z-index: 9998 !important; /* Below header but above other content */
}