/* Financeiro Styles */

/* Resumo Financeiro */
.resumo-financeiro {
  margin-bottom: 16px;
  padding: 16px;
  background: #2d3748;
  border-radius: 8px;
  border: 1px solid #4a5568;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.resumo-financeiro strong {
  color: #17acaf;
  font-weight: 600;
}

/* Controles do Financeiro */
.financeiro-controles {
  margin-bottom: 16px;
  padding: 12px;
  background: #2d3748;
  border-radius: 8px;
  border: 1px solid #4a5568;
}

/* Checkbox customizado */
.checkbox-mostrar-todos {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
  user-select: none;
}

.checkbox-mostrar-todos input[type="checkbox"] {
  display: none;
}

.checkmark {
  position: relative;
  width: 20px;
  height: 20px;
  background: #1a202c;
  border: 2px solid #4a5568;
  border-radius: 4px;
  margin-right: 10px;
  transition: all 0.2s ease;
}

.checkbox-mostrar-todos:hover .checkmark {
  border-color: #17acaf;
}

.checkbox-mostrar-todos input[type="checkbox"]:checked + .checkmark {
  background: #17acaf;
  border-color: #17acaf;
}

.checkbox-mostrar-todos input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

/* Estilos para lançamentos financeiros */
.lancamento-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  border-radius: 8px;
  padding: 4px 10px;
  align-items: center;
  transition: all 0.3s ease;
}

/* Estados visuais para feedback */
.lancamento-item.processando {
  opacity: 0.7;
  transform: scale(0.98);
  pointer-events: none;
}

.lancamento-item.sucesso {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(56, 161, 105, 0.3);
}

.lancamento-item.removendo {
  opacity: 0.5;
  transform: scale(0.95);
  pointer-events: none;
}

/* Cores de fundo por tipo de lançamento */
.lancamento-item.receita {
  background: #38a169;
}

.lancamento-item.receita-vendas {
  background: #3182ce;
}

.lancamento-item.despesa {
  background: #CC0000;
}

/* Ícones dos lançamentos */
.lancamento-item .lancamento-icon i {
  color: #fff;
}

/* Botão de remover */
.lancamento-btn-remover i {
  color: #e53e3e;
}

/* Animação para novos itens */
@keyframes slideInFinanceiro {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lancamento-item.novo {
  animation: slideInFinanceiro 0.4s ease;
}

/* Estilo para notificações do financeiro */
.notificacao-financeiro {
  font-family: inherit;
  font-size: 0.9rem;
  position: fixed;
  top: 80px;
  right: 20px;
  background: #2f855a;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9998;
  font-weight: bold;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  text-align: center;
}

.notificacao-financeiro.erro {
  background: #e53e3e;
}

.notificacao-financeiro.show {
  transform: translateX(0);
}

.notificacao-financeiro.mobile {
  top: 70px;
  left: 10px;
  right: 10px;
  transform: translateY(-100%);
}

.notificacao-financeiro.mobile.show {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .notificacao-financeiro {
    top: 70px;
    left: 10px;
    right: 10px;
    transform: translateY(-100%);
  }
  
  .notificacao-financeiro.show {
    transform: translateY(0);
  }
}

.lancamento-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 0%;
  min-width: 0;
}

.lancamento-icon {
  font-size: 1.5rem;
}

.lancamento-descricao {
  font-size: 0.98rem;
}

.lancamento-valor-container {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 120px;
  text-align: right;
  word-break: break-all;
  height: 100%;
}

.lancamento-valor {
  font-size: 1.1rem;
  font-weight: bold;
  cursor: help;
  position: relative;
}

.lancamento-valor:hover {
  text-decoration: underline;
}

.lancamento-data {
  font-size: 0.9rem;
}

.lancamento-btn-remover {
  background: none;
  border: none;
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  margin-left: 12px;
  text-shadow: 1px 1px 2px rgb(0, 0, 0);
}

.lancamento-btn-remover:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/* Estilos para o formulário financeiro integrado */
#financeiro-form {
  background: #2d3748;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #4a5568;
  margin-bottom: 20px;
}

#financeiro-form input:not([type="radio"]) {
  background: #232b38;
  color: #e2e8f0;
  border: 2px solid #4a5568;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* Inputs dentro de form-row não precisam de margin-bottom */
.form-row input:not([type="radio"]) {
  margin-bottom: 0;
}

#financeiro-form input:not([type="radio"]):hover {
  border-color: #17acaf;
  background-color: #17acaf22;
}

#financeiro-form input:not([type="radio"]):focus {
  outline: none;
  border-color: #17acaf22;
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

#financeiro-form button[type="submit"] {
  background: #17acaf;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 8px;
}

#financeiro-form button[type="submit"]:hover:not(:disabled) {
  background: #17acaf22;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

#financeiro-form button[type="submit"]:active:not(:disabled) {
  transform: translateY(0);
}

#financeiro-form button[type="submit"]:disabled {
  background: #4a5568;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}



/* Estilos para integração unificada */
.integration-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: #2d3748;
  border: 2px solid #4a5568;
}

.integration-status.connected {
  background: rgba(56, 161, 105, 0.1);
  border-color: #38a169;
}

.integration-status.error {
  background: rgba(229, 62, 62, 0.1);
  border-color: #e53e3e;
}

.status-icon {
  font-size: 1.5rem;
}

.status-text {
  color: #e2e8f0;
  font-size: 0.95rem;
}

.sheets-tabs-status {
  background: #2d3748;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.tab-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #4a5568;
}

.tab-status:last-child {
  border-bottom: none;
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-name {
  flex: 1;
  color: #e2e8f0;
  font-weight: 500;
}

.tab-status-indicator {
  font-size: 1.1rem;
}

.btn-create-tab {
  background: #ecc94b;
  color: #1a202c;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-create-tab:hover {
  background: #d69e2e;
}

.btn-sync-primary {
  background: #17acaf;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 8px;
}

.btn-sync-primary:hover {
  background: #2f855a;
}

.btn-sync-primary:disabled {
  background: #4a5568;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-test {
  background: #4a5568;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-test:hover {
  background: #2d3748;
}



/* Aviso de importação */
.aviso-importacao {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: rgba(236, 201, 75, 0.1);
  border: 2px solid #ecc94b;
  border-radius: 8px;
  color: #ecc94b;
}

.aviso-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.aviso-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.aviso-texto {
  flex: 1;
  font-size: 0.9rem;
  min-width: 200px;
}

.aviso-btn {
  background: #ecc94b;
  color: #1a202c;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.aviso-btn:hover {
  background: #d69e2e;
}

.aviso-fechar {
  background: transparent;
  color: #ecc94b;
  border: 1px solid #ecc94b;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.2s;
}

.aviso-fechar:hover {
  background: #ecc94b;
  color: #1a202c;
}

/* Botão de submit com estado de carregamento */
#financeiro-form button[type="submit"] {
  transition: all 0.3s ease;
  position: relative;
}

#financeiro-form button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: #4a5568;
}

#financeiro-form button[type="submit"]:disabled::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@media (max-width: 600px) {
  .aviso-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .aviso-texto {
    min-width: 100%;
  }
  
  .aviso-btn {
    align-self: stretch;
  }


  
  .integration-status {
    flex-direction: column;
    text-align: center;
  }
  
  .sheets-actions {
    flex-direction: column;
  }
  
  .btn-sync-primary,
  .btn-test {
    width: 100%;
    margin: 4px 0;
  }
  
  #financeiro-form {
    padding: 12px;
  }
  
  #financeiro-form input:not([type="radio"]) {
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  
  .form-row input:not([type="radio"]) {
    margin-bottom: 8px;
  }
  
  #financeiro-form button[type="submit"] {
    padding: 12px 20px;
  }
}