/**
 * Shared Simple mode tokens, mode bar, and field typography for record detail views.
 */

:root {
  --ro-simple-font: 13px;
  --ro-simple-label-font: 12px;
  --ro-simple-row-h: 28px;
  --ro-simple-pad-x: 12px;
  --ro-simple-pad-y: 3px;
  --ro-simple-label-w: 132px;
  --ro-simple-input-max-w: min(100%, 360px);
  --ro-simple-textarea-max-w: min(100%, 480px);
  --ro-border: #e2e8f0;
  --ro-border-strong: #cbd5e1;
  --ro-page-bg: #f1f5f9;
  --ro-form-bg: #ffffff;
  --ro-label-color: #475569;
  --ro-value-color: #0f172a;
  --ro-section-color: #64748b;
  --ro-input-border: #cbd5e1;
  --ro-input-bg: #ffffff;
  --ro-input-readonly-bg: #f8fafc;
  --ro-accent: #2563eb;
  --ro-edit-btn-bg: #0f172a;
  --ro-edit-btn-bg-hover: #1e293b;
  --ro-edit-btn-border: #0f172a;
  --ro-edit-btn-color: #ffffff;
  --ro-layout-gap: 14px;
  --ro-card-radius: 8px;
  --ro-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 14px rgba(15, 23, 42, 0.03);
}

/* ── Mode bar (project / invoice / quote) ── */
.record-overview-mode-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px 10px;
  padding: 6px 12px;
  margin: 0 0 8px;
  border: 1px solid var(--ro-border, #e2e8f0);
  border-radius: var(--ro-card-radius, 8px);
  background: #fff;
  box-sizing: border-box;
  min-width: 0;
  position: relative;
  min-height: 36px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.record-overview-mode-bar[hidden] {
  display: none !important;
}

.record-overview-mode-bar--advanced {
  justify-content: center;
  padding: 5px 10px;
  margin: 0 0 8px;
}

.record-overview-mode-bar--advanced .record-overview-mode-bar__simple-only {
  display: none !important;
}

.record-overview-mode-bar--simple {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  align-items: center !important;
  gap: 8px 10px !important;
  flex-wrap: unset !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: visible !important;
}

.record-overview-mode-bar--simple .record-overview-mode-bar__start {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.record-overview-mode-bar--simple .record-overview-mode-bar__end {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.record-overview-mode-bar--simple .record-overview-mode-bar__toggle {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.record-overview-mode-bar--advanced .record-overview-mode-bar__toggle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.record-overview-mode-bar__start,
.record-overview-mode-bar__end {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.record-overview-mode-bar__toggle {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
}

.record-overview-mode-bar__btn {
  flex: 0 0 auto;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid var(--ro-border-strong, #cbd5e1);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  min-height: 28px;
}

.record-overview-mode-bar__btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.record-overview-mode-bar__edit:not(.record-overview-mode-bar__edit--save) {
  background: var(--ro-edit-btn-bg, #0f172a);
  border-color: var(--ro-edit-btn-border, #0f172a);
  color: var(--ro-edit-btn-color, #fff);
}

.record-overview-mode-bar__edit:not(.record-overview-mode-bar__edit--save):hover {
  background: var(--ro-edit-btn-bg-hover, #1e293b);
  border-color: var(--ro-edit-btn-bg-hover, #1e293b);
  color: var(--ro-edit-btn-color, #fff);
}

.record-overview-mode-bar__edit--save {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.record-overview-mode-bar__edit--save:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.record-overview-mode-bar__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-overview-mode-toggle {
  border: 1px solid var(--ro-border-strong, #cbd5e1);
  border-radius: 6px;
  background: #f1f5f9;
  overflow: hidden;
  padding: 2px;
  display: inline-flex;
}

.record-overview-mode-btn {
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  color: #64748b;
  background: transparent;
  border: none;
  cursor: pointer;
  min-height: 24px;
}

.record-overview-mode-btn--active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
  .record-overview-mode-bar--simple,
  .record-overview-mode-bar--simple.record-overview-mode-bar--stacked {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 8px 10px !important;
    padding: 8px 10px 10px !important;
    margin: 0 0 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .record-overview-mode-bar--simple .record-overview-mode-bar__start {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: start !important;
  }

  .record-overview-mode-bar--simple .record-overview-mode-bar__end {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
  }

  .record-overview-mode-bar--simple .record-overview-mode-bar__toggle {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Shared simple field typography (scoped by surface CSS) */
[data-project-overview-mode="simple"],
[data-invoice-overview-mode="simple"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.ro-simple-field-group {
  position: relative;
  padding: 8px 12px 4px;
  margin: 0;
  border-top: 1px solid var(--ro-border);
  background: var(--ro-form-bg);
}

.ro-simple-field-group:first-child {
  border-top: none;
  padding-top: 10px;
}

.ro-simple-section-title,
[data-project-overview-mode="simple"] .contact-field-group-title,
[data-invoice-overview-mode="simple"] .contact-field-group-title {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--ro-section-color) !important;
  padding: 0 0 6px !important;
  margin: 0 0 2px !important;
  line-height: 1.2 !important;
}

[data-project-overview-mode="simple"] .contact-field-group-title svg,
[data-invoice-overview-mode="simple"] .contact-field-group-title svg {
  display: none !important;
}

[data-project-overview-mode="simple"] .detailRow .label,
[data-project-overview-mode="simple"] .contact-field-label,
[data-project-overview-mode="simple"] .invoice-ov-label,
[data-invoice-overview-mode="simple"] .detailRow .label,
[data-invoice-overview-mode="simple"] .invoice-ov-label {
  font-size: var(--ro-simple-label-font) !important;
  font-weight: 500 !important;
  color: var(--ro-label-color) !important;
}

[data-project-overview-mode="simple"] .detailRow .value,
[data-project-overview-mode="simple"] .invoice-ov-value,
[data-invoice-overview-mode="simple"] .detailRow .value,
[data-invoice-overview-mode="simple"] .invoice-ov-value {
  font-size: var(--ro-simple-font) !important;
  color: var(--ro-value-color) !important;
}

[data-project-overview-mode="simple"] .contact-detail-tab-btn,
[data-invoice-overview-mode="simple"] .contact-detail-tab-btn {
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  min-height: 0 !important;
  border-radius: 6px 6px 0 0 !important;
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
}

[data-project-overview-mode="simple"] .contact-detail-tab-btn.is-active,
[data-project-overview-mode="simple"] .contact-detail-tab-btn.active,
[data-invoice-overview-mode="simple"] .contact-detail-tab-btn.is-active,
[data-invoice-overview-mode="simple"] .contact-detail-tab-btn.active {
  color: #0f172a !important;
  border-bottom-color: var(--ro-accent) !important;
}

/* =============================================================================
   Canonical Simple field rows — master: contact overview (contact-overview-simple-mode.css)
   Applied anywhere .contact-overview-simple-fields is toggled on (contact, invoice, quote, project).
   ============================================================================= */

.crm-contact-overview-fields.contact-overview-simple-fields {
  --co-simple-font: var(--ro-simple-font, 13px);
  --co-simple-label-font: var(--ro-simple-label-font, 12px);
  --co-simple-row-h: var(--ro-simple-row-h, 28px);
  --co-simple-pad-x: var(--ro-simple-pad-x, 12px);
  --co-simple-pad-y: var(--ro-simple-pad-y, 3px);
  --co-simple-label-w: var(--ro-simple-label-w, 132px);
  --co-simple-input-max-w: var(--ro-simple-input-max-w, min(100%, 360px));
  --co-simple-textarea-max-w: var(--ro-simple-textarea-max-w, min(100%, 480px));
  --co-border: var(--ro-border, #e2e8f0);
  --co-label-color: var(--ro-label-color, #475569);
  --co-value-color: var(--ro-value-color, #0f172a);
  --co-section-color: var(--ro-section-color, #64748b);
  --co-input-border: var(--ro-input-border, #cbd5e1);
  --co-input-bg: var(--ro-input-bg, #ffffff);
  --co-input-readonly-bg: var(--ro-input-readonly-bg, #f8fafc);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .contact-field-group {
  position: relative !important;
  padding: 8px 12px 4px !important;
  margin: 0 !important;
  border: none !important;
  border-top: 1px solid var(--co-border) !important;
  background: var(--ro-form-bg, #fff) !important;
  box-shadow: none !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .contact-field-group:first-child {
  border-top: none !important;
  padding-top: 10px !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .contact-field-group-title {
  position: static !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--co-section-color) !important;
  padding: 0 0 6px !important;
  margin: 0 0 2px !important;
  line-height: 1.2 !important;
  background: transparent !important;
  border: none !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .contact-overview-record-grid,
.crm-contact-overview-fields.contact-overview-simple-fields .contact-overview-record-grid--two,
.crm-contact-overview-fields.contact-overview-simple-fields .contact-overview-record-grid--simple-stack {
  display: block !important;
  gap: 0 !important;
  padding: 0 !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .contact-overview-record-card:not(.contact-overview-record-card--lead-date):not(.contact-overview-record-card--lead-from),
.crm-contact-overview-fields.contact-overview-simple-fields .contact-overview-record-card--span-2 {
  display: block !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .detailRow,
.crm-contact-overview-fields.contact-overview-simple-fields .multi-field-detail-row,
.crm-contact-overview-fields.contact-overview-simple-fields .contact-field-row,
.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field,
.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field--wide,
.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field--span2 {
  display: grid !important;
  grid-template-columns: var(--co-simple-label-w) minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: var(--co-simple-row-h) !important;
  padding: var(--co-simple-pad-y) var(--co-simple-pad-x) !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field-grid--identity,
.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field-grid--props,
.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field-grid--csz {
  display: block !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  grid-template-columns: unset !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-address-block--editing {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .detailRow .label,
.crm-contact-overview-fields.contact-overview-simple-fields .multi-field-detail-row .label,
.crm-contact-overview-fields.contact-overview-simple-fields .contact-field-row .label,
.crm-contact-overview-fields.contact-overview-simple-fields .contact-field-label,
.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-label {
  font-size: var(--co-simple-label-font) !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--co-label-color) !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  text-align: left !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .detailRow .value,
.crm-contact-overview-fields.contact-overview-simple-fields .multi-field-detail-row .value,
.crm-contact-overview-fields.contact-overview-simple-fields .contact-field-row .value,
.crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-value {
  font-size: var(--co-simple-font) !important;
  font-weight: 400 !important;
  font-family: inherit !important;
  color: var(--co-value-color) !important;
  min-height: 0 !important;
  padding: 0 !important;
  line-height: 1.25 !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields.editing .invoice-ov-value .inline-input,
.crm-contact-overview-fields.contact-overview-simple-fields.editing .invoice-ov-value select,
.crm-contact-overview-fields.contact-overview-simple-fields.editing .invoice-ov-value .searchable-dropdown-input {
  width: 100% !important;
  max-width: var(--co-simple-input-max-w) !important;
  box-sizing: border-box !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields.editing .invoice-ov-billto-actions {
  padding: var(--co-simple-pad-y) var(--co-simple-pad-x) !important;
  margin: 0 !important;
  border: none !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .detailRow .value,
.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .multi-field-detail-row .value,
.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .contact-field-row .value {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 4px !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .inline-input:not([type="checkbox"]):not([type="radio"]),
.crm-contact-overview-fields.contact-overview-simple-fields select.inline-input,
.crm-contact-overview-fields.contact-overview-simple-fields textarea.inline-input {
  font-size: var(--co-simple-font) !important;
  font-family: inherit !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  border: 1px solid var(--co-input-border) !important;
  line-height: 1.3 !important;
  box-shadow: none !important;
  background: var(--co-input-bg) !important;
  color: var(--co-value-color) !important;
  width: 100% !important;
  max-width: var(--co-simple-input-max-w) !important;
  box-sizing: border-box !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .detailRow .value > .inline-input[readonly],
.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly],
.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .detailRow .value > select:disabled,
.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .contact-overview-record-card .detailRow:not(.multi-field-detail-row) > .value > .inline-input[readonly],
.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .contact-overview-record-card .detailRow:not(.multi-field-detail-row) > .value > select:disabled {
  display: block !important;
  border: 1px solid var(--co-input-border) !important;
  background: var(--co-input-readonly-bg) !important;
  box-shadow: none !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 4px 8px !important;
  font-size: var(--co-simple-font) !important;
  font-weight: 400 !important;
  -webkit-text-fill-color: var(--co-value-color) !important;
  color: var(--co-value-color) !important;
  cursor: default !important;
  opacity: 1 !important;
  width: 100% !important;
  max-width: var(--co-simple-input-max-w) !important;
  box-sizing: border-box !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly] {
  height: auto !important;
  min-height: 52px !important;
  max-width: var(--co-simple-textarea-max-w) !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .detailRow:has(textarea),
.crm-contact-overview-fields.contact-overview-simple-fields .multi-field-detail-row {
  align-items: start !important;
  min-height: 0 !important;
  padding-top: 3px !important;
  padding-bottom: 3px !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .detailRow:has(textarea) .label,
.crm-contact-overview-fields.contact-overview-simple-fields .multi-field-detail-row .label {
  padding-top: 2px !important;
}

.crm-contact-overview-fields.contact-overview-simple-fields .mm-field-edit-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .crm-contact-overview-fields.contact-overview-simple-fields .detailRow,
  .crm-contact-overview-fields.contact-overview-simple-fields .multi-field-detail-row,
  .crm-contact-overview-fields.contact-overview-simple-fields .contact-field-row,
  .crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field,
  .crm-contact-overview-fields.contact-overview-simple-fields .invoice-ov-field--wide {
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr) !important;
  }
}

/* =============================================================================
   PASS 4 — Shared polish (contact, project, invoice simple overview views)
   ============================================================================= */

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"],
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"],
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] {
  --co-simple-input-max-w: 100%;
  --ro-simple-input-max-w: 100%;
  --co-section-color: #475569;
  --ro-section-color: #475569;
  --co-simple-label-w: 140px;
  --ro-simple-label-w: 140px;
  --co-simple-row-gap: 6px;
  --co-simple-section-pad: 10px 14px 8px;
  --co-simple-control-h: 30px;
  --co-simple-control-pad: 5px 10px;
  --co-simple-control-radius: 6px;
  --co-simple-row-pad-y: 4px;
  --co-simple-row-pad-x: 14px;
}

/* Identity header card */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .detailHeader.contact-detail-header-new,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .detailHeader.contact-detail-header-new,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .detailHeader.contact-detail-header-new {
  margin-bottom: 6px !important;
  box-shadow: var(--ro-card-shadow) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .detailHeader.contact-detail-header-new .metaWrap.contact-detail-header-wrap,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .detailHeader.contact-detail-header-new .metaWrap.contact-detail-header-wrap,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .detailHeader.contact-detail-header-new .metaWrap.contact-detail-header-wrap {
  overflow: hidden !important;
}

/* Simple mode: toggle only — no extra bar chrome between header and tabs */
body.contact-overview-simple-page .contact-overview-mode-bar--simple,
body.project-overview-simple-page .record-overview-mode-bar--simple,
body.invoice-overview-simple-page .record-overview-mode-bar--simple {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 0 8px !important;
  margin: 0 0 2px !important;
  min-height: 0 !important;
}

body.contact-overview-simple-page .contact-overview-mode-bar,
body.project-overview-simple-page .record-overview-mode-bar,
body.invoice-overview-simple-page .record-overview-mode-bar {
  margin: 0 0 6px !important;
}

body.project-overview-simple-page .record-overview-mode-bar--simple .record-overview-mode-bar__toggle,
body.invoice-overview-simple-page .record-overview-mode-bar--simple .record-overview-mode-bar__toggle {
  justify-self: center !important;
}

/* Tabs strip */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tabs-card,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-detail-tabs-card,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .project-detail-tabs-card,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .contact-detail-tabs-card {
  border-radius: var(--ro-card-radius, 8px) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tabs-header,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-detail-tabs-header,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .project-detail-tabs-header,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .contact-detail-tabs-header {
  padding: 0 2px !important;
  border-bottom: 1px solid var(--ro-border, #e2e8f0) !important;
  background: #fff !important;
  border-radius: var(--ro-card-radius, 8px) var(--ro-card-radius, 8px) 0 0 !important;
}

/* Form cards */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields.contact-details-card,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields.contact-details-card,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-overview-details-card,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields.contact-details-card {
  border-color: var(--ro-border, #e2e8f0) !important;
  box-shadow: var(--ro-card-shadow) !important;
}

/* Section groups + titles */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group {
  padding: var(--co-simple-section-pad) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group-title,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group-title,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group-title {
  margin-bottom: 6px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid var(--ro-border, #e2e8f0) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group-title-text,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group-title-text,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields .contact-field-group-title-text {
  color: var(--co-section-color) !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
}

/* Field rows */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .detailRow,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .multi-field-detail-row,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .contact-field-row,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields .detailRow,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields .contact-field-row,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields .detailRow,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-overview-surface .invoice-ov-field {
  grid-template-columns: var(--co-simple-label-w) minmax(0, 1fr) !important;
  gap: 10px var(--co-simple-row-gap) !important;
  padding: var(--co-simple-row-pad-y) var(--co-simple-row-pad-x) !important;
  min-height: calc(var(--co-simple-control-h) + 8px) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .detailRow + .detailRow,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .multi-field-detail-row + .multi-field-detail-row,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields .contact-field-row + .contact-field-row,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields .detailRow + .detailRow,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields .contact-field-row + .contact-field-row,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields .detailRow + .detailRow,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-overview-surface .invoice-ov-field + .invoice-ov-field {
  border-top: 1px solid #f1f5f9 !important;
}

/* Unified readonly controls */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly],
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > select:disabled,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly],
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > select:disabled,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly],
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-field .inline-input[readonly],
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-field select:disabled {
  min-height: var(--co-simple-control-h) !important;
  height: var(--co-simple-control-h) !important;
  padding: var(--co-simple-control-pad) !important;
  border-radius: var(--co-simple-control-radius) !important;
  max-width: 100% !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly],
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly],
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly],
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-field textarea.inline-input[readonly] {
  min-height: 64px !important;
  height: auto !important;
  padding: 8px 10px !important;
}

/* Empty readonly fields — em dash instead of placeholder hints */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown),
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> textarea.inline-input[readonly]:placeholder-shown),
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown),
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> textarea.inline-input[readonly]:placeholder-shown),
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown),
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value:has(> .inline-input[readonly]:placeholder-shown),
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value:has(> textarea.inline-input[readonly]:placeholder-shown) {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: center !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown) > *,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> textarea.inline-input[readonly]:placeholder-shown) > *,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown) > *,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> textarea.inline-input[readonly]:placeholder-shown) > *,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown) > *,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value:has(> .inline-input[readonly]:placeholder-shown) > *,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value:has(> textarea.inline-input[readonly]:placeholder-shown) > * {
  grid-area: 1 / 1 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly]:placeholder-shown,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly]:placeholder-shown,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly]:placeholder-shown,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly]:placeholder-shown,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly]:placeholder-shown,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value > .inline-input[readonly]:placeholder-shown,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value > textarea.inline-input[readonly]:placeholder-shown {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly]:placeholder-shown::placeholder,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > textarea.inline-input[readonly]:placeholder-shown::placeholder,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly]:placeholder-shown::placeholder,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value > .inline-input[readonly]:placeholder-shown::placeholder,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value > .inline-input[readonly]:placeholder-shown::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown):not(:has(> .contact-overview-website-link))::after,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> textarea.inline-input[readonly]:placeholder-shown)::after,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown)::after,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> textarea.inline-input[readonly]:placeholder-shown)::after,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .detailRow .value:has(> .inline-input[readonly]:placeholder-shown)::after,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value:has(> .inline-input[readonly]:placeholder-shown)::after,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields:not(.editing) .invoice-ov-value:has(> textarea.inline-input[readonly]:placeholder-shown)::after {
  content: "—" !important;
  grid-area: 1 / 1 !important;
  display: flex !important;
  align-items: center !important;
  align-self: stretch !important;
  padding: var(--co-simple-control-pad) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  color: #94a3b8 !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
  z-index: 1 !important;
}

/* Edit focus ring */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields.editing .inline-input:focus,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields.editing select:focus,
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-fields.editing textarea:focus,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields.editing .inline-input:focus,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields.editing select:focus,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields.editing textarea:focus,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields.editing .inline-input:focus,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields.editing select:focus,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields.editing textarea:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
  background: #fff !important;
}

/* Record history / meta footer */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-record-meta-group,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .contact-record-meta-group,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-ov-meta-group.contact-field-group:last-child {
  padding-top: 6px !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-record-meta-group .contact-field-group-title,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .contact-record-meta-group .contact-field-group-title {
  border-bottom: none !important;
  margin-bottom: 2px !important;
  padding-bottom: 4px !important;
  font-size: 10px !important;
  letter-spacing: 0.05em !important;
  color: #94a3b8 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-record-meta-group .detailRow .label,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .contact-record-meta-group .detailRow .label {
  font-size: 11px !important;
  color: #94a3b8 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-record-meta-group .detailRow .value,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .contact-record-meta-group .detailRow .value {
  font-size: 12px !important;
  color: #64748b !important;
}

/* Notes rail (contact + project advanced notes card) */
body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-notes.contact-details-card,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-notes.contact-details-card {
  border-color: var(--ro-border, #e2e8f0) !important;
  box-shadow: var(--ro-card-shadow) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-notes .related-section-header,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-notes .related-section-header {
  display: flex !important;
  align-items: center !important;
  min-height: 36px !important;
  padding: 8px 14px !important;
  margin: 0 !important;
  background: #f8fafc !important;
  border-bottom: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--ro-card-radius, 8px) var(--ro-card-radius, 8px) 0 0 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-contact-overview-notes .related-section-title,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-notes .related-section-title {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--co-section-color) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .overview-note-composer,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .overview-note-composer {
  margin: 10px 12px 8px !important;
  padding: 8px !important;
  border: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--co-simple-control-radius, 6px) !important;
  background: #fff !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .overview-note-composer textarea,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .overview-note-composer textarea {
  min-height: 68px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--ro-input-border, #cbd5e1) !important;
  border-radius: var(--co-simple-control-radius, 6px) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-activity-item,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .contact-activity-item {
  padding: 7px 9px !important;
  margin: 0 0 5px !important;
  border: 1px solid #e8edf3 !important;
  border-radius: 6px !important;
  background: #fff !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

/* =============================================================================
   PASS 4b — Simple mode polish for non-overview tabs (contact, project, invoice)
   ============================================================================= */

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"],
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"],
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] {
  --ro-section-color: #475569;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]),
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane),
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-detail-tab-surface:not(:has(.invoice-overview-surface)),
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .quote-detail-tab-surface:not(:has(.invoice-overview-surface)) {
  padding-top: 8px !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]) .detailSection.contact-details-card,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane) .detailSection.contact-details-card,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane).detailSection.contact-details-card,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-detail-tab-surface .detailSection.contact-details-card,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .quote-detail-tab-surface .detailSection.contact-details-card {
  border: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--ro-card-radius, 8px) !important;
  box-shadow: var(--ro-card-shadow) !important;
  background: #fff !important;
  overflow: hidden !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]) .related-section-header,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane) .related-section-header,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-detail-tab-surface .related-section-header,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .quote-detail-tab-surface .related-section-header {
  display: flex !important;
  align-items: center !important;
  min-height: 36px !important;
  padding: 8px 14px !important;
  margin: 0 !important;
  background: #f8fafc !important;
  border-bottom: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--ro-card-radius, 8px) var(--ro-card-radius, 8px) 0 0 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]) .related-section-title,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane) .related-section-title,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-detail-tab-surface .related-section-title,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .quote-detail-tab-surface .related-section-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--ro-section-color, #475569) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]) .contact-tab-metrics,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane) .contact-tab-metrics {
  gap: 10px !important;
  margin-bottom: 10px !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]) .contact-tab-metric-card,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane) .contact-tab-metric-card {
  border: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--ro-card-radius, 8px) !important;
  box-shadow: var(--ro-card-shadow) !important;
  background: #fff !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]) .contact-tab-metric-label,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane) .contact-tab-metric-label {
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--ro-section-color, #475569) !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-detail-tab-panel:not([data-contact-detail-tab="overview"]) .contact-activity-item,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane) .contact-activity-item,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-detail-tab-surface .contact-activity-item,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .quote-detail-tab-surface .contact-activity-item {
  padding: 7px 9px !important;
  margin: 0 0 5px !important;
  border: 1px solid #e8edf3 !important;
  border-radius: 6px !important;
  background: #fff !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-detail-tab-surface:not(:has(.invoice-overview-surface)) .invoice-line-items-sticky-header,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .quote-detail-tab-surface:not(:has(.invoice-overview-surface)) .invoice-line-items-sticky-header {
  border: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--ro-card-radius, 8px) !important;
  box-shadow: var(--ro-card-shadow) !important;
  background: #fff !important;
  overflow: hidden !important;
}

body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane).project-pane-empty,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-tab-pane:not(.project-overview-pane).mm-project-tab-empty {
  border: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--ro-card-radius, 8px) !important;
  box-shadow: var(--ro-card-shadow) !important;
  background: #fff !important;
}

body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-notes.contact-details-card {
  border-color: var(--ro-border, #e2e8f0) !important;
  box-shadow: var(--ro-card-shadow) !important;
}

body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-notes .related-section-header {
  display: flex !important;
  align-items: center !important;
  min-height: 36px !important;
  padding: 8px 14px !important;
  margin: 0 !important;
  background: #f8fafc !important;
  border-bottom: 1px solid var(--ro-border, #e2e8f0) !important;
  border-radius: var(--ro-card-radius, 8px) var(--ro-card-radius, 8px) 0 0 !important;
}

body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-overview-details-card > h3,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-contact-overview-fields > h3,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields > h3 {
  display: none !important;
}

/* =============================================================================
   PASS 5 — KPI hero spacing in Simple mode (hero visibility restored in per-surface CSS)
   ============================================================================= */

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .contact-overview-top,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .contact-overview-top,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .project-record-overview-top,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .contact-overview-top,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-record-overview-top {
  margin: 0 0 12px !important;
  min-width: 0 !important;
}

body.contact-overview-simple-page #detailPanel[data-contact-overview-mode="simple"] .crm-overview-hero--contact-command,
body.project-overview-simple-page #projectsWrap[data-project-overview-mode="simple"] .crm-overview-hero--contact-command,
body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-overview-hero--contact-command {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
