/* ==================== PREMIUM B2B SAAS DESIGN SYSTEM - CACHE BUST v2 ==================== */

/* CSS Custom Properties - Design System */
:root {
  /* Color Palette - Enhanced Premium Tones */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;

  /* Enhanced Gray Palette - More Sophisticated */
  --gray-50: #fafbfc;
  --gray-100: #f4f6f8;
  --gray-200: #e8ecf0;
  --gray-300: #d1d9e0;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Priority Colors - Enhanced Premium Tones */
  --priority-high: #dc2626;
  --priority-high-light: #fef2f2;
  --priority-medium: #d97706;
  --priority-medium-light: #fffbeb;
  --priority-low: #059669;
  --priority-low-light: #f0fdf4;
  --priority-approved: #7c3aed;
  --priority-approved-light: #faf5ff;
  
  /* Status Colors */
  --status-active: #3b82f6;
  --status-completed: #10b981;
  --status-accepted: #8b5cf6;

  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);

  /* Spacing - 8px Grid System - Improved for better readability */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  
  /* Typography - Reduced for enterprise density */
  --font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.65rem;    /* 10px - reduced from 12px */
  --font-size-sm: 0.75rem;    /* 12px - reduced from 14px */
  --font-size-base: 0.85rem;  /* 14px - reduced from 16px */
  --font-size-lg: 0.95rem;    /* 15px - reduced from 18px */
  --font-size-xl: 1.05rem;    /* 17px - reduced from 20px */
  --font-size-2xl: 1.25rem;   /* 20px - reduced from 24px */
  --font-size-3xl: 1.5rem;    /* 24px - reduced from 30px */
  --font-size-4xl: 1.8rem;    /* 29px - reduced from 36px */
  --font-size-5xl: 2.4rem;    /* 38px - reduced from 48px */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Border Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */

  /* Enhanced Premium Shadows - Multi-layered */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
  --shadow-premium: 0 32px 64px -12px rgba(0, 0, 0, 0.25), 0 16px 32px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
  
  /* Enhanced Transitions - Premium Feel */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Z-Index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ==================== DARK THEME MAPPING ==================== */

:root {
  /* Map existing tokens to use dark values when theme is active */
  --page-bg: var(--bg);
  --card-bg: var(--surface-1);
  --card-bg-alt: var(--surface-2);
  --card-border: var(--border-subtle);
  --heading-color: var(--text-primary);
  --body-color: var(--text-secondary);

  /* Replace primary palette references used for buttons/links with brand */
  --primary-500: var(--brand-500);
  --primary-600: var(--brand-600);
}

/* ==================== RESET & BASE STYLES ==================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--body-color);
  background: var(--page-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==================== PREMIUM HEADER ==================== */

.premium-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 60px; /* Reduced header height for more compact layout */
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.header-title {
  font-size: 25.6px;
  font-weight: var(--font-weight-bold);
  color: #E4B468;
  letter-spacing: -0.025em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

/* ==================== HEADER TAB NAVIGATION ==================== */

.header-tab-navigation {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.header-tab-btn {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-height: 40px;
  position: relative;
  border-radius: 6px;
}

.header-tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.header-tab-btn.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.header-tab-btn.active::after {
  transform: translateX(-50%) scaleX(1);
}

.header-tab-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.8);
}

/* ==================== PREMIUM BUTTONS ==================== */

.premium-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  min-height: 32px;
  position: relative;
  overflow: hidden;
}

.premium-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition-slow);
}

.premium-btn:hover::before {
  left: 100%;
}

.premium-btn.primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  box-shadow: var(--shadow-md);
}

.premium-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.premium-btn.secondary {
  background: var(--card-bg);
  color: var(--body-color);
  border: 1px solid var(--gray-200);
  backdrop-filter: blur(10px);
}

.premium-btn.secondary:hover {
  background: var(--card-bg-alt);
  border-color: var(--card-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.premium-btn.small {
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  min-height: 28px;
}

.premium-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.premium-btn:disabled:hover {
  transform: none !important;
  box-shadow: var(--shadow-md);
}

/* ==================== PREMIUM DROPZONE ==================== */

.premium-dropzone {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.6);
  border: 2px dashed var(--primary-300);
  border-radius: var(--radius-md);
  color: var(--primary-600);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-normal);
  min-height: 44px;
  backdrop-filter: blur(10px);
}

.premium-dropzone:hover {
  background: var(--card-bg);
  border-color: var(--primary-400);
  transform: translateY(-1px);
}

.premium-dropzone.drag-over {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-700);
}


/* ==================== MAIN CONTENT ==================== */

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ==================== HERO METRICS ==================== */

.hero-metrics {
  margin-bottom: var(--space-12);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.metric-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2); /* Reduced by 35% from var(--space-4) */
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}

.metric-card.primary::before {
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}

.metric-card.active::before {
  background: linear-gradient(90deg, var(--status-active), #2563eb);
}

.metric-card.completed::before {
  background: linear-gradient(90deg, var(--status-completed), #059669);
}

.metric-card.reviewed::before {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.metric-card.accepted::before {
  background: linear-gradient(90deg, var(--status-accepted), #7c3aed);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.metric-card {
  display: flex !important;
  align-items: center;
  gap: 0.5rem; /* Further reduced gap for more compact layout */
  padding: 12px 16px; /* Enhanced padding for premium appearance */
  margin: 2px !important; /* Reduced margin for tighter spacing */
  border-radius: 8px; /* Cleaner border radius */
  background: var(--card-bg); /* Premium gradient */
  border: 1px solid rgba(0, 0, 0, 0.04); /* Subtle border */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* Premium shadow */
  transition: all 0.2s ease; /* Smooth transitions */
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
}

.metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12); /* Enhanced hover shadow */
  border-color: rgba(59, 130, 246, 0.3);
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px; /* Further reduced size for more compact cards */
  height: 20px; /* Further reduced size for more compact cards */
  border-radius: var(--radius-lg);
  background: rgba(214, 179, 109, 0.15);
  color: var(--primary-600);
  flex-shrink: 0;
}

.metric-card.active .metric-icon {
  background: rgba(214, 179, 109, 0.15);
  color: var(--status-active);
}

.metric-card.completed .metric-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--status-completed);
}

.metric-card.reviewed .metric-icon {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.metric-card.accepted .metric-icon {
  background: rgba(139, 92, 246, 0.1);
  color: var(--status-accepted);
}

.metric-content {
  flex: 1;
}

.metric-value {
  font-size: 20px; /* Increased from 18px for better prominence */
  font-weight: 700; /* Bold weight */
  color: var(--heading-color);
  line-height: 1; /* Tight line height */
  letter-spacing: -0.01em; /* Refined letter spacing */
  margin-bottom: 2px; /* Better spacing */
  cursor: pointer; /* Interactive numbers */
  transition: color 0.15s ease; /* Smooth color transition */
}

.metric-value:hover {
  color: #2563eb; /* Hover color */
  text-decoration: underline; /* Hover underline */
}

.metric-label {
  font-size: 11px; /* Refined label size */
  color: var(--body-color); /* Consistent color */
  font-weight: 500; /* Medium weight */
  margin-bottom: 4px; /* Better spacing */
}

/* ==================== NEW LAYOUT STRUCTURE ==================== */

/* Row 1: Project Confidence | Report Description */
.top-row {
  margin-bottom: var(--space-8);
}

.top-row-grid {
  display: grid;
  grid-template-columns: 1fr 3fr; /* Project Confidence 1/4, Report Description 3/4 */
  gap: var(--space-8);
}

/* Row 2: Priority Distribution | Total Clashes | Active | Completed */
.middle-row {
  margin-bottom: var(--space-8);
}

.middle-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr; /* Four equal columns */
  gap: var(--space-6);
}

/* Row 3: High | Medium | Low | System Approved */
.priority-row {
  margin-bottom: var(--space-8);
}

.priority-row-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Four equal columns */
  gap: var(--space-6);
}

/* ==================== GROUPED LAYOUT ==================== */

.main-layout {
  margin-bottom: var(--space-8);
  padding-top: var(--space-3); /* Reduced padding below tabs */
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* Reduced gap between all group cards */
}

.grouped-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.grouped-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.grouped-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}


.grouped-card-content {
  display: grid;
  grid-template-columns: 1fr 2fr; /* Left column 1/3, Right column 2/3 */
  gap: var(--space-4); /* Further reduced gap for more compact layout */
  align-items: start; /* Align items to start for consistent positioning */
  padding: var(--space-3); /* Further reduced padding for more compact layout */
}

/* Individual cards within grouped structure */
.confidence-card,
.report-description-card,
.chart-card,
.numbers-cards-container {
  background: transparent; /* Remove individual card backgrounds */
  border: none; /* Remove individual card borders */
  box-shadow: none; /* Remove individual card shadows */
  padding: 0; /* Remove individual card padding */
  margin: 0; /* Remove individual card margins */
  min-height: 160px; /* Further reduced height for more compact layout */
  display: flex;
  flex-direction: column;
}

.confidence-card {
  justify-content: center; /* Center content vertically in the card */
  min-height: 200px; /* Reduced height for more compact layout */
}

.chart-card,
.numbers-cards-container {
  min-height: 200px; /* Further reduced height for more compact layout */
}

/* Numbers cards container - now transparent within grouped structure */

.metric-cards-row {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important; /* Four equal columns to match priority cards */
  gap: 6px !important; /* Match gap of priority cards for consistent spacing */
}

.priority-cards-row {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important; /* Four equal columns for priority cards */
  gap: 6px !important; /* Reduced gap for tighter spacing */
}

/* Full Width Hotspots Map */
.hotspots-section {
  margin-top: var(--space-4); /* Reduced gap from main-layout */
  margin-bottom: var(--space-8);
  width: 100%;
  clear: both; /* Ensure proper clearing */
}

/* Responsive design */
@media (max-width: 1200px) {
  .grouped-card-content {
    grid-template-columns: 1fr; /* Single column on smaller screens */
    gap: var(--space-4); /* Further reduce gap on smaller screens */
    padding: var(--space-3); /* Further reduce padding on smaller screens */
  }
  
  .priority-cards-row {
    grid-template-columns: repeat(2, 1fr); /* 2x2 grid on medium screens */
    gap: var(--space-4); /* Maintain good spacing on smaller screens */
  }
  
  .confidence-card {
    min-height: 230px; /* Match Priority Distribution chart on smaller screens */
  }
  
  .report-description-card {
    min-height: 180px; /* Further reduce minimum height on smaller screens */
  }
  
  .chart-card,
  .numbers-cards-container {
    min-height: 220px; /* Further reduce minimum height on smaller screens */
  }
}

@media (max-width: 768px) {
  .metric-cards-row {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: var(--space-4); /* Maintain good spacing on mobile */
  }
  
  .priority-cards-row {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: var(--space-4); /* Maintain good spacing on mobile */
  }
  
  .grouped-card-content {
    gap: var(--space-3); /* Further reduce gap on mobile */
    padding: var(--space-3); /* Further reduce padding on mobile */
  }
  
  .confidence-card,
  .report-description-card {
    min-height: 160px; /* Further reduce minimum height on mobile */
  }
  
  .chart-card,
  .numbers-cards-container {
    min-height: 200px; /* Further reduce minimum height on mobile */
  }
}

/* Chart and confidence cards now transparent within grouped structure */

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3); /* Further reduced margin for more compact layout */
  padding: var(--space-3) var(--space-4); /* Further reduced padding for card titles */
}

.card-header h3 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
}

.chart-container {
  width: 173px; /* Reduced by 20% from 216px */
  height: 173px; /* Reduced by 20% from 216px */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto; /* Center the chart */
}

.apex-chart {
  width: 100%;
  height: 100%;
}

/* ==================== CONFIDENCE CARD ==================== */

.confidence-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1; /* Take available space */
  flex-direction: column; /* Stack chart and details vertically */
  gap: var(--space-4);
  height: 100%; /* Ensure full height usage */
  text-align: center; /* Center all content */
}

.confidence-ring {
  width: 240px; /* Reduced speedometer size by 20% */
  height: 160px; /* Reduced height by 20% */
  position: relative;
  flex-shrink: 0;
  margin: 0 auto; /* Center the ring horizontally */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ==================== SVG SPEEDOMETER STYLES ==================== */

.speedometer-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
  width: 100%;
}

.speedometer-text {
  text-align: center;
  margin-top: 5px;
}

.confidence-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1px;
}

.confidence-status {
  font-size: 12px;
  font-weight: 600;
  margin: 1px 0;
}

.confidence-subtitle {
  font-size: 10px;
  color: #6b7280;
}

/* ==================== SPEEDOMETER CONTAINER ==================== */

.speedometer-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

/* Responsive adjustments for SVG speedometer */
@media (max-width: 768px) {
  .confidence-ring {
    width: 140px;
    height: 80px;
  }
  
  .speedometer-wrapper svg {
    width: 120px;
    height: 70px;
  }
  
  .confidence-value {
    font-size: 18px;
  }
  
  .confidence-status {
    font-size: 10px;
  }
  
  .confidence-subtitle {
    font-size: 8px;
  }
}

.confidence-details {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-4);
}

.confidence-value {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.confidence-status {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.confidence-status.critical {
  color: var(--priority-high);
}

.confidence-status.low {
  color: var(--priority-medium);
}

.confidence-status.moderate {
  color: var(--priority-medium);
}

.confidence-status.good {
  color: var(--priority-low);
}

.confidence-message {
  font-size: var(--font-size-sm);
  color: var(--body-color);
}

/* ==================== PRIORITY BREAKDOWN ==================== */

.priority-breakdown {
  margin-bottom: var(--space-12);
}

/* Report Description Section */
.report-description-section {
  margin-bottom: var(--space-12);
}

/* Report description card now transparent within grouped structure */

.report-description-card .card-header {
  padding: 0 var(--space-1); /* Align with other card headers */
}

.report-description-content {
  padding: 0 var(--space-3) var(--space-3) var(--space-3); /* Further reduced padding for more compact layout */
  color: var(--text-secondary);
  line-height: 1.1; /* Further reduced line height for more compact layout */
}

.report-description-content p {
  margin: 0 0 0.25rem 0; /* Further reduced spacing for more compact layout */
}

.report-description-content p:last-child {
  margin-bottom: 0;
}

/* Chip badges for highlighted numbers */
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9em;
  margin: 0 4px;
  color: white;
}

.chip.high {
  background-color: #E74C3C; /* Red */
}

.chip.medium,
.chip.med {
  background-color: #F1C40F; /* Yellow */
}

.chip.low {
  background-color: #2ECC71; /* Green */
}

.chip.confidence {
  background-color: #3498DB; /* Blue */
}

.chip.total {
  background-color: #95A5A6; /* Gray */
}

/* Tests list styling for better spacing */
.tests-list {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

.tests-list li {
  margin-bottom: var(--space-3);
  line-height: 1.6;
}

.tests-list .chip {
  margin: 0 2px;
}

/* Enhanced Typography - Premium Hierarchy */
.metric-value {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--heading-color);
}

.card-header h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--heading-color);
}

.metric-label {
  font-weight: 500;
  color: var(--body-color);
}

.report-description-content strong {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Enhanced bullet point styling */
.report-description-content ul {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

.report-description-content li {
  margin-bottom: var(--space-2);
  position: relative;
  color: var(--text-secondary);
}

.report-description-content li::marker {
  color: var(--primary-500);
  font-weight: 600;
}

/* Better visual hierarchy for key metrics */
.report-description-content p:first-child {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2); /* Further reduced margin for more compact layout */
}

/* .breakdown-grid removed - now using .priority-row-grid */

.priority-card {
  background: var(--card-bg); /* Premium gradient */
  border: 1px solid rgba(0, 0, 0, 0.04); /* Subtle border */
  border-radius: 8px; /* Cleaner border radius */
  padding: 6px 8px; /* Slightly more compact */
  margin: 2px !important; /* Reduced margin for tighter spacing */
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* Premium shadow */
  transition: all 0.2s ease; /* Smooth transitions */
  text-align: center;
  min-height: 50px; /* Better height for content */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center content vertically */
}

.priority-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.priority-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12); /* Enhanced hover shadow */
  border-color: rgba(59, 130, 246, 0.2);
}

.priority-card.high {
  border-left: 3px solid #dc2626; /* Refined border width */
}

.priority-card.medium {
  border-left: 3px solid #d97706; /* Refined border width */
}

.priority-card.low {
  border-left: 3px solid #059669; /* Refined border width */
}

.priority-card.accepted {
  border-left: 3px solid #6b7280; /* System approved color */
}

.priority-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; /* Further reduced spacing for more compact layout */
  margin-bottom: 0.5rem; /* Further reduced spacing for more compact layout */
}

.priority-icon {
  color: var(--body-color);
}

.priority-card.high .priority-icon {
  color: var(--priority-high);
}

.priority-card.medium .priority-icon {
  color: var(--priority-medium);
}

.priority-card.low .priority-icon {
  color: var(--priority-low);
}

.priority-label {
  font-size: 11px; /* Refined label size */
  font-weight: 500; /* Medium weight */
  color: var(--body-color); /* Consistent color */
  margin-bottom: 4px; /* Better spacing */
}

.priority-value {
  font-size: 20px; /* Increased from 18px for better prominence */
  font-weight: 700; /* Bold weight */
  color: var(--heading-color);
  line-height: 1; /* Tight line height */
  letter-spacing: -0.01em; /* Refined letter spacing */
  margin-bottom: 2px; /* Better spacing */
  cursor: pointer; /* Interactive numbers */
  transition: color 0.15s ease; /* Smooth color transition */
}

.priority-value:hover {
  color: #2563eb; /* Hover color */
  text-decoration: underline; /* Hover underline */
}

.priority-percent {
  font-size: 10px; /* Refined percentage size */
  color: var(--body-color); /* Consistent color */
  font-weight: 500; /* Medium weight */
  letter-spacing: 0.02em; /* Refined letter spacing */
  text-transform: uppercase; /* Uppercase for premium look */
  margin-top: 0; /* Remove top margin */
}

/* ==================== HOTSPOTS SECTION ==================== */

.hotspots-section {
  margin-bottom: var(--space-12);
}

.hotspots-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.hotspots-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.hotspots-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.hotspots-content {
  height: 280px; /* Further reduced height for more compact layout */
}

/* ==================== PROJECT MANAGEMENT ==================== */

.project-management-section {
  max-width: 100%;
}

.project-management-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: calc(var(--space-8) * 0.3); /* Reduced by 70% */
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.project-management-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  margin: 0;
}

.project-management-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

/* Email Report Button States */
.project-management-actions .email-btn {
  background: var(--gray-300);
  color: var(--gray-500);
  border: 1px solid var(--gray-300);
  box-shadow: none;
  cursor: not-allowed;
}

.project-management-actions .email-btn:not(:disabled) {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.project-management-actions .email-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #D97706, #B45309);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Download Excel Button States */
.project-management-actions #download:not(:disabled) {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

.project-management-actions #download:not(:disabled):hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ==================== DETAILED REPORT ==================== */

.detailed-report-section {
  max-width: 100%;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.report-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
}

.report-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}


.clash-groups-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* ==================== CLASH GROUPS ==================== */

.clash-group {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.clash-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.clash-group:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.clash-group-header {
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg-alt);
}

.clash-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.clash-group-title h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
  margin: 0;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 24px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
}

.priority-badge.high {
  background: #ef4444; /* Red */
}

.priority-badge.medium {
  background: #f59e0b; /* Amber/Yellow */
}

.priority-badge.low {
  background: #10b981; /* Green */
}

.clash-group-summary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--body-color);
  font-weight: var(--font-weight-medium);
}

.clash-group-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.clash-group-content {
  padding: var(--space-3);
  display: block; /* Always expanded */
}

.clash-group-table-container {
  display: block;
}

.clash-group-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.clash-group-table th,
.clash-group-table td {
  padding: var(--space-1) var(--space-2);
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.clash-group-table th {
  background: var(--card-bg-alt);
  font-weight: var(--font-weight-semibold);
  color: var(--body-color);
  font-size: var(--font-size-sm);
}

.clash-group-table tr:nth-child(even) {
  background: var(--card-bg-alt);
}

.clash-group-table tr:hover {
  background: rgba(214, 179, 109, 0.1);
}


.export-group-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  background: var(--card-bg-alt);
  color: var(--brand-500);
  border: 1px solid var(--card-border);
}

.export-group-btn:hover {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-500);
  transform: translateY(-1px);
}

/* Clickable Numbers */
.clickable-number {
  color: var(--primary-600);
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.clickable-number:hover {
  color: var(--primary-700);
  text-decoration: underline;
  transform: translateY(-1px);
}

.clickable-number::after {
  content: '📥';
  font-size: 0.8em;
  opacity: 0;
  transition: var(--transition-normal);
}

.clickable-number:hover::after {
  opacity: 1;
}

.clickable-number[title] {
  cursor: help;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
}

.modal-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  color: var(--gray-500);
  transition: var(--transition-normal);
  pointer-events: auto; /* Ensure clickable */
  z-index: 1001; /* Above modal content */
  position: relative; /* Ensure proper stacking context */
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red-600);
}

.modal-body {
  padding: var(--space-6);
  max-height: 60vh;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.search-container {
  flex: 1;
  min-width: 200px;
}

.search-input {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  color: var(--body-color);
  font-size: var(--font-size-sm);
  transition: var(--transition-normal);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.export-actions {
  display: flex;
  gap: var(--space-3);
}

.element-ids-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
  max-height: 400px;
  overflow-y: auto;
}

.element-id-item {
  padding: var(--space-2) var(--space-3);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: var(--font-size-sm);
  color: var(--body-color);
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.element-id-item:hover {
  background: rgba(214, 179, 109, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.element-id-item.copied {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--green-700);
}

.copy-indicator {
  font-size: var(--font-size-xs);
  color: var(--green-600);
  opacity: 0;
  transition: var(--transition-normal);
}

.element-id-item.copied .copy-indicator {
  opacity: 1;
}

/* ==================== ANALYSES SECTION ==================== */

.analyses-section {
  max-width: 100%;
}

.analyses-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.analyses-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
}

.rule-impact-content {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}

/* ==================== SIDEBAR ==================== */

.priority-rules-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  box-shadow: var(--shadow-2xl);
  transition: var(--transition-slow);
  z-index: var(--z-modal);
  overflow-y: auto;
}

.priority-rules-sidebar.open {
  right: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 1;
}

.sidebar-header h3 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--body-color);
  cursor: pointer;
  transition: var(--transition-normal);
}

.sidebar-toggle:hover {
  background: var(--gray-100);
  color: var(--heading-color);
}

.sidebar-content {
  padding: var(--space-6);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--gray-200);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  z-index: var(--z-modal-backdrop);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==================== START OVERLAY ==================== */

/* Start Overlay Design Tokens */
:root {
  --brand: #E4B468;
  --text-strong: #E6E9EE;
  --text: #C4C9D1;
  --text-dim: #9AA1AB;
  --bg-card: #1E232B;
  --bg-page: rgba(8, 10, 13, 0.75);
  --stroke: #2B323B;
  --accent: #E4B468;
}
.start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.start-overlay.hidden {
  display: none;
}

/* Early Access Header with Badge */
.early-access-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.early-access-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Error Overlay Styles */
.start-error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.start-error-overlay.show {
  opacity: 1;
}

.start-error-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.start-error-content .error-icon {
  margin-bottom: 24px;
}

.start-error-content h2 {
  color: #ef4444;
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.start-error-content .error-message {
  color: var(--text);
  font-size: 16px;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.start-error-content .error-file {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 32px 0;
  font-family: monospace;
}

.start-error-content .error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.start-error-content .btn-secondary,
.start-error-content .btn-primary {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-size: 14px;
}

.start-error-content .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.start-error-content .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.start-error-content .btn-primary {
  background: var(--accent);
  color: #1E232B;
}

.start-error-content .btn-primary:hover {
  background: #D4A85A;
  transform: translateY(-1px);
}

.start-overlay-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px;
  max-width: 880px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--stroke);
}

.start-header {
  text-align: center;
  margin-bottom: 48px;
}

.start-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  justify-content: center;
}

.start-logo img {
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.start-title {
  font-size: 36px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.start-header h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 16px 0;
  line-height: 1.3;
  color: var(--text-strong);
}

.start-header p {
  font-size: 16px;
  margin: 0;
  color: var(--text);
  font-weight: 400;
  line-height: 1.5;
}

.start-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.2s ease;
}

.start-close-btn:hover {
  color: var(--text-strong);
}

.start-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  min-height: 450px;
}

.start-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

.start-dropzone {
  border: 2px dashed var(--stroke);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.6);
  width: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.2);
}

.start-dropzone:hover,
.start-dropzone:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.start-dropzone.drag-over {
  border-color: var(--accent);
  transform: scale(1.02);
}

.dropzone-icon {
  color: var(--text-dim);
  margin: 0;
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-heading {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
}

.dropzone-subline {
  font-size: 16px;
  color: var(--text);
  margin: 0;
}

.dropzone-primary-btn {
  background: var(--accent);
  color: #1E232B;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

.dropzone-primary-btn:hover {
  background: #D4A85A;
  transform: translateY(-1px);
}

.dropzone-primary-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dropzone-helper {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0;
  font-weight: 500;
}

.start-sample-section {
  text-align: center;
}

.sample-link {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
}

.sample-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.start-tutorial {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
}

.start-tutorial h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 32px 0;
  text-align: left;
}

.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-number {
  background: var(--accent);
  color: #1E232B;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.step-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding-top: 4px;
}

.step-text strong {
  color: var(--text-strong);
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .start-main {
    grid-template-columns: 1fr;
  }
  
  .start-upload-section {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .start-header h1 {
    font-size: 24px;
  }
  
  .start-dropzone {
    padding: 32px 24px;
  }
  
  .email-modal-content {
    padding: 32px 24px;
  }
  
  .email-actions {
    flex-direction: column;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
  }
}

/* ==================== EMAIL CAPTURE MODAL ==================== */
.email-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.email-modal.hidden {
  display: none;
}

.email-modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--stroke);
  text-align: center;
}

.email-modal-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 12px 0;
}

.email-modal-header p {
  font-size: 16px;
  color: var(--text);
  margin: 0 0 32px 0;
  line-height: 1.5;
}

.email-form {
  margin-bottom: 24px;
}

.email-input-group {
  margin-bottom: 24px;
  text-align: left;
}

.email-input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.email-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--stroke);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-strong);
  font-size: 16px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.email-input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(228, 180, 104, 0.1);
}

.email-input-group input::placeholder {
  color: var(--text-dim);
}

.email-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-primary, .btn-secondary {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  min-width: 120px;
}

.btn-primary {
  background: var(--accent);
  color: #1E232B;
}

.btn-primary:hover:not(:disabled) {
  background: #D4A85A;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--stroke);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--text-dim);
}

.btn-loading {
  display: none;
}

.btn-loading.show {
  display: inline;
}

.btn-text.hide {
  display: none;
}

.email-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke);
}

.email-footer p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.email-footer .link {
  color: var(--accent);
  text-decoration: none;
}

.email-footer .link:hover {
  text-decoration: underline;
}

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

.login-screen.hidden {
  display: none;
}

.login-container {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 48px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--stroke);
  text-align: center;
}

.login-header {
  margin-bottom: 40px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  justify-content: center;
}

.login-logo img {
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.login-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0 0 12px 0;
}

.login-header p {
  font-size: 16px;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

.login-form-container {
  margin-bottom: 32px;
}

.login-form {
  margin-bottom: 24px;
}

.login-input-group {
  margin-bottom: 24px;
  text-align: left;
}

.login-input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.login-input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--stroke);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-strong);
  font-size: 16px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login-input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(228, 180, 104, 0.1);
}

.login-input-group input::placeholder {
  color: var(--text-dim);
}

.login-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: #1E232B;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-submit-btn:hover:not(:disabled) {
  background: #D4A85A;
  transform: translateY(-1px);
}

.login-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
}

.login-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.login-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-message.hidden {
  display: none;
}

.login-footer {
  padding-top: 24px;
  border-top: 1px solid var(--stroke);
}

.login-footer p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

.login-footer .link {
  color: var(--accent);
  text-decoration: none;
}

.login-footer .link:hover {
  text-decoration: underline;
}

/* User Actions in Header */
.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 16px;
}

.user-info {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
}

/* White Header Buttons */
.header-white-btn {
  background: white;
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-white-btn:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-white-btn:active {
  transform: translateY(0);
}

/* Theme Toggle Icon Button */
.theme-icon-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.theme-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Contact Container - Far Right */
.contact-container {
  margin-left: auto;
}

/* Header Icon Buttons (Logout, Theme Toggle) */
.header-icon-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  min-width: 40px;
  min-height: 40px;
}

.header-icon-btn:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.header-icon-btn:active {
  transform: translateY(0);
}

/* Contact Pill Button */
.contact-pill-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 10px 20px;
  color: white;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.contact-pill-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(228, 180, 104, 0.1);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(228, 180, 104, 0.2);
}

.contact-pill-btn:active {
  transform: translateY(0);
}

.logout-btn {
  padding: 8px 12px;
  font-size: 14px;
}

/* Magic Link Info Styles */
.email-magic-link-info {
  text-align: center;
  margin: 24px 0;
}

.magic-link-icon {
  color: var(--accent);
  margin-bottom: 16px;
}

.email-magic-link-info p {
  color: var(--text);
  margin: 8px 0;
  font-size: 16px;
}

.email-note {
  font-size: 14px;
  color: var(--text-dim);
  font-style: italic;
}

/* Responsive Design for Login */
@media (max-width: 768px) {
  .login-container {
    padding: 32px 24px;
    margin: 20px;
  }
  
  .login-title {
    font-size: 28px;
  }
  
  .login-header h2 {
    font-size: 20px;
  }
  
  .user-actions {
    flex-direction: column;
    gap: 8px;
    margin-right: 8px;
  }
  
  .user-info {
    font-size: 12px;
  }
  
  .logout-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ==================== LOADING STATES ==================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
    right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--body-color);
}

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

@media (max-width: 1024px) {
  .priority-grid {
    grid-template-columns: 1fr;
  }
  
  .header-actions {
    flex-wrap: wrap;
    gap: var(--space-2); /* Reduce gap on tablets */
  }
  
  .header-tab-navigation {
    gap: var(--space-1);
  }
  
  .header-tab-btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-size-xs);
  }
  
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4); /* Reduce gap on tablets */
  }
  
  .header-container {
    padding: var(--space-3) var(--space-4); /* Reduce header padding on tablets */
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-4);
    min-height: auto; /* Remove fixed height on mobile */
  }
  
  .header-actions {
    width: 100%;
    justify-content: center;
    gap: var(--space-2); /* Reduce gap on mobile */
  }
  
  .header-tab-navigation {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .header-tab-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    min-height: 36px;
  }
  
  .main-content {
    padding: var(--space-6) var(--space-4);
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3); /* Reduce gap on mobile */
  }
  
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
  
  .confidence-content {
    flex-direction: column;
    text-align: center;
  }

  .priority-rules-sidebar {
    width: 100%;
    right: -100%;
  }
  
  
  .clash-groups-container {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: var(--space-3);
  }
  
  .clash-group-table-container {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: var(--space-3);
  }
  
  
  .report-actions {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  
  .project-management-actions {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  
  
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .export-actions {
    justify-content: center;
  }
  
  .element-ids-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: var(--font-size-lg);
  }
  
  .premium-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    min-height: 40px; /* Reduce button height on small screens */
  }
  
  .metric-card {
    padding: var(--space-2); /* Further reduce padding on small screens */
  }
  
  .metric-value {
    font-size: var(--font-size-2xl);
  }
  
  .main-content {
    padding: var(--space-4) var(--space-3); /* Further reduce padding on small screens */
  }
  
  .grouped-card-content {
    padding: var(--space-2); /* Further reduce padding on small screens */
  }
  
  .confidence-card,
  .report-description-card {
    min-height: 140px; /* Further reduce minimum height on small screens */
  }
  
  .chart-card,
  .numbers-cards-container {
    min-height: 180px; /* Further reduce minimum height on small screens */
  }
}

/* ==================== CLASH ANALYSES REDESIGN ==================== */

/* Analyses Section Layout */
.analyses-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-4);
}

/* Overview Metrics Card */
.analyses-overview-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.analyses-overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.analyses-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.analyses-overview-content {
  padding: var(--space-6);
}

.overview-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.overview-metric-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--card-bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  transition: all var(--transition-normal);
}

.overview-metric-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.3);
}

.overview-metric-card .metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(214, 179, 109, 0.15);
  color: var(--primary-600);
  flex-shrink: 0;
}

.overview-metric-card .metric-content {
  flex: 1;
}

.overview-metric-card .metric-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  line-height: 1;
  margin-bottom: 2px;
}

.overview-metric-card .metric-label {
  font-size: var(--font-size-sm);
  color: var(--body-color);
  font-weight: var(--font-weight-medium);
}

/* Classification Breakdown Card */
.analyses-classification-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.analyses-classification-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.analyses-classification-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.analyses-classification-content {
  padding: var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
}

.classification-section h4,
.rule-performance-section h4 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
  margin: 0 0 var(--space-4) 0;
}

.classification-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.classification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  background: rgba(255, 255, 255, 0.6);
  transition: all var(--transition-normal);
}

.classification-item.high {
  border-left-color: var(--priority-high);
}

.classification-item.medium {
  border-left-color: var(--priority-medium);
}

.classification-item.low {
  border-left-color: var(--priority-low);
}

.classification-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.classification-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--body-color);
}

.classification-value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.classification-count {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
}

.classification-percent {
  font-size: var(--font-size-sm);
  color: var(--body-color);
  font-weight: var(--font-weight-medium);
}

.rule-performance-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rule-performance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--card-border);
  transition: all var(--transition-normal);
}

.rule-performance-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.rule-performance-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--body-color);
}

.rule-performance-value {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
}

/* Top Rule Pairs Card */
.analyses-rule-pairs-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.analyses-rule-pairs-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.analyses-rule-pairs-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.analyses-rule-pairs-content {
  padding: var(--space-6);
}

.rule-pairs-table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
}

.rule-pairs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

.rule-pairs-table th {
  background: var(--card-bg-alt);
  padding: var(--space-4) var(--space-3);
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--body-color);
  border-bottom: 1px solid var(--card-border);
}

.rule-pairs-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--card-border);
  font-size: var(--font-size-sm);
  color: var(--heading-color);
}

.rule-pairs-table tbody tr:hover {
  background: rgba(214, 179, 109, 0.1);
}

.rule-pair-cell {
  font-weight: var(--font-weight-medium);
  color: var(--heading-color);
}

.count-cell {
  font-weight: var(--font-weight-semibold);
  color: var(--heading-color);
}

.priority-cell {
  font-weight: var(--font-weight-medium);
}

.priority-cell.high {
  color: var(--priority-high);
}

.priority-cell.medium {
  color: var(--priority-medium);
}

.priority-cell.low {
  color: var(--priority-low);
}

.percentage-cell {
  color: var(--body-color);
  font-weight: var(--font-weight-medium);
}

/* Responsive Design for Analyses */
@media (max-width: 1200px) {
  .overview-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  
  .analyses-classification-content {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

@media (max-width: 768px) {
  .overview-metrics-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .analyses-overview-content,
  .analyses-classification-content,
  .analyses-rule-pairs-content {
    padding: var(--space-4);
  }
  
  .rule-pairs-table th,
  .rule-pairs-table td {
    padding: var(--space-2);
    font-size: var(--font-size-xs);
  }
}

/* ==================== RULE MANAGEMENT TAB ==================== */

/* Rule Management Section Layout */
.rules-management-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-4);
}

.rules-management-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
}

.rules-management-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  margin: 0;
}

.rules-management-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* Rule Statistics Card */
.rules-stats-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.rules-stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.rules-stats-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.rules-stats-content {
  padding: var(--space-6);
}

.rules-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

.rules-stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--card-bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  transition: all var(--transition-normal);
}

.rules-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.3);
}

.rules-stat-card .stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(214, 179, 109, 0.15);
  color: var(--primary-600);
  flex-shrink: 0;
}

.rules-stat-card .stat-content {
  flex: 1;
}

.rules-stat-card .stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--heading-color);
  line-height: 1;
  margin-bottom: 2px;
}

.rules-stat-card .stat-label {
  font-size: var(--font-size-sm);
  color: var(--body-color);
  font-weight: var(--font-weight-medium);
}

/* Priority Rules Management Card */
.priority-rules-management-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.priority-rules-management-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.priority-rules-management-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.priority-rules-management-content {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.priority-rules-description {
  flex: 1;
}

.priority-rules-description p {
  font-size: var(--font-size-sm);
  color: var(--body-color);
  line-height: 1.6;
  margin: 0;
}

.priority-rules-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

/* All Rules Card */
.all-rules-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-premium);
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.all-rules-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.all-rules-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(59, 130, 246, 0.2);
}

.all-rules-content {
  padding: var(--space-6);
}

/* Hide Edit/Delete buttons inside the All Rules card (Rules Management tab) */
.all-rules-card .action-btn.edit,
.all-rules-card .action-btn.delete {
  display: none !important;
}

.rules-filter {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.premium-select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--body-color);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-normal);
}

.premium-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rules-table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

.rules-table th {
  background: var(--card-bg-alt);
  padding: var(--space-4) var(--space-3);
  text-align: left;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--body-color);
  border-bottom: 1px solid var(--card-border);
}

.rules-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--card-border);
  font-size: var(--font-size-sm);
  color: var(--heading-color);
}

.rules-table tbody tr:hover {
  background: rgba(214, 179, 109, 0.1);
}

.rule-pair-cell {
  font-weight: var(--font-weight-medium);
  color: var(--heading-color);
}

.priority-cell {
  font-weight: var(--font-weight-medium);
}

.priority-cell.high {
  color: var(--priority-high);
}

.priority-cell.medium {
  color: var(--priority-medium);
}

.priority-cell.low {
  color: var(--priority-low);
}

.priority-cell.approved {
  color: var(--status-approved);
}

.keywords-cell {
  color: var(--body-color);
  font-style: italic;
}

.count-cell {
  font-weight: var(--font-weight-medium);
  color: var(--body-color);
  text-align: right;
}

.percentage-cell {
  font-weight: var(--font-weight-medium);
  color: var(--body-color);
  text-align: right;
}

.actions-cell {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.action-btn {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--body-color);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.action-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.action-btn.edit {
  color: var(--primary-600);
}

.action-btn.delete {
  color: var(--priority-high);
}

.action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Editable Rule Row */
.rule-row-editing {
  background: rgba(59, 130, 246, 0.05) !important;
}

.rule-edit-input {
  width: 100%;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--primary-300);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--heading-color);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.rule-edit-select {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--primary-300);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  color: var(--heading-color);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

/* Responsive Design for Rule Management */
@media (max-width: 1200px) {
  .rules-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
  
  .rules-management-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
  
  .rules-management-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 768px) {
  .rules-stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  
  .rules-stats-content,
  .all-rules-content,
  .priority-rules-management-content {
    padding: var(--space-4);
  }
  
  .rules-table th,
  .rules-table td {
    padding: var(--space-2);
    font-size: var(--font-size-xs);
  }
  
  .rules-management-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .rules-management-actions .premium-btn {
    width: 100%;
  }
}

/* ==================== THEME TOGGLE STYLES ==================== */

.theme-toggle-container {
  margin-left: var(--space-4);
  display: flex;
  align-items: center;
}

#themeToggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--card-bg-alt);
  color: var(--heading-color);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#themeToggle:hover {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-500);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

#themeIcon {
  transition: transform 0.3s ease;
}

#themeToggle:hover #themeIcon {
  transform: rotate(180deg);
}

/* Dark mode icon for when in light mode */
[data-theme="light"] #themeIcon {
  display: none;
}

[data-theme="light"] #themeToggle::before {
  content: "🌙";
  font-size: 16px;
}

/* Light mode icon for when in dark mode */
[data-theme="dark"] #themeIcon {
  display: block;
}

[data-theme="dark"] #themeToggle::before {
  display: none;
}

/* Light mode overrides for BWO CSV cards */
[data-theme="light"] .bwo-csv-summary-card {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .bwo-csv-summary-card .card-header h3 {
  color: #1e293b !important;
}

[data-theme="light"] .bwo-csv-summary-card .metric-value {
  color: #1e293b !important;
}

[data-theme="light"] .bwo-csv-summary-card .metric-label {
  color: #475569 !important;
}

/* ==================== BWO CSV SUMMARY CARDS ==================== */

.bwo-csv-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.bwo-csv-summary-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.bwo-csv-summary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bwo-csv-summary-card .card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.bwo-csv-summary-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bwo-csv-summary-card.correct .card-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.bwo-csv-summary-card.missing .card-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.bwo-csv-summary-card.redundant .card-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.bwo-csv-summary-card.not-allowed .card-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.bwo-csv-summary-card.no-need .card-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.bwo-csv-summary-card.double-classification .card-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.bwo-csv-summary-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--heading-color);
  margin: 0;
}

.bwo-csv-summary-card .card-content {
  padding-left: 52px;
}

.bwo-csv-summary-card .metric-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: var(--space-1);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  position: relative;
}

.bwo-csv-summary-card .metric-value:hover {
  background: rgba(214, 179, 109, 0.1);
  transform: scale(1.05);
  color: var(--brand-500);
}

.bwo-csv-summary-card .metric-value::after {
  content: "👆";
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-sm);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bwo-csv-summary-card .metric-value:hover::after {
  opacity: 1;
}

.bwo-csv-summary-card .metric-label {
  font-size: var(--font-size-sm);
  color: var(--body-color);
}

/* ==================== BWO MODAL STYLES ==================== */

/* Modal visibility classes */
.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg-alt);
}

.modal-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--heading-color);
  margin: 0;
}

.modal-tools {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
}

.modal-tools .input {
  flex: 1;
  padding: var(--space-2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--body-color);
}

.modal-tools .btn {
  padding: var(--space-2) var(--space-3);
  background: var(--brand-500);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
}

.modal-tools .btn:hover {
  background: var(--brand-600);
}

.id-pill-list {
  padding: var(--space-4);
  max-height: 400px;
  overflow-y: auto;
  background: var(--card-bg);
}

.id-pill {
  display: inline-block;
  background: var(--card-bg-alt);
  color: var(--heading-color);
  padding: var(--space-1) var(--space-2);
  margin: var(--space-1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  font-size: var(--font-size-sm);
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s ease;
}

.id-pill:hover {
  background: var(--brand-500);
  color: white;
  border-color: var(--brand-500);
  transform: translateY(-1px);
}

.no-ids {
  text-align: center;
  color: var(--body-color);
  font-style: italic;
  padding: var(--space-4);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--body-color);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}

.icon-btn:hover {
  background: var(--card-bg-alt);
  color: var(--heading-color);
}

/* ==================== BWO GROUPED CARDS STYLES ==================== */

.bwo-grouped-cards-container {
  margin-top: var(--space-6);
}

.bwo-grouped-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.bwo-group-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.bwo-group-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bwo-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  background: var(--card-bg-alt);
  border-bottom: 1px solid var(--card-border);
}

.bwo-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.bwo-group-icon {
  font-size: var(--font-size-lg);
  font-weight: bold;
}

.bwo-group-title h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--heading-color);
  margin: 0;
}

.bwo-group-count {
  background: var(--card-bg);
  color: var(--body-color);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border: 1px solid var(--card-border);
}

.bwo-export-btn {
  background: var(--brand-500);
  color: white;
  border: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bwo-export-btn:hover {
  background: var(--brand-600);
  transform: translateY(-1px);
}

.bwo-group-content {
  padding: var(--space-4);
}

.bwo-group-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
}

.bwo-group-table th {
  background: var(--card-bg-alt);
  color: var(--heading-color);
  font-weight: 600;
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  font-size: var(--font-size-sm);
}

.bwo-group-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

.bwo-group-table tr:hover {
  background: rgba(214, 179, 109, 0.05);
}

.service-category {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.service-name {
  font-weight: 500;
  color: var(--heading-color);
  font-size: var(--font-size-sm);
}

.service-count {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--brand-500);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-block;
}

.service-count:hover {
  background: rgba(214, 179, 109, 0.1);
  transform: scale(1.05);
}

.element-ids-preview {
  font-family: monospace;
  font-size: var(--font-size-xs);
  color: var(--body-color);
  background: var(--card-bg-alt);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  max-width: 300px;
  word-break: break-all;
}

/* Color variants for different BWO statuses */
.bwo-group-card.success {
  border-left: 4px solid #10b981;
}

.bwo-group-card.warning {
  border-left: 4px solid #f59e0b;
}

.bwo-group-card.error {
  border-left: 4px solid #ef4444;
}

.bwo-group-card.info {
  border-left: 4px solid #3b82f6;
}

.bwo-group-card.default {
  border-left: 4px solid var(--card-border);
}

/* ==================== BWO ANALYSIS TAB STYLES ==================== */

/* BWO Analysis Section */
.bwo-analysis-section {
  padding: var(--space-6);
  max-width: 1400px;
  margin: 0 auto;
}

.bwo-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.bwo-analysis-header h2 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.bwo-analysis-actions {
  display: flex;
  gap: var(--space-3);
}

/* BWO Overview Chart */
.bwo-overview-card {
  margin-bottom: var(--space-6);
}

.bwo-chart-container {
  padding: var(--space-4);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BWO Summary Cards */
.bwo-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.bwo-summary-card {
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.bwo-summary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bwo-summary-card .card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.bwo-summary-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bwo-summary-card.correct .card-icon {
  background: var(--priority-low-light);
  color: var(--priority-low);
}

.bwo-summary-card.missing .card-icon {
  background: var(--priority-medium-light);
  color: var(--priority-medium);
}

.bwo-summary-card.redundant .card-icon {
  background: var(--priority-high-light);
  color: var(--priority-high);
}

.bwo-summary-card.not-allowed .card-icon {
  background: var(--gray-100);
  color: var(--body-color);
}

.bwo-summary-card h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.bwo-summary-card .card-content {
  text-align: center;
}

.bwo-summary-card .metric-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.bwo-summary-card .metric-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* BWO Detailed Cards */
.bwo-detailed-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.bwo-detailed-card {
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.bwo-detailed-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-light);
  background: var(--gray-50);
}

.bwo-detailed-card .card-header h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.bwo-detailed-card .card-actions {
  display: flex;
  gap: var(--space-2);
}

.bwo-detailed-card .card-content {
  padding: var(--space-4);
}

/* BWO Items List */
.bwo-items-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: var(--space-4);
}

.bwo-item-card {
  background: var(--surface-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: all 0.2s ease;
}

.bwo-item-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-300);
}

.bwo-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-light);
}

.bwo-item-header h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.bwo-item-type {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bwo-item-card.correct .bwo-item-type {
  background: var(--priority-low-light);
  color: var(--priority-low);
}

.bwo-item-card.missing .bwo-item-type {
  background: var(--priority-medium-light);
  color: var(--priority-medium);
}

.bwo-item-card.redundant .bwo-item-type {
  background: var(--priority-high-light);
  color: var(--priority-high);
}

.bwo-item-card.not-allowed .bwo-item-type {
  background: var(--gray-100);
  color: var(--body-color);
}

.bwo-element-info {
  margin-bottom: var(--space-3);
}

.bwo-element-info:last-child {
  margin-bottom: 0;
}

.bwo-element-info h5 {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border-light);
}

.bwo-element-info p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin: var(--space-1) 0;
  line-height: 1.4;
}

.bwo-element-info strong {
  color: var(--text-primary);
  font-weight: 600;
}

.no-data {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: var(--space-8);
}

/* Responsive Design */
@media (max-width: 768px) {
  .bwo-analysis-section {
    padding: var(--space-4);
  }
  
  .bwo-analysis-header {
    flex-direction: column;
    gap: var(--space-4);
    align-items: stretch;
  }
  
  .bwo-summary-cards {
    grid-template-columns: 1fr;
  }
  
  .bwo-items-list {
    grid-template-columns: 1fr;
  }
  
  .bwo-detailed-card .card-header {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
  }
  
  .bwo-detailed-card .card-actions {
    justify-content: center;
  }
}

/* ==================== LEGACY COMPATIBILITY ==================== */

/* Maintain compatibility with existing JavaScript */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.sticky-header {
  display: none; /* Hidden in favor of premium-header */
}

.summary-section,
.rule-impact-section,
.orientation-triage-section {
  display: none; /* Content moved to tabs */
}

.clash-groups {
  display: none; /* Content moved to detailed-report tab */
}

/* Ensure existing IDs still work */
#overallStats,
#overallChart,
#confidenceCard,
#ruleImpactAnalysis,
#triageContent,
#isoCanvasContainer,
#clashGroups {
  /* These will be populated by JavaScript */
  position: relative;
}

/* ==================== COORSIGHT LIGHT THEME ==================== */

:root[data-theme="light"] {
  /* Surfaces */
  --bg: #ffffff;                 /* page background */
  --surface-1: #f8fafc;          /* cards */
  --surface-2: #f1f5f9;          /* headers/strips */
  --surface-3: #e2e8f0;          /* subtle panels */
  --border-subtle: #e2e8f0;

  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* Brand accent (gold like landing) */
  --brand-500: #d6b36d;
  --brand-600: #c8a055;

  /* Shadows (softer on light) */
  --shadow-premium: 0 4px 12px rgba(0,0,0,.1);

  /* Keep existing priority + BWO colors AS IS */
}

/* ==================== COORSIGHT DARK THEME ==================== */

:root[data-theme="dark"] {
  /* Surfaces */
  --bg: #0e1116;                 /* page background */
  --surface-1: #141922;          /* cards */
  --surface-2: #1b2330;          /* headers/strips */
  --surface-3: #10151d;          /* subtle panels */
  --border-subtle: #2a303b;

  /* Text */
  --text-primary: #e8eaf0;
  --text-secondary: #b4bdd1;
  --text-muted: #8a94a8;

  /* Brand accent (gold like landing) */
  --brand-500: #d6b36d;
  --brand-600: #c8a055;

  /* Shadows (softer on dark) */
  --shadow-premium: 0 6px 18px rgba(0,0,0,.35);

  /* Keep existing priority + BWO colors AS IS */
}

/* ==================== EMAIL MODAL STYLES ==================== */
.email-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.email-modal-content {
  background: var(--surface-800);
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-premium);
}

.email-modal-header h2 {
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.email-modal-header p {
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
  font-size: 0.9rem;
}

.email-input-group {
  margin-bottom: 1.5rem;
}

.email-input-group label {
  display: block;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.email-input-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-600);
  border-radius: 6px;
  background: var(--surface-700);
  color: var(--text-primary);
  font-size: 1rem;
}

.email-input-group input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.email-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.btn-secondary, .btn-primary {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-secondary {
  background: var(--surface-600);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--surface-500);
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
}

.email-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.email-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.email-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.email-message.hidden {
  display: none;
}

/* Loading spinner for form */
.loading-spinner-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--surface-600);
  border-top: 3px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* FormData-based form styling */
#signup-gate .error {
  color: #E05252;
  margin-top: 8px;
}

#signup-gate .success {
  color: #D6B36D;
  margin-top: 8px;
}

.form-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  opacity: 0.8;
}
