/* Refinamentos exclusivos da consulta pública Betha. */
/* O tema reserva 100px no topo para um navbar fixo que este layout não renderiza. */
body:has(.bx-page) { padding-top: 0; background: #f5f7fb; }
.bx-page { background: #f5f7fb; color: #334155; min-height: 100vh; }
.bx-page .cdt-shell { width: 100%; max-width: none; padding-top: 1rem; }
.bx-page .cdt-header { margin-bottom: 1.75rem; align-items: center; }
.bx-page .cdt-breadcrumb { color: #65758a; font-size: .76rem; margin-bottom: 1.25rem; line-height: 1.7; }
.bx-eyebrow { color: #54718e; font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; margin-bottom: .45rem; }
.bx-page .cdt-title { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -.045em; line-height: 1.2; }
.bx-page .cdt-subtitle { margin-top: .55rem !important; color: #64748b; }
.bx-page .bx-tabs { gap: .25rem; padding: .35rem; margin-bottom: 1.25rem; border: 1px solid #e0e7ef; border-radius: 12px; background: #eaf0f6; scrollbar-width: thin; }
.bx-page .bx-tab { border: 0; border-radius: 8px; background: transparent; padding: .8rem 1rem; color: #53677d; }
.bx-page .bx-tab.is-active { background: #fff; color: #174b7b; box-shadow: 0 2px 5px #17365312; }
.bx-page .bx-tab:hover { background: #ffffffa6; color: #174b7b; }
.bx-page .cdt-card { border-radius: 16px; border-color: #e0e7ef; box-shadow: 0 4px 24px #1f395408; }
.bx-page .cdt-filter-bar { padding: 1rem 1.5rem; background: #fff; gap: 1rem; }
.bx-page .cdt-filter-toggle { border: 1px solid #d6e2ee; padding: .55rem .9rem; }
.bx-page .cdt-filter-toggle.is-open { color: #23557e; background: #edf4fa; border-color: #d6e2ee; }
.bx-page .cdt-chip { background: #f4f7fa; border-color: #e4eaf1; padding: .35rem .7rem; color: #53677d; }
.bx-page .cdt-filter-panel { background: #fbfcfe; }
.bx-page .cdt-filter-panel.is-open { max-height: none; overflow: visible; }
.bx-page .cdt-filter-panel-inner { padding: 1.4rem 1.5rem 1rem; }
.bx-page .cdt-filter-section-label { border: 0; color: #53677d; font-size: .67rem; padding: 0; margin-bottom: .85rem; }
.bx-page .cdt-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.bx-page .cdt-filter-item { min-width: 0; max-width: none; }
.bx-page .cdt-label { color: #465970; font-size: .75rem; font-weight: 600; text-transform: none; }
.bx-page .cdt-control { min-height: 43px; border-color: #dce4ed; border-radius: 8px; font-size: .85rem; box-shadow: 0 1px 2px #18345004; }
.bx-page .cdt-control::placeholder { color: #8290a2; }
.bx-page .cdt-control:disabled { background-color: #edf1f5; cursor: not-allowed; color: #64748b; }
.bx-page #bx-month-help { display: block; margin-top: .4rem; font-size: .7rem; line-height: 1.45; }
.bx-page .bx-filter-actions { align-items: center; justify-content: flex-end; border-top: 1px solid #e7edf3; padding-top: 1rem; gap: .6rem; }
.bx-filter-hint { margin-right: auto; color: #718096; font-size: .75rem; }
.bx-page .bx-btn { border-radius: 8px; font-size: .8rem; min-height: 39px; transition: background .15s, border-color .15s; }
.bx-page .bx-btn--primary { background: #245780; border-color: #245780; box-shadow: 0 2px 4px #24578018; }
.bx-page .bx-btn--primary:hover { background: #173e62; }
.bx-summary { padding: 1.5rem; border-bottom: 1px solid #e7edf3; }
.bx-section-heading h4, .bx-results-heading h4 { font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 700; color: #223e59; margin: 0; letter-spacing: -.02em; }
.bx-section-heading p { margin: .35rem 0 1rem; color: #718096; font-size: .76rem; }
.bx-page .bx-totals { padding: 0; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .85rem; }
.bx-page .bx-total { position: relative; padding: 1.1rem 1.15rem; border-radius: 10px; background: #f8fafc; border-color: #e4ebf2; }
.bx-page .bx-total:first-child { background: #eff6fc; border-color: #d6e6f4; }
.bx-page .bx-total span { line-height: 1.5; font-size: .73rem; font-weight: 500; color: #5b7188; }
.bx-page .bx-total strong { font-size: clamp(1.05rem, 1.5vw, 1.35rem); font-variant-numeric: tabular-nums; letter-spacing: -.025em; margin-top: .65rem; overflow-wrap: anywhere; }
.bx-skeleton { height: 100px; border-radius: 10px; background: linear-gradient(100deg, #f0f4f8 25%, #fafcfe 45%, #f0f4f8 65%); background-size: 200% 100%; animation: bx-shimmer 1.5s infinite; }
.bx-no-totals { color: #718096; font-size: .85rem; margin: 0; }
@keyframes bx-shimmer { to { background-position: -200% 0; } }
.bx-page .cdt-table-section { padding: 1.5rem; }
.bx-page .cdt-stats-row { gap: 1rem; margin-bottom: 1.25rem; }
.bx-results-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.bx-page .cdt-stats-pill { font-size: .71rem; padding: .3rem .65rem; background: #f0f5fa; border-color: #e1e9f1; }
.bx-page .cdt-export-bar { gap: .4rem; }
.bx-page .cdt-export-label { font-size: .65rem; }
.bx-page .cdt-export-btn { border-radius: 7px; padding: .5rem .75rem; font-size: .73rem; box-shadow: none; }
.bx-page .cdt-export-btn:not(.excel) { background: #fff; color: #53677d; border-color: #dce4ed; }
.bx-page .cdt-export-btn:disabled { opacity: .55; cursor: wait; }
.bx-page #bx-export-status:empty { display: none; }
.bx-page #bx-export-status { font-size: .8rem; padding: .65rem .8rem; border-radius: 8px; background: #f0f6fc; }
.bx-page :is(#public-data-table, .bx-group-table) { border: 1px solid #e4ebf2; }
.bx-page .bx-table-container,
.bx-page .bx-table-container .dataTables_wrapper { width: 100%; min-width: 0; max-width: 100%; }
/* Bootstrap legado só habilita .table-responsive em telas pequenas.
   A tabela Betha precisa de rolagem em qualquer largura, sem mover a paginação. */
.bx-page .bx-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: #8fa7bf #edf2f7;
}
.bx-page .bx-table-scroll::-webkit-scrollbar { height: 12px; }
.bx-page .bx-table-scroll::-webkit-scrollbar-track { background: #edf2f7; border-radius: 6px; }
.bx-page .bx-table-scroll::-webkit-scrollbar-thumb { background: #8fa7bf; border: 2px solid #edf2f7; border-radius: 6px; }
.bx-page .bx-table-scroll:focus-visible { outline: 2px solid #83b8e2; outline-offset: 2px; }
.bx-page .bx-table-scroll :is(#public-data-table, .bx-group-table) { margin-bottom: 0 !important; }
.bx-page :is(#public-data-table, .bx-group-table) thead th { background: #f3f6fa; border-top: 0; border-bottom: 1px solid #dae4ef; font-size: .65rem; letter-spacing: .045em; padding: 14px !important; color: #53677d; }
.bx-page :is(#public-data-table, .bx-group-table) tbody td { padding: 14px !important; font-size: .8rem; border-left: 0; border-right: 0; border-color: #edf1f6; }
.bx-page :is(#public-data-table, .bx-group-table) tbody tr:nth-child(even) td { background: #fbfcfe; }
.bx-page :is(#public-data-table, .bx-group-table) td.bx-money { font-variant-numeric: tabular-nums; font-weight: 600; color: #334e68; }
.bx-page :is(#public-data-table, .bx-group-table) td.bx-text { white-space: normal; min-width: 140px; max-width: 440px; overflow-wrap: anywhere; }
.bx-page .js-bx-detail { border: 0; background: #edf4fa; color: #245780; font-size: .72rem; min-height: 33px; }
.bx-page .bx-source { border-top: 1px solid #e7edf3; padding-top: 1rem; margin: 1.25rem 0 0; color: #6d7f92; font-size: .7rem; line-height: 1.6; }
.bx-page .dataTables_info, .bx-page .dataTables_paginate { font-size: .78rem; padding-top: 1rem !important; }
.bx-page :is(button, a, select, input):focus-visible, .bx-modal button:focus-visible { outline: 3px solid #83b8e2; outline-offset: 3px; }
.bx-modal .bx-modal__dialog { border-radius: 16px; overflow: hidden; }
.bx-modal .bx-modal__header { background: #f5f8fc; padding: 1.25rem 1.5rem; align-items: center; }
.bx-modal .bx-modal__close { background: #e7eef6; border-radius: 50%; width: 34px; height: 34px; flex-shrink: 0; }
.bx-modal .bx-modal__body { padding: 1.5rem; }
.bx-modal .bx-fields { gap: 1rem; }
.bx-modal .bx-fields > div { background: #f8fafc; border: 1px solid #e7edf3; border-radius: 8px; padding: .85rem; }
.bx-modal .bx-fields dt { font-size: .65rem; margin-bottom: .4rem; }
.bx-modal .bx-fields dd { font-size: .85rem; }
.bx-modal .bx-list th, .bx-modal .bx-list td { padding: .65rem .8rem; }
@media (max-width: 991px) {
    .bx-page .cdt-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bx-filter-hint { display: none; }
}
@media (max-width: 575px) {
    .bx-page .cdt-header { gap: .75rem; }
    .bx-page .cdt-breadcrumb { font-size: .68rem; margin-bottom: .8rem; }
    .bx-page .cdt-filter-bar, .bx-page .cdt-filter-panel-inner, .bx-page .cdt-table-section, .bx-summary { padding: 1rem; }
    .bx-page .bx-fields-grid { grid-template-columns: 1fr; }
    .bx-page .bx-totals { grid-template-columns: 1fr; }
    .bx-page .bx-filter-actions { flex-wrap: wrap; }
    .bx-page .bx-filter-actions .bx-btn { flex: 1; justify-content: center; }
    .bx-page .cdt-filter-bar { align-items: flex-start; flex-wrap: wrap; }
    .bx-page .cdt-chips-strip { flex-basis: 100%; }
    .bx-page .cdt-export-bar { flex-wrap: wrap; }
    .bx-modal .bx-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .bx-page *, .bx-modal * { animation: none !important; transition: none !important; }
}

.bx-page .bx-last-update { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .8rem; padding: .4rem .7rem; border: 1px solid #dce7ef; border-radius: 8px; background: #fff; color: #64748b; font-size: .73rem; }
.bx-page .bx-last-update strong { color: #334e68; font-weight: 600; font-variant-numeric: tabular-nums; }

.bx-page .bx-group-summary { min-height: 0; }
.bx-group-toolbar, .bx-group-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem 1rem;
}
.bx-group-toolbar { margin-bottom: 1rem; }
.bx-group-summary .bx-table-scroll { border-radius: 8px; container: payroll / inline-size; }
.bx-page .bx-group-summary :is(#public-data-table, .bx-group-table) .bx-group-value { text-align: right; }
.bx-page .bx-group-summary :is(#public-data-table, .bx-group-table) td.bx-group-value { white-space: nowrap; }
.bx-group-footer { padding-top: 1rem; color: #53677d; font-size: .8rem; }
.bx-group-footer nav { display: flex; flex-wrap: wrap; gap: .5rem; }

.bx-group-toggle::before { content: '▸'; display: inline-block; margin-right: .4em; }
.bx-group-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.bx-group-toggle[aria-busy="true"] { cursor: progress; }
.bx-child-row > td { border-inline-start: 3px solid #dce7ef; }

/* O agrupador é HTML nativo: não recebe as larguras que o DataTables calcula. */
.bx-page .bx-group-header { margin-bottom: 1rem; padding-block: 1.1rem; }
.bx-group-header .cdt-breadcrumb { margin-bottom: .5rem; }
.bx-group-header .bx-last-update { margin-top: .5rem; border: 0; background: transparent; padding: 0; }
.bx-group-summary .bx-group-table {
    display: table;
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
}
.bx-group-table .bx-group-name-col { width: 34%; }
.bx-page .bx-group-table thead th:first-child { text-align: left; }
.bx-page .bx-group-summary .bx-group-table > thead > tr > th {
    font-size: .75rem;
    padding: .55rem .65rem !important;
    overflow-wrap: anywhere;
    line-height: 1.35;
    letter-spacing: normal;
    vertical-align: middle;
}
.bx-page .bx-group-summary .bx-group-table > tbody > tr > td {
    vertical-align: middle;
    line-height: 1.45;
    font-size: .8rem;
    padding: .58rem .65rem !important;
    border-bottom: 1px solid #e4ebf2;
}
.bx-group-summary .bx-group-toggle {
    display: inline-flex;
    align-items: baseline;
    gap: .5rem;
    text-decoration: none;
    color: #245780;
    font-weight: 600;
}
.bx-group-summary .bx-group-toggle:hover { text-decoration: underline; }
.bx-group-toggle::before { flex: none; color: #47799e; }
.bx-page .bx-child-row .bx-group-summary { padding: .65rem; }
.bx-page .bx-group-summary .bx-group-value { font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
    .bx-page .bx-group-summary { padding: .85rem; min-width: 0; }
    .bx-page .bx-group-header { padding: 1rem; }
}

@container payroll (max-width: 52rem) {
    .bx-group-table > tbody { display: block; }
    .bx-page :is(#public-data-table, .bx-group-table) td.bx-text { min-width: 0; max-width: none; }
    .bx-group-summary .bx-group-toggle { max-width: 100%; overflow-wrap: anywhere; }
    .bx-group-summary .bx-group-table { display: block; }
    .bx-group-table > colgroup { display: none; }
    .bx-group-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .bx-group-table > tbody > tr {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
        border-bottom: 1px solid #dae4ef;
    }
    .bx-group-table > tbody > tr > :first-child { grid-column: 1 / -1; }
    .bx-page .bx-group-summary :is(#public-data-table, .bx-group-table) td.bx-group-value {
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .bx-group-value[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .15rem;
        font-size: .73rem;
        color: #53677d;
        font-weight: 500;
    }
    .bx-page .bx-group-summary .bx-group-table > tbody > .bx-child-row > td,
    .bx-page .bx-child-row .bx-group-summary { min-width: 0; padding: .25rem !important; }
}

.bx-list-order { display: none; }
.bx-page .bx-table-container #public-data-table { table-layout: fixed; }
.bx-page .bx-table-container #public-data-table thead th:nth-child(n),
.bx-page .bx-table-container #public-data-table tbody td {
    min-width: 0;
    max-width: none;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
    padding: .55rem .6rem !important;
}
.bx-page .bx-table-container #public-data-table thead th { font-size: .72rem; }
.bx-page .bx-table-container #public-data-table thead th.sorting,
.bx-page .bx-table-container #public-data-table thead th.sorting_asc,
.bx-page .bx-table-container #public-data-table thead th.sorting_desc { padding-right: 1.4rem !important; }
.bx-page .bx-table-container #public-data-table tbody td { font-size: .78rem; }
.bx-table-container .js-bx-detail { max-width: 100%; white-space: normal; }
.bx-list-stacked .bx-list-order {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}
.bx-list-order select { width: auto; max-width: 100%; }
.bx-page .bx-list-stacked #public-data-table,
.bx-page .bx-list-stacked #public-data-table tbody { display: block; }
.bx-list-stacked #public-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    visibility: hidden;
}
.bx-list-stacked #public-data-table tbody tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    border-bottom: 2px solid #dae4ef;
}
.bx-page .bx-list-stacked #public-data-table td { text-align: left; }
.bx-list-stacked #public-data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: #53677d;
    font-size: .73rem;
    font-weight: 600;
}
.bx-list-stacked #public-data-table td:last-child { grid-column: 1 / -1; }
