/* Modern Invoice Styles */
.cbh-invoice-container {
  max-width: 900px;
  margin: 20px auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

/* Invoice Header */
.cbh-invoice-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.cbh-company-name {
  font-size: 2.5rem;
  margin: 0 0 10px 0;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.cbh-company-details {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.cbh-invoice-title {
  font-size: 2rem;
  margin: 0 0 20px 0;
  text-align: right;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

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

.cbh-invoice-number,
.cbh-invoice-date {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.cbh-invoice-status {
  margin-top: 15px;
}

.cbh-status {
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.cbh-status-confirmed {
  background: #10b981;
  color: white;
}

/* Content */
.cbh-invoice-content {
  padding: 40px;
}

.cbh-section-title {
  font-size: 1.5rem;
  color: #1a202c;
  margin-bottom: 20px;
  font-weight: 600;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

/* Info Grid */
.cbh-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.cbh-info-box {
  background: #f8fafc;
  padding: 25px;
  border-radius: 12px;
  border-left: 5px solid #667eea;
}

.cbh-info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

.cbh-info-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cbh-label {
  font-weight: 600;
  color: #4a5568;
  min-width: 100px;
}

.cbh-value {
  color: #1a202c;
  font-weight: 500;
}

/* Vehicle Box */
.cbh-vehicle-box {
  display: flex;
  gap: 20px;
  align-items: center;
}

.cbh-vehicle-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cbh-vehicle-name {
  font-size: 1.3rem;
  color: #1a202c;
  margin-bottom: 10px;
  font-weight: 600;
}

/* Location Cards */
.cbh-rental-details {
  margin-bottom: 40px;
}

.cbh-location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.cbh-location-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.cbh-location-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.cbh-location-header {
  padding: 15px 20px;
  font-weight: 600;
}

.cbh-pickup .cbh-location-header {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.cbh-return .cbh-location-header {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.cbh-location-content {
  padding: 20px;
}

.cbh-location-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 8px;
}

.cbh-location-address {
  color: #6b7280;
  margin-bottom: 15px;
}

.cbh-location-datetime {
  background: #f3f4f6;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.cbh-time {
  font-size: 1.1rem;
  color: #667eea;
  font-weight: 600;
}

/* Additional Drivers */
.cbh-additional-info {
  margin-bottom: 40px;
}

.cbh-drivers-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.cbh-driver-card {
  background: #f8fafc;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

/* Invoice Table */
.cbh-invoice-summary {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
}

.cbh-services-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.cbh-services-table th {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 15px 12px;
  text-align: left;
  font-weight: 600;
}

.cbh-services-table td {
  padding: 15px 12px;
  border-bottom: 1px solid #e2e8f0;
}

.cbh-service-row:hover {
  background: #f8fafc;
}

.cbh-service-row:last-child td {
  border-bottom: none;
}

/* Payment Summary */
.cbh-payment-summary {
  background: #f8fafc;
  padding: 25px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.cbh-payment-calculations {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.cbh-payment-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.cbh-payment-row.cbh-total {
  border-top: 3px solid #667eea;
  border-bottom: none;
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a202c;
  margin-top: 15px;
  padding-top: 15px;
}

.cbh-payment-row.cbh-discount {
  color: #10b981;
  font-weight: 600;
}

.cbh-payment-status-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cbh-payment-method,
.cbh-payment-status-display {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cbh-status-pending {
  color: #f59e0b;
  font-weight: 600;
}

.cbh-status-completed {
  color: #10b981;
  font-weight: 600;
}

/* Action Buttons */
.cbh-invoice-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 30px 0;
  flex-wrap: wrap;
}

.cbh-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 30px;
  border: none;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 140px;
}

.cbh-btn-print {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.cbh-btn-download {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.cbh-btn-new {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.cbh-action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.cbh-action-btn i {
  font-size: 1.5rem;
}

/* Footer */
.cbh-invoice-footer {
  background: #f8fafc;
  padding: 30px 40px;
  border-top: 3px solid #667eea;
}

.cbh-footer-info h4 {
  color: #1a202c;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.cbh-info-grid-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.cbh-info-item {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #667eea;
  font-size: 0.9rem;
}

.cbh-contact-footer {
  background: #1a202c;
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }

  .cbh-invoice-container,
  .cbh-invoice-container * {
    visibility: visible;
  }

  .cbh-invoice-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .cbh-invoice-actions {
    display: none !important;
  }

  .cbh-invoice-header {
    background: #667eea !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cbh-location-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cbh-services-table th {
    background: #667eea !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cbh-invoice-content {
    page-break-inside: avoid;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .cbh-invoice-container {
    margin: 10px;
    border-radius: 8px;
  }

  .cbh-invoice-header {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 25px;
    text-align: center;
  }

  .cbh-invoice-title {
    text-align: center;
  }

  .cbh-invoice-details {
    text-align: center;
  }

  .cbh-invoice-content {
    padding: 25px;
  }

  .cbh-info-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cbh-location-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cbh-payment-summary {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cbh-vehicle-box {
    flex-direction: column;
    text-align: center;
  }

  .cbh-invoice-actions {
    flex-direction: column;
    align-items: center;
  }

  .cbh-action-btn {
    width: 200px;
  }
}
