/* Tabelas do painel: datas e valores alinhados, ações em linha e linhas mais baixas.
   As classes cell-date, cell-money e cell-actions são aplicadas pelos renderizadores das tabelas. */
.admin-active td.cell-date,
.admin-active :is(td, th).cell-money {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.admin-active :is(td, th).cell-money {
  text-align: right;
}

.admin-active td.cell-money.is-income {
  color: var(--ui-success);
}

.admin-active td.cell-money.is-expense {
  color: var(--ui-danger);
}

@media (min-width: 981px) {
  .admin-active td.cell-actions {
    width: 1%;
  }

  .admin-active .row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .admin-active td.cell-actions .btn {
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Lançamentos e contas a pagar/receber podem não caber na largura: as ações (e, em contas a
     pagar, o valor) ficam fixas à direita e o restante rola por baixo. */
  .admin-active :is(#transactionsView, #payablesView, #receivablesView) :is(th, td).cell-actions {
    position: sticky;
    right: 0;
  }

  .admin-active #payablesView :is(th, td).cell-actions {
    width: 17.5rem;
    min-width: 17.5rem;
    max-width: 17.5rem;
  }

  .admin-active #receivablesView td.cell-actions .receivable-actions {
    flex-wrap: nowrap;
  }

  .admin-active #payablesView :is(th, td).cell-money {
    position: sticky;
    right: 17.5rem;
  }

  .admin-active :is(#transactionsView, #payablesView) :is(th, td).cell-money,
  .admin-active #receivablesView :is(th, td).cell-actions {
    box-shadow: -10px 0 14px -10px var(--ui-edge-shadow, rgba(0, 0, 0, 0.55));
  }

  .admin-active :is(#transactionsView, #payablesView, #receivablesView) td:is(.cell-actions, .cell-money) {
    z-index: 1;
    background: var(--ui-surface-sunken);
  }

  .admin-active #receivablesView td.cell-money {
    position: static;
    background: transparent;
  }

  .admin-active #transactionsView :is(th, td).cell-actions {
    width: 11rem;
    min-width: 11rem;
    max-width: 11rem;
  }

  .admin-active #transactionsView :is(th, td).cell-money {
    position: sticky;
    right: 11rem;
  }

  .admin-active :is(#transactionsView, #payablesView, #receivablesView) th:is(.cell-actions, .cell-money) {
    z-index: 3;
  }

  .admin-active #payablesView td:nth-child(3) {
    min-width: 12rem;
  }

  .admin-active .th-sort-btn {
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
  }

  .admin-active :is(#financeModule, .module-panel) tbody td {
    padding-block: 0.5rem;
  }

  /* Células > Pessoas: a lista ocupa a largura toda e as ações ficam lado a lado. */
  .admin-active .cells-grid.cells-people-stage-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-active :is(.cells-people-actions, .cells-people-actions--members) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: auto;
    min-width: 21rem;
  }

  .admin-active .cells-people-actions .btn-inline {
    width: auto;
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Demais tabelas: a última coluna com botões fica em uma linha só, com botões menores. */
  .admin-active tbody td:last-child:has(> .btn, > div > .btn) {
    width: 1%;
    white-space: nowrap;
  }

  .admin-active tbody td:last-child:has(> .btn, > div > .btn) .btn {
    min-height: 34px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }

  .admin-active #transactionsView .tx-filters-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  /* Contas a pagar: a coluna Anexo repete o que o botão "Boleto" já mostra. */
  .admin-active #payablesView table :is(th, td):nth-child(10) {
    display: none;
  }
}

@media (min-width: 1360px) {
  .admin-active :is(.cells-people-actions, .cells-people-actions--members) {
    flex-wrap: nowrap;
  }
}
