/* Shared components are opt-in; other modules keep their existing layouts. */
[data-ux-workspace] { min-width:0; }
#topo [data-ux-workspace] :is(input,select,textarea,button,a,summary):focus-visible { outline:3px solid var(--mes-primary,#2563eb); outline-offset:3px; }
#topo [data-ux-workspace] :is(.btn,summary,.form-control,.form-select) { min-height:44px; }
#topo [data-ux-workspace] :is(h5,[id]) { scroll-margin-top:calc(var(--mes-header-height,80px) + 16px); }
.ux-section { border:1px solid var(--mes-border,#dce3ec); border-radius:10px; margin-bottom:16px; background:#fff; }
.ux-section > summary { padding:16px!important; margin:0!important; border:0!important; cursor:pointer; }
.ux-section > summary h5 { display:inline; font-size:1rem; border:0!important; padding:0!important; }
.ux-section > .row { padding:16px; margin:0; border-top:1px solid var(--mes-border,#dce3ec); }
.ux-actions { position:sticky; bottom:8px; z-index:8; display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:12px 16px; background:#fff; border:1px solid var(--mes-border,#dce3ec); border-radius:10px; box-shadow:0 -4px 16px #17203312; margin-top:20px; }
.ux-actions .btn { margin-top:0!important; }
.ux-actions-hint { margin-right:auto; font-size:.82rem; color:var(--mes-muted,#526176); }
.ux-criterion { border:1px solid var(--mes-border,#dce3ec); border-radius:10px; padding:16px; margin-bottom:16px; background:var(--mes-bg,#f6f8fb); }
.ux-criterion .ux-criterion-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:16px; }
.ux-criterion-grid > div { min-width:0; }
.ux-criterion-grid label { display:block; margin-bottom:6px; }
.ux-criterion-grid .ux-criterion-description { grid-column:1/-1; }
.ux-criterion .ux-criterion-actions { display:flex; flex-wrap:wrap; gap:12px; margin:16px 0; }
#topo .mes-supply .ux-stock-region { max-height:none; overflow:visible; border:0; }
#topo .mes-supply .ux-stock-table { width:100%; table-layout:fixed; border:1px solid var(--mes-border,#dce3ec); }
#topo .mes-supply .ux-stock-table th,#topo .mes-supply .ux-stock-table td { white-space:normal; overflow-wrap:anywhere; padding:12px; }
#topo .mes-supply .ux-stock-table :is(th,td):nth-child(3) { position:static; min-width:0; z-index:auto; }
.ux-stock-table .ux-stock-check { width:44px; }
.ux-stock-table .ux-stock-material { width:34%; }
.ux-stock-table .ux-stock-actions { width:190px; }
.ux-material-identity { display:flex; align-items:flex-start; gap:12px; }
.ux-material-identity > div { min-width:0; }
.ux-material-identity .ux-material-photo { flex-shrink:0; }
.ux-material-more { margin-top:8px; font-size:.85rem; }
.ux-material-more summary { font-weight:500!important; color:var(--mes-primary,#2563eb); }
.ux-material-more dl { margin:0; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; }
.ux-material-more dt { color:var(--mes-muted,#526176); font-size:.78rem; }
.ux-material-more dd { margin:0; }
.ux-stock-actions > div { display:flex; flex-wrap:wrap; gap:8px; }
.ux-stock-actions details { margin-top:8px; }
.ux-stock-actions summary { font-size:.82rem; color:var(--mes-muted,#526176); }
@media(max-width:1199px) {
 #topo .mes-supply .ux-stock-table,.ux-stock-table tbody { display:block; }
 .ux-stock-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
 .ux-stock-table tbody tr { display:grid; grid-template-columns:44px minmax(0,1fr) minmax(0,1fr); border-bottom:1px solid var(--mes-border,#dce3ec); padding:12px 0; }
 #topo .mes-supply .ux-stock-table tbody td { display:block; border:0; width:auto; background:transparent; text-align:left; }
 .ux-stock-table td[data-label]::before { content:attr(data-label); display:block; color:var(--mes-muted,#526176); font-size:.78rem; margin-bottom:6px; }
 .ux-stock-table .ux-stock-material { grid-column:2/-1; }
 .ux-stock-table .ux-stock-balance { grid-column:2; }
 .ux-stock-table .ux-stock-status,.ux-stock-table .ux-stock-actions { grid-column:2/-1; }
 .ux-stock-actions > div { display:inline-flex; margin-right:16px; }
 .ux-stock-actions details { display:inline-block; }
}
@media(max-width:575px) {
 .ux-actions { padding:10px; bottom:4px; gap:8px; }
 .ux-actions-hint { display:none; }
 .ux-actions .btn { flex:1; }
 .ux-criterion .ux-criterion-grid { grid-template-columns:minmax(0,1fr); }
 .ux-material-identity { flex-direction:column; }
 .ux-material-more dl { grid-template-columns:minmax(0,1fr); }
}
@media(max-height:500px) { .ux-actions { position:static; } }
@media print { .ux-actions { position:static; box-shadow:none; } .ux-stock-actions { display:none!important; } }

.ux-criterion-grid label { min-height:24px; }
.ux-criterion-grid input[type=checkbox] { width:24px; height:24px; }

.ux-confirmation { color:#166534; font-size:.85rem; flex-basis:100%; }

@media(max-width:575px) {
 .ux-stock-metrics > .col-md-4 { width:33.333333%; }
 .ux-stock-metrics .card { padding:10px!important; }
 .ux-stock-metrics .text-muted { font-size:.72rem; line-height:1.4; }
 .ux-stock-metrics .fs-3 { font-size:1.15rem!important; }
}
