/* ============================================================================
   SISTEMA DE DESPESAS
   ============================================================================ */

.despesas-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.despesas-container h4,
.despesas-etapa h4 {
  margin: 0px 0px 20px 0px;
  color: #333;
  padding: 10px 15px;
  background: #f8f9fa;
  border-left: 4px solid #c21a26;
  font-size: 1.2em;
  font-family: 'Rubik', sans-serif;
  border-radius: 6px;
}

/* .despesas-listagem-section {

} */

/* ============================================================================
   SEÇÕES PRINCIPAIS
   ============================================================================ */

.despesas-registro-section {
  margin-bottom: 30px;
}

/* ============================================================================
   ETAPAS DO SISTEMA
   ============================================================================ */

.despesas-etapa-oculta {
  display: none;
}

.despesas-etapa {
  margin-bottom: 20px;
}

/* ============================================================================
   SELEÇÃO DE CATEGORIA
   ============================================================================ */

.categoria-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
  /* margin-bottom: 20px; */
}

.categoria-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  text-align: center;
}

.categoria-option:hover {
  border-color: #c21a26;
  box-shadow: 0 4px 8px rgba(194, 26, 38, .1);
  transform: translateY(-2px);
}

.categoria-option.selected {
  border-color: #c21a26;
  background: #fff5f5;
  box-shadow: 0 4px 12px rgba(194, 26, 38, .2);
}

.categoria-icon {
  font-size: 2.5em;
  margin-bottom: 10px;
  display: block;
}

.categoria-option span:not(.categoria-icon) {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

/* ============================================================================
   FORMA DE PAGAMENTO
   ============================================================================ */

.pagamento-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.pagamento-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
  text-align: center;
}

.pagamento-option:hover {
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0, 123, 255, .1);
  transform: translateY(-2px);
}

.pagamento-option.selected {
  border-color: #007bff;
  background: #f0f8ff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, .2);
}

.pagamento-icon {
  font-size: 2em;
  margin-bottom: 10px;
  display: block;
}

.pagamento-option span:not(.pagamento-icon) {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.selecao-cartao {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.selecao-cartao label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

#select-cartao {
  width: 100%;
  padding: 10px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 16px;
}

#select-cartao:focus {
  border-color: #007bff;
  outline: none;
}

/* ============================================================================
   FORMULÁRIO DE DADOS
   ============================================================================ */

.dados-form {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 6px;
}

.dados-form .form-group:last-child {
  margin: 20px 0px 0px 0px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #c21a26;
  outline: none;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.campos-categoria {
  margin-top: 20px;
}

/* ============================================================================
   UPLOAD DE FOTO
   ============================================================================ */

.upload-area {
  position: relative;
}

#foto-comprovante {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.upload-placeholder {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  background: #f8f9fa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-placeholder:hover {
  border-color: #c21a26;
  background: #fff5f5;
}

.upload-icon {
  font-size: 3em;
  margin-bottom: 15px;
  color: #6c757d;
}

.upload-placeholder p {
  margin: 0 0 5px 0;
  font-weight: 600;
  color: #333;
}

.upload-placeholder span {
  color: #6c757d;
  font-size: 14px;
}

.preview-foto {
  position: relative;
  display: none;
  text-align: center;
}

.preview-foto img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
}

.remover-foto-btn {
  display: block;
  margin: 10px auto 0 auto;
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.remover-foto-btn:hover {
  background: #c82333;
}

/* ============================================================================
   RESUMO DA DESPESA
   ============================================================================ */

.resumo-despesa {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #28a745;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(40, 167, 69, .2);
}

.resumo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #dee2e6;
}

.resumo-item:last-child {
  border-bottom: none;
}

.resumo-label {
  font-weight: 600;
  color: #495057;
}

.resumo-valor {
  font-weight: 500;
  color: #333;
  text-align: right;
}

/* ============================================================================
   BOTÕES
   ============================================================================ */

.confirmar-etapa-btn,
.registrar-despesa-btn {
  margin: 20px auto 0 auto;
  background: #c21a26;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  text-align: center;
}

.confirmar-etapa-btn:hover,
.registrar-despesa-btn:hover {
  background: #a50d17;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(194, 26, 38, .3);
}

/* ============================================================================
   LISTAGEM DE DESPESAS - NOVO DESIGN
   ============================================================================ */

.despesas-listagem-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-top: 20px;
}

h4.despesas-dropdown-toggle {
  background: linear-gradient(135deg, #c9333e 0%, #c21a26 100%);
  color: white;
  padding: 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  border-left: none;
  font-family: "Rubik", sans-serif;
}

.despesas-dropdown-toggle::after {
  content: "▼";
  margin-left: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.despesas-dropdown-toggle.active::after {
  content: "▲";
}

.dropdown-arrow {
  display: none;
}

.despesas-dropdown-content {
  display: none;
  animation: slideDown 0.3s ease-out;
}

.despesas-dropdown-content.show {
  display: block;
}

.despesas-list {
  padding: 0;
}

.despesa-item {
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  padding: 20px;
  border-bottom: 1px solid #f1f3f4;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
  background: #fff;
  box-shadow: none;
  border-left: none;
  gap: 5px;
}

.despesa-item:hover {
  background-color: #f8f9fa;
  transform: none;
  box-shadow: none;
}

.despesa-item:last-child {
  border-bottom: none;
}

/* Ícones por categoria */
.despesa-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.despesa-item[data-categoria="Outros"] .despesa-icon {
  background: #e0f2fe;
  color: #0277bd;
}

.despesa-item[data-categoria="Combustivel"] .despesa-icon {
  background: #fff3e0;
  color: #f57c00;
}

.despesa-item[data-categoria="Alimentacao"] .despesa-icon {
  background: #e8f5e8;
  color: #388e3c;
}

.despesa-item[data-categoria="Hospedagem"] .despesa-icon {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Detalhes centrais */
.despesa-details {
  width: 100%;
  flex: 1;
}

.despesa-category {
  font-weight: 500;
  color: #374151;
  margin-bottom: 5px;
}

.despesa-meta {
  flex-wrap: wrap;
  color: #6b7280;
  display: flex;
}

.despesa-meta .despesa-meta-item:nth-child(3) {
  margin: 5px 0px 0px 0px;
  flex-basis: 100%;
}

.despesa-meta-item {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: 5px;
}

.despesa-description {
  font-size: 14px;
  color: #9ca3af;
  margin-top: 5px;
  background: none;
  padding: 0;
  border: none;
  font-style: normal;
}

/* Lado direito */
.despesa-right {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.despesa-amount {
  font-weight: 600;
  font-size: 16px;
  color: #111827;
}

.despesa-status {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: normal;
  border: none;
}

.status-pendente {
  background: #fef3c7;
  color: #92400e;
}

.status-aprovado {
  background: #d4edda;
  color: #155724;
}

.status-rejeitado {
  background: #f8d7da;
  color: #721c24;
}

.sem-despesas {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-style: italic;
  background: #fff;
  border-radius: 0;
  border-left: none;
}

/* ============================================================================
   BOTÃO E MODAL DO COMPROVANTE
   ============================================================================ */

.despesa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.comprovante-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comprovante-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: scale(1.05);
}

.comprovante-btn svg {
  width: 18px;
  height: 18px;
  color: #6c757d;
}

.comprovante-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  cursor: pointer;
}

.comprovante-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 80%;
  max-height: 85%;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.comprovante-modal img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 4px;
  display: block;
}

.comprovante-modal-fechar {
  position: absolute;
  top: -15px;
  right: -15px;
  background: #fff;
  border: 2px solid #dee2e6;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  color: #6c757d;
  transition: all 0.2s ease;
}

.comprovante-modal-fechar:hover {
  background: #dc3545;
  color: #fff;
  border-color: #dc3545;
}

/* Dropdown da listagem */
.despesas-dropdown-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.despesas-dropdown-toggle.active {
  margin-bottom: 5px;
}

.dropdown-arrow {
  transition: transform 0.3s ease;
  color: #c21a26;
}

.despesas-dropdown-toggle.active .dropdown-arrow {
  transform: rotate(180deg);
}

.despesas-dropdown-content {
  display: none;
  animation: slideDown 0.3s ease-out;
}

.despesas-dropdown-content.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   PAGINAÇÃO ESPECÍFICA PARA DESPESAS
   ============================================================================ */

/* Container de paginação das despesas */
.despesas-dropdown-content #paginacao-despesas {
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-top: 1px solid #dee2e6;
}

/* Informações da paginação das despesas */
.despesas-dropdown-content #paginacao-despesas .paginacao-info {
  text-align: center;
  margin-bottom: 15px;
  color: #666;
  font-size: 16px;
}

/* Navegação da paginação das despesas */
.despesas-dropdown-content #paginacao-despesas .paginacao-navegacao {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 10px;
}

/* Números da paginação das despesas */
.despesas-dropdown-content #paginacao-despesas .paginacao-numeros {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Controles da paginação das despesas */


/* Botões da paginação das despesas */
.pag-btn-despesas {
  background: #fff;
  border: 1px solid #dee2e6;
  color: #495057;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  min-width: 40px;
}

.pag-btn-despesas:hover:not(.disabled) {
  background: #e9ecef;
  border-color: #adb5bd;
}

.pag-btn-despesas.active {
  background: #c21a26;
  border-color: #c21a26;
  color: #fff;
}

.pag-btn-despesas.disabled {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Removido: alerta visual para despesas rejeitadas (não utilizado) */

/* Keyframes ainda usados por .aviso-despesas-rejeitadas .aviso-icon */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.comprovante-btn[data-status="REJEITADO"] {
  border-color: #dc3545;
}

.comprovante-btn[data-status="REJEITADO"]:hover {
  background: #dc3545;
  border-color: #dc3545;
}



/* ============================================================================
   AVISO DE DESPESAS REJEITADAS
   ============================================================================ */

.aviso-despesas-rejeitadas {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.15);
  animation: slideInAlert 0.5s ease-out;
}

@keyframes slideInAlert {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aviso-despesas-rejeitadas .aviso-icon {
  font-size: 24px;
  flex-shrink: 0;
  animation: pulse 1.5s infinite;
}

.aviso-despesas-rejeitadas .aviso-texto {
  color: #856404;
  font-size: 14px;
  line-height: 1.4;
}

.aviso-despesas-rejeitadas .aviso-texto strong {
  color: #533f03;
  font-weight: 600;
}

.despesa-motivo-rejeicao {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  border-radius: 4px;
  font-size: 14px;
  color: #856404;
}

.despesa-motivo-rejeicao strong {
  color: #533f03;
}