/**
 * Merge Policy Configurator Styles v2.0.0 - ENHANCED
 * Phase 3C - Advanced field-level merge policy UI
 * Modern glassmorphism design with improved UX
 */

/* ==================== CONTAINER ==================== */
.merge-policy-container {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== HEADER ==================== */
.merge-policy-header {
  margin-bottom: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 32px;
  border-radius: 16px;
  color: white;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.merge-policy-header-content {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.merge-policy-icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.merge-policy-header-text {
  flex: 1;
}

.merge-policy-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: white;
}

.merge-policy-subtitle {
  font-size: 16px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

/* ==================== STATS BANNER ==================== */
.merge-policy-stats-banner {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  padding: 20px 32px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.merge-policy-stat-item {
  text-align: center;
}

.merge-policy-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: white;
  line-height: 1;
  margin-bottom: 8px;
}

.merge-policy-stat-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.merge-policy-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
}

/* ==================== INFO BANNER ==================== */
.merge-policy-info-banner {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 32px;
  color: #4338ca;
}

.merge-policy-info-banner i {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==================== POLICY FIELDS GRID ==================== */
.merge-policy-fields {
  display: grid;
  gap: 24px;
}

/* ==================== FIELD CARD ==================== */
.merge-policy-field-card {
  background: white;
  border-radius: 16px;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.merge-policy-field-card:hover {
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  border-color: #e0e7ff;
}

/* ==================== FIELD HEADER ==================== */
.policy-field-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 24px;
  border-bottom: 2px solid #e2e8f0;
}

.policy-field-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.policy-field-name {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-field-name::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.policy-field-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.policy-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.policy-stat-badge.conflict {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.policy-stat-badge.groups {
  background: #ede9fe;
  color: #6b21a8;
  border: 1px solid #c4b5fd;
}

/* ==================== SAMPLE CONFLICTS ==================== */
.policy-field-samples {
  padding: 24px;
  background: #fafbfc;
  border-bottom: 1px solid #e2e8f0;
}

/* Expand/Collapse Button */
.merge-policy-expand-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #667eea;
  transition: all 0.2s ease;
  margin-bottom: 0;
}

.merge-policy-expand-btn:hover {
  background: #f7fafc;
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.merge-policy-expand-btn:active {
  transform: translateY(1px);
}

.merge-policy-expand-btn.expanded {
  color: #4f46e5;
  background: #eef2ff;
  border-color: #c7d2fe;
  margin-bottom: 16px;
}

.merge-policy-expand-btn i {
  transition: transform 0.2s ease;
}

.samples-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.samples-content {
  display: grid;
  gap: 16px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sample-value-group {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.sample-value-group:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.sample-value-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.sample-value-list {
  display: grid;
  gap: 10px;
}

.sample-value-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.sample-value-source {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  white-space: nowrap;
}

.sample-value-text {
  font-size: 14px;
  color: #1e293b;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  word-break: break-word;
}

.sample-value-item.empty-value .sample-value-text {
  color: #94a3b8;
  font-style: italic;
}

.no-samples {
  text-align: center;
  padding: 24px;
  color: #64748b;
  font-style: italic;
}

/* ==================== POLICY SELECTOR ==================== */
.policy-selector {
  padding: 24px;
  background: white;
}

.policy-selector-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.policy-selector-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.policy-action-select,
.policy-source-select {
  padding: 12px 16px;
  font-size: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: white;
  color: #1e293b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234f46e5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.policy-action-select:hover,
.policy-source-select:hover {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.policy-action-select:focus,
.policy-source-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.policy-source-select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* ==================== POLICY EXPLANATION ==================== */
.policy-explanation {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 10px;
  font-size: 13px;
  color: #075985;
  line-height: 1.6;
}

.policy-explanation i {
  flex-shrink: 0;
  margin-top: 2px;
  color: #0284c7;
}

.policy-explanation-text strong {
  font-weight: 600;
  color: #0c4a6e;
}

/* ==================== NAVIGATION ==================== */
.wizard-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  padding: 24px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.wizard-navigation .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.wizard-navigation .btn-secondary {
  background: white;
  color: #64748b;
  border: 2px solid #e2e8f0;
}

.wizard-navigation .btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateX(-2px);
}

.wizard-navigation .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wizard-navigation .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .merge-policy-container {
    padding: 20px;
  }
  
  .merge-policy-stats-banner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .merge-policy-stat-divider {
    display: none;
  }
  
  .policy-selector-controls {
    grid-template-columns: 1fr;
  }
  
  .sample-value-item {
    grid-template-columns: 1fr;
  }
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.merge-policy-field-card {
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.merge-policy-field-card:nth-child(1) { animation-delay: 0.05s; }
.merge-policy-field-card:nth-child(2) { animation-delay: 0.1s; }
.merge-policy-field-card:nth-child(3) { animation-delay: 0.15s; }
.merge-policy-field-card:nth-child(4) { animation-delay: 0.2s; }
.merge-policy-field-card:nth-child(5) { animation-delay: 0.25s; }



/* ==================== PHASE 1: PROGRESS BAR ==================== */
.merge-policy-progress-section {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.progress-count {
  font-size: 14px;
  color: #6B7280;
  font-weight: 500;
}

.progress-bar-container {
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}


/* ==================== PHASE 1: QUICK ACTIONS ==================== */
.merge-policy-quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

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

.quick-action-btn.recommended {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.quick-action-btn.recommended:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.quick-action-btn.newest {
  background: #F0F9FF;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.quick-action-btn.newest:hover {
  background: #E0F2FE;
  border-color: #7DD3FC;
}

.quick-action-btn.clear {
  background: #F9FAFB;
  color: #6B7280;
  border: 1px solid #E5E7EB;
}

.quick-action-btn.clear:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

/* ==================== PHASE 1: POLICY GROUPS ==================== */
.merge-policy-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.policy-group {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.policy-group:hover {
  border-color: #D1D5DB;
}

.policy-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #F9FAFB;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.policy-group-header:hover {
  background: #F3F4F6;
}

.policy-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.policy-group-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.policy-group-icon i {
  width: 20px;
  height: 20px;
}

.policy-group-name {
  font-weight: 600;
  font-size: 15px;
  color: #1F2937;
}

.policy-group-count {
  font-size: 13px;
  color: #6B7280;
  background: #E5E7EB;
  padding: 4px 10px;
  border-radius: 12px;
}

.policy-group-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.policy-group-progress {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
}

.policy-group-arrow {
  width: 20px;
  height: 20px;
  color: #9CA3AF;
  transition: transform 0.3s ease;
}

.policy-group.collapsed .policy-group-arrow {
  transform: rotate(-90deg);
}

.policy-group-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid #E5E7EB;
}

.policy-group.collapsed .policy-group-content {
  display: none;
}

/* Adjust card styling within groups */
.policy-group .merge-policy-field-card {
  margin-bottom: 0;
  animation: none;
}


/* ==================== PHASE 2: PROGRESS BAR ==================== */
.merge-policy-progress-section {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #E5E7EB;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.progress-count {
  font-size: 14px;
  color: #6B7280;
  font-weight: 500;
}

.progress-bar-container {
  height: 10px;
  background: #E5E7EB;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 5px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== PHASE 2: QUICK ACTIONS ==================== */
.merge-policy-quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.quick-action-btn.recommended {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.quick-action-btn.recommended:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.quick-action-btn.newest {
  background: #F0FDF4;
  color: #166534;
  border-color: #86EFAC;
}

.quick-action-btn.newest:hover {
  background: #DCFCE7;
  border-color: #4ADE80;
}

.quick-action-btn.clear {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}

.quick-action-btn.clear:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

/* ==================== PHASE 2: DATA PREVIEW ==================== */
.policy-data-preview {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 16px;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 10px;
}

.preview-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  font-size: 13px;
}

.preview-value-row.recommended {
  background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
  border-color: #C4B5FD;
}

.preview-value-row.empty {
  opacity: 0.6;
}

.preview-source {
  font-weight: 600;
  color: #374151;
  min-width: 120px;
}

.preview-arrow {
  color: #9CA3AF;
}

.preview-text {
  color: #1F2937;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
}

.preview-text em {
  color: #9CA3AF;
  font-style: italic;
}

.preview-star {
  margin-left: auto;
  font-size: 14px;
}

/* ==================== PHASE 2: RECOMMENDATION BADGE ==================== */
.policy-recommendation {
  margin-left: auto;
}

.rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.rec-badge.high {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.rec-badge.medium {
  background: #FEF3C7;
  color: #92400E;
}

.rec-badge.low {
  background: #E5E7EB;
  color: #6B7280;
}

/* ==================== PHASE 2: COMPACT POLICY SELECTOR ==================== */
.policy-selector-compact {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  flex-wrap: wrap;
}

.policy-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-select-group label {
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
}

.policy-select-group select {
  padding: 8px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 13px;
  background: white;
  min-width: 150px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.policy-select-group select:hover {
  border-color: #9CA3AF;
}

.policy-select-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.policy-use-rec-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #D1D5DB;
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  transition: all 0.2s ease;
  margin-left: auto;
}

.policy-use-rec-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  transform: scale(1.05);
}

/* ==================== PHASE 2: FIELD CARD STATUS ==================== */
.merge-policy-field-card.configured {
  border-color: #86EFAC;
  background: linear-gradient(to right, #F0FDF4, white);
}

.merge-policy-field-card.pending {
  border-color: #FCD34D;
}

.policy-field-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
  gap: 16px;
}

.policy-field-info {
  flex: 1;
}

.policy-field-name {
  font-size: 16px;
  font-weight: 600;
  color: #1F2937;
  margin: 0 0 6px 0;
}

.policy-field-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.policy-conflict-count {
  font-size: 13px;
  color: #6B7280;
}

.policy-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}

.policy-status.configured {
  color: #16A34A;
}

.policy-status.pending {
  color: #D97706;
}

/* ==================== PHASE 2: GROUPS CONTAINER ==================== */
.merge-policy-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Batch apply button for optional fields */
.batch-apply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: #F3F4F6;
  border: 2px dashed #D1D5DB;
  border-radius: 8px;
  color: #6B7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.batch-apply-btn:hover {
  background: #E5E7EB;
  border-color: #9CA3AF;
  color: #374151;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .merge-policy-quick-actions {
    flex-direction: column;
  }
  
  .quick-action-btn {
    width: 100%;
    justify-content: center;
  }
  
  .policy-selector-compact {
    flex-direction: column;
    align-items: stretch;
  }
  
  .policy-select-group {
    flex: 1;
  }
  
  .policy-select-group select {
    flex: 1;
    min-width: unset;
  }
  
  .policy-use-rec-btn {
    margin-left: 0;
    width: 100%;
  }
}


/* ==================== PHASE 2: DATA PREVIEW ==================== */
.policy-data-preview {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  background: white;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
}

.preview-value-row.recommended {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.preview-value-row.empty {
  opacity: 0.6;
}

.preview-source {
  font-weight: 600;
  color: #374151;
  min-width: 120px;
}

.preview-arrow {
  color: #9CA3AF;
}

.preview-text {
  color: #1F2937;
  flex: 1;
  font-family: 'SF Mono', Monaco, monospace;
}

.preview-text em {
  color: #9CA3AF;
  font-style: italic;
}

.preview-star {
  font-size: 14px;
  margin-left: auto;
}


/* ==================== PHASE 2: RECOMMENDATION BADGES ==================== */
.policy-recommendation {
  margin-left: auto;
}

.rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.rec-badge.high {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  color: #047857;
  border: 1px solid #6EE7B7;
}

.rec-badge.medium {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #B45309;
  border: 1px solid #FCD34D;
}

.rec-badge.low {
  background: #F3F4F6;
  color: #6B7280;
  border: 1px solid #D1D5DB;
}


/* ==================== PHASE 2: COMPACT POLICY SELECTOR ==================== */
.policy-selector-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #FAFAFA;
  border-top: 1px solid #E5E7EB;
  margin: 0 -16px -16px -16px;
  border-radius: 0 0 10px 10px;
}

.policy-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-select-group label {
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
}

.policy-select-group select {
  padding: 8px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  min-width: 140px;
  cursor: pointer;
}

.policy-select-group select:hover {
  border-color: #9CA3AF;
}

.policy-select-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.policy-use-rec-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: auto;
}

.policy-use-rec-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}


/* ==================== PHASE 2: UPDATED FIELD CARD ==================== */
.merge-policy-field-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 16px;
  transition: all 0.2s ease;
}

.merge-policy-field-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.merge-policy-field-card.configured {
  border-left: 3px solid #22C55E;
}

.merge-policy-field-card.pending {
  border-left: 3px solid #F59E0B;
}

.policy-field-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.policy-field-name {
  font-size: 15px;
  font-weight: 600;
  color: #1F2937;
  margin: 0 0 6px 0;
}

.policy-field-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.policy-conflict-count {
  font-size: 12px;
  color: #6B7280;
}

.policy-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}

.policy-status.configured {
  color: #22C55E;
}

.policy-status.pending {
  color: #F59E0B;
}

/* ==================== PHASE 2: BATCH APPLY FOR GROUPS ==================== */
.policy-group-batch-action {
  padding: 12px 16px;
  background: #F9FAFB;
  border-top: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.policy-group-batch-action span {
  font-size: 13px;
  color: #6B7280;
}

.batch-apply-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: white;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.batch-apply-btn:hover {
  background: #F3F4F6;
  border-color: #9CA3AF;
}

.batch-apply-btn i {
  width: 14px;
  height: 14px;
}

.batch-apply-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
}

.batch-apply-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}


/* ==================== PHASE 2: DATA PREVIEW ==================== */
.policy-data-preview {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
}

.preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.preview-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  background: white;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
}

.preview-value-row.recommended {
  border-color: #A78BFA;
  background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
}

.preview-value-row.empty {
  opacity: 0.6;
}

.preview-source {
  font-weight: 600;
  color: #475569;
  min-width: 120px;
}

.preview-arrow {
  color: #94A3B8;
}

.preview-text {
  color: #1E293B;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 12px;
}

.preview-text em {
  color: #94A3B8;
  font-style: italic;
}

.preview-star {
  margin-left: auto;
  font-size: 14px;
}


/* ==================== PHASE 2: RECOMMENDATION BADGES ==================== */
.policy-recommendation {
  flex-shrink: 0;
}

.rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.rec-badge.high {
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
  color: #166534;
  border: 1px solid #86EFAC;
}

.rec-badge.medium {
  background: linear-gradient(135deg, #FEF9C3 0%, #FEF08A 100%);
  color: #854D0E;
  border: 1px solid #FDE047;
}

.rec-badge.low {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}


/* ==================== PHASE 2: COMPACT POLICY SELECTOR ==================== */
.policy-selector-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #FAFAFA;
  border-top: 1px solid #E5E7EB;
  margin-top: auto;
}

.policy-select-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.policy-select-group label {
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  white-space: nowrap;
}

.policy-select-group select {
  padding: 8px 12px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
  min-width: 140px;
}

.policy-select-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}


/* ==================== PHASE 3: TIME SAVED BANNER ==================== */
.time-saved-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 1px solid #6EE7B7;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  animation: slideInFade 0.5s ease-out;
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.time-saved-icon {
  width: 48px;
  height: 48px;
  background: #10B981;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.time-saved-content {
  flex: 1;
}

.time-saved-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.time-saved-value {
  font-size: 28px;
  font-weight: 700;
  color: #059669;
  line-height: 1;
}

.time-saved-label {
  font-size: 14px;
  color: #047857;
  font-weight: 500;
}

.time-saved-detail {
  font-size: 14px;
  color: #065F46;
  line-height: 1.5;
}

.time-saved-detail strong {
  color: #047857;
}

/* ==================== PHASE 3: IMPROVED ANIMATIONS ==================== */

/* Smooth group collapse/expand animation */
.policy-group-content {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.policy-group.collapsed .policy-group-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-top: none;
}

/* Card hover lift effect */
.merge-policy-field-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.merge-policy-field-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Configured card subtle highlight */
.merge-policy-field-card.configured {
  border-color: #86EFAC;
  background: linear-gradient(to right, #F0FDF4 0%, white 20%);
}

/* Progress bar glow effect when complete */
.progress-bar-fill {
  position: relative;
}

.progress-bar-fill[style*="100%"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Quick action button press effect */
.quick-action-btn:active {
  transform: scale(0.97);
}

/* Recommendation badge pulse for high confidence */
.rec-badge.high {
  animation: subtlePulse 2s infinite;
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(139, 92, 246, 0); }
}

/* Group header hover state improvement */
.policy-group-header {
  transition: background 0.2s ease, padding-left 0.2s ease;
}

.policy-group-header:hover {
  padding-left: 24px;
}

/* Status indicator animations */
.policy-status {
  transition: color 0.3s ease, background 0.3s ease;
}

.policy-status.configured {
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Batch action button enhancement */
.batch-apply-btn {
  transition: all 0.2s ease;
}

.batch-apply-btn:hover {
  transform: translateX(4px);
}

.batch-apply-btn:active {
  transform: translateX(2px) scale(0.98);
}

/* Progress section completion state */
.merge-policy-progress-section.complete {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border-color: #6EE7B7;
}

.merge-policy-progress-section.complete .progress-label {
  color: #059669;
}

.merge-policy-progress-section.complete .progress-count {
  color: #047857;
  font-weight: 600;
}

/* Staggered animation for field cards */
.policy-group-content .merge-policy-field-card {
  animation: cardSlideIn 0.3s ease-out backwards;
}

.policy-group-content .merge-policy-field-card:nth-child(1) { animation-delay: 0.05s; }
.policy-group-content .merge-policy-field-card:nth-child(2) { animation-delay: 0.1s; }
.policy-group-content .merge-policy-field-card:nth-child(3) { animation-delay: 0.15s; }
.policy-group-content .merge-policy-field-card:nth-child(4) { animation-delay: 0.2s; }
.policy-group-content .merge-policy-field-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Use Recommended button sparkle effect */
.quick-action-btn.recommended i {
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}


/* ==================== SEMANTIC FIELD GROUPING ==================== */
.semantic-group {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.semantic-group:hover {
  border-color: #D1D5DB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.semantic-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: #FAFAFA;
  transition: all 0.2s ease;
}

.semantic-group-header:hover {
  background: #F5F5F5;
}

.semantic-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.semantic-group-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.semantic-group-icon i {
  width: 18px;
  height: 18px;
}

.semantic-group-name {
  font-weight: 600;
  font-size: 15px;
  color: #1F2937;
}

.semantic-group-count {
  font-size: 12px;
  color: #6B7280;
  background: #F3F4F6;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.semantic-group-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.semantic-group-progress {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
  min-width: 40px;
  text-align: right;
}

.semantic-group-progress.complete {
  color: #059669;
  font-weight: 600;
}

.semantic-group-arrow {
  width: 18px;
  height: 18px;
  color: #9CA3AF;
  transition: transform 0.3s ease;
}

.semantic-group.collapsed .semantic-group-arrow {
  transform: rotate(-90deg);
}

.semantic-group-content {
  padding: 16px;
  border-top: 1px solid #E5E7EB;
  transition: all 0.3s ease;
}

.semantic-group.collapsed .semantic-group-content {
  display: none;
}

/* Batch action within semantic group */
.semantic-group-batch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border: 1px solid #BAE6FD;
  border-radius: 10px;
  margin-bottom: 12px;
}

.batch-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.batch-count {
  font-weight: 600;
  font-size: 14px;
  color: #0369A1;
}

.batch-examples {
  font-size: 12px;
  color: #6B7280;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.semantic-group-batch .batch-apply-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.semantic-group-batch .batch-apply-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.semantic-group-batch .batch-apply-btn i {
  width: 14px;
  height: 14px;
}

/* Compact field cards within semantic groups */
.semantic-group-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compact-field-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #FAFAFA;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.compact-field-card:hover {
  background: #F5F5F5;
  border-color: #D1D5DB;
}

.compact-field-card.configured {
  background: linear-gradient(to right, #F0FDF4 0%, #FAFAFA 30%);
  border-color: #86EFAC;
}

.compact-field-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compact-field-name {
  font-weight: 500;
  font-size: 13px;
  color: #374151;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-field-conflicts {
  font-size: 11px;
  color: #9CA3AF;
}

.compact-field-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-source-select {
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  background: white;
  color: #374151;
  cursor: pointer;
  min-width: 140px;
}

.compact-source-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.compact-field-status {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #D1D5DB;
}

.compact-field-status.done {
  color: #10B981;
}

/* No conflicts message */
.no-conflicts {
  text-align: center;
  padding: 40px;
  color: #6B7280;
  font-size: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .semantic-group-batch {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .semantic-group-batch .batch-apply-btn {
    justify-content: center;
  }
  
  .compact-field-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .compact-field-controls {
    width: 100%;
  }
  
  .compact-source-select {
    flex: 1;
  }
}


/* ==================== DATA QUALITY ANOMALIES ==================== */

.v3-anomalies-section {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1px solid #F59E0B;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.v3-anomalies-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #92400E;
  margin-bottom: 8px;
}

.v3-anomalies-header i {
  width: 16px;
  height: 16px;
}

.v3-anomalies-badge {
  background: #F59E0B;
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}

.v3-anomalies-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #92400E;
  opacity: 0.8;
  margin-bottom: 10px;
}

.v3-anomalies-note i {
  width: 12px;
  height: 12px;
}

.v3-anomaly-row {
  background: white;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  border-left: 3px solid #F59E0B;
}

.v3-anomaly-row.v3-anomaly-critical {
  border-left-color: #EF4444;
  background: #FEF2F2;
}

.v3-anomaly-row.v3-anomaly-warning {
  border-left-color: #F59E0B;
  background: #FFFBEB;
}

.v3-anomaly-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.v3-anomaly-icon {
  width: 14px;
  height: 14px;
}

.v3-anomaly-row.v3-anomaly-critical .v3-anomaly-icon {
  color: #EF4444;
}

.v3-anomaly-row.v3-anomaly-warning .v3-anomaly-icon {
  color: #F59E0B;
}

.v3-anomaly-field {
  font-weight: 600;
  color: #1F2937;
}

.v3-anomaly-count {
  font-size: 11px;
  color: #6B7280;
  margin-left: auto;
}

/* Download button for anomaly rows */
.v3-anomaly-download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.v3-anomaly-download:hover {
  background: #6366F1;
  border-color: #6366F1;
  color: white;
}

.v3-anomaly-download i {
  width: 14px;
  height: 14px;
}

.v3-anomaly-details {
  padding-left: 22px;
}

.v3-anomaly-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid #E5E7EB;
}

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

.v3-anomaly-value {
  background: #FEE2E2;
  color: #991B1B;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', Monaco, monospace;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-anomaly-row.v3-anomaly-warning .v3-anomaly-value {
  background: #FEF3C7;
  color: #92400E;
}

.v3-anomaly-reason {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.4;
}


/* ================================================
   RECOMMENDATION BUTTON STATES
   ================================================ */

/* Base recommendation button */
.policy-use-rec-btn {
  background: linear-gradient(135deg, #8B5CF6, #6366F1);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.policy-use-rec-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* When using recommended - show green checkmark */
.policy-use-rec-btn.using-recommended {
  background: linear-gradient(135deg, #10B981, #059669);
  cursor: default;
}

.policy-use-rec-btn.using-recommended:hover {
  transform: none;
  box-shadow: none;
}

.policy-use-rec-btn:disabled {
  opacity: 1; /* Keep visible but inactive */
}

/* AI Recommendation badge active state */
.ai-recommendation-badge.active {
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  border-color: #10B981;
}

.ai-recommendation-badge.active::before {
  content: '✓ ';
}


/* ================================
   GROUP-LEVEL CONFIGURATION
   ================================ */

/* Group header actions container */
.semantic-group-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Group source selector container */
.group-source-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Group-level dropdown */
.group-source-select {
  padding: 6px 28px 6px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  background: white;
  cursor: pointer;
  min-width: 160px;
  max-width: 220px;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.group-source-select:hover {
  border-color: #8B5CF6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.group-source-select:focus {
  outline: none;
  border-color: #8B5CF6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

/* Mixed badge when fields have different sources */
.group-mixed-badge {
  padding: 2px 8px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================================
   INHERITED & OVERRIDE STATES
   ================================ */

/* Inherited badge on field cards */
.inherited-badge {
  padding: 2px 6px;
  background: #ECFDF5;
  color: #059669;
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 8px;
}

/* Override badge on field cards */
.override-badge {
  padding: 2px 6px;
  background: #FEF3C7;
  color: #B45309;
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 8px;
}

/* Card state styling */
.compact-field-card.inherited {
  background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
  border-left: 3px solid #10B981;
}

.compact-field-card.inherited .compact-source-select {
  background: #F0FDF4;
  border-color: #A7F3D0;
}

.compact-field-card.override {
  background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
  border-left: 3px solid #F59E0B;
}

.compact-field-card.override .compact-source-select {
  background: #FFFBEB;
  border-color: #FCD34D;
}

/* Collapsed state - hide fields, keep header dropdown visible */
.semantic-group.collapsed .semantic-group-content {
  display: none;
}

/* Show group dropdown is working */
.semantic-group.collapsed .group-source-selector {
  display: flex;
}

/* Compact field card base improvements */
.compact-field-card {
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.compact-field-card:hover {
  background: #F9FAFB;
}

/* Field info layout */
.compact-field-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* Shorter dropdown text in compact view */
.compact-source-select {
  max-width: 200px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
