:root {
  --erp-font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --erp-chrome: #edf1f5;
  --erp-sheet: #fff;
  --erp-subtle: #f5f7fa;
  --erp-line: #dce2e9;
  --erp-ink: #222933;
  --erp-muted: #586575;
  --erp-accent: #775b2e;
  --erp-accent-bg: #e1e8f1;
  --erp-focus: #8d6c38;
  --erp-radius: 15px;
}

#app :is(.company-app, .eng-app, .migration-app, .records-app, .minimal-shell) {
  font-family: var(--erp-font);
  color: var(--erp-ink);
}

#app :is(.company-app, .eng-app:not(.auth-page), .migration-app, .records-app:not(.embedded)) {
  background: var(--erp-chrome);
}

#app :is(.company-app, .eng-app, .migration-app, .records-app) :is(button, input, select, textarea) {
  font-family: inherit;
}

#app :is(.company-app, .eng-app, .migration-app, .records-app) :focus-visible {
  outline: 2px solid var(--erp-focus);
  outline-offset: 2px;
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation, .eng-sidebar, .records-nav) {
  background: var(--erp-chrome);
  border-color: transparent;
  color: var(--erp-ink);
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation, .eng-sidebar) .erp-brand {
  display: flex;
  justify-content: flex-start;
  width: auto;
  min-height: 55px;
  margin: 0 0 7px;
  padding: 7px 11px;
  background: transparent;
  color: var(--erp-ink);
  line-height: 1.2;
  letter-spacing: 0;
}

#app .eng-sidebar .erp-brand span {
  margin: 0;
  letter-spacing: 0;
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation, .eng-sidebar) nav :is(a, button) {
  color: #394555;
}

#app :is(.crm-navigation, .service-navigation) nav,
#app :is(.crm-navigation .crm-secondary, .service-navigation .service-nav-children),
#app :is(.crm-navigation .level-one, .service-navigation .service-nav-parent) {
  background: transparent;
}

#app .crm-navigation nav .crm-submenu {
  box-sizing: border-box;
  padding: 4px;
  background: #fff;
  border: 1px solid #ced8e3;
  border-radius: 8px;
}

#app .crm-navigation .crm-flyout-group > .crm-submenu {
  left: 100%;
  box-shadow: 0 5px 16px rgb(31 51 71 / 13%);
}

#app .crm-navigation nav .crm-submenu a {
  border-radius: 4px;
  font-weight: 500;
}

#app .crm-navigation nav .crm-submenu a:focus-visible {
  outline: 2px solid #315d82;
  outline-offset: -3px;
}

@media (max-width: 650px) {
  #app .crm-navigation .crm-flyout-group > .crm-submenu {
    margin: 0 6px;
    box-shadow: none;
  }
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation, .eng-sidebar) nav :is(a, button):hover {
  background: #e5ebf2;
  color: var(--erp-ink);
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation, .eng-sidebar) nav :is(a, button):is(.active, .selected, [aria-current="page"]) {
  background: var(--erp-accent-bg);
  border-color: #617997;
  color: #233952;
  font-weight: 650;
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation) nav :is(i, small, .service-nav-parent > b),
#app :is(.company-sidebar, .crm-navigation, .service-navigation) footer,
#app :is(.crm-navigation .crm-back, .service-navigation .service-company-back) {
  color: var(--erp-muted);
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation) :is(input[type="search"], input[type="text"], .crm-search input, .service-menu-search input) {
  background: var(--erp-subtle);
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  color: var(--erp-ink);
}

#app :is(.company-sidebar, .crm-navigation, .service-navigation) input::placeholder {
  color: var(--erp-muted);
}

#app .eng-app:not(.auth-page) .eng-sidebar {
  padding-top: 12px;
}

#app .eng-sidebar .eng-workspace {
  background: #e5ebf2;
  border-radius: 8px;
  margin-top: 12px;
}

#app :is(.company-app .company-header, .company-app .company-session, .company-app .console-bar, .eng-app .eng-header, .records-body > header) {
  background: var(--erp-chrome);
  border-color: transparent;
  color: var(--erp-ink);
}

#app :is(.company-app .company-header, .eng-app .eng-header) {
  height: 58px;
  min-height: 58px;
  padding-inline: clamp(12px, 2vw, 26px);
}

#app :is(.company-header, .company-session, .console-bar, .eng-header) :is(button, a):focus-visible {
  position: relative;
  z-index: 1;
}

#app .company-app .company-session {
  min-height: 38px;
  padding-inline: clamp(12px, 2vw, 26px);
}

#app :is(.company-app .company-body > main, .eng-app:not(.auth-page) .eng-body > main, .migration-app > main, .records-app:not(.embedded) .records-body > main) {
  box-sizing: border-box;
  min-width: 0;
  max-width: none;
  background: var(--erp-sheet);
  border: 1px solid var(--erp-line);
  border-radius: var(--erp-radius);
  margin: 0 12px 12px 0;
  padding: clamp(15px, 2.25vw, 32px);
}

#app .company-app:is(.crm-sales, .service-console) .company-body > main {
  width: auto;
  padding: clamp(10px, 1.35vw, 18px);
}

#app .service-console .company-body > main {
  align-self: stretch;
  margin: 0 12px 9px 0;
}

#app :is(.company-app, .eng-app, .migration-app, .records-app) h1 {
  font-size: clamp(23px, 2.3vw, 34px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.3;
}

#app :is(.company-app, .eng-app, .migration-app, .records-app) h2 {
  letter-spacing: -.02em;
}

#app .company-app :is(.module-heading, .role-heading) {
  padding-top: 9px;
}

#app .company-app .role-heading {
  padding-bottom: 21px;
}

#app .company-app .role-heading > div > small {
  display: none;
}

#app .company-app :is(.role-heading p, .module-heading p, .module-card > p) {
  color: var(--erp-muted);
}

#app .company-app :is(.module-card, .business-flow button, .role-shortcuts a, .role-heading > a) {
  border-color: var(--erp-line);
  box-shadow: none;
}

#app .company-app :is(.module-card, .business-flow button, .role-shortcuts a):hover {
  border-color: #a2b2c6;
  background: #f4f7fb;
}

#app .company-app .role-heading > a {
  background: #292c25;
  color: #fff;
}

#app .company-app .business-flow {
  gap: 7px;
}

#app .company-app .business-flow button {
  background: var(--erp-subtle);
  border-radius: 9px;
}

#app :is(.company-app, .eng-app, .migration-app, .records-app) table {
  font-variant-numeric: tabular-nums;
}

#app :is(.company-app, .eng-app, .migration-app, .records-app) thead th {
  background-color: var(--erp-subtle);
  border-color: var(--erp-line);
  color: #445266;
}

#app .company-app :is(.sw-table, .service-table-panel, .service-filter-panel),
#app .records-app .table-wrap {
  border-color: var(--erp-line);
}

#app .company-app :is(.crm-quick-tabs, .crm-detail-tabs) button.active {
  border-bottom-color: var(--erp-focus);
  color: var(--erp-accent);
}

/* Sales CRM typography and table metrics come from the tenant's desktop views.
   Keep the desktop density while retaining the compact-screen navigation. */
#app .company-app.crm-sales {
  --erp-font: "PingFang SC", Arial, Tahoma, "Hiragino Sans GB", "Hiragino Sans GB W3", Helvetica, "Microsoft Yahei", STHeitiSC-Light, "Helvetica Neue", sans-serif;
  --erp-chrome: #f2f3f5;
  --erp-sheet: #fff;
  --erp-subtle: #f7f8fa;
  --erp-line: #e5e6eb;
  --erp-ink: #323233;
  --erp-muted: #646566;
  --erp-accent: #ff6a00;
  --erp-accent-bg: #fff5eb;
  --erp-focus: #ff6a00;
  --crm-link: #248df5;
  font: 200 13px/1.5 var(--erp-font);
  color: var(--erp-ink);
}

#app .crm-sales :where(header, nav, main, section, article, aside, div, form, fieldset, label,
  p, span, strong, small, button, a, input, select, textarea, table, th, td, h1, h2, h3) {
  font-family: var(--erp-font);
}
#app .crm-sales .console-bar { background: #fff; border-bottom: 1px solid var(--erp-line); font-size: 13px; font-weight: 400; }
#app .crm-sales .console-bar .main-tabs a.active,
#app .crm-sales .console-bar .main-tabs a.active svg { color: var(--erp-accent); }
#app .crm-sales .company-body > main { background: var(--erp-chrome); border: 0; border-radius: 0; }
#app .crm-sales :is(.company-header,.company-session) { background: #fff; }
#app .company-app.crm-sales .crm-hub > .sw-heading h1,
#app .crm-sales main h1 { font-size: 16px; font-weight: 500; line-height: 24px; letter-spacing: normal; color: var(--erp-ink); }
#app .crm-sales main h2 { font-size: 16px; font-weight: 600; line-height: 24px; letter-spacing: normal; color: var(--erp-ink); }
#app .crm-sales main h3 { font-size: 14px; font-weight: 500; line-height: 22px; letter-spacing: normal; color: var(--erp-ink); }
#app .crm-sales :is(.sw-dialog,.sw-detail,.sr-sheet,.sales-workspace,.sr-group,.sr-leaf,.workflow-panel) { color: var(--erp-muted); font-size: 13px; }
#app .crm-sales :is(.sw-dialog label,.source-field > span,.sr-caption,.sr-target-basis,.sr-scope small,.sr-note,.followup-missing,.crm-info-grid p span,.sr-goal-values dt) { color: var(--erp-muted); font-size: 12px; }
#app .crm-sales :is(.sw-dialog,.sw-detail,[role="dialog"]) :is(input,select,textarea) { font-size: 13px; }
#app .crm-sales :is(.sw-link,.cell-link,.sf-link,.followup-view,.followup-customer,.followup-file-link,main td a,.sr-entry,.sr-detail a,.sw-detail a,.sw-heading a) { color: var(--crm-link); }
#app .crm-sales :is(.sw-link,.cell-link,.sf-link,.followup-view,.followup-customer,.followup-file-link,main td a,.sr-entry):hover { text-decoration: underline; }

#app .company-app.crm-sales .crm-navigation { background: #142740; color: #fff; }
#app .crm-sales .crm-navigation :is(.erp-brand,.erp-brand-wordmark) { color: #fff; }
#app .crm-sales .crm-navigation nav :is(a,button) { font-size: 13px; font-weight: 400; color: #e5e6eb; }
#app .crm-sales .crm-navigation nav .level-one { font-size: 14px; }
#app .crm-sales .crm-navigation nav :is(.crm-secondary,.crm-submenu) { background: #061932; border-color: #142740; }
#app .crm-sales .crm-navigation nav :is(a,button):hover { background: #233a55; color: #fff; }
#app .crm-sales .crm-navigation nav :is(a,button):is(.active,[aria-current="page"]) { color: #fff; background: #142b45; box-shadow: inset 3px 0 var(--erp-accent); }
#app .crm-sales .crm-navigation :is(.crm-search,nav i) { color: #c9cdd4; }
#app .crm-sales .crm-navigation .crm-search input { background: #fff; color: var(--erp-ink); }
#app .crm-sales :is(.sr-leaf,.sr-target-tabs button).selected { color: var(--erp-accent); background: var(--erp-accent-bg); border-color: var(--erp-accent); }
#app .crm-sales .crm-toplinks a.active { color: var(--erp-accent); }
#app .crm-sales .category-row button[aria-pressed="true"],
#app .crm-sales :is(.crm-quick-tabs,.crm-detail-tabs) button.active { color: var(--erp-ink); border-bottom-color: var(--erp-accent); }
#app .crm-sales :is(.crm-quick-tabs,.crm-detail-tabs,.category-row) button { font-size: 13px; }
#app .company-app.crm-sales .sw-primary { background: var(--erp-accent) !important; border-color: var(--erp-accent) !important; color: white !important; }
#app .company-app.crm-sales .sw-primary:not(:disabled):hover { background: #ff8c2e !important; border-color: #ff8c2e !important; }

/* The source list uses a 24px line in a 36px row (including its grid line). */
#app .crm-sales main table { font-size: 12px; font-weight: 400; color: var(--erp-muted); border-spacing: 0; }
#app .crm-sales main :is(th,td) {
  box-sizing: border-box;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--erp-line);
  border-bottom: 1px solid var(--erp-line);
  font-size: 12px;
  line-height: 24px;
  vertical-align: middle;
}
#app .crm-sales main th { background: var(--erp-subtle); color: var(--erp-muted); font-weight: 400; box-shadow: none; }
#app .crm-sales main tbody td { color: var(--erp-muted); }
#app .crm-sales main tbody tr { background-color: #fff; }
#app .crm-sales main tbody tr:hover > td { background-color: #f7f8fa; }
#app .crm-sales :is(.sw-table,.grid-scroll,.sf-scroll,.sr-table,.table-scroll) { border: 1px solid var(--erp-line); border-radius: 0; background: #fff; }
#app .crm-sales .grid-scroll .subheaders th, #app .crm-sales .sr-register th.phone-subhead { top: 36px; }
#app .crm-sales .sr-register :is(th,td).selection { padding: 0; text-align: center; }
#app .crm-sales .sr-register th .sort { padding: 0; font: inherit; }
#app .crm-sales .sr-register th .sort + button { margin-left: 3px; color: #969799; }
/* Customer lists have grouped telephone headers and narrower action columns. */
#app .crm-sales .customer-grid .grid-scroll .selection { width: 42px; min-width: 42px; padding: 0; text-align: center; }
#app .crm-sales .customer-grid .grid-scroll .selection input { width: 18px; height: 18px; }
#app .crm-sales .customer-grid .grid-scroll th[rowspan="2"] { height: 48px; }
#app .crm-sales .customer-grid .grid-scroll thead:has(.subheaders) tr > th:not([rowspan="2"]) { height: 24px; line-height: 20px; }
#app .crm-sales .customer-grid .grid-scroll .subheaders th { top: 24px; }
#app .crm-sales .customer-grid .grid-scroll th .filter { position:absolute; right:4px; top:50%; transform:translateY(-50%); padding:2px; margin:0; color:#c9cdd4; }
#app .crm-sales .customer-grid .grid-scroll th .filter:is(:focus-visible,.active) { color:var(--crm-link); }
#app .crm-sales .customer-grid .grid-scroll th .filter svg { display:block; width:13px; height:13px; fill:none; stroke:currentColor; }
#app .crm-sales .customer-grid .column-arrows { display:inline-grid; margin-left:6px; gap:2px; vertical-align:middle; }
#app .crm-sales .customer-grid .column-arrows::before, #app .crm-sales .customer-grid .column-arrows::after { content:""; border-inline:4px solid transparent; }
#app .crm-sales .customer-grid .column-arrows::before { border-bottom:4px solid #c0c4cc; }
#app .crm-sales .customer-grid .column-arrows::after { border-top:4px solid #c0c4cc; }
#app .crm-sales .customer-grid th[aria-sort="ascending"] .column-arrows::before { border-bottom-color:var(--crm-link); }
#app .crm-sales .customer-grid th[aria-sort="descending"] .column-arrows::after { border-top-color:var(--crm-link); }
#app .crm-sales .customer-grid [data-cell="area"], #app .crm-sales .customer-grid [data-cell="budget"] { text-align:right; }
#app .crm-sales .customer-grid [data-cell="followups"] { text-align:center; }
#app .crm-sales .customer-grid .grid-scroll td .cell-link { max-width:100%; color:var(--crm-link); }
#app .crm-sales .customer-grid .grid-scroll :is(td,th).compact { padding:0 4px; text-align:center; }
#app .crm-sales .followup-register td[data-column="record"] { text-align: center; }
#app .crm-sales .followup-register td button.followup-view { padding: 0; border: 0; background: transparent; font: inherit; color: var(--crm-link); }
#app .crm-sales .followup-register :is(.followup-summary,.followup-cell,.followup-customer) { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: inherit; }
#app .crm-sales .followup-summary,#app .crm-sales .followup-text p { color: var(--erp-muted); }
#app .crm-sales .followup-text p { white-space: pre-wrap; }
#app .crm-sales .sr-register .followup-summary { padding: 0; border: 0; background: none; }
#app .crm-sales .followup-register .summary { min-width: 0; white-space: nowrap; }
#app .crm-sales :is(.grid-scroll,.sr-register) input[type="checkbox"] { width: 16px; height: 16px; vertical-align: middle; accent-color: var(--erp-accent); }

#app .crm-sales .followup-register td:last-child button {
  padding: 0 6px; height: 24px; line-height: 22px; vertical-align: middle;
}
#app .crm-sales .sr-register th[data-column] { position: sticky; }
#app .crm-sales .sr-register .column-filter {
  width: 16px; height: 24px; background: transparent; border: 0; padding: 0; vertical-align: middle; color: #c9cdd4;
}
#app .crm-sales .column-filter svg { width: 12px; height: 12px; vertical-align: middle; fill: none; stroke: currentColor; stroke-linejoin: round; }
#app .crm-sales .column-filter[aria-pressed=true], #app .crm-sales .column-filter:hover { color: var(--crm-link); }
#app .crm-sales .followup-register th[data-column] > .column-filter { position: absolute; right: 4px; top: 5px; }
#app .crm-sales .followup-register th .sort-symbol { position: relative; display: inline-block; vertical-align: middle; width: 10px; height: 14px; font-size: 0; line-height: 0; color: #c0c4cc; }
#app .crm-sales .followup-register .sort-symbol::before,
#app .crm-sales .followup-register .sort-symbol::after { content: ""; position: absolute; left: 1px; width: 0; height: 0; border-inline: 5px solid transparent; }
#app .crm-sales .followup-register .sort-symbol::before { top: 1px; border-bottom: 5px solid currentColor; }
#app .crm-sales .followup-register .sort-symbol::after { bottom: 1px; border-top: 5px solid currentColor; }
#app .crm-sales .followup-register th[aria-sort="ascending"] .sort-symbol::before,
#app .crm-sales .followup-register th[aria-sort="descending"] .sort-symbol::after { color: var(--crm-link); }
#app .crm-sales .followup-register th:is([data-column="files"],[data-column="pictures"],[data-column="location"]):not(:hover,:focus-within) .sort-symbol { visibility: hidden; }
#app .crm-sales .followup-register th[data-column="record"] { padding: 0 3px; text-align: center; }
#app .crm-sales .followup-register th[data-column="record"] .sort-symbol { display: none; }
#app .crm-sales .followup-register th[data-column="record"] .column-filter { position: absolute; right: 0; top: 5px; opacity: 0; background: var(--erp-subtle); }
#app .crm-sales .followup-register th[data-column="record"]:is(:hover,:focus-within) .column-filter,
#app .crm-sales .followup-register th[data-column="record"] .column-filter[aria-pressed=true] { opacity: 1; }
#app .crm-sales :is(.grid-scroll,.sr-register) input[type="checkbox"] {
  appearance: none; margin: 0; padding: 0; box-sizing: border-box; border: 1px solid #bfcbd9; border-radius: 3px; background: white; cursor: pointer;
}
#app .crm-sales :is(.grid-scroll,.sr-register) input[type="checkbox"]:is(:checked,:indeterminate) { background: var(--erp-accent); border-color: var(--erp-accent); }
#app .crm-sales :is(.grid-scroll,.sr-register) input[type="checkbox"]:checked::after {
  content: ""; display: block; width: 4px; height: 8px; margin: 1px 4px; border: solid white; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
#app .crm-sales :is(.grid-scroll,.sr-register) input[type="checkbox"]:indeterminate::after { content: ""; display: block; width: 8px; margin: 6px auto; border-bottom: 2px solid white; }

#app .crm-sales .crm-source-form .sw-dialog > header h2 { font-size: 20px; font-weight: 600; }
#app .crm-sales .crm-source-form :is(.source-field > span,.crm-form-heading) { font-size: 13px; font-weight: 400; }
#app .crm-sales .sr-charts .sr-group { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 40px; font-size: 14px; font-weight: 400; }
#app .crm-sales .sr-charts .sr-leaf { min-height: 40px; padding-left: 32px; font-size: 13px; }
#app .crm-sales .sr-charts .sr-group > span { order: -1; }
#app .crm-sales .sr-charts .sr-group[aria-expanded=true] { color: var(--erp-accent); }
#app .crm-sales .sr-charts :is(.sr-sheet,.asset-report) h2 { font-size: 16px; font-weight: 400; }
#app .crm-sales .sr-charts .sr-table th { height: 40px; }
#app .crm-sales .sr-charts .sr-table td { height: 49px; }
@media (min-width: 851px) {
  #app .crm-sales .sr-charts { grid-template-columns: 200px minmax(0,1fr); gap: 10px; }
}

#app .crm-sales .followup-register :is(th,td)[data-column] { padding-top: 2px; }
#app .crm-sales .followup-register .selection input[type="checkbox"] { width: 18px; height: 18px; transform: translateX(-2px); }
#app .crm-sales .followup-register th[data-column="location"]:not(:hover,:focus-within) .column-filter[aria-pressed=false] { opacity: 0; }

/* One continuous KPI grid, with the same scale for customer and money figures. */
#app .crm-sales .sr-home, #app .crm-sales .sr-charts { background: var(--erp-chrome); }
#app .crm-sales .sr-home > div > section { border: 0; border-radius: 8px; padding: 16px; }
#app .crm-sales .sr-home header { justify-content: flex-start; gap: 12px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid #f2f3f5; }
#app .crm-sales .sr-context { background: var(--erp-subtle); color: var(--erp-muted); padding: 2px 6px; border-radius: 3px; font-size: 12px; }
#app .crm-sales .brief-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0 8px; }
#app .crm-sales .brief-metric {
  display: grid; grid-template: auto auto / 32px minmax(0,1fr); align-content: center; align-items: center; gap: 2px 8px;
  min-height: 80px; min-width: 0; margin: 0; padding: 4px 8px; border: 0; border-radius: 4px; background: #fff;
  color: var(--erp-muted); text-align: left; text-decoration: none; cursor: pointer;
}
#app .crm-sales .brief-metric:is(:hover,:focus-visible) { background: var(--erp-subtle); }
#app .crm-sales .brief-icon { grid-row: span 2; width: 32px; height: 32px; display: grid; place-items: center; color: #ff8c2e; background: #ffeedf; border-radius: 4px; }
#app .crm-sales .brief-money .brief-icon { color: #fa6864; background: #fce8e5; }
#app .crm-sales .brief-file .brief-icon { color: #ffb24d; background: #fff5e6; }
#app .crm-sales .brief-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#app .crm-sales .brief-label { font: 400 12px/18px var(--erp-font); }
#app .crm-sales :is(.brief-metric strong,.sr-ledger strong,.sr-fund-totals strong,.amount-chart figcaption strong) { color: var(--crm-link); font: 400 20px/24px var(--erp-font); letter-spacing: normal; overflow-wrap: anywhere; }
#app .crm-sales :is(.brief-metric,.sr-ledger) strong small { margin-left: 3px; color: var(--erp-muted); font: 400 12px/18px var(--erp-font); }
#app .crm-sales .amount-chart figcaption strong { font-size: 28px; line-height: 36px; }
#app .crm-sales .sr-target-reading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 36px; padding: 18px 12px 10px; }
#app .crm-sales .sr-gauge { margin: 0; width: min(100%,264px); text-align: center; }
#app .crm-sales .sr-gauge svg { width: 100%; display: block; }
#app .crm-sales .sr-gauge text { font: 12px var(--erp-font); fill: #646566; }
#app .crm-sales .sr-gauge figcaption { font-size: 15px; color: #f76262; font-weight: 600; }
#app .crm-sales .sr-goal-values { display: grid; gap: 10px; }
#app .crm-sales .sr-goal-values dd { font-weight: 400; font-size: 18px; color: var(--erp-ink); margin-top: 2px; }
#app .crm-sales .sr-goal-values div:first-child dd { color: var(--crm-link); }
#app .crm-sales .sr-ranking { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px 12px; list-style: none; padding: 22px 0 10px; margin: 0; }
#app .crm-sales .sr-ranking li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
#app .crm-sales .sr-rank-avatar { display: grid; place-items: center; position: relative; width: min(100%,84px); aspect-ratio: 1; margin-bottom: 4px; border-radius: 50%; background: #f55d61; color: white; font-size: 26px; }
#app .crm-sales .sr-ranking li:nth-child(3n+2) .sr-rank-avatar { background: #67b6ce; }
#app .crm-sales .sr-ranking li:nth-child(3n) .sr-rank-avatar { background: #ff902c; }
#app .crm-sales .sr-rank-avatar small { position: absolute; bottom: -2px; right: -3px; background: #ffc86c; color: #60401a; font-size: 12px; padding: 0 4px; }
#app .crm-sales .sr-ranking b { color: var(--crm-link); font-weight: 400; }
#app .crm-sales .sr-report-chart :is(figcaption,label,small) { color: var(--erp-muted); }
#app .crm-sales :is(.chart-line,.sr-report-chart circle) { stroke: #4887ff; }
#app .crm-sales .sr-report-chart circle:is(:focus,:hover) { fill: #4887ff; }
#app .crm-sales .stages button { min-height: 32px; font-size: 12px; font-weight: 400; }
#app .crm-sales .stages button.passed { background: #ff8c2e; color: white; }
#app .crm-sales .stages button.current { background: var(--erp-accent); color: white; }
#app .crm-sales .stages button.viewed { box-shadow: inset 0 -2px var(--erp-accent); }
@container (max-width: 540px) {
  #app .crm-sales .brief-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

#app .company-app .company-footer {
  background: transparent;
  color: var(--erp-muted);
}

#app .migration-app > header {
  align-items: center;
  background: var(--erp-chrome);
  border-bottom: 0;
  color: var(--erp-ink);
  padding: 12px clamp(12px, 2vw, 26px);
}

#app .migration-app > main {
  margin-inline: 12px;
}

#app .records-app:not(.embedded) .records-body > header {
  min-height: 56px;
}

@media (max-width: 800px) {
  #app .eng-app:not(.auth-page) .eng-body > main {
    margin-inline: 8px;
  }
}

@media (max-width: 650px) {
  #app .company-app .company-body > main {
    margin-inline: 6px;
    border-radius: 11px;
  }

  #app .company-app .role-heading {
    gap: 12px;
    flex-wrap: wrap;
  }

  #app .company-app .company-session {
    min-height: 38px;
  }

  #app :is(.company-sidebar, .crm-navigation, .service-navigation) nav :is(a, button) {
    min-height: 42px;
  }
}

@media (max-width: 560px) {
  #app .records-app:not(.embedded) .records-body > main {
    margin-inline: 6px;
  }
}

@media print {
  #app :is(.company-app, .eng-app, .migration-app, .records-app) main {
    margin: 0;
    padding: 0;
    background: white;
    border: 0;
  }
}

body.erp-install {
  background: var(--erp-chrome);
  color: var(--erp-ink);
  font-family: var(--erp-font);
}

.erp-install header {
  background: var(--erp-chrome);
}

.erp-install header strong {
  font-size: 17px;
  letter-spacing: -.025em;
}

.erp-install .title {
  background: #26251f;
  color: white;
  border-color: #373329;
}

.erp-install .title p {
  color: #e1cfab;
}

.erp-install .panel {
  border-color: var(--erp-line);
  border-radius: var(--erp-radius);
  box-shadow: none;
}

body:has(#app .company-app),
body:has(#app .eng-app:not(.auth-page)),
body:has(#app .migration-app) {
  margin: 0;
  background: var(--erp-chrome);
}

#app .company-app {
  min-height: 100dvh;
}

#app .company-app :is(.crm-search, .service-menu-search) {
  min-height: 36px;
  padding: 0 8px;
  background: var(--erp-subtle);
  border: 1px solid #cfd8e3;
  border-radius: 7px;
}

#app .company-app :is(.crm-search, .service-menu-search) input {
  min-height: 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#app .company-app.service-console .sales-workspace .sw-primary {
  background: #166668;
  border-color: #166668;
}

#app .company-app.service-console :is(.service-filter-line button.active, .service-new, .sw-link) {
  color: #116366;
}

#app .company-app .exec-board {
  --ink: var(--erp-ink);
  --sub: var(--erp-muted);
  --ground: var(--erp-subtle);
  --line: var(--erp-line);
  font-family: var(--erp-font);
  border-radius: 11px;
}

#app .company-app .exec-board .exec-kpis button:focus-visible {
  outline-offset: -3px;
}

.erp-install .title {
  border-radius: var(--erp-radius);
}

.erp-install .title img {
  box-sizing: border-box;
  padding: 7px;
  border: 1px solid #6a6049;
  border-radius: 9px;
  mix-blend-mode: lighten;
}

#app .eng-sidebar .eng-company-return {
  display: block;
  margin: 4px 11px 12px;
  color: var(--erp-muted);
  font-size: 12px;
}

@media (max-width: 800px) {
  #app .eng-app:not(.auth-page) .eng-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 7px 10px 0;
  }

  #app .eng-sidebar .erp-brand {
    margin-bottom: 0;
    padding-inline: 4px;
  }

  #app .eng-sidebar .eng-company-return {
    margin: 0;
    padding: 12px 2px;
  }

  #app .eng-sidebar nav {
    grid-column: 1 / -1;
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  #app .eng-sidebar .engineering-nav-group {
    margin: 0;
  }

  #app .eng-sidebar .engineering-nav-group summary {
    padding: 6px 4px;
  }

  #app .eng-sidebar .engineering-nav-items {
    display: flex;
    gap: 4px;
    padding: 1px 2px 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  #app .eng-sidebar nav .engineering-nav-items button {
    min-height: 42px;
    padding: 8px 12px;
    white-space: nowrap;
  }

  #app .eng-app:not(.auth-page) .eng-header {
    height: auto;
    min-height: 58px;
    padding-block: 6px;
  }
}

@media (max-width: 650px) {
  #app .company-app:is(.crm-sales, .service-console) .company-body > main {
    margin-inline: 6px;
  }
}

#app .company-sidebar {
  padding-top: 3px;
}

#app .company-sidebar .company-brand {
  width: fit-content;
  margin-bottom: 4px;
}

#app .company-header.workbench-header {
  position: relative;
  z-index: 6;
  gap: 12px;
}

#app .workbench-location {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}

#app .workbench-location > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .workbench-account {
  position: relative;
  flex-shrink: 0;
  max-width: 60%;
}

#app .workbench-account summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 9px;
  list-style: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

#app .workbench-account summary::-webkit-details-marker {
  display: none;
}

#app .workbench-account summary::after {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border: solid var(--erp-muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}

#app .workbench-account summary :is(strong,span) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .workbench-account summary span {
  color: var(--erp-muted);
}

#app .workbench-account[open] summary,
#app .workbench-account summary:hover {
  background: var(--erp-sheet);
  border-color: var(--erp-line);
}

#app .workbench-account-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: min(208px, calc(100vw - 26px));
  display: grid;
  padding: 6px;
  border: 1px solid var(--erp-line);
  border-radius: 10px;
  background: var(--erp-sheet);
  box-shadow: 0 10px 24px #24364814;
}

#app .workbench-account-menu :is(a,button,label) {
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--erp-ink);
  font: inherit;
  text-align: left;
}

#app .workbench-account-menu :is(a,button):hover {
  background: var(--erp-subtle);
}

#app .workbench-account-menu select {
  width: 100%;
  margin-top: 6px;
  padding: 5px;
  border: 1px solid var(--erp-line);
  border-radius: 5px;
  background: var(--erp-sheet);
}

@media (max-width: 650px) {
  #app .company-header.workbench-header {
    position: sticky;
    top: 0;
  }

  #app .company-sidebar {
    top: 58px;
  }
}

#app .crm-sales .customer-source-detail>header h2 { font-size:18px; font-weight:600; color:#323233; }
#app .crm-sales .customer-badges { display:flex; flex-wrap:wrap; gap:4px; }
#app .crm-sales .customer-badges span { padding:0 5px; border-radius:2px; font-size:12px; line-height:18px; color:#ff6a00; background:#fff6eb; }

@media (min-width: 901px) {
  #app .company-app.crm-sales .company-body > main:has(.crm-list-heading) {
    padding:0 10px 10px !important; margin:0 !important; border:0 !important; border-radius:0 !important;
    background:#f2f3f5 !important; box-shadow:none;
  }
  #app .crm-sales .customer-desk-heading > h1 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  #app .crm-sales .sales-workspace .customer-desk-heading {
    padding:0 24px 0 20px !important; gap:0 12px; min-height:48px; align-items:center;
  }
  #app .crm-sales .customer-desk-heading .customer-switcher {
    order:-1; display:flex; flex:1 1 390px; align-items:center; flex-wrap:wrap; padding:0;
  }
  #app .crm-sales .customer-desk-heading .category-row { gap:0 24px; }
  #app .crm-sales .customer-desk-heading .category-row button { height:48px; padding:0; border-radius:0; font-size:14px; }
  #app .crm-sales .customer-desk-heading .category-row button:first-child { font-size:16px; margin-right:-12px; font-weight:500; color:#323233; }
  #app .crm-sales .customer-desk-heading .view-row { margin-left:14px; }
  #app .crm-sales .customer-desk-heading .view-gear { font-size:0; border:0; padding:4px; }
  #app .crm-sales .customer-desk-heading .view-gear::before { content:'⚙︎'; font-size:16px; color:#969799; }
  #app .crm-sales .customer-desk-heading .crm-heading-actions { gap:12px; padding:8px 0; }
  #app .crm-sales .customer-desk-heading .template-more { font-size:0; min-width:24px; width:24px; padding:0; margin-left:-12px; color:white; background:#ff6a00; border:1px solid #ff6a00; border-left-color:#ff984c; border-radius:0 4px 4px 0; }
  #app .crm-sales .template-more::before { content:'⌄'; font-size:14px; }
  #app .crm-sales .customer-desk-heading .sw-primary:has(+ .template-more) { border-radius:4px 0 0 4px; }
  #app .crm-sales .customer-grid .grid-scroll { height:max(260px,calc(100dvh - 238px)); max-height:none; }
}

#app .crm-sales .customer-related { overflow-x:auto; padding:10px; }
#app .crm-sales .customer-related h3 { padding:8px 12px; background:#f7f8fa; font-size:13px; margin:0 0 12px; }
#app .crm-sales .related-tabs button { color:#646566; background:#f2f3f5; border:0; }
#app .crm-sales .related-tabs button[aria-pressed=true] { background:#fff; font-weight:500; color:#323233; }
#app .crm-sales .customer-related table { width:100%; white-space:nowrap; }
#app .crm-sales .task-grid .task-hit { position:absolute; inset:0; width:100%; height:100%; border:0; background:transparent; cursor:pointer; }
#app .crm-sales .task-grid .task-hit:is(:hover,:focus-visible) { outline:1px solid #ff8c2e; outline-offset:-1px; }
#app .crm-sales .crm-list-filters > button { font-size:14px; font-weight:400; color:#646566; }
#app .crm-sales .crm-list-filters > button.active { color:#323233; font-weight:600; }
#app .crm-sales .customer-follow-star { border:0; background:none; min-width:0; padding:0; color:#969799; font-size:20px; }
#app .crm-sales .customer-follow-star.chosen { color:#ffa51e; }

/* Keep the two goal selectors on the title line when the card is wide. */
@container (min-width: 750px) {
  #app .crm-sales .sr-home .sr-target > header { min-height: 44px; padding-right: 425px; }
  #app .crm-sales .sr-target-controls {
    position: absolute; top: 14px; right: 16px;
    gap: 9px; max-width: 425px; justify-content: flex-end;
  }
  #app .crm-sales .sr-target-controls select { max-width: 104px; min-width: 0; }
  #app .crm-sales .sr-target .sr-ledger {
    display: flex; align-items: center; gap: 12px; padding: 0;
    border: 0; min-height: 32px; margin: 0 0 8px;
  }
  #app .crm-sales .sr-target .sr-ledger > div { display: flex; align-items: center; gap: 10px; }
}
#app .crm-sales .sr-home .sr-target { position: relative; }
@media (min-width: 801px) {
  #app .crm-sales .crm-source-form .sw-dialog > header { padding-inline: 60px; }
}
#app .crm-sales .customer-stage-history details { border-bottom: 1px solid #f2f3f5; padding: 14px 0; }
#app .crm-sales .customer-stage-history summary { cursor: pointer; color: #323233; }
#app .crm-sales .customer-stage-history time { margin-left: 18px; color: #969799; }
#app .crm-sales .customer-stage-history ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(340px,100%),1fr)); padding: 0; gap: 10px; }
#app .crm-sales .customer-stage-history li { display: flex; gap: 8px; padding: 12px; border: 1px solid #e5e6eb; min-height: 65px; align-items: flex-start; }
#app .crm-sales .customer-stage-history small { display: block; color: #969799; margin-top: 6px; }
