:root {
  --erp-ink: #13213a;
  --erp-muted: #64748b;
  --erp-border: #d9e2ee;
  --erp-surface: #f6f9fc;
  --erp-blue: #086bd8;
  --erp-blue-soft: #eef6ff;
  --erp-green: #087754;
  --erp-amber: #a96000;
  --erp-red: #bf293c;
  --erp-violet: #7252cc;
}

.header-menu { position: relative; flex: 0 0 auto; }
.header-menu-panel,
.module-menu-panel {
  position: absolute;
  z-index: 80;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--erp-border);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 16px 38px rgb(20 42 72 / 18%);
}
.header-menu-panel[hidden], .module-menu-panel[hidden] { display: none; }
.header-menu-panel { top: calc(100% + 6px); right: 0; width: 270px; }
.header-menu-panel button,
.module-menu-panel button {
  width: 100%;
  min-height: 46px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  color: #31445e;
  background: transparent;
  text-align: left;
}
.header-menu-panel button:hover,
.header-menu-panel button:focus-visible,
.module-menu-panel button:hover,
.module-menu-panel button:focus-visible { background: var(--erp-blue-soft); outline: 0; }
.header-menu-panel b, .module-menu-panel b { font-size: 10px; }
.header-menu-panel span, .module-menu-panel span { color: var(--erp-muted); font-size: 8px; font-weight: 500; }

.module-nav { gap: 6px; padding-inline: 18px; overflow: visible; }
.module-nav > .module-nav-direct,
.module-menu-trigger {
  min-width: auto;
  padding-inline: 11px;
  border-radius: 5px 5px 0 0;
}
.module-menu { position: relative; display: flex; align-items: stretch; }
.module-menu-trigger { border: 0; color: #4f6079; background: transparent; font-size: 11px; font-weight: 650; }
.module-menu-trigger[aria-expanded="true"] { color: var(--erp-blue); background: #f3f8ff; }
.module-menu-panel { top: calc(100% + 1px); left: 0; width: 244px; }
.module-menu:last-child .module-menu-panel { right: 0; left: auto; }
.module-menu-panel button { position: static; min-width: 0; }
.module-nav button:focus-visible { outline: 2px solid #70a9e3; outline-offset: -2px; }

.erp-ops[hidden], .erp-project[hidden] { display: none !important; }
.erp-kicker { color: #2f7da8; font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.erp-button { min-height: 30px; padding: 0 10px; border: 1px solid var(--erp-border); border-radius: 5px; color: var(--erp-ink); background: #fff; font-size: 9px; font-weight: 800; cursor: pointer; }
.erp-button.primary { color: #fff; border-color: var(--erp-blue); background: var(--erp-blue); }
.erp-button.ai { color: #fff; border-color: var(--erp-violet); background: var(--erp-violet); }
.erp-button.subtle { color: #334762; background: #fff; }
.erp-button:hover:not(:disabled), .erp-button:focus-visible { filter: brightness(.97); box-shadow: 0 0 0 2px rgb(8 107 216 / 12%); outline: 0; }
.erp-button:disabled { cursor: not-allowed; opacity: .55; }
/* The single control that advances the quotation carries a forward arrow so
   operators can always locate "next" at a glance. */
.erp-button.is-advance::after { content: "\00a0→"; font-weight: 800; }
.erp-rate-prefill-note { grid-column: 1 / -1; margin: 0; color: var(--erp-green); font-size: 8px; font-weight: 650; line-height: 1.4; }
.erp-rate-prefill-note:empty { display: none; }

.erp-ops {
  height: calc(100vh - 106px);
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  overflow: hidden;
  background: #fff;
}

.erp-ops-main { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--erp-border); }
.erp-ops-heading { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--erp-border); }
.erp-ops-heading h2 { margin: 3px 0 2px; color: var(--erp-ink); font-size: 19px; }
.erp-ops-heading p { margin: 0; color: var(--erp-muted); font-size: 10px; }
.erp-heading-actions { display: flex; gap: 7px; }
.erp-heading-actions b { margin-left: 4px; color: var(--erp-blue); }

.erp-stage-views { min-height: 44px; display: flex; align-items: stretch; gap: 2px; padding: 0 8px; overflow-x: auto; border-bottom: 1px solid var(--erp-border); background: #fff; }
.erp-stage-views button { position: relative; flex: 0 0 auto; padding: 0 11px; border: 0; color: #526179; background: transparent; font-size: 9px; font-weight: 800; }
.erp-stage-views button b { margin-left: 4px; color: var(--erp-blue); }
.erp-stage-views button.active { color: var(--erp-ink); }
.erp-stage-views button.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; background: var(--erp-blue); }

.erp-queue-toolbar { min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-bottom: 1px solid var(--erp-border); }
.erp-search { width: min(320px, 34vw); }
.erp-search input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--erp-border); border-radius: 5px; font-size: 10px; }
.erp-filter-toggle { height: 34px; padding: 0 10px; border: 1px solid var(--erp-border); border-radius: 5px; color: #32455f; background: #fff; font-size: 10px; font-weight: 800; }
.erp-filter-toggle b { min-width: 17px; height: 17px; margin-left: 5px; display: inline-grid; place-items: center; border-radius: 9px; color: #fff; background: var(--erp-blue); font-size: 8px; }
.erp-filter-pills { display: flex; align-items: center; gap: 5px; overflow-x: auto; }
.erp-filter-pills button { flex: 0 0 auto; height: 28px; padding: 0 8px; border: 1px solid #c5d9ef; border-radius: 14px; color: #305174; background: #f4f9ff; font-size: 8px; font-weight: 750; }
.erp-toolbar-spacer { flex: 1 1 auto; }
.erp-density { display: flex; align-items: center; gap: 5px; color: var(--erp-muted); font-size: 8px; }
.erp-density select { width: 98px; height: 32px; font-size: 9px; }

.erp-filters { min-height: 76px; display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)) auto; gap: 8px; align-items: end; padding: 10px 14px; border-bottom: 1px solid var(--erp-border); background: var(--erp-surface); }
.erp-filters[hidden] { display: none; }
.erp-filters label { gap: 4px; color: #53637a; font-size: 8px; font-weight: 750; }
.erp-filters select { height: 32px; padding: 0 7px; font-size: 9px; }
.erp-filters > div { display: flex; gap: 5px; }

.erp-bulk-bar { min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-bottom: 1px solid var(--erp-border); background: #fbfdff; }
.erp-bulk-bar label { display: flex; align-items: center; gap: 6px; font-size: 9px; }
.erp-bulk-bar input { width: 15px; height: 15px; }
.erp-bulk-bar button { min-height: 30px; padding: 0 9px; border: 1px solid var(--erp-border); border-radius: 4px; color: #34475f; background: #fff; font-size: 8px; font-weight: 750; }
.erp-bulk-bar button[data-erp-bulk="copilot"] { color: var(--erp-violet); border-color: #cfc1f2; background: #f8f5ff; }
.erp-bulk-bar > span { margin-left: auto; color: var(--erp-muted); font-size: 8px; }

.erp-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.erp-quote-table { width: 100%; min-width: 1000px; border-collapse: collapse; color: #20324c; font-size: 9px; }
.erp-quote-table thead { position: sticky; z-index: 3; top: 0; background: #f7f9fc; }
.erp-quote-table th { height: 38px; padding: 0 8px; border-bottom: 1px solid var(--erp-border); text-align: left; color: #33445d; font-size: 8px; white-space: nowrap; }
.erp-quote-table td { height: 39px; padding: 4px 8px; border-bottom: 1px solid #e7edf4; vertical-align: middle; white-space: nowrap; }
.erp-quote-table.comfortable td { height: 50px; }
.erp-quote-table tbody tr { cursor: pointer; }
.erp-quote-table tbody tr:hover { background: #f6faff; }
.erp-quote-table tbody tr.selected { background: #edf6ff; box-shadow: inset 3px 0 var(--erp-blue); }
.erp-select-column { width: 34px; text-align: center !important; }
.erp-row-check, .erp-bulk-bar input[type="checkbox"] { width: 14px; height: 14px; display: inline-grid; place-content: center; margin: 0; appearance: none; border: 1px solid #93a4b9; border-radius: 3px; background: #fff; vertical-align: middle; cursor: pointer; }
.erp-row-check::before, .erp-bulk-bar input[type="checkbox"]::before { content: ""; width: 7px; height: 4px; margin-top: -1px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); transform-origin: center; }
.erp-row-check:checked, .erp-bulk-bar input[type="checkbox"]:checked { border-color: var(--erp-blue); background: var(--erp-blue); }
.erp-row-check:checked::before, .erp-bulk-bar input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
.erp-quote-table td:first-child { text-align: center; }
.erp-quote-cell { display: grid; gap: 2px; }
.erp-quote-cell b { color: var(--erp-blue); font-size: 9px; }
.erp-quote-cell span { color: var(--erp-muted); font-size: 8px; }
.erp-customer-cell { display: grid; gap: 2px; max-width: 150px; }
.erp-customer-cell b { overflow: hidden; text-overflow: ellipsis; }
.erp-customer-cell span, .erp-owner-cell span { color: var(--erp-muted); font-size: 8px; }
.erp-stage-chip, .erp-priority-chip { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 6px; border-radius: 4px; font-size: 8px; font-weight: 800; }
.erp-stage-chip { color: #1763b6; background: #eaf3ff; }
.erp-stage-chip.approval, .erp-stage-chip.customer_offer { color: var(--erp-amber); background: #fff3dd; }
.erp-stage-chip.order_handoff, .erp-stage-chip.procurement { color: var(--erp-green); background: #e8f7f0; }
.erp-priority-chip.urgent { color: var(--erp-red); background: #fff0f2; }
.erp-priority-chip.high { color: #bd5c00; background: #fff3dd; }
.erp-priority-chip.normal { color: #59677a; background: #eef1f5; }
.erp-owner-cell { display: grid; gap: 2px; }
.erp-sla-risk { color: var(--erp-red) !important; font-weight: 800; }
.erp-amount { font-weight: 850; font-variant-numeric: tabular-nums; }
.erp-next-action { max-width: 170px; overflow: hidden; text-overflow: ellipsis; color: var(--erp-blue); font-weight: 800; }
.erp-queue-footer { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--erp-border); color: #536279; font-size: 8px; }
.erp-queue-footer b { color: var(--erp-green); }

.erp-queue-inspector { min-width: 0; overflow: auto; background: #fff; }
.erp-queue-inspector > header { min-height: 88px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 15px 16px 10px; }
.erp-queue-inspector > header h2 { margin: 3px 0 3px; color: var(--erp-ink); font-size: 20px; }
.erp-queue-inspector > header p { margin: 0; color: #52627a; font-size: 10px; }
.erp-queue-inspector > header button { border: 0; color: var(--erp-muted); background: transparent; font-size: 8px; }
.erp-inspector-status { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 16px 12px; border-bottom: 1px solid var(--erp-border); }
.erp-inspector-status span { min-height: 22px; display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 4px; color: #36516e; background: #eff4f9; font-size: 8px; font-weight: 800; }
.erp-mini-lifecycle { margin: 0; padding: 11px 15px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; list-style: none; border-bottom: 1px solid var(--erp-border); }
.erp-mini-lifecycle li { min-width: 0; display: grid; justify-items: center; gap: 4px; color: #8a96a8; font-size: 7px; text-align: center; }
.erp-mini-lifecycle li::before { content: ""; width: 9px; height: 9px; border: 2px solid #c7d0dc; border-radius: 50%; background: #fff; }
.erp-mini-lifecycle li.complete::before { border-color: var(--erp-green); background: var(--erp-green); }
.erp-mini-lifecycle li.current { color: var(--erp-blue); font-weight: 800; }
.erp-mini-lifecycle li.current::before { border-color: var(--erp-blue); box-shadow: 0 0 0 3px #dcecff; }
.erp-next-card { margin: 12px 14px 0; padding: 12px; border: 1px solid #c4dcf7; border-radius: 6px; background: #f3f8ff; }
.erp-next-card span { color: var(--erp-blue); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.erp-next-card strong { margin-top: 5px; display: block; color: var(--erp-ink); font-size: 12px; line-height: 1.35; }
.erp-next-card p { margin: 7px 0 0; color: var(--erp-red); font-size: 8px; font-weight: 800; }
.erp-inspector-metrics { margin: 12px 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.erp-inspector-metrics div { padding: 9px; border: 1px solid var(--erp-border); border-radius: 5px; }
.erp-inspector-metrics dt { color: var(--erp-muted); font-size: 8px; }
.erp-inspector-metrics dd { margin: 4px 0 0; color: var(--erp-ink); font-size: 13px; font-weight: 850; }
.erp-inspector-blockers, .erp-inspector-handoffs { margin: 11px 14px 0; padding: 11px; border: 1px solid var(--erp-border); border-radius: 6px; }
.erp-inspector-blockers header, .erp-inspector-handoffs h3 { display: flex; justify-content: space-between; align-items: center; margin: 0; }
.erp-inspector-blockers h3, .erp-inspector-handoffs h3 { font-size: 10px; }
.erp-inspector-blockers header b { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--erp-red); font-size: 8px; }
.erp-inspector-blockers ul { margin: 8px 0 0; padding-left: 16px; color: #5c3b42; font-size: 8px; line-height: 1.5; }
.erp-inspector-handoffs > div { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #edf1f5; font-size: 8px; }
.erp-inspector-handoffs > div:last-child { border-bottom: 0; }
.erp-inspector-handoffs b { color: #3e516b; }
.erp-inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 12px 14px 18px; }

.erp-project { height: calc(100vh - 106px); min-height: 680px; overflow: hidden; background: var(--erp-surface); }
.erp-project-header { min-height: 68px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--erp-border); background: #fff; }
.erp-back { border: 0; color: var(--erp-blue); background: transparent; font-size: 9px; font-weight: 800; }
.erp-project-header h2 { margin: 3px 0 2px; color: var(--erp-ink); font-size: 18px; }
.erp-project-header p { margin: 0; color: var(--erp-muted); font-size: 9px; }
.erp-project-header-actions { display: flex; gap: 6px; }
.erp-project-lifecycle { min-height: 54px; margin: 0; padding: 6px 16px; display: grid; grid-template-columns: repeat(11, minmax(70px, 1fr)); gap: 4px; align-items: center; overflow-x: auto; list-style: none; border-bottom: 1px solid var(--erp-border); background: #fff; }
.erp-project-lifecycle li { position: relative; min-width: 70px; display: grid; justify-items: center; gap: 5px; color: #7b8799; font-size: 7px; text-align: center; }
.erp-project-lifecycle li::before { content: ""; z-index: 1; width: 11px; height: 11px; border: 2px solid #c6d0dc; border-radius: 50%; background: #fff; }
.erp-project-lifecycle li:not(:last-child)::after { content: ""; position: absolute; top: 6px; left: 58%; width: 84%; height: 2px; background: #dbe2ea; }
.erp-project-lifecycle li.complete::before { border-color: var(--erp-green); background: var(--erp-green); }
.erp-project-lifecycle li.complete::after { background: #8fd2bc; }
.erp-project-lifecycle li.current { color: var(--erp-blue); font-weight: 850; }
.erp-project-lifecycle li.current::before { border-color: var(--erp-blue); box-shadow: 0 0 0 3px #dcecff; }
.erp-project-layout { height: calc(100% - 122px); display: grid; grid-template-columns: 188px minmax(0, 1fr) 292px; gap: 8px; padding: 8px; }
.erp-project-nav, .erp-project-content, .erp-project-rail > section { border: 1px solid var(--erp-border); border-radius: 7px; background: #fff; }
.erp-project-nav { min-width: 0; overflow: auto; padding: 5px; }
.erp-nav-group + .erp-nav-group { margin-top: 3px; }
.erp-nav-group-toggle {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  color: #4e5f75;
  background: #f7f9fc;
  text-align: left;
}
.erp-nav-group-toggle span { color: inherit; font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.erp-nav-group-toggle em { color: #8894a5; font-size: 7px; font-style: normal; }
.erp-nav-group.open .erp-nav-group-toggle { color: #245782; background: #eef6ff; }
.erp-nav-group-panel { display: grid; gap: 2px; padding: 3px 0 1px; }
.erp-nav-group-panel[hidden] { display: none; }
.erp-nav-group-panel > button { width: 100%; min-height: 42px; display: grid; grid-template-columns: 23px 1fr; grid-template-rows: auto auto; gap: 2px 5px; align-items: center; padding: 5px 7px; border: 0; border-radius: 5px; color: #43536a; background: transparent; text-align: left; }
.erp-nav-group-panel > button span { grid-row: 1 / 3; color: #99a4b3; font-size: 7px; font-weight: 800; }
.erp-nav-group-panel > button b { font-size: 8px; }
.erp-nav-group-panel > button em { color: #78869a; font-size: 7px; font-style: normal; }
.erp-nav-group-panel > button:hover, .erp-nav-group-panel > button:focus-visible { background: #f6f9fc; outline: 0; }
.erp-nav-group-panel > button.active { color: var(--erp-blue); background: var(--erp-blue-soft); }
.erp-nav-group-panel > button.active span, .erp-nav-group-panel > button.active em { color: var(--erp-blue); }
.erp-project-content { min-width: 0; overflow: auto; padding: 14px; }
.erp-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.erp-section-head h2 { margin: 3px 0 2px; color: var(--erp-ink); font-size: 17px; }
.erp-section-head p { margin: 0; color: var(--erp-muted); font-size: 9px; }
.erp-section-head > div:last-child { display: flex; gap: 6px; }
.erp-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.erp-table-scroll { width: 100%; overflow-x: auto; }
.erp-editable-table { min-width: 890px; }
.erp-editable-table tr.editing { background: var(--erp-blue-soft); }
.erp-evidence-ref { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-icon-button { min-height: 27px; padding: 0 8px; border: 1px solid var(--erp-border); border-radius: 4px; color: #36506f; background: #fff; font-size: 8px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.erp-icon-button:hover, .erp-icon-button:focus-visible { border-color: #75afea; color: var(--erp-blue); background: var(--erp-blue-soft); outline: 0; }
.erp-evidence-editor { margin: 0 0 10px; border: 1px solid #bdd8f5; border-radius: 6px; background: #f8fbff; overflow: hidden; }
.erp-evidence-editor > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 10px; border-bottom: 1px solid #dce9f7; background: #eef6ff; }
.erp-evidence-editor > header > div { display: grid; gap: 2px; }
.erp-evidence-editor > header b { color: #244b78; font-size: 10px; }
.erp-evidence-editor > header span { color: #61758c; font-size: 8px; }
.erp-editor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 9px 10px; }
.erp-editor-grid label { min-width: 0; display: grid; gap: 3px; color: #53637a; font-size: 7px; font-weight: 800; }
.erp-editor-grid label.span-2 { grid-column: span 2; }
.erp-editor-grid .span-3 { grid-column: 1 / -1; }
.erp-editor-divider { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 0 2px; border-bottom: 1px solid #dce9f7; }
.erp-editor-divider b { color: #244b78; font-size: 8px; }
.erp-editor-divider span { color: var(--erp-muted); font-size: 7px; }
.erp-editor-grid input, .erp-editor-grid select { width: 100%; height: 30px; min-width: 0; padding: 0 7px; border: 1px solid #cbd8e6; border-radius: 4px; color: var(--erp-ink); background: #fff; font: inherit; font-size: 8px; }
.erp-editor-grid input:focus, .erp-editor-grid select:focus { border-color: #70a9e3; outline: 2px solid rgb(8 107 216 / 9%); }
.erp-editor-grid input[readonly] { color: #6c7b8f; background: #f1f4f8; }
.erp-price-break-editor, .erp-parcel-editor { border: 1px solid #d5e3f1; border-radius: 5px; background: #fff; }
.erp-price-break-editor > summary, .erp-parcel-editor > summary { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; color: #36506f; background: #f5f9fd; cursor: pointer; list-style-position: inside; }
.erp-price-break-editor > summary > span, .erp-parcel-editor > summary > span { display: flex; align-items: baseline; gap: 7px; font-size: 8px; }
.erp-price-break-editor > summary b, .erp-parcel-editor > summary b { color: var(--erp-ink); font-size: 9px; }
.erp-price-break-editor > summary em, .erp-parcel-editor > summary em { color: var(--erp-muted); font-size: 7px; font-style: normal; }
.erp-price-break-grid { display: grid; grid-template-columns: minmax(58px, .45fr) repeat(2, minmax(120px, 1fr)); align-items: center; gap: 5px 7px; padding: 8px; }
.erp-price-break-grid > span { color: var(--erp-muted); font-size: 7px; font-weight: 800; }
.erp-price-break-grid > b { color: #36506f; font-size: 8px; }
.erp-price-break-grid input { height: 28px; }
.erp-parcel-editor > .erp-editor-grid { padding: 8px; }
.erp-check-field { grid-template-columns: 18px minmax(0, 1fr) !important; align-items: center; gap: 7px !important; min-height: 34px; padding: 6px 8px; border: 1px solid #d5e3f1; border-radius: 5px; background: #fff; }
.erp-check-field input[type="checkbox"] { appearance: none; width: 15px; height: 15px; display: inline-grid; place-content: center; margin: 0; padding: 0; border: 1px solid #8ea4ba; border-radius: 3px; background: #fff; }
.erp-check-field input[type="checkbox"]:checked { border-color: var(--erp-blue); background: var(--erp-blue); }
.erp-check-field input[type="checkbox"]:checked::after { content: ""; width: 7px; height: 4px; margin-top: -1px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.erp-check-field > span { display: grid; gap: 2px; }
.erp-check-field b { color: #36506f; font-size: 8px; }
.erp-check-field em { color: var(--erp-muted); font-size: 7px; font-style: normal; font-weight: 500; }
.erp-destination-row { display: grid; grid-template-columns: minmax(90px, .5fr) repeat(2, minmax(140px, 1fr)); align-items: end; gap: 7px; padding: 7px 8px; border: 1px solid #d5e3f1; border-radius: 5px; background: #fff; }
.erp-destination-row > b { align-self: center; color: #36506f; font-size: 9px; }
.erp-evidence-editor > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-top: 1px solid #dce9f7; background: #fff; }
.erp-evidence-editor > footer span { color: var(--erp-muted); font-size: 7px; line-height: 1.4; }
.erp-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.erp-info-card { padding: 11px; border: 1px solid var(--erp-border); border-radius: 6px; background: #fff; }
.erp-info-card.wide { grid-column: span 2; }
.erp-info-card.full { grid-column: 1 / -1; }
.erp-info-card span { color: var(--erp-muted); font-size: 8px; }
.erp-info-card strong { margin-top: 4px; display: block; color: var(--erp-ink); font-size: 10px; line-height: 1.4; }
.erp-info-card p { margin: 6px 0 0; color: #506078; font-size: 8px; line-height: 1.5; }
.erp-evidence-table { width: 100%; border-collapse: collapse; font-size: 8px; }
.erp-evidence-table th, .erp-evidence-table td { min-height: 36px; padding: 8px; border-bottom: 1px solid #e6edf4; text-align: left; vertical-align: middle; }
.erp-evidence-table th { color: #4b5b72; background: #f8fafc; white-space: nowrap; }
.erp-evidence-table td b, .erp-evidence-table td span { display: block; }
.erp-evidence-table td span { margin-top: 3px; color: var(--erp-muted); }
.erp-source-state { min-height: 21px; display: inline-flex !important; align-items: center; padding: 2px 6px; border-radius: 4px; color: var(--erp-green) !important; background: #e9f7f1; font-weight: 800; }
.erp-source-state.needs_review { color: var(--erp-amber) !important; background: #fff3dd; }
.erp-supplier-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.erp-supplier-card { position: relative; display: grid; gap: 8px; padding: 11px; border: 1px solid var(--erp-border); border-radius: 6px; }
.erp-supplier-card.selected { border-color: #76b0ec; box-shadow: inset 0 0 0 2px #ddecff; }
.erp-selection-marker { position: absolute; z-index: 1; top: 8px; right: 8px; width: 14px; height: 14px; display: grid; place-items: center; border: 1px solid #9cacbe; border-radius: 3px; background: #fff; }
.erp-supplier-card.selected .erp-selection-marker { border-color: var(--erp-blue); background: var(--erp-blue); }
.erp-supplier-card.selected .erp-selection-marker::after { content: ""; width: 7px; height: 4px; margin-top: -1px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.erp-supplier-card > header { padding-right: 22px; }
.erp-supplier-card header { display: flex; justify-content: space-between; gap: 8px; }
.erp-supplier-card header > div { min-width: 0; display: grid; gap: 2px; }
.erp-supplier-card header span { color: var(--erp-muted); font-size: 8px; }
.erp-supplier-card header b { font-size: 10px; }
.erp-supplier-card dl { margin: 0; }
.erp-supplier-card dl div { min-height: 26px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #edf1f5; font-size: 8px; }
.erp-supplier-card dd { margin: 0; font-weight: 800; text-align: right; }
.erp-supplier-card p { margin: 0; color: var(--erp-muted); font-size: 8px; line-height: 1.4; }
.erp-supplier-card button { width: 100%; }
.erp-subtabs { margin-bottom: 10px; display: flex; gap: 4px; border-bottom: 1px solid var(--erp-border); }
.erp-subtabs button { position: relative; min-height: 35px; padding: 0 10px; border: 0; color: #66758a; background: transparent; font-size: 8px; font-weight: 800; }
.erp-subtabs button.active { color: var(--erp-blue); }
.erp-subtabs button.active::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: -1px; height: 2px; background: var(--erp-blue); }
.erp-scenario-summary { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--erp-muted); font-size: 8px; }
.erp-scenario-summary b { color: var(--erp-ink); font-size: 9px; }
.erp-optimizer-summary { margin: 8px 0 10px; display: grid; grid-template-columns: .8fr .9fr 1.5fr; gap: 7px; padding: 9px; border: 1px solid #b9d8c6; border-radius: 6px; background: #f4fbf7; }
.erp-optimizer-summary > div { min-width: 0; display: grid; gap: 3px; }
.erp-optimizer-summary span { color: #567068; font-size: 7px; }
.erp-optimizer-summary b { color: #174f3c; font-size: 8px; line-height: 1.35; overflow-wrap: anywhere; }
.erp-optimizer-summary em { grid-column: 1 / -1; color: #39705e; font-size: 7px; font-style: normal; font-weight: 800; }
.erp-scenario-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--erp-border); border-radius: 6px; }
.erp-scenario-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 8px; }
.erp-scenario-table th, .erp-scenario-table td { min-width: 132px; padding: 0; border-right: 1px solid var(--erp-border); border-bottom: 1px solid var(--erp-border); vertical-align: stretch; }
.erp-scenario-table th { position: sticky; top: 0; z-index: 2; height: 36px; padding: 8px; color: #4d5e74; background: #f7f9fc; text-align: left; white-space: nowrap; }
.erp-scenario-table th:first-child, .erp-scenario-table td:first-child { position: sticky; left: 0; z-index: 3; min-width: 148px; background: #f7f9fc; }
.erp-scenario-table td:first-child { padding: 9px; color: var(--erp-ink); font-weight: 800; }
.erp-scenario-table tr:last-child td { border-bottom: 0; }
.erp-scenario-table th:last-child, .erp-scenario-table td:last-child { border-right: 0; }
.erp-scenario-cell { width: 100%; min-height: 78px; display: grid; align-content: center; gap: 3px; padding: 9px; border: 0; color: inherit; background: #fff; text-align: left; }
.erp-scenario-cell:not(:disabled):hover, .erp-scenario-cell:not(:disabled):focus-visible { background: var(--erp-blue-soft); box-shadow: inset 0 0 0 2px #87baf0; outline: 0; }
.erp-scenario-cell.active { background: #edf6ff; box-shadow: inset 0 0 0 2px #1473d2; }
.erp-scenario-cell b { color: var(--erp-ink); font-size: 10px; }
.erp-scenario-cell span { color: var(--erp-muted); }
.erp-scenario-cell em { color: var(--erp-blue); font-size: 7px; font-style: normal; font-weight: 800; }
.erp-scenario-cell:disabled { cursor: not-allowed; background: #fafbfc; }
.erp-scenario-cell:disabled b { color: #8290a3; }
.erp-approval-list { display: grid; gap: 8px; }
.erp-approval-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--erp-border); border-radius: 6px; }
.erp-approval-row > b { font-size: 9px; text-transform: capitalize; }
.erp-approval-row p { margin: 0; color: var(--erp-muted); font-size: 8px; }
.erp-approval-row span { color: var(--erp-amber); font-size: 8px; font-weight: 800; }
.erp-approval-row.approved span { color: var(--erp-green); }
.erp-doc-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.erp-doc-card { padding: 9px; border: 1px solid var(--erp-border); border-radius: 5px; }
.erp-doc-card b, .erp-doc-card span { display: block; }
.erp-doc-card b { font-size: 8px; }
.erp-doc-card span { margin-top: 4px; color: var(--erp-muted); font-size: 7px; }
.erp-doc-card.locked { background: #f4f6f9; opacity: .72; }
.erp-event-list { margin: 0; padding: 0; list-style: none; }
.erp-event-list li { position: relative; min-height: 58px; margin-left: 8px; padding: 2px 0 12px 24px; border-left: 2px solid #dbe3ec; }
.erp-event-list li::before { content: ""; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--erp-blue); }
.erp-event-list b { display: block; color: var(--erp-ink); font-size: 9px; }
.erp-event-list span { margin-top: 3px; display: block; color: var(--erp-muted); font-size: 8px; }
.erp-project-rail { min-width: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.erp-project-rail > section { padding: 11px; }
.erp-project-rail h3 { margin: 0; font-size: 10px; }
.erp-rail-next { border-color: #bed8f4 !important; background: #f2f8ff !important; }
.erp-rail-next > span { color: var(--erp-blue); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.erp-rail-next h3 { margin-top: 5px; line-height: 1.35; }
.erp-rail-next p { margin: 7px 0 9px; color: #50627a; font-size: 8px; line-height: 1.45; }
.erp-rail-next button { width: 100%; }
.erp-rail-money header, .erp-rail-holds header, .erp-rail-docs header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.erp-rail-money header b, .erp-rail-holds header b, .erp-rail-docs header span { color: var(--erp-muted); font-size: 8px; }
.erp-rail-money dl { margin: 8px 0 0; }
.erp-rail-money dl div { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #edf1f5; font-size: 8px; }
.erp-rail-money dd { margin: 0; color: var(--erp-ink); font-weight: 850; }
.erp-rail-money p { margin: 8px 0 0; color: var(--erp-muted); font-size: 7px; line-height: 1.45; }
.erp-rail-holds ul { margin: 8px 0 0; padding: 0; list-style: none; color: #6c3a42; font-size: 8px; line-height: 1.5; }
.erp-rail-holds li + li { margin-top: 4px; }
.erp-rail-holds li > button { width: 100%; display: grid; gap: 2px; padding: 7px; border: 1px solid #f0d6d9; border-radius: 4px; color: #6c3a42; background: #fff8f8; text-align: left; cursor: pointer; }
.erp-rail-holds li > button:hover, .erp-rail-holds li > button:focus-visible { border-color: #dd9ba4; background: #fff2f3; outline: 0; }
.erp-rail-holds li b { font-size: 8px; line-height: 1.4; }
.erp-rail-holds li span { color: #96626a; font: 7px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.erp-rail-docs > div { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.erp-rail-docs button { min-height: 30px; padding: 0 5px; border: 1px solid var(--erp-border); border-radius: 4px; color: #31445e; background: #fff; font-size: 7px; font-weight: 800; }
.erp-rail-docs button:disabled { color: #98a2b1; background: #f2f4f7; }
.erp-rail-docs button.erp-doc-locked { color: #7a8496; background: #f2f4f7; border-style: dashed; cursor: help; }
.erp-rail-docs button.erp-doc-locked:hover, .erp-rail-docs button.erp-doc-locked:focus-visible { color: #31445e; background: #e9edf3; outline: 0; }
.erp-rail-holds li b { display: block; }
.erp-hold-hint { color: #b06a74; font: 700 7px/1.3 var(--erp-font, system-ui); letter-spacing: .02em; }
.erp-rail-holds li > button:hover .erp-hold-hint, .erp-rail-holds li > button:focus-visible .erp-hold-hint { color: #8a3d47; }

.erp-copilot { position: fixed; z-index: 50; background: #fff; }
/* One Copilot only: the header "Copilot" button is the single entry point.
   When closed it is fully hidden — no floating card overlapping the rail. */
.erp-copilot[data-mode="docked"] { display: none; }
.erp-copilot-launcher { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; color: var(--erp-ink); background: #fff; text-align: left; }
.erp-copilot-launcher:hover, .erp-copilot-launcher:focus-visible { background: #f5f9fe; outline: 2px solid #7fb2e8; outline-offset: -2px; }
.erp-copilot-launcher-mark, .erp-copilot-intro-mark { display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #086bd8, #7252cc); font-weight: 850; letter-spacing: -.03em; }
.erp-copilot-launcher-mark { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 7px; font-size: 9px; }
.erp-copilot-launcher > span:last-child { min-width: 0; display: grid; gap: 2px; }
.erp-copilot-launcher b { color: #33445d; font-size: 9px; }
.erp-copilot-launcher small { overflow: hidden; color: var(--erp-muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.erp-copilot-body { display: none; }
.erp-copilot[data-mode="expanded"] { top: 58px; right: 0; bottom: 0; width: min(470px, 42vw); border-left: 1px solid var(--erp-border); box-shadow: -12px 0 32px rgb(20 42 72 / 16%); }
.erp-copilot[data-mode="expanded"] .erp-copilot-launcher, .erp-copilot[data-mode="full"] .erp-copilot-launcher { display: none; }
.erp-copilot[data-mode="expanded"] .erp-copilot-body, .erp-copilot[data-mode="full"] .erp-copilot-body { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.erp-copilot-title { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--erp-border); background: #fff; }
.erp-copilot-title h2 { margin: 2px 0 0; display: flex; align-items: baseline; gap: 7px; color: var(--erp-ink); font-size: 15px; }
.erp-copilot-title h2 small { color: var(--erp-muted); font-size: 8px; font-weight: 750; }
.erp-copilot-mode-actions { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--erp-border); border-radius: 6px; background: var(--erp-surface); }
.erp-copilot-mode-actions button { min-height: 28px; padding: 0 7px; border: 0; border-radius: 4px; color: #53637a; background: transparent; font-size: 7px; font-weight: 800; white-space: nowrap; }
.erp-copilot-mode-actions button[aria-pressed="true"] { color: #164f8e; background: #fff; box-shadow: 0 1px 4px rgb(20 42 72 / 13%); }
.erp-copilot-mode-actions .erp-copilot-close { color: #59677a; }
.erp-copilot-intro { display: flex; align-items: center; gap: 10px; padding: 13px 14px 10px; background: #fbfdff; }
.erp-copilot-intro-mark { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; font-size: 10px; }
.erp-copilot-intro h3 { margin: 0; color: var(--erp-ink); font-size: 12px; }
.erp-copilot-intro p { margin: 3px 0 0; color: var(--erp-muted); font-size: 8px; line-height: 1.4; }
.erp-copilot-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 14px 12px; border-bottom: 1px solid var(--erp-border); background: #fbfdff; }
.erp-copilot-scope span { min-width: 0; display: grid; gap: 3px; padding: 8px; border: 1px solid #d7e2ee; border-radius: 6px; background: #fff; }
.erp-copilot-scope b { color: var(--erp-green); font-size: 8px; }
.erp-copilot-scope span:last-child b { color: var(--erp-red); }
.erp-copilot-scope em { color: #53637a; font-size: 7px; font-style: normal; line-height: 1.4; }
.erp-copilot-workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: auto auto auto; gap: 10px; padding: 12px 14px 18px; overflow: auto; background: #f7f9fc; }
.erp-copilot-workspace > section { padding: 11px; border: 1px solid var(--erp-border); border-radius: 7px; background: #fff; }
.erp-copilot-workspace h3 { margin: 0; color: var(--erp-ink); font-size: 10px; }
.erp-copilot-tasks > div { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.erp-copilot-tasks button { min-height: 58px; display: grid; gap: 3px; align-content: center; padding: 8px 9px; border: 1px solid var(--erp-border); border-radius: 6px; color: #2f425c; background: #fff; text-align: left; }
.erp-copilot-tasks button:hover, .erp-copilot-tasks button:focus-visible { border-color: #7fb2e8; background: #f3f8ff; outline: 0; }
.erp-copilot-tasks b { font-size: 8px; }
.erp-copilot-tasks span { color: var(--erp-muted); font-size: 7px; line-height: 1.35; }
.erp-copilot-request > form { margin-top: 8px; }
.erp-copilot-request textarea { width: 100%; min-height: 72px; resize: vertical; padding: 9px; border: 1px solid #cfdbe8; border-radius: 6px; color: var(--erp-ink); background: #fff; font: inherit; font-size: 9px; line-height: 1.45; }
.erp-copilot-request textarea:focus { border-color: #70a9e3; outline: 3px solid rgb(8 107 216 / 9%); }
.erp-copilot-request form > div { margin-top: 7px; display: flex; align-items: end; gap: 7px; }
.erp-copilot-request form label { flex: 1 1 auto; display: grid; gap: 3px; color: var(--erp-muted); font-size: 7px; font-weight: 750; }
.erp-copilot-request select { width: 100%; height: 31px; font-size: 8px; }
.erp-copilot-request form > div > button { flex: 0 0 auto; min-width: 108px; }
.erp-copilot-request form > p { margin: 7px 0 0; color: var(--erp-muted); font-size: 7px; line-height: 1.4; }
.erp-copilot-answer { margin-top: 9px; padding: 9px; border-left: 3px solid var(--erp-violet); border-radius: 0 5px 5px 0; background: #f7f4ff; }
.erp-copilot-answer span { color: var(--erp-violet); font-size: 7px; font-weight: 850; }
.erp-copilot-answer p { margin: 4px 0 0; color: #34455e; font-size: 8px; line-height: 1.5; }
.erp-copilot-preview > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.erp-copilot-preview > header p { margin: 4px 0 0; color: var(--erp-muted); font-size: 7px; line-height: 1.4; }
.erp-copilot-review-status { flex: 0 0 auto; padding: 4px 6px; border-radius: 4px; color: #59677a; background: #eef1f5; font-size: 7px; font-weight: 800; }
.erp-copilot-preview dl { margin: 8px 0 0; }
.erp-copilot-preview dl div { min-height: 27px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid #edf1f5; font-size: 8px; }
.erp-copilot-preview dt { color: var(--erp-muted); }
.erp-copilot-preview dd { margin: 0; color: var(--erp-ink); font-weight: 800; text-align: right; }
.erp-copilot-review-form { margin-top: 8px; border-top: 1px solid var(--erp-border); }
.erp-copilot-review-form summary { padding: 9px 1px 1px; color: var(--erp-blue); font-size: 8px; font-weight: 850; cursor: pointer; }
.erp-copilot-preview button { width: 100%; margin-top: 8px; }
.erp-copilot-preview button:disabled { cursor: not-allowed; opacity: .5; }
.erp-copilot-payload { max-height: 190px; margin: 7px 0 0; padding: 8px; overflow: auto; border: 1px solid #dbe3ed; border-radius: 4px; color: #29405e; background: #f7f9fc; font: 7px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.erp-copilot-field { display: grid; gap: 4px; margin-top: 7px; color: #53637a; font-size: 7px; font-weight: 800; }
.erp-copilot-field input, .erp-copilot-field textarea { width: 100%; padding: 6px 7px; border: 1px solid var(--erp-border); border-radius: 4px; color: var(--erp-ink); background: #fff; font: inherit; font-size: 8px; resize: vertical; }
.erp-copilot-commit-note { margin: 7px 0 0; color: var(--erp-muted); font-size: 7px; line-height: 1.45; }
.erp-copilot[data-mode="full"] { inset: 58px 0 0; width: auto; border-radius: 0; box-shadow: none; }
.erp-copilot[data-mode="full"] .erp-copilot-title, .erp-copilot[data-mode="full"] .erp-copilot-intro, .erp-copilot[data-mode="full"] .erp-copilot-scope, .erp-copilot[data-mode="full"] .erp-copilot-workspace { width: min(1120px, 100%); margin-inline: auto; }
.erp-copilot[data-mode="full"] .erp-copilot-workspace { grid-template-columns: 260px minmax(0, 1fr) 300px; grid-template-rows: 1fr; align-items: start; width: min(1120px, calc(100% - 28px)); }

.erp-feedback { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(620px, calc(100% - 30px)); padding: 10px 14px; border: 1px solid #bdd4ee; border-radius: 6px; color: #29415f; background: #fff; box-shadow: 0 10px 28px rgb(20 42 72 / 18%); font-size: 9px; }

.erp-copilot-draft-log { margin-bottom: 12px; border: 1px solid #d9d0f2; border-radius: 6px; overflow: hidden; }
.erp-copilot-draft-log > header { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; color: #4e3d80; background: #faf8ff; }
.erp-copilot-draft-log > header h3 { margin: 0; font-size: 9px; }
.erp-copilot-draft-log > header span { font-size: 8px; }
.erp-copilot-draft-log article { padding: 9px 11px; border-top: 1px solid #eee9f8; }
.erp-copilot-draft-log article > div { display: flex; justify-content: space-between; gap: 10px; font-size: 8px; }
.erp-copilot-draft-log article p { margin: 6px 0; color: #33445d; font-size: 8px; line-height: 1.45; }
.erp-copilot-draft-log article small { color: var(--erp-muted); font-size: 7px; }

.erp-rfq-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: hidden; border: 0; border-radius: 9px; color: var(--erp-ink); background: #fff; box-shadow: 0 24px 70px rgb(15 28 48 / 30%); }
.erp-rfq-dialog::backdrop { background: rgb(11 24 44 / 55%); }
.erp-rfq-dialog form { max-height: calc(100vh - 28px); margin: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.erp-rfq-dialog header { display: flex; justify-content: space-between; gap: 16px; padding: 17px 18px 13px; border-bottom: 1px solid var(--erp-border); }
.erp-rfq-dialog header h2 { margin: 4px 0 3px; font-size: 19px; }
.erp-rfq-dialog header p { margin: 0; color: var(--erp-muted); font-size: 9px; line-height: 1.45; }
.erp-rfq-dialog header button { align-self: flex-start; border: 0; color: var(--erp-muted); background: transparent; font-size: 8px; }
.erp-rfq-grid { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 15px 18px; overflow: auto; }
.erp-rfq-grid label { gap: 4px; color: #53637a; font-size: 8px; font-weight: 750; }
.erp-rfq-grid label.wide { grid-column: 1 / -1; }
.erp-rfq-grid input, .erp-rfq-grid select, .erp-rfq-grid textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--erp-border); border-radius: 5px; color: var(--erp-ink); background: #fff; font: inherit; font-size: 9px; }
.erp-rfq-grid input, .erp-rfq-grid select { height: 34px; }
.erp-rfq-grid textarea { resize: vertical; }
.erp-field-help { margin-top: 4px; color: var(--erp-muted); font-size: 8px; font-weight: 500; line-height: 1.4; }
.erp-rfq-repeat { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--erp-border); border-radius: 6px; background: #fbfcfe; }
.erp-rfq-repeat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.erp-rfq-repeat-head > div { display: grid; gap: 3px; }
.erp-rfq-repeat-head b { color: #53637a; font-size: 8px; }
.erp-rfq-repeat-head span { color: var(--erp-muted); font-size: 8px; font-weight: 500; line-height: 1.4; }
.erp-token-list { min-height: 28px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.erp-token-list:empty::before { content: var(--erp-empty-token-label, "None added yet"); color: #8b97a8; font-size: 8px; }
html[lang="zh-Hans"] .erp-token-list { --erp-empty-token-label: "尚未添加"; }
.erp-token { min-height: 27px; display: inline-flex; align-items: center; gap: 6px; padding: 0 7px; border: 1px solid #bdd8f5; border-radius: 14px; color: #244b78; background: #eef6ff; font-size: 8px; font-weight: 800; }
.erp-token button { width: 16px; height: 16px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #46627f; background: #dbeafa; font: inherit; }
.erp-rfq-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.erp-rfq-presets { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.erp-rfq-presets span { margin-right: 3px; color: var(--erp-muted); font-size: 8px; }
.erp-rfq-presets button { min-width: 30px; height: 27px; padding: 0 7px; border: 1px solid var(--erp-border); border-radius: 4px; color: #334b68; background: #fff; font-size: 8px; font-weight: 800; }
.erp-rfq-presets button:hover, .erp-rfq-presets button:focus-visible { border-color: #75afea; background: var(--erp-blue-soft); }
.erp-rfq-scenario-count { padding: 9px 11px; border: 1px solid #bed8f4; border-radius: 6px; color: #274f7d; background: #f2f8ff; font-size: 9px; font-weight: 800; }
.erp-rfq-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--erp-border); background: #f8fafc; }
.erp-rfq-dialog footer > span { max-width: 430px; color: var(--erp-muted); font-size: 8px; line-height: 1.4; }
.erp-rfq-dialog footer > div { display: flex; gap: 6px; }

@media (max-width: 1180px) {
  .module-nav { gap: 4px; }
  .header-menu .header-command, .ai-settings-trigger { display: inline-flex; align-items: center; justify-content: center; }
  .erp-ops { grid-template-columns: minmax(0, 1fr) 340px; }
  .erp-project-layout { grid-template-columns: 190px minmax(0, 1fr) 280px; }
  .erp-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-supplier-cards { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .erp-ops { height: calc(100vh - 148px); grid-template-columns: 1fr; }
  .erp-queue-inspector { position: fixed; z-index: 20; inset: 148px 0 0 20%; display: none; border-left: 1px solid var(--erp-border); box-shadow: -12px 0 28px rgb(31 49 74 / 18%); }
  .erp-queue-inspector.open { display: block; }
  .erp-project { height: auto; min-height: calc(100vh - 148px); overflow: visible; }
  .erp-project-header { grid-template-columns: auto 1fr; }
  .erp-project-header-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .erp-project-layout { height: auto; grid-template-columns: 1fr; }
  .erp-project-nav { display: flex; gap: 4px; overflow-x: auto; }
  .erp-nav-group { flex: 0 0 auto; display: flex; gap: 3px; }
  .erp-nav-group + .erp-nav-group { margin-top: 0; }
  .erp-nav-group-toggle { flex: 0 0 126px; }
  .erp-nav-group-panel { display: flex; gap: 2px; padding: 0; }
  .erp-nav-group-panel[hidden] { display: none; }
  .erp-nav-group-panel > button { flex: 0 0 138px; }
  .erp-project-content { min-height: 560px; }
  .erp-project-rail { display: grid; grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .erp-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-destination-row { grid-template-columns: 1fr 1fr; }
  .erp-destination-row > b { grid-column: 1 / -1; }
  .erp-copilot[data-mode="expanded"] { top: 100px; width: min(470px, 72vw); }
  .erp-copilot[data-mode="full"] { inset: 100px 0 0; }
  .erp-copilot[data-mode="full"] .erp-copilot-workspace { grid-template-columns: 1fr; grid-template-rows: auto; }
}

@media (max-width: 640px) {
  .module-nav { padding-inline: 6px; }
  .module-nav > .module-nav-direct, .module-nav > .module-menu { flex: 1 1 25%; min-width: 0; }
  .module-menu-trigger, .module-nav > .module-nav-direct { width: 100%; padding-inline: 4px; font-size: 9px; }
  .module-menu-panel { width: min(244px, calc(100vw - 12px)); }
  .header-menu-panel { position: fixed; top: 60px; right: 6px; width: min(270px, calc(100vw - 12px)); }
  .erp-ops-heading { align-items: flex-start; flex-direction: column; }
  .erp-heading-actions { width: 100%; }
  .erp-heading-actions button { flex: 1; }
  .erp-bulk-bar button:not([data-erp-bulk="copilot"]), .erp-bulk-bar > span, .erp-density { display: none; }
  .erp-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erp-queue-inspector { inset: 146px 0 0; }
  .erp-project-header { grid-template-columns: 1fr; }
  .erp-project-header-actions { grid-column: auto; justify-content: stretch; overflow-x: auto; }
  .erp-project-lifecycle { grid-template-columns: repeat(11, 82px); }
  .erp-project-rail { grid-template-columns: 1fr; }
  .erp-info-grid { grid-template-columns: 1fr; }
  .erp-editor-grid { grid-template-columns: 1fr; }
  .erp-destination-row, .erp-price-break-grid { grid-template-columns: 1fr; }
  .erp-editor-grid label.span-2 { grid-column: auto; }
  .erp-editor-grid .span-3 { grid-column: auto; }
  .erp-section-head { flex-direction: column; }
  .erp-section-head > div:last-child, .erp-section-actions { width: 100%; justify-content: flex-start; }
  .erp-evidence-editor > footer { align-items: flex-start; flex-direction: column; }
  .erp-info-card.wide { grid-column: auto; }
  .erp-scenario-table th, .erp-scenario-table td { min-width: 118px; }
  .erp-scenario-table th:first-child, .erp-scenario-table td:first-child { min-width: 112px; }
  .erp-rfq-repeat-head { flex-direction: column; }
  .erp-copilot[data-mode="docked"] { right: 8px; bottom: 8px; width: 208px; }
  .erp-copilot[data-mode="expanded"] { inset: 98px 0 0; width: auto; }
  .erp-copilot[data-mode="full"] { inset: 98px 0 0; }
  .erp-copilot-title { align-items: flex-start; }
  .erp-copilot-mode-actions { flex-wrap: wrap; justify-content: flex-end; }
  .erp-copilot-scope, .erp-copilot-tasks > div { grid-template-columns: 1fr; }
  .erp-copilot[data-mode="full"] .erp-copilot-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   Universal interaction feedback — every control visibly responds to a click.
   A guaranteed press animation, a brief post-click flash, and an in-flight
   busy spinner mean no button ever feels dead, regardless of its handler.
   ============================================================================ */
.erp-app button, .erp-ops button, #erpQuoteProject button, .erp-rfq-dialog button,
.erp-action-dialog button, .provider-settings button, .app-header button,
header button, .language-option, .erp-stage-views button, .erp-quote-table tbody tr {
  transition: transform .07s ease, box-shadow .13s ease, background-color .13s ease,
    border-color .13s ease, filter .13s ease, opacity .12s ease;
  -webkit-tap-highlight-color: transparent;
}
button:not(:disabled):active,
.language-option:not(:disabled):active { transform: translateY(1px) scale(.985); }
.erp-quote-table tbody tr:active { transform: scale(.997); }

/* Guaranteed acknowledgement flash — added by JS on every real click. */
@keyframes erp-click-flash {
  0% { box-shadow: 0 0 0 0 rgb(8 107 216 / 45%); }
  100% { box-shadow: 0 0 0 6px rgb(8 107 216 / 0%); }
}
button.erp-clicked:not(:disabled) { animation: erp-click-flash .32s ease-out; }
.erp-quote-table tbody tr.erp-clicked { background: var(--erp-blue-soft); }

/* In-flight busy state for async actions (save, commit, calculate). */
@keyframes erp-spin { to { transform: rotate(360deg); } }
button[aria-busy="true"] { pointer-events: none; opacity: .72; position: relative; }
button[aria-busy="true"] { padding-right: 26px !important; }
button[aria-busy="true"]::after {
  content: ""; position: absolute; top: 50%; right: 9px;
  width: 11px; height: 11px; margin-top: -6px;
  border: 2px solid rgb(19 33 58 / 25%); border-top-color: var(--erp-blue);
  border-radius: 50%; animation: erp-spin .6s linear infinite;
}

/* Motion-reduction: keep instant colour feedback, drop movement/spin. */
@media (prefers-reduced-motion: reduce) {
  button:not(:disabled):active, .language-option:not(:disabled):active,
  .erp-quote-table tbody tr:active { transform: none; }
  button.erp-clicked:not(:disabled) { animation: none; box-shadow: 0 0 0 3px rgb(8 107 216 / 30%); }
  button[aria-busy="true"]::after { animation: none; }
}
