/* Beauty Foam ERP — shared professional workspace language.
   Presentation only: no workflow, permissions, accounting or inventory rules. */

:root {
  --erp-ink: #142f43;
  --erp-muted: #526b7c;
  --erp-line: #a9bbc8;
  --erp-line-strong: #7892a5;
  --erp-soft: #eef4f8;
  --erp-soft-2: #f7fafc;
  --erp-hover: #f2f8fc;
  --erp-blue: #176795;
  --erp-blue-dark: #0f527b;
  --erp-green: #148160;
  --erp-red: #9b2f3b;
  --erp-amber: #8a5b00;
  --erp-radius: 5px;
}

/* Restored price-list workspace: lists and registered prices, separate from item coding. */
#catalog-pricing-panel{min-width:0}
.pricing-actions-bar{justify-content:flex-start!important;margin-bottom:6px}
#catalog-pricing-panel .price-lists-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:4px;margin:0 0 4px}
#catalog-pricing-panel .price-list-card{display:flex;align-items:center;justify-content:space-between;gap:7px;width:100%;min-height:38px;padding:4px 7px;text-align:right;font:inherit;cursor:pointer;border:1px solid #adbfcc;border-radius:5px;background:#fff;box-shadow:none}
#catalog-pricing-panel .price-list-card>span:first-child{display:grid;gap:1px;min-width:0}
#catalog-pricing-panel .price-list-card>span:first-child strong{overflow:hidden;color:#173e5b;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
#catalog-pricing-panel .price-list-card>span:first-child span{overflow:hidden;color:#647b8b;font-size:8px;text-overflow:ellipsis;white-space:nowrap}
#catalog-pricing-panel .price-list-card:hover{border-color:#6e9fbe;background:#f8fcff}
#catalog-pricing-panel .price-list-card.active{border-color:#137aac;background:#eef8fd;box-shadow:inset -3px 0 #137aac}
.price-list-card-meta{display:flex!important;align-items:center;justify-content:flex-end;gap:6px;margin-inline-start:auto}
.price-list-card-meta>b{color:#173b56;font-size:10px;white-space:nowrap}
.price-list-card-meta .default-badge{margin:0;font-style:normal}
.pricing-list-card{overflow:hidden;border-radius:6px;box-shadow:none}
.pricing-list-toolbar{align-items:center;gap:7px;min-height:34px!important;height:34px!important;padding:2px 5px!important}
.pricing-list-toolbar>div:first-child{min-width:145px}
.pricing-list-toolbar h2{margin:0;font-size:13px}
.pricing-list-toolbar p{margin:2px 0 0;color:#61798b;font-size:8px}
.pricing-list-filters{display:flex;align-items:center;gap:4px;flex:1;min-width:0}
.pricing-list-filters .catalog-list-filter{display:flex;align-items:center;gap:3px;margin:0;min-width:135px}
.pricing-list-filters .catalog-list-filter:first-child{min-width:220px}
.pricing-list-filters .catalog-list-filter>span{font-size:8px;font-weight:800;color:#526c80}
.pricing-list-filters select{width:100%;height:25px!important;min-height:25px!important;min-width:0!important;padding-inline:7px 28px;font-size:9px}
.pricing-list-filters .table-search{height:25px!important;min-height:25px!important;min-width:210px;margin-inline-start:auto}
.pricing-items-table{min-width:920px;table-layout:fixed}
.pricing-items-table th{height:27px;padding:3px 7px!important;background:#e8f0f5!important;color:#29485f!important;font-size:9px!important}
.pricing-items-table td{height:30px;padding:3px 7px!important}
.pricing-items-table th:first-child{width:26%}
.pricing-items-table th:nth-child(2),.pricing-items-table th:nth-child(3),.pricing-items-table th:nth-child(4){width:12%}
.pricing-items-table th:nth-child(5){width:8%}
.pricing-items-table th:nth-child(6),.pricing-items-table th:nth-child(7){width:8%}
.pricing-items-table th:last-child{width:10%}
.pricing-items-table td small{display:block;margin-top:1px;color:#708596;font-size:8px}
.registered-price{color:#105f46;font-size:11px;font-variant-numeric:tabular-nums}
.price-not-set{color:#9aabba}
.pricing-family-row td{height:28px!important;padding:2px 7px!important;background:#dce9f2!important;border-top:1px solid #8fa8ba!important;border-bottom:1px solid #afc0cc!important}
.pricing-family-row:not([style*="--pricing-depth:0"]) td{background:#edf3f7!important;border-top-color:#c1d0da!important}
.pricing-family-line{display:flex;align-items:center;gap:6px;padding-inline-start:calc(var(--pricing-depth,0) * 18px);color:#173e5b}
.pricing-family-line strong{font-size:10px}.pricing-family-line small{color:#688091;font-size:8px}.pricing-family-line em{margin-inline-start:auto;padding:2px 6px;border:1px solid #afc2cf;border-radius:9px;background:#fff;color:#49677c;font-size:8px;font-style:normal;font-weight:800}
.pricing-tree-toggle{display:grid;place-items:center;width:18px;height:18px;padding:0;border:1px solid #819caf;border-radius:3px;background:#fff;color:#174d73;cursor:pointer;transform:rotate(180deg)}
.pricing-tree-toggle.expanded{transform:rotate(90deg)}.pricing-family-icon{font-size:11px;color:#316985}
.pricing-product-row td:first-child{padding-inline-start:calc(8px + (var(--pricing-depth,1) * 18px))!important}.pricing-tree-branch{display:inline-block;width:18px;color:#8aa0af;text-align:center}.pricing-product-identity{display:inline-grid;gap:1px;vertical-align:middle}.pricing-product-identity strong{font-size:10px;color:#173c58}.pricing-product-identity small{margin:0!important;font-size:8px!important}
@media(max-width:1000px){.pricing-list-toolbar{align-items:stretch;flex-direction:column}.pricing-list-filters{width:100%;flex-wrap:wrap}.pricing-list-filters .table-search{flex:1;margin-inline-start:0}}

/* Product opening balances use the accounting opening-balance workspace contract. */
.product-opening-workspace{overflow:hidden;margin:0 0 4px;border-color:#aebfcd;border-radius:6px;box-shadow:none}
.product-opening-controls{display:grid;grid-template-columns:minmax(230px,320px) minmax(320px,1fr);gap:5px;padding:4px 6px;border-bottom:1px solid #aebfcd;background:#f5f8fa}
.product-opening-controls label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:5px}.product-opening-controls label>span{color:#29485e;font-size:8px;font-weight:850;white-space:nowrap}.product-opening-controls :is(input,select){width:100%;height:26px;min-height:26px;padding:2px 7px;border:1px solid #a7bac8;border-radius:4px;background:#fff;font:inherit;font-size:9px}
.product-opening-workspace .opening-balance-toolbar{display:flex;align-items:center;gap:6px;min-height:34px;height:34px;padding:3px 6px;border-bottom:1px solid #aebfcd;background:#eef4f8}.product-opening-workspace .opening-filter-group{display:flex;align-items:center;gap:4px;min-width:420px;flex:1}.product-opening-workspace .table-search{width:min(430px,40vw);height:26px;margin:0;background:#fff}.product-opening-workspace .table-search input{height:24px}.product-opening-workspace #opening-family{width:180px;height:26px;border:1px solid #a7bac8;border-radius:4px;background:#fff;font-size:9px}
.product-opening-summary{display:flex!important;align-items:stretch;margin-inline-start:auto;border:1px solid #a9bac7;border-radius:4px;background:#fff;white-space:nowrap}.product-opening-summary>span{display:grid;grid-template-columns:auto auto;align-items:center;gap:6px;min-width:112px;height:25px;padding:0 7px;border-inline-start:1px solid #d1dbe2}.product-opening-summary>span:first-child{border-inline-start:0}.product-opening-summary small{color:#657887;font-size:7.5px;font-weight:700}.product-opening-summary strong{color:#155d83;font-size:9px}
.product-opening-grid-wrap{max-height:calc(100vh - 330px);min-height:210px;overflow:auto}.product-opening-grid{width:100%;min-width:900px;table-layout:fixed}.product-opening-grid thead{position:sticky;top:0;z-index:3}.product-opening-grid th{height:25px;padding:2px 6px!important;border-color:#aebfcd!important;background:#dfeaf1!important;color:#1c3b52!important;font-size:8px!important;font-weight:850}.product-opening-grid td{height:31px;padding:2px 5px!important;border-color:#cbd6df!important;background:#fff;vertical-align:middle}.product-opening-grid tbody tr:nth-child(even) td{background:#fbfcfd}.product-opening-grid tbody tr:hover td{background:#f0f7fb}.product-opening-grid th:nth-child(1){width:34px}.product-opening-grid th:nth-child(2){width:120px}.product-opening-grid th:nth-child(4){width:135px}.product-opening-grid th:nth-child(5),.product-opening-grid th:nth-child(6),.product-opening-grid th:nth-child(7){width:135px}.product-opening-grid input{width:100%;height:25px;min-width:0;padding:1px 5px;border:1px solid #a8bac8;border-radius:3px;background:#fff;font:700 9px inherit}.product-opening-grid input[type=number]{direction:ltr;text-align:left}.product-opening-grid td:first-child{text-align:center;color:#607686;font-weight:800}.opening-product-code strong{color:#165376;font-size:9px}.opening-product-name strong{display:block;color:#17364d;font-size:9.5px}.opening-product-name small{display:block;margin-top:1px;color:#718391;font-size:7px}.product-opening-grid [data-opening-line-total]{color:#176343;font-size:9px}.product-opening-grid .opening-line-incomplete td{background:#fff2f2!important}.product-opening-history{margin:0}.product-opening-history table{min-width:900px}.product-opening-history th,.product-opening-history td{height:27px;padding:3px 6px!important;font-size:8.5px!important}
@media(max-width:900px){.product-opening-controls{grid-template-columns:1fr}.product-opening-workspace .opening-balance-toolbar{height:auto;align-items:stretch;flex-wrap:wrap}.product-opening-workspace .opening-filter-group{min-width:100%}.product-opening-workspace .table-search{width:auto;flex:1}.product-opening-summary{margin-inline-start:0}.product-opening-grid-wrap{max-height:54vh}}

.supplier-directory-tools{display:flex;align-items:center;gap:6px;margin-inline-start:auto}.supplier-directory-tools .accounting-inline-filter{display:flex;align-items:center;gap:4px;margin:0}.supplier-directory-tools input{width:min(360px,32vw);height:30px}.accounting-opening-batch{margin-top:4px}.opening-batch-controls{display:grid;grid-template-columns:140px 150px minmax(260px,1fr) minmax(220px,1fr);gap:6px;padding:6px;border-bottom:1px solid var(--line)}.opening-batch-controls label{display:grid;gap:2px}.opening-batch-controls label>span{font-size:12px;font-weight:700;color:var(--ink)}.opening-batch-controls input,.opening-batch-controls select{height:30px}.opening-balance-grid th,.opening-balance-grid td{padding:4px 7px}.opening-balance-grid input[data-opening-amount]{width:130px;height:28px;text-align:left;direction:ltr}.opening-balance-grid input:disabled{background:#eef2f5;color:#607080}.opening-balance-grid small{display:block}.supplier-directory-root .accounting-pro-head{margin-bottom:2px}
@media(max-width:900px){.opening-batch-controls{grid-template-columns:1fr 1fr}.opening-batch-controls .wide{grid-column:span 2}.supplier-directory-tools{width:100%;flex-wrap:wrap}.supplier-directory-tools .accounting-inline-filter{flex:1}.supplier-directory-tools input{width:100%}}

/* ---------- Remaining ERP workspaces ---------- */
.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) {
  padding: 3px 6px 12px !important;
  color: var(--erp-ink) !important;
}

.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) > .page-heading,
.app-shell #enterprise-reports-view > .reports-head,
.app-shell .accounting-pro-root > .accounting-pro-head,
.app-shell .accounting-pro-root > .invoice-workspace-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 5px !important;
  height: 31px !important;
  min-height: 31px !important;
  max-height: 31px !important;
  margin: 0 0 4px !important;
  padding: 2px 3px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--erp-line-strong) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view,
  #enterprise-reports-view
) :is(.page-heading, .reports-head) :is(.eyebrow, p),
.app-shell .accounting-pro-head :is(.eyebrow, p),
.app-shell .invoice-workspace-head span,
.app-shell .warehouse-compact-header small {
  display: none !important;
}

.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view,
  #enterprise-reports-view
) :is(.page-heading h1, .reports-head h1),
.app-shell .accounting-pro-head h1,
.app-shell .invoice-workspace-head h1,
.app-shell .warehouse-compact-header h1 {
  margin: 0 !important;
  color: var(--erp-ink) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}

/* When a module already has inner navigation, its actions are moved to that bar.
   The repeated title row is then unnecessary. */
.app-shell :is(#finance-view, #finance-receipts-view, #finance-paid-view, #prices-view, #issue-requests-view) > .page-heading,
.app-shell :is(
  #accounting-general-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-treasury-view
) .accounting-pro-root > .accounting-pro-head {
  display: none !important;
}

/* Old dashboard cards consume space and are not part of the operating workspace. */
.app-shell :is(
  #inventory-work-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #manufacturing-work-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view
) :is(.stats-grid, .warehouse-kpis, .warehouse-overview-grid, .ar-aging-grid) {
  display: none !important;
}

/* ---------- Shared buttons ---------- */
.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) :is(.button, .small-action, .doc-action, .warehouse-create-button) {
  box-sizing: border-box !important;
  height: 25px !important;
  min-height: 25px !important;
  min-width: 0 !important;
  padding: 0 8px !important;
  border: 1px solid #91a8b8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #173d59 !important;
  box-shadow: none !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) :is(.button.primary, .small-action.primary, .doc-action.print, .warehouse-create-button) {
  border-color: var(--erp-blue) !important;
  background: var(--erp-blue) !important;
  color: #fff !important;
}

.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) :is(.button.success, .small-action.success) {
  border-color: var(--erp-green) !important;
  background: var(--erp-green) !important;
  color: #fff !important;
}

.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) :is(.button.danger, .small-action.danger, .doc-action.danger) {
  border-color: #d6a5aa !important;
  background: #fff5f5 !important;
  color: var(--erp-red) !important;
}

.app-shell :is(.button, .small-action, .doc-action):hover:not(:disabled) {
  filter: brightness(.96);
}
.app-shell :is(.button, .small-action, .doc-action):focus-visible {
  outline: 2px solid #2f79ae !important;
  outline-offset: 1px !important;
}

/* ---------- Inner navigation ---------- */
.app-shell :is(
  .inventory-content-nav,
  .warehouse-module-tabs,
  .accounting-inner-tabs,
  .accounting-module-tabs,
  .catalog-tabs,
  .approval-tabs,
  .report-category-tabs
) {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  height: 31px !important;
  min-height: 31px !important;
  margin: 0 0 4px !important;
  padding: 2px !important;
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: var(--erp-soft) !important;
  box-shadow: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.app-shell :is(
  .inventory-content-nav,
  .warehouse-module-tabs,
  .accounting-inner-tabs,
  .accounting-module-tabs,
  .catalog-tabs,
  .approval-tabs,
  .report-category-tabs
) > button {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 25px !important;
  min-height: 25px !important;
  padding: 0 10px !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: #29475d !important;
  box-shadow: none !important;
  font-size: 9.5px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.app-shell :is(
  .inventory-content-nav,
  .warehouse-module-tabs,
  .accounting-inner-tabs,
  .accounting-module-tabs,
  .catalog-tabs,
  .approval-tabs,
  .report-category-tabs
) > button.active {
  border-color: #8da9bc !important;
  background: #fff !important;
  color: #0b5e91 !important;
}

.app-shell :is(
  .inventory-content-nav,
  .warehouse-module-tabs,
  .accounting-inner-tabs,
  .accounting-module-tabs,
  .catalog-tabs,
  .approval-tabs
) > .unified-tab-actions {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin-right: auto !important;
  margin-left: 0 !important;
}

/* ---------- Search and filters ---------- */
.app-shell .unified-screen-filter,
.app-shell .reports-filter,
.app-shell .inventory-balance-toolbar,
.app-shell .accounting-inline-filter,
.app-shell .journal-register-bar form {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  min-height: 32px !important;
  height: auto !important;
  margin: 0 0 4px !important;
  padding: 2px 4px !important;
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: #fff !important;
  box-shadow: none !important;
  flex-wrap: wrap !important;
}

.app-shell .unified-screen-filter .unified-search,
.app-shell .reports-filter .report-search,
.app-shell .inventory-balance-toolbar .unified-search {
  flex: 1 1 290px !important;
  min-width: 210px !important;
}

.app-shell :is(
  .unified-screen-filter,
  .reports-filter,
  .inventory-balance-toolbar,
  .accounting-inline-filter,
  .journal-register-bar,
  .card-toolbar,
  .approval-section-head,
  .warehouse-table-toolbar
) :is(input, select, .smart-select-input, .smart-select-trigger),
.app-shell .accounting-compact-form :is(input, select, textarea, .smart-select-input, .smart-select-trigger) {
  box-sizing: border-box !important;
  height: 27px !important;
  min-height: 27px !important;
  min-width: 0 !important;
  padding: 2px 6px !important;
  border: 1px solid #91a8b8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--erp-ink) !important;
  box-shadow: none !important;
  font-size: 10px !important;
  font-weight: 650 !important;
}

.app-shell :is(.unified-screen-filter, .reports-filter, .inventory-balance-toolbar) label > span {
  color: #425e72 !important;
  font-size: 8.5px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
}

.app-shell .unified-filter-results:not(.hidden) {
  margin: 0 0 4px !important;
  padding: 4px !important;
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: #fff !important;
}

/* ---------- Cards, toolbars and dense tables ---------- */
.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) .content-card {
  margin: 0 0 4px !important;
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: #fff !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) :is(.card-toolbar, .approval-section-head, .report-result-head, .warehouse-table-toolbar) {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 5px !important;
  min-height: 31px !important;
  height: auto !important;
  padding: 3px 5px !important;
  border-bottom: 1px solid #d5e0e7 !important;
  background: #fff !important;
}

.app-shell :is(.card-toolbar, .approval-section-head, .report-result-head, .warehouse-table-toolbar) :is(h2, strong) {
  margin: 0 !important;
  color: var(--erp-ink) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
}
.app-shell :is(.card-toolbar, .approval-section-head, .report-result-head, .warehouse-table-toolbar) p,
.app-shell :is(.card-toolbar, .approval-section-head) > div > span {
  display: none !important;
}

.app-shell .table-wrap {
  max-width: 100% !important;
  overflow: auto !important;
  scrollbar-width: thin;
}
.app-shell table {
  border-collapse: collapse !important;
}
.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-assets-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) table th {
  height: 25px !important;
  padding: 3px 6px !important;
  border-color: #bdcbd5 !important;
  background: #e8f0f5 !important;
  color: #18364d !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
}
.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) table td {
  height: 31px !important;
  padding: 3px 6px !important;
  border-color: #d1dce4 !important;
  background: #fff !important;
  color: #172f42 !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  vertical-align: middle !important;
}
.app-shell :is(
  #approvals-view,
  #issue-requests-view,
  #issue-history-view,
  #inventory-work-view,
  #inventory-stock-view,
  #warehouse-directory-view,
  #warehouse-finished-view,
  #warehouse-spares-view,
  #warehouse-chemicals-view,
  #manufacturing-work-view,
  #prices-view,
  #finance-view,
  #finance-receipts-view,
  #finance-paid-view,
  #accounting-general-view,
  #accounting-sales-invoices-view,
  #accounting-customers-view,
  #accounting-suppliers-view,
  #accounting-costs-view,
  #accounting-treasury-view,
  #enterprise-reports-view,
  #admin-users-view,
  #admin-roles-view,
  #admin-backups-view
) table tbody tr:hover td {
  background: var(--erp-hover) !important;
}
.app-shell table td small {
  display: block !important;
  margin-top: 1px !important;
  color: #5c7282 !important;
  font-size: 8px !important;
  line-height: 1.05 !important;
}
.app-shell .document-action-cell {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

/* ---------- Warehouse workspace ---------- */
.app-shell .warehouse-screen-root {
  color: var(--erp-ink) !important;
}
.app-shell .warehouse-command-bar {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  height: 31px !important;
  min-height: 31px !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--erp-line-strong) !important;
  background: #fff !important;
}
.app-shell .warehouse-command-bar .warehouse-compact-header {
  flex: 0 1 auto !important;
  height: 30px !important;
  min-height: 30px !important;
  margin: 0 !important;
  padding: 2px 3px !important;
  border: 0 !important;
  background: #fff !important;
}
.app-shell .warehouse-command-bar .warehouse-type-badge {
  padding: 1px 5px !important;
  border-radius: 8px !important;
  font-size: 8px !important;
}
.app-shell .warehouse-command-bar .warehouse-module-tabs {
  flex: 1 1 auto !important;
  margin: 0 !important;
}
.app-shell .warehouse-panel > .content-card,
.app-shell .warehouse-data-card,
.app-shell .warehouse-ledger-card,
.app-shell .preparation-movements-card {
  margin-top: 0 !important;
  margin-bottom: 4px !important;
}
.app-shell .warehouse-balance-inline {
  min-height: 28px !important;
  margin: 0 0 4px !important;
  padding: 2px 4px !important;
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: var(--erp-soft-2) !important;
}
.app-shell .warehouse-directory-tools,
.app-shell .inventory-balance-actions,
.app-shell .warehouse-heading-actions,
.app-shell .warehouse-movement-actions {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-wrap: nowrap !important;
}

/* ---------- Accounting workspace ---------- */
.app-shell .accounting-pro-root {
  color: var(--erp-ink) !important;
}
.app-shell .accounting-pro-root > .accounting-inner-tabs,
.app-shell .accounting-pro-root > .accounting-module-tabs {
  margin-bottom: 4px !important;
}
.app-shell .accounting-compact-form {
  margin: 0 0 4px !important;
  padding: 4px !important;
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: var(--erp-soft-2) !important;
  box-shadow: none !important;
}
.app-shell .accounting-compact-form .compact-form-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(135px, 1fr)) !important;
  gap: 4px !important;
}
.app-shell .accounting-compact-form .compact-form-row > label {
  display: grid !important;
  align-content: end !important;
  gap: 2px !important;
  min-width: 0 !important;
}
.app-shell .accounting-compact-form .compact-form-row > label.wide {
  grid-column: span 2 !important;
}
.app-shell .accounting-compact-form label > span {
  color: #39586d !important;
  font-size: 8.5px !important;
  font-weight: 900 !important;
}
.app-shell .accounting-compact-form textarea {
  height: 50px !important;
  min-height: 50px !important;
  resize: vertical !important;
}
.app-shell .compact-form-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 3px !important;
  margin-top: 4px !important;
  padding-top: 4px !important;
  border-top: 1px solid #d4dfe6 !important;
}
.app-shell .coa-card .card-toolbar,
.app-shell .cost-center-directory .card-toolbar {
  min-height: 31px !important;
  height: auto !important;
}
.app-shell :is(.coa-toolbar, .cost-center-tools, .accounting-toolbar-actions, .statement-toolbar-actions, .profit-totals) {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  flex-wrap: nowrap !important;
}
.app-shell :is(.coa-toolbar, .cost-center-tools) :is(input, .unified-search) {
  height: 25px !important;
  min-height: 25px !important;
}
.app-shell .coa-table .coa-row td,
.app-shell .cost-center-tree-table tbody td,
.app-shell .journal-register-table tbody td {
  height: 29px !important;
  padding-block: 2px !important;
}
.app-shell .coa-table .account-tree-name,
.app-shell .cost-center-tree-table .account-tree-name {
  min-height: 23px !important;
}
.app-shell .coa-table .coa-row.coa-root td,
.app-shell .cost-center-tree-table .coa-root td {
  border-top: 2px solid #8fa6ba !important;
  background: #dfeaf3 !important;
}
.app-shell .coa-table .coa-row.coa-branch td,
.app-shell .cost-center-tree-table .coa-branch td {
  background: #eff5f8 !important;
}
.app-shell .journal-register-bar {
  display: block !important;
  min-height: 35px !important;
  padding: 3px !important;
  border-bottom: 1px solid var(--erp-line) !important;
  background: #fff !important;
}
.app-shell .journal-register-bar form {
  display: grid !important;
  grid-template-columns: 110px 105px minmax(180px, 1fr) 120px 120px auto auto !important;
  margin: 0 !important;
  border: 0 !important;
}
.app-shell .journal-register-footer,
.app-shell .report-pagination,
.app-shell .record-pager {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 30px !important;
  padding: 2px 5px !important;
  border-top: 1px solid #c8d5de !important;
  color: var(--erp-muted) !important;
  font-size: 9px !important;
}
.app-shell .accounting-currency-grid {
  gap: 4px !important;
}
.app-shell :is(.accounting-doc-head, .accounting-doc-totals, .statement-preview-summary) {
  gap: 4px !important;
}

/* ---------- Approvals, reports and administration ---------- */
.app-shell #approvals-view .approval-command-bar {
  height: 31px !important;
  min-height: 31px !important;
  margin: 0 0 4px !important;
  padding: 2px 3px !important;
  border-bottom: 1px solid var(--erp-line-strong) !important;
  background: #fff !important;
}
.app-shell #approvals-view .approval-command-bar h1 {
  font-size: 13px !important;
}
.app-shell #approvals-view .approval-inline-counts {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
}
.app-shell #approvals-view .approval-inline-counts span {
  padding: 2px 5px !important;
  border: 1px solid #c7d4dd !important;
  border-radius: 8px !important;
  background: var(--erp-soft-2) !important;
  font-size: 8px !important;
}
.app-shell #approvals-view .approval-two-columns {
  gap: 4px !important;
}
.app-shell #enterprise-reports-view .reports-filter {
  display: grid !important;
  grid-template-columns: minmax(240px, 1.25fr) 125px 125px minmax(220px, 1fr) auto !important;
}
.app-shell #enterprise-reports-view .reports-filter label {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 4px !important;
}
.app-shell #enterprise-reports-view .reports-actions {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  margin-right: auto !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) .admin-editor {
  margin-bottom: 4px !important;
  padding: 5px !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) :is(.admin-form-grid, .backup-settings-grid) {
  gap: 4px !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) .permission-checks {
  gap: 3px !important;
  padding: 4px !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) :is(.admin-form-grid, .backup-settings-form) {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(135px, 1fr)) !important;
  align-items: end !important;
  gap: 4px !important;
  padding: 5px !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) .field {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) .field > span,
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) .admin-label {
  color: #39586d !important;
  font-size: 8.5px !important;
  font-weight: 900 !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) .field :is(input, select, .smart-select-input, .smart-select-trigger) {
  width: 100% !important;
  height: 27px !important;
  min-height: 27px !important;
  padding: 2px 6px !important;
  border: 1px solid #91a8b8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--erp-ink) !important;
  font-size: 10px !important;
}
.app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) .field small {
  color: #607687 !important;
  font-size: 8px !important;
  line-height: 1.15 !important;
}
.app-shell #admin-backups-view .backup-status-strip {
  min-height: 29px !important;
  margin: 0 0 4px !important;
  padding: 4px 6px !important;
  border: 1px solid var(--erp-line) !important;
  border-radius: var(--erp-radius) !important;
  background: var(--erp-soft-2) !important;
  font-size: 9px !important;
}
.app-shell #admin-roles-view .permission-matrix {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(210px, 1fr)) !important;
  gap: 4px !important;
  max-height: 54vh !important;
  padding: 4px !important;
  overflow: auto !important;
}
.app-shell #admin-roles-view .permission-matrix > section {
  margin: 0 !important;
  padding: 5px !important;
  border: 1px solid #c5d3dc !important;
  border-radius: 4px !important;
  background: #fff !important;
}

/* ---------- All standard dialogs ---------- */
body > .modal-layer:not(#environment-switch-modal) {
  padding: 12px !important;
  background: rgba(16, 35, 49, .58) !important;
  backdrop-filter: blur(1px);
}
body > .modal-layer:not(#environment-switch-modal) > .modal-card {
  display: flex !important;
  flex-direction: column !important;
  width: min(980px, 97vw);
  max-height: 96vh !important;
  border: 1px solid #829bab !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: 0 18px 52px rgba(8, 27, 40, .28) !important;
  overflow: hidden !important;
}
body > .modal-layer:not(#environment-switch-modal) .modal-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 6 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 7px !important;
  min-height: 37px !important;
  padding: 5px 8px !important;
  border-bottom: 1px solid var(--erp-line) !important;
  background: #fff !important;
}
body > .modal-layer:not(#environment-switch-modal) .modal-header .eyebrow,
body > .modal-layer:not(#environment-switch-modal) .modal-header p:not(.eyebrow) {
  display: none !important;
}
body > .modal-layer:not(#environment-switch-modal) .modal-header h2 {
  margin: 0 !important;
  color: var(--erp-ink) !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
}
body > .modal-layer:not(#environment-switch-modal) .modal-header .icon-button {
  flex: 0 0 25px !important;
  width: 25px !important;
  height: 25px !important;
  min-height: 25px !important;
  padding: 0 !important;
  border: 1px solid #a7bac8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #243f52 !important;
  box-shadow: none !important;
}
body > .modal-layer:not(#environment-switch-modal) > .modal-card > form {
  min-height: 0 !important;
  overflow: auto !important;
}
body > .modal-layer:not(#environment-switch-modal) .modal-card > [id$="-content"] {
  min-height: 0 !important;
  overflow: auto !important;
  scrollbar-width: thin;
}
body > .modal-layer:not(#environment-switch-modal) .modal-form {
  gap: 4px !important;
  padding: 5px 8px !important;
}
body > .modal-layer:not(#environment-switch-modal) .field {
  gap: 2px !important;
  margin: 0 !important;
}
body > .modal-layer:not(#environment-switch-modal) .field > span,
body > .modal-layer:not(#environment-switch-modal) :is(.check-field, .check-label) {
  color: #38566b !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
}
body > .modal-layer:not(#environment-switch-modal) .field > small {
  color: #607687 !important;
  font-size: 8px !important;
  line-height: 1.2 !important;
}
body > .modal-layer:not(#environment-switch-modal) :is(input, select, textarea, .smart-select-input, .smart-select-trigger) {
  box-sizing: border-box !important;
  min-height: 28px !important;
  padding: 3px 6px !important;
  border: 1px solid #91a8b8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--erp-ink) !important;
  box-shadow: none !important;
  font-size: 10px !important;
  font-weight: 650 !important;
}
body > .modal-layer:not(#environment-switch-modal) textarea {
  min-height: 48px !important;
  resize: vertical !important;
}
body > .modal-layer:not(#environment-switch-modal) :is(.button, .small-action, .doc-action) {
  height: 26px !important;
  min-height: 26px !important;
  min-width: 0 !important;
  padding: 0 8px !important;
  border: 1px solid #91a8b8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #173d59 !important;
  box-shadow: none !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
body > .modal-layer:not(#environment-switch-modal) :is(.button.primary, .small-action.primary, .doc-action.print) {
  border-color: var(--erp-blue) !important;
  background: var(--erp-blue) !important;
  color: #fff !important;
}
body > .modal-layer:not(#environment-switch-modal) :is(.button.success, .small-action.success) {
  border-color: var(--erp-green) !important;
  background: var(--erp-green) !important;
  color: #fff !important;
}
body > .modal-layer:not(#environment-switch-modal) :is(.button.danger, .small-action.danger) {
  border-color: #d6a5aa !important;
  background: #fff5f5 !important;
  color: var(--erp-red) !important;
}
body > .modal-layer:not(#environment-switch-modal) .modal-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 6 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 3px !important;
  min-height: 38px !important;
  padding: 5px 8px !important;
  border-top: 1px solid var(--erp-line) !important;
  background: var(--erp-soft-2) !important;
}
body > .modal-layer:not(#environment-switch-modal) .form-message:not(.hidden) {
  position: sticky !important;
  bottom: 38px !important;
  z-index: 7 !important;
  display: block !important;
  margin: 4px 8px !important;
  padding: 6px 8px !important;
  border: 1px solid #c98e96 !important;
  border-radius: 4px !important;
  background: #fff2f3 !important;
  color: #841f2c !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
}
body > .modal-layer:not(#environment-switch-modal) .table-wrap {
  max-width: 100% !important;
  overflow: auto !important;
  scrollbar-width: thin;
}
body > .modal-layer:not(#environment-switch-modal) :is(.approval-decision-box, .approval-step-toolbar, .warehouse-receipt-lines-head, .uom-section-head) {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 4px !important;
  min-height: 32px !important;
  margin: 0 !important;
  padding: 4px 8px !important;
  border-top: 1px solid #d3dee6 !important;
  background: var(--erp-soft-2) !important;
}
body > .modal-layer:not(#environment-switch-modal) .approval-decision-box {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 7 !important;
}
body > .modal-layer:not(#environment-switch-modal) table {
  border-collapse: collapse !important;
}
body > .modal-layer:not(#environment-switch-modal) table th {
  height: 25px !important;
  padding: 3px 5px !important;
  border: 1px solid #b8c7d2 !important;
  background: #e8f0f5 !important;
  color: #18364d !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}
body > .modal-layer:not(#environment-switch-modal) table td {
  height: 30px !important;
  padding: 3px 5px !important;
  border: 1px solid #d1dce4 !important;
  color: #172f42 !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
}

/* Wide transactional dialogs. */
body > :is(
  #issue-modal,
  #weight-issue-modal,
  #warehouse-document-modal,
  #warehouse-receipt-modal,
  #opening-balance-modal,
  #invoice-detail-modal,
  #new-sales-invoice-modal,
  #sales-invoice-editor-modal,
  #approval-detail-modal,
  #cutting-preview-modal,
  #delivery-detail-modal
) > .modal-card {
  width: min(1320px, 98vw) !important;
}

/* Never touch the deliberately discreet environment switch. */
#environment-switch-modal,
#environment-switch-modal * {
  --erp-ink: initial;
}

/* ---------- Responsive without overlapping controls ---------- */
@media (max-width: 1100px) {
  .app-shell .accounting-compact-form .compact-form-row {
    grid-template-columns: repeat(3, minmax(130px, 1fr)) !important;
  }
  .app-shell #enterprise-reports-view .reports-filter {
    grid-template-columns: repeat(3, minmax(135px, 1fr)) !important;
  }
  .app-shell #enterprise-reports-view .reports-filter .report-search {
    grid-column: span 2 !important;
  }
  .app-shell #approvals-view .approval-two-columns {
    grid-template-columns: 1fr !important;
  }
  .app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) :is(.admin-form-grid, .backup-settings-form),
  .app-shell #admin-roles-view .permission-matrix {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .app-shell :is(
    #approvals-view,
    #issue-requests-view,
    #issue-history-view,
    #inventory-work-view,
    #inventory-stock-view,
    #warehouse-directory-view,
    #warehouse-finished-view,
    #warehouse-spares-view,
    #warehouse-chemicals-view,
    #manufacturing-work-view,
    #prices-view,
    #finance-view,
    #finance-receipts-view,
    #finance-paid-view,
    #accounting-general-view,
    #accounting-sales-invoices-view,
    #accounting-customers-view,
    #accounting-suppliers-view,
    #accounting-costs-view,
    #accounting-assets-view,
    #accounting-treasury-view,
    #enterprise-reports-view,
    #admin-users-view,
    #admin-roles-view,
    #admin-backups-view
  ) {
    padding-inline: 3px !important;
  }
  .app-shell .accounting-compact-form .compact-form-row,
  .app-shell #enterprise-reports-view .reports-filter {
    grid-template-columns: repeat(2, minmax(120px, 1fr)) !important;
  }
  .app-shell .accounting-compact-form .compact-form-row > label.wide {
    grid-column: span 2 !important;
  }
  .app-shell :is(.accounting-inner-tabs, .accounting-module-tabs, .warehouse-module-tabs, .inventory-content-nav, .catalog-tabs, .approval-tabs) {
    overflow-x: auto !important;
  }
  body > .modal-layer:not(#environment-switch-modal) {
    padding: 5px !important;
  }
  body > .modal-layer:not(#environment-switch-modal) > .modal-card {
    width: 99vw !important;
    max-height: 98vh !important;
  }
  body > .modal-layer:not(#environment-switch-modal) .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) :is(.admin-form-grid, .backup-settings-form),
  .app-shell #admin-roles-view .permission-matrix {
    grid-template-columns: repeat(2, minmax(130px, 1fr)) !important;
  }
}

/* Fixed assets module */
#accounting-assets-view .fixed-assets-head{min-height:0;padding-block:2px;margin:0}
#accounting-assets-view .fixed-assets-head h1{font-size:18px;line-height:1.15;margin:0}
#accounting-assets-view .fixed-assets-tabs{margin:2px 0 5px;min-height:32px}
#accounting-assets-view .fixed-assets-tabs button{min-height:28px;padding:3px 12px}
#accounting-assets-view .fixed-asset-editor,
#accounting-assets-view .fixed-asset-form-strip{display:block;margin:0 0 5px;padding:6px}
#accounting-assets-view .fixed-asset-editor .compact-form-row{grid-template-columns:repeat(4,minmax(150px,1fr));gap:5px 7px;margin-bottom:5px}
#accounting-assets-view .fixed-asset-form-strip .compact-form-row{grid-template-columns:repeat(4,minmax(150px,1fr));gap:5px 7px}
#accounting-assets-view .compact-form-row label>span{font-size:12px;font-weight:700;color:#24364a;margin-bottom:2px}
#accounting-assets-view .compact-form-row input,
#accounting-assets-view .compact-form-row select{height:30px;min-height:30px;padding-block:3px}
#accounting-assets-view .compact-form-actions{padding-top:4px;margin-top:2px}
#accounting-assets-view .fixed-assets-directory .accounting-inline-filter{min-width:min(520px,65vw);margin:0}
#accounting-assets-view .fixed-assets-directory .accounting-inline-filter input{min-width:320px}
#accounting-assets-view table th,
#accounting-assets-view table td{padding:5px 7px;vertical-align:middle}
#accounting-assets-view table td small{display:block;margin-top:1px;line-height:1.2}
#accounting-assets-view .fixed-asset-depreciation .card-toolbar{align-items:end}
#accounting-assets-view .fixed-asset-depreciation .card-toolbar>strong{font-size:15px;color:#0d4f76}
#accounting-assets-view .depreciation-run-footer{display:grid;grid-template-columns:minmax(260px,1fr) auto;gap:7px;padding:6px;border-top:1px solid #c7d5e2}
#accounting-assets-view .depreciation-run-footer input{height:32px}
#accounting-assets-view .fixed-asset-node-editor{border:1px solid #aebfcd;border-radius:6px;background:#f8fbfd;margin:0 0 5px;overflow:hidden}
#accounting-assets-view .fixed-asset-node-kind{display:flex;align-items:end;gap:10px;padding:5px 7px;border-bottom:1px solid #c7d5e2;background:#eaf2f7}
#accounting-assets-view .fixed-asset-node-kind label{display:grid;gap:2px;width:190px}
#accounting-assets-view .fixed-asset-node-kind label>span{font-size:10px;font-weight:800;color:#294b63}
#accounting-assets-view .fixed-asset-node-kind select{height:29px;border:1px solid #8fa7ba;border-radius:4px;background:#fff;padding:2px 6px}
#accounting-assets-view .fixed-asset-node-kind>div{display:grid;gap:1px}
#accounting-assets-view .fixed-asset-node-kind strong{font-size:12px;color:#123e5e}
#accounting-assets-view .fixed-asset-node-kind small{font-size:9px;color:#5d7181}
#accounting-assets-view .fixed-asset-node-editor .accounting-compact-form{border:0;border-radius:0;margin:0;background:#fff}
#accounting-assets-view .fixed-asset-category-fields{grid-template-columns:110px minmax(220px,1fr) minmax(220px,1fr) 75px!important}
#accounting-assets-view .fixed-asset-category-note{margin:1px 0 5px;padding:4px 7px;border-inline-start:3px solid #6f95b2;background:#f2f7fa;color:#40596b;font-size:9px}
#accounting-assets-view .fixed-assets-tree-card .card-toolbar{display:flex;justify-content:space-between;align-items:center;min-height:34px;padding:3px 6px!important}
#accounting-assets-view .fixed-assets-tree-card .accounting-inline-filter{flex:1;max-width:520px;min-width:280px}
#accounting-assets-view .fixed-assets-tree-table{min-width:1050px}
#accounting-assets-view .fixed-assets-tree-table th:first-child{width:32%}
#accounting-assets-view .fixed-assets-tree-table th:nth-child(2){width:7%}
#accounting-assets-view .fixed-assets-tree-table th:nth-child(3){width:20%}
#accounting-assets-view .fixed-assets-tree-table th:nth-child(4){width:12%}
#accounting-assets-view .fixed-assets-tree-table th:nth-child(5){width:10%}
#accounting-assets-view .fixed-assets-tree-table th:nth-child(6){width:7%}
#accounting-assets-view .fixed-assets-tree-table th:nth-child(7){width:12%}
#accounting-assets-view .fixed-assets-tree-table td{height:30px!important;padding-block:2px!important}
#accounting-assets-view .fixed-assets-tree-table td>small{display:block;margin-top:1px;color:#607383;font-size:8px}
#accounting-assets-view .fixed-assets-tree-table .document-action-cell{justify-content:flex-start;gap:2px;flex-wrap:nowrap}
#accounting-assets-view .fixed-assets-tree-table .small-action{min-height:21px;padding:2px 5px;font-size:8px;white-space:nowrap}
#accounting-assets-view .fixed-asset-category-row td{background:#eef4f8}
#accounting-assets-view .fixed-asset-category-row[data-depth="0"] td{background:#dce9f2;border-top:2px solid #89a3b7}
#accounting-assets-view .fixed-asset-leaf-row td{background:#fff}

@media (max-width: 1050px){
  #accounting-assets-view .fixed-asset-editor .compact-form-row,
  #accounting-assets-view .fixed-asset-form-strip .compact-form-row{grid-template-columns:repeat(2,minmax(140px,1fr))}
  #accounting-assets-view .fixed-asset-category-fields{grid-template-columns:repeat(2,minmax(150px,1fr))!important}
}
@media (max-width: 650px){
  #accounting-assets-view .fixed-asset-editor .compact-form-row,
  #accounting-assets-view .fixed-asset-form-strip .compact-form-row{grid-template-columns:1fr}
  #accounting-assets-view .compact-form-row label.wide{grid-column:auto}
  #accounting-assets-view .fixed-assets-tabs{overflow-x:auto;justify-content:flex-start}
  #accounting-assets-view .fixed-assets-tabs button{white-space:nowrap}
  #accounting-assets-view .fixed-assets-directory .accounting-inline-filter{min-width:0;width:100%}
  #accounting-assets-view .fixed-assets-directory .accounting-inline-filter input{min-width:0;width:100%}
  #accounting-assets-view .depreciation-run-footer{grid-template-columns:1fr}
  #accounting-assets-view .fixed-asset-node-kind{align-items:stretch;flex-direction:column}
  #accounting-assets-view .fixed-asset-node-kind label{width:100%}
  #accounting-assets-view .fixed-asset-category-fields{grid-template-columns:1fr!important}
}

@media (max-width: 520px) {
  .app-shell .accounting-compact-form .compact-form-row,
  .app-shell #enterprise-reports-view .reports-filter,
  body > .modal-layer:not(#environment-switch-modal) .form-grid {
    grid-template-columns: 1fr !important;
  }
  .app-shell :is(#admin-users-view, #admin-roles-view, #admin-backups-view) :is(.admin-form-grid, .backup-settings-form),
  .app-shell #admin-roles-view .permission-matrix {
    grid-template-columns: 1fr !important;
  }
  .app-shell .accounting-compact-form .compact-form-row > label.wide,
  .app-shell #enterprise-reports-view .reports-filter .report-search,
  body > .modal-layer:not(#environment-switch-modal) .form-grid > .span-2,
  body > .modal-layer:not(#environment-switch-modal) .form-grid > .span-3 {
    grid-column: 1 !important;
  }
  .app-shell .unified-screen-filter > label,
  .app-shell .unified-screen-filter .unified-search {
    flex: 1 1 100% !important;
  }
}
#invoice-detail-collect-btn,#delivery-detail-dispatch-btn{display:none!important}
.app-shell .treasury-invoice-field{display:flex;flex-direction:column;gap:3px;min-width:0}
.app-shell .treasury-invoice-field>span{font-size:10px;font-weight:800;color:#31485d}
.app-shell .treasury-receivable-options{display:grid;grid-template-columns:repeat(2,minmax(210px,1fr));gap:3px;max-height:108px;overflow:auto;padding:4px;border:1px solid #9eb1c2;border-radius:5px;background:#f8fafc}
.app-shell .treasury-receivable-option{display:flex!important;flex-direction:row!important;align-items:center;gap:6px!important;min-width:0;padding:4px 6px;border:1px solid #cfdae4;border-radius:4px;background:#fff;cursor:pointer}
.app-shell .treasury-receivable-option input{width:15px!important;height:15px!important;min-height:15px!important;flex:0 0 15px}
.app-shell .treasury-receivable-option span{display:flex;flex-direction:column;min-width:0;font-size:10px!important}
.app-shell .treasury-receivable-option small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#53687b}
@media(max-width:760px){.app-shell .treasury-receivable-options{grid-template-columns:1fr}}

/* Purchasing documents: compact, data-first and consistent with the ERP chrome. */
#purchasing-orders-view .accounting-pro-head,#purchasing-invoices-view .accounting-pro-head{min-height:34px;padding:3px 6px;margin-bottom:4px}
#purchasing-orders-view .accounting-pro-head h1,#purchasing-invoices-view .accounting-pro-head h1{font-size:16px;margin:0}
.purchasing-document-modal{width:min(1180px,96vw);max-height:94vh}
.compact-purchase-head{gap:5px!important;padding:5px!important}
.compact-purchase-head .field{gap:2px}
.compact-purchase-head :is(input,select){height:29px;min-height:29px}
.purchasing-lines-head{display:flex;align-items:center;justify-content:space-between;padding:4px 6px;border-block:1px solid #c6d4e0;background:#edf3f7}
.purchasing-lines-wrap{max-height:52vh;overflow:auto}
.purchasing-lines-wrap table{min-width:960px}
.purchasing-lines-wrap th{height:25px;padding:3px 5px;font-size:10px}
.purchasing-lines-wrap td{height:31px;padding:3px 4px;vertical-align:middle}
.purchasing-lines-wrap :is(input,select){height:27px;min-height:27px;padding:2px 5px}
.purchasing-lines-wrap td:nth-child(1){width:38px}.purchasing-lines-wrap td:nth-child(3){width:105px}.purchasing-lines-wrap td:last-child{width:36px}
.purchase-notes{display:grid;gap:2px;padding:4px 6px}.purchase-notes textarea{min-height:44px}
.compact-measurement-row{display:flex;align-items:end;gap:5px;padding:3px 5px;background:#f4f8fb}
.compact-measurement-row label{display:grid;gap:1px;font-size:9px;font-weight:800}.compact-measurement-row input{width:100px}
.purchase-block-measurements.hidden{display:none}
#purchasing-invoices-view .accounting-inner-tabs{margin-bottom:4px}
@media(max-width:700px){.purchasing-document-modal{width:98vw}.compact-purchase-head{grid-template-columns:1fr!important}.purchasing-lines-wrap{overflow:auto}.compact-measurement-row{align-items:stretch;flex-wrap:wrap}}

.purchasing-register-filter{display:grid!important;grid-template-columns:minmax(260px,1fr) 145px 132px 132px auto auto;align-items:center;gap:4px!important;min-height:34px!important;padding:3px 6px!important;margin:0 0 4px!important;border:1px solid #a9bbc8;border-radius:5px;background:#f5f8fa}
.purchasing-register-filter :is(input,select,.button){height:27px!important;min-height:27px!important;font-size:9px!important}
.purchasing-register-filter .unified-search{width:auto!important;min-width:0!important;height:27px!important;margin:0!important;background:#fff}
.purchasing-register-card,.supplier-invoice-register{margin:0!important;border-color:#a9bbc8!important;border-radius:5px!important;overflow:hidden}
.purchasing-register-card .card-toolbar,.supplier-invoice-register .card-toolbar{min-height:29px!important;padding:3px 6px!important;background:#edf3f7}
.purchasing-register-table{min-width:980px;table-layout:fixed}
.purchasing-register-table th:nth-child(1){width:90px}.purchasing-register-table th:nth-child(2){width:110px}.purchasing-register-table th:nth-child(3){width:230px}.purchasing-register-table th:nth-child(4){width:58px}.purchasing-register-table th:nth-child(5){width:105px}.purchasing-register-table th:nth-child(6){width:125px}.purchasing-register-table th:nth-child(7){width:88px}.purchasing-register-table th:nth-child(8){width:190px}
.purchasing-register-table :is(th,td),.supplier-invoice-register :is(th,td){height:30px!important;padding:2px 5px!important;vertical-align:middle!important}
.purchasing-register-table td>small,.purchasing-register-table td>strong+small,.supplier-invoice-register td>small{display:block;margin-top:1px;color:#63798a;font-size:7.5px;line-height:1.1}
.purchasing-register-table .document-action-cell,.supplier-invoice-register .document-action-cell{justify-content:flex-start;gap:2px!important;white-space:nowrap}
.purchasing-register-table .small-action,.purchasing-register-table .doc-action,.supplier-invoice-register .small-action,.supplier-invoice-register .doc-action{height:22px!important;min-height:22px!important;padding:0 6px!important;font-size:8px!important}
.purchasing-load-more{display:flex;justify-content:center;padding:5px;border-top:1px solid #d0dbe3;background:#f8fafb}
.purchase-order-modal-card .modal-header{height:40px;min-height:40px;padding:4px 8px!important}.purchase-order-modal-card .modal-header h2{font-size:13px!important;margin:0}.purchase-order-modal-card .modal-header .eyebrow{display:none}
.purchase-currency-chip{display:inline-flex;align-items:center;justify-content:center;min-width:72px;height:23px;margin-inline-start:auto;padding:0 8px;border:1px solid #8eb3ca;border-radius:12px;background:#edf7fc;color:#145d84;font-size:8.5px;font-weight:900}
.purchase-order-lines-wrap table{min-width:1080px;table-layout:fixed}.purchase-order-lines-wrap th:nth-child(1){width:34px}.purchase-order-lines-wrap th:nth-child(2){width:235px}.purchase-order-lines-wrap th:nth-child(3){width:92px}.purchase-order-lines-wrap th:nth-child(4){width:135px}.purchase-order-lines-wrap th:nth-child(5){width:112px}.purchase-order-lines-wrap th:nth-child(6){width:112px}.purchase-order-lines-wrap th:nth-child(7){width:185px}.purchase-order-lines-wrap th:nth-child(8){width:auto}.purchase-order-lines-wrap th:nth-child(9){width:34px}
.purchase-line-total{direction:ltr;text-align:left;color:#173d58}.purchase-order-lines-wrap tfoot th{height:28px!important;border-top:2px solid #8199aa!important;background:#e7eff4!important;color:#153d59!important;font-size:9px!important}.purchase-order-lines-wrap tfoot #purchase-order-total{direction:ltr;text-align:left;font-weight:900}
#warehouse-receipt-purchase-order-field{min-width:0;padding:3px 5px;border:1px solid #b7c8d4;border-radius:5px;background:#f4f8fa}#warehouse-receipt-purchase-order-field>small{margin-top:1px;color:#647989;font-size:7.5px}.receipt-remaining-hint{display:block;color:#256b54;font-size:7.5px;font-weight:800}.linked-line-badge{display:inline-flex;align-items:center;min-height:18px;padding:1px 5px;border-radius:9px;background:#e9f4fb;color:#12608c;font-size:7px;font-weight:850;white-space:nowrap}
.warehouse-receipt-modal-card{width:min(1500px,98vw)!important}.purchase-receipt-source-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin:0 10px 4px;border:1px solid #9fb3c1;border-radius:5px;overflow:hidden;background:#9fb3c1}.purchase-receipt-source-summary>div{min-width:0;padding:4px 7px;background:#f4f8fb}.purchase-receipt-source-summary span,.purchase-receipt-source-summary small{display:block;color:#627889;font-size:7.5px}.purchase-receipt-source-summary strong{display:block;overflow:hidden;color:#173d58;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap table{min-width:1320px!important;table-layout:fixed}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(1){width:42px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(2){width:32px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(3){width:220px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(4),.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(5),.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(6){width:78px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(7){width:105px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(8){width:90px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(9),.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(10),.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(11){width:72px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(12){width:92px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(13){width:125px}.warehouse-receipt-modal-card .warehouse-receipt-lines-wrap th:nth-child(14){width:70px}.receipt-select-cell{text-align:center}.warehouse-receipt-lines-wrap .receipt-line-selected{width:15px!important;height:15px!important;min-height:15px!important;accent-color:#0878b9}.receipt-order-quantity{text-align:center;color:#526c7e}.receipt-order-quantity strong{color:#173d58}.receipt-order-quantity.remaining strong{color:#16704d}.receipt-line-skipped{opacity:.48}.receipt-line-skipped td{background:#f2f4f6!important}.receipt-not-applicable{text-align:center;color:#93a3ae}.warehouse-receipt-lines-wrap .receipt-number{width:100%!important}.warehouse-receipt-lines-wrap .receipt-date{width:100%!important}
@media(max-width:900px){.purchase-receipt-source-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.purchasing-register-filter{grid-template-columns:minmax(220px,1fr) 130px 125px 125px auto auto}.purchase-order-modal-card{width:99vw!important}.compact-purchase-head{grid-template-columns:repeat(3,minmax(160px,1fr))!important}}
@media(max-width:680px){.purchasing-register-filter{grid-template-columns:1fr 1fr}.purchasing-register-filter .unified-search{grid-column:1/-1}.compact-purchase-head{grid-template-columns:1fr!important}.purchase-currency-chip{margin-inline-start:0}.purchasing-register-filter .button{width:100%}}

/* Purchasing workspace: wide, grid-safe, and consistent with the approved ERP visual system. */
.app-shell :is(#purchasing-orders-view,#purchasing-suppliers-view,#purchasing-invoices-view){
  min-width:0!important;
  padding-inline:4px!important;
}
.app-shell .purchasing-command-bar{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  width:100%!important;
  min-height:38px!important;
  margin:0 0 3px!important;
  padding:4px 5px!important;
  border:1px solid #8fa9bb!important;
  border-radius:6px!important;
  background:linear-gradient(180deg,#f9fbfd 0%,#e9f1f6 100%)!important;
  box-shadow:0 2px 7px rgba(20,61,88,.08)!important;
}
.app-shell .purchasing-command-title{
  display:flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  gap:6px!important;
  min-width:175px!important;
}
.app-shell .purchasing-command-icon{
  display:grid!important;
  flex:0 0 26px!important;
  place-items:center!important;
  width:26px!important;
  height:26px!important;
  border-radius:6px!important;
  background:linear-gradient(145deg,#164f76,#08729d)!important;
  color:#fff!important;
  font-size:12px!important;
  font-weight:950!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)!important;
}
.app-shell .purchasing-command-title h1{
  margin:0!important;
  color:#123d5b!important;
  font-size:13px!important;
  font-weight:950!important;
  line-height:1.05!important;
  white-space:nowrap!important;
}
.app-shell .purchasing-command-title small{
  display:block!important;
  margin-top:2px!important;
  color:#607789!important;
  font-size:7.5px!important;
  font-weight:700!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.app-shell .purchasing-inline-filter{
  display:grid!important;
  flex:1 1 auto!important;
  grid-template-columns:minmax(180px,1fr) 125px 116px 116px 42px 42px!important;
  align-items:center!important;
  gap:3px!important;
  min-width:0!important;
  margin:0!important;
}
.app-shell .purchasing-inline-filter :is(input,select,.small-action,.unified-search){
  width:100%!important;
  min-width:0!important;
  height:25px!important;
  min-height:25px!important;
  margin:0!important;
  border-radius:4px!important;
  font-size:9px!important;
}
.app-shell .purchasing-inline-filter .unified-search{background:#fff!important}
.app-shell .purchasing-inline-filter .unified-search input{height:23px!important;min-height:23px!important;border:0!important}
.app-shell .purchasing-primary-action{
  flex:0 0 auto!important;
  height:26px!important;
  min-height:26px!important;
  padding:0 9px!important;
  border-radius:4px!important;
  font-size:9px!important;
  white-space:nowrap!important;
}
.app-shell .purchasing-status-strip{
  display:flex!important;
  align-items:center!important;
  gap:5px!important;
  min-height:27px!important;
  margin-bottom:3px!important;
  padding:3px 5px!important;
  border:1px solid #b3c3ce!important;
  border-radius:5px!important;
  background:#fff!important;
}
.app-shell .purchasing-status-strip>span{
  display:inline-flex!important;
  align-items:center!important;
  gap:4px!important;
  min-height:19px!important;
  padding:1px 7px!important;
  border-left:1px solid #d0dbe2!important;
  color:#4c6678!important;
  font-size:8px!important;
  font-weight:750!important;
  white-space:nowrap!important;
}
.app-shell .purchasing-status-strip>span:last-child{border-left:0!important}
.app-shell .purchasing-status-strip b{color:#123d5b!important;font-size:10px!important}
.app-shell .purchase-state-dot{display:inline-block!important;width:7px!important;height:7px!important;border-radius:50%!important;background:#879aa8!important}
.app-shell .purchase-state-dot.open{background:#2a78b0!important}.app-shell .purchase-state-dot.partial{background:#d39018!important}.app-shell .purchase-state-dot.received{background:#159168!important}
.app-shell .purchasing-segmented-tabs{
  display:inline-flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  gap:2px!important;
  padding:2px!important;
  border:1px solid #a9bbc8!important;
  border-radius:5px!important;
  background:#dde8ef!important;
}
.app-shell .purchasing-segmented-tabs button{
  height:23px!important;
  min-height:23px!important;
  padding:0 8px!important;
  border:0!important;
  border-radius:4px!important;
  background:transparent!important;
  color:#476176!important;
  font-size:8.5px!important;
  font-weight:850!important;
  cursor:pointer!important;
}
.app-shell .purchasing-segmented-tabs button.active{background:#fff!important;color:#075f96!important;box-shadow:0 1px 3px rgba(23,61,88,.16)!important}
.app-shell .purchasing-segmented-tabs b{display:inline-grid!important;place-items:center!important;min-width:17px!important;height:16px!important;margin-inline-start:3px!important;border-radius:8px!important;background:#d8e8f3!important;font-size:7.5px!important}
.app-shell .purchasing-filter-row{
  grid-template-columns:minmax(220px,1fr) 125px 125px 42px 42px auto!important;
  min-height:32px!important;
  margin:0 0 3px!important;
  padding:3px 5px!important;
  border:1px solid #afc0cc!important;
  border-radius:5px!important;
  background:#f7fafc!important;
}
.app-shell .purchasing-filter-result{margin-inline-start:auto!important;color:#607789!important;font-size:8.5px!important;font-weight:850!important;white-space:nowrap!important}
.app-shell :is(#purchasing-orders-view,#purchasing-invoices-view) .accounting-pro-head{
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  padding:3px 5px!important;
  border:1px solid #9db2c2!important;
  border-radius:5px 5px 0 0!important;
  background:linear-gradient(180deg,#f9fbfc,#edf3f7)!important;
}
.app-shell :is(#purchasing-orders-view,#purchasing-invoices-view) .accounting-pro-head h1{
  color:#123d5b!important;
  font-size:14px!important;
  font-weight:900!important;
}
.app-shell :is(#purchasing-orders-view,#purchasing-invoices-view) .accounting-pro-head .button{
  height:23px!important;
  min-height:23px!important;
  padding:0 8px!important;
  border-radius:4px!important;
  font-size:9px!important;
}
.app-shell :is(#purchasing-orders-view,#purchasing-invoices-view) .purchasing-register-filter{
  margin-top:-1px!important;
  border-radius:0 0 5px 5px!important;
  border-color:#9db2c2!important;
  background:#f6f9fb!important;
  box-shadow:0 1px 0 rgba(18,61,91,.04)!important;
}
.app-shell :is(.purchasing-register-card,.supplier-invoice-register){
  border:1px solid #9db2c2!important;
  box-shadow:0 2px 8px rgba(27,58,80,.06)!important;
}
.app-shell :is(.purchasing-register-card,.supplier-invoice-register) .table-wrap{
  max-width:100%!important;
  overflow-x:auto!important;
  scrollbar-width:thin;
}
.app-shell :is(.purchasing-register-card,.supplier-invoice-register) tbody tr:nth-child(even) td{background:#fbfdfe}
.app-shell :is(.purchasing-register-card,.supplier-invoice-register) tbody tr:hover td{background:#eef6fb!important}
.app-shell :is(.purchasing-register-card,.supplier-invoice-register) thead th{
  border-block:1px solid #a8bbc9!important;
  background:#e7eff4!important;
  color:#173e5b!important;
  font-weight:900!important;
}
.app-shell #purchasing-invoices-view .accounting-inner-tabs{
  margin-top:2px!important;
  border:1px solid #a4b8c7!important;
  border-radius:5px!important;
  background:#e9f0f5!important;
}
.app-shell #purchasing-invoices-view .accounting-inner-tabs>button.active{
  border-color:#759cb7!important;
  background:#fff!important;
  color:#075d94!important;
}

/* Supplier directory uses the same compact command-bar/card language. */
.app-shell #purchasing-suppliers-view .supplier-directory-head{
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  padding:3px 6px!important;
  border:1px solid #9db2c2!important;
  border-radius:5px 5px 0 0!important;
  background:linear-gradient(180deg,#f9fbfc,#edf3f7)!important;
}
.app-shell #purchasing-suppliers-view .supplier-purchasing-command .purchasing-command-title{min-width:190px!important}
.app-shell #purchasing-suppliers-view .supplier-purchasing-command .supplier-directory-filter{grid-template-columns:minmax(220px,1fr) 42px auto!important}
.app-shell #purchasing-suppliers-view .supplier-purchasing-command .supplier-directory-primary-actions{margin-inline-start:0!important}
.app-shell #purchasing-suppliers-view .supplier-directory-bar{
  min-height:34px!important;
  margin-top:-1px!important;
  margin-bottom:3px!important;
  padding:3px 5px!important;
  border-color:#9db2c2!important;
  border-radius:0 0 5px 5px!important;
  background:#f6f9fb!important;
}
.app-shell #purchasing-suppliers-view .supplier-directory-filter{min-width:0!important;flex:1 1 360px!important}
.app-shell #purchasing-suppliers-view .supplier-directory-primary-actions{flex:0 0 auto!important;flex-wrap:wrap!important;justify-content:flex-end!important}
.app-shell #purchasing-suppliers-view .supplier-directory-card{box-shadow:0 2px 8px rgba(27,58,80,.06)!important}
.app-shell #purchasing-suppliers-view .supplier-directory-card>.table-wrap{max-width:100%!important;overflow-x:auto!important;scrollbar-width:thin}
.app-shell #purchasing-suppliers-view .supplier-tree-table{width:100%!important;min-width:1060px!important}

/* Purchasing dialogs fill the usable viewport; their tables never create a nested horizontal scrollbar. */
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal)>.purchasing-document-modal{
  width:min(1460px,calc(100vw - 14px))!important;
  max-width:calc(100vw - 14px)!important;
  max-height:calc(100vh - 12px)!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal)>.purchasing-document-modal>form{
  min-width:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .modal-header{
  flex:0 0 38px!important;
  min-height:38px!important;
  padding:5px 8px!important;
  background:linear-gradient(180deg,#fff,#f3f7fa)!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .modal-header h2{
  color:#123d5b!important;
  font-size:15px!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .compact-purchase-head{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:5px 7px!important;
  padding:6px 8px!important;
  border-bottom:1px solid #bdccd7!important;
  background:#fbfcfd!important;
}
body>#supplier-invoice-modal .supplier-invoice-head{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-head{
  min-height:31px!important;
  padding:4px 8px!important;
  border-color:#aebfcb!important;
  background:#e7eff4!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-head strong{color:#153e5d!important;font-size:11px!important}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-head small{display:block;color:#617789!important;font-size:8px!important}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-wrap{
  width:100%!important;
  max-width:100%!important;
  max-height:none!important;
  overflow:visible!important;
  border:0!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-wrap table{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  table-layout:fixed!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-wrap :is(th,td){
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-wrap td :is(input,select,.smart-select,.smart-select-input,.smart-select-trigger){
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchasing-lines-wrap td :is(.smart-select-input,.smart-select-trigger){
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .purchase-notes{padding:5px 8px!important;background:#fbfcfd!important}
body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .modal-actions{flex:0 0 38px!important}

body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(1){width:3%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(2){width:21%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(3){width:8%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(4){width:10%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(5){width:10%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(6){width:11%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(7){width:18%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(8){width:16%!important}
body>#purchase-order-modal .purchase-order-lines-wrap th:nth-child(9){width:3%!important}
body>#purchase-order-modal .purchase-order-lines-wrap td:nth-child(1),body>#purchase-order-modal .purchase-order-lines-wrap td:last-child{text-align:center!important}

body>#purchase-receipt-modal .purchase-receipt-source-summary{margin:6px 8px 0!important}
body>#purchase-receipt-modal .purchase-receipt-financial-note{padding:3px 7px;border:1px solid #b7d8ca;border-radius:999px;background:#f1faf6;color:#176c4c;font-size:9px;font-weight:700;white-space:nowrap}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(1){width:5%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(2){width:4%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(3){width:20%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(4){width:9%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(5){width:10%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(6){width:9%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(7){width:12%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(8){width:10%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(9){width:11%!important}
body>#purchase-receipt-modal .purchasing-lines-wrap th:nth-child(10){width:10%!important}
body>#purchase-receipt-modal .purchase-receipt-product strong,body>#purchase-receipt-modal .purchase-receipt-product small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body>#purchase-receipt-modal .purchase-receipt-order-notes{color:#617789;font-size:9px;white-space:normal!important}
body>#purchase-receipt-modal .fixed-uom-badge{display:block;padding:4px 5px;border:1px solid #c8d5de;border-radius:4px;background:#f5f8fa;color:#244a64;text-align:center;font-weight:700}
body>#purchase-receipt-modal .purchase-block-measurements td{overflow:visible!important}
body>#purchase-receipt-modal .compact-measurement-row{display:grid!important;grid-template-columns:repeat(3,minmax(120px,1fr)) minmax(180px,2fr)!important;align-items:end!important}
body>#purchase-receipt-modal .compact-measurement-row input{width:100%!important}

body>#supplier-invoice-modal .supplier-invoice-lines-wrap th:nth-child(1){width:5%!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap th:nth-child(2){width:29%!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap th:nth-child(3){width:11%!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap th:nth-child(4){width:11%!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap th:nth-child(5){width:14%!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap th:nth-child(6){width:15%!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap th:nth-child(7){width:15%!important}

/* Supplier invoices: receipt-led workflow with compact, readable accounting controls. */
.app-shell #supplier-invoices-filter{
  grid-template-columns:minmax(230px,1fr) 112px 112px 98px 98px 42px 42px auto!important;
}
.app-shell .supplier-invoice-status-strip{margin-bottom:3px!important}
.app-shell .supplier-invoice-register table{width:100%!important;min-width:1120px!important;table-layout:fixed!important}
.app-shell .supplier-invoice-register th:nth-child(1){width:10%!important}
.app-shell .supplier-invoice-register th:nth-child(2){width:10%!important}
.app-shell .supplier-invoice-register th:nth-child(3){width:15%!important}
.app-shell .supplier-invoice-register th:nth-child(4){width:13%!important}
.app-shell .supplier-invoice-register th:nth-child(5){width:10%!important}
.app-shell .supplier-invoice-register th:nth-child(6){width:15%!important}
.app-shell .supplier-invoice-register th:nth-child(7){width:12%!important}
.app-shell .supplier-invoice-register th:nth-child(8){width:7%!important}
.app-shell .supplier-invoice-register th:nth-child(9){width:8%!important}
.app-shell .supplier-invoice-register td{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body>#supplier-invoice-modal>.supplier-invoice-modal-card{width:min(1280px,calc(100vw - 18px))!important;max-height:calc(100vh - 14px)!important;overflow:hidden!important}
body>#supplier-invoice-modal .supplier-invoice-cycle-badge{display:inline-flex;align-items:center;min-height:23px;margin-inline-start:auto;padding:2px 9px;border:1px solid #9cb8ca;border-radius:12px;background:#edf6fb;color:#155b82;font-size:8.5px;font-weight:900;white-space:nowrap}
body>#supplier-invoice-modal #supplier-invoice-form{display:flex!important;flex-direction:column!important;gap:5px!important;padding:5px 7px 0!important;overflow-x:hidden!important;overflow-y:auto!important}
body>#supplier-invoice-modal .supplier-invoice-section{min-width:0;border:1px solid #a8bbc9;border-radius:6px;background:#fff;overflow:hidden}
body>#supplier-invoice-modal .supplier-invoice-section>header{display:flex;align-items:center;justify-content:space-between;min-height:31px;padding:4px 8px;border-bottom:1px solid #b8c8d3;background:linear-gradient(180deg,#f7fafc,#eaf1f5)}
body>#supplier-invoice-modal .supplier-invoice-section>header strong{display:block;color:#143e5c;font-size:10.5px;font-weight:950}
body>#supplier-invoice-modal .supplier-invoice-section>header small{display:block;margin-top:1px;color:#607789;font-size:7.5px;font-weight:700}
body>#supplier-invoice-modal .supplier-invoice-source-grid{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:5px 7px!important;padding:6px 8px!important;background:#fff!important;border:0!important}
body>#supplier-invoice-modal .supplier-invoice-source-grid .supplier-receipt-field{grid-column:span 2}
body>#supplier-invoice-modal .supplier-invoice-source-grid :is(input,select,.smart-select){width:100%!important;min-width:0!important;max-width:100%!important}
body>#supplier-invoice-modal .supplier-invoice-source-summary{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:1px!important;min-height:42px!important;margin:0 8px 6px!important;padding:0!important;border:1px solid #a8bbc9!important;border-radius:5px!important;background:#a8bbc9!important;overflow:hidden!important}
body>#supplier-invoice-modal .supplier-invoice-source-summary>div{min-width:0;padding:4px 7px;background:#f2f7fa}
body>#supplier-invoice-modal .supplier-invoice-source-summary>div.empty{grid-column:1/-1}
body>#supplier-invoice-modal .supplier-invoice-source-summary span,body>#supplier-invoice-modal .supplier-invoice-source-summary small{display:block;color:#61788a;font-size:7.5px;line-height:1.2}
body>#supplier-invoice-modal .supplier-invoice-source-summary strong{display:block;overflow:hidden;margin:1px 0;color:#143e5c;font-size:10px;text-overflow:ellipsis;white-space:nowrap}
body>#supplier-invoice-modal .supplier-invoice-items-section{flex:1 1 auto;min-height:150px}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap{max-height:250px!important;overflow-y:auto!important;overflow-x:hidden!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap thead{position:sticky;top:0;z-index:2}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap :is(th,td){height:31px!important;padding:3px 6px!important;border-bottom:1px solid #d8e1e7!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap th{background:#e8f0f5!important;color:#173e5b!important;font-size:8.5px!important;font-weight:900!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap td:nth-child(1),body>#supplier-invoice-modal .supplier-invoice-lines-wrap td:nth-child(n+3){text-align:center!important}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap td strong,body>#supplier-invoice-modal .supplier-invoice-lines-wrap td small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body>#supplier-invoice-modal .supplier-invoice-lines-wrap td small{color:#63798a;font-size:7.5px}
body>#supplier-invoice-modal .supplier-po-price{color:#536d7f;font-weight:800}
body>#supplier-invoice-modal .supplier-invoice-unit-price{height:25px!important;text-align:center!important;font-weight:850!important}
body>#supplier-invoice-modal .supplier-invoice-line-total{direction:ltr;color:#0f5f42;font-weight:950!important}
body>#supplier-invoice-modal .supplier-invoice-bottom-grid{display:grid;grid-template-columns:minmax(0,1fr) 305px;gap:5px;min-width:0}
body>#supplier-invoice-modal .supplier-invoice-adjustment-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px 7px;padding:6px 8px}
body>#supplier-invoice-modal .supplier-invoice-adjustment-grid .supplier-description-field{grid-column:span 2}
body>#supplier-invoice-modal .supplier-invoice-adjustment-grid :is(input,select){height:28px!important;min-height:28px!important}
body>#supplier-invoice-modal .supplier-invoice-toggle .supplier-toggle-line{display:flex;align-items:center;justify-content:space-between;height:28px;padding:3px 8px;border:1px solid #b5c6d2;border-radius:4px;background:#f7fafc;color:#35566d}
body>#supplier-invoice-modal .supplier-invoice-toggle .supplier-toggle-line input{width:15px!important;height:15px!important;min-height:15px!important;margin:0;accent-color:#0878b9}
body>#supplier-invoice-modal .supplier-invoice-toggle .supplier-toggle-line b{font-size:8.5px}
body>#supplier-invoice-modal .supplier-invoice-totals{border:1px solid #8faabc;border-radius:6px;background:#f7fafc;overflow:hidden}
body>#supplier-invoice-modal .supplier-invoice-totals>header{min-height:31px;padding:4px 8px;border-bottom:1px solid #afc1cd;background:#e7f0f5}
body>#supplier-invoice-modal .supplier-invoice-totals>header strong,body>#supplier-invoice-modal .supplier-invoice-totals>header small{display:block}
body>#supplier-invoice-modal .supplier-invoice-totals>header strong{color:#143e5c;font-size:10.5px}
body>#supplier-invoice-modal .supplier-invoice-totals>header small{color:#61788a;font-size:7.5px}
body>#supplier-invoice-modal .supplier-invoice-totals dl{margin:0;padding:3px 7px}
body>#supplier-invoice-modal .supplier-invoice-totals dl>div{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:23px;border-bottom:1px dashed #c8d5de;color:#3f5d72;font-size:8.5px}
body>#supplier-invoice-modal .supplier-invoice-totals dd{margin:0;direction:ltr;color:#173e5b;font-weight:900}
body>#supplier-invoice-modal .supplier-invoice-totals .grand{min-height:31px;margin:3px -2px -1px;padding:2px 7px;border:1px solid #77a9c5;border-radius:4px;background:#e7f4fb;color:#0e537a;font-size:10px;font-weight:950}
body>#supplier-invoice-modal .modal-actions{position:sticky;bottom:0;z-index:3;margin-inline:-7px!important;padding-inline:8px!important;border-top:1px solid #aabcc8!important;background:#f7fafc!important}

/* Supplier definition dialogs are also wide enough for four balanced columns. */
body>#purchasing-supplier-modal>.supplier-directory-modal-card{width:min(1120px,calc(100vw - 18px))!important;max-width:calc(100vw - 18px)!important;overflow:hidden!important}
body>#purchasing-supplier-modal>.supplier-directory-modal-card>form{overflow-x:hidden!important;overflow-y:auto!important}
body>#purchasing-supplier-modal .supplier-form-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px 7px!important}
body>#purchasing-supplier-modal .supplier-form-grid :is(input,select,.smart-select){width:100%!important;min-width:0!important;max-width:100%!important}
body>#purchasing-supplier-category-modal>.supplier-category-modal-card{width:min(820px,calc(100vw - 18px))!important;max-width:calc(100vw - 18px)!important;overflow:hidden!important}
body>#purchasing-supplier-category-modal .supplier-category-form-grid{grid-template-columns:145px minmax(190px,1fr) minmax(190px,1fr)!important}

@media(max-width:900px){
  .app-shell .purchasing-command-bar{align-items:stretch!important;flex-wrap:wrap!important}
  .app-shell .purchasing-command-title{min-width:160px!important}
  .app-shell .purchasing-inline-filter{order:3;flex:1 1 100%!important;grid-template-columns:minmax(170px,1fr) 112px 110px 110px 42px 42px!important}
  .app-shell .purchasing-primary-action{margin-inline-start:auto!important}
  .app-shell #purchasing-suppliers-view .supplier-directory-bar{align-items:stretch!important;flex-direction:column!important}
  .app-shell #purchasing-suppliers-view .supplier-directory-primary-actions{width:100%!important;margin:0!important;overflow:visible!important}
  body>#purchasing-supplier-modal .supplier-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body>#supplier-invoice-modal .supplier-invoice-head{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body>#supplier-invoice-modal .supplier-invoice-source-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body>#supplier-invoice-modal .supplier-invoice-bottom-grid{grid-template-columns:1fr}
  body>#supplier-invoice-modal .supplier-invoice-adjustment-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  body>#supplier-invoice-modal .supplier-invoice-totals dl{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
  body>#supplier-invoice-modal .supplier-invoice-totals .grand{grid-column:1/-1}
}
@media(max-width:680px){
  .app-shell .purchasing-inline-filter,.app-shell .purchasing-filter-row{grid-template-columns:1fr 1fr!important}
  .app-shell .purchasing-inline-filter .unified-search{grid-column:1/-1!important}
  .app-shell .purchasing-command-title small{display:none!important}
  .app-shell .purchasing-status-strip{overflow-x:auto!important}
  body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal)>.purchasing-document-modal{width:calc(100vw - 6px)!important;max-width:calc(100vw - 6px)!important}
  body>:is(#purchase-order-modal,#purchase-receipt-modal,#supplier-invoice-modal) .compact-purchase-head{grid-template-columns:1fr!important}
  body>#purchasing-supplier-modal .supplier-form-grid,body>#purchasing-supplier-category-modal .supplier-category-form-grid{grid-template-columns:1fr!important}
  body>#purchasing-supplier-modal .supplier-name-field,body>#purchasing-supplier-modal .supplier-address-field,body>#purchasing-supplier-category-modal .supplier-category-description{grid-column:auto!important}
  body>#purchase-receipt-modal .compact-measurement-row{grid-template-columns:1fr 1fr!important}
  body>#supplier-invoice-modal .supplier-invoice-cycle-badge{display:none}
  body>#supplier-invoice-modal .supplier-invoice-source-grid{grid-template-columns:1fr!important}
  body>#supplier-invoice-modal .supplier-invoice-source-grid .supplier-receipt-field{grid-column:auto}
  body>#supplier-invoice-modal .supplier-invoice-source-summary{grid-template-columns:1fr 1fr!important}
  body>#supplier-invoice-modal .supplier-invoice-adjustment-grid{grid-template-columns:1fr 1fr}
  body>#supplier-invoice-modal .supplier-invoice-adjustment-grid .supplier-description-field{grid-column:1/-1}
}
/* Professional compact product directory */
#catalog-products-panel{min-width:0}
#catalog-products-panel>.catalog-heading-actions{min-height:0;margin:0!important}
.catalog-capability-toolbar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;height:38px!important;min-height:38px!important;max-height:38px!important;padding:4px 7px!important;flex-wrap:nowrap!important;background:#f8fafc!important}
.catalog-capability-toolbar .catalog-title-block{flex:0 0 auto;display:flex;align-items:baseline;gap:6px;min-width:150px}
.catalog-capability-toolbar .catalog-title-block h2{font-size:12px!important;color:#153e5d}
.catalog-capability-toolbar .catalog-title-block span{font-size:8px!important;color:#667b8b}
.catalog-capability-toolbar>.unified-screen-filter{display:none!important}
.catalog-filter-strip{display:grid!important;grid-template-columns:minmax(260px,1fr) 175px!important;align-items:center!important;gap:5px!important;width:min(570px,55vw)!important;min-width:435px!important;margin-inline-start:auto!important}
.catalog-filter-strip .table-search{display:flex!important;width:100%!important;min-width:0!important;height:28px!important;min-height:28px!important;margin:0!important}
.catalog-filter-strip .table-search input{width:100%!important;height:26px!important;min-height:26px!important;font-size:9.5px!important}
.catalog-filter-strip>select{width:175px!important;height:28px!important;min-height:28px!important;border:1px solid #9fb4c4;border-radius:4px;background:#fff;color:#173b55;padding:1px 6px;font-size:9px}
.catalog-filter-strip>.smart-select{width:175px!important;min-width:175px!important;max-width:175px!important}
.catalog-filter-strip>.smart-select :is(.smart-select-input,.smart-select-trigger){height:28px!important;min-height:28px!important;font-size:9px!important}
.catalog-bulk-capability{display:flex;align-items:center;gap:4px;height:30px;min-height:30px;padding:2px 6px;border-bottom:1px solid #9eb5c5;background:#edf5fa;color:#23465f}
.catalog-bulk-capability.hidden{display:none!important}
.catalog-bulk-capability strong{min-width:58px;font-size:10px;color:#0b5f93}
.catalog-bulk-capability>span{font-size:9px;font-weight:800}
.catalog-bulk-capability select{width:145px;height:24px;min-height:24px;border:1px solid #94acbd;border-radius:4px;background:#fff;padding:1px 5px;font-size:9px}
.catalog-bulk-capability .small-action{height:23px!important;min-height:23px!important;padding:0 7px!important;font-size:8px!important}
.catalog-products-professional-table{width:100%!important;min-width:1010px!important;table-layout:fixed!important}
.catalog-products-professional-table th:nth-child(1){width:32px!important}
.catalog-products-professional-table th:nth-child(2){width:27%!important}
.catalog-products-professional-table th:nth-child(3){width:18%!important}
.catalog-products-professional-table th:nth-child(4){width:18%!important}
.catalog-products-professional-table th:nth-child(5){width:10%!important}
.catalog-products-professional-table th:nth-child(6){width:12%!important}
.catalog-products-professional-table th:nth-child(7){width:70px!important}
.catalog-products-professional-table th:nth-child(8){width:155px!important}
.catalog-products-professional-table :is(th,td){overflow:hidden}
.catalog-select-column{width:32px!important;min-width:32px!important;padding:0 4px!important;text-align:center!important}
.catalog-product-row td:first-child{padding:0 4px!important}
.catalog-select-column input{display:block;width:14px;height:14px;margin:auto;accent-color:#176e9f}
.catalog-product-row td{height:34px!important;padding:2px 5px!important;vertical-align:middle!important}
.catalog-product-row .catalog-product-identity{display:grid;grid-template-columns:minmax(80px,1fr) auto auto;align-items:center;gap:3px 7px;width:calc(100% - 19px);max-width:none}
.catalog-product-identity strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px!important;color:#133b58}
.catalog-product-identity small{direction:ltr;white-space:nowrap;font:8px Consolas,monospace!important;color:#536c7f}
.catalog-product-identity em{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;font-size:8px;color:#64798a}
.catalog-tree-branch{width:14px!important;margin-inline-end:3px!important}
.catalog-capability-badges{display:flex;align-items:center;flex-wrap:nowrap;gap:3px;max-width:100%;overflow:hidden}
.catalog-capability-badge,.catalog-capability-empty{display:inline-flex;align-items:center;min-height:18px;padding:1px 5px;border:1px solid transparent;border-radius:9px;background:#edf2f5;color:#40596b;font-size:8px;font-weight:800;white-space:nowrap}
.catalog-capability-badge.sales{border-color:#a8d5c0;background:#eaf8f1;color:#176a4e}
.catalog-capability-badge.purchase{border-color:#aac7df;background:#edf6fc;color:#1c5f8e}
.catalog-capability-badge.manufacturing_input,.catalog-capability-badge.manufacturing_output{border-color:#cab7df;background:#f5effb;color:#6a438a}
.warehouse-chip{display:block!important;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;border:0!important;background:transparent!important;padding:0!important;border-radius:0!important;color:#355267!important;font-size:8.5px!important}
.catalog-unit-summary,.catalog-balance-summary{display:grid;gap:1px;line-height:1.05}
.catalog-unit-summary strong,.catalog-balance-summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9.5px;color:#183f5a}
.catalog-unit-summary small,.catalog-balance-summary small{font-size:7.5px!important;color:#647989}
.catalog-row-actions{justify-content:flex-end;gap:2px!important}
.catalog-row-actions .small-action{height:21px!important;min-height:21px!important;padding:0 5px!important;font-size:7.5px!important}
.catalog-family-row td{padding:2px 5px!important}
.catalog-family-line{min-height:26px!important}
.catalog-family-line>.sales-row-actions{justify-self:end!important;margin-inline-start:auto!important}
.catalog-family-line>.sales-row-actions>summary{height:23px!important;min-height:23px!important;width:62px!important}

.product-catalog-modal-card{width:min(1180px,98vw)!important;max-height:96vh;overflow:auto;background:#f3f6f8}
.product-catalog-modal-card .modal-header{position:sticky;top:0;z-index:5;height:39px;min-height:39px;padding:4px 8px!important;border-bottom:1px solid #9fb3c2;background:#fff}
.product-catalog-modal-card .modal-header h2{font-size:13px!important;margin:0!important}
.product-catalog-modal-card .modal-header .eyebrow{display:none}
.product-catalog-modal-card form{padding:4px!important}
.catalog-form-section{margin:0 0 4px;border:1px solid #a9bbc8;border-radius:5px;background:#fff;overflow:hidden}
.catalog-form-section>header{display:flex;align-items:center;gap:8px;height:27px;padding:3px 7px;border-bottom:1px solid #b8c7d1;background:#eaf1f5}
.catalog-form-section>header strong{font-size:10.5px;color:#123d5c}
.catalog-form-section>header small{font-size:7.5px;color:#627786}
.product-catalog-form-grid{display:grid!important;grid-template-columns:1.15fr .7fr 1fr 1fr!important;gap:4px 5px!important;align-items:end!important;padding:5px 7px!important}
.product-catalog-form-grid .field{display:grid;gap:1px!important;min-width:0}
.product-catalog-form-grid .field>span{font-size:8.5px!important;font-weight:850;color:#314f65;white-space:nowrap}
.product-catalog-form-grid .field>small{min-height:9px;margin:0;font-size:7px!important;line-height:1.15;color:#687d8b}
.product-catalog-form-grid :is(input,select){width:100%;height:27px!important;min-height:27px!important;padding:2px 5px!important;border-color:#9fb3c2!important;border-radius:4px!important;font-size:9.5px!important;background:#fff}
.catalog-basic-grid .catalog-name-field{grid-column:span 2}
.catalog-active-field{display:flex!important;align-items:center!important;align-self:end;gap:6px;height:27px!important;min-height:27px;padding:0 7px!important;border:1px solid #9fb3c2!important;border-radius:4px!important;background:#f8fafb!important;font-size:9px!important;font-weight:800}
.catalog-active-field input{width:14px!important;height:14px!important;min-height:14px!important;margin:0}
.catalog-operation-grid{align-items:start!important}
.catalog-operation-grid>.field:nth-child(1),.catalog-operation-grid>.field:nth-child(2){grid-column:span 2}
.catalog-operation-grid>.catalog-warehouses-field{grid-column:1/-1!important}
.catalog-operation-grid>.catalog-transaction-uoms-field{grid-column:1/-1!important}
.catalog-warehouse-picker{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;align-content:start;gap:5px!important;height:auto!important;min-height:46px;max-height:128px!important;padding:5px!important;overflow:auto;border:1px solid #93aabd!important;border-radius:5px!important;background:#f5f8fa!important}
.catalog-warehouse-choice{display:flex!important;align-items:center!important;gap:7px!important;min-height:34px!important;padding:5px 7px!important;border:1px solid #c3d1dc!important;border-radius:4px!important;background:#fff!important;color:#173b58!important;font-size:9.5px!important;font-weight:750;cursor:pointer;transition:border-color .12s ease,background .12s ease,box-shadow .12s ease}
.catalog-warehouse-choice:hover{border-color:#5f8eb0!important;background:#f4faff!important}
.catalog-warehouse-choice:has(input:checked){border-color:#1774a8!important;background:#eaf6fc!important;box-shadow:inset -3px 0 0 #1774a8}
.catalog-warehouse-choice input{flex:0 0 auto!important;width:15px!important;height:15px!important;min-height:15px!important;margin:0!important;accent-color:#1774a8}
.catalog-warehouse-choice span{display:block;min-width:0;white-space:normal!important;overflow-wrap:anywhere;line-height:1.3}
.catalog-uom-picker{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));align-content:flex-start;gap:5px!important;height:auto!important;min-height:46px!important;max-height:118px;overflow:auto;padding:5px!important;border:1px solid #93aabd!important;border-radius:5px!important;background:#f5f8fa!important}
.catalog-uom-option{position:relative;display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important;min-height:36px!important;padding:5px 7px!important;border:1px solid #c3d1dc!important;border-radius:4px!important;background:#fff!important}
.catalog-uom-option:hover{border-color:#5f8eb0!important;background:#f4faff!important}
.catalog-uom-option.selected{border-color:#15805d!important;background:#eef9f5!important;box-shadow:inset -3px 0 0 #15805d}
.catalog-uom-option.storage-uom{border-color:#176e9f!important;background:#edf7fd!important;box-shadow:inset -3px 0 0 #176e9f}
.catalog-uom-option input{flex:0 0 auto;width:15px!important;height:15px!important;min-height:15px!important;margin:0!important;accent-color:#15805d}
.catalog-uom-name{display:grid!important;flex:1;gap:0!important;min-width:0;line-height:1.2}
.catalog-uom-option strong{font-size:9.5px!important;color:#173d59}.catalog-uom-option small{font-size:7.5px!important;color:#687d8b}
.catalog-uom-base-choice{display:flex!important;align-items:center;gap:4px;min-width:55px;padding:3px 5px;border:1px solid #b7c8d5;border-radius:4px;background:#fff;color:#36566c;font-size:8px;font-weight:900;cursor:pointer;white-space:nowrap}
.catalog-uom-base-choice span{display:block!important}.catalog-uom-base-choice input{accent-color:#176e9f!important}
.catalog-uom-remove{height:22px;padding:0 6px;border:1px solid #d5adb1;border-radius:4px;background:#fff7f7;color:#92323d;font:850 7.5px inherit;cursor:pointer}
.catalog-uom-remove:hover:not(:disabled){border-color:#a94752;background:#fff0f0}.catalog-uom-remove:disabled{border-color:#d2dce3;background:#edf2f5;color:#8998a3;cursor:not-allowed}
.catalog-uom-summary{display:flex!important;align-items:center;gap:5px;min-height:18px;margin-top:2px!important;color:#3f5d72!important;font-size:8px!important}.catalog-uom-summary i{width:1px;height:11px;background:#a9bbc8}.catalog-uom-summary span{color:#687d8b}
.catalog-capability-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;height:72px;max-height:72px;overflow:auto;padding:0}
.catalog-capability-option{display:flex;align-items:center;gap:6px;min-height:34px;padding:3px 6px;border:1px solid #c3d0da;border-radius:4px;background:#f9fbfc;cursor:pointer}
.catalog-capability-option.selected{border-color:#4a8bb5;background:#edf7fd;box-shadow:inset -3px 0 0 #176e9f}
.catalog-capability-option input{width:14px!important;height:14px!important;min-height:14px!important;margin:0;accent-color:#176e9f}
.catalog-capability-option span{display:grid;gap:0;min-width:0}
.catalog-capability-option strong{font-size:9px;color:#173d59}
.catalog-capability-option small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:7px!important;color:#687d8b}
.capabilities-readonly .catalog-capability-option{cursor:default;opacity:.72}
.product-catalog-modal-card #product-catalog-message{margin:4px 7px}
.product-catalog-modal-card .modal-actions{position:sticky;bottom:-4px;z-index:5;justify-content:flex-start;gap:4px;padding:5px 7px!important;border-top:1px solid #a9bbc8;background:#fff}
.product-catalog-modal-card .modal-actions .button{height:25px!important;min-height:25px!important;padding:0 10px!important}
@media(max-width:1050px){.catalog-capability-toolbar{height:auto!important;max-height:none!important;flex-wrap:wrap!important}.catalog-filter-strip{flex:1}.catalog-products-professional-table{min-width:930px!important}.product-catalog-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.catalog-basic-grid .catalog-name-field{grid-column:span 1}.catalog-operation-grid>.field:nth-child(1),.catalog-operation-grid>.field:nth-child(2){grid-column:span 1}.catalog-operation-grid>.catalog-warehouses-field,.catalog-operation-grid>.catalog-transaction-uoms-field{grid-column:1/-1!important}.catalog-warehouse-picker,.catalog-uom-picker{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:680px){.catalog-filter-strip{width:100%}.catalog-filter-strip .table-search{flex:1;width:auto!important}.catalog-filter-strip>select{width:125px}.catalog-bulk-capability{height:auto;flex-wrap:wrap}.product-catalog-modal-card{width:98vw!important}.product-catalog-form-grid{grid-template-columns:1fr!important}.product-catalog-form-grid .span-2,.catalog-basic-grid .catalog-name-field,.catalog-operation-grid>.field:nth-child(1),.catalog-operation-grid>.field:nth-child(2),.catalog-operation-grid>.catalog-warehouses-field,.catalog-operation-grid>.catalog-transaction-uoms-field{grid-column:auto!important}.catalog-warehouse-picker,.catalog-uom-picker{grid-template-columns:1fr!important}.catalog-warehouse-picker,.catalog-uom-picker,.catalog-capability-picker{height:auto!important;max-height:120px!important}.catalog-uom-summary{flex-wrap:wrap}.catalog-products-professional-table{min-width:850px!important}}
.catalog-uom-add-button{width:100%;height:30px!important;margin-top:4px;padding:3px 10px!important;font-size:12px!important}
.opening-balance-toolbar{display:flex;align-items:center;gap:6px;padding:5px 6px;border-bottom:1px solid var(--line);background:#f8fbfd}.opening-balance-toolbar .table-search{min-width:280px;max-width:430px;flex:1}.opening-balance-toolbar select{width:170px;height:30px}.opening-balance-toolbar>[data-general-opening-totals]{margin-inline-start:auto;font-weight:800;color:var(--ink);white-space:nowrap}.general-opening-grid-wrap{max-height:58vh}.general-opening-grid thead{position:sticky;top:0;z-index:2}.general-opening-grid td{vertical-align:middle}.general-opening-grid input,.general-opening-grid select{height:28px;min-width:0}.general-opening-grid [data-general-opening-debit],.general-opening-grid [data-general-opening-credit]{width:110px;text-align:left;direction:ltr}.general-opening-grid [data-general-opening-center]{width:190px}.general-opening-grid [data-general-opening-description]{width:220px}@media(max-width:900px){.opening-batch-controls{grid-template-columns:1fr 1fr}.opening-balance-toolbar{flex-wrap:wrap}.opening-balance-toolbar .table-search{min-width:100%}.opening-balance-toolbar>[data-general-opening-totals]{margin-inline-start:0}}

/* General opening balances — compact ERP workspace */
.general-opening-workspace{display:grid;gap:4px}.general-opening-workspace .accounting-opening-batch{overflow:hidden;margin:0;border-color:#9fb3c4;border-radius:6px;box-shadow:0 1px 2px rgba(20,48,70,.05)}
.general-opening-commandbar{display:flex;align-items:center;min-height:34px;padding:3px 6px;border-bottom:1px solid #b8c7d3;background:linear-gradient(180deg,#fbfdfe,#f1f6f9)}
.general-opening-title{display:flex;align-items:center;gap:6px;min-width:0}.general-opening-title h2{margin:0;color:#123b5a;font-size:12px;line-height:1.1}.general-opening-title small{display:block;margin-top:1px;color:#6a7d8c;font-size:7.5px;line-height:1}
.general-opening-mark{display:grid;place-items:center;width:23px;height:23px;border:1px solid #8fb0c7;border-radius:5px;background:#e8f3fa;color:#12658f;font-size:13px;font-weight:900}.general-opening-submit{height:26px!important;min-height:26px!important;margin-inline-start:auto;padding:0 10px!important;font-size:9px!important}
.general-opening-workspace .opening-batch-controls{display:grid;grid-template-columns:132px minmax(250px,.85fr) minmax(260px,1.15fr);gap:4px;padding:4px 6px;border-bottom:1px solid #c4d0da;background:#fff}
.general-opening-workspace .opening-batch-controls label{display:grid;grid-template-rows:11px 27px;gap:1px;min-width:0}.general-opening-workspace .opening-batch-controls label>span{overflow:hidden;color:#405a6e;font-size:8px;font-weight:800;line-height:11px;white-space:nowrap}.general-opening-workspace .opening-batch-controls input,.general-opening-workspace .opening-batch-controls select{width:100%;height:27px;min-width:0;border:1px solid #9eb2c2;border-radius:4px;background:#fff;padding:2px 6px;color:#15364f;font:700 9px inherit}
.general-opening-workspace .opening-batch-controls input:focus,.general-opening-workspace .opening-batch-controls select:focus,.general-opening-grid input:focus,.general-opening-grid select:focus{border-color:#1873a4;outline:2px solid rgba(24,115,164,.11);outline-offset:-1px}
.general-opening-workspace .opening-balance-toolbar{display:flex;align-items:center;gap:7px;min-height:35px;padding:3px 6px;border-bottom:1px solid #aebfcd;background:#eef4f8}
.opening-filter-group{display:flex;align-items:center;gap:4px;min-width:360px;flex:1}.general-opening-workspace .opening-balance-toolbar .table-search{width:min(420px,42vw);min-width:220px;max-width:none;height:27px;margin:0;background:#fff}.general-opening-workspace .opening-balance-toolbar .table-search input{height:25px;font-size:9px}.general-opening-workspace .opening-balance-toolbar select{width:145px;height:27px;border-color:#9eb2c2;border-radius:4px;background:#fff;font-size:9px}
.opening-live-summary{display:flex!important;align-items:stretch;margin-inline-start:auto;border:1px solid #a9bac7;border-radius:4px;background:#fff;white-space:nowrap}.opening-live-summary>span{display:grid;grid-template-columns:auto auto;align-items:center;gap:6px;min-width:112px;height:25px;padding:0 7px;border-inline-start:1px solid #d1dbe2}.opening-live-summary>span:first-child{border-inline-start:0}.opening-live-summary small{color:#657887;font-size:7.5px;font-weight:700}.opening-live-summary strong{color:#163a55;font-size:9px}.opening-live-summary .debit strong{color:#075f91}.opening-live-summary .credit strong{color:#287249}.opening-live-summary .difference.unbalanced{background:#fff2f2}.opening-live-summary .difference.unbalanced strong{color:#b32c35}
.general-opening-grid-wrap{max-height:calc(100vh - 286px);min-height:210px;overflow:auto}.general-opening-grid{width:100%;min-width:900px;table-layout:fixed}.general-opening-grid .opening-code-col{width:105px}.general-opening-grid .opening-account-col{width:26%}.general-opening-grid .opening-money-col{width:105px}.general-opening-grid .opening-center-col{width:190px}.general-opening-grid .opening-description-col{width:210px}.general-opening-grid thead{position:sticky;top:0;z-index:3}.general-opening-grid th{height:24px;padding:2px 6px!important;border-color:#aebfcd!important;background:#dfeaf1!important;color:#1c3b52!important;font-size:8px!important;font-weight:850}.general-opening-grid td{height:31px;padding:2px 5px!important;border-color:#cbd6df!important;background:#fff;vertical-align:middle}.general-opening-grid tbody tr:nth-child(even) td{background:#fbfcfd}.general-opening-grid tbody tr:hover td{background:#f0f7fb}
.general-opening-grid input,.general-opening-grid select{width:100%!important;height:25px!important;min-width:0;border:1px solid #a8bac8;border-radius:3px;background:#fff;padding:1px 5px;font:700 9px inherit}.general-opening-grid [data-general-opening-debit],.general-opening-grid [data-general-opening-credit]{text-align:left;direction:ltr}.opening-account-code strong{color:#164f73;font-size:9px}.opening-account-name>strong{display:block;overflow:hidden;color:#162f43;font-size:9.5px;line-height:1.05;text-overflow:ellipsis;white-space:nowrap}.opening-account-name>span{display:flex;gap:3px;margin-top:2px}.opening-account-name i{display:inline-flex;align-items:center;height:13px;padding:0 4px;border-radius:8px;font-size:6.5px;font-style:normal;font-weight:800}.opening-account-type{background:#e9f1f6;color:#4c6475}.opening-account-nature.debit{background:#e7f3fb;color:#126995}.opening-account-nature.credit{background:#e8f6ee;color:#26744a}
.general-opening-history{overflow:hidden;margin:0;border-color:#aebfcd;border-radius:6px}.general-opening-history>summary{display:flex;align-items:center;min-height:32px;padding:3px 7px;background:#f4f8fa;color:#173a55;cursor:pointer;list-style:none}.general-opening-history>summary::-webkit-details-marker{display:none}.general-opening-history>summary span{display:flex;align-items:baseline;gap:7px}.general-opening-history>summary b{font-size:10px}.general-opening-history>summary small{color:#6a7d8c;font-size:7.5px}.general-opening-history>summary i{display:grid;place-items:center;min-width:20px;height:18px;margin-inline-start:auto;border-radius:9px;background:#dbeaf3;color:#155b83;font-size:8px;font-style:normal;font-weight:900}.general-opening-history[open]>summary{border-bottom:1px solid #b8c7d3}.general-opening-history table th,.general-opening-history table td{padding:3px 6px!important}.general-opening-history td small{display:block;color:#627687;font-size:7px}
@media(max-width:980px){.general-opening-workspace .opening-batch-controls{grid-template-columns:130px minmax(220px,1fr)}.general-opening-workspace .opening-batch-controls .opening-notes-field{grid-column:1/-1}.general-opening-workspace .opening-balance-toolbar{align-items:stretch;flex-wrap:wrap}.opening-filter-group{min-width:100%}.general-opening-workspace .opening-balance-toolbar .table-search{width:auto;flex:1}.opening-live-summary{margin-inline-start:0}.general-opening-grid-wrap{max-height:54vh}}
@media(max-width:620px){.general-opening-workspace .opening-batch-controls{grid-template-columns:1fr}.general-opening-workspace .opening-batch-controls .opening-notes-field{grid-column:auto}.opening-filter-group{flex-wrap:wrap}.general-opening-workspace .opening-balance-toolbar .table-search{min-width:100%}.general-opening-workspace .opening-balance-toolbar select{width:100%}.opening-live-summary{width:100%;overflow:auto}.opening-live-summary>span{flex:1;min-width:100px}}

.general-opening-actions{display:flex;align-items:center;gap:4px;margin-inline-start:auto}.general-opening-actions .button{height:26px!important;min-height:26px!important;padding:0 9px!important;font-size:8.5px!important}.general-opening-actions .general-opening-submit{margin:0}
.opening-entry-hint{display:flex;align-items:center;gap:10px;min-height:29px;padding:3px 7px;border-bottom:1px solid #aebfcd;background:#eef4f8;color:#5c7181;font-size:8px}.opening-entry-hint strong{display:flex;align-items:center;gap:4px;color:#174361}.opening-entry-hint strong i{display:grid;place-items:center;min-width:20px;height:18px;border-radius:9px;background:#176f9d;color:#fff;font-style:normal}.opening-entry-hint em{margin-inline-start:auto;color:#536b7c;font-style:normal}.opening-line-duplicate td{background:#fff0f0!important}.opening-line-duplicate [data-general-opening-account],.opening-line-duplicate [data-general-opening-currency]{border-color:#c33b46!important}
.general-opening-entry-grid{min-width:1120px}.general-opening-entry-grid .opening-index-col{width:30px}.general-opening-entry-grid .opening-code-col{width:100px}.general-opening-entry-grid .opening-account-col{width:245px}.general-opening-entry-grid .opening-value-col{width:110px}.general-opening-entry-grid .opening-direction-col{width:90px}.general-opening-entry-grid .opening-currency-col{width:125px}.general-opening-entry-grid .opening-center-col{width:175px}.general-opening-entry-grid .opening-description-col{width:auto}.general-opening-entry-grid .opening-action-col{width:36px}.general-opening-entry-grid td:first-child{text-align:center;color:#607686;font-weight:800}.general-opening-entry-grid .opening-code-input{background:#eef3f6;color:#21465f;font-weight:900;cursor:default}.general-opening-entry-grid [data-general-opening-amount]{direction:ltr;text-align:left}.general-opening-entry-grid .opening-line-remove{display:grid;place-items:center;width:23px;height:23px;margin:auto;padding:0;font-size:13px}
@media(max-width:760px){.general-opening-commandbar{align-items:flex-start;flex-wrap:wrap}.general-opening-actions{width:100%;justify-content:flex-start;margin:2px 29px 0 0}.opening-entry-hint{flex-wrap:wrap}.opening-entry-hint em{width:100%;margin:0}}

/* Simplified bulk opening balances, matching customer opening balances */
.general-opening-workspace .opening-simple-controls{grid-template-columns:130px 145px minmax(260px,1fr) minmax(220px,1fr)}
.opening-simple-toolbar{display:flex;align-items:center;gap:8px;min-height:32px;padding:3px 6px;border-bottom:1px solid #aebfcd;background:#eef4f8}.opening-simple-toolbar .table-search{width:min(430px,45vw);height:26px;margin:0;background:#fff}.opening-simple-toolbar .table-search input{height:24px;font-size:9px}.opening-simple-toolbar>strong{display:flex;align-items:center;gap:4px;color:#24485f;font-size:8px}.opening-simple-toolbar>strong i{display:grid;place-items:center;min-width:20px;height:18px;border-radius:9px;background:#176f9d;color:#fff;font-style:normal}.opening-simple-toolbar>em{margin-inline-start:auto;color:#ad2835;font-size:8px;font-style:normal;font-weight:800}
.general-opening-simple-grid{min-width:760px}.general-opening-simple-grid .opening-index-col{width:34px}.general-opening-simple-grid .opening-code-col{width:115px}.general-opening-simple-grid .opening-account-col{width:auto}.general-opening-simple-grid .opening-value-col{width:145px}.general-opening-simple-grid .opening-direction-col{width:125px}.general-opening-simple-grid .opening-status-col{width:125px}.general-opening-simple-grid td:first-child{text-align:center;color:#607686;font-weight:800}.general-opening-simple-grid td:nth-child(2) strong{color:#155679;font-size:9px}.general-opening-simple-grid td:nth-child(3)>strong{display:block;color:#18364c;font-size:9px}.general-opening-simple-grid td:nth-child(3)>small{display:block;margin-top:1px;color:#718390;font-size:7px}.general-opening-simple-grid [data-general-opening-amount]{direction:ltr;text-align:left}.opening-account-status{display:inline-flex;align-items:center;height:17px;padding:0 6px;border-radius:9px;font-size:7px;font-weight:850}.opening-account-status.postable{background:#e7f5ed;color:#1f7448}.opening-account-status.locked{background:#edf1f4;color:#657581}.general-opening-simple-grid .opening-account-locked td{background:#f5f7f8!important;color:#7a8994}.general-opening-simple-grid .opening-line-incomplete td{background:#fff3f3!important}.general-opening-simple-grid .opening-line-incomplete [data-general-opening-direction]{border-color:#c43b47!important}
@media(max-width:900px){.general-opening-workspace .opening-simple-controls{grid-template-columns:1fr 1fr}.opening-simple-toolbar .table-search{width:auto;flex:1}}
@media(max-width:560px){.general-opening-workspace .opening-simple-controls{grid-template-columns:1fr}.opening-simple-toolbar{flex-wrap:wrap}.opening-simple-toolbar .table-search{min-width:100%}.opening-simple-toolbar>em{width:100%;margin:0}}
.general-opening-workspace .opening-header-minimal{grid-template-columns:150px minmax(280px,1fr)}
.opening-currency-grid{min-width:1160px}.opening-currency-grid .opening-date-col{width:132px}.opening-currency-grid .opening-currency-col{width:135px}.opening-currency-grid .opening-rate-col{width:125px}.opening-currency-grid .opening-status-col{width:90px}
.party-opening-currency-grid{min-width:1110px}.party-opening-currency-grid th:nth-child(1){width:105px}.party-opening-currency-grid th:nth-child(2){width:80px}.party-opening-currency-grid th:nth-child(4){width:132px}.party-opening-currency-grid th:nth-child(5){width:105px}.party-opening-currency-grid th:nth-child(6){width:125px}.party-opening-currency-grid th:nth-child(7){width:145px}.party-opening-currency-grid th:nth-child(8){width:125px}.party-opening-currency-grid select,.party-opening-currency-grid input{width:100%;min-width:0;height:28px}
@media(max-width:700px){.general-opening-workspace .opening-header-minimal{grid-template-columns:1fr}}
/* Compact action menu shared by financial and purchasing registers. */
.app-shell :is(#accounting-view,#purchasing-view) .order-row-actions{position:relative;display:inline-block;z-index:2}
.app-shell :is(#accounting-view,#purchasing-view) .order-row-actions[open]{z-index:40}
.app-shell :is(#accounting-view,#purchasing-view) .order-row-actions>summary{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:72px;height:29px;padding:0 10px;border:1px solid #aed0f2;border-radius:6px;background:#eef7ff;color:#0874df;font-size:11px;font-weight:800;cursor:pointer;list-style:none}
.app-shell :is(#accounting-view,#purchasing-view) .order-row-actions>summary::-webkit-details-marker{display:none}
.app-shell :is(#accounting-view,#purchasing-view) .order-row-actions>.document-action-cell{position:absolute;top:calc(100% + 4px);left:0;display:flex;flex-direction:column;align-items:stretch;width:185px;padding:6px;border:1px solid #d4dfe9;border-radius:8px;background:#fff;box-shadow:0 12px 28px rgba(19,40,61,.2);overflow:visible}
.app-shell :is(#accounting-view,#purchasing-view) .order-row-actions>.document-action-cell :is(.button,.small-action,.doc-action){display:flex;width:100%;height:30px;min-height:30px;align-items:center;justify-content:flex-start;padding:0 9px;border:0;border-radius:5px;background:#fff;color:#344a60;font-size:10px;text-align:right}
.app-shell :is(#accounting-view,#purchasing-view) .order-row-actions>.document-action-cell :is(.button,.small-action,.doc-action):hover{background:#eef6ff;color:#0874df}
.saved-invoice-actions{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
/* Integrated external purchasing shipment workspace */
.import-shipment-modal-card{display:flex;flex-direction:column;overflow:hidden!important}
body>#import-shipment-modal{align-items:center;justify-items:center;padding:10px!important;overflow:hidden;overscroll-behavior:contain}
body>#import-shipment-modal.modal-layer .modal-card.import-shipment-modal-card{box-sizing:border-box;min-height:0;width:min(1380px,calc(100vw - 20px));height:min(880px,calc(100vh - 20px));max-width:calc(100vw - 20px)!important;max-height:calc(100vh - 20px)!important;margin:auto!important;border-radius:9px!important;overflow:hidden!important}
@supports(height:100dvh){body>#import-shipment-modal.modal-layer .modal-card.import-shipment-modal-card{height:min(880px,calc(100dvh - 20px));max-height:calc(100dvh - 20px)!important}}
.import-shipment-modal-card>form{display:flex;min-height:0;flex:1;flex-direction:column;overflow:hidden}.import-shipment-scroll{min-height:0;flex:1;padding:9px 11px;background:#f5f8fb;overflow:auto;scrollbar-gutter:stable}.import-shipment-modal-card>.modal-header,.import-shipment-modal-card .modal-actions{flex:0 0 auto}.import-shipment-header{background:#fff!important}.import-shipment-header h2{font-size:16px!important}.import-shipment-header p{max-width:700px}.import-shipment-header .status.success{background:var(--green-soft);color:var(--green)}
.import-shipment-tabs{display:flex;flex:0 0 auto;gap:3px;padding:5px 10px;border-bottom:1px solid #d9e3ed;background:#fff;overflow-x:auto}.import-shipment-tabs button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:145px;height:31px;border:1px solid transparent;border-radius:6px;background:#f2f5f8;color:#52677a;padding:0 12px;font:inherit;font-size:10px;font-weight:800;cursor:pointer;white-space:nowrap}.import-shipment-tabs button span{display:inline-grid;width:18px;height:18px;place-items:center;border-radius:50%;background:#dce5ed;color:#5a6e80;font-size:9px}.import-shipment-tabs button.active{border-color:#9fcaf0;background:#eaf4ff;color:#096caf;box-shadow:inset 0 -2px #1684e8}.import-shipment-tabs button.active span{background:#1684e8;color:#fff}
.import-shipment-section{min-height:100%;margin:0;padding:10px;border:1px solid #dce5ed;border-radius:8px;background:#fff}.import-shipment-section .section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.import-shipment-section .section-heading h3{margin:0;color:#153b59;font-size:12px}.import-shipment-section .section-heading small{display:block;margin-top:2px;color:#718497;font-size:9px}.import-logistics-heading{margin-top:10px!important;padding-top:9px;border-top:1px solid #e5ebf1}.import-shipment-grid{padding:0!important;gap:6px 8px!important}.import-shipment-grid .field>small{color:#7a8c9b;font-size:8px}.import-section-counter{border:1px solid #cbd9e5;border-radius:999px;background:#f4f8fb;color:#476176;padding:3px 9px;font-size:9px;font-weight:800}
.import-date-control{position:relative;display:block;width:100%}.import-date-control>input[type=date]{width:100%;padding-inline-end:31px!important}.import-date-clear{position:absolute;inset-inline-end:4px;top:50%;display:grid;width:22px;height:22px;transform:translateY(-50%);place-items:center;border:0;border-radius:5px;background:#edf3f7;color:#49657a;font:700 15px/1 Arial;cursor:pointer}.import-date-clear:hover{background:#dfeaf2;color:#173f5c}.import-date-clear:disabled{visibility:hidden;pointer-events:none}
.import-order-picker{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:6px;margin-bottom:9px}.import-order-picker label{display:flex;gap:8px;align-items:center;min-height:48px;border:1px solid #dbe5ee;background:#f8fafc;border-radius:7px;padding:7px 9px;cursor:pointer}.import-order-picker label:hover{border-color:#9fc6e6;background:#f1f8ff}.import-order-picker label span{display:flex;min-width:0;flex-direction:column;gap:2px}.import-order-picker label small{color:#718497}.import-order-picker input{flex:0 0 auto;width:15px!important;height:15px!important}.import-shipment-lines{margin-top:8px!important;max-height:330px}
.import-expense-list{display:grid;gap:8px}.import-expense-card{border:1px solid #dbe5ee;border-radius:8px;background:#fbfcfe;padding:8px}.import-expense-card-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px;padding-bottom:6px;border-bottom:1px solid #e7edf2;color:#244760}.import-expense-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px 7px;align-items:end}.import-expense-base-field strong{display:flex;align-items:center;height:31px;padding:0 8px;border:1px solid #d6e0e9;border-radius:6px;background:#eef4f8;color:#174767}.import-expense-capital-field{display:flex!important;align-items:center!important;gap:6px!important;height:31px;margin:0;padding:0 8px;border:1px solid #d6e0e9;border-radius:6px;background:#fff}.import-expense-capital-field input{width:15px!important;height:15px!important}.import-expense-notes-field{grid-column:span 2}.import-cost-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin-top:9px}.import-cost-summary>div{border:1px solid #dce5ed;border-radius:7px;padding:7px 9px;background:#f8fafc}.import-cost-summary span{display:block;color:#687d90;font-size:9px}.import-cost-summary strong{display:block;margin-top:2px;color:#153c5d;font-size:13px}.import-cost-summary .primary{border-color:#9dccf3;background:#eaf5ff}
.import-document-upload{display:grid;grid-template-columns:145px 150px 135px minmax(230px,1fr) minmax(180px,.8fr) auto;gap:6px;align-items:center;margin-bottom:9px}.import-document-list{display:grid;gap:6px}.import-document-list article{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #dce5ed;background:#f8fafc;padding:7px 9px;border-radius:7px}.import-document-list strong,.import-document-list small{display:block}.import-document-list small{margin-top:2px;color:#718496}.import-empty-state{display:flex;min-height:80px;align-items:center;justify-content:center;flex-direction:column;gap:4px;border:1px dashed #c7d5e0;border-radius:7px;background:#f8fafc;color:#60778b;text-align:center}.import-empty-state strong{color:#345269}.import-shipment-command .purchasing-inline-filter{flex:1}.import-shipments-table td small{display:block;color:#738697;margin-top:2px}
@media(max-width:1100px){.import-expense-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.import-document-upload{grid-template-columns:repeat(2,minmax(0,1fr))}.import-document-upload .button{grid-column:span 2}.import-cost-summary{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){body>#import-shipment-modal{padding:5px!important}body>#import-shipment-modal.modal-layer .modal-card.import-shipment-modal-card{width:calc(100vw - 10px);height:calc(100dvh - 10px);max-width:calc(100vw - 10px)!important;max-height:calc(100dvh - 10px)!important}.import-shipment-grid,.import-expense-grid{grid-template-columns:1fr!important}.import-shipment-grid .span-2,.import-shipment-grid .span-4,.import-expense-notes-field{grid-column:auto}.import-cost-summary,.import-document-upload{grid-template-columns:1fr}.import-document-upload .button{grid-column:auto}.import-shipment-tabs button{min-width:130px}.import-document-list article{align-items:flex-start;flex-direction:column}}
