/* CRM presentation only. Existing markup, commands and shell remain authoritative.
   Scoped specificity overrides the legacy layered CRM themes. */
html body[data-view="crm"] #view .aq-crm-premium {
  --crm-ink: #18283d;
  --crm-muted: #66758a;
  --crm-border: #e5eaf0;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  padding: 16px 22px 28px !important;
  background: #f7f9fc !important;
  color: var(--crm-ink) !important;
  font-family: Inter, "Segoe UI", sans-serif;
}
/* Reset legacy column placement as well as the grid template. Otherwise the
   customer panel at column 2 creates an unintended implicit second track. */
html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-kpis,.aq-crm-filters,.aq-crm-panel) {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
html body[data-view="crm"] #view .aq-crm-kpis {
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
}
html body[data-view="crm"] #view .aq-crm-filters > * {
  grid-column: auto !important;
  min-width: 0 !important;
}
html body[data-view="crm"] #view .aq-crm-filter-actions {
  flex-wrap: wrap !important;
  min-width: 0 !important;
  height: auto !important;
}
html body[data-view="crm"] #view .aq-crm-kpis {
  gap: 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
html body[data-view="crm"] #view .aq-crm-kpis .aq-crm-kpi-segment {
  grid-template-columns: 42px minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto !important;
  gap: 5px 14px !important;
  min-height: 112px !important;
  padding: 18px !important;
  border: 1px solid var(--crm-border) !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: 0 2px 6px rgb(24 40 61 / 2%) !important;
}
html body[data-view="crm"] #view .aq-crm-kpi-segment :is(small,b,span) {
  grid-column: 2 !important;
  max-width: 100% !important;
  white-space: normal !important;
}
html body[data-view="crm"] #view .aq-crm-kpi-segment small {
  color: var(--crm-muted) !important;
  font-size: 10px !important;
  font-weight: 650 !important;
  letter-spacing: .02em !important;
}
html body[data-view="crm"] #view .aq-crm-kpi-segment b {
  color: var(--crm-ink) !important;
  font-size: clamp(18px, 1.45vw, 24px) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  font-variant-numeric: tabular-nums;
}
html body[data-view="crm"] #view .aq-crm-kpi-segment > span { color: var(--crm-muted) !important; font-size: 11px !important; line-height: 1.4 !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > i {
  grid-column: 1 !important;
  grid-row: 1 / 4 !important;
  align-self: center !important;
  width: 42px !important;
  height: 46px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #edf4ff !important;
  color: #1769d2 !important;
}
html body[data-view="crm"] #view .aq-crm-kpi-segment > i svg { width: 22px !important; height: 22px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment.green > i { background: #edf7f2 !important; color: #328567 !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment.orange > i { background: #fff7eb !important; color: #aa752c !important; }
html body[data-view="crm"] #view :is(.aq-crm-filters,.aq-crm-panel) {
  background: #fff !important;
  border: 1px solid var(--crm-border) !important;
  border-radius: 9px !important;
  box-shadow: 0 2px 6px rgb(24 40 61 / 2%) !important;
}
html body[data-view="crm"] #view .aq-crm-filters {
  grid-template-columns: minmax(130px,.8fr) minmax(130px,.8fr) minmax(170px,1fr) auto auto !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  overflow: visible !important;
}
html body[data-view="crm"] #view .aq-crm-filters label > span { color: var(--crm-muted) !important; font-size: 10px !important; font-weight: 600 !important; }
html body[data-view="crm"] #view .aq-crm-filters :is(select,button,.aq-crm-filter-date) { border-radius: 6px !important; font-size: 12px !important; box-shadow: none !important; }
html body[data-view="crm"] #view .aq-crm-filters select { border-color: var(--crm-border) !important; color: var(--crm-ink) !important; background-color: #fff !important; }
html body[data-view="crm"] #view .aq-crm-filters > button { width: auto !important; color: var(--crm-ink) !important; background: #fff !important; border: 1px solid var(--crm-border) !important; }
html body[data-view="crm"] #view .aq-crm-filter-actions > button { color: #fff !important; background: #1769d2 !important; border: 1px solid #1769d2 !important; padding: 0 14px !important; min-height: 42px !important; white-space: nowrap; }
html body[data-view="crm"] #view .aq-crm-filter-actions .aq-crm-quick { background: #182f4d !important; border-color: #182f4d !important; font-weight: 600 !important; }
html body[data-view="crm"] #view .aq-crm-filter-actions .crm-new-dropdown { width: min(610px,calc(100vw - 48px)) !important; max-width: calc(100vw - 48px) !important; border: 1px solid var(--crm-border) !important; border-radius: 9px !important; background: #fff !important; box-shadow: 0 8px 24px rgb(24 40 61 / 12%) !important; }
html body[data-view="crm"] #view .crm-new-option { background: #fff !important; border-color: var(--crm-border) !important; color: var(--crm-ink) !important; box-shadow: none !important; }
html body[data-view="crm"] #view .crm-new-option small { color: var(--crm-muted) !important; }
html body[data-view="crm"] #view .aq-crm-panel > header { padding: 14px 18px !important; min-height: 64px !important; background: #fff !important; border-bottom: 1px solid var(--crm-border) !important; }
html body[data-view="crm"] #view .aq-crm-panel > header h2 { color: var(--crm-ink) !important; font-size: 16px !important; font-weight: 650 !important; }
html body[data-view="crm"] #view .aq-crm-panel > header p { margin-top: 4px !important; color: var(--crm-muted) !important; font-size: 11px !important; }
html body[data-view="crm"] #view .aq-crm-panel > header button { color: #1769d2 !important; font-size: 12px !important; font-weight: 600 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary { gap: 8px !important; padding: 12px 16px !important; background: #fff !important; border-bottom: 1px solid var(--crm-border) !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button { min-height: 62px !important; border: 1px solid var(--crm-border) !important; border-radius: 6px !important; background: #f8fafc !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button[data-status="Quoted"] { background: #f0f5fd !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button[data-status="Follow Up"] { background: #fdf8ef !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button[data-status="Won"] { background: #f0f8f4 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button[data-status="Lost"] { background: #fcf2f2 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary b { text-transform: none !important; letter-spacing: 0 !important; font-size: 12px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary small { font-size: 11px !important; color: var(--crm-muted) !important; }
html body[data-view="crm"] #view .aq-crm-panel .crm-control-table-wrap { overflow-x: auto !important; }
html body[data-view="crm"] #view .aq-crm-panel .crm-control-table { table-layout: auto !important; min-width: 680px !important; }
html body[data-view="crm"] #view .aq-crm-panel .crm-control-table th { padding: 10px 16px !important; background: #f7f9fc !important; color: var(--crm-muted) !important; font-size: 10px !important; font-weight: 600 !important; border-bottom: 1px solid var(--crm-border) !important; }
html body[data-view="crm"] #view .aq-crm-panel .crm-control-table td { padding: 10px 16px !important; color: var(--crm-muted) !important; font-size: 12px !important; border-bottom: 1px solid #eef1f5 !important; }
html body[data-view="crm"] #view .aq-crm-panel .crm-control-table td :is(b,strong) { color: var(--crm-ink) !important; font-size: 12px !important; font-weight: 600 !important; }
html body[data-view="crm"] #view .crm-control-table :is(th,td):nth-child(4) { text-align: right !important; font-variant-numeric: tabular-nums; }
html body[data-view="crm"] #view .crm-control-badge { padding: 4px 9px !important; border-radius: 20px !important; font-size: 10px !important; font-weight: 600 !important; box-shadow: none !important; }
html body[data-view="crm"] #view .crm-control-badge.won { background: #eaf5ef !important; color: #317758 !important; }
html body[data-view="crm"] #view .crm-control-badge:is(.quoted,.sent) { background: #edf4ff !important; color: #2867ad !important; }
html body[data-view="crm"] #view .crm-control-badge.lost { background: #faeeee !important; color: #a44c50 !important; }
html body[data-view="crm"] #view .crm-priority-row :is(span b,strong) { color: var(--crm-ink) !important; font-size: 12px !important; font-weight: 600 !important; }
html body[data-view="crm"] #view .crm-priority-row em { font-weight: 600 !important; border: 0 !important; }
html body[data-view="crm"] #view .crm-priority-row em.overdue-critical { background: #faeeee !important; color: #a44c50 !important; }
html body[data-view="crm"] #view .crm-priority-row em.overdue { background: #fbf3e6 !important; color: #946c2d !important; }
html body[data-view="crm"] #view :is(.aq-customer-performance-head,.aq-customer-performance-row) { padding: 12px 18px !important; font-size: 12px !important; border-color: var(--crm-border) !important; }
html body[data-view="crm"] #view .aq-customer-performance-row b { color: var(--crm-ink) !important; font-weight: 600 !important; }
html body[data-view="crm"] #view .aq-crm-premium :is(button,select):focus-visible { outline: 2px solid #1769d2 !important; outline-offset: 3px !important; }
html body[data-view="crm"] #view :is(.aq-crm-kpi-segment,.crm-new-option,.aq-crm-stage-summary button,.clickable-row,.crm-priority-row):hover { background: #f5f8fc !important; }
@media(max-width:1450px) {
  html body[data-view="crm"] #view .aq-crm-filters { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
  html body[data-view="crm"] #view .aq-crm-filter-actions { grid-column: 2 / -1 !important; justify-self: end !important; flex-wrap: wrap !important; }
}
@media(max-width:1000px) {
  html body[data-view="crm"] #view .aq-crm-kpis { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  html body[data-view="crm"] #view .aq-crm-filters > label:nth-child(3) { grid-column: auto !important; }
}
@media(max-width:720px) {
  html body[data-view="crm"] #view .aq-crm-premium { padding: 12px !important; }
  html body[data-view="crm"] #view .aq-crm-kpis { grid-template-columns: 1fr !important; }
  html body[data-view="crm"] #view .aq-crm-filters { grid-template-columns: 1fr !important; }
  html body[data-view="crm"] #view .aq-crm-filter-actions { grid-column: 1 !important; justify-self: stretch !important; min-width: 0 !important; }
  html body[data-view="crm"] #view .aq-crm-stage-summary { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

/* Reference composition: pipeline, quotations, then two existing lower panels. */
html body[data-view="crm"] #view .aq-crm-premium { grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel { order: 5 !important; }
html body[data-view="crm"] #view .aq-crm-follow-panel { grid-column: 1 !important; order: 6 !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel { grid-column: 2 !important; order: 6 !important; }
html body[data-view="crm"] #view .aq-crm-kpis .aq-crm-kpi-segment { position: relative !important; grid-template-columns: 48px minmax(0,1fr) !important; min-height: 126px !important; padding: 20px 40px 20px 20px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > i { width: 48px !important; height: 52px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment::after { content: '\203A'; position: absolute; right: 12px; top: 23px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #f0f5fd; color: #1769d2; font-size: 22px; line-height: 1; }
html body[data-view="crm"] #view .aq-crm-kpi-segment small { font-size: 11px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment b { font-size: clamp(18px,1.45vw,26px) !important; }
html body[data-view="crm"] #view .aq-crm-panel > header > div { position: relative; padding-left: 32px; }
html body[data-view="crm"] #view .aq-crm-panel > header > div::before { content: ''; position: absolute; left: 0; top: 3px; width: 21px; height: 25px; background: #1769d2; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 2h9l5 5v15H5V2zm8 2v5h4l-4-5zM8 12v2h8v-2H8zm0 4v2h8v-2H8z'/%3E%3C/svg%3E") center / contain no-repeat; }
html body[data-view="crm"] #view .aq-crm-pipeline-panel > header { border-bottom: 0 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary { gap: 0 !important; border-bottom: 0 !important; padding: 0 18px 18px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button { position: relative; grid-template-columns: 40px auto minmax(0,1fr) !important; grid-template-rows: auto auto !important; gap: 3px 9px !important; border: 0 !important; border-radius: 0 !important; min-height: 64px !important; padding: 10px 16px 10px 25px !important; box-shadow: none !important; clip-path: polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%,16px 50%); }
html body[data-view="crm"] #view .aq-crm-stage-summary button:first-child { clip-path: polygon(0 0,calc(100% - 16px) 0,100% 50%,calc(100% - 16px) 100%,0 100%); padding-left: 14px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button:last-child { clip-path: polygon(0 0,100% 0,100% 100%,0 100%,16px 50%); }
html body[data-view="crm"] #view .aq-crm-stage-summary button::before { content: '\25A4'; grid-column: 1; grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 40px; border-radius: 9px; background: rgb(255 255 255 / 55%); color: #1769d2; font-size: 24px; }
html body[data-view="crm"] #view .aq-crm-stage-summary b { grid-column: 2 / 4 !important; grid-row: 1 !important; color: #18283d !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary span { grid-column: 2 !important; grid-row: 2 !important; min-width: 0 !important; width: auto !important; height: auto !important; background: transparent !important; font-size: 16px !important; border-radius: 0 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary small { grid-column: 3 !important; grid-row: 2 !important; align-self: center; font-size: 10px !important; white-space: nowrap; }
html body[data-view="crm"] #view .aq-crm-stage-summary button[data-status="Won"]::before { color: #328567; }
html body[data-view="crm"] #view .aq-crm-stage-summary button[data-status="Follow Up"]::before { color: #aa752c; }
html body[data-view="crm"] #view .aq-crm-stage-summary button[data-status="Lost"]::before { color: #a44c50; }
html body[data-view="crm"] #view .aq-crm-quotation-panel { position: relative; }
html body[data-view="crm"] #view .aq-crm-quotation-panel > header { padding-right: 250px !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel > header p { display: none !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .global-data-export-tools { position: absolute !important; top: 12px; right: 16px; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .global-data-export-tools > span { display: none !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table td { padding-block: 8px !important; }
html body[data-view="crm"] #view .aq-crm-follow-list .crm-priority-row { grid-template-columns: minmax(0,1fr) 100px 130px 64px !important; }
@media(max-width:1250px) {
 html body[data-view="crm"] #view .aq-crm-stage-summary button { grid-template-columns: auto minmax(0,1fr) !important; padding-left: 18px !important; }
 html body[data-view="crm"] #view .aq-crm-stage-summary button::before { display: none; }
 html body[data-view="crm"] #view .aq-crm-stage-summary b { grid-column: 1 / 3 !important; }
 html body[data-view="crm"] #view .aq-crm-stage-summary span { grid-column: 1 !important; }
 html body[data-view="crm"] #view .aq-crm-stage-summary small { grid-column: 2 !important; }
 html body[data-view="crm"] #view .aq-crm-premium { grid-template-columns: minmax(0,1fr) !important; }
 html body[data-view="crm"] #view :is(.aq-crm-follow-panel,.aq-crm-customer-panel) { grid-column: 1 !important; }
}
@media(max-width:720px) {
 html body[data-view="crm"] #view .aq-crm-quotation-panel > header { padding-right: 18px !important; }
 html body[data-view="crm"] #view .aq-crm-quotation-panel .global-data-export-tools { position: static !important; padding: 8px 12px !important; }
 html body[data-view="crm"] #view .aq-crm-follow-list .crm-priority-row { grid-template-columns: minmax(0,1fr) auto !important; }
}
/* Explicit placement wins the shared full-width panel reset. */
html body[data-view="crm"] #view .aq-crm-premium .aq-crm-follow-panel { grid-column: 1 !important; order: 6 !important; }
html body[data-view="crm"] #view .aq-crm-premium .aq-crm-customer-panel { grid-column: 2 !important; order: 6 !important; }
@media(max-width:1250px) {
 html body[data-view="crm"] #view .aq-crm-premium .aq-crm-customer-panel { grid-column: 1 !important; }
}
html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-customer-panel) { grid-row: 5 !important; }
@media(max-width:1250px) {
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-customer-panel) { grid-row: auto !important; }
}

/* Compact desktop proportions, including browsers with Windows display scaling. */
html body[data-view="crm"] #view .aq-crm-kpis .aq-crm-kpi-segment { min-height: 108px !important; padding: 16px 32px 16px 16px !important; grid-template-columns: 40px minmax(0,1fr) !important; column-gap: 10px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > i { width: 40px !important; height: 44px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment b { font-size: clamp(17px,1.4vw,24px) !important; white-space: nowrap !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment.green b { font-size: clamp(16px,1.3vw,23px) !important; letter-spacing: -.035em !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment::after { right: 8px; width: 22px; height: 22px; }
html body[data-view="crm"] #view .aq-crm-filters { padding: 10px 12px !important; gap: 10px !important; }
html body[data-view="crm"] #view .aq-crm-filters :is(select,.aq-crm-filter-date,.aq-crm-quick),
html body[data-view="crm"] #view .aq-crm-filters > button,
html body[data-view="crm"] #view .aq-crm-filter-actions > button { height: 36px !important; min-height: 36px !important; max-height: 36px !important; font-size: 11px !important; }
html body[data-view="crm"] #view .aq-crm-filter-actions { gap: 7px !important; }
html body[data-view="crm"] #view .aq-crm-filter-actions .aq-crm-quick { width: 140px !important; min-width: 140px !important; max-width: 140px !important; }
html body[data-view="crm"] #view .aq-crm-panel > header { min-height: 54px !important; padding: 10px 16px !important; }
html body[data-view="crm"] #view .aq-crm-panel > header h2 { font-size: 15px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary { padding: 0 14px 12px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button { min-height: 56px !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table td { height: 32px !important; padding: 6px 14px !important; line-height: 1.3 !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table th { height: 28px !important; padding: 6px 14px !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .global-data-export-tools { top: 9px; }
html body[data-view="crm"] #view .aq-crm-follow-list .crm-priority-row { min-height: 44px !important; padding: 7px 0 !important; }
html body[data-view="crm"] #view .aq-customer-performance-row { min-height: 44px !important; padding: 8px 16px !important; }
@media(min-width:1280px) {
 html body[data-view="crm"] #view .aq-crm-filters { grid-template-columns: minmax(100px,.8fr) minmax(100px,.8fr) minmax(130px,1fr) auto auto !important; }
 html body[data-view="crm"] #view .aq-crm-filters > label:nth-child(3) { grid-column: auto !important; }
 html body[data-view="crm"] #view .aq-crm-filter-actions { grid-column: auto !important; flex-wrap: nowrap !important; }
}
@media(max-width:1279px) and (min-width:721px) {
 html body[data-view="crm"] #view .aq-crm-kpis { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
html body[data-view="crm"] #view .aq-crm-filter-actions .aq-crm-quick { width: 158px !important; min-width: 158px !important; max-width: 158px !important; }
html body[data-view="crm"] #view .aq-crm-filter-actions .aq-crm-quick > span { white-space: nowrap !important; overflow: visible !important; text-overflow: clip !important; }

/* Label the count and aggregate value explicitly; preserve stage drill-downs. */
html body[data-view="crm"] #view .aq-crm-stage-summary button {
 grid-template-columns: minmax(0,1fr) !important;
 grid-template-rows: auto auto auto !important;
 gap: 5px !important;
 min-height: 88px !important;
 padding: 12px 24px !important;
 text-align: left !important;
}
html body[data-view="crm"] #view .aq-crm-stage-summary button:first-child { padding-left: 16px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button::before { display: none !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary b { grid-column: 1 !important; grid-row: 1 !important; font-size: 12px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary span { grid-column: 1 !important; grid-row: 2 !important; display: block !important; font-size: 20px !important; font-weight: 700 !important; }
html body[data-view="crm"] #view .aq-crm-stage-unit { font-size: 11px !important; color: #66758a !important; font-weight: 500 !important; font-style: normal !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary small { grid-column: 1 !important; grid-row: 3 !important; display: block !important; font-size: 11px !important; white-space: normal !important; line-height: 1.4 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary span { box-shadow: none !important; border: 0 !important; padding: 0 !important; }

/* Preserve the approved funnel arrows; the heading explains the status totals. */

/* Approved three-panel management layout, using the existing ERP population. */
html body[data-view="crm"] #view .aq-crm-premium { grid-template-columns: minmax(0,1.15fr) minmax(0,1fr) minmax(0,1fr) !important; }
html body[data-view="crm"] #view .aq-crm-premium .aq-crm-follow-panel { grid-column: 1 !important; grid-row: 5 !important; }
html body[data-view="crm"] #view .aq-crm-premium .aq-crm-chart-panel { grid-column: 2 !important; grid-row: 5 !important; order: 6 !important; }
html body[data-view="crm"] #view .aq-crm-premium .aq-crm-customer-panel { grid-column: 3 !important; grid-row: 5 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary button { grid-template-columns: 38px minmax(0,1fr) !important; gap: 3px 9px !important; min-height: 78px !important; padding: 10px 24px !important; }
html body[data-view="crm"] #view .aq-crm-stage-icon { grid-column: 1; grid-row: 1 / 4; display: grid; place-items: center; width: 36px; height: 42px; border-radius: 8px; background: rgb(255 255 255 / 55%); color: #1769d2; }
html body[data-view="crm"] #view .aq-crm-stage-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
html body[data-view="crm"] #view .aq-crm-stage-summary :is(b,span,small) { grid-column: 2 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary span { font-size: 17px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary small { font-size: 10px !important; }
html body[data-view="crm"] #view [data-status="Follow Up"] .aq-crm-stage-icon { color: #aa752c; }
html body[data-view="crm"] #view [data-status="Won"] .aq-crm-stage-icon { color: #328567; }
html body[data-view="crm"] #view [data-status="Lost"] .aq-crm-stage-icon { color: #a44c50; }
html body[data-view="crm"] #view .aq-crm-chart-body { padding: 10px 12px 12px; }
html body[data-view="crm"] #view .aq-crm-chart-legend { display: flex; justify-content: end; gap: 12px; font-size: 10px; color: #66758a; }
html body[data-view="crm"] #view .aq-crm-chart-legend span { display: inline-flex; gap: 5px; align-items: center; }
html body[data-view="crm"] #view .aq-crm-chart-legend i { width: 7px; height: 7px; border-radius: 2px; }
html body[data-view="crm"] #view .aq-crm-value-chart { display: block; width: 100%; height: auto; overflow: visible; }
html body[data-view="crm"] #view .aq-crm-value-chart text { font: 11px Inter,"Segoe UI",sans-serif; fill: #66758a; }
html body[data-view="crm"] #view .aq-crm-chart-note { margin: 4px 0 0; font-size: 10px; color: #66758a; }
html body[data-view="crm"] #view .aq-crm-period-label { font-size: 10px; color: #66758a; text-transform: capitalize; white-space: nowrap; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-head { grid-template-columns: minmax(0,1fr) 110px !important; padding: 8px 12px !important; font-size: 9px !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-head > span:nth-child(2) { display: none; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row { grid-template-columns: minmax(0,1fr) 110px !important; gap: 3px 8px !important; padding: 8px 12px !important; min-height: 44px !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row b { display: flex; gap: 7px; align-items: center; font-size: 10px !important; overflow: hidden; }
html body[data-view="crm"] #view .aq-crm-customer-rank { display: grid; place-items: center; flex: 0 0 17px; height: 17px; border-radius: 5px; background: #40516a; color: #fff; font-size: 10px; font-style: normal; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row > .crm-win-rate { grid-column: 1; grid-row: 2; justify-self: start; margin-left: 24px; padding: 0 !important; background: transparent !important; color: #66758a !important; font-size: 9px !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row strong { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 10px !important; text-align: right; }
html body[data-view="crm"] #view .aq-crm-follow-panel > header h2,
html body[data-view="crm"] #view .aq-crm-customer-panel > header h2 { font-size: 13px !important; }
html body[data-view="crm"] #view .aq-crm-follow-panel .aq-crm-follow-list { padding: 0 12px 8px !important; }
html body[data-view="crm"] #view .aq-crm-follow-columns { display: grid; grid-template-columns: minmax(0,1fr) 65px 105px; gap: 8px; background: #f7f9fc; padding: 8px 0; font-size: 9px; color: #66758a; text-transform: uppercase; }
html body[data-view="crm"] #view .aq-crm-follow-list .aq-crm-reference-follow { grid-template-columns: minmax(0,1fr) 65px 105px !important; gap: 4px 8px !important; min-height: 50px !important; padding: 8px 0 !important; }
html body[data-view="crm"] #view .aq-crm-reference-follow > span { grid-column: 1; grid-row: 1 / 3; }
html body[data-view="crm"] #view .aq-crm-reference-follow span b { font-size: 10px !important; }
html body[data-view="crm"] #view .aq-crm-reference-follow span small { display: block; font-size: 9px; color: #66758a; white-space: normal; line-height: 1.4; margin-top: 3px; }
html body[data-view="crm"] #view .aq-crm-reference-follow strong { font-size: 10px !important; }
html body[data-view="crm"] #view .aq-crm-reference-follow em { grid-column: 3; font-size: 9px !important; min-height: 22px !important; padding: 2px 5px !important; }
html body[data-view="crm"] #view .aq-crm-reference-follow i { grid-column: 3; justify-self: start; height: 22px !important; min-height: 22px !important; font-size: 9px !important; }
@media(max-width:1250px) {
 html body[data-view="crm"] #view .aq-crm-premium { grid-template-columns: minmax(0,1fr) !important; }
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) { grid-column: 1 !important; grid-row: auto !important; }
 html body[data-view="crm"] #view .aq-crm-stage-icon { display: none; }
 html body[data-view="crm"] #view .aq-crm-stage-summary button { grid-template-columns: minmax(0,1fr) !important; }
 html body[data-view="crm"] #view .aq-crm-stage-summary :is(b,span,small) { grid-column: 1 !important; }
}

/* Final reference alignment: compact natural-height panels and legible totals. */
html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) { align-self: start !important; height: auto !important; min-height: 0 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary small { grid-column: 1 / -1 !important; white-space: nowrap !important; font-size: 10px !important; font-weight: 500 !important; }
html body[data-view="crm"] #view .aq-crm-stage-icon { grid-row: 1 / 3 !important; }
html body[data-view="crm"] #view .aq-crm-follow-list .aq-crm-reference-follow { grid-template-rows: auto auto !important; align-content: center !important; min-height: 48px !important; padding: 6px 0 !important; }
html body[data-view="crm"] #view .aq-crm-reference-follow span b { font-weight: 600 !important; }
html body[data-view="crm"] #view .aq-crm-reference-follow span small { font-weight: 400 !important; }
html body[data-view="crm"] #view .aq-crm-reference-follow em { line-height: 1.3 !important; }
html body[data-view="crm"] #view .aq-crm-chart-body { padding-bottom: 14px !important; }
html body[data-view="crm"] #view .aq-crm-pipeline-panel > header > div::before,
html body[data-view="crm"] #view .aq-crm-chart-panel > header > div::before {
 mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='14' width='5' height='8' rx='1'/%3E%3Crect x='10' y='8' width='5' height='14' rx='1'/%3E%3Crect x='18' y='2' width='5' height='20' rx='1'/%3E%3C/svg%3E");
}
html body[data-view="crm"] #view .aq-crm-follow-panel > header > div::before {
 mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a6 6 0 0 0-6 6v6l-3 4h18l-3-4V8a6 6 0 0 0-6-6zm-3 18a3 3 0 0 0 6 0H9z'/%3E%3C/svg%3E");
}
html body[data-view="crm"] #view .aq-crm-customer-panel > header > div::before {
 background: #294d76;
 mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h12v3h4v3a6 6 0 0 1-6 6 6 6 0 0 1-3 2v4h5v2H6v-2h5v-4a6 6 0 0 1-3-2 6 6 0 0 1-6-6V5h4V2zm0 5H4v1a4 4 0 0 0 3 4L6 7zm12 0-1 5a4 4 0 0 0 3-4V7h-2z'/%3E%3C/svg%3E");
}
@media(max-width:1250px) {
 html body[data-view="crm"] #view .aq-crm-stage-summary small { white-space: normal !important; }
}

/* Balanced lower row: equal card heights with contained lists and a larger plot. */
@media(min-width:1251px) {
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) {
  height: 360px !important;
  min-height: 360px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
 }
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) > header { flex: 0 0 auto; }
 html body[data-view="crm"] #view .aq-crm-premium .aq-crm-follow-list,
 html body[data-view="crm"] #view .aq-crm-premium .aq-customer-performance-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin !important;
 }
 html body[data-view="crm"] #view .aq-crm-chart-body { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; }
 html body[data-view="crm"] #view .aq-crm-value-chart { flex: 1 1 auto; min-height: 0; height: 100% !important; }
 html body[data-view="crm"] #view .aq-crm-chart-legend,
 html body[data-view="crm"] #view .aq-crm-chart-note { flex: 0 0 auto; }
 html body[data-view="crm"] #view .aq-crm-follow-columns,
 html body[data-view="crm"] #view .aq-customer-performance-head { position: sticky; top: 0; z-index: 1; background: #f7f9fc !important; }
}

/* Align the lower-panel contents as well as their outer card boundaries. */
@media(min-width:1251px) {
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) > header {
  height: 64px !important;
  min-height: 64px !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  align-items: center !important;
 }
 html body[data-view="crm"] #view .aq-crm-premium .aq-crm-follow-list,
 html body[data-view="crm"] #view .aq-crm-premium .aq-customer-performance-list { overflow-y: auto !important; scrollbar-width: thin !important; }
 html body[data-view="crm"] #view .aq-crm-follow-panel .aq-crm-follow-list { padding: 0 12px !important; }
 html body[data-view="crm"] #view .aq-crm-follow-columns { height: 28px; box-sizing: border-box; padding: 7px 0; }
 html body[data-view="crm"] #view .aq-crm-follow-list .aq-crm-reference-follow {
  grid-template-columns: minmax(0,1fr) 55px 100px !important;
  grid-template-rows: 17px 17px !important;
  min-height: 44px !important;
  height: 44px !important;
  padding: 5px 0 !important;
  gap: 0 8px !important;
  box-sizing: border-box !important;
 }
 html body[data-view="crm"] #view .aq-crm-follow-columns { grid-template-columns: minmax(0,1fr) 55px 100px !important; }
 html body[data-view="crm"] #view .aq-crm-reference-follow strong { grid-column: 2; grid-row: 1 / 3; align-self: center; text-align: left; }
 html body[data-view="crm"] #view .aq-crm-reference-follow em { grid-row: 1; min-height: 16px !important; height: 16px !important; padding: 1px 4px !important; align-self: center; }
 html body[data-view="crm"] #view .aq-crm-reference-follow i { grid-row: 2; height: 16px !important; min-height: 16px !important; border: 0 !important; padding: 0 !important; background: transparent !important; justify-self: start; }
 html body[data-view="crm"] #view .aq-crm-reference-follow span small { margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
 html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-head { height: 28px !important; min-height: 28px !important; box-sizing: border-box; padding-block: 7px !important; }
 html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row { height: 44px !important; min-height: 44px !important; padding: 5px 12px !important; box-sizing: border-box; }
 html body[data-view="crm"] #view .aq-crm-chart-legend { min-height: 18px; align-items: center; }
 html body[data-view="crm"] #view .aq-crm-chart-body { padding-top: 5px !important; padding-bottom: 10px !important; }
 html body[data-view="crm"] #view .aq-crm-chart-note { font-size: 9px !important; line-height: 1.4; }
}

/* Compact reference composition. Existing buttons and monthly scope are retained. */
html body[data-view="crm"] #view .aq-crm-stage-summary button,
html body[data-view="crm"] #view .aq-crm-stage-summary button:first-child {
 grid-template-columns: 30px auto minmax(0,1fr) !important;
 grid-template-rows: auto auto !important;
 min-height: 60px !important;
 padding: 10px 16px !important;
 gap: 3px 7px !important;
}
html body[data-view="crm"] #view .aq-crm-stage-icon { grid-column: 1 !important; grid-row: 1 / 3 !important; width: 30px; height: 36px; }
html body[data-view="crm"] #view .aq-crm-stage-summary b { grid-column: 2 / 4 !important; grid-row: 1 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary span { grid-column: 2 !important; grid-row: 2 !important; font-size: 16px !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary small { grid-column: 3 !important; grid-row: 2 !important; font-size: 9px !important; align-self: center; white-space: nowrap !important; }
html body[data-view="crm"] #view .aq-crm-stage-unit,
html body[data-view="crm"] #view .aq-crm-stage-value-label { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
html body[data-view="crm"] #view .aq-crm-period-label { padding: 8px 10px; border: 1px solid #e5eaf0; border-radius: 6px; background: #fff; }
@media(min-width:1251px) {
 html body[data-view="crm"] #view .aq-crm-premium { grid-template-columns: minmax(0,1.25fr) minmax(0,1.05fr) minmax(0,1fr) !important; }
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) { height: 330px !important; min-height: 330px !important; }
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) > header { height: 58px !important; min-height: 58px !important; }
 html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row { height: 40px !important; min-height: 40px !important; }
 html body[data-view="crm"] #view .aq-crm-follow-columns { grid-template-columns: minmax(0,1.1fr) minmax(0,.8fr) 52px 90px !important; }
 html body[data-view="crm"] #view .aq-crm-follow-list .aq-crm-reference-follow { grid-template-columns: minmax(0,1.1fr) minmax(0,.8fr) 52px 90px !important; height: 40px !important; min-height: 40px !important; grid-template-rows: auto !important; align-items: center !important; }
 html body[data-view="crm"] #view .aq-crm-reference-follow > span { grid-column: 1 !important; grid-row: 1 !important; }
 html body[data-view="crm"] #view .aq-crm-reference-follow .aq-crm-next-action { grid-column: 2 !important; grid-row: 1 !important; font-size: 9px !important; color: #66758a; font-style: normal; overflow: hidden; text-overflow: ellipsis; }
 html body[data-view="crm"] #view .aq-crm-reference-follow strong { grid-column: 3 !important; grid-row: 1 !important; font-size: 9px !important; }
 html body[data-view="crm"] #view .aq-crm-reference-follow em { grid-column: 4 !important; grid-row: 1 !important; height: auto !important; min-height: 18px !important; }
 html body[data-view="crm"] #view .aq-crm-reference-follow i { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip-path: inset(50%); }
}
@media(max-width:1250px) {
 html body[data-view="crm"] #view .aq-crm-stage-summary button,
 html body[data-view="crm"] #view .aq-crm-stage-summary button:first-child { grid-template-columns: auto minmax(0,1fr) !important; }
 html body[data-view="crm"] #view .aq-crm-stage-summary b { grid-column: 1 / 3 !important; }
 html body[data-view="crm"] #view .aq-crm-stage-summary span { grid-column: 1 !important; }
 html body[data-view="crm"] #view .aq-crm-stage-summary small { grid-column: 2 !important; white-space: normal !important; }
 html body[data-view="crm"] #view .aq-crm-next-action { grid-column: 1; font-size: 10px; font-style: normal; color: #66758a; }
}

/* Won-value ranking: keep conversion in customer detail, not the leaderboard. */
/* Inset quotation register and restrained stage accents from the approved reference. */
html body[data-view="crm"] #view .aq-crm-quotation-panel > header { border-bottom: 0 !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table-wrap { width: auto !important; margin: 0 14px 12px !important; border: 1px solid #e5eaf0 !important; border-radius: 6px !important; overflow: auto !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table { width: 100% !important; border-collapse: collapse !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table th { background: #f3f6fa !important; color: #66758a !important; font-weight: 600 !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table :is(th,td):nth-child(4) { text-align: right !important; font-variant-numeric: tabular-nums; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table :is(th,td):last-child { width: 54px !important; text-align: right !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table tbody tr:last-child td { border-bottom: 0 !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-more { width: 26px !important; height: 26px !important; min-height: 26px !important; padding: 4px !important; border-radius: 6px !important; background: #fff !important; border: 1px solid #e5eaf0 !important; }
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-more:hover { background: #edf4ff !important; border-color: #bdd6f7 !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary [data-status="Quoted"] .aq-crm-stage-icon { background: #e3efff !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary [data-status="Sent"] .aq-crm-stage-icon { background: #edf0f4 !important; color: #40516a !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary [data-status="Follow Up"] .aq-crm-stage-icon { background: #fff1df !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary [data-status="Won"] .aq-crm-stage-icon { background: #e0f5eb !important; }
html body[data-view="crm"] #view .aq-crm-stage-summary [data-status="Lost"] .aq-crm-stage-icon { background: #fde7e9 !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row > .crm-win-rate { display: none !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row { grid-template-rows: 1fr !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-row strong { grid-row: 1 !important; }
html body[data-view="crm"] #view .aq-crm-customer-panel .aq-customer-performance-head > span:last-child { text-align: right; }
@media(max-width:1250px) {
 html body[data-view="crm"] #view .aq-crm-follow-columns { grid-template-columns: minmax(0,1fr) minmax(0,.8fr) 65px 105px !important; }
 html body[data-view="crm"] #view .aq-crm-follow-list .aq-crm-reference-follow { grid-template-columns: minmax(0,1fr) minmax(0,.8fr) 65px 105px !important; }
 html body[data-view="crm"] #view .aq-crm-reference-follow > span { grid-column: 1 !important; }
 html body[data-view="crm"] #view .aq-crm-reference-follow .aq-crm-next-action { grid-column: 2; grid-row: 1 / 3; align-self: center; }
 html body[data-view="crm"] #view .aq-crm-reference-follow strong { grid-column: 3; grid-row: 1 / 3; align-self: center; }
 html body[data-view="crm"] #view .aq-crm-reference-follow em,
 html body[data-view="crm"] #view .aq-crm-reference-follow i { grid-column: 4; }
}

/* Reference KPI and filter proportions; scoped entirely to the CRM content. */
html body[data-view="crm"] #view .aq-crm-control-icon { display: inline-flex; flex: 0 0 16px; width: 16px; height: 16px; align-items: center; }
html body[data-view="crm"] #view .aq-crm-control-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
html body[data-view="crm"] #view .aq-crm-filters > button,
html body[data-view="crm"] #view .aq-crm-filter-actions > button,
html body[data-view="crm"] #view .aq-crm-filter-date { display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 7px !important; white-space: nowrap !important; }
html body[data-view="crm"] #view .aq-crm-kpis .aq-crm-kpi-segment { align-content: center !important; gap: 5px 14px !important; padding: 18px 32px 18px 18px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment small { color: #334f72 !important; font-weight: 650 !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment.green::after { color: #328567 !important; background: #edf7f2 !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment.orange::after { color: #66758a !important; background: #f3f5f8 !important; }
@media(min-width:1251px) {
 html body[data-view="crm"] #view .aq-crm-filters { grid-template-columns: minmax(115px,.8fr) minmax(115px,.8fr) minmax(140px,1fr) auto auto !important; gap: 10px !important; padding: 12px 14px !important; }
 html body[data-view="crm"] #view .aq-crm-filters select { padding-left: 12px !important; padding-right: 25px !important; text-overflow: clip !important; }
 html body[data-view="crm"] #view .aq-crm-filters > button { padding-inline: 10px !important; }
 html body[data-view="crm"] #view .aq-crm-filter-date { padding-inline: 9px !important; }
 html body[data-view="crm"] #view .aq-crm-filter-actions { flex-wrap: nowrap !important; gap: 8px !important; }
 html body[data-view="crm"] #view .aq-crm-filter-actions > button { padding-inline: 10px !important; }
 html body[data-view="crm"] #view .aq-crm-filter-actions .aq-crm-quick { width: 148px !important; min-width: 148px !important; max-width: 148px !important; }
}

/* Stable KPI baselines: notes may wrap without moving labels or values. */
html body[data-view="crm"] #view .aq-crm-kpis .aq-crm-kpi-segment {
 display: grid !important;
 grid-template-columns: 40px minmax(0,1fr) !important;
 grid-template-rows: 16px 26px 28px !important;
 align-content: start !important;
 align-items: start !important;
 gap: 3px 12px !important;
 height: 104px !important;
 min-height: 104px !important;
 padding: 14px 30px 14px 16px !important;
 box-sizing: border-box !important;
 text-align: left !important;
}
html body[data-view="crm"] #view .aq-crm-kpi-segment > small { grid-row: 1 !important; line-height: 16px !important; font-size: 10px !important; white-space: nowrap !important; letter-spacing: 0 !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > b { grid-row: 2 !important; line-height: 26px !important; font-size: 22px !important; letter-spacing: -.025em !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment.green > b { font-size: clamp(16px,1.25vw,22px) !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > span { grid-row: 3 !important; line-height: 14px !important; font-size: 10px !important; margin: 0 !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > i { align-self: start !important; margin-top: 8px !important; width: 40px !important; height: 44px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment::after { top: 15px !important; right: 8px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > :is(small,b,span) { align-self: start !important; margin: 0 !important; padding: 0 !important; }

/* Shared CRM report range stays on one horizontal row at every width. */
html body #modal[data-crm-scope] .crm-modal-report-range {
 display: flex !important;
 flex-flow: row nowrap !important;
 align-items: flex-end !important;
 gap: 12px !important;
 padding: 12px 14px !important;
 margin: 0 0 14px !important;
 border: 1px solid #e5eaf0 !important;
 border-radius: 8px !important;
 background: #f7f9fc !important;
 overflow-x: auto !important;
}
html body #modal[data-crm-scope] .crm-modal-report-range label { display: flex !important; flex-direction: column !important; flex: 0 0 170px !important; gap: 5px !important; margin: 0 !important; font-size: 11px !important; color: #66758a !important; font-weight: 600 !important; }
html body #modal[data-crm-scope] .crm-modal-report-range input { width: 170px !important; min-width: 170px !important; height: 36px !important; min-height: 36px !important; padding: 6px 10px !important; box-sizing: border-box !important; font-size: 12px !important; background: white !important; }
html body #modal[data-crm-scope] .crm-modal-report-range button { flex: 0 0 auto !important; height: 36px !important; min-height: 36px !important; padding: 6px 14px !important; margin: 0 !important; white-space: nowrap !important; font-size: 12px !important; }
html body #modal[data-crm-scope] .crm-modal-report-range .button { background: #1769d2 !important; border-color: #1769d2 !important; color: white !important; }
html body #modal[data-crm-scope] .crm-modal-report-range small { flex: 0 0 auto !important; align-self: flex-end !important; line-height: 36px !important; font-size: 11px !important; color: #66758a !important; white-space: nowrap !important; }
html body #modal[data-crm-scope] .crm-performance-register-row > b,
html body #modal[data-crm-scope] .compact-record-customer > span:nth-child(2),
html body[data-view="crm"] #view .aq-crm-customer-performance-row > b { text-transform: uppercase !important; }
@media print { .crm-modal-report-range button { display: none !important; } }
html body[data-view="crm"] #view input.aq-crm-period-label { flex: 0 0 120px !important; width: 120px !important; min-width: 120px !important; height: 32px !important; min-height: 32px !important; padding: 5px 7px !important; font-size: 10px !important; color: #18283d !important; cursor: pointer; }
html body #modal[data-crm-scope] :is(.compact-record-quote,.compact-record-delivery) > span:nth-child(2),
html body #modal[data-crm-scope] .crm-priority-row b,
html body[data-view="crm"] #view .aq-customer-performance-row > b { text-transform: uppercase !important; }

/* Compact management KPIs with consistent baselines and less unused padding. */
html body[data-view="crm"] #view .aq-crm-kpis .aq-crm-kpi-segment {
 height: 92px !important;
 min-height: 92px !important;
 grid-template-rows: 14px 24px 28px !important;
 padding: 10px 30px 10px 14px !important;
 gap: 3px 10px !important;
}
html body[data-view="crm"] #view .aq-crm-kpi-segment > small { line-height: 14px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > b { line-height: 24px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment > i { margin-top: 6px !important; }
html body[data-view="crm"] #view .aq-crm-kpi-segment::after { top: 11px !important; }

/* The chart title owns the first line; its month picker sits on the second. */
html body[data-view="crm"] #view .aq-crm-chart-panel > header {
 display: grid !important;
 grid-template-columns: minmax(0,1fr) 120px !important;
 grid-template-rows: 20px 28px !important;
 gap: 4px 8px !important;
 height: 74px !important;
 min-height: 74px !important;
 padding: 10px 14px !important;
 overflow: visible !important;
 box-sizing: border-box !important;
}
html body[data-view="crm"] #view .aq-crm-chart-panel > header > div {
 grid-column: 1 / -1 !important;
 grid-row: 1 / 3 !important;
 align-self: start !important;
 min-width: 0 !important;
 padding-left: 30px !important;
}
html body[data-view="crm"] #view .aq-crm-chart-panel > header h2 {
 margin: 0 !important;
 font-size: 13px !important;
 line-height: 20px !important;
 white-space: nowrap !important;
}
html body[data-view="crm"] #view .aq-crm-chart-panel > header p {
 width: calc(100% - 128px) !important;
 margin: 8px 0 0 !important;
 line-height: 16px !important;
 font-size: 10px !important;
 white-space: nowrap !important;
 overflow: hidden !important;
 text-overflow: ellipsis !important;
}
html body[data-view="crm"] #view .aq-crm-chart-panel > header > input.aq-crm-period-label {
 grid-column: 2 !important;
 grid-row: 2 !important;
 height: 28px !important;
 min-height: 28px !important;
 align-self: center !important;
 justify-self: end !important;
 margin: 0 !important;
 position: relative;
 z-index: 1;
}
@media(min-width:1251px) {
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) { height: 346px !important; min-height: 346px !important; }
 html body[data-view="crm"] #view .aq-crm-premium :is(.aq-crm-follow-panel,.aq-crm-chart-panel,.aq-crm-customer-panel) > header { height: 74px !important; min-height: 74px !important; }
}
/* Customer names use the same capitals in the quotation dashboard and reports. */
html body[data-view="crm"] #view .aq-crm-quotation-panel .crm-control-table tbody td:first-child,
html body[data-view="crm"] #view .aq-crm-reference-follow > span > b { text-transform: uppercase !important; }
html body #modal[data-crm-scope] #crmCustomerForm input[name="name"] { text-transform: uppercase; }
