html[data-bs-theme=dark] {
  --ct-body-bg: #211f21;
  --ct-secondary-bg: #120812;
  --ct-tertiary-bg: #080308;
  --ct-emphasis-color: #dedede;
  --ct-secondary-color: #aba8ac;
  --ct-sidebar-dark: #2a1137;
  --ct-text-light: #cdccce;
  --ct-text-lighter: #707070;
  --ct-accent-color: #f2d8ff;
  --ct-border-color: #414042;
  --ct-info-color: #b5b5ff;
  --ct-primary-custom: #a04ccb;
  --ct-primary-dark: #3f1057;
  --ct-hover-bg: #332c37;
  --ct-alt-bg: #1b0e1b;
  --ct-alt-bg-light: #202228;
  --ct-alt-bg-lighter: #333333;
  --ct-card-bg: #252930;
  --ct-card-hover-bg: #2d3139;
  --ct-card-hover-border: #4a5058;
  --ct-navbar-border: #3a3f47;
  --ct-white: #fff;
  --ct-bg-kambam: #141314;
}

html[data-bs-theme=dark] span {
  color: var(--ct-emphasis-color);
}

html[data-bs-theme=dark] .leftside-menu {
  background-color: var(--ct-sidebar-dark) !important;
}

html[data-bs-theme=dark] .card-modern{
  background-color: var(--ct-secondary-bg);
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .programacao-dia, 
html[data-bs-theme=dark] .card-preview-container{
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .data-mes,
html[data-bs-theme=dark] .programacao-hora,
html[data-bs-theme=dark] .view-button, 
html[data-bs-theme=dark] .day-name, 
html[data-bs-theme=dark] .mes-dia-numero{
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .programacao-titulo, 
html[data-bs-theme=dark] .day-number, 
html[data-bs-theme=dark] .form-label, 
html[data-bs-theme=dark] .sequencia-bloco span {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .agenda-date {
    color: var(--ct-text-light) !important;
}

html[data-bs-theme=dark] .title-agenda, 
html[data-bs-theme=dark] .mes-atual-label, 
html[data-bs-theme=dark] .card-title-modern {
    color: var(--ct-white) !important;
}

html[data-bs-theme=dark] .view-button.active {
    background: var(--ct-secondary-bg) !important;
    color: var(--ct-primary-custom) !important;
}

html[data-bs-theme=dark] .view-switch {
    background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .search-toggle-btn:hover, 
html[data-bs-theme=dark] .btn-config:hover {
    background-color: var(--ct-hover-bg) !important;
    color: var(--ct-white) !important;
}

html[data-bs-theme=dark] .time-slot, 
html[data-bs-theme=dark] .hora-cell, 
html[data-bs-theme=dark] .day-header, 
html[data-bs-theme=dark] .agenda-header {
    background-color: var(--ct-secondary-bg) !important;
    border-color: var(--ct-border-color) !important;
    color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .hora-header {
    background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .mes-col-header, 
html[data-bs-theme=dark] .agenda-mes-body .mes-cell {
    background-color: var(--ct-secondary-bg) !important;
    border-color: var(--ct-border-color) !important;
    color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .navbar-custom {
  background-color: var(--ct-secondary-bg);
  border-bottom: 1px solid var(--ct-navbar-border);
}

html[data-bs-theme=dark] body{
  background-color: var(--ct-body-bg) !important;
}

html[data-bs-theme=dark] .modal.fade.show .modal-dialog .modal-content.modal-modern .modal-header-modern, 
.modal.show .modal-dialog .modal-content.modal-modern .modal-header-modern, 
.modal-dialog .modal-content.modal-modern .modal-header-modern, 
html[data-bs-theme=dark] .modal-content.modal-modern .modal-header-modern, 
.modal.fade.show .modal-dialog .modal-content.modal-modern, 
.modal.show .modal-dialog .modal-content.modal-modern, 
.modal-dialog .modal-content.modal-modern, 
.modal-content.modal-modern, 
html[data-bs-theme=dark] .modal.fade.show .modal-dialog .modal-content.modal-modern .modal-body-modern, 
.modal.show .modal-dialog .modal-content.modal-modern .modal-body-modern, 
.modal-dialog .modal-content.modal-modern .modal-body-modern, 
.modal-content.modal-modern .modal-body-modern, 
html[data-bs-theme=dark] .modal.fade.show .modal-dialog .modal-content.modal-modern .modal-footer-modern, 
.modal.show .modal-dialog .modal-content.modal-modern .modal-footer-modern, 
.modal-dialog .modal-content.modal-modern .modal-footer-modern, 
.modal-content.modal-modern .modal-footer-modern{
    background-color: var(--ct-secondary-bg) !important;
}

/* Modal sem a classe modal-modern (ex: modais de confirmação/exclusão) */
html[data-bs-theme=dark] .modal-content .modal-header-modern,
html[data-bs-theme=dark] .modal-content .modal-body-modern,
html[data-bs-theme=dark] .modal-content .modal-footer-modern {
    background-color: var(--ct-secondary-bg) !important;
    color: var(--ct-emphasis-color) !important;
    border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .modal-content .modal-body-modern p,
html[data-bs-theme=dark] .modal-content .modal-body-modern span,
html[data-bs-theme=dark] .modal-content .modal-body-modern label {
    color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .modal-content .text-deletion-confirmation {
    background-color: rgba(220, 38, 38, 0.12) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
    color: #fca5a5 !important;
}

html[data-bs-theme=dark] .modal-content .text-deletion-confirmation svg {
    color: #fca5a5 !important;
    stroke: #fca5a5 !important;
}

html[data-bs-theme=dark] .card-preview-text p {
    color: var(--ct-text-lighter) !important;
}

html[data-bs-theme=dark] .seq-modal-close:hover {
    background-color: var(--ct-hover-bg) !important;
    color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .seq-modal-close {
    color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .btn-secondary-class {
    background: var(--ct-alt-bg) !important;
    color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .btn-secondary-class:hover {
    background: var(--ct-alt-bg-lighter) !important;
}

html[data-bs-theme=dark] .dropdown-item {
    color: var(--ct-secondary-color);
}

html[data-bs-theme=dark] .dropdown-item:hover {
    background: var(--ct-alt-bg-light) !important;
}

html[data-bs-theme=dark] .modal-tabs-content, 
html[data-bs-theme=dark] .modal.fade.show .modal-dialog .modal-content.modal-modern .modal-body-with-tabs {
    background-color: var(--ct-body-bg) !important;
}

html[data-bs-theme=dark] .grafico-preview-card {
    background-color: var(--ct-secondary-bg) !important;
    border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .btn-grafico-sequencia {
    color: var(--ct-primary-custom) !important;
}

html[data-bs-theme=dark] .modal-main-area {
    background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .modal-tabs-sidebar {
    background: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .modal-tabs-sidebar-header, 
html[data-bs-theme=dark] .modal-tabs-sidebar, 
html[data-bs-theme=dark] .modal-main-area {
    border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .modal-header-active-tab {
    color: var(--ct-white) !important;
}

html[data-bs-theme=dark] .agenda-container {
    background-color: var(--ct-secondary-bg) !important;
}

/* Agenda - slots do dia/semana mantêm fundo claro (como mensal) */
html[data-bs-theme=dark] .bg-tertiary,
html[data-bs-theme=dark] .tarefas-container.card-semana,
html[data-bs-theme=dark] .tarefas-container.card-dia {
  background: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .agenda-grid-dia .slot-cell,
html[data-bs-theme=dark] .agenda-grid-semana .slot-cell {
  background-color: var(--ct-body-bg);
  border-color: var(--ct-border-color);
}

/* Tarefas: fundo escuro padrão, preserva cores inline personalizadas */
html[data-bs-theme=dark] .tarefa-agenda-item,
html[data-bs-theme=dark] .tarefa-agenda-item.tarefa-extendida {
  background-color: var(--ct-hover-bg) !important;
  border-color: var(--ct-border-color);
}

html[data-bs-theme=dark] .tarefa-agenda-item:hover,
html[data-bs-theme=dark] .tarefa-agenda-item.tarefa-extendida:hover {
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .tarefa-agenda-item .tarefa-agenda-horario,
html[data-bs-theme=dark] .tarefa-agenda-item .tarefa-agenda-titulo {
  color: var(--ct-emphasis-color) !important;
}

/* Tarefas dentro de horários não úteis também têm o padrão de listras */
html[data-bs-theme=dark] .slot-cell.horario-fora-expediente .tarefa-agenda-item,
html[data-bs-theme=dark] .slot-cell.horario-fora-expediente .tarefa-agenda-item.tarefa-extendida,
html[data-bs-theme=dark] .slot-cell.dia-nao-util .tarefa-agenda-item,
html[data-bs-theme=dark] .slot-cell.dia-nao-util .tarefa-agenda-item.tarefa-extendida {
  background-color: var(--ct-hover-bg) !important;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.05) 10px,
    rgba(255, 255, 255, 0.05) 11px
  ) !important;
}

/* Horários fora de expediente e dias não úteis - fundo escuro com textura */
html[data-bs-theme=dark] .agenda-grid-dia .slot-cell.horario-fora-expediente,
html[data-bs-theme=dark] .agenda-grid-semana .slot-cell.horario-fora-expediente,
html[data-bs-theme=dark] .agenda-grid-semana .slot-cell.dia-nao-util,
html[data-bs-theme=dark] .agenda-mes-body .mes-cell.dia-nao-util {
  background-color: var(--ct-tertiary-bg) !important;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.05) 10px,
    rgba(255, 255, 255, 0.05) 11px
  ) !important;
}

html[data-bs-theme=dark] .agenda-grid-dia .slot-cell.horario-fora-expediente::after,
html[data-bs-theme=dark] .agenda-grid-semana .slot-cell.horario-fora-expediente::after,
html[data-bs-theme=dark] .slot-cell.dia-nao-util::after {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.05) 10px,
    rgba(255, 255, 255, 0.05) 11px
  ) !important;
}

html[data-bs-theme=dark] .add-card-title {
    color: var(--ct-primary-dark) !important;
}

html[data-bs-theme=dark] h5,
html[data-bs-theme=dark] h4,
html[data-bs-theme=dark] h3,
html[data-bs-theme=dark] h2,
html[data-bs-theme=dark] h1,
html[data-bs-theme=dark] .card-title {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] h6 {
    color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .btn-compartilhar-formulario-custom,
html[data-bs-theme=dark] .seq-dropdown-button {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .btn-compartilhar-formulario-custom svg,
html[data-bs-theme=dark] .seq-dropdown-button svg {
  color: var(--ct-secondary-color) !important;
  stroke: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .form-label-modern {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] body .modal-content.modal-modern .modal-header-modern h5.modal-title-modern,
html[data-bs-theme=dark] body .modal-content.modal-modern .modal-header-modern h4.modal-title-modern,
html[data-bs-theme=dark] body .modal-content.modal-modern .modal-header-modern .modal-title-modern {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .upload-area {
  background-color: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .bg-white {
  background-color: transparent !important;
}

html[data-bs-theme=dark] .text-muted {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .container-border {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .form-container, html[data-bs-theme=dark] #dashboard-content-area {
  background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .form-control-modern, html[data-bs-theme=dark] .form-select, html[data-bs-theme=dark] .form-control, html[data-bs-theme=dark] .form-select-modern, html[data-bs-theme=dark] .input-search {
  background-color: var(--ct-tertiary-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .form-control::placeholder,
html[data-bs-theme=dark] .form-select option,
html[data-bs-theme=dark] .input-search::placeholder {
  color: var(--ct-secondary-color);
}

html[data-bs-theme=dark] .form-control:focus,
html[data-bs-theme=dark] .form-select:focus,
html[data-bs-theme=dark] .form-select-modern:focus,
html[data-bs-theme=dark] .input-search:focus {
  background-color: var(--ct-card-bg) !important;
  border-color: var(--ct-primary-custom) !important;
  color: var(--ct-emphasis-color) !important;
  box-shadow: 0 0 0 0.2rem rgba(160, 76, 203, 0.25) !important;
}

html[data-bs-theme=dark] .text-primary {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] #painel-dropdown {
  background-color: var(--ct-body-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] #painel-selector {
  background: transparent !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .grid-stack-item-content {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .text-muted-modern {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] #pagination-tarefas {
  background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] #departamentosTabs .custom-react-tab:hover {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .custom-react-tab, html[data-bs-theme=dark] .tabs-settings {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .tabs-settings:hover {
  color: var(--ct-white) !important;
}

html[data-bs-theme=dark] .tabs-settings.active {
  background-color: var(--ct-primary-dark) !important;
  color: var(--ct-white) !important;
}

html[data-bs-theme=dark] .subtitle-config {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] #painel-list {
  background: transparent !important;
  color: var(--ct-secondary-color);
}

html[data-bs-theme=dark] .card-sequence-hover {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] #painel-list li:hover {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .border-color {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .btn-back-gray {
  color: var(--ct-accent-color) !important;
}

html[data-bs-theme=dark] .btn-compartilhar-formulario-custom:hover,
html[data-bs-theme=dark] .seq-dropdown-button:hover {
  color: var(--ct-white) !important;
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .btn-compartilhar-formulario-custom:hover svg,
html[data-bs-theme=dark] .seq-dropdown-button:hover svg {
  color: var(--ct-white) !important;
  stroke: var(--ct-white) !important;
}

html[data-bs-theme=dark] .card {
  background-color: var(--ct-card-bg);
  border-color: var(--ct-border-color);
}

html[data-bs-theme=dark] .modal-content {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color);
}

html[data-bs-theme=dark] .dropdown-menu {
  background-color: var(--ct-body-bg) !important;
  color: var(--ct-secondary-color) !important;
  border-color: var(--ct-border-color);
}

html[data-bs-theme=dark] .table {
  --bs-table-bg: var(--ct-card-bg);
  --bs-table-border-color: var(--ct-border-color);
}

html[data-bs-theme=dark] .sequence-card {
  background-color: var(--ct-card-bg);
  border-color: var(--ct-border-color);
}

html[data-bs-theme=dark] .sequence-card:hover {
  background-color: var(--ct-card-hover-bg);
  border-color: var(--ct-card-hover-border);
}

html[data-bs-theme=dark] .table-responsive,
html[data-bs-theme=dark] .table-responsive table,
html[data-bs-theme=dark] .table-responsive th,
html[data-bs-theme=dark] .table-responsive td {
  background-color: var(--ct-secondary-bg) !important;
  color: var(--ct-emphasis-color) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .table-responsive thead th {
  background-color: var(--ct-secondary-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .table-responsive tbody tr {
  background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .table-responsive tbody tr:hover {
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .table-responsive tbody tr:hover,
html[data-bs-theme=dark] .table-responsive table tbody tr:hover {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .table-hover > tbody > tr:hover > * {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
  --ct-table-color-state: var(--ct-table-hover-color);
  --ct-table-bg-state: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .table-striped > tbody > tr:nth-of-type(odd) > * {
  --ct-table-color-type: var(--ct-table-striped-color);
  --ct-table-bg-type: var(--ct-hover-bg);
}

html[data-bs-theme=dark] .ds-pagination-size__label, html[data-bs-theme=dark] .ds-pagination-navigation-label, html[data-bs-theme=dark] .ds-pagination-go-to__label {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .ds-pagination-item, html[data-bs-theme=dark] .ds-select__button {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .ds-pagination-item:hover {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] body .modal-footer-modern[style] {
  background-color: var(--ct-secondary-bg) !important;
}

/* Sobrescrever os seletores de alta especificidade do app-saas.css
   que forçam background: #ffffff !important no footer do modal */
html[data-bs-theme=dark] body .modal.fade.show .modal-content.modal-modern .modal-footer-modern,
html[data-bs-theme=dark] body .modal.show .modal-content.modal-modern .modal-footer-modern,
html[data-bs-theme=dark] body .modal.fade .modal-content.modal-modern .modal-footer-modern,
html[data-bs-theme=dark] body .modal-content.modal-modern .modal-footer-modern,
html[data-bs-theme=dark] .modal-footer-modern {
  background: var(--ct-secondary-bg) !important;
  background-color: var(--ct-secondary-bg) !important;
  background-image: none !important;
}

html[data-bs-theme=dark] .form-check-label {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .alert-info {
  color: var(--ct-info-color) !important;
}

html[data-bs-theme=dark] .btn-outline-primary {
  background-color: var(--ct-alt-bg) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .btn-outline-primary:hover {
  background-color: var(--ct-alt-bg-lighter) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .list-container {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .list-item:hover, html[data-bs-theme=dark] .acumulador-item:hover{
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .geracao-controles {
  background: var(--ct-tertiary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .btn.btn-primary {
  color: var(--ct-primary-custom) !important;
}

html[data-bs-theme=dark] .nav-tabs .nav-link {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .nav-tabs .nav-link.active {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .table ,html[data-bs-theme=dark] .table > :not(caption) > * > * {
  background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .table th {
  color: var(--ct-emphasis-color) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .modern-table tbody td {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .table td, html[data-bs-theme=dark] .btn-icon-view, html[data-bs-theme=dark] .btn-icon-message {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .accordion-button:not(.collapsed) {
  background-color: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .custom-react-tab.vencido{
  color: #b91c1cbf !important;
}

html[data-bs-theme=dark] .custom-react-tab.vencido:hover{
  color: #b91c1c !important;
}

html[data-bs-theme=dark] .custom-react-tab.avencer {
  color: #ff9966bf !important;
}

html[data-bs-theme=dark] .custom-react-tab.avencer:hover {
  color: #ff9966 !important;
}

html[data-bs-theme=dark] .custom-react-tab.prazo {
  color: #1c4eb9bf !important;
}

html[data-bs-theme=dark] .custom-react-tab.prazo:hover {
  color: #1c4eb9 !important;
}

/* ── Linhas da lista de etapas (formAddRegras) ── */
.etf-row-card {
  border: 1px solid #e0e0e0;
  background: #fafafa;
}

.etf-row-idx {
  color: #888;
}

.etf-row-hint {
  color: #888;
}

html[data-bs-theme=dark] .etf-row-card {
  background-color: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .etf-row-card:hover {
  background-color: var(--ct-card-hover-bg) !important;
  border-color: var(--ct-card-hover-border) !important;
}

html[data-bs-theme=dark] .etf-row-idx {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .etf-row-hint {
  color: var(--ct-text-lighter) !important;
}

html[data-bs-theme=dark] .etf-row-card .etf-row-hint {
  color: var(--ct-text-lighter) !important;
}

html[data-bs-theme=dark] .etf-panel {
  background-color: var(--ct-card-bg) !important;
  border: 1px solid var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .etf-panel h6 {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .etf-panel label {
  color: var(--ct-text-light) !important;
}

html[data-bs-theme=dark] .etf-input,
html[data-bs-theme=dark] .etf-select {
  background-color: var(--ct-alt-bg) !important;
  border: 1px solid var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .etf-input::placeholder {
  color: var(--ct-text-lighter) !important;
}

html[data-bs-theme=dark] .etf-input:focus,
html[data-bs-theme=dark] .etf-select:focus {
  border-color: var(--ct-primary-custom) !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(160, 76, 203, 0.2) !important;
}

html[data-bs-theme=dark] .etf-hint {
  color: var(--ct-text-lighter) !important;
}

html[data-bs-theme=dark] .etf-tag-remove {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .etf-tag-remove:hover {
  color: var(--ct-emphasis-color) !important;
}

/* ── Selected Action Display (automação) ── */
.selected-action-display {
  background-color: #f8f5fa;
  border-color: #3f1057 !important;
}

.selected-action-icon-wrap {
  background-color: #fff;
}

.selected-action-text,
.selected-action-display i {
  color: #3f1057;
}

html[data-bs-theme=dark] .selected-action-display {
  background-color: var(--ct-primary-dark) !important;
  border-color: var(--ct-primary-custom) !important;
}

html[data-bs-theme=dark] .selected-action-icon-wrap {
  background-color: var(--ct-alt-bg) !important;
}

html[data-bs-theme=dark] .selected-action-text,
html[data-bs-theme=dark] .selected-action-display i {
  color: var(--ct-accent-color) !important;
}

/* ── Campo Dinâmico Select (EmailsTemplateModalManager) ── */
#campoDinamicoSelect {
  border: 1px solid #ced4da;
}

.campo-dinamico-summary {
  cursor: pointer;
  font-weight: bold;
  background-color: #f8f9fa;
  padding: 5px;
  border-radius: 4px;
}

.campo-dinamico-item {
  padding: 8px;
  background-color: #ffffff;
  border-bottom: 1px solid #eef2f7;
  cursor: pointer;
}

.campo-dinamico-item--hover {
  background-color: #f8f9fa !important;
}

html[data-bs-theme=dark] #campoDinamicoSelect {
  background-color: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .campo-dinamico-summary {
  background-color: var(--ct-secondary-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .campo-dinamico-item {
  background-color: var(--ct-alt-bg) !important;
  border-bottom-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .campo-dinamico-item--hover,
html[data-bs-theme=dark] .campo-dinamico-item:hover {
  background-color: var(--ct-hover-bg) !important;
}

/* ── Logs e Comentários ── */
.log-card {
  background: white;
  border: 1px solid #e9ecef;
}

.log-detalhes-mudancas {
  background: #f8f9fa;
}

.log-attach-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

.log-file-box {
  background: #f9f9f9;
  border: 1px solid #ddd;
}

.log-file-label {
  color: #999;
}

.comentario-bubble {
  background: white;
  color: #212529;
  border: 1px solid #e9ecef;
}

html[data-bs-theme=dark] .log-card {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .log-card .log-header strong,
html[data-bs-theme=dark] .log-card .log-body {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .log-detalhes-mudancas {
  background: var(--ct-alt-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .log-detalhes-mudancas span,
html[data-bs-theme=dark] .log-detalhes-mudancas strong {
  color: inherit !important;
}

html[data-bs-theme=dark] .log-attach-box {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .log-attach-box a {
  color: var(--ct-accent-color) !important;
}

html[data-bs-theme=dark] .log-attach-box .fw-semibold {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .log-file-box {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .log-file-box a {
  color: var(--ct-accent-color) !important;
}

html[data-bs-theme=dark] .log-file-label {
  color: var(--ct-text-lighter) !important;
}

html[data-bs-theme=dark] .comentario-bubble {
  background: var(--ct-card-bg) !important;
  color: var(--ct-emphasis-color) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .comentario-bubble [style*="color: #495057"] {
  color: var(--ct-text-light) !important;
}

/* ── Modal Tarefas Pendentes ── */
html[data-bs-theme=dark] .modal-tarefas-pendentes .card {
  background-color: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .card-header {
  border-bottom-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .tarefas-lista {
  background-color: var(--ct-card-bg) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .tarefas-lista .border-bottom {
  background-color: var(--ct-alt-bg) !important;
  border-bottom-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .tarefas-lista .border-bottom strong {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .tarefas-lista .border-bottom small {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .tarefas-lista a[href] {
  color: var(--ct-accent-color) !important;
  background: rgba(160, 76, 203, 0.15) !important;
  border-color: rgba(160, 76, 203, 0.35) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .tarefas-lista a[href]:hover {
  background: rgba(160, 76, 203, 0.28) !important;
}

html[data-bs-theme=dark] .modal-tarefas-pendentes .text-muted {
  color: var(--ct-text-lighter) !important;
}


html[data-bs-theme=dark] .custom-react-tab.active{
  background-color: var(--ct-primary-dark) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .custom-react-tab.active:hover {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] #colaboradoresCount, html[data-bs-theme=dark] #empresaCount {
  background-color: var(--ct-body-bg) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .btn-outline-secondary {
  background-color: var(--ct-body-bg) !important;
}

html[data-bs-theme=dark] .filter-panel, html[data-bs-theme=dark] .modern-dropdown-menu {
  background-color: var(--ct-body-bg) !important;
  color: var(--ct-secondary-color) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] #solicitacoes-obrigacoes-list li, html[data-bs-theme=dark] #obrigacoes-list li {
  background-color: transparent !important;
  border: 1px solid var(--ct-border-color) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] #solicitacoes-obrigacoes-list li label, html[data-bs-theme=dark] #obrigacoes-list li label, html[data-bs-theme=dark] #empresas-list li label, html[data-bs-theme=dark] #departamentos-list li label, html[data-bs-theme=dark] #responsaveis-list li label, html[data-bs-theme=dark] #solicitacoes-empresas-list li label, html[data-bs-theme=dark] #solicitacoes-departamentos-list li label, html[data-bs-theme=dark] #solicitacoes-responsaveis-list li label {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] #solicitacoes-obrigacoes-list li:hover, html[data-bs-theme=dark] #obrigacoes-list li:hover, html[data-bs-theme=dark] #empresas-list li:hover, html[data-bs-theme=dark] #departamentos-list li:hover, html[data-bs-theme=dark] #responsaveis-list li:hover, html[data-bs-theme=dark] #solicitacoes-empresas-list li:hover, html[data-bs-theme=dark] #solicitacoes-departamentos-list li:hover, html[data-bs-theme=dark] #solicitacoes-responsaveis-list li:hover {
  background-color: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .filtros-avancados-dropdown-menu {
  background-color: var(--ct-body-bg) !important;
  color: var(--ct-secondary-color) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .btn:hover {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .content-page--phase-list .phase-toolbar {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .nav-btn.active {
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .nav-btn:hover {
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .nav-btn {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .virtual-phase-header {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .virtual-phase-title {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .virtual-phase-card-count {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-secondary-color) !important ;
}

html[data-bs-theme=dark] .tasks {
  background-color: var(--ct-bg-kambam) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .sequence-card-body {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .kanban-scroll {
  scrollbar-width: thin;         
  scrollbar-color: var(--ct-primary-custom) transparent;
}

html[data-bs-theme=dark] .sequence-card-body {
  color: var(--ct-white) !important;
}

html[data-bs-theme=dark] .bg-danger {
  background-color: #991b1b30 !important;
}

html[data-bs-theme=dark] .departamento-nome-tabela {
  color: var(--ct-secondary-color) !important;
}

.thin-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--ct-hover-bg) transparent;
}

html[data-bs-theme=dark] .modal-header, html[data-bs-theme=dark] .modal-header-modern {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .campos-container, html[data-bs-theme=dark] .form-field-wrapper {
  background-color: transparent !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] body .modal-dialog.modal-side, html[data-bs-theme=dark] #grupo-checkbox-container, html[data-bs-theme=dark] #funcao-checkbox-container {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .icon-box {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .icon-box svg {
  stroke: currentColor !important;
}

html[data-bs-theme=dark] label {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] [data-field="regime_tributario"].valor-campo {
  border-color: var(--ct-border-color) !important;
  background: transparent !important;
}

html[data-bs-theme=dark] [data-field="regime_tributario"].valor-campo:hover {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .accordion-historico .accordion-button {
  border-color: var(--ct-border-color) !important;
  background-color: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .accordion-button.accordion-historico-btn:not(.collapsed) {
  background-color: var(--ct-bg-kambam) !important;
}

html[data-bs-theme=dark] .accordion-body {
  background-color: transparent !important;
}

html[data-bs-theme=dark] .accordion-button::after {
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dedede' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='lucide lucide-chevron-down-icon lucide-chevron-down'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

html[data-bs-theme=dark] .accordion-button {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .icon-card {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .titulo-campo-card, html[data-bs-theme=dark] .campo-text-card {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .bg-light {
  background-color: transparent !important;
}

html[data-bs-theme=dark] .coluna-card {
  scrollbar-width: thin;
  scrollbar-color: var(--ct-hover-bg) transparent;
}

html[data-bs-theme=dark] .card-title-text {
  color: var(--ct-white) !important;
}

html[data-bs-theme=dark] .responsavel-card {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .field-tag {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .field-tag:hover {
  color: var(--ct-emphasis-color) !important;
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .nav-item-sequence .nav-link {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .nav-item-sequence .nav-link:hover {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .nav-item-sequence .nav-link.active {
  background-color: var(--ct-primary-dark) !important;
  color: var(--ct-emphasis-color) !important;
}

/* ============================================================
   Overrides do novoscriptsequencias.js — componentes gerados via JS
   ============================================================ */

/* Placeholder de responsáveis */
html[data-bs-theme=dark] .placeholder-text {
  color: var(--ct-secondary-color) !important;
}

/* Dropdown de responsáveis inline */
html[data-bs-theme=dark] .dropdown-responsaveis-inline {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}

/* Dropdown assignee */
html[data-bs-theme=dark] .assignee-dropdown {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}

/* Select2 — estilos injetados via JS */
html[data-bs-theme=dark] .select2-container--default .select2-selection--single,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--single {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__placeholder,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
  color: var(--ct-text-lighter) !important;
}
html[data-bs-theme=dark] .select2-container--default .select2-selection--multiple,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-selection__rendered,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background-color: var(--ct-hover-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
  color: var(--ct-secondary-color) !important;
  border-right-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .select2-container--default .select2-selection--multiple .select2-search__field,
html[data-bs-theme=dark] .select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .select2-dropdown {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .select2-container--default .select2-results__option--highlighted {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .select2-nome {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .select2-email {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .select2-nome-selection {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .select2-inline-search {
  color: var(--ct-emphasis-color) !important;
}

/* ── Empresas Responsável (form colaborador) ── */
.empresas-responsavel-table-wrap { border-radius: 6px; overflow: hidden; border: 1px solid #dee2e6; }
html[data-bs-theme=dark] .empresas-responsavel-table-wrap { border-color: var(--ct-border-color) !important; }
html[data-bs-theme=dark] .empresas-responsavel-table thead tr { background: var(--ct-secondary-bg) !important; color: var(--ct-emphasis-color) !important; }
html[data-bs-theme=dark] .empresas-responsavel-table tbody tr { background: var(--ct-card-bg) !important; color: var(--ct-emphasis-color) !important; }
html[data-bs-theme=dark] .empresas-responsavel-table tbody tr:hover { background: var(--ct-hover-bg) !important; }
html[data-bs-theme=dark] .empresas-responsavel-table td, html[data-bs-theme=dark] .empresas-responsavel-table th { border-color: var(--ct-border-color) !important; }

/* Seletor de empresa */
html[data-bs-theme=dark] .empresa-search-input {
  background: var(--ct-card-hover-bg) !important;
  border-color: var(--ct-card-hover-border) !important;
}

/* Modal body/footer com background white inline - EXCLUINDO elementos da agenda */
html[data-bs-theme=dark] .modal-body[style*="background: white"]:not(.programacao-item):not(.tarefa-agenda-item),
html[data-bs-theme=dark] .modal-body[style*="background-color: #fff"]:not(.programacao-item):not(.tarefa-agenda-item),
html[data-bs-theme=dark] .modal-footer[style*="background: white"],
html[data-bs-theme=dark] .modal-footer[style*="background-color: #fff"] {
  background: var(--ct-card-bg) !important;
}

/* Textos genéricos hardcoded para preto - EXCLUINDO elementos da agenda */
html[data-bs-theme=dark] [style*="color: #101820"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet),
html[data-bs-theme=dark] [style*="color: #333"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet),
html[data-bs-theme=dark] [style*="color: #2c3e50"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet),
html[data-bs-theme=dark] [style*="color: #2d0c3f"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet) {
  color: var(--ct-emphasis-color) !important;
}

/* Backgrounds claros hardcoded - EXCLUINDO elementos da agenda */
html[data-bs-theme=dark] [style*="background-color: #f8f9fa"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet),
html[data-bs-theme=dark] [style*="background-color: #e9ecef"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet),
html[data-bs-theme=dark] [style*="background: white"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet),
html[data-bs-theme=dark] [style*="background-color: #fff"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet),
html[data-bs-theme=dark] [style*="background:#fff"]:not(.programacao-item):not(.tarefa-agenda-item):not(.bullet) {
  background-color: var(--ct-card-bg) !important;
  background: var(--ct-card-bg) !important;
}
html[data-bs-theme=dark] .text-desconsiderar {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .badget-tarefas-desconsiderar {
  color: var(--ct-secondary-color) !important;
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .tt {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .bg-hover {
  background-color: var(--ct-hover-bg) !important;
}

html[data-bs-theme=dark] .color-emphasis {
  color: var(--ct-primary-custom) !important;
}

html[data-bs-theme=dark] .color-secondary {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .color-titles {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .accordion-button {
  color: var(--ct-emphasis-color);
}

html[data-bs-theme=dark] .bg-body {
  background-color: var(--ct-body-bg) !important;
}

html[data-bs-theme=dark] .bg-secondary-dark {
  background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .bg-tertiary {
  background: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .container-form, html[data-bs-theme=dark] .container-sequence {
  background-color: transparent !important ;
}

html[data-bs-theme=dark] .btn-filter {
  background-color: var(--ct-hover-bg);
}

html[data-bs-theme=dark] .btn-filter:hover {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .btn-filter.active {
  background-color: var(--ct-primary-dark) !important;
}

html[data-bs-theme=dark] .profile-dropdown-name {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .profile-dropdown-email {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .profile-dropdown-header {
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .authentication-bg {
  background-color: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .tipo-notificacao-option {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .tipo-notificacao-label {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .sequence-search-container {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .btn-trocar-status {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

/* ── ds-* dropdown components (paginação, seletor de tamanho, etc.) ── */
html[data-bs-theme=dark] .ds-option-wrapper {
  background-color: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

html[data-bs-theme=dark] .ds-option button {
  color: var(--ct-emphasis-color) !important;
  background: none !important;
}

html[data-bs-theme=dark] .ds-option button:hover {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .ds-option.is-selected button {
  background-color: var(--ct-primary-dark) !important;
  color: #ffffff !important;
}

html[data-bs-theme=dark] .ds-option.is-selected button:hover {
  background-color: var(--ct-primary-custom) !important;
}

html[data-bs-theme=dark] .ds-options__scrollable-options {
  scrollbar-color: var(--ct-border-color) transparent;
}

/* ── logs-chat (atividade da tarefa) ── */
html[data-bs-theme=dark] .logs-chat-container {
  background: var(--ct-secondary-bg) !important;
}

html[data-bs-theme=dark] .logs-chat-header {
  background: var(--ct-card-bg) !important;
  border-bottom-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .logs-chat-header h5 {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .logs-chat-messages {
  background: var(--ct-tertiary-bg) !important;
}

html[data-bs-theme=dark] .logs-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15) !important;
}

html[data-bs-theme=dark] .logs-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}

html[data-bs-theme=dark] .logs-chat-input {
  background: var(--ct-card-bg) !important;
  border-top-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .logs-chat-input #btn-attach-file {
  color: var(--ct-secondary-color) !important;
}

/* Cards internos dos logs */
html[data-bs-theme=dark] .log-content .d-flex.align-items-start {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .log-header,
html[data-bs-theme=dark] .log-body {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .log-header strong {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .log-icon {
  color: var(--ct-secondary-color) !important;
}

/* ── Anexo nome container (ícone de arquivo, nome, botão editar, input) ── */
html[data-bs-theme=dark] .anexo-nome-container svg {
  stroke: var(--ct-accent-color) !important;
}

html[data-bs-theme=dark] .anexo-nome-text {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .anexo-edit-icon {
  stroke: var(--ct-accent-color) !important;
}

html[data-bs-theme=dark] .anexo-nome-input {
  color: var(--ct-emphasis-color) !important;
  background-color: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
}

/* ======================================================
   Botões do modal de recorrentes (trocar responsável/status)
   ====================================================== */
.btn-trocar-responsavel,
.btn-trocar-status {
  color: #000;
  border: 1px solid #dee2e6;
}

.btn-trocar-responsavel:hover {
  border-color: #000 !important;
  color: #495057 !important;
}

.btn-trocar-status:hover {
  border-color: #0d6efd !important;
  color: #0d6efd !important;
}

html[data-bs-theme=dark] .btn-trocar-responsavel,
html[data-bs-theme=dark] .btn-trocar-status {
  color: var(--ct-emphasis-color) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .btn-trocar-responsavel:hover {
  border-color: var(--ct-accent-color) !important;
  color: var(--ct-accent-color) !important;
}

html[data-bs-theme=dark] .btn-trocar-status:hover {
  border-color: var(--ct-primary-custom) !important;
  color: var(--ct-primary-custom) !important;
}

html[data-bs-theme=dark] span[id^="responsavel-nome-"] {
  color: var(--ct-emphasis-color) !important;
}

/* ─── Empresa Selector ─────────────────────────────────────────────────── */
html[data-bs-theme=dark] .empresa-selector-container {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .empresa-search-input {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .empresa-search-input::placeholder {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .empresa-search-input:focus {
  border-color: var(--ct-primary-custom) !important;
  box-shadow: 0 0 0 3px rgba(160, 76, 203, 0.2) !important;
}
html[data-bs-theme=dark] .empresa-list-container {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .empresa-card-selector {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .empresa-card-selector:hover {
  background: var(--ct-hover-bg) !important;
}
html[data-bs-theme=dark] .empresa-card-selector.selected {
  background: var(--ct-primary-dark) !important;
  border-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .empresa-title-selector {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .empresa-subtitle-selector {
  color: var(--ct-secondary-color) !important;
  background: var(--ct-alt-bg) !important;
}
html[data-bs-theme=dark] .select-circle {
  border-color: var(--ct-border-color) !important;
  background: var(--ct-secondary-bg) !important;
}
html[data-bs-theme=dark] .empresa-card-selector.selected .select-circle {
  background: var(--ct-primary-custom) !important;
  border-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .empresa-details-selector {
  border-top-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .detail-item-selector:not(:last-child) {
  border-bottom-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .detail-text-selector {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .detail-label-selector {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .empresa-loading-modern {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .loading-spinner-modern {
  border-color: var(--ct-border-color) !important;
  border-top-color: var(--ct-primary-custom) !important;
}

/* ─── Prontuário Sidebar ───────────────────────────────────────────────── */
html[data-bs-theme=dark] #prontuario-app .container-border {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar {
  background: var(--ct-secondary-bg) !important;
  color: var(--ct-secondary-color) !important;
  border-right-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-header {
  border-bottom-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-breadcrumb {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-breadcrumb:hover {
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-section-title {
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-icon-btn {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-icon-btn:hover {
  color: var(--ct-emphasis-color) !important;
  background: var(--ct-hover-bg) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-search-input {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-search-input::placeholder {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-search-input:focus {
  border-color: var(--ct-primary-custom) !important;
  box-shadow: 0 0 0 2px rgba(160, 76, 203, 0.2) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item:hover {
  background: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item.active {
  color: var(--ct-emphasis-color) !important;
  border-left-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item-all.active,
html[data-bs-theme=dark] .prontuario-sidebar-item-space.active {
  background: var(--ct-primary-dark) !important;
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-registros-list .prontuario-sidebar-item.active,
html[data-bs-theme=dark] .prontuario-registros-list-space .prontuario-sidebar-item.active {
  border-left-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item-count {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item-delete {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-loading {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-empty {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item-creating {
  background: var(--ct-hover-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-item-input {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-footer {
  border-top-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-create-btn {
  background: var(--ct-primary-dark) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-sidebar-create-btn:hover {
  background: var(--ct-hover-bg) !important;
  border-color: var(--ct-primary-custom) !important;
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-empty-criar-btn {
  color: var(--ct-accent-color) !important;
  background: var(--ct-primary-dark) !important;
  border-color: var(--ct-border-color) !important;
}

/* ─── Prontuário Content View ──────────────────────────────────────────── */
html[data-bs-theme=dark] .prontuario-toolbar-back {
  color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-toolbar-back:hover {
  background: var(--ct-hover-bg) !important;
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-toolbar-btn {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-toolbar-btn:hover {
  background: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-title {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-title:empty::before {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-title.prontuario-doc-editable:empty::before {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-meta {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-body {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-placeholder {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-placeholder-inline {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-content-editable {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-inline-plus,
html[data-bs-theme=dark] .prontuario-inline-handle {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-inline-plus:hover,
html[data-bs-theme=dark] .prontuario-inline-handle:hover {
  background: var(--ct-hover-bg) !important;
  color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-doc-content-editable pre {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-anexos {
  border-top-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-tag {
  background: var(--ct-secondary-bg) !important;
  color: var(--ct-emphasis-color) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-tag:hover {
  background: var(--ct-hover-bg) !important;
  border-color: var(--ct-primary-custom) !important;
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-tipo-badge {
  background: var(--ct-hover-bg) !important;
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-doc-tipo-ligacao   { background: var(--ct-primary-dark) !important; color: var(--ct-accent-color) !important; }
html[data-bs-theme=dark] .prontuario-doc-tipo-email     { background: #0c2240 !important; color: #7eb3f5 !important; }
html[data-bs-theme=dark] .prontuario-doc-tipo-whatsapp  { background: #0c2818 !important; color: #4ade80 !important; }
html[data-bs-theme=dark] .prontuario-doc-tipo-presencial{ background: #2d1a06 !important; color: #fbbf24 !important; }
html[data-bs-theme=dark] .prontuario-doc-tipo-online    { background: #2a0a2e !important; color: #e879f9 !important; }
html[data-bs-theme=dark] .prontuario-doc-save-btn,
html[data-bs-theme=dark] .prontuario-doc-edit-btn {
  color: var(--ct-accent-color) !important;
  border-color: var(--ct-border-color) !important;
  background: var(--ct-secondary-bg) !important;
}
html[data-bs-theme=dark] .prontuario-doc-save-btn:hover,
html[data-bs-theme=dark] .prontuario-doc-edit-btn:hover {
  background: var(--ct-hover-bg) !important;
  border-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-md-block:hover {
  background: rgba(160, 76, 203, 0.08) !important;
}

/* ─── Prontuário Audio Inline ──────────────────────────────────────────── */
html[data-bs-theme=dark] .prontuario-audio-inline {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-audio-header {
  background: #2a0f0f !important;
  border-bottom-color: #4a1a1a !important;
}
html[data-bs-theme=dark] .prontuario-audio-title {
  color: #fca5a5 !important;
}
html[data-bs-theme=dark] .prontuario-audio-close {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-audio-close:hover {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-audio-hint {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-audio-vu-bar {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-audio-vu-warning {
  background: #2d1e00 !important;
  border-color: #7a5200 !important;
  color: #fbbf24 !important;
}
html[data-bs-theme=dark] .prontuario-audio-spinner {
  border-color: #4a1a1a !important;
  border-top-color: #ef4444 !important;
}
html[data-bs-theme=dark] .prontuario-audio-processing-txt {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-audio-result-text {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
  outline-color: #ef4444 !important;
}
html[data-bs-theme=dark] .prontuario-audio-copy,
html[data-bs-theme=dark] .prontuario-audio-reiniciar {
  background: var(--ct-secondary-bg) !important;
  color: var(--ct-emphasis-color) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-audio-copy:hover,
html[data-bs-theme=dark] .prontuario-audio-reiniciar:hover {
  background: var(--ct-hover-bg) !important;
}

/* ─── Prontuário AI Inline ─────────────────────────────────────────────── */
html[data-bs-theme=dark] .prontuario-ai-inline {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-title {
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-close {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-close:hover {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-input {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-input:focus {
  border-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-ai-input::placeholder {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-btn {
  background: var(--ct-primary-dark) !important;
  color: var(--ct-accent-color) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-btn:hover {
  background: var(--ct-hover-bg) !important;
  border-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-panel,
html[data-bs-theme=dark] .prontuario-ai-arq-panel {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-search {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-search:focus {
  border-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-search::placeholder {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-list li[data-id]:hover,
html[data-bs-theme=dark] .prontuario-ai-arq-folder:hover,
html[data-bs-theme=dark] .prontuario-ai-arq-file:hover label,
html[data-bs-theme=dark] .prontuario-ai-arq-back:hover {
  background: var(--ct-hover-bg) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-list li[data-id] label,
html[data-bs-theme=dark] .prontuario-ai-ctx-reg-nome,
html[data-bs-theme=dark] .prontuario-ai-arq-folder,
html[data-bs-theme=dark] .prontuario-ai-arq-file label {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-ctx-reg-preview,
html[data-bs-theme=dark] .prontuario-ai-ctx-loading {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-arq-breadcrumb {
  color: var(--ct-secondary-color) !important;
  border-bottom-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-arq-crumb {
  color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .prontuario-ai-arq-crumb:hover {
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-arq-crumb-active {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-arq-sep {
  color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-arq-back {
  color: var(--ct-primary-custom) !important;
  border-bottom-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .prontuario-ai-result {
  border-top-color: var(--ct-border-color) !important;
}

/* ─── Modal Empresas Movimentação ──────────────────────────────────────── */
html[data-bs-theme=dark] .empresas-lista {
  background-color: var(--ct-secondary-bg) !important;
}
html[data-bs-theme=dark] .empresa-item {
  border-bottom-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .empresa-item:hover {
  background-color: var(--ct-hover-bg) !important;
}

/* ─── Empresa Card Modern (display selecionado) ────────────────────────── */
html[data-bs-theme=dark] .empresa-card-modern {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .empresa-title {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .empresa-id {
  color: var(--ct-secondary-color) !important;
  background: var(--ct-alt-bg) !important;
}
html[data-bs-theme=dark] .btn-action {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .btn-action:hover {
  background: var(--ct-hover-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .btn-action-edit {
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .btn-action-edit:hover {
  background: var(--ct-primary-dark) !important;
  border-color: var(--ct-primary-custom) !important;
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .btn-action-remove:hover {
  background: rgba(220, 38, 38, 0.12) !important;
  border-color: #ef4444 !important;
}
html[data-bs-theme=dark] .empresa-details {
  border-top-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .detail-label {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .detail-value {
  color: var(--ct-emphasis-color) !important;
}

/* ─── Empresa Card Extended (tabs + detalhes) ──────────────────────────── */
/* Sections */
html[data-bs-theme=dark] .info-section {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .info-section-title {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .info-section-title i {
  color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .info-label {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .info-value {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .info-value.editing {
  background-color: var(--ct-primary-dark) !important;
}

/* Tabs */
html[data-bs-theme=dark] .empresa-tabs-nav {
  border-bottom-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .empresa-tab-btn {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .empresa-tab-btn:hover {
  background: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}

/* Responsáveis */
html[data-bs-theme=dark] .responsavel-card-modern {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .responsavel-nome-modern {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .responsavel-funcao {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .responsavel-actions button {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .responsavel-actions-footer {
  border-top-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .responsavel-item {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .responsavel-nome {
  color: var(--ct-emphasis-color) !important;
}

/* Contatos / Acessos / Certificados */
html[data-bs-theme=dark] .contato-item,
html[data-bs-theme=dark] .acesso-item,
html[data-bs-theme=dark] .certificado-item {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .contato-info h6,
html[data-bs-theme=dark] .acesso-info h6,
html[data-bs-theme=dark] .certificado-info h6 {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .contato-cargo {
  color: var(--ct-secondary-color) !important;
  background: var(--ct-alt-bg) !important;
}
html[data-bs-theme=dark] .certificado-status.ativo {
  background: rgba(5, 150, 105, 0.15) !important;
  color: #34d399 !important;
}
html[data-bs-theme=dark] .certificado-status.inativo {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme=dark] .btn-toggle-password {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .btn-toggle-password:hover {
  color: var(--ct-accent-color) !important;
}
html[data-bs-theme=dark] .btn-copy-cnpjcpf,
html[data-bs-theme=dark] .btn-copy-usuario {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .acesso-link {
  color: var(--ct-accent-color) !important;
}

/* Seções container */
html[data-bs-theme=dark] .responsaveis-section,
html[data-bs-theme=dark] .contatos-section,
html[data-bs-theme=dark] .certificados-section,
html[data-bs-theme=dark] .acessos-section {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .section-title {
  color: var(--ct-emphasis-color) !important;
  border-bottom-color: var(--ct-border-color) !important;
}

/* Status badges */
html[data-bs-theme=dark] .status-badge.status-ativo,
html[data-bs-theme=dark] .status-ativo {
  background: rgba(5, 150, 105, 0.15) !important;
  color: #34d399 !important;
}
html[data-bs-theme=dark] .status-badge.status-inativo,
html[data-bs-theme=dark] .status-inativo {
  background: rgba(220, 38, 38, 0.12) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme=dark] .status-badge.status-suspenso,
html[data-bs-theme=dark] .status-suspenso {
  background: rgba(217, 119, 6, 0.12) !important;
  color: #fbbf24 !important;
}

/* Registros relevantes */
html[data-bs-theme=dark] .registro-relevante-item {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .registro-titulo {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .registro-data {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .registro-conteudo {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .registro-tag {
  background: var(--ct-alt-bg) !important;
  color: var(--ct-accent-color) !important;
}

/* Empty state */
html[data-bs-theme=dark] .empty-state {
  color: var(--ct-secondary-color) !important;
}

/* ─── Competencia Dropdown ──────────────────────────────────────── */
.competencia-item--active {
  background-color: #f0f7ff;
  font-weight: 600;
  color: #9B128DFF;
}
.competencia-item:not(.competencia-item--active):hover {
  background-color: #f8f9fa;
}
html[data-bs-theme=dark] [id$="-competenciaDropdown"] {
  background: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .competencia-item {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .competencia-item:not(.competencia-item--active):hover {
  background-color: var(--ct-hover-bg) !important;
}
html[data-bs-theme=dark] .competencia-item--active {
  background-color: var(--ct-primary-dark) !important;
  color: var(--ct-accent-color) !important;
}

/* ─── Consulta Documentos (dropzone) ──────────────────────────────────── */
html[data-bs-theme=dark] .consulta-dropzone {
  background: var(--ct-alt-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .consulta-dropzone.is-dragover {
  background: var(--ct-primary-dark) !important;
  border-color: var(--ct-primary-custom) !important;
}
html[data-bs-theme=dark] .consulta-dropzone__title {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .consulta-dropzone__subtitle {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .consulta-selected {
  background: var(--ct-secondary-bg) !important;
}
html[data-bs-theme=dark] .consulta-selected__label {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .consulta-selected__value {
  color: var(--ct-emphasis-color) !important;
}

/* ================================================================
   Painel de Obrigações (renderizarAnexosParaCard / RecorrentesModal)
   ================================================================ */

/* Ícone de obrigação no header do card (span com color: #3f1057 inline) */
html[data-bs-theme=dark] .card-body > .d-flex > span[style*="#3f1057"] {
  color: var(--ct-primary-custom) !important;
}

/* Separador hr dentro do card de obrigação */
html[data-bs-theme=dark] .card.bg-light {
  background-color: var(--ct-card-bg) !important;
}

/* obrigacao-item (template do dropdown) */
html[data-bs-theme=dark] .obrigacao-item {
  border-bottom-color: var(--ct-border-color) !important;
}

/* Items de anexo / email / whatsapp dentro de .anexos-container */
html[data-bs-theme=dark] .anexos-container .border {
  background-color: var(--ct-secondary-bg) !important;
  border-color: var(--ct-primary-dark) !important;
}

/* SVGs com stroke hardcoded (#3c2256) */
html[data-bs-theme=dark] .anexos-container .border svg {
  stroke: var(--ct-secondary-color) !important;
}

/* Nome do arquivo / assunto (span com color: #3c2256 inline) */
html[data-bs-theme=dark] .anexos-container .border span:not(.badge) {
  color: var(--ct-emphasis-color) !important;
}

/* Metadata de email/whatsapp (destinatários, data, cor #673b8e) */
html[data-bs-theme=dark] .anexos-container .border div[style*="margin-top"] {
  color: var(--ct-secondary-color) !important;
}

/* Botões modernos */
html[data-bs-theme=dark] .btn-primary-modern {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .btn-primary-modern:hover {
  background-color: var(--ct-primary-dark) !important;
}
html[data-bs-theme=dark] .btn-secondary-modern {
  background-color: var(--ct-alt-bg) !important;
  color: var(--ct-secondary-color) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .btn-secondary-modern:hover {
  background-color: var(--ct-hover-bg) !important;
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .btn-danger-modern {
  background-color: #7f1d1d !important;
  color: #fca5a5 !important;
}
html[data-bs-theme=dark] .btn-danger-modern:hover {
  background-color: #991b1b !important;
}

/* ================================================================
   Grid de Relatórios (.relatorios-grid-container)
   ================================================================ */

/* Card base */
html[data-bs-theme=dark] .relatorio-card-base {
  background: rgba(160, 76, 203, 0.1) !important;
  border-color: rgba(160, 76, 203, 0.25) !important;
}

/* Dobra do canto (pseudo-elemento ::before) */
html[data-bs-theme=dark] .relatorio-card-base:not(#btn-criar-novo-relatorio)::before {
  border-color: var(--ct-primary-custom) var(--ct-primary-custom) var(--ct-primary-custom) var(--ct-primary-custom) !important;
}

/* Card "Novo Relatório" */
html[data-bs-theme=dark] #btn-criar-novo-relatorio {
  background: linear-gradient(135deg, var(--ct-card-bg) 0%, var(--ct-secondary-bg) 100%) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] #btn-criar-novo-relatorio:hover {
  border-color: var(--ct-primary-custom) !important;
  background: var(--ct-primary-dark) !important;
}
html[data-bs-theme=dark] #btn-criar-novo-relatorio .relatorio-card-title {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] #btn-criar-novo-relatorio .relatorio-card-subtitle {
  color: var(--ct-secondary-color) !important;
}

/* Título do card (.relatorio-card-title fora do botão criar) */
html[data-bs-theme=dark] .relatorio-card-title {
  color: var(--ct-emphasis-color) !important;
}

/* Nome do relatório (div com color: #2d3748 inline, tem classe color-secondary) */
html[data-bs-theme=dark] .relatorio-card-base .color-secondary {
  color: var(--ct-emphasis-color) !important;
}

/* Data de atualização (div com color: #718096 inline) */
html[data-bs-theme=dark] .btn-visualizar-relatorio div[style*="#718096"] {
  color: var(--ct-secondary-color) !important;
}

/* Botão de três pontos */
html[data-bs-theme=dark] .btn-relatorio-menu {
  color: var(--ct-secondary-color) !important;
}

/* Dropdown de ações do relatório */
html[data-bs-theme=dark] .relatorio-dropdown-menu {
  background-color: var(--ct-card-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .relatorio-dropdown-menu .dropdown-divider {
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .dropdown-item-grafico {
  color: var(--ct-emphasis-color) !important;
}
html[data-bs-theme=dark] .dropdown-item-grafico.grafico-edit:hover {
  background-color: rgba(59, 130, 246, 0.15) !important;
}
html[data-bs-theme=dark] .dropdown-item-grafico.grafico-clone:hover {
  background-color: rgba(16, 185, 129, 0.15) !important;
}
html[data-bs-theme=dark] .dropdown-item-grafico.grafico-delete:hover {
  background-color: rgba(220, 38, 38, 0.12) !important;
  color: #fca5a5 !important;
}

/* Barra de ações em massa */
html[data-bs-theme=dark] .rel-bulk-bar {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}
html[data-bs-theme=dark] .rel-bulk-count {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] tr.selected-row {
  background-color: var(--ct-primary-dark) !important;
}

/* ================================================================
   Modal Adicionar/Editar Gráfico (paineis)
   ================================================================ */

/* form-container com inline background-color: #fff */
html[data-bs-theme=dark] .form-container {
  background-color: var(--ct-secondary-bg) !important;
}

/* Select native: optgroup label e options */
html[data-bs-theme=dark] .form-select option,
html[data-bs-theme=dark] select.form-select option,
html[data-bs-theme=dark] .form-select optgroup {
  background-color: var(--ct-card-bg);
  color: var(--ct-emphasis-color);
}

/* Hint de campo desabilitado */
html[data-bs-theme=dark] small.feedback {
  color: var(--ct-secondary-color) !important;
}

/* Preview pane — garantir fundo escuro */
html[data-bs-theme=dark] .preview-container,
html[data-bs-theme=dark] .previewGrafico {
  background-color: var(--ct-card-bg) !important;
  border-radius: 8px;
}

/* Delete confirm box (inline background:#fff5f5; color:#b91c1c) */
html[data-bs-theme=dark] .grafico-delete-modal .p-3.rounded.border {
  background: rgba(127, 29, 29, 0.2) !important;
  color: #fca5a5 !important;
  border-color: #b91c1c !important;
}

/* ================================================================
   Gráfico tipo Card (GraficoCard.js / GraficoPersonalizado.js)
   ================================================================ */

/* Número principal (inline color: #3f1057) */
html[data-bs-theme=dark] .text-center > div[style*="#3f1057"] {
  color: var(--ct-accent-color) !important;
}

/* Métrica / label (inline color: #64748b) */
html[data-bs-theme=dark] .text-center > div[style*="#64748b"] {
  color: var(--ct-secondary-color) !important;
}

/* Subtítulo / eixo (inline color: #94a3b8) */
html[data-bs-theme=dark] .text-center > div[style*="#94a3b8"] {
  color: var(--ct-secondary-color) !important;
  opacity: 0.75;
}

/* ================================================================
   Componente de Anexos de Campo (input_controler.js / novoscriptsequencias.js)
   ================================================================ */

/* Container de cada arquivo (background: #f8f9fa, border: #e9ecef inline) */
html[data-bs-theme=dark] [data-file-url] {
  background: var(--ct-secondary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

/* Preview de imagem dentro do item (background: #fff inline) */
html[data-bs-theme=dark] [data-file-url] img {
  background: var(--ct-alt-bg) !important;
}

/* Barra inferior do item de imagem (border-top inline) */
html[data-bs-theme=dark] [data-file-url] > div[style*="border-top"] {
  border-top-color: var(--ct-border-color) !important;
}

/* Link de nome do arquivo (color: inherit — herda do pai) */
html[data-bs-theme=dark] [data-file-url] a[style*="color: inherit"] span {
  color: var(--ct-emphasis-color) !important;
}

/* Ícone de arquivo genérico (fill="#18183a") */
html[data-bs-theme=dark] [data-file-url] .bi-file-earmark {
  fill: var(--ct-secondary-color) !important;
}

/* Ícone de imagem (fill="#3f1057") */
html[data-bs-theme=dark] [data-file-url] .bi-file-earmark-image {
  fill: var(--ct-primary-custom) !important;
}

/* Ícone download (fill="currentColor" — herda color do link) */
html[data-bs-theme=dark] [data-file-url] a[title="Baixar anexo"] {
  color: var(--ct-secondary-color) !important;
}

/* Botão excluir */
html[data-bs-theme=dark] .btn-link-modern {
  color: var(--ct-secondary-color) !important;
}
html[data-bs-theme=dark] .btn-link-modern:hover {
  color: #fca5a5 !important;
}

html[data-bs-theme=dark] .card-preview-selected, html[data-bs-theme=dark] .card-preview-container:hover {
  border-color: #6f42c1 !important;
  background-color: #aa00ff0a !important;
}

html[data-bs-theme=dark] .stat-card {
  background-color: var(--ct-tertiary-bg);
  border-color: var(--ct-border-color);
}

html[data-bs-theme=dark] .stat-card p {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .departamento-card-horizontal {
  background-color: var(--ct-tertiary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .modelo-badge {
  background: transparent !important;
}

html[data-bs-theme=dark] .info-row {
  background-color: var(--ct-tertiary-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .info-value {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] option {
  background-color: var(--ct-body-bg) !important;
  color: var(--ct-emphasis-color) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .modern-dropdown-menu .campo-extra-dropdown {
  background-color: var(--ct-body-bg) !important;
}

html[data-bs-theme=dark] .detalhe-label {
  color: var(--ct-secondary-color) !important;
}

html[data-bs-theme=dark] .detalhe-value {
  color: var(--ct-emphasis-color) !important;
  background-color: var(--ct-hover-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .navbar-custom {
  box-shadow: 0 0 8px 1px #0000005c;
}

html[data-bs-theme=dark] .leftside-menu {
  box-shadow: 0 50px 8px 1px #0000005c;
}

html[data-bs-theme=dark] .ce-popover__container, html[data-bs-theme=dark] .cdx-search-field {
  background-color: var(--ct-body-bg) !important;
  border-color: var(--ct-border-color) !important;
}

html[data-bs-theme=dark] .ce-popover-item__title {
  color: var(--ct-emphasis-color) !important;
}

html[data-bs-theme=dark] .prontuario-doc-content .ce-popover-item:hover, html[data-bs-theme=dark] .prontuario-doc-content .ce-popover-item--active, html[data-bs-theme=dark] .prontuario-doc-content .ce-toolbar__plus:hover, html[data-bs-theme=dark] .prontuario-doc-content .ce-toolbar__settings-btn:hover {
  background-color: var(--ct-hover-bg) !important;
}