/* Enterprise UX authority
 * A single final layer for frame geometry, type, tables, forms, approvals,
 * responsive behavior, and dark-mode contrast. Business markup stays intact.
 */

:root {
  --enterprise-sidebar: 216px;
  --enterprise-subnav: 176px;
  --enterprise-header: 56px;
  --enterprise-tabs: 38px;
  --enterprise-content: 1440px;
  --enterprise-workbench: 1136px;
  --enterprise-bg: #f4f6f8;
  --enterprise-surface: #ffffff;
  --enterprise-surface-muted: #f7f9fb;
  --enterprise-surface-strong: #eef2f6;
  --enterprise-sidebar-bg: #0f3476;
  --enterprise-sidebar-active: #19498f;
  --enterprise-sidebar-hover: #173f7f;
  --enterprise-accent: #146fe8;
  --enterprise-accent-soft: #eaf3ff;
  --enterprise-teal: #318f8b;
  --enterprise-warning: #b96716;
  --enterprise-danger: #c93632;
  --enterprise-text: #1d2733;
  --enterprise-text-secondary: #526170;
  --enterprise-text-tertiary: #5f6d7b;
  --enterprise-border: #d7dde5;
  --enterprise-border-soft: #e8ecf1;
  --enterprise-row-hover: #f2f7fd;
  --enterprise-shadow: 0 1px 2px rgba(16, 35, 58, 0.06), 0 8px 24px rgba(16, 35, 58, 0.04);
  --enterprise-focus: 0 0 0 3px rgba(20, 111, 232, 0.22);

  --reference-sidebar: var(--enterprise-sidebar);
  --reference-header: var(--enterprise-header);
  --reference-tabs: var(--enterprise-tabs);
  --reference-content-max: var(--enterprise-content);
  --reference-canvas: var(--enterprise-bg);
  --reference-surface: var(--enterprise-surface);
  --reference-surface-subtle: var(--enterprise-surface-muted);
  --reference-surface-strong: var(--enterprise-surface-strong);
  --reference-sidebar-bg: var(--enterprise-sidebar-bg);
  --reference-sidebar-active: var(--enterprise-sidebar-active);
  --reference-sidebar-hover: var(--enterprise-sidebar-hover);
  --reference-accent: var(--enterprise-accent);
  --reference-action-solid: var(--enterprise-accent);
  --reference-accent-soft: var(--enterprise-accent-soft);
  --reference-secondary: var(--enterprise-teal);
  --reference-warning: var(--enterprise-warning);
  --reference-danger: var(--enterprise-danger);
  --reference-text: var(--enterprise-text);
  --reference-text-secondary: var(--enterprise-text-secondary);
  --reference-text-tertiary: var(--enterprise-text-tertiary);
  --reference-border: var(--enterprise-border);
  --reference-border-soft: var(--enterprise-border-soft);
  --reference-row-hover: var(--enterprise-row-hover);
  --reference-shadow: var(--enterprise-shadow);
  --reference-focus: var(--enterprise-focus);
}

/* Compact project preview: keep record details scannable without a long single-column sheet. */
body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-preview-overview {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
  align-items: start;
  gap: 10px;
  margin-bottom: 10px;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel :is(.project-preview-details, .project-preview-attachments) {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--enterprise-border);
  border-radius: 6px;
  background: var(--enterprise-surface);
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-preview-overview .flow-section-title {
  min-height: 34px;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--enterprise-border);
  font-size: 13px;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact > .summary-row {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(76px, 0.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border-right: 1px solid var(--enterprise-border-soft);
  border-bottom: 1px solid var(--enterprise-border-soft);
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact > .summary-row.is-wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(96px, 0.16fr) minmax(0, 1fr);
  border-right: 0;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact > .summary-row > span {
  min-width: 0;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.3;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact > .summary-row > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--enterprise-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-preview-attachments .empty-state {
  min-height: 56px;
  padding: 10px;
}

body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-preview-attachments .flow-attachment-file-list {
  margin: 0;
  padding: 8px;
}

@media (max-width: 1100px) and (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-preview-overview,
  body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact > .summary-row,
  body[data-ui-theme="macos-workspace-v3"] .project-preview-panel .project-summary-compact > .summary-row.is-wide {
    grid-column: auto;
    grid-template-columns: 104px minmax(0, 1fr);
    border-right: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-actions {
    display: flex;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  body[data-ui-theme="macos-workspace-v3"] .project-preview-panel > .dashboard-preview-actions .table-action {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 42px;
    white-space: nowrap;
  }
}

:root[data-color-scheme="dark"] {
  --enterprise-bg: #11161d;
  --enterprise-surface: #1b222c;
  --enterprise-surface-muted: #222b36;
  --enterprise-surface-strong: #2a3441;
  --enterprise-sidebar-bg: #091f48;
  --enterprise-sidebar-active: #19498f;
  --enterprise-sidebar-hover: #143766;
  --enterprise-accent: #78b3ff;
  --enterprise-accent-soft: rgba(120, 179, 255, 0.16);
  --enterprise-teal: #7fd4cf;
  --enterprise-warning: #ffc17d;
  --enterprise-danger: #ff8b8b;
  --enterprise-text: #f3f6f9;
  --enterprise-text-secondary: #c6cfda;
  --enterprise-text-tertiary: #a7b2bf;
  --enterprise-border: #414d5d;
  --enterprise-border-soft: #303b48;
  --enterprise-row-hover: #26364a;
  --enterprise-shadow: 0 1px 2px rgba(0, 0, 0, 0.34), 0 10px 28px rgba(0, 0, 0, 0.18);
  --enterprise-focus: 0 0 0 3px rgba(120, 179, 255, 0.3);
}

body[data-ui-theme="macos-workspace-v3"] {
  color: var(--enterprise-text);
  background: var(--enterprise-bg);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

body[data-ui-theme="macos-workspace-v3"] :is(button, input, select, textarea) {
  letter-spacing: 0;
}

body[data-ui-theme="macos-workspace-v3"] :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--enterprise-accent);
  outline-offset: 2px;
  box-shadow: var(--enterprise-focus);
}

body[data-ui-theme="macos-workspace-v3"] .skip-to-content {
  color: #ffffff !important;
  background: #0b357a !important;
}

body[data-ui-theme="macos-workspace-v3"] .skip-to-content:not(:focus):not(:focus-visible) {
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  padding: 0 !important;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  transform: none;
}

body[data-ui-theme="macos-workspace-v3"] .skip-to-content:focus,
body[data-ui-theme="macos-workspace-v3"] .skip-to-content:focus-visible {
  z-index: 30000;
  width: auto;
  height: auto;
  padding: 8px 12px !important;
  margin: 0;
  overflow: visible;
  clip-path: none;
  transform: translate(-50%, 0);
  color: #ffffff !important;
  background: #0b357a !important;
  border: 2px solid #ffffff;
}

.login-password-toggle,
.login-password-toggle span {
  color: #34465a;
}

/* Stable application frame */
body[data-ui-theme="macos-workspace-v3"] .erp-shell {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  grid-template-columns: var(--enterprise-sidebar) minmax(0, 1fr);
  grid-template-rows: var(--enterprise-header) minmax(0, 1fr);
  overflow: hidden;
  background: var(--enterprise-bg);
}

body[data-ui-theme="macos-workspace-v3"] .app-header {
  height: var(--enterprise-header);
  min-height: var(--enterprise-header);
  max-height: var(--enterprise-header);
  grid-template-columns: var(--enterprise-sidebar) minmax(0, 1fr);
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border-bottom: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] .app-header-brand,
body[data-ui-theme="macos-workspace-v3"] .app-header-workspace,
body[data-ui-theme="macos-workspace-v3"] .brand,
body[data-ui-theme="macos-workspace-v3"] .topbar,
body[data-ui-theme="macos-workspace-v3"] .app-header .topbar.is-compact {
  height: var(--enterprise-header);
  min-height: var(--enterprise-header);
  max-height: var(--enterprise-header);
}

body[data-ui-theme="macos-workspace-v3"] .app-header-brand {
  padding: 0 16px;
  background: var(--enterprise-sidebar-bg);
}

body[data-ui-theme="macos-workspace-v3"] .brand {
  gap: 10px;
}

body[data-ui-theme="macos-workspace-v3"] .brand img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

body[data-ui-theme="macos-workspace-v3"] .brand strong {
  max-width: 142px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .app-header .topbar.is-compact {
  grid-template-columns: minmax(180px, 0.7fr) minmax(320px, 720px) minmax(84px, auto);
  gap: 16px;
  padding: 0 20px;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-context {
  min-width: 0;
  gap: 8px;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-context strong {
  overflow: hidden;
  color: var(--enterprise-text);
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-context span {
  overflow: hidden;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .global-search > input {
  height: 38px;
  min-height: 38px;
  padding: 0 14px !important;
  color: var(--enterprise-text);
  background: var(--enterprise-surface-muted);
  border: 1px solid var(--enterprise-border);
  border-radius: 7px;
  font-size: 13px;
}

body[data-ui-theme="macos-workspace-v3"] .global-search > input::placeholder {
  color: var(--enterprise-text-tertiary);
  opacity: 1;
}

body[data-ui-theme="macos-workspace-v3"] .global-search > input:hover {
  border-color: #aeb9c7;
}

body[data-ui-theme="macos-workspace-v3"] .user-name-button.user-avatar-button,
body[data-ui-theme="macos-workspace-v3"] :is(.user-toolbar-avatar, .user-toolbar-avatar img, .user-toolbar-avatar-fallback, #user-toolbar-avatar-fallback) {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  border-radius: 50% !important;
}

body[data-ui-theme="macos-workspace-v3"] .user-name-button.user-avatar-button {
  border: 1px solid var(--enterprise-border) !important;
  background: var(--enterprise-surface) !important;
  box-shadow: 0 1px 2px rgba(14, 32, 54, 0.12);
}

body[data-ui-theme="macos-workspace-v3"] :is(.user-toolbar-avatar-fallback, #user-toolbar-avatar-fallback) {
  color: #ffffff !important;
  background: #0f5fc4 !important;
}

/* Inline expandable navigation */
body[data-ui-theme="macos-workspace-v3"] .erp-sidebar {
  width: var(--enterprise-sidebar);
  min-width: var(--enterprise-sidebar);
  max-width: var(--enterprise-sidebar);
  height: calc(100dvh - var(--enterprise-header));
  padding: 0;
  overflow: hidden;
  background: var(--enterprise-sidebar-bg);
  border-right: 0;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  display: block;
  padding: 12px 10px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav-group {
  display: grid;
  gap: 3px;
  margin: 0 0 14px;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav-title {
  display: block;
  min-height: 22px;
  padding: 4px 10px 3px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav-branch {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 2px;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view] {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view]:hover {
  color: #ffffff;
  background: var(--enterprise-sidebar-hover);
}

body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view]:is(.is-active, [aria-current="page"]) {
  color: #ffffff;
  background: var(--enterprise-sidebar-active);
  box-shadow: inset 3px 0 0 #72c8c4;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view]::before {
  width: 20px;
  min-width: 20px;
  height: 20px;
  opacity: 0.86;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-ui-theme="macos-workspace-v3"] .module-nav-chevron {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.62);
}

body[data-ui-theme="macos-workspace-v3"] .module-subnav {
  position: static;
  inset: auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  display: grid;
  gap: 2px;
  margin: 3px 0 6px;
  padding: 5px 6px 5px 32px;
  overflow: visible;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.055);
  border: 0;
  border-left: 1px solid rgba(114, 200, 196, 0.46);
  border-radius: 0 6px 6px 0;
  box-shadow: none;
}

body[data-ui-theme="macos-workspace-v3"] .module-subnav[hidden] {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] .module-subnav button {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .module-subnav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

body[data-ui-theme="macos-workspace-v3"] .module-subnav button.is-active {
  color: #ffffff;
  background: rgba(114, 200, 196, 0.16);
}

/* Main workspace and tabs */
body[data-ui-theme="macos-workspace-v3"] .erp-main {
  min-width: 0;
  max-width: none;
  height: calc(100dvh - var(--enterprise-header));
  padding: 0;
  overflow: auto;
  background: var(--enterprise-bg);
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 220);
  width: 100%;
  height: var(--enterprise-tabs);
  min-height: var(--enterprise-tabs);
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0 20px;
  overflow-x: auto;
  overflow-y: hidden;
  color: var(--enterprise-text-secondary);
  background: var(--enterprise-surface);
  border-bottom: 1px solid var(--enterprise-border);
  scrollbar-width: thin;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tab {
  flex: 0 0 auto;
  height: var(--enterprise-tabs);
  border-right: 1px solid var(--enterprise-border-soft);
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs button {
  color: var(--enterprise-text-secondary);
  font-size: 13px;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tabs .workspace-tab-activate {
  max-width: 220px;
  padding: 0 10px 0 12px;
}

body[data-ui-theme="macos-workspace-v3"] .workspace-tab.is-active,
body[data-ui-theme="macos-workspace-v3"] .workspace-tab:has(.workspace-tab-activate[aria-current="page"]) {
  background: var(--enterprise-accent-soft);
  box-shadow: inset 0 -2px 0 var(--enterprise-accent);
}

body[data-ui-theme="macos-workspace-v3"] .view-root {
  width: min(var(--enterprise-content), calc(100% - 48px));
  max-width: var(--enterprise-content);
  min-width: 0;
  display: grid;
  gap: 16px;
  margin: 0 auto;
  padding: 22px 0 48px;
}

body[data-ui-theme="macos-workspace-v3"] .view-root > * {
  min-width: 0;
}

body[data-ui-theme="macos-workspace-v3"] .view-root > :is(.workspace-page-head, .workbench-heading) {
  min-height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] .view-root > :is(.workspace-page-head, .workbench-heading) h1 {
  margin: 0;
  color: var(--enterprise-text);
  font-size: 22px;
  font-weight: 720;
  line-height: 1.3;
}

body[data-ui-theme="macos-workspace-v3"] .view-root > :is(.workspace-page-head, .workbench-heading) :is(p, span, small) {
  color: var(--enterprise-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* Consistent framed work surfaces */
body[data-ui-theme="macos-workspace-v3"] .view-root :is(
  .panel,
  .data-table-shell,
  .business-ledger,
  .context-panel,
  .settings-panel,
  .workbench-task-center,
  .workbench-operational-tasks,
  .workbench-recent-activity,
  .workbench-flow-status-bar,
  .dashboard-executive,
  .dashboard-chart-panel,
  .dashboard-detail-drawer
) {
  min-width: 0;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 8px;
  box-shadow: var(--enterprise-shadow);
}

body[data-ui-theme="macos-workspace-v3"] :is(.panel-title, .dashboard-panel-head, .workbench-section-head, .workbench-next-action-head) {
  min-height: 50px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--enterprise-border-soft);
}

body[data-ui-theme="macos-workspace-v3"] :is(.panel-title, .dashboard-panel-head, .workbench-section-head, .workbench-next-action-head) :is(h2, strong) {
  color: var(--enterprise-text);
  font-size: 15px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] :is(.panel-title, .dashboard-panel-head, .workbench-section-head, .workbench-next-action-head) :is(p, span, small) {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

body[data-ui-theme="macos-workspace-v3"] .context-card :is(span, small) {
  color: var(--enterprise-text-secondary) !important;
}

/* Workbench keeps a stable operator width */
body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .workbench-heading) {
  width: min(var(--enterprise-workbench), calc(100% - 48px));
  max-width: var(--enterprise-workbench);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-layout,
body[data-ui-theme="macos-workspace-v3"] .workbench-layout.has-inspector {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 760px) 360px;
  gap: 16px;
  align-items: start;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-layout:not(.has-inspector) {
  grid-template-columns: minmax(0, 1fr);
}

body[data-ui-theme="macos-workspace-v3"] :is(.workbench-primary-column, .workbench-inspector) {
  min-width: 0;
  display: grid;
  gap: 16px;
}

body[data-ui-theme="macos-workspace-v3"] :is(.workbench-next-action-list, .workbench-operational-task-list, .workbench-recent-list) > button {
  min-width: 0;
  min-height: 60px;
  padding: 10px 14px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-operational-task-list > button span {
  min-width: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-operational-task-list > button strong {
  color: var(--enterprise-text);
  font-size: 13px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-operational-task-list > button small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Compact, resizable ledgers */
body[data-ui-theme="macos-workspace-v3"] :is(
  .data-table-shell,
  .schedule-table-wrap,
  .workbench-project-table-scroll,
  .org-table-wrap,
  .reconciliation-table-shell,
  .dashboard-preview-table
) {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

body[data-ui-theme="macos-workspace-v3"] .data-table-shell {
  overflow-x: auto;
}

body[data-ui-theme="macos-workspace-v3"] :is(.data-table, .schedule-editor-table, .payroll-table, .org-directory-table, .org-editor-table) {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  font-size: 13px;
  line-height: 1.45;
}

body[data-ui-theme="macos-workspace-v3"] .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 40px;
  padding: 9px 11px;
  color: var(--enterprise-text-secondary);
  background: var(--enterprise-surface-muted);
  border-right: 1px solid var(--enterprise-border-soft);
  border-bottom: 1px solid var(--enterprise-border);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .data-table tbody td {
  min-height: 44px;
  padding: 9px 11px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border-right: 1px solid var(--enterprise-border-soft);
  border-bottom: 1px solid var(--enterprise-border-soft);
  font-size: 13px;
  line-height: 1.45;
  vertical-align: middle;
}

body[data-ui-theme="macos-workspace-v3"] .data-table tbody tr:hover td {
  background: var(--enterprise-row-hover);
}

body[data-ui-theme="macos-workspace-v3"] .data-table :is(.is-money, [data-type="money"]) {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] .data-table-column-resizer {
  right: 0;
  width: 18px;
  min-width: 18px;
  height: 100%;
  color: transparent;
}

body[data-ui-theme="macos-workspace-v3"] .data-table-pagination {
  min-height: 44px;
  padding: 8px 12px;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .schedule-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--enterprise-border);
  border-radius: 7px;
}

body[data-ui-theme="macos-workspace-v3"] .schedule-editor-table {
  min-width: 1520px;
}

body[data-ui-theme="macos-workspace-v3"] .reconciliation-table-shell :is(.reconciliation-table-downstream, .reconciliation-table-upstream) {
  min-width: 1100px;
}

body[data-ui-theme="macos-workspace-v3"] .ledger-record-link {
  max-width: 100%;
  overflow: hidden;
  color: #125bb5;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .ledger-record-context,
body[data-ui-theme="macos-workspace-v3"] .ledger-record-number,
body[data-ui-theme="macos-workspace-v3"] .table-missing-value {
  color: var(--enterprise-text-secondary);
}

/* Form hierarchy and validation states */
body[data-ui-theme="macos-workspace-v3"] :is(.form-grid, .flow-form .form-grid) {
  gap: 0;
}

body[data-ui-theme="macos-workspace-v3"] :is(.form-grid, .flow-form .form-grid) > label,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field {
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  margin: 0;
  border-right: 1px solid var(--enterprise-border);
  border-bottom: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] :is(.form-grid, .flow-form .form-grid) > label > span,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field > span {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 10px;
  color: var(--enterprise-text-secondary);
  background: var(--enterprise-surface-muted);
  border-right: 1px solid var(--enterprise-border);
  font-size: 13px;
  font-weight: 630;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

body[data-ui-theme="macos-workspace-v3"] :is(.form-grid, .flow-form .form-grid) > label > :is(input, select, textarea, .percent-input-control),
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-trigger {
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
}

body[data-ui-theme="macos-workspace-v3"] :is(.view-root, #erp-flow-launch-dialog, .global-overlay-root) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select
) {
  height: 40px;
  min-height: 40px;
  padding: 0 11px;
  color: var(--enterprise-text);
  background-color: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
}

body[data-ui-theme="macos-workspace-v3"] :is(.view-root, #erp-flow-launch-dialog, .global-overlay-root) textarea {
  min-height: 86px;
  padding: 9px 11px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

body[data-ui-theme="macos-workspace-v3"] :is(.view-root, #erp-flow-launch-dialog, .global-overlay-root) :is(input, textarea)::placeholder {
  color: var(--enterprise-text-tertiary);
  opacity: 1;
}

body[data-ui-theme="macos-workspace-v3"] :is(input, select, textarea):invalid:not(:placeholder-shown),
body[data-ui-theme="macos-workspace-v3"] :is(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--enterprise-danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--enterprise-danger) 18%, transparent);
}

body[data-ui-theme="macos-workspace-v3"] .form-section-label,
body[data-ui-theme="macos-workspace-v3"] .flow-section-title {
  min-height: 40px;
  margin: 10px 0 0;
  padding: 10px 14px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface-strong);
  border-top: 1px solid var(--enterprise-border);
  border-bottom: 1px solid var(--enterprise-border);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

body[data-ui-theme="macos-workspace-v3"] .table-action {
  min-height: 34px;
  padding: 6px 12px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .table-action:hover:not(:disabled) {
  border-color: var(--enterprise-accent);
  background: var(--enterprise-accent-soft);
}

body[data-ui-theme="macos-workspace-v3"] .table-action.primary {
  color: #ffffff;
  background: var(--enterprise-accent);
  border-color: var(--enterprise-accent);
}

body[data-ui-theme="macos-workspace-v3"] .table-action.danger {
  color: var(--enterprise-danger);
  background: color-mix(in srgb, var(--enterprise-danger) 8%, var(--enterprise-surface));
  border-color: color-mix(in srgb, var(--enterprise-danger) 42%, var(--enterprise-border));
}

body[data-ui-theme="macos-workspace-v3"] .table-action:disabled {
  color: var(--enterprise-text-secondary) !important;
  background: var(--enterprise-surface-strong) !important;
  border-color: var(--enterprise-border) !important;
  cursor: not-allowed;
  opacity: 1 !important;
}

body[data-ui-theme="macos-workspace-v3"] .org-role-member button:disabled,
body[data-ui-theme="macos-workspace-v3"] .approval-tree-node-actions button:disabled {
  color: var(--enterprise-text-secondary) !important;
  background: var(--enterprise-surface-strong) !important;
  border-color: var(--enterprise-border) !important;
  cursor: not-allowed;
  opacity: 1 !important;
}

/* Flow editor */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) {
  padding: 18px;
  background: rgba(18, 28, 42, 0.44);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) > .erp-flow-launch-dialog-shell {
  width: min(1120px, calc(100vw - 36px)) !important;
  height: min(920px, calc(100dvh - 36px));
  max-width: 1120px !important;
  max-height: calc(100dvh - 36px);
  margin: auto;
  overflow: hidden;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(7, 18, 34, 0.32);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head {
  min-height: 56px;
  padding: 0 16px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border-bottom: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head h2 {
  color: var(--enterprise-text);
  font-size: 17px;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-body.is-form {
  min-height: 0;
  overflow: hidden;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  height: 100%;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
  width: 100%;
  min-height: 112px;
  padding: 14px 20px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface-muted);
  border-bottom: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading h3 {
  color: var(--enterprise-text);
  font-size: 22px;
  line-height: 1.3;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading p {
  color: var(--enterprise-text-secondary);
  font-size: 13px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px;
  padding: 14px 20px 76px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--enterprise-bg);
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-editor {
  width: 100% !important;
  max-width: 1040px;
  margin: 0 auto;
  min-width: 0;
  overflow: hidden;
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 8px;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-task-rail {
  min-width: 0;
  align-self: start;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-task-rail-card,
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-progress {
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 8px;
}

@media (min-width: 1100px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker):has(#flow-form[data-preferred-kind="projectExpense"]) > .erp-flow-launch-dialog-shell {
    width: min(1416px, calc(100vw - 24px)) !important;
    max-width: 1416px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-form > #flow-form[data-preferred-kind="projectExpense"] {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) #flow-form[data-preferred-kind="projectExpense"] .flow-form-editor {
    max-width: none !important;
  }
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 0;
  border-left: 0;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-section-label {
  grid-column: 1 / -1;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
  min-height: 64px;
  padding: 10px 18px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border-top: 1px solid var(--enterprise-border);
}

/* Approval and record preview */
body[data-ui-theme="macos-workspace-v3"] :is(.dashboard-preview-backdrop, .flow-record-preview-backdrop) {
  padding: 20px;
  background: rgba(15, 25, 38, 0.48);
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode {
  width: min(1180px, calc(100vw - 40px));
  max-width: 1180px;
  max-height: calc(100dvh - 40px);
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(7, 18, 34, 0.34);
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
  min-height: 92px;
  padding: 14px 18px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border-bottom: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block strong {
  color: var(--enterprise-text);
  font-size: 18px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block :is(span, small, p),
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-header-amount :is(span, small) {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-header-amount strong {
  color: var(--enterprise-text);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-preview-layout.has-approval-workbench {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 340px;
  overflow: hidden;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-preview-layout {
  color: var(--enterprise-text);
  background: var(--enterprise-bg) !important;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-preview-main {
  min-width: 0;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--enterprise-text);
  background: var(--enterprise-bg);
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode :is(
  .flow-approval-context-strip,
  .flow-approval-focus,
  .flow-approval-content-section,
  .flow-approval-system-checks,
  .flow-approval-decision-panel
) {
  min-width: 0;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 7px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip > div {
  min-width: 0;
  padding: 11px 12px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip strong {
  overflow: hidden;
  color: var(--enterprise-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip :is(span, small) {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-primary strong {
  color: var(--enterprise-text);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-financial-comparison {
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-financial-comparison > div {
  min-width: 0;
  padding: 10px 12px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-financial-comparison dt {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-financial-comparison dd {
  min-width: 0;
  margin: 3px 0 0;
  overflow: visible;
  color: var(--enterprise-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip strong,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-review-brief dd,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-account-brief dd {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-content-section > header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--enterprise-border-soft);
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-content-section > header strong {
  color: var(--enterprise-text);
  font-size: 15px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-content-section > header span {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-workbench {
  min-width: 0;
  height: 100%;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--enterprise-text);
  background: var(--enterprise-surface-muted);
  border-left: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-workbench :is(dt, span, small, p) {
  color: var(--enterprise-text-secondary);
  font-size: 13px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-workbench :is(dd, strong) {
  color: var(--enterprise-text);
  font-size: 14px;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-actions {
  background: var(--enterprise-surface);
  border-top: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-preview-action-bar {
  color: var(--enterprise-text);
  background: var(--enterprise-surface) !important;
  border-top: 1px solid var(--enterprise-border);
}

/* Light-mode contrast authority for high-frequency operational controls. */
:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-primary-action > span {
  color: #ffffff !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-next-action-check {
  color: #1d6d68 !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-flow-status-overview.is-active span {
  color: #34465a !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-flow-status-group > span {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-flow-status-group:nth-child(1) .workbench-flow-status-button strong {
  color: #0b5fc3 !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-flow-status-group:nth-child(2) .workbench-flow-status-button strong {
  color: #545ec5 !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-flow-status-group:nth-child(3) .workbench-flow-status-button strong {
  color: #247d74 !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .boss-kpi-card small,
  .dashboard-donut-legend small
) {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-calendar-grid button:is(.is-selected, .is-active) {
  color: #ffffff !important;
  background: #146fe8 !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-calendar-grid button:is(.is-selected, .is-active) > span {
  color: #ffffff !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-upload-trigger > span {
  color: #ffffff !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-group-switch button.is-active {
  color: #0b5fc3 !important;
}

:root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main #save-org-departments {
  color: #ffffff !important;
  background: #146fe8 !important;
  border-color: #146fe8 !important;
}

/* Dark-mode legibility for legacy cells that carried fixed light-mode colors. */
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(
  .ledger-record-link,
  .login-audit-ip,
  .data-table summary,
  .amount-link,
  .dashboard-project-picker select
) {
  color: #8ec0ff !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(
  .ledger-record-context,
  .ledger-record-number,
  .table-missing-value,
  .empty-state,
  .data-table-empty-state
) {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(
  .context-card,
  .metric-card,
  .dashboard-preview-metrics > div,
  .flow-approval-financial-comparison,
  .flow-approval-basis,
  .flow-approval-review-brief,
  .flow-approval-account-brief,
  .construction-log-form,
  .construction-log-calendar
) {
  color: var(--enterprise-text);
  background: var(--enterprise-surface) !important;
  border-color: var(--enterprise-border) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(
  .context-card,
  .metric-card,
  .dashboard-preview-metrics > div,
  .flow-approval-financial-comparison,
  .flow-approval-basis,
  .flow-approval-review-brief,
  .flow-approval-account-brief,
  .construction-log-form,
  .construction-log-calendar
) :is(strong, dd, h2, h3) {
  color: var(--enterprise-text) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(
  .context-card,
  .metric-card,
  .dashboard-preview-metrics > div,
  .flow-approval-financial-comparison,
  .flow-approval-basis,
  .flow-approval-review-brief,
  .flow-approval-account-brief,
  .construction-log-form,
  .construction-log-calendar
) :is(span, small, p, dt, label) {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .workbench-section-head,
  .dashboard-cost-result,
  .dashboard-exposure-item,
  .schedule-editor-toolbar,
  .data-table-pagination,
  .construction-log-layout,
  .construction-calendar-grid button
) {
  color: var(--enterprise-text) !important;
  background: var(--enterprise-surface-muted) !important;
  border-color: var(--enterprise-border) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .workbench-section-head,
  .dashboard-cost-result,
  .dashboard-exposure-item,
  .schedule-editor-toolbar
) :is(span, small, p, label) {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .workbench-section-head,
  .dashboard-cost-result,
  .dashboard-exposure-item,
  .schedule-editor-toolbar
) :is(strong, h2, h3) {
  color: var(--enterprise-text) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .workbench-section-head button,
  .dashboard-project-picker button,
  .dashboard-project-picker select
) {
  color: var(--enterprise-accent) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .ledger-record-cell,
  .ledger-party-cell
) :is(strong, b) {
  color: var(--enterprise-text) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .ledger-record-cell :is(small, span),
  .ledger-party-cell :is(small, span),
  .ledger-metric-link span,
  .ledger-static-metric span,
  .ledger-status-cell small,
  .ledger-alert-stack small
) {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .ledger-metric-link strong,
  .ledger-static-metric strong
) {
  color: var(--enterprise-teal) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table td > strong {
  color: var(--enterprise-text) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table td > small {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table td > :is(
  .contract-name-link,
  .ledger-record-link,
  .amount-link
) {
  color: var(--enterprise-accent) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table-pagination strong {
  color: var(--enterprise-text) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-layout {
  background: var(--enterprise-bg) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-calendar-grid button {
  color: var(--enterprise-text) !important;
  background: var(--enterprise-surface-muted) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-calendar-grid button.is-outside-month {
  color: var(--enterprise-text-tertiary) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-calendar-grid button:is(.is-selected, .is-active) {
  color: #071526 !important;
  background: var(--enterprise-accent) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-calendar-grid button:is(.is-selected, .is-active) > span,
:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-primary-action > span {
  color: #071526 !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .dashboard-cost-connector span,
  .dashboard-invoice-row :is(span, small),
  .ledger-alert-link span,
  .construction-log-summary-date small
) {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .dashboard-invoice-row strong,
  .ledger-secondary-stat strong,
  .ledger-status-cell strong,
  .construction-log-summary-date strong
) {
  color: var(--enterprise-text) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .ledger-alert-link strong {
  color: var(--enterprise-accent) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .construction-log-form .form-grid,
  .construction-log-upload-field
) {
  color: var(--enterprise-text);
  background: var(--enterprise-surface-muted) !important;
  border-color: var(--enterprise-border) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-upload-label {
  color: var(--enterprise-text) !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main .construction-log-summary-pending {
  color: var(--enterprise-text-secondary) !important;
}

:root[data-color-scheme="dark"] .login-password-toggle,
:root[data-color-scheme="dark"] .login-password-toggle span {
  color: #45566b;
}

@media (max-width: 1240px) and (min-width: 761px) {
  :root {
    --enterprise-sidebar: 188px;
  }

  body[data-ui-theme="macos-workspace-v3"] .app-header .topbar.is-compact {
    grid-template-columns: minmax(150px, 0.6fr) minmax(260px, 1fr) auto;
    gap: 10px;
    padding-inline: 14px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-layout,
  body[data-ui-theme="macos-workspace-v3"] .workbench-layout.has-inspector {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-task-rail {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --enterprise-header: 56px;
    --enterprise-tabs: 38px;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--enterprise-header) minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .app-header {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .app-header-brand {
    display: none;
  }

  body[data-ui-theme="macos-workspace-v3"] .app-header .topbar.is-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 10px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workspace-context {
    display: none;
  }

  body[data-ui-theme="macos-workspace-v3"] .global-search > input {
    height: 44px;
    min-height: 44px;
    font-size: 14px;
  }

  body[data-ui-theme="macos-workspace-v3"] .user-name-button.user-avatar-button,
  body[data-ui-theme="macos-workspace-v3"] :is(.user-toolbar-avatar, .user-toolbar-avatar img, .user-toolbar-avatar-fallback, #user-toolbar-avatar-fallback) {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main {
    height: calc(100dvh - var(--enterprise-header));
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .workspace-tabs {
    height: 46px;
    min-height: 46px;
    padding: 0 8px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workspace-tabs button {
    min-height: 44px;
    font-size: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workspace-tabs .workspace-tab {
    height: 44px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workspace-tabs .workspace-tab-activate {
    min-height: 44px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workspace-tabs .workspace-tab-close {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table:not(.schedule-editor-table):not(.construction-log-summary-table):not(.reconciliation-table) tbody td {
    width: 100%;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 44px;
    display: grid !important;
    grid-template-columns: minmax(88px, 30%) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table:not(.schedule-editor-table):not(.construction-log-summary-table):not(.reconciliation-table) tbody td::before {
    grid-column: 1;
    grid-row: 1 / span 99;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table:not(.schedule-editor-table):not(.construction-log-summary-table):not(.reconciliation-table) tbody td > :is(strong, small, span, button, a, div, details, input, select) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-column: 2;
    justify-self: stretch;
    overflow: visible;
    text-align: left;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .view-root,
  body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .workbench-heading) {
    width: calc(100% - 16px);
    max-width: none;
    gap: 12px;
    padding: 14px 0 22px;
  }

  body[data-ui-theme="macos-workspace-v3"] .view-root > :is(.workspace-page-head, .workbench-heading) {
    min-height: 52px;
    align-items: flex-start;
    gap: 10px;
    padding: 0 2px 10px;
  }

  body[data-ui-theme="macos-workspace-v3"] .view-root > :is(.workspace-page-head, .workbench-heading) h1 {
    font-size: 20px;
  }

  body[data-ui-theme="macos-workspace-v3"] .view-root > .view-semantic-title {
    position: static !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center;
    margin: 0 !important;
    padding: 6px 2px 8px !important;
    overflow: visible !important;
    clip-path: none !important;
    color: var(--enterprise-text);
    border: 0 !important;
    font-size: 18px !important;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-layout,
  body[data-ui-theme="macos-workspace-v3"] .workbench-layout.has-inspector {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar {
    position: fixed;
    z-index: var(--z-fixed, 400);
    inset: auto 0 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: calc(64px + env(safe-area-inset-bottom));
    overflow: visible;
    background: var(--enterprise-surface) !important;
    border-top: 1px solid var(--enterprise-border);
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2 {
    width: 100%;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 4px 5px;
    overflow: visible;
    background: var(--enterprise-surface) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2 > .module-nav-group {
    display: contents !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2 > .module-nav-group > .module-nav-branch {
    display: contents !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2 > .module-nav-group > .module-nav-title,
  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2 button[data-view]:not([data-mobile-primary]),
  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2 .module-subnav {
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary],
  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav #mobile-more-toggle {
    min-width: 0;
    min-height: 54px;
    color: var(--enterprise-text-secondary) !important;
    font-size: 13px;
    line-height: 1.25;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary] .module-nav-label {
    width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    color: inherit !important;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary] .module-nav-chevron {
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary],
  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav #mobile-more-toggle {
    width: 100%;
    height: 54px;
    max-height: 54px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 2px;
    overflow: hidden;
    text-align: center;
    white-space: normal;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary]::before {
    width: 20px;
    min-width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary]:is(.is-active, [aria-current="page"]) {
    color: var(--enterprise-accent) !important;
    background: var(--enterprise-accent-soft) !important;
    box-shadow: inset 0 2px 0 var(--enterprise-accent);
  }

  :root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav button[data-mobile-primary]:is(.is-active, [aria-current="page"]),
  :root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav #mobile-more-toggle:is(.is-active, [aria-expanded="true"]) {
    color: #0b5fc3 !important;
  }

  :root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .tabs button.is-active {
    color: #0b5fc3 !important;
  }

  :root[data-color-scheme="light"] body[data-ui-theme="macos-workspace-v3"] .erp-main .finance-subnav button.is-active {
    color: #0b5fc3 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main :is(button, summary, select) {
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) {
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2.is-mobile-open {
    inset: auto 8px calc(70px + env(safe-area-inset-bottom)) 8px !important;
    width: auto !important;
    max-height: min(70dvh, 560px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    color: var(--enterprise-text);
    background: var(--enterprise-surface);
    border: 1px solid var(--enterprise-border);
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(8, 24, 44, 0.28);
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2.is-mobile-open > .module-nav-group {
    display: grid !important;
    gap: 3px;
    padding: 6px;
    background: var(--enterprise-surface-muted);
    border: 1px solid var(--enterprise-border-soft);
    border-radius: 7px;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2.is-mobile-open > .module-nav-group > .module-nav-title {
    display: block !important;
    min-height: 24px;
    padding: 3px 7px;
    color: var(--enterprise-text-tertiary);
    font-size: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2.is-mobile-open .module-nav-branch {
    display: contents !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2.is-mobile-open button[data-view] {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    max-height: none;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 9px;
    padding: 8px 10px;
    overflow: visible;
    color: var(--enterprise-text);
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.ui-system-v2.is-mobile-open button[data-view]:not([data-mobile-primary]) {
    display: grid !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.is-mobile-open .module-nav-title {
    color: var(--enterprise-text-tertiary);
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.is-mobile-open button[data-view],
  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.is-mobile-open .module-subnav button {
    min-height: 44px;
    color: var(--enterprise-text);
    background: transparent;
    font-size: 14px;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar .module-nav.is-mobile-open .module-subnav {
    color: var(--enterprise-text);
    background: var(--enterprise-surface-muted);
    border-left-color: var(--enterprise-border);
  }

  body[data-ui-theme="macos-workspace-v3"] .data-table-pagination {
    font-size: 13px;
  }

  body[data-ui-theme="macos-workspace-v3"] .schedule-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body[data-ui-theme="macos-workspace-v3"] .schedule-editor-table {
    width: 1180px !important;
    min-width: 1180px !important;
    display: table !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .schedule-editor-table :is(thead, tbody) {
    display: table-header-group;
  }

  body[data-ui-theme="macos-workspace-v3"] .schedule-editor-table tbody {
    display: table-row-group;
  }

  body[data-ui-theme="macos-workspace-v3"] .schedule-editor-table tr {
    display: table-row !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .schedule-editor-table :is(th, td) {
    display: table-cell !important;
    min-width: 104px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) {
    width: 100vw;
    height: 100dvh;
    padding: 0;
    background: var(--enterprise-surface);
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) > .erp-flow-launch-dialog-shell {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head {
    min-height: calc(54px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 10px 0 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
    min-height: 0;
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading h3 {
    font-size: 20px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-change {
    min-width: 76px;
    min-height: 44px !important;
    font-size: 13px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(
    .line-table-head button,
    .attachment-upload-button,
    .upstream-reference-button
  ) {
    min-height: 44px !important;
    font-size: 13px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-identity input {
    height: 44px !important;
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-layout {
    display: block;
    padding: 10px 10px calc(86px + env(safe-area-inset-bottom));
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-task-rail,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-form-progress {
    display: none;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    border-right: 0;
    gap: 6px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field {
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    border-right: 0;
    gap: 6px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label > span,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label > :is(input, select, textarea, button, .readonly-link) {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field > * {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field > :is(span, input, button, .flow-related-trigger, .flow-related-chips) {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-grid > label > span,
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-related-field > span {
    min-height: 20px;
    justify-content: flex-start;
    padding: 0;
    color: var(--enterprise-text-secondary);
    background: transparent;
    border: 0;
    font-size: 13px;
    text-align: left;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) :is(input, select) {
    height: 44px;
    min-height: 44px;
    border: 1px solid var(--enterprise-border);
    border-radius: 6px;
    font-size: 15px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) textarea {
    min-height: 96px;
    border: 1px solid var(--enterprise-border);
    border-radius: 6px;
    font-size: 15px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .form-actions {
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  }

  body[data-ui-theme="macos-workspace-v3"] :is(.dashboard-preview-backdrop, .flow-record-preview-backdrop) {
    padding: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode > .flow-record-preview-head {
    padding: 10px 12px 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block strong {
    font-size: 18px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-title-block :is(span, small, p),
  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-header-amount :is(span, small) {
    font-size: 13px;
    white-space: normal;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-preview-layout {
    min-height: 0;
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--enterprise-bg) !important;
    padding-bottom: calc(116px + env(safe-area-inset-bottom));
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-record-preview-main {
    width: 100%;
    min-width: 0;
    display: flex !important;
    flex: 0 0 auto;
    flex-direction: column;
    padding: 10px;
    overflow: visible;
    font-size: 14px;
    background: var(--enterprise-bg);
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-document {
    width: 100%;
    min-width: 0;
    display: block !important;
    margin: 0;
    overflow: visible;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip > div {
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--enterprise-border-soft);
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip strong {
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-financial-comparison {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-financial-comparison > div {
    border-right: 0;
    border-bottom: 1px solid var(--enterprise-border-soft);
  }

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-financial-comparison dd {
  font-size: 15px;
  white-space: normal;
}

body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-context-strip strong,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-review-brief dd,
body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-account-brief dd {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-workbench {
    width: 100%;
    height: auto;
    padding: 10px;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid var(--enterprise-border);
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-actions {
    position: fixed !important;
    z-index: 10020;
    inset: auto 0 0 !important;
    width: 100vw;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-actions .table-action {
    min-width: 0;
    min-height: 48px;
    font-size: 15px;
  }

  body[data-ui-theme="macos-workspace-v3"] .flow-record-preview-panel.is-approval-mode .flow-approval-actions .primary {
    grid-column: 1 / -1;
  }
}

/* Unified preview metric band authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel:has(> .dashboard-preview-metrics) {
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-head {
  min-height: 54px;
  padding: 9px 14px;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-head > div:first-child {
  gap: 2px;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-head span {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.3;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  align-content: start;
  background: var(--enterprise-border-soft);
  border-bottom: 1px solid var(--enterprise-border);
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics:has(> .context-card:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics:has(> .context-card:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics:has(> .context-card:nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics:has(> .context-card:nth-child(5):last-child) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics:has(> .context-card:nth-child(6):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics:has(> .context-card:nth-child(7):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card {
  min-width: 0;
  min-height: 78px;
  padding: 10px 14px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 0;
  background: var(--enterprise-surface);
  box-shadow: none;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card > span {
  min-width: 0;
  overflow: hidden;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--enterprise-text);
  font-size: 18px;
  line-height: 1.25;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card > small {
  min-width: 0;
  overflow: hidden;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel:has(> .dashboard-preview-metrics) > :nth-child(3) {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

@media (max-width: 900px) {
  body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics,
  body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-metrics:has(> .context-card:nth-child(n)) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card {
    min-height: 72px;
    padding: 9px 10px;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-preview-panel > .dashboard-preview-metrics > .context-card > strong {
    font-size: 16px;
  }
}

/* Workbench flow preview authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .workbench-flow-preview-only) {
  display: block;
  padding: 24px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only {
  width: min(100%, 1120px);
  margin: 0 auto;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-task-center {
  min-height: min(680px, calc(100dvh - 150px));
  margin: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-next-action-head {
  min-height: 64px;
  padding: 14px 16px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-preview-launch {
  min-width: 88px;
  min-height: 36px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-next-action-list > button {
  min-height: 58px;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .workbench-flow-preview-only) {
    padding: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-task-center {
    min-height: calc(100dvh - 154px);
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-next-action-head {
    align-items: flex-start;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-task-head-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .erp-main .ledger-metric-link {
    height: auto !important;
    min-height: 44px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .ledger-record-link {
    height: auto !important;
    min-height: 44px !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main [data-project-preview] {
    height: auto !important;
    min-height: 60px !important;
    align-content: center;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main [data-project-preview] strong,
  body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-exception-list button span small {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-exception-list button {
    height: auto !important;
    min-height: 60px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-ui-theme="macos-workspace-v3"] *,
  body[data-ui-theme="macos-workspace-v3"] *::before,
  body[data-ui-theme="macos-workspace-v3"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.data-export-filter-error {
  margin: 8px 0 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
}

[data-color-scheme="dark"] .data-export-filter-error {
  color: #ffb4ab;
}

/* Preview, form and workbench boundary authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .party-preview-panel {
  width: min(1320px, calc(100vw - 40px));
  max-width: 1320px;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--enterprise-border);
  background: var(--enterprise-surface);
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics > .context-card {
  min-width: 0;
  min-height: 78px;
  padding: 11px 14px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 0;
  border-right: 1px solid var(--enterprise-border-soft);
  border-radius: 0;
  background: var(--enterprise-surface);
  box-shadow: none;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics > .context-card:last-child {
  border-right: 0;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics > .context-card :is(span, small) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics > .context-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--enterprise-text);
  font-size: 17px;
  line-height: 1.25;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-table {
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--enterprise-bg);
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-layout > :is(.party-preview-summary, .party-preview-projects) {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--enterprise-border);
  border-radius: 6px;
  background: var(--enterprise-surface);
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .flow-section-title {
  min-height: 38px;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--enterprise-border);
  color: var(--enterprise-text);
  background: var(--enterprise-surface-muted);
  font-size: 13px;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .project-summary {
  display: grid;
  gap: 0;
  padding: 0 10px;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .summary-row {
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--enterprise-border-soft);
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .summary-row:last-child {
  border-bottom: 0;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .summary-row > span {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .summary-row > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--enterprise-text);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] :is(.party-project-table-shell, .party-contract-table-shell) {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: auto;
}

body[data-ui-theme="macos-workspace-v3"] .party-project-table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

body[data-ui-theme="macos-workspace-v3"] .party-project-table col:nth-child(1) { width: 30%; }
body[data-ui-theme="macos-workspace-v3"] .party-project-table col:nth-child(2) { width: 10%; }
body[data-ui-theme="macos-workspace-v3"] .party-project-table col:nth-child(3),
body[data-ui-theme="macos-workspace-v3"] .party-project-table col:nth-child(4),
body[data-ui-theme="macos-workspace-v3"] .party-project-table col:nth-child(5) { width: 14%; }
body[data-ui-theme="macos-workspace-v3"] .party-project-table col:nth-child(6) { width: 18%; }

body[data-ui-theme="macos-workspace-v3"] .party-contract-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

body[data-ui-theme="macos-workspace-v3"] .party-contract-table col:nth-child(1) { width: 17%; }
body[data-ui-theme="macos-workspace-v3"] .party-contract-table col:nth-child(2) { width: 22%; }
body[data-ui-theme="macos-workspace-v3"] .party-contract-table col:nth-child(3) { width: 12%; }
body[data-ui-theme="macos-workspace-v3"] .party-contract-table col:nth-child(4) { width: 12%; }
body[data-ui-theme="macos-workspace-v3"] .party-contract-table col:nth-child(5) { width: 11%; }
body[data-ui-theme="macos-workspace-v3"] .party-contract-table col:nth-child(6) { width: 9%; }
body[data-ui-theme="macos-workspace-v3"] .party-contract-table col:nth-child(7) { width: 17%; }

body[data-ui-theme="macos-workspace-v3"] :is(.party-project-table, .party-contract-table) :is(th, td) {
  min-width: 0;
  box-sizing: border-box;
  padding: 7px 9px;
  line-height: 1.4;
  vertical-align: middle;
}

body[data-ui-theme="macos-workspace-v3"] :is(.party-project-table, .party-contract-table) th,
body[data-ui-theme="macos-workspace-v3"] :is(.party-project-table, .party-contract-table) td:not(:first-child):not(:nth-child(2)) {
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] :is(.party-project-table, .party-contract-table) td:first-child,
body[data-ui-theme="macos-workspace-v3"] .party-contract-table td:nth-child(2),
body[data-ui-theme="macos-workspace-v3"] .party-contract-table td:last-child {
  overflow-wrap: anywhere;
  white-space: normal;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-actions {
  min-width: max-content;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-change {
  min-width: 76px;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.2;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.72fr) !important;
  gap: 12px;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-identity {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-template-tools {
  width: 76px;
  min-width: 0;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-template-tools > summary {
  width: 76px;
  min-width: 0 !important;
  box-sizing: border-box;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-number {
  min-width: 0;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-number input {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-operational-task-list > button {
  min-height: 54px;
  padding: 8px 11px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-operational-task-list > button small {
  display: block;
  overflow: hidden;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-operational-tasks:has([data-workbench-operational-toggle][aria-expanded="true"]) .workbench-operational-task-list {
  max-height: 420px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-task-head-actions {
  min-width: max-content;
  flex-wrap: nowrap;
}

@media (max-width: 900px) {
  body[data-ui-theme="macos-workspace-v3"] .party-preview-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-identity {
    width: min(100%, 420px);
    margin-inline: auto;
  }
}

/* Reference-style searchable subnavigation panel 2026-08-26 */
:root {
  --enterprise-sidebar: 156px;
  --enterprise-subnav: 220px;
}

@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .module-nav {
    padding: 12px 0 24px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav-group {
    gap: 2px;
    margin-bottom: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav-title {
    padding-inline: 14px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view] {
    min-height: 44px;
    gap: 10px;
    padding: 0 14px;
    border-radius: 0;
    font-size: 14px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view]:is(.is-active, [aria-current="page"]) {
    background: var(--enterprise-sidebar-active);
    box-shadow: inset 3px 0 0 #72c8c4;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view]::before {
    width: 19px;
    min-width: 19px;
    height: 19px;
    flex-basis: 19px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav {
    width: var(--enterprise-subnav) !important;
    min-width: var(--enterprise-subnav) !important;
    max-width: var(--enterprise-subnav) !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 8px 14px !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--enterprise-text) !important;
    background: var(--enterprise-surface) !important;
    border-right: 1px solid var(--enterprise-border) !important;
    box-shadow: 5px 0 16px rgba(20, 34, 52, 0.1) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav[hidden] {
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav::before {
    content: none !important;
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav-search {
    position: sticky;
    z-index: 2;
    top: 0;
    width: 100%;
    height: 36px;
    min-height: 36px;
    margin: 0 0 6px;
    padding: 0 30px 0 34px !important;
    flex: 0 0 36px;
    color: var(--enterprise-text);
    background-color: var(--enterprise-surface);
    background-image: url("./assets/vendor/lucide-icons/search.svg");
    background-repeat: no-repeat;
    background-position: 11px center;
    background-size: 16px 16px;
    border: 1px solid var(--enterprise-border);
    border-radius: 4px;
    box-shadow: none;
    font-size: 13px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav-search:hover {
    border-color: #aeb9c7;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav-search:focus {
    border-color: var(--enterprise-accent);
    box-shadow: var(--enterprise-focus);
    outline: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    overflow: hidden;
    color: var(--enterprise-text-secondary) !important;
    background: transparent !important;
    border: 0;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 560;
    line-height: 1.35;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button::before {
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    margin: 0;
    opacity: 0.78;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: currentColor !important;
    box-shadow: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button:hover {
    color: var(--enterprise-text) !important;
    background: var(--enterprise-surface-strong) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button:is(.is-active, [aria-current="page"]) {
    color: var(--enterprise-accent) !important;
    background: var(--enterprise-accent-soft) !important;
    box-shadow: inset 3px 0 0 var(--enterprise-accent) !important;
    font-weight: 680;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav.has-no-results::after {
    content: "未找到匹配功能";
    padding: 30px 8px;
    color: var(--enterprise-text-tertiary);
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .party-preview-panel {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics > .context-card:nth-child(2) {
    border-right: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-metrics > .context-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--enterprise-border-soft);
  }

  body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .dashboard-preview-table {
    padding: 8px;
  }

  body[data-ui-theme="macos-workspace-v3"] .party-preview-panel .summary-row {
    grid-template-columns: 92px minmax(0, 1fr);
    padding-inline: 4px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-dialog-actions {
    gap: 6px;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .erp-flow-launch-change {
    min-width: 76px;
    padding-inline: 8px;
  }
}

/* Desktop right-side subnavigation authority 2026-08-26 */
@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .app-header .topbar.is-compact {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 720px) minmax(84px, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .topbar > .global-search {
    grid-column: 2 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .topbar > .topbar-actions {
    grid-column: 3 !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-shell:has(.module-subnav:not([hidden])) {
    grid-template-columns: calc(var(--enterprise-sidebar) + var(--enterprise-subnav)) minmax(0, 1fr) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-shell:has(.module-subnav:not([hidden])) .erp-sidebar {
    width: calc(var(--enterprise-sidebar) + var(--enterprise-subnav)) !important;
    min-width: calc(var(--enterprise-sidebar) + var(--enterprise-subnav)) !important;
    max-width: calc(var(--enterprise-sidebar) + var(--enterprise-subnav)) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-sidebar {
    position: relative;
    overflow: visible;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav {
    width: var(--enterprise-sidebar) !important;
    min-width: var(--enterprise-sidebar) !important;
    max-width: var(--enterprise-sidebar) !important;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav-branch {
    position: static !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav {
    position: absolute !important;
    inset: 0 auto 0 var(--enterprise-sidebar) !important;
    left: var(--enterprise-sidebar) !important;
    width: var(--enterprise-subnav) !important;
    min-width: var(--enterprise-subnav) !important;
    max-width: var(--enterprise-subnav) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 12px 10px !important;
    display: grid;
    align-content: start;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--enterprise-text) !important;
    background: var(--enterprise-surface) !important;
    border: 0 !important;
    border-right: 1px solid var(--enterprise-border) !important;
    border-radius: 0 !important;
    box-shadow: 6px 0 18px rgba(19, 33, 52, 0.12) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav[hidden] {
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav::before {
    content: none !important;
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button {
    min-height: 38px;
    padding: 8px 10px;
    color: var(--enterprise-text-secondary) !important;
    background: transparent !important;
    border: 0;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 560;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button:hover {
    color: var(--enterprise-text) !important;
    background: var(--enterprise-surface-strong) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button:is(.is-active, [aria-current="page"]) {
    color: var(--enterprise-accent) !important;
    background: var(--enterprise-accent-soft) !important;
    box-shadow: inset 3px 0 0 var(--enterprise-accent) !important;
    font-weight: 680;
  }
}

/* Workbench status and cockpit header authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .dashboard-semantic-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-bar {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  margin-bottom: 12px;
  overflow: hidden;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-intro {
  min-height: 88px;
  padding: 12px;
  border-right: 1px solid var(--enterprise-border-soft);
  border-bottom: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-intro strong {
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-groups {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-group {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid var(--enterprise-border-soft);
  border-bottom: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-group:last-child {
  border-right: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-group > div {
  display: grid;
  grid-auto-flow: row !important;
  grid-auto-columns: auto !important;
  grid-template-columns: repeat(3, minmax(70px, 1fr)) !important;
  gap: 4px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-group:last-child > div {
  grid-template-columns: repeat(2, minmax(70px, 1fr)) !important;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-button {
  min-height: 42px;
  gap: 3px;
  padding: 6px 5px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-button small {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-main {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-eyebrow {
  grid-column: auto;
  grid-row: auto;
  flex: 0 0 auto;
  padding: 0;
  color: #ffffff;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-project-picker.compact {
  width: min(48vw, 520px);
  min-width: 320px;
  max-width: 100%;
  height: 32px;
  flex: 0 1 520px;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-project-picker select {
  width: 100%;
  height: 32px;
  padding: 0 30px 0 10px;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-project-picker option {
  color: #1d2129;
  background: #ffffff;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-project-picker select:hover,
body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-project-picker select:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.62);
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-filter-trigger {
  right: 12px;
  width: 7px;
  height: 7px;
  border-color: rgba(255, 255, 255, 0.88);
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-bar {
    display: block;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-intro {
    min-height: 58px;
    border-right: 0;
    border-bottom: 1px solid var(--enterprise-border-soft);
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-group {
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--enterprise-border-soft);
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-group:last-child {
    border-bottom: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title {
    flex-wrap: wrap;
    gap: 7px 10px;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-command-title .dashboard-project-picker.compact {
    width: 100%;
    min-width: 0;
  }
}

/* Final detail-fit authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .module-nav-title {
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-intro > div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 3px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-intro small {
  width: auto;
  max-width: none;
  overflow: visible;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-group > span,
body[data-ui-theme="macos-workspace-v3"] .workbench-flow-preview-only .workbench-flow-status-button small,
body[data-ui-theme="macos-workspace-v3"] .status-pill {
  font-size: 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .dashboard-executive,
  .dashboard-chart-panel,
  .dashboard-project-overview,
  .dashboard-detail-drawer
) small,
body[data-ui-theme="macos-workspace-v3"] .erp-main .dashboard-donut-plot span,
body[data-ui-theme="macos-workspace-v3"] .erp-main .dashboard-trend-legend button,
body[data-ui-theme="macos-workspace-v3"] .erp-main .dashboard-detail-drawer summary > b,
body[data-ui-theme="macos-workspace-v3"] .erp-main .schedule-editor-toolbar label,
body[data-ui-theme="macos-workspace-v3"] .erp-main .finance-period-control label > span,
body[data-ui-theme="macos-workspace-v3"] .erp-main .finance-period-current small,
body[data-ui-theme="macos-workspace-v3"] .erp-main .contract-ledger-summary--three :is(span, small),
body[data-ui-theme="macos-workspace-v3"] .erp-main .workbench-project-table small {
  font-size: 12px !important;
  line-height: 1.4;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-stage-node {
  height: auto !important;
  min-height: 126px;
  overflow: visible;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-stage-node > :is(span, strong, small) {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

body[data-ui-theme="macos-workspace-v3"] .dashboard-panel-head :is(span, small),
body[data-ui-theme="macos-workspace-v3"] .dashboard-chart-bar > :is(strong, span) {
  font-size: 12px;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .table-action {
  height: auto !important;
  min-height: 32px !important;
}

body[data-ui-theme="macos-workspace-v3"] .erp-main .ledger-record-link {
  height: auto;
  min-height: 36px;
  align-items: center;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(
  .user-toolbar-avatar-fallback,
  #user-toolbar-avatar-fallback
) {
  color: #ffffff !important;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] :is(input, textarea)::placeholder {
  color: #b7c0cc !important;
  opacity: 1;
}

:root[data-color-scheme="dark"] body[data-ui-theme="macos-workspace-v3"] .erp-main :is(
  .workbench-task-count,
  .workbench-next-action-empty small,
  .workbench-flow-status-intro small,
  .dashboard-panel-head small,
  .dashboard-panel-head span
) {
  color: #b7c0cc !important;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table:not(.schedule-editor-table):not(.construction-log-summary-table):not(.reconciliation-table) tbody {
    grid-auto-rows: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table:not(.schedule-editor-table):not(.construction-log-summary-table):not(.reconciliation-table) tbody tr {
    height: auto !important;
    grid-auto-rows: auto !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table:not(.schedule-editor-table):not(.construction-log-summary-table):not(.reconciliation-table) tbody td {
    height: auto !important;
    min-height: 44px !important;
    overflow: visible !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .erp-main .data-table:not(.schedule-editor-table):not(.construction-log-summary-table):not(.reconciliation-table) tbody td::before {
    align-self: start;
    grid-row: 1 !important;
    padding-top: 2px;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-stage-node {
    min-height: 140px;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-comparison-scroll {
    width: auto;
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-comparison-bars {
    width: 100%;
    min-width: 0 !important;
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 154px;
    gap: 12px 8px;
    padding: 14px 4px 6px;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-chart-bar {
    width: 100%;
    height: 154px;
    grid-template-rows: 22px minmax(0, 1fr) 34px;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-chart-bar > i {
    width: min(34px, 58%);
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-chart-bar > span {
    line-height: 1.25;
    white-space: normal;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-line-canvas {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  body[data-ui-theme="macos-workspace-v3"] .dashboard-line-canvas svg {
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    display: block;
  }
}

/* Reference-style searchable subnavigation panel 2026-08-26 */
:root {
  --enterprise-sidebar: 156px;
  --enterprise-subnav: 220px;
}

@media (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .module-nav {
    width: var(--enterprise-sidebar) !important;
    min-width: var(--enterprise-sidebar) !important;
    max-width: var(--enterprise-sidebar) !important;
    padding: 12px 0 24px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav-group {
    gap: 2px;
    margin-bottom: 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav-title {
    padding-inline: 14px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view] {
    min-height: 44px;
    gap: 10px;
    padding: 0 14px;
    border-radius: 0;
    font-size: 14px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view]:is(.is-active, [aria-current="page"]) {
    background: var(--enterprise-sidebar-active);
    box-shadow: inset 3px 0 0 #72c8c4;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-nav button[data-view]::before {
    width: 19px;
    min-width: 19px;
    height: 19px;
    flex-basis: 19px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav {
    position: absolute !important;
    inset: 0 auto 0 var(--enterprise-sidebar) !important;
    left: var(--enterprise-sidebar) !important;
    width: var(--enterprise-subnav) !important;
    min-width: var(--enterprise-subnav) !important;
    max-width: var(--enterprise-subnav) !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 10px 8px 14px !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    align-content: start;
    gap: 2px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: var(--enterprise-text) !important;
    background: var(--enterprise-surface) !important;
    border: 0 !important;
    border-right: 1px solid var(--enterprise-border) !important;
    border-radius: 0 !important;
    box-shadow: 5px 0 16px rgba(20, 34, 52, 0.1) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav[hidden] {
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav::before {
    content: none !important;
    display: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav-search {
    position: sticky;
    z-index: 2;
    top: 0;
    width: 100%;
    height: 36px;
    min-height: 36px;
    margin: 0 0 6px;
    padding: 0 30px 0 34px !important;
    flex: 0 0 36px;
    color: var(--enterprise-text);
    background-color: var(--enterprise-surface);
    background-image: url("./assets/vendor/lucide-icons/search.svg");
    background-repeat: no-repeat;
    background-position: 11px center;
    background-size: 16px 16px;
    border: 1px solid var(--enterprise-border);
    border-radius: 4px;
    box-shadow: none;
    font-size: 13px;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav-search:hover {
    border-color: #aeb9c7;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav-search:focus {
    border-color: var(--enterprise-accent);
    box-shadow: var(--enterprise-focus);
    outline: 0;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button {
    width: 100%;
    min-width: 0;
    min-height: 42px !important;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    overflow: hidden;
    color: var(--enterprise-text-secondary) !important;
    background: transparent !important;
    border: 0;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 560;
    line-height: 1.35;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button::before {
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    margin: 0;
    opacity: 0.78;
    border: 0 !important;
    border-radius: 0 !important;
    background-color: currentColor !important;
    box-shadow: none !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button:hover {
    color: var(--enterprise-text) !important;
    background: var(--enterprise-surface-strong) !important;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav > button:is(.is-active, [aria-current="page"]) {
    color: var(--enterprise-accent) !important;
    background: var(--enterprise-accent-soft) !important;
    box-shadow: inset 3px 0 0 var(--enterprise-accent) !important;
    font-weight: 680;
  }

  body[data-ui-theme="macos-workspace-v3"] .module-subnav.has-no-results::after {
    content: "未找到匹配功能";
    padding: 30px 8px;
    color: var(--enterprise-text-tertiary);
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .module-subnav-search {
    display: none !important;
  }
}

/* Flow dialog duplicate-heading removal 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
  min-height: 0 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center;
  padding: 8px 12px !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading {
  display: contents !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-heading > :is(.flow-document-meta, h3, p) {
  display: none !important;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-recovery-banner {
  grid-column: 1 / -1;
  width: 100%;
}

body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-identity {
  width: min(100%, 640px) !important;
  max-width: 640px !important;
  justify-self: end;
  margin: 0 !important;
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-head {
    padding: 8px !important;
  }

  body[data-ui-theme="macos-workspace-v3"] #erp-flow-launch-dialog:not(.is-picker) .flow-document-identity {
    width: 100% !important;
    max-width: none !important;
  }
}

/* Workbench flow window authority 2026-08-26 */
body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .workbench-flow-window) {
  padding: 16px;
  overflow: hidden;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window {
  width: min(100%, 1180px);
  height: min(760px, calc(100dvh - var(--enterprise-header) - var(--enterprise-tabs) - 32px));
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 1px solid var(--enterprise-border);
  border-radius: 8px;
  box-shadow: var(--enterprise-shadow);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window-body {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--enterprise-surface-muted);
  border-right: 1px solid var(--enterprise-border);
  grid-column: 1;
  grid-row: 1;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-head {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--enterprise-border-soft);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-head :is(h1, p),
body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-group h2 {
  margin: 0;
  letter-spacing: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-head h1 {
  color: var(--enterprise-text);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 720;
  text-wrap: balance;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-head p {
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.45;
  text-wrap: pretty;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-status-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-group {
  min-width: 0;
  display: grid;
  gap: 5px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-group h2 {
  padding: 0 8px;
  color: var(--enterprise-text-tertiary);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 650;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-group > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  color: var(--enterprise-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button:hover {
  color: var(--enterprise-text);
  background: var(--enterprise-surface-strong);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button.is-active {
  color: var(--enterprise-accent);
  background: var(--enterprise-accent-soft);
  border-color: color-mix(in srgb, var(--enterprise-accent) 24%, var(--enterprise-border));
  font-weight: 680;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button.is-priority {
  min-height: 44px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border-color: var(--enterprise-border);
  font-weight: 680;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button.is-priority.is-active {
  color: var(--enterprise-accent);
  background: var(--enterprise-accent-soft);
  border-color: color-mix(in srgb, var(--enterprise-accent) 28%, var(--enterprise-border));
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button strong {
  min-width: 24px;
  color: inherit;
  font-size: 13px;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-task-center {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--enterprise-surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-task-center:has(.workbench-next-action-empty) {
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--enterprise-surface);
  border: 0;
  border-bottom: 1px solid var(--enterprise-border-soft);
  box-shadow: none;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-head :is(h2, p) {
  margin: 0;
  letter-spacing: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-head h2 {
  color: var(--enterprise-text);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 720;
  text-wrap: balance;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-head p {
  overflow: hidden;
  color: var(--enterprise-text-secondary);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-task-head-actions span {
  min-width: 48px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  color: var(--enterprise-text-secondary);
  background: var(--enterprise-surface-muted);
  border: 1px solid var(--enterprise-border-soft);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-head,
body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row {
  min-width: 760px;
  display: grid;
  grid-template-columns: 36px minmax(200px, 1.35fr) minmax(150px, 1fr) 78px minmax(96px, 0.7fr) 96px 18px;
  align-items: center;
  gap: 10px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-head {
  min-height: 38px;
  padding: 0 16px;
  color: var(--enterprise-text-tertiary);
  background: var(--enterprise-surface-muted);
  border-bottom: 1px solid var(--enterprise-border);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 650;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-list {
  min-width: 0;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row {
  width: 100%;
  min-height: 64px;
  padding: 8px 16px;
  color: var(--enterprise-text);
  background: var(--enterprise-surface);
  border: 0;
  border-bottom: 1px solid var(--enterprise-border-soft);
  border-radius: 0;
  text-align: left;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-list > .workbench-flow-list-row {
  min-width: 760px;
  min-height: 64px;
  display: grid;
  grid-template-columns: 36px minmax(200px, 1.35fr) minmax(150px, 1fr) 78px minmax(96px, 0.7fr) 96px 18px;
  grid-template-areas: none;
  gap: 10px;
  padding: 8px 16px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row:hover {
  background: var(--enterprise-row-hover);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row:last-child {
  border-bottom: 0;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--enterprise-accent);
  background: var(--enterprise-accent-soft);
  font-size: 12px;
  font-weight: 750;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row :is(
  .workbench-next-action-copy,
  .workbench-next-action-related,
  .workbench-next-action-owner
) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row :is(
  .workbench-next-action-related,
  .workbench-next-action-owner
) small {
  display: none;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row :is(strong, em, small, time) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row strong {
  color: var(--enterprise-text);
  font-size: 13px;
  line-height: 1.4;
  font-style: normal;
  font-weight: 650;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row :is(em, small, time) {
  color: var(--enterprise-text-secondary);
  font-size: 11px;
  line-height: 1.4;
  font-style: normal;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .status-pill {
  max-width: 78px;
  justify-self: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-next-action-arrow {
  color: var(--enterprise-text-tertiary);
  font-size: 20px;
  line-height: 1;
  text-align: right;
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-empty {
  min-height: 100%;
  padding: 24px;
  color: var(--enterprise-text-secondary);
  background: var(--enterprise-surface);
}

body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-empty :is(strong, small) {
  color: inherit;
}

@media (max-width: 960px) and (min-width: 761px) {
  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window-body {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-head,
  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row {
    min-width: 680px;
    grid-template-columns: 36px minmax(180px, 1.35fr) minmax(140px, 1fr) 74px 94px 86px 18px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-list > .workbench-flow-list-row {
    min-width: 680px;
    grid-template-columns: 36px minmax(180px, 1.35fr) minmax(140px, 1fr) 74px 94px 86px 18px;
  }
}

@media (max-width: 760px) {
  body[data-ui-theme="macos-workspace-v3"] .view-root:has(> .workbench-flow-window) {
    width: 100%;
    height: calc(100dvh - var(--enterprise-header) - var(--enterprise-tabs) - var(--mobile-bottom-nav-height, 64px) - env(safe-area-inset-bottom));
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window-body {
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-rail {
    display: grid;
    grid-template-rows: auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--enterprise-border);
    grid-column: 1;
    grid-row: 1;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-head {
    min-height: 48px;
    padding: 8px 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-head h1 {
    font-size: 17px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-status-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
    padding: 0 12px 10px;
    overflow: visible;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-group {
    display: contents;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-group h2 {
    display: none;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-group > div {
    display: contents;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button,
  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-filter-button.is-priority {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    gap: 8px;
    padding: 7px 10px;
    color: var(--enterprise-text-secondary);
    background: var(--enterprise-surface);
    border-color: var(--enterprise-border-soft);
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-head {
    min-height: 58px;
    padding: 10px 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-list > .workbench-flow-list-row {
    min-width: 0;
    min-height: 96px;
    grid-template-columns: 36px minmax(0, 1fr) auto 18px;
    grid-template-areas:
      "mark title status arrow"
      ". related related ."
      ". owner date .";
    gap: 5px 8px;
    padding: 10px 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-task-center {
    grid-column: 1;
    grid-row: 2;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-window .workbench-next-action-head p {
    max-width: 64vw;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-head {
    display: none;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row {
    min-width: 0;
    min-height: 96px;
    grid-template-columns: 36px minmax(0, 1fr) auto 18px;
    grid-template-areas:
      "mark title status arrow"
      ". related related ."
      ". owner date .";
    gap: 5px 8px;
    padding: 10px 12px;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-mark {
    grid-area: mark;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-copy {
    grid-area: title;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-related {
    grid-area: related;
    display: block;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-related small,
  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-owner small {
    display: none;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .status-pill {
    grid-area: status;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-owner {
    grid-area: owner;
    display: block;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-date {
    grid-area: date;
    text-align: right;
  }

  body[data-ui-theme="macos-workspace-v3"] .workbench-flow-list-row .workbench-next-action-arrow {
    grid-area: arrow;
  }
}
