/* ===================================================================
   NL Query Bar — Natural Language Chart Generation
   =================================================================== */

/* Dark overlay behind bar */
.nl-query-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1099;
  animation: nl-overlay-in 0.2s ease;
}

.nl-query-overlay.nl-visible {
  display: block;
}

@keyframes nl-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Floating Bar */
.nl-query-bar {
  position: fixed;
  top: 28%;
  left: 25%;
  right: 25%;
  z-index: 1100;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 10px;
  animation: nl-bar-in 0.2s ease;
}

@keyframes nl-bar-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nl-query-bar.nl-visible {
  display: flex;
}

.nl-query-icon {
  font-size: 20px;
  flex-shrink: 0;
  color: #6366f1;
}

.nl-query-input {
  flex: 1;
  border-radius: 8px;
  padding: 8px 14px;
  border: 1.5px solid #6366f1;
  font-size: 14px;
  outline: none;
  background: #f8faff;
  color: #1e293b;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nl-query-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: #fff;
}

.nl-query-input::placeholder {
  color: #94a3b8;
}

.nl-query-submit-btn {
  padding: 8px 16px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  position: relative;
}

.nl-query-submit-btn:hover {
  background: #4f46e5;
}

.nl-query-submit-btn:disabled {
  background: #a5b4fc;
  cursor: not-allowed;
}

/* Animierter Farbverlauf-Rahmen während Analyse läuft */
.nl-query-submit-btn.analyzing::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #4facfe, #667eea);
  background-size: 300% 300%;
  border-radius: 10px;
  z-index: -1;
  animation: gradient-border 2s linear infinite;
}

@keyframes gradient-border {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.nl-query-shortcut-hint {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Phase 3 — Interactive trigger hint (shown next to submit when query matches) */
.nl-query-interactive-hint {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: nl-hint-pop 0.25s ease-out;
  cursor: help;
}

@keyframes nl-hint-pop {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

.nl-query-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.nl-query-close-btn:hover {
  color: #475569;
}

/* Agent Mode Toggle (Auto / One-Step / Multi-Step) */
.nl-query-mode-toggle {
  display: flex;
  gap: 0;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.nl-query-mode-toggle .mode-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.nl-query-mode-toggle .mode-btn:hover {
  color: #475569;
  background: rgba(255, 255, 255, 0.6);
}

.nl-query-mode-toggle .mode-btn.active {
  background: #ffffff;
  color: #6366f1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Loading spinner inside input area */
.nl-query-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e0e7ff;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: nl-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ===================================================================
   Preview Card
   =================================================================== */

.nl-query-preview {
  position: fixed;
  top: calc(28% + 58px);
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
  z-index: 1200;
  animation: nl-preview-in 0.15s ease;
}

@keyframes nl-preview-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nl-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.nl-preview-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.nl-confidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.nl-confidence-high {
  background: #dcfce7;
  color: #15803d;
}

.nl-confidence-medium {
  background: #fef9c3;
  color: #854d0e;
}

.nl-confidence-low {
  background: #fee2e2;
  color: #991b1b;
}

.nl-preview-canvas {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  background: #f8faff;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

.nl-preview-meta {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 14px;
  line-height: 1.5;
}

.nl-preview-meta strong {
  color: #475569;
}

.nl-preview-alternatives {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.nl-alt-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8faff;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.nl-alt-btn:hover {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4f46e5;
}

.nl-preview-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.nl-btn-primary {
  padding: 8px 18px;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.nl-btn-primary:hover {
  background: #4f46e5;
}

.nl-btn-secondary {
  padding: 8px 14px;
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.nl-btn-secondary:hover {
  border-color: #94a3b8;
  color: #334155;
}

/* Error state */
.nl-preview-error {
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
  margin-bottom: 14px;
}

/* Success state */
.nl-preview-success {
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #667eea;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 14px;
}

/* Active filter tags in preview */
.nl-preview-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.nl-filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 12px;
  color: #1d4ed8;
  font-weight: 500;
}

/* No-dataset warning */
.nl-no-dataset-hint {
  font-size: 12px;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Canvas wrapper - main container for grid view */
.canvas-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  width: 100%;
  height: calc(100vh - 140px);
  overflow: hidden;
  background: #f5f6fa;
  position: relative;
  z-index: 1;
  transition: grid-template-columns 0.3s ease;
}

.canvas-wrapper.left-collapsed {
  grid-template-columns: 0 1fr 320px;
}

.canvas-wrapper.right-collapsed {
  grid-template-columns: 280px 1fr 0;
}

.canvas-wrapper.both-collapsed {
  grid-template-columns: 0 1fr 0;
}

/* Dataset panel sidebar - left sidebar */
.dataset-panel-sidebar {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid #e1e4e8;
  border-top: 1px solid #e1e4e8;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.dataset-panel-sidebar.collapsed {
  opacity: 0;
  overflow: hidden;
}

.canvas-layout-left-sidebar {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid #e1e4e8;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}

.canvas-layout-left-sidebar.collapsed {
  transform: translateX(-280px);
  margin-right: -280px;
}

/* Canvas container - main chart area */
.canvas-container {
  flex: 1;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #f5f6fa;
}

/* Table container specific styles */
.chart-container.table-container {
  display: flex;
  flex-direction: column;
}

.chart-container.table-container .table-content-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  gap: 0;
}

/* Canvas Table View Container */
.canvas-table-view-container {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  gap: 0;
}

.canvas-full-table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  gap: 0;
}

.canvas-full-table-container #data-table,
.canvas-full-table-container #canvas-data-table,
.canvas-full-table-container #split-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 0;
  padding: 0;
}

.canvas-full-table-container #data-table thead,
.canvas-full-table-container #canvas-data-table thead,
.canvas-full-table-container #split-data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  margin: 0;
  padding: 0;
}

.canvas-full-table-container #data-table th,
.canvas-full-table-container #canvas-data-table th,
.canvas-full-table-container #split-data-table th {
  background: transparent;
  color: #334155;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

.canvas-full-table-container #data-table td,
.canvas-full-table-container #canvas-data-table td,
.canvas-full-table-container #split-data-table td {
  padding: 6px 10px;
  font-size: 0.8125rem;
  border-bottom: 1px solid #e1e4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.canvas-full-table-container #data-table tbody tr:nth-child(even),
.canvas-full-table-container #canvas-data-table tbody tr:nth-child(even),
.canvas-full-table-container #split-data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.canvas-full-table-container #data-table tbody tr:hover,
.canvas-full-table-container #canvas-data-table tbody tr:hover,
.canvas-full-table-container #split-data-table tbody tr:hover {
  background: #e6f7ff;
}

/* Canvas Table Toolbar */
.canvas-table-toolbar {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e1e4e8;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
}

.table-control-btn {
  padding: 8px 16px;
  border: 1px solid #e1e4e8;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fa 100%);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #24292e;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.table-control-btn:hover {
  background: linear-gradient(180deg, #f6f8fa 0%, #e9ecef 100%);
  border-color: #0969da;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.table-control-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.canvas-table-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #24292e;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.canvas-table-toolbar label:hover {
  background: #f6f8fa;
}

.canvas-table-toolbar input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.canvas-table-toolbar input[type="text"] {
  padding: 8px 12px;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  font-size: 13px;
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  transition: all 0.2s;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.canvas-table-toolbar input[type="text"]:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.table-view-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 16px;
  color: #6b7280;
}

.table-view-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
}

.table-view-empty .empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.table-view-empty .empty-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.table-view-empty .empty-text {
  font-size: 14px;
  color: #6b7280;
}

.canvas-toolbar-btn.active {
  background-color: #e0e7ff;
  border-color: #818cf8;
  color: #4338ca;
  font-weight: 600;
}

/* Canvas Toolbar */
.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid #e1e4e8;
  min-height: 48px;
  gap: 16px;
}

.canvas-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.canvas-toolbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  position: relative;
  left: -100px;
  pointer-events: none;
}

.canvas-toolbar-center > * {
  pointer-events: auto;
}

.canvas-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.canvas-toolbar-btn {
  padding: 6px 12px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #24292e;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  height: 32px;
  line-height: 1;
}

.canvas-toolbar-btn:hover {
  background: #f6f8fa;
  border-color: #0969da;
}

.canvas-toolbar-btn:disabled,
.canvas-toolbar-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: #f6f8fa;
}

.canvas-toolbar-btn.warning {
  border-color: #f59e0b;
}

.canvas-toolbar-btn.warning:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.canvas-toolbar-btn[data-action="clear-canvas"]:hover {
  background: #fee;
  border-color: #ef4444;
  color: #dc2626;
}

.canvas-toolbar-btn-primary {
  padding: 6px 12px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  color: #24292e;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.canvas-toolbar-select {
  padding: 6px 12px;
  border: 1px solid #e1e4e8;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #24292e;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 12px;
  height: 32px;
}

.canvas-toolbar-select:hover {
  border-color: #0969da;
}

.canvas-toolbar-select:focus {
  outline: 2px solid #0969da;
  outline-offset: 2px;
}

.canvas-toolbar-btn-primary:hover {
  background: #f6f8fa;
  border-color: #0969da;
}

.canvas-tabs {
  display: flex;
  gap: 4px;
  padding: 2px;
  background: #f6f8fa;
  border-radius: 6px;
}

.canvas-tab {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #57606a;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.canvas-tab:hover {
  color: #24292e;
  background: rgba(0, 0, 0, 0.05);
}

.canvas-tab.active {
  background: #ffffff;
  color: #0969da;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Collapsed sidebar states - removed old transform-based styles */

.canvas-layout-main {
  flex: 1;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #f5f6fa;
}

/* Context panel sidebar - right sidebar */
.context-panel-sidebar {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid #e1e4e8;
  border-top: 1px solid #e1e4e8;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.context-panel-sidebar.collapsed {
  opacity: 0;
  overflow: hidden;
}

.canvas-layout-right-sidebar {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  height: 100%;
  background: #ffffff;
  border-left: 1px solid #e1e4e8;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
  z-index: 100;
}

.canvas-layout-right-sidebar.collapsed {
  transform: translateX(320px);
  margin-left: -320px;
}

/* Canvas toolbar removed - navigation moved to header */


.canvas-main-content {
  flex: 1;
  padding: 16px;
  padding-bottom: 32px;
  overflow: auto;
  position: relative;
  min-height: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.grid-warning-banner {
  background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
  border-left: 4px solid #ffc107;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 12px 16px;
  color: #664d03;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
  animation: slideDown 0.3s ease-out;
}

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

.grid-warning-banner .warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.grid-warning-banner .warning-message {
  flex: 1;
  color: #664d03;
  line-height: 1.4;
}

.grid-warning-banner .warning-message strong {
  color: #523d02;
  font-weight: 600;
}

.grid-warning-banner .warning-action-btn {
  background: #ffc107;
  color: #664d03;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.grid-warning-banner .warning-action-btn:hover {
  background: #ffb300;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.grid-warning-banner .warning-action-btn:active {
  transform: translateY(0);
}

.grid-layout-container {
  display: grid;
  gap: 24px;
  row-gap: 60px;
  width: 100%;
  max-width: 100%;
  overflow-y: visible;
  overflow-x: hidden;
  padding-bottom: 40px;
  box-sizing: border-box;
}

.grid-layout-container.auto-fit {
  height: 100%;
}

.grid-layout-container.custom-grid {
  min-height: 0;
  height: auto;
}

.grid-layout-container.grid-2x2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(480px, auto);
}

.grid-layout-container.grid-3x2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(480px, auto);
}

.grid-layout-container.grid-4x2 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(480px, auto);
}

.grid-layout-container.grid-2x3 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(480px, auto);
}

.grid-layout-container.auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  grid-auto-rows: minmax(500px, 1fr);
}

.chart-container {
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  position: relative;
  min-height: 500px;
  height: 100%;
  max-width: 100%;
  padding-bottom: 0;
  margin-bottom: 0;
  box-sizing: border-box;
}

.chart-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d0d7de;
}

.chart-container.active {
  border-color: #0969da;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

.chart-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #e1e4e8;
  background: #f6f8fa;
  gap: 20px;
  width: 100%;
  min-height: 56px;
}

.chart-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

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

.chart-header-row-2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 32px;
}

.chart-filters-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.chart-header-single-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e1e4e8;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 44px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chart-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.chart-dataset-label {
  font-size: 13px;
  font-weight: 600;
  color: #24292e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 1 auto;
}

.chart-title-text {
  font-size: 16px;
  font-weight: 700;
  color: #24292e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.5;
  margin-bottom: 4px;
}

.chart-header-bottom {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.chart-dataset-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.chart-dataset-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.chart-dataset-name {
  font-size: 12px;
  color: #57606a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-header-divider {
  color: #d0d7de;
  font-size: 14px;
  font-weight: 300;
  flex-shrink: 0;
  user-select: none;
}

.chart-type-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
}

.chart-type-select {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: white;
  color: #24292e;
  cursor: pointer;
}

.chart-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.chart-export-btn {
  padding: 6px 12px;
  border: 1px solid #d0d7de;
  background: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #24292e;
}

.chart-export-btn:hover {
  background: #f6f8fa;
  border-color: #57606a;
}

.chart-export-btn:active {
  background: #e1e4e8;
}

/* Treemap interaction mode toggle button */
.treemap-mode-toggle {
  padding: 6px 12px;
  border: 1px solid #d0d7de;
  background: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #24292e;
  display: none !important; /* Hidden by default */
}

/* Show treemap mode toggle in split view */
.canvas-split-view .treemap-mode-toggle,
.canvas-split-container .treemap-mode-toggle {
  display: inline-block !important;
}

.treemap-mode-toggle[data-mode="filter"] {
  background: #0969da;
  color: #ffffff;
  border-color: #0969da;
}

.treemap-mode-toggle:hover {
  background: #f6f8fa;
  border-color: #57606a;
}

.treemap-mode-toggle[data-mode="filter"]:hover {
  background: #0860ca;
  border-color: #0860ca;
}

.treemap-mode-toggle:active {
  background: #e1e4e8;
}

.treemap-mode-toggle[data-mode="filter"]:active {
  background: #0550ae;
}

.chart-legend-toggle {
  padding: 6px 12px;
  border: 1px solid #d0d7de;
  background: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #24292e;
  flex-shrink: 0;
}

.chart-legend-toggle:hover {
  background: #f6f8fa;
  border-color: #57606a;
}

.chart-legend-toggle:active {
  background: #e1e4e8;
}

.chart-filters-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filters-label {
  font-size: 11px;
  font-weight: 500;
  color: #57606a;
  white-space: nowrap;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  background: linear-gradient(135deg, #0969da 0%, #0550ae 100%);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(9, 105, 218, 0.15);
  transition: all 0.2s ease;
  cursor: default;
}

.filter-badge:hover {
  box-shadow: 0 2px 4px rgba(9, 105, 218, 0.25);
  transform: translateY(-1px);
}

.filter-badge-icon {
  font-size: 9px;
  line-height: 1;
  opacity: 0.9;
}

.filter-badge-label {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.2px;
}

.filter-badge-text {
  font-size: 10px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.chart-action-btn {
  padding: 4px 8px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #57606a;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
}

.chart-legend-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.chart-legend-toggle {
  padding: 6px 10px;
  background: white;
  border: 1px solid #d1d5da;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #24292e;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.chart-legend-toggle:hover {
  background: #f6f8fa;
  border-color: #0969da;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.chart-legend-box {
  background: #f6f8fa;
  border: 1px solid #d1d5da;
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  max-width: 200px;
  min-width: 150px;
  margin-left: auto;
  margin-top: 4px;
  align-self: flex-end;
}

.chart-legend-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.chart-legend-item:hover {
  background: #f6f8fa;
}

.chart-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chart-legend-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-action-btn:hover {
  background: #e1e4e8;
  color: #24292e;
}

.chart-action-btn:active {
  background: #d0d7de;
}

.chart-canvas-area {
  flex: 1;
  padding: 16px;
  overflow: hidden; /* CRITICAL FIX: Prevent chart content from overlapping labels */
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
  min-height: 400px;
  width: 100%;
  height: auto;
}

.chart-canvas-area canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
}

/* Special styling for globe.gl container */
.chart-canvas-area > div {
  width: 100% !important;
  height: 100% !important;
}

.chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid #e1e4e8;
  background: #ffffff;
  min-height: 44px;
  gap: 12px;
}

.chart-quick-config {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.chart-quick-config select {
  padding: 4px 8px;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  background: #ffffff;
  font-size: 12px;
  color: #24292e;
  cursor: pointer;
  flex: 1;
  min-width: 80px;
  max-width: 150px;
}

.chart-quick-config select:hover {
  border-color: #d0d7de;
}

.chart-quick-config select:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

.chart-footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-footer-btn {
  padding: 4px 10px;
  border: 1px solid #e1e4e8;
  background: #ffffff;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #24292e;
}

.chart-footer-btn:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
}

.empty-grid-cell {
  background: #f6f8fa;
  border: 2px dashed #d0d7de;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  cursor: pointer;
  transition: all 0.2s;
}

/* Empty state when no charts (after toolbar) */
.canvas-empty-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  padding: 48px;
}

.empty-content {
  text-align: center;
  max-width: 600px;
  padding: 64px 48px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid #e1e4e8;
  animation: fadeInUp 0.4s ease;
}

.empty-icon {
  font-size: 96px;
  margin-bottom: 32px;
  animation: float 3s ease-in-out infinite;
  line-height: 1;
  filter: grayscale(0.3) opacity(0.9);
}

.empty-title {
  font-size: 28px;
  font-weight: 700;
  color: #24292e;
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.empty-text {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 40px 0;
  line-height: 1.6;
}

.empty-btn-primary {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #24292e;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fa 100%);
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
}

.empty-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  background: linear-gradient(180deg, #f6f8fa 0%, #e9ecef 100%);
  border-color: #818cf8;
}

.empty-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Welcome screen (no project loaded) */
.canvas-welcome-screen {
  position: fixed;
  top: 140px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f6fa;
  z-index: 10;
}

.welcome-content {
  text-align: center;
  max-width: 600px;
  padding: 64px 48px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid #e1e4e8;
  animation: fadeInUp 0.4s ease;
}

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

.welcome-icon {
  font-size: 96px;
  margin-bottom: 32px;
  animation: float 3s ease-in-out infinite;
  line-height: 1;
  filter: grayscale(0.3) opacity(0.9);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.welcome-title {
  font-size: 32px;
  font-weight: 700;
  color: #24292e;
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
}

.welcome-text {
  font-size: 16px;
  color: #6b7280;
  margin: 0 0 40px 0;
  line-height: 1.6;
}

.welcome-btn-primary {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #24292e;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fa 100%);
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
}

.welcome-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  background: linear-gradient(180deg, #f6f8fa 0%, #e9ecef 100%);
  border-color: #818cf8;
}

.welcome-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.empty-grid-cell:hover {
  background: #ffffff;
  border-color: #0969da;
}

.empty-grid-cell-icon {
  font-size: 48px;
  color: #d0d7de;
}

.empty-grid-cell:hover .empty-grid-cell-icon {
  color: #0969da;
}

.empty-grid-cell-text {
  font-size: 14px;
  color: #57606a;
  text-align: center;
}

.empty-grid-cell:hover .empty-grid-cell-text {
  color: #0969da;
}

@media (max-width: 1024px) {
  .canvas-layout-left-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 200;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }
  
  .canvas-layout-left-sidebar.collapsed {
    transform: translateX(-100%);
    margin-right: 0;
  }
  
  .canvas-layout-right-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 200;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  }
  
  .canvas-layout-right-sidebar.collapsed {
    transform: translateX(100%);
    margin-left: 0;
  }
  
  .grid-layout-container.auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .canvas-layout-left-sidebar,
  .canvas-layout-right-sidebar {
    width: 100%;
    max-width: 100%;
  }
  
  .grid-layout-container {
    grid-template-columns: 1fr !important;
    grid-auto-rows: minmax(250px, auto);
  }
  
  .chart-quick-config {
    flex-direction: column;
    align-items: stretch;
  }
  
  .chart-quick-config select {
    max-width: none;
  }
}

.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 101;
  color: #57606a;
  font-size: 12px;
}

.sidebar-toggle-btn:hover {
  background: #f6f8fa;
  border-color: #d0d7de;
  color: #24292e;
}

.sidebar-toggle-left {
  right: -12px;
}

.sidebar-toggle-right {
  left: -12px;
}

.canvas-layout-left-sidebar.collapsed + * .sidebar-toggle-left,
.canvas-layout-main + .canvas-layout-right-sidebar.collapsed .sidebar-toggle-right {
  transform: translateY(-50%) rotate(180deg);
}

/* ===============================================
   SPLIT VIEW STYLES
   =============================================== */

.canvas-split-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.canvas-split-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #f5f6fa;
}

.canvas-split-container[data-orientation="vertical"],
.canvas-split-container[data-orientation="vertical-reverse"] {
  flex-direction: column;
}

.canvas-split-container[data-orientation="vertical-reverse"] {
  flex-direction: column-reverse;
}

/* Left Panel (Tabelle) */
.canvas-split-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border-right: 1px solid #e5e7eb;
  min-width: 250px;
  max-width: 80%;
}

.canvas-split-container[data-orientation="vertical"] .canvas-split-left,
.canvas-split-container[data-orientation="vertical-reverse"] .canvas-split-left {
  width: 100% !important;
  border-right: none;
  border-bottom: 1px solid #e5e7eb;
  min-height: 200px;
  max-height: 80%;
  min-width: unset;
  max-width: unset;
}

.canvas-split-table-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#split-table-container {
  flex: 1;
  overflow: auto;
}

#split-table-container .canvas-full-table-container {
  height: 100%;
}

/* Resize Handle */
.canvas-split-resize-handle {
  width: 8px;
  background: #f3f4f6;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.canvas-split-container[data-orientation="vertical"] .canvas-split-resize-handle,
.canvas-split-container[data-orientation="vertical-reverse"] .canvas-split-resize-handle {
  width: 100%;
  height: 8px;
  cursor: row-resize;
}

.canvas-split-container[data-orientation="vertical"] .resize-handle-bar,
.canvas-split-container[data-orientation="vertical-reverse"] .resize-handle-bar {
  width: 40px;
  height: 2px;
}

.canvas-split-resize-handle:hover {
  background: #e5e7eb;
}

.canvas-split-resize-handle:active {
  background: #d1d5db;
}

.resize-handle-bar {
  width: 2px;
  height: 40px;
  background: #9ca3af;
  border-radius: 2px;
  pointer-events: none;
}

/* Right Panel (Charts) */
.canvas-split-right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f5f6fa;
  min-width: 250px;
  max-width: 80%;
}

.canvas-split-container[data-orientation="vertical"] .canvas-split-right,
.canvas-split-container[data-orientation="vertical-reverse"] .canvas-split-right {
  width: 100% !important;
  min-height: 200px;
  max-height: 80%;
  min-width: unset;
  max-width: unset;
}

.split-grid-wrapper {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.split-grid-wrapper .grid-layout-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  row-gap: 60px;
  padding: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Empty state for charts in split view */
.split-empty-charts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #57606a;
  gap: 16px;
}

.split-empty-charts .empty-icon {
  font-size: 64px;
}

.split-empty-charts p {
  font-size: 16px;
  margin: 0;
}

.split-empty-charts .empty-btn-primary {
  padding: 10px 24px;
  background: #2da44e;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.split-empty-charts .empty-btn-primary:hover {
  background: #2c974b;
}

/* View Toggle Group */
.canvas-view-toggle-group {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
  margin-left: 12px;
  width: fit-content;
}

.canvas-toolbar-center .canvas-view-toggle-group:first-child {
  margin-left: 0;
}

.canvas-view-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #57606a;
  transition: all 0.2s;
  white-space: nowrap;
}

.canvas-view-btn:hover {
  background: #e5e7eb;
  color: #24292e;
}

.canvas-view-btn.active {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
  color: #4338ca;
}

.canvas-view-btn.disabled,
.canvas-view-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Responsive adjustments for split view */
@media (max-width: 1024px) {
  .split-grid-wrapper .grid-layout-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .canvas-split-container {
    flex-direction: column;
  }
  
  .canvas-split-left,
  .canvas-split-right {
    width: 100% !important;
    max-width: 100%;
  }
  
  .canvas-split-resize-handle {
    width: 100%;
    height: 8px;
    cursor: row-resize;
  }
  
  .resize-handle-bar {
    width: 40px;
    height: 2px;
  }
}

/* Compact Chart Header - Single Line */
.chart-title-compact {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  flex-shrink: 1;
}

.chart-controls-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.chart-type-select-compact {
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: white;
  color: #24292e;
  cursor: pointer;
  min-width: 90px;
  height: 32px;
}

.chart-control-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #d0d7de;
  background: white;
  color: #24292e;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-control-btn:hover {
  background: #f6f8fa;
  border-color: #0969da;
}

.chart-control-btn-icon {
  padding: 6px;
  border: 1px solid #d0d7de;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chart-control-btn-icon:hover {
  background: #f6f8fa;
  border-color: #0969da;
}

/* Canvas Data Table Styles */

.data-table-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  overflow: hidden;
}

/* Table Refresh Button */
.table-refresh-btn {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
  margin-left: auto;
}

.table-refresh-btn:hover {
  background: #e6f7ff;
  border-color: #91d5ff;
}

.table-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}

.data-table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.data-table-info {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #6b7280;
}

.table-row-count,
.table-col-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.data-table-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-nav-btn {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  color: #374151;
}

.table-nav-btn:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

.table-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.table-page-info {
  font-size: 13px;
  color: #6b7280;
  min-width: 140px;
  text-align: center;
}

.data-table-scroll-container {
  flex: 1;
  overflow: auto;
  position: relative;
}

.canvas-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}

.canvas-data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: white;
}

.table-header-cell {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #1f2937;
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-type-icon {
  font-size: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

.table-row {
  transition: background-color 0.1s;
}

.table-row.even {
  background: white;
}

.table-row.odd {
  background: #f9fafb;
}

.table-row:hover {
  background: #f3f4f6 !important;
}

.table-cell {
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #374151;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-cell {
  color: #9ca3af;
  font-style: italic;
}

.data-table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
}

.data-table-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.data-table-empty .empty-text {
  font-size: 16px;
  font-weight: 500;
}

/* Sum Row Toggle Button */
.table-sum-toggle-btn {
  padding: 8px 14px;
  border: 1px solid #e1e4e8;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fa 100%);
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #24292e;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1;
}

.table-sum-toggle-btn:hover {
  background: linear-gradient(180deg, #f6f8fa 0%, #e9ecef 100%);
  border-color: #0969da;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.table-sum-toggle-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.table-sum-toggle-btn.active {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
  color: #1e40af;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Sum Row Styling */
.table-sum-row {
  background: #fffbeb !important;
  border-top: 2px solid #fbbf24;
  font-weight: 600;
}

.table-sum-row:hover {
  background: #fef3c7 !important;
}

.table-sum-cell {
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  color: #92400e;
  font-size: 13px;
}

.table-sum-cell strong {
  color: #92400e;
}

/* Sum Column Styling */
.table-sum-column-header {
  background: #fef3c7 !important;
  border-left: 2px solid #fbbf24 !important;
  position: sticky;
  right: 0;
  z-index: 5;
}

.table-sum-column-cell {
  background: #fffbeb;
  border-left: 2px solid #fbbf24;
  color: #92400e;
  font-weight: 600;
  text-align: right;
  position: sticky;
  right: 0;
  z-index: 3;
}

.table-row:hover .table-sum-column-cell {
  background: #fef3c7 !important;
}

.table-grand-total {
  background: #fcd34d !important;
  font-size: 14px;
  color: #78350f;
}

/* Scrollbar styling */
.data-table-scroll-container::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.data-table-scroll-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.data-table-scroll-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

.data-table-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

#recipe-library {
  max-width: 1200px;
  width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.recipe-library-toolbar {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--background-secondary, #f9f9f9);
}

.recipe-search {
  flex: 1;
}

.recipe-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  font-size: 14px;
}

.recipe-actions {
  display: flex;
  gap: 8px;
}

.recipe-library-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.recipe-sidebar {
  width: 200px;
  padding: 16px;
  border-right: 1px solid var(--border-color, #e0e0e0);
  background: var(--background-secondary, #f9f9f9);
  overflow-y: auto;
}

.recipe-stats {
  margin-bottom: 24px;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border-color, #e0e0e0);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary, #666);
}

.stat-value {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary-color, #2196F3);
}

.recipe-tags h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text-primary, #333);
}

.tag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tag-filter {
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: all 0.2s;
}

.tag-filter:hover {
  background: var(--background-hover, #f0f0f0);
}

.tag-filter.active {
  background: var(--primary-color, #2196F3);
  color: white;
  border-color: var(--primary-color, #2196F3);
}

.recipe-main {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.recipe-card {
  background: white;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.recipe-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.recipe-card-header {
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.recipe-icon {
  font-size: 32px;
}

.recipe-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.recipe-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recipe-description {
  font-size: 13px;
  color: var(--text-secondary, #666);
  line-height: 1.5;
}

.recipe-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary, #666);
}

.recipe-viz-type {
  padding: 4px 8px;
  background: var(--background-secondary, #f0f0f0);
  border-radius: 4px;
  font-weight: 500;
}

.recipe-author {
  padding: 4px 8px;
  background: var(--background-secondary, #f0f0f0);
  border-radius: 4px;
}

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recipe-tag {
  padding: 3px 8px;
  background: var(--primary-light, #e3f2fd);
  color: var(--primary-color, #2196F3);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.recipe-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  display: flex;
  gap: 8px;
  background: var(--background-secondary, #f9f9f9);
}

.recipe-action-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #ddd);
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.recipe-action-btn:hover {
  background: var(--background-hover, #f0f0f0);
}

.recipe-apply-btn {
  background: var(--primary-color, #2196F3);
  color: white;
  border-color: var(--primary-color, #2196F3);
  font-weight: 500;
}

.recipe-apply-btn:hover {
  background: var(--primary-dark, #1976D2);
  border-color: var(--primary-dark, #1976D2);
}

.recipe-empty {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.empty-state {
  text-align: center;
  padding: 48px;
}

.empty-state h3 {
  margin: 0 0 12px 0;
  font-size: 24px;
  color: var(--text-primary, #333);
}

.empty-state p {
  margin: 0 0 24px 0;
  font-size: 14px;
  color: var(--text-secondary, #666);
}

@media (max-width: 768px) {
  #recipe-library {
    width: 95vw;
    max-height: 90vh;
  }

  .recipe-library-toolbar {
    flex-direction: column;
  }

  .recipe-library-content {
    flex-direction: column;
  }

  .recipe-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
  }

  .recipe-grid {
    grid-template-columns: 1fr;
  }
}

#recipe-parameter-dialog {
  max-width: 600px;
  width: 90vw;
}

.recipe-param-info {
  padding: 16px;
  background: var(--background-secondary, #f9f9f9);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.recipe-param-info p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #666);
}

.param-field {
  margin-bottom: 20px;
}

.param-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #333);
}

.param-label .required {
  color: var(--error-color, #f44336);
  margin-left: 4px;
}

.param-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.param-input:focus {
  outline: none;
  border-color: var(--primary-color, #2196F3);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.param-input.error {
  border-color: var(--error-color, #f44336);
}

.param-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary, #999);
  font-family: 'Courier New', monospace;
}

.recipe-param-functions {
  padding: 16px;
  background: var(--background-secondary, #f9f9f9);
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.function-help {
  cursor: pointer;
}

.function-help summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-color, #2196F3);
  padding: 8px 0;
  user-select: none;
}

.function-help summary:hover {
  color: var(--primary-dark, #1976D2);
}

.function-list {
  margin-top: 12px;
  padding-left: 16px;
}

.function-item {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.function-name {
  min-width: 150px;
  padding: 4px 8px;
  background: var(--background-code, #f5f5f5);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--primary-color, #2196F3);
}

.function-desc {
  color: var(--text-secondary, #666);
  line-height: 1.6;
}

.no-functions {
  margin: 0;
  padding: 12px;
  text-align: center;
  color: var(--text-secondary, #999);
  font-size: 13px;
}

select.param-input {
  cursor: pointer;
  background: white;
}

textarea.param-input {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

@media (max-width: 768px) {
  #recipe-parameter-dialog {
    width: 95vw;
  }

  .function-item {
    flex-direction: column;
    gap: 4px;
  }

  .function-name {
    min-width: auto;
  }
}

.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-modal {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.3s ease-out;
}

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

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  color: #666;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
}

.auth-modal-close:hover {
  background-color: #f0f0f0;
  color: #333;
}

.auth-modal-content {
  padding: 40px 32px 32px;
}

.auth-modal-title {
  margin: 0 0 24px 0;
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.auth-form-group input {
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.2s;
  background-color: #fafafa;
}

.auth-form-group input:focus {
  outline: none;
  border-color: #007bff;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.auth-form-group input::placeholder {
  color: #999;
}

.auth-form-hint {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.auth-error {
  display: none;
  padding: 12px 16px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.auth-submit-btn {
  padding: 14px 24px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.auth-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

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

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-switch {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: #666;
  padding-top: 24px;
  border-top: 1px solid #eee;
}

.auth-switch a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-switch a:hover {
  color: #0056b3;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .auth-modal {
    width: 95%;
    margin: 20px;
  }

  .auth-modal-content {
    padding: 32px 24px 24px;
  }

  .auth-modal-title {
    font-size: 24px;
  }

  .auth-form-row {
    grid-template-columns: 1fr;
  }
}

/* Dataset Panel - Compact Item Styling */

.dataset-item-compact {
  background: white;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
  overflow: hidden;
}

.dataset-item-compact:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dataset-item-compact.expanded {
  border-color: #0ea5e9;
}

/* Compact Dataset Header */
.dataset-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  gap: 8px;
}

.dataset-compact-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.dataset-compact-info:hover {
  opacity: 0.8;
}

.dataset-compact-main {
  flex: 1;
  min-width: 0;
}

.dataset-compact-name {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dataset-compact-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.dataset-compact-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dataset-compact-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.dataset-compact-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e0;
}

.dataset-compact-btn.dataset-remove-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

/* Expanded Content Container */
.dataset-expanded-content {
  border-top: 1px solid #e2e8f0;
  background: #fafbfc;
}

/* Charts Section */
.dataset-charts-section {
  padding: 0 12px 12px 12px;
  background: white;
}

.dataset-charts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dataset-chart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dataset-chart-item:hover {
  background: #f0f9ff;
  border-color: #0ea5e9;
}

.dataset-chart-item .chart-icon {
  font-size: 14px;
}

.dataset-chart-item .chart-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dataset-charts-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
}

/* Actions Row */
.dataset-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: white;
}

.dataset-action-btn {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.dataset-action-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e0;
}

.dataset-action-btn .charts-expand-icon {
  color: #64748b;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.dataset-action-icons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.dataset-action-icon {
  width: 38px;
  height: 32px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.dataset-action-icon:hover {
  background: #f8fafc;
  border-color: #cbd5e0;
}

.dataset-action-icon.dataset-action-remove:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.dataset-action-icon.dataset-action-refresh:hover {
  background: #e6f7ff;
  border-color: #91d5ff;
  color: #0050b3;
}

.dataset-action-icon.dataset-action-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.fa-spinner.fa-spin {
  animation: spin 1s linear infinite;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  border-bottom: 1px solid #e2e8f0;
}

.modal-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.modal-tab:hover {
  color: #64748b;
}

.modal-tab.active {
  color: #1e293b;
  border-bottom-color: #1e293b;
  background: transparent;
}

/* Modal Tab Content */
.modal-tab-content {
  background: white;
  border-radius: 0;
  border: none;
  padding: 0;
  max-height: 500px;
  overflow-y: auto;
}

/* Column List - Anzeige Tab */
.column-list-anzeige {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.column-item-draggable {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: grab;
  transition: all 0.15s ease;
}

.column-item-draggable:hover {
  background: #f1f5f9;
  border-color: #cbd5e0;
}

.column-item-draggable.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.column-item-draggable .drag-handle {
  color: #94a3b8;
  font-size: 14px;
  cursor: grab;
  user-select: none;
}

.column-item-draggable:active .drag-handle {
  cursor: grabbing;
}

.column-item-draggable .visibility-toggle {
  padding: 4px 8px;
  border: 1px solid #cbd5e0;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
}

.column-item-draggable .visibility-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.column-item-draggable .visibility-toggle.hidden {
  background: #fef2f2;
  border-color: #fca5a5;
}

.column-item-draggable .column-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
}

.column-item-draggable .column-name.dimmed {
  color: #94a3b8;
  text-decoration: line-through;
}

.column-item-draggable .column-type-select {
  padding: 4px 8px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  background: white;
  font-size: 12px;
  cursor: pointer;
  min-width: 140px;
  transition: all 0.15s ease;
}

.column-item-draggable .column-type-select:hover {
  border-color: #0ea5e9;
}

.column-item-draggable .column-type-select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Column List - Labels Tab */
.column-list-labels {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.label-item-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 42px;
  border-bottom: 1px solid #e2e8f0;
}

.label-item-row:last-child {
  border-bottom: none;
}

.label-item-original {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

.label-item-name {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}

.label-item-sample {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  font-style: italic;
}

.label-item-input-wrapper {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: white;
}

.label-item-input-wrapper .label-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 13px;
  background: white;
  transition: all 0.15s ease;
}

.label-item-input-wrapper .label-input:hover {
  border-color: #cbd5e0;
}

.label-item-input-wrapper .label-input:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: none;
}

/* Drop Indicator */
.drop-indicator {
  animation: pulse-indicator 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-indicator {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}

/* Empty State */
.no-columns {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* Scrollbar Styling */
.dataset-tab-content::-webkit-scrollbar {
  width: 8px;
}

.dataset-tab-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.dataset-tab-content::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.dataset-tab-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.admin-dashboard {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #24292e;
}

.admin-header .subtitle {
  font-size: 16px;
  color: #586069;
  margin: 0;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid #e1e4e8;
  margin-bottom: 24px;
}

.admin-tab {
  background: none;
  border: none;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #586069;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.admin-tab:hover {
  color: #24292e;
  background: #f6f8fa;
}

.admin-tab.active {
  color: #0969da;
  border-bottom-color: #0969da;
}

.tab-content {
  display: none;
}

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

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

.plan-card {
  border: 1px solid #d1d5da;
  border-radius: 8px;
  padding: 20px;
  background: white;
  transition: box-shadow 0.2s;
}

.plan-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e1e4e8;
}

.plan-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #24292e;
}

.plan-price {
  font-size: 18px;
  font-weight: 600;
  color: #0969da;
}

.plan-description {
  font-size: 14px;
  color: #586069;
  margin-bottom: 16px;
}

.plan-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-category {
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  padding: 12px;
  background: #f6f8fa;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d1d5da;
}

.category-name {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
}

.category-count {
  font-size: 12px;
  color: #586069;
  background: white;
  padding: 2px 8px;
  border-radius: 12px;
}

.feature-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.feature-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #24292e;
}

.feature-checkbox input[type="checkbox"] {
  cursor: pointer;
}

.quota-input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #d1d5da;
  border-radius: 4px;
  font-size: 12px;
}

.features-list {
  background: white;
  border-radius: 8px;
  padding: 24px;
}

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

.features-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.features-category-section {
  margin-bottom: 32px;
}

.features-category-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #24292e;
}

.features-table {
  width: 100%;
  border-collapse: collapse;
}

.features-table th {
  text-align: left;
  padding: 12px;
  background: #f6f8fa;
  border-bottom: 2px solid #d1d5da;
  font-size: 13px;
  font-weight: 600;
  color: #586069;
}

.features-table td {
  padding: 12px;
  border-bottom: 1px solid #e1e4e8;
  font-size: 14px;
}

.features-table code {
  background: #f6f8fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #cf222e;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: #dafbe1;
  color: #1a7f37;
}

.user-overrides {
  background: white;
  border-radius: 8px;
  padding: 24px;
}

.user-search h2 {
  margin: 0 0 16px 0;
  font-size: 24px;
  font-weight: 700;
}

.search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.search-box input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #d1d5da;
  border-radius: 6px;
  font-size: 14px;
}

.btn-primary {
  background: #0969da;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #0550ae;
}

/* Users Management */
.users-management {
  background: white;
  border-radius: 8px;
  padding: 24px;
}

.users-table-container {
  overflow-x: auto;
  margin-top: 20px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.users-table thead {
  background: #f6f8fa;
}

.users-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #24292e;
  border-bottom: 2px solid #d0d7de;
}

.users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #d0d7de;
  vertical-align: middle;
}

.users-table tbody tr:hover {
  background: #f6f8fa;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: #dafbe1;
  color: #1a7f37;
}

.status-badge.inactive {
  background: #ffebe9;
  color: #cf222e;
}

.admin-dashboard .btn-danger,
.user-details-overlay .btn-danger {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.admin-dashboard .btn-danger:hover,
.user-details-overlay .btn-danger:hover {
  background: #bb2d3b;
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.dialog-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  overflow: hidden;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px;
  border-bottom: 1px solid #e1e4e8;
  flex-shrink: 0;
}

.dialog-header h3 {
  margin: 0;
  font-size: 22px;
  color: #2c3e50;
}

.dialog-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #95a5a6;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.dialog-close:hover {
  color: #2c3e50;
}

.dialog-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.dialog-description {
  margin: 0 0 24px 0;
  color: #7f8c8d;
  font-size: 15px;
}

.connector-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.connector-type-card {
  background: white;
  border: 2px solid #e1e4e8;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.connector-type-card:not(.disabled):hover {
  border-color: #3498db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.connector-type-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.connector-type-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.connector-type-card h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #2c3e50;
}

.connector-type-card p {
  margin: 0;
  font-size: 13px;
  color: #7f8c8d;
  line-height: 1.4;
}

.badge {
  display: inline-block;
  margin-top: 12px;
  padding: 4px 12px;
  background: #ecf0f1;
  border-radius: 12px;
  font-size: 11px;
  color: #7f8c8d;
  font-weight: 500;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group .required {
  color: #e74c3c;
  margin-left: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dfe4e8;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-help {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #3498db;
}

.form-help h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #2c3e50;
}

.form-help ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #7f8c8d;
  line-height: 1.6;
}

.form-help li {
  margin-bottom: 8px;
}

.form-help a {
  color: #3498db;
  text-decoration: none;
}

.form-help a:hover {
  text-decoration: underline;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 30px;
  border-top: 1px solid #e1e4e8;
  flex-shrink: 0;
  background: white;
}

.btn-primary,
.btn-secondary {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #ecf0f1;
  color: #7f8c8d;
}

.btn-secondary:hover {
  background: #dfe4e8;
  color: #2c3e50;
}

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

.loading-spinner {
  display: inline-block;
  width: 60px;
  height: 60px;
  border: 4px solid #ecf0f1;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: #2ecc71;
  color: white;
  font-size: 48px;
  border-radius: 50%;
  margin: 20px auto;
}

.error-message {
  padding: 16px;
  background: #fff5f5;
  border: 1px solid #ffdddd;
  border-radius: 6px;
  color: #e74c3c;
  font-size: 14px;
}

.error-message strong {
  display: block;
  margin-bottom: 8px;
  color: #c0392b;
}

/* Custom Forms Modal Styles */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Form Editor Modal Specific Styles */
.form-editor-modal-overlay .addFieldTypeBtn:hover {
  background: #667eea !important;
  color: white !important;
  border-color: #667eea !important;
}

.form-editor-modal-overlay .fieldItem:hover {
  border-color: #667eea !important;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.form-editor-modal-overlay .fieldItem:active {
  opacity: 0.6;
}

.form-editor-modal-overlay .editFieldBtn:hover {
  background: #667eea !important;
  color: white !important;
}

.form-editor-modal-overlay .deleteFieldBtn:hover {
  background: #e74c3c !important;
  color: white !important;
}

.form-editor-modal-close:hover {
  background: rgba(255,255,255,0.3) !important;
}

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

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

/* Loading Spinner */
.custom-forms-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
}

.custom-forms-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* Empty State */
.custom-forms-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.custom-forms-empty h3 {
  font-size: 24px;
  margin: 16px 0;
  color: #333;
}

.custom-forms-empty p {
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Forms Grid */
.forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* Form Card */
.form-card {
  background: white;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.form-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

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

.form-card-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px 0;
}

.form-card-description {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.form-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.form-card-badge.submissions {
  background: #e8f5e9;
  color: #2e7d32;
}

.form-card-badge.version {
  background: #e3f2fd;
  color: #1565c0;
}

.form-card-badge.template {
  background: #fff3e0;
  color: #e65100;
}

.form-card-badge.public {
  background: #fce4ec;
  color: #c2185b;
}

.form-card-badge.offline {
  background: #f3e5f5;
  color: #7b1fa2;
}

.form-card-date {
  font-size: 12px;
  color: #999;
  margin-top: 8px;
}

.form-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.form-card-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.form-card-btn.edit {
  background: #667eea;
  color: white;
}

.form-card-btn.edit:hover {
  background: #5568d3;
}

.form-card-btn.view {
  background: #f0f0f0;
  color: #333;
}

.form-card-btn.view:hover {
  background: #e0e0e0;
}

.form-card-btn.delete {
  background: #fee;
  color: #d32f2f;
}

.form-card-btn.delete:hover {
  background: #fdd;
}

/* Template Cards */
.templates-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid #f0f0f0;
}

.templates-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: #333;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.template-card {
  background: white;
  color: #333;
  border-radius: 6px;
  padding: 8px 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1.5px solid #e1e4e8;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 50px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.template-card:hover {
  border-color: #0969da;
  background: #f6f8fa;
  transform: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.template-card.active {
  border-color: #0969da;
  border-width: 2px;
  background: #ddf4ff;
  color: #0969da;
}

.template-card-icon {
  font-size: 16px;
  margin-bottom: 4px;
  opacity: 0.8;
}

.template-card:hover .template-card-icon {
  opacity: 1;
}

.template-card-title {
  font-size: 10px;
  font-weight: 500;
  margin: 0;
  line-height: 1.3;
  color: #57606a;
}

.template-card.active .template-card-title {
  color: #0969da;
  font-weight: 600;
}

.template-card-description {
  display: none;
}

.template-card-badge {
  display: none;
}

/* Template Browser specific styles (from TemplateBrowser.ts) */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.template-icon {
  font-size: 18px;
  margin-bottom: 4px;
  display: block;
}

.template-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  display: block;
}

.template-preview {
  margin-top: 4px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.template-browser-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #333;
}

.template-category-title {
  font-size: 12px;
  font-weight: 600;
  margin: 16px 0 8px 0;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Show All Templates Button */
.show-all-templates-btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: #f8f8f8;
  color: #667eea;
  border: 2px dashed #667eea;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 16px;
}

.show-all-templates-btn:hover {
  background: #f0f0ff;
  border-color: #5568d3;
}

/* Template Selection Modal */
.template-selection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease-in-out;
}

.template-selection-modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease-out;
}

.template-selection-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 24px 32px;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

.template-selection-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #333;
}

.template-selection-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-selection-close:hover {
  background-color: #f0f0f0;
  color: #333;
}

.template-selection-content {
  padding: 32px;
}

.template-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.template-selection-card {
  background: white;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.template-selection-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.template-selection-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.template-selection-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #333;
}

.template-selection-description {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.template-selection-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.template-selection-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: #e3f2fd;
  color: #1565c0;
}

.template-selection-badge.official {
  background: #e8f5e9;
  color: #2e7d32;
}

.use-template-btn {
  width: 100%;
  padding: 10px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.use-template-btn:hover {
  background: #5568d3;
}

/* Responsive */
@media (max-width: 768px) {
  .forms-grid,
  .templates-grid,
  .template-selection-grid {
    grid-template-columns: 1fr;
  }

  .template-selection-content {
    padding: 20px;
  }

  .template-selection-header {
    padding: 16px 20px;
  }
}

/**
 * Organisation Switcher Component Styles
 */

/* Container */
.header-org-switcher {
  position: relative;
  display: inline-block;
}

/* Button */
.org-switcher-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.org-switcher-button:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

.org-switcher-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.org-switcher-label {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-switcher-icon {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.org-switcher-button:hover .org-switcher-icon {
  transform: translateY(2px);
}

/* Dropdown */
.org-switcher-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: white;
  border: 1px solid #cbd5e0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  min-width: 280px;
  max-width: 350px;
  max-height: 500px;
  overflow-y: auto;
  z-index: 10000;
  animation: dropdownFadeIn 0.2s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* Dropdown Item */
.org-switcher-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid transparent;
}

.org-switcher-item:first-child {
  border-radius: 12px 12px 0 0;
}

.org-switcher-item:last-child {
  border-radius: 0 0 12px 12px;
  border-bottom: none;
}

.org-switcher-item:hover {
  background: #f7fafc;
}

.org-switcher-item.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.org-switcher-item.active:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.org-switcher-item-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Checkmark */
.org-check {
  font-size: 16px;
  color: #667eea;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

.org-check-placeholder {
  min-width: 20px;
  display: inline-block;
}

/* Organisation Info */
.org-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.org-name {
  font-size: 14px;
  font-weight: 500;
  color: #2d3748;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-role {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.org-role.role-admin {
  background: #fee2e2;
  color: #dc2626;
}

.org-role.role-editor {
  background: #dbeafe;
  color: #2563eb;
}

.org-role.role-viewer {
  background: #d1fae5;
  color: #059669;
}

/* Action Items */
.org-switcher-action {
  color: #4a5568;
}

.org-switcher-action:hover {
  background: #edf2f7;
}

.org-action-icon {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

/* Divider */
.org-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* Scrollbar */
.org-switcher-dropdown::-webkit-scrollbar {
  width: 6px;
}

.org-switcher-dropdown::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 12px;
}

.org-switcher-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 12px;
}

.org-switcher-dropdown::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
  .org-switcher-label {
    max-width: 150px;
  }

  .org-switcher-dropdown {
    min-width: 260px;
    max-width: 90vw;
    right: -10px;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .org-switcher-dropdown {
    background: #1a202c;
    border-color: #2d3748;
  }

  .org-switcher-item {
    color: #e2e8f0;
  }

  .org-switcher-item:hover {
    background: #2d3748;
  }

  .org-switcher-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  }

  .org-name {
    color: #e2e8f0;
  }

  .org-divider {
    background: #2d3748;
  }

  .org-switcher-action {
    color: #cbd5e0;
  }

  .org-switcher-action:hover {
    background: #2d3748;
  }
}

/* Focus states for accessibility */
.org-switcher-button:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.org-switcher-item:focus {
  outline: 2px solid #667eea;
  outline-offset: -2px;
  background: #edf2f7;
}

/* Loading state (optional) */
.org-switcher-loading {
  padding: 20px;
  text-align: center;
  color: #718096;
  font-size: 14px;
}

.org-switcher-loading::after {
  content: '...';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%, 100% {
    content: '...';
  }
}

/* Empty state */
.org-switcher-empty {
  padding: 20px;
  text-align: center;
  color: #718096;
  font-size: 14px;
}

.org-switcher-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* Project Sharing Modal Styles */

.project-sharing-modal {
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Share Form Section */
.share-form-section {
  margin-bottom: 24px;
}

.share-form-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2c3e50;
}

/* User Search */
.user-search-container {
  position: relative;
  margin-bottom: 20px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 1.2rem;
  pointer-events: none;
  color: #94a3b8;
}

#user-search-input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

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

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: #f8fafc;
}

.autocomplete-empty {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.user-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.autocomplete-user-info {
  flex: 1;
  min-width: 0;
}

.autocomplete-user-name {
  font-weight: 500;
  color: #1e293b;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.autocomplete-user-email {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Permission Selector */
.permission-selector {
  margin-bottom: 20px;
}

.permission-selector label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: #475569;
  font-size: 0.9rem;
}

.select-field {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.permission-description {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
}

/* Grant Access Button */
#grant-access-btn {
  width: 100%;
  padding: 12px 20px;
  margin-bottom: 20px;
}

#grant-access-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Permissions Info */
.permissions-info {
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.permissions-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #713f12;
}

.permissions-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.permissions-info li {
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #854d0e;
  line-height: 1.5;
}

.permissions-info li:last-child {
  margin-bottom: 0;
}

/* Existing Shares Section */
.existing-shares-section {
  margin-top: 24px;
}

.existing-shares-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2c3e50;
}

.empty-shares {
  padding: 32px;
  text-align: center;
  background: #f8fafc;
  border-radius: 8px;
  color: #64748b;
}

.empty-shares p {
  margin: 0;
  font-size: 0.95rem;
}

/* Shares List */
.shares-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.share-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.share-item:hover {
  background: #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  margin-right: 16px;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
  margin-right: 16px;
}

.user-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 1rem;
  margin-bottom: 4px;
}

.user-email {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Share Actions */
.share-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.permission-dropdown {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
  cursor: pointer;
  min-width: 140px;
  transition: all 0.2s ease;
}

.permission-dropdown:hover {
  border-color: #94a3b8;
}

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

.btn-remove-share {
  padding: 8px 16px;
  background: #fee;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-remove-share:hover {
  background: #fecaca;
  border-color: #dc2626;
}

.btn-remove-share:active {
  transform: scale(0.98);
}

/* Permission Badges */
.badge-view {
  background: #dbeafe;
  color: #1e40af;
}

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

.badge-admin {
  background: #fce7f3;
  color: #9f1239;
}

/* Info Message */
.info-message {
  padding: 16px;
  background: #e0f2fe;
  border-left: 4px solid #0284c7;
  border-radius: 6px;
  margin-bottom: 16px;
}

.info-message p {
  margin: 0;
  color: #075985;
  font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 640px) {
  .project-sharing-modal {
    max-width: 95%;
    width: 95%;
  }

  .share-item {
    flex-wrap: wrap;
    gap: 12px;
  }

  .user-info {
    margin-right: 0;
    width: 100%;
  }

  .share-actions {
    width: 100%;
    justify-content: space-between;
  }

  .permission-dropdown {
    flex: 1;
  }

  .autocomplete-user-name,
  .autocomplete-user-email {
    font-size: 0.9rem;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* LinkedIn Connect Dialog Styles */

/* Modal container */
#linkedin-connect-dialog-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 12000;
  display: none; /* Hidden by default */
}

.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 11999;
}

.dialog-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  z-index: 12000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #0077B5 0%, #00A0DC 100%);
  color: white;
}

.dialog-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 500;
}

.dialog-close {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.dialog-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.dialog-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.linkedin-connect-dialog {
  max-width: 600px;
}

.linkedin-connect-step,
.linkedin-config-step {
  padding: 1rem 0;
}

.linkedin-intro {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.linkedin-intro p {
  margin: 0.5rem 0;
}

.linkedin-intro p:first-child {
  font-size: 1.1rem;
  font-weight: 500;
  color: #0077B5;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #0077B5;
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-large:hover {
  background: #006399;
}

.btn-large:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.linkedin-connect-btn svg {
  fill: currentColor;
}

.linkedin-info {
  background: #e7f3ff;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  border-left: 4px solid #0077B5;
}

.linkedin-info h4 {
  margin: 0 0 1rem 0;
  color: #0077B5;
  font-size: 1rem;
}

.linkedin-info ul {
  margin: 0;
  padding-left: 1.5rem;
}

.linkedin-info li {
  margin: 0.5rem 0;
  color: #495057;
}

.linkedin-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 2rem;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.linkedin-success h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
}

.linkedin-success p {
  margin: 0;
  opacity: 0.95;
}

.linkedin-config-step .form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.linkedin-config-step .form-actions button {
  flex: 1;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

/* Spinner for loading states */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* OAuth Alternative Button in Forms */
.oauth-alternative {
  margin: 2rem 0;
  text-align: center;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px dashed #0077B5;
}

.oauth-alternative h4 {
  margin: 0 0 1rem 0;
  color: #0077B5;
  font-size: 1rem;
}

.oauth-alternative p {
  margin: 0 0 1rem 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.oauth-alternative button {
  margin: 0 auto;
}

/**
 * Palette Selector Component Styles
 * Modern dropdown selector for color palettes with preview dots
 */

/* ===================================
   BEM Base Component
   =================================== */

.palette-selector {
  position: relative;
  width: 100%;
}

/* ===================================
   Dropdown Trigger Button
   =================================== */

.palette-selector__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: white;
  border: 1.5px solid #e1e4e8;
  border-radius: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #24292e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.palette-selector__trigger:hover {
  border-color: #0969da;
  background: #f6f8fa;
}

.palette-selector__trigger:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

.palette-selector__trigger--open {
  border-color: #0969da;
  background: #f6f8fa;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

/* ===================================
   Trigger Content
   =================================== */

.palette-selector__current {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.palette-selector__label {
  font-weight: 400;
  color: #24292e;
}

.palette-selector__icon {
  font-size: 16px;
  color: var(--text-secondary, #57606a);
  transition: transform 0.2s ease;
}

.palette-selector__trigger--open .palette-selector__icon {
  transform: rotate(180deg);
}

/* ===================================
   Color Preview Dots
   =================================== */

.palette-selector__preview {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.palette-selector__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.palette-selector__dot:hover {
  transform: scale(1.2);
}

/* ===================================
   Dropdown Menu
   =================================== */

.palette-selector__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  background: white;
  border: 1px solid var(--border-color, #d0d7de);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.palette-selector__dropdown--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ===================================
   Dropdown Items
   =================================== */

.palette-selector__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #24292e);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light, #f6f8fa);
  transition: all 0.15s ease;
}

.palette-selector__item:last-child {
  border-bottom: none;
}

.palette-selector__item:hover {
  background: var(--bg-hover, #f0f7ff);
  color: var(--accent-color, #0969da);
}

.palette-selector__item--active {
  background: var(--bg-selected, #e6f2ff);
  color: var(--accent-color, #0969da);
  font-weight: 600;
}

.palette-selector__item--active::before {
  content: '✓';
  margin-right: 8px;
  font-weight: bold;
  color: var(--accent-color, #0969da);
}

/* ===================================
   Palette Name
   =================================== */

.palette-selector__name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.palette-selector__emoji {
  font-size: 16px;
}

/* ===================================
   Custom Scrollbar
   =================================== */

.palette-selector__dropdown::-webkit-scrollbar {
  width: 8px;
}

.palette-selector__dropdown::-webkit-scrollbar-track {
  background: var(--bg-light, #f6f8fa);
  border-radius: 8px;
}

.palette-selector__dropdown::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, #d0d7de);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.palette-selector__dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover, #b8bfc6);
}

/* ===================================
   CSS Variables (Light Theme)
   =================================== */

:root {
  --border-color: #d0d7de;
  --border-light: #f6f8fa;
  --text-primary: #24292e;
  --text-secondary: #57606a;
  --accent-color: #0969da;
  --bg-hover: #f0f7ff;
  --bg-selected: #e6f2ff;
  --bg-light: #f6f8fa;
  --focus-ring: rgba(9, 105, 218, 0.1);
  --scrollbar-thumb: #d0d7de;
  --scrollbar-thumb-hover: #b8bfc6;
}

/* ===================================
   Dark Mode Support
   =================================== */

@media (prefers-color-scheme: dark) {
  .palette-selector__trigger {
    background: #161b22;
    border-color: #30363d;
    color: #c9d1d9;
  }

  .palette-selector__trigger:hover {
    background: #1c2128;
    border-color: #58a6ff;
  }

  .palette-selector__dropdown {
    background: #161b22;
    border-color: #30363d;
  }

  .palette-selector__item {
    color: #c9d1d9;
    border-bottom-color: #21262d;
  }

  .palette-selector__item:hover {
    background: #1c2128;
    color: #58a6ff;
  }

  .palette-selector__item--active {
    background: #0d419d;
    color: #58a6ff;
  }

  :root {
    --border-color: #30363d;
    --border-light: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --bg-hover: #1c2128;
    --bg-selected: #0d419d;
    --bg-light: #21262d;
    --focus-ring: rgba(88, 166, 255, 0.1);
    --scrollbar-thumb: #30363d;
    --scrollbar-thumb-hover: #484f58;
  }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
  .palette-selector__trigger {
    padding: 8px 10px;
    font-size: 12px;
  }

  .palette-selector__item {
    padding: 10px 12px;
    font-size: 12px;
  }

  .palette-selector__dot {
    width: 12px;
    height: 12px;
  }

  .palette-selector__dropdown {
    max-height: 240px;
  }
}

/* ===================================
   Animation Variants
   =================================== */

.palette-selector__dropdown--fade-in {
  animation: fadeInDown 0.2s ease;
}

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

/* ===================================
   Disabled State
   =================================== */

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

.palette-selector__trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-light, #f6f8fa);
}

/**
 * Visual Style Selector Component Styles
 * Modern dropdown selector for visual style presets
 */

/* ===================================
   BEM Base Component
   =================================== */

.visual-style-selector {
  position: relative;
  width: 100%;
}

/* ===================================
   Dropdown Trigger Button
   =================================== */

.visual-style-selector__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: white;
  border: 1.5px solid #e1e4e8;
  border-radius: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #24292e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.visual-style-selector__trigger:hover {
  border-color: #0969da;
  background: #f6f8fa;
}

.visual-style-selector__trigger:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

.visual-style-selector__trigger--open {
  border-color: #0969da;
  background: #f6f8fa;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.1);
}

/* ===================================
   Trigger Content
   =================================== */

.visual-style-selector__current {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.visual-style-selector__label {
  font-weight: 400;
  color: #24292e;
}

.visual-style-selector__icon {
  font-size: 12px;
  color: var(--text-secondary, #57606a);
  transition: transform 0.2s ease;
}

.visual-style-selector__trigger--open .visual-style-selector__icon {
  transform: rotate(180deg);
}

/* ===================================
   Dropdown Menu
   =================================== */

.visual-style-selector__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 380px;
  background: white;
  border: 1px solid var(--border-color, #d0d7de);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.2s ease;
}

.visual-style-selector__dropdown--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ===================================
   Category Headers
   =================================== */

.visual-style-selector__category-header {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #57606a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f6f8fa;
  border-bottom: 1px solid #e1e4e8;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ===================================
   Dropdown Items
   =================================== */

.visual-style-selector__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-primary, #24292e);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light, #f6f8fa);
  transition: all 0.15s ease;
}

.visual-style-selector__item:last-child {
  border-bottom: none;
}

.visual-style-selector__item:hover {
  background: var(--bg-hover, #f0f7ff);
  color: var(--accent-color, #0969da);
}

.visual-style-selector__item--active {
  background: var(--bg-selected, #e6f2ff);
  color: var(--accent-color, #0969da);
  font-weight: 500;
}

.visual-style-selector__item--active::before {
  content: '✓';
  margin-right: 8px;
  font-weight: bold;
  color: var(--accent-color, #0969da);
}

/* ===================================
   Preset Name
   =================================== */

.visual-style-selector__name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.visual-style-selector__emoji {
  font-size: 16px;
}

/* ===================================
   Visual Preview (small indicators)
   =================================== */

.visual-style-selector__preview {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
}

.visual-style-preview__line {
  width: 24px;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
}

.visual-style-preview__bar {
  width: 8px;
  height: 14px;
  background: currentColor;
  opacity: 0.4;
}

/* ===================================
   Custom Scrollbar
   =================================== */

.visual-style-selector__dropdown::-webkit-scrollbar {
  width: 8px;
}

.visual-style-selector__dropdown::-webkit-scrollbar-track {
  background: var(--bg-light, #f6f8fa);
  border-radius: 8px;
}

.visual-style-selector__dropdown::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, #d0d7de);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.visual-style-selector__dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover, #b8bfc6);
}

/* ===================================
   CSS Variables (Light Theme)
   =================================== */

:root {
  --border-color: #d0d7de;
  --border-light: #f6f8fa;
  --text-primary: #24292e;
  --text-secondary: #57606a;
  --accent-color: #0969da;
  --bg-hover: #f0f7ff;
  --bg-selected: #e6f2ff;
  --bg-light: #f6f8fa;
  --focus-ring: rgba(9, 105, 218, 0.1);
  --scrollbar-thumb: #d0d7de;
  --scrollbar-thumb-hover: #b8bfc6;
}

/* ===================================
   Dark Mode Support
   =================================== */

@media (prefers-color-scheme: dark) {
  .visual-style-selector__trigger {
    background: #161b22;
    border-color: #30363d;
    color: #c9d1d9;
  }

  .visual-style-selector__trigger:hover {
    background: #1c2128;
    border-color: #58a6ff;
  }

  .visual-style-selector__dropdown {
    background: #161b22;
    border-color: #30363d;
  }

  .visual-style-selector__category-header {
    background: #0d1117;
    border-bottom-color: #21262d;
    color: #8b949e;
  }

  .visual-style-selector__item {
    color: #c9d1d9;
    border-bottom-color: #21262d;
  }

  .visual-style-selector__item:hover {
    background: #1c2128;
    color: #58a6ff;
  }

  .visual-style-selector__item--active {
    background: #0d419d;
    color: #58a6ff;
  }

  :root {
    --border-color: #30363d;
    --border-light: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --bg-hover: #1c2128;
    --bg-selected: #0d419d;
    --bg-light: #21262d;
    --focus-ring: rgba(88, 166, 255, 0.1);
    --scrollbar-thumb: #30363d;
    --scrollbar-thumb-hover: #484f58;
  }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
  .visual-style-selector__trigger {
    padding: 8px 10px;
    font-size: 12px;
  }

  .visual-style-selector__item {
    padding: 8px 12px;
    font-size: 12px;
  }

  .visual-style-selector__dropdown {
    max-height: 280px;
  }
}

/**
 * Template Browser Component Styles
 * Grid-based template browser with card-style previews
 */

/* ===================================
   BEM Base Component
   =================================== */

.template-browser {
  width: 100%;
  padding: 16px 0;
}

/* ===================================
   Section Header
   =================================== */

.template-browser__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 2px;
}

.template-browser__title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #24292e);
  margin: 0;
}

.template-browser__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #57606a);
  background: var(--bg-light, #f6f8fa);
  padding: 4px 10px;
  border-radius: 12px;
}

/* ===================================
   Template Grid
   =================================== */

.template-browser__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

/* ===================================
   Template Card
   =================================== */

.template-browser__card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: white;
  border: 1.5px solid var(--border-color, #e1e4e8);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

.template-browser__card:hover {
  border-color: var(--accent-color, #0969da);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.template-browser__card--active {
  border-color: var(--accent-color, #0969da);
  border-width: 2px;
  box-shadow: 0 4px 16px rgba(9, 105, 218, 0.15);
}

.template-browser__card--active::before {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--accent-color, #0969da);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  z-index: 10;
}

/* ===================================
   Card Preview (Image/Icon Area)
   =================================== */

.template-browser__preview {
  position: relative;
  width: 100%;
  height: 60px;
  background: linear-gradient(135deg, #f6f8fa 0%, #e1e4e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.template-browser__preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-browser__card:hover .template-browser__preview-image {
  transform: scale(1.05);
}

.template-browser__preview-icon {
  font-size: 24px;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.template-browser__card:hover .template-browser__preview-icon {
  opacity: 0.9;
  transform: scale(1.1);
}

/* ===================================
   Card Content
   =================================== */

.template-browser__content {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.template-browser__name {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #24292e);
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-browser__description {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-secondary, #57606a);
  line-height: 1.3;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* ===================================
   Card Footer (Tags/Metadata)
   =================================== */

.template-browser__footer {
  padding: 0 10px 8px;
  display: none;
}

.template-browser__tag {
  font-family: 'Roboto Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--tag-text, #0969da);
  background: var(--tag-bg, #ddf4ff);
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.template-browser__tag--premium {
  color: #9a6700;
  background: #fff8c5;
}

.template-browser__tag--new {
  color: #116329;
  background: #dafbe1;
}

/* ===================================
   Empty State
   =================================== */

.template-browser__empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.template-browser__empty-icon {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.template-browser__empty-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #57606a);
}

/* ===================================
   Loading State
   =================================== */

.template-browser__loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.template-browser__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light, #f6f8fa);
  border-top-color: var(--accent-color, #0969da);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===================================
   CSS Variables (Light Theme)
   =================================== */

:root {
  --border-color: #e1e4e8;
  --border-light: #f6f8fa;
  --text-primary: #24292e;
  --text-secondary: #57606a;
  --accent-color: #0969da;
  --bg-light: #f6f8fa;
  --tag-text: #0969da;
  --tag-bg: #ddf4ff;
}

/* ===================================
   Dark Mode Support
   =================================== */

@media (prefers-color-scheme: dark) {
  .template-browser__card {
    background: #161b22;
    border-color: #30363d;
  }

  .template-browser__card:hover {
    border-color: #58a6ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .template-browser__card--active {
    border-color: #58a6ff;
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.25);
  }

  .template-browser__preview {
    background: linear-gradient(135deg, #21262d 0%, #30363d 100%);
  }

  .template-browser__name {
    color: #c9d1d9;
  }

  .template-browser__description {
    color: #8b949e;
  }

  .template-browser__tag {
    color: #58a6ff;
    background: #0d419d;
  }

  .template-browser__tag--premium {
    color: #f0c14b;
    background: #3d2700;
  }

  .template-browser__tag--new {
    color: #7ee787;
    background: #0a3d1c;
  }

  :root {
    --border-color: #30363d;
    --border-light: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --bg-light: #21262d;
    --tag-text: #58a6ff;
    --tag-bg: #0d419d;
  }
}

/* ===================================
   Responsive Design (2 columns)
   =================================== */

@media (max-width: 768px) {
  .template-browser__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .template-browser__preview {
    height: 100px;
  }

  .template-browser__content {
    padding: 10px;
    gap: 4px;
  }

  .template-browser__name {
    font-size: 12px;
  }

  .template-browser__description {
    font-size: 10px;
  }

  .template-browser__tag {
    font-size: 9px;
    padding: 2px 6px;
  }
}

/* ===================================
   Responsive Design (1 column)
   =================================== */

@media (max-width: 480px) {
  .template-browser__grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .template-browser__preview {
    height: 160px;
  }
}

/* ===================================
   Hover Effects (Desktop Only)
   =================================== */

@media (hover: hover) and (pointer: fine) {
  .template-browser__card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(9, 105, 218, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .template-browser__card:hover::after {
    opacity: 1;
  }

  .template-browser__card:active {
    transform: translateY(0);
  }
}

/* ===================================
   Accessibility
   =================================== */

.template-browser__card:focus {
  outline: 2px solid var(--accent-color, #0969da);
  outline-offset: 2px;
}

.template-browser__card:focus:not(:focus-visible) {
  outline: none;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
  .template-browser__card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e1e4e8;
  }

  .template-browser__card:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Saved Charts Panel Styles */

/* List */
.saved-charts-list {
  padding: 8px 0;
}

/* Tabs */
.saved-charts-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e5e7eb;
  padding: 0 12px;
  background-color: #f9fafb;
}

.saved-charts-tab {
  flex: 1;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
  position: relative;
  margin-bottom: -2px;
}

.saved-charts-tab:hover {
  color: #374151;
  background-color: #f3f4f6;
}

.saved-charts-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background-color: #ffffff;
}

.saved-charts-section-header {
  padding: 16px 12px 8px;
  border-bottom: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.saved-charts-section-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

/* Individual Chart Item */
.saved-chart-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 8px 12px;
  background-color: #ffffff;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.chart-clickable-area {
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  min-height: 94px;
}

.chart-clickable-area:hover {
  background-color: #f9fafb;
}

.chart-thumbnail {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.chart-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chart-thumbnail i {
  font-size: 28px;
  color: #9ca3af;
}

.chart-recipe-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.chart-info {
  flex: 1;
  min-width: 0;
}

.chart-info h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.chart-info h4:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  top: 100%;
  background-color: #1f2937;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 13px;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chart-info .chart-type {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: #6b7280;
}

.chart-info .chart-dataset {
  margin: 0 0 4px 0;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-info .chart-dataset i {
  font-size: 11px;
  color: #9ca3af;
}

.chart-info .chart-date {
  margin: 0;
  font-size: 11px;
  color: #9ca3af;
}

.recipe-description {
  margin: 4px 0 !important;
  font-size: 12px !important;
  color: #6b7280 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 4 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  line-height: 1.4 !important;
}

.saved-chart-item .chart-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
}

.chart-actions .btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-weight: 500;
  min-width: 40px;
  background: white;
  color: #374151;
}

.saved-chart-item .chart-actions .btn.btn-primary,
.chart-actions .btn-primary {
  flex: 1;
  border-color: #d1d5db;
}

.saved-chart-item .chart-actions .btn.btn-primary:hover,
.chart-actions .btn-primary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-item .chart-actions .btn.btn-secondary,
.chart-actions .btn-secondary {
  border-color: #d1d5db;
}

.saved-chart-item .chart-actions .btn.btn-secondary:hover,
.chart-actions .btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.chart-actions .btn-info {
  border-color: #d1d5db;
}

.chart-actions .btn-info:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-item .chart-actions .btn.btn-danger,
.chart-actions .btn-danger {
  border-color: #d1d5db;
  color: #ef4444;
}

.saved-chart-item .chart-actions .btn.btn-danger:hover,
.chart-actions .btn-danger:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

/* Chart Set Item */
.saved-chart-set-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 8px 12px;
  background-color: #ffffff;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.chart-set-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.chart-set-header:hover {
  background-color: #f9fafb;
}

.chart-set-expand-icon {
  font-size: 16px;
  color: #6b7280;
  flex-shrink: 0;
  width: 20px;
  transition: transform 0.2s;
}

.chart-set-info {
  flex: 1;
  min-width: 0;
}

.chart-set-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chart-set-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.chart-set-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 13px;
}

.chart-set-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background-color: #dbeafe;
  color: #1e40af;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.chart-set-note-icon {
  font-size: 14px;
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chart-set-note-icon:hover {
  opacity: 1;
}

.chart-set-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.chart-set-actions .btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  font-weight: 500;
  min-width: 40px;
  background: white;
  color: #374151;
}

.saved-chart-set-item .chart-set-actions .btn.btn-primary,
.chart-set-actions .btn-primary {
  flex: 1;
  border-color: #d1d5db;
}

.saved-chart-set-item .chart-set-actions .btn.btn-primary:hover,
.chart-set-actions .btn-primary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-set-item .chart-set-actions .btn.btn-secondary,
.chart-set-actions .btn-secondary {
  border-color: #d1d5db;
}

.saved-chart-set-item .chart-set-actions .btn.btn-secondary:hover,
.chart-set-actions .btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.saved-chart-set-item .chart-set-actions .btn.btn-danger,
.chart-set-actions .btn-danger {
  border-color: #d1d5db;
  color: #ef4444;
}

.saved-chart-set-item .chart-set-actions .btn.btn-danger:hover,
.chart-set-actions .btn-danger:hover {
  background-color: #fef2f2;
  border-color: #fca5a5;
}

/* Chart Set Charts Container */
.chart-set-charts-container {
  padding: 12px;
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.chart-set-chart-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s;
}

.chart-set-chart-preview:hover {
  background-color: #ffffff;
  border-color: #3b82f6;
}

.chart-set-chart-preview:last-child {
  margin-bottom: 0;
}

.chart-preview-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-preview-name {
  flex: 1;
  font-size: 13px;
  color: #1f2937;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-preview-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.chart-preview-actions .btn,
.chart-preview-actions .btn-sm,
.chart-preview-actions .btn-xs {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-width: 36px;
  background: white;
  color: #374151;
  font-weight: 500;
}

.chart-preview-actions .btn i {
  font-size: 12px;
}

.chart-preview-actions .btn-primary {
  border-color: #d1d5db;
}

.chart-preview-actions .btn-primary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.chart-preview-actions .btn-secondary {
  border-color: #d1d5db;
}

.chart-preview-actions .btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #6b7280;
  font-size: 13px;
}

.empty-state-small {
  text-align: center;
  padding: 12px;
  color: #9ca3af;
  font-size: 12px;
  font-style: italic;
}

.error-message-small {
  text-align: center;
  padding: 12px;
  color: #ef4444;
  font-size: 12px;
}

/* ============================================================================
   Dashboard List Page Styles
   ============================================================================ */

.dashboard-list-page {
  padding: 32px;
  max-width: 1400px;
  margin: 0 auto;
  background: #f7fafc;
  min-height: 100vh;
}

/* Header
   ========================================================================== */

.dashboard-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
}

.header-left h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px 0;
}

.header-left .subtitle {
  font-size: 16px;
  color: #718096;
  margin: 0;
}

.header-right .btn-primary {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  background: #4299e1;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(66, 153, 225, 0.2);
}

.header-right .btn-primary:hover {
  background: #3182ce;
  box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
  transform: translateY(-1px);
}

/* Toolbar
   ========================================================================== */

.dashboard-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sort-select {
  padding: 8px 32px 8px 12px;
  font-size: 14px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sort-select:hover {
  border-color: #4299e1;
}

.sort-select:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* View Mode Toggle */
.view-mode-toggle {
  display: flex;
  gap: 4px;
  background: #edf2f7;
  padding: 4px;
  border-radius: 6px;
}

.view-mode-btn {
  padding: 8px 16px;
  font-size: 18px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: #718096;
}

.view-mode-btn:hover {
  background: white;
  color: #4299e1;
}

.view-mode-btn.active {
  background: white;
  color: #4299e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dashboard Grid
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  padding: 8px;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Dashboard Card
   ========================================================================== */

.dashboard-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.dashboard-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

/* Thumbnail - Compact Status Badge Left-Aligned */
.dashboard-thumbnail {
  width: 100%;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  min-height: 36px;
}

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

.status-badge.public {
  background: #e3f2fd;
  color: #1976d2;
  border: 1px solid #90caf9;
}

.status-badge.private {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ce93d8;
}

/* Card Content */
.dashboard-card-content {
  padding: 20px;
  flex: 1;
}

.dashboard-name {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-description {
  font-size: 14px;
  color: #718096;
  margin: 0 0 16px 0;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dashboard-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #a0aec0;
  align-items: flex-start;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
}

/* Card Actions */
.dashboard-card-actions {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  background: #f7fafc;
  border-top: 1px solid #e2e8f0;
}

.btn-action {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  color: #4a5568;
}

.btn-action:hover {
  border-color: #4299e1;
  color: #4299e1;
  background: #ebf8ff;
}

.btn-edit:hover {
  border-color: #48bb78;
  color: #48bb78;
  background: #f0fff4;
}

.btn-delete:hover {
  border-color: #f56565;
  color: #f56565;
  background: #fff5f5;
}

/* List View Specific Styles */
.dashboard-list .dashboard-card {
  flex-direction: row;
  height: auto;
}

.dashboard-list .dashboard-thumbnail {
  width: auto;
  height: auto;
  min-height: unset;
  padding: 20px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  border-bottom: none;
  border-right: 1px solid #e2e8f0;
}

.dashboard-list .dashboard-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dashboard-list .dashboard-card-actions {
  flex-direction: column;
  width: 180px;
  padding: 16px;
  background: white;
  border-top: none;
  border-left: 1px solid #e2e8f0;
}

.dashboard-list .btn-action {
  width: 100%;
}

/* Empty State
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 80px 32px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-state-icon {
  font-size: 96px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 12px 0;
}

.empty-state p {
  font-size: 16px;
  color: #718096;
  margin: 0 0 32px 0;
}

.empty-state .btn-lg {
  padding: 16px 32px;
  font-size: 18px;
}

/* Dashboard Filters
   ========================================================================== */

.dashboard-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 24px;
  align-items: center;
}

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

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

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #4a5568;
}

.filter-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.filter-btn.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
}

/* Public Badge
   ========================================================================== */

.public-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(59, 130, 246, 0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
}

.dashboard-thumbnail {
  position: relative;
}

/* Dashboard Link Actions
   ========================================================================== */

.dashboard-link-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.btn-open-link,
.btn-copy-link {
  flex: 1;
  padding: 8px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-open-link {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.btn-open-link:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-copy-link {
  background: white;
  color: #4a5568;
  border-color: #cbd5e1;
}

.btn-copy-link:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .dashboard-list-page {
    padding: 16px;
  }

  .dashboard-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-list .dashboard-card {
    flex-direction: column;
  }

  .dashboard-list .dashboard-thumbnail {
    width: 100%;
    height: 200px;
  }

  .dashboard-list .dashboard-card-actions {
    flex-direction: row;
    width: 100%;
    border-left: none;
    border-top: 1px solid #e2e8f0;
  }

  /* Responsive Filter Bar */
  .dashboard-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-buttons {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
  }
}

/* Loading State
   ========================================================================== */

.dashboard-card.loading {
  pointer-events: none;
  opacity: 0.6;
}

.dashboard-card.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid #e2e8f0;
  border-top-color: #4299e1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/**
 * Agent Analysis View Styles
 *
 * Complete styling for agentic AI analysis sidebar:
 * - Loading animations
 * - Progress indicators
 * - Step protocol timeline
 * - Finding cards (severity-based colors)
 * - Chart previews
 * - Actions buttons
 * - Error states
 */

/* ============================================================================
   Container & Layout
   ============================================================================ */

.agent-analysis-view {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: 100%;
}

/* ============================================================================
   Header
   ============================================================================ */

.agent-header {
  border-bottom: 2px solid var(--border-color, #e0e0e0);
  padding-bottom: 15px;
}

.agent-header h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text-primary, #333);
}

.agent-header .query {
  font-size: 14px;
  font-style: italic;
  color: var(--text-secondary, #666);
  margin: 0;
  line-height: 1.4;
}

/* ============================================================================
   Loading State
   ============================================================================ */

.agent-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 40px 20px;
}

.agent-loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color, #e0e0e0);
  border-top-color: var(--primary-color, #4A90E2);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.agent-loading p {
  font-size: 14px;
  color: var(--text-secondary, #666);
  margin: 0;
}

/* ============================================================================
   Progress Bar
   ============================================================================ */

.agent-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--border-color, #e0e0e0);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color, #4A90E2), var(--accent-color, #7B68EE));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin: 0;
}

/* ============================================================================
   Completion State
   ============================================================================ */

.agent-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background-color: var(--success-bg, #e8f5e9);
  border-radius: 8px;
  border: 1px solid var(--success-border, #4caf50);
}

.complete-icon {
  font-size: 48px;
  color: var(--success-color, #4caf50);
}

.complete-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--success-color, #2e7d32);
  margin: 0;
}

.complete-meta {
  font-size: 12px;
  color: var(--text-secondary, #666);
  margin: 0;
}

/* ============================================================================
   Error State
   ============================================================================ */

.agent-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background-color: var(--error-bg, #ffebee);
  border-radius: 8px;
  border: 1px solid var(--error-border, #f44336);
}

.error-icon {
  font-size: 48px;
}

.error-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--error-color, #c62828);
  margin: 0;
}

.error-message {
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin: 0;
  text-align: center;
  line-height: 1.4;
}

/* ============================================================================
   Steps Timeline
   ============================================================================ */

.agent-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-steps h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background-color: var(--bg-secondary, #f5f5f5);
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.step-completed {
  border-left-color: var(--success-color, #4caf50);
  background-color: var(--success-bg, #e8f5e9);
}

.step-in_progress {
  border-left-color: var(--primary-color, #4A90E2);
  background-color: var(--primary-bg, #e3f2fd);
  animation: pulse 1.5s ease-in-out infinite;
}

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

.step-error {
  border-left-color: var(--error-color, #f44336);
  background-color: var(--error-bg, #ffebee);
}

.step-icon {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.step-message {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary, #333);
  line-height: 1.4;
}

.step-duration {
  font-size: 11px;
  color: var(--text-secondary, #999);
  font-weight: 500;
}

/* ============================================================================
   Executive Summary
   ============================================================================ */

.agent-executive-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background-color: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  border: 1px solid var(--border-color, #e0e0e0);
}

.agent-executive-summary h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
}

.summary-text {
  font-size: 13px;
  color: var(--text-primary, #333);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ============================================================================
   Findings
   ============================================================================ */

.agent-findings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-findings h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
}

.findings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finding {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  font-size: 13px;
  line-height: 1.5;
}

.finding-critical {
  border-left-color: #d32f2f;
  background-color: #ffebee;
}

.finding-warning {
  border-left-color: #f57c00;
  background-color: #fff3e0;
}

.finding-positive {
  border-left-color: #388e3c;
  background-color: #e8f5e9;
}

.finding-neutral {
  border-left-color: #1976d2;
  background-color: #e3f2fd;
}

.finding-icon {
  font-size: 16px;
  min-width: 20px;
}

.finding-text {
  flex: 1;
  color: var(--text-primary, #333);
}

/* ============================================================================
   Recommendations
   ============================================================================ */

.agent-recommendations {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-recommendations h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
}

.recommendations-list {
  margin: 0;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recommendations-list li {
  font-size: 13px;
  color: var(--text-primary, #333);
  line-height: 1.5;
}

/* ============================================================================
   Charts Preview
   ============================================================================ */

.agent-charts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-charts h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.chart-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background-color: var(--bg-secondary, #f5f5f5);
  border-radius: 6px;
  border: 1px solid var(--border-color, #e0e0e0);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-preview:hover {
  background-color: var(--bg-hover, #eeeeee);
  border-color: var(--primary-color, #4A90E2);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chart-preview img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  background-color: white;
}

.chart-placeholder {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 4px;
  font-size: 32px;
}

.chart-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary, #333);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-type {
  font-size: 11px;
  color: var(--text-secondary, #999);
  margin: 0;
  text-transform: capitalize;
}

/* ============================================================================
   Actions
   ============================================================================ */

.agent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.agent-actions .btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.agent-actions .btn-primary {
  background-color: var(--primary-color, #4A90E2);
  color: white;
}

.agent-actions .btn-primary:hover {
  background-color: var(--primary-hover, #357ABD);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.agent-actions .btn-primary:active {
  transform: translateY(0);
}

.agent-actions .btn-success {
  background-color: #28a745;
  color: white;
  cursor: default;
}

.agent-actions .btn-success:hover {
  background-color: #28a745;
  transform: none;
  box-shadow: none;
}

/* ============================================================================
   Reasoning Panel (NL-CALIBRATION-1)
   ============================================================================ */

.agent-reasoning {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.reasoning-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background-color: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #333);
  transition: background-color 0.2s ease;
  width: 100%;
  text-align: left;
}

.reasoning-toggle:hover {
  background-color: var(--bg-hover, #eeeeee);
}

.reasoning-toggle-icon {
  font-size: 10px;
  color: var(--text-secondary, #999);
  transition: transform 0.2s ease;
}

.reasoning-chain {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-color, #e0e0e0);
  border-top: none;
  border-radius: 0 0 6px 6px;
  background-color: var(--bg-secondary, #fafafa);
}

.reasoning-chain.expanded {
  display: flex;
}

.reasoning-step {
  padding: 10px;
  background: white;
  border-radius: 4px;
  border-left: 3px solid var(--primary-color, #4A90E2);
}

.reasoning-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.reasoning-step-num {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color, #4A90E2);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.reasoning-agent {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #333);
}

.reasoning-step-detail {
  font-size: 12px;
  color: var(--text-secondary, #666);
  line-height: 1.4;
  padding-left: 30px;
}

.reasoning-step-findings {
  font-size: 11px;
  color: var(--text-secondary, #888);
  font-style: italic;
  padding-left: 30px;
  margin-top: 4px;
  line-height: 1.4;
}

/* ============================================================================
   Feedback Buttons (NL-CALIBRATION-1)
   ============================================================================ */

.agent-feedback {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background-color: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  border: 1px solid var(--border-color, #e0e0e0);
}

.feedback-label {
  font-size: 13px;
  color: var(--text-secondary, #666);
  margin: 0;
  flex: 1;
}

.feedback-buttons {
  display: flex;
  gap: 8px;
}

.feedback-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  background: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-btn:hover {
  background-color: var(--bg-hover, #eee);
  transform: scale(1.1);
}

.feedback-btn.active {
  border-color: var(--primary-color, #4A90E2);
  background-color: var(--primary-bg, #e3f2fd);
  transform: scale(1.1);
}

.feedback-thanks {
  font-size: 12px;
  color: var(--success-color, #4caf50);
  font-style: italic;
}

/* ============================================================================
   Follow-Up Input (NL-2)
   ============================================================================ */

.agent-followup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px;
  background-color: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  border: 1px solid var(--border-color, #e0e0e0);
}

.agent-followup h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
}

.followup-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.followup-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  background: white;
  color: var(--text-primary, #333);
  outline: none;
  transition: border-color 0.2s ease;
}

.followup-input:focus {
  border-color: var(--primary-color, #4A90E2);
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
}

.followup-input::placeholder {
  color: var(--text-secondary, #999);
}

.followup-submit {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 6px;
  background-color: var(--primary-color, #4A90E2);
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.followup-submit:hover {
  background-color: var(--primary-hover, #357ABD);
}

.followup-hint {
  font-size: 11px;
  color: var(--text-secondary, #999);
  margin: 0;
  font-style: italic;
}

/* ============================================================================
   Conversation Info
   ============================================================================ */

.agent-conversation-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg-secondary, #f0f0f0);
  border-radius: 6px;
  font-size: 12px;
}

.conversation-badge {
  color: var(--text-secondary, #666);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary-color, #4A90E2);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--primary-hover, #357ABD);
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  .agent-analysis-view {
    padding: 15px;
  }

  .charts-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .chart-preview img,
  .chart-placeholder {
    height: 60px;
  }
}

/**
 * Summary Detail View Styles
 * Schöne Präsentation von Executive Summaries
 */

/* ============================================================================
   Modal Container
   ============================================================================ */

.summary-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.summary-detail-modal.show {
  opacity: 1;
}

.summary-detail-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.summary-detail-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

/* ============================================================================
   Header
   ============================================================================ */

.summary-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.summary-detail-title h2 {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.summary-detail-date {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}

.summary-detail-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.summary-detail-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ============================================================================
   Content
   ============================================================================ */

.summary-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.summary-section {
  margin-bottom: 32px;
}

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

.summary-section-title {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================================
   Executive Summary
   ============================================================================ */

.summary-executive-text {
  font-size: 15px;
  line-height: 1.8;
  color: #4a5568;
  background: #f7fafc;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.summary-executive-text strong {
  color: #2d3748;
  font-weight: 600;
}

/* ============================================================================
   Key Findings
   ============================================================================ */

.summary-findings-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-finding-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.summary-finding-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
  transform: translateX(4px);
}

.summary-finding-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.summary-finding-text {
  font-size: 14px;
  line-height: 1.6;
  color: #4a5568;
  flex: 1;
}

.summary-finding-text strong {
  color: #2d3748;
  font-weight: 600;
}

/* ============================================================================
   Finding Feedback Buttons
   ============================================================================ */

.finding-feedback {
  display: inline-flex;
  gap: 2px;
  margin-left: 8px;
  flex-shrink: 0;
  align-self: center;
}

.feedback-btn {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0.5;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
  line-height: 1;
}

.feedback-btn:hover {
  opacity: 1;
}

.feedback-btn.active {
  opacity: 1;
  border-color: #ddd;
  background: #f0f0f0;
}

.feedback-btn.active.feedback-positive {
  border-color: #86efac;
  background: #f0fdf4;
}

.feedback-btn.active.feedback-negative {
  border-color: #fca5a5;
  background: #fef2f2;
}

/* ============================================================================
   Recommendations
   ============================================================================ */

.summary-recommendations-list {
  padding-left: 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-recommendation-item {
  font-size: 14px;
  line-height: 1.6;
  color: #4a5568;
  padding-left: 8px;
}

.summary-recommendation-item strong {
  color: #2d3748;
  font-weight: 600;
}

/* ============================================================================
   Charts Grid
   ============================================================================ */

.summary-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.summary-chart-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.summary-chart-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.summary-chart-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.summary-chart-info {
  flex: 1;
  min-width: 0;
}

.summary-chart-name {
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-chart-type {
  font-size: 12px;
  color: #718096;
  text-transform: capitalize;
}

.summary-chart-add-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #667eea;
  background: #edf2f7;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.summary-chart-add-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ============================================================================
   Metadata
   ============================================================================ */

.summary-metadata {
  background: #f7fafc;
  padding: 20px;
  border-radius: 12px;
}

.summary-metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.summary-metadata-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: 8px;
}

.summary-metadata-label {
  font-size: 13px;
  color: #718096;
  font-weight: 500;
}

.summary-metadata-value {
  font-size: 14px;
  color: #2d3748;
  font-weight: 600;
}

/* ============================================================================
   Footer
   ============================================================================ */

.summary-detail-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 32px;
  border-top: 1px solid #e0e0e0;
  background: #f7fafc;
}

.summary-detail-footer .btn-secondary,
.summary-detail-footer .btn-primary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.summary-detail-footer .btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.summary-detail-footer .btn-secondary:hover {
  background: #cbd5e0;
}

.summary-detail-footer .btn-primary {
  background: #667eea;
  color: white;
}

.summary-detail-footer .btn-primary:hover {
  background: #5a67d8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============================================================================
   ARTIFACT-1 Phase 4: Multi-Artifact Accordion
   ============================================================================ */

.summary-artifacts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-artifact-card {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fafafa;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.summary-artifact-card.is-open {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.08);
}

/* Phase 5: header row holds drag-handle + toggle button side-by-side */
.summary-artifact-header {
  display: flex;
  align-items: stretch;
}

.summary-artifact-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  min-width: 0; /* allow title ellipsis */
}

.summary-artifact-toggle:hover {
  background: #f1f5f9;
}

/* ============================================================================
   Phase 5: Drag-to-Reorder UI for Artifacts
   ============================================================================ */

.summary-artifact-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
  touch-action: none; /* prevent scroll-conflict while dragging on touch devices */
}

.summary-artifact-drag-handle:hover {
  color: #475569;
  background: #f1f5f9;
}

.summary-artifact-drag-handle:active,
.summary-artifact-card-chosen .summary-artifact-drag-handle {
  cursor: grabbing;
  color: #4338ca;
}

/* Card currently being dragged — show as faded "ghost" in its source slot */
.summary-artifact-card-ghost {
  opacity: 0.35;
  background: #eef2ff !important;
  border-style: dashed !important;
  border-color: #818cf8 !important;
}

/* Card the user has grabbed (still in its original slot until dropped) */
.summary-artifact-card-chosen {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: grabbing;
}

/* The element rendered at the cursor while dragging */
.summary-artifact-card-drag {
  opacity: 0.9;
  transform: rotate(0.5deg);
}

.summary-artifact-toggle-icon {
  flex-shrink: 0;
  width: 18px;
  color: #667eea;
  font-size: 12px;
}

.summary-artifact-toggle-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-artifact-toggle-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.summary-artifact-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: lowercase;
}

.summary-artifact-pill--scenario {
  background: #fef3c7;
  color: #a16207;
}

.summary-artifact-description {
  padding: 0 16px 12px 44px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.summary-artifact-body {
  padding: 0 16px 16px 16px;
}

.summary-artifact-mount {
  background: #1a1a2e;
  position: relative;
}

.summary-artifact-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 360px;
  color: #cbd5e1;
  font-size: 14px;
}

.summary-artifact-error {
  background: #fef2f2;
}

/* Add-to-Summary dialog — Phase 4: artifact toggle */
.add-to-summary-artifact-toggle {
  margin: 12px 0;
  padding: 12px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
}

.add-to-summary-artifact-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #4338ca;
}

.add-to-summary-artifact-toggle .hint {
  display: block;
  margin-top: 6px;
  margin-left: 24px;
  font-size: 12px;
  font-weight: 400;
  color: #6366f1;
}

/* Public report — interactive visualizations section */
.report-artifacts {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 16px;
}

.report-artifact-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.report-artifact-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.report-artifact-title {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.report-artifact-description {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.report-artifact-mount {
  background: #1a1a2e;
  min-height: 400px;
}

.report-artifact-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 360px;
  color: #cbd5e1;
  font-size: 14px;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  .summary-detail-container {
    width: 95%;
    max-height: 95vh;
  }

  .summary-detail-header {
    padding: 20px;
  }

  .summary-detail-title h2 {
    font-size: 20px;
  }

  .summary-detail-content {
    padding: 20px;
  }

  .summary-section {
    margin-bottom: 24px;
  }

  .summary-charts-grid {
    grid-template-columns: 1fr;
  }

  .summary-metadata-grid {
    grid-template-columns: 1fr;
  }

  .summary-detail-footer {
    flex-direction: column-reverse;
    padding: 16px 20px;
  }

  .summary-detail-footer .btn-secondary,
  .summary-detail-footer .btn-primary {
    width: 100%;
  }
}

/* ============================================================
   leaflet-map.css – Styles for Leaflet Map Chart Type
   ============================================================ */

/* Container: fills chart widget, keeps Leaflet happy */
.leaflet-map-container {
  width: 100%;
  height: 100%;
  min-height: 0;  /* Let parent widget control height via grid rowSpan */
  position: relative;
  background: #f0f4f8;
  border-radius: 4px;
  overflow: hidden;
}

/* Override leaflet default z-index to avoid canvas toolbar bleeding */
.leaflet-map-container .leaflet-pane {
  z-index: 1;
}

/* CRITICAL: Overlay panes (markers, heatmaps, etc.) MUST be above tiles */
.leaflet-map-container .leaflet-overlay-pane {
  z-index: 400 !important;  /* Leaflet default, ensure heatmap is visible */
}
.leaflet-map-container .leaflet-shadow-pane {
  z-index: 500 !important;
}
.leaflet-map-container .leaflet-marker-pane {
  z-index: 600 !important;
}

.leaflet-map-container .leaflet-top,
.leaflet-map-container .leaflet-bottom {
  z-index: 1000;
}
.leaflet-map-container .leaflet-control {
  z-index: 1000;
}
.leaflet-map-container .leaflet-popup-pane {
  z-index: 1100;
}

/* Popup styling */
.leaflet-map-container .leaflet-popup-content-wrapper {
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
}
.leaflet-map-container .leaflet-popup-content {
  margin: 8px 12px;
}
.leaflet-map-container .leaflet-popup-tip-container {
  margin-top: -1px;
}

/* Attribution – keep it subtle */
.leaflet-map-container .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 1px 4px;
  border-radius: 3px;
}

/* No-data message overlay */
.leaflet-map-container .leaflet-no-data-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 16px 24px;
  text-align: center;
  color: #666;
  font-size: 13px;
  z-index: 10;
  pointer-events: none;
  max-width: 280px;
}

/* Choropleth legend */
.leaflet-choropleth-legend {
  line-height: 1.4;
}

/* CRITICAL: Allow heatmap blur effects to render outside canvas bounds */
.leaflet-map-container canvas {
  overflow: visible !important;
}

/* CRITICAL: Force heatmap canvas ABOVE EVERYTHING */
.leaflet-heatmap-layer {
  z-index: 99999 !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  pointer-events: none !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Dark theme support */
.chart-dark-bg .leaflet-map-container {
  background: #1a1a2e;
}
.chart-dark-bg .leaflet-map-container .leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.5);
  color: #aaa;
}
.chart-dark-bg .leaflet-map-container .leaflet-popup-content-wrapper {
  background: #2d2d3d;
  color: #e0e0e0;
  border: 1px solid #444;
}
.chart-dark-bg .leaflet-map-container .leaflet-popup-tip {
  background: #2d2d3d;
}

/**
 * Leaflet Interactive Controls CSS
 * Controls positioned ABOVE the map in normal document flow
 */

/* Wrapper for all controls - sits above map */
.leaflet-controls-wrapper {
  margin-bottom: 10px;
  position: relative;
}

/* Map Title - Displayed above settings panel */
.leaflet-map-title {
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 2px solid rgba(0, 0, 0, 0.05);
  font-size: 16px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

/* Settings Panel - Always visible, no toggle button */
.leaflet-interactive-panel {
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* Animation removed - panel is always visible */

/* Panel Header - With toggle button */
.leaflet-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.leaflet-control-toggle {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.leaflet-control-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.leaflet-control-toggle.collapsed {
  transform: rotate(-90deg);
}

.leaflet-control-toggle svg {
  display: block;
}

/* Panel Body - Vertical stack of horizontal rows */
.leaflet-control-body {
  padding: 16px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.leaflet-control-body.collapsed {
  max-height: 0;
  padding: 0 16px;
  overflow: hidden;
}

/* Horizontal row - elements side by side */
.leaflet-control-row {
  display: flex !important;
  flex-direction: row !important; /* FORCE HORIZONTAL layout */
  flex-wrap: nowrap !important;
  align-items: flex-start !important; /* Align all elements at the top */
  gap: 40px !important; /* Large spacing between columns */
  padding: 16px 0 !important;
}

/* Column within row - Label on top, control below */
.leaflet-control-field-inline {
  display: flex;
  flex-direction: column; /* Label ABOVE control in SAME column */
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
  min-width: fit-content;
}

/* Vertical divider between control groups */
.leaflet-control-divider {
  width: 2px;
  height: 40px;
  background: linear-gradient(180deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
  border-radius: 1px;
  flex-shrink: 0;
  align-self: center;
}

.leaflet-control-field-inline label {
  font-size: 14px; /* Reduced by 1pt */
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  display: flex; /* Changed from block to flex for baseline alignment */
  align-items: baseline; /* Align label text and value spans on same baseline */
  gap: 6px; /* Space between label text and value span */
  line-height: 1.4;
  height: 20px; /* Fixed height to ensure all labels align at same vertical position */
}

/* Value display with FIXED width to prevent jumping */
.leaflet-control-value {
  display: inline-block;
  min-width: 50px; /* Fixed width for "100px", "100%" */
  text-align: left;
  font-weight: 600;
  color: #667eea;
  vertical-align: baseline; /* Ensure baseline alignment within flex labels */
}

.leaflet-control-field-inline .leaflet-control-checkbox {
  margin: 0;
  gap: 8px;
}

/* Compact inputs for inline layout */
.leaflet-control-input-compact {
  padding: 7px 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px; /* Reduced by 1pt */
  min-width: 150px;
  max-width: 170px;
  transition: border-color 0.2s ease;
}

.leaflet-control-input-compact:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Compact slider for inline layout */
.leaflet-control-slider-compact {
  width: 120px;
  height: 6px;
  background: #ddd;
  border: none;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* Toggle button - just label, active state via background color */
.leaflet-control-toggle-button {
  padding: 7px 14px;
  border: 2px solid #667eea;
  border-radius: 6px;
  background: white;
  color: #667eea;
  font-size: 14px; /* Reduced by 1pt */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 110px;
  text-align: center;
}

.leaflet-control-toggle-button:hover {
  background: rgba(102, 126, 234, 0.08);
}

.leaflet-control-toggle-button.active {
  background: #667eea;
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.leaflet-control-toggle-button:active {
  transform: scale(0.98);
}

.leaflet-control-slider-compact::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #667eea;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.leaflet-control-slider-compact::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

.leaflet-control-slider-compact::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #667eea;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.leaflet-control-slider-compact::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

/* Scrollbar styling */
.leaflet-control-body::-webkit-scrollbar {
  width: 8px;
}

.leaflet-control-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.leaflet-control-body::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.leaflet-control-body::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Control Field */
.leaflet-control-field {
  margin-bottom: 16px;
}

.leaflet-control-field:last-child {
  margin-bottom: 0;
}

.leaflet-control-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}

.leaflet-control-field small {
  display: block;
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

/* Input Styling */
.leaflet-control-input,
.leaflet-control-slider {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  transition: border-color 0.2s ease;
}

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

/* Slider Styling */
.leaflet-control-slider {
  padding: 0;
  height: 6px;
  background: #ddd;
  border: none;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.leaflet-control-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: #667eea;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.leaflet-control-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.leaflet-control-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #667eea;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.leaflet-control-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

/* Value Display */
.leaflet-control-value {
  font-weight: 600;
  color: #667eea;
}

/* Checkbox Styling */
.leaflet-control-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.leaflet-control-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.leaflet-control-checkbox span {
  font-size: 14px; /* Reduced by 1pt */
  font-weight: 600;
  color: #333;
}

/* Dual Slider (for marker size min/max) */
.leaflet-control-dual-slider {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaflet-control-dual-slider .leaflet-control-slider {
  margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .leaflet-interactive-panel {
    width: 95%;
    max-width: none;
  }

  .leaflet-control-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .leaflet-control-field-inline {
    width: 100%;
  }

  .leaflet-control-slider-compact {
    width: 100%;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .leaflet-interactive-panel {
    background: #1e1e1e;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .leaflet-control-body {
    background: #1e1e1e;
  }

  .leaflet-control-field label,
  .leaflet-control-field-inline label {
    color: #e0e0e0;
  }

  .leaflet-control-field small {
    color: #999;
  }

  .leaflet-control-input,
  .leaflet-control-input-compact {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
  }

  .leaflet-control-slider,
  .leaflet-control-slider-compact {
    background: #444;
  }

  .leaflet-control-body::-webkit-scrollbar-track {
    background: #2a2a2a;
  }

  .leaflet-map-title {
    background: #2a2a2a;
    color: #e0e0e0;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
}

/**
 * SpaceVDL Canvas Styles
 *
 * Styles for 3D Solar System visualization component
 */

/* Canvas Container */
.spacevdl-canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #0a0a1a 0%, #000000 100%);
}

/* Canvas element */
.spacevdl-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Tooltip (positioned dynamically via JS) */
.spacevdl-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: none;
  max-width: 300px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.4;
}

.spacevdl-tooltip strong {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 15px;
}

.spacevdl-tooltip small {
  color: #aaa;
  font-size: 12px;
}

/* Loading Spinner */
.spacevdl-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 100;
}

.spacevdl-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spacevdl-spin 1s linear infinite;
  margin: 0 auto 10px;
}

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

.spacevdl-loading-text {
  font-size: 14px;
  color: #ccc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Controls Overlay */
.spacevdl-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 8px;
  backdrop-filter: blur(5px);
  z-index: 10;
}

.spacevdl-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.spacevdl-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.spacevdl-controls button:active {
  background: rgba(255, 255, 255, 0.3);
}

.spacevdl-controls button.active {
  background: rgba(66, 153, 225, 0.4);
  border-color: rgba(66, 153, 225, 0.6);
}

/* Info Panel */
.spacevdl-info-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px;
  border-radius: 8px;
  min-width: 250px;
  max-width: 350px;
  backdrop-filter: blur(5px);
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.spacevdl-info-panel h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
}

.spacevdl-info-panel .info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.spacevdl-info-panel .info-label {
  color: #aaa;
}

.spacevdl-info-panel .info-value {
  color: #fff;
  font-weight: 500;
}

/* Legend */
.spacevdl-legend {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 15px;
  border-radius: 8px;
  backdrop-filter: blur(5px);
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.spacevdl-legend h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 6px;
}

.spacevdl-legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.spacevdl-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.spacevdl-legend-label {
  color: #ccc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .spacevdl-controls {
    bottom: 10px;
    padding: 8px 12px;
  }

  .spacevdl-controls button {
    padding: 6px 12px;
    font-size: 12px;
  }

  .spacevdl-info-panel,
  .spacevdl-legend {
    max-width: 200px;
    padding: 10px;
    top: 10px;
  }

  .spacevdl-info-panel {
    right: 10px;
  }

  .spacevdl-legend {
    left: 10px;
  }

  .spacevdl-tooltip {
    max-width: 200px;
    font-size: 12px;
  }
}

/* Animation classes */
.spacevdl-fade-in {
  animation: spacevdl-fadeIn 0.3s ease-in;
}

@keyframes spacevdl-fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.spacevdl-fade-out {
  animation: spacevdl-fadeOut 0.2s ease-out;
}

@keyframes spacevdl-fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Object selection highlight */
.spacevdl-selected {
  outline: 2px solid rgba(66, 153, 225, 0.8);
  outline-offset: 2px;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .spacevdl-canvas-container {
    background: radial-gradient(circle at center, #0a0a1a 0%, #000000 100%);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .spacevdl-tooltip {
    background: rgba(0, 0, 0, 1);
    border: 1px solid white;
  }

  .spacevdl-controls button {
    border-width: 2px;
  }

  .spacevdl-info-panel,
  .spacevdl-legend {
    background: rgba(0, 0, 0, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
  }
}

/* Print styles */
@media print {
  .spacevdl-controls,
  .spacevdl-tooltip {
    display: none !important;
  }

  .spacevdl-canvas-container {
    background: white;
  }
}

/**
 * webhook-management.css
 *
 * Styling for Webhook Management Panel
 * Pattern: dashboard-builder.css color scheme and spacing
 */

/* ========================================
   Panel Header
   ======================================== */

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

.webhook-management .panel-header {
  margin-bottom: 2rem;
}

.webhook-management .panel-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.webhook-management .panel-header .subtitle {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
}

/* ========================================
   Platform Cards Section
   ======================================== */

.platform-cards-section {
  margin-bottom: 3rem;
}

.platform-cards-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #1e293b;
}

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

.platform-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.platform-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.platform-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.platform-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.platform-description {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.75rem;
  min-height: 3em;
}

.platform-pricing {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.platform-active-badge {
  display: inline-block;
  background: #10b981;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.platform-guide-link {
  display: inline-block;
  font-size: 0.875rem;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.platform-guide-link:hover {
  color: #5568d3;
  text-decoration: underline;
}

/* ========================================
   Webhooks List Section
   ======================================== */

.webhooks-list-section {
  margin-bottom: 2rem;
}

.webhooks-list-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #1e293b;
}

/* Empty State */
.empty-state {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 3rem 2rem;
  text-align: center;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.empty-state p {
  color: #64748b;
  margin: 0;
}

/* Webhooks Table */
.webhooks-table-wrapper {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.webhooks-table {
  width: 100%;
  border-collapse: collapse;
}

.webhooks-table thead {
  background: #f8fafc;
}

.webhooks-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.webhooks-table tbody tr {
  transition: background-color 0.15s ease;
}

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

.webhooks-table tbody tr.webhook-inactive {
  opacity: 0.6;
}

.webhooks-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.875rem;
}

.webhooks-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status Icon */
.status-icon {
  font-size: 1.25rem;
  display: inline-block;
}

.status-update-flash {
  animation: flash-pulse 1s ease;
}

@keyframes flash-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Webhook URL */
.webhook-url {
  color: #667eea;
  text-decoration: none;
  transition: color 0.2s ease;
}

.webhook-url:hover {
  color: #5568d3;
  text-decoration: underline;
}

/* Event Count Badge */
.event-count {
  display: inline-block;
  background: #e0e7ff;
  color: #4338ca;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Success Rate */
.success-rate {
  font-weight: 600;
  margin-right: 0.5rem;
}

.delivery-count {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Webhook Actions */
.webhook-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-icon {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* ========================================
   Add Webhook Section
   ======================================== */

.add-webhook-section {
  text-align: center;
  margin-top: 2rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

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

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

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .webhook-management {
    padding: 1rem;
  }

  .platform-cards-grid {
    grid-template-columns: 1fr;
  }

  .webhooks-table-wrapper {
    overflow-x: auto;
  }

  .webhooks-table {
    min-width: 800px;
  }

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

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
  .webhook-management .panel-header h2 {
    color: #e2e8f0;
  }

  .webhook-management .panel-header .subtitle {
    color: #94a3b8;
  }

  .platform-card {
    background: #1e293b;
    border-color: #334155;
  }

  .platform-card h4 {
    color: #e2e8f0;
  }

  .platform-description {
    color: #94a3b8;
  }

  .webhooks-table-wrapper {
    background: #1e293b;
    border-color: #334155;
  }

  .webhooks-table th {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
  }

  .webhooks-table td {
    border-color: #334155;
    color: #cbd5e1;
  }

  .webhooks-table tbody tr:hover {
    background: #0f172a;
  }

  .empty-state {
    background: #0f172a;
    border-color: #334155;
  }

  .empty-state h4 {
    color: #e2e8f0;
  }

  .empty-state p {
    color: #94a3b8;
  }
}

/* ========================================
   Webhook Type Buttons
   ======================================== */

.webhook-type-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.webhook-type-buttons .btn-large {
  flex: 1;
  padding: 0.875rem 1.25rem;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.webhook-type-hint {
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

/* Success Box (Incoming Webhook Created) */
.success-box {
  background: #dcfce7;
  border: 2px solid #22c55e;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.success-box p {
  margin: 0.5rem 0;
  color: #166534;
}

.success-box strong {
  color: #15803d;
}

/* Info Box */
.info-box {
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.info-box strong {
  color: #0369a1;
  display: block;
  margin-bottom: 0.5rem;
}

.info-box p {
  margin: 0.5rem 0;
  color: #075985;
  font-size: 0.875rem;
  line-height: 1.5;
}

.info-box ol {
  margin: 0.5rem 0 0 1.5rem;
  color: #075985;
  font-size: 0.875rem;
}

.info-box ul {
  margin: 0.25rem 0 0 1.5rem;
  font-size: 0.875rem;
}

.info-box a {
  color: #0284c7;
  text-decoration: none;
}

.info-box a:hover {
  text-decoration: underline;
}

/* Copy Input Group */
.copy-input-group {
  display: flex;
  gap: 0.5rem;
}

.copy-input-group input {
  flex: 1;
  font-family: monospace;
  font-size: 0.875rem;
}

.copy-input-group .btn-icon {
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.copy-input-group .btn-icon:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* Warning Hint */
.form-hint.warning {
  color: #dc2626;
  font-weight: 600;
}

/**
 * webhook-modals.css
 *
 * Styling for Webhook modals (Create, Edit, Test, Logs)
 * Pattern: ShareEmbedModal.ts styling (fixed overlay + modal)
 */

/* ========================================
   Modal Overlay & Container
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 100000; /* Same as ProfileModal to stay on top */
  animation: fadeIn 0.2s ease;
  display: none; /* Hidden by default */
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.webhook-create-modal,
.webhook-edit-modal,
.webhook-test-modal,
.webhook-logs-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 100001; /* Higher than ProfileModal (100000) */
  max-width: 700px; /* Increased from 600px for better content fit */
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.webhook-logs-modal {
  max-width: 900px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ========================================
   Modal Header
   ======================================== */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1e293b;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  transition: color 0.2s ease;
  padding: 0.5rem;
  line-height: 1;
}

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

/* ========================================
   Modal Body
   ======================================== */

.modal-body {
  padding: 2rem;
}

/* ========================================
   Form Groups
   ======================================== */

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1e293b;
  font-size: 0.875rem;
}

.required {
  color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.form-hint.warning {
  color: #ea580c;
  font-weight: 500;
}

/* Info and Success Boxes */
.info-box,
.success-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.success-box {
  background: #f0fdf4;
  border-color: #86efac;
}

.info-box p,
.success-box p {
  margin: 0.5rem 0;
}

.info-box ol,
.info-box ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.info-box li {
  margin: 0.25rem 0;
}

/* Copy Input Group */
.copy-input-group {
  display: flex;
  gap: 0.5rem;
}

.copy-input-group input {
  flex: 1;
  min-width: 0; /* Allow input to shrink below content size */
  word-break: break-all;
}

/* ========================================
   Secret Input Wrapper
   ======================================== */

.secret-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.secret-input-wrapper input {
  flex: 1;
}

.secret-input-wrapper .btn-icon {
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.secret-input-wrapper .btn-icon:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

/* ========================================
   Event Types Checkboxes
   ======================================== */

.event-types-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  cursor: pointer;
}

.checkbox-icon {
  font-size: 1.5rem;
}

.checkbox-text {
  flex: 1;
}

.checkbox-text strong {
  display: block;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.checkbox-text small {
  color: #64748b;
}

/* ========================================
   Advanced Settings
   ======================================== */

.advanced-settings {
  margin-top: 2rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 6px;
}

.advanced-settings summary {
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
  margin-bottom: 1rem;
}

.advanced-settings summary:hover {
  color: #1e293b;
}

.advanced-settings[open] summary {
  margin-bottom: 1.5rem;
}

/* ========================================
   Modal Actions (Buttons)
   ======================================== */

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

.btn-secondary:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

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

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

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

/* ========================================
   Test Response Display
   ======================================== */

.test-response {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.response-loading,
.response-success,
.response-error {
  text-align: center;
}

.response-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.response-loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #667eea;
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

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

.response-success {
  background: #dcfce7;
  border-color: #22c55e;
}

.response-success h4 {
  color: #15803d;
  margin-bottom: 0.5rem;
}

.response-success p {
  color: #166534;
  margin: 0.25rem 0;
}

.response-success code {
  background: rgba(255, 255, 255, 0.5);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.875rem;
}

.response-error {
  background: #fee2e2;
  border-color: #ef4444;
}

.response-error h4 {
  color: #dc2626;
  margin-bottom: 0.5rem;
}

.response-error p {
  color: #991b1b;
  margin: 0.25rem 0;
}

.response-error code {
  background: rgba(255, 255, 255, 0.5);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.875rem;
}

.test-response small {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Webhook Info Header */
.webhook-info {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.webhook-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: #1e293b;
}

.webhook-url {
  color: #667eea;
  font-size: 0.875rem;
  word-break: break-all;
}

/* ========================================
   Logs Controls
   ======================================== */

.logs-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 6px;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 600;
  font-size: 0.875rem;
  color: #475569;
}

.filter-group select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 0.875rem;
}

.refresh-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.auto-refresh-toggle input[type="checkbox"] {
  cursor: pointer;
}

/* ========================================
   Webhook Logs Table
   ======================================== */

.logs-table-wrapper {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-top: 1rem;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
}

.logs-table thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.logs-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.logs-table td {
  padding: 0.75rem;
  font-size: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

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

.log-status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
}

.log-status-success {
  background: #dcfce7;
  color: #15803d;
}

.log-status-failed {
  background: #fee2e2;
  color: #dc2626;
}

.log-status-retrying {
  background: #fef3c7;
  color: #ca8a04;
}

.log-status-pending {
  background: #e0e7ff;
  color: #4338ca;
}

/* ========================================
   Pagination
   ======================================== */

.logs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.pagination-info {
  font-size: 0.875rem;
  color: #64748b;
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
}

.pagination-controls button {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.pagination-controls button:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 640px) {
  .webhook-create-modal,
  .webhook-edit-modal,
  .webhook-test-modal,
  .webhook-logs-modal {
    width: 95%;
    max-height: 95vh;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-header {
    padding: 1rem 1.5rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .secret-input-wrapper {
    flex-wrap: wrap;
  }

  .secret-input-wrapper input {
    width: 100%;
  }

  .secret-input-wrapper .btn-icon {
    flex: 1;
  }
}

/* ========================================
   Dark Mode Support (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
  .webhook-create-modal,
  .webhook-edit-modal,
  .webhook-test-modal,
  .webhook-logs-modal {
    background: #1e293b;
  }

  .modal-header {
    border-color: #334155;
  }

  .modal-header h2 {
    color: #e2e8f0;
  }

  .modal-close {
    color: #cbd5e1;
  }

  .modal-close:hover {
    color: #e2e8f0;
  }

  .form-group label {
    color: #e2e8f0;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
  }

  .form-hint {
    color: #94a3b8;
  }

  .checkbox-label {
    border-color: #334155;
  }

  .checkbox-label:hover {
    background: #0f172a;
  }

  .checkbox-text strong {
    color: #e2e8f0;
  }

  .checkbox-text small {
    color: #94a3b8;
  }

  .advanced-settings {
    background: #0f172a;
    border-color: #334155;
  }

  .modal-actions {
    border-color: #334155;
  }

  .btn-secondary {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
  }

  .btn-secondary:hover {
    background: #334155;
  }
}

/* Scheduled Reports Modal */
.scheduled-reports-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: srFadeIn 0.2s ease-out;
}

@keyframes srFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.scheduled-reports-modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: srSlideUp 0.25s ease-out;
}

/* Header */
.sr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.sr-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

.sr-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-left: 12px;
}

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

/* Body */
.sr-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Buttons */
.sr-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.sr-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.sr-btn-primary {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.sr-btn-primary:hover {
  background: #4338ca;
  border-color: #4338ca;
}

.sr-btn-sm {
  padding: 4px 8px;
  font-size: 14px;
  border: none;
  background: transparent;
  border-radius: 6px;
}

.sr-btn-sm:hover {
  background: #f3f4f6;
}

.sr-btn-close {
  font-size: 24px;
  line-height: 1;
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 4px 8px;
}

.sr-btn-close:hover {
  color: #374151;
}

/* Empty State */
.sr-empty {
  text-align: center;
  padding: 60px 20px;
}

.sr-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.sr-empty h3 {
  font-size: 18px;
  color: #1f2937;
  margin: 0 0 8px;
}

.sr-empty p {
  color: #6b7280;
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.5;
}

/* Schedule Cards */
.sr-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sr-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.sr-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sr-card-inactive {
  opacity: 0.6;
}

.sr-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
}

.sr-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sr-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.sr-card-actions {
  display: flex;
  gap: 2px;
}

.sr-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sr-status-active {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.sr-status-paused {
  background: #9ca3af;
}

.sr-template-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #6366f1;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

.sr-card-body {
  padding: 14px 16px;
}

.sr-card-info {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

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

.sr-info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.3px;
}

.sr-info-value {
  font-size: 13px;
  color: #374151;
}

.sr-card-prompt {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.sr-card-prompt p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #4b5563;
  font-style: italic;
}

.sr-card-error {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 12px;
  color: #991b1b;
}

.sr-status-icon {
  margin-left: 4px;
}

/* Form */
.sr-form {
  max-width: 560px;
  margin: 0 auto;
}

.sr-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.sr-form-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.sr-form-group {
  margin-bottom: 18px;
}

.sr-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.sr-form-group input,
.sr-form-group select,
.sr-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #1f2937;
  background: #fff;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.sr-form-group input:focus,
.sr-form-group select:focus,
.sr-form-group textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.sr-form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #9ca3af;
}

.sr-form-group small code {
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}

.sr-form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

/* =============================================================================
   PROMPT LIBRARY MODAL
   ============================================================================= */

@keyframes plFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.pl-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: plFadeIn 0.2s ease-out;
}

.pl-modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: plSlideUp 0.25s ease-out;
}

.pl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.pl-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}

.pl-btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.pl-btn-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.pl-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Toolbar */
.pl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.pl-tabs {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
}

.pl-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.pl-tab:hover {
  color: #374151;
}

.pl-tab-active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pl-toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pl-filter-category {
  padding: 7px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  background: #fff;
  cursor: pointer;
}

/* Buttons */
.pl-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.pl-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.pl-btn-primary {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.pl-btn-primary:hover {
  background: #4338ca;
  border-color: #4338ca;
}

/* Card Grid */
.pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.pl-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s;
  cursor: default;
}

.pl-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.pl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pl-card-name {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pl-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.pl-card-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.pl-card-preview {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 60px;
  overflow: hidden;
}

.pl-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

.pl-card-meta {
  font-size: 11px;
  color: #9ca3af;
}

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

.pl-btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.pl-btn-icon:hover {
  background: #f3f4f6;
}

/* Empty State */
.pl-empty {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* Form */
.pl-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.pl-form-container h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.pl-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pl-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pl-form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.pl-form-group input,
.pl-form-group select,
.pl-form-group textarea {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s;
}

.pl-form-group input:focus,
.pl-form-group select:focus,
.pl-form-group textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.pl-form-group textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

.pl-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* =============================================================================
   PROMPT PICKER (Popover)
   ============================================================================= */

.pp-popover {
  position: fixed;
  width: 360px;
  max-height: 400px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 100001;
  display: flex;
  flex-direction: column;
  animation: plSlideUp 0.15s ease-out;
}

.pp-header {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.pp-search {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.pp-search:focus {
  border-color: #4f46e5;
}

.pp-category-filter {
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  color: #6b7280;
  background: #fff;
  cursor: pointer;
}

.pp-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.pp-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 8px 4px;
}

.pp-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.pp-item:hover {
  background: #f5f3ff;
}

.pp-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pp-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pp-item-badge {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.pp-item-desc {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.pp-empty {
  text-align: center;
  padding: 30px;
  color: #9ca3af;
  font-size: 13px;
}

/* =============================================================================
   PROMPT PICKER TRIGGER BUTTON (for NLQueryBar, ScheduledReportsModal)
   ============================================================================= */

.prompt-picker-trigger {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.prompt-picker-trigger:hover {
  background: #f5f3ff;
  border-color: #c7d2fe;
  color: #4f46e5;
}

/**
 * ScenarioCreatorModal Styles
 *
 * Professional modal styling for scenario creation with:
 * - Purple gradient header
 * - Smooth animations
 * - Responsive form layout
 * - Preview results table
 * - Loading overlay
 */

/* Modal Container */
.scenario-creator-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.scenario-creator-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Modal Content */
.scenario-creator-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Header */
.scenario-creator-modal .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}

.scenario-creator-modal .modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.scenario-creator-modal .modal-close {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scenario-creator-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Body */
.scenario-creator-modal .modal-body {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
}

/* Form Sections */
.form-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.section-description {
  margin: 0 0 20px 0;
  color: #6b7280;
  font-size: 14px;
}

/* Form Groups */
.form-group {
  margin-bottom: 20px;
}

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

.form-group .required {
  color: #ef4444;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

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

.form-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* Form Rows */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Metrics List */
.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metric-adjustment-row {
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s;
}

.metric-adjustment-row:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

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

.metric-label {
  font-weight: 500;
  color: #1f2937;
  font-size: 14px;
}

.metric-current {
  font-size: 13px;
  color: #6b7280;
  background: #ffffff;
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.adjustment-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adjustment-inputs {
  display: none;
  gap: 12px;
  align-items: center;
}

.adjustment-inputs .form-control {
  flex: 1;
}

.adjustment-inputs .adjustment-type {
  min-width: 180px;
}

.adjustment-inputs .adjustment-direction {
  min-width: 140px;
}

.adjustment-inputs .adjustment-value {
  max-width: 120px;
}

.adjustment-inputs .budget-allocation {
  max-width: 140px;
}

/* No Metrics Message */
.no-metrics-message {
  text-align: center;
  padding: 40px 20px;
  background: #fef3c7;
  border: 2px dashed #f59e0b;
  border-radius: 8px;
  color: #92400e;
}

.no-metrics-message p {
  margin: 0 0 8px 0;
}

.no-metrics-message p:last-child {
  margin: 0;
  font-size: 14px;
  color: #b45309;
}

/* Preview Section */
.preview-section {
  background: #f0f9ff;
  padding: 24px;
  border-radius: 8px;
  border: 2px solid #0ea5e9;
}

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

.preview-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0c4a6e;
}

.preview-header small {
  font-size: 12px;
  color: #075985;
}

/* Preview Table */
.preview-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.preview-table thead {
  background: #0ea5e9;
  color: #ffffff;
}

.preview-table th,
.preview-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
}

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

.preview-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.preview-table tbody tr:last-child {
  border-bottom: none;
}

.preview-table tbody tr:hover {
  background: #f0f9ff;
}

.preview-table .positive {
  color: #16a34a;
  font-weight: 500;
}

.preview-table .negative {
  color: #dc2626;
  font-weight: 500;
}

/* Budget Summary */
.budget-summary {
  background: #ffffff;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.budget-summary.over-budget {
  border-color: #ef4444;
  background: #fef2f2;
}

.budget-summary h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.budget-row:last-of-type {
  border-bottom: none;
  font-weight: 600;
}

.budget-row.positive {
  color: #16a34a;
}

.budget-row.negative {
  color: #dc2626;
}

.budget-warning {
  margin-top: 12px;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 500;
}

/* Footer */
.scenario-creator-modal .modal-footer {
  padding: 20px 32px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.scenario-creator-modal .btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.scenario-creator-modal .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

.scenario-creator-modal .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.scenario-creator-modal .btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.scenario-creator-modal .btn-secondary:hover {
  background: #e5e7eb;
}

.scenario-creator-modal .btn-cancel {
  background: transparent;
  color: #6b7280;
}

.scenario-creator-modal .btn-cancel:hover {
  color: #374151;
  background: #f3f4f6;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 100;
}

.loading-overlay .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-overlay p {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .scenario-creator-content {
    width: 95%;
    max-height: 95vh;
  }

  .scenario-creator-modal .modal-header {
    padding: 20px 24px;
  }

  .scenario-creator-modal .modal-header h2 {
    font-size: 20px;
  }

  .scenario-creator-modal .modal-body {
    padding: 24px;
  }

  .scenario-creator-modal .modal-footer {
    padding: 16px 24px;
    flex-wrap: wrap;
  }

  .scenario-creator-modal .btn {
    flex: 1;
    min-width: 120px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .adjustment-inputs .form-control {
    min-width: 140px;
  }
}

/**
 * InviteMemberModal Styles
 *
 * Professional modal styling for organisation member invitation with:
 * - Purple gradient header
 * - Clean form layout
 * - Role dropdown with descriptions
 * - Error message display
 * - Smooth animations
 */

/* Modal Container */
.invite-member-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100002; /* Higher than ProfileModal (100000) and Webhook Modals (100001) */
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.invite-member-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

/* Modal Content */
.invite-member-content {
  position: relative;
  width: 90%;
  max-width: 550px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Header */
.invite-member-modal .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}

.invite-member-modal .modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.invite-member-modal .modal-close {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.invite-member-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Body */
.invite-member-modal .modal-body {
  padding: 32px;
}

/* Info Box */
.invite-member-modal .info-box {
  background: #f3f4f6;
  border-left: 4px solid #667eea;
  padding: 12px 16px;
  margin-bottom: 24px;
  border-radius: 4px;
  font-size: 14px;
  color: #374151;
}

/* Form Groups */
.invite-member-modal .form-group {
  margin-bottom: 24px;
}

.invite-member-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.invite-member-modal .form-group label .required {
  color: #ef4444;
  margin-left: 4px;
}

.invite-member-modal .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.invite-member-modal .form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.invite-member-modal .form-control:invalid {
  border-color: #ef4444;
}

.invite-member-modal .form-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

/* Error Message */
.invite-member-modal .error-message {
  background: #fee2e2;
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #991b1b;
  font-size: 14px;
  display: none;
}

/* Footer */
.invite-member-modal .modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.invite-member-modal .btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.invite-member-modal .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.invite-member-modal .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
}

.invite-member-modal .btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.invite-member-modal .btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.invite-member-modal .btn-secondary:hover {
  background: #e5e7eb;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Responsive */
@media (max-width: 640px) {
  .invite-member-content {
    width: 95%;
    max-width: none;
  }

  .invite-member-modal .modal-header {
    padding: 20px 24px;
  }

  .invite-member-modal .modal-body {
    padding: 24px;
  }

  .invite-member-modal .modal-header h2 {
    font-size: 20px;
  }
}

/* Artifact Renderer - KI-generierte interaktive Visualisierungen */

.artifact-container {
  background: var(--surface, #1e293b);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--border, #334155);
}

.artifact-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
  background: var(--surface-elevated, #1e293b);
  border-bottom: 1px solid var(--border, #334155);
}

.artifact-toolbar-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-badge {
  background: #667eea;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.artifact-toolbar-btn {
  background: none;
  border: 1px solid var(--border, #475569);
  color: var(--text-secondary, #94a3b8);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.artifact-toolbar-btn:hover {
  background: var(--surface-hover, #334155);
  color: var(--text-primary, #e2e8f0);
  border-color: var(--border-hover, #667eea);
}

.artifact-frame-wrapper {
  position: relative;
  background: #1a1a2e;
}

.artifact-frame-wrapper iframe {
  width: 100%;
  min-height: 400px;
  border: none;
  border-radius: 0 0 12px 12px;
  display: block;
}

.artifact-description {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary, #94a3b8);
  background: var(--surface-elevated, #1e293b);
  border-top: 1px solid var(--border, #334155);
}

/* Fullscreen mode */
.artifact-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f172a;
  border-radius: 0;
  border: none;
}

.artifact-fullscreen .artifact-frame-wrapper iframe {
  min-height: calc(100vh - 44px);
  border-radius: 0;
}

.artifact-fullscreen .artifact-toolbar {
  border-radius: 0;
}

/* Loading state */
.artifact-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-secondary, #94a3b8);
  font-size: 13px;
  gap: 8px;
}

.artifact-loading .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border, #475569);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/**
 * JobBadge Styles - Header notification badge for active jobs
 */

.job-badge-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.job-badge-button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.job-badge-button.active {
  background: #667eea;
  border-color: #667eea;
  color: white;
  animation: pulse-badge 2s ease-in-out infinite;
}

.job-badge-button.active:hover {
  background: #5a67d8;
  border-color: #5a67d8;
}

.job-badge-count {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: white;
  color: #667eea;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.job-badge-button.active .job-badge-count {
  animation: pulse-count 1s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  }
}

@keyframes pulse-count {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/**
 * JobPanel Styles - Sliding panel for job management
 */

.job-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.job-panel.open {
  transform: translateX(0);
}

.job-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9997;
}

.job-panel-content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 9999; /* Above overlay */
}

.job-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.job-panel-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.job-panel-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.job-panel-close:hover {
  opacity: 1;
}

.job-panel-filters {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow-x: auto;
}

.filter-btn {
  padding: 6px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.filter-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.job-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.job-panel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #94a3b8;
  font-size: 14px;
}

.job-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.job-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.job-card.processing {
  border-left: 4px solid #667eea;
}

.job-card.completed {
  border-left: 4px solid #10b981;
}

.job-card.failed {
  border-left: 4px solid #ef4444;
}

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

.job-query {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.5;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.processing {
  background: #dbeafe;
  color: #1e40af;
}

.status-badge.completed {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.cancelled {
  background: #f1f5f9;
  color: #475569;
}

.job-progress {
  margin-bottom: 12px;
}

.job-progress-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.job-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.job-progress-text {
  font-size: 12px;
  color: #64748b;
}

.job-error {
  padding: 8px 12px;
  background: #fee2e2;
  border-radius: 6px;
  font-size: 13px;
  color: #991b1b;
  margin-bottom: 12px;
  line-height: 1.4;
}

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-time {
  font-size: 12px;
  color: #94a3b8;
}

.job-actions {
  display: flex;
  gap: 8px;
}

.job-action-btn {
  padding: 6px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.job-action-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.job-action-btn.view {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.job-action-btn.view:hover {
  background: #5a67d8;
  border-color: #5a67d8;
}

.job-action-btn.cancel {
  border-color: #fca5a5;
  color: #dc2626;
}

.job-action-btn.cancel:hover {
  background: #fee2e2;
}

.job-action-btn.retry {
  border-color: #fbbf24;
  color: #d97706;
}

.job-action-btn.retry:hover {
  background: #fef3c7;
}

.job-action-btn.delete {
  border-color: #f87171;
  color: #b91c1c;
}

.job-action-btn.delete:hover {
  background: #fecaca;
  border-color: #dc2626;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .job-panel {
    max-width: 100%;
  }

  .job-panel-header {
    padding: 16px 20px;
  }

  .job-panel-filters {
    padding: 12px 20px;
  }

  .job-panel-list {
    padding: 12px 20px;
  }

  .job-card {
    padding: 12px;
  }

  .job-actions {
    flex-direction: column;
    width: 100%;
  }

  .job-action-btn {
    width: 100%;
  }
}

