/* Custom Fields Section */
.cf-section {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto 1.5rem auto;
}

.cf-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cf-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cf-section-title i {
  color: #2845ae;
}

.cf-section-subtitle {
  color: #6c757d;
  font-size: 0.875rem;
  margin: 0;
}

.cf-section-actions {
  flex-shrink: 0;
}

/* Custom Fields List */
.cf-list {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Custom Field Row */
.cf-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.15s ease-in-out;
}

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

.cf-row:hover {
  background-color: #f8f9fa;
}

.cf-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e8edf5 0%, #dce3f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cf-row-icon i {
  color: #2845ae;
  font-size: 0.875rem;
}

.cf-row-content {
  flex: 0 0 auto;
  min-width: 140px;
  max-width: 200px;
}

.cf-row-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: #212529;
  line-height: 1.3;
}

.cf-row-type {
  display: block;
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
}

.cf-row-value {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  color: #495057;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cf-row-value span {
  word-break: break-word;
}

.cf-link {
  color: #007bff;
  text-decoration: none;
  word-break: break-all;
}

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

.cf-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.cf-badge-yes {
  background: #d4edda;
  color: #155724;
}

.cf-badge-no {
  background: #f8d7da;
  color: #721c24;
}

.cf-masked-value {
  font-family: monospace;
  letter-spacing: 2px;
  color: #6c757d;
}

.cf-copy-btn {
  background: transparent;
  border: 1px solid #e9ecef;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.cf-copy-btn:hover {
  background: #f8f9fa;
  color: #007bff;
  border-color: #007bff;
}

.cf-empty-value {
  color: #adb5bd;
  font-style: italic;
  font-size: 0.85rem;
}

.cf-row-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.cf-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: white;
  color: #6c757d;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}

.cf-action-btn:hover {
  background: #f8f9fa;
  border-color: #007bff;
  color: #007bff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.cf-action-btn-save {
  border-color: #28a745;
  color: #28a745;
}

.cf-action-btn-save:hover {
  background: #28a745;
  border-color: #28a745;
  color: white;
}

.cf-action-btn-danger:hover {
  border-color: #dc3545;
  color: #dc3545;
}

/* Inline Empty State */
.cf-empty-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  color: #6c757d;
  font-size: 0.9rem;
}

.cf-empty-inline i {
  color: #dee2e6;
  font-size: 1.25rem;
}

/* Inline Form (used for both new and edit within the card) */
.cf-inline-form {
  padding: 0.75rem 1.25rem;
  background: #f8f9fb;
  border-bottom: 1px solid #e9ecef;
}

.cf-inline-errors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cf-inline-error {
  display: inline-block;
  font-size: 0.8rem;
  color: #c53030;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

.cf-inline-fields {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cf-inline-field {
  flex-shrink: 0;
}

.cf-inline-field-name {
  flex: 1 1 160px;
  min-width: 120px;
}

.cf-inline-field-type {
  flex: 0 0 140px;
}

.cf-inline-field-value {
  flex: 1 1 180px;
  min-width: 120px;
}

.cf-inline-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
  align-self: center;
}

/* Compact form inputs */
.cf-form-input-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.cf-amount-wrapper-sm {
  display: flex;
  align-items: center;
}

.cf-amount-prefix-sm {
  padding: 0.375rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 6px 0 0 6px;
}

/* General form input styles (shared) */
.cf-form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  color: #212529;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.cf-form-input:focus {
  outline: none;
  border-color: #2845ae;
  box-shadow: 0 0 0 3px rgba(40, 69, 174, 0.1);
}

.cf-form-input::placeholder {
  color: #adb5bd;
}

/* Dollar Amount Input */
.cf-amount-wrapper {
  display: flex;
  align-items: center;
}

.cf-amount-prefix {
  padding: 0.5rem 0.75rem;
  background: #e9ecef;
  border: 1px solid #e3e8f0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
}

.cf-amount-input {
  border-radius: 0 8px 8px 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
  .cf-inline-fields {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .cf-inline-field-type {
    flex: 1 1 auto;
  }

  .cf-inline-actions {
    align-self: flex-end;
  }

  .cf-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .cf-row-content {
    min-width: 100px;
    max-width: none;
    flex: 1;
  }

  .cf-row-value {
    flex-basis: 100%;
    order: 5;
    padding-left: calc(36px + 1rem);
  }
}

/* Confirm Delete Dialog */
.cf-confirm-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  max-width: 380px;
  width: 90%;
}

.cf-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.cf-confirm-body {
  padding: 1.75rem;
  text-align: center;
}

.cf-confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff5f5;
  border: 1px solid #fed7d7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  color: #dc3545;
  font-size: 1.1rem;
}

.cf-confirm-message {
  font-size: 0.95rem;
  color: #212529;
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
  font-weight: 500;
}

.cf-confirm-skip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: #6c757d;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.cf-confirm-skip-input {
  width: 16px;
  height: 16px;
  accent-color: #2845ae;
  cursor: pointer;
}

.cf-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.cf-confirm-actions .btn {
  min-width: 90px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cf-confirm-actions .btn-danger {
  background: #dc3545;
  border: 1px solid #dc3545;
  color: white;
}

.cf-confirm-actions .btn-danger:hover {
  background: #c82333;
  border-color: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.cf-confirm-actions .btn-outline-secondary {
  background: white;
  border: 1px solid #ced4da;
  color: #495057;
}

.cf-confirm-actions .btn-outline-secondary:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}
