﻿/* === ANGLE 4.8.1 + BS 4.6 — Dark Mode === */
/* Funciona com html[data-theme="dark"] (recomendado) e body.dark-mode (legado) */

html[data-theme="dark"] body,
body.dark-mode {
    background-color: #0f172a;
    color: #e5e7eb;
}

    html[data-theme="dark"] a,
    body.dark-mode a {
        color: #ffffff;
    }

        html[data-theme="dark"] a:hover,
        body.dark-mode a:hover {
            color: #b3d6ff;
        }

    /* Navbar */
    html[data-theme="dark"] .navbar,
    body.dark-mode .navbar {
        background: #111827 !important;
        border-color: #334155 !important;
    }

        html[data-theme="dark"] .navbar .nav-link,
        html[data-theme="dark"] .navbar .navbar-brand,
        body.dark-mode .navbar .nav-link,
        body.dark-mode .navbar .navbar-brand {
            color: #e5e7eb !important;
        }

    /* Sidebar (ajuste o seletor para o seu layout) */
    html[data-theme="dark"] .sidebar,
    html[data-theme="dark"] .navbar-static-side,
    body.dark-mode .sidebar,
    body.dark-mode .navbar-static-side {
        background: #0b1324 !important;
    }

        html[data-theme="dark"] .sidebar .nav-link,
        body.dark-mode .sidebar .nav-link {
            color: #9ca3af !important;
        }

            html[data-theme="dark"] .sidebar .nav-link.active,
            html[data-theme="dark"] .sidebar .nav-link:hover,
            body.dark-mode .sidebar .nav-link.active,
            body.dark-mode .sidebar .nav-link:hover {
                color: #e5e7eb !important;
                background: #1f2937 !important;
            }

    /* Cards / ibox / panels */
    html[data-theme="dark"] .card,
    html[data-theme="dark"] .ibox,
    html[data-theme="dark"] .panel,
    body.dark-mode .card,
    body.dark-mode .ibox,
    body.dark-mode .panel {
        background: #1f2937 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .card-header,
    html[data-theme="dark"] .ibox-title,
    html[data-theme="dark"] .panel-heading,
    body.dark-mode .card-header,
    body.dark-mode .ibox-title,
    body.dark-mode .panel-heading {
        background: #374151 !important;
        border-color: #334155 !important;
        color: #e5e7eb !important;
    }

    /* Tables */
    html[data-theme="dark"] .table,
    body.dark-mode .table {
        background: #1f2937 !important;
        color: #e5e7eb !important;
    }

        html[data-theme="dark"] .table thead th,
        body.dark-mode .table thead th {
            background: #111827 !important;
            color: #e5e7eb !important;
            border-color: #334155 !important;
        }

    html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
    body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
        background: #141b2f !important;
    }

    /* Forms */
    html[data-theme="dark"] .form-control,
    body.dark-mode .form-control {
        background: #111827 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

        html[data-theme="dark"] .form-control:focus,
        body.dark-mode .form-control:focus {
            background: #0b1220 !important;
            border-color: #22d3ee !important;
            box-shadow: none !important;
        }

    /* Dropdowns / Modals */
    html[data-theme="dark"] .dropdown-menu,
    html[data-theme="dark"] .modal-content,
    body.dark-mode .dropdown-menu,
    body.dark-mode .modal-content {
        background: #1f2937 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    /* Buttons (exemplos) */
    html[data-theme="dark"] .btn-light,
    body.dark-mode .btn-light {
        background: #374151;
        color: #e5e7eb;
        border-color: #334155;
    }

    html[data-theme="dark"] .btn-primary,
    body.dark-mode .btn-primary {
        background: #2563eb;
        border-color: #1d4ed8;
    }


    /* ===== PATCH DARK PARA A PÁGINA DE PROCURADORES ===== */
    /* Use com: <html data-theme="dark"> ... ou body.dark-mode ... */

    html[data-theme="dark"] .content-wrapper,
    body.dark-mode .content-wrapper {
        background: #0f172a !important;
        color: #e5e7eb !important;
    }

    /* Título da página */
    html[data-theme="dark"] .content-heading,
    body.dark-mode .content-heading {
        color: #e5e7eb !important;
    }

    /* Card da lista */
    html[data-theme="dark"] .card.card-default,
    body.dark-mode .card.card-default {
        background: #1f2937 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

        html[data-theme="dark"] .card.card-default .card-header,
        body.dark-mode .card.card-default .card-header {
            background: #374151 !important;
            color: #e5e7eb !important;
            border-color: #334155 !important;
        }

        html[data-theme="dark"] .card.card-default .card-body,
        body.dark-mode .card.card-default .card-body {
            background: #1f2937 !important;
            color: #e5e7eb !important;
        }

/* DataTables – área de botões, busca e info */
html[data-theme="dark"] .dataTables_wrapper .dt-buttons .btn,
body.dark-mode .dataTables_wrapper .dt-buttons .btn {
    background: #374151 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_filter label,
body.dark-mode .dataTables_wrapper .dataTables_filter label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_filter .form-control,
body.dark-mode .dataTables_wrapper .dataTables_filter .form-control {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_info {
    color: #9ca3af !important;
}

/* DataTables – tabela */
html[data-theme="dark"] table.dataTable,
body.dark-mode table.dataTable {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] table.dataTable thead th,
body.dark-mode table.dataTable thead th {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] table.dataTable tbody td,
body.dark-mode table.dataTable tbody td {
    border-color: #334155 !important;
}

html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
    background-color: #141b2f !important;
}

/* DataTables – paginação */
html[data-theme="dark"] .dataTables_wrapper .pagination .page-link,
body.dark-mode .dataTables_wrapper .pagination .page-link {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .dataTables_wrapper .pagination .page-item.active .page-link,
body.dark-mode .dataTables_wrapper .pagination .page-item.active .page-link {
    background: #1e3a8a !important; /* azul escuro */
    border-color: #1e3a8a !important;
}

/* Inputs dos filtros na linha do THEAD */
html[data-theme="dark"] table.dataTable thead input.form-control,
body.dark-mode table.dataTable thead input.form-control {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Bootstrap-select (o <select class="selectpicker"> vira um .bootstrap-select .btn) */
html[data-theme="dark"] .bootstrap-select > .dropdown-toggle,
body.dark-mode .bootstrap-select > .dropdown-toggle {
    background: #374151 !important; /* substitui btn-light */
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .bootstrap-select .dropdown-menu,
body.dark-mode .bootstrap-select .dropdown-menu {
    background: #1f2937 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .bootstrap-select .dropdown-menu .inner li a,
body.dark-mode .bootstrap-select .dropdown-menu .inner li a {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .bootstrap-select .dropdown-menu .inner li a:hover,
body.dark-mode .bootstrap-select .dropdown-menu .inner li a:hover {
    background: #374151 !important;
}

/* Botões secundários (DataTables usa .btn-secondary no BS4) */
html[data-theme="dark"] .btn-secondary,
body.dark-mode .btn-secondary {
    background: #374151 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

/* Badges de situação */
html[data-theme="dark"] .badge-success,
body.dark-mode .badge-success {
    filter: saturate(1.1) brightness(0.9);
}

/* Links dentro da tabela */
html[data-theme="dark"] table.dataTable a,
body.dark-mode table.dataTable a {
    color: #93c5fd !important;
}

html[data-theme="dark"] table.dataTable a:hover,
body.dark-mode table.dataTable a:hover {
    color: #b3d6ff !important;
}


/* =========================
Dark mode - content-heading
========================= */
html[data-theme="dark"] .content-heading,
body.dark-mode .content-heading {
    color: #e5e7eb !important; /* texto claro */
    background-color: transparent !important; /* se não quiser fundo */
    border-color: #334155 !important; /* se existir borda */
}

html[data-theme="dark"] .content-heading i,
body.dark-mode .content-heading i {
    color: #93c5fd !important; /* ícones em azul claro */
}


/* ====== DARK PATCH – PÁGINA DO PROCURADOR (BS 4.6 + Angle) ====== */
/* Ativo quando: html[data-theme="dark"] ...  ou  body.dark-mode ... */

html[data-theme="dark"] body,
body.dark-mode {
    background: #0f172a;
    color: #e5e7eb;
}

    /* Heading/títulos */
    html[data-theme="dark"] .content-heading,
    body.dark-mode .content-heading {
        color: #e5e7eb !important;
    }

        html[data-theme="dark"] .content-heading i,
        body.dark-mode .content-heading i {
            color: #93c5fd !important;
        }

    /* HR */
    html[data-theme="dark"] .hr-form,
    body.dark-mode .hr-form {
        border-color: #334155 !important;
    }

    /* NAV TABS */
    html[data-theme="dark"] .nav-tabs .nav-link,
    body.dark-mode .nav-tabs .nav-link {
        background: #111827 !important;
        color: #cbd5e1 !important;
        border-color: #334155 !important;
    }

        html[data-theme="dark"] .nav-tabs .nav-link:hover,
        body.dark-mode .nav-tabs .nav-link:hover {
            color: #e5e7eb !important;
        }

        html[data-theme="dark"] .nav-tabs .nav-link.active,
        body.dark-mode .nav-tabs .nav-link.active {
            background: #1f2937 !important;
            color: #e5e7eb !important;
            border-color: #334155 #334155 transparent #334155 !important;
        }

    html[data-theme="dark"] .tab-content,
    body.dark-mode .tab-content {
        background: #1f2937 !important;
    }

    /* CARD (container principal) */
    html[data-theme="dark"] .card,
    body.dark-mode .card {
        background: #1f2937 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .card-header,
    body.dark-mode .card-header {
        background: #374151 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .card-body,
    body.dark-mode .card-body {
        background: #1f2937 !important;
    }

    /* FORM + INPUT GROUPS */
    html[data-theme="dark"] .form-group label,
    body.dark-mode .form-group label {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .form-control,
    body.dark-mode .form-control {
        background: #111827 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

        html[data-theme="dark"] .form-control:focus,
        body.dark-mode .form-control:focus {
            background: #0b1220 !important;
            border-color: #22d3ee !important;
            box-shadow: none !important;
        }

    html[data-theme="dark"] .input-group-text,
    body.dark-mode .input-group-text {
        background: #374151 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    /* Texto de validação */
    html[data-theme="dark"] .text-danger,
    body.dark-mode .text-danger {
        color: #fca5a5 !important;
    }

    /* BADGES */
    html[data-theme="dark"] .badge,
    body.dark-mode .badge {
        filter: brightness(0.95) saturation(1.05);
    }

    /* TABLE (geral) */
    html[data-theme="dark"] .table,
    body.dark-mode .table {
        background: #1f2937 !important;
        color: #e5e7eb !important;
    }

        html[data-theme="dark"] .table thead th,
        body.dark-mode .table thead th {
            background: #111827 !important;
            color: #e5e7eb !important;
            border-color: #334155 !important;
        }

        html[data-theme="dark"] .table td,
        html[data-theme="dark"] .table th,
        body.dark-mode .table td,
        body.dark-mode .table th {
            border-color: #334155 !important;
        }

    html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
    body.dark-mode .table-striped tbody tr:nth-of-type(odd) {
        background: #141b2f !important;
    }

    /* DATATABLES (se existir na página) */
    html[data-theme="dark"] .dataTables_wrapper .dt-buttons .btn,
    body.dark-mode .dataTables_wrapper .dt-buttons .btn {
        background: #374151 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .dataTables_wrapper .dataTables_filter label,
    body.dark-mode .dataTables_wrapper .dataTables_filter label {
        color: #cbd5e1 !important;
    }

    html[data-theme="dark"] .dataTables_wrapper .dataTables_filter .form-control,
    body.dark-mode .dataTables_wrapper .dataTables_filter .form-control {
        background: #111827 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .dataTables_wrapper .pagination .page-link,
    body.dark-mode .dataTables_wrapper .pagination .page-link {
        background: #111827 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .dataTables_wrapper .pagination .page-item.active .page-link,
    body.dark-mode .dataTables_wrapper .pagination .page-item.active .page-link {
        background: #1e3a8a !important;
        border-color: #1e3a8a !important;
    }

    /* BOOTSTRAP-SELECT (selectpicker) */
    html[data-theme="dark"] .bootstrap-select > .dropdown-toggle,
    body.dark-mode .bootstrap-select > .dropdown-toggle {
        background: #374151 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .bootstrap-select .dropdown-menu,
    body.dark-mode .bootstrap-select .dropdown-menu {
        background: #1f2937 !important;
        border-color: #334155 !important;
    }

        html[data-theme="dark"] .bootstrap-select .dropdown-menu .inner li a,
        body.dark-mode .bootstrap-select .dropdown-menu .inner li a {
            color: #e5e7eb !important;
        }

            html[data-theme="dark"] .bootstrap-select .dropdown-menu .inner li a:hover,
            body.dark-mode .bootstrap-select .dropdown-menu .inner li a:hover {
                background: #374151 !important;
            }

    html[data-theme="dark"] .bs-searchbox .form-control,
    body.dark-mode .bs-searchbox .form-control {
        background: #111827 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    /* DATEPICKER (bootstrap-datepicker) */
    html[data-theme="dark"] .datepicker-dropdown,
    body.dark-mode .datepicker-dropdown {
        background: #1f2937 !important;
        color: #e5e7eb !important;
        border: 1px solid #334155 !important;
    }

    html[data-theme="dark"] .datepicker table tr td.day,
    html[data-theme="dark"] .datepicker table tr th,
    body.dark-mode .datepicker table tr td.day,
    body.dark-mode .datepicker table tr th {
        color: #e5e7eb !important;
    }

        html[data-theme="dark"] .datepicker table tr td.day:hover,
        body.dark-mode .datepicker table tr td.day:hover {
            background: #374151 !important;
        }

    html[data-theme="dark"] .datepicker table tr td.active,
    html[data-theme="dark"] .datepicker table tr td.active:hover,
    body.dark-mode .datepicker table tr td.active,
    body.dark-mode .datepicker table tr td.active:hover {
        background: #2563eb !important;
        color: #fff !important;
    }

    /* TOOLTIPS (Bootstrap 4) */
    html[data-theme="dark"] .tooltip-inner,
    body.dark-mode .tooltip-inner {
        background: #111827 !important;
        color: #e5e7eb !important;
    }

    html[data-theme="dark"] .bs-tooltip-auto[x-placement^="top"] .arrow::before,
    html[data-theme="dark"] .bs-tooltip-top .arrow::before,
    body.dark-mode .bs-tooltip-auto[x-placement^="top"] .arrow::before,
    body.dark-mode .bs-tooltip-top .arrow::before {
        border-top-color: #111827 !important;
    }

    /* BOTÕES */
    html[data-theme="dark"] .btn-light,
    body.dark-mode .btn-light {
        background: #374151 !important;
        color: #e5e7eb !important;
        border-color: #334155 !important;
    }

    html[data-theme="dark"] .btn-primary,
    body.dark-mode .btn-primary {
        background: #2563eb !important;
        border-color: #1d4ed8 !important;
    }

    html[data-theme="dark"] .btn-warning,
    body.dark-mode .btn-warning {
        color: #111 !important;
    }

    /* Ícones dentro de input-group-text e headings */
    html[data-theme="dark"] .input-group-text i,
    body.dark-mode .input-group-text i {
        color: #e5e7eb !important;
    }

    html[data-theme="dark"] h4.text-primary,
    body.dark-mode h4.text-primary {
        color: #93c5fd !important;
    }

    html[data-theme="dark"] h4.text-warning,
    body.dark-mode h4.text-warning {
        color: #f59e0b !important;
    }

    html[data-theme="dark"] h4.text-success,
    body.dark-mode h4.text-success {
        color: #22c55e !important;
    }

    html[data-theme="dark"] h4.text-danger,
    body.dark-mode h4.text-danger {
        color: #ef4444 !important;
    }
