/* SAMAMI ERP v90: explicit surface/controls contract.
   Repairs legacy `background: ... !important` declarations which could
   defeat the previous background-color-only theme rules. Scoped to ERP main.
   Sidebar remains independently inverse-themed. */
html[data-samami-theme="light"] body #root .samami-enterprise-shell main[data-qa="erp-main"] :is(
 .samami-page-header-v88,.erp-card,.erp-subcard,.sam-world-browser,
 .sam-world-attention,.sam-world-calm-empty,.sam-world-toolbar,
 .op51-panel,.op51-rule-card,.sam-world-metric-card
) {
 background:var(--sam89-surface) !important;
 background-image:none !important;
 border-color:var(--sam89-line) !important;
 color:var(--sam89-text) !important;
}
html[data-samami-theme="dark"] body #root .samami-enterprise-shell main[data-qa="erp-main"] :is(
 .samami-page-header-v88,.erp-card,.erp-subcard,.sam-world-browser,
 .sam-world-attention,.sam-world-calm-empty,.sam-world-toolbar,
 .op51-panel,.op51-rule-card,.sam-world-metric-card
) {
 background:var(--sam89-surface) !important;
 background-image:none !important;
 border-color:var(--sam89-line) !important;
 color:var(--sam89-text) !important;
}
html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] :is(
 .erp-input,.op51-input,.sam-world-toolbar input,.sam-world-toolbar select,
 .samami-page-shell input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
 .samami-page-shell select,.samami-page-shell textarea
) {
 background:var(--sam89-control) !important;
 color:var(--sam89-text) !important;
 border-color:var(--sam89-line) !important;
 color-scheme:normal;
}
html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] :is(
 button.erp-button-secondary,a.erp-button-secondary,.erp-button.erp-button-secondary
) {
 background:var(--sam89-secondary-bg) !important;
 color:var(--sam89-text) !important;
 border-color:var(--sam89-line) !important;
}
html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] :is(
 button.erp-button-primary,a.erp-button-primary,.erp-button.erp-button-primary
) {
 background:var(--sam89-primary) !important;
 color:#fff !important;
 border-color:var(--sam89-primary) !important;
}
/* Keep all real page actions in one consistent row or mobile stack. */
html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] .samami-page-header-v88 .samami-page-actions {
 display:flex !important;
 align-items:center !important;
 justify-content:flex-start !important;
 flex-wrap:wrap !important;
 gap:8px !important;
 margin:0 !important;
 min-width:0 !important;
}
html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] .samami-page-header-v88 .samami-page-header-row {
 display:flex !important;
 justify-content:space-between !important;
 align-items:center !important;
 flex-wrap:wrap !important;
 gap:12px !important;
 min-width:0 !important;
}
html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] :is(
 .sam-world-browser__head,.sam-world-attention__head,.erp-section-header
) > :is(button,a) {flex-shrink:0 !important;}
@media(max-width:640px){
 html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] .samami-page-header-v88 .samami-page-actions {width:100% !important;}
 html[data-samami-theme] body #root .samami-enterprise-shell main[data-qa="erp-main"] .samami-page-header-v88 .samami-page-actions > :is(a,button){flex:1 1 145px !important;}
}
