/* ============================================================
   WeChurch+ — Tema escuro (data-bs-theme="dark")
   Carregado por ULTIMO no <head> do base_sistema.html para
   sobrescrever CSS dos modulos. NAO mexer no tema claro.
   ============================================================ */

html[data-bs-theme="dark"] {
  /* Tokens */
  --wc-bg:         #0b1220;
  --wc-bg-soft:    #0f172a;
  --wc-surface:    #111c2f;
  --wc-surface-2:  #182338;
  --wc-surface-3:  #1f2c45;
  --wc-border:     #243149;
  --wc-border-soft:#1b2640;
  --wc-text:       #e5e7eb;
  --wc-muted:      #94a3b8;
  --wc-heading:    #f1f5f9;
  --wc-primary:    #60a5fa;
  --wc-link:       #93c5fd;
  --wc-hover:      #1f2c45;

  /* Bootstrap CSS vars (Bootstrap 5 ja respeita data-bs-theme,
     mas reforcamos para componentes que ainda usam --bs-body-bg). */
  --bs-body-bg: var(--wc-bg);
  --bs-body-color: var(--wc-text);
  --bs-secondary-bg: var(--wc-surface);
  --bs-tertiary-bg: var(--wc-surface-2);
  --bs-border-color: var(--wc-border);

  /* Sobrescreve tokens globais --mc-* definidos em base_sistema.css.
     Como esses tokens sao usados por mc-glass-card, mc-kpi-card,
     sidebar e dashboards, redefini-los aqui cobre a maioria das telas
     sem precisar caçar cada componente individualmente. */
  --mc-glass-bg:     rgba(17, 28, 47, 0.92);
  --mc-glass-border: rgba(255, 255, 255, 0.06);
  --mc-shadow:       0 8px 32px rgba(0, 0, 0, 0.45);
  --mc-text:         #f1f5f9;
  --mc-muted:        #94a3b8;
  --mc-sidebar-bg:   #0a111f;
  --mc-sidebar-soft: #182338;
  --mc-sidebar-text: #cbd5e1;
  --mc-sidebar-muted:#94a3b8;

  /* Tokens do wrapper de modulo (definidos em base_sistema.css / base.css).
     Usados por dezenas de classes: .finance-page, .ev-page, .gc-module,
     .mm-module, .card-membros, .mc-form-card, .mc-table-card etc.
     Sobrescrever aqui propaga o tema escuro para todos os wrappers sem
     precisar enumerar cada classe individual. */
  --app-module-bg:     var(--wc-surface);
  --app-module-border: var(--wc-border);
  --app-module-shadow: 0 8px 24px rgba(0,0,0,.35);

  color-scheme: dark;
}

/* ---------- Base ---------- */
html[data-bs-theme="dark"] body {
  background-color: var(--wc-bg);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .main-content,
html[data-bs-theme="dark"] .content,
html[data-bs-theme="dark"] .container,
html[data-bs-theme="dark"] .container-fluid {
  background-color: transparent;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] hr,
html[data-bs-theme="dark"] .dropdown-divider {
  border-color: var(--wc-border) !important;
  background-color: transparent;
  color: var(--wc-border);
  opacity: 1;
}
html[data-bs-theme="dark"] h1,
html[data-bs-theme="dark"] h2,
html[data-bs-theme="dark"] h3,
html[data-bs-theme="dark"] h4,
html[data-bs-theme="dark"] h5,
html[data-bs-theme="dark"] h6 { color: var(--wc-heading); }

html[data-bs-theme="dark"] a { color: var(--wc-link); }
html[data-bs-theme="dark"] a:hover { color: #bfdbfe; }

html[data-bs-theme="dark"] small,
html[data-bs-theme="dark"] .text-muted,
html[data-bs-theme="dark"] .small { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .text-dark { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .text-secondary { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .bg-light { background-color: var(--wc-surface) !important; color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .bg-white { background-color: var(--wc-surface) !important; color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .border,
html[data-bs-theme="dark"] .border-top,
html[data-bs-theme="dark"] .border-bottom,
html[data-bs-theme="dark"] .border-start,
html[data-bs-theme="dark"] .border-end,
html[data-bs-theme="dark"] .border-light { border-color: var(--wc-border) !important; }

/* ---------- Sidebar lateral (desktop) ----------
   Atencao: base_sistema.css usa "background: linear-gradient(...)"
   (shorthand). Para sobrescrever o gradiente precisamos do shorthand
   tambem, nao "background-color". */
html[data-bs-theme="dark"] .sidebar-icons {
  background: linear-gradient(180deg, #0a111f 0%, #0f1a2e 100%);
  border-right: 1px solid var(--wc-border-soft);
}
html[data-bs-theme="dark"] .sidebar-icons .icon-link,
html[data-bs-theme="dark"] .sidebar-icons .icon-link i,
html[data-bs-theme="dark"] .sidebar-icons button { color: #cbd5e1; }
html[data-bs-theme="dark"] .sidebar-icons .icon-link:hover,
html[data-bs-theme="dark"] .sidebar-icons .icon-link.active {
  background-color: var(--wc-hover);
  color: #fff;
}

html[data-bs-theme="dark"] .sidebar-expandido {
  background-color: var(--wc-bg-soft);
  color: var(--wc-text);
  border-right: 1px solid var(--wc-border-soft);
}
html[data-bs-theme="dark"] .sidebar-expandido h4 { color: var(--wc-heading); }
html[data-bs-theme="dark"] .sidebar-expandido a { color: #cbd5e1; }
html[data-bs-theme="dark"] .sidebar-expandido a:hover {
  background-color: var(--wc-hover);
  color: #fff;
}

html[data-bs-theme="dark"] .sidebar-perfil-btn { color: #cbd5e1; }
html[data-bs-theme="dark"] .sidebar-perfil-menu {
  background-color: var(--wc-surface);
  border: 1px solid var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .sidebar-perfil-menu .dropdown-item { color: var(--wc-text); }
html[data-bs-theme="dark"] .sidebar-perfil-menu .dropdown-item:hover,
html[data-bs-theme="dark"] .sidebar-perfil-menu .dropdown-item:focus {
  background-color: var(--wc-surface-3);
  color: #fff;
}
html[data-bs-theme="dark"] .sidebar-perfil-header {
  background-color: var(--wc-bg-soft) !important;
  border-bottom: 1px solid var(--wc-border) !important;
}
html[data-bs-theme="dark"] .sidebar-perfil-header .text-dark,
html[data-bs-theme="dark"] .sidebar-perfil-header .fw-semibold { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .sidebar-perfil-header .text-muted { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .sidebar-perfil-menu {
  background-color: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
}

/* ---------- Mobile bottom nav + drawer ---------- */
html[data-bs-theme="dark"] .mobile-bottom-nav {
  background-color: var(--wc-bg-soft);
  border-top: 1px solid var(--wc-border-soft);
}
html[data-bs-theme="dark"] .mobile-nav-item { color: #cbd5e1; }
html[data-bs-theme="dark"] .mobile-nav-item.active,
html[data-bs-theme="dark"] .mobile-nav-item:hover { color: #fff; }

html[data-bs-theme="dark"] .mobile-drawer-sheet {
  background-color: var(--wc-bg-soft);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .mobile-drawer-handle { background-color: var(--wc-border); }
html[data-bs-theme="dark"] .mobile-drawer-section-title { color: var(--wc-muted); }
html[data-bs-theme="dark"] .mobile-drawer-item,
html[data-bs-theme="dark"] .mobile-drawer-sheet .mobile-drawer-item,
html[data-bs-theme="dark"] .mobile-drawer-section .mobile-drawer-item {
  color: var(--wc-text) !important;
  border-bottom: 1px solid var(--wc-border-soft) !important;
  background-color: transparent !important;
}
html[data-bs-theme="dark"] .mobile-drawer-item:hover,
html[data-bs-theme="dark"] .mobile-drawer-item:active { background-color: var(--wc-hover) !important; }
html[data-bs-theme="dark"] .mobile-drawer-item i {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
html[data-bs-theme="dark"] .mobile-drawer-section {
  border-bottom-color: var(--wc-border-soft) !important;
}
html[data-bs-theme="dark"] .mobile-drawer-profile-actions .btn-perfil,
html[data-bs-theme="dark"] .mobile-drawer-profile-actions .btn-sair {
  background: var(--wc-surface-2) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .mobile-drawer-profile-actions .btn-sair {
  color: #fca5a5 !important;
}

/* ============================================================
   SweetAlert2 (.swal2-*) — modais de alerta showSuccess/Error/
   Warning/Info/Confirm renderizados via modal.js + Swal.fire().
   No dark precisam virar surface escuro com texto claro.
   ============================================================ */
html[data-bs-theme="dark"] .swal2-popup {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.55) !important;
}
html[data-bs-theme="dark"] .swal2-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .swal2-html-container,
html[data-bs-theme="dark"] .swal2-content { color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .swal2-close { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .swal2-close:hover { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .swal2-actions { background: transparent !important; }
html[data-bs-theme="dark"] .swal2-footer {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-muted) !important;
  border-top: 1px solid var(--wc-border) !important;
}
html[data-bs-theme="dark"] .swal2-input,
html[data-bs-theme="dark"] .swal2-textarea,
html[data-bs-theme="dark"] .swal2-select,
html[data-bs-theme="dark"] .swal2-file {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .swal2-input:focus,
html[data-bs-theme="dark"] .swal2-textarea:focus,
html[data-bs-theme="dark"] .swal2-select:focus {
  border-color: var(--wc-primary) !important;
  box-shadow: 0 0 0 .2rem rgba(96,165,250,.25) !important;
}
html[data-bs-theme="dark"] .swal2-validation-message {
  background: var(--wc-bg-soft) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme="dark"] .swal2-progress-steps .swal2-progress-step-line {
  background: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .swal2-progress-steps .swal2-progress-step {
  background: var(--wc-surface-2) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step {
  background: var(--wc-primary) !important;
  color: #fff !important;
}

/* Toast (top-end) - mesma cor do popup */
html[data-bs-theme="dark"] .swal2-toast {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.45) !important;
}
html[data-bs-theme="dark"] .swal2-toast .swal2-title,
html[data-bs-theme="dark"] .swal2-toast .swal2-html-container {
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .swal2-timer-progress-bar {
  background: rgba(255,255,255,.18) !important;
}

/* Backdrop sutilmente mais escuro no dark */
html[data-bs-theme="dark"] .swal2-container.swal2-backdrop-show {
  background: rgba(0,0,0,.65) !important;
}

/* Modais nativos do app (.app-modal-overlay) — reforco caso o
   bg-light de showModal venha em algum trecho */
html[data-bs-theme="dark"] .app-modal-overlay .modal-content .alert-light,
html[data-bs-theme="dark"] .modal.app-modal-overlay .modal-content .alert-light {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .mobile-drawer-profile {
  background-color: var(--wc-surface);
  border-bottom: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .mobile-drawer-profile-name { color: var(--wc-heading); }
html[data-bs-theme="dark"] .mobile-drawer-profile-role { color: var(--wc-muted); }

/* ---------- Cards e containers ---------- */
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .card-body,
html[data-bs-theme="dark"] .card-membros,
html[data-bs-theme="dark"] .config-card,
html[data-bs-theme="dark"] .app-card,
html[data-bs-theme="dark"] .app-section,
html[data-bs-theme="dark"] .app-table-card,
html[data-bs-theme="dark"] .app-filter-panel,
html[data-bs-theme="dark"] .app-mobile-row-card,
html[data-bs-theme="dark"] .app-mobile-list-card,
html[data-bs-theme="dark"] .mc-section-card,
html[data-bs-theme="dark"] .mc-form-card,
html[data-bs-theme="dark"] .mc-module-card,
html[data-bs-theme="dark"] .mc-table-card {
  background-color: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.32);
}
html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .card-membros-header {
  background-color: var(--wc-bg-soft) !important;
  color: var(--wc-heading) !important;
  border-bottom: 1px solid var(--wc-border) !important;
}
html[data-bs-theme="dark"] .card-footer {
  background-color: var(--wc-bg-soft) !important;
  border-top: 1px solid var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .card-membros-header h1,
html[data-bs-theme="dark"] .card-membros-header h2,
html[data-bs-theme="dark"] .card-membros-header h3 { color: var(--wc-heading); }

/* Escopo restrito ao card de /perfil — perfis.html usa .perfil-header
   com cor de fundo dinamica vinda de inline style; nao mexer naquele. */
html[data-bs-theme="dark"] .card-membros .perfil-header {
  background-color: var(--wc-surface);
  border-bottom: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .perfil-header-info .nome { color: var(--wc-heading); }
html[data-bs-theme="dark"] .perfil-header-info .email,
html[data-bs-theme="dark"] .perfil-header-info .badge.bg-secondary { color: var(--wc-muted); }

html[data-bs-theme="dark"] .section-title,
html[data-bs-theme="dark"] .section-title * { color: var(--wc-heading); }

/* ---------- Metricas / Super Admin / Pagamentos ---------- */
html[data-bs-theme="dark"] .metric-card,
html[data-bs-theme="dark"] .pay-metric,
html[data-bs-theme="dark"] .finance-metric-card,
html[data-bs-theme="dark"] .finance-analytic-card,
html[data-bs-theme="dark"] .finance-mobile-card,
html[data-bs-theme="dark"] .finance-card,
html[data-bs-theme="dark"] .finance-table-card,
html[data-bs-theme="dark"] .integration-card {
  background-color: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.32);
}
html[data-bs-theme="dark"] .metric-card .label,
html[data-bs-theme="dark"] .pay-metric .label { color: var(--wc-muted); }
html[data-bs-theme="dark"] .metric-card .value,
html[data-bs-theme="dark"] .pay-metric .value { color: var(--wc-heading); }
html[data-bs-theme="dark"] .pay-empty,
html[data-bs-theme="dark"] .empty-state,
html[data-bs-theme="dark"] .app-empty-state {
  background-color: var(--wc-surface) !important;
  border: 1px dashed var(--wc-border) !important;
  color: var(--wc-muted) !important;
}

/* Abas de Pagamentos */
html[data-bs-theme="dark"] .config-tabs,
html[data-bs-theme="dark"] .nav-tabs {
  background-color: transparent;
  border-bottom: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .tab-btn,
html[data-bs-theme="dark"] .nav-tabs .nav-link {
  background-color: var(--wc-surface);
  color: var(--wc-text);
  border: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .tab-btn:hover,
html[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
  background-color: var(--wc-surface-2);
  color: #fff;
}
html[data-bs-theme="dark"] .tab-btn.active,
html[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: var(--wc-surface-3);
  color: #fff;
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .tab-panel {
  background-color: var(--wc-surface);
  color: var(--wc-text);
  border: 1px solid var(--wc-border);
}

/* ---------- Tabelas ---------- */
html[data-bs-theme="dark"] .table,
html[data-bs-theme="dark"] .mc-table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--wc-text);
  --bs-table-border-color: var(--wc-border);
  --bs-table-striped-bg: var(--wc-surface-2);
  --bs-table-striped-color: var(--wc-text);
  --bs-table-hover-bg: var(--wc-surface-3);
  --bs-table-hover-color: #fff;
  color: var(--wc-text);
  background-color: transparent;
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .table > :not(caption) > * > *,
html[data-bs-theme="dark"] .mc-table > :not(caption) > * > * {
  background-color: transparent;
  color: var(--wc-text);
  border-bottom-color: var(--wc-border);
  box-shadow: none;
}
html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] .table thead td,
html[data-bs-theme="dark"] .mc-table thead th {
  background-color: var(--wc-bg-soft) !important;
  color: var(--wc-heading) !important;
  border-bottom-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
  background-color: var(--wc-surface-3) !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255,255,255,.025);
  color: var(--wc-text);
}
/* membros.css define background-color direto no TR */
html[data-bs-theme="dark"] .table tbody tr {
  background-color: var(--wc-surface) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
}
html[data-bs-theme="dark"] .table tbody tr:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}
html[data-bs-theme="dark"] .responsive-table-wrap {
  background-color: var(--wc-surface);
  border: 1px solid var(--wc-border);
}

/* table-bordered: as bordas verticais entre celulas (cabecalho NOME|CELULAR|
   etc.) ficam visiveis demais no dark. Suavizamos para border-soft. */
html[data-bs-theme="dark"] .table-bordered,
html[data-bs-theme="dark"] .table-bordered > :not(caption) > *,
html[data-bs-theme="dark"] .table-bordered > :not(caption) > * > * {
  border-color: var(--wc-border-soft) !important;
}

/* ---------- Formularios ---------- */
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select,
html[data-bs-theme="dark"] textarea.form-control {
  background-color: var(--wc-bg-soft);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
  background-color: var(--wc-bg-soft);
  border-color: var(--wc-primary);
  color: var(--wc-heading);
  box-shadow: 0 0 0 .2rem rgba(96, 165, 250, .25);
}
html[data-bs-theme="dark"] .form-control::placeholder { color: #64748b; }
html[data-bs-theme="dark"] .form-control:disabled,
html[data-bs-theme="dark"] .form-select:disabled {
  background-color: #0a111f;
  color: var(--wc-muted);
  opacity: .8;
}
html[data-bs-theme="dark"] .form-label,
html[data-bs-theme="dark"] .form-check-label { color: #cbd5e1; }
html[data-bs-theme="dark"] .form-text { color: var(--wc-muted); }
html[data-bs-theme="dark"] .input-group-text {
  background-color: var(--wc-surface-2);
  border-color: var(--wc-border);
  color: #cbd5e1;
}
html[data-bs-theme="dark"] .form-check-input {
  background-color: var(--wc-bg-soft);
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .form-check-input:checked {
  background-color: var(--wc-primary);
  border-color: var(--wc-primary);
}

/* Choices.js no escuro */
html[data-bs-theme="dark"] .choices__inner {
  background-color: var(--wc-bg-soft);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .choices__list--dropdown,
html[data-bs-theme="dark"] .choices__list[aria-expanded] {
  background-color: var(--wc-surface);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: var(--wc-surface-3);
  color: #fff;
}

/* ---------- Bootstrap components ---------- */
html[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--wc-surface);
  border-color: var(--wc-border);
  color: var(--wc-text);
  --bs-dropdown-link-color: var(--wc-text);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: var(--wc-surface-3);
}
html[data-bs-theme="dark"] .dropdown-item { color: var(--wc-text); }
html[data-bs-theme="dark"] .dropdown-item:hover,
html[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: var(--wc-surface-3);
  color: #fff;
}

html[data-bs-theme="dark"] .modal-content {
  background-color: var(--wc-surface);
  color: var(--wc-text);
  border: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .modal-header,
html[data-bs-theme="dark"] .modal-footer { border-color: var(--wc-border); }
html[data-bs-theme="dark"] .modal-title { color: var(--wc-heading); }
html[data-bs-theme="dark"] .mc-modal-header {
  background-color: var(--wc-bg-soft);
  color: var(--wc-heading);
  border-bottom: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(1.8); }

/* app-modal.css usa background: #fff !important — precisamos do mesmo nivel */
html[data-bs-theme="dark"] .app-modal,
html[data-bs-theme="dark"] .app-modal-overlay .modal-content,
html[data-bs-theme="dark"] .modal.app-modal-overlay .modal-content {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .app-modal-header,
html[data-bs-theme="dark"] .app-modal-overlay .modal-header,
html[data-bs-theme="dark"] .modal.app-modal-overlay .modal-header {
  background: var(--wc-bg-soft) !important;
  background-image: none !important;
  border-bottom: 1px solid var(--wc-border) !important;
  color: var(--wc-heading) !important;
}
html[data-bs-theme="dark"] .app-modal-footer,
html[data-bs-theme="dark"] .app-modal-overlay .modal-footer,
html[data-bs-theme="dark"] .modal.app-modal-overlay .modal-footer {
  background: var(--wc-bg-soft) !important;
  border-top: 1px solid var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .app-modal-title,
html[data-bs-theme="dark"] .app-modal-overlay .modal-title,
html[data-bs-theme="dark"] .modal.app-modal-overlay .modal-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .app-modal-body,
html[data-bs-theme="dark"] .app-modal-overlay .modal-body,
html[data-bs-theme="dark"] .modal.app-modal-overlay .modal-body {
  background: var(--wc-surface) !important;
  color: var(--wc-text);
}

html[data-bs-theme="dark"] .pagination {
  --bs-pagination-bg: var(--wc-surface);
  --bs-pagination-color: var(--wc-text);
  --bs-pagination-border-color: var(--wc-border);
  --bs-pagination-hover-bg: var(--wc-surface-3);
  --bs-pagination-hover-color: #fff;
  --bs-pagination-hover-border-color: var(--wc-border);
  --bs-pagination-disabled-bg: var(--wc-surface);
  --bs-pagination-disabled-color: var(--wc-muted);
  --bs-pagination-disabled-border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .page-link {
  background-color: var(--wc-surface);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .page-link:hover {
  background-color: var(--wc-surface-3);
  color: #fff;
}

/* ---------- Alertas e badges (preservar semantica) ---------- */
html[data-bs-theme="dark"] .alert { border-color: var(--wc-border); }
html[data-bs-theme="dark"] .alert-primary {
  background-color: rgba(59,130,246,.12); color: #bfdbfe; border-color: rgba(59,130,246,.35);
}
html[data-bs-theme="dark"] .alert-secondary {
  background-color: var(--wc-surface-2); color: var(--wc-text); border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .alert-success {
  background-color: rgba(34,197,94,.12); color: #86efac; border-color: rgba(34,197,94,.35);
}
html[data-bs-theme="dark"] .alert-danger {
  background-color: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.35);
}
html[data-bs-theme="dark"] .alert-warning {
  background-color: rgba(245,158,11,.12); color: #fcd34d; border-color: rgba(245,158,11,.35);
}
html[data-bs-theme="dark"] .alert-info {
  background-color: rgba(14,165,233,.12); color: #7dd3fc; border-color: rgba(14,165,233,.35);
}
html[data-bs-theme="dark"] .mc-alert {
  background-color: var(--wc-surface);
  color: var(--wc-text);
  border: 1px solid var(--wc-border);
}

/* Badges mantem cor de fundo, mas garantimos contraste do .bg-light/.bg-secondary */
html[data-bs-theme="dark"] .badge.bg-light { background-color: var(--wc-surface-3) !important; color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .badge.text-dark { color: var(--wc-heading) !important; }

/* Bootstrap 5 text-bg-* (usadas nas categorias financeiras: Ativa, Geral,
   Contribuicoes, Inativa). No light tem texto escuro sobre cor saturada;
   no dark precisamos de versoes pastel com texto bem legivel. */
html[data-bs-theme="dark"] .badge.text-bg-success {
  background-color: rgba(34,197,94,.22) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .badge.text-bg-info {
  background-color: rgba(14,165,233,.22) !important;
  color: #7dd3fc !important;
}
html[data-bs-theme="dark"] .badge.text-bg-secondary {
  background-color: var(--wc-surface-3) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .badge.text-bg-warning {
  background-color: rgba(245,158,11,.22) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .badge.text-bg-danger {
  background-color: rgba(239,68,68,.22) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme="dark"] .badge.text-bg-primary {
  background-color: rgba(59,130,246,.22) !important;
  color: #bfdbfe !important;
}

/* Botoes neutros */
html[data-bs-theme="dark"] .btn-light {
  background-color: var(--wc-surface-2);
  color: var(--wc-text);
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .btn-light:hover {
  background-color: var(--wc-surface-3);
  color: #fff;
}
html[data-bs-theme="dark"] .btn-outline-secondary {
  color: var(--wc-text);
  border-color: var(--wc-border);
  background-color: transparent;
}
html[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: var(--wc-surface-3);
  color: #fff;
  border-color: var(--wc-border);
}

/* Header de notificacoes (cores hardcoded em base_sistema.html) */
html[data-bs-theme="dark"] .notification-dropdown {
  background-color: var(--wc-surface);
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .notification-dropdown-head,
html[data-bs-theme="dark"] .notification-dropdown-footer {
  background-color: var(--wc-bg-soft) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .notification-item {
  background-color: var(--wc-surface) !important;
  border-bottom: 1px solid var(--wc-border) !important;
}
html[data-bs-theme="dark"] .notification-item:hover { background-color: var(--wc-surface-2) !important; }
html[data-bs-theme="dark"] .notification-item strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .notification-item span { color: #cbd5e1 !important; }
html[data-bs-theme="dark"] .notification-item small,
html[data-bs-theme="dark"] .notification-empty { color: var(--wc-muted) !important; }

/* Listas e list-group */
html[data-bs-theme="dark"] .list-group-item {
  background-color: var(--wc-surface);
  color: var(--wc-text);
  border-color: var(--wc-border);
}

/* Tooltips */
html[data-bs-theme="dark"] .tooltip-inner {
  background-color: var(--wc-surface-3);
  color: #fff;
}

/* ============================================================
   Home (home.css) — hero, KPIs, blocos e ações rápidas
   ============================================================ */
html[data-bs-theme="dark"] .home-principal {
  background: var(--wc-surface);
  border-color: var(--wc-border, rgba(255,255,255,.08));
  box-shadow: none;
}
html[data-bs-theme="dark"] .home-hero-text h2 { color: var(--wc-heading); }
html[data-bs-theme="dark"] .home-hero-text p { color: var(--wc-muted); }
html[data-bs-theme="dark"] .home-hero-church {
  background: rgba(96,165,250,.12);
  border-color: rgba(96,165,250,.30);
  color: #bfdbfe;
}
html[data-bs-theme="dark"] .home-section-label { color: #c4b5fd; }

html[data-bs-theme="dark"] .home-block-title { color: #cbd5e1; }
html[data-bs-theme="dark"] .home-block-title i { color: #a78bfa; }

html[data-bs-theme="dark"] .home-list li {
  border-bottom-color: var(--wc-border-soft);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .home-list .item-date { color: var(--wc-muted); }

html[data-bs-theme="dark"] .home-empty,
html[data-bs-theme="dark"] .home-module-unavailable { color: var(--wc-muted); }
html[data-bs-theme="dark"] .home-module-unavailable h4 { color: #cbd5e1; }

html[data-bs-theme="dark"] .home-stat-row {
  border-bottom-color: var(--wc-border-soft);
}
html[data-bs-theme="dark"] .home-stat-row .label { color: var(--wc-muted); }
html[data-bs-theme="dark"] .home-stat-row .value { color: var(--wc-heading); }

html[data-bs-theme="dark"] .home-action-btn {
  background: var(--wc-surface);
  border: 1px solid var(--wc-border);
  color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .home-action-btn:hover {
  background: var(--wc-surface-2);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.45);
}
html[data-bs-theme="dark"] .home-block-link {
  border-top-color: var(--wc-border);
  color: #93c5fd;
}
html[data-bs-theme="dark"] .home-block-link:hover { color: #bfdbfe; }

html[data-bs-theme="dark"] .audit-row {
  border-bottom-color: var(--wc-border-soft);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .audit-action { color: var(--wc-text); }
html[data-bs-theme="dark"] .audit-meta { color: var(--wc-muted); }

/* Status badges legíveis no dark */
html[data-bs-theme="dark"] .badge-ativa {
  background: rgba(34,197,94,.18);
  color: #4ade80;
}
html[data-bs-theme="dark"] .badge-inativa {
  background: rgba(148,163,184,.18);
  color: #cbd5e1;
}
html[data-bs-theme="dark"] .badge-suspensa {
  background: rgba(244,63,94,.20);
  color: #fda4af;
}

/* item-name em mobile (<=575px) tem color #1f2937 hardcoded */
@media (max-width: 575.98px) {
  html[data-bs-theme="dark"] .home-list .item-name { color: var(--wc-heading); }
}

/* KPI / stat cards (mc-glass-card + mc-kpi-card) */
html[data-bs-theme="dark"] .mc-kpi-card,
html[data-bs-theme="dark"] .mc-dashboard-card,
html[data-bs-theme="dark"] .mc-chart-card {
  background: var(--mc-glass-bg);
  border-color: var(--mc-glass-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .mc-stat-label { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .mc-stat-value { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .mc-stat-icon {
  background: var(--wc-surface-2);
  color: var(--wc-text);
}
/* IMPORTANTE: aplicar pilula (background) APENAS quando a classe estiver
   combinada com .mc-stat-icon (mesmo padrao do tema claro). Caso contrario,
   icones inline em <i class="bi ... mc-icon-blue"> dentro de .mc-form-label
   ficavam com retangulo colorido/cinza atras (bug reportado em /financeiro
   modal "Nova entrada"). Para uso standalone (inline), so a cor muda. */
html[data-bs-theme="dark"] .mc-stat-icon.mc-icon-blue   { background: rgba(59,130,246,.15)  !important; color: #93c5fd !important; }
html[data-bs-theme="dark"] .mc-stat-icon.mc-icon-green  { background: rgba(34,197,94,.15)   !important; color: #86efac !important; }
html[data-bs-theme="dark"] .mc-stat-icon.mc-icon-amber  { background: rgba(245,158,11,.15)  !important; color: #fcd34d !important; }
html[data-bs-theme="dark"] .mc-stat-icon.mc-icon-rose   { background: rgba(244,63,94,.15)   !important; color: #fda4af !important; }
html[data-bs-theme="dark"] .mc-stat-icon.mc-icon-violet { background: rgba(139,92,246,.15)  !important; color: #c4b5fd !important; }
html[data-bs-theme="dark"] .mc-stat-icon.mc-icon-teal   { background: rgba(20,184,166,.15)  !important; color: #5eead4 !important; }
html[data-bs-theme="dark"] .mc-stat-icon.mc-icon-muted  { background: var(--wc-surface-2)    !important; color: #cbd5e1 !important; }

/* Uso inline (icones em labels, headers, etc.) — apenas cor, sem fundo */
html[data-bs-theme="dark"] .mc-icon-blue   { color: #93c5fd; }
html[data-bs-theme="dark"] .mc-icon-green  { color: #86efac; }
html[data-bs-theme="dark"] .mc-icon-amber  { color: #fcd34d; }
html[data-bs-theme="dark"] .mc-icon-rose   { color: #fda4af; }
html[data-bs-theme="dark"] .mc-icon-violet { color: #c4b5fd; }
html[data-bs-theme="dark"] .mc-icon-purple { color: #c4b5fd; }
html[data-bs-theme="dark"] .mc-icon-sky    { color: #7dd3fc; }
html[data-bs-theme="dark"] .mc-icon-teal   { color: #5eead4; }
html[data-bs-theme="dark"] .mc-icon-orange { color: #fdba74; }
html[data-bs-theme="dark"] .mc-icon-pink   { color: #f9a8d4; }
html[data-bs-theme="dark"] .mc-icon-red    { color: #fca5a5; }
html[data-bs-theme="dark"] .mc-icon-muted  { color: #94a3b8; }

/* Status badges do home */
html[data-bs-theme="dark"] .badge-ativa    { background: rgba(34,197,94,.18);  color: #86efac; }
html[data-bs-theme="dark"] .badge-inativa  { background: rgba(148,163,184,.18);color: #cbd5e1; }
html[data-bs-theme="dark"] .badge-suspensa { background: rgba(244,63,94,.18);  color: #fda4af; }

/* ============================================================
   Super Admin — Dashboard (super_admin.html) e Perfis (perfis.html)
   ============================================================ */
html[data-bs-theme="dark"] .metric-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.32) !important;
}
html[data-bs-theme="dark"] .metric-card strong { color: var(--wc-heading); }
html[data-bs-theme="dark"] .metric-card .small,
html[data-bs-theme="dark"] .metric-card .text-muted { color: var(--wc-muted) !important; }

/* Perfis e Telas */
html[data-bs-theme="dark"] .perfil-card {
  background: var(--wc-surface);
  border-color: var(--wc-border);
  color: var(--wc-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.32);
}
html[data-bs-theme="dark"] .perfil-card .perfil-header { color: #fff; }
html[data-bs-theme="dark"] .perfil-card .perfil-counter {
  background: rgba(255,255,255,.18);
  color: #fff;
}
html[data-bs-theme="dark"] .perfil-progress-wrap { background: rgba(255,255,255,.10); }
html[data-bs-theme="dark"] .perfil-footer {
  background: var(--wc-bg-soft);
  border-top: 1px solid var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .screen-group-header {
  background: var(--wc-bg-soft);
  border-bottom: 1px solid var(--wc-border);
  color: var(--wc-muted);
}
html[data-bs-theme="dark"] .perm-item {
  color: var(--wc-text);
  border-bottom: 1px solid var(--wc-border-soft);
}
html[data-bs-theme="dark"] .perm-item:hover { background: var(--wc-surface-2); }
html[data-bs-theme="dark"] .perm-item.perm-granted { background: rgba(34,197,94,.10); }
html[data-bs-theme="dark"] .perm-item.perm-denied  { background: rgba(244,63,94,.10); }

/* ============================================================
   Page subtitles e wrappers usados em modulos
   ============================================================ */
html[data-bs-theme="dark"] .finance-page-subtitle,
html[data-bs-theme="dark"] .gc-page-subtitle,
html[data-bs-theme="dark"] .ec-page-subtitle { color: var(--wc-muted); }

/* Logo placeholder e upload area (super_admin.html) */
html[data-bs-theme="dark"] .church-logo-placeholder {
  background: var(--wc-surface-2);
  color: #cbd5e1;
}
html[data-bs-theme="dark"] .logo-upload-area {
  border-color: var(--wc-border);
  background: var(--wc-surface);
  color: var(--wc-muted);
}
html[data-bs-theme="dark"] .logo-upload-area:hover {
  border-color: var(--wc-primary);
  background: var(--wc-surface-2);
}
html[data-bs-theme="dark"] .logo-upload-area .placeholder-icon {
  background: var(--wc-surface-3);
  color: #cbd5e1;
}

/* ============================================================
   Modulos com prefixo proprio (ec-*, gc-*, atd-*, ev-*, finance-*,
   ensino-*, mapa-*) — wrappers "glass" brancos hardcoded.
   ============================================================ */

/* Wrapper externo da pagina (ec-module, gc-module, etc.) */
html[data-bs-theme="dark"] .ec-page,
html[data-bs-theme="dark"] .gc-page,
html[data-bs-theme="dark"] .atd-page,
html[data-bs-theme="dark"] .ev-page,
html[data-bs-theme="dark"] .finance-page,
html[data-bs-theme="dark"] .ensino-page,
html[data-bs-theme="dark"] .mapa-page { color: var(--wc-text); }

html[data-bs-theme="dark"] .ec-module,
html[data-bs-theme="dark"] .gc-module,
html[data-bs-theme="dark"] .atd-module,
html[data-bs-theme="dark"] .ev-module,
html[data-bs-theme="dark"] .finance-module,
html[data-bs-theme="dark"] .ensino-module,
html[data-bs-theme="dark"] .mapa-module {
  background: var(--wc-surface);
  border: 1px solid var(--wc-border);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  color: var(--wc-text);
}

/* Headers de modulo (h1, kickers, subtitles) */
html[data-bs-theme="dark"] .ec-header h1,
html[data-bs-theme="dark"] .gc-header h1,
html[data-bs-theme="dark"] .atd-header h1,
html[data-bs-theme="dark"] .ev-header h1,
html[data-bs-theme="dark"] .finance-header h1,
html[data-bs-theme="dark"] .finance-page-title,
html[data-bs-theme="dark"] .ensino-header h1,
html[data-bs-theme="dark"] .mapa-header h1 { color: var(--wc-heading); }

html[data-bs-theme="dark"] .ec-kicker,
html[data-bs-theme="dark"] .gc-kicker,
html[data-bs-theme="dark"] .atd-kicker,
html[data-bs-theme="dark"] .ev-kicker,
html[data-bs-theme="dark"] .finance-kicker,
html[data-bs-theme="dark"] .ensino-kicker,
html[data-bs-theme="dark"] .mapa-kicker { color: var(--wc-muted); }

/* Filtros */
html[data-bs-theme="dark"] .ec-filters,
html[data-bs-theme="dark"] .gc-filters,
html[data-bs-theme="dark"] .atd-filters,
html[data-bs-theme="dark"] .ev-filters,
html[data-bs-theme="dark"] .finance-filters,
html[data-bs-theme="dark"] .ensino-filters,
html[data-bs-theme="dark"] .mapa-filters {
  background: var(--wc-bg-soft);
  border: 1px solid var(--wc-border);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  color: var(--wc-text);
}

/* Paineis internos */
html[data-bs-theme="dark"] .ec-panel,
html[data-bs-theme="dark"] .gc-panel,
html[data-bs-theme="dark"] .atd-panel,
html[data-bs-theme="dark"] .ev-panel,
html[data-bs-theme="dark"] .finance-panel,
html[data-bs-theme="dark"] .ensino-panel,
html[data-bs-theme="dark"] .mapa-panel {
  background: var(--wc-surface);
  border: 1px solid var(--wc-border);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .ec-panel p,
html[data-bs-theme="dark"] .gc-panel p,
html[data-bs-theme="dark"] .atd-panel p,
html[data-bs-theme="dark"] .ev-panel p,
html[data-bs-theme="dark"] .finance-panel p,
html[data-bs-theme="dark"] .ensino-panel p,
html[data-bs-theme="dark"] .mapa-panel p { color: var(--wc-muted); }

/* Tabelas dos modulos (.ec-table, .gc-table, etc.) */
html[data-bs-theme="dark"] .ec-table th,
html[data-bs-theme="dark"] .gc-table th,
html[data-bs-theme="dark"] .atd-table th,
html[data-bs-theme="dark"] .ev-table th,
html[data-bs-theme="dark"] .finance-table th,
html[data-bs-theme="dark"] .ensino-table th,
html[data-bs-theme="dark"] .mapa-table th { color: var(--wc-muted); }

html[data-bs-theme="dark"] .ec-table td,
html[data-bs-theme="dark"] .gc-table td,
html[data-bs-theme="dark"] .atd-table td,
html[data-bs-theme="dark"] .ev-table td,
html[data-bs-theme="dark"] .finance-table td,
html[data-bs-theme="dark"] .ensino-table td,
html[data-bs-theme="dark"] .mapa-table td {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .ec-table tbody tr:nth-child(even) td,
html[data-bs-theme="dark"] .gc-table tbody tr:nth-child(even) td,
html[data-bs-theme="dark"] .ev-table tbody tr:nth-child(even) td,
html[data-bs-theme="dark"] .finance-table tbody tr:nth-child(even) td,
html[data-bs-theme="dark"] .ensino-table tbody tr:nth-child(even) td {
  background: var(--wc-surface-2) !important;
}
html[data-bs-theme="dark"] .ec-table tbody tr:hover td,
html[data-bs-theme="dark"] .gc-table tbody tr:hover td,
html[data-bs-theme="dark"] .ev-table tbody tr:hover td,
html[data-bs-theme="dark"] .finance-table tbody tr:hover td,
html[data-bs-theme="dark"] .ensino-table tbody tr:hover td {
  background: var(--wc-surface-3) !important;
  color: #fff !important;
}

/* Info banners — sao banners coloridos pastel (laranja/azul/violeta).
   No dark damos versao escura preservando hue. */
html[data-bs-theme="dark"] .ec-info-banner,
html[data-bs-theme="dark"] .gc-info-banner,
html[data-bs-theme="dark"] .atd-info-banner,
html[data-bs-theme="dark"] .ev-info-banner,
html[data-bs-theme="dark"] .finance-info-banner,
html[data-bs-theme="dark"] .ensino-info-banner,
html[data-bs-theme="dark"] .mapa-info-banner {
  background: rgba(139, 92, 246, .12) !important;
  border: 1px solid rgba(139, 92, 246, .30) !important;
  color: #c4b5fd !important;
}
html[data-bs-theme="dark"] .ec-info-banner p,
html[data-bs-theme="dark"] .gc-info-banner p,
html[data-bs-theme="dark"] .atd-info-banner p,
html[data-bs-theme="dark"] .ev-info-banner p,
html[data-bs-theme="dark"] .finance-info-banner p,
html[data-bs-theme="dark"] .ensino-info-banner p,
html[data-bs-theme="dark"] .mapa-info-banner p { color: #ddd6fe !important; }
html[data-bs-theme="dark"] .ec-info-banner i,
html[data-bs-theme="dark"] .gc-info-banner i,
html[data-bs-theme="dark"] .atd-info-banner i,
html[data-bs-theme="dark"] .ev-info-banner i,
html[data-bs-theme="dark"] .finance-info-banner i,
html[data-bs-theme="dark"] .ensino-info-banner i,
html[data-bs-theme="dark"] .mapa-info-banner i { color: #c4b5fd !important; }

/* Cards individuais dos modulos (ev-card, finance-card, ensino-curso-card, etc.) */
html[data-bs-theme="dark"] .ev-card,
html[data-bs-theme="dark"] .ev-card-body,
html[data-bs-theme="dark"] .ev-card-footer,
html[data-bs-theme="dark"] .ev-banner,
html[data-bs-theme="dark"] .ev-cal-wrapper,
html[data-bs-theme="dark"] .ev-cal-popover,
html[data-bs-theme="dark"] .gc-card,
html[data-bs-theme="dark"] .gc-stat-card,
html[data-bs-theme="dark"] .atd-tipo-card,
html[data-bs-theme="dark"] .atd-agenda-item,
html[data-bs-theme="dark"] .atd-dia-group,
html[data-bs-theme="dark"] .atd-resumo,
html[data-bs-theme="dark"] .finance-card,
html[data-bs-theme="dark"] .finance-mobile-card,
html[data-bs-theme="dark"] .finance-table-card,
html[data-bs-theme="dark"] .ensino-curso-card,
html[data-bs-theme="dark"] .ensino-m-card,
html[data-bs-theme="dark"] .ensino-avaliacao-card,
html[data-bs-theme="dark"] .ensino-avaliacoes-panel,
html[data-bs-theme="dark"] .mapa-card,
html[data-bs-theme="dark"] .mapa-stat-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}

/* Slot buttons / wizard / quick actions */
html[data-bs-theme="dark"] .atd-slot-btn,
html[data-bs-theme="dark"] .mc-quick-btn,
html[data-bs-theme="dark"] .mc-switch-item {
  background: var(--wc-surface-2);
  border: 1px solid var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .atd-slot-btn:hover,
html[data-bs-theme="dark"] .mc-quick-btn:hover { background: var(--wc-surface-3); color: #fff; }

/* Wrappers que SAO glass no light theme (financeiro.css/eventos.css definem
   bg/border/shadow brancos hardcoded com fallback no var). No dark precisam
   virar surface card escuro e remover o backdrop-filter de blur. */
html[data-bs-theme="dark"] .ev-page,
html[data-bs-theme="dark"] .finance-page,
html[data-bs-theme="dark"] .financeiro-page {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.35) !important;
  color: var(--wc-text) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Wrappers que NAO sao glass — apenas containers de fluxo cujo filho
   .X-module é que tem o glass. Aqui so corrigimos a cor herdada (light
   theme define color: #0f172a). Sem bg/border/shadow para nao duplicar
   o card visual sobre o .X-module interno. */
html[data-bs-theme="dark"] .ec-page,
html[data-bs-theme="dark"] .gc-page,
html[data-bs-theme="dark"] .atd-page,
html[data-bs-theme="dark"] .ensino-page,
html[data-bs-theme="dark"] .mapa-page {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--wc-text) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Garante que textos genericos (p, span, div, li, td, label) dentro desses
   wrappers herdem a cor clara. Componentes que tem cor propria (badges,
   botoes, headings, links) continuam com sua cor especifica via overrides
   mais especificos definidos acima. */
html[data-bs-theme="dark"] .finance-page,
html[data-bs-theme="dark"] .financeiro-page,
html[data-bs-theme="dark"] .ec-page,
html[data-bs-theme="dark"] .gc-page,
html[data-bs-theme="dark"] .atd-page,
html[data-bs-theme="dark"] .ev-page,
html[data-bs-theme="dark"] .ensino-page,
html[data-bs-theme="dark"] .mapa-page {
  --bs-body-color: var(--wc-text);
}

/* ---------- Financeiro: toolbars, periodo, tabs e checks ---------- */
/* .finance-toolbar (financeiro-area-selector) eh o wrapper dos tabs do
   menu financeiro. No light theme tem glass branco; no dark deixar
   transparente para os tabs flutuarem ao inves de ficar uma barra
   cinza ligando eles. */
html[data-bs-theme="dark"] .finance-toolbar,
html[data-bs-theme="dark"] .financeiro-area-selector {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .finance-periodo,
html[data-bs-theme="dark"] .finance-periodo-inner {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .finance-tab,
html[data-bs-theme="dark"] .finance-tab-link {
  background: var(--wc-surface-2);
  color: var(--wc-text);
  border: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .finance-tab:hover,
html[data-bs-theme="dark"] .finance-tab-link:hover {
  background: var(--wc-surface-3);
  color: #fff;
}
html[data-bs-theme="dark"] .finance-tab.active,
html[data-bs-theme="dark"] .finance-tab-link.active {
  background: rgba(139, 92, 246, .25);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, .4);
}
html[data-bs-theme="dark"] .finance-check-label,
html[data-bs-theme="dark"] .finance-pill-label,
html[data-bs-theme="dark"] .finance-filter-label {
  background: var(--wc-surface-2) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}

/* ---------- Eventos: sidebar de filtros e cards ---------- */
html[data-bs-theme="dark"] .ev-sidebar {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .ev-filter,
html[data-bs-theme="dark"] .ev-cat-name,
html[data-bs-theme="dark"] .ev-card-title,
html[data-bs-theme="dark"] .ev-card-meta,
html[data-bs-theme="dark"] .ev-banner-meta,
html[data-bs-theme="dark"] .ev-cal-popover-title { color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .ev-cat-add-btn { color: #c4b5fd; }
html[data-bs-theme="dark"] .ev-cat-row:hover,
html[data-bs-theme="dark"] .ev-filter:hover { background-color: var(--wc-surface-2); }

/* ---------- Grupos de Conexao: metric cards e atalhos ---------- */
html[data-bs-theme="dark"] .gc-filtros-bar,
html[data-bs-theme="dark"] .gc-metric-card,
html[data-bs-theme="dark"] .gc-card-azul,
html[data-bs-theme="dark"] .gc-card-verde,
html[data-bs-theme="dark"] .gc-card-indigo,
html[data-bs-theme="dark"] .gc-card-teal,
html[data-bs-theme="dark"] .gc-card-sucesso,
html[data-bs-theme="dark"] .gc-card-aviso,
html[data-bs-theme="dark"] .gc-card-perigo,
html[data-bs-theme="dark"] .gc-card-laranja,
html[data-bs-theme="dark"] .gc-card-vermelho,
html[data-bs-theme="dark"] .gc-atalho-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .gc-metric-value,
html[data-bs-theme="dark"] .gc-metric-label,
html[data-bs-theme="dark"] .gc-atalho-card .value,
html[data-bs-theme="dark"] .gc-atalho-card .label,
html[data-bs-theme="dark"] .gc-atalho-card .title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .gc-metric-label,
html[data-bs-theme="dark"] .gc-metric-card .label { color: var(--wc-muted) !important; }

/* ---------- Ensino: mc-nav-scroll, mc-tabs, value/label ---------- */
html[data-bs-theme="dark"] .mc-nav-scroll,
html[data-bs-theme="dark"] .mc-tabs {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .mc-nav-scroll a,
html[data-bs-theme="dark"] .mc-nav-scroll button,
html[data-bs-theme="dark"] .mc-tabs a,
html[data-bs-theme="dark"] .mc-tabs button { color: var(--wc-text); }
html[data-bs-theme="dark"] .mc-nav-scroll .active,
html[data-bs-theme="dark"] .mc-tabs .active { background: var(--wc-surface-3); color: #fff; }

/* Genericos .value / .label (dashboards de varios modulos) */
html[data-bs-theme="dark"] .ensino-page .value,
html[data-bs-theme="dark"] .ensino-page .label,
html[data-bs-theme="dark"] .mc-kpi-card .value,
html[data-bs-theme="dark"] .mc-kpi-card .label,
html[data-bs-theme="dark"] .gc-page .value,
html[data-bs-theme="dark"] .gc-page .label,
html[data-bs-theme="dark"] .atd-page .value,
html[data-bs-theme="dark"] .atd-page .label,
html[data-bs-theme="dark"] .ev-page .value,
html[data-bs-theme="dark"] .ev-page .label { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .ensino-page .label,
html[data-bs-theme="dark"] .gc-page .label,
html[data-bs-theme="dark"] .atd-page .label,
html[data-bs-theme="dark"] .ev-page .label { color: var(--wc-muted) !important; }

/* ---------- Configuracoes (config-card ja coberto) ---------- */
html[data-bs-theme="dark"] .config-section-title { color: var(--wc-heading); }
html[data-bs-theme="dark"] .config-card-header,
html[data-bs-theme="dark"] .config-card-title { color: var(--wc-heading); }
html[data-bs-theme="dark"] .config-card-subtitle { color: var(--wc-muted); }

/* ---------- Mapa de Membresia (mm-*) ---------- */
html[data-bs-theme="dark"] .mm-module,
html[data-bs-theme="dark"] .mm-metric-card,
html[data-bs-theme="dark"] .mm-filtros-bar,
html[data-bs-theme="dark"] .mm-org-group-card,
html[data-bs-theme="dark"] .mm-group-collapsed,
html[data-bs-theme="dark"] .mm-org-members,
html[data-bs-theme="dark"] .mm-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .mm-metric-value,
html[data-bs-theme="dark"] .mm-card-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .mm-metric-label,
html[data-bs-theme="dark"] .mm-card-subtitle { color: var(--wc-muted) !important; }

/* Mapa membresia — cards de grupo (Familia, Celula, etc.) renderizados via JS
   com bg #fff e texto #1e293b hardcoded em mapa_membresia.css. */
html[data-bs-theme="dark"] .mm-org-group-card {
  background: var(--wc-surface-2) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.35) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .mm-org-group-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.45) !important;
}
html[data-bs-theme="dark"] .mm-org-group-header h6 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .mm-org-group-stats { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .mm-chevron { color: var(--wc-muted); }

/* Card raiz da arvore no topo (ex.: "Familia · 2 grupos · 7 membros") —
   mapa_membresia.css define bg #f8fbff + texto #1e40af, ilegivel no dark. */
html[data-bs-theme="dark"] .mm-org-root-card {
  background: rgba(96,165,250,.10) !important;
  border-color: rgba(96,165,250,.30) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .mm-org-root-card:hover {
  box-shadow: 0 6px 18px rgba(96,165,250,.18) !important;
}
html[data-bs-theme="dark"] .mm-org-root-card h6 { color: #bfdbfe !important; }
html[data-bs-theme="dark"] .mm-org-root-stats { color: var(--wc-muted) !important; }

/* Conectores verticais/horizontais da arvore */
html[data-bs-theme="dark"] .mm-org-vline,
html[data-bs-theme="dark"] .mm-org-hline { background-color: var(--wc-border) !important; }

/* Icones de metricas (inline-styled no template) — manter identidade de cor no dark */
html[data-bs-theme="dark"] .mm-metrics-grid .mm-metric-card:nth-child(1) .mm-metric-icon {
  background: rgba(96,165,250,.18) !important;
  color: #93c5fd !important;
}
html[data-bs-theme="dark"] .mm-metrics-grid .mm-metric-card:nth-child(2) .mm-metric-icon {
  background: rgba(34,197,94,.18) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .mm-metrics-grid .mm-metric-card:nth-child(3) .mm-metric-icon {
  background: rgba(245,158,11,.18) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .mm-metrics-grid .mm-metric-card:nth-child(4) .mm-metric-icon {
  background: rgba(167,139,250,.22) !important;
  color: #c4b5fd !important;
}

/* Badge "Cônjuge" no card do membro — fundo claro e texto escuro no light;
   ajusta para tons translucidos no dark */
html[data-bs-theme="dark"] .mm-org-member-parentesco {
  background: rgba(167,139,250,.18) !important;
  color: #ddd6fe !important;
}

/* ---------- Aniversariantes ---------- */
html[data-bs-theme="dark"] .aniversario-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .aniversario-card-name { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .aniversario-card-date,
html[data-bs-theme="dark"] .aniversario-card-info { color: var(--wc-muted) !important; }

/* finance-card-value generico (aparece em aniversariantes, etc.) */
html[data-bs-theme="dark"] .finance-card-value,
html[data-bs-theme="dark"] .finance-card-label,
html[data-bs-theme="dark"] .finance-card-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .finance-card-label,
html[data-bs-theme="dark"] .finance-card-sub { color: var(--wc-muted) !important; }

/* ---------- Notificacoes ---------- */
html[data-bs-theme="dark"] .wc-notification-card,
html[data-bs-theme="dark"] .wc-notif-card,
html[data-bs-theme="dark"] .wc-notif-item {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .wc-notification-card .title,
html[data-bs-theme="dark"] .wc-notif-card .title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .tpl-name,
html[data-bs-theme="dark"] .tpl-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .tpl-meta,
html[data-bs-theme="dark"] .tpl-sub { color: var(--wc-muted) !important; }

/* ---------- Super Admin: auditoria ---------- */
html[data-bs-theme="dark"] .audit-card,
html[data-bs-theme="dark"] .audit-card-critical,
html[data-bs-theme="dark"] .audit-card-denied,
html[data-bs-theme="dark"] .audit-card-login,
html[data-bs-theme="dark"] .audit-card-global,
html[data-bs-theme="dark"] .audit-card-notif,
html[data-bs-theme="dark"] .audit-feed,
html[data-bs-theme="dark"] .audit-feed-item {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .audit-card-label,
html[data-bs-theme="dark"] .audit-card-sub,
html[data-bs-theme="dark"] .audit-feed-meta { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .audit-card-title,
html[data-bs-theme="dark"] .audit-feed-action { color: var(--wc-heading) !important; }

/* form-label-sm (super-admin configuracoes) */
html[data-bs-theme="dark"] .form-label-sm { color: var(--wc-text); }

/* ---------- Minha assinatura (sub-*) ---------- */
html[data-bs-theme="dark"] .sub-card,
html[data-bs-theme="dark"] .sub-metric,
html[data-bs-theme="dark"] .sub-section,
html[data-bs-theme="dark"] .sub-header {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .sub-card .value,
html[data-bs-theme="dark"] .sub-metric .value,
html[data-bs-theme="dark"] .sub-card-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .sub-card .label,
html[data-bs-theme="dark"] .sub-metric .label,
html[data-bs-theme="dark"] .sub-card-sub { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .pay-pagination-summary { color: var(--wc-muted) !important; }

/* ---------- Admin painel ---------- */
html[data-bs-theme="dark"] .admin-panel,
html[data-bs-theme="dark"] .admin-card,
html[data-bs-theme="dark"] .admin-section {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .nav-link.active {
  background: var(--wc-surface-3) !important;
  color: #fff !important;
  border-color: var(--wc-border) !important;
}

/* ---------- mc-stat-row generico (ensino, dashboards) ---------- */
html[data-bs-theme="dark"] .mc-stat-row {
  border-bottom-color: var(--wc-border-soft);
}
html[data-bs-theme="dark"] .mc-stat-row .value,
html[data-bs-theme="dark"] .mc-section-card .value { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .mc-stat-row .label,
html[data-bs-theme="dark"] .mc-section-card .label { color: var(--wc-muted) !important; }

/* ---------- Super Admin: Matriz de Permissoes ---------- */
/* Legend cards: manter hue semantica em versao escura */
html[data-bs-theme="dark"] .legend-card {
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .legend-card.legend-unprotected {
  background: rgba(244, 63, 94, .18) !important;
  color: #fda4af !important;
}
html[data-bs-theme="dark"] .legend-card.legend-public {
  background: var(--wc-surface-2) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .legend-card.legend-login {
  background: rgba(245, 158, 11, .18) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .legend-card.legend-role {
  background: rgba(34, 197, 94, .18) !important;
  color: #86efac !important;
}

/* Cells da matriz: verde/vermelho semantico em variante escura */
html[data-bs-theme="dark"] .perm-cell.perm-yes-cell {
  background: rgba(34, 197, 94, .18) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .perm-cell.perm-no-cell {
  background: rgba(244, 63, 94, .18) !important;
  color: #fca5a5 !important;
}

/* Badges com .text-dark precisam manter texto escuro sobre fundo amarelo/claro */
html[data-bs-theme="dark"] .badge.text-dark,
html[data-bs-theme="dark"] .badge.bg-warning.text-dark,
html[data-bs-theme="dark"] .badge.bg-light.text-dark,
html[data-bs-theme="dark"] .badge.bg-info.text-dark { color: #0f172a !important; }
/* bg-warning + text-dark eh o padrao Bootstrap para amarelo legivel */
html[data-bs-theme="dark"] .badge.bg-warning { background-color: #fbbf24 !important; }

/* Linhas da matriz: module-row (cabecalho de modulo), route-row variantes */
html[data-bs-theme="dark"] tr.module-row > td {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-heading) !important;
  border-bottom: 1px solid var(--wc-border) !important;
}
html[data-bs-theme="dark"] tr.route-row > td {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
  border-bottom: 1px solid var(--wc-border-soft) !important;
}
html[data-bs-theme="dark"] tr.route-row.route-public-ok > td {
  background: var(--wc-surface-2) !important;
}
html[data-bs-theme="dark"] tr.route-row.route-login > td {
  background: rgba(245, 158, 11, .10) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] tr.route-row.route-no-decorator > td,
html[data-bs-theme="dark"] tr.route-row.route-unprotected > td {
  background: rgba(244, 63, 94, .12) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] tr.route-row:hover > td { background: var(--wc-surface-3) !important; color: #fff !important; }
html[data-bs-theme="dark"] tr.route-row > td.path-col,
html[data-bs-theme="dark"] tr.route-row > td.path-col code { color: var(--wc-heading) !important; }

/* ---------- Super Admin: Testes ---------- */
html[data-bs-theme="dark"] .test-module-card,
html[data-bs-theme="dark"] .test-card,
html[data-bs-theme="dark"] .h-card,
html[data-bs-theme="dark"] .h-section {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .test-module-title,
html[data-bs-theme="dark"] .test-card-title,
html[data-bs-theme="dark"] .h-label,
html[data-bs-theme="dark"] .h-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .test-last-run {
  background: rgba(245, 158, 11, .14) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, .30) !important;
}
html[data-bs-theme="dark"] .test-badge,
html[data-bs-theme="dark"] .test-badge.test-badge-idle {
  background: var(--wc-surface-3) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .test-badge.test-badge-passed,
html[data-bs-theme="dark"] .h-status.h-status-passed {
  background: rgba(34, 197, 94, .18) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .test-badge.test-badge-failed,
html[data-bs-theme="dark"] .h-status.h-status-failed {
  background: rgba(244, 63, 94, .18) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme="dark"] .test-badge.test-badge-running,
html[data-bs-theme="dark"] .h-status.h-status-running {
  background: rgba(59, 130, 246, .18) !important;
  color: #93c5fd !important;
}
html[data-bs-theme="dark"] .btn-run-test {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .btn-run-test:hover {
  background: var(--wc-surface-3) !important;
  color: #fff !important;
}

/* ---------- Financeiro: metricas e contas ---------- */
html[data-bs-theme="dark"] .finance-evolution-card,
html[data-bs-theme="dark"] .finance-account-card,
html[data-bs-theme="dark"] .finance-metric-block,
html[data-bs-theme="dark"] .finance-chart-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .finance-evolution-bars {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
}

/* ---------- gc-empty-state ---------- */
html[data-bs-theme="dark"] .gc-empty-state {
  background: var(--wc-surface) !important;
  border: 1px dashed var(--wc-border) !important;
  color: var(--wc-muted) !important;
}

/* ---------- gc-grupo-card variantes de status ---------- */
html[data-bs-theme="dark"] .gc-grupo-card,
html[data-bs-theme="dark"] .gc-grupo-card.gc-status-ativo,
html[data-bs-theme="dark"] .gc-grupo-card.gc-status-pausado,
html[data-bs-theme="dark"] .gc-grupo-card.gc-status-encerrado,
html[data-bs-theme="dark"] .gc-grupo-card.gc-status-multiplicando {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .gc-grupo-card .gc-grupo-title,
html[data-bs-theme="dark"] .gc-grupo-card .title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .gc-grupo-card .gc-grupo-meta,
html[data-bs-theme="dark"] .gc-grupo-card .meta { color: var(--wc-muted) !important; }

/* ---------- GC Redes ---------- */
html[data-bs-theme="dark"] .gc-rede-card,
html[data-bs-theme="dark"] .gc-rede-header,
html[data-bs-theme="dark"] .gc-rede-body {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .gc-rede-info,
html[data-bs-theme="dark"] .gc-rede-info * { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .gc-rede-info small,
html[data-bs-theme="dark"] .gc-rede-info .text-muted { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .gc-rede-supervisores { color: var(--wc-text); }
html[data-bs-theme="dark"] .gc-rede-supervisores .fw-bold,
html[data-bs-theme="dark"] .gc-rede-supervisores strong { color: var(--wc-heading) !important; }

/* ---------- GC Organograma ---------- */
html[data-bs-theme="dark"] .gc-org-network-card,
html[data-bs-theme="dark"] .gc-org-supervisor-card,
html[data-bs-theme="dark"] .gc-org-group-card,
html[data-bs-theme="dark"] .gc-org-leader-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .gc-org-network-card *,
html[data-bs-theme="dark"] .gc-org-supervisor-card *,
html[data-bs-theme="dark"] .gc-org-group-card *,
html[data-bs-theme="dark"] .gc-org-leader-card * { color: inherit; }
html[data-bs-theme="dark"] .gc-org-network-card .title,
html[data-bs-theme="dark"] .gc-org-supervisor-card .title,
html[data-bs-theme="dark"] .gc-org-group-card .title,
html[data-bs-theme="dark"] .gc-org-leader-card .title,
html[data-bs-theme="dark"] .gc-org-network-card h3,
html[data-bs-theme="dark"] .gc-org-network-card h4,
html[data-bs-theme="dark"] .gc-org-network-card h5,
html[data-bs-theme="dark"] .gc-org-supervisor-card h3,
html[data-bs-theme="dark"] .gc-org-supervisor-card h4,
html[data-bs-theme="dark"] .gc-org-supervisor-card h5,
html[data-bs-theme="dark"] .gc-org-group-card h3,
html[data-bs-theme="dark"] .gc-org-group-card h4,
html[data-bs-theme="dark"] .gc-org-group-card h5,
html[data-bs-theme="dark"] .gc-org-leader-card h3,
html[data-bs-theme="dark"] .gc-org-leader-card h4,
html[data-bs-theme="dark"] .gc-org-leader-card h5 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .gc-org-member-chip {
  background: var(--wc-surface-2) !important;
  border: 1px solid var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .gc-org-warning-card {
  background: rgba(245, 158, 11, .14) !important;
  border: 1px solid rgba(245, 158, 11, .35) !important;
  color: #fcd34d !important;
}

/* ---------- GC Materiais ---------- */
html[data-bs-theme="dark"] .gc-material-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .gc-material-card .title,
html[data-bs-theme="dark"] .gc-material-card h3,
html[data-bs-theme="dark"] .gc-material-card h4,
html[data-bs-theme="dark"] .gc-material-card h5 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .gc-material-card .meta,
html[data-bs-theme="dark"] .gc-material-card .text-muted,
html[data-bs-theme="dark"] .gc-material-card small { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .gc-material-read-btn--pending,
html[data-bs-theme="dark"] .mc-action-btn.gc-material-read-btn--pending {
  background: rgba(245, 158, 11, .18) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, .35) !important;
}
html[data-bs-theme="dark"] .gc-material-read-btn--done,
html[data-bs-theme="dark"] .mc-action-btn.gc-material-read-btn--done {
  background: rgba(34, 197, 94, .18) !important;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, .35) !important;
}

/* ---------- GC Metricas ---------- */
html[data-bs-theme="dark"] .finance-empty {
  background: var(--wc-surface) !important;
  border: 1px dashed var(--wc-border) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .finance-bar-track {
  background: var(--wc-surface-2) !important;
  border: 1px solid var(--wc-border) !important;
}
/* Status badges do GC (verde claro -> verde escuro pastel) */
html[data-bs-theme="dark"] .badge.gc-status-grupo-ativo {
  background: rgba(34, 197, 94, .22) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .badge.gc-status-grupo-pausado {
  background: rgba(245, 158, 11, .22) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .badge.gc-status-grupo-encerrado {
  background: var(--wc-surface-3) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .badge.gc-status-grupo-multiplicando {
  background: rgba(139, 92, 246, .22) !important;
  color: #c4b5fd !important;
}

/* ============================================================
   Cobertura adicional por modulo
   ============================================================ */

/* Configuracoes simples */
html[data-bs-theme="dark"] .config-container {
  background: var(--wc-surface);
  border: 1px solid var(--wc-border);
  border-radius: 16px;
  color: var(--wc-text);
  box-shadow: 0 8px 24px rgba(0,0,0,.32);
}
html[data-bs-theme="dark"] .config-container h2,
html[data-bs-theme="dark"] .config-container label {
  color: var(--wc-heading);
}
html[data-bs-theme="dark"] .config-container input[type="text"],
html[data-bs-theme="dark"] .config-container input[type="email"],
html[data-bs-theme="dark"] .config-container input[type="file"] {
  background: var(--wc-bg-soft);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .config-container .btn-cancelar {
  background: var(--wc-surface-2);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .config-container .btn-cancelar:hover {
  background: var(--wc-surface-3);
  color: #fff;
}

/* Dashboard legado */
html[data-bs-theme="dark"] .dashboard-layout .card,
html[data-bs-theme="dark"] .filtros-dashboard {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 8px 24px rgba(0,0,0,.32) !important;
}
html[data-bs-theme="dark"] .dashboard-layout .card h6,
html[data-bs-theme="dark"] .filtro label {
  color: var(--wc-muted);
}
html[data-bs-theme="dark"] .dashboard-layout .card h2,
html[data-bs-theme="dark"] .fc .fc-toolbar-title,
html[data-bs-theme="dark"] .fc .fc-daygrid-day-number {
  color: #93c5fd;
}
html[data-bs-theme="dark"] .filtro select,
html[data-bs-theme="dark"] .filtro input[type="date"] {
  background: var(--wc-bg-soft);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .fc-theme-standard td,
html[data-bs-theme="dark"] .fc-theme-standard th {
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .fc .fc-col-header-cell,
html[data-bs-theme="dark"] .fc .fc-daygrid-day {
  background: var(--wc-surface);
}
html[data-bs-theme="dark"] .fc .fc-day-today {
  background: rgba(96,165,250,.12) !important;
}

/* Membros, usuarios, visitantes e telas que reutilizam membros.css */
html[data-bs-theme="dark"] .card-membros .form-select,
html[data-bs-theme="dark"] .card-membros input[type="text"],
html[data-bs-theme="dark"] .card-membros input[type="tel"],
html[data-bs-theme="dark"] .card-membros input[type="email"],
html[data-bs-theme="dark"] .card-membros input[type="date"],
html[data-bs-theme="dark"] #paginacao .btn {
  background-color: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.20);
}
html[data-bs-theme="dark"] #paginacao .btn:hover {
  background-color: var(--wc-surface-3) !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] #paginacao .btn.active {
  background-color: var(--wc-primary) !important;
  border-color: var(--wc-primary) !important;
  color: #0b1220 !important;
}
html[data-bs-theme="dark"] .table td {
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .table td img,
html[data-bs-theme="dark"] #previewFoto,
html[data-bs-theme="dark"] .familiar-avatar-img {
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .choices {
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .choices__list--multiple .choices__item {
  background-color: rgba(96,165,250,.22);
  border: 1px solid rgba(96,165,250,.34);
  color: #bfdbfe;
}
html[data-bs-theme="dark"] .familiar-choices-choice:hover {
  background-color: var(--wc-surface-3) !important;
}

/* Cards e listas mobile reutilizaveis */
html[data-bs-theme="dark"] .mc-card-mobile,
html[data-bs-theme="dark"] .ec-mobile-card,
html[data-bs-theme="dark"] .gc-mobile-card,
html[data-bs-theme="dark"] .finance-mobile-card,
html[data-bs-theme="dark"] .ensino-m-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 6px 18px rgba(0,0,0,.30);
}
html[data-bs-theme="dark"] .mc-card-mobile-title,
html[data-bs-theme="dark"] .ec-mobile-card-title,
html[data-bs-theme="dark"] .ensino-m-card-title,
html[data-bs-theme="dark"] .ensino-curso-nome {
  color: var(--wc-heading);
}
html[data-bs-theme="dark"] .mc-card-mobile-sub,
html[data-bs-theme="dark"] .mc-card-mobile-meta,
html[data-bs-theme="dark"] .ec-mobile-card-meta,
html[data-bs-theme="dark"] .ec-mobile-card-details,
html[data-bs-theme="dark"] .ensino-m-card-sub,
html[data-bs-theme="dark"] .ensino-curso-turma,
html[data-bs-theme="dark"] .ensino-curso-data,
html[data-bs-theme="dark"] .ensino-curso-desc {
  color: var(--wc-muted);
}
html[data-bs-theme="dark"] .ec-mobile-card-header,
html[data-bs-theme="dark"] .ec-mobile-card-actions,
html[data-bs-theme="dark"] .ensino-m-card-row,
html[data-bs-theme="dark"] .ensino-m-card-actions {
  border-color: var(--wc-border);
}
html[data-bs-theme="dark"] .ec-mobile-card-icon-muted,
html[data-bs-theme="dark"] .ensino-curso-capa,
html[data-bs-theme="dark"] .ensino-capa-placeholder {
  background: var(--wc-surface-2);
  color: var(--wc-muted);
}

/* Escalas/Cultos: detalhes, cards e metricas */
html[data-bs-theme="dark"] .ec-info-card,
html[data-bs-theme="dark"] .ec-equipe-card,
html[data-bs-theme="dark"] .ec-empty,
html[data-bs-theme="dark"] .ec-metric-card,
html[data-bs-theme="dark"] .ec-analytic-card,
html[data-bs-theme="dark"] .ec-person-rank-card,
html[data-bs-theme="dark"] .ec-evolution-card,
html[data-bs-theme="dark"] .ec-next-card,
html[data-bs-theme="dark"] .ec-sugestao-item,
html[data-bs-theme="dark"] .ec-membro-equipe-item,
html[data-bs-theme="dark"] .ec-suggest-block {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .ec-equipe-card:hover,
html[data-bs-theme="dark"] .ec-sugestao-item:hover,
html[data-bs-theme="dark"] .ec-membro-equipe-item:hover {
  background: var(--wc-surface-2) !important;
}
html[data-bs-theme="dark"] .ec-sugestao-item.selected {
  background: rgba(96,165,250,.16) !important;
  border-color: rgba(96,165,250,.38) !important;
}
html[data-bs-theme="dark"] .ec-info-value,
html[data-bs-theme="dark"] .ec-ministerio-title,
html[data-bs-theme="dark"] .ec-equipe-info h3,
html[data-bs-theme="dark"] .ec-empty h4,
html[data-bs-theme="dark"] .ec-empty p.fw-semibold,
html[data-bs-theme="dark"] .ec-metrics-heading h2,
html[data-bs-theme="dark"] .ec-metric-value,
html[data-bs-theme="dark"] .ec-metric-bar-row > div:first-child,
html[data-bs-theme="dark"] .ec-sugestao-item-nome,
html[data-bs-theme="dark"] .ec-membro-equipe-nome {
  color: var(--wc-heading) !important;
}
html[data-bs-theme="dark"] .ec-info-label,
html[data-bs-theme="dark"] .ec-equipe-stats,
html[data-bs-theme="dark"] .ec-empty,
html[data-bs-theme="dark"] .ec-metrics-heading span,
html[data-bs-theme="dark"] .ec-metric-label,
html[data-bs-theme="dark"] .ec-analytic-card span,
html[data-bs-theme="dark"] .ec-person-rank-card small,
html[data-bs-theme="dark"] .ec-next-card small,
html[data-bs-theme="dark"] .ec-next-card span,
html[data-bs-theme="dark"] .ec-empty-inline,
html[data-bs-theme="dark"] .ec-suggest-block-label,
html[data-bs-theme="dark"] .ec-sugestao-item-meta,
html[data-bs-theme="dark"] .ec-membro-equipe-funcao {
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .ec-metric-bar-track,
html[data-bs-theme="dark"] .ec-evolution-bars {
  background: var(--wc-bg-soft);
}

/* Ensino */
html[data-bs-theme="dark"] .mc-switch-group,
html[data-bs-theme="dark"] .ensino-capa-area {
  background: var(--wc-surface-2);
  border-color: var(--wc-border);
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .ensino-capa-area:hover {
  background: var(--wc-surface-3);
  border-color: var(--wc-primary);
}
html[data-bs-theme="dark"] .ensino-avaliacoes-head > div,
html[data-bs-theme="dark"] .ensino-avaliacao-title {
  color: var(--wc-heading);
}
html[data-bs-theme="dark"] .ensino-avaliacao-sub,
html[data-bs-theme="dark"] .ensino-avaliacao-meta,
html[data-bs-theme="dark"] .ensino-m-card-label {
  color: var(--wc-muted);
}
html[data-bs-theme="dark"] .ensino-avaliacao-icon {
  background: rgba(139,92,246,.18);
  color: #c4b5fd;
}

/* MFA e paginas publicas que usam base.html */
html[data-bs-theme="dark"] .bg-custom,
html[data-bs-theme="dark"] main.w-100 {
  background: var(--wc-bg) !important;
}
html[data-bs-theme="dark"] .mfa-wrapper {
  background: linear-gradient(135deg, #0b1220 0%, #111c2f 100%) !important;
}
html[data-bs-theme="dark"] .mfa-card,
html[data-bs-theme="dark"] .mfa-activate-card,
html[data-bs-theme="dark"] .mfa-deactivate-card {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border);
  color: var(--wc-text);
  box-shadow: 0 20px 60px rgba(0,0,0,.38), 0 4px 16px rgba(0,0,0,.22) !important;
}
html[data-bs-theme="dark"] .mfa-title,
html[data-bs-theme="dark"] .mfa-activate-card h2,
html[data-bs-theme="dark"] .mfa-deactivate-card h2,
html[data-bs-theme="dark"] .mfa-benefits h4,
html[data-bs-theme="dark"] .mfa-field label {
  color: var(--wc-heading) !important;
}
html[data-bs-theme="dark"] .mfa-subtitle,
html[data-bs-theme="dark"] .mfa-activate-card .subtitle,
html[data-bs-theme="dark"] .mfa-deactivate-card .subtitle,
html[data-bs-theme="dark"] .mfa-benefits li,
html[data-bs-theme="dark"] .mfa-field .hint,
html[data-bs-theme="dark"] .mfa-timer,
html[data-bs-theme="dark"] .mfa-link {
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .mfa-code-input input,
html[data-bs-theme="dark"] .mfa-field input {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-heading) !important;
}
html[data-bs-theme="dark"] .mfa-code-input input:focus,
html[data-bs-theme="dark"] .mfa-field input:focus {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-primary) !important;
  box-shadow: 0 0 0 3px rgba(96,165,250,.22) !important;
}
html[data-bs-theme="dark"] .mfa-benefits {
  background: var(--wc-surface-2) !important;
  border: 1px solid var(--wc-border);
}
html[data-bs-theme="dark"] .mfa-warning {
  background: rgba(239,68,68,.12) !important;
  border-left-color: #f87171 !important;
}
html[data-bs-theme="dark"] .mfa-warning p {
  color: #fecaca !important;
}
html[data-bs-theme="dark"] .mfa-btn-outline,
html[data-bs-theme="dark"] .mfa-btn-send-code {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-primary) !important;
  color: #bfdbfe !important;
}
html[data-bs-theme="dark"] .mfa-btn-outline:hover:not(:disabled),
html[data-bs-theme="dark"] .mfa-btn-send-code:hover:not(:disabled) {
  background: var(--wc-surface-3) !important;
}
html[data-bs-theme="dark"] .mfa-alert-error {
  background: rgba(239,68,68,.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,.35) !important;
}
html[data-bs-theme="dark"] .mfa-alert-success {
  background: rgba(34,197,94,.12) !important;
  color: #86efac !important;
  border-color: rgba(34,197,94,.35) !important;
}

/* ============================================================
   Admin panel (/admin) — admin.html define estilos inline em
   <style> com bg branco hardcoded.
   ============================================================ */
html[data-bs-theme="dark"] .admin-tabs-wrap {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] #adminTabs .nav-link {
  color: var(--wc-text) !important;
  background: transparent !important;
}
html[data-bs-theme="dark"] #adminTabs .nav-link:hover {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] #adminTabs .nav-link.active {
  background: var(--wc-surface-3) !important;
  border-color: var(--wc-border) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.35) !important;
}
html[data-bs-theme="dark"] .admin-tab-icon {
  background: var(--wc-surface-2) !important;
}
html[data-bs-theme="dark"] #adminTabs .nav-link.active .admin-tab-icon {
  background: var(--wc-bg-soft) !important;
}
html[data-bs-theme="dark"] .admin-panel {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .admin-panel-title { color: var(--wc-heading); }

/* ============================================================
   /configuracoes — estilos inline com bg branco/cinza claro
   ============================================================ */
html[data-bs-theme="dark"] .smtp-toggle-wrap {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .smtp-badge-off {
  background: var(--wc-surface-3) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .smtp-badge-on {
  background: rgba(34,197,94,.18) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .pwa-info-item {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .pwa-info-item span { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .pwa-info-item strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .logo-preview {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .logo-preview-placeholder {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .color-swatch { border-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .config-section-title {
  color: #c4b5fd !important;
  border-bottom-color: rgba(139,92,246,.30) !important;
}

/* ============================================================
   /configuracoes/notificacoes — notif-card-panel e preview
   ============================================================ */
html[data-bs-theme="dark"] .notif-card-panel {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .notif-preview-phone {
  background: var(--wc-bg-soft) !important;
  border-color: #000 !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.5) !important;
}
html[data-bs-theme="dark"] .notif-preview-card {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .notif-preview-card small { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .notif-preview-card strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .notif-preview-card p { color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .notif-tab-panel { color: var(--wc-text); }

/* ============================================================
   Cards de metricas/analytics dos modulos (escalas, finance, gc,
   atendimentos). Todos sao .X-metric-card / .X-analytic-card /
   .X-person-rank-card / .X-evolution-card / .X-next-card com
   bg #fff + texto #0f172a hardcoded. Cobertos individualmente
   pois compartilham o mesmo padrao.
   ============================================================ */
html[data-bs-theme="dark"] .ec-metric-card,
html[data-bs-theme="dark"] .ec-analytic-card,
html[data-bs-theme="dark"] .ec-person-rank-card,
html[data-bs-theme="dark"] .ec-evolution-card,
html[data-bs-theme="dark"] .ec-next-card,
html[data-bs-theme="dark"] .finance-evolution-card,
html[data-bs-theme="dark"] .finance-person-rank-card,
html[data-bs-theme="dark"] .gc-analytic-card,
html[data-bs-theme="dark"] .gc-person-rank-card,
html[data-bs-theme="dark"] .gc-evolution-card,
html[data-bs-theme="dark"] .atd-metric-card,
html[data-bs-theme="dark"] .atd-analytic-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28) !important;
}
html[data-bs-theme="dark"] .ec-metric-card:hover,
html[data-bs-theme="dark"] .ec-analytic-card:hover,
html[data-bs-theme="dark"] .ec-person-rank-card:hover,
html[data-bs-theme="dark"] .ec-evolution-card:hover,
html[data-bs-theme="dark"] .ec-next-card:hover,
html[data-bs-theme="dark"] .finance-evolution-card:hover,
html[data-bs-theme="dark"] .finance-metric-card:hover,
html[data-bs-theme="dark"] .finance-analytic-card:hover {
  border-color: rgba(139,92,246,.30) !important;
  box-shadow: 0 14px 38px rgba(0,0,0,.45) !important;
}

/* Labels e values dos metric cards (todos modulos) */
html[data-bs-theme="dark"] .ec-metric-label,
html[data-bs-theme="dark"] .finance-metric-label,
html[data-bs-theme="dark"] .atd-metric-label,
html[data-bs-theme="dark"] .ec-analytic-card span,
html[data-bs-theme="dark"] .finance-analytic-content span,
html[data-bs-theme="dark"] .gc-analytic-card span { color: var(--wc-muted) !important; }

html[data-bs-theme="dark"] .ec-metric-value,
html[data-bs-theme="dark"] .finance-metric-value,
html[data-bs-theme="dark"] .atd-metric-value,
html[data-bs-theme="dark"] .ec-analytic-card strong,
html[data-bs-theme="dark"] .finance-analytic-content strong,
html[data-bs-theme="dark"] .gc-analytic-card strong { color: var(--wc-heading) !important; }

/* Section headings/kickers das paginas de metricas */
html[data-bs-theme="dark"] .ec-metrics-heading h2,
html[data-bs-theme="dark"] .finance-section-heading h2,
html[data-bs-theme="dark"] .gc-metrics-heading h2 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .ec-metrics-heading .ec-section-kicker,
html[data-bs-theme="dark"] .finance-section-kicker,
html[data-bs-theme="dark"] .ec-section-kicker,
html[data-bs-theme="dark"] .gc-section-kicker { color: var(--wc-muted) !important; }

/* Barras de progresso / tracks dos cards de metrica */
html[data-bs-theme="dark"] .ec-metric-bar-track,
html[data-bs-theme="dark"] .finance-metric-bar-track,
html[data-bs-theme="dark"] .gc-metric-bar-track {
  background: var(--wc-bg-soft) !important;
}

/* Lista "proximos" (ec-next-list) e items genericos */
html[data-bs-theme="dark"] .ec-next-list li,
html[data-bs-theme="dark"] .finance-next-list li,
html[data-bs-theme="dark"] .ec-metric-mobile-list li {
  border-bottom-color: var(--wc-border-soft) !important;
  color: var(--wc-text);
}

/* ============================================================
   Atendimentos /relatorios — usa Bootstrap .card padrao + tabela
   ============================================================ */
html[data-bs-theme="dark"] .atd-page .card,
html[data-bs-theme="dark"] .atd-page .card-body { color: var(--wc-text); }
html[data-bs-theme="dark"] .atd-page .badge.bg-primary { background: rgba(59,130,246,.22) !important; color: #bfdbfe !important; }
html[data-bs-theme="dark"] .atd-page .badge.bg-success { background: rgba(34,197,94,.22) !important; color: #86efac !important; }

/* ============================================================
   Mapa de membresia — cards de membros (Acsa Cristina, etc.) e
   labels de nivel familiar (Conjuge, Sem parentesco informado)
   ============================================================ */
html[data-bs-theme="dark"] .mm-org-member-card {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .mm-org-member-card:hover {
  border-color: rgba(96,165,250,.45) !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.35) !important;
}
html[data-bs-theme="dark"] .mm-org-member-multiplo {
  background: rgba(139,92,246,.12) !important;
  border-color: rgba(139,92,246,.45) !important;
}
html[data-bs-theme="dark"] .mm-org-member-multiplo:hover { border-color: #c4b5fd !important; }
html[data-bs-theme="dark"] .mm-org-avatar {
  background: linear-gradient(135deg, rgba(96,165,250,.22), rgba(139,92,246,.22)) !important;
  color: #bfdbfe !important;
}
html[data-bs-theme="dark"] .mm-org-member-name { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .mm-org-member-status { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .mm-org-member-status.mm-status-ativo { color: #86efac !important; }
html[data-bs-theme="dark"] .mm-org-member-parentesco {
  background: rgba(168,28,175,.18) !important;
  color: #f0abfc !important;
}
html[data-bs-theme="dark"] .mm-family-level-title {
  background: rgba(139,92,246,.14) !important;
  border-color: rgba(139,92,246,.32) !important;
  color: #c4b5fd !important;
}
html[data-bs-theme="dark"] .mm-family-level-members {
  border-left-color: rgba(139,92,246,.32) !important;
}

/* ============================================================
   /super-admin/notificacoes — inline <style> com varios bg/cores
   light hardcoded em super_admin_notificacoes.html
   ============================================================ */
html[data-bs-theme="dark"] .config-tabs .tab-btn:hover {
  background: var(--wc-surface-2) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .config-tabs .tab-btn.active {
  background: rgba(139,92,246,.18) !important;
  color: #c4b5fd !important;
  border-bottom-color: #c4b5fd !important;
}
html[data-bs-theme="dark"] .status-dot.warn { background: #fcd34d !important; }
html[data-bs-theme="dark"] .tpl-item {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .tpl-item:hover {
  background: var(--wc-surface-3) !important;
}
html[data-bs-theme="dark"] .badge-email {
  background: rgba(245,158,11,.18) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .log-table th {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-muted) !important;
  border-bottom-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .log-status.failed {
  background: rgba(239,68,68,.18) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme="dark"] .log-status.skipped {
  background: var(--wc-surface-3) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .notification-group-title {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-muted) !important;
  border-left-color: #c4b5fd !important;
}
html[data-bs-theme="dark"] .log-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text);
}

/* Modais inline com <div style="background:#fff;...">. Como sao
   estilos inline, precisam de seletor de atributo + !important. */
html[data-bs-theme="dark"] [style*="background:#fff"][style*="border-radius"],
html[data-bs-theme="dark"] [style*="background: #fff"][style*="border-radius"] {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] [style*="background:#f9fafb"],
html[data-bs-theme="dark"] [style*="background: #f9fafb"],
html[data-bs-theme="dark"] [style*="background:#f3f4f6"],
html[data-bs-theme="dark"] [style*="background:#f8fafc"],
html[data-bs-theme="dark"] [style*="background: #f8fafc"] {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] [style*="background:#f0f9ff"] {
  background: rgba(59,130,246,.12) !important;
  color: #bfdbfe !important;
  border-color: rgba(59,130,246,.32) !important;
}
html[data-bs-theme="dark"] [style*="background:#fffbeb"] {
  background: rgba(245,158,11,.12) !important;
  color: #fcd34d !important;
  border-color: rgba(245,158,11,.32) !important;
}

/* ============================================================
   /financeiro/metricas — cards de contribuicoes e contas/caixas
   (.finance-contribution-grid > div, .finance-account-card) +
   .finance-category-card de /financeiro#categorias
   ============================================================ */
html[data-bs-theme="dark"] .finance-contribution-grid > div,
html[data-bs-theme="dark"] .finance-account-card,
html[data-bs-theme="dark"] .finance-category-card,
html[data-bs-theme="dark"] .finance-config-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
html[data-bs-theme="dark"] .finance-contribution-grid span,
html[data-bs-theme="dark"] .finance-account-card span,
html[data-bs-theme="dark"] .finance-account-card small,
html[data-bs-theme="dark"] .finance-category-card span { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .finance-contribution-grid strong,
html[data-bs-theme="dark"] .finance-account-card strong,
html[data-bs-theme="dark"] .finance-category-card strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .finance-contribution-grid i {
  background: rgba(96,165,250,.18) !important;
  color: #bfdbfe !important;
}
html[data-bs-theme="dark"] .finance-empty { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .finance-empty i { color: #c4b5fd !important; }

/* /financeiro — section header dentro do modal "Nova entrada" */
html[data-bs-theme="dark"] .fin-section-header { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .fin-section-divider { border-top-color: var(--wc-border) !important; }

/* ============================================================
   /atendimentos/painel — items da lista (Tipos / Responsaveis)
   ============================================================ */
html[data-bs-theme="dark"] .atd-agenda-item-info strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .atd-agenda-item-meta { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .atd-agenda-item:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.4) !important;
}
/* badge.bg-light text-dark border usada no painel */
html[data-bs-theme="dark"] .atd-page .badge.bg-light,
html[data-bs-theme="dark"] .atd-agenda-item .badge.bg-light {
  background: var(--wc-surface-3) !important;
  color: var(--wc-heading) !important;
  border-color: var(--wc-border) !important;
}

/* ============================================================
   /atendimentos/solicitar — titulos do wizard e badges bg-light
   ============================================================ */
html[data-bs-theme="dark"] .atd-wizard-step-title { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .atd-tipo-card strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .atd-tipo-card small { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .atd-tipo-card .badge.bg-light {
  background: var(--wc-surface-3) !important;
  color: var(--wc-heading) !important;
  border-color: var(--wc-border) !important;
}

/* ============================================================
   /atendimentos/relatorios — paginacao customizada (.pagination
   renderizada via JS dentro de #paginacaoPorTipo/Resp/Lista)
   Reforco do override generico pois o page-link estava ficando
   branco neste contexto.
   ============================================================ */
html[data-bs-theme="dark"] #paginacaoPorTipo .page-link,
html[data-bs-theme="dark"] #paginacaoPorResp .page-link,
html[data-bs-theme="dark"] #paginacaoLista .page-link,
html[data-bs-theme="dark"] .atd-page .pagination .page-link {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] #paginacaoPorTipo .page-item.active .page-link,
html[data-bs-theme="dark"] #paginacaoPorResp .page-item.active .page-link,
html[data-bs-theme="dark"] #paginacaoLista .page-item.active .page-link,
html[data-bs-theme="dark"] .atd-page .pagination .page-item.active .page-link {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] .atd-page .pagination .page-item.disabled .page-link {
  background: var(--wc-surface) !important;
  color: var(--wc-muted) !important;
}

/* Paginacao renderizada via mcPaginar (#paginacaoXxx) usada em
   /escalas/metricas, /grupos-conexao/pessoas, financeiro, etc. */
html[data-bs-theme="dark"] [id^="paginacao"] .pagination .page-link {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] [id^="paginacao"] .pagination .page-item.active .page-link {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] [id^="paginacao"] .pagination .page-item.disabled .page-link {
  background: var(--wc-surface) !important;
  color: var(--wc-muted) !important;
}

/* Reforco para .gc-module .pagination (caso ID nao siga prefixo paginacao) */
html[data-bs-theme="dark"] .gc-module .pagination .page-link,
html[data-bs-theme="dark"] .gc-page .pagination .page-link {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .gc-module .pagination .page-item.active .page-link,
html[data-bs-theme="dark"] .gc-page .pagination .page-item.active .page-link {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

/* ============================================================
   /grupos-conexao/materiais — badges bg-light text-dark border
   dentro dos cards de material. Reforco com seletor especifico
   pois bg-light pode estar sendo sobrescrito pela ordem inline.
   ============================================================ */
html[data-bs-theme="dark"] .gc-material-card .badge.bg-light,
html[data-bs-theme="dark"] .gc-material-meta .badge.bg-light,
html[data-bs-theme="dark"] .gc-material-meta .badge {
  background: var(--wc-surface-3) !important;
  color: var(--wc-heading) !important;
  border-color: var(--wc-border) !important;
}

/* ============================================================
   /grupos-conexao/metricas — barras de progresso (finance-bar-*)
   tem texto #0f172a + bg #eef2f7 ilegiveis no dark.
   ============================================================ */
html[data-bs-theme="dark"] .finance-bar-row-top { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .finance-bar-row-top strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .finance-bar-row-top span { color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .finance-bar-row small { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .finance-bar-track {
  background: var(--wc-bg-soft) !important;
}
/* .finance-bar-track span colorido (verde/vermelho) mantem hue saturado */

/* ============================================================
   /ensino — mc-section-card, mc-stat-row, mc-alert-* sao usados
   no dashboard de ensino com bg branco e texto escuro hardcoded.
   ============================================================ */
html[data-bs-theme="dark"] .mc-section-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
html[data-bs-theme="dark"] .mc-section-title {
  color: #c4b5fd !important;
}
html[data-bs-theme="dark"] .mc-stat-row {
  border-bottom-color: var(--wc-border-soft) !important;
}
html[data-bs-theme="dark"] .mc-stat-row .label { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .mc-stat-row .value { color: var(--wc-heading) !important; }

/* mc-alert pastel — versoes dark com mesmo hue mas pastel claro */
html[data-bs-theme="dark"] .mc-alert-success {
  background: rgba(34,197,94,.12) !important;
  border-color: rgba(34,197,94,.32) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .mc-alert-danger {
  background: rgba(239,68,68,.12) !important;
  border-color: rgba(239,68,68,.32) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme="dark"] .mc-alert-warning {
  background: rgba(245,158,11,.12) !important;
  border-color: rgba(245,158,11,.32) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .mc-alert-info {
  background: rgba(14,165,233,.12) !important;
  border-color: rgba(14,165,233,.32) !important;
  color: #7dd3fc !important;
}

/* mc-empty (empty state) e mc-kpi-card label/value */
html[data-bs-theme="dark"] .mc-empty {
  background: var(--wc-bg-soft) !important;
  border: 1px dashed var(--wc-border) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .mc-kpi-card .mc-stat-label { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .mc-kpi-card .mc-stat-value { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .mc-kpi-card .mc-stat-body p { margin-bottom: 0; }

/* mc-form-label e demais labels do ensino */
html[data-bs-theme="dark"] .mc-form-label { color: var(--wc-text); }

/* Riscas nos titulos das tabelas — gc-table thead com border-bottom forte */
html[data-bs-theme="dark"] .ensino-page .gc-table thead th,
html[data-bs-theme="dark"] .ensino-module .gc-table thead th,
html[data-bs-theme="dark"] .mc-table-card thead th {
  border-bottom: 1px solid var(--wc-border) !important;
  background: var(--wc-bg-soft) !important;
  color: var(--wc-muted) !important;
}

/* ============================================================
   /atendimentos/tipos — remover borda dupla da tabela e
   suavizar o "quadrado" cinza ao redor do wrapper
   ============================================================ */
html[data-bs-theme="dark"] .gc-module .responsive-table-wrap {
  background: transparent !important;
  border: 0 !important;
}
html[data-bs-theme="dark"] .gc-table {
  border: 0 !important;
  background: transparent !important;
}
html[data-bs-theme="dark"] .gc-table thead th {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-muted) !important;
  border-bottom: 1px solid var(--wc-border) !important;
  border-top: 0 !important;
}
html[data-bs-theme="dark"] .gc-table tbody tr {
  background: var(--wc-surface) !important;
}
html[data-bs-theme="dark"] .gc-table tbody td {
  background: transparent !important;
  border-color: var(--wc-border-soft) !important;
  color: var(--wc-text) !important;
}

/* ============================================================
   /notificacoes/preferencias — paineis e status pills
   ============================================================ */
html[data-bs-theme="dark"] .wc-pref-panel {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .wc-push-status {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .wc-push-status i { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .wc-push-status.is-ok {
  background: rgba(34,197,94,.12) !important;
  border-color: rgba(34,197,94,.32) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .wc-push-status.is-ok i { color: #86efac !important; }
html[data-bs-theme="dark"] .wc-push-status.is-warn {
  background: rgba(245,158,11,.12) !important;
  border-color: rgba(245,158,11,.32) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .wc-push-status.is-blocked {
  background: rgba(239,68,68,.12) !important;
  border-color: rgba(239,68,68,.32) !important;
  color: #fca5a5 !important;
}
html[data-bs-theme="dark"] .wc-push-status.is-unsupported {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-muted) !important;
}
html[data-bs-theme="dark"] .wc-pref-row {
  border-bottom-color: var(--wc-border-soft) !important;
}
html[data-bs-theme="dark"] .wc-pref-row strong { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .wc-pref-row span { color: var(--wc-muted) !important; }

/* ============================================================
   /aniversariantes — mobile filter groups (PERIODO, TIPO)
   ============================================================ */
@media (max-width: 575.98px) {
  html[data-bs-theme="dark"] .aniversariantes-page .aniversariantes-filter-group {
    background: var(--wc-bg-soft) !important;
    border-color: var(--wc-border) !important;
  }
  html[data-bs-theme="dark"] .aniversariantes-page .aniversariantes-filter-label {
    color: var(--wc-muted) !important;
  }
  html[data-bs-theme="dark"] .aniversariantes-page #grupoPeriodo,
  html[data-bs-theme="dark"] .aniversariantes-page #grupoTipo {
    background: var(--wc-surface-2) !important;
    border-color: var(--wc-border) !important;
  }
  html[data-bs-theme="dark"] .aniversariantes-page .aniversariantes-filter-buttons .btn {
    color: var(--wc-text) !important;
    background: transparent !important;
  }
  html[data-bs-theme="dark"] .aniversariantes-page .aniversariantes-filter-buttons .btn + .btn {
    border-left-color: var(--wc-border) !important;
  }
  html[data-bs-theme="dark"] .aniversariantes-page .aniversariantes-filter-buttons .btn.active {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
  }
}

/* ============================================================
   FullCalendar (.ev-fc) — eventos detalhe e pagina de calendario.
   eventos.css usa #f8fafc / #e5e7eb / #fff hardcoded em quase
   tudo do FC. Aqui sobrescrevemos para o tema escuro.
   ============================================================ */
html[data-bs-theme="dark"] .ev-fc,
html[data-bs-theme="dark"] .ev-cal-wrapper {
  background: var(--wc-surface) !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .ev-fc .fc { color: var(--wc-text); }
html[data-bs-theme="dark"] .ev-fc .fc .fc-toolbar-title { color: var(--wc-heading); }

/* Cabecalho dos dias da semana */
html[data-bs-theme="dark"] .ev-fc .fc .fc-col-header { background: var(--wc-bg-soft) !important; }
html[data-bs-theme="dark"] .ev-fc .fc .fc-col-header-cell {
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-col-header-cell-cushion { color: var(--wc-muted); }
html[data-bs-theme="dark"] .ev-fc .fc .fc-col-header-cell.fc-day-sun .fc-col-header-cell-cushion,
html[data-bs-theme="dark"] .ev-fc .fc .fc-col-header-cell.fc-day-sat .fc-col-header-cell-cushion {
  color: #cbd5e1;
}

/* Celulas dos dias */
html[data-bs-theme="dark"] .ev-fc .fc .fc-daygrid-day { border-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .ev-fc .fc .fc-daygrid-day-number { color: var(--wc-text); }
html[data-bs-theme="dark"] .ev-fc .fc .fc-day-other .fc-daygrid-day-number { color: #475569; }
html[data-bs-theme="dark"] .ev-fc .fc .fc-day-sun .fc-daygrid-day-number,
html[data-bs-theme="dark"] .ev-fc .fc .fc-day-sat .fc-daygrid-day-number { color: var(--wc-muted); }

/* Dia de hoje */
html[data-bs-theme="dark"] .ev-fc .fc .fc-day-today {
  background: rgba(139,92,246,.12) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-day-today .fc-daygrid-day-number {
  color: #c4b5fd;
}

/* Bordas gerais (scrollgrid, td, th) */
html[data-bs-theme="dark"] .ev-fc .fc .fc-scrollgrid,
html[data-bs-theme="dark"] .ev-fc .fc td,
html[data-bs-theme="dark"] .ev-fc .fc th { border-color: var(--wc-border) !important; }

/* Botoes da toolbar do FC */
html[data-bs-theme="dark"] .ev-fc .fc .fc-button,
html[data-bs-theme="dark"] .ev-fc .fc .fc-button-primary {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-button:not(:disabled):hover,
html[data-bs-theme="dark"] .ev-fc .fc .fc-button-primary:not(:disabled):hover {
  background: var(--wc-surface-3) !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-button-primary:not(:disabled).fc-button-active,
html[data-bs-theme="dark"] .ev-fc .fc .fc-button-primary:not(:disabled):active {
  background: rgba(139,92,246,.25) !important;
  color: #c4b5fd !important;
  border-color: rgba(139,92,246,.4) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-today-button:disabled {
  background: var(--wc-surface) !important;
  color: var(--wc-muted) !important;
}

/* Popover de "+N mais" */
html[data-bs-theme="dark"] .ev-fc .fc .fc-popover {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  color: var(--wc-text);
  box-shadow: 0 12px 32px rgba(0,0,0,.45) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-popover-header {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-heading) !important;
  border-bottom: 1px solid var(--wc-border) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-daygrid-more-link { color: #c4b5fd; }
html[data-bs-theme="dark"] .ev-fc .fc .fc-daygrid-more-link:hover {
  background: rgba(139,92,246,.18) !important;
  color: #ddd6fe !important;
}

/* Lista (listMonth/listWeek) */
html[data-bs-theme="dark"] .ev-fc .fc .fc-list-day th,
html[data-bs-theme="dark"] .ev-fc .fc .fc-list-day-cushion {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-heading) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-list-event td {
  border-color: var(--wc-border-soft) !important;
  background: transparent !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-list-event:hover td {
  background: var(--wc-surface-2) !important;
}
html[data-bs-theme="dark"] .ev-fc .fc .fc-list-event-title a { color: var(--wc-text); }
html[data-bs-theme="dark"] .ev-fc .fc .fc-list-event-time { color: var(--wc-muted); }
html[data-bs-theme="dark"] .ev-fc .fc .fc-list-empty {
  background: var(--wc-surface) !important;
  color: var(--wc-muted) !important;
}

/* Popover customizado de detalhe (.ev-cal-popover) */
html[data-bs-theme="dark"] .ev-cal-popover {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  color: var(--wc-text) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.45) !important;
}
html[data-bs-theme="dark"] .ev-cal-popover-title { color: var(--wc-heading); }
html[data-bs-theme="dark"] .ev-cal-popover-row { color: var(--wc-text); }
html[data-bs-theme="dark"] .ev-cal-popover-row i { color: #c4b5fd; }
html[data-bs-theme="dark"] .ev-fc-legend { color: var(--wc-muted); }

/* ============================================================
   Eventos detalhe — barra de tabs, stat cards, panel boxes e dl
   (todos com glass branco hardcoded em eventos.css)
   ============================================================ */
html[data-bs-theme="dark"] .ev-tabs-bar {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html[data-bs-theme="dark"] .ev-tab { color: var(--wc-muted) !important; background: transparent !important; }
html[data-bs-theme="dark"] .ev-tab:hover { background: var(--wc-surface-2) !important; color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .ev-tab.active {
  background: rgba(139,92,246,.22) !important;
  color: #c4b5fd !important;
}

html[data-bs-theme="dark"] .ev-stat-card {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .ev-stat-label { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .ev-stat-value { color: var(--wc-heading) !important; }

html[data-bs-theme="dark"] .ev-panel-box {
  background: var(--wc-surface) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.28) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .ev-panel-box-header h3 { color: var(--wc-heading); }
html[data-bs-theme="dark"] .ev-panel-box-header h3 i { color: #c4b5fd; }

html[data-bs-theme="dark"] .ev-dl dt { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .ev-dl dd { color: var(--wc-text) !important; }

/* Tabela interna do resumo (.ev-table td/th estao fora destes wrappers) */
html[data-bs-theme="dark"] .ev-table td { background: var(--wc-surface-2) !important; color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .ev-table th { color: var(--wc-muted) !important; }

/* ============================================================
   Eventos detalhe — paineis/secoes/banners cinzentos
   ============================================================ */
html[data-bs-theme="dark"] .ev-banner,
html[data-bs-theme="dark"] .ev-banner-placeholder {
  background: var(--wc-surface-2) !important;
  color: var(--wc-muted) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .ev-section,
html[data-bs-theme="dark"] .ev-detail-section,
html[data-bs-theme="dark"] .ev-info-card,
html[data-bs-theme="dark"] .ev-meta-card,
html[data-bs-theme="dark"] .ev-inscricao-card,
html[data-bs-theme="dark"] .ev-participantes,
html[data-bs-theme="dark"] .ev-list-row,
html[data-bs-theme="dark"] .ev-empty {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .ev-list-row + .ev-list-row {
  border-top: 1px solid var(--wc-border-soft) !important;
}
html[data-bs-theme="dark"] .ev-list-row:hover {
  background: var(--wc-surface-2) !important;
}

/* Badges de status em dark (preservando hue) */
html[data-bs-theme="dark"] .ev-badge.rascunho,
html[data-bs-theme="dark"] .ev-status.rascunho {
  background: rgba(148,163,184,.18) !important; color: #cbd5e1 !important;
}
html[data-bs-theme="dark"] .ev-badge.encerrado,
html[data-bs-theme="dark"] .ev-status.encerrado,
html[data-bs-theme="dark"] .ev-status.lista_espera {
  background: rgba(245,158,11,.18) !important; color: #fcd34d !important;
}
html[data-bs-theme="dark"] .ev-badge.cancelado,
html[data-bs-theme="dark"] .ev-status.cancelado {
  background: rgba(239,68,68,.18) !important; color: #fca5a5 !important;
}
html[data-bs-theme="dark"] .ev-status.interessado {
  background: rgba(34,197,94,.18) !important; color: #86efac !important;
}

/* ============================================================
   SWEEP MESTRE — varredura final de classes que ainda usam
   bg branco/cinza claro ou texto preto hardcoded.
   Detectadas via grep em app/static/css/*.css (light theme).
   Agrupadas por modulo para facilitar manutencao.
   ============================================================ */

/* ── Eventos — cards/secoes adicionais ─────────────────────── */
html[data-bs-theme="dark"] .ev-banner-cat,
html[data-bs-theme="dark"] .ev-capa-preview,
html[data-bs-theme="dark"] .ev-cat-actions,
html[data-bs-theme="dark"] .ev-com-item,
html[data-bs-theme="dark"] .ev-convidado-card,
html[data-bs-theme="dark"] .ev-icon-option,
html[data-bs-theme="dark"] .ev-list-item,
html[data-bs-theme="dark"] .ev-mobile-tab-select,
html[data-bs-theme="dark"] .ev-prog-item,
html[data-bs-theme="dark"] .ev-sidebar,
html[data-bs-theme="dark"] .ev-ticket-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .ev-title,
html[data-bs-theme="dark"] .ev-card-title,
html[data-bs-theme="dark"] .ev-card-cat,
html[data-bs-theme="dark"] .ev-prog-title,
html[data-bs-theme="dark"] .ev-com-assunto,
html[data-bs-theme="dark"] .ev-convidado-name,
html[data-bs-theme="dark"] .ev-list-item-name,
html[data-bs-theme="dark"] .ev-ticket-card-name,
html[data-bs-theme="dark"] .ev-ticket-card-price,
html[data-bs-theme="dark"] .ev-stat-value { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .ev-card-meta,
html[data-bs-theme="dark"] .ev-prog-time,
html[data-bs-theme="dark"] .ev-com-tipo,
html[data-bs-theme="dark"] .ev-filter,
html[data-bs-theme="dark"] .ev-cat-add-btn,
html[data-bs-theme="dark"] .ev-cat-btn,
html[data-bs-theme="dark"] .ev-card-capa-placeholder,
html[data-bs-theme="dark"] .ev-convidado-foto-placeholder { color: var(--wc-muted) !important; }

/* ── Financeiro — cards/elementos adicionais ───────────────── */
html[data-bs-theme="dark"] .finance-alerta-card,
html[data-bs-theme="dark"] .finance-mobile-metric-list,
html[data-bs-theme="dark"] .finance-mobile-tab-select {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .finance-card-icon,
html[data-bs-theme="dark"] .finance-metric-icon,
html[data-bs-theme="dark"] .finance-config-card-header,
html[data-bs-theme="dark"] .finance-config-card-info,
html[data-bs-theme="dark"] .finance-section-heading,
html[data-bs-theme="dark"] .finance-periodo-label { color: var(--wc-text); }
html[data-bs-theme="dark"] .finance-section-heading h2 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .finance-pagination {
  background: transparent !important;
  color: var(--wc-text);
}
html[data-bs-theme="dark"] .finance-pagination .page-link {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .finance-pagination .page-item.active .page-link {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

/* ── Grupos de Conexao — extras ────────────────────────────── */
html[data-bs-theme="dark"] .gc-lider-option-hint,
html[data-bs-theme="dark"] .gc-sup-dropdown {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .gc-card-mobile-title { color: var(--wc-heading) !important; }

/* ── Escalas/Cultos — extras ───────────────────────────────── */
html[data-bs-theme="dark"] .ec-equipe-inativa,
html[data-bs-theme="dark"] .ec-info-card {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .ec-info-value,
html[data-bs-theme="dark"] .ec-mobile-card-title,
html[data-bs-theme="dark"] .ec-sugestao-item-nome,
html[data-bs-theme="dark"] .ec-metric-value,
html[data-bs-theme="dark"] .ec-metrics-heading h2 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .ec-mobile-card-icon-purple,
html[data-bs-theme="dark"] .ec-action-team,
html[data-bs-theme="dark"] .ec-filter-grid label,
html[data-bs-theme="dark"] .ec-info-banner,
html[data-bs-theme="dark"] .ec-empty { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .ec-metric-bar-row { color: var(--wc-text) !important; }

/* ── Dashboard.css — classes genericas ─────────────────────── */
html[data-bs-theme="dark"] .filtro,
html[data-bs-theme="dark"] .filtros-dashboard,
html[data-bs-theme="dark"] .dashboard-layout .card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}

/* ── Auditoria — extras ────────────────────────────────────── */
html[data-bs-theme="dark"] .audit-mobile-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .audit-mobile-card-action,
html[data-bs-theme="dark"] .audit-empty-title,
html[data-bs-theme="dark"] .audit-feed-action,
html[data-bs-theme="dark"] .audit-meta { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .audit-pagination .page-link {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}

/* ── Ensino — extras ───────────────────────────────────────── */
html[data-bs-theme="dark"] .ensino-avaliacao-title,
html[data-bs-theme="dark"] .ensino-curso-nome,
html[data-bs-theme="dark"] .ensino-m-card-title,
html[data-bs-theme="dark"] .ensino-avaliacoes-head { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .ensino-avaliacao-meta,
html[data-bs-theme="dark"] .ensino-avaliacao-icon { color: var(--wc-muted) !important; }

/* ── Mobile (app-mobile-*) ─────────────────────────────────── */
html[data-bs-theme="dark"] .app-mobile-kpi-number,
html[data-bs-theme="dark"] .app-mobile-title { color: var(--wc-heading) !important; }

/* ── Atendimentos — extras ─────────────────────────────────── */
html[data-bs-theme="dark"] .atd-slot-btn {
  background: var(--wc-surface-2) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .atd-slot-btn:hover {
  background: var(--wc-surface-3) !important;
  color: #fff !important;
}

/* ── Botoes action genericos com cor escura ────────────────── */
html[data-bs-theme="dark"] .btn-act-edit,
html[data-bs-theme="dark"] .btn-act-warning { color: var(--wc-heading); }

/* ============================================================
   SAFETY NETS — atributos inline e padroes comuns
   Capturam casos hardcoded em <style="..."> ou classes raras.
   ============================================================ */

/* Inline styles com bg branco/cinza claro */
html[data-bs-theme="dark"] [style*="background: #fff"][style*="border"],
html[data-bs-theme="dark"] [style*="background:#fff "],
html[data-bs-theme="dark"] [style*="background-color:#fff"],
html[data-bs-theme="dark"] [style*="background-color: #fff"] {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] [style*="background:#fefefe"],
html[data-bs-theme="dark"] [style*="background: #fefefe"],
html[data-bs-theme="dark"] [style*="background:#fafafa"],
html[data-bs-theme="dark"] [style*="background: #fafafa"],
html[data-bs-theme="dark"] [style*="background:#fcfcfc"],
html[data-bs-theme="dark"] [style*="background: #fcfcfc"] {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-text) !important;
}

/* Inline styles com cor de texto escura ilegivel */
html[data-bs-theme="dark"] [style*="color:#0f172a"],
html[data-bs-theme="dark"] [style*="color: #0f172a"],
html[data-bs-theme="dark"] [style*="color:#111827"],
html[data-bs-theme="dark"] [style*="color: #111827"],
html[data-bs-theme="dark"] [style*="color:#1e293b"],
html[data-bs-theme="dark"] [style*="color: #1e293b"],
html[data-bs-theme="dark"] [style*="color:#1f2937"],
html[data-bs-theme="dark"] [style*="color: #1f2937"],
html[data-bs-theme="dark"] [style*="color:#374151"],
html[data-bs-theme="dark"] [style*="color: #374151"] {
  color: var(--wc-text) !important;
}

/* Bordas claras (hardcoded em inline) */
html[data-bs-theme="dark"] [style*="border:1px solid #e"],
html[data-bs-theme="dark"] [style*="border: 1px solid #e"],
html[data-bs-theme="dark"] [style*="border:1px solid #f"],
html[data-bs-theme="dark"] [style*="border: 1px solid #f"],
html[data-bs-theme="dark"] [style*="border:1px solid #d"],
html[data-bs-theme="dark"] [style*="border: 1px solid #d"] {
  border-color: var(--wc-border) !important;
}

/* Bootstrap alert variants pastel (sem cobertura em modulos especificos) */
html[data-bs-theme="dark"] .alert-light {
  background: var(--wc-bg-soft) !important;
  color: var(--wc-text) !important;
  border-color: var(--wc-border) !important;
}

/* text-* utilities que viram ilegiveis no dark */
html[data-bs-theme="dark"] .text-body { color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .text-black,
html[data-bs-theme="dark"] .text-black-50 { color: var(--wc-text) !important; }

/* Genericos .empty / .vazio / .no-data */
html[data-bs-theme="dark"] .empty,
html[data-bs-theme="dark"] .vazio,
html[data-bs-theme="dark"] .no-data,
html[data-bs-theme="dark"] .sem-dados {
  color: var(--wc-muted) !important;
}

/* Cards genericos que possam aparecer em qualquer modulo */
html[data-bs-theme="dark"] .info-card,
html[data-bs-theme="dark"] .stats-card,
html[data-bs-theme="dark"] .summary-card,
html[data-bs-theme="dark"] .detail-card,
html[data-bs-theme="dark"] .stat-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}

/* Form inputs/selects/textareas genericos sem classe form-control */
html[data-bs-theme="dark"] input[type="text"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] input[type="email"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] input[type="number"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] input[type="tel"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] input[type="search"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] input[type="date"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] input[type="time"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] input[type="datetime-local"]:not(.form-control):not(.swal2-input),
html[data-bs-theme="dark"] textarea:not(.form-control):not(.swal2-textarea),
html[data-bs-theme="dark"] select:not(.form-select):not(.swal2-select) {
  background-color: var(--wc-bg-soft);
  border-color: var(--wc-border);
  color: var(--wc-text);
}

/* Garante que titulos genericos h1-h6 sem classe especifica sejam visiveis */
html[data-bs-theme="dark"] :where(h1, h2, h3, h4, h5, h6):not([class*="color"]):not([style*="color"]):not(.text-success):not(.text-danger):not(.text-warning):not(.text-info):not(.text-primary):not(.text-white) {
  color: var(--wc-heading);
}

/* Strong/b sem cor especifica - garante legibilidade */
html[data-bs-theme="dark"] :is(strong, b):not([class*="color"]):not([style*="color"]):not(.text-success):not(.text-danger):not(.text-warning):not(.text-info):not(.text-primary):not(.text-white):not(.text-muted) {
  color: inherit;
}

/* ============================================================
   /login — pagina de autenticacao com painel direito branco
   hardcoded em <style> inline no template login.html
   ============================================================ */
html[data-bs-theme="dark"] .auth-right {
  background: var(--wc-bg) !important;
}
html[data-bs-theme="dark"] .auth-form-header h2 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .auth-form-header p { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .auth-form-wrap .form-floating > .form-control {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .auth-form-wrap .form-floating > .form-control:focus {
  background: var(--wc-surface) !important;
  color: var(--wc-heading) !important;
}
html[data-bs-theme="dark"] .auth-form-wrap .form-floating > label { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .auth-form-wrap .form-floating > .form-control:not(:placeholder-shown) ~ label,
html[data-bs-theme="dark"] .auth-form-wrap .form-floating > .form-control:focus ~ label {
  color: #c4b5fd !important;
}
html[data-bs-theme="dark"] .btn-show-pass { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .btn-show-pass:hover { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .link-recover { color: #93c5fd !important; }
html[data-bs-theme="dark"] .link-recover:hover { color: #bfdbfe !important; }
html[data-bs-theme="dark"] .auth-form-wrap .alert.alert-success {
  background: rgba(34,197,94,.12) !important;
  color: #86efac !important;
  border-color: rgba(34,197,94,.32) !important;
}
html[data-bs-theme="dark"] .auth-form-wrap .alert.alert-danger {
  background: rgba(239,68,68,.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,.32) !important;
}
html[data-bs-theme="dark"] .auth-form-wrap .alert.alert-warning {
  background: rgba(245,158,11,.12) !important;
  color: #fcd34d !important;
  border-color: rgba(245,158,11,.32) !important;
}
html[data-bs-theme="dark"] .auth-form-wrap .alert.alert-info {
  background: rgba(14,165,233,.12) !important;
  color: #7dd3fc !important;
  border-color: rgba(14,165,233,.32) !important;
}

/* /esqueci-senha e /redefinir-senha usam mesmo padrao .auth-* */
html[data-bs-theme="dark"] .auth-form-wrap .form-text { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .auth-form-wrap small { color: var(--wc-muted) !important; }

/* ============================================================
   PATCH DE ACABAMENTO — dark mode fine-tuning
   Objetivo: eliminar "faixas/sobras" em toasts e cabecalhos de
   tabela tipo card (.card-membros .table tem border-spacing 0 12px,
   entao cada thead th vira um quadrado escuro isolado).
   ============================================================ */

/* --- SweetAlert2: garantir que o container fullscreen NAO tenha
   background quando estiver em modo toast. O .swal2-container eh
   position:fixed inset:0 e qualquer background nele "pega a tela
   inteira". Apenas o backdrop de modais regulares pode escurecer. */
html[data-bs-theme="dark"] .swal2-container.swal2-toast-shown,
html[data-bs-theme="dark"] .swal2-container.swal2-top,
html[data-bs-theme="dark"] .swal2-container.swal2-top-start,
html[data-bs-theme="dark"] .swal2-container.swal2-top-end,
html[data-bs-theme="dark"] .swal2-container.swal2-bottom,
html[data-bs-theme="dark"] .swal2-container.swal2-bottom-start,
html[data-bs-theme="dark"] .swal2-container.swal2-bottom-end {
  background: transparent !important;
}
html[data-bs-theme="dark"] .swal2-container.swal2-toast-shown.swal2-backdrop-show {
  background: transparent !important;
}

/* --- Bootstrap toast-container deve ser sempre transparente
   (e sem borda/sombra). Apenas o .toast interno tem visual. */
html[data-bs-theme="dark"] .toast-container {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html[data-bs-theme="dark"] .toast {
  background-color: var(--wc-surface) !important;
  color: var(--wc-text) !important;
  border: 1px solid var(--wc-border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.45) !important;
}
html[data-bs-theme="dark"] .toast-header {
  background-color: var(--wc-bg-soft) !important;
  color: var(--wc-heading) !important;
  border-bottom: 1px solid var(--wc-border) !important;
}
html[data-bs-theme="dark"] .toast-body {
  background-color: transparent !important;
  color: var(--wc-text) !important;
}

/* --- Bootstrap .alert: garantir que seja apenas o componente,
   sem position fixed/inset herdado de algum modulo. */
html[data-bs-theme="dark"] .alert {
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
}

/* --- Tabelas card-style (.card-membros .table com border-spacing).
   O override generico de .table thead th pinta cada celula com
   bg-soft, e como o border-spacing separa as celulas, cada uma
   aparece como um quadrado escuro isolado (a "faixa quadrada"
   reportada). Para esses casos, thead transparente. */
html[data-bs-theme="dark"] .card-membros .table thead th,
html[data-bs-theme="dark"] .card-membros .table thead td {
  background-color: transparent !important;
  color: var(--wc-muted) !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}
/* O mesmo padrao card-style aparece em outras paginas que reusam
   o membros.css. Detectamos pelo seletor #paginacao irmao. */
html[data-bs-theme="dark"] .table[style*="border-spacing"] thead th,
html[data-bs-theme="dark"] table.table thead tr {
  background-color: transparent !important;
}

/* --- Linhas tipo card (tbody tr com bg-surface) ja estao OK,
   mas reforco do tr para nao herdar bg-soft do thead override. */
html[data-bs-theme="dark"] .card-membros .table tbody tr > * {
  background-color: transparent !important;
}

/* --- /perfil: tela tem alguns blocos com bg branco hardcoded
   no inline style. O safety net generico cobre, mas reforco
   para garantir contraste em headers internos. */
html[data-bs-theme="dark"] .perfil-info-card,
html[data-bs-theme="dark"] .perfil-stats,
html[data-bs-theme="dark"] .perfil-section {
  background-color: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}

/* --- /super-admin/pagamentos e /financeiro: garantir que
   .table-responsive wrapper nao crie outro bg sobre as linhas. */
html[data-bs-theme="dark"] .table-responsive {
  background-color: transparent !important;
}

/* --- Modal Bootstrap "vazio" (sem alert-light/etc) deve manter
   bg da surface, nao bg branco herdado. Reforco geral. */
html[data-bs-theme="dark"] .modal-body {
  background-color: var(--wc-surface);
  color: var(--wc-text);
}

/* ============================================================
   PATCH ORGANOGRAMA / GRUPOS DE CONEXAO — icones e chips
   Bug: as regras dark mode aplicam color:var(--wc-text)!important
   no container do card, e !important ganha de seletor descendente
   sem !important. Resultado: todos os icones .gc-metric-icon e
   afins ficam cinza, perdendo a hue semantica. Reafirmamos as
   cores aqui com !important e preto/branco onde necessario.
   ============================================================ */

/* Icones de metricas (cards de KPI no /grupos-conexao) */
html[data-bs-theme="dark"] .gc-card-azul .gc-metric-icon,
html[data-bs-theme="dark"] .gc-card-indigo .gc-metric-icon { color: #93c5fd !important; background: rgba(59,130,246,.18) !important; }
html[data-bs-theme="dark"] .gc-card-verde .gc-metric-icon,
html[data-bs-theme="dark"] .gc-card-sucesso .gc-metric-icon { color: #86efac !important; background: rgba(34,197,94,.18) !important; }
html[data-bs-theme="dark"] .gc-card-teal .gc-metric-icon  { color: #5eead4 !important; background: rgba(20,184,166,.18) !important; }
html[data-bs-theme="dark"] .gc-card-aviso .gc-metric-icon  { color: #fcd34d !important; background: rgba(245,158,11,.18) !important; }
html[data-bs-theme="dark"] .gc-card-perigo .gc-metric-icon,
html[data-bs-theme="dark"] .gc-card-vermelho .gc-metric-icon { color: #fca5a5 !important; background: rgba(239,68,68,.18) !important; }
html[data-bs-theme="dark"] .gc-card-laranja .gc-metric-icon { color: #fdba74 !important; background: rgba(249,115,22,.18) !important; }

/* gc-grupo-icon (categoria do grupo: casais/jovens/criancas/...) */
html[data-bs-theme="dark"] .gc-grupo-icon { color: #c4b5fd !important; background: rgba(139,92,246,.18) !important; }
html[data-bs-theme="dark"] .gc-grupo-icon.gc-cat-casais   { color: #f9a8d4 !important; background: rgba(219,39,119,.18) !important; }
html[data-bs-theme="dark"] .gc-grupo-icon.gc-cat-jovens   { color: #93c5fd !important; background: rgba(37,99,235,.18) !important; }
html[data-bs-theme="dark"] .gc-grupo-icon.gc-cat-criancas { color: #86efac !important; background: rgba(22,163,74,.18) !important; }
html[data-bs-theme="dark"] .gc-grupo-icon.gc-cat-homens   { color: #7dd3fc !important; background: rgba(2,132,199,.18) !important; }
html[data-bs-theme="dark"] .gc-grupo-icon.gc-cat-mulheres { color: #fda4af !important; background: rgba(225,29,72,.18) !important; }

/* Organograma — avatares, nomes, badges, chips, leader card */
html[data-bs-theme="dark"] .gc-org-avatar {
  background: rgba(96,165,250,.22) !important;
  color: #bfdbfe !important;
}
html[data-bs-theme="dark"] .gc-org-sup-label,
html[data-bs-theme="dark"] .gc-org-leader-count,
html[data-bs-theme="dark"] .gc-org-leader-empty,
html[data-bs-theme="dark"] .gc-org-group-stats,
html[data-bs-theme="dark"] .gc-org-network-stats { color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .gc-org-sup-name,
html[data-bs-theme="dark"] .gc-org-leader-name,
html[data-bs-theme="dark"] .gc-org-network-card h6,
html[data-bs-theme="dark"] .gc-org-group-card h6 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .gc-org-leader-card {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .gc-org-leader-badge {
  background: rgba(96,165,250,.22) !important;
  color: #bfdbfe !important;
}
html[data-bs-theme="dark"] .gc-org-group-alert {
  background: rgba(245,158,11,.16) !important;
  border-color: rgba(245,158,11,.36) !important;
  color: #fcd34d !important;
}
html[data-bs-theme="dark"] .gc-org-warning-title { color: #fcd34d !important; }
html[data-bs-theme="dark"] .gc-org-warning-desc  { color: #fde68a !important; }
html[data-bs-theme="dark"] .gc-org-vline,
html[data-bs-theme="dark"] .gc-org-hline { background-color: var(--wc-border) !important; }

/* gc-org-group-card h6 i (icone colorido do tipo de grupo) NAO deve
   herdar var(--wc-text). Como o h6 ja recebe var(--wc-heading), o i
   herda heading tambem — mantemos roxo violeta consistente. */
html[data-bs-theme="dark"] .gc-org-group-card h6 i { color: #c4b5fd !important; }

/* Reforco: ic-stat-icon ja coberto. Aqui garantimos que .gc-metric-card
   nao force cor cinza no proprio .gc-metric-icon (que tem hue). */
html[data-bs-theme="dark"] .gc-metric-card .gc-metric-icon { /* sem cor, deixa hue subir */ }

/* ============================================================
   PATCH /financeiro — modal "Nova entrada/Nova saida"
   financeiro.css define #modalFinanceiro .modal-body com bg
   #f8fafc e #modalFinanceiro .app-form-grid com bg #fff, alem
   de fin-section-header/fin-section-divider com cinza fixo.
   No dark isso fica como faixa cinza clara dentro do modal escuro.
   ============================================================ */
html[data-bs-theme="dark"] #modalFinanceiro .modal-body {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] #modalFinanceiro .app-form-grid {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] #modalFinanceiro .fin-section-header,
html[data-bs-theme="dark"] #modalFinanceiro .fin-section-header i { color: #c4b5fd !important; }
html[data-bs-theme="dark"] #modalFinanceiro .fin-section-divider {
  border-top-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] #modalFinanceiro .finance-subtitle { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] #modalFinanceiro .mc-form-label { color: var(--wc-text) !important; }
html[data-bs-theme="dark"] #modalFinanceiro .mc-form-label i { background: transparent !important; }

/* Cobertura para outros modais que reusam .app-form-grid (membros,
   atendimentos, ensino, grupos): se algum CSS de modulo aplicar bg
   branco no .app-form-grid, sobrescrevemos genericamente. */
html[data-bs-theme="dark"] .modal-body .app-form-grid,
html[data-bs-theme="dark"] .app-modal-body .app-form-grid {
  background: transparent !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}

/* fin-section-header generico fora do #modalFinanceiro tambem deve
   ficar com tom roxo legivel, nao cinza. */
html[data-bs-theme="dark"] .fin-section-header,
html[data-bs-theme="dark"] .fin-section-header i { color: #c4b5fd !important; }

/* ============================================================
   MyKids — padronizacao do dark com o resto do app.
   kids.css define uma paleta slate propria (rgba(30,41,59,...))
   que destoa do --wc-surface usado em /membros e demais modulos.
   Aqui forcamos os mesmos tokens globais para que /kids fique
   visualmente igual a /membros no escuro. Carregado por ultimo,
   com seletor html[...] (especificidade > kids.css), entao vence.
   ============================================================ */

/* Superficies principais (cards/paineis/modulo) -> --wc-surface */
html[data-bs-theme="dark"] .kids-module,
html[data-bs-theme="dark"] .kids-metric-card,
html[data-bs-theme="dark"] .kids-panel,
html[data-bs-theme="dark"] .kids-form-page .kids-form-card,
html[data-bs-theme="dark"] .kids-children-page .kids-child-card,
html[data-bs-theme="dark"] .kids-equipe-page .kids-equipe-section {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .32) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Secao "Restricoes" mantem a sinalizacao ambar, mas sobre o token */
html[data-bs-theme="dark"] .kids-form-page .kids-form-card--restrito {
  background: linear-gradient(180deg, rgba(120, 53, 15, .22), var(--wc-surface)) !important;
  border-color: rgba(245, 158, 11, .35) !important;
}

/* Superficies secundarias / aninhadas -> --wc-surface-2 */
html[data-bs-theme="dark"] .kids-fieldset,
html[data-bs-theme="dark"] .kids-result-card,
html[data-bs-theme="dark"] .kids-form-page .kids-member-preview,
html[data-bs-theme="dark"] .kids-form-page .kids-guardian-list .list-group-item,
html[data-bs-theme="dark"] .kids-classroom-form-page .kids-age-block,
html[data-bs-theme="dark"] .kids-equipe-page .kids-equipe-turma {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
}

/* Areas "afundadas": dropzones de foto, placeholders, inputs e selects.
   Mesmo fundo dos .form-control globais (--wc-bg-soft). */
html[data-bs-theme="dark"] .kids-form-page .kids-photo-drop,
html[data-bs-theme="dark"] .kids-form-page .kids-guardian-placeholder,
html[data-bs-theme="dark"] .kids-classroom-form-page .kids-classroom-photo-area,
html[data-bs-theme="dark"] .kids-form-page .choices__inner,
html[data-bs-theme="dark"] .kids-children-page .form-select,
html[data-bs-theme="dark"] .kids-children-page input[type="text"] {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
}

/* Paginacao do MyKids no mesmo tom dos demais modulos */
html[data-bs-theme="dark"] .kids-children-page .pagination .page-link,
html[data-bs-theme="dark"] .kids-checkin-page .pagination .page-link,
html[data-bs-theme="dark"] .kids-checkout-page .pagination .page-link,
html[data-bs-theme="dark"] .kids-home-page .pagination .page-link,
html[data-bs-theme="dark"] .kids-pais-page .pagination .page-link {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-link) !important;
}

/* Rodape sticky dos formularios (fade) sobre o fundo da pagina */
html[data-bs-theme="dark"] .kids-form-page .kids-form-actions,
html[data-bs-theme="dark"] .kids-classroom-form-page .kids-form-actions {
  background: linear-gradient(180deg, rgba(11, 18, 32, 0), var(--wc-bg) 35%) !important;
  border-color: var(--wc-border) !important;
}

/* Check-in / Check-out: painel de filtro, contadores e avatares que
   ficaram claros (cinza) no dark por nao terem regra escura. */
html[data-bs-theme="dark"] .kids-checkin-page .kids-checkin-filter-grid {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .kids-checkin-page .kids-checkin-open-count {
  background: color-mix(in srgb, var(--brand-primary) 18%, transparent) !important;
  color: #c4b5fd !important;
}
html[data-bs-theme="dark"] .kids-checkout-page .kids-checkout-pending-count {
  background: rgba(16, 185, 129, .18) !important;
  color: #86efac !important;
}
html[data-bs-theme="dark"] .kids-checkin-page .kids-checkin-open-avatar {
  background: rgba(99, 102, 241, .22) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .kids-checkin-page .kids-checkin-open-avatar--initials { color: #c7d2fe !important; }
html[data-bs-theme="dark"] .kids-checkout-page .kids-checkout-pending-avatar {
  background: rgba(16, 185, 129, .18) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .kids-checkout-page .kids-checkout-pending-avatar--initials { color: #86efac !important; }

/* ============================================================
   Menu mobile fullscreen (central de modulos) — os itens sao
   CARDS, nao linhas. A regra generica .mobile-drawer-item dark
   (acima) zera o fundo com !important e quebra o visual de card.
   Aqui restauramos o card no escuro com os MESMOS tokens globais
   (--wc-surface), deixando o menu mobile igual ao resto do app.
   ============================================================ */
@media (max-width: 767px) {
  html[data-bs-theme="dark"] .mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item {
    background-color: var(--wc-surface) !important;
    border: 1px solid var(--wc-border) !important;
    color: var(--wc-text) !important;
  }
  html[data-bs-theme="dark"] .mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item i {
    background: var(--wc-surface-2) !important;
    color: var(--wc-text) !important;
  }
  html[data-bs-theme="dark"] .mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item.is-active {
    background-color: var(--wc-hover) !important;
    border-color: var(--wc-primary) !important;
    color: #fff !important;
  }
  html[data-bs-theme="dark"] .mobile-drawer--fullscreen .mobile-drawer-section > a.mobile-drawer-item.is-active i {
    background: var(--wc-primary) !important;
    color: #fff !important;
  }
}

/* ============================================================
   SWEEP DARK — superficies, placeholders e tiles de icone que
   ficavam claros/cinza no dark por estarem definidos em CSS de
   modulo ou em <style>/inline de template sem override escuro.
   theme.css carrega por ultimo, entao !important vence inclusive
   o style inline (sem !important) dos templates.
   NAO mexe em badges semanticos de status (mantidos claros, como
   na referencia /membros) nem em mockups da landing/design-system.
   ============================================================ */

/* Avatares de iniciais cinza (#6c757d) -> slate */
html[data-bs-theme="dark"] .avatar-initials,
html[data-bs-theme="dark"] .avatar-initials-aniv,
html[data-bs-theme="dark"] .avatar-initials-user {
  background: #334155 !important;
  color: #e2e8f0 !important;
}

/* Placeholders de foto (#e9ecef) -> superficie escura */
html[data-bs-theme="dark"] .equipe-foto-placeholder,
html[data-bs-theme="dark"] .gc-grupo-foto-placeholder,
html[data-bs-theme="dark"] .gc-rede-foto-placeholder,
html[data-bs-theme="dark"] .ev-convidado-foto-placeholder {
  background: var(--wc-surface-2) !important;
  color: var(--wc-muted) !important;
}

/* Avatar fallback do MyKids (membro) — #e0e7ff + texto indigo */
html[data-bs-theme="dark"] .kids-member-avatar-fallback,
html[data-bs-theme="dark"] .kids-form-page .kids-member-preview__avatar,
html[data-bs-theme="dark"] .kids-form-page .kids-member-preview__avatar--initials {
  background: rgba(99, 102, 241, .22) !important;
  color: #c7d2fe !important;
}

/* Superficies claras (#f8fafc/#f9fafb/#e2e8f0) -> escuras */
html[data-bs-theme="dark"] .notif-empty,
html[data-bs-theme="dark"] .ev-icon-picker {
  background: var(--wc-bg-soft) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .upload-preview {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .mm-org-vline-sm { background-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .kids-classrooms-page .kids-classroom-progress { background: var(--wc-surface-2) !important; }
html[data-bs-theme="dark"] .ds-code { background: var(--wc-surface-2) !important; color: var(--wc-text) !important; }

/* Paginacao Bootstrap default ainda clara em algumas telas */
html[data-bs-theme="dark"] .page-link {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .page-item.active .page-link {
  background: var(--wc-primary) !important;
  border-color: var(--wc-primary) !important;
  color: #fff !important;
}
html[data-bs-theme="dark"] .page-item.disabled .page-link { color: var(--wc-muted) !important; }

/* perm-badge (super-admin/perfis) — legenda Concedida/Negada ficava branca */
html[data-bs-theme="dark"] .perm-badge { background: var(--wc-surface-2) !important; }
html[data-bs-theme="dark"] .perm-badge.bg-success { background: rgba(34, 197, 94, .20) !important; color: #86efac !important; }
html[data-bs-theme="dark"] .perm-badge.bg-danger { background: rgba(239, 68, 68, .20) !important; color: #fca5a5 !important; }

/* Counters/chips neutros claros -> accent/slate escuro */
html[data-bs-theme="dark"] .group-count { background: color-mix(in srgb, var(--brand-primary) 18%, transparent) !important; color: #c4b5fd !important; }
html[data-bs-theme="dark"] .inv-pending-badge { background: var(--wc-surface-2) !important; color: var(--wc-muted) !important; }
html[data-bs-theme="dark"] .gc-sup-chip {
  background: rgba(139, 92, 246, .18) !important;
  border-color: rgba(139, 92, 246, .35) !important;
  color: #ddd6fe !important;
}

/* Pills de canal (notificacoes/admin) — fundo claro -> tint */
html[data-bs-theme="dark"] .notif-channel-pill.notif-channel-push { background: rgba(59, 130, 246, .16) !important; color: #93c5fd !important; }
html[data-bs-theme="dark"] .notif-channel-pill.notif-channel-whatsapp { background: rgba(34, 197, 94, .16) !important; color: #86efac !important; }
html[data-bs-theme="dark"] .notif-channel-pill.notif-channel-disabled { background: rgba(148, 163, 184, .14) !important; color: var(--wc-muted) !important; }

/* Tiles de icone com PASTEL SOLIDO (sem override dark) -> tint por
   matiz + icone clarinho, no mesmo estilo dos .gc-metric-icon dark. */
/* mapa-membresia */
html[data-bs-theme="dark"] .mm-icon-phone      { background: rgba(34, 197, 94, .16) !important;  color: #86efac !important; }
html[data-bs-theme="dark"] .mm-icon-email      { background: rgba(59, 130, 246, .16) !important; color: #93c5fd !important; }
html[data-bs-theme="dark"] .mm-icon-familia    { background: rgba(236, 72, 153, .16) !important; color: #f9a8d4 !important; }
html[data-bs-theme="dark"] .mm-icon-cargo      { background: rgba(139, 92, 246, .16) !important; color: #c4b5fd !important; }
html[data-bs-theme="dark"] .mm-icon-ministerio { background: rgba(245, 158, 11, .16) !important; color: #fcd34d !important; }
html[data-bs-theme="dark"] .mm-icon-nascimento { background: rgba(6, 182, 212, .16) !important;  color: #67e8f9 !important; }
html[data-bs-theme="dark"] .mm-icon-civil      { background: rgba(244, 63, 94, .16) !important;  color: #fca5a5 !important; }
html[data-bs-theme="dark"] .mm-icon-endereco   { background: rgba(249, 115, 22, .16) !important; color: #fdba74 !important; }
html[data-bs-theme="dark"] .mm-icon-parentesco { background: rgba(217, 70, 239, .16) !important; color: #f0abfc !important; }
/* auditoria */
html[data-bs-theme="dark"] .audit-card-critical .audit-card-icon { background: rgba(239, 68, 68, .16) !important;  color: #fca5a5 !important; }
html[data-bs-theme="dark"] .audit-card-denied .audit-card-icon   { background: rgba(249, 115, 22, .16) !important; color: #fdba74 !important; }
html[data-bs-theme="dark"] .audit-card-login .audit-card-icon    { background: rgba(234, 179, 8, .16) !important;  color: #fde047 !important; }
html[data-bs-theme="dark"] .audit-card-global .audit-card-icon   { background: rgba(59, 130, 246, .16) !important; color: #93c5fd !important; }
html[data-bs-theme="dark"] .audit-card-notif .audit-card-icon    { background: rgba(139, 92, 246, .16) !important; color: #c4b5fd !important; }
/* super-admin/testes */
html[data-bs-theme="dark"] .test-module-icon.auth       { background: rgba(59, 130, 246, .16) !important; color: #93c5fd !important; }
html[data-bs-theme="dark"] .test-module-icon.membros    { background: rgba(34, 197, 94, .16) !important;  color: #86efac !important; }
html[data-bs-theme="dark"] .test-module-icon.celulas    { background: rgba(20, 184, 166, .16) !important; color: #5eead4 !important; }
html[data-bs-theme="dark"] .test-module-icon.financeiro { background: rgba(245, 158, 11, .16) !important; color: #fcd34d !important; }
html[data-bs-theme="dark"] .test-module-icon.eventos    { background: rgba(139, 92, 246, .16) !important; color: #c4b5fd !important; }
html[data-bs-theme="dark"] .test-module-icon.escalas    { background: rgba(236, 72, 153, .16) !important; color: #f9a8d4 !important; }
/* admin (title icon) */
html[data-bs-theme="dark"] .admin-title-icon { background: rgba(132, 204, 22, .16) !important; color: #bef264 !important; }

/* Notificacoes/admin — cards e dropdown de lookup ficavam brancos
   (so apareciam ao abrir a aba/busca, por isso escaparam ao 1o sweep). */
html[data-bs-theme="dark"] .notif-campaign-card {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .notif-campaign-card h3,
html[data-bs-theme="dark"] .notif-campaign-card h4,
html[data-bs-theme="dark"] .notif-campaign-card-header h4 { color: var(--wc-heading) !important; }
html[data-bs-theme="dark"] .notif-lookup-option {
  background: var(--wc-surface) !important;
  color: var(--wc-text) !important;
}
html[data-bs-theme="dark"] .notif-lookup-option:hover,
html[data-bs-theme="dark"] .notif-lookup-option:focus { background: var(--wc-surface-2) !important; }
html[data-bs-theme="dark"] .notif-lookup-avatar { background: rgba(59, 130, 246, .18) !important; color: #93c5fd !important; }

/* Grupos — detalhe do relatorio de presenca (lista/headers/acoes brancos
   com texto escuro). So aparece na pagina de detalhe <id>. */
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-relatorio-actions {
  background: var(--wc-surface) !important;
  border-color: var(--wc-border) !important;
}
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-lista { background: var(--wc-surface) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-secao { border-bottom-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-secao-header { background: var(--wc-bg-soft) !important; color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-participantes .gc-presenca-secao-header { background: rgba(59, 130, 246, .14) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-visitantes .gc-presenca-secao-header { background: rgba(249, 115, 22, .14) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-item { border-bottom-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-item:hover { background: var(--wc-surface-2) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-item-label,
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-item label { color: var(--wc-text) !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-presenca-empty { background: transparent !important; }
html[data-bs-theme="dark"] .gc-relatorio-detalhe .gc-relatorio-readonly p {
  background: var(--wc-surface-2) !important;
  border-color: var(--wc-border) !important;
  color: var(--wc-text) !important;
}

/* Botoes/badges secundarios — cinza Bootstrap (#6c757d) fora da paleta
   slate. Re-tematiza SO no dark via variaveis --bs-btn-* (hover/active/
   disabled herdam sozinhos). Outline-secondary fica como esta (sem fill). */
html[data-bs-theme="dark"] .btn-secondary {
  --bs-btn-color: #e2e8f0;
  --bs-btn-bg: #334155;
  --bs-btn-border-color: #475569;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #3f4d63;
  --bs-btn-hover-border-color: #56657c;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #56657c;
  --bs-btn-active-border-color: #56657c;
  --bs-btn-disabled-color: #cbd5e1;
  --bs-btn-disabled-bg: #334155;
  --bs-btn-disabled-border-color: #475569;
}
html[data-bs-theme="dark"] .badge.bg-secondary,
html[data-bs-theme="dark"] .badge.text-bg-secondary {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* Design System (super-admin) — chrome da PROPRIA pagina ficava branco/cinza.
   Os mockups de device sao preview fiel: .ds-mini-browser mostra o app WEB
   (dark) -> escurece; os .app-mobile-* mostram o app MOBILE (claro) -> ficam. */
html[data-bs-theme="dark"] .ds-tab-panel { background: var(--wc-surface) !important; border-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .ds-shell-preview { background: var(--wc-bg-soft) !important; border-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .ds-mini-browser { background: var(--wc-surface-2) !important; border-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .ds-mini-block { background: var(--wc-surface) !important; border-color: var(--wc-border) !important; }
html[data-bs-theme="dark"] .ds-section h2,
html[data-bs-theme="dark"] .ds-mobile-note h3 { color: var(--wc-heading) !important; }
