.admin-menu-btn,
.admin-nav-close,
.admin-nav-backdrop {
  display: none;
}

@media (max-width: 1023px) {
  html,
  body {
    height: auto !important;
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body {
    display: block !important;
  }

  body > aside {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(20rem, 88vw) !important;
    height: 100dvh !important;
    max-height: 100dvh;
    transform: translateX(110%);
    transition: transform 0.22s ease;
    z-index: 80 !important;
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.16);
  }

  body.admin-nav-open > aside {
    transform: translateX(0);
  }

  body > aside nav {
    max-height: none !important;
    overflow: visible !important;
  }

  body > aside [dir="ltr"] {
    display: none !important;
  }

  body > aside + div {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
  }

  body > aside + div > header,
  body > aside + div > header > div {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    row-gap: 0.6rem;
  }

  body > aside + div > header {
    padding-inline: 3.5rem 0.85rem !important;
  }

  body > aside + div > header h1,
  body > aside + div main h1,
  body > aside + div main h2 {
    font-size: 1.05rem !important;
    line-height: 1.45 !important;
    white-space: normal !important;
  }

  body > aside + div > header .text-right,
  body > aside + div > header .h-6 {
    display: none !important;
  }

  .admin-menu-btn {
    display: inline-flex;
    position: fixed;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 45;
    width: 2.6rem;
    height: 2.6rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.85rem;
    background: #fff;
    color: #1b1b1f;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    cursor: pointer;
  }

  body.admin-nav-open .admin-menu-btn {
    display: none;
  }

  .admin-nav-close {
    display: inline-flex;
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 2;
    width: 2.4rem;
    height: 2.4rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0.75rem;
    background: #f3f0f4;
    color: #1b1b1f;
    cursor: pointer;
  }

  .admin-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(20, 16, 18, 0.46);
  }

  body:not(.admin-nav-open) .admin-nav-backdrop {
    display: none;
  }

  main {
    display: flex;
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0.75rem !important;
    gap: 0.75rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  main > section,
  main > div,
  main section {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
  }

  main .overflow-auto,
  main .overflow-x-auto,
  main .overflow-y-auto,
  section:has(table) {
    max-width: 100%;
    overflow: auto !important;
  }

  main table {
    min-width: 36rem;
  }

  main .min-w-\[1100px\],
  .min-w-\[1100px\] {
    min-width: 0 !important;
    height: auto !important;
  }

  #lane-new,
  #lane-cooking,
  #lane-ready,
  #lane-done,
  #lane-cancelled {
    max-height: none;
    overflow: visible !important;
  }

  #productDrawer,
  #systemDishModal {
    width: 100% !important;
    max-width: 100% !important;
  }

  main .grid > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  aside:has(#pos-submit) {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.5rem;
    z-index: 35;
    max-height: 38vh;
    overflow: auto;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  }

  body:has(#pos-submit) main {
    padding-bottom: 42vh !important;
  }
}
