
/* Linha de totais igual grid das linhas da tabela */
.lancamentos-total-row {
  display: grid;
  grid-template-columns: 2.5rem 16rem 5fr 2fr 1.5fr 2fr 2fr 2fr;
  gap: 0.5rem;
  align-items: center;
  background: #182233;
  border-top: 2px solid #22304a;
  font-weight: 700;
  font-size: 1rem;
  color: #bfc9db;
  min-height: 44px;
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}
.lancamentos-total-row .col {
  padding: 0;
  text-align: center;
}
/* Aumenta a fonte dos valores na linha de totais */
.lancamentos-total-row .valor-real,
.lancamentos-total-row .custo-real,
.lancamentos-total-row .total-real {
  font-size: 14px !important;
  font-weight: 700;
}
.lancamentos-total-row .col-due {
  color: #1e90ff;
}
.lancamentos-total-row .col-days {
  color: #e23c3c;
}
.lancamentos-total-row .col-total {
  color: #1ecb7b;
}
.lancamentos-card-entrada .lancamentos-card-value {
  color: #1ecb7b;
}
.lancamentos-card-custo .lancamentos-card-value {
  color: #e23c3c;
}
.lancamentos-card-total .lancamentos-card-value {
  color: #1e90ff;
}
/* Botão excluir estilo grid de planos */
.lancamento-row .btn.lancamento-excluir {
  background: rgba(14,165,255,0.06);
  color: #d66c26;
  border: 2px solid rgba(14,165,255,0.15);
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(14,165,255,0.08);
}
.lancamento-row .btn.lancamento-excluir:hover {
  background: rgba(14,165,255,0.18);
  color: #d66c26;
  border-color: #d66c26;
}
/* Valor em moeda azul igual tela de clientes */
.lancamento-row .valor-real {
  color: #3ecfff;
  font-weight: 600;
  font-size: 16px !important;
}
.lancamento-row .custo-real {
  color: #ff4d4f;
  font-weight: 600;
  font-size: 16px !important;
}
.lancamento-row .total-real {
  color: #1ed760;
  font-weight: 600;
  font-size: 16px !important;
}
/* ====== PÁGINA LANÇAMENTOS ====== */

/* Campo de busca dos filtros igual aos selects */
.filters-left .search-input {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  background: linear-gradient(145deg, rgba(16, 24, 35, 0.95), rgba(12, 17, 25, 0.95));
  color: var(--muted-light);
  border: 1.5px solid rgba(14,165,255,0.15);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), 0 2px 8px rgba(14,165,255,0.06);
  transition: all 0.25s ease;
}
.filters-left .search-input:hover {
  border-color: rgba(14,165,255,0.35);
  box-shadow: 0 0 8px rgba(14,165,255,0.15);
  background: linear-gradient(145deg, rgba(16,26,38,1), rgba(12,20,30,1));
}
.filters-left .search-input:focus {
  outline: none;
  border-color: rgba(14,165,255,0.45);
  box-shadow: 0 0 0 3px rgba(14,165,255,0.12), inset 0 1px 2px rgba(255,255,255,0.05);
}

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.page-header .title-group h2 { margin: 0; }

/* ===== TABELA DE LANÇAMENTOS ===== */
.clients-box {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
  padding: 18px 0 0 0;
  margin-top: 5px;
}

/* Cabeçalho da tabela */
/* Aumentar a coluna CLIENTE em 100% */
.clients-header-row {
  display: grid;
  grid-template-columns: 2.5rem 16rem 5fr 2fr 1.5fr 2fr 5fr 1.5fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.3rem;
  font-size: 13px;
  color: #66e8ff !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(14,165,255,0.18) !important;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.04) !important;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Linhas de lançamentos */
.lancamento-row {
  display: grid;
  grid-template-columns: 2.5rem 16rem 5fr 2fr 1.5fr 2fr 5fr 1.5fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.2rem;
  border-radius: 0.5rem;
  border-bottom: 2px solid rgba(14,165,255,0.18);
  background: rgba(255,255,255,0.04);
  margin-bottom: 0.5rem;
  color: #fff !important;
  font-size: 16px;
}
.lancamento-row .col-check, .clients-header-row .col-check { display: flex; align-items: center; justify-content: center; }
.lancamento-row .col-lancamento, .clients-header-row .col-lancamento { display: flex; align-items: center; gap: 12px; justify-self: start; }
.lancamento-row .col-plan, .clients-header-row .col-plan { text-align: center; justify-self: center; }
.lancamento-row .col-due, .clients-header-row .col-due { text-align: center; justify-self: center; font-size: 12px;}
.lancamento-row .col-days, .clients-header-row .col-days { text-align: center; justify-self: center; font-size: 12px;}
.lancamento-row .col-status, .clients-header-row .col-status { text-align: center; justify-self: center; }
.lancamento-row .col-payment, .clients-header-row .col-payment { text-align: center; justify-self: center; }
.lancamento-row .col-actions, .clients-header-row .col-actions { display: flex; gap: 8px; justify-content: flex-end; justify-self: start; }

/* Paginação */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pagination .page-btn { background: transparent; border: 1px solid rgba(255,255,255,0.03); padding: 6px 10px; border-radius: 6px; color: var(--muted-light); cursor: pointer; min-width: 36px; text-align: center; }
.pagination .page-btn:hover:not(:disabled):not(.active) { background: rgba(255,255,255,0.02); border-color: rgba(255,255,255,0.06); }
.pagination .page-btn.active { background: rgba(14,165,255,0.06); border-color: rgba(14,165,255,0.15); color: #0ea5ff; }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-ellipsis { color: var(--muted); padding: 6px 4px; user-select: none; }

/* Botões principais */
#btnNovoLancamento {
  background: rgba(14,165,255,0.06);
  color: #0ea5ff;
  border: 2px solid rgba(14,165,255,0.15);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(14,165,255,0.08);
}
#btnNovoLancamento:hover, #btnNovoLancamento.active, #btnNovoLancamento:focus {
  background: rgba(14,165,255,0.18);
}

.more-actions-wrapper { display:inline-block; position:relative; margin-left:8px; z-index: 1100; }
#btnMoreActions {
  height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(14,165,255,0.06);
  color: #0ea5ff;
  border: 2px solid rgba(14,165,255,0.15);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(14,165,255,0.08);
}
#btnMoreActions:hover, #btnMoreActions.active, #btnMoreActions:focus {
  background: rgba(14,165,255,0.18);
}

/* O menu só fica visível quando tem a classe .show */
#moreActionsMenu, .dropdown-menu {
  display: none;
}
@media (max-width: 900px) {
  .filters-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100vw !important;
    padding: 0 12px !important;
    align-items: stretch !important;
  }
  .filters-row-1 {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100%;
  }
  .filters-row-2 {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100%;
  }
  .filter-periodo {
    flex: 2 1 0;
    min-width: 0;
    margin-right: 0 !important;
  }
  .btn-clear-filter, .filter-mostrar {
    flex: 1 1 0;
    min-width: 0;
    margin-left: 0 !important;
  }
  .filters-left .search-input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
}
  #moreActionsMenu.show {
    display: block;
    position: fixed !important;
    left: 80% !important;
    top: 145px !important;
    transform: translateX(-50%) !important;
    min-width: 220px !important;
    max-width: 90vw !important;
    background: #10151c;
    border-radius: 12px;
    padding: 10px 0;
    border: 1.5px solid rgba(14,165,255,0.15);
    box-shadow: 0 8px 32px rgba(14,165,255,0.10), 0 2px 16px rgba(0,0,0,0.18);
    overflow: hidden;
    z-index: 3000 !important;
  }

#moreActionsMenu.show {
  display: block;
  position: absolute;
  right: 0;
  top: 44px;
  min-width: 170px;
  background: #10151c;
  border-radius: 12px;
  padding: 10px 0;
  border: 1.5px solid rgba(14,165,255,0.15);
  box-shadow: 0 8px 32px rgba(14,165,255,0.10), 0 2px 16px rgba(0,0,0,0.18);
  overflow: hidden;
  z-index: 1100;
}
#moreActionsMenu .dropdown-item {
  padding: 12px 18px;
  color: #60a5fa;
  font-size: 14px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: left;
}
#moreActionsMenu .dropdown-item:last-child {
  border-bottom: none;
}
#moreActionsMenu .dropdown-item:hover, #moreActionsMenu .dropdown-item:focus {
  background: rgba(14,165,255,0.08);
  color: #0ea5ff;
}
#moreActionsMenu .dropdown-item.delete {
  color: #ef4444;
}
#moreActionsMenu .dropdown-item.delete:hover {
  background: rgba(239,68,68,0.10);
  color: #fff;
}

.btn-clear-filter {
  background: transparent;
  color: #60a5fa;
  border: 1.5px solid rgba(14,165,255,0.15);
  border-radius: 7px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  margin-left: 8px;
  transition: background 0.22s, color 0.22s, border 0.22s, box-shadow 0.22s, transform 0.12s;
  box-shadow: none;
}
.btn-clear-filter:hover, .btn-clear-filter:focus {
  background: rgba(14,165,255,0.12);
  color: #0ea5ff;
  border-color: #0ea5ff;
  box-shadow: 0 2px 8px rgba(14,165,255,0.10) inset;
  outline: none;
  transform: scale(1.08);
}
.btn-clear-filter:active {
  background: rgba(14,165,255,0.18);
  color: #fff;
  border-color: #0ea5ff;
  box-shadow: 0 0 0 2px rgba(14,165,255,0.18) inset;
  transform: scale(0.96);
}

/* Modal de lançamento */
#lancamentoModal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10,18,30,0.82);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s;
}
#lancamentoModal.active {
  display: flex;
  opacity: 1;
}
#lancamentoModal .modal {
  background: #181f2a;
  border-radius: 16px;
  padding: 0 0 0 0;
  min-width: 420px;
  max-width: 98vw;
  width: 520px;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.32s cubic-bezier(.4,2,.6,1);
}
#lancamentoModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 10px 28px;
  background: transparent;
}
#lancamentoModal .modal-header h3 {
  margin: 0;
  color: #38b6ff;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
#lancamentoModal .modal-header .btn.small {
  background: none;
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}
#lancamentoModal .modal-header .btn.small:hover {
  background: #222e3c;
  color: #38b6ff;
}
#lancamentoModal .modal-body {
  padding: 0 32px 28px 32px;
  overflow-y: auto;
}
#lancamentoModal .modal-form .form-row.full {
  width: 100%;
  margin-bottom: 12px;
}
#lancamentoModal .modal-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
  margin-bottom: 12px;
}
#lancamentoModal .modal-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#lancamentoModal .modal-form input,
#lancamentoModal .modal-form select {
  background: #20293a;
  border: 1.5px solid rgba(14,165,255,0.13);
  color: #e0e6f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 15px;
  outline: none;
  transition: border 0.18s, box-shadow 0.18s;
}
#lancamentoModal .modal-form input:focus,
#lancamentoModal .modal-form select:focus {
  border-color: #38b6ff;
  box-shadow: 0 0 0 2px #38b6ff33;
}
#lancamentoModal .modal-form label.form-label {
  color: #e0e6f0;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}
#lancamentoModal .payment-panel {
  margin-bottom: 12px;
  margin-top: 2px;
  padding: 10px 12px 10px 12px;
  display: flex;
  align-items: center;
  border: 1px dashed rgba(255,255,255,0.03);
  border-radius: 8px;
}
#lancamentoModal .payment-panel .rem-item {
  width: 100%;
}
#lancamentoModal .payment-panel .rem-label {
  font-size: 16px;
  font-weight: 700;
  color: #38b6ff;
}
#lancamentoModal .payment-panel .rem-toggle input[type="checkbox"] {
  margin-top: 4px;
}
#lancamentoModal .modal-form textarea {
  width: 100%;
  background: #20293a;
  color: #e0e6f0;
  border: 1.5px solid rgba(14,165,255,0.13);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  margin-top: 2px;
  min-height: 62px;
  resize: vertical;
}
#lancamentoModal .modal-form .form-row.buttons {
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: flex-start;
  margin-top: 10px;
}
#lancamentoModal .modal-form .form-row.buttons .btn.success {
  background: rgba(14,165,255,0.06);
  color: #1ab87b;
  border: 2px solid rgba(14,165,255,0.15);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(14,165,255,0.08);
  min-width: 120px;
}
#lancamentoModal .modal-form .form-row.buttons .btn.success:hover {
  background: rgba(14,165,255,0.18);
  color: #1ab87b;
  border-color: #1ab87b;
}
#lancamentoModal .modal-form .form-row.buttons .btn.danger {
  background: rgba(14,165,255,0.06);
  color: #d66c26;
  border: 2px solid rgba(14,165,255,0.15);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(14,165,255,0.08);
  min-width: 120px;
}
#lancamentoModal .modal-form .form-row.buttons .btn.danger:hover {
  background: rgba(14,165,255,0.18);
  color: #d66c26;
  border-color: #d66c26;
}

@keyframes modalIn {
  0% { transform: translateY(60px) scale(0.98); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Checkbox customizado */
.col-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  cursor: pointer;
}
.col-check input[type="checkbox"]:checked {
  background: linear-gradient(180deg, rgba(14,165,255,0.16), rgba(14,165,255,0.06));
  border-color: rgba(14,165,255,0.35);
}
.col-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Resumo e paginação */
#lancamentosSummary { margin:12px 0 20px; text-align:center; color:var(--muted); font-size:13px; }
#lancamentosPagination { margin-top:12px; display:flex; justify-content:center; }

/* Ajustes para responsividade se necessário */



@media (max-width: 900px) {
  .clients-box {
    overflow-x: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .clients-list {
    width: 1200px !important;
    min-width: 1200px !important;
    max-width: 1200px !important;
    display: block !important;
  }
  .clients-header-row, .lancamento-row {
    min-width: 1200px !important;
    font-size: 14px !important;
    grid-template-columns: 2.5rem 8rem 2.5fr 2fr 2fr 2fr 2fr 2fr !important;
  }
}
