/* ═══════════════════════════════════════════════════════════════
   DARK HUBS v1 — list/shell surfaces for main CRM modules
   Loads after momentum + list-workspace. Preference: html[data-theme="dark"].
   Light path untouched.
═══════════════════════════════════════════════════════════════ */

/* ── Shared list toolbar (Contacts, Home, Projects, Budgets, Invoices, Calendar) ── */
html[data-theme="dark"] #filtersSection,
html[data-theme="dark"] #ccFiltersSection,
html[data-theme="dark"] #filtersSection.filters-modern,
html[data-theme="dark"] #ccFiltersSection.filters-modern,
html[data-theme="dark"] #filtersSection.list-toolbar-strip,
html[data-theme="dark"] #projectsWrap .list-toolbar-strip,
html[data-theme="dark"] #budgetsWrap .list-toolbar-strip,
html[data-theme="dark"] #invoicesWrap .list-toolbar-strip {
  background: var(--surface, #1a1a1a) !important;
  border-color: var(--border-light, rgba(255, 255, 255, 0.1)) !important;
  color: var(--text-primary, #f0f0f0) !important;
}

html[data-theme="dark"] #filtersSection .list-toolbar-bar.filter-bar-main,
html[data-theme="dark"] #ccFiltersSection .list-toolbar-bar.filter-bar-main,
html[data-theme="dark"] #projectsWrap .list-toolbar-bar.filter-bar-main,
html[data-theme="dark"] #budgetsWrap .list-toolbar-bar.filter-bar-main,
html[data-theme="dark"] #invoicesWrap .list-toolbar-bar.filter-bar-main {
  background: transparent !important;
  color: var(--text-primary, #f0f0f0) !important;
}

html[data-theme="dark"] .filter-search-wrap,
html[data-theme="dark"] .filter-search-wrap input,
html[data-theme="dark"] .filter-search-wrap .input,
html[data-theme="dark"] #globalSearch,
html[data-theme="dark"] #searchInput {
  background: var(--surface-2, #1e1e1e) !important;
  color: var(--text-primary, #f0f0f0) !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

html[data-theme="dark"] .filter-search-wrap input::placeholder,
html[data-theme="dark"] #globalSearch::placeholder {
  color: #6a6a6a !important;
}

html[data-theme="dark"] {
  --list-toolbar-view-settings-idle-fill: linear-gradient(
    180deg,
    #1e1e1e 0%,
    #1a1a1a 52%,
    #1a1a1a 100%
  );
}

html[data-theme="dark"] .list-toolbar-view-settings-btn,
html[data-theme="dark"] .btn.list-options-trigger,
html[data-theme="dark"] .filter-toolbar-create-group .btn:not(.primary):not(.btn-primary) {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-secondary, #8a8a8a) !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

/* ── Gmail tabs / priority legend / list workspace chrome ── */
html[data-theme="dark"] #gmailTabs,
html[data-theme="dark"] #gmailTabs.gmail-tabs-container,
html[data-theme="dark"] .gmail-tabs {
  background: transparent !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}

html[data-theme="dark"] .gmail-tab {
  color: #8a8a8a !important;
}
html[data-theme="dark"] .gmail-tab.active {
  color: #f0f0f0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #userMenuBtn.header-avatar-btn {
  background: #2a2a2a !important;
  background-image: none !important;
  border: 1px solid rgba(240, 240, 240, 0.34) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32) !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #userMenuBtn.header-avatar-btn:hover {
  background: #2e2e2e !important;
  border-color: rgba(135, 166, 196, 0.54) !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #userMenuBtn .header-avatar,
html[data-theme="dark"] body[data-theme="momentum"] #userAvatar.header-avatar {
  background: linear-gradient(145deg, #87a6c4 0%, #81a1c1 100%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid rgba(168, 197, 212, 0.28) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #priorityLegend,
html[data-theme="dark"] .priority-legend,
html[data-theme="dark"] .list-workspace-context-rail {
  background: rgba(24, 24, 24, 0.72) !important;
  color: #8a8a8a !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #projectPriorityLegend.priority-legend {
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  background-image: none !important;
  color: #8a8a8a !important;
  border-top-color: rgba(240, 240, 240, 0.12) !important;
  border-bottom-color: rgba(240, 240, 240, 0.2) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #projectPriorityLegend .priority-legend-label,
html[data-theme="dark"] body[data-theme="momentum"] #projectPriorityLegend .priority-legend-item {
  color: #8a8a8a !important;
}

html[data-theme="dark"] .list-workspace-context-chip {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  color: #c6c6c6 !important;
}
html[data-theme="dark"] .list-workspace-context-chip--active {
  background: #1e1e1e !important;
  border-color: #7a7a7a !important;
  color: #f0f0f0 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .list-workspace-meta-row {
  background: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 100%) !important;
  border-bottom-color: rgba(240, 240, 240, 0.16) !important;
  color: #8a8a8a !important;
}
html[data-theme="dark"] .list-workspace-meta strong {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] .list-workspace-pager {
  background: #1e1e1e !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
}
html[data-theme="dark"] .list-workspace-pager .btn.small {
  color: #8a8a8a !important;
}
html[data-theme="dark"] .list-workspace-pager .btn.small:hover:not(:disabled) {
  background: #242424 !important;
  color: #f0f0f0 !important;
}

html[data-theme="dark"] .list-workspace-shell,
html[data-theme="dark"] #contactListWrap.listPane,
html[data-theme="dark"] #contactList {
  background: transparent !important;
  color: var(--text-primary, #f0f0f0) !important;
}

/* Contact / shared pipe tables */
html[data-theme="dark"] .pipe-list-table,
html[data-theme="dark"] .contact-list-table,
html[data-theme="dark"] .pipe-list-table-wrap,
html[data-theme="dark"] .contact-list-table-wrap {
  background: transparent !important;
  color: var(--text-primary, #f0f0f0) !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}
html[data-theme="dark"] .pipe-list-table thead th,
html[data-theme="dark"] .contact-list-table thead th,
html[data-theme="dark"] .pipe-list-table thead tr {
  background: rgba(0, 0, 0, 0.85) !important;
  color: #8a8a8a !important;
  border-bottom-color: rgba(240, 240, 240, 0.18) !important;
}
html[data-theme="dark"] .pipe-list-row,
html[data-theme="dark"] .contact-row,
html[data-theme="dark"] .invoice-row,
html[data-theme="dark"] .project-row,
html[data-theme="dark"] .budget-row {
  background: rgba(24, 24, 24, 0.55) !important;
  color: #e6e6e6 !important;
  border-bottom-color: rgba(240, 240, 240, 0.12) !important;
}
html[data-theme="dark"] .pipe-list-row:hover,
html[data-theme="dark"] .contact-row:hover,
html[data-theme="dark"] .invoice-row:hover,
html[data-theme="dark"] .project-row:hover,
html[data-theme="dark"] .budget-row:hover {
  background: rgba(36, 48, 68, 0.88) !important;
}
html[data-theme="dark"] .pipe-list-name,
html[data-theme="dark"] .pipe-list-table td,
html[data-theme="dark"] .contact-list-table td {
  color: #e6e6e6 !important;
}

/* ── KPI strips (Projects / Budgets / Invoices) ── */
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-card,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-card,
html[data-theme="dark"] body[data-theme="momentum"] #dealEstimateHost .td-kpi-card,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-card {
  background: rgba(24, 24, 24, 0.92) !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35) !important;
  color: #f0f0f0 !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] #dealEstimateHost .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-value {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-label,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-label,
html[data-theme="dark"] body[data-theme="momentum"] #dealEstimateHost .td-kpi-label,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-label {
  color: #8a8a8a !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-card--money .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-card--money .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-card--money .td-kpi-value {
  color: #87a6c4 !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-card--warning .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-card--warning .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-card--warning .td-kpi-value {
  color: #fbbf24 !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-card--risk,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-card--risk,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-card--risk {
  background: rgba(127, 29, 29, 0.35) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-card--risk .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-card--risk .td-kpi-value,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-card--risk .td-kpi-value {
  color: #fca5a5 !important;
}

/* ── Hub wraps ── */
html[data-theme="dark"] #projectsWrap,
html[data-theme="dark"] #invoicesWrap,
html[data-theme="dark"] #budgetsWrap,
html[data-theme="dark"] #calendarWrap,
html[data-theme="dark"] #reportsWrap,
html[data-theme="dark"] #formsView,
html[data-theme="dark"] #emailInboxView,
html[data-theme="dark"] .calendarPane,
html[data-theme="dark"] .reportsPane,
html[data-theme="dark"] .formsPane,
html[data-theme="dark"] .inboxPane {
  background: var(--bg, #181818) !important;
  color: var(--text-primary, #f0f0f0) !important;
  color-scheme: dark;
}

html[data-theme="dark"] #budgetsWrap .budgets-list-pane,
html[data-theme="dark"] #budgetsWrap .budgets-detail-pane,
html[data-theme="dark"] #budgetsWrap .budgets-detail-header-card,
html[data-theme="dark"] #invoicesWrap .invoice-board-list,
html[data-theme="dark"] #projectsWrap .projects-board,
html[data-theme="dark"] #projectsWrap .pipe-board {
  background: transparent !important;
  color: var(--text-primary, #f0f0f0) !important;
}

/* Empty states inside hubs */
html[data-theme="dark"] #projectsWrap .emptyState,
html[data-theme="dark"] #invoicesWrap .emptyState,
html[data-theme="dark"] #budgetsWrap .emptyState,
html[data-theme="dark"] #formsView .emptyState,
html[data-theme="dark"] #reportsWrap .emptyState,
html[data-theme="dark"] .empty-state {
  color: #8a8a8a !important;
  background: transparent !important;
}

/* ── Calendar ── */
html[data-theme="dark"] #calendarWrap #calendarPanel,
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-body,
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-main {
  background: var(--bg, #181818) !important;
  color: var(--text-primary, #f0f0f0) !important;
}
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-header,
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-sidebar,
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-avail-bar {
  background: var(--surface, #1a1a1a) !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  color: var(--text-primary, #f0f0f0) !important;
}
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-header-title,
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-header-title span {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-header .btn,
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-header .cal-view-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.25) !important;
}
html[data-theme="dark"] #calendarWrap .fc,
html[data-theme="dark"] #calendarWrap .fc-theme-standard td,
html[data-theme="dark"] #calendarWrap .fc-theme-standard th,
html[data-theme="dark"] #calendarWrap .fc-scrollgrid,
html[data-theme="dark"] #calendarWrap .fc-daygrid-day,
html[data-theme="dark"] #calendarWrap .fc-col-header-cell {
  background: var(--surface, #1a1a1a) !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] #calendarWrap .fc-col-header-cell-cushion,
html[data-theme="dark"] #calendarWrap .fc-daygrid-day-number {
  color: #c6c6c6 !important;
}

/* ── Forms ── */
html[data-theme="dark"] #formsView,
html[data-theme="dark"] .formsPane {
  background: var(--bg, #181818) !important;
}
html[data-theme="dark"] #formsView .forms-sidebar,
html[data-theme="dark"] #formsView .forms-list,
html[data-theme="dark"] #formsView .forms-workspace,
html[data-theme="dark"] #formsView .forms-main,
html[data-theme="dark"] #formsView aside,
html[data-theme="dark"] #formsView .form-builder-shell {
  background: var(--surface, #1a1a1a) !important;
  color: var(--text-primary, #f0f0f0) !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}
html[data-theme="dark"] #formsView h1,
html[data-theme="dark"] #formsView h2,
html[data-theme="dark"] #formsView h3,
html[data-theme="dark"] #formsView .forms-title {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] #formsView .form-list-item,
html[data-theme="dark"] #formsView .forms-list-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
  color: #e6e6e6 !important;
}

/* ── Reports (real classes from styles-gmail) ── */
html[data-theme="dark"] #reportsWrap,
html[data-theme="dark"] .reportsPane {
  background: var(--bg, #181818) !important;
  color: var(--text-primary, #f0f0f0) !important;
}
html[data-theme="dark"] .reports-split-layout {
  background: var(--bg, #181818) !important;
}
html[data-theme="dark"] .reports-list-panel {
  background: var(--surface, #1a1a1a) !important;
  border-right-color: rgba(240, 240, 240, 0.18) !important;
}
html[data-theme="dark"] .reports-list-header {
  background: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 100%) !important;
  border-bottom-color: rgba(240, 240, 240, 0.18) !important;
}
html[data-theme="dark"] .reports-list-header h2 {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] .reports-refresh-btn-sm {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #8a8a8a !important;
  border-color: rgba(240, 240, 240, 0.25) !important;
}
html[data-theme="dark"] .reports-list-group-header {
  color: #8a8a8a !important;
}
html[data-theme="dark"] .report-list-item {
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .report-list-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}
html[data-theme="dark"] .report-list-item.active {
  background: rgba(129, 161, 193, 0.18) !important;
}
html[data-theme="dark"] .report-list-name {
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .report-list-item.active .report-list-name {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] .reports-preview-panel,
html[data-theme="dark"] .reports-preview-empty {
  background: var(--bg, #181818) !important;
  color: #8a8a8a !important;
}

/* ── Inbox (.td-inbox*) ── */
html[data-theme="dark"] #emailInboxView,
html[data-theme="dark"] .td-inbox-host,
html[data-theme="dark"] .inboxPane {
  background: var(--bg, #181818) !important;
  color: var(--text-primary, #f0f0f0) !important;
}
html[data-theme="dark"] .td-inbox {
  --td-inbox-outline: rgba(240, 240, 240, 0.22);
  --td-inbox-outline-soft: rgba(240, 240, 240, 0.14);
  --td-inbox-card-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  background: #181818 !important;
  color: #f0f0f0 !important;
}
html[data-theme="dark"] .td-inbox__thread-col {
  background: #1a1a1a !important;
  border-right-color: rgba(240, 240, 240, 0.18) !important;
}
html[data-theme="dark"] .td-inbox__conv-col {
  background: #1a1a1a !important;
}
html[data-theme="dark"] .td-inbox__toolbar {
  background: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 100%) !important;
  border-bottom-color: rgba(240, 240, 240, 0.16) !important;
}
html[data-theme="dark"] .td-inbox__back-to-record,
html[data-theme="dark"] .td-inbox__title,
html[data-theme="dark"] .td-inbox input,
html[data-theme="dark"] .td-inbox textarea {
  background: #1e1e1e !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.25) !important;
}
html[data-theme="dark"] .td-inbox__thread,
html[data-theme="dark"] .td-inbox [class*="thread"] {
  color: #e6e6e6 !important;
}
html[data-theme="dark"] .td-inbox__thread:hover,
html[data-theme="dark"] .td-inbox__thread.is-selected,
html[data-theme="dark"] .td-inbox__thread[aria-selected="true"] {
  background: rgba(129, 161, 193, 0.16) !important;
}
html[data-theme="dark"] .td-inbox__message-list,
html[data-theme="dark"] .td-inbox__message,
html[data-theme="dark"] .td-inbox #conversationView {
  background: #1a1a1a !important;
  color: #e6e6e6 !important;
}

/* Budgets table empty + sync note */
html[data-theme="dark"] #budgetsWrap .budgets-workspace-sync-note,
html[data-theme="dark"] #budgetsWrap [class*="sync-note"] {
  background: var(--surface, #1a1a1a) !important;
  color: #8a8a8a !important;
  border-top-color: rgba(240, 240, 240, 0.16) !important;
}

/* Main column canvas when any hub view is active */
html[data-theme="dark"] .app-shell .mainColumn {
  background: var(--bg, #181818) !important;
  color: var(--text-primary, #f0f0f0) !important;
}

/* ── Forms builder (.fb-*) ── */
html[data-theme="dark"] #formsView .fb-shell,
html[data-theme="dark"] #formsView .fb-main,
html[data-theme="dark"] #formsView .fb-sidebar {
  background: var(--surface, #1a1a1a) !important;
  color: var(--text-primary, #f0f0f0) !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
}
html[data-theme="dark"] #formsView .fb-sidebar-header,
html[data-theme="dark"] #formsView .fb-topbar {
  background: #1e1e1e !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
  color: #f0f0f0 !important;
}
html[data-theme="dark"] #formsView .fb-sidebar-title,
html[data-theme="dark"] #formsView .fb-form-item-name {
  color: #f0f0f0 !important;
}
html[data-theme="dark"] #formsView .fb-form-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(240, 240, 240, 0.14) !important;
  color: #e6e6e6 !important;
}
html[data-theme="dark"] #formsView .fb-form-item.active {
  background: rgba(129, 161, 193, 0.18) !important;
}
html[data-theme="dark"] #formsView .fb-empty-state,
html[data-theme="dark"] #formsView .fb-form-item-meta,
html[data-theme="dark"] #formsView .muted {
  color: #8a8a8a !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK HUBS v1b — beat !important light hardcodes (audit follow-up)
═══════════════════════════════════════════════════════════════ */

/* Shared toolbar strip — exact selectors from styles-gmail */
html[data-theme="dark"] #filtersSection.filters-modern.list-toolbar-strip,
html[data-theme="dark"] #ccFiltersSection.filters-modern.list-toolbar-strip,
html[data-theme="dark"] #projectsWrap .projects-list-layout > section.filters-modern.list-toolbar-strip,
html[data-theme="dark"] #budgetsWrap .projects-list-layout > section.filters-modern.list-toolbar-strip,
html[data-theme="dark"] #invoicesWrap .invoice-list-layout > section.filters-modern.list-toolbar-strip {
  --list-toolbar-view-settings-idle-fill: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 52%, #1a1a1a 100%);
  background: #1a1a1a !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"] .filter-search-input,
html[data-theme="dark"] #filtersSection .filter-search-input,
html[data-theme="dark"] #ccFiltersSection .filter-search-input,
html[data-theme="dark"] #projectsWrap .filter-search-input,
html[data-theme="dark"] #budgetsWrap .filter-search-input,
html[data-theme="dark"] #invoicesWrap .filter-search-input {
  background: #1e1e1e !important;
  color: #f0f0f0 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

html[data-theme="dark"] #listOptionsBtn.actions-dropdown-btn,
html[data-theme="dark"] #budgetListOptionsBtn.actions-dropdown-btn,
html[data-theme="dark"] #projectListOptionsBtn.actions-dropdown-btn,
html[data-theme="dark"] #invoiceListOptionsBtn.actions-dropdown-btn {
  background: var(--list-toolbar-view-settings-idle-fill) !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

html[data-theme="dark"] #addContactQuickBtn.filter-add-btn--contact-quick,
html[data-theme="dark"] .filter-add-btn--contact-quick {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
}

/* Contacts refresh stack (loads after gmail; needs matching specificity) */
@media (min-width: 768px) {
  html[data-theme="dark"] .app-shell.contacts-v2-view[data-view="contacts"]:not(.contact-detail-visible) #filtersSection.filters-modern.list-toolbar-strip {
    background: #1a1a1a !important;
    border-color: rgba(240, 240, 240, 0.22) !important;
  }
  html[data-theme="dark"] .app-shell.contacts-v2-view[data-view="contacts"]:not(.contact-detail-visible) .gmail-tabs {
    background: #1e1e1e !important;
    border-color: rgba(240, 240, 240, 0.18) !important;
  }
  html[data-theme="dark"] .app-shell.contacts-v2-view[data-view="contacts"]:not(.contact-detail-visible) .gmail-tab {
    color: #8a8a8a !important;
    background: transparent !important;
  }
  html[data-theme="dark"] .app-shell.contacts-v2-view[data-view="contacts"]:not(.contact-detail-visible) .gmail-tab.active {
    background: #1a1a1a !important;
    color: #f0f0f0 !important;
  }
  html[data-theme="dark"] .app-shell.contacts-v2-view[data-view="contacts"]:not(.contact-detail-visible) .gmail-tab.active::after {
    background: #243038 !important;
  }
  html[data-theme="dark"] .app-shell.contacts-v2-view[data-view="contacts"]:not(.contact-detail-visible) #priorityLegend.priority-legend {
    background: #1a1a1a !important;
    border-top-color: rgba(240, 240, 240, 0.14) !important;
    color: #8a8a8a !important;
  }
}

html[data-theme="dark"] .priority-layout-toggle-icon-only,
html[data-theme="dark"] .contact-list-layout-toggle {
  background: #1e1e1e !important;
  border-color: rgba(240, 240, 240, 0.22) !important;
}
html[data-theme="dark"] .contact-layout-btn {
  color: #8a8a8a !important;
  background: transparent !important;
}
html[data-theme="dark"] .contact-layout-btn.active,
html[data-theme="dark"] .contact-layout-btn[aria-pressed="true"] {
  background: #1a1a1a !important;
  color: #f0f0f0 !important;
}

html[data-theme="dark"] .contact-list-table-wrap--spreadsheet,
html[data-theme="dark"] .contact-list-table.contact-list-table--spreadsheet,
html[data-theme="dark"] .contact-list-table.contact-list-table--spreadsheet thead th {
  background: #1a1a1a !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

/* Projects / Invoices / Budgets canvas + glass list cards */
html[data-theme="dark"] .app-shell[data-view="projects"] #projectsWrap,
html[data-theme="dark"] .app-shell[data-view="budgets"] #budgetsWrap,
html[data-theme="dark"] .app-shell[data-view="invoices"] #invoicesWrap {
  background: #181818 !important;
}
html[data-theme="dark"] .app-shell[data-view="projects"] #projectsWrap .projects-list-layout > .pipe-board-list,
html[data-theme="dark"] .app-shell[data-view="invoices"] #invoicesWrap .invoice-list-layout > .pipe-board-list,
html[data-theme="dark"] .app-shell[data-view="budgets"] #budgetsWrap .projects-list-layout > .pipe-board-list {
  background: linear-gradient(
    178deg,
    rgba(36, 36, 36, 0.94) 0%,
    rgba(24, 24, 24, 0.9) 45%,
    rgba(0, 0, 0, 0.92) 100%
  ) !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .td-kpi-strip,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap .td-kpi-strip,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-strip,
html[data-theme="dark"] body[data-theme="momentum"] .invoice-board-list .td-kpi-strip--invoice {
  background: transparent !important;
}

html[data-theme="dark"] .project-stage-column,
html[data-theme="dark"] #projectsWrap .pipe-kanban-col,
html[data-theme="dark"] #projectsWrap .project-stage-board .pipe-kanban-col {
  background: rgba(24, 24, 24, 0.92) !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  color: #f0f0f0 !important;
}

html[data-theme="dark"] .invoice-gmail-subtabs-row,
html[data-theme="dark"] .invoice-gmail-subtabs-container {
  background: #1a1a1a !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

/* Calendar shell — exact panel classes */
html[data-theme="dark"] .calendarPane,
html[data-theme="dark"] #calendarWrap {
  background: #181818 !important;
}
html[data-theme="dark"] #calendarWrap #calendarPanel {
  background: #1a1a1a !important;
  border-color: rgba(240, 240, 240, 0.18) !important;
  color: #f0f0f0 !important;
}
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-header {
  background: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 100%) !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}
html[data-theme="dark"] #calendarWrap #calendarPanel .cal-body {
  background: #1a1a1a !important;
}

/* Forms builder tokens under dark */
html[data-theme="dark"] {
  --fb-bg: #181818;
  --fb-bg-white: #1a1a1a;
  --fb-border: rgba(240, 240, 240, 0.22);
  --fb-border-dark: rgba(240, 240, 240, 0.35);
  --fb-text: #f0f0f0;
  --fb-text-muted: #8a8a8a;
  --fb-text-light: #6a6a6a;
  --fb-primary-light: rgba(129, 161, 193, 0.16);
  --fb-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --fb-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .fb-shell {
  background: var(--fb-bg) !important;
  color: var(--fb-text) !important;
}
html[data-theme="dark"] .fb-sidebar,
html[data-theme="dark"] .fb-main,
html[data-theme="dark"] .fb-palette,
html[data-theme="dark"] .fb-workspace,
html[data-theme="dark"] .fb-inspector {
  background: var(--fb-bg-white) !important;
  border-color: var(--fb-border) !important;
  color: var(--fb-text) !important;
}

/* Reports pane shell */
html[data-theme="dark"] .reportsPane {
  background: #181818 !important;
}
html[data-theme="dark"] .reports-preview-panel {
  background: linear-gradient(180deg, #1a1a1a 0%, #181818 100%) !important;
}
html[data-theme="dark"] .report-kpi {
  background: #1a1a1a !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
  color: #f0f0f0 !important;
}

/* Inbox mailbox bar + bubbles */
html[data-theme="dark"] .td-inbox__mailbox-bar {
  background: #1e1e1e !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}
html[data-theme="dark"] .td-inbox__msg-bubble {
  background: #1e1e1e !important;
  color: #e6e6e6 !important;
  border-color: rgba(240, 240, 240, 0.2) !important;
}

/* Styled selects used by Calendar booking filters load after the base hub CSS. */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarWrap .mm-styled-select__trigger,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarWrap .mm-styled-select__menu,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarWrap .mm-styled-select__option {
  background: #222222 !important;
  background-image: none !important;
  color: #dcdcdc !important;
  -webkit-text-fill-color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.26) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarWrap .mm-styled-select__option:hover,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="calendar"] #calendarWrap .mm-styled-select__option.is-selected {
  background: #1e1e1e !important;
  color: #f0f0f0 !important;
}

/* Aging signals stay amber without becoming bright cream pills. */
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="pipeline"] #pipelineWrap .pipe-stale-pill,
html[data-theme="dark"] body[data-theme="momentum"] .app-shell[data-view="deals"] #pipelineWrap .pipe-stale-pill {
  background: rgba(120, 53, 15, 0.38) !important;
  background-image: none !important;
  color: #fcd34d !important;
  border-color: rgba(251, 191, 36, 0.34) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .app-shell .actions-dropdown-label {
  color: #c6c6c6 !important;
  -webkit-text-fill-color: #c6c6c6 !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap .project-stage-pill-inline {
  background: #2a2a2a !important;
  background-image: none !important;
  color: #dcdcdc !important;
  -webkit-text-fill-color: #dcdcdc !important;
  border-color: rgba(240, 240, 240, 0.24) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-card-health__bit--task {
  background: rgba(129, 161, 193, 0.18) !important;
  color: #88c0d0 !important;
  -webkit-text-fill-color: #88c0d0 !important;
  border-color: rgba(136, 192, 208, 0.3) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-card-glance__close {
  background: rgba(240, 240, 240, 0.08) !important;
  color: #c6c6c6 !important;
  -webkit-text-fill-color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.16) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-card-glance__close--missing {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-card-glance__close--overdue {
  background: rgba(248, 113, 113, 0.18) !important;
  color: #fca5a5 !important;
  -webkit-text-fill-color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-card-glance__forecast--pipeline {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-card-glance__forecast--best_case {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #fbbf24 !important;
  -webkit-text-fill-color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap .pipe-card-glance__forecast--commit {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #86efac !important;
  -webkit-text-fill-color: #86efac !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
}

html[data-theme="dark"] body[data-theme="momentum"] .list-options-criteria-summary-btn {
  background: #2a2a2a !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #pipelineWrap :is(
  #pipeMeetingPackBtn,
  #pipeExportBtn,
  #pipeRefreshBtn,
  .pipe-deal-more,
  .pill
) {
  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"] #budgetsWrap .budget-hub-delete-btn {
  background: #3a2028 !important;
  background-image: none !important;
  color: #fca5a5 !important;
  -webkit-text-fill-color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.32) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body[data-theme="momentum"] #filtersSection.filters-modern.list-toolbar-strip #listOptionsCriteriaSummaryBtn.list-options-criteria-summary-btn,
html[data-theme="dark"] body[data-theme="momentum"] #projectsWrap #projectListCriteriaSummaryBtn.list-options-criteria-summary-btn,
html[data-theme="dark"] body[data-theme="momentum"] #budgetsWrap #budgetListCriteriaSummaryBtn.list-options-criteria-summary-btn,
html[data-theme="dark"] body[data-theme="momentum"] #invoicesWrap #invoiceListCriteriaSummaryBtn.list-options-criteria-summary-btn {
  background: #2a2a2a !important;
  background-image: none !important;
  color: #c6c6c6 !important;
  border-color: rgba(240, 240, 240, 0.28) !important;
  box-shadow: none !important;
}

/* Deals list grouped mode chrome. */
html[data-theme="dark"] body[data-theme="momentum"] #pipelinePanel :is(
  .pipe-grouped-select,
  .pipe-group-header
) {
  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"] #pipelinePanel .pipe-group-deal:hover {
  background: #242424 !important;
}
