/* Shared geometry. Compact tables keep their density; controls share alignment. */
:root{--control-height:36px;--control-compact:30px;--control-icon:16px;--control-gap:8px}
button{line-height:20px;vertical-align:middle;min-width:0;max-width:100%;flex-shrink:0}
button>.icon{display:block;width:var(--control-icon);height:var(--control-icon);flex:none;margin:0}
button.small{height:var(--control-compact);padding:4px 10px;line-height:20px;font-size:12px;gap:6px}
.actions{align-items:center;gap:var(--control-gap)}
.actions>button,.modal-foot>button,.panel-header>button,.heading .actions>button,.topbar>button{min-height:var(--control-height);padding-block:7px;line-height:20px}
.actions>button.small,.panel-header>button.small{min-height:var(--control-compact);height:var(--control-compact);padding-block:4px}
.field{min-width:0;line-height:16px}
.field>input:not([type=checkbox]):not([type=radio]),.field>select{height:var(--control-height);min-height:var(--control-height);padding-top:7px;padding-bottom:7px;line-height:20px}
input,select,textarea{vertical-align:middle}
input[type=checkbox],input[type=radio],.check{width:14px;height:14px;min-width:14px;min-height:14px;margin:0;flex:none;vertical-align:middle;accent-color:var(--green)}
select:not([hidden]){line-height:20px;background-position:right 10px center!important;background-size:14px!important;padding-right:32px!important}
@supports(appearance:base-select){select:not([hidden]){display:inline-flex;align-items:center;background-image:none!important;padding-right:10px!important}select::picker-icon{align-self:center;margin-top:-4px;margin-left:auto;flex:none}}
/* Numeric inputs do not gain a different baseline from browser spin controls. */
input[type=number]{font-variant-numeric:tabular-nums}
.table-action-cell{width:1%;white-space:nowrap;text-align:right}
.table-action-cell>.actions{justify-content:flex-end;flex-wrap:nowrap}
.directory-content .table-action-cell{padding:12px 18px}
.directory-content .table-action-cell button{height:30px;min-height:30px;margin:0;padding:4px 10px}
.directory-navigation>button{min-height:40px;line-height:18px;align-items:center}
.directory-navigation .pill-number{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 5px;line-height:1}
.directory-navigation>button>.icon{width:16px;height:16px}
/* Row editing and table selects always fit the row rather than the form size. */
:is(table,.registry-control-row,.component-page-size) select:not([hidden]){height:30px;min-height:30px;padding-top:4px!important;padding-bottom:4px!important;line-height:20px}
:is(.edit-table,#line-table,.packing-layout-table) input:not([type=checkbox]):not([type=radio]){height:30px;min-height:30px;line-height:20px;padding-top:4px;padding-bottom:4px}
.component-actions>button[data-action="edit-component"]{width:28px;height:28px;min-height:28px;padding:5px;margin:0}
.component-actions>button[data-action="edit-component"]>.icon{width:14px;height:14px}
.registry-control-row select:not([hidden]),.registry-control-row .registry-tools button{height:32px;min-height:32px}
.registry-control-row .search{height:32px;align-items:center}
.registry-control-row .search input{height:30px;padding-block:5px}
.pagination button{width:30px;height:30px;min-height:30px;padding:0;line-height:1}
.pagination{gap:6px;align-items:center}
.modal-head{gap:16px;align-items:center}
.modal-head h2{min-width:0;line-height:24px}
.modal-head>button{display:inline-flex;width:30px;height:30px;min-width:30px;min-height:30px;padding:0;margin:0;align-items:center;justify-content:center;line-height:1}
.modal-foot{align-items:center;flex-wrap:wrap;gap:8px}
.modal-foot>.actions{margin-left:auto}
.modal .form-grid>.field{align-self:start}
.project-detail-row{align-items:center;gap:8px}
.project-detail-row input{height:36px;min-height:36px;line-height:20px;padding:7px 10px;border:1px solid var(--line);border-radius:6px}
.project-detail-row>button{width:30px;height:30px;padding:0}
.savebar{align-items:center;gap:12px}
.savebar>.actions{justify-content:flex-end;row-gap:8px}
.invoice-upload-button{height:36px;line-height:20px;align-items:center;padding:7px 12px}
.invoice-upload-button>.icon{width:16px;height:16px;flex:none}
/* Intentional text links, tabs and help icons do not become full-size buttons. */
.tab,.orders-view-tab,.packing-wizard-nav button,.registry-sort,.link-button,.mm-invoice-link{min-height:0}
button.distribution-info,.field-legend-heading button.distribution-info{width:14px;height:14px;min-height:14px;min-width:14px;padding:0;line-height:1}
.packing-legend-heading>button{width:24px;height:24px;padding:3px;line-height:1}
.mega-manual-modal .mm-tools select,.mega-manual-modal .mm-linkbar select{height:30px;min-height:30px;padding-top:4px;padding-bottom:4px}
.mega-manual-modal .mm-linkbar button{height:30px;min-height:30px;padding-block:4px}
.mega-manual-modal .mm-header-filter .mm-filter{height:26px!important;min-height:26px!important;line-height:18px}
.mega-manual-modal .mm-sort{height:24px;min-height:24px;width:20px;min-width:20px;padding:2px;line-height:18px}
.mega-manual-modal .mm-invoice-link{padding:0;line-height:20px}
.new-order-methods>button{height:auto;min-height:76px;align-items:center;padding:16px}
.profile button{width:28px;height:28px;padding:5px;line-height:1}
@media(max-width:1000px){.heading{flex-wrap:wrap}.heading .actions{margin-left:auto}.savebar{flex-wrap:wrap}.savebar>.actions{margin-left:auto}.panel-header{flex-wrap:wrap}}
@media(max-width:650px){.toolbar{flex-wrap:wrap}.toolbar .search{min-width:0;flex:1 1 180px}.table-action-cell>.actions{flex-wrap:wrap}.modal-foot>button{flex:0 1 auto}}
/* Packing subcolumns share one grid, including empty placeholders. */
.packing-document-head,.packing-document-row:has(.packing-document-review){grid-template-columns:14px 120px 110px 104px 120px 84px;column-gap:10px;align-items:center}
.packing-document-head{min-width:702px}
.packing-document-row:has(.packing-document-review){min-width:702px}
.packing-document-placeholder,.packing-document-flight,.packing-document-date{line-height:20px}
.packing-document-row:has(.packing-document-review) .packing-document-review{margin-left:0}
.packing-document-review .badge{white-space:normal;line-height:16px}
/* Nested invoice editors use the same compact inputs as the parent tables. */
.modal table input:not([type=checkbox]):not([type=radio]){height:30px;min-height:30px;padding:4px 8px;border:1px solid var(--line,#dce5e1);border-radius:6px;background:#fff;color:var(--ink);font:inherit;line-height:20px;box-sizing:border-box}
.mega-manual-modal .mm-left th:nth-child(4){min-width:110px}
.mega-manual-modal .mm-header-filter .mm-filter{min-width:58px!important}
/* Component registry: identity first, supporting data second. */
.components-registry-table tbody td{color:#000}
.components-registry-table tbody td[data-column="name"]>strong{font-size:13px;font-weight:400;line-height:20px;color:inherit}
.components-registry-table tbody td:is([data-column="date"],[data-column="pi"],[data-column="creator"]){color:#000;font-size:12px}
.components-registry-table tbody td:is([data-column="legal_entity"],[data-column="project"],[data-column="project_detail"],[data-column="broker"]){font-size:12px}
.components-registry-table tbody .muted,.components-registry-table tbody td.registry-zero{color:#868686;font-weight:400}
.components-registry-table tbody .component-order-chip{background:#f4f7f5;border-color:#e3eae6;font-weight:500;color:#000}
.components-registry-table tbody .component-order-chip:hover,.components-registry-table tbody .component-order-chip:focus-visible{background:#e6f0eb;border-color:#a9c4b6;color:#000}
.components-registry-table .component-actions>button[data-action="edit-component"]{background:#f2f7f4;border-color:#cadbd1;color:#215f4c}
.components-registry-table .component-actions>button[data-action="edit-component"]:hover,.components-registry-table .component-actions>button[data-action="edit-component"]:focus-visible{background:#dcece3;border-color:#79a28b;color:#143e2d}
.components-registry-table tbody tr:has(.component-select:checked)>td{background:#eaf4ee}
.components-registry-table tbody tr:has(.component-select:checked)>td[data-column="name"]{box-shadow:inset 3px 0 #347255}
.components-registry-table tbody tr.component-received td[data-column="name"]>strong{color:#8b9691}
/* Orders registry */
.orders-registry .registry-control-row {
 display:flex;
 align-items:center;
 flex-wrap:wrap;
 gap:6px 14px;
 padding:6px 12px;
 min-height:0;
 border-bottom:1px solid var(--line);
}
.orders-registry .orders-view-tabs {flex:none;align-self:center;align-items:center;gap:6px;padding:0;border:0;overflow:visible}
.orders-registry .orders-view-tabs .tab {display:inline-flex;align-items:center;height:32px;min-height:32px;padding:4px 10px;white-space:nowrap}
.registry-query {display:flex;align-items:center;gap:6px;flex:1 1 390px;min-width:0;padding:0}
.registry-query .search {flex:1 1 190px;min-width:110px;max-width:340px;width:auto;margin:0;height:32px}
.registry-query .search input {width:100%;min-width:0}
.registry-query select {height:32px;min-height:32px;max-width:190px;padding:4px 26px 4px 8px;font-size:12px}
.orders-registry .registry-tools {gap:6px;padding:0;margin-block:0;align-items:center}
.registry-tools button {padding:4px 10px;font-size:12px;white-space:nowrap}
.registry-tools button .icon {width:15px;height:15px}
.registry-panel-toggle[aria-expanded="true"] {border-color:#acc5b8;background:#eaf3ed;color:var(--green)}
.registry-panel-toggle .pill-number {padding:1px 5px;margin-left:2px}
.component-filter-chips {align-items:center;padding:6px 12px;background:#f8faf9;border-bottom:1px solid var(--line)}
.component-filter-chips button {display:inline-flex;align-items:center;gap:6px;max-width:100%;min-height:26px;padding:3px 8px}
.component-filter-chips button span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.component-filter-chips button .icon {width:12px;height:12px;flex:none}

.registry-workspace {display:grid;grid-template-columns:minmax(0,1fr);min-width:0;align-items:start}
.registry-workspace.filters-open {grid-template-columns:minmax(0,1fr) 260px}
.registry-workspace>.components-scroll {min-width:0}
.registry-filter-sidebar {
 border-left:1px solid var(--line);
 background:#f8faf9;
 padding:12px;
 max-height:var(--registry-table-height,calc(100vh - 180px));
 overflow:auto;
}
.registry-filter-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.registry-filter-heading>button {display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-height:28px;padding:5px}
.registry-filter-sidebar .component-filter-fields {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:0}
.registry-filter-sidebar .component-filter-fields select {width:100%;max-width:none}
.registry-filter-sidebar .field {font-size:12px;color:#526a5e}
.registry-column-options {display:grid;gap:3px;margin-bottom:12px}
.registry-column-option {min-height:32px;padding:0 0 0 4px;border-radius:5px}
.registry-column-option:hover,.registry-column-option:focus-within {background:#eaf2ed}
.registry-column-option label {display:flex;align-items:center;gap:8px;cursor:pointer}
.registry-column-option button {width:26px;min-width:26px;height:26px;min-height:26px}

.orders-list-page .components-scroll {--registry-name-width:clamp(250px,16vw,380px)}
.orders-list-page .components-registry-table :is(th,td)[data-column="name"] {
 width:var(--registry-name-width);min-width:var(--registry-name-width);max-width:var(--registry-name-width)
}
.orders-list-page .components-registry-table :is(td[data-column="name"]>strong,.registry-total-label) {
 display:block;
 width:calc(var(--registry-name-width) - 22px);
 max-width:100%;
 overflow:hidden;
 text-overflow:ellipsis;
}
.components-registry-table tfoot td {scroll-margin-bottom:0}
.components-scroll {scroll-padding-bottom:40px}
.orders-list-page .components-registry-table tfoot td {position:sticky;bottom:0;z-index:3;background:#eef4f0}
.orders-list-page .components-registry-table tfoot td[data-column="select"] {left:0;z-index:4}
.orders-list-page .components-registry-table tfoot td[data-column="name"] {left:36px;z-index:4;box-shadow:1px 0 0 var(--line)}
.orders-list-page .components-registry-table tbody td[data-column="actions"] {position:sticky;right:0;z-index:2;background:white;box-shadow:-1px 0 0 var(--line)}
.components-registry-table thead tr th[data-column="actions"] {right:0;z-index:6}

.orders-list-page .components-registry-table :is(th,td)[data-column="packings"] {min-width:190px}
.orders-list-page .components-registry-table tbody td {padding-block:6px}
.orders-list-page .components-registry-table tr :is(th,td):is([data-column="quantity"],[data-column="allocated"],[data-column="draft_quantity"],[data-column="remaining"],[data-column="price"],[data-column="total"]) {white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.orders-list-page .components-registry-table tr :is(th,td):is([data-column="date"],[data-column="price"],[data-column="total"],[data-column="status"]) {width:1px;padding-inline:6px;white-space:nowrap}
.orders-list-page .components-registry-table tbody td :is(.packing-document-link,button,.badge.green) {color:#000}
/* Completed rows recede into the table surface; keep cells opaque for sticky columns. */
.orders-list-page .components-registry-table tbody tr.component-fully-allocated {
 --packed-text:#909090;
}
.orders-list-page .components-registry-table tbody tr.component-fully-allocated>td {
 background:white;color:var(--packed-text)
}
.orders-list-page .components-registry-table tr.component-fully-allocated td[data-column] :is(strong,.muted,.secondary,.badge.green) {
 color:inherit
}
.orders-list-page .components-registry-table tr.component-fully-allocated td :is(.packing-document-link,button):not(:hover):not(:focus-visible) {
 color:var(--packed-text);background:transparent;border-color:transparent
}
.orders-list-page .components-registry-table tr.component-fully-allocated .packing-document-progress:not(:hover):not(:focus-visible) {
 filter:grayscale(1);opacity:.65
}
.components-registry-table tbody tr:hover>td {background:#f6faf7}
.orders-list-page .components-registry-table tbody tr:has(.component-select:checked)>td {background:#eaf4ee}
.components-registry-table th[aria-sort]:not([aria-sort="none"]) .registry-sort {color:#000;font-weight:700}
.components-registry-table th[aria-sort]:not([aria-sort="none"]) .registry-sort span {color:inherit}
.orders-registry-scroll td {padding-block:12px}
.registry-invoice-link {font-weight:650;color:var(--green);text-underline-offset:3px}
.registry-invoice-link:hover,.registry-invoice-link:focus-visible {text-decoration:underline}
.orders-list-page > .component-selection-bar {padding:6px 12px;gap:6px 14px;flex-wrap:wrap}
.registry-footer-overview {flex:0 0 100%;min-width:0;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 16px;padding-bottom:5px;border-bottom:1px solid #c6cfd1}
.registry-footer-totals {display:flex;align-items:center;flex-wrap:wrap;gap:4px 14px;font-size:12px}
.registry-footer-totals span {white-space:nowrap;color:#506065}
.registry-footer-totals b {color:var(--ink);font-variant-numeric:tabular-nums}
.component-selection-bar .registry-footer-overview .table-footer {display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-left:auto;padding:0;border:0;background:transparent}

.registry-selection-summary {display:flex;align-items:center;gap:12px;min-width:0;flex:1 1 260px}
.registry-selection-title {display:flex;align-items:center;gap:6px;flex:none;white-space:nowrap;font-variant-numeric:tabular-nums}
.component-selection-bar .actions {gap:6px;margin-top:0;max-width:100%}
.component-selection-bar button {height:32px;min-height:32px;padding:4px 10px;font-size:12px}
.component-selection-bar button .icon {width:15px;height:15px}
#component-selection-note {min-width:0;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:650px){
 .component-selection-bar .actions {width:100%;justify-content:flex-start}
 .component-selection-bar .actions button {height:auto;white-space:normal}
}
.orders-registry .registry-control-row,
.orders-list-page .component-selection-bar {background-color:#e8eced;border-color:#c6cfd1}
.orders-registry .orders-view-tabs .tab:not(.active),
.orders-list-page #component-selection-note {color:#506065}
@media(max-width:1200px){
 .orders-registry .registry-control-row {column-gap:8px}
 .registry-query {flex-basis:335px}
 .registry-query select {max-width:145px}
}
@media(max-width:850px){
 .registry-workspace.filters-open {grid-template-columns:minmax(0,1fr) 218px}
 .registry-query {flex-basis:100%;order:1;padding-top:0}
 .orders-list-page .components-scroll {--registry-name-width:178px}
 .orders-registry-topbar {height:auto;min-height:56px;flex-wrap:wrap;padding-block:8px;gap:8px}
 .orders-registry-topbar .actions {flex-wrap:wrap}
}
@media(max-width:600px){
 .registry-workspace.filters-open {grid-template-columns:minmax(0,1fr)}
 .registry-filter-sidebar {grid-row:1;border-left:0;border-bottom:1px solid var(--line);max-height:32vh}
 .registry-query {flex-wrap:wrap}
 .registry-query .search {flex-basis:100%;max-width:none}
 .orders-list-page .components-scroll {--registry-name-width:150px}
 .orders-list-page .components-registry-table tbody td[data-column="actions"] {position:static;box-shadow:none}
}
