/* Archive and configuration tables only. Keep detail editors, output documents,
   category trees, permission semantics and mobile cards outside this scope. */
:root {--settings-list-gutter:16px;}
@media screen and (max-width:768px) {:root {--settings-list-gutter:10px;}}

/* Remove old nested card padding without changing the existing scrollers. */
:is(#page-material,#page-region)>div {padding:var(--settings-list-gutter)!important;}
:is(#page-material,#page-region)>div>.card {padding:0;}
#page-staff>div>div:last-child {min-width:0;}
#page-staff>div>div:last-child>div:has(>table.data-table) {margin-inline:var(--settings-list-gutter);min-width:0;}
#page-staff .data-table {min-width:460px;}
#page-externalAccounts>div {padding:var(--settings-list-gutter)!important;}
#page-brand-management {padding:var(--settings-list-gutter)!important;overflow:auto;}
#page-brand-management>table {min-width:340px;}
#page-home .sales-company-management {padding:var(--settings-list-gutter);}
.sales-company-management .sales-company-table-wrap {border:0;border-radius:0;}
#page-product-create .product-create-page {padding:var(--settings-list-gutter);}
#page-product-create .product-create-table {border:0;border-radius:0;}
:is(#page-users,#page-autoTask,#page-logs)>.card {padding:var(--settings-list-gutter);}
.aux-settings-page>.card {padding:var(--settings-list-gutter);}
.automatic-settings-panel .automatic-receipt-card {padding:var(--settings-list-gutter);}
.document-number-settings {padding:var(--settings-list-gutter);}
.operator-access-preview .oap-content {padding:var(--settings-list-gutter);}
:is(.settings-table-wrap,.number-settings-scroll,.permission-matrix-scroll,.wxp-table-scroll,.operator-access-preview .oap-matrix-scroll) {border:0;border-radius:0;}

:is(#materialTable,#materialModal table,#regionTable,#page-staff .data-table,#page-brand-management>table,.sales-company-table,#page-product-create .product-create-grid,#productCreatePreviewBox .data-table,#usersTable,#autoTaskTable,#logsTable,#serverConnectionsTable,#formulaTable,#businessQuerySourcesContent .settings-table-wrap>table,#externalAccountList>table,.automatic-settings-history table,.document-number-settings .number-settings-table,.permission-function-matrix,.wxp-table,.wxp-log-scroll>table,.status-settings .status-matrix,.operator-access-preview .oap-matrix,.operator-access-preview .oap-table) {border-collapse:separate!important;border-spacing:0;border:1px solid #cbd7e5;border-radius:5px;}
:is(#materialTable,#materialModal table,#regionTable,#page-staff .data-table,#page-brand-management>table,.sales-company-table,#page-product-create .product-create-grid,#productCreatePreviewBox .data-table,#usersTable,#autoTaskTable,#logsTable,#serverConnectionsTable,#formulaTable,#businessQuerySourcesContent .settings-table-wrap>table,#externalAccountList>table,.automatic-settings-history table,.document-number-settings .number-settings-table,.permission-function-matrix,.wxp-table,.wxp-log-scroll>table,.status-settings .status-matrix,.operator-access-preview .oap-matrix,.operator-access-preview .oap-table)>:is(thead,tbody)>tr>:is(th,td),
.automatic-settings-history>table>tr>th {box-sizing:border-box;padding:6px 11px!important;border-right:1px solid #d7e0eb;border-bottom:1px solid #e2e8f0;}
:is(#materialTable,#materialModal table,#regionTable,#page-staff .data-table,#page-brand-management>table,.sales-company-table,#page-product-create .product-create-grid,#productCreatePreviewBox .data-table,#usersTable,#autoTaskTable,#logsTable,#serverConnectionsTable,#formulaTable,#businessQuerySourcesContent .settings-table-wrap>table,#externalAccountList>table,.automatic-settings-history table,.document-number-settings .number-settings-table,.permission-function-matrix,.wxp-table,.wxp-log-scroll>table,.status-settings .status-matrix,.operator-access-preview .oap-matrix,.operator-access-preview .oap-table)>thead>tr>th,
#page-brand-management>table>tbody>tr:has(>th)>th,
.automatic-settings-history>table>tr>th {height:40px;white-space:nowrap;}
:is(#materialTable,#materialModal table,#regionTable,#page-staff .data-table,#page-brand-management>table,.sales-company-table,#productCreatePreviewBox .data-table,#usersTable,#autoTaskTable,#logsTable,#serverConnectionsTable,#formulaTable,#businessQuerySourcesContent .settings-table-wrap>table,#externalAccountList>table,.automatic-settings-history table,.document-number-settings .number-settings-table,.operator-access-preview .oap-table,.wxp-log-scroll>table)>tbody>tr:has(>td)>td {height:43px;}
:is(#materialTable,#materialModal table,#regionTable,#page-staff .data-table,#page-brand-management>table,.sales-company-table,#page-product-create .product-create-grid,#productCreatePreviewBox .data-table,#usersTable,#autoTaskTable,#logsTable,#serverConnectionsTable,#formulaTable,#businessQuerySourcesContent .settings-table-wrap>table,#externalAccountList>table,.automatic-settings-history table,.document-number-settings .number-settings-table,.permission-function-matrix,.wxp-table,.wxp-log-scroll>table,.status-settings .status-matrix,.operator-access-preview .oap-matrix,.operator-access-preview .oap-table)>:is(thead,tbody)>tr>:last-child,
.automatic-settings-history>table>tr>th:last-child {border-right:0;}
:is(#materialTable,#materialModal table,#regionTable,#page-staff .data-table,#page-brand-management>table,.sales-company-table,#page-product-create .product-create-grid,#productCreatePreviewBox .data-table,#usersTable,#autoTaskTable,#logsTable,#serverConnectionsTable,#formulaTable,#businessQuerySourcesContent .settings-table-wrap>table,#externalAccountList>table,.automatic-settings-history table,.document-number-settings .number-settings-table,.permission-function-matrix,.wxp-table,.wxp-log-scroll>table,.status-settings .status-matrix,.operator-access-preview .oap-matrix,.operator-access-preview .oap-table,.wxp-log-scroll>table)>tbody>tr:last-child>:is(th,td) {border-bottom:0;}

#materialModal>div {box-sizing:border-box;max-width:calc(100vw - 16px);padding:var(--settings-list-gutter)!important;}
#materialModal>div>div:has(>table) {border:0!important;border-radius:0!important;overflow:auto;}
.wxp-log-scroll {border:0;border-radius:0;}

/* Inputs still fill product cells. Do not pad the cell around an editor. */
#page-product-create .product-create-grid>tbody>tr>td:has(>input) {padding:0!important;}
#page-product-create .product-create-grid>tbody>tr>td>input.form-input {box-sizing:border-box;height:42px;margin:0;padding:0 8px;}
#page-product-create .product-create-grid>tbody>tr>td {height:43px;}
/* Matrix rows grow with their content; category indentation stays semantic. */
#mainWrap .status-settings .status-matrix .status-matrix-child>td:first-child {padding-left:22px!important;}
:is(#materialTable,#materialModal table,#regionTable,#page-staff .data-table)>tbody>tr>td>.btn {box-sizing:border-box;min-height:28px;height:28px;padding:2px 8px;line-height:20px;}

/* Customer lookups join the same control column as plain quotation inputs. */
.quotation-live-page .quotation-customer-lookup-control {display:flex;flex:1;min-width:0;width:100%;}
.quotation-live-page .quotation-customer-lookup-control>input {width:100%;max-width:none;padding-right:36px;}
.quotation-application-dialog>label>.quotation-customer-lookup-control {box-sizing:border-box;width:100%;max-width:none;min-width:0;}
.quotation-application-dialog:not(.special-application-dialog) .quotation-customer-lookup-control>input {box-sizing:border-box;width:100%;max-width:none;height:36px;min-height:36px;padding-right:40px;}
.quotation-application-dialog .quotation-customer-lookup-trigger {margin:0;}
