/* Finance Page */
.finance-page {
  min-height: 100vh;
  padding-bottom: 2rem;
}

.finance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.finance-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Finance KPI Grid */
.finance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.finance-kpi-card {
  background: white;
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.finance-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.finance-kpi-card.success::before {
  background: linear-gradient(180deg, #10b981, #059669);
}

.finance-kpi-card.pending::before {
  background: linear-gradient(180deg, #f59e0b, #d97706);
}

.finance-kpi-card.overdue::before {
  background: linear-gradient(180deg, #ef4444, #dc2626);
}

.finance-kpi-card.total::before {
  background: linear-gradient(180deg, #8b5cf6, #7c3aed);
}

.finance-kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(139, 92, 246, 0.15);
}

.finance-kpi-card .kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.finance-kpi-card.success .kpi-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.finance-kpi-card.pending .kpi-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.finance-kpi-card.overdue .kpi-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.finance-kpi-card.total .kpi-icon {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.finance-kpi-card .kpi-icon i {
  width: 28px;
  height: 28px;
}

.finance-kpi-card .kpi-content {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1;
}

.finance-kpi-card .kpi-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.finance-kpi-card .kpi-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.finance-kpi-card .kpi-count {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Charges Card */
.charges-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.charges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.charges-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.charges-filters {
  display: flex;
  gap: 0.5rem;
  background: rgba(139, 92, 246, 0.05);
  padding: 0.375rem;
  border-radius: 8px;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-primary);
  color: white;
}

/* Charges Table */
.charges-table-wrapper {
  overflow-x: auto;
}

.charges-table {
  width: 100%;
  border-collapse: collapse;
}

.charges-table thead tr {
  border-bottom: 2px solid rgba(139, 92, 246, 0.1);
}

.charges-table th {
  text-align: left;
  padding: 0.875rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.charges-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.05);
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.charges-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.03);
}

.customer-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.customer-info strong {
  color: var(--text-primary);
}

.customer-info small {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.amount {
  font-weight: 600;
  color: var(--text-primary);
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.status-badge.paid {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-badge.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.empty-charges {
  text-align: center;
  padding: 4rem 1rem !important;
}

.empty-charges i {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  opacity: 0.5;
}

.empty-charges p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Charge Details */
.charge-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.05);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 600;
}

.payment-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.payment-link:hover {
  text-decoration: underline;
}

/* Actions Cell */
.actions-cell {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-primary);
}

.action-btn i {
  width: 16px;
  height: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
  .charges-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .charges-filters {
    width: 100%;
  }

  .filter-btn {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .finance-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .finance-kpi-grid {
    grid-template-columns: 1fr;
  }

  .charges-table {
    font-size: 0.8125rem;
  }

  .charges-table th,
  .charges-table td {
    padding: 0.625rem 0.5rem;
  }
}

/* Setup Message */
.setup-message {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.1);
}

.setup-message i {
  width: 64px;
  height: 64px;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
}

.setup-message h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.setup-message p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.setup-message code {
  background: rgba(139, 92, 246, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--accent-primary);
  font-weight: 600;
}

.setup-message button {
  margin-top: 1.5rem;
}
