/* SAMAMI ERP design convergence v73 — shared controls for nested views.
 * Only existing shell components; no changes to data, permissions, or APIs.
 */
.samami-enterprise-shell {
  --erp-ui-radius: 14px;
  --erp-ui-gap: 12px;
  --erp-ui-focus: #2176c8;
}
.samami-enterprise-shell :is(
  .sam-world-toolbar,.sam-erp4-toolbar,.sam-world-browser__head,
  .sam-customer-controls,.erp-toolbar,.sam-world-toolbar__actions
) {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: var(--erp-ui-gap);
  align-items: center;
  align-content: center;
}
.samami-enterprise-shell :is(
  .sam-world-toolbar,.sam-erp4-toolbar,.erp-toolbar,
  .sam-customer-controls
) :is(input[type="search"],.erp-input[type="search"],.sam-master-search) {
  min-width: min(100%,190px);
  flex: 1 1 220px;
  max-width: 100%;
  box-sizing: border-box;
}
.samami-enterprise-shell :is(.sam-master-search,.sam-world-toolbar__search) input {
  min-width: 0;
  width: 100%;
}
#root .samami-enterprise-shell :is(
  .sam-world-browser,.sam-erp4-card,.sam-erp4-column,
  .sam-deep-object,.fin49-panel,.sam-world-card,
  .sam-customer-master
) {
  box-sizing: border-box;
  min-width: 0;
  border-radius: var(--erp-ui-radius);
}
.samami-enterprise-shell :is(
  .sam-world-browser__head,.sam-erp4-toolbar,.sam-world-toolbar
) :is(h1,h2,h3,p,small,span) {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.samami-enterprise-shell :is(
  .erp-button,.sam-erp4-toolbar button,.sam-world-toolbar button,
  .sam-world-toolbar select,.erp-input
) {
  box-sizing: border-box;
  min-height: 40px;
  border-radius: 10px;
  font: inherit;
  line-height: 1.4;
}
.samami-enterprise-shell :is(
  input[type="search"],input[type="text"],select,textarea
):focus-visible,
.samami-enterprise-shell :is(
  button,.erp-button,a[role="button"]
):focus-visible {
  outline: 2px solid var(--erp-ui-focus);
  outline-offset: 2px;
}
.samami-enterprise-shell :is(.sam-record-table-scroll,.sam-world-browser) {
  min-width: 0;
  max-width: 100%;
}
.samami-enterprise-shell :is(.sam-world-toolbar,.sam-erp4-toolbar,.erp-toolbar)
  :is(button,a,input,select) {
  max-width: 100%;
}
@media (max-width:640px) {
  .samami-enterprise-shell :is(
    .sam-world-toolbar,.sam-erp4-toolbar,
    .sam-customer-controls,.erp-toolbar
  ) { gap: 9px; }
  .samami-enterprise-shell :is(
    .sam-world-toolbar,.sam-erp4-toolbar,
    .sam-customer-controls,.erp-toolbar
  ) :is(input[type="search"],.sam-master-search) {
    flex: 1 1 100%;
    width: 100%;
  }
}
/* Industrial showroom: neutral gradient behind the real WebGL canvas,
 * distinct from the actual GLB/PBR shader and applied only to studio. */
#root [data-qa="studio-guided-preview"] .cw-elevator-canvas-shell {
  background: linear-gradient(155deg,#edf3f7 0%,#d6e1ea 67%,#c5d3df 100%);
}
html[data-samami-theme="dark"] #root [data-qa="studio-guided-preview"] .cw-elevator-canvas-shell {
  background: linear-gradient(155deg,#202c3d 0%,#141e2c 70%,#111a26 100%);
}


/* Existing CRM-specific !important radius declarations otherwise win
 * even over the common Page Grammar. Keep this one scoped convergence rule. */
#root .samami-enterprise-shell .sam-erp4-card {
  border-radius: var(--erp-ui-radius) !important;
}
