/* Mobile-only admin/POS layout. Desktop styles are never overridden. */
@media (max-width: 767px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  body:not(.lockscreen) .content-wrapper,
  body:not(.lockscreen) .content,
  body:not(.lockscreen) section.content,
  body:not(.lockscreen) #scrollable-container,
  body:not(.lockscreen) .zoho-main-column,
  body:not(.lockscreen) .zoho-app-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.lockscreen) .content-wrapper,
  body:not(.lockscreen) section.content {
    padding: 12px 10px 24px !important;
    margin-left: 0 !important;
  }

  body:not(.lockscreen) .row {
    margin-left: -6px !important;
    margin-right: -6px !important;
  }

  body:not(.lockscreen) .row > [class*="col-"] {
    padding-left: 6px !important;
    padding-right: 6px !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }

  body:not(.lockscreen) .box,
  body:not(.lockscreen) .box-body,
  body:not(.lockscreen) .nav-tabs-custom,
  body:not(.lockscreen) .form-horizontal,
  body:not(.lockscreen) .table-responsive,
  body:not(.lockscreen) .dataTables_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.lockscreen) table {
    min-width: 640px;
  }

  body:not(.lockscreen) .form-group,
  body:not(.lockscreen) .input-group {
    width: 100%;
    max-width: 100%;
  }

  body:not(.lockscreen) .btn-group,
  body:not(.lockscreen) .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  body:not(.lockscreen) .main-header {
    width: 100% !important;
    left: 0 !important;
    margin-left: 0 !important;
  }

  body:not(.lockscreen) .main-sidebar,
  body:not(.lockscreen) .side-bar {
    max-width: 86vw;
  }

  body:not(.lockscreen) .modal-dialog {
    width: calc(100% - 16px) !important;
    margin: 8px auto !important;
    max-width: none !important;
  }

  body.lockscreen.pos-sale-theme,
  body.lockscreen.pos-sale-theme .wrapper,
  body.lockscreen.pos-sale-theme .content-wrapper,
  body.lockscreen.pos-sale-theme .thetop {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body.lockscreen.pos-sale-theme .pos-checkout-row,
  body.lockscreen.pos-sale-theme #pos_sidebar_wrap,
  body.lockscreen.pos-sale-theme #pos_checkout_wrap {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }

  body.lockscreen.pos-sale-theme .pos-ls-topbar {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.japs-home-ops .content-wrapper,
  body.japs-home-ops section.content,
  body.japs-home-ops .content {
    padding: 0 0 20px !important;
  }

  body.japs-home-ops table,
  body.japs-dashboard-home table {
    min-width: 0 !important;
    width: 100%;
  }
}

/* Admin top bar: fit phone/tablet width without desktop changes */
@media (max-width: 1023px) {
  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar {
    overflow: hidden;
    max-width: 100%;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__inner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0 8px;
    gap: 6px;
    box-sizing: border-box;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__inner > .tw-flex {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    gap: 6px;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__brand {
    display: inline-flex !important;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__brand span.tw-truncate {
    max-width: none !important;
    flex: 1 1 auto;
    min-width: 0;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__actions {
    flex: 0 1 auto;
    justify-content: flex-end;
    min-width: 0;
    max-width: 52%;
    overflow: hidden;
    gap: 4px;
    margin-left: auto;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__actions > a,
  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__actions > button,
  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__actions > span {
    display: none !important;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__actions > .zoho-quick-create,
  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__actions > .tw-relative,
  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__actions > details {
    display: inline-flex !important;
    flex-shrink: 0;
  }

  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__btn,
  body.zoho-theme:not(.pos-sale-theme) .zoho-topbar__btn--icon,
  body.zoho-theme:not(.pos-sale-theme) .zoho-quick-create__trigger {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
  }
}
