/* Padrão institucional global para tabelas operacionais (referência: MVI). */

.pcse-table-section {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0 .85rem;
    color: var(--pcse-table-accent, var(--bs-theme));
}

.pcse-table-section::after {
    content: "";
    min-width: 2rem;
    height: 1px;
    flex: 1 1 auto;
    background: linear-gradient(90deg, rgba(var(--bs-theme-rgb), .72), rgba(var(--bs-theme-rgb), .04));
}

.pcse-table-section__label {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    flex: 0 0 auto;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.pcse-table-section__label iconify-icon { font-size: .95rem; }

.pcse-table-count {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .25rem .62rem;
    border: 1px solid rgba(var(--bs-theme-rgb), .34);
    border-radius: 999px;
    background: rgba(var(--bs-theme-rgb), .08);
    color: var(--pcse-table-accent, var(--bs-theme));
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .025em;
    white-space: nowrap;
}

.pcse-table-card {
    overflow: hidden;
    border: 1px solid rgba(var(--bs-white-rgb), .1);
    border-radius: .75rem;
    background: rgba(12, 31, 37, .66);
    box-shadow: none;
}

.pcse-table-card > .card-header {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: .72rem .95rem;
    border-bottom: 1px solid rgba(var(--bs-white-rgb), .08);
    background: rgba(var(--bs-white-rgb), .025);
}

.pcse-table-card > .card-header .card-title {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: rgba(var(--bs-white-rgb), .74);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.pcse-table-card__icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(var(--bs-theme-rgb), .34);
    border-radius: .55rem;
    background: rgba(var(--bs-theme-rgb), .08);
    color: var(--pcse-table-accent, var(--bs-theme));
    font-size: 1rem;
}

.pcse-table-card > .card-body { padding: .85rem; }
.pcse-table-wrap { width: 100%; overflow-x: auto; }

body .bootstrap-table .fixed-table-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: .55rem;
    min-height: 36px;
    margin-bottom: .72rem;
}

body .bootstrap-table .fixed-table-toolbar::after,
body .bootstrap-table .fixed-table-pagination::after { display: none; }
body .bootstrap-table .fixed-table-toolbar .columns {
    order: 1;
    float: none !important;
    margin: 0;
}

body .bootstrap-table .fixed-table-toolbar .search {
    order: 2;
    flex: 0 1 260px;
    float: none !important;
    width: 260px;
    max-width: 100%;
    min-width: 240px;
    margin: 0;
}

body .bootstrap-table .fixed-table-toolbar .search-input {
    min-height: 36px;
    height: 36px;
    box-sizing: border-box;
    padding: 4px 8px;
    line-height: 1.5;
    border: 1px solid rgba(var(--bs-white-rgb), .14);
    border-radius: 0 !important;
    background: rgba(var(--bs-white-rgb), .035);
    color: rgba(var(--bs-white-rgb), .78);
    font-size: .72rem;
}

/* Os filtros gerados no cabeçalho devem manter exatamente a mesma geometria,
   independentemente de serem input, select nativo ou Select2. */
body .bootstrap-table .filter-control input,
body .bootstrap-table .filter-control select,
body .bootstrap-table thead input[class*="bootstrap-table-filter-control-"],
body .bootstrap-table thead select[class*="bootstrap-table-filter-control-"] {
    display: block;
    width: 100% !important;
    min-height: 30px !important;
    height: 30px !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 4px 8px !important;
    line-height: 1.2 !important;
    border: 1px solid rgba(var(--bs-white-rgb), .14) !important;
    border-radius: 0 !important;
    background: rgba(var(--bs-white-rgb), .035) !important;
    color: rgba(var(--bs-white-rgb), .78) !important;
    font-size: .72rem !important;
}

body .bootstrap-table .filter-control .select2-container,
body .bootstrap-table thead .select2-container {
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
}

/* O Select2 mantém o select original acessível e absolutamente posicionado.
   A regra de largura dos filtros acima não pode transformar esse elemento
   invisível em uma caixa do tamanho da tabela, pois isso cria overflow falso. */
body .bootstrap-table .filter-control select.select2-hidden-accessible,
body .bootstrap-table thead select.select2-hidden-accessible[class*="bootstrap-table-filter-control-"] {
    position: absolute !important;
    width: 1px !important;
    min-width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body .bootstrap-table .fixed-table-toolbar .btn {
    min-height: 36px;
    height: 36px;
    box-sizing: border-box;
    border-color: rgba(var(--bs-white-rgb), .18);
    border-radius: .45rem;
    background: rgba(var(--bs-white-rgb), .045);
    color: rgba(var(--bs-white-rgb), .78);
}

body .bootstrap-table .fixed-table-pagination .btn {
    min-height: 34px;
    border-color: rgba(var(--bs-white-rgb), .18);
    border-radius: .45rem;
    background: rgba(var(--bs-white-rgb), .045);
    color: rgba(var(--bs-white-rgb), .78);
}

body .bootstrap-table .fixed-table-toolbar .columns .dropdown-menu input[type="checkbox"] {
    width: .95rem;
    height: .95rem;
    margin: 0 .45rem 0 0;
    accent-color: var(--bs-theme, #00ff9c);
    cursor: pointer;
}

body .bootstrap-table .fixed-table-toolbar .columns .dropdown-item-marker {
    display: flex;
    align-items: center;
}

body .bootstrap-table .fixed-table-container {
    border: 1px solid rgba(var(--bs-white-rgb), .08);
    border-radius: .65rem;
    overflow: hidden;
}

body .bootstrap-table table { margin-bottom: 0; }

body .bootstrap-table .fixed-table-container table {
    border-top: 0 !important;
}

body .bootstrap-table .fixed-table-body thead tr {
    border-top: 0 !important;
}

body .bootstrap-table table th,
body .bootstrap-table table td {
    border-right: 0 !important;
    border-left: 0 !important;
}

body .bootstrap-table table thead th {
    padding: .7rem .8rem;
    border-color: rgba(var(--bs-white-rgb), .08);
    background: rgba(var(--bs-white-rgb), .025);
    color: rgba(var(--bs-white-rgb), .46);
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .085em;
    text-transform: uppercase;
    vertical-align: middle;
}

body .bootstrap-table table tbody td {
    padding: .7rem .8rem;
    border-color: rgba(var(--bs-white-rgb), .08);
    color: rgba(var(--bs-white-rgb), .76);
    font-size: .76rem;
    vertical-align: middle;
    white-space: normal;
}

body .bootstrap-table table tbody tr:nth-child(odd) > td { background: rgba(var(--bs-white-rgb), .03); }
body .bootstrap-table table tbody tr:nth-child(even) > td { background: rgba(0, 0, 0, .07); }
body .bootstrap-table table tbody tr:hover > td { background: rgba(var(--bs-theme-rgb), .12); }

/* Tabelas simples também recebem a linguagem visual oficial, sem ganhar
   paginação ou busca quando essas interações não são necessárias. */
body .table-responsive > table.table {
    margin-bottom: 0;
    border: 1px solid rgba(var(--bs-white-rgb), .08);
    border-radius: .65rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

body .table-responsive > table.table > thead > tr > th {
    padding: .7rem .8rem;
    border-right: 0;
    border-left: 0;
    border-color: rgba(var(--bs-white-rgb), .08);
    background: rgba(var(--bs-white-rgb), .025);
    color: rgba(var(--bs-white-rgb), .46);
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .085em;
    text-transform: uppercase;
    vertical-align: middle;
}

body .table-responsive > table.table > tbody > tr > td {
    padding: .7rem .8rem;
    border-right: 0;
    border-left: 0;
    border-color: rgba(var(--bs-white-rgb), .08);
    color: rgba(var(--bs-white-rgb), .76);
    font-size: .76rem;
    vertical-align: middle;
    white-space: normal;
}

body .table-responsive > table.table > tbody > tr:nth-child(odd) > td { background: rgba(var(--bs-white-rgb), .03); }
body .table-responsive > table.table > tbody > tr:nth-child(even) > td { background: rgba(0, 0, 0, .07); }
body .table-responsive > table.table > tbody > tr:hover > td { background: rgba(var(--bs-theme-rgb), .12); }

body .bootstrap-table .fixed-table-pagination {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .75rem;
    padding-top: .72rem;
    border-top: 1px solid rgba(var(--bs-white-rgb), .08);
}

body .bootstrap-table .fixed-table-pagination > .pagination-detail {
    margin: 0 auto 0 0;
    color: rgba(var(--bs-white-rgb), .5);
    font-size: .7rem;
}

body .bootstrap-table .fixed-table-pagination > .pagination {
    margin: 0 0 0 auto;
    align-items: center;
}

body .bootstrap-table .pagination .page-item {
    display: flex;
    align-items: center;
}

body .bootstrap-table .page-link {
    display: inline-flex;
    min-width: 32px;
    height: 32px;
    padding: 0 .55rem;
    align-items: center;
    justify-content: center;
    border-color: rgba(var(--bs-white-rgb), .12);
    background: rgba(var(--bs-white-rgb), .04);
    color: rgba(var(--bs-white-rgb), .68);
    font-size: .7rem;
    line-height: 1;
}

body .bootstrap-table .page-item.active .page-link {
    border-color: rgba(var(--bs-theme-rgb), .62);
    background: rgba(var(--bs-theme-rgb), .18);
    color: var(--pcse-table-accent, var(--bs-theme));
}

@media (max-width: 767.98px) {
    .pcse-table-section { gap: .55rem; margin-top: 1rem; }
    .pcse-table-card > .card-body { padding: .65rem; }
    body .bootstrap-table .fixed-table-toolbar { flex-wrap: wrap; }
    body .bootstrap-table .fixed-table-toolbar .search {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
    body .bootstrap-table .filter-control input,
    body .bootstrap-table .filter-control select,
    body .bootstrap-table thead input[class*="bootstrap-table-filter-control-"],
    body .bootstrap-table thead select[class*="bootstrap-table-filter-control-"] {
        min-height: var(--pcse-select2-height, 48px) !important;
        height: var(--pcse-select2-height, 48px) !important;
    }
    body .bootstrap-table .fixed-table-pagination { align-items: flex-start; flex-direction: column; }
    body .bootstrap-table .fixed-table-pagination > .pagination { margin-left: 0; }
}
