/* MXAI Runtime Theme Surface Adapter v3.11.3
   Compatibility authority only. Canonical component CSS remains !important-free.
   These scoped !important rules neutralize host/plugin hard-coded visual colors so Full Theme actually propagates. */
.mxai-theme-scope{background:var(--mx-bg);color:var(--mx-text);font-family:var(--mx-font);color-scheme:light}
.mx-theme-dark .mxai-theme-scope,.mxai-theme-scope.mx-theme-dark{color-scheme:dark}
@media (prefers-color-scheme:dark){.mx-theme-system .mxai-theme-scope,.mxai-theme-scope.mx-theme-system{color-scheme:dark}}
.mxai-theme-scope .mxai-adapt-surface{background:var(--mx-surface)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope .mxai-adapt-soft{background:var(--mx-surface-2)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope .mxai-adapt-text{color:var(--mx-text)!important}
.mxai-theme-scope :where(.card,.panel,.widget,.box,.modal-content,.offcanvas,.dropdown-menu,.popover,.table-wrap,.table-container,.datatable-wrap,.data-table,.content-card,.stat-card,.metric-card,.settings-card){background:var(--mx-surface)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope :where(.toolbar,.filter-bar,.search-bar,.actions-bar,.page-header,.section-header){background:var(--mx-surface)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),select,textarea,.form-control,.form-select){background:var(--mx-surface)!important;color:var(--mx-input-text-color,var(--mx-text))!important;border-color:var(--mx-border)!important;border-radius:var(--mx-input-radius)!important}
.mxai-theme-scope :where(input,textarea)::placeholder{color:var(--mx-muted)!important;opacity:.86}
.mxai-theme-scope :where(h1,h2,h3,h4,h5,h6,.page-title,.section-title,.card-title){color:var(--mx-heading-color)!important}
.mxai-theme-scope :where(label,.form-label,.field-label,.control-label){color:var(--mx-label-color)!important}
.mxai-theme-scope :where(.text-muted,.muted,.help-text,.description,.subtitle,.form-text){color:var(--mx-muted)!important}
.mxai-theme-scope :where(.table,.dataTable,table){color:var(--mx-text);background:var(--mx-surface)}
.mxai-theme-scope :where(.table th,.dataTable th,table th){background:var(--mx-surface-2)!important;color:var(--mx-muted)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope :where(.table td,.dataTable td,table td){background:var(--mx-surface)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope :where(.sidebar,.app-sidebar,.layout-menu,.main-menu,.vertical-menu,.mx-sidebar){background:var(--mx-sidebar-bg)!important;color:var(--mx-sidebar-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope :where(.navbar,.app-navbar,.layout-navbar,.topbar,.header-navbar,.mx-topbar){background:var(--mx-topbar-bg)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope :where(.content-wrapper,.app-content,.main-content,.page-wrapper,.workspace,.mx-content){background:var(--mx-bg)!important;color:var(--mx-text)!important}
.mxai-theme-scope :where(.btn-primary,.button-primary,.primary-action,[data-variant="primary"]){background:var(--mx-gradient-primary,var(--mx-primary))!important;color:#fff!important;border-color:transparent!important}
.mxai-theme-scope :where(.btn-secondary,.button-secondary,.btn-light,.button-light){background:var(--mx-surface-2)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope :where(.nav-link,.menu-link,.dropdown-item){color:var(--mx-text)}
.mxai-theme-scope :where(.nav-link.active,.menu-link.active,.is-active>.nav-link,.is-active>.menu-link){color:var(--mx-primary)!important;background:color-mix(in srgb,var(--mx-primary) 11%,var(--mx-surface))!important}
.mxai-theme-scope :where(hr,.divider,.separator){border-color:var(--mx-border)!important;color:var(--mx-border)!important}
/* Dark/system state owns generic shells as well, not only canonical .mx-* components. */
.mx-theme-dark .mxai-theme-scope,.mxai-theme-scope.mx-theme-dark{background:var(--mx-bg)!important;color:var(--mx-text)!important}
@media (prefers-color-scheme:dark){
  .mx-theme-system .mxai-theme-scope,.mxai-theme-scope.mx-theme-system{background:var(--mx-bg)!important;color:var(--mx-text)!important}
}

/* Specificity-safe control bridge: beats legacy `.card input{...!important}` without touching canonical CSS. */
.mxai-theme-scope input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),
.mxai-theme-scope select,.mxai-theme-scope textarea,.mxai-theme-scope .form-control,.mxai-theme-scope .form-select{background:var(--mx-surface)!important;color:var(--mx-input-text-color,var(--mx-text))!important;border-color:var(--mx-border)!important;border-radius:var(--mx-input-radius)!important}
.mxai-theme-scope table th,.mxai-theme-scope .table th,.mxai-theme-scope .dataTable th{background:var(--mx-surface-2)!important;color:var(--mx-muted)!important;border-color:var(--mx-border)!important}
.mxai-theme-scope table td,.mxai-theme-scope .table td,.mxai-theme-scope .dataTable td{background:var(--mx-surface)!important;color:var(--mx-text)!important;border-color:var(--mx-border)!important}
