/**
 * MAVEN PAGAMENTOS CSS v5.1
 * Estilos premium para Sistema de Pagamento Inteligente
 * Padrão: Mercury Bank + Linear + Notion
 */

/* ========================================
   HEADER
======================================== */

.pagamentos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pagamentos-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin: 0 0 6px 0;
}

.pagamentos-header .subtitle {
  font-size: 14px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.6));
  margin: 0;
}

/* ========================================
   STATS GRID
======================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-card.stat-danger {
  border-left: 3px solid #c0392b;
  background: rgba(192, 57, 43, 0.05);
}

.stat-card.stat-warning {
  border-left: 3px solid #e67e22;
  background: rgba(230, 126, 34, 0.05);
}

.stat-card.stat-success {
  border-left: 3px solid #1a2e1e;
  background: rgba(26, 46, 30, 0.05);
}

.stat-icon {
  font-size: 32px;
  line-height: 1;
  opacity: 0.9;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.5));
  margin-bottom: 6px;
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #f9f6ef);
  margin-bottom: 4px;
  font-family: 'DM Sans', sans-serif;
}

.stat-footer {
  font-size: 13px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.6));
}

/* ========================================
   ALERTAS
======================================== */

.alertas-section {
  margin-bottom: 32px;
}

.alertas-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin-bottom: 16px;
}

.maven-alerta {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 12px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.maven-alerta:hover {
  transform: translateX(4px);
}

.alerta-critico {
  background: rgba(192, 57, 43, 0.08);
  border-left-color: #c0392b;
}

.alerta-atencao {
  background: rgba(230, 126, 34, 0.08);
  border-left-color: #e67e22;
}

.alerta-insight {
  background: rgba(201, 168, 76, 0.08);
  border-left-color: #c9a84c;
}

.alerta-icone {
  font-size: 22px;
  line-height: 1;
  padding-top: 2px;
}

.alerta-conteudo {
  flex: 1;
  min-width: 0;
}

.alerta-titulo {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin-bottom: 6px;
}

.alerta-descricao {
  font-size: 14px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.7));
  margin-bottom: 8px;
  line-height: 1.5;
}

.alerta-acao {
  font-size: 13px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.6));
  font-style: italic;
}

/* ========================================
   CARTÕES GRID
======================================== */

.cartoes-section {
  margin-top: 32px;
}

.cartoes-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin-bottom: 16px;
}

.cartoes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.cartao-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cartao-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.cartao-card.cartao-critico {
  background: rgba(192, 57, 43, 0.08);
  border-color: #c0392b;
}

.cartao-card.cartao-atencao {
  background: rgba(230, 126, 34, 0.08);
  border-color: #e67e22;
}

.cartao-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.cartao-info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cartao-bandeira {
  font-size: 28px;
  line-height: 1;
}

.cartao-nome {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin-bottom: 4px;
}

.cartao-digitos {
  font-size: 13px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.5));
  font-family: 'DM Sans', monospace;
  letter-spacing: 1px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary, rgba(249, 246, 239, 0.4));
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #f9f6ef);
}

/* Fatura */

.cartao-fatura {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fatura-valor {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.fatura-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.5));
  font-weight: 500;
}

.fatura-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #f9f6ef);
  font-family: 'DM Sans', sans-serif;
}

.fatura-limite {
  display: flex;
  justify-content: flex-end;
}

.limite-disponivel {
  font-size: 13px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.6));
}

/* Progresso */

.cartao-progresso {
  margin-bottom: 16px;
}

.progresso-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progresso-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.progresso-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.6));
}

/* Footer */

.cartao-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.5));
}

.cartao-vencimento {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cartao-transacoes {
  opacity: 0.7;
}

.cartao-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(201, 168, 76, 0.15);
  color: #c9a84c;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   MODAL
======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-content {
  background: var(--bg-secondary, #0f1419);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-large {
  max-width: 700px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin: 0;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary, rgba(249, 246, 239, 0.5));
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #f9f6ef);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ========================================
   FORM
======================================== */

.form-pagamento {
  padding: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, rgba(249, 246, 239, 0.7));
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary, #f9f6ef);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: #1a2e1e;
  box-shadow: 0 0 0 3px rgba(26, 46, 30, 0.15);
}

.form-group input[type="color"] {
  height: 44px;
  cursor: pointer;
}

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

.btn-primary {
  background: #1a2e1e;
  color: #f9f6ef;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #2a4e2e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 46, 30, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #f9f6ef);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(192, 57, 43, 0.15);
  color: #e74c3c;
  border: 1px solid rgba(192, 57, 43, 0.3);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(192, 57, 43, 0.25);
  border-color: rgba(192, 57, 43, 0.5);
}

/* ========================================
   DETALHES DO CARTÃO
======================================== */

.detalhes-cartao {
  padding: 24px;
}

.detalhes-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-item {
  text-align: center;
}

.stat-item .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.5));
  margin-bottom: 8px;
  display: block;
}

.stat-item .stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #f9f6ef);
  font-family: 'DM Sans', sans-serif;
}

.detalhes-info {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detalhes-info p {
  font-size: 14px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.7));
  margin: 8px 0;
}

.detalhes-transacoes h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin-bottom: 16px;
}

.transacoes-lista {
  max-height: 300px;
  overflow-y: auto;
}

.transacao-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background 0.2s ease;
}

.transacao-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.transacao-categoria {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin-bottom: 4px;
}

.transacao-descricao {
  font-size: 12px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.6));
}

.transacao-valor {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  text-align: right;
  margin-bottom: 4px;
}

.transacao-data {
  font-size: 12px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.5));
  text-align: right;
}

/* ========================================
   EMPTY STATE
======================================== */

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #f9f6ef);
  margin: 0 0 8px 0;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary, rgba(249, 246, 239, 0.6));
  margin: 0 0 24px 0;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .cartoes-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .detalhes-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
