/* ERP_SIGMA_TABLET_UI_SINGLE_SOURCE_FIT_20260525_ACTIVE
   Authoritative tablet presentation layer. Layout only. */
@media (min-width: 768px) and (max-width: 1368px) {
  html,
  body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body:not(.portal-page-shell) .app {
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body:not(.portal-page-shell) .sidebar {
    flex-basis: 88px !important;
    max-width: 88px !important;
    min-width: 88px !important;
    overflow: hidden !important;
    padding: 10px 8px !important;
    width: 88px !important;
  }

  body:not(.portal-page-shell) .brand {
    align-items: center !important;
    display: grid !important;
    gap: 10px !important;
    justify-items: center !important;
    padding: 10px 4px !important;
    width: 100% !important;
  }

  body:not(.portal-page-shell) .brand-logo {
    height: auto !important;
    max-width: 64px !important;
    width: 100% !important;
  }

  body:not(.portal-page-shell) .nav a,
  body:not(.portal-page-shell) .nav summary {
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    padding: 10px 6px !important;
  }

  body:not(.portal-page-shell) .nav-text,
  body:not(.portal-page-shell) .nav summary strong {
    display: none !important;
  }

  body:not(.portal-page-shell) .nav-icon {
    margin: 0 !important;
  }

  body:not(.portal-page-shell) .main {
    margin-left: 0 !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    width: 100% !important;
  }

  body:not(.portal-page-shell) .topbar {
    align-items: center !important;
    gap: 12px !important;
    min-height: 68px !important;
    padding: 10px 16px !important;
  }

  body:not(.portal-page-shell) .topbar h1 {
    flex: 1 1 auto !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    min-width: 0 !important;
    white-space: normal !important;
  }

  body:not(.portal-page-shell) .topbar .user {
    flex: 0 1 auto !important;
    gap: 6px !important;
    max-width: min(55vw, 460px) !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .topbar .user-name,
  body:not(.portal-page-shell) .topbar .technical-link {
    display: none !important;
  }

  body:not(.portal-page-shell) .content {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    padding: 14px !important;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
  }

  body:not(.portal-page-shell) .panel,
  body:not(.portal-page-shell) .card,
  body:not(.portal-page-shell) .owner-dashboard,
  body:not(.portal-page-shell) .role-dashboard,
  body:not(.portal-page-shell) .sales-modern,
  body:not(.portal-page-shell) .production-modern,
  body:not(.portal-page-shell) .inventory-control,
  body:not(.portal-page-shell) .finance-modern {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body:not(.portal-page-shell) .panel-header,
  body:not(.portal-page-shell) .panel-header .actions,
  body:not(.portal-page-shell) .page-toolbar,
  body:not(.portal-page-shell) .toolbar,
  body:not(.portal-page-shell) .filters {
    flex-wrap: wrap !important;
    gap: 8px !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .owner-dashboard-head.sigma-dashboard-hero,
  body:not(.portal-page-shell) .role-dashboard-compact-head,
  body:not(.portal-page-shell) .finance-compact-head,
  body:not(.portal-page-shell) .production-compact-head {
    min-height: 0 !important;
    padding: 14px 16px !important;
  }

  body:not(.portal-page-shell) .owner-dashboard-head.sigma-dashboard-hero h2,
  body:not(.portal-page-shell) .role-dashboard-compact-head h2 {
    font-size: 22px !important;
    line-height: 1.22 !important;
  }

  body:not(.portal-page-shell) .owner-summary-grid,
  body:not(.portal-page-shell) .role-dashboard .owner-summary-grid,
  body:not(.portal-page-shell) .summary-grid,
  body:not(.portal-page-shell) .kpi-grid,
  body:not(.portal-page-shell) .finance-kpi-grid,
  body:not(.portal-page-shell) .production-kpi-grid,
  body:not(.portal-page-shell) .sales-kpi-grid {
    display: grid !important;
    gap: 12px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 100% !important;
  }

  body:not(.portal-page-shell) .resizable-split,
  body:not(.portal-page-shell) .master-product-layout,
  body:not(.portal-page-shell) .setting-master-layout,
  body:not(.portal-page-shell) .settings-user-layout,
  body:not(.portal-page-shell) .hr-master-layout > .grid,
  body:not(.portal-page-shell) .consumable-layout,
  body:not(.portal-page-shell) .purchase-entry-layout {
    display: grid !important;
    gap: 14px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body:not(.portal-page-shell) .resizable-split > *,
  body:not(.portal-page-shell) .master-product-layout > *,
  body:not(.portal-page-shell) .setting-master-layout > *,
  body:not(.portal-page-shell) .settings-user-layout > *,
  body:not(.portal-page-shell) .consumable-layout > *,
  body:not(.portal-page-shell) .purchase-entry-layout > * {
    grid-column: 1 / -1 !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  body:not(.portal-page-shell) .resizable-gutter,
  body:not(.portal-page-shell) .resizable-divider,
  body:not(.portal-page-shell) .resizable-reset {
    display: none !important;
  }

  body:not(.portal-page-shell) .two-col,
  body:not(.portal-page-shell) .finance-report-grid,
  body:not(.portal-page-shell) .balance-sheet-grid,
  body:not(.portal-page-shell) .production-material-grid,
  body:not(.portal-page-shell) .pos-main-layout {
    display: grid !important;
    gap: 14px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .form-grid,
  body:not(.portal-page-shell) .master-product-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .setting-master-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .settings-user-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .hr-master-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .consumable-layout .panel-body > form.form-grid {
    display: grid !important;
    gap: 12px 14px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 100% !important;
  }

  body:not(.portal-page-shell) .form-grid > .actions,
  body:not(.portal-page-shell) .form-grid > details,
  body:not(.portal-page-shell) .form-grid > textarea {
    grid-column: 1 / -1 !important;
  }

  body:not(.portal-page-shell) input,
  body:not(.portal-page-shell) select,
  body:not(.portal-page-shell) textarea,
  body:not(.portal-page-shell) button,
  body:not(.portal-page-shell) .btn {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  body:not(.portal-page-shell) .tabs,
  body:not(.portal-page-shell) .tabbar,
  body:not(.portal-page-shell) .subtabs,
  body:not(.portal-page-shell) .pill-tabs,
  body:not(.portal-page-shell) .finance-tabs,
  body:not(.portal-page-shell) .inventory-tabs,
  body:not(.portal-page-shell) .sales-tabs,
  body:not(.portal-page-shell) .production-work-nav,
  body:not(.portal-page-shell) .role-dashboard-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: thin !important;
  }

  body:not(.portal-page-shell) .tabs > *,
  body:not(.portal-page-shell) .tabbar > *,
  body:not(.portal-page-shell) .subtabs > *,
  body:not(.portal-page-shell) .pill-tabs > *,
  body:not(.portal-page-shell) .finance-tabs > *,
  body:not(.portal-page-shell) .inventory-tabs > *,
  body:not(.portal-page-shell) .sales-tabs > *,
  body:not(.portal-page-shell) .production-work-nav > *,
  body:not(.portal-page-shell) .role-dashboard-actions > * {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    white-space: nowrap !important;
  }

  body:not(.portal-page-shell) .table-wrap,
  body:not(.portal-page-shell) .production-jit-grid .table-wrap,
  body:not(.portal-page-shell) .sales-modern .order-reseller-page .table-wrap,
  body:not(.portal-page-shell) .master-product-layout .table-wrap,
  body:not(.portal-page-shell) .setting-master-layout .table-wrap,
  body:not(.portal-page-shell) .settings-user-layout .table-wrap,
  body:not(.portal-page-shell) .hr-master-layout .table-wrap,
  body:not(.portal-page-shell) .consumable-layout .table-wrap {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body:not(.portal-page-shell) .table-wrap > table,
  body:not(.portal-page-shell) .production-jit-grid .table-wrap table,
  body:not(.portal-page-shell) .sales-modern .order-reseller-page .table-wrap table,
  body:not(.portal-page-shell) .master-product-layout .table-wrap table,
  body:not(.portal-page-shell) .setting-master-layout .table-wrap table,
  body:not(.portal-page-shell) .settings-user-layout .table-wrap table,
  body:not(.portal-page-shell) .hr-master-layout .table-wrap table,
  body:not(.portal-page-shell) .consumable-layout .table-wrap table {
    min-width: max(680px, 100%) !important;
    table-layout: auto !important;
    width: max-content !important;
  }

  body:not(.portal-page-shell) .table-wrap th,
  body:not(.portal-page-shell) .table-wrap td {
    line-height: 1.35 !important;
    max-width: 260px !important;
    overflow: hidden !important;
    overflow-wrap: normal !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    word-break: normal !important;
  }

  body:not(.portal-page-shell) .table-wrap td:last-child .actions,
  body:not(.portal-page-shell) .table-wrap td:last-child {
    overflow: visible !important;
    white-space: normal !important;
  }

  body:not(.portal-page-shell) .modal,
  body:not(.portal-page-shell) .dialog,
  body:not(.portal-page-shell) [role="dialog"] {
    max-height: calc(100vh - 44px) !important;
    max-width: min(680px, calc(100vw - 32px)) !important;
    overflow-y: auto !important;
  }

  body.portal-page-shell {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body.portal-page-shell .portal-page,
  body.portal-page-shell .portal-shell,
  body.portal-page-shell .portal-reseller-shell {
    box-sizing: border-box !important;
    margin: 0 auto !important;
    max-width: min(920px, calc(100vw - 28px)) !important;
    overflow-x: hidden !important;
    padding-inline: 14px !important;
    width: 100% !important;
  }

  body.portal-page-shell .portal-reseller-tab,
  body.portal-page-shell input,
  body.portal-page-shell select,
  body.portal-page-shell textarea,
  body.portal-page-shell button {
    max-width: 100% !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  body:not(.portal-page-shell) .two-col,
  body:not(.portal-page-shell) .finance-report-grid,
  body:not(.portal-page-shell) .balance-sheet-grid,
  body:not(.portal-page-shell) .production-material-grid,
  body:not(.portal-page-shell) .pos-main-layout,
  body:not(.portal-page-shell) .form-grid,
  body:not(.portal-page-shell) .master-product-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .setting-master-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .settings-user-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .hr-master-layout .panel-body > form.form-grid,
  body:not(.portal-page-shell) .consumable-layout .panel-body > form.form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:not(.portal-page-shell) .owner-summary-grid,
  body:not(.portal-page-shell) .role-dashboard .owner-summary-grid,
  body:not(.portal-page-shell) .summary-grid,
  body:not(.portal-page-shell) .kpi-grid,
  body:not(.portal-page-shell) .finance-kpi-grid,
  body:not(.portal-page-shell) .production-kpi-grid,
  body:not(.portal-page-shell) .sales-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 900px) and (max-width: 1368px) and (orientation: landscape) {
  body:not(.portal-page-shell) .app {
    grid-template-columns: 96px minmax(0, 1fr) !important;
  }

  body:not(.portal-page-shell) .sidebar {
    flex-basis: 96px !important;
    max-width: 96px !important;
    min-width: 96px !important;
    width: 96px !important;
  }

  body:not(.portal-page-shell) .owner-summary-grid,
  body:not(.portal-page-shell) .role-dashboard .owner-summary-grid,
  body:not(.portal-page-shell) .summary-grid,
  body:not(.portal-page-shell) .kpi-grid,
  body:not(.portal-page-shell) .finance-kpi-grid,
  body:not(.portal-page-shell) .production-kpi-grid,
  body:not(.portal-page-shell) .sales-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ERP_SIGMA_FINANCE_TABLET_ACTIVE_SOURCE_TAB_TOPBAR_FIX_20260525_ACTIVE
   Authoritative Finance tablet and Finance topbar layout. Data and action flow are unchanged. */
@media (min-width: 768px) and (max-width: 1368px) {
  body:not(.portal-page-shell) .main:has(.finance-page) {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  body:not(.portal-page-shell) .main:has(.finance-page) > .topbar {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: visible !important;
    z-index: 10 !important;
  }

  body:not(.portal-page-shell) .main:has(.finance-page) > .topbar h1 {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.portal-page-shell) .main:has(.finance-page) > .topbar .user {
    align-items: center !important;
    display: flex !important;
    flex: 0 1 auto !important;
    flex-wrap: nowrap !important;
    gap: 7px !important;
    position: static !important;
    inset: auto !important;
    margin-left: auto !important;
    min-width: 0 !important;
    max-width: min(52vw, 420px) !important;
  }

  body:not(.portal-page-shell) .main:has(.finance-page) > .topbar .user form,
  body:not(.portal-page-shell) .main:has(.finance-page) > .topbar .topbar-icon,
  body:not(.portal-page-shell) .main:has(.finance-page) > .topbar .user > .btn {
    flex: 0 0 auto !important;
  }

  body:not(.portal-page-shell) .main:has(.finance-page) > .topbar .sigma-notification-center {
    flex: 0 0 auto !important;
    position: relative !important;
    inset: auto !important;
    z-index: 11 !important;
  }

  body:not(.portal-page-shell) .main:has(.finance-page) > .content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .finance-page {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body:not(.portal-page-shell) .finance-page > .finance-tabs.finance-tab-row {
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 8px 8px 10px !important;
    white-space: nowrap !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: thin !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x proximity;
  }

  body:not(.portal-page-shell) .finance-page > .finance-tabs.finance-tab-row > a {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    min-width: max-content !important;
    font-size: 14px !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    scroll-snap-align: start;
  }

  body:not(.portal-page-shell) .finance-page > .finance-filter,
  body:not(.portal-page-shell) .finance-page > .finance-content {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .finance-page > .finance-filter .actions {
    align-items: end !important;
    box-sizing: border-box !important;
    display: grid !important;
    gap: 10px !important;
    grid-template-columns: minmax(148px, 1fr) repeat(2, minmax(142px, 1fr)) auto auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .finance-page > .finance-filter .actions .btn {
    min-height: 44px !important;
  }

  body:not(.portal-page-shell) .finance-page > .finance-content > .panel,
  body:not(.portal-page-shell) .finance-page > .finance-content .table-wrap {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .finance-page > .finance-content > .panel > .panel-header {
    flex-wrap: wrap !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  body:not(.portal-page-shell) .finance-page > .finance-filter .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.portal-page-shell) .finance-page > .finance-filter .actions label:first-of-type {
    grid-column: 1 / -1 !important;
  }

  body:not(.portal-page-shell) .finance-page > .finance-filter .actions .btn {
    width: 100% !important;
  }
}

/* TABLET FIX - GALAXY TAB 11 PLUS - 20260526
   One tablet source for internal ERP layout only. No data or action flow changes. */
@media (min-width: 768px) and (max-width: 1368px) {
  body:not(.portal-page-shell),
  body:not(.portal-page-shell) .app,
  body:not(.portal-page-shell) .main,
  body:not(.portal-page-shell) .content,
  body:not(.portal-page-shell) .content *,
  body:not(.portal-page-shell) .panel,
  body:not(.portal-page-shell) .card {
    box-sizing: border-box !important;
  }

  body:not(.portal-page-shell) .app {
    min-height: 100vh !important;
    min-height: 100dvh !important;
  }

  body:not(.portal-page-shell) .sidebar-toggle {
    align-items: center !important;
    display: inline-flex !important;
    height: 42px !important;
    justify-content: center !important;
    max-width: 48px !important;
    min-width: 42px !important;
    padding: 0 !important;
    width: 42px !important;
  }

  body:not(.portal-page-shell) .main > .topbar {
    align-items: center !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    isolation: isolate !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 10 !important;
  }

  body:not(.portal-page-shell) .main > .topbar h1 {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.portal-page-shell) .main > .topbar .user,
  body:not(.portal-page-shell) .main > .topbar .topbar-actions {
    align-items: center !important;
    display: flex !important;
    flex: 0 1 auto !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    margin-left: auto !important;
    max-width: min(58vw, 480px) !important;
    min-width: 0 !important;
    overflow: visible !important;
    position: static !important;
  }

  body:not(.portal-page-shell) .main > .topbar .user-chip {
    flex: 0 1 auto !important;
    max-width: 164px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body:not(.portal-page-shell) .main > .topbar .user-chip .user-name {
    max-width: 106px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.portal-page-shell) .main > .topbar .sigma-notification-center {
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 12 !important;
  }

  body:not(.portal-page-shell) .sigma-notification-panel {
    left: auto !important;
    max-height: min(calc(100dvh - 92px), 620px) !important;
    max-width: calc(100vw - 24px) !important;
    overflow-y: auto !important;
    position: fixed !important;
    right: 12px !important;
    top: max(72px, calc(env(safe-area-inset-top, 0px) + 58px)) !important;
    width: min(380px, calc(100vw - 112px)) !important;
    z-index: 80 !important;
  }

  body:not(.portal-page-shell) .tabs,
  body:not(.portal-page-shell) .tabbar,
  body:not(.portal-page-shell) .module-tabs,
  body:not(.portal-page-shell) .sales-module-tabs.sales-modern-tabs {
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-right: 14px !important;
    scroll-snap-type: x proximity !important;
    white-space: nowrap !important;
  }

  body:not(.portal-page-shell) .sales-module-tabs.sales-modern-tabs > a {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    min-width: max-content !important;
    scroll-snap-align: start !important;
    white-space: nowrap !important;
  }

  body:not(.portal-page-shell) .sales-modern,
  body:not(.portal-page-shell) .sales-modern-content,
  body:not(.portal-page-shell) .pos-page,
  body:not(.portal-page-shell) .pos-main-layout,
  body:not(.portal-page-shell) .pos-input-panel,
  body:not(.portal-page-shell) .pos-summary-panel,
  body:not(.portal-page-shell) .pos-items-panel,
  body:not(.portal-page-shell) .pos-history-panel {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  body:not(.portal-page-shell) .sales-order-summary {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body:not(.portal-page-shell) .sales-order-summary-head {
    flex-wrap: wrap !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .sales-order-kpi-grid {
    display: grid !important;
    gap: 10px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 100% !important;
  }

  body:not(.portal-page-shell) .sales-order-kpi {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .sales-order-kpi small,
  body:not(.portal-page-shell) .sales-order-kpi strong {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body:not(.portal-page-shell) .sales-modern .pos-main-layout {
    align-items: start !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.portal-page-shell) .sales-modern .pos-input-panel,
  body:not(.portal-page-shell) .sales-modern .pos-items-panel {
    overflow: visible !important;
  }

  body:not(.portal-page-shell) .sales-modern .pos-summary-panel {
    position: static !important;
  }

  body:not(.portal-page-shell) .pos-page .pos-item-table-wrap,
  body:not(.portal-page-shell) .pos-page .compact-cart-wrap {
    display: block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body:not(.portal-page-shell) .pos-page .compact-suggestions {
    max-height: min(48dvh, 430px) !important;
    max-width: calc(100% - 20px) !important;
    overflow-y: auto !important;
  }

  body:not(.portal-page-shell) .table-wrap,
  body:not(.portal-page-shell) .data-grid,
  body:not(.portal-page-shell) .table-responsive {
    display: block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  body:not(.portal-page-shell) .file-preview-modal,
  body:not(.portal-page-shell) .output-preview-modal,
  body:not(.portal-page-shell) .bulk-edit-modal,
  body:not(.portal-page-shell) dialog {
    max-height: calc(100dvh - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    overflow-y: auto !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  body:not(.portal-page-shell) .main > .topbar {
    gap: 8px !important;
    min-height: 60px !important;
    padding: 8px 10px !important;
  }

  body:not(.portal-page-shell) .main > .topbar h1 {
    font-size: 18px !important;
  }

  body:not(.portal-page-shell) .main > .topbar .user-chip .user-name {
    display: none !important;
  }

  body:not(.portal-page-shell) .sales-order-summary-head .sales-order-summary-link {
    flex: 1 0 100% !important;
    justify-content: center !important;
  }

  body:not(.portal-page-shell) .sales-modern .pos-main-layout,
  body:not(.portal-page-shell) .sales-modern .pos-payment-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:not(.portal-page-shell) .pos-page .pos-item-line {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.portal-page-shell) .pos-page .pos-item-line > label:first-child,
  body:not(.portal-page-shell) .pos-page .pos-item-line .compact-add {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}

@media (min-width: 1024px) and (max-width: 1100px) and (orientation: landscape) {
  body:not(.portal-page-shell) .sales-modern .pos-main-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 1101px) and (max-width: 1368px) and (orientation: landscape) {
  body:not(.portal-page-shell) .sales-order-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body:not(.portal-page-shell) .sales-modern .pos-main-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px) !important;
  }
}

@media (min-width: 768px) and (max-width: 1368px) and (max-height: 850px) {
  body:not(.portal-page-shell) .content {
    padding-block: 10px !important;
  }

  body:not(.portal-page-shell) .main > .topbar {
    min-height: 56px !important;
    padding-block: 6px !important;
  }

  body:not(.portal-page-shell) .sigma-notification-panel {
    max-height: calc(100dvh - 74px) !important;
    top: 62px !important;
  }
}

/* TABLET FIX - SIDEBAR LABEL STATE - GALAXY TAB 11 PLUS - 20260526
   Collapsed is icon-only; expanded overlays content and restores complete labels. */
@media (min-width: 768px) and (max-width: 1368px) {
  body:not(.portal-page-shell) {
    --sigma-tablet-sidebar-rail: 88px;
  }

  body:not(.portal-page-shell) .app,
  body.tablet-mobile-mode:not(.portal-page-shell) .app,
  body.tablet-mobile-mode.sidebar-collapsed:not(.portal-page-shell) .app,
  body.tablet-mobile-mode.sidebar-expanded:not(.portal-page-shell) .app {
    grid-template-columns: var(--sigma-tablet-sidebar-rail) minmax(0, 1fr) !important;
  }

  body:not(.portal-page-shell):not(.sidebar-expanded) .sidebar,
  body.sidebar-collapsed:not(.portal-page-shell) .sidebar,
  body.tablet-mobile-mode.sidebar-collapsed:not(.portal-page-shell) .sidebar {
    flex-basis: var(--sigma-tablet-sidebar-rail) !important;
    max-width: var(--sigma-tablet-sidebar-rail) !important;
    min-width: var(--sigma-tablet-sidebar-rail) !important;
    overflow-x: hidden !important;
    width: var(--sigma-tablet-sidebar-rail) !important;
  }

  body:not(.portal-page-shell):not(.sidebar-expanded) .nav-text,
  body.sidebar-collapsed:not(.portal-page-shell) .nav-text,
  body.tablet-mobile-mode.sidebar-collapsed:not(.portal-page-shell) .nav-text {
    display: none !important;
    opacity: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    width: 0 !important;
  }

  body:not(.portal-page-shell):not(.sidebar-expanded) .nav a,
  body.sidebar-collapsed:not(.portal-page-shell) .nav a,
  body.tablet-mobile-mode.sidebar-collapsed:not(.portal-page-shell) .nav a {
    gap: 0 !important;
    justify-content: center !important;
  }

  body.sidebar-expanded:not(.portal-page-shell) .main,
  body.tablet-mobile-mode.sidebar-expanded:not(.portal-page-shell) .main {
    grid-column: 2 !important;
    min-width: 0 !important;
  }

  body.sidebar-expanded:not(.portal-page-shell) .sidebar,
  body.tablet-mobile-mode.sidebar-expanded:not(.portal-page-shell) .sidebar {
    bottom: 0 !important;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.24) !important;
    flex-basis: min(280px, calc(100vw - 32px)) !important;
    height: 100vh !important;
    height: 100dvh !important;
    left: 0 !important;
    max-height: 100dvh !important;
    max-width: min(280px, calc(100vw - 32px)) !important;
    min-width: min(260px, calc(100vw - 32px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    position: fixed !important;
    top: 0 !important;
    width: min(280px, calc(100vw - 32px)) !important;
    z-index: 80 !important;
  }

  body.sidebar-expanded:not(.portal-page-shell) .brand,
  body.tablet-mobile-mode.sidebar-expanded:not(.portal-page-shell) .brand {
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  body.sidebar-expanded:not(.portal-page-shell) .nav a,
  body.tablet-mobile-mode.sidebar-expanded:not(.portal-page-shell) .nav a {
    align-items: center !important;
    gap: 12px !important;
    justify-content: flex-start !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    width: 100% !important;
  }

  body.sidebar-expanded:not(.portal-page-shell) .nav-icon,
  body.tablet-mobile-mode.sidebar-expanded:not(.portal-page-shell) .nav-icon {
    flex: 0 0 24px !important;
  }

  body.sidebar-expanded:not(.portal-page-shell) .nav-text,
  body.tablet-mobile-mode.sidebar-expanded:not(.portal-page-shell) .nav-text {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    opacity: 1 !important;
    overflow: visible !important;
    overflow-wrap: break-word !important;
    visibility: visible !important;
    white-space: normal !important;
    width: auto !important;
  }
}

@media (min-width: 900px) and (max-width: 1368px) and (orientation: landscape) {
  body:not(.portal-page-shell) {
    --sigma-tablet-sidebar-rail: 96px;
  }
}

/* TABLET FIX - INDUSTRIAL CLEAN MODERN ERP - 20260528 */
@media (min-width: 768px) and (max-width: 1368px) {
  body:not(.portal-page-shell) {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body:not(.portal-page-shell) .content,
  body:not(.portal-page-shell) .main,
  body:not(.portal-page-shell) .hr-master-layout,
  body:not(.portal-page-shell) .panel,
  body:not(.portal-page-shell) .panel-body {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not(.portal-page-shell) .industrial-flow-panel {
    margin-inline: 0 !important;
    overflow: hidden !important;
  }

  body:not(.portal-page-shell) .industrial-flow {
    display: flex !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 8px !important;
    scroll-snap-type: x proximity !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body:not(.portal-page-shell) .industrial-flow-step {
    flex: 0 0 168px !important;
    min-width: 168px !important;
    scroll-snap-align: start !important;
  }

  body:not(.portal-page-shell) .kpi-grid,
  body:not(.portal-page-shell) .owner-summary-grid,
  body:not(.portal-page-shell) .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.portal-page-shell) .table-wrap,
  body:not(.portal-page-shell) .table-responsive,
  body:not(.portal-page-shell) .data-table-wrap,
  body:not(.portal-page-shell) .responsive-table,
  body:not(.portal-page-shell) .erp-table-wrap,
  body:not(.portal-page-shell) .table-scroll {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}
