/* ==================== CONTAS A RECEBER E PAGAR ==================== */
.receber-resumo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  /* Diminuí de 14px para 12px */
  margin-bottom: 20px;
  width: 100%;
}

.receber-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  /* Diminuí de 18px para 14px para caber melhor */
  display: flex;
  align-items: center;
  gap: 10px;
  /* Diminuí de 14px para 10px */
}

.receber-card .icone {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  /* Ícone um pouco maior */
  flex-shrink: 0;
  background: transparent !important;
  /* Remove o fundo */
  border: none !important;
  /* Remove bordas se houver */
}

.receber-card .info .rotulo {
  font-size: 10px;
  /* Fonte um pouco menor para caber */
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  white-space: nowrap;
  /* Evita quebra de linha */
}

.receber-card .info .valor {
  font-size: 18px;
  /* Fonte levemente menor */
  font-weight: 800;
  font-family: var(--font-title);
}

.receber-card .icone.azul {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.receber-card .icone.verde {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.receber-card .icone.vermelho {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.receber-card .icone.laranja {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent);
}

.receber-card .info .rotulo {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.receber-card .info .valor {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-title);
}

.receber-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.receber-tabs button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 0;
  cursor: pointer;
  width: auto;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
}

.receber-tabs button.ativa {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.filtros-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filtros-status button {
  width: auto;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
}

.filtros-status button.ativa {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.filtros-status button .num {
  opacity: 0.7;
  margin-left: 4px;
}

.tabela-receber {
  width: 100%;
  border-collapse: collapse;
}

.tabela-receber th {
  text-align: left;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.tabela-receber td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

.tabela-receber tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.tabela-receber tbody tr:hover {
  background: var(--card-hover);
}

.tabela-receber tbody tr.selecionada {
  background: rgba(249, 115, 22, 0.08);
  border-left: 3px solid var(--accent);
}

.avatar-cliente {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.aberto {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.status-pill.hoje {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent);
}

.status-pill.atrasado {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.status-pill.pago {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.status-pill.parcial {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.btn-receber-linha {
  width: auto;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
}

.btn-receber-linha:hover {
  filter: brightness(1.1);
}

.btn-ver-linha {
  width: auto;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
}

.proximos-venc {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
}

.proximos-venc h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.proximos-venc .linha-venc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.proximos-venc .linha-venc:last-child {
  border-bottom: none;
}

.proximos-venc .info {
  flex: 1;
  min-width: 0;
}

.proximos-venc .info .nome {
  font-size: 13px;
  font-weight: 600;
}

.proximos-venc .info .desc {
  font-size: 11px;
  color: var(--muted);
}

/* NOVO LAYOUT: Tabela na esquerda e Drawer na direita */
.receber-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px;
  align-items: start;
  /* O segredo para o sticky funcionar */
  width: 100%;
  /* REMOVA o height: calc(100vh - 140px); e o overflow: hidden; daqui */
}

.receber-layout .drawer-detalhes {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  position: sticky;
  top: 16px;
  display: none;
  width: 100%;
  max-width: 375px; /* era 400px → alinhado com o RESET */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-sizing: border-box;
}

.receber-layout .drawer-detalhes.ativo {
  display: block;
}

/* Estilização da Barra de Rolagem do Painel Lateral (Drawer) */
.receber-layout .drawer-detalhes::-webkit-scrollbar {
  width: 6px;
  /* Largura fina */
}

.receber-layout .drawer-detalhes::-webkit-scrollbar-track {
  background: transparent;
  /* Fundo invisível */
}

.receber-layout .drawer-detalhes::-webkit-scrollbar-thumb {
  background: var(--border);
  /* Cor da borda do sistema */
  border-radius: 10px;
  /* Bordas arredondadas */
}

.receber-layout .drawer-detalhes::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
  /* Fica um pouco mais clara ao passar o mouse */
}

/* Suporte para Firefox (caso use) */
.receber-layout .drawer-detalhes {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Impede que os mini-cards (Total, Pago, A Pagar) estiquem o painel */
.drawer-detalhes .mini-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Impede que o texto do cliente e da descrição quebrem o layout */
.drawer-detalhes .cabecalho h3,
.drawer-detalhes .cabecalho .sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.drawer-detalhes .cabecalho .sub {
  font-size: 12px;
  color: var(--muted);
}

.drawer-detalhes .cabecalho .fechar {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--txt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.drawer-detalhes .mini-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.drawer-detalhes .mini-cards > div {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.drawer-detalhes .mini-cards .rot {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
}

.drawer-detalhes .mini-cards .val {
  font-size: 13px;
  font-weight: 700;
}

.barra-progresso {
  height: 8px;
  background: var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0 6px;
}

.barra-progresso .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 8px;
  transition: width 0.3s;
}

.lista-parcelas {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.lista-parcelas .parcela {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: 0.15s;
}

.lista-parcelas .parcela:hover {
  border-color: var(--accent);
}

.lista-parcelas .parcela.atual {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.08);
}

.lista-parcelas .parcela .n {
  font-weight: 700;
}

.lista-parcelas .parcela .v {
  color: var(--muted);
}

.lista-parcelas .parcela .st {
  font-size: 10px;
  font-weight: 700;
}

.drawer-detalhes .acoes-grandes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 20px;
}

.drawer-detalhes .acoes-grandes button {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
}

.historico-receb {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.historico-receb h4 {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 10px;
}

.historico-receb .item-hist {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
