/* ============================================================
   VISI MARKETING CRM — GESTÃO FINANCEIRA
   ============================================================ */

/* ---- HEADER FILTER DROPDOWN & SELECTOR ---- */
.fin-filter-container {
  position: relative;
}

.fin-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  transition: var(--transition);
}

[data-theme="dark"] .fin-select-btn {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.fin-select-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.fin-select-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2.5;
  transition: transform 0.22s ease;
}

.fin-select-btn.active svg {
  transform: rotate(180deg);
}

/* Dropdown de Período */
.fin-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 180px;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  padding: 6px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.fin-dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fin-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.fin-dropdown-item:hover {
  background: rgba(26, 206, 238, 0.1);
  color: var(--cyan);
}

.fin-dropdown-item.active {
  background: var(--cyan);
  color: #000;
  font-weight: 600;
}

/* ---- SUMMARY WIDGET CARDS GRID ---- */
.fin-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.fin-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: var(--transition);
  animation: fadeSlideUp 0.35s ease both;
}

.fin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.fin-stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fin-icon-receita {
  background: rgba(16, 185, 129, 0.1);
}
.fin-icon-receita svg {
  stroke: #10B981;
}

.fin-icon-despesa {
  background: rgba(239, 68, 68, 0.1);
}
.fin-icon-despesa svg {
  stroke: #EF4444;
}

.fin-icon-saldo {
  background: var(--cyan-dim);
}
.fin-icon-saldo svg {
  stroke: var(--cyan);
}

.fin-stat-icon-wrap svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fin-stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fin-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fin-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

/* ---- TAB CONTROL BAR ---- */
.fin-tabs-container {
  background: #0D0D0D;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xl);
  padding: 8px;
  margin-bottom: 24px;
}

.fin-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 16px 14px;
}

.fin-tabs-triggers {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.fin-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.fin-tab-btn:hover {
  color: var(--black);
  background: rgba(255, 255, 255, 0.02);
}

.fin-tab-btn.active {
  background: var(--cyan);
  color: #000;
}

.fin-tab-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.fin-tab-count {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 12px;
  color: inherit;
}

.fin-tab-btn.active .fin-tab-count {
  background: rgba(0, 0, 0, 0.15);
}

.fin-tab-meta-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- TAB CONTENT / PANEL ---- */
.fin-tab-panel {
  display: none;
  animation: pageFadeIn 0.22s ease;
}

.fin-tab-panel.active {
  display: block;
}

/* ---- DATA TABLES ---- */
.fin-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 550px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  scrollbar-width: thin;
}

.fin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.fin-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: #0D0D0D;
  position: sticky;
  top: 0;
  z-index: 10;
}

.fin-table td {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.fin-table tr:last-child td {
  border-bottom: none;
}

.fin-table tr {
  transition: background 0.15s ease;
}

.fin-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

/* Highlight Names */
.fin-name-cell {
  display: flex;
  flex-direction: column;
}

.fin-name-main {
  font-weight: 700;
  color: var(--black);
}

.fin-name-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.fin-value-cell {
  font-weight: 700;
  color: var(--black);
}

.fin-date-cell {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- STATUS BADGES ---- */
.fin-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fin-status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.fin-status-pago {
  background: rgba(16, 185, 129, 0.1);
  color: #10B981;
}

.fin-status-pendente {
  background: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

.fin-status-atrasado {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

/* ---- TYPE BADGES (Recorrente / Pontual) ---- */
.fin-type-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

.fin-type-recorrente {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.fin-type-pontual {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.fin-type-parcelado {
  background: rgba(99, 102, 241, 0.1);
  color: #6366F1;
}


/* Empty Table State */
.fin-empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

/* ---- PREMIUM MODAL STYLE ---- */
#fin-modal-overlay {
  position: fixed; 
  inset: 0; 
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex; 
  align-items: center; 
  justify-content: center;
  animation: finFadeIn 0.25s ease both;
  font-family: 'Inter', sans-serif;
}

#fin-modal-card {
  background: #0F0F0F;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 480px; 
  width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  animation: finSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes finFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes finSlideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.fin-modal-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  margin-bottom: 24px; 
}

.fin-modal-title { 
  font-size: 18px; 
  font-weight: 800; 
  color: #FFF; 
}

.fin-modal-close { 
  background: transparent; 
  border: none; 
  color: var(--text-secondary); 
  cursor: pointer; 
  display: flex; 
}

.fin-modal-close svg { 
  width: 20px; 
  height: 20px; 
  stroke: currentColor; 
}

.fin-form-group { 
  margin-bottom: 18px; 
}

.fin-form-label { 
  display: block; 
  font-size: 11px; 
  font-weight: 700; 
  color: var(--text-secondary); 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
  margin-bottom: 6px; 
}

.fin-form-input {
  width: 100%; 
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 14px; 
  color: #FFF;
  font-size: 13px; 
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.fin-form-input:focus { 
  border-color: var(--cyan); 
  outline: none; 
  background: rgba(255, 255, 255, 0.05); 
}

.fin-form-input option { 
  background: #0F0F0F; 
  color: #FFF; 
}

.fin-form-row { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 12px; 
}

/* ---- RESPONSIVE DESIGNS ---- */
@media (max-width: 1024px) {
  .fin-stats-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .fin-tabs-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .fin-tabs-triggers {
    width: 100%;
  }
  .fin-tab-btn {
    flex: 1;
    justify-content: center;
  }
}

/* Custom Scrollbars para o Wrapper da Tabela */
.fin-table-wrapper::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.fin-table-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.fin-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(26, 206, 238, 0.35);
  border-radius: 4px;
  transition: background 0.15s ease;
}

.fin-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 206, 238, 0.65);
}

/* Hover style for inline delete row button */
.fin-btn-delete-row {
  opacity: 0.25 !important;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}

.fin-row-clickable:hover .fin-btn-delete-row {
  opacity: 0.75 !important;
}

.fin-btn-delete-row:hover {
  opacity: 1 !important;
  color: #FF4D4D !important;
  transform: scale(1.18);
}
