/* MORTX DataTable Page Template v1 — shared presentation layer.
   The existing per-page markup, IDs, handlers, DataTables options and data remain intact.
   Component ownership: header / actions / table toolbar / table / footer. */
:root{--mdp-gap:14px;--mdp-control-height:36px;--mdp-border:var(--mg-border,#dce3ec);--mdp-radius:var(--mg-control-radius,6px)}
body[data-management-page] .mdp-page{box-sizing:border-box;min-width:0;max-width:100%}
body[data-management-page] .mdp-header{display:flex!important;align-items:center!important;justify-content:space-between!important;flex-wrap:wrap!important;gap:12px!important;min-width:0!important;max-width:100%!important}
body[data-management-page] .mdp-heading{flex:1 1 220px;min-width:0}
body[data-management-page] .mdp-actions{display:flex!important;flex:0 1 auto!important;align-items:center;justify-content:flex-start;flex-wrap:wrap!important;gap:8px;min-width:0;max-width:100%}
body[data-management-page] .mdp-actions .btn{white-space:normal;min-height:var(--mdp-control-height)}
body[data-management-page] .mdp-table-region{box-sizing:border-box;min-width:0;max-width:100%;width:100%}
body[data-management-page] .mdp-table-region .dt-container{width:100%;min-width:0;max-width:100%}
body[data-management-page] .mdp-table-region .dt-layout-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;min-width:0}
body[data-management-page] .mdp-table-region .dt-layout-row>.dt-layout-cell{min-width:0;max-width:100%}
body[data-management-page] .mdp-table-region .dt-layout-row:not(.dt-layout-table)>.dt-layout-cell:last-child{margin-left:auto}
body[data-management-page] .mdp-table-region .dt-search input,
body[data-management-page] .mdp-table-region .dt-length select{box-sizing:border-box;min-height:var(--mdp-control-height);max-width:100%}
body[data-management-page] .mdp-table-region .dt-layout-table>.dt-layout-cell{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
body[data-management-page] .mdp-table-region table.dataTable{min-width:100%;max-width:none}
@media(max-width:680px){
 body[data-management-page] .mdp-header{align-items:flex-start!important}
 body[data-management-page] .mdp-heading{flex-basis:100%}
 body[data-management-page] .mdp-actions{width:100%;flex-basis:100%!important}
 body[data-management-page] .mdp-table-region .dt-layout-row:not(.dt-layout-table)>.dt-layout-cell:last-child{margin-left:0}
}

/* The only page-header action is native Refresh; all other actions
   are moved by datatable-options.js to the DataTables toolbar. */
body[data-management-page] .mdp-header .mdp-refresh-host{
 display:flex!important;align-items:center;justify-content:flex-end;
 gap:8px;flex:0 0 auto;min-width:0;margin-left:auto;
}
body[data-management-page] .mdp-header .mdp-refresh-host > :not([hidden]){
 max-width:100%;
}
body[data-management-page] .mdp-table-region .dt-buttons{
 display:flex;flex-wrap:wrap;align-items:center;gap:6px;max-width:100%;
}
