/*
 * Camada de tema escuro do shell OmniGestor.
 * Carregada depois do CSS isolado para também alcançar estilos locais dos módulos.
 */
body.dark-mode {
    color-scheme: dark;
    --omni-color-primary: #ad8cff;
    --omni-color-primary-strong: #c5adff;
    --omni-color-primary-soft: #30264a;
    --omni-color-text: #edf0f7;
    --omni-color-text-muted: #aeb6c6;
    --omni-color-border: #454d5c;
    --omni-color-surface: #262c35;
    --omni-color-page: #1b2027;
    --omni-color-danger: #ff8b98;
    --omni-color-danger-soft: #42272d;
    --omni-shadow-card: 0 16px 44px rgba(0, 0, 0, .3);
    --omni-shadow-control-focus: 0 0 0 3px rgba(173, 140, 255, .24);

    /* Aliases usados por telas antigas antes do Design System. */
    --color-bg: var(--omni-color-page);
    --color-background: var(--omni-color-page);
    --color-surface: var(--omni-color-surface);
    --color-card: var(--omni-color-surface);
    --color-text: var(--omni-color-text);
    --color-muted: var(--omni-color-text-muted);
    --color-border: var(--omni-color-border);
}

body.dark-mode,
body.dark-mode .content-wrapper,
body.dark-mode .content,
body.dark-mode .main-footer {
    color: var(--omni-color-text);
    background-color: var(--omni-color-page);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode label,
body.dark-mode legend,
body.dark-mode .text-dark {
    color: var(--omni-color-text) !important;
}

body.dark-mode .text-muted,
body.dark-mode small,
body.dark-mode .form-text {
    color: var(--omni-color-text-muted) !important;
}

body.dark-mode .card,
body.dark-mode .card-body,
body.dark-mode .card-header,
body.dark-mode .card-footer,
body.dark-mode .modal-content,
body.dark-mode .modal-header,
body.dark-mode .modal-body,
body.dark-mode .modal-footer,
body.dark-mode .dropdown-menu,
body.dark-mode .popover,
body.dark-mode .list-group-item,
body.dark-mode .jumbotron,
body.dark-mode .well,
body.dark-mode .box,
body.dark-mode .box-body,
body.dark-mode .tab-content {
    color: var(--omni-color-text);
    background-color: var(--omni-color-surface);
    border-color: var(--omni-color-border);
}

body.dark-mode .dropdown-item,
body.dark-mode .nav-link,
body.dark-mode .page-link,
body.dark-mode .close {
    color: var(--omni-color-text-muted);
}

body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus,
body.dark-mode .nav-tabs .nav-link:hover,
body.dark-mode .page-link:hover {
    color: var(--omni-color-text);
    background-color: var(--omni-color-primary-soft);
}

body.dark-mode .nav-tabs,
body.dark-mode .nav-tabs .nav-link,
body.dark-mode hr {
    border-color: var(--omni-color-border);
}

body.dark-mode .nav-tabs .nav-link.active {
    color: var(--omni-color-text);
    background-color: var(--omni-color-surface);
    border-color: var(--omni-color-border) var(--omni-color-border) var(--omni-color-surface);
}

body.dark-mode .form-control,
body.dark-mode .custom-select,
body.dark-mode .custom-file-label,
body.dark-mode .input-group-text,
body.dark-mode .select2-selection,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]) {
    color: var(--omni-color-text);
    background-color: var(--omni-color-surface);
    border-color: var(--omni-color-border);
}

body.dark-mode .form-control::placeholder,
body.dark-mode textarea::placeholder,
body.dark-mode input::placeholder {
    color: var(--omni-color-text-muted);
    opacity: .8;
}

body.dark-mode .form-control:disabled,
body.dark-mode .form-control[readonly],
body.dark-mode input:disabled,
body.dark-mode select:disabled,
body.dark-mode textarea:disabled {
    color: var(--omni-color-text-muted);
    background-color: #303640;
}

body.dark-mode .table,
body.dark-mode .table th,
body.dark-mode .table td {
    color: var(--omni-color-text);
    border-color: var(--omni-color-border);
}

body.dark-mode .table thead th,
body.dark-mode .table-light,
body.dark-mode .table-light > th,
body.dark-mode .table-light > td,
body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    color: var(--omni-color-text);
    background-color: #303640;
}

body.dark-mode .table-hover tbody tr:hover {
    color: var(--omni-color-text);
    background-color: #353c47;
}

body.dark-mode .bg-white,
body.dark-mode .bg-light {
    color: var(--omni-color-text) !important;
    background-color: var(--omni-color-surface) !important;
}

/* Corrige cores claras literais ainda presentes em atributos style legados. */
body.dark-mode [style*="background: white" i],
body.dark-mode [style*="background:white" i],
body.dark-mode [style*="background-color: white" i],
body.dark-mode [style*="background-color:white" i],
body.dark-mode [style*="background: #fff" i],
body.dark-mode [style*="background:#fff" i],
body.dark-mode [style*="background-color: #fff" i],
body.dark-mode [style*="background-color:#fff" i],
body.dark-mode [style*="background: #ffffff" i],
body.dark-mode [style*="background-color: #ffffff" i] {
    background: var(--omni-color-surface) !important;
}

body.dark-mode [style*="color: #111" i],
body.dark-mode [style*="color:#111" i],
body.dark-mode [style*="color: #212529" i],
body.dark-mode [style*="color:#212529" i],
body.dark-mode [style*="color: #343a40" i],
body.dark-mode [style*="color:#343a40" i] {
    color: var(--omni-color-text) !important;
}

/* Dashboards compartilhados ainda possuem valores claros literais. */
body.dark-mode .odash-shell,
body.dark-mode .omni-page,
body.dark-mode .finance-page,
body.dark-mode .quick-page {
    color: var(--omni-color-text);
    background: var(--omni-color-page) !important;
}

body.dark-mode .odash-hero {
    color: var(--omni-color-text);
    background:
        radial-gradient(circle at 83% 30%, rgba(173, 140, 255, .18), transparent 24%),
        linear-gradient(110deg, #262c35 0%, #262c35 58%, #30264a 100%);
    border-color: var(--omni-color-border);
    box-shadow: var(--omni-shadow-card);
}

body.dark-mode .odash-title,
body.dark-mode .odash-field input,
body.dark-mode .odash-field .form-control,
body.dark-mode .odash-select .simple-dropdown-button {
    color: var(--omni-color-text);
}

body.dark-mode .odash-copy,
body.dark-mode .odash-field > span,
body.dark-mode .odash-field > label,
body.dark-mode .odash-filter-label {
    color: var(--omni-color-text-muted);
}

body.dark-mode .odash-filter-panel,
body.dark-mode .odash-field,
body.dark-mode .odash-select .dropdown-menu {
    color: var(--omni-color-text);
    background: var(--omni-color-surface);
    border-color: var(--omni-color-border);
}

/* Bibliotecas de gráficos SVG usadas nos dashboards. */
body.dark-mode .apexcharts-text,
body.dark-mode .apexcharts-legend-text,
body.dark-mode .apexcharts-xaxis-label,
body.dark-mode .apexcharts-yaxis-label,
body.dark-mode .e-chart text,
body.dark-mode .e-chart-title,
body.dark-mode .e-axis-labels text {
    color: var(--omni-color-text-muted) !important;
    fill: var(--omni-color-text-muted) !important;
}

body.dark-mode .apexcharts-gridline,
body.dark-mode .e-axis-line,
body.dark-mode .e-major-grid-lines {
    stroke: var(--omni-color-border) !important;
}

body.dark-mode .ql-toolbar,
body.dark-mode .ql-container,
body.dark-mode .ql-editor,
body.dark-mode .calendar,
body.dark-mode .fc-theme-standard td,
body.dark-mode .fc-theme-standard th,
body.dark-mode .fc-theme-standard .fc-scrollgrid {
    color: var(--omni-color-text);
    background-color: var(--omni-color-surface);
    border-color: var(--omni-color-border);
}

body.dark-mode .ql-stroke {
    stroke: var(--omni-color-text-muted);
}

body.dark-mode .ql-fill {
    fill: var(--omni-color-text-muted);
}

/* Shell e página inicial. */
body.dark-mode .top-row,
body.dark-mode .user-profile-menu,
body.dark-mode .home-info-panel,
body.dark-mode .home-visual-card,
body.dark-mode .module-card,
body.dark-mode .support-card,
body.dark-mode .advertisement-editor-shell {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .user-profile-menu .dropdown-item,
body.dark-mode .user-profile-menu .dropdown-item span {
    color: var(--omni-color-text) !important;
    background: transparent !important;
}

body.dark-mode .user-profile-menu .dropdown-item i {
    color: var(--omni-color-primary) !important;
}

body.dark-mode .user-profile-menu .dropdown-item:hover,
body.dark-mode .user-profile-menu .dropdown-item:focus {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-primary-soft) !important;
}

body.dark-mode .user-profile-menu-divider {
    background: var(--omni-color-border) !important;
}

body.dark-mode .user-profile-menu .user-profile-logout,
body.dark-mode .user-profile-menu .user-profile-logout span {
    color: #ff9aa6 !important;
}

body.dark-mode .user-profile-menu .user-profile-logout i {
    color: #ff7f91 !important;
}

body.dark-mode .user-profile-menu .user-profile-logout:hover,
body.dark-mode .user-profile-menu .user-profile-logout:focus {
    background: var(--omni-color-danger-soft) !important;
}

body.dark-mode .home-info-copy h2,
body.dark-mode .home-section-title,
body.dark-mode .module-card h3,
body.dark-mode .module-card strong {
    color: var(--omni-color-text) !important;
}

body.dark-mode .home-info-copy p,
body.dark-mode .module-card p,
body.dark-mode .support-card p {
    color: var(--omni-color-text-muted) !important;
}

body.dark-mode .home-button-light {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

/* OmniClass: dashboard, cursos, detalhes e presença. */
body.dark-mode .oc-dashboard-shell {
    color: var(--omni-color-text) !important;
}

body.dark-mode .oc-dashboard-hero {
    background:
        radial-gradient(circle at 83% 30%, rgba(173, 140, 255, .18), transparent 24%),
        linear-gradient(110deg, #262c35 0%, #262c35 58%, #30264a 100%) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .oc-period-panel,
body.dark-mode .oc-section-card,
body.dark-mode .oc-dashboard-shell .card,
body.dark-mode .oc-dashboard-shell .card-header,
body.dark-mode .upcoming-card,
body.dark-mode .encouragement-card,
body.dark-mode .course-card,
body.dark-mode .course-schedule,
body.dark-mode .course-details,
body.dark-mode .course-search,
body.dark-mode .courses-empty-state,
body.dark-mode .activity-details-card,
body.dark-mode .activity-details-card .metadata-item,
body.dark-mode .activity-details-card .admin-item,
body.dark-mode .activity-card .info-section {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .oc-period-button,
body.dark-mode .secondary-course-button,
body.dark-mode .view-toggle,
body.dark-mode .filter-button {
    color: var(--omni-color-text-muted) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .oc-period-button.active,
body.dark-mode .view-toggle.active,
body.dark-mode .filter-button.active {
    color: #fff !important;
    background: linear-gradient(135deg, #7b5cff, #5230d7) !important;
}

body.dark-mode .oc-dashboard-title,
body.dark-mode .oc-section-title,
body.dark-mode .oc-dashboard-shell .card-title,
body.dark-mode .course-card h2,
body.dark-mode .course-card h3,
body.dark-mode .activity-details-card h1,
body.dark-mode .activity-details-card h2,
body.dark-mode .activity-details-card h3 {
    color: var(--omni-color-text) !important;
}

body.dark-mode .oc-dashboard-copy,
body.dark-mode .oc-period-summary,
body.dark-mode .course-card p,
body.dark-mode .course-card small,
body.dark-mode .activity-details-card p {
    color: var(--omni-color-text-muted) !important;
}

body.dark-mode .full-button {
    color: var(--omni-color-primary) !important;
    background: var(--omni-color-surface) !important;
}

body.dark-mode .card-header.bg-white,
body.dark-mode .card-header.bg-light,
body.dark-mode .card-header[style] {
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .card-header [style*="color: #2c3e50" i],
body.dark-mode .card-header [style*="color: #34495e" i] {
    color: var(--omni-color-text) !important;
}

body.dark-mode input[type="date"][style*="background-color" i] {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

/* Dashboards OmniEvent e demais telas que usam o padrão metric/panel. */
body.dark-mode .event-dashboard {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-page) !important;
}

body.dark-mode .event-dashboard .date-field,
body.dark-mode .event-dashboard .department-filter,
body.dark-mode .event-dashboard .metric-card,
body.dark-mode .event-dashboard .panel,
body.dark-mode .event-dashboard .modality-grid > div,
body.dark-mode .event-dashboard .compact-item,
body.dark-mode .event-dashboard .event-table-row {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .event-dashboard-head h1,
body.dark-mode .event-dashboard .metric-card strong,
body.dark-mode .event-dashboard .panel-title h2,
body.dark-mode .event-dashboard .modality-grid strong,
body.dark-mode .event-dashboard .compact-item strong,
body.dark-mode .event-dashboard .event-table-row strong {
    color: var(--omni-color-text) !important;
}

/* OmniFinance: todas as superfícies operacionais compartilhadas. */
body.dark-mode .finance-page,
body.dark-mode .finance-dashboard {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-page) !important;
}

body.dark-mode .finance-hero,
body.dark-mode .finance-filter-card,
body.dark-mode .finance-page-title,
body.dark-mode .finance-panel,
body.dark-mode .finance-metric-card,
body.dark-mode .finance-alert-form-card,
body.dark-mode .finance-alert-email-box > div,
body.dark-mode .finance-empty,
body.dark-mode .finance-report-total,
body.dark-mode .finance-attachment-list,
body.dark-mode .finance-attachment-preview,
body.dark-mode .finance-modal {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .finance-hero-copy h1,
body.dark-mode .finance-page-title h1,
body.dark-mode .finance-panel h2,
body.dark-mode .finance-alert-form-card h2,
body.dark-mode .finance-metric-card strong,
body.dark-mode .finance-table td strong,
body.dark-mode .finance-alerts strong,
body.dark-mode .finance-report-total strong {
    color: var(--omni-color-text) !important;
}

body.dark-mode .finance-period-actions button,
body.dark-mode .finance-custom-period button,
body.dark-mode .finance-new-button,
body.dark-mode .finance-page button:not(.btn-primary):not(.btn-success):not(.btn-danger),
body.dark-mode .finance-row-actions .icon-button {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

/* OmniPlan. */
body.dark-mode .agenda-shell,
body.dark-mode .calendar-header,
body.dark-mode .month-view,
body.dark-mode .week-view-grid,
body.dark-mode .day-view,
body.dark-mode .calendar-list-view,
body.dark-mode .calendar-board-view,
body.dark-mode .calendar-timeline-view,
body.dark-mode .calendar-board-column,
body.dark-mode .calendar-board-card,
body.dark-mode .calendar-list-item,
body.dark-mode .calendar-timeline-item,
body.dark-mode .month-event-card,
body.dark-mode .calendar-search,
body.dark-mode .calendar-board-toolbar,
body.dark-mode .calendar-board-tag-creator {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .month-cell,
body.dark-mode .month-grid-header,
body.dark-mode .week-day-header {
    color: var(--omni-color-text) !important;
    background: #303640 !important;
    border-color: var(--omni-color-border) !important;
}

/* OmniForms, OmniCampaign e componentes compartilhados. */
body.dark-mode .form-container,
body.dark-mode .json-output,
body.dark-mode .select-type,
body.dark-mode .quick-item,
body.dark-mode .quick-modal,
body.dark-mode .kanban-column,
body.dark-mode .kanban-card,
body.dark-mode .chatbot-card,
body.dark-mode .channel-card,
body.dark-mode .session-card,
body.dark-mode .booking-modal-body,
body.dark-mode .booking-modal-footer,
body.dark-mode .booking-summary,
body.dark-mode .booking-form-grid,
body.dark-mode .booking-file-drop,
body.dark-mode .booking-file-pill,
body.dark-mode .simple-dropdown-button,
body.dark-mode .simple-filter-container,
body.dark-mode .simple-filter-input,
body.dark-mode .simple-bs-compat {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

/* Superfícies locais restantes auditadas nos módulos. */
body.dark-mode .course-focus-card,
body.dark-mode .course-stat-card,
body.dark-mode .course-empty-state,
body.dark-mode .certificate-row,
body.dark-mode .stats-card,
body.dark-mode .filter-section,
body.dark-mode .table-modern,
body.dark-mode .chart-section,
body.dark-mode .result-header,
body.dark-mode .answer-card,
body.dark-mode .question-card,
body.dark-mode .tool-panel,
body.dark-mode .activity-admins-list,
body.dark-mode .current-plan-section,
body.dark-mode .module-section,
body.dark-mode .summary-container,
body.dark-mode .category-card,
body.dark-mode .faq-accordion,
body.dark-mode .search-results {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .of-filter-panel,
body.dark-mode .approval-metrics > *,
body.dark-mode .approvals-filter,
body.dark-mode .builder-canvas .question-box,
body.dark-mode .of-card,
body.dark-mode .history-modal {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .campaign-filter-panel,
body.dark-mode .campaign-table-panel,
body.dark-mode .filter-control,
body.dark-mode .action-button,
body.dark-mode .action-menu,
body.dark-mode .kanban-toolbar,
body.dark-mode .kanban-toolbar .input-group-text,
body.dark-mode .card-action-btn,
body.dark-mode .msg-bubble-action-btn,
body.dark-mode .msg-media-preview-bar {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .care-patients-toolbar,
body.dark-mode .care-patient-history,
body.dark-mode .care-history-summary > div,
body.dark-mode .care-history-timeline button,
body.dark-mode .medical-record-panel,
body.dark-mode .medical-record-note,
body.dark-mode .bmi-card,
body.dark-mode .bmi-classification,
body.dark-mode .creation-card {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .departments-row,
body.dark-mode .department-drawer,
body.dark-mode .department-management-toggle,
body.dark-mode .tenant-card,
body.dark-mode .stat-card,
body.dark-mode .participant-item:hover,
body.dark-mode .breadcrumb-nav button {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .event-types-shell,
body.dark-mode .event-type-card,
body.dark-mode .event-type-modal .modal-body,
body.dark-mode .event-type-modal-section,
body.dark-mode .event-type-modal-footer,
body.dark-mode .owner-search-menu,
body.dark-mode .booking-slots-panel,
body.dark-mode .calendar-event-modal-body,
body.dark-mode .calendar-owner-search-menu,
body.dark-mode .calendar-event-modal .card,
body.dark-mode .calendar-event-room-card,
body.dark-mode .calendar-event-modal-footer,
body.dark-mode .calendar-event-board-section,
body.dark-mode .calendar-event-tags-group,
body.dark-mode .calendar-event-tag-option,
body.dark-mode .event-preview-body,
body.dark-mode .event-preview-room {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .event-type-modal input,
body.dark-mode .event-type-modal select,
body.dark-mode .calendar-event-modal input,
body.dark-mode .calendar-event-modal select,
body.dark-mode .calendar-event-modal textarea {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

/* OmniForms: construtor, respostas, aprovações e listagens. */
body.dark-mode .of-shell,
body.dark-mode .builder-canvas,
body.dark-mode .builder-fields button,
body.dark-mode .builder-property-tabs button,
body.dark-mode .modern-builder-container,
body.dark-mode .modern-builder-content,
body.dark-mode .modern-builder-content .step-item,
body.dark-mode .modern-builder-content .question-box,
body.dark-mode .modern-builder-content .select-type,
body.dark-mode .theme-panel,
body.dark-mode .response-form-fields,
body.dark-mode .response-readonly-value,
body.dark-mode .approval-search,
body.dark-mode .approval-metric,
body.dark-mode .file-preview-modal,
body.dark-mode .history-heading,
body.dark-mode .history-modal,
body.dark-mode .history-modal footer button,
body.dark-mode .history-table th {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .builder-save,
body.dark-mode .modern-preview-btn,
body.dark-mode .modern-builder-content .add-btn-between,
body.dark-mode .response-export-btn,
body.dark-mode .response-back-btn,
body.dark-mode .responses-pagination .per-page,
body.dark-mode .of-secondary-action,
body.dark-mode .card-title-row button {
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .approval-search input,
body.dark-mode .history-table td,
body.dark-mode .response-readonly-value,
body.dark-mode .file-preview-modal h2 {
    color: var(--omni-color-text) !important;
}

body.dark-mode .history-heading:hover,
body.dark-mode .response-export-btn:hover:not(:disabled) {
    background: var(--omni-color-primary-soft) !important;
}

/* OmniPlan: dashboard, tipos de evento, timeline e modais. */
body.dark-mode .plan-dashboard,
body.dark-mode .event-types-shell,
body.dark-mode .event-types-empty,
body.dark-mode .event-type-card,
body.dark-mode .event-type-metrics span,
body.dark-mode .plan-dashboard .panel,
body.dark-mode .plan-dashboard .compact-item,
body.dark-mode .plan-dashboard .timeline-item,
body.dark-mode .event-type-info-box {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .event-type-icon-button,
body.dark-mode .plan-dashboard .secondary-button {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

/* OmniCampaign: campanhas, respostas rápidas, Kanban e chat lateral. */
body.dark-mode .campaign-filter-panel,
body.dark-mode .campaign-table-panel,
body.dark-mode .quick-panel,
body.dark-mode .quick-toolbar,
body.dark-mode .quick-action,
body.dark-mode .quick-modal .form-control,
body.dark-mode .sync-expand-panel,
body.dark-mode .kanban-search-wrap,
body.dark-mode .kanban-filter-btn,
body.dark-mode .kanban-filter-select,
body.dark-mode .kanban-column,
body.dark-mode .kanban-column-header,
body.dark-mode .k-contact-drawer,
body.dark-mode .k-contact-drawer-body,
body.dark-mode .k-contact-drawer-body select.form-control,
body.dark-mode .k-contact-drawer-footer,
body.dark-mode .k-chat-bubble-in,
body.dark-mode .k-chat-reaction-picker,
body.dark-mode .k-chat-reaction-badge,
body.dark-mode .k-chat-reply-bar,
body.dark-mode .kanban-sync-action {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .action-menu button:hover,
body.dark-mode .kanban-filter-btn:hover {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-primary-soft) !important;
}

/* Estilos inline legados destes módulos. */
body.dark-mode [style*="background:#f5f5f5" i],
body.dark-mode [style*="background: #f5f5f5" i],
body.dark-mode [style*="background:#f8f9fa" i],
body.dark-mode [style*="background: #f8f9fa" i],
body.dark-mode [style*="background:#f9fafb" i],
body.dark-mode [style*="background: #f9fafb" i] {
    color: var(--omni-color-text-muted) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .of-embedded,
body.dark-mode .submission-card,
body.dark-mode .closed-period-filter input,
body.dark-mode .theme-preview-input {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .calendar-owner-more,
body.dark-mode .calendar-owner-multiselect .simple-dropdown-button,
body.dark-mode .calendar-people-filter {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .quick-page,
body.dark-mode .session-page,
body.dark-mode .chatbot-page,
body.dark-mode .msg-root {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-page) !important;
}

body.dark-mode .custom-field-pill,
body.dark-mode .kanban-column-actions .btn,
body.dark-mode .kanban-search-shortcut,
body.dark-mode .k-tag-pill,
body.dark-mode .channel-header,
body.dark-mode .tg-chat-input,
body.dark-mode .wa-closed,
body.dark-mode .action-button,
body.dark-mode .action-menu,
body.dark-mode .filter-control,
body.dark-mode .page-icon,
body.dark-mode .audience-card,
body.dark-mode .channel-card,
body.dark-mode .content-mode-card,
body.dark-mode .send-type-card,
body.dark-mode .template-item,
body.dark-mode .save-tpl-bar,
body.dark-mode .wizard-step-circle,
body.dark-mode .msg-sidebar,
body.dark-mode .msg-attach-menu,
body.dark-mode .msg-bubble-content-in,
body.dark-mode .msg-media-preview-bar,
body.dark-mode .msg-reaction-picker {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .wizard-step.active .wizard-step-circle {
    color: #fff !important;
    background: var(--omni-color-primary) !important;
}

body.dark-mode .msg-contact-item:hover {
    background: var(--omni-color-primary-soft) !important;
}

/* Ajustes orientados pelos fluxos reais do OmniCampaign. */
body.dark-mode .chatbot-page {
    --bot-border: var(--omni-color-border);
    --bot-muted: var(--omni-color-text-muted);
    color: var(--omni-color-text) !important;
}

body.dark-mode .chatbot-titlebar h2,
body.dark-mode .bot-list-name,
body.dark-mode .section-heading h5,
body.dark-mode .channel-title {
    color: var(--omni-color-text) !important;
}

body.dark-mode .bot-list-card,
body.dark-mode .config-section,
body.dark-mode .empty-editor,
body.dark-mode .agenda-option,
body.dark-mode .add-menu,
body.dark-mode .stepper button,
body.dark-mode .delay-note {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .channel-card,
body.dark-mode .channel-card.on,
body.dark-mode .channel-card.disabled,
body.dark-mode .menu-agenda,
body.dark-mode .agenda-option.selected,
body.dark-mode .menu-row:not(.handoff):hover {
    border-color: var(--omni-color-border) !important;
    background: #303640 !important;
}

body.dark-mode .provision-banner {
    color: #83dec3 !important;
    background: #173a34 !important;
    border-color: #2b6c5d !important;
}

body.dark-mode .session-page {
    --s-border: var(--omni-color-border);
    --s-muted: var(--omni-color-text-muted);
    color: var(--omni-color-text) !important;
}

body.dark-mode .session-page .panel,
body.dark-mode .session-page .variable,
body.dark-mode .session-page .answer {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .session-title,
body.dark-mode .session-row {
    color: var(--omni-color-text) !important;
}

body.dark-mode .session-row:hover,
body.dark-mode .session-row.active {
    background: var(--omni-color-primary-soft) !important;
}

body.dark-mode .channel-body,
body.dark-mode .tg-chat-box,
body.dark-mode .tg-chat-hint {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .msg-root,
body.dark-mode .msg-sidebar,
body.dark-mode .msg-chat-area,
body.dark-mode .msg-chat-body,
body.dark-mode .msg-chat-empty-state,
body.dark-mode .msg-chat-footer,
body.dark-mode .msg-search-box,
body.dark-mode .msg-filter-btn,
body.dark-mode .msg-chat-input {
    color: var(--omni-color-text) !important;
    background-color: var(--omni-color-surface) !important;
    background-image: none !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .msg-contact-item {
    color: var(--omni-color-text) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .msg-contact-item.active,
body.dark-mode .msg-filter-btn:not(.active):hover {
    background: var(--omni-color-primary-soft) !important;
}

body.dark-mode .kanban-root {
    --k-surface: var(--omni-color-page);
    --k-card-bg: var(--omni-color-surface);
    --k-border: var(--omni-color-border);
    --k-text: var(--omni-color-text);
    --k-muted: var(--omni-color-text-muted);
    --k-purple-light: var(--omni-color-primary-soft);
    color: var(--omni-color-text) !important;
    background: var(--omni-color-page) !important;
}

body.dark-mode .kanban-card,
body.dark-mode .kanban-card-unread,
body.dark-mode .sync-option-card,
body.dark-mode .column-new-panel,
body.dark-mode .k-drawer,
body.dark-mode .k-drawer-body,
body.dark-mode .k-chat-body,
body.dark-mode .k-chat-footer,
body.dark-mode .k-chat-input,
body.dark-mode .k-chat-empty {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

/* OmniCare: pacientes e fundos gerados pelo ApexCharts. */
body.dark-mode .care-patient-row,
body.dark-mode .care-pagination,
body.dark-mode .care-refresh-button,
body.dark-mode .care-action-button.primary,
body.dark-mode .care-action-button.neutral {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .care-patient-main strong,
body.dark-mode .care-patient-item strong {
    color: var(--omni-color-text) !important;
}

body.dark-mode .apexcharts-canvas,
body.dark-mode .apexcharts-svg,
body.dark-mode .apexcharts-inner,
body.dark-mode .apexcharts-graphical,
body.dark-mode foreignObject {
    background: var(--omni-color-surface) !important;
}

body.dark-mode .apexcharts-svg rect[fill="#fff"],
body.dark-mode .apexcharts-svg rect[fill="#ffffff"],
body.dark-mode .apexcharts-svg rect[fill="white"] {
    fill: var(--omni-color-surface) !important;
}

body.dark-mode [style*="background-color: white" i][style*="width: 100%" i] {
    background-color: var(--omni-color-surface) !important;
}

/* Conta: perfil e alteração de senha usam CSS isolado. */
body.dark-mode .account-card {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
    box-shadow: var(--omni-shadow-card) !important;
}

body.dark-mode .account-card-header {
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .account-card h1,
body.dark-mode .profile-photo-section strong,
body.dark-mode .account-field label {
    color: var(--omni-color-text) !important;
}

body.dark-mode .account-card-header p,
body.dark-mode .upload-note {
    color: var(--omni-color-text-muted) !important;
}

body.dark-mode .account-icon,
body.dark-mode .account-security-note {
    color: var(--omni-color-primary) !important;
    background: var(--omni-color-primary-soft) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .profile-photo-wrapper {
    border-color: var(--omni-color-surface) !important;
}

body.dark-mode .profile-uploader .card,
body.dark-mode .profile-uploader .dropzone {
    color: var(--omni-color-text) !important;
    background: #303640 !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .dropzone {
    position: relative;
}

body.dark-mode .dropzone label {
    z-index: 1;
    color: var(--omni-color-text) !important;
    pointer-events: none;
}

body.dark-mode .dropzone input[type="file"] {
    position: relative;
    z-index: 2;
    color: transparent !important;
    background: transparent !important;
    border: 0 !important;
    cursor: pointer;
    opacity: 0;
}

body.dark-mode .dropzone.dropzone-active {
    background: var(--omni-color-primary-soft) !important;
    border-color: var(--omni-color-primary) !important;
}

body.dark-mode .danger-zone {
    background: var(--omni-color-danger-soft) !important;
    border-color: #75404a !important;
}

body.dark-mode .danger-zone strong {
    color: #ff9aa6 !important;
}

body.dark-mode .danger-zone p {
    color: #d8aab0 !important;
}

body.dark-mode .account-button-secondary {
    color: var(--omni-color-text) !important;
    background: #303640 !important;
    border: 1px solid var(--omni-color-border) !important;
}

/* Centro de Ajuda. */
body.dark-mode .help-container {
    color: var(--omni-color-text) !important;
    background: linear-gradient(135deg, #1b2027 0%, #242b36 100%) !important;
}

body.dark-mode .help-header h1,
body.dark-mode .category-name,
body.dark-mode .faq-question,
body.dark-mode .search-result-header,
body.dark-mode .search-result-question,
body.dark-mode .help-container h2[style] {
    color: var(--omni-color-text) !important;
}

body.dark-mode .help-header p,
body.dark-mode .category-description,
body.dark-mode .faq-answer-content,
body.dark-mode .search-result-category,
body.dark-mode .empty-state-text,
body.dark-mode .loading-spinner p {
    color: var(--omni-color-text-muted) !important;
}

body.dark-mode .search-box,
body.dark-mode .category-card,
body.dark-mode .faq-accordion,
body.dark-mode .search-results,
body.dark-mode .search-result-item,
body.dark-mode .empty-state {
    color: var(--omni-color-text) !important;
    background: var(--omni-color-surface) !important;
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .faq-item {
    border-color: var(--omni-color-border) !important;
}

body.dark-mode .faq-tag,
body.dark-mode .search-result-item:hover {
    color: var(--omni-color-primary) !important;
    background: var(--omni-color-primary-soft) !important;
}

@media (forced-colors: active) {
    body.dark-mode * {
        forced-color-adjust: auto;
    }
}
