/* Shared spacing and hierarchy. Colors continue to come from the approved themes. */
body.ws-ui .sidebar-head{align-items:center;gap:12px}
body.ws-ui .sidebar-head .brand-mark{flex:0 0 44px;width:44px;height:44px;margin:0;padding:2px;border-radius:10px}
body.ws-ui .sidebar-brand{flex:1;min-width:0}
body.ws-ui .sidebar-brand strong{display:block;line-height:1.3;letter-spacing:.02em}
body.ws-ui .sidebar-brand span{display:block;line-height:1.5;letter-spacing:.06em;margin-top:4px}
body.ws-ui .pc-fields+.actions{margin-top:16px;gap:12px;flex-wrap:wrap}
body.ws-ui .ws-product-row{display:grid;grid-template-columns:minmax(170px,240px) minmax(0,1fr);gap:24px;align-items:start}
body.ws-ui .ws-product-info{min-width:0;overflow-wrap:anywhere}
body.ws-ui .ws-product-info p{margin:12px 0;line-height:1.6}
body.ws-ui .ws-product-row .reference-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
body.ws-ui .ws-product-row .reference-gallery .ref-slot:first-child{grid-column:1/-1}
body.ws-ui .ws-product-row .product-ref-thumb{width:100%;height:auto;aspect-ratio:1;display:block}
body.ws-ui .ws-product-row .product-ref-thumb img{width:100%;height:100%;object-fit:contain}
body.ws-ui .ws-product-row .ref-download{max-width:100%;margin-top:8px}
body.ws-ui .p-products{display:grid;grid-template-columns:minmax(0,1fr);gap:0}
body.ws-ui .p-products .p-product{border:0;border-radius:0;background:transparent;padding:20px 0}
body.ws-ui .p-products .p-product:first-child{padding-top:0}
body.ws-ui .p-products .p-product:last-child{padding-bottom:0}
body.ws-ui .p-products .p-product+.p-product{border-top:1px solid var(--ws-line)}
body.ws-ui .p-products .p-reference-panel{border:0;background:transparent;padding:0;margin:0}
body.ws-ui .p-products .p-reference-panel h4{margin-top:0}
body.ws-ui .p-products .p-reference-photos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
body.ws-ui .p-products .p-reference-photos .p-photo:first-child{grid-column:1/-1}
body.ws-ui .p-products .p-photo{min-width:0;width:auto;margin:0}
body.ws-ui .p-products .p-photo figcaption{overflow-wrap:anywhere}
body.ws-ui .p-products .p-item-identity{gap:10px}
body.ws-ui .p-qc-visuals{gap:20px;margin:20px 0 24px}
body.ws-ui .p-fault-grid{gap:12px;margin:20px 0}
body.ws-ui .p-fault-grid label{padding:12px;align-items:center;gap:10px}
body.ws-ui .p-qc-item{margin-bottom:20px}
body.ws-ui .ws-disabled-selection{display:inline-flex;cursor:not-allowed;padding:4px}
body.ws-ui .ws-disabled-selection input{margin:0;pointer-events:none;opacity:.5}
body.ws-ui .ws-list-photo{display:block;flex:0 0 48px;width:48px;height:56px;padding:0;border:1px solid var(--ws-line);border-radius:7px;overflow:hidden;background:var(--ws-soft);cursor:zoom-in}
body.ws-ui .r49-product .ws-list-photo img{display:block;width:100%;height:100%;object-fit:contain;border:0;border-radius:0}
body.ws-ui :is(#sh-filter,#fin-filter){grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;align-items:end}
body.ws-ui :is(#sh-filter,#fin-filter)>.form-group{margin:0;min-width:0}
body.ws-ui :is(#sh-filter,#fin-filter)>.actions{align-self:end;min-height:40px;margin:0;gap:8px;flex-wrap:wrap}
body.ws-ui :is(#p-filters,#pc-filters){align-items:end;gap:12px}
body.ws-ui :is(#p-filters,#pc-filters)>label{min-width:140px;flex:1;display:flex;flex-direction:column;gap:6px}
body.ws-ui .table-tools-inline{grid-column:1/-1;flex:1 1 100%;padding:0;margin:0;border:0;background:transparent;justify-content:flex-end}
body.ws-ui .card-body>.table-tools:not(.table-tools-inline){padding-left:0;padding-right:0}
body.ws-ui .table-primary-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 0 auto}
body.ws-ui :is(.table-advanced,.table-column-picker,.wf-column-picker)>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;line-height:1.4;list-style:none}
body.ws-ui :is(.table-advanced,.table-column-picker,.wf-column-picker)>summary::-webkit-details-marker{display:none}
body.ws-ui :is(.table-advanced,.table-column-picker,.wf-column-picker)>summary:after{content:'';display:block;flex:0 0 7px;width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin:-4px 2px 0 0}
body.ws-ui :is(.table-advanced,.table-column-picker,.wf-column-picker)[open]>summary:after{transform:rotate(225deg);margin-top:4px}
body.ws-ui :is(#sh-import-form,#fin-import){display:grid;gap:16px;margin-top:20px}
body.ws-ui :is(#sh-import-form,#fin-import)>.btn{justify-self:start;margin:0}
body.ws-ui #sh-import-form .form-group{margin:0}
body.ws-ui .fin-page{gap:16px}
body.ws-ui .fin-page>.page-head,body.ws-ui .fin-page>.fin-tabs,body.ws-ui .fin-page>.r50-summary{margin:0}
body.ws-ui .fin-page .fin-selected-summary{gap:12px;margin:16px 0}
body.ws-ui .fin-page .card{margin:0}
.ws-image-hover{position:fixed;z-index:2000;box-sizing:border-box;display:grid;grid-template-rows:minmax(0,1fr) auto;padding:10px;gap:8px;border:1px solid var(--ws-line,#cbd5e1);border-radius:12px;background:var(--ws-surface,#fff);color:var(--ws-ink,#182238);box-shadow:0 16px 48px #0004;overflow:hidden;pointer-events:auto}
.ws-image-hover[hidden]{display:none}
.ws-image-hover img{display:block;width:100%;height:100%;min-height:0;object-fit:contain;border-radius:6px}
.ws-image-hover>div{font-size:12px;line-height:1.5;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
@media(max-width:760px){body.ws-ui .ws-product-row{grid-template-columns:minmax(140px,180px) minmax(0,1fr);gap:16px}body.ws-ui .table-primary-actions{width:100%;margin:0}body.ws-ui .table-primary-actions>.btn{flex:1}body.ws-ui :is(#sh-filter,#fin-filter){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){body.ws-ui .ws-product-row{grid-template-columns:minmax(0,1fr)}body.ws-ui .ws-product-row>.reference-gallery,body.ws-ui .p-products .p-reference-panel{max-width:280px;width:100%}body.ws-ui :is(#sh-filter,#fin-filter){grid-template-columns:minmax(0,1fr)}body.ws-ui .table-tools-inline{justify-content:start}}

/* 0.9.12: one spacing system for both portals, retaining approved color tokens. */
.ws-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
body.ws-ui{--ws-space-field:16px;--ws-space-section:24px;--ws-control-height:40px}
body.ws-ui .content{padding:24px;min-width:0}
body.ws-ui .topbar{min-height:64px;height:auto;padding:12px 24px;gap:16px}
body.ws-ui .topbar-actions{flex-wrap:wrap;justify-content:flex-end}
body.ws-ui .page-head{margin:0 0 24px;gap:16px;align-items:center;flex-wrap:wrap}
body.ws-ui .page-head>div{min-width:0}
body.ws-ui .page-head h1{overflow-wrap:anywhere;line-height:1.35}
body.ws-ui .page-head p{margin:8px 0 0;line-height:1.6}
body.ws-ui :is(.card-head,.r49-list-head){padding:20px 24px;gap:16px;flex-wrap:wrap}
body.ws-ui .card-head h3{line-height:1.5;overflow-wrap:anywhere}
body.ws-ui .card-body{padding:24px;min-width:0}
body.ws-ui :is(.card-foot,.card-footer){padding:16px 24px}
body.ws-ui :is(#main,#factory-main)>.card+.card{margin-top:24px}
body.ws-ui :is(.ws-profile,.ws-form-grid,.ws-order-form,.ws-product-form,.pc-layout,.pc-sections,.gs-content){gap:24px}
body.ws-ui :is(.ws-profile,.ws-profile-column){align-items:start;min-width:0}
body.ws-ui :is(.ws-profile-column,.ws-form-aside){display:grid;gap:24px;align-content:start}
body.ws-ui .ws-profile-card{gap:16px;margin:0;align-items:center}
body.ws-ui .ws-profile-card .avatar{width:64px;height:64px;flex:0 0 64px;font-size:22px;line-height:1;display:grid;place-items:center;overflow:hidden}
body.ws-ui .ws-profile-card .avatar img{width:100%;height:100%;object-fit:cover;display:block}
body.ws-ui .ws-profile-card>div:last-child{min-width:0;overflow-wrap:anywhere}
body.ws-ui .ws-profile-card+form{margin-top:24px}
body.ws-ui .ws-account-permissions{display:grid;gap:20px}
body.ws-ui .ws-account-permissions h4{margin:0 0 8px;font-size:13px}
body.ws-ui .ws-account-permissions ul{padding-left:20px;margin:0;display:grid;gap:8px;line-height:1.6}
body.ws-ui .ws-form-stack{display:grid;gap:16px}
body.ws-ui .ws-form-stack>.form-help{margin:0;line-height:1.6;color:var(--ws-muted)}
body.ws-ui .ws-form-stack>.ws-form-actions{margin-top:8px}
body.ws-ui label.form-group{gap:8px;min-width:0}
body.ws-ui :is(.form-control,.form-select,.form-textarea){max-width:100%;min-width:0}
body.ws-ui :is(.ws-form-grid,.pc-fields){gap:16px}
body.ws-ui .gs-fields{display:grid;gap:16px}
body.ws-ui .gs-fields>.notice,body.ws-ui .gs-fields .form-group{margin:0}
body.ws-ui .gs-save{margin:8px 0 0;padding-top:24px}
body.ws-ui .gs-content .data-table .btn{white-space:normal;line-height:1.5}
body.ws-ui .gs-content .card-body>.ws-form-grid+form{margin-top:24px}
body.ws-ui .gs-content .card-body>form+.table-wrap{margin-top:24px}
body.ws-ui .gs-fields>h3{margin:8px 0 0}
body.ws-ui .gs-paging{gap:12px;flex-wrap:wrap;margin-top:24px}
body.ws-ui .gs-paging>span{margin-right:auto}
body.ws-ui .brand-mark.brand-mark-image{padding:0;background:transparent;border:0;box-shadow:none}
body.ws-ui .brand-mark-image img{display:block;object-fit:contain;width:100%;height:100%}

/* Search has one accessible label, without a second visible line above it. */
body.ws-ui .table-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:16px 24px;margin:0;background:var(--ws-surface)}
body.ws-ui .table-tools .table-search-field{flex:1 1 260px;max-width:none;min-width:0;display:block;margin:0}
body.ws-ui :is(.table-tools,.ws-filter-main) :is(.btn,.form-control,.form-select,summary){height:40px;min-height:40px;box-sizing:border-box}
body.ws-ui :is(.table-tools,.ws-filter-main) :is(.btn,summary){display:inline-flex;align-items:center;justify-content:center;line-height:1.4;padding:8px 12px}
body.ws-ui :is(.table-tools,.ws-filter-main) .form-control{width:100%;font-size:13px}
body.ws-ui form.ws-list-filter{display:block;padding:0;margin:0;border:0;background:transparent;border-radius:0}
body.ws-ui .card>form.ws-list-filter{padding:24px}
body.ws-ui .ws-list-filter .ws-filter-main{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0}
body.ws-ui .ws-filter-main>label.ws-search-field{display:block;flex:1 1 260px;min-width:0;max-width:none;margin:0;padding:0}
body.ws-ui .ws-filter-main .table-tools-inline{display:flex;flex:0 0 auto;grid-column:auto;width:auto;padding:0;margin:0;border:0;background:transparent;gap:12px}
body.ws-ui .ws-filter-details{position:relative;flex:0 0 auto}
body.ws-ui .ws-filter-details>summary{border:1px solid var(--ws-line-strong);border-radius:8px;background:var(--ws-surface);color:var(--ws-ink);cursor:pointer;gap:12px;list-style:none;white-space:nowrap}
body.ws-ui .ws-filter-details>summary::-webkit-details-marker{display:none}
body.ws-ui .ws-filter-details>summary:after{content:'';width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin:-4px 2px 0 0}
body.ws-ui .ws-filter-details[open]>summary:after{transform:rotate(225deg);margin-top:4px}
body.ws-ui .ws-filter-panel{position:absolute;z-index:45;top:calc(100% + 8px);right:0;width:min(540px,calc(100vw - 64px));padding:20px;border:1px solid var(--ws-line-strong);border-radius:12px;background:var(--ws-surface);box-shadow:0 12px 32px #0002;max-height:calc(100dvh - 180px);overflow:auto}
body.ws-ui .ws-filter-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
body.ws-ui .ws-filter-fields>label{display:flex;flex-direction:column;gap:8px;min-width:0;width:auto;max-width:none;flex:none;margin:0;font-size:12px}
body.ws-ui .ws-filter-fields :is(input,select){width:100%;height:40px;min-height:40px;box-sizing:border-box}
body.ws-ui .ws-filter-reset{margin-top:16px;padding-top:16px;border-top:1px solid var(--ws-line)}
body.ws-ui .table-column-panel{width:260px;min-width:0;max-width:calc(100vw - 48px);overflow-x:hidden;padding:12px;box-sizing:border-box}
body.ws-ui .table-column-panel label.check{display:flex;flex-direction:row;align-items:flex-start;gap:10px;width:100%;min-width:0;max-width:100%;margin:0;padding:8px;flex:none;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box;line-height:1.5}
body.ws-ui .table-column-panel label.check input{width:16px;height:16px;min-height:16px;flex:0 0 16px;padding:0;margin:2px 0 0}
body.ws-ui .table-column-panel>.btn{width:100%;margin-top:8px}
body.ws-ui .table-advanced-panel{max-width:calc(100vw - 48px);box-sizing:border-box}
body.ws-ui .table-pager{padding:16px 24px;gap:12px;background:var(--ws-soft);align-items:center}
body.ws-ui .table-pager :is(.btn,select){height:40px;min-height:40px;font-size:12px}
body.ws-ui .table-tools[hidden]{display:none!important}
body.ws-ui .ws-action-column{min-width:120px;vertical-align:middle;text-align:left}
body.ws-ui .ws-action-column :is(.actions,.pc-row-actions){justify-content:flex-start;gap:8px}
body.ws-ui .ws-export-controls{display:flex;gap:12px;align-items:end;flex-wrap:wrap;min-width:0}
body.ws-ui .ws-export-controls>.form-group{margin:0;min-width:160px;flex:0 1 190px}
body.ws-ui .ws-export-controls :is(.btn,.form-select){height:40px;min-height:40px}
body.ws-ui .r49-actions{align-items:end;gap:12px}
body.ws-ui .ws-seller-invoices>.fin-selected-summary{margin:16px 24px;padding:16px}
body.ws-ui .ws-seller-invoices>.actions{margin:16px 24px;gap:8px}
body.ws-ui .card-body>.toolbar{padding:0;border:0;background:transparent}
body.ws-ui :is(.r49-list-head,.ws-profile-card,.gs-account-summary,.ws-role,.ws-resource,.api-row-actions){overflow-wrap:anywhere}
body.ws-ui .data-table th{vertical-align:middle}
body.ws-ui .data-table :is(th,td){line-height:1.55}
body.ws-ui .data-table .empty{padding:32px 24px;text-align:center}
body.ws-ui :is(.btn,summary,input,select,textarea):focus-visible{outline:2px solid var(--ws-accent);outline-offset:3px}
@media(max-width:760px){
 body.ws-ui .content{padding:16px}
 body.ws-ui .topbar{padding:12px 16px}
 body.ws-ui :is(.card-head,.card-body,.r49-list-head){padding:16px}
 body.ws-ui :is(.card-foot,.card-footer,.table-tools,.table-pager){padding:16px}
 body.ws-ui .card>form.ws-list-filter{padding:16px}
 body.ws-ui .ws-filter-main>label.ws-search-field{flex-basis:100%}
 body.ws-ui .ws-filter-main{gap:8px}
 body.ws-ui .ws-filter-details[open]{flex-basis:100%;order:5}
 body.ws-ui .ws-filter-panel{position:static;width:100%;max-height:none;margin-top:12px;box-shadow:none}
 body.ws-ui .ws-seller-invoices>.fin-selected-summary,body.ws-ui .ws-seller-invoices>.actions{margin:16px}
 body.ws-ui .ws-export-controls{width:100%}
 body.ws-ui .ws-export-controls>.form-group{flex:1;min-width:0}
 body.ws-ui .table-tools .table-search-field{flex-basis:100%}
}
@media(max-width:480px){body.ws-ui .ws-filter-fields{grid-template-columns:minmax(0,1fr)}body.ws-ui .ws-export-controls>.btn{flex:1}body.ws-ui .ws-profile-card .avatar{width:56px;height:56px;flex-basis:56px;font-size:20px}}

body.ws-ui .table-column-panel .check>span{flex:1;min-width:0;overflow-wrap:anywhere}
body.ws-ui :is(.ws-list-filter,.table-tools:not(.table-tools-inline)){container-type:inline-size}
@container(max-width:620px){
 .ws-filter-main>label.ws-search-field,.table-tools>.table-search-field{flex-basis:100%!important}
 .ws-filter-main .ws-filter-details[open]{flex-basis:100%;order:5}
 .ws-filter-main .ws-filter-panel{position:static;width:100%;max-height:none;margin-top:12px;box-shadow:none}
}


/* 0.9.14: order search/filter on the left; export format/action on the right. */
body.ws-ui .ws-orders-list>.r49-list-head{padding-bottom:16px;border-bottom:0}
body.ws-ui .ws-orders-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:16px 24px;padding:0 24px 24px;min-width:0}
body.ws-ui .ws-orders-toolbar>form{flex:1 1 620px;min-width:0;margin:0;padding:0}
body.ws-ui .ws-orders-toolbar>.ws-export-controls{flex:0 0 auto;align-items:center;flex-wrap:nowrap;width:auto;margin-left:auto}
body.ws-ui .ws-orders-toolbar .ws-export-controls>.form-group{display:block;flex:0 1 160px;width:160px;min-width:0;margin:0}
body.ws-ui .ws-orders-toolbar .ws-export-controls .form-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
body.ws-ui .ws-orders-toolbar .ws-export-controls>.btn{white-space:nowrap}
@media(max-width:760px){
 body.ws-ui .ws-orders-toolbar{padding:0 16px 16px;gap:16px}
 body.ws-ui .ws-orders-toolbar>.ws-export-controls{width:100%;margin-left:0}
 body.ws-ui .ws-orders-toolbar .ws-export-controls>.form-group{flex:1;width:auto}
}


/* 0.9.16: keep page navigation and page size in one aligned control row. */
body.ws-ui .r49-pager{padding:16px 24px;align-items:center;gap:12px 24px}
body.ws-ui .r49-pager>span{flex:0 0 auto;white-space:nowrap;line-height:1.5}
body.ws-ui .r49-pager>.r49-actions{display:flex;flex:0 1 auto;align-items:center;flex-wrap:nowrap;gap:12px;width:auto;max-width:100%;margin-left:auto;overflow-x:auto}
body.ws-ui .r49-pager>.r49-actions>span{flex:0 0 auto;white-space:nowrap;line-height:1.5}
body.ws-ui :is(.r49-pager,.table-pager) :is(.btn,select){box-sizing:border-box;flex:0 0 auto;height:40px;min-height:40px;margin:0;font-size:12px}
body.ws-ui .r49-pager .btn{display:inline-flex;align-items:center;justify-content:center;line-height:1.4;white-space:nowrap}
body.ws-ui :is(.r49-pager,.table-pager) select{width:144px;min-width:0;max-width:100%}
@media(max-width:760px){body.ws-ui .r49-pager{padding:16px}}
@media(max-width:600px){
 body.ws-ui .r49-pager{gap:12px}
 body.ws-ui .r49-pager>.r49-actions{gap:8px}
 body.ws-ui .r49-pager .btn{padding:8px}
 body.ws-ui :is(.r49-pager,.table-pager) select{width:124px}
}

.table-filter-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:8px 0}.table-filter-chips[hidden]{display:none}.table-filter-chips .btn{min-height:28px;padding:4px 8px;font-size:11px;line-height:18px}.table-tools>.table-tool-field{display:flex;align-items:center;gap:8px;flex-direction:row}.table-tools>.table-tool-field>span{white-space:nowrap}.table-tools .btn,.table-tools select,.table-tools input{height:34px;min-height:34px}.table-pager{align-items:center}.ws-filter-details .ws-filter-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:12px}.ws-filter-panel{min-width:min(600px,85vw)}
