/**
 * GAP ANALYSIS V3.0 - REBUILD CSS
 * 
 * Design System: Matches report-v2.html styling (LIGHT THEME)
 * - Light background (#f8f9fa)
 * - Clean white cards
 * - Professional typography (Inter font)
 * - Modern data visualizations
 */

/* ============================================
   GAP ANALYSIS SECTION HEADER (MAIN PAGE)
   ============================================ */

#gapAnalysisSection .section-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}

#gapAnalysisSection .section-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#gapAnalysisSection .section-subtitle {
  font-size: 15px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
}

/* ============================================
   GAP ANALYSIS CONTAINER
   ============================================ */

.gap-analysis-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
  background: #f8f9fa;
  min-height: 100vh;
}

/* ============================================
   GAP ANALYSIS HEADER (TIMESTAMP & HISTORY)
   ============================================ */

.gap-analysis-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 24px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

.gap-analysis-timestamp {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.gap-analysis-timestamp svg {
  color: #94a3b8;
}

.latest-badge {
  display: inline-block;
  margin-left: 12px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-view-history {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-view-history:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
}

.btn-view-history svg {
  color: #64748b;
}

/* ============================================
   HISTORICAL REPORTS MODAL
   ============================================ */

.gap-history-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gap-history-modal-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.gap-history-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid #e2e8f0;
}

.gap-history-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.gap-history-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #64748b;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-history-modal-close:hover {
  color: #1e293b;
}

.gap-history-modal-body {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.gap-history-item {
  padding: 20px;
  margin-bottom: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.gap-history-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gap-history-item-latest {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

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

.gap-history-item-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.gap-history-item-date svg {
  color: #64748b;
}

.gap-history-badge-latest {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
}

.gap-history-item-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.gap-history-stat {
  font-size: 14px;
  color: #64748b;
}

.gap-history-stat strong {
  color: #1e293b;
  font-weight: 700;
}

@media (max-width: 768px) {
  .gap-analysis-header-meta {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .btn-view-history {
    width: 100%;
    justify-content: center;
  }

  .gap-history-modal-content {
    max-height: 90vh;
  }

  .gap-history-modal-header,
  .gap-history-modal-body {
    padding: 20px;
  }

  .gap-history-item-stats {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================
   EXECUTIVE SUMMARY CARD
   ============================================ */

.gap-summary-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.gap-summary-card h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 16px 0;
}

.key-result {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.6;
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-left: 4px solid #0066cc;
  border-radius: 8px;
}

.executive-summary-text {
  font-size: 16px;
  color: #4a5568;
  line-height: 1.8;
  margin-bottom: 24px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.stat {
  text-align: center;
  padding: 16px;
  background: #f7fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.stat-value {
  display: block;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-value.success {
  color: #10b981;
}

.stat-value.warning {
  color: #f59e0b;
}

.stat-value.danger {
  color: #ef4444;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #718096;
  font-weight: 500;
}

/* ============================================
   SECTION CARDS
   ============================================ */

.gap-section-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid #e2e8f0;
}

.gap-section-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.gap-section-card h3::before {
  font-size: 20px;
}

.gap-section-card > p {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 20px 0;
  font-style: italic;
}

/* Adequate Coverage Section - Green theme */
.gap-section-card.adequate-section {
  border-top: 3px solid #10b981;
}

.gap-section-card.adequate-section h3 {
  color: #065f46;
}

.gap-section-card.adequate-section h3::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 4px;
}

/* Red Flags Section - Red theme */
.gap-section-card.red-flags-section {
  border-top: 3px solid #dc2626;
}

.gap-section-card.red-flags-section h3 {
  color: #991b1b;
}

.gap-section-card.red-flags-section h3::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: 50%;
  margin-right: 4px;
}

/* ============================================
   COVERAGE GAP ITEMS
   ============================================ */

.gap-item {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.gap-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e0;
}

.gap-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
}

.gap-item-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
  flex: 1;
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-badge.critical {
  background: #fee2e2;
  color: #991b1b;
}

.severity-badge.high {
  background: #fef3c7;
  color: #92400e;
}

.severity-badge.medium {
  background: #dbeafe;
  color: #1e40af;
}

.severity-badge.low {
  background: #d1fae5;
  color: #065f46;
}

.gap-item-body {
  display: grid;
  gap: 16px;
}

.gap-detail-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
}

.gap-detail-label {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gap-detail-value {
  font-size: 15px;
  color: #2d3748;
  line-height: 1.6;
}

.gap-detail-value.highlight {
  font-weight: 600;
  color: #0066cc;
}

.gap-detail-value.impact {
  font-weight: 600;
  color: #dc2626;
}

.gap-scenario {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 16px;
  border-radius: 8px;
  margin-top: 12px;
}

.gap-scenario-text {
  font-size: 15px;
  color: #78350f;
  font-weight: 500;
  line-height: 1.6;
}

/* ============================================
   ADEQUATE COVERAGE ITEMS - Premium Design
   ============================================ */

.adequate-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.adequate-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-left-color: #059669;
}

.adequate-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 16px;
}

.adequate-item-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.adequate-item-title::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.adequate-item-limit {
  font-size: 13px;
  font-weight: 600;
  color: #059669;
  background: #ecfdf5;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.adequate-item-assessment {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
  margin-left: 30px;
}

/* Adequate Coverage Grid - Clean Style */
.adequate-coverage-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coverage-card-clean {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.coverage-card-clean:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-left-color: #059669;
}

.coverage-card-clean h4 {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.coverage-card-clean h4::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

.coverage-card-clean .coverage-detail {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 6px 26px;
}

.coverage-card-clean .coverage-detail strong {
  color: #475569;
  font-weight: 600;
}

.coverage-card-clean .coverage-assessment {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 0 26px;
}

/* Red Flag Clean Style */
.red-flag-item-clean {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.red-flag-item-clean:hover {
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.08);
}

.red-flag-item-clean .red-flag-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.red-flag-item-clean .red-flag-title {
  font-size: 15px;
  font-weight: 600;
  color: #b91c1c;
  line-height: 1.4;
}

.red-flag-item-clean .severity-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.red-flag-item-clean .severity-badge.severity-high {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
}

.red-flag-item-clean .severity-badge.severity-medium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}

.red-flag-item-clean .severity-badge.severity-low {
  background: #fef3c7;
  color: #92400e;
}

.red-flag-item-clean .red-flag-description {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 12px;
}

.red-flag-item-clean .red-flag-action {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: #7f1d1d;
  line-height: 1.5;
}

.red-flag-item-clean .red-flag-action strong {
  color: #dc2626;
  font-weight: 600;
}

.red-flag-item-clean .red-flag-deadline {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #dc2626;
  font-weight: 600;
}

/* ============================================
   OVER-COVERAGE ITEMS
   ============================================ */

.overcoverage-item {
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

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

.overcoverage-item-title {
  font-size: 18px;
  font-weight: 700;
  color: #92400e;
  margin: 0;
}

.overcoverage-saving {
  font-size: 16px;
  font-weight: 600;
  color: #16a34a;
}

.overcoverage-action {
  font-size: 15px;
  color: #78350f;
  line-height: 1.6;
}

/* ============================================
   RED FLAGS - Premium Urgent Design
   ============================================ */

.red-flag-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #dc2626;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.red-flag-item:hover {
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.08);
}

.red-flag-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.red-flag-title {
  font-size: 15px;
  font-weight: 600;
  color: #b91c1c;
  margin: 0;
  flex: 1;
  line-height: 1.4;
}

.red-flag-deadline {
  padding: 4px 10px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #ffffff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.25);
}

.red-flag-deadline.medium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.25);
}

.red-flag-description {
  font-size: 14px;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 16px;
}

.red-flag-action {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 14px 16px;
}

.red-flag-action-label {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.red-flag-action-text {
  font-size: 14px;
  color: #7f1d1d;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 8px;
}

.red-flag-deadline-text {
  font-size: 12px;
  color: #dc2626;
  font-weight: 600;
}

/* ============================================
   APPETITE MATCHING CARDS
   ============================================ */

.appetite-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.appetite-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0066cc;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.appetite-card:hover {
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.2);
  transform: translateY(-2px);
}

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

.appetite-insurer-name {
  font-size: 18px;
  font-weight: 700;
  color: #1e40af;
}

.appetite-fit-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.appetite-fit-badge.excellent {
  background: #d1fae5;
  color: #065f46;
}

.appetite-fit-badge.good {
  background: #dbeafe;
  color: #1e40af;
}

.appetite-fit-badge.fair {
  background: #fef3c7;
  color: #92400e;
}

.appetite-details {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #1e40af;
}

.appetite-detail {
  display: flex;
  justify-content: space-between;
}

.appetite-detail-label {
  font-weight: 600;
}

/* ============================================
   APPETITE MODAL
   ============================================ */

.appetite-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.appetite-modal.active {
  display: flex;
}

.appetite-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.appetite-modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
}

.appetite-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.appetite-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
}

.appetite-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 24px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  line-height: 1;
}

.appetite-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.appetite-modal-body {
  padding: 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.appetite-modal-body .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.7);
}

.appetite-modal-body .empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.appetite-modal-body .empty-state-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 16px;
}

.appetite-modal-section {
  margin-bottom: 24px;
}

.appetite-modal-section:last-child {
  margin-bottom: 0;
}

.appetite-modal-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a202c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.appetite-modal-grid {
  display: grid;
  gap: 12px;
}

.appetite-modal-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
}

.appetite-modal-label {
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
}

.appetite-modal-value {
  font-size: 14px;
  color: #2d3748;
}

.appetite-modal-value.highlight {
  font-weight: 600;
  color: #0066cc;
}

/* ============================================
   LOADING STATE
   ============================================ */

.gap-loading {
  text-align: center;
  padding: 80px 20px;
}

.gap-loading-spinner {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.gap-loading-text {
  font-size: 18px;
  color: #4a5568;
  margin-top: 24px;
  font-weight: 500;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.gap-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
}

.gap-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.gap-empty-text {
  font-size: 16px;
  color: #4a5568;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .gap-analysis-container {
    padding: 24px 16px;
  }

  .gap-summary-card,
  .gap-section-card {
    padding: 24px;
  }

  .gap-summary-card h2 {
    font-size: 24px;
  }

  .key-result {
    font-size: 18px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .gap-detail-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .gap-item-header,
  .adequate-item-header,
  .overcoverage-item-header,
  .red-flag-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .appetite-modal {
    margin: 20px;
    max-height: calc(100vh - 40px);
  }
}

/* ============================================
   SEVERITY STYLING
   ============================================ */

/* Severity Badges */
.severity-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-critical,
.severity-badge.critical {
  background: #7f1d1d;
  color: #ffffff;
  border: 1px solid #991b1b;
}

.severity-high,
.severity-badge.high {
  background: #ea580c;
  color: #ffffff;
  border: 1px solid #c2410c;
}

.severity-medium,
.severity-badge.medium {
  background: #f59e0b;
  color: #ffffff;
  border: 1px solid #d97706;
}

.severity-low,
.severity-badge.low {
  background: #10b981;
  color: #ffffff;
  border: 1px solid #059669;
}

/* Severity Border Colors for Cards */
.gap-item.severity-critical {
  border-left: 4px solid #7f1d1d;
}

.gap-item.severity-high {
  border-left: 4px solid #ea580c;
}

.gap-item.severity-medium {
  border-left: 4px solid #f59e0b;
}

.gap-item.severity-low {
  border-left: 4px solid #10b981;
}

.red-flag-item.severity-critical {
  border-left: 4px solid #7f1d1d;
  background: #fef2f2;
}

.red-flag-item.severity-high {
  border-left: 4px solid #ea580c;
  background: #fff7ed;
}

.red-flag-item.severity-medium {
  border-left: 4px solid #f59e0b;
  background: #fffbeb;
}

.red-flag-item.severity-low {
  border-left: 4px solid #10b981;
  background: #f0fdf4;
}

/* ============================================
   EXPERT ASSESSMENT SECTION
   ============================================ */

.expert-assessment-card {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  border: 2px solid #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.expert-assessment-card h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1e40af;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.expert-assessment-card h3::before {
  content: '';
  font-size: 28px;
}

.expert-assessment-text {
  font-size: 16px;
  color: #1e3a8a;
  line-height: 1.8;
  font-weight: 500;
}

/* ============================================
   APPETITE MODAL LINK STYLING
   ============================================ */

.view-insurers-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.view-insurers-link:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.view-insurers-link svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   GAP ANALYSIS EMPTY STATE
   ============================================ */

.gap-analysis-empty-state {
  max-width: 700px;
  margin: 80px auto;
  padding: 60px 40px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid #e2e8f0;
  text-align: center;
}

/* Prominent empty state for gap analysis section */
.gap-analysis-empty-state-prominent {
  background: #ffffff;
  border-radius: 12px;
  padding: 48px 32px;
  margin: 24px 0;
  border: 2px solid #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
  text-align: center;
}

.gap-analysis-empty-icon {
  margin: 0 auto 24px;
  width: 64px;
  height: 64px;
  color: #ef4444;
  opacity: 0.8;
}

.gap-analysis-empty-icon svg {
  width: 100%;
  height: 100%;
}

.gap-analysis-empty-title {
  font-size: 24px;
  font-weight: 700;
  color: #dc2626;
  margin: 0 0 16px 0;
}

.gap-analysis-empty-message {
  font-size: 16px;
  font-weight: 600;
  color: #dc2626;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.gap-analysis-empty-action {
  margin-top: 24px;
}

.btn-upload-documents {
  padding: 12px 24px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.btn-upload-documents:hover {
  background: #0052a3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.empty-state-icon {
  margin-bottom: 32px;
  opacity: 0.6;
}

.empty-state-icon svg {
  display: inline-block;
}

.empty-state-title {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

.empty-state-description {
  font-size: 16px;
  color: #64748b;
  line-height: 1.7;
  margin: 0 0 32px 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-benefits {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 40px 0;
  text-align: left;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: #475569;
  font-weight: 500;
}

.benefit-item svg {
  flex-shrink: 0;
}

.empty-state-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
  margin-bottom: 16px;
}

.empty-state-cta:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.empty-state-cta svg {
  width: 20px;
  height: 20px;
}

.empty-state-note {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  font-style: italic;
}

/* ============================================
   PRIORITY BADGES - ESSENTIAL/RECOMMENDED/OPTIONAL
   ============================================ */

.gap-v3-priority-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.gap-v3-priority-badge.essential {
  background: #dc2626;
  color: white;
}

.gap-v3-priority-badge.recommended {
  background: #ea580c;
  color: white;
}

.gap-v3-priority-badge.optional {
  background: #059669;
  color: white;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .gap-analysis-empty-state {
    margin: 40px 16px;
    padding: 40px 24px;
  }

  .empty-state-title {
    font-size: 24px;
  }

  .empty-state-description {
    font-size: 15px;
  }

  .empty-state-benefits {
    max-width: 100%;
  }

  .empty-state-cta {
    width: 100%;
    justify-content: center;
  }
}

