/* CRM Invoices Styles - Modern & Sophisticated */

:root {
  --invoice-bg: #0a0e1a;
  --invoice-card-bg: #151b2e;
  --invoice-border: rgba(212, 175, 55, 0.2);
  --gold-color: #d4af37;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
}

/* Stat Cards (reuse from pipeline) */
.stat-card {
  background: linear-gradient(135deg, var(--invoice-card-bg) 0%, rgba(21, 27, 46, 0.8) 100%);
  border: 1px solid var(--invoice-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(212, 175, 55, 0.15);
  border-color: var(--gold-color);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.stat-icon.bg-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.bg-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon.bg-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon.bg-danger {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card Styling */
.card {
  background: var(--invoice-card-bg);
  border: 1px solid var(--invoice-border);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: rgba(212, 175, 55, 0.05);
  border-bottom: 1px solid var(--invoice-border);
  padding: 1.25rem;
  color: var(--text-primary);
}

.card-header h5 {
  color: var(--gold-color);
  font-weight: 600;
  margin: 0;
}

/* Table Styling */
.table {
  color: var(--text-primary);
  margin-bottom: 0;
}

.table thead th {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-color);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1rem;
  border-bottom: 2px solid var(--invoice-border);
  border-top: none;
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.draft {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border: 1px solid #6c757d;
}

.status-badge.sent {
  background: rgba(23, 162, 184, 0.2);
  color: #17a2b8;
  border: 1px solid #17a2b8;
}

.status-badge.paid {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid #28a745;
}

.status-badge.partial {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid #ffc107;
}

.status-badge.overdue {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border: 1px solid #dc3545;
}

.status-badge.cancelled {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border: 1px solid #6c757d;
}

/* Line Items */
.line-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.line-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--gold-color);
}

.line-item-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.line-item-number {
  background: var(--gold-color);
  color: var(--invoice-bg);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.line-item-remove {
  background: transparent;
  border: none;
  color: #dc3545;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.line-item-remove:hover {
  background: rgba(220, 53, 69, 0.1);
}

/* Invoice Summary */
.invoice-summary {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--invoice-border);
  border-radius: 8px;
}

.invoice-summary .text-gold {
  color: var(--gold-color);
}

/* Modal Styling */
.modal-dark .modal-content {
  background: var(--invoice-card-bg);
  border: 1px solid var(--invoice-border);
  color: var(--text-primary);
}

.modal-dark .modal-header {
  border-bottom: 1px solid var(--invoice-border);
}

.modal-dark .modal-footer {
  border-top: 1px solid var(--invoice-border);
}

.modal-dark .form-control,
.modal-dark .form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-dark .form-control:focus,
.modal-dark .form-select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--gold-color);
  color: var(--text-primary);
  box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

.modal-dark .form-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Button Group */
.btn-group .btn {
  background: transparent;
  border-color: var(--invoice-border);
  color: var(--text-secondary);
}

.btn-group .btn.active {
  background: var(--gold-color);
  border-color: var(--gold-color);
  color: var(--invoice-bg);
}

.btn-group .btn:hover:not(.active) {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold-color);
  color: var(--gold-color);
}

/* Payment Indicator */
.payment-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.payment-progress {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.payment-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
  transition: width 0.3s ease;
}

/* Invoice Preview */
.invoice-preview {
  background: white;
  color: #000;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.invoice-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gold-color);
}

.invoice-preview-logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-color);
  font-family: 'Cinzel', serif;
}

.invoice-preview-details {
  text-align: right;
}

.invoice-preview-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 0.5rem;
}

.invoice-preview-date {
  color: #666;
  font-size: 0.875rem;
}

.invoice-preview-table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
}

.invoice-preview-table th {
  background: #f8f9fa;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}

.invoice-preview-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

.invoice-preview-total {
  text-align: right;
  margin-top: 2rem;
}

.invoice-preview-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  margin-bottom: 0.5rem;
}

.invoice-preview-total-label {
  font-weight: 600;
  min-width: 100px;
}

.invoice-preview-total-amount {
  min-width: 120px;
  text-align: right;
}

.invoice-preview-grand-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-color);
  padding-top: 1rem;
  border-top: 2px solid #dee2e6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .stat-card {
    padding: 1rem;
  }
  
  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table thead th,
  .table tbody td {
    padding: 0.75rem 0.5rem;
  }
  
  .invoice-preview {
    padding: 1rem;
  }
}

/* Print Styles */
@media print {
  .sidebar,
  .top-bar,
  .page-header,
  .card-header .btn-group,
  .admin-footer,
  .modal-footer {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .invoice-preview {
    box-shadow: none;
  }
  
  body {
    background: white;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.line-item {
  animation: fadeIn 0.3s ease;
}
