/* SAMAMI ERP v75 — functional consistency on additional nested workspaces.
   Scope changes to existing ERP PageShell classes; do not touch public storefront.
   Auth, permissions, backend state, and business data remain unchanged. */
#root .samami-enterprise-shell .erp-page-surface :is(
  .supply54-page,.fin49-page,.sam-sales-world-route,.sam-customers-world,
  .owner-system-map-page
) {
  --erp75-panel-radius: 12px;
  --erp75-control-height: 42px;
  --erp75-flow-space: 12px;
}
/* All primary page commands present at the top and in predictable wrapping order. */
#root .samami-enterprise-shell .erp-page-surface
:is(.supply54-page,.fin49-page,.sam-sales-world-route,.sam-customers-world)
:is(.sam-world-browser__head,.sam-sales-command,.sam-customer-controls,
    .sam-world-toolbar,.sam-inventory-embedded-head) {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  column-gap: var(--erp75-flow-space);
  row-gap: 9px;
  min-width: 0;
  max-width: 100%;
}
#root .samami-enterprise-shell .erp-page-surface
:is(.supply54-page,.fin49-page,.sam-sales-world-route,.sam-customers-world)
:is(.sam-world-browser__head,.sam-sales-command,.sam-customer-controls,
    .sam-world-toolbar,.sam-inventory-embedded-head)
:is(input,select,button) {
  box-sizing: border-box;
  min-height: var(--erp75-control-height);
  max-width: 100%;
}
#root .samami-enterprise-shell .erp-page-surface
:is(.supply54-page,.fin49-page,.sam-sales-world-route,.sam-customers-world)
:is(.sam-world-browser__head,.sam-sales-command,.sam-customer-controls,
    .sam-world-toolbar,.sam-inventory-embedded-head)
:is(input[type="search"],.sam-master-search,.sam-world-toolbar__search) {
  min-width: 0;
  flex: 1 1 230px;
}
/* Procurement/Inventory embedded sections lacked consistent card rhythm. */
#root .samami-enterprise-shell .erp-page-surface .supply54-page
:is(.erp-embedded-module,.erp-local-tabstrip,.sam-inventory-embedded-head) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#root .samami-enterprise-shell .erp-page-surface .supply54-page
.erp-local-tabstrip {
  align-items: center;
  min-height: 48px;
  border-radius: var(--erp75-panel-radius);
  gap: 6px;
  scrollbar-width: thin;
}
#root .samami-enterprise-shell .erp-page-surface .supply54-page
.erp-local-tabstrip :is(button,a) {
  min-height: 40px;
  border-radius: 9px;
  white-space: nowrap;
}
#root .samami-enterprise-shell .erp-page-surface .supply54-page
:is(.erp-embedded-module,.sam-world-browser)
:is(input[type="search"],input[type="text"],select) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  border-radius: 10px;
  font: inherit;
}
/* Normalize the nested procurement/inventory containers, not status colors. */
#root .samami-enterprise-shell .erp-page-surface .supply54-page
:is(.erp-embedded-module .rounded-2xl.border.bg-white,
    .erp-embedded-module .rounded-xl.border.bg-white,
    .erp-embedded-module .rounded-2xl.border.bg-slate-50,
    .erp-embedded-module .rounded-xl.border.bg-slate-50) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--erp75-panel-radius);
}
#root .samami-enterprise-shell .erp-page-surface .supply54-page
:is(.erp-embedded-module,.sam-world-browser)
:is(h2,h3,p,span,small) {
  overflow-wrap: anywhere;
}
/* Finance: same panel geometry as CRM, Procurement and Services. */
#root .samami-enterprise-shell .erp-page-surface .fin49-page
:is(.fin49-panel,.sam-world-browser,.fin49-result-list,.sam-deep-object) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--erp75-panel-radius);
}
#root .samami-enterprise-shell .erp-page-surface .fin49-page
:is(.sam-world-browser__head,.sam-world-toolbar) {
  gap: 10px;
  align-items: center;
}
#root .samami-enterprise-shell .erp-page-surface .fin49-page
:is(.sam-world-browser__head,.fin49-panel)
:is(h2,h3,strong,span) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
/* Services: consistent in-page object search and status actions. */
#root .samami-enterprise-shell .erp-page-surface
:is(.sam-service-active-view,.sam-service-record,.sam-service-workspace)
:is(input[type="search"],.erp-input) {
  min-height: 42px;
  min-width: 0;
  box-sizing: border-box;
}
#root .samami-enterprise-shell .erp-page-surface
:is(.sam-service-active-view,.sam-service-record,.sam-service-workspace)
:is(.sam-world-browser__head,.sam-world-toolbar) {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
/* OWNER map search: previous min-width:280px clipped on narrow phones. */
#root .samami-enterprise-shell .erp-page-surface .owner-system-map-page
[data-qa="owner-capability-search"] {
  min-width: 0;
  max-width: 100%;
}
#root .samami-enterprise-shell .erp-page-surface .owner-system-map-page
[data-qa="owner-capability-search"] > div {
  min-width: 0;
  flex-wrap: wrap;
}
#root .samami-enterprise-shell .erp-page-surface .owner-system-map-page
[data-qa="owner-capability-search"] .min-w-\[280px\] {
  min-width: 0 !important;
  flex: 1 1 240px;
  max-width: 100%;
  box-sizing: border-box;
}
#root .samami-enterprise-shell .erp-page-surface .owner-system-map-page
[data-qa="owner-capability-search"] input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
/* Route-only mobile changes; do not compress breadcrumbs or the global nav. */
@media(max-width:720px) {
  #root .samami-enterprise-shell .erp-page-surface
  :is(.supply54-page,.fin49-page,.sam-sales-world-route,.sam-customers-world)
  :is(.sam-world-browser__head,.sam-sales-command,.sam-customer-controls,
      .sam-world-toolbar,.sam-inventory-embedded-head)
  :is(input[type="search"],.sam-master-search,.sam-world-toolbar__search) {
    flex: 1 1 100%;
    width: 100%;
  }
  #root .samami-enterprise-shell .erp-page-surface .supply54-page .erp-local-tabstrip {
    overflow-x: auto;
    flex-wrap: nowrap;
    overscroll-behavior-x: contain;
  }
  #root .samami-enterprise-shell .erp-page-surface .owner-system-map-page
  [data-qa="owner-capability-search"] .min-w-\[280px\] {
    flex: 1 1 100%;
  }
}
