/* Final UI overrides loaded after the legacy production cascade. */

:root {
  --ui-text: var(--ui-ink);
  --ui-text-muted: var(--ui-muted);
  --ui-text-readable-muted: #5b6470;
  --z-dropdown: 300;
  --z-sticky: 220;
  --z-modal-backdrop: 500;
  --z-modal: 510;
  --z-toast: 600;
  --z-tooltip: 700;
}

.template-required-sidebar.is-navigation-only {
  grid-template-rows: auto minmax(0, 1fr);
}

.login-audit-agent {
  display: block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-audit-ip {
  color: var(--ui-navy-950);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.supplier-link-scope-panel {
  width: min(560px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 32px));
}

.supplier-link-scope-form {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}

.supplier-link-scope-form label {
  display: grid;
  gap: 7px;
  color: #1d2129;
  font-size: 13px;
  font-weight: 700;
}

.supplier-link-scope-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  color: #1d2129;
  padding: 0 12px;
  font: inherit;
}

.supplier-link-scope-form p {
  margin: 0;
  color: #6e7681;
  font-size: 12px;
  line-height: 1.65;
}

.supplier-generated-link-content {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}

.supplier-generated-link-content > p {
  margin: 0;
  color: #5b6470;
  font-size: 13px;
  line-height: 1.6;
}

.supplier-generated-link-content label {
  display: grid;
  gap: 7px;
  color: #1d2129;
  font-size: 13px;
  font-weight: 700;
}

.supplier-generated-link-content input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #aebdce;
  border-radius: 6px;
  background: #f6f8fa;
  color: #1d2129;
  padding: 0 12px;
  font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Shared modal portal keeps previews above the frozen shell and mobile nav. */
.global-overlay-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  pointer-events: none;
}

.global-overlay-root:empty {
  display: none;
}

.global-overlay-root > .dashboard-preview-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  pointer-events: auto;
  background: rgba(6, 27, 69, 0.44);
}

.global-overlay-root > .dashboard-preview-backdrop:last-child {
  z-index: 1;
}

.global-overlay-root .dashboard-preview-panel {
  position: relative;
  z-index: var(--z-modal);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  outline: none;
}

.global-overlay-root .dashboard-preview-panel:focus-visible {
  box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.45);
}

.global-overlay-root .dashboard-preview-head,
.global-overlay-root .dashboard-preview-actions {
  flex: 0 0 auto;
}

.global-overlay-root .dashboard-preview-table,
.global-overlay-root .dashboard-preview-body,
.global-overlay-root .flow-record-preview-layout,
.global-overlay-root .template-document-layout {
  min-height: 0;
  overflow: auto;
}

.global-overlay-root .dashboard-preview-actions {
  position: relative;
  z-index: 2;
  margin-top: auto;
  border-top: 1px solid var(--ui-line-soft);
  background: #ffffff;
}

body.has-global-overlay {
  overflow: hidden;
}

.system-notification-stack {
  z-index: var(--z-toast);
}

@media (max-width: 760px) {
  .global-overlay-root > .dashboard-preview-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .global-overlay-root .dashboard-preview-panel {
    width: 100% !important;
    max-width: none !important;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .global-overlay-root .dashboard-preview-head {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .global-overlay-root .dashboard-preview-actions {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .global-overlay-root .dashboard-preview-head button,
  .global-overlay-root .dashboard-preview-actions button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Cloud-first arrival: never present an empty local ledger as cloud data. */
.cloud-ledger-state {
  width: min(760px, calc(100% - 24px));
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  margin: clamp(28px, 8vh, 92px) auto 0;
  padding: 22px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  color: var(--ui-text);
  background: #ffffff;
}

.cloud-ledger-state-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.cloud-ledger-state-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.cloud-ledger-state-head strong {
  color: var(--ui-navy-950);
  font-size: 15px;
}

.cloud-ledger-state-head small {
  color: var(--ui-text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.cloud-ledger-state-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--ui-navy-950);
  font-size: 17px;
  font-weight: 800;
}

.cloud-ledger-state.is-loading .cloud-ledger-state-mark {
  border: 3px solid #dbe5ec;
  border-top-color: var(--ui-cyan-500);
  background: transparent;
  animation: cloud-ledger-spin 780ms linear infinite;
}

.cloud-ledger-state.is-error .cloud-ledger-state-mark {
  background: var(--ui-red-500);
}

.cloud-ledger-state.is-error .table-action {
  align-self: flex-start;
}

.cloud-ledger-skeleton {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cloud-ledger-skeleton i,
.shell-status-loading i {
  display: block;
  border-radius: 5px;
  background: #e7edf2;
  animation: cloud-ledger-pulse 1.2s ease-in-out infinite alternate;
}

.cloud-ledger-skeleton i {
  height: 54px;
}

.shell-status-loading {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px !important;
}

.shell-status-loading i {
  min-height: 30px;
}

.cloud-sync-status[data-state="loading"]::before {
  background: var(--ui-gold-500);
}

@keyframes cloud-ledger-spin {
  to { transform: rotate(360deg); }
}

@keyframes cloud-ledger-pulse {
  to { opacity: 0.48; }
}

.flow-related-field {
  min-height: 58px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid #e1e5e9;
  border-radius: 5px;
  background: #fff;
}

.flow-related-field > span {
  color: #3f4d5a;
  font-size: 12px;
  font-weight: 700;
}

.flow-related-trigger {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid #cfd9e2;
  border-radius: 5px;
  color: #173d64;
  background: #f7fafb;
  cursor: pointer;
}

.flow-related-trigger:hover,
.flow-related-trigger:focus-visible {
  border-color: #72c8c4;
  background: #eef7f7;
}

.flow-related-trigger b { font-size: 12px; }
.flow-related-trigger small { color: #536474; font-size: 11px; }

.flow-related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flow-related-chips span {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px 3px 7px;
  border: 1px solid #cae4e3;
  border-radius: 5px;
  color: #174b5a;
  background: #eff8f7;
  font-size: 11px;
}

.flow-related-chips b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-related-chips button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  color: #7b3131;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
}

.related-flow-picker {
  width: min(920px, calc(100vw - 32px));
  max-height: min(780px, calc(100dvh - 32px));
}

.related-flow-picker-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ui-line);
  background: #f6f8fa;
}

.related-flow-picker-toolbar label { width: min(420px, 100%); display: grid; gap: 4px; }
.related-flow-picker-toolbar label span,
.related-flow-picker-toolbar small { color: #5a6876; font-size: 11px; }
.related-flow-picker-toolbar input { min-height: 36px; padding: 6px 9px; border: 1px solid #ccd7e0; }
.related-flow-picker-list { min-height: 220px; max-height: min(520px, 58dvh); overflow: auto; padding: 8px 12px; }

.related-flow-option {
  min-height: 58px;
  display: grid;
  grid-template-columns: 18px minmax(170px, 0.85fr) minmax(220px, 1.4fr) 110px 72px;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border-bottom: 1px solid #e7ebef;
  color: #1d2129;
  cursor: pointer;
}

.related-flow-option:hover,
.related-flow-option:has(input:checked) { background: #f0f7f7; }
.related-flow-option input { width: 16px; height: 16px; accent-color: #168985; }
.related-flow-option > span { min-width: 0; }
.related-flow-option strong,
.related-flow-option small { display: block; }
.related-flow-option strong { color: #173d64; font-size: 12px; }
.related-flow-option small { margin-top: 2px; color: #687684; font-size: 10px; }
.related-flow-option-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.related-flow-option-amount { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }
.related-flow-record-panel { width: min(880px, calc(100vw - 32px)); }

.change-order-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.change-order-form-grid .field-wide { grid-column: 1 / -1; }
.change-order-existing-attachments { padding: 0 12px 12px; }
.change-order-metrics .context-card.warning { border-color: #ffab40; background: #fff8eb; }

.approval-template-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  min-height: 390px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  overflow: hidden;
}

.approval-template-list {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 8px;
  border-right: 1px solid var(--ui-line);
  background: #f6f8fa;
}

.approval-template-list-head { display: flex; justify-content: space-between; gap: 8px; padding: 5px 6px 8px; }
.approval-template-list-head span { color: #233b55; font-size: 12px; font-weight: 750; }
.approval-template-list-head small { color: #6e7681; font-size: 10px; }
.approval-template-list > button { display: grid; gap: 2px; padding: 9px; border: 1px solid transparent; border-radius: 5px; text-align: left; background: transparent; cursor: pointer; }
.approval-template-list > button strong { color: #293e53; font-size: 12px; }
.approval-template-list > button small { color: #6a7885; font-size: 10px; }
.approval-template-list > button:hover { background: #fff; }
.approval-template-list > button.is-active { border-color: #b8deda; background: #eaf5f4; box-shadow: inset 3px 0 0 #168985; }
.approval-template-editor { min-width: 0; padding: 12px; }
.approval-tree-head > label { min-width: min(360px, 100%); display: grid; gap: 4px; }
.approval-tree-head > label span { color: #596979; font-size: 11px; }
.approval-tree-head > label input { min-height: 36px; padding: 6px 9px; border: 1px solid #ccd7e0; }
.approval-tree-head > div { display: flex; gap: 6px; }

.approval-assignment-section { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--ui-line); }
.approval-assignment-section > p { margin: 6px 0 10px; color: #5f6d79; font-size: 12px; }
.approval-assignment-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.approval-assignment-groups > section { border: 1px solid #dde4ea; border-radius: 6px; overflow: hidden; background: #fff; }
.approval-assignment-groups > section > strong { display: block; padding: 7px 9px; color: #173d64; background: #f3f6f8; font-size: 12px; }
.approval-assignment-row { min-height: 48px; display: grid; grid-template-columns: minmax(110px, 0.7fr) minmax(180px, 1fr); align-items: start; gap: 10px; padding: 7px 9px; border-top: 1px solid #edf0f2; }
.approval-assignment-row > span { padding-top: 8px; color: #35495d; font-size: 12px; }
.approval-assignment-dropdown { width: 100%; min-width: 0; }
.approval-assignment-dropdown .org-module-dropdown-options,
.org-module-dropdown-options.is-approval-assignment-options { grid-template-columns: 1fr; }

.payroll-project-payment-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.payroll-project-payment-actions .table-action {
  max-width: 100%;
  min-height: 38px;
  white-space: normal;
  text-align: left;
}

.payroll-payment-warning {
  color: var(--ui-warning-700, #9a5a10);
  font-size: 13px;
  line-height: 1.55;
}

.payroll-flow-lock {
  color: var(--ui-warning-700, #9a5a10);
  font-size: 12px;
  line-height: 1.5;
}
.approval-assignment-empty { padding: 8px; color: #7a6670; font-size: 11px; }

@media (max-width: 980px) {
  .change-order-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approval-template-layout { grid-template-columns: 1fr; }
  .approval-template-list { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-right: 0; border-bottom: 1px solid var(--ui-line); }
  .approval-template-list-head { grid-column: 1 / -1; }
  .approval-assignment-groups { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .related-flow-picker,
  .related-flow-record-panel { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .related-flow-picker-toolbar { align-items: stretch; flex-direction: column; }
  .related-flow-option { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .related-flow-option-subject { grid-column: 2 / -1; white-space: normal; }
  .related-flow-option-amount { grid-column: 2; text-align: left; }
  .change-order-form-grid { grid-template-columns: 1fr; }
  .approval-assignment-row { grid-template-columns: 1fr; gap: 4px; }
  .approval-assignment-row > span { padding-top: 0; }
  .approval-tree-head { align-items: stretch; flex-direction: column; }
}

/* Three-skill enterprise UI pass: IBM density, Airtable structure, Linear restraint. */
:root {
  --ui-sidebar-width: 196px;
  --ui-content-max: 1440px;
  --ui-header-height: 64px;
  --ui-surface-canvas: #f6f8fa;
  --ui-surface-subtle: #f8fafb;
  --ui-surface-raised: #ffffff;
  --ui-line-strong: #cbd6df;
  --ui-panel-shadow: 0 1px 3px rgba(29, 33, 41, 0.06);
}

body {
  color: var(--ui-text);
  background-color: var(--ui-surface-canvas);
}

.erp-main {
  width: 100%;
  max-width: var(--ui-content-max);
  margin-inline: auto;
  padding: 12px 16px 28px;
  background: rgba(246, 248, 250, 0.94);
}

.view-root {
  gap: 12px;
}

@media (min-width: 761px) {
  .erp-shell {
    --app-header-height: var(--ui-header-height);
    --content-max: var(--ui-content-max);
    grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
  }

  .app-header {
    grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
    min-height: var(--ui-header-height);
    box-shadow: 0 2px 10px rgba(15, 52, 118, 0.08);
  }

  .app-header .brand {
    min-height: var(--ui-header-height);
    gap: 7px;
    padding: 6px 11px;
  }

  .app-header .brand img {
    width: 46px;
    height: 44px;
    flex-basis: 46px;
  }

  .app-header .brand strong {
    font-size: 15px;
    letter-spacing: 0;
  }

  .app-header-workspace {
    padding: 6px 14px;
  }

  .app-header .topbar.is-compact {
    max-width: var(--ui-content-max);
    min-height: 48px;
    grid-template-columns: minmax(500px, 1fr) minmax(240px, 320px) auto;
    margin: 0 auto;
  }

  .app-header .flow-status-strip {
    min-height: 38px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .app-header .flow-status-items {
    height: 38px;
    gap: 0 !important;
  }

  .app-header .flow-status-cluster {
    min-height: 38px;
    gap: 0;
    padding: 0 4px;
    border-right: 1px solid var(--ui-line);
    border-radius: 0;
  }

  .app-header .flow-status-cluster:first-child {
    padding-left: 0;
  }

  .app-header .flow-status-cluster:last-child {
    padding-right: 0;
    border-right: 0;
  }

  .app-header .flow-status-cluster .approval-link {
    min-width: 42px;
    min-height: 34px;
    height: 34px;
    border-radius: 4px;
  }

  .app-header .flow-status-cluster .approval-link:hover,
  .app-header .flow-status-cluster .approval-link:focus-visible {
    border-color: transparent;
    color: var(--ui-navy-950);
    background: #eef7f7;
    box-shadow: inset 0 -2px 0 var(--ui-cyan-500);
  }

  .app-header .flow-status-cluster .approval-link small {
    color: #40566d;
    font-size: 10px;
  }

  .app-header .flow-status-cluster .approval-link strong {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
  }

  .app-header .global-search input,
  .app-header .user-name-button {
    height: 36px;
    min-height: 36px;
    border-radius: 6px;
  }

  .app-header .global-search input {
    padding-inline: 12px;
    background: var(--ui-surface-subtle);
  }

  .app-header .user-name-button {
    min-width: 64px;
    padding-inline: 12px;
  }

  .erp-sidebar {
    padding: 8px 7px 18px;
  }

  .module-nav {
    gap: 0;
    margin-top: 0;
  }

  .module-nav-group {
    gap: 1px;
    margin-bottom: 3px;
    padding: 0 0 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .module-nav-group:last-of-type {
    border-bottom: 0;
  }

  .module-nav-title {
    padding: 5px 10px 3px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.2;
  }

  .module-nav button {
    min-height: 34px;
    gap: 9px;
    padding: 7px 10px;
    border: 0;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.82);
    background: transparent;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    box-shadow: none;
    transform: none;
  }

  .module-nav button::before {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border: 1px solid rgba(184, 230, 228, 0.58);
    border-radius: 3px;
    background: transparent;
    box-shadow: none;
    filter: none;
    transform: none;
  }

  .module-nav button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
    transform: none;
  }

  .module-nav button.is-active {
    color: #ffffff;
    border-color: transparent;
    background: rgba(114, 200, 196, 0.14);
    box-shadow: inset 3px 0 0 var(--ui-cyan-500);
    transform: none;
  }

  .module-nav button.is-active::before {
    border-color: var(--ui-cyan-500);
    background: var(--ui-cyan-500);
    box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.15);
    filter: none;
    transform: none;
  }
}

.workspace-tabs {
  min-height: 34px;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-tab {
  min-height: 34px;
  border-color: var(--ui-line);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: var(--ui-panel-shadow);
}

.panel,
.flow-form,
.dashboard-visual-panel,
.dashboard-chart-panel {
  border-color: var(--ui-line);
  border-radius: 7px;
  background: var(--ui-surface-raised);
  box-shadow: var(--ui-panel-shadow);
}

.panel-title,
.form-head,
.dashboard-panel-head {
  min-height: 48px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--ui-line);
  background: #ffffff;
  background-image: none;
}

.panel-title > div:first-child,
.form-head > div:first-child,
.dashboard-panel-head > div:first-child {
  padding-left: 0;
}

.panel-title strong,
.form-head strong,
.dashboard-panel-head :is(strong, h2) {
  margin: 0;
  color: var(--ui-text);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
}

.panel-title span,
.form-head span,
.dashboard-panel-head span {
  color: #5b6875;
}

.tabs,
.finance-subnav,
.contract-subnav,
.contract-subtabs,
.project-subtabs,
.party-subtabs,
.organization-subtabs {
  min-height: 40px;
  gap: 0;
  padding: 0 6px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.tab-button,
.finance-subnav button,
.contract-subnav button,
.contract-subtabs button,
.project-subtabs button,
.party-subtabs button,
.organization-subtabs button {
  min-height: 39px;
  padding: 6px 11px;
  border: 0;
  border-radius: 0;
  color: #4b5e70;
  background: transparent;
  box-shadow: none;
}

.tab-button:hover,
.finance-subnav button:hover,
.contract-subnav button:hover,
.contract-subtabs button:hover,
.project-subtabs button:hover,
.party-subtabs button:hover,
.organization-subtabs button:hover {
  color: var(--ui-navy-950);
  background: #f2f7f8;
}

.tab-button.is-active,
.finance-subnav button.is-active,
.contract-subnav button.is-active,
.contract-subtabs button.is-active,
.project-subtabs button.is-active,
.party-subtabs button.is-active,
.organization-subtabs button.is-active {
  color: var(--ui-navy-950);
  border-color: transparent;
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--ui-cyan-500);
}

.table-action,
.readonly-link,
.attachment-upload-button,
.line-table-head button {
  border-color: var(--ui-line-strong);
  color: #26415b;
  background: #ffffff;
  font-weight: 650;
}

.table-action:hover,
.readonly-link:hover,
.attachment-upload-button:hover,
.line-table-head button:hover {
  border-color: var(--ui-cyan-500);
  color: var(--ui-navy-950);
  background: #f1f8f7;
}

.table-action.primary,
.form-actions #submit-flow {
  border-color: var(--ui-navy-950);
  color: #ffffff;
  background: var(--ui-navy-950);
}

.table-action.primary:hover,
.table-action.primary:focus-visible,
.form-actions #submit-flow:hover,
.form-actions #submit-flow:focus-visible {
  border-color: #153f80;
  color: #ffffff;
  background: #153f80;
}

.dashboard-executive {
  gap: 6px;
  padding: 9px 12px 10px;
  border-radius: 7px;
  box-shadow: var(--ui-panel-shadow);
}

.dashboard-command {
  min-height: 36px;
  padding-bottom: 5px;
}

.dashboard-command-main :is(strong, h1) {
  font-size: 17px;
}

.boss-kpi-grid {
  gap: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.boss-kpi-card {
  min-height: 62px;
  padding: 8px 13px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.boss-kpi-card:first-child {
  border-left: 0;
}

.boss-kpi-card:hover,
.boss-kpi-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--ui-cyan-500);
}

.boss-kpi-card strong {
  margin: 3px 0 1px;
  font-size: 18px;
}

.dashboard-chart-panel {
  padding: 0;
  overflow: hidden;
}

.dashboard-chart-panel > :not(.dashboard-panel-head) {
  margin-right: 14px;
  margin-left: 14px;
}

.dashboard-chart-panel > :last-child {
  margin-bottom: 12px;
}

.dashboard-comparison-bars,
.dashboard-donut-layout {
  min-height: 270px;
}

.dashboard-chart-bar {
  height: 244px;
}

.dashboard-trend-chart {
  min-height: 310px;
}

.flow-form {
  max-width: 1320px;
}

.flow-form-progress {
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-subtle);
}

.flow-template-tools {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #dde5ec;
  background: #fff;
}

.flow-template-tools label {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: #3d4b58;
  font-size: 12px;
  font-weight: 600;
}

.flow-template-tools select {
  width: 100%;
  min-height: 34px;
}

.workbench-exception-center {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #d8e1e9;
  border-radius: 8px;
  background: #fff;
}

.workbench-exception-center .workbench-section-head {
  margin-bottom: 8px;
}

.workbench-exception-center .workbench-section-head > b {
  color: #8b4b14;
  font-size: 12px;
}

.workbench-exception-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.workbench-exception-list > button {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #dce4ea;
  border-radius: 7px;
  color: #1d2129;
  text-align: left;
  background: #f8fafb;
}

.workbench-exception-list > button:hover,
.workbench-exception-list > button:focus-visible {
  border-color: #72c8c4;
  background: #f2fbfa;
}

.workbench-exception-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffab40;
}

.workbench-exception-list i.high {
  background: #e53935;
}

.workbench-exception-list span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workbench-exception-list strong,
.workbench-exception-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-exception-list strong {
  font-size: 13px;
}

.workbench-exception-list small {
  color: #5b6670;
  font-size: 11px;
}

.workbench-exception-list > button > b {
  color: #0f3476;
  font-size: 20px;
  font-weight: 400;
}

.reconciliation-panel .data-table th,
.reconciliation-panel .data-table td {
  white-space: nowrap;
}

.flow-approval-decision-summary {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e1e9;
  border-radius: 7px;
  background: #f8fafb;
}

.flow-approval-decision-summary > strong,
.flow-approval-risk-list > b {
  color: #20384f;
  font-size: 12px;
}

.flow-approval-decision-summary > div:first-of-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.flow-approval-decision-summary > div:first-of-type > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.flow-approval-decision-summary small {
  color: #5d6872;
  font-size: 10px;
}

.flow-approval-decision-summary b {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.flow-approval-decision-summary > p {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 7px 8px;
  border-radius: 6px;
  color: #294a66;
  background: #eaf3f8;
  font-size: 11px;
}

.flow-approval-risk-list {
  display: grid;
  gap: 5px;
}

.flow-approval-risk-list > span {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  color: #7a4a17;
  font-size: 11px;
  line-height: 1.45;
}

.flow-approval-risk-list > span.high {
  color: #a32825;
}

.flow-approval-risk-list > span.clear {
  color: #28635f;
}

.flow-approval-risk-list i {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: #ffab40;
}

.flow-approval-risk-list .high i {
  background: #e53935;
}

.flow-approval-risk-list .clear i {
  background: #72c8c4;
}

.global-search-item.is-command {
  background: #f2f8fb;
}

.global-search-item.is-command strong {
  color: #0f3476;
}

.flow-attachment-checklist {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #dce4ea;
  border-radius: 7px;
  background: #f8fafb;
}

.flow-attachment-checklist[hidden] {
  display: none;
}

.flow-attachment-checklist > strong {
  color: #29445b;
  font-size: 12px;
}

.flow-attachment-checklist > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-attachment-checklist span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #e5bf85;
  border-radius: 6px;
  color: #754714;
  background: #fff8ed;
  font-size: 11px;
}

.flow-attachment-checklist span.is-complete {
  border-color: #a6d8d4;
  color: #275f5c;
  background: #eff9f8;
}

.flow-attachment-checklist i {
  font-style: normal;
  font-weight: 700;
}

.flow-attachment-checklist > small {
  color: #5d6872;
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .flow-template-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .flow-template-tools label {
    grid-column: 1 / -1;
    grid-template-columns: 74px minmax(0, 1fr);
    margin: 0;
  }

  .flow-template-tools button {
    min-height: 44px;
  }

  .workbench-exception-list {
    grid-template-columns: 1fr;
  }
}

.flow-form .form-grid {
  gap: 10px 14px;
  padding: 13px 15px 17px;
}

.flow-form .form-grid label > span {
  color: #3e4d5c;
  font-weight: 700;
}

.flow-required-field > span:first-child::after,
label.flow-required-field > span:first-child::after {
  content: " *";
  color: var(--ui-danger, #e53935);
  font-weight: 800;
}

.flow-section-incomplete-count {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid rgba(230, 153, 72, 0.42);
  border-radius: 999px;
  color: #8b4d12;
  background: #fff7ed;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.flow-section-incomplete-count[hidden] {
  display: none;
}

.flow-form .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.flow-form .form-grid select,
.flow-form .form-grid textarea {
  border-color: #cfd8e1;
  border-radius: 5px;
  color: var(--ui-text);
  background: #ffffff;
}

.flow-form .form-grid input:hover,
.flow-form .form-grid select:hover,
.flow-form .form-grid textarea:hover {
  border-color: #aebdca;
}

.flow-form .form-section-label {
  min-height: 32px;
  margin-top: 7px;
  padding: 6px 9px;
  border: 1px solid #d8e3e7;
  border-radius: 3px;
  color: #173d64;
  background: #f2f7f8;
}

.form-actions {
  border-top: 1px solid var(--ui-line);
  background: #ffffff;
}

.data-table-shell .data-table thead th {
  height: 38px;
  color: #2f465d;
  background: #f0f3f6;
}

.data-table-shell .data-table tbody td {
  min-height: 40px;
  color: var(--ui-text);
}

.data-table-shell .data-table tbody tr:hover td,
.data-table-shell .data-table tbody tr:hover td.is-action {
  background: #eef7f7;
}

.table-empty-row {
  height: 132px;
}

.table-empty-cell {
  height: 132px;
  text-align: center;
  color: #637282 !important;
  background: #ffffff !important;
  font-weight: 600;
}

.table-empty-cell::before {
  content: none;
}

.page-export-tools {
  border-color: var(--ui-line);
  background: #ffffff;
  box-shadow: var(--ui-panel-shadow);
}

.global-overlay-root .dashboard-preview-panel {
  border-radius: 7px;
  box-shadow: 0 18px 44px rgba(15, 31, 54, 0.2);
}

.global-overlay-root .dashboard-preview-head {
  background: #ffffff;
}

@media (min-width: 1500px) {
  .flow-form .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) and (min-width: 761px) {
  .erp-shell {
    --ui-sidebar-width: 188px;
  }

  .app-header .topbar.is-compact {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) auto;
  }
}

@media (max-width: 760px) {
  .erp-main {
    max-width: none;
    padding: 8px 8px calc(82px + env(safe-area-inset-bottom));
    background: rgba(246, 248, 250, 0.96);
  }

  .panel-title,
  .form-head,
  .dashboard-panel-head {
    min-height: 46px;
    padding: 9px 10px;
  }

  .tabs,
  .finance-subnav,
  .contract-subnav,
  .contract-subtabs,
  .project-subtabs,
  .party-subtabs,
  .organization-subtabs {
    padding-inline: 2px;
  }

  .tab-button,
  .finance-subnav button,
  .contract-subnav button,
  .contract-subtabs button,
  .project-subtabs button,
  .party-subtabs button,
  .organization-subtabs button {
    min-height: 44px;
    padding-inline: 12px;
  }

  .boss-kpi-grid {
    gap: 0;
  }

  .boss-kpi-card {
    min-height: 68px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .boss-kpi-card:nth-child(odd),
  .boss-kpi-card:first-child,
  .boss-kpi-card:last-child {
    border-left: 0;
  }

  .boss-kpi-card:nth-child(-n + 2) {
    border-top: 0;
  }

  .dashboard-chart-panel > :not(.dashboard-panel-head) {
    margin-right: 9px;
    margin-left: 9px;
  }

  .flow-form .form-grid {
    padding: 10px;
  }

  .table-empty-row,
  .table-empty-cell {
    height: 104px;
  }

  .module-nav.is-mobile-open button[data-view] {
    min-height: 48px;
    justify-content: flex-start;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--ui-line);
    border-radius: 0;
    color: #294158;
    background: #ffffff;
    box-shadow: none;
    text-align: left;
  }

  .module-nav.is-mobile-open {
    gap: 0;
    padding: 10px 9px max(10px, env(safe-area-inset-bottom));
    border-top: 3px solid var(--ui-navy-950);
    background: #ffffff;
    box-shadow: 0 -14px 34px rgba(15, 31, 54, 0.2);
  }

  .module-nav.is-mobile-open .module-nav-group {
    gap: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .module-nav.is-mobile-open button[data-view]::before {
    border-color: #7fa6ad;
    background: transparent;
    box-shadow: none;
  }

  .module-nav.is-mobile-open button[data-view]:hover,
  .module-nav.is-mobile-open button[data-view].is-active {
    color: var(--ui-navy-950);
    border-color: var(--ui-line);
    background: #eef7f7;
    box-shadow: inset 3px 0 0 var(--ui-cyan-500);
  }

  .module-nav.is-mobile-open button[data-view].is-active::before {
    border-color: var(--ui-cyan-500);
    background: var(--ui-cyan-500);
  }

  .module-nav.is-mobile-open #mobile-more-toggle {
    min-height: 48px;
    margin-top: 8px;
    border: 1px solid var(--ui-line-strong);
    border-radius: 5px;
    color: var(--ui-navy-950);
    background: var(--ui-surface-subtle);
    box-shadow: none;
  }

  .global-overlay-root .dashboard-preview-head button,
  .global-overlay-root .dashboard-preview-actions button {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cloud-ledger-state.is-loading .cloud-ledger-state-mark,
  .cloud-ledger-skeleton i,
  .shell-status-loading i {
    animation: none;
  }
}

/* The signed-in identity stays compact in the frozen header. */
.app-header .topbar.is-compact .topbar-actions .user-name-button.user-avatar-button {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}

.user-toolbar-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  color: #ffffff;
  background: var(--ui-navy-950);
  font-size: 13px;
  font-weight: 800;
}

.user-toolbar-avatar img,
.user-toolbar-avatar span {
  width: 100%;
  height: 100%;
}

.user-toolbar-avatar img {
  display: block;
  object-fit: cover;
}

.user-toolbar-avatar img[hidden] {
  display: none;
}

.user-toolbar-avatar span {
  display: grid;
  place-items: center;
}

.app-header .user-name-button.user-avatar-button:hover,
.app-header .user-name-button.user-avatar-button:focus-visible {
  border-color: var(--ui-cyan-500);
  box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.18);
}

/* Payroll editor: keep the summary visible while the detailed table scrolls. */
.payroll-live-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px;
  border: 1px solid var(--ui-line-soft);
  border-radius: 6px;
  background: var(--ui-surface-soft);
}

.construction-log-header-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(100%, 430px);
}

.construction-log-header-controls > label {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--ui-muted-strong, #53606c);
  font-size: 12px;
}

.construction-log-header-controls select {
  min-height: 34px;
  max-width: 260px;
  padding: 5px 8px;
}

.org-module-dropdown {
  position: relative;
  min-width: 168px;
  border: 1px solid var(--ui-line, #d7e0e8);
  border-radius: 6px;
  background: #fff;
}

.org-module-dropdown > summary {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: var(--ui-ink, #1d2129);
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  outline: none;
}

.org-module-dropdown > summary::marker { content: ""; }
.org-module-dropdown > summary::-webkit-details-marker { display: none; }
.org-module-dropdown > summary:focus-visible { box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.3); }
.org-module-dropdown > summary b { color: var(--ui-navy-950, #0f3476); font-weight: 650; white-space: nowrap; }
.org-module-dropdown > summary i {
  color: var(--ui-teal, #087d79);
  font-style: normal;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  transition: transform 160ms ease-out;
}
.org-module-dropdown[open] {
  border-color: rgba(15, 52, 118, 0.42);
}
.org-module-dropdown[open] > summary {
  color: var(--ui-navy-950, #0f3476);
  background: #f2f7fa;
}
.org-module-dropdown[open] > summary i { transform: rotate(180deg); }

.org-module-dropdown-options {
  position: fixed;
  z-index: var(--z-dropdown, 300);
  display: none;
  grid-template-columns: repeat(2, minmax(138px, 1fr));
  gap: 6px;
  width: min(360px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  max-height: min(360px, var(--org-dropdown-max-height, calc(100dvh - 24px)));
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--ui-line, #d7e0e8);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 52, 118, 0.18), 0 3px 10px rgba(29, 33, 41, 0.08);
  overscroll-behavior: contain;
}

.org-module-dropdown[open] > .org-module-dropdown-options {
  display: grid;
}

.org-module-dropdown-options.is-floating-open {
  display: grid;
}

.org-module-dropdown-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px;
  border-radius: 5px;
  color: var(--ui-ink, #1d2129);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
}

.org-module-dropdown-options label:hover { background: var(--ui-surface-soft, #f6f8fa); }
.org-module-dropdown-options label:has(input:checked) {
  color: var(--ui-navy-950, #0f3476);
  background: #eaf4f5;
  font-weight: 650;
}

.org-module-dropdown-options input[type="checkbox"] {
  width: 16px !important;
  height: 16px;
  min-height: 0;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--ui-teal, #087d79);
}

.org-module-dropdown-options span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.org-employee-permission-table {
  min-width: 1280px;
}

.org-employee-permission-table th:nth-child(1),
.org-employee-permission-table td:nth-child(1) { min-width: 150px; }
.org-employee-permission-table th:nth-child(2),
.org-employee-permission-table td:nth-child(2),
.org-employee-permission-table th:nth-child(3),
.org-employee-permission-table td:nth-child(3) { min-width: 112px; }
.org-employee-permission-table th:nth-child(4),
.org-employee-permission-table td:nth-child(4) { min-width: 170px; }
.org-employee-permission-table th:nth-child(5),
.org-employee-permission-table td:nth-child(5) { min-width: 210px; }
.org-employee-permission-table th:nth-child(6),
.org-employee-permission-table td:nth-child(6) { min-width: 190px; }
.org-employee-permission-table th:nth-child(7),
.org-employee-permission-table td:nth-child(7),
.org-employee-permission-table th:nth-child(8),
.org-employee-permission-table td:nth-child(8),
.org-employee-permission-table th:nth-child(9),
.org-employee-permission-table td:nth-child(9) { min-width: 82px; }

.org-editor-table .org-module-dropdown:not(.org-action-dropdown) {
  min-width: 196px;
}

.org-editor-table .org-module-dropdown:not(.org-action-dropdown) .org-module-dropdown-options span {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .org-module-dropdown { min-width: 0; width: 100%; }
  .org-module-dropdown-options {
    grid-template-columns: minmax(0, 1fr);
    max-height: var(--org-dropdown-max-height, calc(100dvh - 96px));
  }

  .org-editor-table .org-module-dropdown:not(.org-action-dropdown) .org-module-dropdown-options {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .org-module-dropdown > summary i { transition: none; }
}

@media (max-width: 760px) {
  .construction-log-header-controls {
    width: 100%;
    justify-content: stretch;
  }

  .construction-log-header-controls > label {
    grid-template-columns: 84px minmax(0, 1fr);
    width: 100%;
  }

  .construction-log-header-controls select { max-width: none; min-height: 42px; }
}

.payroll-live-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--ui-line);
  background: #fff;
}

.payroll-live-summary span { color: var(--ui-muted-strong, #53606c); font-size: 12px; }
.payroll-live-summary strong { color: var(--ui-navy-950, #0f3476); font-size: 19px; line-height: 1.2; }
.payroll-live-summary > div:last-child strong { color: #087d79; }

.payroll-table-wrap { scrollbar-gutter: stable; }
.payroll-table { min-width: 1900px; }
.payroll-table th,
.payroll-table td { min-width: 78px; padding: 5px 6px; }
.payroll-table th:nth-child(1),
.payroll-table td:nth-child(1) { min-width: 48px; }
.payroll-table th:nth-child(2),
.payroll-table td:nth-child(2) { min-width: 142px; }
.payroll-table th:nth-child(3),
.payroll-table td:nth-child(3) { min-width: 112px; }
.payroll-table th:nth-child(4),
.payroll-table td:nth-child(4) { min-width: 148px; }
.payroll-table th:nth-child(20),
.payroll-table td:nth-child(20) { min-width: 104px; }
.payroll-table input,
.payroll-table select,
.payroll-table textarea { min-height: 29px; padding: 3px 5px; font-size: 12px; }
.payroll-table textarea { min-width: 125px; }
.payroll-table tfoot td { background: #eef5f8; font-weight: 700; }

@media (max-width: 760px) {
  .payroll-live-summary { grid-template-columns: 1fr; }
  .payroll-live-summary > div { grid-template-columns: 1fr auto; align-items: center; }
  .payroll-live-summary strong { text-align: right; font-size: 18px; }
  .payroll-table { min-width: 1860px; }
}

@media (max-width: 760px) {
  .cloud-ledger-state {
    width: calc(100% - 18px);
    margin-top: 18px;
    padding: 18px;
  }

  .cloud-ledger-skeleton {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 761px) {
  .erp-shell {
    grid-template-columns: 204px minmax(0, min(calc(var(--content-max) + 48px), calc(100vw - 204px)));
  }

  .app-tech-canvas {
    left: 204px;
    right: 0;
    width: calc(100vw - 204px);
  }

  .erp-sidebar {
    padding: 10px 8px;
  }

  .brand {
    min-height: 58px;
    gap: 6px;
    padding: 2px 5px 8px;
  }

  .brand img {
    flex: 0 0 50px;
    width: 50px;
    height: 46px;
  }

  .brand strong,
  .brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand strong {
    font-size: 15px;
  }

  .brand span {
    font-size: 11px;
  }

  .module-nav {
    gap: 4px;
    margin-top: 7px;
  }

  .module-nav-group {
    gap: 2px;
    padding: 1px 0 4px;
  }

  .module-nav-title {
    padding: 0 7px 1px;
    font-size: 10px;
  }

  .module-nav button {
    min-height: 31px;
    gap: 7px;
    padding: 5px 8px;
    font-size: 14px;
    line-height: 1.15;
  }
}

/* Keep the operation background as one viewport-wide layer behind both columns. */
.erp-shell {
  position: relative;
  isolation: isolate;
  background: transparent;
}

.erp-shell > .app-tech-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.erp-shell > .erp-sidebar,
.erp-shell > .erp-main {
  position: relative;
  z-index: 1;
}

.erp-main {
  background: rgba(246, 248, 250, 0.82);
}

.payroll-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--ui-line-soft);
  border-bottom: 1px solid var(--ui-line-soft);
  background: #fff;
}

.payroll-table {
  min-width: 2140px;
  table-layout: fixed;
}

.payroll-table th,
.payroll-table td {
  min-width: 86px;
  padding: 6px 7px;
  white-space: nowrap;
}

.payroll-table th:nth-child(2),
.payroll-table td:nth-child(2) {
  min-width: 150px;
}

.payroll-table th:nth-child(4),
.payroll-table td:nth-child(4) {
  min-width: 160px;
}

.payroll-table input,
.payroll-table select,
.payroll-table textarea {
  width: 100%;
  min-width: 76px;
  min-height: 30px;
  padding: 4px 6px;
  border: 1px solid #d6e1e8;
  border-radius: 4px;
  background: #fff;
}

.payroll-table textarea {
  min-width: 150px;
  resize: vertical;
}

.payroll-group-head th {
  color: #fff;
  background: var(--ui-navy-950);
}

.contract-ledger-group-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 14px 12px;
  padding: 4px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: var(--ui-surface-soft);
}

.contract-ledger-group-switch button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #40566d;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.contract-ledger-group-switch button:hover,
.contract-ledger-group-switch button.is-active {
  color: #fff;
  border-color: var(--ui-navy-950);
  background: var(--ui-navy-950);
}

@media (max-width: 760px) {
  .contract-ledger-group-switch {
    margin-right: 9px;
    margin-left: 9px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .contract-ledger-group-switch button {
    flex: 0 0 auto;
  }

  .payroll-table-wrap {
    margin: 0 -1px;
  }
}

/* Dense workflow forms: section hierarchy stays visible without field-card clutter. */
.flow-form .form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 12px 16px 16px;
  background: #ffffff;
}

.flow-form .form-grid label {
  min-width: 0;
  min-height: 0;
  padding: 0;
  gap: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.flow-form .form-grid label:hover,
.flow-form .form-grid label:focus-within {
  transform: none;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.flow-form .form-grid label > span {
  min-height: 16px;
  color: #465463;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
}

.flow-form .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.flow-form .form-grid select {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #cfd8df;
  border-radius: 5px;
  color: var(--ui-text);
  background: #ffffff;
}

.flow-form .form-grid textarea {
  min-height: 76px;
  padding: 8px 9px;
  border: 1px solid #cfd8df;
  border-radius: 5px;
  color: var(--ui-text);
  background: #ffffff;
  line-height: 1.55;
}

.flow-form .form-grid input:focus,
.flow-form .form-grid select:focus,
.flow-form .form-grid textarea:focus {
  border-color: #4d9e9a;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.18);
}

.flow-form .form-grid input[readonly],
.flow-form .form-grid textarea[readonly],
.flow-form .form-grid select:disabled {
  color: #52606d;
  border-color: #dde3e8;
  background: var(--ui-surface-soft);
}

.flow-form .form-grid label.field-invalid,
.flow-form .form-grid .field-invalid {
  background: transparent !important;
  box-shadow: none !important;
}

.flow-form .form-grid label.field-invalid input,
.flow-form .form-grid label.field-invalid select,
.flow-form .form-grid label.field-invalid textarea,
.flow-form .form-grid .field-invalid input,
.flow-form .form-grid .field-invalid select,
.flow-form .form-grid .field-invalid textarea {
  border-color: var(--ui-red-500) !important;
  background: #fff7f6 !important;
  box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.12) !important;
}

.flow-form .form-section-label {
  min-height: 34px;
  margin: 5px 0 1px;
  padding: 7px 10px;
  border: 1px solid #dbe4e9;
  border-radius: 5px;
  color: #173d64;
  background: #f1f6f7;
}

/* Roles read as compact records, with permissions on a separate scan-friendly row. */
.org-role-list {
  gap: 12px;
}

.org-role-row {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: #ffffff;
}

.org-role-summary {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(240px, 1.4fr) minmax(145px, auto) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--ui-line-soft);
  background: var(--ui-surface-soft);
}

.org-role-name-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.org-role-name-field > span,
.org-module-checks legend {
  color: var(--ui-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.org-role-name-field input {
  min-height: 36px;
  padding: 6px 8px;
  border-color: #cfd8df;
  border-radius: 5px;
}

.org-role-summary .org-inline-check {
  min-height: 36px;
  justify-content: center;
  padding: 6px 9px;
  border: 1px solid #d5dee4;
  border-radius: 5px;
  color: #334455;
  background: #ffffff;
}

.org-module-checks {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 7px;
  margin: 0;
  padding: 12px;
  border: 0;
}

.org-module-checks legend {
  width: 100%;
  padding: 10px 12px 0;
}

.org-module-checks label {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid #dfe5e9;
  border-radius: 5px;
  color: #3f4c59;
  background: #ffffff;
  font-size: 12px;
  white-space: normal;
}

.org-module-checks label:has(input:checked) {
  color: #173d64;
  border-color: #8ecac7;
  background: #f0f8f7;
}

.org-module-checks input,
.org-role-summary .org-inline-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: var(--ui-navy-950);
}

@media (max-width: 980px) {
  .flow-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-role-summary {
    grid-template-columns: minmax(160px, 0.7fr) minmax(220px, 1.3fr) auto;
  }

  .org-role-summary > .table-action {
    grid-column: 3;
  }
}

@media (max-width: 760px) {
  .flow-form .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
    padding: 11px 10px 14px;
  }

  .flow-form .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .flow-form .form-grid select {
    height: 44px;
    min-height: 44px;
    font-size: 14px;
  }

  .flow-form .form-grid textarea {
    min-height: 96px;
    font-size: 14px;
  }

  .org-role-list {
    padding: 9px;
  }

  .org-role-summary {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
  }

  .org-role-summary > .table-action {
    grid-column: auto;
  }

  .org-module-checks {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }
}

/* Unified frozen application header: brand, workflow status, search and user. */
.erp-shell {
  --app-header-height: 72px;
  grid-template-columns: 204px minmax(0, min(calc(var(--content-max) + 48px), calc(100vw - 204px)));
  grid-template-rows: var(--app-header-height) minmax(0, 1fr);
  align-items: start;
}

.app-header {
  grid-column: 1 / -1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 220;
  min-width: 0;
  min-height: var(--app-header-height);
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  border-bottom: 1px solid var(--ui-line);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 52, 118, 0.09);
}

.app-header-brand {
  min-width: 0;
  background: var(--ui-navy-950);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.app-header .brand {
  width: 100%;
  min-height: var(--app-header-height);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px;
  border: 0;
}

.app-header .brand img {
  width: 52px;
  height: 50px;
  flex: 0 0 52px;
  object-fit: contain;
}

.app-header .brand strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header-workspace {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #ffffff;
}

.app-header .topbar.is-compact {
  width: 100%;
  min-height: 54px;
  position: static;
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(210px, 300px) auto;
  grid-template-areas: "approval search actions";
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-header .approval-overview {
  min-width: 0;
}

.app-header .flow-status-strip {
  height: 100%;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--ui-line-soft);
  border-radius: 6px;
  background: var(--ui-surface-soft);
}

.app-header .flow-status-items {
  min-width: 0;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 3px !important;
}

.app-header .flow-status-cluster {
  min-width: 0;
  min-height: 32px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(40px, 1fr);
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 5px;
}

.app-header .flow-status-cluster > span,
.app-header .flow-status-title {
  display: none !important;
}

.app-header .flow-status-cluster .approval-link {
  min-width: 40px;
  min-height: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  white-space: nowrap;
}

.app-header .flow-status-cluster .approval-link:hover {
  border-color: rgba(114, 200, 196, 0.64);
  background: #ffffff;
}

.app-header .flow-status-cluster .approval-link small,
.app-header .flow-status-cluster .approval-link strong {
  margin: 0;
  line-height: 1;
}

.app-header .flow-status-cluster .approval-link small {
  color: #485d70;
  font-size: 10px;
}

.app-header .flow-status-cluster .approval-link strong {
  color: var(--ui-navy-950);
  font-size: 11px;
}

.app-header .global-search,
.app-header .topbar-actions {
  align-self: center;
}

.app-header .global-search input,
.app-header .user-name-button {
  height: 38px;
  min-height: 38px;
}

.app-header .global-search input {
  border-color: var(--ui-line);
  background: var(--ui-surface-soft);
}

.app-header .global-search input:focus {
  border-color: var(--ui-cyan-500);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.14);
}

.app-header .user-name-button {
  border-color: var(--ui-line);
  color: var(--ui-navy-950);
  background: #ffffff;
}

.erp-sidebar {
  grid-column: 1;
  grid-row: 2;
  top: var(--app-header-height);
  height: calc(100dvh - var(--app-header-height));
  min-height: calc(100dvh - var(--app-header-height));
  padding-top: 11px;
}

.erp-shell > .erp-sidebar {
  z-index: 180;
}

@media (min-width: 761px) {
  .erp-shell > .erp-sidebar {
    position: sticky;
    top: var(--app-header-height);
    align-self: start;
  }
}

.erp-main {
  grid-column: 2;
  grid-row: 2;
  padding-top: 12px;
}

/* Dashboard charts share the same restrained business palette as the cockpit. */
.dashboard-chart-suite {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.65fr);
  gap: 12px;
  margin-top: 12px;
}

.dashboard-chart-panel {
  min-width: 0;
  padding: 15px 16px 13px;
  border: 1px solid var(--ui-line-soft);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(15, 52, 118, 0.06);
}

.dashboard-comparison-chart .dashboard-panel-head {
  margin-bottom: 8px;
}

.dashboard-comparison-chart .dashboard-panel-head > small {
  color: var(--ui-text-muted);
  font-size: 11px;
}

.dashboard-comparison-scroll {
  min-width: 0;
}

.dashboard-comparison-bars {
  min-height: 230px;
  display: grid;
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  align-items: end;
  gap: clamp(8px, 1.6vw, 24px);
  padding: 20px 12px 0;
  border-bottom: 1px solid var(--ui-line);
  background: repeating-linear-gradient(to top, transparent 0, transparent 54px, rgba(216, 225, 232, 0.58) 55px);
}

.dashboard-chart-bar {
  min-width: 0;
  height: 210px;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr) 30px;
  align-items: end;
  gap: 4px;
  padding: 0;
  border: 0;
  color: var(--ui-text);
  background: transparent;
  cursor: pointer;
}

.dashboard-chart-bar > strong {
  overflow: hidden;
  color: var(--ui-navy-950);
  font-size: 12px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-chart-bar > i {
  width: min(44px, 68%);
  height: max(5px, var(--bar-height));
  min-height: 5px;
  justify-self: center;
  display: block;
  position: relative;
  border-radius: 4px 4px 0 0;
  background: var(--chart-color, var(--ui-navy-950));
  transition: filter 160ms ease, transform 160ms ease;
}

.dashboard-chart-bar > i::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(15, 52, 118, 0.08);
  border-bottom: 0;
  border-radius: inherit;
}

.dashboard-chart-bar:hover > i,
.dashboard-chart-bar:focus-visible > i {
  filter: saturate(1.12) brightness(1.03);
  transform: translateY(-2px);
}

.dashboard-chart-bar > span {
  align-self: start;
  color: var(--ui-text-muted);
  font-size: 11px;
  line-height: 15px;
  text-align: center;
}

.dashboard-chart-bar.income { --chart-color: #0f3476; }
.dashboard-chart-bar.cost { --chart-color: #e69948; }
.dashboard-chart-bar.output { --chart-color: #3966a8; }
.dashboard-chart-bar.receivable { --chart-color: #72c8c4; }
.dashboard-chart-bar.received { --chart-color: #319b94; }
.dashboard-chart-bar.paid { --chart-color: #c47a31; }

.dashboard-donut-layout {
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(138px, 0.9fr) minmax(128px, 1.1fr);
  align-items: center;
  gap: 12px;
}

.dashboard-donut-plot {
  width: min(176px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  position: relative;
}

.dashboard-donut-plot svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.dashboard-donut-track,
.dashboard-donut-segment {
  fill: none;
  stroke-width: 14;
}

.dashboard-donut-track {
  stroke: #e9eef2;
}

.dashboard-donut-segment {
  stroke-linecap: butt;
}

.dashboard-donut-segment.received {
  stroke: #319b94;
}

.dashboard-donut-segment.unreceived {
  stroke: #ffab40;
}

.dashboard-donut-plot > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dashboard-donut-plot > div strong {
  color: var(--ui-navy-950);
  font-size: 23px;
  line-height: 1;
}

.dashboard-donut-plot > div span {
  margin-top: 6px;
  color: var(--ui-text-muted);
  font-size: 11px;
}

.dashboard-donut-legend {
  display: grid;
  gap: 8px;
}

.dashboard-donut-legend button {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  border: 1px solid var(--ui-line-soft);
  border-radius: 5px;
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  text-align: left;
}

.dashboard-donut-legend button:hover,
.dashboard-donut-legend button:focus-visible {
  border-color: var(--ui-cyan-500);
  background: #ffffff;
}

.dashboard-donut-legend button > i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #319b94;
}

.dashboard-donut-legend button.unreceived > i {
  background: #ffab40;
}

.dashboard-donut-legend button > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  color: var(--ui-text-muted);
  font-size: 11px;
}

.dashboard-donut-legend button > span small {
  margin-top: 2px;
  color: #5f6e7c;
  font-size: 11px;
}

.dashboard-donut-legend button > strong {
  color: var(--ui-navy-950);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-trend-chart {
  grid-column: 1 / -1;
}

.dashboard-trend-head {
  align-items: center;
}

.dashboard-trend-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.dashboard-trend-legend button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 3px 7px;
  border: 1px solid var(--ui-line-soft);
  border-radius: 4px;
  color: var(--ui-text-muted);
  background: var(--ui-surface-soft);
  font-size: 11px;
}

.dashboard-trend-legend button:hover,
.dashboard-trend-legend button:focus-visible {
  border-color: var(--ui-cyan-500);
  color: var(--ui-navy-950);
  background: #ffffff;
}

.dashboard-trend-legend i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: #3966a8;
}

.dashboard-trend-legend .received i { background: #319b94; }
.dashboard-trend-legend .paid i { background: #e69948; }

.dashboard-line-canvas {
  max-width: 100%;
  overflow-x: auto;
}

.dashboard-line-canvas svg {
  width: 100%;
  min-width: 680px;
  height: auto;
  display: block;
}

.dashboard-line-grid line {
  stroke: #e2e9ee;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.dashboard-line-grid text,
.dashboard-line-months text {
  fill: #6e7681;
  font-size: 11px;
}

.dashboard-line-series {
  fill: none;
  stroke: #3966a8;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.dashboard-line-series.received { stroke: #319b94; }
.dashboard-line-series.paid { stroke: #e69948; }

.dashboard-line-point {
  fill: #ffffff;
  stroke: #3966a8;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.dashboard-line-point.received { stroke: #319b94; }
.dashboard-line-point.paid { stroke: #e69948; }

/* Flatten legacy module surfaces into the active navy/cyan system palette. */
.panel-title {
  background: var(--ui-surface-soft);
  background-image: none;
}

.panel-title > div,
.dashboard-panel-head > div,
.form-head > div {
  padding-left: 0;
}

.panel-title > div::before,
.dashboard-panel-head > div::before,
.form-head > div::before {
  content: none;
}

.metric-card {
  background: #ffffff;
  background-image: none;
}

.org-table-wrap {
  background: #ffffff;
  background-image: none;
}

.erp-main table thead th {
  background: var(--ui-surface-soft);
  background-image: none;
}

.erp-main table thead .payroll-group-head th {
  color: #ffffff;
  background: var(--ui-navy-950);
  background-image: none;
}

.table-action {
  background: #ffffff;
  background-image: none;
}

.table-action.primary {
  border-color: var(--ui-navy-950);
  color: #ffffff;
  background: var(--ui-navy-950);
  background-image: none;
}

.inline-settings button {
  border-color: var(--ui-navy-950);
  color: #ffffff;
  background: var(--ui-navy-950);
  background-image: none;
}

.inline-settings button:hover,
.inline-settings button:focus-visible,
.table-action.primary:hover,
.table-action.primary:focus-visible {
  border-color: #0b2d66;
  background: #0b2d66;
  background-image: none;
}

@media (max-width: 1120px) {
  .dashboard-chart-suite {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .dashboard-chart-panel {
    padding: 12px 10px 10px;
  }

  .dashboard-comparison-scroll {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .dashboard-comparison-scroll .dashboard-comparison-bars {
    min-width: 560px;
    margin: 0;
  }

  .dashboard-comparison-chart {
    overflow: hidden;
  }

  .dashboard-donut-layout {
    min-height: 0;
    grid-template-columns: minmax(130px, 0.8fr) minmax(150px, 1.2fr);
  }

  .dashboard-trend-head {
    align-items: flex-start;
  }

  .dashboard-trend-legend {
    justify-content: flex-start;
  }
}

body.flow-detail-only .app-header {
  display: none !important;
}

body.flow-detail-only .erp-shell {
  grid-template-rows: minmax(0, 1fr) !important;
}

body.flow-detail-only .erp-main {
  grid-row: 1 !important;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .erp-shell {
    --app-header-height: 108px;
  }

  .app-header .topbar.is-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "search actions"
      "approval approval";
    grid-template-rows: 38px 42px;
  }
}

@media (max-width: 760px) {
  .erp-shell {
    --app-header-height: auto;
    display: block;
  }

  .app-header {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: 50px auto;
  }

  .app-header-brand {
    grid-row: 1;
  }

  .app-header .brand {
    min-height: 50px;
    gap: 7px;
    padding: 4px 10px;
  }

  .app-header .brand img {
    width: 42px;
    height: 40px;
    flex-basis: 42px;
  }

  .app-header .brand strong {
    font-size: 15px;
  }

  .app-header-workspace {
    grid-row: 2;
    padding: 5px 8px 6px;
  }

  .app-header .topbar.is-compact {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "search actions"
      "approval approval";
    gap: 5px;
  }

  .app-header .flow-status-items {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .app-header .flow-status-items::-webkit-scrollbar {
    display: none;
  }

  .app-header .flow-status-cluster {
    flex: 0 0 auto;
  }

  .app-header .global-search input,
  .app-header .user-name-button {
    height: 36px;
    min-height: 36px;
  }

  .erp-sidebar {
    position: static;
    width: 0;
    height: 0;
    min-height: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  .erp-main {
    padding-top: 9px;
  }
}

/* Mobile editable line-item tables become labeled record blocks. */
@media (max-width: 760px) {
  .mobile-editable-table {
    max-width: 100%;
    min-width: 0;
    overflow: visible;
  }

  .mobile-editable-table .line-table-head {
    position: static;
    flex-wrap: wrap;
    background: #f6f8fa;
  }

  .mobile-editable-table .line-table-head > div {
    margin-left: auto;
  }

  .mobile-editable-table .line-table-head button {
    min-height: 44px;
  }

  .mobile-editable-table .line-item-table {
    width: 100%;
    min-width: 0;
    display: block;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .mobile-editable-table .line-item-table thead {
    display: none;
  }

  .mobile-editable-table .line-item-table.has-editable-head thead {
    display: block;
    margin-bottom: 10px;
    padding: 9px;
    border: 1px solid #d7e1e8;
    border-radius: 6px;
    background: #eef3f6;
  }

  .mobile-editable-table .line-item-table.has-editable-head thead tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-editable-table .line-item-table.has-editable-head thead th {
    position: static;
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .mobile-editable-table .line-item-table tbody {
    display: grid;
    gap: 10px;
  }

  .mobile-editable-table .line-item-table tfoot {
    display: block;
    margin-top: 10px;
  }

  .mobile-editable-table .line-item-table tbody tr {
    display: grid;
    gap: 0;
    padding: 8px 10px;
    border: 1px solid #d7e1e8;
    border-radius: 7px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(29, 33, 41, 0.05);
  }

  .mobile-editable-table .line-item-table td,
  .mobile-editable-table .line-item-table tbody td {
    min-width: 0;
    min-height: 44px;
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    text-align: left;
    border-bottom: 1px solid var(--ui-line-soft);
  }

  .mobile-editable-table .line-item-table tbody td:last-child {
    border-bottom: 0;
  }

  .mobile-editable-table .line-item-table td::before {
    content: attr(data-mobile-label);
    display: block;
    color: #526273;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
  }

  .mobile-editable-table .line-item-table tfoot tr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    border: 1px solid #c9d8df;
    border-radius: 6px;
    background: #f2f7f8;
  }

  .mobile-editable-table .line-item-table tfoot td {
    min-height: 0;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .mobile-editable-table .line-item-table tfoot td:empty {
    display: none;
  }

  .mobile-editable-table .line-item-table input,
  .mobile-editable-table .line-item-table select,
  .mobile-editable-table .line-item-table textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
}

@media print {
  .mobile-editable-table .line-item-table {
    width: 100% !important;
    min-width: 0 !important;
    display: table !important;
  }

  .mobile-editable-table .line-item-table thead { display: table-header-group !important; }
  .mobile-editable-table .line-item-table tbody { display: table-row-group !important; }
  .mobile-editable-table .line-item-table tfoot { display: table-footer-group !important; }
  .mobile-editable-table .line-item-table tr { display: table-row !important; }
  .mobile-editable-table .line-item-table th,
  .mobile-editable-table .line-item-table td { display: table-cell !important; }
  .mobile-editable-table .line-item-table td::before { display: none !important; }
}

/* Operational layout consolidation */
:root {
  --ui-control-height: 36px;
  --ui-panel-radius: 8px;
  --ui-panel-shadow: 0 2px 8px rgba(29, 33, 41, 0.06);
  --ui-focus-ring: 0 0 0 3px rgba(114, 200, 196, 0.22);
  --ui-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  color: var(--ui-text);
  background-color: var(--ui-surface-soft);
}

.erp-shell {
  --content-max: 1440px;
}

.erp-main {
  padding: 14px 18px 28px;
  background: rgba(246, 248, 250, 0.9);
}

.view-root {
  align-content: start;
  gap: 12px;
}

.panel,
.flow-form,
.dashboard-visual-panel,
.dashboard-chart-panel {
  border-color: var(--ui-line);
  border-radius: var(--ui-panel-radius);
  box-shadow: var(--ui-panel-shadow);
}

.panel:hover,
.dashboard-visual-panel:hover {
  border-color: var(--ui-line);
  box-shadow: var(--ui-panel-shadow);
  transform: none;
}

.panel-title,
.form-head,
.dashboard-panel-head {
  min-height: 46px;
  gap: 12px;
  padding: 9px 13px;
  background: var(--ui-surface-soft);
  background-image: none;
}

.panel-title > div,
.form-head > div,
.dashboard-panel-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.panel-title strong,
.form-head strong,
.dashboard-panel-head :is(strong, h2) {
  margin: 0;
  color: var(--ui-text);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
}

.panel-title span,
.form-head span,
.dashboard-panel-head span {
  max-width: 72ch;
  color: var(--ui-text-muted);
  font-size: 12px;
  line-height: 1.45;
  text-wrap: pretty;
}

.workspace-tabs,
.tabs,
.finance-subnav,
.contract-subnav,
.contract-subtabs,
.project-subtabs,
.party-subtabs,
.organization-subtabs {
  min-height: 38px;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: var(--ui-panel-shadow);
}

.workspace-tabs:empty {
  display: none;
}

.tab-button,
.finance-subnav button,
.contract-subnav button,
.contract-subtabs button,
.project-subtabs button,
.party-subtabs button,
.organization-subtabs button {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 5px;
  color: #40566d;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.tab-button.is-active,
.finance-subnav button.is-active,
.contract-subnav button.is-active,
.contract-subtabs button.is-active,
.project-subtabs button.is-active,
.party-subtabs button.is-active,
.organization-subtabs button.is-active {
  color: #ffffff;
  border-color: var(--ui-navy-950);
  background: var(--ui-navy-950);
  background-image: none;
  box-shadow: none;
}

.page-export-tools {
  min-height: 40px;
  gap: 10px;
  margin-top: 4px;
  padding: 6px 8px;
  border-color: var(--ui-line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: var(--ui-panel-shadow);
}

.page-export-tools > div:first-child {
  min-width: 76px;
}

.page-export-tools > div:first-child span {
  display: none;
}

.page-export-tools strong {
  color: var(--ui-text);
  font-size: 12px;
}

.export-toolbar select,
.export-toolbar input,
.export-toolbar button {
  min-height: 32px;
  height: 32px;
}

/* The first viewport is for decisions; repeated operating details stay available on demand. */
.dashboard-executive {
  gap: 7px;
  padding: 9px 11px 11px;
  border-color: var(--ui-navy-950);
  background: var(--ui-navy-950);
  background-image: none;
  box-shadow: var(--ui-panel-shadow);
}

.dashboard-command {
  min-height: 40px;
  padding: 0 0 6px;
}

.dashboard-command-main {
  gap: 1px;
}

.dashboard-command-main :is(strong, h1) {
  margin: 1px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.dashboard-command-main small {
  display: none;
}

.dashboard-eyebrow {
  font-size: 11px;
}

.dashboard-project-picker.compact,
.dashboard-filter-trigger {
  width: 42px;
  height: 38px;
}

.dashboard-filter-trigger::before {
  width: 14px;
  height: 14px;
  border-width: 0 4px 4px 0;
  transform: translateY(-3px) rotate(45deg);
}

.boss-kpi-grid {
  gap: 7px;
  padding: 4px 0 0;
}

.boss-kpi-card {
  min-height: 60px;
  padding: 7px 9px;
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.boss-kpi-card:hover,
.boss-kpi-card:focus-visible {
  border-color: rgba(114, 200, 196, 0.82);
  background: rgba(255, 255, 255, 0.14);
  transform: none;
}

.boss-kpi-card strong {
  margin: 4px 0 2px;
  font-size: 18px;
}

.boss-kpi-card small {
  font-size: 10px;
}

.dashboard-chart-suite {
  gap: 12px;
  margin-top: 0;
}

.dashboard-chart-panel {
  padding: 13px 14px 11px;
  box-shadow: var(--ui-panel-shadow);
}

.dashboard-comparison-bars {
  min-height: 252px;
}

.dashboard-chart-bar {
  height: 232px;
}

.dashboard-donut-layout {
  min-height: 252px;
}

.dashboard-trend-chart {
  min-height: 292px;
}

.dashboard-detail-drawer {
  overflow: clip;
  scroll-margin-top: calc(var(--app-header-height) + 12px);
  border-top: 1px solid var(--ui-line);
  border-bottom: 1px solid var(--ui-line);
  background: transparent;
}

.dashboard-detail-drawer > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  list-style: none;
}

.dashboard-detail-drawer > summary::-webkit-details-marker {
  display: none;
}

.dashboard-detail-drawer > summary:hover,
.dashboard-detail-drawer > summary:focus-visible {
  background: #ffffff;
}

.dashboard-detail-drawer > summary > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-detail-drawer > summary strong {
  font-size: 14px;
}

.dashboard-detail-drawer > summary small {
  color: var(--ui-text-muted);
  font-size: 11px;
}

.dashboard-detail-drawer > summary b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ui-navy-950);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-detail-drawer > summary b::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms var(--ui-ease-out);
}

.dashboard-detail-drawer[open] > summary {
  border-bottom: 1px solid var(--ui-line);
}

.dashboard-detail-drawer[open] > summary b::after {
  transform: translateY(2px) rotate(225deg);
}

.dashboard-detail-drawer .dashboard-primary-grid {
  margin: 0;
  padding: 12px 0 0;
}

/* Forms use a stable working width and reveal sections without oversized controls. */
.flow-form {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
}

.flow-form .form-head {
  min-height: 50px;
}

.flow-form-progress {
  padding: 8px 13px;
  background: var(--ui-surface-soft);
}

#flow-section-nav button {
  min-height: 28px;
  border-radius: 5px;
  color: #40566d;
  background: #ffffff;
}

#flow-section-nav button:hover,
#flow-section-nav button:focus-visible {
  color: var(--ui-navy-950);
  border-color: var(--ui-cyan-500);
}

.flow-form .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 13px 15px 16px;
  background: #ffffff;
}

.flow-form .form-grid label > span {
  min-height: 16px;
  color: #3f4d5a;
  font-size: 12px;
  font-weight: 700;
}

.flow-form .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.flow-form .form-grid select {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding: 6px 9px;
  font-size: 13px;
}

.flow-form .form-grid textarea {
  min-height: 80px;
  font-size: 13px;
}

.flow-form .form-grid input::placeholder,
.flow-form .form-grid textarea::placeholder,
.global-search input::placeholder {
  color: #667482;
  opacity: 1;
}

.flow-form .form-section-label {
  min-height: 32px;
  margin: 6px 0 0;
  padding: 6px 9px;
  border-color: #dce5ea;
  color: #173d64;
  background: #f1f6f7;
  font-size: 12px;
}

.form-actions {
  gap: 7px;
  padding: 9px 12px;
  border-top-color: var(--ui-line);
  background: #ffffff;
}

.form-actions button,
.table-action,
.readonly-link,
.attachment-upload-button,
.line-table-head button {
  min-height: 32px;
  border-radius: 5px;
  background-image: none;
  box-shadow: none;
}

/* All ledgers share one keyboard-focusable scroll surface and a fixed header. */
.data-table-shell {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  max-height: min(68vh, 720px);
  overscroll-behavior: contain;
  background: #ffffff;
  scrollbar-gutter: stable;
}

.data-table-shell:focus-visible {
  outline: 0;
  box-shadow: inset var(--ui-focus-ring);
}

.data-table-shell .data-table {
  min-width: 100%;
  border: 0;
  border-radius: 0;
}

.data-table-shell .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 36px;
  padding: 7px 9px;
  color: #30485f;
  background: #eef2f5;
  background-image: none;
  box-shadow: inset 0 -1px 0 var(--ui-line);
}

.data-table-shell .data-table tbody td {
  min-height: 38px;
  padding: 8px 9px;
  color: var(--ui-text);
  font-size: 12px;
  line-height: 1.45;
}

.data-table-shell .data-table tbody tr:nth-child(even) td {
  background: #fbfcfd;
}

.data-table-shell .data-table tbody tr:hover td {
  background: #f1f7f7;
}

.data-table-shell .data-table td.is-text {
  min-width: 180px;
  max-width: 320px;
  line-height: 1.55;
}

.data-table-shell .data-table th.is-action-header,
.data-table-shell .data-table td.is-action {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: -1px 0 0 var(--ui-line);
}

.data-table-shell .data-table th.is-action-header {
  z-index: 4;
  background: #eef2f5;
}

.data-table-shell .data-table tbody tr:nth-child(even) td.is-action {
  background: #fbfcfd;
}

.data-table-shell .data-table tbody tr:hover td.is-action {
  background: #f1f7f7;
}

.table-empty-cell {
  min-height: 92px;
}

/* Preview windows keep identity, content and actions in fixed, predictable zones. */
.global-overlay-root > .dashboard-preview-backdrop {
  padding: 20px;
  background: rgba(15, 31, 54, 0.56);
}

.global-overlay-root .dashboard-preview-panel {
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(15, 31, 54, 0.22);
}

.global-overlay-root .dashboard-preview-head {
  min-height: 52px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-soft);
}

.global-overlay-root .dashboard-preview-head strong {
  color: var(--ui-text);
  font-size: 15px;
}

.global-overlay-root .dashboard-preview-head span {
  color: var(--ui-text-muted);
  font-size: 12px;
}

.global-overlay-root .dashboard-preview-metrics > div {
  border: 1px solid var(--ui-line);
  border-left-width: 1px;
  border-radius: 6px;
  background: var(--ui-surface-soft);
  box-shadow: none;
}

.global-overlay-root .dashboard-preview-head button {
  min-width: 36px;
  min-height: 36px;
  border-radius: 5px;
}

.global-overlay-root .dashboard-preview-table,
.global-overlay-root .dashboard-preview-body,
.global-overlay-root .flow-record-preview-layout,
.global-overlay-root .template-document-layout {
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.global-overlay-root .dashboard-preview-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  gap: 7px;
  padding: 9px 12px;
  border-top: 1px solid var(--ui-line);
  background: #ffffff;
  box-shadow: 0 -3px 8px rgba(29, 33, 41, 0.04);
}

button,
[role="button"],
summary,
input,
select,
textarea {
  transition: border-color 160ms var(--ui-ease-out), background-color 160ms var(--ui-ease-out), color 160ms var(--ui-ease-out), box-shadow 160ms var(--ui-ease-out), transform 160ms var(--ui-ease-out);
}

button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--ui-focus-ring);
}

@media (max-width: 1180px) {
  .flow-form {
    max-width: 980px;
  }

  .flow-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-chart-suite {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .erp-main {
    padding: 8px 8px calc(82px + env(safe-area-inset-bottom));
  }

  .view-root {
    gap: 8px;
  }

  .panel,
  .flow-form,
  .dashboard-chart-panel,
  .dashboard-executive {
    border-radius: 6px;
  }

  .panel-title,
  .form-head,
  .dashboard-panel-head {
    min-height: 44px;
    align-items: flex-start;
    padding: 9px 10px;
  }

  .panel-title span,
  .form-head span,
  .dashboard-panel-head span {
    font-size: 11px;
  }

  .workspace-tabs,
  .tabs,
  .finance-subnav,
  .contract-subnav,
  .contract-subtabs,
  .project-subtabs,
  .party-subtabs,
  .organization-subtabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .workspace-tabs button,
  .tabs button,
  .finance-subnav button,
  .contract-subnav button,
  .contract-subtabs button,
  .project-subtabs button,
  .party-subtabs button,
  .organization-subtabs button {
    min-height: 40px;
    flex: 0 0 auto;
  }

  .page-export-tools {
    align-items: stretch;
    padding: 8px;
  }

  .page-export-tools > div:first-child {
    display: none;
  }

  .export-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .export-toolbar > * {
    width: 100%;
    min-height: 44px;
    height: 44px;
  }

  .export-toolbar button {
    grid-column: 1 / -1;
  }

  .dashboard-executive {
    padding: 8px;
  }

  .dashboard-command-main :is(strong, h1) {
    font-size: 17px;
  }

  .boss-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .boss-kpi-card {
    min-height: 68px;
  }

  .boss-kpi-card:last-child {
    grid-column: 1 / -1;
  }

  .dashboard-chart-panel {
    padding: 10px 9px;
  }

  .dashboard-detail-drawer > summary {
    min-height: 52px;
    padding: 8px 10px;
  }

  .dashboard-detail-drawer .dashboard-primary-grid {
    padding-top: 8px;
  }

  .flow-form-progress {
    top: 0;
    grid-template-columns: auto minmax(88px, 1fr);
    gap: 7px;
    padding: 8px 10px;
  }

  #flow-section-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  #flow-section-nav button {
    min-height: 36px;
  }

  .flow-form .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
    padding: 10px;
  }

  .flow-form .form-grid > * {
    grid-column: 1 / -1;
  }

  .flow-form .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .flow-form .form-grid select,
  .flow-form .form-grid textarea {
    font-size: 16px;
  }

  .data-table-shell {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .data-table-shell .data-table th.is-action-header,
  .data-table-shell .data-table td.is-action {
    position: static;
    box-shadow: none;
  }

  .global-overlay-root > .dashboard-preview-backdrop {
    padding: 0;
  }

  .global-overlay-root .dashboard-preview-panel {
    border-radius: 0;
  }

  .global-overlay-root .dashboard-preview-head {
    min-height: 54px;
    padding-right: 8px;
    padding-left: 10px;
  }

  .global-overlay-root .dashboard-preview-actions {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .global-overlay-root .dashboard-preview-actions button,
  .form-actions button,
  .table-action,
  .readonly-link,
  .attachment-upload-button {
    min-height: 44px;
  }
}

/* Final cascade guard for the legacy stylesheet stack. */
.erp-main {
  width: 100%;
  max-width: var(--ui-content-max);
  margin-inline: auto;
  padding: 12px 16px 28px;
  background: rgba(246, 248, 250, 0.94);
}

.workspace-tabs {
  min-height: 34px;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel,
.flow-form,
.dashboard-visual-panel,
.dashboard-chart-panel {
  border-color: var(--ui-line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: var(--ui-panel-shadow);
}

.panel-title,
.form-head,
.dashboard-panel-head {
  min-height: 48px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--ui-line);
  background: #ffffff;
  background-image: none;
}

.panel-title > div:first-child,
.form-head > div:first-child,
.dashboard-panel-head > div:first-child {
  padding-left: 0;
}

.tabs,
.finance-subnav,
.contract-subnav,
.contract-subtabs,
.project-subtabs,
.party-subtabs,
.organization-subtabs {
  min-height: 40px;
  gap: 0;
  padding: 0 6px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.tab-button,
.finance-subnav button,
.contract-subnav button,
.contract-subtabs button,
.project-subtabs button,
.party-subtabs button,
.organization-subtabs button {
  min-height: 39px;
  padding: 6px 11px;
  border: 0;
  border-radius: 0;
  color: #4b5e70;
  background: transparent;
  box-shadow: none;
}

.tab-button.is-active,
.finance-subnav button.is-active,
.contract-subnav button.is-active,
.contract-subtabs button.is-active,
.project-subtabs button.is-active,
.party-subtabs button.is-active,
.organization-subtabs button.is-active {
  color: var(--ui-navy-950);
  border-color: transparent;
  background: transparent;
  box-shadow: inset 0 -2px 0 var(--ui-cyan-500);
}

.boss-kpi-grid {
  gap: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.boss-kpi-card {
  min-height: 62px;
  padding: 8px 13px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.boss-kpi-card:first-child {
  border-left: 0;
}

.boss-kpi-card:hover,
.boss-kpi-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--ui-cyan-500);
}

.dashboard-chart-panel {
  padding: 0;
  overflow: hidden;
}

.dashboard-chart-panel > :not(.dashboard-panel-head) {
  margin-right: 14px;
  margin-left: 14px;
}

.dashboard-chart-panel > :last-child {
  margin-bottom: 12px;
}

.flow-form {
  max-width: 1320px;
}

.flow-form-progress {
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-surface-subtle);
}

.flow-form .form-section-label {
  min-height: 32px;
  margin-top: 7px;
  padding: 6px 9px;
  border: 1px solid #d8e3e7;
  border-radius: 3px;
  color: #173d64;
  background: #f2f7f8;
}

.table-empty-row,
.table-empty-cell {
  height: 132px;
}

.table-empty-cell {
  height: 132px;
  text-align: center !important;
  vertical-align: middle !important;
  color: #637282 !important;
  background: #ffffff !important;
  font-weight: 600;
}

.table-empty-cell::before {
  content: none;
}

@media (min-width: 761px) {
  .erp-shell {
    --app-header-height: var(--ui-header-height);
    --content-max: var(--ui-content-max);
    grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
  }

  .app-header {
    grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
    min-height: var(--ui-header-height);
    box-shadow: 0 2px 10px rgba(15, 52, 118, 0.08);
  }

  .app-header .brand {
    min-height: var(--ui-header-height);
    gap: 7px;
    padding: 6px 11px;
  }

  .app-header .brand img {
    width: 46px;
    height: 44px;
    flex-basis: 46px;
  }

  .app-header-workspace {
    padding: 6px 14px;
  }

  .app-header .topbar.is-compact {
    max-width: var(--ui-content-max);
    min-height: 48px;
    grid-template-columns: minmax(500px, 1fr) minmax(240px, 320px) auto;
    margin: 0 auto;
  }

  .app-header .flow-status-strip {
    min-height: 38px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .app-header .flow-status-items {
    height: 38px;
    gap: 0 !important;
  }

  .app-header .flow-status-cluster {
    min-height: 38px;
    gap: 0;
    padding: 0 4px;
    border-right: 1px solid var(--ui-line);
    border-radius: 0;
  }

  .app-header .flow-status-cluster:last-child {
    border-right: 0;
  }

  .app-header .flow-status-cluster .approval-link {
    min-width: 42px;
    min-height: 34px;
    height: 34px;
    border-radius: 4px;
  }

  .app-header .global-search input,
  .app-header .user-name-button {
    height: 36px;
    min-height: 36px;
    border-radius: 6px;
  }

  .erp-sidebar {
    padding: 8px 7px 18px;
  }

  .module-nav {
    gap: 0;
    margin-top: 0;
  }

  .module-nav-group {
    gap: 1px;
    margin-bottom: 3px;
    padding: 0 0 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .module-nav-title {
    padding: 5px 10px 3px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
  }

  .module-nav button {
    min-height: 34px;
    gap: 9px;
    padding: 7px 10px;
    border: 0;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.82);
    background: transparent;
    font-size: 14px;
    box-shadow: none;
    transform: none;
  }

  .module-nav button::before {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border: 1px solid rgba(184, 230, 228, 0.58);
    border-radius: 3px;
    background: transparent;
    box-shadow: none;
    filter: none;
    transform: none;
  }

  .module-nav button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
    transform: none;
  }

  .module-nav button.is-active {
    color: #ffffff;
    border-color: transparent;
    background: rgba(114, 200, 196, 0.14);
    box-shadow: inset 3px 0 0 var(--ui-cyan-500);
    transform: none;
  }

  .module-nav button.is-active::before {
    border-color: var(--ui-cyan-500);
    background: var(--ui-cyan-500);
    box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.15);
    filter: none;
    transform: none;
  }
}

@media (min-width: 1500px) {
  .flow-form .form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .erp-main {
    max-width: none;
    padding: 8px 8px calc(82px + env(safe-area-inset-bottom));
  }

  .tab-button,
  .finance-subnav button,
  .contract-subnav button,
  .contract-subtabs button,
  .project-subtabs button,
  .party-subtabs button,
  .organization-subtabs button {
    min-height: 44px;
  }

  .module-nav.is-mobile-open button[data-view] {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Three-skill refinement pass: compact enterprise controls and calm hierarchy. */
:root {
  --ui-canvas: #f4f7f9;
  --ui-surface-raised: #ffffff;
  --ui-surface-muted: #f7f9fb;
  --ui-border-strong: #c9d4dd;
  --ui-shadow-xs: 0 1px 2px rgba(29, 33, 41, 0.05);
  --ui-shadow-sm: 0 3px 10px rgba(29, 33, 41, 0.06);
}

body {
  background: var(--ui-canvas);
}

.erp-main {
  background: rgba(246, 248, 250, 0.985);
}

.erp-shell > .app-tech-canvas {
  opacity: 0.32;
}

.erp-main::before {
  opacity: 0.18;
}

.org-department-actions,
.org-role-actions {
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.org-department-actions button,
.org-role-actions button {
  min-width: 96px;
  white-space: nowrap;
}

.org-module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--ui-line);
}

.org-module-grid .metric-card {
  min-height: 88px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid var(--ui-line);
  border-radius: 0;
  background: var(--ui-surface-raised);
  box-shadow: none;
}

.org-module-grid .metric-card:last-child {
  border-right: 0;
}

.dashboard-chart-panel {
  position: relative;
}

.dashboard-chart-empty {
  position: absolute;
  z-index: 2;
  inset: 58px 14px 14px;
  display: grid;
  place-content: center;
  padding: 16px;
  color: #667482;
  background: rgba(255, 255, 255, 0.74);
  text-align: center;
  font-size: 12px;
  font-weight: 650;
  pointer-events: none;
}

.dashboard-trend-chart .dashboard-chart-empty {
  top: 64px;
}

.table-empty-row,
.table-empty-cell {
  height: 96px;
}

.table-empty-cell {
  min-height: 96px;
  text-align: center !important;
  vertical-align: middle !important;
  color: #607080 !important;
  background: #ffffff !important;
  font-weight: 600;
}

@media (max-width: 1180px) and (min-width: 761px) {
  .org-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-module-grid .metric-card:nth-child(2n) {
    border-right: 0;
  }

  .org-module-grid .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ui-line);
  }

}

/* Dashboard decision-first cockpit v5. */
.dashboard-project-picker.compact,
.dashboard-filter-trigger {
  width: 44px;
  height: 44px;
}

.dashboard-executive {
  gap: 6px;
  padding: 10px 12px 0;
  border-color: var(--ui-navy-950);
  background: var(--ui-navy-950);
  box-shadow: var(--ui-panel-shadow);
}

.dashboard-command {
  min-height: 46px;
  padding: 0 0 7px;
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.dashboard-command-main {
  gap: 2px;
}

.dashboard-command-main :is(strong, h1) {
  margin: 0;
  font-size: 20px;
}

.dashboard-command-main small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.boss-kpi-grid {
  gap: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.boss-kpi-card {
  min-height: 68px;
  padding: 8px 12px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.boss-kpi-card:first-child {
  border-left: 0;
}

.boss-kpi-card strong {
  margin: 4px 0 2px;
  font-size: 19px;
}

.boss-kpi-card:hover,
.boss-kpi-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 -2px 0 var(--ui-cyan-500);
}

.dashboard-insight-strip {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 8px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: var(--ui-panel-shadow);
}

.dashboard-insight-heading {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 0 8px;
  border-right: 1px solid var(--ui-line);
}

.dashboard-insight-heading :is(strong, h2) {
  margin: 0;
  color: var(--ui-text);
  font-size: 13px;
}

.dashboard-insight-heading span {
  color: var(--ui-text-muted);
  font-size: 10px;
}

.dashboard-insight-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-insight-items .attention-item {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 5px;
  color: var(--ui-text);
  background: var(--ui-surface-soft);
  text-align: left;
}

.dashboard-insight-items .attention-item:hover,
.dashboard-insight-items .attention-item:focus-visible {
  border-color: var(--ui-cyan-500);
  background: #ffffff;
}

.dashboard-insight-items .attention-item span {
  color: var(--ui-text-muted);
  font-size: 11px;
}

.dashboard-insight-items .attention-item strong {
  color: var(--ui-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-insight-items .attention-item.warning {
  border-color: rgba(230, 153, 72, 0.55);
  background: #fffaf4;
}

.dashboard-insight-items .attention-item.risk {
  border-color: rgba(229, 57, 53, 0.48);
  background: #fff7f6;
}

.dashboard-chart-suite {
  grid-template-columns: minmax(0, 1.52fr) minmax(290px, 0.72fr);
  gap: 12px;
  margin-top: 0;
}

.dashboard-chart-panel {
  min-height: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--ui-panel-shadow);
}

.dashboard-chart-panel .dashboard-panel-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
}

.dashboard-chart-panel .dashboard-panel-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-chart-panel .dashboard-panel-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-comparison-scroll {
  margin: 0 14px 12px;
}

.dashboard-comparison-bars {
  height: 208px;
  min-height: 208px;
  padding: 16px 10px 0;
}

.dashboard-chart-bar {
  height: 184px;
  grid-template-rows: 20px minmax(0, 1fr) 28px;
}

.dashboard-chart-bar > i {
  width: min(40px, 62%);
}

.dashboard-donut-layout {
  height: 208px;
  min-height: 208px;
  margin: 0 14px 12px;
}

.dashboard-donut-plot {
  width: min(148px, 100%);
}

.dashboard-trend-chart {
  grid-column: 1 / -1;
  min-height: 0;
}

.dashboard-trend-head {
  display: flex !important;
  align-items: center !important;
}

.dashboard-line-canvas {
  height: 218px;
  margin: 0 14px 12px;
}

.dashboard-line-canvas svg {
  height: 218px;
}

.dashboard-chart-empty-inline {
  min-height: 112px;
  display: grid;
  place-content: center;
  gap: 5px;
  margin: 10px 14px 12px;
  padding: 14px;
  border: 1px dashed #c9d6df;
  border-radius: 5px;
  color: var(--ui-text-readable-muted);
  background: #f8fafb;
  text-align: center;
}

.dashboard-chart-empty-inline strong {
  color: var(--ui-text);
  font-size: 13px;
}

.dashboard-chart-empty-inline span {
  font-size: 11px;
}

@media (max-width: 1180px) {
  .dashboard-chart-suite {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-trend-chart {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .dashboard-executive {
    padding: 9px 10px 0;
  }

  .dashboard-command-main :is(strong, h1) {
    font-size: 18px;
  }

  .dashboard-command-main small {
    font-size: 10px;
  }

  .boss-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .boss-kpi-card,
  .boss-kpi-card:first-child {
    min-height: 60px;
    padding: 6px 9px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .boss-kpi-card:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.14);
  }

  .dashboard-insight-strip {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 7px 8px;
  }

  .dashboard-insight-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 5px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
  }

  .dashboard-insight-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-insight-items .attention-item {
    min-height: 58px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 6px 4px;
    text-align: center;
  }

  .dashboard-insight-items .attention-item span {
    font-size: 10px;
  }

  .dashboard-insight-items .attention-item strong {
    max-width: 100%;
    font-size: 12px;
  }

  .dashboard-trend-head {
    display: grid !important;
    align-items: stretch !important;
  }

  .dashboard-trend-legend {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-trend-legend button {
    min-height: 44px;
    justify-content: center;
  }

  .dashboard-comparison-scroll {
    overflow-x: auto;
  }

  .dashboard-comparison-bars {
    min-width: 520px;
  }

  .dashboard-donut-layout {
    height: auto;
    min-height: 180px;
    grid-template-columns: minmax(120px, 0.8fr) minmax(150px, 1.2fr);
  }

  .dashboard-line-canvas,
  .dashboard-line-canvas svg {
    height: 190px;
  }
}

/* Finance close, recovery state and system administration */
.flow-form-state {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.flow-form-state #flow-autosave-status {
  color: #536273;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.finance-period-control {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(280px, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #e3e8ef;
  border-bottom: 1px solid #e3e8ef;
}

.finance-period-control > label {
  display: grid;
  gap: 6px;
  color: #344152;
  font-size: 12px;
  font-weight: 700;
}

.finance-period-control input {
  min-height: 38px;
  width: 100%;
  border: 1px solid #cbd4df;
  border-radius: 6px;
  background: #ffffff;
  color: #1d2129;
}

.finance-period-current {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.finance-period-current > span:first-child {
  color: #536273;
  font-size: 12px;
  font-weight: 650;
}

.finance-period-current small {
  min-width: 0;
  color: #536273;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-period-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.finance-period-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 171, 64, 0.42);
  border-radius: 6px;
  background: #fff8ed;
  color: #5d3c11;
  line-height: 1.55;
}

.finance-period-warning strong {
  flex: 0 0 auto;
  color: #8a4d08;
}

.org-role-row > .org-action-dropdown {
  margin-top: 8px;
}

.org-action-dropdown .org-module-dropdown-options,
.org-module-dropdown-options.is-action-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-management-overview .context-grid {
  margin-top: 4px;
}

.system-notification-panel .status-pill,
.system-audit-panel .status-pill,
.system-backup-panel .status-pill {
  white-space: nowrap;
}

.system-audit-preview-panel {
  width: min(1100px, calc(100vw - 48px));
}

.system-audit-change-list {
  min-height: 0;
  padding: 0 18px 18px;
  overflow: auto;
}

.system-audit-change {
  border-bottom: 1px solid #e3e8ef;
}

.system-audit-change:first-child {
  border-top: 1px solid #e3e8ef;
}

.system-audit-change summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  color: #1d2129;
  cursor: pointer;
}

.system-audit-change summary span {
  color: #0f3476;
  font-weight: 750;
}

.system-audit-change summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-audit-change > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 0 14px;
}

.system-audit-change section {
  min-width: 0;
}

.system-audit-change b {
  display: block;
  margin-bottom: 6px;
  color: #536273;
  font-size: 12px;
}

.system-audit-change pre {
  max-height: 260px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #dce3eb;
  border-radius: 6px;
  background: #f6f8fa;
  color: #1d2129;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.data-table-pagination {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 0;
  color: #536273;
  font-size: 12px;
}

.data-table-pagination > div {
  display: flex;
  gap: 6px;
}

.data-table-pagination strong {
  color: #1d2129;
  font-variant-numeric: tabular-nums;
}

.data-table-pagination .table-action {
  min-width: 72px;
}

@media (max-width: 980px) {
  .finance-period-control {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

  .finance-period-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-header .flow-status-items {
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .app-header .flow-status-items::-webkit-scrollbar {
    display: none;
  }

  .app-header .flow-status-cluster {
    flex: 0 0 auto;
  }

  .app-header .topbar.is-compact .flow-status-cluster .approval-link {
    width: 58px;
    min-width: 58px;
    flex: 0 0 58px;
    padding-inline: 4px;
  }

  .app-header .topbar.is-compact .flow-status-cluster .approval-link small {
    font-size: 10px;
  }

  .app-header .topbar.is-compact .flow-status-cluster .approval-link strong {
    font-size: 11px;
  }

  .flow-form-state {
    justify-items: start;
  }

  .finance-period-control {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
  }

  .finance-period-current {
    min-height: 44px;
    flex-wrap: wrap;
  }

  .finance-period-current small {
    flex-basis: 100%;
    white-space: normal;
  }

  .finance-period-actions {
    grid-column: auto;
  }

  .finance-period-actions .table-action {
    flex: 1 1 0;
  }

  .finance-period-warning {
    display: grid;
    gap: 4px;
  }

  .org-action-dropdown .org-module-dropdown-options,
  .org-module-dropdown-options.is-action-options,
  .system-audit-change > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .system-audit-preview-panel {
    width: 100%;
  }

  .system-audit-change-list {
    padding: 0 12px calc(14px + env(safe-area-inset-bottom));
  }

  .data-table-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .data-table-pagination > div,
  .data-table-pagination .table-action {
    flex: 1 1 0;
  }

  .flow-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .flow-form select,
  .flow-form textarea,
  .flow-form button,
  .approval-link,
  .finance-subnav button,
  .project-subtabs button,
  .contract-subtabs button,
  .party-subtabs button,
  .organization-subtabs button,
  .table-action {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .module-nav-chevron,
  .table-action,
  .approval-link,
  .org-module-dropdown summary {
    transition-duration: 0.01ms !important;
  }
}

/* Desktop sidebar child modules */
@media (min-width: 761px) {
  .module-nav-branch {
    min-width: 0;
    display: grid;
    gap: 1px;
  }

  .module-nav-branch > button[data-view] {
    width: 100%;
  }

  .module-nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .module-nav-chevron {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    margin-left: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    opacity: 0.68;
    transform: rotate(-45deg);
    transition: transform 160ms ease, opacity 160ms ease;
  }

  .module-nav-branch > button[aria-expanded="true"] .module-nav-chevron {
    opacity: 1;
    transform: translateY(-2px) rotate(45deg);
  }

  .module-subnav {
    display: grid;
    gap: 1px;
    margin: 2px 0 5px 14px;
    padding: 2px 0 3px 9px;
    border-left: 1px solid rgba(114, 200, 196, 0.34);
  }

  .module-subnav[hidden] {
    display: none !important;
  }

  .module-nav .module-subnav button {
    min-height: 29px;
    width: 100%;
    gap: 7px;
    padding: 5px 7px;
    border-radius: 4px;
    color: rgba(229, 244, 250, 0.7);
    background: transparent;
    font-size: 12px;
    font-weight: 560;
    text-align: left;
    box-shadow: none;
  }

  .module-nav .module-subnav button::before {
    width: 4px;
    height: 4px;
    flex: 0 0 4px;
    border: 0;
    border-radius: 50%;
    background: rgba(114, 200, 196, 0.48);
    box-shadow: none;
    transform: none;
  }

  .module-nav .module-subnav button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
  }

  .module-nav .module-subnav button.is-active {
    color: #ffffff;
    background: rgba(114, 200, 196, 0.16);
    box-shadow: none;
  }

  .module-nav .module-subnav button.is-active::before {
    border: 0;
    background: var(--ui-cyan-500);
    box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.14);
    transform: none;
  }

  .finance-subnav,
  .contract-subtabs,
  .project-subtabs,
  .party-subtabs,
  .organization-subtabs {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .module-nav-branch {
    display: contents;
  }

  .module-nav-chevron,
  .module-subnav {
    display: none !important;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .erp-shell {
    display: grid;
  }

  .module-nav {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .erp-shell {
    --app-header-height: 108px;
  }

  .app-header .topbar.is-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "search actions"
      "approval approval";
    grid-template-rows: 36px 38px;
  }

  .app-header .approval-overview,
  .app-header .flow-status-strip,
  .app-header .flow-status-items {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .app-header .flow-status-strip {
    overflow: hidden;
  }

  .app-header .flow-status-items {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
}

@media (max-width: 760px) {
  .organization-department-panel input,
  .organization-department-panel select,
  .organization-directory-panel input:not([type="checkbox"]),
  .organization-directory-panel select {
    min-height: 44px;
  }

  .organization-subtabs + .panel .table-action,
  .organization-department-panel button,
  .organization-directory-panel button {
    min-height: 44px;
  }

  .org-department-actions,
  .org-role-actions {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #save-org-departments,
  #save-org-roles {
    grid-column: 1 / -1;
  }

  .org-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-module-grid .metric-card {
    min-height: 82px;
    padding: 10px;
  }

  .org-module-grid .metric-card:nth-child(2n) {
    border-right: 0;
  }

  .org-module-grid .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ui-line);
  }
}

@media (max-width: 760px) {
  .org-employee-permission-table {
    min-width: 0;
    width: 100%;
  }

  .org-employee-permission-table tbody,
  .org-employee-permission-table tbody tr,
  .org-employee-permission-table tbody td {
    min-width: 0;
    width: 100%;
  }

  .org-employee-permission-table tbody td {
    align-items: center;
  }

  .org-employee-permission-table tbody td > :is(input, select, details) {
    min-width: 0;
    width: auto;
    max-width: 220px;
    flex: 1 1 auto;
  }

  .org-employee-permission-table tbody td > .org-project-checks {
    min-width: 0;
    width: min(220px, 100%);
    flex: 1 1 auto;
  }

  .org-employee-permission-table tbody td > .org-inline-check,
  .org-employee-permission-table tbody td > .table-action {
    margin-left: auto;
  }
}

/* Workbench integrated flow launch. */
.erp-flow-launch-dialog {
  width: min(1180px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: var(--ui-ink);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 52, 118, 0.24);
}

.erp-flow-launch-dialog::backdrop {
  background: rgba(6, 27, 69, 0.48);
}

.erp-flow-launch-dialog[open] {
  display: block;
}

.erp-flow-launch-dialog.is-picker {
  width: min(480px, calc(100vw - 32px));
  height: fit-content;
}

.erp-flow-launch-dialog.is-picker .erp-flow-launch-dialog-shell {
  height: auto;
}

.erp-flow-launch-dialog.is-picker .erp-flow-launch-dialog-body {
  flex: 0 1 auto;
  overflow: visible;
  padding: 0;
  background: #ffffff;
}

.erp-flow-launch-dialog-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.erp-flow-launch-dialog-head {
  min-height: 76px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--ui-line);
  background: #ffffff;
}

.erp-flow-launch-dialog-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.erp-flow-launch-dialog-head span,
.erp-flow-launch-dialog-head p {
  color: var(--ui-text-readable-muted);
  font-size: 11px;
}

.erp-flow-launch-dialog-head h2,
.erp-flow-launch-dialog-head p {
  margin: 0;
}

.erp-flow-launch-dialog-head h2 {
  color: var(--ui-ink);
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: 0;
}

.erp-flow-launch-dialog-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  color: var(--ui-navy-950);
  background: var(--ui-surface-soft);
  font-size: 22px;
  line-height: 1;
}

.erp-flow-launch-dialog-close:hover,
.erp-flow-launch-dialog-close:focus-visible {
  border-color: var(--ui-cyan-500);
  background: var(--ui-cyan-100);
}

.erp-flow-launch-dialog-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: var(--ui-surface-soft);
}

.erp-flow-launch-dialog-body.is-form {
  padding: 0;
  background: #ffffff;
}

.erp-flow-launch-dialog-form,
.erp-flow-launch-dialog-form > .flow-form {
  min-height: 100%;
}

.erp-flow-launch-dialog-form > .flow-form {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.erp-flow-type-picker {
  min-height: 0;
  background: #ffffff;
}

.workbench-flow-picker-form {
  display: grid;
  gap: 18px;
  padding: 18px 20px 20px;
}

.workbench-flow-picker-form > label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.workbench-flow-picker-form > label > span {
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 680;
}

.workbench-flow-picker-select {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.workbench-flow-picker-form select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 40px;
  padding: 0 36px 0 11px;
  border: 1px solid #cbd7e3;
  border-radius: 6px;
  color: var(--ui-ink);
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 52, 118, 0.05);
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.workbench-flow-picker-form select:invalid {
  color: var(--ui-text-readable-muted);
  font-weight: 500;
}

.workbench-flow-picker-form select option {
  color: var(--ui-ink);
  background: #ffffff;
  font-weight: 500;
}

.workbench-flow-picker-select > i {
  width: 8px;
  height: 8px;
  position: absolute;
  top: 50%;
  right: 14px;
  border-right: 2px solid #526b82;
  border-bottom: 2px solid #526b82;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.workbench-flow-picker-form select:hover {
  border-color: #93a9bd;
  background: #ffffff;
}

.workbench-flow-picker-form select:focus-visible {
  border-color: var(--ui-cyan-500);
  outline: 0;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(114, 200, 196, 0.22);
}

.workbench-flow-picker-form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.workbench-flow-picker-form > footer .table-action {
  min-width: 84px;
}

.workbench-heading {
  min-height: 76px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 16px;
}

.workbench-heading > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workbench-heading span,
.workbench-heading p,
.workbench-section-head span {
  color: var(--ui-text-readable-muted);
}

.workbench-heading span {
  font-size: 12px;
}

.workbench-heading h1 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 740;
  letter-spacing: 0;
}

.workbench-heading p {
  margin: 0;
  font-size: 13px;
}

.workbench-heading > button {
  min-width: 120px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--ui-navy-950);
  font-weight: 650;
}

.workbench-heading > button:hover,
.workbench-heading > button:focus-visible {
  background: #17458f;
}

.workbench-heading > button strong {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--ui-navy-950);
  background: var(--ui-cyan-300);
  font-variant-numeric: tabular-nums;
}

.workbench-flow-status-bar {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 2.28fr);
  margin-bottom: 4px;
  border-block: 1px solid var(--ui-line);
  background: #ffffff;
}

.workbench-flow-status-intro {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 0;
  border-right: 1px solid var(--ui-line);
}

.workbench-flow-status-mark {
  width: 38px;
  height: 38px;
  position: relative;
  flex: 0 0 38px;
  border-radius: 6px;
  background: var(--ui-cyan-100);
}

.workbench-flow-status-mark::before,
.workbench-flow-status-mark::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--ui-navy-950);
}

.workbench-flow-status-mark::before {
  top: 13px;
  box-shadow: 0 10px 0 var(--ui-navy-950);
}

.workbench-flow-status-mark::after {
  width: 6px;
  height: 6px;
  top: 11px;
  left: 16px;
  right: auto;
  border-radius: 50%;
  box-shadow: 0 10px 0 var(--ui-cyan-600);
  background: var(--ui-cyan-600);
}

.workbench-flow-status-intro > div {
  min-width: 0;
  flex: 1;
}

.workbench-flow-status-intro strong,
.workbench-flow-status-intro small {
  display: block;
}

.workbench-flow-status-intro strong {
  color: var(--ui-ink);
  font-size: 15px;
}

.workbench-flow-status-intro small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ui-text-readable-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-launch-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--ui-navy-950);
  font-size: 12px;
  font-weight: 680;
}

.workbench-launch-toggle:hover,
.workbench-launch-toggle:focus-visible {
  background: #17458f;
}

.workbench-launch-toggle:disabled {
  color: var(--ui-text-readable-muted);
  background: var(--ui-surface-soft);
  cursor: not-allowed;
}

.workbench-launch-toggle > span {
  color: inherit;
  font-size: 17px;
  line-height: 1;
}

.workbench-flow-status-groups {
  min-width: 0;
  display: grid;
  grid-template-columns: 0.78fr 1.12fr 1.1fr;
  padding: 8px 0;
}

.workbench-flow-status-group {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  border-right: 1px solid var(--ui-line-soft);
}

.workbench-flow-status-group:last-child {
  border-right: 0;
}

.workbench-flow-status-group > span {
  color: var(--ui-text-readable-muted);
  font-size: 10px;
  font-weight: 650;
}

.workbench-flow-status-group > div {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(54px, 1fr);
  gap: 4px;
}

.workbench-flow-status-button {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ui-text-readable-muted);
  background: transparent;
  white-space: nowrap;
}

.workbench-flow-status-button:hover,
.workbench-flow-status-button:focus-visible {
  color: var(--ui-ink);
  border-color: var(--ui-line);
  background: var(--ui-surface-soft);
}

.workbench-flow-status-button.is-active {
  color: var(--ui-navy-950);
  border-color: #b8dbd8;
  background: var(--ui-cyan-100);
}

.workbench-flow-status-button small {
  font-size: 10px;
}

.workbench-flow-status-button strong {
  color: var(--ui-ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.workbench-launch-drawer,
.workbench-flow-detail-panel {
  min-width: 0;
  margin-bottom: 0;
  border-block: 1px solid var(--ui-line);
  background: #ffffff;
}

.workbench-launch-drawer {
  margin-bottom: 4px;
  border-top: 2px solid var(--ui-navy-950);
}

.workbench-section-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ui-line-soft);
}

.workbench-section-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workbench-section-head h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 720;
  letter-spacing: 0;
}

.workbench-section-head span {
  font-size: 12px;
}

.workbench-section-head > button {
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  color: var(--ui-navy-950);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.workbench-section-head > button:hover,
.workbench-section-head > button:focus-visible {
  background: var(--ui-cyan-100);
}

.workbench-launch-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 16px;
  padding: 8px 12px 12px;
}

.workbench-launch-group {
  min-width: 0;
  padding: 8px 0;
}

.workbench-launch-group > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ui-text-readable-muted);
  font-size: 11px;
  font-weight: 700;
}

.workbench-launch-group > div {
  display: grid;
  gap: 6px;
}

.workbench-launch-group button {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #dfe5ea;
  border-radius: 6px;
  color: var(--ui-ink);
  background: var(--ui-surface-soft);
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.workbench-launch-group button:hover,
.workbench-launch-group button:focus-visible {
  border-color: var(--ui-cyan-500);
  background: #eef8f7;
  transform: translateY(-1px);
}

.workbench-launch-group button span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
}

.workbench-launch-group button i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  border-radius: 50%;
  color: var(--ui-navy-950);
  background: #dceceb;
  font-style: normal;
}

.workbench-launch-group button i::before {
  content: "\203A";
  transform: translateY(-1px);
  font-size: 17px;
  line-height: 1;
}

.workbench-flow-list {
  min-height: 0;
  display: grid;
  align-content: start;
  padding: 0 12px 4px;
}

.workbench-flow-record {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 34px minmax(220px, 1fr) minmax(150px, 0.52fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ui-line-soft);
}

.workbench-flow-record:last-child {
  border-bottom: 0;
}

.workbench-flow-record:hover {
  background: #f8fbfb;
}

.workbench-flow-record-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--ui-navy-950);
  background: var(--ui-cyan-100);
  font-size: 12px;
  font-weight: 750;
}

.workbench-flow-record-copy,
.workbench-flow-process {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workbench-flow-record-copy strong,
.workbench-flow-record-copy small,
.workbench-flow-process small,
.workbench-flow-process time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-flow-record-copy strong {
  color: var(--ui-ink);
  font-size: 13px;
}

.workbench-flow-record-copy small,
.workbench-flow-process small,
.workbench-flow-process time {
  color: var(--ui-text-readable-muted);
  font-size: 11px;
}

.workbench-flow-record .status-pill {
  white-space: nowrap;
}

.workbench-flow-empty,
.workbench-launch-empty {
  min-height: 128px;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 24px;
  color: var(--ui-text-readable-muted);
  text-align: center;
}

.workbench-flow-empty strong {
  color: var(--ui-ink);
  font-size: 13px;
}

.workbench-flow-empty span,
.workbench-launch-empty {
  font-size: 12px;
}

.workbench-metric-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0;
  border-block: 1px solid var(--ui-line);
}

.workbench-metric-band article {
  min-width: 0;
  border-right: 1px solid var(--ui-line-soft);
}

.workbench-metric-band article:last-child {
  border-right: 0;
}

.workbench-metric-band button {
  width: 100%;
  min-height: 112px;
  display: block;
  padding: 16px 20px;
  border: 0;
  color: var(--ui-ink);
  background: transparent;
  text-align: left;
}

.workbench-metric-band button:hover,
.workbench-metric-band button:focus-visible {
  background: #f2f8f8;
}

.workbench-metric-band span,
.workbench-metric-band p {
  color: var(--ui-text-readable-muted);
  font-size: 12px;
}

.workbench-metric-band strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--ui-ink);
  font-size: 23px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.workbench-metric-band strong small {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 620;
}

.workbench-metric-band p {
  margin: 0;
}

.workbench-project-overview,
.workbench-personal-attention {
  min-width: 0;
  margin-bottom: 12px;
  border-top: 2px solid var(--ui-navy-950);
  background: #ffffff;
}

.workbench-project-overview .workbench-section-head,
.workbench-personal-attention .workbench-section-head {
  padding-inline: 0;
}

.workbench-personal-attention .workbench-section-head > b {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--ui-navy-950);
  background: var(--ui-cyan-100);
  font-size: 11px;
  text-align: center;
}

.workbench-project-table-scroll {
  overflow-x: auto;
}

.workbench-project-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.workbench-project-table th,
.workbench-project-table td {
  height: 50px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ui-line-soft);
  color: var(--ui-ink);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.workbench-project-table th {
  height: 38px;
  color: var(--ui-text-readable-muted);
  background: var(--ui-surface-soft);
  font-size: 11px;
  font-weight: 680;
}

.workbench-project-table td:first-child {
  min-width: 190px;
}

.workbench-project-table td > button {
  max-width: 260px;
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  color: var(--ui-navy-950);
  background: transparent;
  text-align: left;
}

.workbench-project-table td > button strong,
.workbench-project-table td > button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-project-table td > button small {
  color: var(--ui-text-readable-muted);
  font-size: 10px;
}

.workbench-project-table td.is-negative {
  color: var(--ui-red-500);
  font-weight: 680;
}

.workbench-project-progress {
  width: 118px;
  display: grid;
  gap: 5px;
}

.workbench-project-progress > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.workbench-project-progress small {
  color: var(--ui-text-readable-muted);
  font-size: 10px;
}

.workbench-project-progress > i {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ecef;
}

.workbench-project-progress > i > b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--ui-cyan-600);
}

.workbench-project-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ui-text-readable-muted);
  font-weight: 650;
}

.workbench-project-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ui-cyan-600);
}

.workbench-project-state.warning::before {
  background: #e69948;
}

.workbench-project-state.risk::before {
  background: var(--ui-red-500);
}

.workbench-table-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--ui-text-readable-muted);
  white-space: normal;
}

.workbench-attention-list {
  display: grid;
}

.workbench-attention-list > button {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--ui-line-soft);
  color: var(--ui-ink);
  background: transparent;
  text-align: left;
}

.workbench-attention-list > button:hover,
.workbench-attention-list > button:focus-visible {
  background: #f2f8f8;
}

.workbench-attention-list > button > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workbench-attention-list strong,
.workbench-attention-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-attention-list strong {
  font-size: 12px;
}

.workbench-attention-list small {
  color: var(--ui-text-readable-muted);
  font-size: 10px;
}

.workbench-attention-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 4px;
  color: var(--ui-text-readable-muted);
  text-align: center;
}

.workbench-attention-empty strong {
  color: var(--ui-ink);
  font-size: 13px;
}

.workbench-attention-empty span {
  font-size: 11px;
}

.workbench-flow-editor-shell {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.workbench-flow-editor-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: #ffffff;
}

.workbench-flow-editor-head > button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  color: var(--ui-navy-950);
  background: var(--ui-surface-soft);
  font-size: 20px;
}

.workbench-flow-editor-head > button:hover,
.workbench-flow-editor-head > button:focus-visible {
  border-color: var(--ui-cyan-500);
  background: #eaf5f5;
}

.workbench-flow-editor-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workbench-flow-editor-head span,
.workbench-flow-editor-head p {
  color: var(--ui-text-readable-muted);
  font-size: 11px;
}

.workbench-flow-editor-head h1,
.workbench-flow-editor-head p {
  margin: 0;
}

.workbench-flow-editor-head h1 {
  color: var(--ui-ink);
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.workbench-flow-form-mount,
.workbench-flow-form-mount > .flow-form {
  min-width: 0;
}

@media (max-width: 980px) {
  .workbench-flow-status-bar {
    grid-template-columns: 1fr;
  }

  .workbench-flow-status-intro {
    padding-left: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-line-soft);
  }

  .workbench-launch-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workbench-flow-record {
    grid-template-columns: 34px minmax(220px, 1fr) auto auto;
  }

  .workbench-flow-process {
    display: none;
  }
}

@media (max-width: 760px) {
  .erp-flow-launch-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .erp-flow-launch-dialog.is-picker {
    width: calc(100vw - 24px);
    height: fit-content;
    max-height: calc(100dvh - 24px);
    margin: auto;
    border-radius: 8px;
  }

  .erp-flow-launch-dialog.is-picker .erp-flow-launch-dialog-head {
    min-height: 70px;
    padding: 14px 16px 12px;
  }

  .workbench-flow-picker-form {
    gap: 16px;
    padding: 16px;
  }

  .workbench-flow-picker-form select {
    height: 44px;
  }

  .erp-flow-launch-dialog-head {
    min-height: 68px;
    gap: 12px;
    padding: 10px 12px;
  }

  .erp-flow-launch-dialog-close {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .erp-flow-launch-dialog-body {
    padding: 8px;
  }

  .erp-flow-launch-dialog-body.is-form {
    padding: 0 0 calc(72px + env(safe-area-inset-bottom));
  }

  .workbench-heading {
    min-height: 0;
    align-items: center;
    gap: 12px;
    padding: 4px 0 14px;
  }

  .workbench-heading h1 {
    font-size: 19px;
  }

  .workbench-heading p {
    font-size: 12px;
  }

  .workbench-heading > button {
    min-width: 92px;
    min-height: 44px;
    padding-inline: 10px;
  }

  .workbench-heading > button {
    min-width: 88px;
    min-height: 44px;
    padding-inline: 8px;
  }

  .workbench-flow-status-bar {
    margin-bottom: 4px;
  }

  .workbench-flow-status-intro {
    gap: 8px;
    padding: 10px 8px;
  }

  .workbench-flow-status-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .workbench-launch-toggle {
    min-height: 44px;
  }

  .workbench-flow-status-groups {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .workbench-flow-status-group {
    grid-template-columns: 66px minmax(0, 1fr);
    grid-template-rows: 1fr;
    gap: 4px;
    padding: 6px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--ui-line-soft);
  }

  .workbench-flow-status-group:last-child {
    border-bottom: 0;
  }

  .workbench-flow-status-button {
    min-height: 44px;
  }

  .workbench-launch-groups {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 12px;
  }

  .workbench-launch-group {
    border-bottom: 1px solid var(--ui-line-soft);
  }

  .workbench-launch-group:last-child {
    border-bottom: 0;
  }

  .workbench-launch-group button,
  .workbench-section-head > button {
    min-height: 44px;
  }

  .workbench-flow-record {
    min-height: 72px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 0;
  }

  .workbench-flow-record .status-pill {
    grid-column: 3;
    grid-row: 1;
  }

  .workbench-flow-record > .table-action {
    min-height: 36px;
    grid-column: 2;
    justify-self: start;
  }

  .workbench-metric-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 0;
  }

  .workbench-metric-band article:nth-child(2) {
    border-right: 0;
  }

  .workbench-metric-band article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ui-line-soft);
  }

  .workbench-metric-band button {
    min-height: 104px;
    padding: 12px;
  }

  .workbench-metric-band strong {
    font-size: 18px;
  }

  .workbench-project-table {
    min-width: 760px;
  }

  .workbench-personal-attention .workbench-section-head {
    padding-inline: 4px;
  }

  .workbench-flow-editor-head {
    min-height: 74px;
    padding: 10px;
  }

  .workbench-flow-editor-head > button {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workbench-launch-group button {
    transition: none;
  }

  .workbench-launch-group button:hover,
  .workbench-launch-group button:focus-visible {
    transform: none;
  }
}

/* Header search and user-only refinement. */
.app-header .topbar.is-compact {
  max-width: var(--ui-content-max);
  min-height: 44px;
  grid-template-columns: minmax(320px, 680px) auto;
  grid-template-areas: "search actions";
  grid-template-rows: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto;
  padding: 0;
}

.app-header .global-search {
  grid-area: search;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.app-header .topbar-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-header .topbar.is-compact .topbar-actions .user-name-button.user-avatar-button {
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 38px;
  min-height: 38px;
  grid-template-columns: 32px 12px;
  place-items: center;
  column-gap: 5px;
  padding: 2px 5px 2px 3px;
  overflow: visible;
  border-radius: 6px;
}

.user-menu-chevron {
  width: 8px;
  height: 8px;
  display: block;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transform-origin: center;
  transition: transform 180ms ease-out;
}

.user-name-button.user-avatar-button[aria-expanded="true"] .user-menu-chevron {
  transform: rotate(225deg);
}

.app-header .user-menu-dropdown {
  width: min(300px, calc(100vw - 24px));
}

.app-header .user-menu-profile {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}

.app-header .user-menu-profile > div:last-child {
  gap: 2px;
}

.app-header .user-menu-profile strong {
  color: var(--ui-ink);
  font-size: 14px;
}

.app-header .user-menu-profile span,
.app-header .user-menu-profile small {
  color: var(--ui-text-readable-muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (min-width: 761px) and (max-width: 1180px) {
  .erp-shell {
    --app-header-height: var(--ui-header-height);
  }

  .app-header .topbar.is-compact {
    grid-template-columns: minmax(320px, 680px) auto;
    grid-template-areas: "search actions";
    grid-template-rows: 38px;
  }
}

@media (max-width: 760px) {
  .app-header-workspace {
    padding: 6px 8px;
  }

  .app-header .topbar.is-compact {
    min-height: 38px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "search actions";
    grid-template-rows: 38px;
    gap: 8px;
  }

  .app-header .global-search input {
    height: 38px;
    min-height: 38px;
  }

  .app-header .topbar.is-compact .topbar-actions .user-name-button.user-avatar-button {
    height: 38px;
    min-height: 38px;
  }
}

/* Mobile touch target guard: keep late cascade overrides from shrinking controls. */
.material-movement-panel {
  overflow: hidden;
}

.material-movement-metrics {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ui-line-soft);
  background: var(--ui-surface-soft);
}

.material-management-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.72fr) minmax(520px, 1.28fr);
  gap: 16px;
  padding: 0 14px 16px;
}

.material-movement-entry,
.material-inventory-section {
  min-width: 0;
}

.material-movement-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: #ffffff;
}

.material-movement-form > label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 700;
}

.material-movement-form .field-wide {
  grid-column: 1 / -1;
}

.material-direction-segmented {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.material-direction-segmented legend {
  margin-bottom: 5px;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 700;
}

.material-direction-segmented > div {
  height: 38px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid #cfd8df;
  border-radius: 5px;
  background: #f3f6f8;
}

.material-direction-segmented label {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.material-direction-segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.material-direction-segmented span {
  width: 100%;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #536474;
  font-size: 12px;
  font-weight: 700;
}

.material-direction-segmented input:checked + span {
  color: #ffffff;
  background: var(--ui-navy-950);
}

.material-direction-segmented input:focus-visible + span {
  outline: 2px solid var(--ui-cyan-500);
  outline-offset: 1px;
}

.material-movement-form input:not([type="radio"]):not([type="file"]),
.material-movement-form select,
.material-movement-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #cfd8df;
  border-radius: 5px;
  color: var(--ui-text);
  background: #ffffff;
  font: inherit;
}

.material-movement-form textarea {
  min-height: 72px;
  resize: vertical;
}

.material-contract-reference {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #dce6e9;
  border-radius: 5px;
  background: #f3f8f8;
}

.material-contract-reference span {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: #304657;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.material-contract-reference b {
  color: #667482;
  font-size: 10px;
}

.material-movement-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.material-movement-actions small {
  color: var(--ui-text-readable-muted);
}

.material-stock-value {
  color: #176c68;
  font-variant-numeric: tabular-nums;
}

.material-stock-value.is-empty {
  color: var(--ui-text-readable-muted);
}

.material-inventory-heading {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.material-inventory-heading .flow-section-title {
  margin: 0;
}

.material-inventory-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--ui-line);
  border-radius: 5px;
  background: var(--ui-surface-soft);
}

.material-inventory-view-switch button {
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 3px;
  color: var(--ui-text-readable-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.material-inventory-view-switch button.is-active {
  color: #ffffff;
  background: var(--ui-navy-950);
}

.contract-material-performance {
  margin-top: 14px;
}

.contract-material-control-details {
  margin: 12px 14px;
  border: 1px solid var(--ui-line-soft);
  border-radius: 6px;
  background: var(--ui-surface-soft);
}

.contract-material-control-details summary {
  padding: 10px 12px;
  color: var(--ui-navy-950);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.contract-material-control-details[open] summary {
  border-bottom: 1px solid var(--ui-line-soft);
}

.material-void-audit {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 10px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #e9aaa7;
  border-radius: 6px;
  color: var(--ui-text);
  background: #fff4f3;
}

.material-supplement-attachment-control {
  margin-top: 12px;
}

.material-void-reason {
  display: grid;
  gap: 6px;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 700;
}

.material-void-reason textarea {
  width: 100%;
  min-height: 88px;
  padding: 9px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 5px;
  color: var(--ui-text);
  background: #ffffff;
  resize: vertical;
}

.material-movement-preview-panel,
.material-inventory-preview-panel {
  width: min(980px, calc(100vw - 48px));
}

.material-void-panel {
  width: min(680px, calc(100vw - 48px));
}

@media (max-width: 1180px) {
  .material-management-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .material-movement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .material-management-layout {
    gap: 10px;
    padding: 0 10px 12px;
  }

  .material-movement-form {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .material-movement-form .field-wide {
    grid-column: 1;
  }

  .material-movement-form input:not([type="radio"]):not([type="file"]),
  .material-movement-form select {
    min-height: 44px;
  }

  .material-direction-segmented > div {
    height: 44px;
  }

  .material-direction-segmented span {
    height: 36px;
  }

  .material-movement-form textarea {
    min-height: 96px;
  }

  .material-contract-reference {
    grid-template-columns: 1fr;
  }

  .material-inventory-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .material-inventory-view-switch {
    width: 100%;
  }

  .contract-material-control-details {
    margin-inline: 10px;
  }

  .material-movement-preview-panel,
  .material-inventory-preview-panel,
  .material-void-panel {
    width: calc(100vw - 16px);
  }

  .material-movement-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .material-movement-actions .table-action {
    min-height: 44px;
  }

  .flow-form .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    height: 44px;
    min-height: 44px;
  }

  .flow-form .form-grid select {
    height: 44px;
    min-height: 44px;
  }

  .flow-form .form-grid textarea {
    min-height: 96px;
  }

  .flow-template-tools select,
  .flow-template-tools button,
  .flow-related-trigger,
  #flow-section-nav button {
    min-height: 44px;
  }

  .app-header .topbar.is-compact {
    min-height: 44px;
    grid-template-rows: 44px;
  }

  .app-header .global-search input {
    height: 44px;
    min-height: 44px;
  }

  .app-header .topbar.is-compact .topbar-actions .user-name-button.user-avatar-button {
    height: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .user-menu-chevron {
    transition: none;
  }
}

/* Release readiness interaction consolidation. */
.workbench-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.workbench-pending-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 4px;
  color: var(--ui-text-readable-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.workbench-pending-button {
  color: var(--ui-navy-950);
  border: 1px solid #b8dbd8;
  background: var(--ui-cyan-100);
}

.workbench-pending-button strong {
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.workspace-tab {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.workspace-tab-activate,
.workspace-tab-close {
  min-height: 32px;
  border: 0;
  color: inherit;
  background: transparent;
}

.workspace-tab-activate {
  min-width: 0;
  padding: 0 4px 0 10px;
  font: inherit;
}

.workspace-tab-activate span {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tab-close {
  width: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  padding: 0;
  font-size: 16px;
}

.workspace-tab-close:hover,
.workspace-tab-close:focus-visible {
  color: var(--ui-danger);
  background: #fff0ef;
}

.workspace-tab.is-active .workspace-tab-close:hover,
.workspace-tab.is-active .workspace-tab-close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.erp-flow-launch-dialog-actions {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}

.erp-flow-launch-change {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  color: var(--ui-navy-950);
  background: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.erp-flow-launch-change:hover,
.erp-flow-launch-change:focus-visible {
  border-color: var(--ui-cyan-500);
  background: var(--ui-cyan-100);
}

.enterprise-profile-form {
  padding: 14px;
}

.enterprise-profile-form .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.enterprise-profile-form label > span::after {
  content: "";
}

.enterprise-profile-form label:has(input[required]) > span::after {
  content: " *";
  color: var(--ui-danger);
}

@media (max-width: 760px) {
  .workbench-heading-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .workbench-pending-button,
  .erp-flow-launch-change {
    min-height: 44px;
  }

  .erp-flow-launch-dialog-actions {
    align-self: center;
  }

  .erp-flow-launch-change {
    padding-inline: 10px;
  }

  .enterprise-profile-form {
    padding: 10px;
  }

  .enterprise-profile-form .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile operational accessibility */
 .server-data-pagination {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--ui-line);
  color: var(--ui-text-readable-muted);
  background: #ffffff;
  font-size: 12px;
}

.server-data-pagination > div {
  display: flex;
  gap: 8px;
}

@media (max-width: 760px) {
  .flow-approval-actions .table-action,
  .approval-tree-node-actions button,
  .approval-tree-node-fields input,
  .approval-tree-node-fields select,
  .org-module-dropdown summary,
  .org-module-dropdown-options label {
    min-height: 44px;
  }

  .approval-tree-node-actions button {
    width: 44px;
    height: 44px;
  }

  .flow-approval-comment-field small,
  .flow-approval-route span,
  .flow-approval-decision-summary small,
  .related-flow-option small,
  .approval-template-list-head small,
  .approval-template-list > button small,
  .flow-section-incomplete-count {
    font-size: 12px;
  }

  .flow-approval-comment-field textarea {
    min-height: 104px;
    font-size: 14px;
  }

  .approval-tree-node-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .server-data-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .server-data-pagination > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .server-data-pagination .table-action {
    min-height: 44px;
  }
}

/* Centralized data export workspace */
.data-export-panel {
  overflow: hidden;
}

.data-export-heading {
  align-items: center;
}

.panel-title .data-export-heading-stats {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.data-export-heading-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid #dbe4ec;
  border-radius: 6px;
  color: #5b6470;
  background: #f6f8fa;
  font-size: 12px;
}

.data-export-heading-stats b {
  color: #0f3476;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.data-export-category-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-top: 1px solid #edf1f4;
  background: #ffffff;
}

.data-export-category-tabs button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-bottom-color: #dbe4ec;
  border-radius: 6px 6px 0 0;
  color: #5b6470;
  background: #f6f8fa;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.data-export-category-tabs button b {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #5b6470;
  background: #e8edf2;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.data-export-category-tabs button.is-active {
  border-color: #b8dbd8;
  border-bottom-color: #ffffff;
  color: #0f3476;
  background: #ffffff;
}

.data-export-category-tabs button.is-active b {
  color: #0f5e5b;
  background: #dff3f1;
}

.data-export-layout {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(270px, 310px) minmax(0, 1fr);
  border-top: 1px solid #dbe4ec;
  background: #ffffff;
}

.data-export-config {
  min-width: 0;
  padding: 15px;
  border-right: 1px solid #dbe4ec;
  background: #f6f8fa;
}

.data-export-section-title {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.data-export-section-title strong {
  color: #1d2129;
  font-size: 13px;
}

.data-export-section-title span {
  color: #6e7681;
  font-size: 11px;
  line-height: 1.5;
}

.data-export-section-title span b {
  color: #0f3476;
  font-variant-numeric: tabular-nums;
}

.data-export-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.data-export-filter-grid label,
.data-export-download-bar label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #3f4d5a;
  font-size: 11px;
  font-weight: 700;
}

.data-export-filter-grid label > span,
.data-export-download-bar label > span {
  display: block;
}

.data-export-filter-grid input,
.data-export-filter-grid select,
.data-export-download-bar input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid #cdd7e1;
  border-radius: 5px;
  color: #1d2129;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
}

.data-export-filter-grid input:focus,
.data-export-filter-grid select:focus,
.data-export-download-bar input:focus {
  border-color: #72c8c4;
  outline: 2px solid rgba(114, 200, 196, 0.2);
  outline-offset: 0;
}

.data-export-filter-grid input:disabled {
  color: #929aa4;
  background: #edf1f4;
}

.data-export-field-wide {
  grid-column: 1 / -1;
}

.data-export-field-wide small {
  color: #6e7681;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
}

.data-export-statuses {
  min-width: 0;
  margin: 13px 0 0;
  padding: 9px;
  border: 1px solid #dbe4ec;
  border-radius: 6px;
  background: #ffffff;
}

.data-export-statuses legend {
  padding: 0 4px;
  color: #3f4d5a;
  font-size: 11px;
  font-weight: 700;
}

.data-export-statuses > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.data-export-statuses label,
.data-export-field-list label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3f4d5a;
  font-size: 11px;
  cursor: pointer;
}

.data-export-statuses label {
  padding: 4px 7px;
  border: 1px solid #dbe4ec;
  border-radius: 5px;
  background: #f9fbfc;
}

.data-export-statuses label:has(input:checked) {
  border-color: #72c8c4;
  color: #0f5e5b;
  background: #e9f7f6;
}

.data-export-statuses input,
.data-export-field-list input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #168985;
}

.data-export-reset {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
}

.data-export-fields-title {
  margin-top: 17px;
}

.data-export-field-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  margin: -31px 0 8px;
}

.data-export-field-actions button {
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid #cdd7e1;
  border-radius: 5px;
  color: #0f3476;
  background: #ffffff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.data-export-field-list {
  max-height: 225px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 7px;
  padding: 7px;
  overflow: auto;
  border: 1px solid #dbe4ec;
  border-radius: 6px;
  background: #ffffff;
}

.data-export-field-list label {
  min-width: 0;
  min-height: 28px;
  padding: 4px;
  border-radius: 4px;
}

.data-export-field-list label:hover,
.data-export-field-list label:has(input:checked) {
  color: #0f3476;
  background: #edf7f6;
}

.data-export-field-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-export-preview {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #ffffff;
}

.data-export-preview-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #e4e9ee;
}

.data-export-preview-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.data-export-preview-head strong {
  color: #0f3476;
  font-size: 14px;
}

.data-export-preview-head span {
  color: #6e7681;
  font-size: 11px;
}

.data-export-preview-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 5px;
  color: #0f5e5b !important;
  background: #e9f7f6;
}

.data-export-preview-count b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

[data-export-preview-table] {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.data-export-table-scroll {
  width: 100%;
  height: 100%;
  max-height: 510px;
  overflow: auto;
}

.data-export-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.data-export-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  min-width: 108px;
  white-space: nowrap;
  background: #edf2f7;
}

.data-export-table td {
  max-width: 280px;
  color: #1d2129;
  white-space: normal;
  overflow-wrap: anywhere;
}

.data-export-preview-note {
  margin: 0;
  padding: 7px 12px;
  border-top: 1px solid #e4e9ee;
  color: #6e7681;
  background: #f6f8fa;
  font-size: 11px;
}

.data-export-empty {
  min-height: 320px;
  display: grid;
  place-items: center;
}

.data-export-download-bar {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid #dbe4ec;
  background: #f6f8fa;
}

.data-export-download-bar label {
  width: min(380px, 55%);
}

.data-export-download-bar > div {
  display: flex;
  gap: 7px;
}

.data-export-download-bar .table-action {
  min-height: 36px;
}

@media (max-width: 980px) {
  .data-export-layout {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  }

  .data-export-field-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .data-export-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .data-export-heading-stats {
    width: 100%;
  }

  .data-export-heading-stats span {
    flex: 1;
    justify-content: center;
  }

  .data-export-category-tabs {
    padding: 8px 10px 0;
  }

  .data-export-category-tabs button {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }

  .data-export-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .data-export-config {
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #dbe4ec;
  }

  .data-export-filter-grid {
    grid-template-columns: 1fr;
  }

  .data-export-field-wide {
    grid-column: auto;
  }

  .data-export-filter-grid input,
  .data-export-filter-grid select,
  .data-export-reset,
  .data-export-field-actions button,
  .data-export-download-bar input,
  .data-export-download-bar .table-action {
    min-height: 44px;
  }

  .data-export-field-actions {
    margin: 0 0 8px;
    justify-content: stretch;
  }

  .data-export-field-actions button {
    flex: 1;
  }

  .data-export-field-list {
    max-height: 240px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-export-field-list label {
    min-height: 40px;
  }

  .data-export-table-scroll {
    max-height: 430px;
  }

  .data-export-download-bar {
    align-items: stretch;
    flex-direction: column;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .data-export-download-bar label {
    width: 100%;
  }

  .data-export-download-bar > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-export-empty {
    min-height: 180px;
  }
}

/* Approval decision surface: key facts first, supporting evidence second. */
.flow-record-preview-panel.is-approval-mode {
  width: min(1280px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-color: #cfd9e3;
  background: #f6f8fa;
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
  min-height: 76px;
  padding: 12px 18px;
  border-bottom: 0;
  color: #ffffff;
  background: #0f3476;
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head span,
.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head small {
  color: rgba(255, 255, 255, 0.76);
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head span {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head small {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head button {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.36);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-head button:hover {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.18);
}

.flow-record-preview-panel.is-approval-mode > .flow-record-preview-layout {
  min-height: 0;
  overflow: auto;
  background: #f6f8fa;
  scrollbar-gutter: stable;
}

.flow-record-preview-panel.is-approval-mode .flow-record-preview-layout.has-approval-workbench {
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 0;
}

.flow-record-preview-panel.is-approval-mode .flow-record-preview-main {
  min-width: 0;
  background: #f6f8fa;
}

.flow-approval-focus {
  display: grid;
  gap: 14px;
  margin: 18px 20px 14px;
  padding: 18px;
  border: 1px solid #dce3ea;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 52, 118, 0.05);
}

.flow-approval-focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e9ee;
}

.flow-approval-focus-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.flow-approval-focus-head span,
.flow-approval-primary > span,
.flow-approval-basis span,
.flow-approval-risk-banner span {
  color: #0f3476;
  font-size: 11px;
  font-weight: 750;
}

.flow-approval-focus-head strong {
  color: #1d2129;
  font-size: 15px;
}

.flow-approval-focus-head em {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid #b8dcda;
  border-radius: 4px;
  color: #246663;
  background: #edf8f7;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.flow-approval-focus-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  align-items: stretch;
}

.flow-approval-primary {
  min-width: 0;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: 8px 22px 8px 4px;
  border-right: 1px solid #dce3ea;
}

.flow-approval-primary strong {
  margin: 5px 0 4px;
  overflow-wrap: anywhere;
  color: #0f3476;
  font-size: 29px;
  font-weight: 760;
  line-height: 1.15;
}

.flow-approval-primary.is-object strong {
  font-size: 21px;
  line-height: 1.35;
}

.flow-approval-primary small {
  color: #6e7681;
  font-size: 11px;
  line-height: 1.5;
}

.flow-approval-key-facts {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding-left: 22px;
}

.flow-approval-key-facts > div {
  min-width: 0;
  padding: 5px 12px 9px 0;
}

.flow-approval-key-facts > div:nth-child(n + 3) {
  padding-top: 10px;
  border-top: 1px solid #edf0f3;
}

.flow-approval-key-facts dt,
.flow-approval-key-facts dd {
  margin: 0;
}

.flow-approval-key-facts dt {
  margin-bottom: 4px;
  color: #6e7681;
  font-size: 10px;
}

.flow-approval-key-facts dd {
  overflow-wrap: anywhere;
  color: #1d2129;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.flow-approval-risk-banner {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  padding: 11px 13px;
  border: 1px solid #f1d39c;
  border-left: 4px solid #ffab40;
  border-radius: 5px;
  background: #fff8ed;
}

.flow-approval-risk-banner.is-high {
  border-color: #efb7b4;
  border-left-color: #e53935;
  background: #fff4f3;
}

.flow-approval-risk-banner.is-clear {
  border-color: #b9ddda;
  border-left-color: #72c8c4;
  background: #eff9f8;
}

.flow-approval-risk-banner > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
}

.flow-approval-risk-banner > div strong {
  color: #784915;
  font-size: 13px;
  line-height: 1.45;
}

.flow-approval-risk-banner.is-high > div strong {
  color: #a42c29;
}

.flow-approval-risk-banner.is-clear > div strong {
  color: #246663;
}

.flow-approval-risk-banner ul {
  min-width: 0;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-approval-risk-banner li {
  position: relative;
  padding-left: 13px;
  color: #5e4a31;
  font-size: 11px;
  line-height: 1.5;
}

.flow-approval-risk-banner li::before {
  position: absolute;
  top: 7px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffab40;
  content: "";
}

.flow-approval-risk-banner li.is-high {
  color: #9e302d;
}

.flow-approval-risk-banner li.is-high::before {
  background: #e53935;
}

.flow-approval-risk-banner.is-clear li {
  color: #355e5c;
}

.flow-approval-risk-banner.is-clear li::before {
  background: #72c8c4;
}

.flow-approval-basis {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  gap: 18px;
  padding-top: 2px;
}

.flow-approval-basis > div {
  min-width: 0;
}

.flow-approval-basis > div + div {
  padding-left: 18px;
  border-left: 1px solid #e5e9ee;
}

.flow-approval-basis p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #343a40;
  font-size: 12px;
  line-height: 1.65;
}

.flow-record-preview-panel.is-approval-mode .dashboard-preview-table {
  min-height: 0;
  padding: 0 20px 24px;
  overflow: visible;
}

.flow-record-preview-panel.is-approval-mode .dashboard-preview-table > .flow-section-title {
  margin-top: 18px;
  padding: 0 0 8px;
  border-bottom: 1px solid #dce3ea;
  color: #0f3476;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.flow-record-preview-panel.is-approval-mode .dashboard-preview-table > .flow-section-title:first-child {
  margin-top: 0;
}

.flow-record-preview-panel.is-approval-mode .dashboard-preview-table .data-table-shell,
.flow-record-preview-panel.is-approval-mode .dashboard-preview-table > .empty-state {
  border: 1px solid #dfe5eb;
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: #ffffff;
}

.flow-approval-workbench {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100dvh - 116px);
  max-height: calc(100dvh - 116px);
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 18px;
  margin: 0;
  padding: 20px;
  border: 0;
  border-left: 1px solid #d8e0e7;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  overflow-y: auto;
}

.flow-approval-workbench-head {
  padding-bottom: 13px;
  border-bottom: 1px solid #e3e8ed;
}

.flow-approval-workbench-head span {
  color: #6e7681;
  font-size: 11px;
}

.flow-approval-workbench-head strong {
  color: #1d2129;
  font-size: 16px;
}

.flow-approval-workbench-head em {
  border-color: #efcb8c;
  border-radius: 4px;
  color: #84500b;
  background: #fff6e7;
}

.flow-approval-progress {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
}

.flow-approval-progress > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.flow-approval-progress span,
.flow-approval-progress small {
  color: #6e7681;
  font-size: 10px;
}

.flow-approval-progress strong {
  overflow-wrap: anywhere;
  color: #0f3476;
  font-size: 14px;
}

.flow-approval-progress > b {
  align-self: start;
  padding: 4px 6px;
  border-radius: 4px;
  color: #246663;
  background: #edf8f7;
  font-size: 10px;
}

.flow-approval-progress-track {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8edf2;
}

.flow-approval-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #72c8c4;
}

.flow-approval-progress p {
  grid-column: 1 / -1;
  margin: 0;
  color: #53606d;
  font-size: 11px;
  line-height: 1.5;
}

.flow-approval-comment-field {
  align-content: start;
  gap: 7px;
}

.flow-approval-comment-field > span {
  color: #1d2129;
  font-size: 12px;
}

.flow-approval-comment-field textarea {
  min-height: 132px;
  border-color: #c8d2dc;
  border-radius: 5px;
  color: #1d2129;
  line-height: 1.6;
}

.flow-approval-comment-field textarea:focus {
  border-color: #72c8c4;
  outline: 3px solid rgba(114, 200, 196, 0.2);
}

.flow-approval-comment-field small {
  color: #6e7681;
  font-size: 10px;
}

.flow-approval-actions {
  position: sticky;
  bottom: -20px;
  z-index: 2;
  align-self: end;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 -20px -20px;
  padding: 14px 20px 20px;
  border-top: 1px solid #e3e8ed;
  background: #ffffff;
}

.flow-approval-actions .table-action {
  min-height: 40px;
  border-radius: 5px;
}

.flow-approval-actions .primary {
  grid-column: 1 / -1;
  min-height: 44px;
  border-color: #0f3476;
  background: #0f3476;
  font-weight: 750;
}

.flow-approval-actions .primary:hover {
  border-color: #0b285d;
  background: #0b285d;
}

@media (max-width: 1040px) {
  .flow-record-preview-panel.is-approval-mode .flow-record-preview-layout.has-approval-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-approval-workbench {
    position: static;
    order: -1;
    height: auto;
    max-height: none;
    min-height: 0;
    grid-template-columns: minmax(220px, 0.7fr) minmax(260px, 1fr);
    grid-template-rows: auto auto auto;
    margin: 0;
    padding: 16px 18px;
    border-left: 0;
    border-bottom: 1px solid #d8e0e7;
    overflow: visible;
  }

  .flow-approval-workbench-head,
  .flow-approval-actions {
    grid-column: 1 / -1;
  }

  .flow-approval-actions {
    position: static;
    margin: 0;
    padding: 14px 0 0;
  }

  .flow-approval-comment-field textarea {
    min-height: 96px;
  }
}

@media (max-width: 760px) {
  .flow-record-preview-panel.is-approval-mode {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 68px;
    padding: 9px 10px;
  }

  .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head strong {
    max-width: calc(100vw - 88px);
    font-size: 15px;
  }

  .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head small {
    max-width: calc(100vw - 88px);
  }

  .flow-approval-workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 13px;
    padding: 13px 12px;
  }

  .flow-approval-workbench-head,
  .flow-approval-actions {
    grid-column: auto;
  }

  .flow-approval-focus {
    gap: 12px;
    margin: 12px 10px;
    padding: 13px 12px;
  }

  .flow-approval-focus-head {
    gap: 10px;
  }

  .flow-approval-focus-head strong {
    font-size: 13px;
  }

  .flow-approval-focus-grid,
  .flow-approval-risk-banner,
  .flow-approval-basis {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow-approval-primary {
    padding: 2px 0 12px;
    border-right: 0;
    border-bottom: 1px solid #dce3ea;
  }

  .flow-approval-primary strong {
    font-size: 25px;
  }

  .flow-approval-primary.is-object strong {
    font-size: 18px;
  }

  .flow-approval-key-facts {
    padding: 0;
  }

  .flow-approval-key-facts > div {
    padding: 8px 8px 8px 0;
  }

  .flow-approval-key-facts > div:nth-child(n + 3) {
    padding-top: 8px;
  }

  .flow-approval-risk-banner {
    gap: 8px;
  }

  .flow-approval-basis {
    gap: 12px;
  }

  .flow-approval-basis > div + div {
    padding: 12px 0 0;
    border-top: 1px solid #e5e9ee;
    border-left: 0;
  }

  .flow-record-preview-panel.is-approval-mode .dashboard-preview-table {
    padding: 0 10px 18px;
  }

  .flow-approval-comment-field textarea {
    min-height: 88px;
    font-size: 14px;
  }

  .flow-approval-actions .table-action {
    min-height: 44px;
  }
}
