/* ============================================ */
/* 🌙 DARK MODE - Complete Theme System        */
/* ============================================ */

/* Base & Typography */
html.dark-theme,
html.dark-mode,
body.dark-theme,
body.dark-mode,
[data-theme="dark"] {
  color-scheme: dark;
  background-color: #0F172A;
  color: #F1F5F9;
}

body.dark-theme,
body.dark-mode {
  background: #0F172A;
  color: #F1F5F9;
}

/* ============================================ */
/* 📌 ESTRUTURA PRINCIPAL & NAVEGAÇÃO          */
/* ============================================ */

/* Header unificado */
body.dark-theme header,
body.dark-mode header {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border-bottom: 1px solid #334155 !important;
}

/* Navegação */
body.dark-theme nav,
body.dark-mode nav {
  background: #1E293B;
  border-bottom: 1px solid #334155;
}

body.dark-theme nav button,
body.dark-mode nav button {
  background: #334155;
  color: #CBD5E1;
  border: 1px solid transparent;
}

body.dark-theme nav button:hover,
body.dark-mode nav button:hover {
  background: #475569;
  color: #FFFFFF;
}

body.dark-theme nav button.active,
body.dark-mode nav button.active {
  background: var(--primary-600);
  color: #FFFFFF;
  border-color: var(--primary-500);
}

/* Telas / Screens */
body.dark-theme .screen,
body.dark-mode .screen {
  background: #1E293B;
  color: #F1F5F9;
}

/* ============================================ */
/* 🎴 CARDS & CONTAINERS                       */
/* ============================================ */

body.dark-theme .card,
body.dark-mode .card,
body.dark-theme .stat-card,
body.dark-mode .stat-card,
body.dark-theme .event-config-card,
body.dark-mode .event-config-card,
body.dark-theme .group-selector,
body.dark-mode .group-selector,
body.dark-theme .form-section,
body.dark-mode .form-section,
body.dark-theme .credits-section,
body.dark-mode .credits-section,
body.dark-theme .form-card,
body.dark-mode .form-card,
[data-theme="dark"] .form-card,
body.dark-theme .dashboard-card,
body.dark-mode .dashboard-card {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

/* Summary cards */
body.dark-theme .summary-info,
body.dark-mode .summary-info,
body.dark-theme .summary-item,
body.dark-mode .summary-item,
body.dark-theme .summary-total,
body.dark-mode .summary-total {
  background: #1E293B !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

/* Títulos e Textos */
body.dark-theme .screen-title,
body.dark-mode .screen-title,
body.dark-theme .card-title,
body.dark-mode .card-title,
body.dark-theme h1,
body.dark-mode h1,
body.dark-theme h2,
body.dark-mode h2,
body.dark-theme h3,
body.dark-mode h3,
body.dark-theme h4,
body.dark-mode h4,
body.dark-theme h5,
body.dark-mode h5,
body.dark-theme h6,
body.dark-mode h6 {
  color: #F1F5F9 !important;
}

body.dark-theme .stat-label,
body.dark-mode .stat-label,
body.dark-theme small,
body.dark-mode small,
body.dark-theme .text-muted,
body.dark-mode .text-muted {
  color: #94A3B8 !important;
}

body.dark-theme .stat-value,
body.dark-mode .stat-value {
  color: #F1F5F9 !important;
}

body.dark-theme .screen-header,
body.dark-mode .screen-header {
  border-bottom-color: #334155 !important;
}

body.dark-theme hr,
body.dark-mode hr {
  border-color: #334155 !important;
}

/* ============================================ */
/* 📝 FORMULÁRIOS & CONTROLES                  */
/* ============================================ */

body.dark-theme form,
body.dark-mode form {
  background: transparent;
}

body.dark-theme label,
body.dark-mode label {
  color: #CBD5E1;
}

body.dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
body.dark-theme select,
body.dark-mode select,
body.dark-theme textarea,
body.dark-mode textarea {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  opacity: 1 !important;
}

body.dark-theme input:focus,
body.dark-mode input:focus,
body.dark-theme select:focus,
body.dark-mode select:focus,
body.dark-theme textarea:focus,
body.dark-mode textarea:focus {
  border-color: var(--primary-500) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
  outline: none !important;
}

body.dark-theme input::placeholder,
body.dark-mode input::placeholder,
body.dark-theme textarea::placeholder,
body.dark-mode textarea::placeholder {
  color: #64748B !important;
}

/* Campos Desabilitados */
body.dark-theme input:disabled,
body.dark-mode input:disabled,
body.dark-theme select:disabled,
body.dark-mode select:disabled,
body.dark-theme textarea:disabled,
body.dark-mode textarea:disabled {
  background-color: #1E293B !important;
  color: #64748B !important;
  border-color: #334155 !important;
  cursor: not-allowed !important;
}

/* Select Options */
body.dark-theme select option,
body.dark-mode select option {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
}

/* Datepicker & Timepicker nativos */
body.dark-theme input[type="date"],
body.dark-mode input[type="date"],
body.dark-theme input[type="time"],
body.dark-mode input[type="time"],
body.dark-theme input[type="datetime-local"],
body.dark-mode input[type="datetime-local"] {
  color-scheme: dark;
}

body.dark-theme input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-theme input[type="time"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

/* Autocomplete & Dropdowns Flutuantes */
body.dark-theme .autocomplete-items,
body.dark-mode .autocomplete-items,
body.dark-theme .suggestion-list,
body.dark-mode .suggestion-list,
body.dark-theme .search-results-dropdown,
body.dark-mode .search-results-dropdown,
body.dark-theme .dropdown-menu,
body.dark-mode .dropdown-menu,
body.dark-theme .user-dropdown-menu,
body.dark-mode .user-dropdown-menu {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .dropdown-item,
body.dark-mode .dropdown-item,
body.dark-theme .autocomplete-item,
body.dark-mode .autocomplete-item {
  color: #E2E8F0 !important;
}

body.dark-theme .dropdown-item:hover,
body.dark-mode .dropdown-item:hover,
body.dark-theme .autocomplete-item:hover,
body.dark-mode .autocomplete-item:hover {
  background-color: #334155 !important;
  color: #FFFFFF !important;
}

body.dark-theme .dropdown-divider,
body.dark-mode .dropdown-divider {
  background-color: #334155 !important;
}

/* ============================================ */
/* 📊 TABELAS & DATA GRIDS                     */
/* ============================================ */

body.dark-theme table,
body.dark-mode table,
body.dark-theme .data-table,
body.dark-mode .data-table {
  background: #1E293B !important;
  border-color: #334155 !important;
}

body.dark-theme th,
body.dark-mode th,
body.dark-theme thead th,
body.dark-mode thead th {
  background: #0F172A !important;
  color: #F1F5F9 !important;
  border-bottom: 2px solid #334155 !important;
}

body.dark-theme td,
body.dark-mode td,
body.dark-theme tbody td,
body.dark-mode tbody td {
  color: #E2E8F0 !important;
  border-bottom: 1px solid #334155 !important;
}

body.dark-theme table tbody tr:nth-child(even),
body.dark-mode table tbody tr:nth-child(even),
body.dark-theme .data-table tbody tr:nth-child(even),
body.dark-mode .data-table tbody tr:nth-child(even) {
  background-color: #1E293B !important;
}

body.dark-theme table tbody tr:nth-child(odd),
body.dark-mode table tbody tr:nth-child(odd),
body.dark-theme .data-table tbody tr:nth-child(odd),
body.dark-mode .data-table tbody tr:nth-child(odd) {
  background-color: #243044 !important;
}

/* Hover de linhas - Não apaga cores de badges */
body.dark-theme table tbody tr:hover,
body.dark-mode table tbody tr:hover,
body.dark-theme .data-table tbody tr:hover,
body.dark-mode .data-table tbody tr:hover {
  background-color: #334155 !important;
}

/* ============================================ */
/* 🪟 MODAIS & DIÁLOGOS                         */
/* ============================================ */

body.dark-theme .modal,
body.dark-mode .modal,
body.dark-theme .custom-modal,
body.dark-mode .custom-modal {
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(8px) !important;
}

body.dark-theme .modal-content,
body.dark-mode .modal-content,
body.dark-theme .custom-modal-content,
body.dark-mode .custom-modal-content,
body.dark-theme .photo-modal-content,
body.dark-mode .photo-modal-content,
body.dark-theme .submission-details-content,
body.dark-mode .submission-details-content {
  background: linear-gradient(145deg, #1A2332 0%, #1E293B 100%) !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .modal-header,
body.dark-mode .modal-header,
body.dark-theme .custom-modal-header,
body.dark-mode .custom-modal-header,
body.dark-theme .photo-modal-header,
body.dark-mode .photo-modal-header {
  background: transparent !important;
  border-bottom: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .modal-title,
body.dark-mode .modal-title,
body.dark-theme .photo-modal-title,
body.dark-mode .photo-modal-title,
body.dark-theme .modal-header h3,
body.dark-mode .modal-header h3 {
  color: #F1F5F9 !important;
  font-weight: 600 !important;
}

body.dark-theme .modal-body,
body.dark-mode .modal-body,
body.dark-theme .custom-modal-body,
body.dark-mode .custom-modal-body {
  color: #E2E8F0 !important;
  background: transparent !important;
}

body.dark-theme .modal-footer,
body.dark-mode .modal-footer {
  border-top: 1px solid #334155 !important;
  background: transparent !important;
}

body.dark-theme .modal-header .close,
body.dark-mode .modal-header .close,
body.dark-theme .custom-modal-header button,
body.dark-mode .custom-modal-header button {
  color: #94A3B8 !important;
  background: transparent !important;
}

body.dark-theme .modal-header .close:hover,
body.dark-mode .modal-header .close:hover,
body.dark-theme .custom-modal-header button:hover,
body.dark-mode .custom-modal-header button:hover {
  background: #334155 !important;
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 🔔 SWEETALERT2 (Modais & Toasts)            */
/* ============================================ */

body.dark-theme .swal2-popup,
body.dark-mode .swal2-popup {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

body.dark-theme .swal2-title,
body.dark-mode .swal2-title,
body.dark-theme .swal2-html-container,
body.dark-mode .swal2-html-container {
  color: #F1F5F9 !important;
}

body.dark-theme .swal2-input,
body.dark-mode .swal2-input,
body.dark-theme .swal2-textarea,
body.dark-mode .swal2-textarea,
body.dark-theme .swal2-select,
body.dark-mode .swal2-select {
  background: #0F172A !important;
  color: #F1F5F9 !important;
  border: 1px solid #475569 !important;
}

body.dark-theme .swal2-validation-message,
body.dark-mode .swal2-validation-message {
  background: #0F172A !important;
  color: #FCA5A5 !important;
}

body.dark-theme .swal2-footer,
body.dark-mode .swal2-footer {
  border-top-color: #334155 !important;
  color: #94A3B8 !important;
}

body.dark-theme #swal-waiting-list-container,
body.dark-mode #swal-waiting-list-container,
body.dark-theme .swal-waiting-list-box,
body.dark-mode .swal-waiting-list-box {
  background: rgba(23, 162, 184, 0.15) !important;
  border-left: 4px solid #17a2b8 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #swal-waiting-list-container label,
body.dark-mode #swal-waiting-list-container label,
body.dark-theme #swal-waiting-list-container strong,
body.dark-mode #swal-waiting-list-container strong,
body.dark-theme .swal-waiting-list-box label,
body.dark-mode .swal-waiting-list-box label,
body.dark-theme .swal-waiting-list-box strong,
body.dark-mode .swal-waiting-list-box strong {
  color: #F1F5F9 !important;
}

body.dark-theme #swal-waiting-list-container p,
body.dark-mode #swal-waiting-list-container p,
body.dark-theme .swal-waiting-list-box p,
body.dark-mode .swal-waiting-list-box p {
  color: #CBD5E1 !important;
}

/* ============================================ */
/* 💬 MÓDULO WHATSAPP & COMUNICAÇÃO            */
/* ============================================ */

/* Fundo do painel do chat */
body.dark-theme .whatsapp-bg-pattern,
body.dark-mode .whatsapp-bg-pattern {
  background-color: #0B141A !important;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,.015) 10px, rgba(255,255,255,.015) 20px),
    repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,.015) 10px, rgba(255,255,255,.015) 20px) !important;
}

/* Lista de conversas */
body.dark-theme .conversation-item,
body.dark-mode .conversation-item {
  background-color: transparent !important;
  border-bottom: 1px solid #202C33 !important;
}

body.dark-theme .conversation-item:hover,
body.dark-mode .conversation-item:hover {
  background-color: #202C33 !important;
}

body.dark-theme .conversation-item.selected,
body.dark-mode .conversation-item.selected {
  background-color: #2A3942 !important;
}

/* Textos da conversa */
body.dark-theme .chat-dark-text,
body.dark-mode .chat-dark-text,
body.dark-theme .dark-text,
body.dark-mode .dark-text,
body.dark-theme #chat-contact-name,
body.dark-mode #chat-contact-name {
  color: #F1F5F9 !important;
}

body.dark-theme .conv-preview,
body.dark-mode .conv-preview,
body.dark-theme #chat-contact-phone,
body.dark-mode #chat-contact-phone {
  color: #94A3B8 !important;
}

/* Balões de Mensagens */
body.dark-theme #chat-messages,
body.dark-mode #chat-messages,
[data-theme="dark"] #chat-messages {
  background-color: #0B141A !important;
}

body.dark-theme .message-bubble,
body.dark-mode .message-bubble,
body.dark-theme .chat-bubble,
body.dark-mode .chat-bubble,
[data-theme="dark"] .chat-bubble {
  color: #E9EDEF !important;
}

body.dark-theme .message-bubble.received,
body.dark-mode .message-bubble.received,
body.dark-theme .message-in,
body.dark-mode .message-in,
body.dark-theme .chat-bubble-incoming,
body.dark-mode .chat-bubble-incoming,
[data-theme="dark"] .chat-bubble-incoming {
  background-color: #202C33 !important;
  color: #E9EDEF !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .message-bubble.sent,
body.dark-mode .message-bubble.sent,
body.dark-theme .message-out,
body.dark-mode .message-out,
body.dark-theme .chat-bubble-outgoing,
body.dark-mode .chat-bubble-outgoing,
[data-theme="dark"] .chat-bubble-outgoing {
  background-color: #005C4B !important;
  color: #E9EDEF !important;
  border: 1px solid #005C4B !important;
}

body.dark-theme .chat-msg-time,
body.dark-mode .chat-msg-time,
[data-theme="dark"] .chat-msg-time {
  color: #8696A0 !important;
}

/* Barra de entrada de mensagem */
body.dark-theme #chat-message-input,
body.dark-mode #chat-message-input {
  background-color: #2A3942 !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
}

/* QR Code Container - Preservar fundo branco para leitura pela câmera */
body.dark-theme #whatsapp-qr-container,
body.dark-mode #whatsapp-qr-container,
body.dark-theme #wa-qr-container,
body.dark-mode #wa-qr-container,
body.dark-theme .qr-code-box,
body.dark-mode .qr-code-box,
body.dark-theme #qr-code-display,
body.dark-mode #qr-code-display {
  background: #FFFFFF !important;
  padding: 16px !important;
  border-radius: 12px !important;
  display: inline-block !important;
}

/* Status de Conexão WhatsApp */
body.dark-theme .wa-status,
body.dark-mode .wa-status,
body.dark-theme [class*="wa-status"],
body.dark-mode [class*="wa-status"] {
  background: #1E293B !important;
  color: #E2E8F0 !important;
  border-radius: 8px;
}

body.dark-theme #conversations-panel .fa-whatsapp,
body.dark-mode #conversations-panel .fa-whatsapp {
  color: #25D366 !important;
}

/* ============================================ */
/* 🛡️ EDITOR DE CRACHÁS (Proteção Canvas)      */
/* ============================================ */

/* O canvas de edição do crachá físico deve manter fundo branco */
body.dark-theme #badge-canvas,
body.dark-mode #badge-canvas,
body.dark-theme #badge-canvas-wrapper,
body.dark-mode #badge-canvas-wrapper {
  background-color: #FFFFFF !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

/* ============================================ */
/* 🏷️ BADGES & STATUS SEMÂNTICOS                */
/* ============================================ */

body.dark-theme .badge-husband,
body.dark-mode .badge-husband {
  background-color: #1976D2 !important;
  color: #FFFFFF !important;
}

body.dark-theme .badge-wife,
body.dark-mode .badge-wife {
  background-color: #C2185B !important;
  color: #FFFFFF !important;
}

body.dark-theme .badge-single,
body.dark-mode .badge-single {
  background-color: #388E3C !important;
  color: #FFFFFF !important;
}

body.dark-theme .badge-neutral,
body.dark-mode .badge-neutral,
body.dark-theme .event-tag,
body.dark-mode .event-tag {
  background: #334155 !important;
  color: #CBD5E1 !important;
}

body.dark-theme .paid,
body.dark-mode .paid {
  color: #34D399 !important;
  font-weight: 600;
}

body.dark-theme .not-paid,
body.dark-mode .not-paid {
  color: #F87171 !important;
  font-weight: 600;
}

body.dark-theme .partial-paid,
body.dark-mode .partial-paid {
  color: #FBBF24 !important;
  font-weight: 600;
}

/* Rótulo de Check-in */
body.dark-theme .checkin-toggle label,
body.dark-mode .checkin-toggle label {
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 🚨 ALERTAS & MENSAGENS                       */
/* ============================================ */

body.dark-theme .alert-success,
body.dark-mode .alert-success {
  background: rgba(16, 185, 129, 0.15) !important;
  border-left: 4px solid #10B981 !important;
  color: #6EE7B7 !important;
}

body.dark-theme .alert-warning,
body.dark-mode .alert-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  border-left: 4px solid #F59E0B !important;
  color: #FCD34D !important;
}

body.dark-theme .alert-danger,
body.dark-mode .alert-danger,
body.dark-theme .error-message,
body.dark-mode .error-message {
  background: rgba(239, 68, 68, 0.15) !important;
  border-left: 4px solid #EF4444 !important;
  color: #FCA5A5 !important;
}

body.dark-theme .alert-info,
body.dark-mode .alert-info {
  background: rgba(59, 130, 246, 0.15) !important;
  border-left: 4px solid #3B82F6 !important;
  color: #93C5FD !important;
}

/* Notificações Auto-Closing */
body.dark-theme .auto-closing-notification.success,
body.dark-mode .auto-closing-notification.success {
  background-color: #059669 !important;
  color: #FFFFFF !important;
}

body.dark-theme .auto-closing-notification.error,
body.dark-mode .auto-closing-notification.error,
body.dark-theme .auto-closing-notification.danger,
body.dark-mode .auto-closing-notification.danger {
  background-color: #DC2626 !important;
  color: #FFFFFF !important;
}

body.dark-theme .auto-closing-notification.warning,
body.dark-mode .auto-closing-notification.warning {
  background-color: #D97706 !important;
  color: #FFFFFF !important;
}

body.dark-theme .auto-closing-notification.info,
body.dark-mode .auto-closing-notification.info {
  background-color: #2563EB !important;
  color: #FFFFFF !important;
}

/* ============================================ */
/* 🔘 BOTÕES OUTLINE (Diretriz do Projeto)     */
/* ============================================ */

body.dark-theme .btn,
body.dark-mode .btn,
body.dark-theme button:not(.btn-filled):not(.calc-btn):not(.emoji-btn):not(.photo-modal-close),
body.dark-mode button:not(.btn-filled):not(.calc-btn):not(.emoji-btn):not(.photo-modal-close) {
  transition: all 0.2s ease-in-out;
}

/* Botão Primário Outline */
body.dark-theme .btn-primary,
body.dark-mode .btn-primary {
  background: transparent !important;
  color: #818CF8 !important;
  border: 1px solid #818CF8 !important;
}
body.dark-theme .btn-primary:hover,
body.dark-mode .btn-primary:hover {
  background: rgba(129, 140, 248, 0.15) !important;
  color: #A5B4FC !important;
}

/* Botão Secundário / Neutro Outline */
body.dark-theme .btn-secondary,
body.dark-mode .btn-secondary,
body.dark-theme .btn-ghost,
body.dark-mode .btn-ghost {
  background: transparent !important;
  color: #CBD5E1 !important;
  border: 1px solid #475569 !important;
}
body.dark-theme .btn-secondary:hover,
body.dark-mode .btn-secondary:hover,
body.dark-theme .btn-ghost:hover,
body.dark-mode .btn-ghost:hover {
  background: rgba(203, 213, 225, 0.1) !important;
  color: #F1F5F9 !important;
}

/* Botão Sucesso Outline */
body.dark-theme .btn-success,
body.dark-mode .btn-success {
  background: transparent !important;
  color: #34D399 !important;
  border: 1px solid #34D399 !important;
}
body.dark-theme .btn-success:hover,
body.dark-mode .btn-success:hover {
  background: rgba(52, 211, 153, 0.15) !important;
  color: #6EE7B7 !important;
}

/* Botão Perigo / Cancelar Outline */
body.dark-theme .btn-danger,
body.dark-mode .btn-danger {
  background: transparent !important;
  color: #F87171 !important;
  border: 1px solid #F87171 !important;
}
body.dark-theme .btn-danger:hover,
body.dark-mode .btn-danger:hover {
  background: rgba(248, 113, 113, 0.15) !important;
  color: #FCA5A5 !important;
}

/* Botão Aviso Outline */
body.dark-theme .btn-warning,
body.dark-mode .btn-warning {
  background: transparent !important;
  color: #FBBF24 !important;
  border: 1px solid #FBBF24 !important;
}
body.dark-theme .btn-warning:hover,
body.dark-mode .btn-warning:hover {
  background: rgba(251, 191, 36, 0.15) !important;
  color: #FCD34D !important;
}

/* Botão de Alternância de Tema */
body.dark-theme #theme-toggle-btn,
body.dark-mode #theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #F1F5F9 !important;
  border-radius: 100px !important;
  border: 1px solid #475569 !important;
}

body.dark-theme #theme-toggle-btn:hover,
body.dark-mode #theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* ============================================ */
/* 📜 SCROLLBARS                                */
/* ============================================ */

body.dark-theme ::-webkit-scrollbar,
body.dark-mode ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body.dark-theme ::-webkit-scrollbar-track,
body.dark-mode ::-webkit-scrollbar-track {
  background: #0F172A;
}

body.dark-theme ::-webkit-scrollbar-thumb,
body.dark-mode ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 5px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover,
body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ============================================ */
/* 📋 1. FORMULÁRIOS & COMPROVANTES (Campistas/Servos) */
/* ============================================ */

body.dark-theme .form-toggle-header,
body.dark-mode .form-toggle-header,
[data-theme="dark"] .form-toggle-header {
  background-color: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .form-toggle-header:hover,
body.dark-mode .form-toggle-header:hover,
[data-theme="dark"] .form-toggle-header:hover {
  background-color: #243044 !important;
}

body.dark-theme .payment-proofs-container,
body.dark-mode .payment-proofs-container,
[data-theme="dark"] .payment-proofs-container {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .payment-proof-item,
body.dark-mode .payment-proof-item,
[data-theme="dark"] .payment-proof-item {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .payment-proof-item.registration-photo-item,
body.dark-mode .payment-proof-item.registration-photo-item,
[data-theme="dark"] .payment-proof-item.registration-photo-item {
  background-color: rgba(59, 130, 246, 0.08) !important;
  border-left-color: #60a5fa !important;
}

body.dark-theme .servant-table-thumb,
body.dark-mode .servant-table-thumb,
[data-theme="dark"] .servant-table-thumb {
  border-color: #60a5fa !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .servant-table-thumb.history-photo-thumb,
body.dark-mode .servant-table-thumb.history-photo-thumb,
[data-theme="dark"] .servant-table-thumb.history-photo-thumb {
  border-color: #34d399 !important;
}

body.dark-theme .payment-proof-actions button,
body.dark-mode .payment-proof-actions button,
body.dark-theme .payment-proof-actions a.btn-download,
body.dark-mode .payment-proof-actions a.btn-download,
[data-theme="dark"] .payment-proof-actions button,
[data-theme="dark"] .payment-proof-actions a.btn-download {
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

body.dark-theme .payment-proof-preview,
body.dark-mode .payment-proof-preview,
[data-theme="dark"] .payment-proof-preview {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

body.dark-theme .payment-proof-filename,
body.dark-mode .payment-proof-filename,
[data-theme="dark"] .payment-proof-filename {
  color: #F1F5F9 !important;
}

body.dark-theme .payment-proof-meta,
body.dark-mode .payment-proof-meta,
[data-theme="dark"] .payment-proof-meta {
  color: #94A3B8 !important;
}

body.dark-theme .payment-proof-upload-area,
body.dark-mode .payment-proof-upload-area,
[data-theme="dark"] .payment-proof-upload-area {
  border-color: #334155 !important;
  background-color: #0F172A !important;
}

body.dark-theme .table-scroll-container,
body.dark-mode .table-scroll-container,
[data-theme="dark"] .table-scroll-container {
  background: #0F172A !important;
  border-color: #334155 !important;
}

body.dark-theme .table-scroll-container::-webkit-scrollbar-track,
body.dark-mode .table-scroll-container::-webkit-scrollbar-track,
[data-theme="dark"] .table-scroll-container::-webkit-scrollbar-track {
  background: #0F172A !important;
}

body.dark-theme .table-scroll-container::-webkit-scrollbar-thumb,
body.dark-mode .table-scroll-container::-webkit-scrollbar-thumb,
[data-theme="dark"] .table-scroll-container::-webkit-scrollbar-thumb {
  background: #334155 !important;
}

body.dark-theme .table-scroll-container::-webkit-scrollbar-thumb:hover,
body.dark-mode .table-scroll-container::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #475569 !important;
}

/* Header de equipes e tribos em tabelas */
body.dark-theme .team-header-row td,
body.dark-mode .team-header-row td,
[data-theme="dark"] .team-header-row td,
body.dark-theme #servants-table tr.team-header-row td,
body.dark-mode #servants-table tr.team-header-row td,
[data-theme="dark"] #servants-table tr.team-header-row td,
body.dark-theme #people-table tr.team-header-row td,
body.dark-mode #people-table tr.team-header-row td,
[data-theme="dark"] #people-table tr.team-header-row td {
  background-color: #475569 !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 0.95em !important;
  line-height: 1.2 !important;
  text-align: center !important;
  padding: 5px 8px !important;
  border-top: 2px solid #64748B !important;
  border-bottom: 1px solid #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* ============================================ */
/* 📊 2. DASHBOARD DE PESSOAS (KPIs & Gráficos) */
/* ============================================ */

body.dark-theme .dashboard-kpi,
body.dark-mode .dashboard-kpi,
[data-theme="dark"] .dashboard-kpi,
body.dark-theme .dashboard-chart-box,
body.dark-mode .dashboard-chart-box,
[data-theme="dark"] .dashboard-chart-box {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
}

body.dark-theme .dashboard-kpi h4,
body.dark-mode .dashboard-kpi h4,
[data-theme="dark"] .dashboard-kpi h4,
body.dark-theme .dashboard-chart-box h4,
body.dark-mode .dashboard-chart-box h4,
[data-theme="dark"] .dashboard-chart-box h4 {
  color: #F1F5F9 !important;
  border-bottom: 1px solid #334155 !important;
}

body.dark-theme .kpi-mini,
body.dark-mode .kpi-mini,
[data-theme="dark"] .kpi-mini {
  background: #0F172A !important;
  border-color: #334155 !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

body.dark-theme .kpi-mini h4,
body.dark-mode .kpi-mini h4,
[data-theme="dark"] .kpi-mini h4 {
  color: #94A3B8 !important;
}

body.dark-theme .kpi-mini p,
body.dark-mode .kpi-mini p,
[data-theme="dark"] .kpi-mini p {
  color: #64748B !important;
}

/* ============================================ */
/* 📸 4. FOTOS - GERENCIAR & MODAL EQUIPES     */
/* ============================================ */

body.dark-theme .manage-actions-section h3,
body.dark-mode .manage-actions-section h3,
[data-theme="dark"] .manage-actions-section h3 {
  color: #F1F5F9 !important;
}

body.dark-theme .manage-action-card,
body.dark-mode .manage-action-card,
[data-theme="dark"] .manage-action-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .manage-action-card:hover,
body.dark-mode .manage-action-card:hover,
[data-theme="dark"] .manage-action-card:hover {
  border-color: #818CF8 !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .manage-action-card h4,
body.dark-mode .manage-action-card h4,
[data-theme="dark"] .manage-action-card h4 {
  color: #F1F5F9 !important;
}

body.dark-theme .manage-action-card p,
body.dark-mode .manage-action-card p,
[data-theme="dark"] .manage-action-card p {
  color: #94A3B8 !important;
}

body.dark-theme .teams-sidebar,
body.dark-mode .teams-sidebar,
[data-theme="dark"] .teams-sidebar {
  background-color: #0F172A !important;
  border-right: 1px solid #334155 !important;
}

body.dark-theme .teams-sidebar h4,
body.dark-mode .teams-sidebar h4,
[data-theme="dark"] .teams-sidebar h4 {
  color: #F1F5F9 !important;
  border-bottom: 2px solid #334155 !important;
}

body.dark-theme .team-list-item,
body.dark-mode .team-list-item,
[data-theme="dark"] .team-list-item {
  color: #E2E8F0 !important;
}

body.dark-theme .team-list-item:hover,
body.dark-mode .team-list-item:hover,
body.dark-theme .team-list-item.active,
body.dark-mode .team-list-item.active,
[data-theme="dark"] .team-list-item.active {
  background-color: #334155 !important;
  color: #FFFFFF !important;
}

body.dark-theme .team-members-list,
body.dark-mode .team-members-list,
[data-theme="dark"] .team-members-list {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .photo-upload-container,
body.dark-mode .photo-upload-container,
[data-theme="dark"] .photo-upload-container {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

/* ============================================ */
/* 💬 5 & 6. WHATSAPP EM MASSA & CHAT          */
/* ============================================ */

body.dark-theme #wa-test-message-block,
body.dark-mode #wa-test-message-block,
[data-theme="dark"] #wa-test-message-block,
body.dark-theme #wa-connection-status-block,
body.dark-mode #wa-connection-status-block,
[data-theme="dark"] #wa-connection-status-block {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #wa-test-message-block small,
body.dark-mode #wa-test-message-block small,
[data-theme="dark"] #wa-test-message-block small {
  color: #94A3B8 !important;
}

body.dark-theme #chat-tab-container,
body.dark-mode #chat-tab-container,
[data-theme="dark"] #chat-tab-container {
  border-color: #334155 !important;
  background-color: #0B141A !important;
}

body.dark-theme #conversations-panel,
body.dark-mode #conversations-panel,
[data-theme="dark"] #conversations-panel {
  background-color: #111B21 !important;
  border-right: 1px solid #202C33 !important;
}

body.dark-theme #conversations-header,
body.dark-mode #conversations-header,
[data-theme="dark"] #conversations-header {
  background-color: #111B21 !important;
  border-bottom: 1px solid #202C33 !important;
}

body.dark-theme #new-chat-container,
body.dark-mode #new-chat-container,
[data-theme="dark"] #new-chat-container {
  background-color: #111B21 !important;
  border-bottom: 2px solid #202C33 !important;
}

body.dark-theme #new-chat-container label,
body.dark-mode #new-chat-container label,
[data-theme="dark"] #new-chat-container label {
  color: #F1F5F9 !important;
}

body.dark-theme #new-chat-search,
body.dark-mode #new-chat-search,
[data-theme="dark"] #new-chat-search,
body.dark-theme #new-chat-select,
body.dark-mode #new-chat-select,
[data-theme="dark"] #new-chat-select {
  background-color: #202C33 !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #chat-panel,
body.dark-mode #chat-panel,
[data-theme="dark"] #chat-panel {
  background-color: #0B141A !important;
}

body.dark-theme #chat-header,
body.dark-mode #chat-header,
[data-theme="dark"] #chat-header {
  background-color: #202C33 !important;
  border-bottom: 1px solid #334155 !important;
}

body.dark-theme #chat-input-area,
body.dark-mode #chat-input-area,
[data-theme="dark"] #chat-input-area {
  background-color: #202C33 !important;
  border-top: 1px solid #334155 !important;
}

body.dark-theme #chat-file-preview,
body.dark-mode #chat-file-preview,
[data-theme="dark"] #chat-file-preview {
  background-color: #111B21 !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #chat-recording-indicator,
body.dark-mode #chat-recording-indicator,
[data-theme="dark"] #chat-recording-indicator {
  background-color: #2D1515 !important;
  border-color: #EF4444 !important;
}

/* ============================================ */
/* 📅 7. AGENDAMENTO & CHECKBOXES DE ARQUIVOS   */
/* ============================================ */

body.dark-theme #schedule-files-checkboxes,
body.dark-mode #schedule-files-checkboxes,
[data-theme="dark"] #schedule-files-checkboxes {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #schedule-files-checkboxes div,
body.dark-mode #schedule-files-checkboxes div,
[data-theme="dark"] #schedule-files-checkboxes div {
  border-bottom-color: #334155 !important;
}

body.dark-theme #schedule-files-checkboxes label,
body.dark-mode #schedule-files-checkboxes label,
[data-theme="dark"] #schedule-files-checkboxes label {
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 💰 8. CONTABILIDADE GERAL (Balanço Rápido)  */
/* ============================================ */

body.dark-theme .detailed-balance-card,
body.dark-mode .detailed-balance-card,
[data-theme="dark"] .detailed-balance-card,
body.dark-theme #general-accounting-balance,
body.dark-mode #general-accounting-balance,
[data-theme="dark"] #general-accounting-balance {
  background-color: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .detailed-balance-card h3,
body.dark-mode .detailed-balance-card h3,
[data-theme="dark"] .detailed-balance-card h3 {
  border-bottom: 2px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .revenue,
body.dark-mode .revenue,
[data-theme="dark"] .revenue,
body.dark-theme .positive,
body.dark-mode .positive,
[data-theme="dark"] .positive {
  color: #34D399 !important;
}

body.dark-theme .expense,
body.dark-mode .expense,
[data-theme="dark"] .expense {
  color: #F87171 !important;
}

/* ============================================ */
/* 💰 8.1 CONTABILIDADE - LANÇAMENTO DE ITENS   */
/* ============================================ */

body.dark-theme .expense-item,
body.dark-mode .expense-item,
[data-theme="dark"] .expense-item,
body.dark-theme .donation-item,
body.dark-mode .donation-item,
[data-theme="dark"] .donation-item {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
  border-radius: 8px !important;
}

body.dark-theme .expense-item label,
body.dark-mode .expense-item label,
[data-theme="dark"] .expense-item label,
body.dark-theme .donation-item label,
body.dark-mode .donation-item label,
[data-theme="dark"] .donation-item label {
  color: #CBD5E1 !important;
}

body.dark-theme .expense-item input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
body.dark-mode .expense-item input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
[data-theme="dark"] .expense-item input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
body.dark-theme .expense-item select,
body.dark-mode .expense-item select,
[data-theme="dark"] .expense-item select,
body.dark-theme .donation-item input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
body.dark-mode .donation-item input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
[data-theme="dark"] .donation-item input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="file"]),
body.dark-theme .donation-item select,
body.dark-mode .donation-item select,
[data-theme="dark"] .donation-item select {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .expense-total-value,
body.dark-mode .expense-total-value,
[data-theme="dark"] .expense-total-value {
  background-color: #0F172A !important;
  color: #94A3B8 !important;
  border-color: #334155 !important;
}

/* ============================================ */
/* 🏦 9. TESOURARIA & RODAPÉ DE CONTAS         */
/* ============================================ */

body.dark-theme #treasury-bills-tfoot tr,
body.dark-mode #treasury-bills-tfoot tr,
body.dark-theme .treasury-tfoot-row,
body.dark-mode .treasury-tfoot-row,
[data-theme="dark"] .treasury-tfoot-row,
body.dark-theme #treasury-contracts-tfoot tr,
body.dark-mode #treasury-contracts-tfoot tr {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border-top: 2px solid #334155 !important;
}

body.dark-theme #treasury-bills-tfoot td,
body.dark-mode #treasury-bills-tfoot td,
[data-theme="dark"] #treasury-bills-tfoot td {
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 👥 10. HISTÓRICO DE PESSOAS & FILTROS       */
/* ============================================ */

body.dark-theme .filters-container,
body.dark-mode .filters-container,
[data-theme="dark"] .filters-container {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
}

body.dark-theme #history-search,
body.dark-mode #history-search,
[data-theme="dark"] #history-search {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}

/* ============================================ */
/* 📥 11. DOWNLOADS & TEMPLATES                */
/* ============================================ */

body.dark-theme .downloads-section,
body.dark-mode .downloads-section,
[data-theme="dark"] .downloads-section {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .section-header,
body.dark-mode .section-header,
[data-theme="dark"] .section-header {
  background-color: #0F172A !important;
  border-bottom: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .coordination-section .section-header,
body.dark-mode .coordination-section .section-header,
[data-theme="dark"] .coordination-section .section-header {
  background-color: #0F172A !important;
  border-bottom: 1px solid #334155 !important;
}

body.dark-theme .coordination-section .event-config-card,
body.dark-mode .coordination-section .event-config-card,
[data-theme="dark"] .coordination-section .event-config-card {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

body.dark-theme .template-download-btn,
body.dark-mode .template-download-btn,
[data-theme="dark"] .template-download-btn {
  background: transparent !important;
  color: #818CF8 !important;
  border: 1px solid #818CF8 !important;
}

body.dark-theme .template-download-btn:hover,
body.dark-mode .template-download-btn:hover,
[data-theme="dark"] .template-download-btn:hover {
  background: rgba(129, 140, 248, 0.15) !important;
  color: #A5B4FC !important;
}

/* ============================================ */
/* ⚙️ 12 & 13. CONFIGURAÇÕES DE INSCRIÇÃO      */
/* ============================================ */

body.dark-theme .config-group,
body.dark-mode .config-group,
[data-theme="dark"] .config-group {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.dark-theme .config-group-header,
body.dark-mode .config-group-header,
[data-theme="dark"] .config-group-header {
  background-color: #0F172A !important;
  border-bottom: 1px solid #334155 !important;
}

body.dark-theme .config-group-header h3,
body.dark-mode .config-group-header h3,
[data-theme="dark"] .config-group-header h3 {
  color: #F1F5F9 !important;
}

body.dark-theme .enhanced-textarea,
body.dark-mode .enhanced-textarea,
[data-theme="dark"] .enhanced-textarea {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}

body.dark-theme .public-links-container,
body.dark-mode .public-links-container,
[data-theme="dark"] .public-links-container {
  background-color: #0F172A !important;
  border-color: #334155 !important;
}

body.dark-theme .public-links-container h4,
body.dark-mode .public-links-container h4,
[data-theme="dark"] .public-links-container h4 {
  color: #34D399 !important;
}

body.dark-theme .public-links-container code,
body.dark-mode .public-links-container code,
[data-theme="dark"] .public-links-container code,
body.dark-theme #campistas-public-link,
body.dark-mode #campistas-public-link,
[data-theme="dark"] #campistas-public-link,
body.dark-theme #servants-public-link,
body.dark-mode #servants-public-link,
[data-theme="dark"] #servants-public-link {
  background-color: #1E293B !important;
  color: #38BDF8 !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .selected-field-item,
body.dark-mode .selected-field-item,
[data-theme="dark"] .selected-field-item {
  background-color: #1E293B !important;
  border-color: #3B82F6 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .field-item,
body.dark-mode .field-item,
[data-theme="dark"] .field-item {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .field-item:hover,
body.dark-mode .field-item:hover,
[data-theme="dark"] .field-item:hover {
  background-color: #1E293B !important;
  border-color: #34D399 !important;
}

/* Modais de links únicos */
body.dark-theme .unique-links-modal-content,
body.dark-mode .unique-links-modal-content,
[data-theme="dark"] .unique-links-modal-content {
  background-color: #1E293B !important;
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 🛡️ 15 & 16. PERMISSÕES & MODO MANUTENÇÃO    */
/* ============================================ */

body.dark-theme #role-management-wrapper,
body.dark-mode #role-management-wrapper,
[data-theme="dark"] #role-management-wrapper {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .permission-card,
body.dark-mode .permission-card,
[data-theme="dark"] .permission-card {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .permission-card:hover,
body.dark-mode .permission-card:hover,
[data-theme="dark"] .permission-card:hover {
  background-color: #1E293B !important;
  border-color: #818CF8 !important;
}

body.dark-theme .permission-label,
body.dark-mode .permission-label,
[data-theme="dark"] .permission-label {
  color: #F1F5F9 !important;
}

body.dark-theme #maintenance-mode-wrapper,
body.dark-mode #maintenance-mode-wrapper,
[data-theme="dark"] #maintenance-mode-wrapper {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  border-left: 5px solid #F59E0B !important;
  color: #F1F5F9 !important;
}

body.dark-theme #maintenance-mode-wrapper p,
body.dark-mode #maintenance-mode-wrapper p,
[data-theme="dark"] #maintenance-mode-wrapper p {
  color: #94A3B8 !important;
}

body.dark-theme #maintenance-status-label,
body.dark-mode #maintenance-status-label,
[data-theme="dark"] #maintenance-status-label {
  color: #CBD5E1 !important;
}

body.dark-theme #maintenance-warning-alert,
body.dark-mode #maintenance-warning-alert,
[data-theme="dark"] #maintenance-warning-alert {
  background-color: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid #F59E0B !important;
  color: #FBBF24 !important;
}

/* ============================================ */
/* 🎨 17. CONFIGURAÇÃO DE AMBIENTE             */
/* ============================================ */

body.dark-theme #env-config-wrapper,
body.dark-mode #env-config-wrapper,
[data-theme="dark"] #env-config-wrapper {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .env-section-card,
body.dark-mode .env-section-card,
[data-theme="dark"] .env-section-card {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .env-section-card h4,
body.dark-mode .env-section-card h4,
[data-theme="dark"] .env-section-card h4 {
  color: #F1F5F9 !important;
}

body.dark-theme .env-section-card p,
body.dark-mode .env-section-card p,
[data-theme="dark"] .env-section-card p {
  color: #94A3B8 !important;
}

body.dark-theme .env-logo-card,
body.dark-mode .env-logo-card,
[data-theme="dark"] .env-logo-card {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .env-logo-card h4,
body.dark-mode .env-logo-card h4,
[data-theme="dark"] .env-logo-card h4 {
  color: #F1F5F9 !important;
}

body.dark-theme .env-logo-card p,
body.dark-mode .env-logo-card p,
[data-theme="dark"] .env-logo-card p {
  color: #94A3B8 !important;
}

/* ============================================ */
/* 🎲 18. CONSTRUTOR DE EVENTOS PERSONALIZADOS */
/* ============================================ */

body.dark-theme #custom-events-wrapper,
body.dark-mode #custom-events-wrapper,
[data-theme="dark"] #custom-events-wrapper {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #custom-events-list-wrapper,
body.dark-mode #custom-events-list-wrapper,
[data-theme="dark"] #custom-events-list-wrapper {
  background-color: #0F172A !important;
  border-color: #334155 !important;
}

body.dark-theme #custom-event-editor-panel,
body.dark-mode #custom-event-editor-panel,
[data-theme="dark"] #custom-event-editor-panel {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .custom-event-card,
body.dark-mode .custom-event-card,
[data-theme="dark"] .custom-event-card {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .custom-event-card:hover,
body.dark-mode .custom-event-card:hover,
[data-theme="dark"] .custom-event-card:hover {
  border-color: #818CF8 !important;
}

body.dark-theme .custom-event-card.active,
body.dark-mode .custom-event-card.active,
[data-theme="dark"] .custom-event-card.active {
  background: #2D1A1A !important;
  border-left: 4px solid var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

body.dark-theme .custom-field-checkbox-card,
body.dark-mode .custom-field-checkbox-card,
[data-theme="dark"] .custom-field-checkbox-card {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .custom-field-checkbox-card:hover,
body.dark-mode .custom-field-checkbox-card:hover,
[data-theme="dark"] .custom-field-checkbox-card:hover {
  background: #1E293B !important;
  border-color: #818CF8 !important;
}

body.dark-theme .custom-field-checkbox-card.selected,
body.dark-mode .custom-field-checkbox-card.selected,
[data-theme="dark"] .custom-field-checkbox-card.selected {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: #3B82F6 !important;
  color: #93C5FD !important;
}

body.dark-theme .custom-tribe-row,
body.dark-mode .custom-tribe-row,
[data-theme="dark"] .custom-tribe-row {
  background: #0F172A !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 🪪 19. EDITOR DE CRACHÁS (Sidebar & Panels) */
/* ============================================ */

body.dark-theme .badge-editor-container,
body.dark-mode .badge-editor-container,
[data-theme="dark"] .badge-editor-container {
  background: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .badge-preview-area,
body.dark-mode .badge-preview-area,
[data-theme="dark"] .badge-preview-area {
  background: #0F172A !important;
  border-color: #334155 !important;
}

body.dark-theme .editor-card,
body.dark-mode .editor-card,
[data-theme="dark"] .editor-card {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .editor-card h4,
body.dark-mode .editor-card h4,
[data-theme="dark"] .editor-card h4 {
  color: #F1F5F9 !important;
  border-bottom-color: #334155 !important;
}

body.dark-theme .editor-card label,
body.dark-mode .editor-card label,
[data-theme="dark"] .editor-card label {
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 📊 20. GRÁFICOS & CARDS DE CONTABILIDADE     */
/* ============================================ */

body.dark-theme .chart-card,
body.dark-mode .chart-card,
[data-theme="dark"] .chart-card {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  color: #F1F5F9 !important;
}

body.dark-theme .chart-card h3,
body.dark-mode .chart-card h3,
[data-theme="dark"] .chart-card h3 {
  color: #F1F5F9 !important;
  border-bottom: 2px solid #334155 !important;
}

body.dark-theme .chart-container,
body.dark-mode .chart-container,
[data-theme="dark"] .chart-container {
  background-color: transparent !important;
}

/* ============================================ */
/* ⚙️ 21. CONFIGURAÇÃO DE CAMPISTAS & PASSOS   */
/* ============================================ */

body.dark-theme #campista-photo-doc-toggles-container,
body.dark-mode #campista-photo-doc-toggles-container,
[data-theme="dark"] #campista-photo-doc-toggles-container {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .step-builder-card,
body.dark-mode .step-builder-card,
[data-theme="dark"] .step-builder-card {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

body.dark-theme .step-card-header,
body.dark-mode .step-card-header,
[data-theme="dark"] .step-card-header {
  background-color: #0F172A !important;
  border-bottom: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .step-card-body,
body.dark-mode .step-card-body,
[data-theme="dark"] .step-card-body {
  background-color: #1E293B !important;
  color: #F1F5F9 !important;
}

body.dark-theme .selected-fields-list,
body.dark-mode .selected-fields-list,
[data-theme="dark"] .selected-fields-list {
  background-color: #0F172A !important;
  border: 2px dashed #334155 !important;
}

body.dark-theme .selected-field-item,
body.dark-mode .selected-field-item,
[data-theme="dark"] .selected-field-item {
  background-color: #1E293B !important;
  border: 1px solid #3B82F6 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .selected-field-item .field-item-label,
body.dark-mode .selected-field-item .field-item-label,
[data-theme="dark"] .selected-field-item .field-item-label {
  color: #F1F5F9 !important;
}

body.dark-theme .form-check.form-switch,
body.dark-mode .form-check.form-switch,
[data-theme="dark"] .form-check.form-switch {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #campista-welcome-wa-image-block,
body.dark-mode #campista-welcome-wa-image-block,
[data-theme="dark"] #campista-welcome-wa-image-block,
body.dark-theme #campista-welcome-wa-test-block,
body.dark-mode #campista-welcome-wa-test-block,
[data-theme="dark"] #campista-welcome-wa-test-block {
  background-color: #0F172A !important;
  border-left: 4px solid #10B981 !important;
  border-color: #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #campista-welcome-wa-disable-image-block,
body.dark-mode #campista-welcome-wa-disable-image-block,
[data-theme="dark"] #campista-welcome-wa-disable-image-block {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #wa-image-preview-container,
body.dark-mode #wa-image-preview-container,
[data-theme="dark"] #wa-image-preview-container {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

/* ============================================ */
/* ✉️ 22. SUB-ABAS DE E-MAIL, WHATSAPP & GERAIS */
/* ============================================ */

body.dark-theme .email-tabs-menu,
body.dark-mode .email-tabs-menu,
[data-theme="dark"] .email-tabs-menu {
  border-bottom: 1px solid #334155 !important;
}

body.dark-theme .email-template-card,
body.dark-mode .email-template-card,
[data-theme="dark"] .email-template-card,
body.dark-theme .wa-category-card,
body.dark-mode .wa-category-card,
[data-theme="dark"] .wa-category-card,
body.dark-theme .general-config-card,
body.dark-mode .general-config-card,
[data-theme="dark"] .general-config-card {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .email-template-card h4,
body.dark-mode .email-template-card h4,
[data-theme="dark"] .email-template-card h4,
body.dark-theme .wa-category-card h4,
body.dark-mode .wa-category-card h4,
[data-theme="dark"] .wa-category-card h4,
body.dark-theme .general-config-card h4,
body.dark-mode .general-config-card h4,
[data-theme="dark"] .general-config-card h4 {
  color: #F1F5F9 !important;
  border-bottom-color: #334155 !important;
}

body.dark-theme #email-wa-info-banner,
body.dark-mode #email-wa-info-banner,
[data-theme="dark"] #email-wa-info-banner {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-left: 4px solid #10B981 !important;
  color: #34D399 !important;
}

body.dark-theme .email-template-details,
body.dark-mode .email-template-details,
[data-theme="dark"] .email-template-details,
body.dark-theme .wa-category-card details,
body.dark-mode .wa-category-card details,
[data-theme="dark"] .wa-category-card details {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #CBD5E1 !important;
}

body.dark-theme .email-template-details summary,
body.dark-mode .email-template-details summary,
[data-theme="dark"] .email-template-details summary,
body.dark-theme .wa-category-card summary,
body.dark-mode .wa-category-card summary,
[data-theme="dark"] .wa-category-card summary {
  color: #94A3B8 !important;
}

body.dark-theme .email-template-details code,
body.dark-mode .email-template-details code,
[data-theme="dark"] .email-template-details code,
body.dark-theme .wa-category-card code,
body.dark-mode .wa-category-card code,
[data-theme="dark"] .wa-category-card code {
  background-color: #1E293B !important;
  color: #38BDF8 !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .env-location-item,
body.dark-mode .env-location-item,
[data-theme="dark"] .env-location-item {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .env-event-edition-card,
body.dark-mode .env-event-edition-card,
[data-theme="dark"] .env-event-edition-card {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .env-event-edition-card label,
body.dark-mode .env-event-edition-card label,
[data-theme="dark"] .env-event-edition-card label {
  color: #F1F5F9 !important;
}

body.dark-theme .event-edition-input,
body.dark-mode .event-edition-input,
[data-theme="dark"] .event-edition-input {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .edition-duration-tag,
body.dark-mode .edition-duration-tag,
[data-theme="dark"] .edition-duration-tag {
  background-color: #1E293B !important;
  border-color: #334155 !important;
  color: #94A3B8 !important;
}

body.dark-theme .edition-status-badge.in-progress,
body.dark-mode .edition-status-badge.in-progress,
[data-theme="dark"] .edition-status-badge.in-progress {
  background-color: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid #F59E0B !important;
  color: #FBBF24 !important;
}

body.dark-theme .edition-status-badge.auto-detected,
body.dark-mode .edition-status-badge.auto-detected,
[data-theme="dark"] .edition-status-badge.auto-detected {
  background-color: rgba(2, 132, 199, 0.15) !important;
  border: 1px solid #0284C7 !important;
  color: #38BDF8 !important;
}

body.dark-theme .edition-status-badge.no-data,
body.dark-mode .edition-status-badge.no-data,
[data-theme="dark"] .edition-status-badge.no-data {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #94A3B8 !important;
}

/* ============================================ */
/* 🧩 23. CONSTRUTOR DINÂMICO DE EVENTOS        */
/* ============================================ */

body.dark-theme .custom-event-section-block,
body.dark-mode .custom-event-section-block,
[data-theme="dark"] .custom-event-section-block {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .custom-event-section-block h5,
body.dark-mode .custom-event-section-block h5,
[data-theme="dark"] .custom-event-section-block h5 {
  color: #F1F5F9 !important;
}

body.dark-theme #custom-event-fields-grid,
body.dark-mode #custom-event-fields-grid,
[data-theme="dark"] #custom-event-fields-grid,
body.dark-theme #custom-event-teams-grid,
body.dark-mode #custom-event-teams-grid,
[data-theme="dark"] #custom-event-teams-grid,
body.dark-theme #custom-event-allowed-servants-grid,
body.dark-mode #custom-event-allowed-servants-grid,
[data-theme="dark"] #custom-event-allowed-servants-grid {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
}

body.dark-theme #custom-event-empty-panel,
body.dark-mode #custom-event-empty-panel,
[data-theme="dark"] #custom-event-empty-panel {
  background-color: #0F172A !important;
  border: 2px dashed #334155 !important;
  color: #94A3B8 !important;
}

body.dark-theme .tribe-name-input,
body.dark-mode .tribe-name-input,
[data-theme="dark"] .tribe-name-input {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .tribe-color-input,
body.dark-mode .tribe-color-input,
[data-theme="dark"] .tribe-color-input {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .team-chk-card,
body.dark-mode .team-chk-card,
[data-theme="dark"] .team-chk-card {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .team-chk-card label,
body.dark-mode .team-chk-card label,
[data-theme="dark"] .team-chk-card label {
  color: #F1F5F9 !important;
}

body.dark-theme .custom-team-row,
body.dark-mode .custom-team-row,
[data-theme="dark"] .custom-team-row {
  background-color: #0F172A !important;
  border: 1px dashed #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .custom-team-input,
body.dark-mode .custom-team-input,
[data-theme="dark"] .custom-team-input {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .custom-allowed-event-row,
body.dark-mode .custom-allowed-event-row,
[data-theme="dark"] .custom-allowed-event-row {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .custom-allowed-event-input,
body.dark-mode .custom-allowed-event-input,
[data-theme="dark"] .custom-allowed-event-input {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

/* ============================================ */
/* 🔍 24. RESULTADOS DE BUSCA / AUTOCOMPLETE   */
/* ============================================ */

body.dark-theme .search-results,
body.dark-mode .search-results,
[data-theme="dark"] .search-results,
body.dark-theme #sales-search-results,
body.dark-mode #sales-search-results,
[data-theme="dark"] #sales-search-results,
body.dark-theme #summary-search-results,
body.dark-mode #summary-search-results,
[data-theme="dark"] #summary-search-results,
body.dark-theme #credits-search-results,
body.dark-mode #credits-search-results,
[data-theme="dark"] #credits-search-results {
  background-color: #1E293B !important;
  border: 1px solid #334155 !important;
  border-top: none !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

body.dark-theme .search-result-item,
body.dark-mode .search-result-item,
[data-theme="dark"] .search-result-item {
  background-color: transparent !important;
  border-bottom: 1px solid #334155 !important;
  color: #E2E8F0 !important;
}

body.dark-theme .search-result-item:hover,
body.dark-mode .search-result-item:hover,
[data-theme="dark"] .search-result-item:hover {
  background-color: #334155 !important;
  color: #FFFFFF !important;
}

body.dark-theme .search-result-item.selected,
body.dark-mode .search-result-item.selected,
[data-theme="dark"] .search-result-item.selected {
  background-color: #243044 !important;
  border-left: 3px solid var(--primary-color) !important;
  color: #FFFFFF !important;
}

body.dark-theme .search-result-item.active-result,
body.dark-mode .search-result-item.active-result,
[data-theme="dark"] .search-result-item.active-result {
  background-color: var(--secondary-color) !important;
  color: #FFFFFF !important;
}

body.dark-theme .search-result-item small,
body.dark-mode .search-result-item small,
[data-theme="dark"] .search-result-item small {
  color: #94A3B8 !important;
}

/* ============================================ */
/* 🪙 ABA DE CRÉDITOS & GERENCIAMENTO          */
/* ============================================ */

body.dark-theme #credits-form-container .form-card,
body.dark-mode #credits-form-container .form-card,
[data-theme="dark"] #credits-form-container .form-card {
  background: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #credits-person-name,
body.dark-mode #credits-person-name,
[data-theme="dark"] #credits-person-name {
  color: #F1F5F9 !important;
}

body.dark-theme #credits-person-type,
body.dark-mode #credits-person-type,
[data-theme="dark"] #credits-person-type,
body.dark-theme #credits-person-rg,
body.dark-mode #credits-person-rg,
[data-theme="dark"] #credits-person-rg {
  background-color: #1E293B !important;
  color: #CBD5E1 !important;
  border-color: #334155 !important;
}

body.dark-theme .credits-amount-input,
body.dark-mode .credits-amount-input,
[data-theme="dark"] .credits-amount-input {
  background-color: #0F172A !important;
  color: #34D399 !important;
  border-color: #334155 !important;
}

body.dark-theme .credits-current-value-input,
body.dark-mode .credits-current-value-input,
[data-theme="dark"] .credits-current-value-input {
  background-color: #064E3B !important;
  color: #6EE7B7 !important;
  border-color: #059669 !important;
}

body.dark-theme .credits-search-grid select,
body.dark-mode .credits-search-grid select,
[data-theme="dark"] .credits-search-grid select {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}

body.dark-theme #credits-table thead,
body.dark-mode #credits-table thead,
[data-theme="dark"] #credits-table thead {
  background: #0F172A !important;
  color: #F1F5F9 !important;
}

body.dark-theme #credits-table tbody tr td:nth-child(6),
body.dark-mode #credits-table tbody tr td:nth-child(6),
[data-theme="dark"] #credits-table tbody tr td:nth-child(6) {
  color: #34D399 !important;
}

body.dark-theme #credits-table .btn-edit,
body.dark-mode #credits-table .btn-edit,
[data-theme="dark"] #credits-table .btn-edit {
  background: transparent !important;
  color: #818CF8 !important;
  border: 1px solid #818CF8 !important;
}

body.dark-theme #credits-table .btn-edit:hover,
body.dark-mode #credits-table .btn-edit:hover,
[data-theme="dark"] #credits-table .btn-edit:hover {
  background: rgba(129, 140, 248, 0.15) !important;
  color: #A5B4FC !important;
}

/* ============================================ */
/* 🛒 25. VENDAS & TOTAL DA VENDA               */
/* ============================================ */

body.dark-theme .sale-total-summary,
body.dark-mode .sale-total-summary,
[data-theme="dark"] .sale-total-summary {
  color: #F1F5F9 !important;
  border-top: 2px solid #334155 !important;
}

body.dark-theme .sale-total-summary strong,
body.dark-mode .sale-total-summary strong,
[data-theme="dark"] .sale-total-summary strong {
  color: #F1F5F9 !important;
}

body.dark-theme .sale-total-summary span,
body.dark-mode .sale-total-summary span,
[data-theme="dark"] .sale-total-summary span,
body.dark-theme #current-sale-total,
body.dark-mode #current-sale-total,
[data-theme="dark"] #current-sale-total {
  color: #34D399 !important;
  font-weight: 800 !important;
}

body.dark-theme #items-count-badge,
body.dark-mode #items-count-badge,
[data-theme="dark"] #items-count-badge,
body.dark-theme #servants-total-badge,
body.dark-mode #servants-total-badge,
[data-theme="dark"] #servants-total-badge,
body.dark-theme #total-sales-badge,
body.dark-mode #total-sales-badge,
[data-theme="dark"] #total-sales-badge {
  color: #94A3B8 !important;
}

body.dark-theme #items-count,
body.dark-mode #items-count,
[data-theme="dark"] #items-count,
body.dark-theme #servants-total,
body.dark-mode #servants-total,
[data-theme="dark"] #servants-total,
body.dark-theme #total-sales,
body.dark-mode #total-sales,
[data-theme="dark"] #total-sales {
  color: #38BDF8 !important;
}

body.dark-theme #config-current-event-info,
body.dark-mode #config-current-event-info,
[data-theme="dark"] #config-current-event-info {
  color: #94A3B8 !important;
  font-weight: normal !important;
}

body.dark-theme #config-current-event-info span,
body.dark-mode #config-current-event-info span,
[data-theme="dark"] #config-current-event-info span {
  color: #38BDF8 !important;
  font-weight: normal !important;
}

/* Modal de Pagamentos Pendentes */
body.dark-theme #pending-payments-modal .modal-content,
body.dark-mode #pending-payments-modal .modal-content,
[data-theme="dark"] #pending-payments-modal .modal-content {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
}

body.dark-theme .pending-item,
body.dark-mode .pending-item,
[data-theme="dark"] .pending-item {
  background-color: transparent !important;
  border-bottom: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme .pending-item:hover,
body.dark-mode .pending-item:hover,
[data-theme="dark"] .pending-item:hover {
  background-color: #334155 !important;
  color: #FFFFFF !important;
}

body.dark-theme .pending-info p,
body.dark-mode .pending-info p,
[data-theme="dark"] .pending-info p {
  color: #CBD5E1 !important;
}

body.dark-theme .pending-info strong,
body.dark-mode .pending-info strong,
[data-theme="dark"] .pending-info strong {
  color: #F1F5F9 !important;
}

/* Modal Gerenciador de Conexões WhatsApp */
body.dark-theme #whatsapp-manager-modal .custom-modal-content,
body.dark-mode #whatsapp-manager-modal .custom-modal-content,
[data-theme="dark"] #whatsapp-manager-modal .custom-modal-content {
  background: linear-gradient(145deg, #1A2332 0%, #1E293B 100%) !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
}

body.dark-theme #whatsapp-manager-modal .custom-modal-header,
body.dark-mode #whatsapp-manager-modal .custom-modal-header,
[data-theme="dark"] #whatsapp-manager-modal .custom-modal-header {
  border-bottom: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #whatsapp-manager-modal .custom-modal-body,
body.dark-mode #whatsapp-manager-modal .custom-modal-body,
[data-theme="dark"] #whatsapp-manager-modal .custom-modal-body {
  background: transparent !important;
  color: #F1F5F9 !important;
}

body.dark-theme #whatsapp-manager-modal #wa-manager-current-event-card,
body.dark-mode #whatsapp-manager-modal #wa-manager-current-event-card,
[data-theme="dark"] #whatsapp-manager-modal #wa-manager-current-event-card,
body.dark-theme #whatsapp-manager-modal .wa-manager-card,
body.dark-mode #whatsapp-manager-modal .wa-manager-card,
[data-theme="dark"] #whatsapp-manager-modal .wa-manager-card {
  background-color: #0F172A !important;
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
}

body.dark-theme #whatsapp-manager-modal .wa-manager-desc,
body.dark-mode #whatsapp-manager-modal .wa-manager-desc,
[data-theme="dark"] #whatsapp-manager-modal .wa-manager-desc,
body.dark-theme #whatsapp-manager-modal p,
body.dark-mode #whatsapp-manager-modal p,
[data-theme="dark"] #whatsapp-manager-modal p {
  color: #94A3B8 !important;
}

body.dark-theme #whatsapp-manager-modal h3,
body.dark-mode #whatsapp-manager-modal h3,
[data-theme="dark"] #whatsapp-manager-modal h3,
body.dark-theme #whatsapp-manager-modal h4,
body.dark-mode #whatsapp-manager-modal h4,
[data-theme="dark"] #whatsapp-manager-modal h4 {
  color: #F1F5F9 !important;
}

body.dark-theme #whatsapp-manager-modal table,
body.dark-mode #whatsapp-manager-modal table,
[data-theme="dark"] #whatsapp-manager-modal table,
body.dark-theme #whatsapp-manager-modal th,
body.dark-mode #whatsapp-manager-modal th,
[data-theme="dark"] #whatsapp-manager-modal th,
body.dark-theme #whatsapp-manager-modal td,
body.dark-mode #whatsapp-manager-modal td,
[data-theme="dark"] #whatsapp-manager-modal td {
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}

body.dark-theme #whatsapp-manager-modal thead tr,
body.dark-mode #whatsapp-manager-modal thead tr,
[data-theme="dark"] #whatsapp-manager-modal thead tr,
body.dark-theme #whatsapp-manager-modal .wa-table-header,
body.dark-mode #whatsapp-manager-modal .wa-table-header,
[data-theme="dark"] #whatsapp-manager-modal .wa-table-header {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
}

body.dark-theme #whatsapp-manager-modal tbody tr:hover,
body.dark-mode #whatsapp-manager-modal tbody tr:hover,
[data-theme="dark"] #whatsapp-manager-modal tbody tr:hover {
  background-color: #334155 !important;
}

body.dark-theme #whatsapp-manager-modal .custom-modal-footer,
body.dark-mode #whatsapp-manager-modal .custom-modal-footer,
[data-theme="dark"] #whatsapp-manager-modal .custom-modal-footer {
  border-top: 1px solid #334155 !important;
  background: transparent !important;
}

body.dark-theme #whatsapp-manager-modal .alert-success,
body.dark-mode #whatsapp-manager-modal .alert-success,
[data-theme="dark"] #whatsapp-manager-modal .alert-success {
  background-color: rgba(46, 204, 113, 0.15) !important;
  color: #34D399 !important;
  border: 1px solid #2ECC71 !important;
}

/* Footer Principal */
body.dark-theme .footer,
body.dark-mode .footer,
[data-theme="dark"] .footer,
body.dark-theme #main-footer,
body.dark-mode #main-footer,
[data-theme="dark"] #main-footer {
  color: #94A3B8 !important;
}

body.dark-theme .footer a,
body.dark-mode .footer a,
[data-theme="dark"] .footer a,
body.dark-theme #footer-dev-link,
body.dark-mode #footer-dev-link,
[data-theme="dark"] #footer-dev-link {
  color: #38BDF8 !important;
}

/* ============================================ */
/* 🖨️ IMPRESSÃO FÍSICA (@media print)          */
/* Garante folhas limpas em preto e branco      */
/* ============================================ */


@media print {
  html,
  body,
  html.dark-theme,
  body.dark-theme,
  html.dark-mode,
  body.dark-mode,
  [data-theme="dark"] {
    background: #FFFFFF !important;
    color: #000000 !important;
    color-scheme: light !important;
  }

  .screen,
  .card,
  .modal-content,
  .custom-modal-content,
  header,
  nav,
  table,
  th,
  td {
    background: #FFFFFF !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: #DDDDDD !important;
  }

  th {
    background-color: #F0F0F0 !important;
    color: #000000 !important;
  }

  tr:nth-child(even),
  tr:nth-child(odd) {
    background-color: transparent !important;
  }
}

/* =========================================================
   REGRAS FINAIS DARK MODE: MOBILE TEAM-HEADER-ROW
   ========================================================= */
@media (max-width: 768px) {
  body.dark-theme .team-header-row td,
  body.dark-mode .team-header-row td,
  [data-theme="dark"] .team-header-row td,
  body.dark-theme #people-table tr.team-header-row td,
  body.dark-mode #people-table tr.team-header-row td,
  [data-theme="dark"] #people-table tr.team-header-row td,
  body.dark-theme #servants-table tr.team-header-row td,
  body.dark-mode #servants-table tr.team-header-row td,
  [data-theme="dark"] #servants-table tr.team-header-row td {
    font-size: 0.60rem !important;
    padding: 3px 5px !important;
    line-height: 1.15 !important;
  }
}

@media (max-width: 480px) {
  body.dark-theme .team-header-row td,
  body.dark-mode .team-header-row td,
  [data-theme="dark"] .team-header-row td,
  body.dark-theme #people-table tr.team-header-row td,
  body.dark-mode #people-table tr.team-header-row td,
  [data-theme="dark"] #people-table tr.team-header-row td,
  body.dark-theme #servants-table tr.team-header-row td,
  body.dark-mode #servants-table tr.team-header-row td,
  [data-theme="dark"] #servants-table tr.team-header-row td {
    font-size: 0.54rem !important;
    padding: 2px 4px !important;
  }
}
