﻿/* DROPDOWN */

.dropdown-toggle:focus,
.dropdown-toggle:focus-visible {
    box-shadow: none !important;
}

/* Remove azul quando ativo */
.dropdown-toggle.btn-primary:active,
.dropdown-toggle.btn-primary.active,
.show > .dropdown-toggle.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Remove outline/focus residual */
.dropdown-toggle.btn-primary:focus,
.dropdown-toggle.btn-primary:focus-visible {
    box-shadow: none;
}

.dropdown {
    cursor: pointer !important;
}

.dropdown-item {
    cursor: pointer !important;
}

/* CARDS */

.card {
    /*border: 1px solid #EEEEEE;*/
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px !important;
}

.card-header {
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 55px;
    border-bottom: 0.5px dashed #d3d3d3 !important;
}

.card-header-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-buttons {
    display: flex;
    gap: 1px; /* espaço entre os botões */
}

.card-title {
    font-size: 14px !important;
    margin-bottom: 0 !important;
}

.card-footer {
    border-top: 0.5px dashed #d3d3d3 !important;
}

/*DATATABLE*/

/* 1. Base: Removemos o 'fixed' para permitir fluidez no mobile */
table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
    vertical-align: middle !important;
    /* Removido: table-layout: fixed */
}

    /* 2.1 Cabeçalho (thead) */
    table.dataTable thead th {
        vertical-align: middle !important;
        line-height: 1.2 !important; /* Aumente se quiser o cabeçalho mais alto */
        padding: 12px 8px !important; /* Primeiro valor (16px) define a altura */
    }

    /* 2.2 Corpo da Tabela (tbody) */
    table.dataTable tbody td {
        vertical-align: middle !important;
        line-height: 1 !important;
        padding: 8px 8px !important; /* Mantém as linhas do corpo pequenas */
        /*white-space: nowrap !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;*/
    }

/* 3. Ellipsis apenas em Desktop (ajuste o min-width conforme sua necessidade) */
@media (min-width: 768px) {
    table.dataTable {
        table-layout: fixed !important; /* Só fixa em telas grandes */
    }
}

/* 4. Forçar apenas 2 colunas no Mobile */
@media (max-width: 767px) {
    table.dataTable {
        width: 100% !important;
    }
}

/* 5. Dropdown */
.dropdown-menu {
    z-index: 1050 !important;
}

/* 1. Aplicamos o espaçamento e o alinhamento no LABEL (container pai) */
div.dataTables_filter label {
    display: flex !important;
    align-items: center !important; /* Centraliza verticalmente o texto e o input */
    gap: 10px; /* Espaço horizontal entre texto e input */
    margin-bottom: 25px !important; /* Movemos o margin-bottom para aqui */
    white-space: nowrap;
}

/* 2. O INPUT fica limpo para seguir o alinhamento do pai */
div.dataTables_filter input {
    width: 100% !important;
    max-width: 300px !important;
    margin-bottom: 0 !important; /* Removemos daqui para não entortar o flex */
    margin-left: 0 !important;
    height: 30px; /* Opcional: define uma altura padrão para melhor visual */
}

/* 3. Ajuste para telas pequenas */
@media (max-width: 480px) {
    div.dataTables_filter input {
        max-width: 160px !important; /* Garante que caiba ao lado do texto em celulares */
    }
}

/* SELECT2 */

.select2-selection {
    padding-top: 2px !important;
    border-radius: 2px !important;
}

    .select2-selection:focus {
        border-color: var(--custom-border-color-sel);
    }

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: auto;
    min-height: 37px;
    border-radius: 2px !important;
    background-color: #fff !important;
    border-color: var(--custom-border-color);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--custom-border-color-sel) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.select2-selection__choice {
    font-size: 13px !important;
    display: block !important;
    height: 25px !important;
    white-space: nowrap !important;
    line-height: 24px !important;
    /*margin-top: 0.2em !important;*/
    padding: 0 !important;
}

.select2-selection__rendered {
    line-height: 32px !important;
}

/* Para Select2 Single (Seleção única) */
.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #eee !important; /* Cor cinza padrão de campos disabled */
    /*cursor: not-allowed;*/
}

/* Para Select2 Multiple (Seleção múltipla) */
.select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: #eee !important;
    /*cursor: not-allowed;*/
}

/* TAGIFY */

.tagify {
    width: 100%;
    min-height: 38px !important;
    font-size: 0.85rem !important;
    padding-top: 2px !important;
    margin: 0 !important;
}

.tagify__tag {
    margin-top: 4px !important;
}

.tags-look .tagify__dropdown__item {
    display: inline-block;
    border: 1px solid #CCC;
    background: #F3F3F3;
    font-size: 12px !important;
    color: black;
    transition: 0s;
    margin: 2px !important;
}

/* TABULATOR */

/* Libera o corte em todas as camadas */
.tabulator, 
.tabulator-tableHolder, 
.tabulator-row, 
.tabulator-cell {
    overflow: visible !important;
}

/* MUITO IMPORTANTE: Remove o 'position: relative' que prende o menu na célula */
.tabulator-row, .tabulator-cell {
    position: static !important;
}

/* Garante que o menu flutue acima de tudo */
.dropdown-menu.show {
    z-index: 999999 !important;
    position: fixed !important;
}

/* 1. Definições Base */
.tabulator,
.tabulator-header .tabulator-col,
.tabulator-row .tabulator-cell {
    font-size: 12px !important;
}

/* 2. Cores Padrão (Zebrado) */
.tabulator-row.tabulator-row-even {
    background-color: #f2f2f2 !important;
}

.tabulator-row.tabulator-row-odd {
    background-color: #ffffff !important;
}

/* 3. Efeito Hover */
.tabulator-row:hover,
.tabulator-row:hover .tabulator-cell {
    background-color: #e9ecef !important;
}

/* destaque amarelo */
/* 4. MODO EDIÇÃO (Sempre por último para ganhar de todos) */
/*.tabulator-row.tabulator-menu-active,
.tabulator-row.tabulator-menu-active .tabulator-cell,
.tabulator-row.tabulator-selected,
.tabulator-row.tabulator-selected .tabulator-cell {
    background-color: #fff3cd !important; 
    color: #856404 !important;
}*/

.tabulator-tableholder {
    overflow: auto !important; 
}

.tabulator,
.tabulator-table-custom {
    overflow: visible !important;
}

/* 1. Volta o padrão do Tabulator para as células (preserva as bordas) */
.tabulator-cell {
    white-space: nowrap !important;
    overflow: hidden !important; /* Mantém o padrão aqui */
    text-overflow: ellipsis !important;
    border-right: 1px solid #dee2e6 !important; /* Garante a linha vertical */
}

    /* 2. Libera o overflow APENAS onde o menu precisa aparecer */
    .tabulator-cell:has(.cell-dropdown),
    .tabulator-row {
        overflow: visible !important;
    }

/* 4. Ajuste para a célula de dropdown não mostrar reticências no ícone */
.tabulator-cell:has(.cell-dropdown),
.tabulator-row {
    overflow: visible !important;
}

/* --- ESTILIZAÇÃO DO MENU DE AÇÕES --- */
.cell-dropdown {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.card-drop {
    line-height: 1;
    color: inherit;
    font-size: 16px;
    display: flex;
    align-items: center;
}

/* O menu suspenso em si (o quadro que abre) */
.dropdown-menu {
    /*font-family: "Sua-Fonte-Aqui", sans-serif; /* Mude aqui a fonte */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 13px; /* Tamanho do texto das opções */
    min-width: 150px; /* Largura mínima opcional */
}

/* Os itens dentro do menu (Editar, etc) */
.dropdown-item {
    font-family: inherit; /* Herda do .dropdown-menu acima */
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 8px 12px;
}

    /* Ajuste fino para os ícones dentro do menu */
    .dropdown-item i {
        margin-right: 8px;
        vertical-align: middle;
        font-size: 16px; /* Tamanho do ícone (ex: ri-file-edit-line) */
    }

/* Adiciona borda vertical nas células do cabeçalho */
.tabulator-col {
    border-right: 1px solid #dee2e6 !important;
}

    /* Remove a borda da última coluna para não sobrar no canto direito */
    .tabulator-cell:last-child,
    .tabulator-col:last-child {
        border-right: none !important;
    }

/* Remove a borda vertical apenas da coluna de ações para ficar mais limpo */
.tabulator-row .tabulator-cell:last-child {
    border-right: none !important;
}

.tabulator-row {
    cursor: pointer;
}

/* 1. Reset Geral para todos os inputs de filtro (remove o negrito/destaque ruim) */
.tabulator-header-filter input {
    border: 1px solid #ced4da !important;
    border-radius: 2px !important;
    padding: 4px 8px !important;
    font-weight: 400 !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

    /* 3. O destaque azul suave que você gostou (aplica ao focar) */
    .tabulator-header-filter input:focus {
        border-color: #000000 !important;
        box-shadow: 0 0 0 0.1rem rgba(102,102,102,.25) !important;
    }

@media (max-width: 600px) {
    /* Esconde os botões numéricos específicos, mantendo apenas a navegação básica */
    .tabulator-page:not(.tabulator-page-prev):not(.tabulator-page-next) {
        display: none !important;
    }
}

.tabulator-wrapper-custom {
    width: 100%;
    height: auto; 
    position: relative;
    overflow: hidden; 
    padding-top: 2px;
    padding-bottom: 2px;
    padding-left: 10px;
    padding-right: 10px;
}

.tabulator-table-custom {
    height: 100% !important; /* Faz a tabela preencher o wrapper */
}