﻿/* =====================================================================
   SIGP • Tema Escuro unificado — InfoPublic 2026
   ---------------------------------------------------------------------
   ÚNICA fonte do tema dark da aplicação. Substitui:
     - ~/Content/dark-theme.css        (paleta cinza #1a1a1a)
     - ~/assets/css/darktheme.css      (paleta navy/roxa #141432)
   Regras:
     1. Toda cor do dark vem dos tokens --dk-* abaixo. Nada de hex solto
        em views/módulos: use var(--dk-...).
     2. O tema só muda CORES. Nunca altera layout (padding, width, display).
     3. Sidebar, topbar e rodapé são do sigp-shell.css — não estilizar aqui.
     4. Contraste validado (WCAG 2.1): texto >= 4.5:1, bordas de campos >= 3:1.
   Ordem de carga: depois do style.bundle/plugins e antes do sigp-shell.css.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. TOKENS
   --------------------------------------------------------------------- */

/* Variáveis legadas usadas por empenho-dark-theme.css e
   liquidacao-pagamento-dark-theme.css — valores claros (padrão). */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --modal-bg: #ffffff;
    --modal-content-bg: #ffffff;
    --table-bg: #ffffff;
    --table-hover: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    color-scheme: dark;

    /* Superfícies (do fundo para o mais elevado) */
    --dk-canvas: #0f1722;      /* fundo da página */
    --dk-surface: #151f2b;     /* portlets, cards, modais */
    --dk-surface-2: #1b2735;   /* cabeçalhos, thead, dropdowns, popovers */
    --dk-surface-3: #233144;   /* hover, botões neutros, chips */
    --dk-input: #1c2836;       /* campos de formulário */
    --dk-input-disabled: #18212d;
    --dk-overlay: rgba(5, 9, 15, 0.72);

    /* Bordas */
    --dk-border: #2b3a4d;        /* divisórias decorativas */
    --dk-border-strong: #3b4c63; /* separadores de destaque */
    --dk-border-input: #56698a;  /* contorno de campos (3:1) */

    /* Texto (contraste sobre --dk-surface) */
    --dk-text-strong: #f1f5f9;   /* títulos            14.6:1 */
    --dk-text: #e2e8f0;          /* texto padrão       13.5:1 */
    --dk-text-2: #cbd5e1;        /* labels, secundário 11.2:1 */
    --dk-muted: #9aa8bc;         /* apoio, legendas     6.9:1 */
    --dk-placeholder: #8494aa;   /* placeholder         5.4:1 */
    --dk-disabled: #64748b;

    /* Interação (identidade InfoPublic) */
    --dk-accent: #2dd4bf;
    --dk-accent-strong: #5eead4;
    --dk-accent-solid: #0f766e;  /* fundo sólido com texto branco 5.5:1 */
    --dk-accent-tint: rgba(45, 212, 191, 0.14);
    --dk-focus-ring: 0 0 0 3px rgba(45, 212, 191, 0.28);
    --dk-link: #5eead4;
    --dk-link-hover: #99f6e4;
    --dk-selected: #16413f;      /* linha/opção selecionada */

    /* Semânticas (texto sobre superfícies escuras) */
    --dk-primary: #8ea2ff;
    --dk-success: #4ade80;
    --dk-warning: #fbbf24;
    --dk-danger: #f87171;
    --dk-info: #60a5fa;
    --dk-primary-tint: rgba(93, 120, 255, 0.16);
    --dk-success-tint: rgba(74, 222, 128, 0.13);
    --dk-warning-tint: rgba(251, 191, 36, 0.13);
    --dk-danger-tint: rgba(248, 113, 113, 0.14);
    --dk-info-tint: rgba(96, 165, 250, 0.14);

    /* Elevação */
    --dk-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --dk-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --dk-shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);

    /* Aliases legados -> tokens (mantém arquivos antigos coerentes) */
    --bg-primary: var(--dk-canvas);
    --bg-secondary: var(--dk-surface-2);
    --bg-tertiary: var(--dk-surface-3);
    --text-primary: var(--dk-text);
    --text-secondary: var(--dk-muted);
    --border-color: var(--dk-border);
    --input-bg: var(--dk-input);
    --input-border: var(--dk-border-input);
    --modal-bg: var(--dk-surface);
    --modal-content-bg: var(--dk-surface);
    --table-bg: var(--dk-surface);
    --table-hover: var(--dk-surface-3);
    --card-bg: var(--dk-surface);
    --shadow: rgba(0, 0, 0, 0.45);

    background-color: var(--dk-canvas) !important;
    color: var(--dk-text) !important;
}

/* ---------------------------------------------------------------------
   2. BASE
   --------------------------------------------------------------------- */
body.dark-theme .kt-content,
body.dark-theme .kt-wrapper,
body.dark-theme .kt-body {
    background-color: transparent;
}

body.dark-theme ::selection {
    background: rgba(45, 212, 191, 0.32);
    color: #fff;
}

body.dark-theme :where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6):where(:not([class*="text-"]):not([class*="kt-font-"])) {
    color: var(--dk-text-strong);
}

body.dark-theme .kt-content :where(h1, h2, h3, h4, h5, h6):where(:not([class*="text-"]):not([class*="kt-font-"])),
body.dark-theme .modal :where(h1, h2, h3, h4, h5, h6):where(:not([class*="text-"]):not([class*="kt-font-"])) {
    color: var(--dk-text-strong);
}

body.dark-theme hr {
    border-color: var(--dk-border) !important;
}

body.dark-theme small:not([class*="text-"]),
body.dark-theme .small:not([class*="text-"]) {
    color: var(--dk-muted);
}

body.dark-theme .kt-content a:where(:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.kt-nav__link):not(.list-group-item):not([class*="text-"]):not([class*="kt-font-"])),
body.dark-theme .modal a:where(:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item):not([class*="text-"]):not([class*="kt-font-"])) {
    color: var(--dk-link);
}

    body.dark-theme .kt-content a:where(:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.kt-nav__link):not(.list-group-item):not([class*="text-"]):not([class*="kt-font-"])):hover,
    body.dark-theme .modal a:where(:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item):not([class*="text-"]):not([class*="kt-font-"])):hover {
        color: var(--dk-link-hover);
    }

body.dark-theme code {
    color: #f9a8d4;
}

body.dark-theme pre,
body.dark-theme kbd {
    background-color: var(--dk-surface-2);
    color: var(--dk-text);
    border-color: var(--dk-border);
}

body.dark-theme :focus-visible {
    outline-color: var(--dk-accent);
}

/* Rodapé (logo e © ficam no sigp-shell.css) */
body.dark-theme .kt-footer,
body.dark-theme .kt-footer.kt-grid,
body.dark-theme .kt-footer .kt-container {
    background: var(--dk-surface) !important;
    border-top-color: var(--dk-border) !important;
    color: var(--dk-muted) !important;
}

body.dark-theme .kt-footer {
    border-top: 1px solid var(--dk-border) !important;
}

    /* Logo InfoPublic sempre branca no escuro (img ou svg inline) */
    body.dark-theme .kt-footer .kt-footer__copyright img,
    body.dark-theme .kt-footer .kt-footer__copyright svg,
    body.dark-theme .kt-footer .logo-min {
        filter: brightness(0) invert(1) !important;
    }

    body.dark-theme .kt-footer .kt-footer__menu .kt-footer__menu-link,
    body.dark-theme .kt-footer .kt-link {
        color: var(--dk-text-2) !important;
    }

/* Scrollbars */
body.dark-theme,
body.dark-theme * {
    scrollbar-color: var(--dk-border-strong) transparent;
}

    body.dark-theme ::-webkit-scrollbar-track {
        background: transparent;
    }

    body.dark-theme ::-webkit-scrollbar-thumb {
        background-color: var(--dk-border-strong);
        border-radius: 8px;
    }

        body.dark-theme ::-webkit-scrollbar-thumb:hover {
            background-color: #4d6280;
        }

/* ---------------------------------------------------------------------
   3. UTILITÁRIOS BOOTSTRAP / KEEN (cores claras fixas no markup)
   --------------------------------------------------------------------- */
body.dark-theme .bg-white:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme .bg-light:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme .kt-bg-light:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)) {
    background-color: var(--dk-surface-2) !important;
}

body.dark-theme .text-dark,
body.dark-theme .text-body,
body.dark-theme .kt-font-dark,
body.dark-theme .text-black-50 {
    color: var(--dk-text) !important;
}

body.dark-theme .text-muted,
body.dark-theme .form-text,
body.dark-theme .kt-font-light,
body.dark-theme .text-secondary {
    color: var(--dk-muted) !important;
}

body.dark-theme .text-primary, body.dark-theme .kt-font-primary, body.dark-theme .kt-font-brand { color: var(--dk-primary) !important; }
body.dark-theme .text-success, body.dark-theme .kt-font-success { color: var(--dk-success) !important; }
body.dark-theme .text-warning, body.dark-theme .kt-font-warning { color: var(--dk-warning) !important; }
body.dark-theme .text-danger,  body.dark-theme .kt-font-danger  { color: var(--dk-danger) !important; }
body.dark-theme .text-info,    body.dark-theme .kt-font-info    { color: var(--dk-info) !important; }

body.dark-theme .border,
body.dark-theme .border-top,
body.dark-theme .border-right,
body.dark-theme .border-bottom,
body.dark-theme .border-left,
body.dark-theme .border-light,
body.dark-theme .border-secondary,
body.dark-theme .border-dark {
    border-color: var(--dk-border) !important;
}

body.dark-theme .border-primary {
    border-color: var(--dk-border-strong) !important;
}

body.dark-theme .shadow,
body.dark-theme .shadow-sm {
    box-shadow: var(--dk-shadow-sm) !important;
}

/* ---------------------------------------------------------------------
   4. SUBHEADER, PORTLETS, CARDS
   --------------------------------------------------------------------- */
body.dark-theme .kt-subheader .kt-subheader__title,
body.dark-theme .kt-subheader__main,
body.dark-theme .kt-subheader__toolbar,
body.dark-theme .kt-subheader_wrapper h6 {
    color: var(--dk-text-strong) !important;
}

body.dark-theme .kt-subheader .kt-subheader__desc,
body.dark-theme .kt-subheader .kt-subheader__breadcrumbs .kt-subheader__breadcrumbs-link,
body.dark-theme .kt-subheader .kt-subheader__breadcrumbs .kt-subheader__breadcrumbs-separator {
    color: var(--dk-muted) !important;
}

body.dark-theme .kt-subheader .kt-subheader__separator {
    background: var(--dk-border) !important;
}

body.dark-theme .kt-portlet,
body.dark-theme .card,
body.dark-theme .card.card-body,
body.dark-theme .accordion .card {
    background-color: var(--dk-surface) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text) !important;
    box-shadow: var(--dk-shadow-sm) !important;
}

body.dark-theme .kt-portlet .kt-portlet__head,
body.dark-theme .card-header {
    background-color: var(--dk-surface) !important;
    border-bottom-color: var(--dk-border) !important;
    color: var(--dk-text-strong) !important;
}

body.dark-theme .kt-portlet .kt-portlet__body,
body.dark-theme .card-body {
    background-color: transparent !important;
    color: var(--dk-text) !important;
}

body.dark-theme .kt-portlet .kt-portlet__foot,
body.dark-theme .card-footer {
    background-color: var(--dk-surface) !important;
    border-top-color: var(--dk-border) !important;
}

body.dark-theme .kt-portlet .kt-portlet__head .kt-portlet__head-label .kt-portlet__head-title,
body.dark-theme .card-title {
    color: var(--dk-text-strong) !important;
}

body.dark-theme .kt-portlet .kt-portlet__head .kt-portlet__head-label .kt-portlet__head-icon {
    color: var(--dk-muted);
}

/* Portlet dentro de portlet / modal: um degrau acima */
body.dark-theme .kt-portlet .kt-portlet,
body.dark-theme .kt-portlet .card,
body.dark-theme .modal .kt-portlet,
body.dark-theme .modal .card {
    background-color: var(--dk-surface-2) !important;
    box-shadow: none !important;
}

    body.dark-theme .kt-portlet .kt-portlet .kt-portlet__head,
    body.dark-theme .kt-portlet .card .card-header,
    body.dark-theme .modal .kt-portlet .kt-portlet__head,
    body.dark-theme .modal .card .card-header {
        background-color: var(--dk-surface-2) !important;
    }

body.dark-theme .accordion .card-header:hover {
    background-color: var(--dk-surface-3) !important;
}

body.dark-theme .collapse,
body.dark-theme .collapsing,
body.dark-theme .tab-content,
body.dark-theme .tab-pane {
    background-color: transparent !important;
    color: inherit;
}

/* Fieldsets / legends (apenas cor, sem mudar layout) */
body.dark-theme fieldset {
    border-color: var(--dk-border);
}

body.dark-theme legend,
body.dark-theme .legend.col-12 {
    color: var(--dk-text-strong) !important;
    border-color: var(--dk-border) !important;
}

body.dark-theme .legend.col-12 {
    background-color: var(--dk-surface-2) !important;
}

body.dark-theme .kt-section .kt-section__title,
body.dark-theme .kt-section .kt-section__info {
    color: var(--dk-text-strong) !important;
}

body.dark-theme .kt-section .kt-section__desc,
body.dark-theme .kt-section .kt-section__sub {
    color: var(--dk-muted) !important;
}

body.dark-theme .kt-section .kt-section__content.kt-section__content--solid,
body.dark-theme .kt-section .kt-section__content.kt-section__content--border {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border) !important;
}

/* ---------------------------------------------------------------------
   5. FORMULÁRIOS
   --------------------------------------------------------------------- */
body.dark-theme label,
body.dark-theme .col-form-label,
body.dark-theme .form-check-label,
body.dark-theme .custom-control-label {
    color: var(--dk-text-2);
}

body.dark-theme .kt-content label:where(:not([class*="text-"]):not([class*="kt-font-"])),
body.dark-theme .modal label:where(:not([class*="text-"]):not([class*="kt-font-"])) {
    color: var(--dk-text-2) !important;
}

body.dark-theme .form-control:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme .custom-select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme .custom-file-label:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme textarea:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="text"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="search"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="email"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="password"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="number"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="tel"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="url"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="date"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="datetime-local"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="month"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="time"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)) {
    background-color: var(--dk-input) !important;
    border-color: var(--dk-border-input) !important;
    color: var(--dk-text) !important;
}

    body.dark-theme .form-control:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):hover:not(:disabled):not([readonly]),
    body.dark-theme .custom-select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):hover:not(:disabled) {
        border-color: #6b80a3 !important;
    }

    body.dark-theme .form-control:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):focus,
    body.dark-theme .custom-select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):focus,
    body.dark-theme select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):focus,
    body.dark-theme textarea:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):focus,
    body.dark-theme input:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):focus {
        border-color: var(--dk-accent) !important;
        box-shadow: var(--dk-focus-ring) !important;
        outline: none;
    }

    body.dark-theme .form-control:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *))::placeholder,
    body.dark-theme textarea:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *))::placeholder,
    body.dark-theme input:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *))::placeholder {
        color: var(--dk-placeholder) !important;
        opacity: 1;
    }

    body.dark-theme .form-control:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):disabled,
    body.dark-theme .form-control:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *))[readonly],
    body.dark-theme .custom-select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):disabled,
    body.dark-theme select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):disabled,
    body.dark-theme textarea:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):disabled,
    body.dark-theme textarea:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *))[readonly],
    body.dark-theme input:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)):disabled,
    body.dark-theme input:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *))[readonly] {
        background-color: var(--dk-input-disabled) !important;
        border-color: var(--dk-border) !important;
        color: var(--dk-muted) !important;
        opacity: 1;
    }

body.dark-theme select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)) option,
body.dark-theme select:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)) optgroup {
    background-color: var(--dk-surface-2);
    color: var(--dk-text);
}

body.dark-theme .form-control-plaintext {
    color: var(--dk-text) !important;
}

body.dark-theme .input-group-text {
    background-color: var(--dk-surface-3) !important;
    border-color: var(--dk-border-input) !important;
    color: var(--dk-text-2) !important;
}

body.dark-theme .input-group-append .btn,
body.dark-theme .input-group-prepend .btn {
    border-color: var(--dk-border-input) !important;
}

body.dark-theme input[type="checkbox"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="radio"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme input[type="range"]:where(:not(#kt_header *, #kt_aside *, #kt_header_mobile *)),
body.dark-theme progress {
    accent-color: var(--dk-accent-solid);
    filter: none !important;
}

/* Keen checkbox / radio / switch */
body.dark-theme .kt-checkbox > span,
body.dark-theme .kt-radio > span {
    background-color: var(--dk-input) !important;
    border-color: var(--dk-border-input) !important;
}

body.dark-theme .kt-checkbox > span:after {
    border-color: var(--dk-text-strong) !important;
}

body.dark-theme .kt-radio > span:after {
    border-color: var(--dk-text-strong) !important;
    background: var(--dk-text-strong) !important;
}

body.dark-theme .kt-checkbox > input:checked ~ span,
body.dark-theme .kt-radio > input:checked ~ span {
    background-color: var(--dk-accent-solid) !important;
    border-color: var(--dk-accent-solid) !important;
}

    body.dark-theme .kt-checkbox > input:checked ~ span:after {
        border-color: #fff !important;
    }

    body.dark-theme .kt-radio > input:checked ~ span:after {
        border-color: #fff !important;
        background: #fff !important;
    }

body.dark-theme .kt-checkbox.kt-checkbox--disabled,
body.dark-theme .kt-radio.kt-radio--disabled {
    opacity: 0.55;
}

body.dark-theme .kt-switch input:empty ~ span:before {
    background-color: var(--dk-surface-3) !important;
}

body.dark-theme .kt-switch input:empty ~ span:after {
    background-color: #94a3b8 !important;
    color: var(--dk-surface) !important;
}

body.dark-theme .kt-switch input:checked ~ span:before {
    background-color: var(--dk-accent-solid) !important;
}

body.dark-theme .kt-switch input:checked ~ span:after {
    background-color: #fff !important;
    color: var(--dk-accent-solid) !important;
}

body.dark-theme .custom-control-label::before {
    background-color: var(--dk-input) !important;
    border-color: var(--dk-border-input) !important;
}

body.dark-theme .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--dk-accent-solid) !important;
    border-color: var(--dk-accent-solid) !important;
}

/* Validação */
body.dark-theme .field-validation-error,
body.dark-theme .txtvalida,
body.dark-theme .invalid-feedback,
body.dark-theme .txtobs {
    color: var(--dk-danger) !important;
}

body.dark-theme .form-control.is-invalid,
body.dark-theme .input-validation-error {
    border-color: var(--dk-danger) !important;
}

body.dark-theme .form-control.is-valid {
    border-color: var(--dk-success) !important;
}

/* ---------------------------------------------------------------------
   6. BOTÕES (só os neutros mudam; semânticos mantêm a cor da marca)
   --------------------------------------------------------------------- */
body.dark-theme .btn.btn-secondary,
body.dark-theme .btn.btn-light,
body.dark-theme .btn.btn-default,
body.dark-theme .btn.btn-metal,
body.dark-theme .btn.btn-outline-secondary,
body.dark-theme .btn.btn-outline-dark,
body.dark-theme .btn.btn-outline-light {
    background-color: var(--dk-surface-3) !important;
    border-color: var(--dk-border-strong) !important;
    color: var(--dk-text) !important;
}

    body.dark-theme .btn.btn-secondary:hover,
    body.dark-theme .btn.btn-light:hover,
    body.dark-theme .btn.btn-default:hover,
    body.dark-theme .btn.btn-metal:hover,
    body.dark-theme .btn.btn-outline-secondary:hover,
    body.dark-theme .btn.btn-outline-dark:hover,
    body.dark-theme .btn.btn-outline-light:hover,
    body.dark-theme .btn.btn-secondary:not(:disabled):not(.disabled).active,
    body.dark-theme .btn.btn-light:not(:disabled):not(.disabled).active,
    body.dark-theme .btn.btn-default:not(:disabled):not(.disabled).active {
        background-color: #2c3d54 !important;
        border-color: #4d6280 !important;
        color: var(--dk-text-strong) !important;
    }

body.dark-theme .btn.btn-clean,
body.dark-theme .btn.btn-link {
    color: var(--dk-text-2) !important;
}

    body.dark-theme .btn.btn-clean:hover {
        background-color: var(--dk-surface-3) !important;
        color: var(--dk-text-strong) !important;
    }

body.dark-theme .btn.btn-outline-brand,
body.dark-theme .btn.btn-outline-primary {
    background-color: transparent !important;
    border-color: #6d84ff !important;
    color: var(--dk-primary) !important;
}

    body.dark-theme .btn.btn-outline-brand:hover,
    body.dark-theme .btn.btn-outline-primary:hover {
        background-color: #5d78ff !important;
        border-color: #5d78ff !important;
        color: #fff !important;
    }

body.dark-theme .btn:focus-visible,
body.dark-theme .btn.focus {
    box-shadow: var(--dk-focus-ring) !important;
}

body.dark-theme .btn:disabled,
body.dark-theme .btn.disabled {
    opacity: 0.5;
}

body.dark-theme .close,
body.dark-theme .modal .close {
    color: var(--dk-text) !important;
    text-shadow: none !important;
    opacity: 0.7;
}

    body.dark-theme .close:hover,
    body.dark-theme .modal .close:hover {
        opacity: 1;
    }

/* ---------------------------------------------------------------------
   7. TABELAS (Bootstrap, MvcGrid, tabelas simples)
   --------------------------------------------------------------------- */
body.dark-theme .table,
body.dark-theme .kt-content table,
body.dark-theme .modal table {
    background-color: transparent !important;
    color: var(--dk-text) !important;
    border-color: var(--dk-border) !important;
}

body.dark-theme .table th,
body.dark-theme .table td,
body.dark-theme .kt-content table th,
body.dark-theme .kt-content table td,
body.dark-theme .modal table th,
body.dark-theme .modal table td,
body.dark-theme .table-bordered {
    border-color: var(--dk-border) !important;
}

body.dark-theme .table td,
body.dark-theme .kt-content table td,
body.dark-theme .modal table td {
    color: inherit;
}

/* Fundo neutro das linhas: neutraliza cores claras herdadas, preservando
   linhas com estado (table-*, selecionado, active) */
body.dark-theme :where(.kt-content, .modal) table tbody tr:where(:not([class*="table-"]):not([class*="bg-"]):not([style*="background"]):not(.selecionado):not(.selected):not(.active)) {
    background-color: transparent !important;
}

body.dark-theme .table thead th,
body.dark-theme .table .thead-light th,
body.dark-theme .table .thead-dark th,
body.dark-theme .kt-content table thead th,
body.dark-theme .modal table thead th,
body.dark-theme .mvc-grid th {
    background-color: var(--dk-surface-2) !important;
    color: var(--dk-text-2) !important;
    border-color: var(--dk-border) !important;
}

body.dark-theme .table-striped tbody tr:nth-of-type(odd):where(:not([class*="table-"]):not([class*="bg-"]):not([style*="background"]):not(.selecionado):not(.selected):not(.active)) {
    background-color: rgba(255, 255, 255, 0.025) !important;
}

body.dark-theme .table-hover tbody tr:hover,
body.dark-theme :where(.kt-content, .modal) table tbody tr:where(:not([class*="table-"]):not([class*="bg-"]):not(.selecionado):not(.selected):not(.active)):hover,
body.dark-theme .mvc-grid tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Hover: o Keen define color:#212529 em .table-hover tr:hover — no escuro
   isso deixava o texto quase invisível. Texto sempre claro no hover. */
body.dark-theme .table-hover tbody tr:hover,
body.dark-theme .table-hover tbody tr:hover > td,
body.dark-theme .mvc-grid tbody tr:hover,
body.dark-theme .mvc-grid tbody tr:hover > td,
body.dark-theme :where(.kt-content, .modal) table tbody tr:hover > td {
    color: var(--dk-text-strong) !important;
}

/* Linha selecionada (classe .selecionado / .selected / .active):
   fundo teal escuro + barra de destaque à esquerda; vale também no hover */
body.dark-theme table tbody tr.selecionado,
body.dark-theme table tbody tr.selected,
body.dark-theme table tbody tr.active,
body.dark-theme table tbody tr.selecionado:hover,
body.dark-theme table tbody tr.selected:hover,
body.dark-theme table tbody tr.active:hover,
body.dark-theme .table tbody tr.selecionado,
body.dark-theme .mvc-grid tbody tr.selecionado,
body.dark-theme .table-active,
body.dark-theme .table-active > td,
body.dark-theme .table-active > th {
    background-color: var(--dk-selected) !important;
    color: var(--dk-text-strong) !important;
}

    body.dark-theme table tbody tr.selecionado > td,
    body.dark-theme table tbody tr.selected > td {
        background-color: transparent !important;
        color: var(--dk-text-strong) !important;
        font-weight: 600;
    }

    body.dark-theme table tbody tr.selecionado > td:first-child,
    body.dark-theme table tbody tr.selected > td:first-child {
        box-shadow: inset 4px 0 0 var(--dk-accent);
    }

body.dark-theme .table-light,
body.dark-theme .table-light > td,
body.dark-theme .table-light > th {
    background-color: var(--dk-surface-2) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .table-success, body.dark-theme .table-success > td, body.dark-theme .table-success > th { background-color: var(--dk-success-tint) !important; color: var(--dk-text) !important; }
body.dark-theme .table-warning, body.dark-theme .table-warning > td, body.dark-theme .table-warning > th { background-color: var(--dk-warning-tint) !important; color: var(--dk-text) !important; }
body.dark-theme .table-danger,  body.dark-theme .table-danger > td,  body.dark-theme .table-danger > th  { background-color: var(--dk-danger-tint) !important;  color: var(--dk-text) !important; }
body.dark-theme .table-info,    body.dark-theme .table-info > td,    body.dark-theme .table-info > th    { background-color: var(--dk-info-tint) !important;    color: var(--dk-text) !important; }
body.dark-theme .table-primary, body.dark-theme .table-primary > td, body.dark-theme .table-primary > th { background-color: var(--dk-primary-tint) !important; color: var(--dk-text) !important; }

body.dark-theme .table-responsive {
    border-color: var(--dk-border);
}

/* MvcGrid (NonFactors) */
body.dark-theme .mvc-grid,
body.dark-theme .mvc-grid table {
    border-color: var(--dk-border) !important;
}

body.dark-theme .mvc-grid-pager button,
body.dark-theme .mvc-grid-pager .mvc-grid-pager-rows {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text-2) !important;
}

    body.dark-theme .mvc-grid-pager button.active {
        background-color: var(--dk-accent-solid) !important;
        border-color: var(--dk-accent-solid) !important;
        color: #fff !important;
    }

body.dark-theme .mvc-grid-popup {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text) !important;
    box-shadow: var(--dk-shadow) !important;
}

/* ---------------------------------------------------------------------
   8. MODAIS, DROPDOWNS, POPOVERS, TOOLTIPS
   --------------------------------------------------------------------- */
body.dark-theme .modal-backdrop.show {
    background-color: #000 !important;
    opacity: 0.65;
}

body.dark-theme .modal-dialog {
    background-color: transparent !important;
}

body.dark-theme .modal-content,
body.dark-theme #modal-content {
    background-color: var(--dk-surface) !important;
    border: 1px solid var(--dk-border-strong) !important;
    color: var(--dk-text) !important;
    box-shadow: var(--dk-shadow-lg) !important;
}

body.dark-theme .modal-header {
    background-color: var(--dk-surface) !important;
    border-bottom-color: var(--dk-border) !important;
    color: var(--dk-text-strong) !important;
}

    body.dark-theme .modal-header .modal-title {
        color: var(--dk-text-strong) !important;
    }

body.dark-theme .modal-body {
    background-color: transparent !important;
    color: var(--dk-text) !important;
}

body.dark-theme .modal-footer {
    background-color: var(--dk-surface) !important;
    border-top-color: var(--dk-border) !important;
}

body.dark-theme #myModal {
    background-color: var(--dk-overlay) !important;
}

body.dark-theme #meuIframe {
    background-color: var(--dk-surface) !important;
}

body.dark-theme .dropdown-menu {
    background-color: var(--dk-surface-2) !important;
    border: 1px solid var(--dk-border) !important;
    box-shadow: var(--dk-shadow) !important;
    color: var(--dk-text) !important;
}

    body.dark-theme .dropdown-menu .dropdown-item,
    body.dark-theme .dropdown-menu > a,
    body.dark-theme .dropdown-menu > li > a,
    body.dark-theme .dropdown-menu .kt-nav .kt-nav__item .kt-nav__link .kt-nav__link-text {
        color: var(--dk-text) !important;
    }

        body.dark-theme .dropdown-menu .dropdown-item:hover,
        body.dark-theme .dropdown-menu .dropdown-item:focus,
        body.dark-theme .dropdown-menu > a:hover,
        body.dark-theme .dropdown-menu > li > a:hover,
        body.dark-theme .dropdown-menu .kt-nav .kt-nav__item .kt-nav__link:hover {
            background-color: var(--dk-surface-3) !important;
            color: var(--dk-text-strong) !important;
        }

        body.dark-theme .dropdown-menu .dropdown-item.active,
        body.dark-theme .dropdown-menu .dropdown-item:active {
            background-color: var(--dk-selected) !important;
            color: var(--dk-text-strong) !important;
        }

    body.dark-theme .dropdown-menu .dropdown-divider,
    body.dark-theme .dropdown-menu .kt-nav__separator {
        border-color: var(--dk-border) !important;
    }

    body.dark-theme .dropdown-menu .dropdown-header {
        color: var(--dk-muted) !important;
    }

body.dark-theme .popover {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border) !important;
    box-shadow: var(--dk-shadow) !important;
}

    body.dark-theme .popover .popover-header {
        background-color: var(--dk-surface-3) !important;
        border-bottom-color: var(--dk-border) !important;
        color: var(--dk-text-strong) !important;
    }

    body.dark-theme .popover .popover-body {
        color: var(--dk-text) !important;
    }

    body.dark-theme .popover .arrow::after {
        border-top-color: var(--dk-surface-2) !important;
        border-bottom-color: var(--dk-surface-2) !important;
    }

body.dark-theme .tooltip .tooltip-inner {
    background-color: #2c3d54 !important;
    color: var(--dk-text-strong) !important;
    box-shadow: var(--dk-shadow) !important;
}

body.dark-theme .tooltip.bs-tooltip-top .arrow::before { border-top-color: #2c3d54 !important; }
body.dark-theme .tooltip.bs-tooltip-bottom .arrow::before { border-bottom-color: #2c3d54 !important; }
body.dark-theme .tooltip.bs-tooltip-left .arrow::before { border-left-color: #2c3d54 !important; }
body.dark-theme .tooltip.bs-tooltip-right .arrow::before { border-right-color: #2c3d54 !important; }

/* ---------------------------------------------------------------------
   9. NAVEGAÇÃO: tabs, pills, paginação, list-group
   --------------------------------------------------------------------- */
body.dark-theme .nav-tabs {
    border-bottom-color: var(--dk-border) !important;
}

    body.dark-theme .nav-tabs .nav-link {
        background-color: transparent !important;
        color: var(--dk-muted) !important;
        border-color: transparent !important;
    }

        body.dark-theme .nav-tabs .nav-link:hover {
            color: var(--dk-text-strong) !important;
            border-color: transparent transparent var(--dk-border-strong) !important;
        }

        body.dark-theme .nav-tabs .nav-link.active,
        body.dark-theme .nav-tabs .nav-item.show .nav-link {
            background-color: var(--dk-surface) !important;
            color: var(--dk-text-strong) !important;
            border-color: var(--dk-border) var(--dk-border) var(--dk-surface) !important;
        }

body.dark-theme .nav-tabs.nav-tabs-line .nav-link.active,
body.dark-theme .nav-tabs.nav-tabs-line .nav-item.show .nav-link {
    background-color: transparent !important;
    border-color: transparent transparent var(--dk-accent) !important;
}

body.dark-theme .nav-pills .nav-link {
    background-color: transparent !important;
    color: var(--dk-text-2) !important;
}

    body.dark-theme .nav-pills .nav-link:hover {
        background-color: var(--dk-surface-3) !important;
        color: var(--dk-text-strong) !important;
    }

    body.dark-theme .nav-pills .nav-link.active,
    body.dark-theme .nav-pills .show > .nav-link {
        background-color: var(--dk-accent-solid) !important;
        color: #fff !important;
    }

body.dark-theme .nav-pills.shadow-sm,
body.dark-theme .nav-pills.rounded-pill {
    background-color: var(--dk-surface-2) !important;
}

body.dark-theme .pagination .page-link {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text-2) !important;
}

    body.dark-theme .pagination .page-link:hover {
        background-color: var(--dk-surface-3) !important;
        color: var(--dk-text-strong) !important;
    }

body.dark-theme .pagination .page-item.active .page-link {
    background-color: var(--dk-accent-solid) !important;
    border-color: var(--dk-accent-solid) !important;
    color: #fff !important;
}

body.dark-theme .pagination .page-item.disabled .page-link {
    background-color: var(--dk-surface) !important;
    color: var(--dk-disabled) !important;
}

body.dark-theme .list-group-item {
    background-color: var(--dk-surface) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .list-group-item-action:hover,
body.dark-theme .list-group-item-action:focus {
    background-color: var(--dk-surface-3) !important;
}

body.dark-theme .list-group-item.active {
    background-color: var(--dk-selected) !important;
    border-color: var(--dk-accent-solid) !important;
    color: var(--dk-text-strong) !important;
}

body.dark-theme .breadcrumb {
    background-color: var(--dk-surface-2) !important;
}

/* ---------------------------------------------------------------------
   10. FEEDBACK: alertas, badges, progresso, loaders
   --------------------------------------------------------------------- */
/* Alertas semânticos (sólidos do Keen) permanecem; os neutros ficam escuros */
body.dark-theme .alert.alert-light,
body.dark-theme .alert.alert-secondary,
body.dark-theme .alert.alert-elevate:not([class*="alert-solid"]):not(.alert-primary):not(.alert-success):not(.alert-warning):not(.alert-danger):not(.alert-info):not(.alert-brand) {
    background-color: var(--dk-surface-2) !important;
    border: 1px solid var(--dk-border) !important;
    color: var(--dk-text) !important;
}

    body.dark-theme .alert.alert-light .alert-text,
    body.dark-theme .alert.alert-secondary .alert-text {
        color: var(--dk-text) !important;
    }

    body.dark-theme .alert.alert-light .alert-icon i,
    body.dark-theme .alert.alert-secondary .alert-icon i {
        color: var(--dk-accent) !important;
    }

body.dark-theme .alert.alert-outline-primary,
body.dark-theme .alert.alert-outline-brand { background-color: var(--dk-primary-tint) !important; color: var(--dk-text) !important; }
body.dark-theme .alert.alert-outline-success { background-color: var(--dk-success-tint) !important; color: var(--dk-text) !important; }
body.dark-theme .alert.alert-outline-warning { background-color: var(--dk-warning-tint) !important; color: var(--dk-text) !important; }
body.dark-theme .alert.alert-outline-danger  { background-color: var(--dk-danger-tint) !important;  color: var(--dk-text) !important; }
body.dark-theme .alert.alert-outline-info    { background-color: var(--dk-info-tint) !important;    color: var(--dk-text) !important; }

body.dark-theme .badge.badge-light,
body.dark-theme .badge.badge-secondary,
body.dark-theme .kt-badge.kt-badge--light,
body.dark-theme .kt-badge.kt-badge--metal {
    background-color: var(--dk-surface-3) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .progress {
    background-color: var(--dk-surface-3) !important;
}

body.dark-theme #loaderDivSelecionaridLoa,
body.dark-theme #loaderDiv,
body.dark-theme .loadList {
    background-color: rgba(15, 23, 34, 0.88) !important;
}

/* ---------------------------------------------------------------------
   11. PLUGINS
   --------------------------------------------------------------------- */
/* Select2 (default e bootstrap4) */
body.dark-theme .select2-container--default .select2-selection--single,
body.dark-theme .select2-container--default .select2-selection--multiple,
body.dark-theme .select2-container--bootstrap4 .select2-selection,
body.dark-theme .select2-container--bootstrap4 .select2-selection--single,
body.dark-theme .select2-container--bootstrap4 .select2-selection--multiple {
    background-color: var(--dk-input) !important;
    border-color: var(--dk-border-input) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .select2-container .select2-selection__rendered {
    color: var(--dk-text) !important;
}

body.dark-theme .select2-container .select2-selection__placeholder {
    color: var(--dk-placeholder) !important;
}

body.dark-theme .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.dark-theme .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    border-color: var(--dk-text-2) transparent transparent transparent !important;
}

body.dark-theme .select2-container--default.select2-container--focus .select2-selection,
body.dark-theme .select2-container--default.select2-container--open .select2-selection,
body.dark-theme .select2-container--bootstrap4.select2-container--focus .select2-selection,
body.dark-theme .select2-container--bootstrap4.select2-container--open .select2-selection {
    border-color: var(--dk-accent) !important;
    box-shadow: var(--dk-focus-ring) !important;
}

body.dark-theme .select2-container--default .select2-selection--multiple .select2-selection__choice,
body.dark-theme .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--dk-surface-3) !important;
    border-color: var(--dk-border-strong) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .select2-dropdown {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border-strong) !important;
    box-shadow: var(--dk-shadow) !important;
}

body.dark-theme .select2-results__option {
    background-color: transparent !important;
    color: var(--dk-text) !important;
}

body.dark-theme .select2-container--default .select2-results__option[aria-selected=true],
body.dark-theme .select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
    background-color: var(--dk-selected) !important;
    color: var(--dk-text-strong) !important;
}

body.dark-theme .select2-container--default .select2-results__option--highlighted[aria-selected],
body.dark-theme .select2-container--bootstrap4 .select2-results__option--highlighted,
body.dark-theme .select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--dk-surface-3) !important;
    color: var(--dk-text-strong) !important;
}

body.dark-theme .select2-search--dropdown .select2-search__field,
body.dark-theme .select2-search__field {
    background-color: var(--dk-input) !important;
    border-color: var(--dk-border-input) !important;
    color: var(--dk-text) !important;
}

/* bootstrap-select */
body.dark-theme .bootstrap-select > .dropdown-toggle,
body.dark-theme .bootstrap-select > .dropdown-toggle.btn-light,
body.dark-theme .bootstrap-select > .dropdown-toggle.btn-default {
    background-color: var(--dk-input) !important;
    border-color: var(--dk-border-input) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .bootstrap-select .dropdown-menu li a,
body.dark-theme .bootstrap-select .dropdown-menu li a span.text {
    color: var(--dk-text) !important;
}

body.dark-theme .bootstrap-select .dropdown-menu li.selected a,
body.dark-theme .bootstrap-select .dropdown-menu li.active a {
    background-color: var(--dk-selected) !important;
}

body.dark-theme .bootstrap-select .bs-searchbox .form-control {
    background-color: var(--dk-input) !important;
}

/* bootstrap-datepicker */
body.dark-theme .datepicker.dropdown-menu,
body.dark-theme .datepicker {
    background-color: var(--dk-surface-2) !important;
    color: var(--dk-text) !important;
}

    body.dark-theme .datepicker table tr th,
    body.dark-theme .datepicker table tr td {
        background-color: transparent !important;
        color: var(--dk-text) !important;
    }

        body.dark-theme .datepicker table tr td.day:hover,
        body.dark-theme .datepicker table tr td span:hover,
        body.dark-theme .datepicker table tr th.prev:hover,
        body.dark-theme .datepicker table tr th.next:hover,
        body.dark-theme .datepicker table tr th.datepicker-switch:hover {
            background-color: var(--dk-surface-3) !important;
        }

        body.dark-theme .datepicker table tr td.old,
        body.dark-theme .datepicker table tr td.new,
        body.dark-theme .datepicker table tr td.disabled {
            color: var(--dk-disabled) !important;
        }

        body.dark-theme .datepicker table tr td.today {
            background-color: var(--dk-accent-tint) !important;
            color: var(--dk-accent-strong) !important;
        }

        body.dark-theme .datepicker table tr td.active,
        body.dark-theme .datepicker table tr td.active:hover,
        body.dark-theme .datepicker table tr td span.active {
            background-color: var(--dk-accent-solid) !important;
            color: #fff !important;
        }

/* daterangepicker */
body.dark-theme .daterangepicker,
body.dark-theme .daterangepicker .calendar-table {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text) !important;
}

    body.dark-theme .daterangepicker td.available:hover,
    body.dark-theme .daterangepicker th.available:hover {
        background-color: var(--dk-surface-3) !important;
    }

    body.dark-theme .daterangepicker td.off {
        background-color: transparent !important;
        color: var(--dk-disabled) !important;
    }

    body.dark-theme .daterangepicker td.in-range {
        background-color: var(--dk-accent-tint) !important;
        color: var(--dk-text) !important;
    }

    body.dark-theme .daterangepicker td.active,
    body.dark-theme .daterangepicker td.active:hover {
        background-color: var(--dk-accent-solid) !important;
        color: #fff !important;
    }

    body.dark-theme .daterangepicker .ranges li:hover {
        background-color: var(--dk-surface-3) !important;
    }

/* SweetAlert2 */
body.dark-theme .swal2-popup {
    background-color: var(--dk-surface) !important;
    border: 1px solid var(--dk-border-strong);
    color: var(--dk-text) !important;
}

body.dark-theme .swal2-title {
    color: var(--dk-text-strong) !important;
}

body.dark-theme .swal2-content,
body.dark-theme .swal2-html-container {
    color: var(--dk-text-2) !important;
}

body.dark-theme .swal2-input,
body.dark-theme .swal2-textarea,
body.dark-theme .swal2-select {
    background-color: var(--dk-input) !important;
    border-color: var(--dk-border-input) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .swal2-container.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* AG Grid v29 (ag-theme-balham) — via variáveis oficiais do tema */
body.dark-theme .ag-theme-balham,
body.dark-theme .ag-theme-balham-dark {
    --ag-background-color: var(--dk-surface);
    --ag-foreground-color: var(--dk-text);
    --ag-data-color: var(--dk-text);
    --ag-secondary-foreground-color: var(--dk-muted);
    --ag-disabled-foreground-color: var(--dk-disabled);
    --ag-header-background-color: var(--dk-surface-2);
    --ag-header-foreground-color: var(--dk-text-2);
    --ag-header-column-separator-color: var(--dk-border);
    --ag-subheader-background-color: var(--dk-surface-2);
    --ag-control-panel-background-color: var(--dk-surface-2);
    --ag-side-button-selected-background-color: var(--dk-surface-3);
    --ag-odd-row-background-color: #18232f;
    --ag-row-hover-color: var(--dk-surface-3);
    --ag-selected-row-background-color: var(--dk-selected);
    --ag-range-selection-border-color: var(--dk-accent);
    --ag-balham-active-color: var(--dk-accent);
    --ag-border-color: var(--dk-border);
    --ag-secondary-border-color: var(--dk-border);
    --ag-row-border-color: var(--dk-border);
    --ag-input-border-color: var(--dk-border-input);
    --ag-input-focus-border-color: var(--dk-accent);
    --ag-input-disabled-background-color: var(--dk-input-disabled);
    --ag-checkbox-background-color: var(--dk-input);
    --ag-checkbox-unchecked-color: var(--dk-muted);
    --ag-checkbox-checked-color: var(--dk-accent);
    --ag-chip-background-color: var(--dk-surface-3);
    --ag-modal-overlay-background-color: rgba(15, 23, 34, 0.66);
    --ag-tooltip-background-color: #2c3d54;
    color-scheme: dark;
}

    body.dark-theme .ag-theme-balham .ag-popup,
    body.dark-theme .ag-theme-balham .ag-menu,
    body.dark-theme .ag-theme-balham .ag-filter,
    body.dark-theme .ag-theme-balham .ag-tooltip {
        background-color: var(--dk-surface-2) !important;
        border-color: var(--dk-border) !important;
        color: var(--dk-text) !important;
    }

    body.dark-theme .ag-theme-balham .ag-menu-option-active {
        background-color: var(--dk-surface-3) !important;
    }

    body.dark-theme .ag-theme-balham input[class^="ag-"]:not([type]),
    body.dark-theme .ag-theme-balham input[class^="ag-"][type="text"],
    body.dark-theme .ag-theme-balham input[class^="ag-"][type="number"],
    body.dark-theme .ag-theme-balham .ag-picker-field-wrapper {
        background-color: var(--dk-input) !important;
        border-color: var(--dk-border-input) !important;
        color: var(--dk-text) !important;
    }

    body.dark-theme .ag-theme-balham .ag-standard-button {
        background-color: var(--dk-surface-3) !important;
        border: 1px solid var(--dk-border-strong) !important;
        color: var(--dk-text) !important;
    }

    body.dark-theme .ag-theme-balham .ag-paging-panel,
    body.dark-theme .ag-theme-balham .ag-status-bar {
        border-color: var(--dk-border) !important;
        color: var(--dk-text-2) !important;
    }

    body.dark-theme .ag-theme-balham .ag-icon {
        color: var(--dk-text-2);
    }

/* ---------------------------------------------------------------------
   12. COMPONENTES ESPECÍFICOS DO SIGP (migrados das folhas antigas)
   --------------------------------------------------------------------- */
body.dark-theme .escondeUndOrcamentaria,
body.dark-theme .escondeDetalhesLicitacao {
    background-color: var(--dk-surface-2) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .data-item,
body.dark-theme .tr .anulacaoEmpenho,
body.dark-theme .tr .tipoLancamentoDois {
    color: var(--dk-text) !important;
}

body.dark-theme #badgeFornecedoresSelecionados,
body.dark-theme .badge-primary {
    background-color: #5d78ff !important;
    color: #fff !important;
}

body.dark-theme .chart-container {
    color: var(--dk-text);
}

/* Seleção de colunas (Gerencial) */
body.dark-theme #columnSelection,
body.dark-theme #gridContainer {
    background-color: var(--dk-surface) !important;
    border-color: var(--dk-border) !important;
    color: var(--dk-text) !important;
}

/* Calendário */
body.dark-theme .calendar-container {
    background-color: var(--dk-surface) !important;
    border: 1px solid var(--dk-border) !important;
    color: var(--dk-text) !important;
}

body.dark-theme .calendar-header {
    background-color: var(--dk-surface-2) !important;
    border-bottom: 1px solid var(--dk-border) !important;
}

body.dark-theme #month-year {
    color: var(--dk-text-strong) !important;
}

body.dark-theme .calendar-container button {
    background-color: var(--dk-surface-3) !important;
    border: 1px solid var(--dk-border-strong) !important;
    color: var(--dk-text) !important;
}

    body.dark-theme .calendar-container button:hover {
        background-color: #2c3d54 !important;
    }

/* Certificados */
body.dark-theme .certificate-list {
    background-color: var(--dk-surface);
    border-color: var(--dk-border);
}

body.dark-theme .certificate-item {
    background-color: var(--dk-surface-2);
    border-left-color: var(--dk-accent);
    color: var(--dk-text);
}

    body.dark-theme .certificate-item:hover {
        background-color: var(--dk-surface-3);
    }

    body.dark-theme .certificate-item strong,
    body.dark-theme .certificate-item b {
        color: var(--dk-text-strong);
    }

    body.dark-theme .certificate-item .identificador { color: var(--dk-accent); }
    body.dark-theme .certificate-item .data-vencimento { color: var(--dk-warning); }
    body.dark-theme .certificate-item.expiring { border-left-color: var(--dk-warning); }
    body.dark-theme .certificate-item.expired { border-left-color: var(--dk-danger); }

/* Switches decorados (cartão em volta do kt-switch) */
body.dark-theme .switch-container .kt-switch,
body.dark-theme span.kt-switch.switch-container {
    color: var(--dk-text);
}

/* Busca no menu */
body.dark-theme .menu-search::placeholder {
    color: rgba(226, 232, 240, 0.6) !important;
}

/* Dica de arrastar tabela (Ctrl + arrastar) — _Layout */
body.dark-theme .drag-scroll-hint {
    color: var(--dk-text-2);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--dk-border);
}

    body.dark-theme .drag-scroll-hint kbd {
        background: var(--dk-surface-3);
        border-color: var(--dk-border-strong);
        color: var(--dk-text-strong);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    }

    body.dark-theme .drag-scroll-hint .hint-sep {
        color: var(--dk-border-strong);
    }

/* ---------------------------------------------------------------------
   14. ESTILOS INLINE LEGADOS (style="..." escrito nas views e no JS)
   Gerado a partir de um levantamento das views. Cada seletor casa com o
   texto exato do style inline e troca a cor clara/escura pelo token.
   Texto: só quando o mesmo style não define fundo próprio.
   Para telas novas: NÃO use cor inline; use classes + tokens.
   --------------------------------------------------------------------- */
body.dark-theme [style*="background-color: #d9d9d9" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color: #dadada" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color: #e9e9e9" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color: #eee" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color: #f2fbf5" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color: #f7f8fa" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color: #f8f9fa" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color: #fff" i] { background-color: var(--dk-surface) !important; }
body.dark-theme [style*="background-color: rgb(233, 233, 233)" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color:#D3D3D3" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color:#E9ECEF" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color:#e9ecef" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color:#f8f9fa" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background-color:white" i] { background-color: var(--dk-surface) !important; }
body.dark-theme [style*="background: #dddddd" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background: #fff" i] { background-color: var(--dk-surface) !important; }
body.dark-theme [style*="background: #ffffff" i] { background-color: var(--dk-surface) !important; }
body.dark-theme [style*="background:#DDDDDD" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background:#f0f0f0" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background:#fafbfc" i] { background-color: var(--dk-surface-2) !important; }
body.dark-theme [style*="background:white" i] { background-color: var(--dk-surface) !important; }
body.dark-theme [style*="border-bottom-color:#808080" i] { border-bottom-color: var(--dk-border) !important; }
body.dark-theme [style*="border-bottom: 1px solid #dee2e6" i] { border-bottom-color: var(--dk-border) !important; }
body.dark-theme [style*="border-color: #000000" i] { border-color: var(--dk-border) !important; }
body.dark-theme [style*="border-color: #e4e4e4" i] { border-color: var(--dk-border) !important; }
body.dark-theme [style*="border-left: 1px solid black" i] { border-left-color: var(--dk-border) !important; }
body.dark-theme [style*="border-top-color:#000000" i] { border-top-color: var(--dk-border) !important; }
body.dark-theme [style*="border-top-color:#ffffff" i] { border-top-color: var(--dk-border) !important; }
body.dark-theme [style*="border-top-color:black" i] { border-top-color: var(--dk-border) !important; }
body.dark-theme [style*="border-top: 1px dashed #ced4da" i] { border-top-color: var(--dk-border) !important; }
body.dark-theme [style*="border-top: 1px solid #dee2e6" i] { border-top-color: var(--dk-border) !important; }
body.dark-theme [style*="border: 1px solid #ccc" i] { border-color: var(--dk-border) !important; }
body.dark-theme [style*="border: 1px solid gray" i] { border-color: var(--dk-border) !important; }
body.dark-theme [style*="border:0.5px solid black" i] { border-color: var(--dk-border) !important; }
body.dark-theme [style*="border:1px solid #ced4da" i] { border-color: var(--dk-border) !important; }
body.dark-theme [style*="border:1px solid #d7d7d7" i] { border-color: var(--dk-border) !important; }
body.dark-theme [style*="color: #000" i]:not([style*="background" i]),
body.dark-theme [style*="color: #000" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text) !important; }
body.dark-theme [style*="color: #000000" i]:not([style*="background" i]),
body.dark-theme [style*="color: #000000" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text) !important; }
body.dark-theme [style*="color: #0084e7" i]:not([style*="background" i]),
body.dark-theme [style*="color: #0084e7" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-info) !important; }
body.dark-theme [style*="color: #2e7d32" i]:not([style*="background" i]),
body.dark-theme [style*="color: #2e7d32" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-success) !important; }
body.dark-theme [style*="color: #333" i]:not([style*="background" i]),
body.dark-theme [style*="color: #333" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text) !important; }
body.dark-theme [style*="color: #353535" i]:not([style*="background" i]),
body.dark-theme [style*="color: #353535" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text) !important; }
body.dark-theme [style*="color: #555" i]:not([style*="background" i]),
body.dark-theme [style*="color: #555" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text) !important; }
body.dark-theme [style*="color: #666" i]:not([style*="background" i]),
body.dark-theme [style*="color: #666" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text-2) !important; }
body.dark-theme [style*="color: #6c757d" i]:not([style*="background" i]),
body.dark-theme [style*="color: #6c757d" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text-2) !important; }
body.dark-theme [style*="color: #c0392b" i]:not([style*="background" i]),
body.dark-theme [style*="color: #c0392b" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-danger) !important; }
body.dark-theme [style*="color: #c3170b" i]:not([style*="background" i]),
body.dark-theme [style*="color: #c3170b" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-danger) !important; }
body.dark-theme [style*="color: #c62828" i]:not([style*="background" i]),
body.dark-theme [style*="color: #c62828" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-danger) !important; }
body.dark-theme [style*="color: #dc3545" i]:not([style*="background" i]),
body.dark-theme [style*="color: #dc3545" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-danger) !important; }
body.dark-theme [style*="color: #e65100" i]:not([style*="background" i]),
body.dark-theme [style*="color: #e65100" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-warning) !important; }
body.dark-theme [style*="color:#006400" i]:not([style*="background" i]),
body.dark-theme [style*="color:#006400" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-success) !important; }
body.dark-theme [style*="color:#017a9f" i]:not([style*="background" i]),
body.dark-theme [style*="color:#017a9f" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-info) !important; }
body.dark-theme [style*="color:#0c5460" i]:not([style*="background" i]),
body.dark-theme [style*="color:#0c5460" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-info) !important; }
body.dark-theme [style*="color:#6E7273" i]:not([style*="background" i]),
body.dark-theme [style*="color:#6E7273" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text-2) !important; }
body.dark-theme [style*="color:#a43434" i]:not([style*="background" i]),
body.dark-theme [style*="color:#a43434" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-danger) !important; }
body.dark-theme [style*="color:black" i]:not([style*="background" i]),
body.dark-theme [style*="color:black" i]:is([style*="background-color: #e9e9e9" i], [style*="background-color:white" i], [style*="background-color: rgb(233, 233, 233)" i], [style*="background-color: #eee" i], [style*="background-color: #d9d9d9" i], [style*="background: #fff" i], [style*="background-color: #dadada" i], [style*="background-color: #fff" i], [style*="background:#DDDDDD" i], [style*="background:white" i], [style*="background-color:#D3D3D3" i], [style*="background-color:#e9ecef" i], [style*="background-color:#E9ECEF" i], [style*="background: #ffffff" i], [style*="background-color: #f8f9fa" i], [style*="background:#fafbfc" i], [style*="background:#f0f0f0" i], [style*="background-color:#f8f9fa" i], [style*="background-color:#d1ecf1" i], [style*="background: #dddddd" i], [style*="background-color: #fff3e0" i], [style*="background-color: #ffebee" i], [style*="background-color: #eaf4ff" i], [style*="background-color: #e9f8f1" i], [style*="background-color: #f2fbf5" i], [style*="background-color: #f7f8fa" i], [style*="background-color: #ffeeee" i], [style*="background-color: #e3f2fd" i], [style*="background-color: #fff3cd" i], [style*="background-color: #fff8e1" i], [style*="background-color:#ffeeee" i], [style*="background:#fbe8e8" i]) { color: var(--dk-text) !important; }
body.dark-theme [style*="background-color: #e3f2fd" i] { background-color: var(--dk-info-tint) !important; }
body.dark-theme [style*="background-color: #e9f8f1" i] { background-color: var(--dk-success-tint) !important; }
body.dark-theme [style*="background-color: #eaf4ff" i] { background-color: var(--dk-info-tint) !important; }
body.dark-theme [style*="background-color: #ffebee" i] { background-color: var(--dk-danger-tint) !important; }
body.dark-theme [style*="background-color: #ffeeee" i] { background-color: var(--dk-danger-tint) !important; }
body.dark-theme [style*="background-color: #fff3cd" i] { background-color: var(--dk-warning-tint) !important; }
body.dark-theme [style*="background-color: #fff3e0" i] { background-color: var(--dk-warning-tint) !important; }
body.dark-theme [style*="background-color: #fff8e1" i] { background-color: var(--dk-warning-tint) !important; }
body.dark-theme [style*="background-color:#d1ecf1" i] { background-color: var(--dk-info-tint) !important; }
body.dark-theme [style*="background-color:#ffeeee" i] { background-color: var(--dk-danger-tint) !important; }
body.dark-theme [style*="background:#fbe8e8" i] { background-color: var(--dk-danger-tint) !important; }

/* ---------------------------------------------------------------------
   13. AJUSTE DO TEMA CLARO PRESERVADO
   Regra que vazava (sem escopo) em darktheme.css e já fazia parte do
   visual claro. Mantida aqui para o tema claro não mudar.
   --------------------------------------------------------------------- */
:where(body:not(.dark-theme)) .btn.btn-secondary {
    background-color: #e4e6eb;
    color: #464E5F;
    border: 1px solid #E4E6EF;
}

    :where(body:not(.dark-theme)) .btn.btn-secondary:hover {
        background-color: #d7dae7;
        border-color: #d7dae7;
    }

    :where(body:not(.dark-theme)) .btn.btn-secondary:active {
        background-color: #E4E6EF;
        border-color: #E4E6EF;
    }

/* ---------------------------------------------------------------------
   15. IMPRESSÃO — sempre no tema claro (theme.js remove a classe no
   beforeprint e devolve no afterprint; isto é a rede de segurança)
   --------------------------------------------------------------------- */
@media print {
    body.dark-theme {
        background-color: #fff !important;
        color: #000 !important;
    }
}
