/* ======================================== */
/* MODERN DESIGN SYSTEM - SCHEMAMIND THEME */
/* ======================================== */

/* ==== Core Variables ==== */
:root {
  /* Primary Colors */
  --primary-dark: #0A1929;
  --primary: #1E3A8A;
  --primary-light: #3B82F6;
  --accent: #10B981;
  --accent-light: #34D399;
  
  /* Neutral Colors */
  --bg-primary: #F8FAFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F1F5F9;
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  
  /* Text Colors */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-disabled: #94A3B8;
  
  /* Status Colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  
  /* 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);
  
  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==== Global Reset ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
}

body {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg-primary);
}

/* ==== Typography ==== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
}

/* ==== Scrollbar Styling ==== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==== Sidebar ==== */
.sidebar {
  width: 260px;
  background: #05285f;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transition: var(--transition-base);
  color: #FFFFFF;
  overflow-y: auto;
  flex-shrink: 0;
}

/* Logo Section */
.logo {
  padding: 28px 24px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.logo-image {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.logo-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.logo-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  text-align: center;
  letter-spacing: 0.3px;
}

/* Navigation Menu */
.blades {
  flex: 1;
  padding: 8px 12px;
}

.blade-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  transition: var(--transition-fast);
  margin-bottom: 4px;
  cursor: pointer;
}

.blade-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(4px);
}

.blade-item.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent);
  border-left: 3px solid var(--accent);
}

.blade-item i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

/* ==== Main Content ==== */
.main-content {
  flex: 1;
  background: var(--bg-primary);
  overflow-y: auto;
  padding: 24px 32px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  background: var(--bg-secondary);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
}

.user-info i {
  font-size: 1rem;
}

/* ==== Cards ==== */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  transition: var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px;
  background: var(--bg-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.card-header h3 {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 i {
  color: var(--accent);
  font-size: 1.25rem;
}

.header-actions button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
}

.header-actions button:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==== Content Panels ==== */
.content-panel {
  display: none;
  flex: 1;
  animation: fadeIn var(--transition-base);
}

.content-panel.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==== Filter Section ==== */
.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.filter-chip:hover {
  background: var(--border-light);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.filter-stats {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==== Tables ==== */
.plans-table, .table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  flex: 1;
}

.plans-table th, .table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.plans-table td, .table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  color: var(--text-primary);
}

.plans-table tr:hover, .table tr:hover {
  background: var(--bg-tertiary);
  cursor: pointer;
}

/* Status Badges */
.status-badge, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.status-active, .badge-success {
  background: var(--success-light);
  color: var(--success);
}

.status-draft, .badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-info {
  background: var(--info-light);
  color: var(--info);
}

.badge-error {
  background: var(--error-light);
  color: var(--error);
}

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition-fast);
  border: none;
  outline: none;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-light);
}

.btn-success {
  background: var(--success);
  color: #FFFFFF;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--error);
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-light);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-md);
}

.btn i {
  font-size: 1rem;
}

/* ==== Fixed Actions ==== */
.content-actions, .fixed-actions {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  gap: 12px;
  z-index: 100;
  background: var(--bg-secondary);
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

/* ==== Forms ==== */
.form-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.form-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section h4 i {
  color: var(--accent);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-group.required label::after {
  content: "*";
  color: var(--error);
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-disabled);
}

.form-control[readonly] {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.form-actions-center {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ==== Loading & Empty States ==== */
.loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-state i {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--accent);
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.875rem;
}

/* ==== Source Plan Configuration ==== */
.source-plan-preview {
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-header {
  padding: 24px 32px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-header h3 {
  color: #FFFFFF;
  font-size: 1.25rem;
  margin: 0;
}

.preview-status-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 32px;
}

.preview-badge {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.preview-badge.bg-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.preview-badge.bg-success {
  background: var(--success);
  color: #FFFFFF;
}

.preview-description {
  margin: 0 32px 24px;
  padding: 16px 20px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.preview-sources-section {
  padding: 0 32px 32px;
}

.preview-source-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  transition: var(--transition-fast);
}

.preview-source-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.preview-source-header {
  padding: 16px 20px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
}

.preview-source-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.125rem;
}

.preview-source-icon.excel,
.source-icon.excel {
  background: linear-gradient(135deg, var(--success), #059669);
}

.preview-source-icon.database,
.source-icon.database {
  background: linear-gradient(135deg, var(--info), #2563EB);
}

.preview-source-icon.azure,
.source-icon.azure {
  background: linear-gradient(135deg, #0078D4, #106EBE);
}

.preview-source-icon.s3,
.source-icon.s3 {
  background: linear-gradient(135deg, #FF9900, #E67C00);
}

.preview-source-body {
  padding: 20px;
}

.preview-columns,
.preview-metadata-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.preview-badge-sm {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* Source Icons */
.source-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.source-icon.json {
  background: linear-gradient(135deg, var(--warning), #D97706);
}

.source-icon.csv {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
}

.source-icon.parquet {
  background: linear-gradient(135deg, #EC4899, #DB2777);
}

.source-icon.pdf {
  background: linear-gradient(135deg, var(--error), #DC2626);
}

.source-icon.odata {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
}

.source-icon.file {
  background: linear-gradient(135deg, var(--text-muted), #475569);
}

/* ==== Source/Destination Sections ==== */
.source-section,
.destination-section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  background: var(--bg-secondary);
  overflow: hidden;
}

.source-section-header,
.destination-section-header {
  padding: 16px 20px;
  background: var(--bg-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

.source-section-header:hover,
.destination-section-header:hover {
  background: var(--border-light);
}

.source-section-header h4,
.destination-section-header h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-section-body,
.destination-section-body {
  padding: 20px;
}

.source-types,
.destination-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.source-type-option,
.destination-type-option {
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
}

.source-type-option:hover,
.destination-type-option:hover {
  border-color: var(--primary-light);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.source-type-option.selected,
.destination-type-option.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.source-type-option i,
.destination-type-option i {
  font-size: 1.5rem;
  color: var(--primary-light);
}

.source-type-label,
.destination-type-label {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-primary);
}

.source-config-form,
.destination-config-form {
  margin-top: 20px;
}

/* ==== Modals ==== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn var(--transition-fast);
}

.modal-dialog {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition-base);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.btn-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==== Execution Panel ==== */
.execution-right-panel-overlay {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: right var(--transition-base);
}

.execution-right-panel-overlay.open {
  right: 0;
}

.execution-right-panel-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.execution-panel-header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-tertiary);
}

.execution-panel-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.execution-panel-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

.execution-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.execution-panel-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-tertiary);
}

/* ==== Query Plan Details ==== */
.query-plan-details {
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
}

.query-plan-details .form-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.query-plan-details .form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.query-plan-details .form-group > div:not(.readonly-box) {
  font-size: 0.875rem;
  padding: 4px 0;
  color: var(--text-primary);
  word-break: break-all;
}

.query-plan-details .readonly-box {
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 10px 12px;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  resize: vertical;
  min-height: 80px;
}

/* ==== Tabs ==== */
.plan-tabs {
  display: flex;
  gap: 8px;
  padding: 20px 24px 0;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-wrap: wrap;
}

.tab-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition-fast);
  cursor: pointer;
}

.tab-chip:hover {
  background: var(--border-light);
  transform: translateY(-1px);
}

.tab-chip.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.tab-chip i {
  font-size: 1rem;
}

.tab-pane {
  display: none;
  padding: 24px;
}

.tab-pane.active {
  display: block;
  animation: fadeIn var(--transition-fast);
}

/* ==== Graph Nodes ==== */
.graph-node {
  transition: var(--transition-fast);
  cursor: pointer;
}

.graph-node:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.graph-node.selected {
  box-shadow: 0 0 0 3px var(--primary-light), var(--shadow-md);
  z-index: 10;
}

/* ==== Detail View Tabs ==== */
.detail-view-tabs {
  margin: 20px 0;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.detail-tab-chip {
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-light);
}

.detail-tab-chip.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.detail-tab-chip:hover:not(.active) {
  background: var(--border-light);
  transform: translateY(-1px);
}

/* ==== Destination Autocomplete ==== */
.destination-autocomplete {
  position: relative;
  width: 100%;
}

.destination-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.destination-option {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

.destination-option:hover,
.destination-option.selected {
  background: var(--bg-tertiary);
  color: var(--primary-light);
}

.destination-option:last-child {
  border-bottom: none;
}

/* ==== View Toggle ==== */
.view-toggle {
  margin-bottom: 20px;
  display: flex;
  gap: 8px;
}

.view-toggle .view-btn {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  line-height: 1.4;
  transition: var(--transition-fast);
  cursor: pointer;
  font-weight: 500;
}

.view-toggle .view-btn:hover:not(.active) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--primary-light);
}

.view-toggle .view-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* ==== Data Sources List ==== */
.data-sources-list {
  margin-bottom: 20px;
}

.source-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition-fast);
}

.source-item:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.source-item-header {
  padding: 14px 20px;
  background: var(--bg-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.source-item-header i {
  font-size: 1rem;
  color: var(--primary-light);
  margin-right: 8px;
}

.source-card-body {
  padding: 20px;
  max-height: 300px;
  overflow-y: auto;
  transition: all var(--transition-base);
}

.source-item.expanded .source-card-body {
  max-height: none;
}

/* ==== File/Sheet Items ==== */
.file-item,
.sheet-item,
.column-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  background: var(--bg-secondary);
  transition: var(--transition-fast);
}

.file-item:hover,
.sheet-item:hover,
.column-item:hover {
  border-color: var(--primary-light);
  background: var(--bg-tertiary);
}

.file-item input,
.sheet-item input,
.column-item input {
  flex: 1;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.file-item i,
.sheet-item i,
.column-item i {
  font-size: 0.875rem;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
}

.source-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  margin-right: 8px;
  cursor: pointer;
}

/* ==== Action Buttons ==== */
.test-connection-btn,
.preview-data-btn {
  background: var(--success);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.test-connection-btn:hover,
.preview-data-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.preview-data-btn {
  background: var(--info);
}

.preview-data-btn:hover {
  background: #2563EB;
}

.btn-remove-circle {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--error);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-remove-circle:hover {
  background: #DC2626;
  transform: scale(1.05);
}

/* ==== Stats Cards ==== */
.sources-stats,
.stat-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  text-align: center;
  transition: var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.stat-card h4 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ==== Plan Info ==== */
.plan-info-header {
  padding: 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.plan-overview-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.info-field {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-field label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-field span {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* ==== Destination Preview ==== */
.destination-preview-large {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
}

/* ==== Responsive Design ==== */
@media (max-width: 1024px) {
  .main-content {
    padding: 20px 24px;
  }
  
  .card-body {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 72px;
  }
  
  .logo h1, 
  .logo small, 
  .blade-item span {
    display: none;
  }
  
  .logo-text {
    display: none;
  }
  
  .logo-container {
    padding: 12px;
  }
  
  .blade-item {
    justify-content: center;
    padding: 12px;
    margin-bottom: 8px;
  }
  
  .blade-item i {
    font-size: 1.25rem;
    margin: 0;
  }
  
  .main-content {
    padding: 16px;
  }
  
  .header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .header h2 {
    font-size: 1.25rem;
  }
  
  .card-header {
    padding: 16px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .card-body {
    padding: 16px;
  }
  
  .filter-section {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding: 16px;
  }
  
  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  
  .plans-table th, 
  .plans-table td,
  .table th,
  .table td {
    padding: 10px 12px;
    font-size: 0.75rem;
  }
  
  .btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  
  .content-actions,
  .fixed-actions {
    bottom: 16px;
    right: 16px;
    flex-direction: column;
    gap: 8px;
  }
  
  .source-types,
  .destination-types {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .source-type-option,
  .destination-type-option {
    padding: 12px;
  }
  
  .modal-dialog {
    width: 95%;
    margin: 16px;
  }
  
  .execution-right-panel-overlay {
    width: 100%;
    right: -100%;
  }
  
  .plan-tabs {
    padding: 16px;
  }
  
  .tab-chip {
    padding: 8px 16px;
    font-size: 0.75rem;
  }
  
  .detail-tab-chip {
    padding: 8px 20px;
    font-size: 0.75rem;
  }
  
  .preview-header {
    padding: 20px;
  }
  
  .preview-chips,
  .preview-sources-section {
    margin: 20px;
  }
  
  .plan-overview-main {
    grid-template-columns: 1fr;
  }
  
  .sources-stats {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 12px;
  }
  
  .card-body {
    padding: 12px;
  }
  
  .form-section {
    padding: 16px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-control {
    padding: 8px 10px;
  }
  
  .btn {
    padding: 6px 10px;
  }
  
  .source-type-option i,
  .destination-type-option i {
    font-size: 1.25rem;
  }
}