/* ========================================
   QMIN Management System - Shared Styles
   ======================================== */

/* ===== CSS CUSTOM PROPERTIES (CSS Variables) ===== */
:root {
  /* Color Palette - Harmonious & Light */
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: #f0f4ff;
  --color-primary-dark: #4338ca;
  
  --color-secondary: #6b7280;
  --color-secondary-hover: #4b5563;
  --color-secondary-light: #f9fafb;
  --color-secondary-dark: #374151;
  
  --color-success: #059669;
  --color-success-hover: #047857;
  --color-success-light: #f0fdf4;
  --color-success-dark: #065f46;
  
  --color-warning: #d97706;
  --color-warning-hover: #b45309;
  --color-warning-light: #fffbeb;
  --color-warning-dark: #92400e;
  
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-light: #fef2f2;
  --color-danger-dark: #991b1b;
  
  --color-info: #0891b2;
  --color-info-hover: #0e7490;
  --color-info-light: #f0f9ff;
  --color-info-dark: #155e75;
  
  --color-purple: #7c3aed;
  --color-purple-hover: #6d28d9;
  --color-purple-light: #f3e8ff;
  --color-purple-dark: #5b21b6;
  
  /* Neutral Colors - Glassmorphism Ready */
  --color-white: #ffffff;
  --color-white-glass: rgba(255, 255, 255, 0.8);
  --color-white-glass-light: rgba(255, 255, 255, 0.6);
  --color-white-glass-heavy: rgba(255, 255, 255, 0.95);
  
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;
  
  /* Glass borders */
  --border-glass: rgba(255, 255, 255, 0.2);
  --border-glass-light: rgba(255, 255, 255, 0.1);
  --border-glass-strong: rgba(255, 255, 255, 0.3);
  
  /* Gradients - Harmonious & Soft */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #059669, #10b981);
  --gradient-warning: linear-gradient(135deg, #d97706, #f59e0b);
  --gradient-purple: linear-gradient(135deg, #7c3aed, #8b5cf6);
  --gradient-blue: linear-gradient(135deg, #6366f1, #3b82f6);
  
  /* Glassmorphism Gradients */
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  --gradient-glass-strong: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  --gradient-glass-primary: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  --gradient-glass-backdrop: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.02));
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-base: 1rem;     /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;    /* 24px */
  --font-size-3xl: 1.875rem;  /* 30px */
  --font-size-4xl: 2.25rem;   /* 36px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing */
  --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 */
  
  /* Border Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.375rem;  /* 6px */
  --radius-lg: 0.5rem;    /* 8px */
  --radius-xl: 0.75rem;   /* 12px */
  --radius-2xl: 1rem;     /* 16px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: var(--line-height-normal);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: #f1f5f9;
  color: var(--color-gray-800);
  line-height: var(--line-height-normal);
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-gray-800);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin-bottom: var(--space-4);
  color: var(--color-gray-600);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

/* ===== LAYOUT UTILITIES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-4);
}

/* ===== APP LAYOUTS ===== */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-container.vertical {
  flex-direction: column;
}

.app-container.vertical .main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Standard app layout with sidebar */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-layout .sidebar {
  flex-shrink: 0;
}

.app-layout .main-canvas {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.9) 0%, rgba(226, 232, 240, 0.8) 100%);
  backdrop-filter: blur(20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.canvas-header {
  background: var(--color-white-glass);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-glass);
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.canvas-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-800);
}

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

.canvas-area {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

/* Full-width app layout (for hierarchy management) */
.app-layout.full-width {
  flex-direction: column;
}

.app-layout.full-width .main-content {
  flex: 1;
  padding: var(--space-5);
  overflow-y: auto;
}

.app-layout.full-width .header {
  text-align: center;
  margin-bottom: var(--space-8);
  padding: var(--space-6) 0;
}

.app-layout.full-width .header h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-800);
  margin-bottom: var(--space-2);
}

.app-layout.full-width .header p {
  font-size: var(--font-size-lg);
  color: var(--color-gray-600);
  max-width: 600px;
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

.app-layout.full-width .controls {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  justify-content: center;
}

.app-layout.full-width .main-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

/* Simple rules layout (converted to sidebar style) */
.simple-rules .app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.simple-rules .sidebar {
  width: 350px;
  background: var(--color-white-glass-heavy);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.simple-rules .main-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.simple-rules .toolbar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  flex-shrink: 0;
}

.simple-rules .content-area {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid {
  display: grid;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-auto { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
  user-select: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

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

.btn:not(:disabled):active {
  transform: translateY(0);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-size-lg);
}

/* Button Variants */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  border: 1px solid var(--border-glass-strong);
  backdrop-filter: blur(10px);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-white-glass);
  color: var(--color-secondary);
  border: 1px solid var(--border-glass);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-gray-200);
  color: var(--color-secondary-hover);
}

.btn-success {
  background: var(--color-success);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
  background: var(--color-success-hover);
  box-shadow: var(--shadow-md);
}

.btn-warning {
  background: var(--color-warning);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn-warning:hover:not(:disabled) {
  background: var(--color-warning-hover);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
  background: var(--color-danger-hover);
  box-shadow: var(--shadow-md);
}

.btn-info {
  background: var(--color-info);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn-info:hover:not(:disabled) {
  background: var(--color-info-hover);
  box-shadow: var(--shadow-md);
}

/* ===== CARDS ===== */
.card {
  background: var(--color-white-glass);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  background: var(--color-white-glass-heavy);
}

.card-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-glass);
  background: var(--gradient-glass-primary);
  backdrop-filter: blur(20px);
  color: var(--color-gray-800);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--color-white);
}

.card-header p {
  font-size: var(--font-size-sm);
  opacity: 0.9;
  margin-bottom: 0;
  color: var(--color-white);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--color-gray-200);
  background: var(--color-gray-50);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: inherit;
  background: var(--color-white);
  transition: all var(--transition-fast);
}

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

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: var(--space-4);
}

.form-row .form-group {
  flex: 1;
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.nav-item {
  display: flex;
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  color: var(--color-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.nav-link:hover {
  background: var(--color-secondary-light);
  color: var(--color-secondary-hover);
}

.nav-link.active {
  background: var(--color-primary);
  color: var(--color-white);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-gray-200);
}

.tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary);
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.tab:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: var(--color-primary-light);
}

.tab-content {
  display: none;
  padding: var(--space-6);
}

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

/* ===== SIDEBAR ===== */
.sidebar {
  width: 350px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
  backdrop-filter: blur(30px);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  position: relative;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(139, 92, 246, 0.01) 100%);
  pointer-events: none;
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-glass);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  backdrop-filter: blur(20px);
  color: white;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.sidebar-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
  pointer-events: none;
}

.sidebar-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.sidebar-header h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-2);
  color: white;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.sidebar-header p {
  font-size: var(--font-size-sm);
  opacity: 0.9;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
  font-weight: var(--font-weight-normal);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

/* Sidebar Tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
  background: transparent;
  padding: 0;
  gap: 0;
  position: relative;
}

.sidebar-tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: #64748b;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
  border-radius: 0;
  position: relative;
  text-align: center;
}

.sidebar-tab:hover {
  color: #334155;
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: #cbd5e1;
}

.sidebar-tab.active {
  color: #667eea;
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: #667eea;
  font-weight: var(--font-weight-medium);
  position: relative;
}

.sidebar-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px 2px 0 0;
}

.sidebar-tab-content {
  display: none;
}

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

.sidebar-section {
  margin-bottom: var(--space-6);
}

.sidebar-section h3 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: #4b5563;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===== MAIN CANVAS ===== */
.main-canvas {
  flex: 1;
  position: relative;
  background: var(--color-gray-50);
  overflow: hidden;
}

.canvas-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  z-index: 100;
}

.canvas-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-800);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.canvas-title i {
  color: var(--color-primary);
}

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

.canvas-area {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  padding: var(--space-5);
}

/* ===== BACK BUTTON ===== */
.back-button {
  position: fixed;
  bottom: var(--space-5);
  left: var(--space-5);
  z-index: var(--z-fixed);
  background: var(--color-white-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-4);
  color: var(--color-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-normal);
}

.back-button:hover {
  background: var(--color-white-glass-heavy);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
}

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

.modal-title {
  margin: 0;
  color: var(--color-gray-800);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--font-size-2xl);
  color: var(--color-secondary);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-800);
}

.modal-body {
  padding: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) 0 0 0;
  border-top: 1px solid var(--color-gray-200);
  margin-top: var(--space-5);
}

/* ===== NOTIFICATIONS ===== */
.notification-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.notification {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-4) var(--space-5);
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid var(--color-primary);
  position: relative;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--transition-slow);
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification.success {
  border-left-color: var(--color-success);
}

.notification.error {
  border-left-color: var(--color-danger);
}

.notification.warning {
  border-left-color: var(--color-warning);
}

.notification.info {
  border-left-color: var(--color-info);
}

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

.notification-icon {
  font-size: var(--font-size-xl);
  flex-shrink: 0;
}

.notification.success .notification-icon {
  color: var(--color-success);
}

.notification.error .notification-icon {
  color: var(--color-danger);
}

.notification.warning .notification-icon {
  color: var(--color-warning);
}

.notification.info .notification-icon {
  color: var(--color-info);
}

.notification-message {
  flex: 1;
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  line-height: var(--line-height-normal);
}

.notification-close {
  background: none;
  border: none;
  font-size: var(--font-size-lg);
  color: var(--color-gray-400);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.notification-close:hover {
  color: var(--color-gray-600);
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-gray-200);
  border-top: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-normal { font-weight: var(--font-weight-normal); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }

.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }
.bg-danger { background-color: var(--color-danger); }
.bg-info { background-color: var(--color-info); }

.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }

/* ===== INSTRUCTIONS PANEL ===== */
.instructions-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin: 16px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.instructions-header h3 {
  color: #1e293b;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0;
}

.instructions-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.instruction-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.step-number {
  background: #3b82f6;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  flex-shrink: 0;
}

/* ===== TABLE STYLES ===== */
.csv-table th, .csv-table td {
  border: 1px solid #64748b;
  padding: 8px 12px;
  text-align: left;
  color: #1e293b;
}

table td {
  border: 1px solid #64748b;
  padding: 8px 12px;
  text-align: left;
  color: #1e293b;
}

table th {
  border: 1px solid #64748b;
  padding: 8px 12px;
  text-align: left;
  background-color: #f8fafc;
  font-weight: var(--font-weight-semibold);
  color: #1e293b;
}

.csv-table th {
  background-color: #f8fafc;
  font-weight: var(--font-weight-semibold);
  color: #1e293b;
}

.csv-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.csv-table tr:hover {
  background-color: #f1f5f9;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .sidebar {
    width: 280px;
  }
  
  .main-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
  
  .sidebar {
    width: 100%;
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    z-index: var(--z-modal);
    transition: left var(--transition-normal);
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .canvas-header {
    padding: 0 var(--space-4);
  }
  
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
  
  .modal {
    width: 95%;
    padding: var(--space-4);
  }
  
  .notification {
    min-width: 280px;
    max-width: 320px;
  }
  
  .form-row {
    flex-direction: column;
    gap: var(--space-2);
  }
  
  .tabs {
    flex-direction: column;
  }
  
  .tab {
    border-bottom: none;
    border-right: 2px solid transparent;
  }
  
  .tab.active {
    border-bottom-color: transparent;
    border-right-color: var(--color-primary);
  }
}

@media (max-width: 480px) {
  .back-button {
    bottom: var(--space-4);
    left: var(--space-4);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
  }
  
  .notification-container {
    top: var(--space-4);
    right: var(--space-4);
  }
  
  .notification {
    min-width: 260px;
    max-width: 300px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .back-button,
  .notification-container,
  .modal-overlay {
    display: none !important;
  }
  
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  
  .main-canvas {
    position: static;
    height: auto;
  }
  
  .canvas-area {
    position: static;
    height: auto;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better accessibility */
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
.tab:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== DARK MODE SUPPORT (Future Enhancement) ===== */
/* @media (prefers-color-scheme: dark) {
  :root {
    --color-gray-50: #0f172a;
    --color-gray-100: #1e293b;
    --color-gray-200: #334155;
    --color-gray-300: #475569;
    --color-gray-400: #64748b;
    --color-gray-500: #94a3b8;
    --color-gray-600: #cbd5e1;
    --color-gray-700: #e2e8f0;
    --color-gray-800: #f1f5f9;
    --color-gray-900: #f8fafc;
  }
} */

/* ===== DATA PIPELINE ORCHESTRATOR STYLES ===== */

/* Data Pipeline Orchestrator Additional Classes */
.data-pipeline-orchestrator .hidden {
    display: none !important;
}

/* Main Canvas */
.main-canvas {
  flex: 1;
  position: relative;
  background: #f8fafc;
  overflow: hidden;
}

.canvas-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.canvas-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-title i {
  color: #667eea;
}

.canvas-actions {
  display: flex;
  gap: 12px;
}

/* Canvas Area */
.canvas-area {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  padding: 20px;
}

/* Pipeline Steps */
.pipeline-steps {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  gap: 20px;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  min-width: 150px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pipeline-step.active {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.pipeline-step.completed {
  border-color: #10b981;
  background: #f0fdf4;
}

.pipeline-step.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  background: #64748b;
}

.pipeline-step.active .step-icon {
  background: #3b82f6;
}

.pipeline-step.completed .step-icon {
  background: #10b981;
}

.pipeline-step.error .step-icon {
  background: #ef4444;
}

.step-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  text-align: center;
}

.step-description {
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

/* Content Areas */
.content-area {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.content-area h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* CSV Upload Area */
.csv-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.csv-upload-area:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.csv-upload-area.dragover {
  border-color: #10b981;
  background: #f0fdf4;
}

.upload-icon {
  font-size: 48px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.upload-text {
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.upload-subtext {
  font-size: 14px;
  color: #64748b;
}

/* CSV Preview */
.csv-preview {
  max-height: 300px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 4px;
}

.csv-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  border-radius: 6px;
  overflow: hidden;
}

.csv-table th,
.csv-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
}

.csv-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
}

.csv-table tr:nth-child(even) {
  background: #f8fafc;
}

/* Mapping Interface */
.mapping-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mapping-column {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
}

.mapping-column h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mapping-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mapping-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.mapping-item:active {
  cursor: grabbing;
}

.mapping-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.mapping-item.mapped {
  border-color: #10b981;
  background: #f0fdf4;
}

.mapping-item.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.mapping-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}

.mapping-icon.csv {
  background: #3b82f6;
}

.mapping-icon.variable {
  background: #6b7280;
}

.mapping-item.mapped .mapping-icon.variable {
  background: #10b981;
}

.mapping-item.mapped .mapping-icon.csv {
  background: #10b981;
}

.mapping-item.error .mapping-icon.csv {
  background: #ef4444;
}

.mapping-content {
  flex: 1;
}

.mapping-title {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 2px;
}

.mapping-description {
  font-size: 11px;
  color: #64748b;
}

.mapping-actions {
  display: flex;
  gap: 4px;
}

.mapping-action {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 3px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
}

.mapping-action:hover {
  background: #e2e8f0;
  color: #475569;
}

.mapping-field-type {
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 10px;
  margin-top: 4px;
}

.system-field {
  border-left: 3px solid #3b82f6 !important;
}

.system-field .mapping-icon {
  background: #3b82f6 !important;
}

/* Drop Zones */
.drop-zone {
  min-height: 60px;
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  background: #fafafa;
}

.drop-zone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.drop-zone.has-item {
  border-color: #10b981;
  background: #f0fdf4;
}

.drop-zone-text {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  padding: 8px;
}

/* Pipeline Management Styles */
.pipeline-section {
  padding: 16px;
}

.pipeline-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pipeline-actions .btn {
  flex: 1;
  min-width: 120px;
}

.pipeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: white;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pipeline-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.pipeline-info h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.pipeline-info p {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #64748b;
}

.pipeline-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #94a3b8;
}

.pipeline-management-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

/* Rules List Styling */
.rules-list {
  margin-top: 16px;
}

.rule-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.rule-item.selected {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.rule-item.selected .rule-icon {
  background: #10b981;
}

.rule-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  background: #667eea;
  flex-shrink: 0;
}

.rule-content {
  flex: 1;
}

.rule-title {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 4px;
}

.rule-description {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
  line-height: 1.4;
}

.rule-meta {
  font-size: 11px;
  color: #94a3b8;
}

.rule-variables {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* Variables List Styling */
.variables-list {
  margin-top: 16px;
}

.variable-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.variable-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.variable-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  background: #f59e0b;
  flex-shrink: 0;
}

.variable-content {
  flex: 1;
}

.variable-title {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 4px;
}

.variable-description {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
  line-height: 1.4;
}

.variable-meta {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  gap: 8px;
}

.variable-type {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.variable-required {
  background: #fef2f2;
  color: #dc2626;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* CSV Statistics Styling */
.csv-stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1;
}

.preview-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 13px;
  color: #1e40af;
  text-align: center;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Mapping Preview Styling */
.mapping-preview-list {
  margin-top: 16px;
}

.mapping-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s;
}

.mapping-preview-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.mapping-preview-column {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  flex: 1;
  min-width: 0;
}

.mapping-preview-column i {
  color: #0369a1;
  font-size: 14px;
  flex-shrink: 0;
}

.mapping-preview-column span {
  font-size: 14px;
  font-weight: 500;
  color: #0c4a6e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mapping-preview-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  flex-shrink: 0;
}

.mapping-preview-arrow i {
  color: #64748b;
  font-size: 12px;
}

.mapping-preview-variable {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 6px;
  flex: 1;
  min-width: 0;
}

.mapping-preview-variable i {
  color: #d97706;
  font-size: 14px;
  flex-shrink: 0;
}

.mapping-preview-variable span {
  font-size: 14px;
  font-weight: 500;
  color: #92400e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Results Area */
.results-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.summary-card.success {
  border-color: #10b981;
  background: #f0fdf4;
}

.summary-card.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.summary-card.warning {
  border-color: #f59e0b;
  background: #fffbeb;
}

.summary-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

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

.summary-card.error .summary-value {
  color: #ef4444;
}

.summary-card.warning .summary-value {
  color: #f59e0b;
}

.summary-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Results Table Container */
.results-table-container {
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.results-table-container h4 {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 16px 0;
  padding: 20px 20px 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-table-container h4 i {
  color: #3b82f6;
}

/* Table Controls */
.table-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 20px 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0;
}

.table-controls .btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-controls .btn i {
  font-size: 12px;
}

/* Results Table Wrapper */
.results-table-wrapper {
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

/* Results Table */
.results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  margin: 0;
}

.results-table th,
.results-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.results-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-table tbody tr {
  transition: background-color 0.2s ease;
}

.results-table tbody tr:hover {
  background: #f8fafc;
}

.results-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.results-table tbody tr:nth-child(even):hover {
  background: #f1f5f9;
}

/* ID Column Styling */
.results-table td:first-child {
  font-weight: 600;
  color: #1e293b;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

/* Result Column Styling */
.results-table td:nth-child(2) {
  font-weight: 500;
  color: #374151;
  max-width: 300px;
  word-wrap: break-word;
}

/* Status Column Styling */
.results-table td:nth-child(3) {
  text-align: center;
}

/* Processing Time Column Styling */
.results-table td:last-child {
  text-align: right;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  color: #64748b;
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 16px;
  background: #f8fafc;
  border-radius: 8px;
  margin: 20px;
}

.no-results i {
  font-size: 48px;
  color: #cbd5e1;
  margin-bottom: 16px;
  display: block;
}

.status-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.success {
  background: #dcfce7;
  color: #166534;
}

.status-badge.error {
  background: #fef2f2;
  color: #991b1b;
}

/* Processing States */
.processing-loader {
  text-align: center;
  padding: 60px 20px;
}

.loader-container h4 {
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.loader-container p {
  font-size: 16px;
  color: #64748b;
  margin-bottom: 32px;
}

.processing-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 32px;
}

.processing-stats .stat-item {
  min-width: 120px;
}

.processing-stats .stat-value.processing {
  color: #3b82f6;
  font-weight: 600;
}

.spinner-large {
  width: 64px;
  height: 64px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}

/* Mapping Section Header */
.mapping-section-header {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-primary-light);
  border-radius: 8px;
  border-left: 4px solid var(--color-primary);
}

.mapping-section-header h3 {
  margin: 0 0 0.5rem 0;
  color: var(--color-primary-dark);
  font-size: 1.1rem;
  font-weight: 600;
}

.mapping-section-header p {
  margin: 0;
  color: var(--color-secondary);
  font-size: 0.9rem;
}

/* No Rule Selected State */
.no-rule-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background: var(--color-secondary-light);
  border: 2px dashed var(--color-secondary);
  border-radius: 12px;
  margin: 1rem 0;
}

.no-rule-icon {
  font-size: 3rem;
  color: var(--color-warning);
  margin-bottom: 1rem;
}

.no-rule-message h3 {
  margin: 0 0 0.5rem 0;
  color: var(--color-secondary-dark);
  font-size: 1.2rem;
}

.no-rule-message p {
  margin: 0;
  color: var(--color-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Responsive Design for Data Pipeline Orchestrator */
@media (max-width: 768px) {
  .sidebar {
    width: 280px;
  }

  .canvas-header {
    padding: 0 16px;
  }

  .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .mapping-container {
    grid-template-columns: 1fr;
  }

  .pipeline-steps {
    flex-direction: column;
    align-items: center;
  }

  .results-table-container h4 {
    padding: 16px 16px 0 16px;
    font-size: 16px;
  }

  .table-controls {
    padding: 0 16px 12px 16px;
    flex-direction: column;
    gap: 8px;
  }

  .table-controls .btn {
    width: 100%;
    justify-content: center;
  }

  .results-table th,
  .results-table td {
    padding: 8px 12px;
    font-size: 12px;
  }

  .results-table-wrapper {
    max-height: 400px;
  }
}

/* ===== HIERARCHY MANAGEMENT STYLES ===== */

/* Hierarchy Management Global Styles */
.hierarchy-management * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hierarchy-management body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: #1e293b;
}

.hierarchy-management .back-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 16px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.hierarchy-management .back-button:hover {
    background: #f1f5f9;
    color: #475569;
    transform: translateY(-1px);
}

.hierarchy-management .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 20px 20px;
}

.hierarchy-management .header {
    text-align: center;
    margin-bottom: 2rem;
}

.hierarchy-management .header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.hierarchy-management .header p {
    font-size: 1.125rem;
    color: #64748b;
}

.hierarchy-management .controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hierarchy-management .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 14px;
}

.hierarchy-management .btn-primary {
    background: #3b82f6;
    color: white;
}

.hierarchy-management .btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.hierarchy-management .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.hierarchy-management .btn-secondary:hover {
    background: #e2e8f0;
}

.hierarchy-management .btn-success {
    background: #10b981;
    color: white;
}

.hierarchy-management .btn-success:hover {
    background: #059669;
}

.hierarchy-management .btn-warning {
    background: #f59e0b;
    color: white;
}

.hierarchy-management .btn-warning:hover {
    background: #d97706;
}

.hierarchy-management .btn-info {
    background: #06b6d4;
    color: white;
}

.hierarchy-management .btn-info:hover {
    background: #0891b2;
}

.hierarchy-management .main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.hierarchy-management .hierarchy-view {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

.hierarchy-management .hierarchy-view h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-size: 1.25rem;
}

.hierarchy-management .tree-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    min-height: 500px;
    background: #fafafa;
}

.hierarchy-management .view-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.hierarchy-management .tab-button {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.hierarchy-management .tab-button:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.hierarchy-management .tab-button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.hierarchy-management .view-content {
    display: none;
}

.hierarchy-management .view-content.active {
    display: block;
}

.hierarchy-management .canvas-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.hierarchy-management .node-container {
    position: relative;
    width: 100%;
    height: 800px;
    background-image: radial-gradient(circle, #e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
    background-repeat: repeat;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.hierarchy-management .tree-node {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.hierarchy-management .tree-node:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.hierarchy-management .tree-node.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.hierarchy-management .tree-item {
    margin-bottom: 0.5rem;
}

.hierarchy-management .tree-level {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 4rem;
    text-align: center;
}

.hierarchy-management .tree-name {
    font-weight: bold;
    color: #1f2937;
    min-width: 8rem;
}

.hierarchy-management .tree-email {
    color: #6b7280;
    font-size: 0.875rem;
    min-width: 12rem;
}

.hierarchy-management .tree-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.hierarchy-management .sidebar-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.hierarchy-management .sidebar-panel h3 {
    margin-bottom: 1rem;
    color: #374151;
    font-size: 1.25rem;
}

.hierarchy-management .form-group {
    margin-bottom: 1rem;
}

.hierarchy-management .form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 14px;
}

.hierarchy-management .form-input,
.hierarchy-management .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.hierarchy-management .form-input:focus,
.hierarchy-management .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.hierarchy-management .form-row {
    display: flex;
    gap: 0.5rem;
}

.hierarchy-management .form-row .form-group {
    flex: 1;
}

.hierarchy-management .bulk-import {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.hierarchy-management .bulk-import h4 {
    margin-bottom: 1rem;
    color: #374151;
}

.hierarchy-management .bulk-import textarea {
    width: 100%;
    height: 120px;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
}

.hierarchy-management .bulk-import .help-text {
    font-size: 12px;
    color: #64748b;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.hierarchy-management .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.hierarchy-management .modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.hierarchy-management .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.hierarchy-management .modal-title {
    margin: 0;
    color: #111827;
    font-size: 1.5rem;
    font-weight: 600;
}

.hierarchy-management .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

.hierarchy-management .modal-close:hover {
    background: #f3f4f6;
}

.hierarchy-management .notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    border-left: 4px solid #3b82f6;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
    max-width: 400px;
}

.hierarchy-management .notification.show {
    transform: translateX(0);
}

.hierarchy-management .notification.success {
    border-left-color: #10b981;
}

.hierarchy-management .notification.error {
    border-left-color: #ef4444;
}

.hierarchy-management .notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hierarchy-management .notification i {
    font-size: 1.25rem;
    color: #3b82f6;
}

.hierarchy-management .notification.success i {
    color: #10b981;
}

.hierarchy-management .notification.error i {
    color: #ef4444;
}

/* Hierarchy Canvas and Nodes */
.hierarchy-management .hierarchy-canvas {
    position: relative;
    width: 100%;
    min-height: 800px;
    background-image: radial-gradient(circle, #e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
    background-repeat: repeat;
    overflow: auto;
}

.hierarchy-management .hierarchy-node {
    position: absolute;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    min-width: 200px;
    cursor: move;
    user-select: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 10;
}

.hierarchy-management .hierarchy-node:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.hierarchy-management .hierarchy-node.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.hierarchy-management .node-level {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

.hierarchy-management .node-actions {
    display: flex;
    gap: 4px;
}

.hierarchy-management .node-action {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.hierarchy-management .node-action:hover {
    background: #e2e8f0;
    color: #475569;
}

.hierarchy-management .node-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.hierarchy-management .node-content {
    margin-bottom: 12px;
}

.hierarchy-management .node-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.hierarchy-management .node-detail i {
    width: 14px;
    color: #94a3b8;
}

.hierarchy-management .node-connectors {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.hierarchy-management .node-inputs,
.hierarchy-management .node-outputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hierarchy-management .node-connector {
    width: 16px;
    height: 16px;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    cursor: crosshair;
    transition: all 0.2s;
    position: relative;
}

.hierarchy-management .node-connector.input {
    background: #dbeafe;
    align-self: flex-start;
}

.hierarchy-management .node-connector.output {
    background: #10b981;
    align-self: flex-end;
}

.hierarchy-management .node-connector:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.hierarchy-management .node-connector.connected {
    background: #f59e0b;
    border-color: #d97706;
}

/* Hierarchy Management Additional Classes */
.hierarchy-management .empty-state {
    text-align: center;
    color: #64748b;
    padding: 2rem;
}

.hierarchy-management .empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.hierarchy-management .btn-full-width {
    width: 100%;
    margin-top: 1rem;
}

.hierarchy-management .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.hierarchy-management .help-text-spaced {
    margin-bottom: 1rem;
}

.hierarchy-management .hidden-svg {
    position: absolute;
    width: 0;
    height: 0;
}

/* Hierarchy Management Responsive adjustments */
@media (max-width: 768px) {
    .hierarchy-management .hierarchy-node {
        min-width: 180px;
        padding: 12px;
    }

    .hierarchy-management .node-title {
        font-size: 13px;
    }

    .hierarchy-management .node-detail {
        font-size: 11px;
    }
}

@media (max-width: 1024px) {
    .hierarchy-management .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hierarchy-management .container {
        padding: 60px 16px 16px;
    }

    .hierarchy-management .header h1 {
        font-size: 2rem;
    }

    .hierarchy-management .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .hierarchy-management .btn {
        justify-content: center;
    }
}

/* ===== SIMPLE RULES STYLES ===== */

/* Simple Rules Global Styles */
.simple-rules .app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Back Button */
.simple-rules .back-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 16px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.simple-rules .back-button:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Header */
.simple-rules .header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
}

.simple-rules .header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.simple-rules .header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.simple-rules .header-nav {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.simple-rules .header-nav a {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.simple-rules .header-nav a:hover {
    background: #f1f5f9;
    color: #475569;
}

/* Main Layout */
.simple-rules .main-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    width: 100%;
}

/* Top Toolbar */
.simple-rules .toolbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.simple-rules .toolbar-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.simple-rules .toolbar-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    min-width: 80px;
}

/* Variables List */
.simple-rules .variables-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.simple-rules .variable-tag {
    background: #d1fae5;
    border: 1px solid #10b981;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #065f46;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.simple-rules .variable-tag:hover {
    background: #a7f3d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.simple-rules .variable-tag:active {
    cursor: grabbing;
}

/* Operations List */
.simple-rules .operations-list {
    display: flex;
    gap: 8px;
}

.simple-rules .operation-icon {
    width: 32px;
    height: 32px;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
    font-size: 16px;
    font-weight: 600;
    color: #92400e;
}

.simple-rules .operation-icon:hover {
    background: #fde68a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.simple-rules .operation-icon:active {
    cursor: grabbing;
}

/* Numbers List */
.simple-rules .numbers-list {
    display: flex;
    gap: 8px;
}

.simple-rules .number-item {
    width: 32px;
    height: 32px;
    background: #ede9fe;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: #5b21b6;
}

.simple-rules .number-item:hover {
    background: #ddd6fe;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.simple-rules .number-item:active {
    cursor: grabbing;
}

/* Content Area */
.simple-rules .content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.simple-rules .content-section {
    margin-bottom: 32px;
}

.simple-rules .content-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.simple-rules .content-section h3 i {
    color: #3b82f6;
}

/* Drop Zone */
.simple-rules .drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-rules .drop-zone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.simple-rules .drop-zone-placeholder {
    color: #94a3b8;
    font-size: 16px;
}

.simple-rules .expression-display {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 18px;
    color: #1e293b;
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Expression Nodes */
.simple-rules .expression-node {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
    border: 2px solid transparent;
}

.simple-rules .expression-node:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.simple-rules .expression-node:active {
    cursor: grabbing;
}

.simple-rules .expression-node.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

/* Node Type Styling */
.simple-rules .operation-node {
    background: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}

.simple-rules .variable-node {
    background: #dcfce7;
    color: #166534;
    border-color: #22c55e;
}

.simple-rules .number-node {
    background: #f3e8ff;
    color: #7c3aed;
    border-color: #a855f7;
}

.simple-rules .default-node {
    background: #f1f5f9;
    color: #475569;
    border-color: #94a3b8;
}

/* Test Input Styles */
.simple-rules .test-input-group {
    margin-bottom: 16px;
}

.simple-rules .test-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.simple-rules .test-input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.simple-rules .test-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Test Results */
.simple-rules .test-result {
    margin-top: 24px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid;
}

.simple-rules .test-result.success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.simple-rules .test-result.error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.simple-rules .result-value {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.simple-rules .execution-steps {
    margin-top: 16px;
}

.simple-rules .execution-steps h4 {
    margin-bottom: 12px;
    font-size: 16px;
}

.simple-rules .execution-steps ol {
    margin-left: 20px;
}

.simple-rules .execution-steps li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.simple-rules .operation {
    color: #6b7280;
    font-style: italic;
}

/* Buttons */
.simple-rules .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
    font-family: inherit;
}

.simple-rules .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.simple-rules .btn-primary {
    background: #3b82f6;
    color: white;
}

.simple-rules .btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.simple-rules .btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.simple-rules .btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.simple-rules .btn-success {
    background: #10b981;
    color: white;
}

.simple-rules .btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.simple-rules .btn-danger {
    background: #ef4444;
    color: white;
}

.simple-rules .btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.simple-rules .btn-warning {
    background: #f59e0b;
    color: white;
}

.simple-rules .btn-warning:hover:not(:disabled) {
    background: #d97706;
}

/* Actions */
.simple-rules .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Modal Styles */
.simple-rules .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.simple-rules .modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.simple-rules .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.simple-rules .modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.simple-rules .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.simple-rules .modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Form Styles */
.simple-rules .form-group {
    margin-bottom: 20px;
}

.simple-rules .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.simple-rules .form-group input,
.simple-rules .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.simple-rules .form-group input:focus,
.simple-rules .form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Rule List */
.simple-rules .rule-list {
    max-height: 400px;
    overflow-y: auto;
}

.simple-rules .rule-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    transition: all 0.2s;
}

.simple-rules .rule-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.simple-rules .rule-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    font-size: 16px;
}

.simple-rules .rule-description {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 12px;
}

.simple-rules .rule-actions {
    display: flex;
    gap: 8px;
}

.simple-rules .rule-actions .btn {
    padding: 8px 16px;
    font-size: 12px;
}

/* Test Results */
.simple-rules .test-inputs {
    margin-bottom: 24px;
}

.simple-rules .test-input-group {
    margin-bottom: 16px;
}

.simple-rules .test-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.simple-rules .test-input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.simple-rules .test-result {
    margin-top: 24px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid;
}

.simple-rules .test-result.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.simple-rules .test-result.error {
    background: #fef2f2;
    border-color: #fecaca;
}

.simple-rules .test-result h4 {
    margin: 0 0 16px 0;
    color: #1e293b;
    font-size: 16px;
}

.simple-rules .test-result.success h4 {
    color: #059669;
}

.simple-rules .test-result.error h4 {
    color: #dc2626;
}

.simple-rules .result-value {
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: 600;
}

.simple-rules .result-expression {
    color: #64748b;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #f1f5f9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.simple-rules .execution-steps {
    margin-top: 16px;
}

.simple-rules .execution-steps h5 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 14px;
}

.simple-rules .execution-steps ol {
    margin: 0;
    padding-left: 20px;
}

.simple-rules .execution-steps li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #64748b;
}

.simple-rules .execution-steps .operation {
    color: #3b82f6;
    font-weight: 500;
}

.simple-rules .error-message {
    color: #dc2626;
    font-weight: 500;
}

/* Notification */
.simple-rules .notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    max-width: 400px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.simple-rules .notification.show {
    transform: translateX(0);
}

.simple-rules .notification.success {
    background: #10b981;
}

.simple-rules .notification.error {
    background: #ef4444;
}

.simple-rules .notification.info {
    background: #3b82f6;
}

/* Simple Rules Additional Classes */
.simple-rules .toolbar-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}

/* Expression Canvas */
.simple-rules .expression-canvas {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    margin: 24px;
    min-height: 400px;
}

.simple-rules .canvas-placeholder {
    text-align: center;
    color: #94a3b8;
}

.simple-rules .canvas-placeholder i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #cbd5e1;
}

.simple-rules .canvas-placeholder p {
    font-size: 16px;
    margin: 0;
}

/* Test Results */
.simple-rules .test-results {
    margin-top: 24px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.simple-rules .test-results h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.simple-rules .test-output {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #374151;
    background: #f8fafc;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.simple-rules .test-results-center {
    text-align: center;
    margin: 24px 0;
}

/* Simple Rules Responsive Design */
@media (max-width: 768px) {
    .simple-rules .main-content {
        flex-direction: column;
    }

    .simple-rules .toolbar {
        padding: 12px 16px;
    }

    .simple-rules .toolbar-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .simple-rules .variables-list,
    .simple-rules .operations-list,
    .simple-rules .numbers-list {
        flex-wrap: wrap;
    }

    .simple-rules .content-area {
        padding: 16px;
    }

    .simple-rules .actions {
        flex-direction: column;
    }

    .simple-rules .actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== DASHBOARD PAGE STYLES ===== */

/* Dashboard Layout */
.dashboard-page {
  min-height: 100vh;
  background: #1a1a1a;
  font-family: 'Inter', sans-serif;
  position: relative;
  color: #ffffff;
}

.dashboard-page > * {
  position: relative;
  z-index: 1;
}

/* Navigation */
.dashboard-nav {
  background: #2a2a2a;
  border-bottom: 1px solid #3a3a3a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 1.5rem;
}

.brand-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1;
}

.brand-text span {
  font-size: 0.875rem;
  color: #cccccc;
  font-weight: 500;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #1a4d1a;
  border-radius: 20px;
  font-size: 0.875rem;
  color: #4ade80;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main Content */
.dashboard-main {
  padding: 2rem 0;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Hero Section */
.dashboard-hero {
  text-align: center;
  padding: 3rem 0;
  margin-bottom: 3rem;
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #cccccc;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

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

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #6366f1;
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: #cccccc;
  font-weight: 500;
}

/* Section Titles */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 1.5rem;
}

/* Quick Actions */
.quick-actions {
  margin-bottom: 3rem;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.action-card {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a3a;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  border-color: #6366f1;
}

.action-card.primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
}

.action-card.secondary {
  background: linear-gradient(135deg, var(--color-info), var(--color-info-dark));
  color: var(--color-white);
}

.action-card.accent {
  background: linear-gradient(135deg, var(--color-purple), var(--color-purple-dark));
  color: var(--color-white);
}

.action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.2);
}

.action-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--color-white);
}

.action-content p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
  color: var(--color-white);
}

.action-arrow {
  margin-left: auto;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.action-card:hover .action-arrow {
  transform: translateX(4px);
}

/* Modules Grid */
.modules-section {
  margin-bottom: 3rem;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.module-card {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a3a;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  border-color: #6366f1;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

/* Specific module icon colors */
.module-card.rules-engine .module-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.module-card.simple-rules .module-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.module-card.hierarchy-management .module-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.module-card.data-pipeline .module-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.module-card.table-management .module-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.module-card.bulk-import .module-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.module-card.transactions .module-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.module-badge {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.module-content {
  flex-grow: 1;
  margin-bottom: 1rem;
}

.module-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
}

.module-description {
  font-size: 0.875rem;
  color: #cccccc;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.module-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  background: #1a1a2e;
  color: #6366f1;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #3a3a3a;
}

.module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #3a3a3a;
}

.launch-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6366f1;
}

.module-footer i {
  color: #6366f1;
  transition: transform 0.2s ease;
}

.module-card:hover .module-footer i {
  transform: translateX(4px);
}

/* Footer */
.dashboard-footer {
  background: #2a2a2a;
  border-top: 1px solid #3a3a3a;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: #cccccc;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #6366f1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }
  
  .dashboard-container {
    padding: 0 1rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-stats {
    gap: 2rem;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
  
  .modules-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Index Page Global Styles */
.index-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.index-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.index-page .container {
    max-width: 1200px;
    padding: 2rem;
    text-align: center;
}

.index-page .header {
    margin-bottom: 3rem;
}

.index-page .header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.index-page .header p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.index-page .apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.index-page .app-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.index-page .app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.index-page .app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.index-page .app-card.rules-engine::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.index-page .app-card.hierarchy-management::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.index-page .app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

.index-page .app-card.rules-engine .app-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.index-page .app-card.simple-rules .app-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.index-page .app-card.hierarchy-management .app-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.index-page .app-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.index-page .app-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.index-page .app-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.index-page .app-features li {
    color: #475569;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.index-page .app-features li i {
    color: #10b981;
    font-size: 0.875rem;
}

.index-page .launch-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.index-page .launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.index-page .app-card.rules-engine .launch-btn {
    background: linear-gradient(135deg, #10b981, #059669);
}

.index-page .app-card.rules-engine .launch-btn:hover {
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.index-page .app-card.hierarchy-management .launch-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.index-page .app-card.hierarchy-management .launch-btn:hover {
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.index-page .app-card.data-pipeline::before {
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
}

.index-page .app-card.data-pipeline .app-icon {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.index-page .app-card.data-pipeline .launch-btn {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

.index-page .app-card.data-pipeline .launch-btn:hover {
  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.index-page .app-card.table-management::before {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.index-page .app-card.table-management .app-icon {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.index-page .app-card.table-management .launch-btn {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.index-page .app-card.table-management .launch-btn:hover {
  box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3);
}

/* Bulk Import Manager Card */
.index-page .app-card.bulk-import .app-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.index-page .app-card.bulk-import .launch-btn {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.index-page .app-card.bulk-import .launch-btn:hover {
  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

/* Transaction Management Card */
.index-page .app-card.transactions::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.index-page .app-card.transactions .app-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.index-page .app-card.transactions .launch-btn {
  background: linear-gradient(135deg, #10b981, #059669);
}

.index-page .app-card.transactions .launch-btn:hover {
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.index-page .footer {
    margin-top: 3rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* Index Page Responsive Design */
@media (max-width: 768px) {
    .index-page .container {
        padding: 1rem;
    }

    .index-page .header h1 {
        font-size: 2rem;
    }

    .index-page .header p {
        font-size: 1rem;
    }

    .index-page .apps-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .index-page .app-card {
        padding: 2rem;
    }
}

/* ===== RULES ENGINE STYLES ===== */

/* Rules Engine Additional Classes */
.rules-engine .hidden {
    display: none !important;
}

.rules-engine .btn-full-width {
    width: 100%;
    margin-top: 12px;
}

.rules-engine .node-item-purple {
    background: #8b5cf6;
}

.rules-engine .test-results {
    margin-top: 20px;
}

.rules-engine .test-output {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    overflow-x: auto;
}

.rules-engine .hidden-svg {
    position: absolute;
    width: 0;
    height: 0;
}

/* Node Items */
.node-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.2s;
  user-select: none;
  display: flex;
  align-items: center;
}

.node-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.node-item:active {
  cursor: grabbing;
}

.node-item .node-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 14px;
  color: white !important;
  flex-shrink: 0;
}

.node-item .node-icon i {
  color: white !important;
}

.node-item .node-title {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 0;
}

.node-item .node-content {
  flex: 1;
}

.node-item .node-description {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin-top: 2px;
}

/* Node Type Colors */
.node-item.condition .node-icon {
  background: #ef4444;
}

.node-item.action .node-icon {
  background: #10b981;
}

.node-item.function .node-icon {
  background: #8b5cf6;
}

.node-item.variable .node-icon {
  background: #f59e0b;
}

.node-item.constant .node-icon {
  background: #3b82f6;
}

.node-item.system .node-icon {
  background: #06b6d4;
}

/* Canvas Grid */
.canvas-grid {
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle, #e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
  background-repeat: repeat;
  position: relative;
  min-height: 2000px;
  min-width: 2000px;
  overflow: visible;
}

/* Connection Styles */
.connection {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.connection svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.connection-line {
  stroke: #3b82f6;
  stroke-width: 2;
  fill: none;
}

/* Node Styles */
.node {
  position: absolute;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  min-width: 200px;
  cursor: move;
  user-select: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: none;
  z-index: 10;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.node:hover {
  border-color: #3b82f6;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.node.drop-target {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.node.output.drop-target::after {
  content: "Drop variable here to attach";
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 1000;
}

.node.smart-connection-success {
  border-color: #10b981;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  animation: smartConnectionSuccess 0.3s ease-out;
}

.node.smart-connection-failed {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
  animation: smartConnectionFailed 0.4s ease-out;
}

@keyframes smartConnectionSuccess {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.15);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  }
}

@keyframes smartConnectionFailed {
  0% {
    transform: translateX(0);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
  }
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
  100% {
    transform: translateX(0);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
  }
}

.node.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.node-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-icon {
  font-size: 14px;
  color: #64748b;
  width: 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.node .node-icon {
  color: #64748b;
  margin-right: 4px;
}

.sidebar .node-item .node-icon {
  color: white !important;
}

.sidebar .node-item .node-icon i {
  color: white !important;
}

.node-type {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
}

/* Node Type Colors */
.node-type.condition,
.node-type.if,
.node-type.compare,
.node-type.equals,
.node-type.greater_than,
.node-type.less_than,
.node-type.not_equals,
.node-type.equal_to,
.node-type.not_equal_to,
.node-type.greater_than_or_equal_to,
.node-type.less_than_or_equal_to,
.node-type.contains,
.node-type.not_contains,
.node-type.in,
.node-type.not_in,
.node-type.output {
  background: #ef4444;
}

.node-type.action,
.node-type.calculate_bonus,
.node-type.set_commission {
  background: #10b981;
}

.node-type.function,
.node-type.sum,
.node-type.multiply,
.node-type.minus,
.node-type.divide,
.node-type.percent,
.node-type.set_value {
  background: #8b5cf6;
}

.node-type.variable,
.node-type.premium_amount,
.node-type.agent_level,
.node-type.transaction_amount,
.node-type.threshold,
.node-type.bonus_rate,
.node-type.bonus,
.node-type.custom_variable {
  background: #f59e0b;
}

.node-type.constant,
.node-type.number {
  background: #3b82f6;
}

.node-type.system,
.node-type.flow_start {
  background: #06b6d4;
}

.node-actions {
  display: flex;
  gap: 4px;
}

.node-action {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.node-action:hover {
  background: #e2e8f0;
  color: #475569;
}

.node-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.node-content {
  font-size: 13px;
  color: #64748b;
}

.node.output .node-content {
  border-left: 3px solid transparent;
  padding-left: 8px;
  transition: border-color 0.2s;
}

.node.output[data-has-attached-variable="true"] .node-content {
  border-left-color: #10b981;
  background: #f0fdf4;
  border-radius: 4px;
  padding: 8px;
}

.node-connectors {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.node-inputs,
.node-outputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node-connector {
  width: 16px;
  height: 16px;
  border: 2px solid #3b82f6;
  border-radius: 50%;
  cursor: crosshair;
  transition: all 0.2s;
  position: relative;
}

.node-connector.input {
  background: #dbeafe;
  align-self: flex-start;
}

.node-connector.output {
  background: #10b981;
  align-self: flex-end;
}

.node-connector.output[data-output="true"] {
  background: #10b981;
  border-color: #059669;
}

.node-connector.output[data-output="false"] {
  background: #ef4444;
  border-color: #dc2626;
}

.node-connector:hover {
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.node-connector[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 4px;
}

.node-connector[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1f2937;
  z-index: 1000;
}

.node-connector.connection-highlight {
  animation: connectionHighlight 1s ease-out;
}

@keyframes connectionHighlight {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.node-connector.connected {
  background: #10b981;
  border-color: #059669;
  animation: connectedPulse 2s ease-in-out infinite;
}

@keyframes connectedPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
  }
}

/* Node Configuration */
.config-section {
  margin-bottom: 8px;
}

.config-section label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

.config-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  cursor: text;
  pointer-events: auto;
  position: relative;
  z-index: 20;
}

.config-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.node-config {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  pointer-events: auto;
  position: relative;
  z-index: 15;
}

/* Range Lookup Table Styles */
.lookup-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
}

.lookup-table th,
.lookup-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 8px;
  text-align: left;
}

.lookup-table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #374151;
}

.lookup-table input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
}

.lookup-table input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.lookup-table .btn-sm {
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 3px;
}

/* Table Editor Styles */
.table-editor {
  width: 100%;
}

.table-controls {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.table-container {
  margin: 20px 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

#table-editor {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}

#table-editor th,
#table-editor td {
  border: 1px solid #e2e8f0;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

#table-editor th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-corner {
  background: #f1f5f9 !important;
  width: 40px;
  min-width: 40px;
}

.row-header {
  background: #f8fafc !important;
  font-weight: 600;
  color: #374151;
  min-width: 120px;
  position: sticky;
  left: 0;
  z-index: 5;
}

.row-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.row-header-input {
  flex: 1;
  border: none;
  background: transparent;
  font-weight: 600;
  color: #374151;
  padding: 4px;
  border-radius: 4px;
  font-size: 13px;
}

.row-header-input:focus {
  outline: none;
  background: white;
  border: 1px solid #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.row-delete-btn {
  flex-shrink: 0;
  padding: 4px 6px;
  font-size: 11px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.row-delete-btn:hover {
  opacity: 1;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-input {
  flex: 1;
  border: none;
  background: transparent;
  font-weight: 600;
  color: #374151;
  padding: 4px;
  border-radius: 4px;
}

.header-input:focus {
  outline: none;
  background: white;
  border: 1px solid #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.cell-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: 4px;
  font-size: 13px;
}

.cell-input:focus {
  outline: none;
  background: white;
  border: 1px solid #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.table-cell {
  position: relative;
  min-width: 120px;
}

.table-cell:hover {
  background: #f8fafc;
}

/* Row actions removed - delete button now in row header */

.table-actions {
  margin-top: 20px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.table-preview {
  margin-top: 15px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.table-preview .table {
  margin: 0;
  font-size: 12px;
}

.table-preview .table th,
.table-preview .table td {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
}

.table-preview .table th {
  background: #f1f5f9;
  font-weight: 600;
}

/* Drag and drop styles */
.table-cell.drag-over {
  background: #dbeafe;
  border: 2px dashed #3b82f6;
}

.row-header.drag-over {
  background: #dbeafe !important;
  border: 2px dashed #3b82f6;
}

/* Button styles for table editor */
.table-controls .btn {
  margin-right: 8px;
  margin-bottom: 8px;
}

.table-controls .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Table management modal should be extra wide */
.table-management .modal,
#edit-table-modal .modal {
  max-width: 95vw;
  width: 90vw;
  min-width: 800px;
  max-height: 90vh;
}

/* Ensure table editor has enough space */
.table-management .table-editor,
#edit-table-modal .table-editor {
  width: 100%;
}

.table-management .table-container,
#edit-table-modal .table-container {
  width: 100%;
  overflow-x: auto;
}

/* Table controls styling */
.table-management .table-controls,
#edit-table-modal .table-controls {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.table-management .table-controls .form-group,
#edit-table-modal .table-controls .form-group {
  margin-bottom: 15px;
}

.table-management .table-controls .form-group:last-child,
#edit-table-modal .table-controls .form-group:last-child {
  margin-bottom: 0;
}

.table-management .table-controls .form-row,
#edit-table-modal .table-controls .form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Responsive table editor */
@media (max-width: 768px) {
  .table-editor .modal {
    max-width: 95vw;
    margin: 10px;
  }
  
  .table-responsive {
    max-height: 300px;
  }
  
  .table-cell {
    min-width: 80px;
  }
  
  .row-header {
    min-width: 80px;
  }
}

/* Table Management Page Styles */
.table-management .header {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.table-management .header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.table-management .back-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.table-management .back-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.table-management .page-title {
  color: white;
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

.table-management .page-description {
  color: rgba(255, 255, 255, 0.9);
  margin: 0.5rem 0 0 0;
  font-size: 1rem;
}

.table-management-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-management-header .header-content h1 {
  margin: 0;
  color: #1f2937;
  font-size: 1.875rem;
  font-weight: 600;
}

.table-management-header .header-content p {
  margin: 0.5rem 0 0 0;
  color: #6b7280;
  font-size: 1rem;
}

.table-management-header .header-actions {
  display: flex;
  gap: 1rem;
}

.table-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #06b6d4;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
}

.table-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-controls {
  flex: 1;
}

.search-input-group {
  position: relative;
}

.search-input-group .search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.filter-controls {
  min-width: 200px;
}

.view-controls {
  display: flex;
  gap: 0.5rem;
}

.table-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.table-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  overflow: hidden;
}

.table-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.table-title {
  flex: 1;
}

.table-name {
  margin: 0 0 0.5rem 0;
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
}

.table-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.table-size {
  font-weight: 500;
}

.table-cells {
  color: #9ca3af;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.table-card-body {
  padding: 1.5rem;
}

.table-description {
  color: #6b7280;
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.table-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.info-item i {
  width: 1rem;
  color: #9ca3af;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state-icon {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: #374151;
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0 0 2rem 0;
  color: #6b7280;
  font-size: 1rem;
}

/* Table Management Sidebar Styles */
.table-management .sidebar {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-right: 1px solid #e2e8f0;
}

.table-management .sidebar-header h2 {
  color: #1e293b;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.table-management .sidebar-header p {
  font-size: 0.875rem;
  margin: 0;
}

.table-management .sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin: 1rem 0;
}

.table-management .sidebar-tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.table-management .sidebar-tab:hover {
  color: #334155;
  background: rgba(59, 130, 246, 0.05);
}

.table-management .sidebar-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.table-management .sidebar-tab-content {
  display: none;
}

.table-management .sidebar-tab-content.active {
  display: block;
}

.table-management .sidebar-section {
  margin-bottom: 1.5rem;
}

.table-management .sidebar-section h3 {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-management .btn-block {
  width: 100%;
  margin-bottom: 0.5rem;
  justify-content: flex-start;
  text-align: left;
}

.table-management .btn-block i {
  margin-right: 0.5rem;
  width: 1rem;
}

.table-management .form-group {
  margin-bottom: 1rem;
}

.table-management .form-label {
  display: block;
  color: #374151;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-management .form-input,
.table-management .form-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.table-management .form-input:focus,
.table-management .form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Recent Tables and Table Items */
.table-management .recent-table-item,
.table-management .table-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-bottom: 0.25rem;
}

.table-management .recent-table-item:hover,
.table-management .table-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

.table-management .recent-table-item i,
.table-management .table-item i {
  color: #6b7280;
  width: 1rem;
}

.table-management .recent-table-item span,
.table-management .table-item span {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Statistics */
.table-management .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  margin-bottom: 0.5rem;
}

.table-management .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.table-management .stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-management .text-muted {
  color: #9ca3af;
  font-size: 0.875rem;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Content Header */
.table-management .content-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.table-management .content-header .page-title {
  color: #1f2937;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-management .content-header .page-title i {
  color: #3b82f6;
}

.table-management .content-header .page-description {
  color: #6b7280;
  font-size: 1rem;
  margin: 0;
}

/* Responsive table management */
@media (max-width: 768px) {
  .table-management-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .table-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .table-list {
    grid-template-columns: 1fr;
  }
  
  .table-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .table-management .sidebar {
    display: none;
  }
}

/* ===== TABLE SELECTION CONTROLS ===== */
.table-selection-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-selection-controls select {
  flex: 1;
}

.table-selection-controls button {
  flex-shrink: 0;
}

.table-management-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-management-controls a {
  align-self: flex-start;
}

/* ===== BULK IMPORT MANAGER STYLES ===== */

/* Bulk Import Page Layout */
.bulk-import-page {
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-primary-light) 100%);
  min-height: 100vh;
}

.bulk-import-page .header {
  background: var(--color-white-glass-heavy);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-gray-200);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.bulk-import-page .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.bulk-import-page .header-left {
  flex: 1;
}

.bulk-import-page .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}

.bulk-import-page .back-btn:hover {
  color: var(--color-primary);
}

.bulk-import-page .header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0 0 0.5rem 0;
}

.bulk-import-page .header p {
  color: var(--color-gray-600);
  font-size: 1.125rem;
  margin: 0;
}

.bulk-import-page .main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* Upload Section */
.upload-section {
  background: var(--color-white-glass-heavy);
  backdrop-filter: blur(20px);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0 0 0.5rem 0;
}

.section-header p {
  color: var(--color-gray-600);
  margin: 0;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--color-gray-300);
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--color-gray-50);
}

.upload-area:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.upload-area.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: scale(1.02);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-icon {
  font-size: 3rem;
  color: var(--color-gray-400);
  margin-bottom: 0.5rem;
}

.upload-area:hover .upload-icon {
  color: var(--color-primary);
}

.upload-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0;
}

.upload-content p {
  color: var(--color-gray-600);
  margin: 0;
}

.file-select-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.file-select-btn:hover {
  color: var(--color-primary-hover);
}

.upload-requirements {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--color-gray-100);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.upload-requirements small {
  color: var(--color-gray-600);
  font-size: 0.875rem;
}

/* Upload Configuration */
.upload-config {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-gray-50);
  border-radius: 0.75rem;
  border: 1px solid var(--color-gray-200);
}

.config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.config-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.config-item label {
  font-weight: 500;
  color: var(--color-gray-700);
  font-size: 0.875rem;
}

.file-preview {
  padding: 1rem;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-name {
  font-weight: 500;
  color: var(--color-gray-900);
}

.file-size {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.config-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Uploads Section */
.uploads-section {
  background: var(--color-white-glass-heavy);
  backdrop-filter: blur(20px);
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.section-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.filter-controls select {
  min-width: 150px;
}

/* Upload Cards */
.uploads-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Refresh Indicator */
.refresh-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--color-info-light);
  border: 1px solid var(--color-info);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  color: var(--color-info-dark);
  font-size: 0.875rem;
  font-weight: 500;
  animation: pulse 2s infinite;
}

.refresh-indicator i {
  color: var(--color-info);
  font-size: 1rem;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.upload-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.upload-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.upload-info {
  flex: 1;
}

.upload-filename {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 0.5rem;
}

.upload-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.upload-status {
  flex-shrink: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-pending {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
  border: 1px solid var(--color-warning);
}

.status-processing {
  background: var(--color-info-light);
  color: var(--color-info-dark);
  border: 1px solid var(--color-info);
}

.status-completed {
  background: var(--color-success-light);
  color: var(--color-success-dark);
  border: 1px solid var(--color-success);
}

.status-failed {
  background: var(--color-danger-light);
  color: var(--color-danger-dark);
  border: 1px solid var(--color-danger);
}

.status-cancelled {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-300);
}

/* Progress Bar */
.progress-container {
  margin: 1rem 0;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--color-gray-200);
  border-radius: 0.25rem;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  border-radius: 0.25rem;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-top: 0.5rem;
}

/* Upload Stats */
.upload-stats {
  margin: 1rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.stats-simple {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-weight: 600;
  color: var(--color-gray-900);
}

/* Upload Actions */
.upload-card-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-gray-100);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-gray-500);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gray-700);
  margin: 0 0 0.5rem 0;
}

.empty-state p {
  margin: 0;
}

/* Loading State */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--color-gray-600);
  font-size: 0.875rem;
}

.loading-state i {
  font-size: 1.25rem;
}

/* Upload Detail Modal */
.upload-detail {
  max-width: 100%;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.detail-title h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detail-section h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0 0 1rem 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  font-weight: 500;
}

.detail-value {
  font-weight: 600;
  color: var(--color-gray-900);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.timeline-label {
  font-weight: 500;
  color: var(--color-gray-700);
}

.timeline-value {
  color: var(--color-gray-600);
  font-size: 0.875rem;
}

/* Error Message */
.error-message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-danger-light);
  border: 1px solid var(--color-danger);
  border-radius: 0.5rem;
  color: var(--color-danger-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
  .bulk-import-page .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .bulk-import-page .main-content {
    padding: 0 1rem 2rem;
  }

  .config-row {
    grid-template-columns: 1fr;
  }

  .section-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-card-header {
    flex-direction: column;
    gap: 1rem;
  }

  .upload-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .upload-card-actions {
    flex-direction: column;
  }

  .detail-header {
    flex-direction: column;
    gap: 1rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== AGENT STATISTICS MODAL STYLES ===== */
.agent-stats-container {
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
}

.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-info-light));
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-primary);
}

.agent-info h2 {
  margin: 0 0 0.5rem 0;
  color: var(--color-primary-dark);
  font-size: 1.5rem;
  font-weight: 600;
}

.agent-details {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.agent-details span {
  padding: 0.25rem 0.75rem;
  background: var(--color-white);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-200);
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

.agent-status.active {
  background: var(--color-success-light);
  color: var(--color-success-dark);
  border: 1px solid var(--color-success);
}

.agent-status.inactive {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  border: 1px solid var(--color-gray-300);
}

.stats-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--color-white);
  border-radius: 0.75rem;
  border: 1px solid var(--color-gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-section h3 {
  margin: 0 0 1.5rem 0;
  color: var(--color-gray-800);
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.5rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  font-weight: 500;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.comparison-item {
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.comparison-label {
  font-size: 0.875rem;
  color: var(--color-gray-600);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.comparison-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.comparison-bar {
  height: 8px;
  background: var(--color-gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.comparison-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.metric-card {
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
  text-align: center;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.metric-value.positive {
  color: var(--color-success-dark);
}

.metric-value.negative {
  color: var(--color-danger-dark);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--color-gray-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-container {
  margin-top: 1rem;
}

.chart-bars {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  height: 200px;
  padding: 1rem 0;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar {
  width: 100%;
  background: linear-gradient(180deg, var(--color-primary), var(--color-info));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.bar-label {
  font-size: 0.75rem;
  color: var(--color-gray-600);
  margin-top: 0.5rem;
  font-weight: 500;
}

.bar-value {
  font-size: 0.75rem;
  color: var(--color-gray-700);
  margin-top: 0.25rem;
  font-weight: 600;
}

.monthly-stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.monthly-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.month-name {
  font-weight: 600;
  color: var(--color-gray-800);
}

.month-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}

.month-transactions {
  color: var(--color-gray-600);
}

.month-amount {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.product-rank {
  width: 2rem;
  height: 2rem;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.product-info {
  flex: 1;
}

.product-name {
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: 0.25rem;
}

.product-type {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.product-stats {
  text-align: right;
}

.product-amount {
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.25rem;
}

.product-transactions {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.region-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.region-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.region-name {
  font-weight: 600;
  color: var(--color-gray-800);
}

.region-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
}

.region-amount {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.region-transactions {
  color: var(--color-gray-600);
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.transaction-info {
  flex: 1;
}

.transaction-number {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--color-gray-600);
  margin-bottom: 0.25rem;
}

.transaction-product {
  font-weight: 600;
  color: var(--color-gray-800);
}

.transaction-details {
  text-align: right;
}

.transaction-amount {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.transaction-amount.positive {
  color: var(--color-success-dark);
}

.transaction-amount.negative {
  color: var(--color-danger-dark);
}

.transaction-date {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.leaderboard-container h3 {
  margin: 0 0 1.5rem 0;
  color: var(--color-gray-800);
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.leaderboard-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--color-gray-200);
}

.leaderboard-entry:nth-child(1) {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border-color: #f59e0b;
}

.leaderboard-entry:nth-child(2) {
  background: linear-gradient(135deg, #e5e7eb, #f3f4f6);
  border-color: #9ca3af;
}

.leaderboard-entry:nth-child(3) {
  background: linear-gradient(135deg, #fbbf24, #fcd34d);
  border-color: #f59e0b;
}

.rank {
  width: 2rem;
  height: 2rem;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.agent-info {
  flex: 1;
}

.agent-name {
  font-weight: 600;
  color: var(--color-gray-800);
  margin-bottom: 0.25rem;
}

.agent-level {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.agent-stats {
  text-align: right;
}

.sales-amount {
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.25rem;
}

.transactions-count {
  font-size: 0.875rem;
  color: var(--color-gray-600);
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--color-gray-600);
}

.loading-spinner i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--color-gray-600);
}

.error-state i {
  font-size: 3rem;
  color: var(--color-danger);
  margin-bottom: 1rem;
}

.error-state h3 {
  margin: 0 0 1rem 0;
  color: var(--color-danger-dark);
}

.error-state p {
  margin: 0;
  color: var(--color-gray-600);
}

/* Responsive Design for Agent Statistics */
@media (max-width: 768px) {
  .agent-stats-container {
    max-height: 60vh;
    padding: 0.5rem;
  }

  .agent-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .agent-details {
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

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

  .chart-bars {
    height: 150px;
  }

  .product-item {
    flex-direction: column;
    text-align: center;
  }

  .transaction-item {
    flex-direction: column;
    text-align: center;
  }

  .leaderboard-entry {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== HIERARCHY MANAGEMENT AGENT STATISTICS MODAL ===== */
/* Make agent statistics modal wider only in hierarchy management */
.hierarchy-management .modal-overlay#agent-stats-modal .modal {
  width: 80%;
  max-width: 1200px;
  max-height: 90vh;
}

/* Help icon styles for agent statistics */
.help-icon {
  display: inline-block;
  margin-left: 0.5rem;
  cursor: help;
  color: var(--color-info);
  font-size: 0.9em;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  position: relative;
}

.help-icon:hover {
  opacity: 1;
}

.help-icon i {
  font-size: 0.9em;
}

/* CSS-only tooltip for help icons */
.help-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1a1a1a;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  white-space: normal;
  min-width: 250px;
  max-width: 400px;
  width: auto;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3), 0 4px 8px -2px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.help-icon::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1a1a;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.help-icon:hover::after,
.help-icon:hover::before {
  opacity: 1;
  visibility: visible;
}

.hierarchy-management .modal-overlay#agent-stats-modal .modal.modal-lg {
  width: 80%;
  max-width: 1200px;
}

/* Ensure the modal content is scrollable */
.hierarchy-management .modal-overlay#agent-stats-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Responsive adjustments for agent statistics modal */
@media (max-width: 1200px) {
  .hierarchy-management .modal-overlay#agent-stats-modal .modal {
    width: 90%;
    max-width: 1000px;
  }
}

@media (max-width: 768px) {
  .hierarchy-management .modal-overlay#agent-stats-modal .modal {
    width: 95%;
    max-width: none;
    margin: 1rem;
  }
}

/* ===== BULK IMPORT MAPPING STYLES ===== */
.mapping-container {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mapping-info {
  width: 100%;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 8px;
  border-left: 4px solid var(--color-primary);
}

.mapping-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.mapping-info p {
  margin: 0;
  color: var(--color-gray-700);
  font-size: 0.9rem;
}

.mapping-table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--color-gray-200);
}

.mapping-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-white);
}

.mapping-table th {
  background: var(--color-gray-50);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-200);
  font-size: 0.875rem;
}

.mapping-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-gray-100);
  vertical-align: middle;
}

.mapping-table tr:last-child td {
  border-bottom: none;
}

.mapping-table tr:hover {
  background: var(--color-gray-50);
}

.mapping-field-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.mapping-field-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.mapping-type-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 4px;
  font-size: 0.875rem;
  background: var(--color-white);
  cursor: pointer;
}

.mapping-required-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.mapping-csv-header {
  font-weight: 500;
  color: var(--color-gray-800);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
}

.mapping-suggestion {
  font-size: 0.75rem;
  color: var(--color-gray-500);
  margin-top: 0.25rem;
  font-style: italic;
}

.mapping-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.mapping-auto-suggest-btn {
  padding: 0.25rem 0.5rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mapping-auto-suggest-btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.mapping-auto-suggest-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mapping modal specific styles */
#bulk-import-mapping-modal .modal {
  max-width: 1200px;
  width: 95vw;
}

#bulk-import-mapping-modal .modal-body {
  max-height: 80vh;
  overflow-y: auto;
}

/* Available Fields Section */
.available-fields-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-gray-50);
  border-radius: 8px;
  border: 1px solid var(--color-gray-200);
}

.available-fields-section h4 {
  margin: 0 0 1rem 0;
  color: var(--color-gray-700);
  font-size: 1rem;
  font-weight: 600;
}

.available-fields-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 60px;
  padding: 0.5rem;
  border: 2px dashed var(--color-gray-300);
  border-radius: 6px;
  background: var(--color-white);
}

.field-token {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: grab;
  user-select: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.field-token:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.field-token:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.field-token.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.field-token .field-type {
  font-size: 0.75rem;
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.375rem;
  border-radius: 10px;
}

.field-token .remove-btn {
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 0.125rem;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background-color 0.2s ease;
}

.field-token .remove-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Drop zones */
.drop-zone {
  min-height: 40px;
  padding: 0.5rem;
  border: 2px dashed var(--color-gray-300);
  border-radius: 6px;
  background: var(--color-gray-50);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.drop-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  transform: scale(1.02);
}

.drop-zone.has-field {
  border-color: var(--color-success);
  background: var(--color-success-light);
  border-style: solid;
}

.drop-zone .drop-hint {
  color: var(--color-gray-500);
  font-size: 0.875rem;
  font-style: italic;
}

.drop-zone .field-token {
  margin: 0;
}

/* Drag and drop states */
.dragging-over {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.mapping-table .drop-zone {
  width: 100%;
  min-height: 50px;
}

/* Responsive mapping table */
@media (max-width: 768px) {
  .mapping-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mapping-table-container {
    font-size: 0.8rem;
  }
  
  .mapping-table th,
  .mapping-table td {
    padding: 0.5rem;
  }
  
  .available-fields-container {
    min-height: 40px;
  }
  
  .field-token {
    font-size: 0.8rem;
    padding: 0.375rem 0.5rem;
  }
}

/* Decision Engine Execution Type Styles */
.execution-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.execution-type-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
}

.execution-type-option:hover {
  border-color: #3b82f6;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.execution-type-option.selected {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.execution-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-right: 1rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  color: #6b7280;
  font-size: 1.25rem;
}

.execution-type-option.selected .execution-type-icon {
  background: #3b82f6;
  color: #ffffff;
}

.execution-type-content {
  flex: 1;
}

.execution-type-label {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.execution-type-description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

/* Aggregation Frequency Grid Styles */
.aggregation-frequency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.aggregation-frequency-option {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
}

.aggregation-frequency-option:hover {
  border-color: #10b981;
  background: #f0fdf4;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.aggregation-frequency-option.selected {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.aggregation-frequency-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 0.75rem;
  background: #f3f4f6;
  border-radius: 0.375rem;
  color: #6b7280;
  font-size: 1rem;
}

.aggregation-frequency-option.selected .aggregation-frequency-icon {
  background: #d1fae5;
  color: #10b981;
}

.aggregation-frequency-content {
  flex: 1;
}

.aggregation-frequency-title {
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.aggregation-frequency-option.selected .aggregation-frequency-title {
  color: #047857;
}

.aggregation-frequency-description {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.3;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .execution-type-grid {
    grid-template-columns: 1fr;
  }
  
  .execution-type-option {
    padding: 0.75rem;
  }
  
  .execution-type-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.75rem;
    font-size: 1rem;
  }
}

/* Decision Engine Token Library Styles */
.decision-engine .sidebar-section {
  margin-bottom: 1.5rem;
}

.decision-engine .sidebar-section h3 {
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.decision-engine .section-description {
  color: #6b7280;
  font-size: 0.75rem;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

/* Token Categories */
.token-category {
  margin-bottom: 1.5rem;
}

.token-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.token-category-header:hover {
  color: #3b82f6;
}

.token-category-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.token-category-toggle {
  color: #9ca3af;
  transition: transform 0.2s ease;
}

.token-category.collapsed .token-category-toggle {
  transform: rotate(-90deg);
}

.token-category-content {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.token-category.collapsed .token-category-content {
  display: none;
}

/* Individual Token Items */
.token-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
}

.token-item:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.token-item:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.token-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.token-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: #3b82f6;
  color: white;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.token-content {
  flex: 1;
  min-width: 0;
}

.token-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
  margin: 0;
  line-height: 1.2;
}

.token-description {
  font-size: 0.7rem;
  color: #6b7280;
  margin: 0.125rem 0 0 0;
  line-height: 1.3;
}

.token-type {
  font-size: 0.65rem;
  color: #9ca3af;
  background: rgba(156, 163, 175, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Token Badges */
.token-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.token-badge {
  font-size: 0.6rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.token-badge.badge-primary {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.token-badge.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.token-badge.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.token-badge.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

/* Rule Variables Mapping Styles */
.rule-variables-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

.rule-variables-section h4 {
  margin: 0 0 1rem 0;
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
}

.rule-variable-group {
  margin-bottom: 1.5rem;
}

.rule-variable-group:last-child {
  margin-bottom: 0;
}

.group-title {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Removed required/optional group title styles since we're not using them */

.variable-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-variable-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.rule-variable-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.variable-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 1rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  color: #6b7280;
  font-size: 1rem;
}

.rule-variable-item .variable-icon i.fa-puzzle-piece {
  color: #10b981;
}

.variable-content {
  flex: 1;
  margin-right: 1rem;
}

.variable-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.variable-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.variable-type {
  font-size: 0.75rem;
  color: #9ca3af;
  background: rgba(156, 163, 175, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  display: inline-block;
}

.required-badge {
  font-size: 0.65rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  margin-left: 0.5rem;
}

.variable-mapping {
  min-width: 200px;
}

.mapping-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.mapping-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mapping-input::placeholder {
  color: #9ca3af;
}

/* Drag and Drop Styles */
.rule-variable-item[data-drop-target="true"] {
  transition: all 0.2s ease;
}

.rule-variable-item.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.mapped-token-display {
  min-width: 200px;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #d1d5db;
  border-radius: 0.375rem;
  background: #f9fafb;
  transition: all 0.2s ease;
}

.rule-variable-item.drag-over .mapped-token-display {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.no-token-mapped {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.875rem;
}

.mapped-token {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  width: 100%;
}

.mapped-token .token-name {
  flex: 1;
  font-weight: 500;
  color: #1f2937;
}

.remove-mapping-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: #ef4444;
  color: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.remove-mapping-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.remove-mapping-btn:active {
  transform: scale(0.95);
}

.no-variables {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-style: italic;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px dashed #d1d5db;
}

/* Execution Cards Styles */
.execution-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.execution-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.execution-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
}

.execution-info {
  flex: 1;
  min-width: 0;
}

.execution-name {
  margin: 0 0 0.75rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.execution-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.execution-type,
.execution-rule,
.execution-date {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.execution-type {
  font-weight: 500;
  color: #374151;
}

.execution-rule {
  color: #6b7280;
}

.execution-date {
  color: #9ca3af;
  font-size: 0.8125rem;
}

.execution-status {
  flex-shrink: 0;
  margin-left: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-badge.processing {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.status-badge.completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-badge.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.status-badge.cancelled {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.execution-progress {
  padding: 1rem;
  background: #f8fafc;
  border-top: 1px solid #f3f4f6;
}

.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
}

/* Execution Statistics */
.execution-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #f3f4f6;
}

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

.stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.stat-value.primary {
  color: #3b82f6;
}

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

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

.stat-value.info {
  color: #0891b2;
}

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

.stat-value.secondary {
  color: #6b7280;
}

/* Rule Outcome Cells */
.rule-outcome-cell {
  text-align: center;
  vertical-align: middle;
}

.rule-outcome-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
}

/* Result Details Modal */
.result-details-modal {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.result-details-section {
  margin-bottom: 2rem;
}

.result-details-section h4 {
  margin-bottom: 1rem;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-item label {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.875rem;
}

.detail-item span {
  color: #1f2937;
}

/* Rule Chain Details */
.rule-chain-details {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rule-execution-detail {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  background: #f9fafb;
}

.rule-execution-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.rule-execution-header h5 {
  margin: 0;
  color: #1f2937;
  font-size: 1rem;
}

.rule-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
}

.rule-status-badge.success {
  background: #dcfce7;
  color: #166534;
}

.rule-status-badge.failure {
  background: #fee2e2;
  color: #dc2626;
}

.rule-status-badge.warning {
  background: #fef3c7;
  color: #d97706;
}

.rule-execution-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-outcome,
.rule-timing,
.rule-error {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.rule-outcome:last-child,
.rule-timing:last-child,
.rule-error:last-child {
  border-bottom: none;
}

.rule-outcome label,
.rule-timing label,
.rule-error label {
  font-weight: 500;
  color: #6b7280;
  font-size: 0.875rem;
}

.rule-outcome-value {
  font-weight: 600;
  color: #1f2937;
}

.error-message {
  color: #dc2626;
  font-style: italic;
}

/* Rule Column Headers */
.rule-column-header {
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
  text-align: center;
  padding: 12px 8px;
  border-left: 1px solid #e1e5e9;
  border-right: 1px solid #e1e5e9;
  white-space: nowrap;
  min-width: 120px;
}

/* Rule Chain Outcome Styling */
.rule-chain-outcome-number {
  color: #1d4ed8;
  font-weight: 600;
}

.rule-chain-outcome-success {
  color: #059669;
  font-weight: 600;
}

.rule-chain-outcome-failure {
  color: #dc2626;
  font-weight: 600;
}

.rule-chain-outcome-failed {
  color: #dc2626;
  font-weight: 600;
}

.rule-chain-outcome-skipped {
  color: #6b7280;
  font-weight: 600;
}

.rule-chain-outcome-text {
  color: #1f2937;
  font-weight: 500;
}

.rule-chain-outcome-unknown {
  color: #6b7280;
  font-style: italic;
}

/* Execution Period */
.execution-period {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid #f3f4f6;
}

.period-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.period-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #3b82f6;
}

.execution-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #f3f4f6;
}

.execution-actions .btn {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.execution-actions .btn-secondary {
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.execution-actions .btn-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.execution-actions .btn-danger {
  background: #ef4444;
  color: #ffffff;
  border: 1px solid #dc2626;
}

.execution-actions .btn-danger:hover {
  background: #dc2626;
  border-color: #b91c1c;
}

.execution-actions .btn-success {
  background: #10b981;
  color: #ffffff;
  border: 1px solid #059669;
}

.execution-actions .btn-success:hover {
  background: #059669;
  border-color: #047857;
}

/* Empty State */
.executions-empty {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
}

.executions-empty i {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.executions-empty h3 {
  margin: 0 0 0.5rem 0;
  color: #374151;
}

.executions-empty p {
  margin: 0;
  font-size: 0.875rem;
}

/* Canvas View Switching */
.canvas-view {
  display: none;
}

.canvas-view.active {
  display: block;
}

/* History View Stats */
.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  flex-shrink: 0;
}

.stat-card:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

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

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

/* Executions Container */
.executions-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.executions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.executions-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

/* Extra Large Modal */
.modal-xl {
  max-width: 95vw !important;
  width: 95vw !important;
  max-height: 95vh !important;
}

.modal-xl .modal-body {
  max-height: calc(95vh - 200px);
  overflow-y: auto;
}

/* Results Modal Header */
.modal-title-section {
  flex: 1;
}

.modal-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Export Buttons */
.btn-outline {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.btn-outline i {
  font-size: 0.875rem;
}

/* Results Summary */
.results-summary {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.summary-stat {
  text-align: center;
}

.summary-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.25rem;
}

.summary-stat-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

/* Results Table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.results-table th {
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
  z-index: 10;
}

.results-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.results-table tbody tr:hover {
  background: #f9fafb;
}

.results-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.results-table tbody tr:nth-child(even):hover {
  background: #f9fafb;
}

/* Outcome Badges */
.outcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.outcome-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.outcome-badge.failure {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.outcome-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* Score Display */
.score-value {
  font-weight: 600;
  color: #111827;
}

.score-value.high {
  color: #10b981;
}

.score-value.medium {
  color: #f59e0b;
}

.score-value.low {
  color: #ef4444;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}

.modal-footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-count {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

/* Decision Engine Notification Overrides */
.decision-engine .notification-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 9999 !important;
}

.decision-engine .notification {
  position: relative !important;
  transform: translateX(0) !important;
  opacity: 1 !important;
}

/* Decision Engine Main Content Styles */
.decision-engine .main-canvas {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%);
  backdrop-filter: blur(20px);
}

.decision-engine .canvas-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.decision-engine .canvas-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.decision-engine .canvas-title i {
  font-size: 1.5rem;
}

.decision-engine .canvas-actions {
  margin-top: 1rem;
}

/* Decision Steps */
.decision-step {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.decision-step .step-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.decision-step .step-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.decision-step .step-header i {
  color: #3b82f6;
}

.decision-step .step-content {
  padding: 1.5rem;
}

/* Config Sections */
.config-section {
  margin-bottom: 1.5rem;
}

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

.config-section .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.config-section .form-input,
.config-section .form-select,
.config-section .form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: white;
}

.config-section .form-input:focus,
.config-section .form-select:focus,
.config-section .form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.config-section .form-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.config-section .form-hint a {
  color: #3b82f6;
  text-decoration: none;
}

.config-section .form-hint a:hover {
  text-decoration: underline;
}

/* Date Range Inputs */
.date-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.date-range-inputs .form-group {
  margin-bottom: 0;
}

.date-range-inputs .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
}

/* Agent Selection */
.agent-selection-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
}

.agent-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: white;
}

.agent-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;
}

.agent-list-item:last-child {
  border-bottom: none;
}

.agent-list-item:hover {
  background: #f8fafc;
}

.agent-list-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
}

.agent-info {
  flex: 1;
}

.agent-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin: 0;
}

.agent-details {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0.125rem 0 0 0;
}

/* Product Filters */
.product-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.product-filters .form-group {
  margin-bottom: 0;
}

/* Results Section */
.results-section {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.results-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.results-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-content {
  padding: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .decision-engine .canvas-header {
    padding: 1rem;
  }
  
  .decision-engine .step-content {
    padding: 1rem;
  }
  
  .date-range-inputs {
    grid-template-columns: 1fr;
  }
  
  .product-filters {
    grid-template-columns: 1fr;
  }
  
  .token-category-content {
    gap: 0.375rem;
  }
  
  .token-item {
    padding: 0.375rem 0.5rem;
  }
}

/* Results summary grid layout */
.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary-stat {
  text-align: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.summary-stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.summary-stat-value.success {
  color: #28a745;
}

.summary-stat-value.danger {
  color: #dc3545;
}

.summary-stat-value.warning {
  color: #ffc107;
}

.summary-stat-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

/* Pagination controls */
.results-pagination {
  margin-top: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #e9ecef;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

.pagination-controls .btn {
  min-width: 100px;
}

.pagination-controls .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
