/*
 * Invoices + Quotes dark mode.
 * This file intentionally loads after the invoice overview styles because
 * those modes contain high-specificity light surfaces and !important rules.
 */

/* ── List toolbar ────────────────────────────────────────────── */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list {
  background: #181818 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  color-scheme: dark;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout > section.filters-modern.list-toolbar-strip {
  background: #1a1a1a !important;
  background-image: none !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
  color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .list-toolbar-bar,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .filter-bar-main,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .filter-search-wrap {
  background: transparent !important;
  color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .list-toolbar-bar .filter-search-input,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout #invoiceSearch.filter-search-input {
  background: #1e1e1e !important;
  background-color: #1e1e1e !important;
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .list-toolbar-bar .filter-search-input:hover {
  background: #222222 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .list-toolbar-bar .filter-search-input:focus {
  background: #222222 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: 0 0 0 3px rgba(136, 192, 208, 0.2) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap #invoiceListOptionsBtn.actions-dropdown-btn,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-header-actions .btn:not(.primary) {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

/* ── KPI, priority rail, and Invoices / Quotes tabs ─────────── */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .td-kpi-strip,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .td-kpi-strip--invoice {
  background: #181818 !important;
  background-image: none !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .td-kpi-card {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap #invoicePriorityLegend.priority-legend,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap #quotePriorityLegend.priority-legend,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .priority-legend {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #8a8a8a !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .priority-legend .priority-legend-label,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .priority-legend .priority-legend-item {
  color: #8a8a8a !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container .invoice-gmail-subtabs-row {
  background: #1a1a1a !important;
  background-image: none !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
  color: #c6c6c6 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container .gmail-tab[data-tab="invoices"],
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container .gmail-tab[data-tab="quotes"] {
  background: transparent !important;
  background-image: none !important;
  color: #8a8a8a !important;
  border-color: transparent !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container .gmail-tab[data-tab="invoices"]:hover,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container .gmail-tab[data-tab="quotes"]:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #c6c6c6 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container .gmail-tab.active {
  background: #242424 !important;
  color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-gmail-subtabs-container .gmail-tab.active::after {
  background: #243038 !important;
}

/* ── Invoice / quote list workspace ─────────────────────────── */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-meta-row {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #8a8a8a !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-meta-row strong {
  color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table-wrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .pipe-list-table-wrap,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .pipe-list-table-wrap.list-workspace {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .pipe-list-table {
  background: #1a1a1a !important;
  color: #e6e6e6 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table thead tr,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table thead th,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .pipe-list-table thead tr,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-board-list .pipe-list-table thead th {
  background: #222222 !important;
  background-image: none !important;
  color: #8a8a8a !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-table tbody tr.pipe-list-row.invoice-row td,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-table tbody tr.pipe-list-row.quote-row td {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.12) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-table tbody tr.pipe-list-row:nth-child(even):not(.selected):not(:hover) td {
  background: #1a1a1a !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-table tbody tr.pipe-list-row:hover td {
  background: #242424 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-table tbody tr.pipe-list-row.selected td,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .list-workspace-table tbody tr.pipe-list-row:has(input[type="checkbox"]:checked) td {
  background: rgba(107, 138, 171, 0.28) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table .contact-list-check-td,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table .contact-list-head-check,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table .invoice-list-action-td,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table .invoice-list-th-actions,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table .contact-list-action-td {
  background: #1a1a1a !important;
  background-image: none !important;
  border-color: rgba(240, 240, 240, 0.12) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table thead .contact-list-head-check,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table thead .invoice-list-th-actions {
  background: #222222 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table .pipe-list-name,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-table a {
  color: #e6e6e6 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-card {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  box-shadow: none !important;
}

/* ── Invoice and quote detail shell ─────────────────────────── */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-detail-workspace,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-detail-workspace-body,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-detail-primary-column,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-record-main,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-detail-record-main {
  background: #181818 !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailHeader.contact-detail-header-new,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailHeader.contact-detail-header-new .metaWrap.contact-detail-header-wrap {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: none !important;
  color-scheme: dark !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contactName,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailHeader h1,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailHeader h2 {
  color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailHeader .mm-meta-line {
  color: #8a8a8a !important;
}

/* All invoice/quote record tabs. */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tabs-card,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-detail-tabs-card,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tabs-header,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-detail-tabs-header,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tabs-nav,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-detail-tabs-nav {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.invoice-tab,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.quote-tab,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-tab {
  background: transparent !important;
  background-image: none !important;
  color: #8a8a8a !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.invoice-tab:hover,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.quote-tab:hover,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-tab:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #c6c6c6 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.invoice-tab.is-active,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.invoice-tab.active,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.quote-tab.is-active,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tab-btn.quote-tab.active,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-tab.is-active,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-tab.active {
  background: #242424 !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-detail-tabs-body,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .project-tab-content,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-detail-tab-surface,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .quote-detail-tab-surface {
  background: #181818 !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

/* Overview hero and fields. */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-record-overview-top,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .crm-overview-hero,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-detail-hero {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .crm-contact-overview-fields,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-details-card,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailSection,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-field-group {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .contact-field-group-title,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-tab-sticky-header,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .related-section-header {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailRow,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-ov-field {
  background: transparent !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.12) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailRow .label,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-ov-label,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .muted {
  color: #8a8a8a !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .detailRow .value,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-ov-value,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root h1,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root h2,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root h3,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root h4 {
  color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root input,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root textarea,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root select,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .inline-input,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .searchable-dropdown-input {
  background: #1e1e1e !important;
  background-color: #1e1e1e !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
  box-shadow: none !important;
}

/* Tables and cards used by line items, payments, schedules, and activity tabs. */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .pipe-list-table-wrap,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-line-items-shell,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-payment-card,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-schedule-card,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .activityItem,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .invoice-settings-card {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .pipe-list-table th {
  background: #222222 !important;
  color: #8a8a8a !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap.invoice-detail-view-root .pipe-list-table td {
  background: #1a1a1a !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.12) !important;
}

/* Simple mode retokens. */
html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"],
html[data-theme="dark"] #invoicesWrap[data-invoice-overview-mode="simple"] {
  --ro-page-bg: #181818;
  --ro-form-bg: #1a1a1a;
  --ro-border: rgba(240, 240, 240, 0.22);
  --ro-input-border: rgba(240, 240, 240, 0.28);
  --ro-label-color: #909090;
  --ro-value-color: #e6e6e6;
  --ro-card-shadow: none;
  color-scheme: dark;
}

html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-detail-workspace-body,
html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .project-detail-workspace-body,
html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .contact-detail-tabs-body,
html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .project-tab-content {
  background: #181818 !important;
}

html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .detailHeader.contact-detail-header-new,
html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .crm-contact-overview-fields.contact-details-card,
html[data-theme="dark"] body.invoice-overview-simple-page #invoicesWrap[data-invoice-overview-mode="simple"] .contact-field-group {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: var(--ro-border) !important;
  box-shadow: none !important;
}

/* Settings drawer and dropdowns. */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-settings-drawer,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-settings-drawer__header,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-settings-drawer__body,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .searchable-dropdown-list {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .searchable-dropdown-item:hover {
  background: #242424 !important;
}

/* Print preview chrome is dark; the printable document itself stays white. */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-print-preview-content {
  background: #1e1e1e !important;
  background-image: none !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
}

/* List-level Stripe readiness prompts and toolbar utilities. */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-readiness-row {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-readiness-row-text strong {
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-readiness-row-text span {
  color: #a0a0a0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .list-toolbar-bar > .invoice-toolbar-paylink {
  background: #242424 !important;
  background-image: none !important;
  color: #dcdcdc !important;
  -webkit-text-fill-color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.3) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout .list-toolbar-bar > .invoice-toolbar-paylink:hover {
  background: #2e2e2e !important;
  color: #ffffff !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-readiness-banner {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #dcdcdc !important;
  border-color: rgba(96, 165, 250, 0.26) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-readiness-banner :is(h2, h3, strong) {
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-readiness-banner :is(p, span) {
  color: #a0a0a0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-list-layout .invoice-toolbar-paylink {
  background: #242424 !important;
  background-image: none !important;
  color: #dcdcdc !important;
  -webkit-text-fill-color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.3) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap :is(
  .invoice-readiness-row-btn,
  #btnNewInvoiceEmpty.btn.primary
) {
  background: #81a1c1 !important;
  background-image: none !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  border-color: #81a1c1 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .contact-list-th-actions-icon {
  background: #2a2a2a !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.24) !important;
}

/* Simple/advanced edit surfaces with direct light-mode declarations. */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap :is(
  .invoice-ov-address-block--editing,
  .invoice-ov-address-block,
  .invoice-ov-field,
  .invoice-ov-readonly,
  .invoice-ov-card,
  .crm-contact-overview-fields,
  .crm-overview-hero
) {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap :is(
  .invoice-ov-address-block--editing,
  .invoice-ov-field,
  .crm-contact-overview-fields
) :is(input, textarea, select) {
  background: #1e1e1e !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
  box-shadow: none !important;
}

/* Focused invoice overview QB sheet + payment overlays (after invoice-overview-simple-mode / surprises). */
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap[data-invoice-overview-mode="simple"] :is(
  .invoice-ov-qb-sheet,
  .invoice-ov-qb-address,
  .invoice-ov-qb-meta-strip,
  .invoice-ov-qb-amounts,
  .invoice-ov-qb-amounts__grid
) {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-ov-qb-header__balance--open {
  background: rgba(120, 53, 15, 0.34) !important;
  color: #fde68a !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-ov-qb-amount--paid {
  background: rgba(6, 78, 59, 0.28) !important;
  color: #a7f3d0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap[data-invoice-overview-mode="simple"] .invoice-ov-qb-amount--remainder:has(.invoice-ov-qb-amount__value--open) {
  background: rgba(120, 53, 15, 0.28) !important;
  color: #fde68a !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap[data-invoice-overview-mode="simple"] :is(
  .invoice-ov-qb-header__number,
  .invoice-ov-qb-header__balance-amount,
  .invoice-ov-qb-field__value,
  .invoice-ov-qb-address__name,
  .invoice-ov-qb-amount__value
) {
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap[data-invoice-overview-mode="simple"] :is(
  .invoice-ov-qb-header__eyebrow,
  .invoice-ov-qb-header__balance-label,
  .invoice-ov-qb-header__balance-meta,
  .invoice-ov-qb-field__label,
  .invoice-ov-qb-address__title,
  .invoice-ov-qb-amount__label
) {
  color: #8a8a8a !important;
  -webkit-text-fill-color: #8a8a8a !important;
}

html[data-theme="dark"] body[data-theme="momentum"] :is(
  .invoice-payment-pulse__card,
  .invoice-pay-qr-modal
) {
  background: #1a1a1a !important;
  background-image: none !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .invoice-payment-pulse__title,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-pay-qr-modal__title {
  color: #f0f0f0 !important;
  -webkit-text-fill-color: #f0f0f0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .invoice-payment-pulse__message,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-pay-qr-modal__lede {
  color: #a0a0a0 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .invoice-pay-qr-modal__qr-mount {
  background: #181818 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-ov-edit-input--bill-again-focus,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-ov-edit-input--bill-again-focus {
  background: #1e1e1e !important;
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important;
  border-color: #34d399 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-ov-field--bill-again-focus {
  background: rgba(6, 78, 59, 0.28) !important;
  background-image: none !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-payments-action-btn {
  background: #2a2a2a !important;
  background-image: none !important;
  color: #dcdcdc !important;
  -webkit-text-fill-color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap .invoice-payments-action-btn:hover {
  background: #2e2e2e !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
