/*
 * ORBITA / FAOS Workspace Visual Contract V1
 * Visual-only authority: shared surfaces, controls and typography.
 * Workflow semantics and module-specific layout remain owned by each workspace.
 */
@import url('/faos-design-tokens.css');

:root {
  --ovc-bg: var(--faos-workspace-bg, #f8fafc);
  --ovc-surface: var(--faos-workspace-surface, #fff);
  --ovc-subtle: #f8fafc;
  --ovc-border: var(--faos-workspace-border, #e2e8f0);
  --ovc-border-strong: var(--faos-workspace-border-strong, #cbd5e1);
  --ovc-text: var(--faos-workspace-text, #0f172a);
  --ovc-muted: var(--faos-workspace-muted, #64748b);
  --ovc-accent: var(--faos-workspace-accent, #0d9488);
  --ovc-radius: var(--faos-workspace-card-radius, 12px);
  --ovc-metric-radius: 10px;
  --ovc-control-radius: var(--faos-workspace-control-radius, 8px);
  --ovc-shadow: var(--faos-workspace-card-shadow, 0 1px 2px rgba(15,23,42,.06));
  --ovc-font: var(--faos-font, "Inter", "Segoe UI", system-ui, -apple-system, sans-serif);
}

/* Workspace frame. */
body.office-unified,
body.factory-ops-v2,
body.suppliers-workspace-mode,
body.fp-scope,
body.finance-command-scope,
body.mfg-workspace,
html.orbita-wms-v2-unify body,
body.ops-center-page {
  background: var(--ovc-bg) !important;
  color: var(--ovc-text) !important;
  font-family: var(--ovc-font) !important;
}

/*
 * Primary surfaces only.
 * Do NOT treat generic .panel as a card: several FAOS pages use .panel purely
 * as a layout wrapper, and surfacing it creates double / nested cards.
 */
body.office-unified :is(.card,.office-iac-product-card,.office-rc-card),
body.factory-ops-v2 .card,
body.suppliers-workspace-mode .card,
body.fp-scope :is(.card,.fp-card),
body.finance-command-scope :is(.card,.fp-card),
body.mfg-workspace :is(.mfg-panel,.mfg-overview-zone),
html.orbita-wms-v2-unify :is(.panel,.wms-v2-surface,.snap),
body.ops-center-page .ops-center-card {
  background: var(--ovc-surface) !important;
  border: 1px solid var(--ovc-border) !important;
  border-radius: var(--ovc-radius) !important;
  box-shadow: var(--ovc-shadow) !important;
  color: var(--ovc-text) !important;
}

/* Compact KPI / summary surfaces share geometry, not semantic status color. */
body.office-unified :is(.office-iac-summary__card,.office-rc-lane-btn,.pricing-summary-card),
body.mfg-workspace .mfg-kpi,
html.orbita-wms-v2-unify .wms-inv-snap-kpi {
  border-radius: var(--ovc-metric-radius) !important;
  box-shadow: none !important;
}
body.office-unified :is(.office-iac-summary__card,.office-rc-lane-btn,.pricing-summary-card),
html.orbita-wms-v2-unify .wms-inv-snap-kpi,
body.mfg-workspace .mfg-kpi:not(.mfg-kpi--tone-warn):not(.mfg-kpi--tone-danger):not(.mfg-kpi--tone-ok) {
  background: var(--ovc-subtle) !important;
  border: 1px solid var(--ovc-border) !important;
}

/* Controls: normalize geometry without flattening primary/secondary semantic colors. */
body.office-unified :is(button,.btn,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.factory-ops-v2 :is(button,.btn,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.suppliers-workspace-mode :is(button,.btn,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.fp-scope :is(.fp-btn,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.finance-command-scope :is(.fp-btn,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.mfg-workspace :is(.mfg-btn,.mfg-btn-link,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
html.orbita-wms-v2-unify :is(button,.btn,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.ops-center-page :is(button,.btn,select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])) {
  border-radius: var(--ovc-control-radius) !important;
  font-family: var(--ovc-font) !important;
}

/* Text-entry controls only. Checkboxes/radios/range/file keep native module behavior. */
body.office-unified :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.factory-ops-v2 :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.suppliers-workspace-mode :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.fp-scope :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.finance-command-scope :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.mfg-workspace :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
html.orbita-wms-v2-unify :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])),
body.ops-center-page :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])) {
  background: var(--ovc-surface) !important;
  border: 1px solid var(--ovc-border-strong) !important;
  color: var(--ovc-text) !important;
}

body.office-unified :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus,
body.factory-ops-v2 :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus,
body.suppliers-workspace-mode :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus,
body.fp-scope :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus,
body.finance-command-scope :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus,
body.mfg-workspace :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus,
html.orbita-wms-v2-unify :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus,
body.ops-center-page :is(select,textarea,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])):focus {
  outline: none !important;
  border-color: var(--ovc-accent) !important;
  box-shadow: 0 0 0 3px rgba(13,148,136,.12) !important;
}

:is(body.office-unified,body.factory-ops-v2,body.suppliers-workspace-mode,body.fp-scope,body.finance-command-scope,body.mfg-workspace,body.ops-center-page) :is(h1,h2,h3),
html.orbita-wms-v2-unify :is(h1,h2,h3) {
  color: var(--ovc-text) !important;
}


/* Wave 3: Office home joins the same surface hierarchy. */
body.atlas-office {
  background: var(--ovc-bg);
  color: var(--ovc-text);
  font-family: var(--ovc-font);
}

/* A workspace shell is layout chrome, not another card around all cards. */
body.atlas-office .office-workspace-shell {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
body.atlas-office .office-workspace-head {
  padding: 0 0 10px;
  border-bottom: 0;
  background: transparent;
}
body.atlas-office .office-layout-refined {
  padding: 0;
  gap: 12px;
}

/* Level-1 content surfaces. Semantic inline colors remain authoritative. */
body.atlas-office :is(
  .card:not(.office-workspace-shell),
  .sidebar,
  .detail-panel,
  .summary-card,
  .bi-card,
  .office-pds-card
) {
  border-color: var(--ovc-border);
  border-radius: var(--ovc-radius);
  box-shadow: var(--ovc-shadow);
}

/* Level-2 metric surfaces: compact and quieter than content cards. */
body.atlas-office .office-kpi-card {
  border: 1px solid var(--ovc-border);
  border-radius: var(--ovc-metric-radius);
  background: var(--ovc-subtle);
  box-shadow: none;
}
body.atlas-office .office-t1-async-block {
  border-radius: var(--ovc-metric-radius);
  border-color: var(--ovc-border);
  background: var(--ovc-subtle);
}

/* Navigation is navigation, not a competing card family. */
body.atlas-office .office-nav-rail.sidebar {
  box-shadow: none;
}
body.atlas-office .office-nav-drill {
  border-radius: var(--ovc-control-radius);
  border-color: var(--ovc-border);
  background: var(--ovc-subtle);
}
body.atlas-office .office-nav-drill__item {
  border-radius: var(--ovc-control-radius);
  border-color: var(--ovc-border);
  box-shadow: none;
}

/* Keep core control geometry in the Office home aligned with sub-workspaces. */
body.atlas-office :is(
  button,
  a.btn,
  .btn-primary,
  .secondary,
  select,
  textarea,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"])
) {
  border-radius: var(--ovc-control-radius);
  font-family: var(--ovc-font);
}


/* Wave 3b: remove accidental cardization from generic Office selectors. */
body.office-unified main > header:not(.app-header),
body.office-unified main > section > header:not(.app-header) {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.office-unified main > header:not(.app-header)::after,
body.office-unified main > section > header:not(.app-header)::after {
  content: none !important;
  display: none !important;
}
body.office-unified > header:not(.app-header) {
  padding: 14px 20px 10px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.office-unified > header:not(.app-header)::after {
  content: none !important;
  display: none !important;
}

/* .panel is frequently a layout wrapper. Only .panel.card is a surface. */
body.office-unified .panel:not(.card),
body.factory-ops-v2 .panel:not(.card) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* .search is a label/input wrapper, never a second input surface. */
body.office-unified .search:not(input),
body.factory-ops-v2 .search:not(input),
body.atlas-office .search:not(input) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Status rows are page chrome, not cards. */
body.factory-ops-v2 .status-bar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Office detail content already sits inside a real content surface. */
body.atlas-office .detail-panel > .glass {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}


/* Wave 4: one Back chrome across Office / WMS / Operations surfaces. */
body.office-unified :is(.office-iac-page__back,.office-rc-page__back,.ws-back-link),
body.ops-center-page .ops-center-back,
html.orbita-wms-v2-unify .back-bar > a:first-child {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 32px !important;
  padding: 6px 11px !important;
  border: 1px solid var(--ovc-border-strong) !important;
  border-radius: var(--ovc-control-radius) !important;
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  font-family: var(--ovc-font) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}
body.office-unified :is(.office-iac-page__back,.office-rc-page__back,.ws-back-link):hover,
body.ops-center-page .ops-center-back:hover,
html.orbita-wms-v2-unify .back-bar > a:first-child:hover {
  border-color: var(--ovc-accent) !important;
  background: var(--faos-workspace-accent-subtle, #f0fdfa) !important;
  color: var(--faos-workspace-accent-strong, #0f766e) !important;
}

/* Shared injected topbar: Back/Logout are chrome, never primary business actions. */
body.factory-ops-v2 #faos-topbar .faos-topbar__back,
body.office-unified #faos-topbar .faos-topbar__back {
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  border: 1px solid var(--ovc-border-strong) !important;
  border-radius: var(--ovc-control-radius) !important;
}
body.factory-ops-v2 #faos-topbar .faos-topbar__logout,
body.office-unified #faos-topbar .faos-topbar__logout {
  background: var(--ovc-surface) !important;
  color: var(--ovc-muted) !important;
  border: 1px solid var(--ovc-border) !important;
  border-radius: var(--ovc-control-radius) !important;
}

/* Button hierarchy: neutral by default, explicit primary only for primary actions. */
body.factory-ops-v2 .btn:not(.btn-primary):not(.danger):not(.btn-danger):not(.secondary) {
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  border: 1px solid var(--ovc-border-strong) !important;
  box-shadow: none !important;
}
body.factory-ops-v2 .btn-primary,
body.factory-ops-v2 #btn-new,
body.factory-ops-v2 #btn-save {
  background: var(--ovc-accent) !important;
  color: #ffffff !important;
  border: 1px solid var(--ovc-accent) !important;
}
body.factory-ops-v2 :is(.danger,.btn-danger,#btn-void) {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}

/* Wave 5: route-authority contract for every canonical FAOS workspace response. */
html[data-faos-visual-contract-root="1"] {
  color-scheme: light;
}
html[data-faos-visual-contract-root="1"] body:not(.exec-body):not(.eba-body) {
  background: var(--ovc-bg) !important;
  color: var(--ovc-text) !important;
  font-family: var(--ovc-font) !important;
}

/* Shared content surfaces. Generic layout .panel is intentionally excluded. */
html[data-faos-visual-contract-root="1"] :is(
  .card,
  .fp-card,
  .finance-kpi-card,
  .mgmt-card,
  .summary-card,
  .section-card,
  .metric-card,
  .stat-card,
  .overview-card,
  .office-dash-card,
  .mfg-customer-card,
  .mfg-panel,
  .mfg-overview-zone,
  .wms-hub-snap-card,
  .wms-mc-panel,
  .wms-rd-panel,
  .ow3-card,
  .ow3-kpi-card,
  .faud-card,
  .cfo-card,
  .cfo-panel,
  .glw-card,
  .efr-card,
  .fbk-card,
  .apws-panel,
  .finance-modal-panel,
  .ops-context-card,
  .list-detail-card,
  .inv-compact-card,
  .recv-panel,
  .foc-panel,
  .insp-panel,
  .fie-panel,
  .mal-panel,
  .tr-panel
) {
  border-radius: var(--ovc-radius) !important;
  border-color: var(--ovc-border) !important;
  box-shadow: var(--ovc-shadow) !important;
}

/* Ordinary cards share the neutral white surface; semantic warning/risk cards keep their module color. */
html[data-faos-visual-contract-root="1"] :is(
  .card,
  .fp-card,
  .mgmt-card,
  .summary-card,
  .section-card,
  .metric-card,
  .stat-card,
  .overview-card,
  .office-dash-card,
  .mfg-panel,
  .mfg-overview-zone,
  .wms-hub-snap-card,
  .wms-mc-panel,
  .wms-rd-panel,
  .ow3-card,
  .faud-card,
  .cfo-card,
  .cfo-panel,
  .glw-card,
  .efr-card,
  .fbk-card,
  .apws-panel,
  .finance-modal-panel,
  .ops-context-card,
  .list-detail-card,
  .inv-compact-card,
  .recv-panel,
  .foc-panel,
  .insp-panel,
  .fie-panel,
  .mal-panel,
  .tr-panel
):not([class*="warn"]):not([class*="danger"]):not([class*="risk"]):not([class*="error"]):not([class*="success"]):not([class*="tone-"]) {
  background-color: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
}

/* KPI / metric geometry: compact, quiet, repeatable. */
html[data-faos-visual-contract-root="1"] :is(
  .finance-kpi-card,
  .mfg-kpi,
  .wms-inv-snap-kpi,
  .wms-mc-kpi,
  .wms-audit-kpi,
  .ow3-kpi-card,
  .atlas-metric-card,
  .mgmt-kpi-card,
  .pl-kpi-card,
  .efr-metric-card,
  .cfo-df-metric,
  .kpi,
  .kpi-box,
  .sf-kpi,
  .profit-kpi
) {
  border-radius: var(--ovc-metric-radius) !important;
  box-shadow: none !important;
}

/* One typography rhythm across workspaces. */
html[data-faos-visual-contract-root="1"] :is(.page-title,.fp-page-title,.mfg-title,main > h1) {
  color: var(--ovc-text) !important;
  font-family: var(--ovc-font) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}
html[data-faos-visual-contract-root="1"] :is(h2,.card h2,.panel h2) {
  font-family: var(--ovc-font) !important;
}
html[data-faos-visual-contract-root="1"] :is(.muted,.hint,.subtle,.subtitle,.page-subtitle) {
  color: var(--ovc-muted) !important;
}

/* Control geometry only; semantic button colors remain owned by explicit primary/danger classes. */
html[data-faos-visual-contract-root="1"] :is(button,.btn,.fp-btn,.mfg-btn,.mfg-btn-link) {
  border-radius: var(--ovc-control-radius) !important;
  font-family: var(--ovc-font) !important;
}
html[data-faos-visual-contract-root="1"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select,
  textarea
) {
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  border-color: var(--ovc-border-strong) !important;
  border-radius: var(--ovc-control-radius) !important;
  font-family: var(--ovc-font) !important;
}
html[data-faos-visual-contract-root="1"] :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
  select,
  textarea
):focus {
  outline: none !important;
  border-color: var(--ovc-accent) !important;
  box-shadow: 0 0 0 3px rgba(13,148,136,.12) !important;
}

/* Tables use a single compact operational density. */
html[data-faos-visual-contract-root="1"] table {
  border-collapse: collapse;
}
html[data-faos-visual-contract-root="1"] :is(thead th,table > tr:first-child th) {
  background: var(--ovc-subtle) !important;
  color: var(--ovc-muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .02em;
  border-bottom-color: var(--ovc-border) !important;
}
html[data-faos-visual-contract-root="1"] :is(th,td) {
  border-color: var(--ovc-border) !important;
}

/* Default workspace scrollbars stay visually quiet. */
html[data-faos-visual-contract-root="1"] * {
  scrollbar-color: var(--ovc-border-strong) transparent;
  scrollbar-width: thin;
}

/* Wave 6: close remaining module chrome / density drift. */
html[data-faos-visual-contract-root="1"] body.fp-scope,
html[data-faos-visual-contract-root="1"] body.finance-command-scope {
  --fod-card-radius: var(--ovc-radius) !important;
  --fex-card-radius: var(--ovc-radius) !important;
  --fp-radius: var(--ovc-radius) !important;
}
html[data-faos-visual-contract-root="1"] body.fp-scope :is(.fp-card,.stat-card,.finance-kpi-card,.kpi-box),
html[data-faos-visual-contract-root="1"] body.finance-command-scope :is(.fp-card,.stat-card,.finance-kpi-card,.kpi-box) {
  border-radius: var(--ovc-radius) !important;
}
html[data-faos-visual-contract-root="1"] body.fp-scope :is(.finance-kpi-card,.kpi-box,.stat-card),
html[data-faos-visual-contract-root="1"] body.finance-command-scope :is(.finance-kpi-card,.kpi-box,.stat-card) {
  border-radius: var(--ovc-metric-radius) !important;
}

/* Page headers are layout chrome, not a competing card family. */
html[data-faos-visual-contract-root="1"] :is(
  .fp-page-header,
  .page-header,
  .fie-page-header,
  .faud-page-head,
  .header-row,
  .mfg-pr-header,
  .fc-workspace-header,
  .apws-header,
  .fcb-page-header,
  .recv-cockpit-header,
  .ops-panel-header
) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Top application bars share the same quiet white shell. */
html[data-faos-visual-contract-root="1"] :is(.legacy-header,.topbar,.ow3-topbar,.wms-ov-topbar) {
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  border-bottom: 1px solid var(--ovc-border) !important;
  box-shadow: none !important;
}
html[data-faos-visual-contract-root="1"] :is(.legacy-header,.topbar,.ow3-topbar,.wms-ov-topbar) a:not(.btn) {
  color: var(--ovc-muted) !important;
}
html[data-faos-visual-contract-root="1"] :is(.legacy-header,.topbar,.ow3-topbar,.wms-ov-topbar) a:not(.btn):hover {
  color: var(--ovc-accent) !important;
}

/* Canonical Back action geometry across route families. */
html[data-faos-visual-contract-root="1"] :is(
  a.back,
  button.back,
  a.pp-back,
  button.pp-back,
  a.bm-back,
  button.bm-back,
  a.wms-rb-back,
  button.wms-rb-back,
  a.apd-back,
  button.apd-back,
  a.apws-back,
  button.apws-back,
  a.faec-back-link,
  a.bm-page-back__link,
  a.rack-print-back-to-map,
  a.rack-label-back,
  a.office-back-to-home,
  a.supplier-assign-banner__back,
  .back-bar > a:first-child,
  .ops-center-back,
  .office-iac-page__back,
  .office-rc-page__back,
  .ws-back-link
) {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 32px !important;
  padding: 6px 11px !important;
  border: 1px solid var(--ovc-border-strong) !important;
  border-radius: var(--ovc-control-radius) !important;
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  box-shadow: none !important;
  text-decoration: none !important;
  font-family: var(--ovc-font) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}
html[data-faos-visual-contract-root="1"] :is(
  a.back,
  button.back,
  a.pp-back,
  button.pp-back,
  a.bm-back,
  button.bm-back,
  a.wms-rb-back,
  button.wms-rb-back,
  a.apd-back,
  button.apd-back,
  a.apws-back,
  button.apws-back,
  a.faec-back-link,
  a.bm-page-back__link,
  a.rack-print-back-to-map,
  a.rack-label-back,
  a.office-back-to-home,
  a.supplier-assign-banner__back,
  .back-bar > a:first-child,
  .ops-center-back,
  .office-iac-page__back,
  .office-rc-page__back,
  .ws-back-link
):hover {
  border-color: var(--ovc-accent) !important;
  background: var(--faos-workspace-accent-subtle, #f0fdfa) !important;
  color: var(--faos-workspace-accent-strong, #0f766e) !important;
}

/* Layout wrappers must never become nested visual cards. */
html[data-faos-visual-contract-root="1"] :is(
  .panel:not(.card):not(.mfg-panel):not(.wms-mc-panel):not(.wms-rd-panel):not(.recv-panel):not(.foc-panel):not(.insp-panel):not(.fie-panel):not(.mal-panel):not(.tr-panel):not(.apws-panel),
  .tab-panel,
  .panel-body,
  .panel-head,
  .fp-card-bd,
  .fp-card-hd
) {
  box-shadow: none;
}

/* Wave 7: close WMS command-center and floor-pulse outliers discovered by browser audit. */
html[data-faos-visual-contract-root="1"] .faos-shell.bm-enterprise-shell main.bm-command-center-page > .header :is(.kpi.stat-card,.stat-card) {
  border-radius: var(--ovc-metric-radius) !important;
  box-shadow: none !important;
}

/* Warehouse Floor Chain is operational content, not a separate dark-theme island. */
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse).orbita-universe-bg--compact {
  color: var(--ovc-text) !important;
  background: var(--ovc-surface) !important;
  background-image: none !important;
  border: 1px solid var(--ovc-border) !important;
  border-radius: var(--ovc-radius) !important;
  box-shadow: var(--ovc-shadow) !important;
  animation: none !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse).orbita-universe-bg--compact::before,
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse).orbita-universe-bg--compact::after {
  display: none !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) :is(.wms-floor-pulse-head,.wms-floor-pulse-head strong,.wms-floor-pulse-label,.wms-floor-pulse-summary,.wms-floor-pulse-meta,.wms-floor-pulse-empty) {
  color: var(--ovc-text) !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) .wms-floor-pulse-meta,
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) .wms-floor-pulse-empty {
  color: var(--ovc-muted) !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) .wms-floor-pulse-link {
  color: var(--ovc-accent) !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) .wms-floor-pulse-chip {
  background: var(--ovc-subtle) !important;
  color: var(--ovc-text) !important;
  border-color: var(--ovc-border-strong) !important;
  box-shadow: none !important;
  animation: none !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) .wms-floor-pulse-chip.wms-floor-status-blocked {
  background: #fef2f2 !important;
  border-color: #fecaca !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) .wms-floor-pulse-chip.wms-floor-status-active {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
html[data-faos-visual-contract-root="1"] :is(#wms-floor-pulse,#wms-floor-trace,#wms-receiving-rack-pulse) .wms-floor-pulse-chip.wms-floor-status-completed {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

/* WMS tile token maps to the cross-module metric geometry. */
html[data-faos-visual-contract-root="1"].orbita-wms-v2-unify,
html[data-faos-visual-contract-root="1"].orbita-wms-v3 {
  --wms-ui-radius-surface: var(--ovc-radius) !important;
  --wms-ui-radius-tile: var(--ovc-metric-radius) !important;
  --wms-ui-radius-control: var(--ovc-control-radius) !important;
}

/* Wave 8: WMS application chrome joins the same FAOS light workspace shell. */
html[data-faos-visual-contract-root="1"] #wms-unified-topbar.faos-shell__topbar {
  background: var(--ovc-surface) !important;
  background-image: none !important;
  color: var(--ovc-text) !important;
  border-bottom: 1px solid var(--ovc-border) !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.06) !important;
  font-family: var(--ovc-font) !important;
}
html[data-faos-visual-contract-root="1"] #wms-unified-topbar .faos-shell__immersive-brand {
  color: var(--ovc-text) !important;
}
html[data-faos-visual-contract-root="1"] #wms-unified-topbar .wms-topbar-session-chip {
  color: var(--ovc-muted) !important;
  background: var(--ovc-subtle) !important;
  border-color: var(--ovc-border) !important;
  border-radius: var(--ovc-control-radius) !important;
}
html[data-faos-visual-contract-root="1"] #wms-unified-topbar :is(
  .wms-unified-topbar__back,
  #wmsTopbarOverviewLink,
  .top-bar-back-overview,
  .wms-unified-topbar__logout
) {
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  border-color: var(--ovc-border-strong) !important;
  box-shadow: none !important;
}
html[data-faos-visual-contract-root="1"] #wms-unified-topbar :is(
  .wms-unified-topbar__back,
  #wmsTopbarOverviewLink,
  .top-bar-back-overview,
  .wms-unified-topbar__logout
):hover {
  background: var(--faos-workspace-accent-subtle, #f0fdfa) !important;
  color: var(--faos-workspace-accent-strong, #0f766e) !important;
  border-color: var(--ovc-accent) !important;
}


/* Wave 9: production-surface closure — cover remaining real card/panel families. */
html[data-faos-visual-contract-root="1"] :is(.fp-os-panel,.atlas-panel,.atlas-status-card,.pp-card,.faud-domain-surface,.faud-export-tile,.tab-content-card,.st-mode-panel,.ll-panel,.mal-card,.dev-panel) {
  border: 1px solid var(--ovc-border) !important;
  border-radius: var(--ovc-radius) !important;
  box-shadow: var(--ovc-shadow) !important;
}
html[data-faos-visual-contract-root="1"] :is(.fp-os-panel,.atlas-panel,.pp-card,.faud-domain-surface,.tab-content-card,.st-mode-panel,.ll-panel,.dev-panel):not([class*="warn"]):not([class*="danger"]):not([class*="risk"]):not([class*="error"]):not([class*="success"]):not([class*="signal"]) {
  background-color: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
}

/* Dense operational tables: same header rhythm and readable row density. */
html[data-faos-visual-contract-root="1"] :is(.fp-table,.mfg-table,.doc-table,.finance-review-table,.finance-report-table,.faud-trace-table,.led-soft-table,table.table) th {
  background: var(--ovc-subtle) !important;
  color: var(--ovc-muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  border-color: var(--ovc-border) !important;
}
html[data-faos-visual-contract-root="1"] :is(.fp-table,.mfg-table,.doc-table,.finance-review-table,.finance-report-table,.faud-trace-table,.led-soft-table,table.table) :is(th,td) {
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  border-color: var(--ovc-border) !important;
  vertical-align: middle;
}
html[data-faos-visual-contract-root="1"] :is(.fp-table-wrap,.finance-table-shell,.finance-table-cockpit-wrap,.mfg-table-wrap,.led-table-wrap,.bm-table-scroll,.bs-table-wrap) {
  box-shadow: none !important;
}

/* Shared action geometry across remaining Finance/WMS/Manufacturing families. */
html[data-faos-visual-contract-root="1"] :is(.fp-btn,.mfg-btn,.exec-btn,.cfo-btn,.eba-btn,.ow3-btn,.wms-mc-btn,.wms-audit-btn,.bm-cmd-btn,.ll-btn,.act-btn) {
  min-height: 34px;
  border-radius: var(--ovc-control-radius) !important;
  box-shadow: none !important;
  font-family: var(--ovc-font) !important;
}
html[data-faos-visual-contract-root="1"] :is(.fp-btn--ghost,.mfg-btn-link,.exec-btn-link,.wms-audit-btn--ghost,.psr-btn-ghost,.eis-btn-ghost) {
  background: var(--ovc-surface) !important;
  color: var(--ovc-text) !important;
  border-color: var(--ovc-border-strong) !important;
  box-shadow: none !important;
}
html[data-faos-visual-contract-root="1"] :is(.fp-btn--primary,.mfg-btn--primary,.cfo-btn-primary) {
  background: var(--ovc-accent) !important;
  color: #fff !important;
  border-color: var(--ovc-accent) !important;
}

/* Finance empty states were authored for a dark shell; keep them legible after surface unification. */
html[data-faos-visual-contract-root="1"] body.fp-scope :is(.fp-empty,.empty-state,#wb-empty) {
  background: var(--ovc-surface) !important;
  color: var(--ovc-muted) !important;
  border-color: var(--ovc-border) !important;
}
html[data-faos-visual-contract-root="1"] body.fp-scope :is(.fp-empty,.empty-state,#wb-empty) :is(p,span,small) {
  color: var(--ovc-muted) !important;
}


/* Wave 10: WMS pages with high-specificity legacy body backgrounds must still obey the shared workspace shell. */
html[data-faos-visual-contract-root="1"][class] > body[class] {
  background: var(--ovc-bg) !important;
  color: var(--ovc-text) !important;
  font-family: var(--ovc-font) !important;
}

html[data-faos-visual-contract-root="1"][class] > body[data-scope] {
  background: var(--ovc-bg) !important;
  color: var(--ovc-text) !important;
  font-family: var(--ovc-font) !important;
}
