.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1050;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: #cf3da6;
  cursor: pointer;
}

#sidebarToggle {
  border-radius: 8px;
}

@media (max-width: 1200px) {
  .sidebar {
    width: 240px;
  }
  .admin-main {
    margin-left: 240px;
  }
}

@media (min-width: 992px) {
  .sidebar-close {
    display: none;
  }
}

@media (max-width: 991px) {
  body > .position-relative.bg-white.d-flex.p-0 {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(320px, 80%);
    height: 100vh;
    padding: 1.5rem;
    border: none;
    border-right: 1px solid rgba(209, 209, 211, 1);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
    transition: left 0.3s ease;
    z-index: 1100;
    overflow-y: auto;
  }

  .sidebar.sidebar-open {
    left: 0;
  }

  .sidebar .navbar-links {
    margin-top: 2rem;
  }

  .sidebar .navbar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .sidebar .navbar-nav ul li {
    width: 100%;
    margin: 0;
    padding: 0.5rem 0.2rem;
    border-radius: 12px;
  }

  .sidebar .navbar-nav ul li a {
    display: block;
    padding: 0.35rem 0.5rem;
  }

  .sidebar-close {
    display: block;
  }

  .sidebar-backdrop {
    display: block;
  }

  .admin-main {
    margin-left: 0;
  }

  nav.w-100 {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  nav.w-100 > div {
    flex: 1 1 100%;
    width: 100%;
  }

  nav.w-100 .d-flex.justify-content-end {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  nav .d-flex.align-items-center.position-relative {
    width: 100%;
    justify-content: space-between;
  }

  nav .w-50 {
    width: 100% !important;
  }

  nav .d-flex.justify-content-end {
    justify-content: flex-start;
    gap: 0.85rem;
    flex-wrap: wrap;
  }

  nav .d-flex.justify-content-end .border-2 {
    width: auto;
    min-width: unset;
  }

  .notifications-tab {
    position: static;
    width: 100%;
  }

  .container-fluid.agent-checkout {
    padding: 1rem;
  }

  .points-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .points-card {
    min-height: auto;
  }

  .summary-breakdown .price-line {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .points-panel .row {
    flex-direction: column;
  }

  .points-panel .row .col-md-6 {
    width: 100%;
  }

  .quantity-selector {
    width: 100%;
    justify-content: space-between;
  }

  .summary-breakdown,
  .total-line {
    gap: 0.5rem;
  }

  .card.checkout-card .card-body {
    padding: 1.5rem;
  }

  .store-credit-wrapper {
    width: 100%;
  }

  .store-credit-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .store-credit-banner .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .w-75-res {
    width: 100% !important;
  }
  .w-50-res {
    width: 100% !important;
  }

  .notifications-tab {
    display: none;
    width: 100%;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 99;
  }
  .admin-main {
    margin-left: 0px;
  }
  nav .border-2 {
    width: auto;
  }
  nav .d-flex.align-items-center.position-relative {
    width: 100%;
    flex-direction: row;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  nav .d-flex.align-items-center.position-relative img {
    max-height: 32px;
  }
  .new-member-grid {
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(1, 1fr);
    gap: 1rem;
  }

  nav.w-100 {
    flex-direction: column;
  }

  nav .d-flex.align-items-center .border-2 {
    width: 100%;
  }

  .points-card {
    padding: 1rem;
  }

  .points-panel {
    padding: 1.25rem;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .table-responsive table {
    min-width: 520px;
  }

  .card {
    overflow-x: hidden;
  }
}

@media (max-width: 576px) {
  .sidebar .navbar-nav ul li {
    width: 100%;
  }

  .sidebar .navbar-brand img {
    width: 65%;
  }

  nav .d-flex.align-items-center.position-relative {
    flex-direction: column;
    align-items: flex-start;
  }

  .points-card {
    text-align: left;
  }

  .quantity-selector {
    flex-direction: row;
    gap: 0.5rem;
  }

  .container-fluid.agent-checkout {
    padding: 0.75rem;
  }
}
