/* Filtro de cabeçalho (popup) — reutilizável em qualquer listagem */
.filtro-cabecalho-modal.modal-filtro {
    position: fixed;
    z-index: 10060;
    display: none;
    background: transparent;
    pointer-events: none;
}

.filtro-cabecalho-modal.modal-filtro[style*="display: block"],
.filtro-cabecalho-modal.modal-filtro[style*="display:block"] {
    pointer-events: auto;
}

.filtro-cabecalho-modal .modal-filtro-content {
    background: #fff;
    background-color: #fff;
    opacity: 1;
    border: 1px solid #d8dee6;
    width: min(380px, calc(100vw - 24px));
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(42, 63, 84, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filtro-cabecalho-modal .modal-filtro-header {
    padding: 14px 16px;
    background: linear-gradient(180deg, #f7f9fb 0%, #f0f3f7 100%);
    border-bottom: 1px solid #e8edf3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.filtro-cabecalho-modal .modal-filtro-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2a3f54;
}

.filtro-cabecalho-modal .filter-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 22px;
    line-height: 1;
    color: #73879c;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.filtro-cabecalho-modal .filter-modal-close:hover,
.filtro-cabecalho-modal .filter-modal-close:focus {
    color: #2a3f54;
    background: rgba(115, 135, 156, 0.12);
}

.filtro-cabecalho-modal .filter-modal-body {
    padding: 14px 16px;
    flex: 1;
    min-height: 0;
}

.filtro-cabecalho-modal .filter-search-input {
    margin-bottom: 12px;
}

.filtro-cabecalho-modal .filter-search-input .form-control {
    height: 34px;
    font-size: 13px;
    border-color: #d4dde8;
    border-radius: 6px;
    box-shadow: none;
}

.filtro-cabecalho-modal .filter-search-input .form-control:focus {
    border-color: #26b99a;
    box-shadow: 0 0 0 3px rgba(38, 185, 154, 0.15);
}

.filtro-cabecalho-modal .filter-options-container {
    border: 1px solid #e8edf3;
    border-radius: 6px;
    background: #fafbfc;
    overflow: hidden;
}

.filtro-cabecalho-modal .filter-select-all-label.filtro-opcao-item--destaque {
    margin: 0;
    padding: 10px 14px;
    background: #f0f4f8;
    border-bottom: 1px solid #e8edf3;
    border-radius: 0;
}

.filtro-cabecalho-modal .filter-divider {
    display: none;
}

.filtro-cabecalho-modal .filter-items-list {
    margin: 0;
    padding: 4px 0;
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.filtro-cabecalho-modal .filtro-lista-vazia,
.filtro-cabecalho-modal .filtro-lista-erro {
    margin: 0;
    padding: 12px 14px;
    font-size: 13px;
    color: #73879c;
}

.filtro-cabecalho-modal .filtro-lista-erro {
    color: #a94442;
}

.filtro-cabecalho-modal .modal-filtro-footer {
    padding: 12px 16px;
    background: #f7f9fb;
    border-top: 1px solid #e8edf3;
    text-align: right;
    flex-shrink: 0;
}

.filtro-cabecalho-modal .modal-filtro-footer .btn {
    min-width: 72px;
    font-size: 13px;
}

.filtro-cabecalho-modal .modal-filtro-footer .btn + .btn {
    margin-left: 8px;
}

.filtro-cabecalho-modal .filtro-opcao-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease;
}

.filtro-cabecalho-modal .filtro-opcao-item:hover {
    background: #eef4f8;
}

.filtro-cabecalho-modal .filtro-opcao-item.filtro-opcao-oculta {
    display: none !important;
}

.filtro-cabecalho-modal .filtro-checkbox-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.filtro-cabecalho-modal .filtro-checkbox-custom {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 2px solid #b8c4d0;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.filtro-cabecalho-modal .filtro-checkbox-input:checked + .filtro-checkbox-custom {
    background: #26b99a;
    border-color: #1f9d83;
}

.filtro-cabecalho-modal .filtro-checkbox-input:checked + .filtro-checkbox-custom::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filtro-cabecalho-modal .filtro-checkbox-input:focus-visible + .filtro-checkbox-custom {
    box-shadow: 0 0 0 3px rgba(38, 185, 154, 0.28);
}

.filtro-cabecalho-modal .filtro-checkbox-input:indeterminate + .filtro-checkbox-custom {
    background: #26b99a;
    border-color: #1f9d83;
}

.filtro-cabecalho-modal .filtro-checkbox-input:indeterminate + .filtro-checkbox-custom::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 7px;
    width: 10px;
    height: 2px;
    background: #fff;
    border: none;
    transform: none;
}

.filtro-cabecalho-modal .filtro-checkbox-label {
    flex: 1;
    font-size: 13px;
    line-height: 1.45;
    color: #334455;
    word-break: break-word;
}

.filtro-cabecalho-modal .filtro-opcao-item--destaque .filtro-checkbox-label {
    font-weight: 600;
    color: #2a3f54;
}

.filtro-cabecalho-tabela th.filtro-coluna-ativa,
.filtro-cabecalho-tabela th.filtro-coluna-ativa a,
.filtro-cabecalho-tabela th.filtro-coluna-ativa .ordenar {
    color: #e67e22 !important;
}

.filtro-cabecalho-tabela th.filtro-coluna-ativa {
    background-color: rgba(230, 126, 34, 0.1) !important;
}

.filtro-cabecalho-tabela th .fa-filter.filtro-ativo {
    color: #e67e22 !important;
}

/* Cabeçalhos: evita quebra de linha e alinha texto com ícones de ordenação/filtro */
.filtro-cabecalho-tabela {
    width: max-content;
    min-width: 100%;
}

.filtro-cabecalho-tabela thead th {
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.3;
}

.filtro-cabecalho-tabela thead th a.ordenar {
    white-space: nowrap;
    display: inline;
}

.filtro-cabecalho-tabela thead th .fa-filter,
.filtro-cabecalho-tabela thead th .fa-sort-asc,
.filtro-cabecalho-tabela thead th .fa-sort-desc,
.filtro-cabecalho-tabela thead th .fa-unsorted {
    vertical-align: middle;
}
