/* Box Boy V5.8.55 — alinhamento do TEXTO dos títulos com o conteúdo visível.
   Ajustes delimitados às nove visualizações auditadas na V5.8.54.
   Sem mudanças em formulários, cartões operacionais, permissões ou dados. */

/* 1. Ordenação: a seta não pode deslocar a legenda do centro da coluna.
   Preserva clique, aria-sort, foco e direção, inclusive cabeçalho longo. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) :is(
  #reportsPage,#storesAdminPage,#registrationsPage,#clientsPage,#couriersPage
) table thead th > button.bb33-sort-head {
  position:relative;
  display:flex;
  width:100%;
  box-sizing:border-box;
  justify-content:center!important;
  text-align:center!important;
  padding-inline:20px!important;
  white-space:normal;
  min-width:0;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) :is(
  #reportsPage,#storesAdminPage,#registrationsPage,#clientsPage
) table thead th > button.bb33-sort-head::after {
  position:absolute;
  inset-inline-end:4px;
  top:50%;
  transform:translateY(-50%);
  flex:none;
  margin:0;
  pointer-events:none;
}
/* Ranking usa ícone próprio atualizado pelo JS; evita uma segunda seta. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #couriersPage table thead th > .bb33-rank-head::after {
  content:none!important;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #couriersPage table thead :is(.rank-sort-head,.courier-sort-head) {
  position:absolute;
  inset-inline-end:4px;
  top:50%;
  transform:translateY(-50%);
  margin:0;
  pointer-events:none;
}
/* Cobrança/Geral também contém título+seta em botão flex. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage #billingMainTableV5719 thead th button.bb39-billing-sort {
  position:relative;
  width:100%;
  box-sizing:border-box;
  display:flex;
  justify-content:center!important;
  text-align:center!important;
  padding-inline:17px!important;
  white-space:normal;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage #billingMainTableV5719 thead th .bb39-sort-indicator {
  position:absolute;
  inset-inline-end:3px;
  top:50%;
  transform:translateY(-50%);
  margin:0;
  pointer-events:none;
}

/* 2. Relatórios / Movimentos — substitui alinhamentos legados por coluna
   inclusive nas células que contêm texto ou badges. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #reportsPage .general-report-tablewrap table thead tr > th,
body:is(.boxboy-theme-light,.boxboy-theme-dark) #reportsPage .general-report-tablewrap table tbody tr > td {
  text-align:center!important;
  vertical-align:middle;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #reportsPage .general-report-tablewrap tbody td :is(.report-action-group-v5842,.report-integration-cell) {
  justify-content:center;
}

/* 3. Dashboard / Detalhamento — inclui a primeira coluna e 12 métricas. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #dashboardPage .dashboard-store-table-v5841 thead tr > th,
body:is(.boxboy-theme-light,.boxboy-theme-dark) #dashboardPage .dashboard-store-table-v5841 tbody tr > td {
  text-align:center!important;
  vertical-align:middle;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #dashboardPage .dashboard-store-table-v5841 thead th > button {
  position:relative;
  width:100%;
  box-sizing:border-box;
  justify-content:center!important;
  text-align:center!important;
  padding-inline:16px!important;
}
#dashboardPage .dashboard-store-table-v5841 thead th > button .sort-head {
  position:absolute;
  inset-inline-end:2px;
  top:50%;
  transform:translateY(-50%);
  margin:0;
  pointer-events:none;
}

/* 4. Dashboard / Entregadores é uma GRADE de divs, não uma tabela. */
#dashboardPage .dashboard-courier-head-v5841 > :is(span,button),
#dashboardPage .dashboard-courier-row-v5841 > :is(span,b,strong,em) {
  text-align:center!important;
  justify-self:stretch;
  min-width:0;
}
#dashboardPage .dashboard-courier-head-v5841 > button {
  position:relative;
  display:flex;
  justify-content:center;
  align-items:center;
  box-sizing:border-box;
  padding-inline:0!important;
  white-space:nowrap;
}
#dashboardPage .dashboard-courier-head-v5841 .bb55-courier-sort-label {
  position:absolute;
  inset-inline:0;
  top:50%;
  transform:translateY(-50%);
  text-align:center;
  white-space:nowrap;
  pointer-events:none;
}
#dashboardPage .dashboard-courier-head-v5841 .bb55-courier-sort-arrow {
  position:absolute;
  inset-inline-end:0;
  top:50%;
  transform:translateY(-50%);
  pointer-events:none;
}
#dashboardPage .dashboard-courier-row-v5841 > .dashboard-courier-meter-v5841 {
  width:min(100%,145px);
  justify-self:center;
}

/* 5. Lojas: três colunas que ainda herdavam text-align:left!important. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #storesAdminPage .v50-admin-table tbody tr > :is(td:nth-child(3),td:nth-child(4),td:nth-child(5)),
body:is(.boxboy-theme-light,.boxboy-theme-dark) #storesAdminPage .v50-admin-table thead tr > th {
  text-align:center!important;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #storesAdminPage .v50-admin-table tbody td :is(.v50-muted,.v50-code) {
  text-align:center!important;
}

/* 6. Cobrança / Geral: centralizar o conteúdo, não só o td. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage #billingMainTableV5719.billing-table-v5722 thead tr > th,
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage #billingMainTableV5719.billing-table-v5722 tbody tr > td {
  text-align:center!important;
  vertical-align:middle!important;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage #billingMainTableV5719 :is(
  .bill-client-v5722,.bill-client-v5722 b,.bill-client-v5722 small,
  .bill-provider-v5719,.bill-paid-date-v5722,
  .nfse-summary-v5718 small
) {text-align:center!important;}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage #billingMainTableV5719 :is(
  .bill-actions-v5722,.bill-paid-v5722,.nfse-summary-v5718,.nfse-summary-title-v5718,
  .billing-method-cell-v5821,.billing-link-actions-v571
) {justify-content:center!important;}

/* 7. Cobrança / E-mail: legado tinha left!important em toda a tabela.
   Preserva o grupo de ações e os indicadores de status. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage .billing-email-table-v5728 thead tr > :is(th:nth-child(2),th:nth-child(6)),
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage .billing-email-table-v5728 tbody tr > :is(td:nth-child(2),td:nth-child(6)) {
  text-align:center!important;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage .billing-email-table-v5728 .billing-email-address-block-v5721 {
  position:relative;
  justify-content:center!important;
  box-sizing:border-box;
  padding-inline:34px;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage .billing-email-table-v5728 .billing-email-address-block-v5721 > span {
  flex:1 1 auto;
  text-align:center!important;
  min-width:0;
}
body:is(.boxboy-theme-light,.boxboy-theme-dark) #billingChargesPage .billing-email-table-v5728 .billing-email-address-block-v5721 > button {
  position:absolute;
  inset-inline-end:0;
  top:50%;
  transform:translateY(-50%);
}

/* 8. Ranking: turnos não devem ficar presos ao lado direito da célula. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #couriersPage .courier-table tbody td .turn-pills {
  justify-content:center!important;
}
/* Cabeçalhos ordenáveis nas duas tabelas: o rótulo, e não rótulo+seta,
   fica centralizado. A ordenação permanece delegada ao JS original. */
body:is(.boxboy-theme-light,.boxboy-theme-dark) #couriersPage table :is(th[data-courier-sort],th[data-rank-sort]) {
  text-align:center!important;
}
