/* 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 {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 0;
  padding: 0;
}

.canvas-full-table-container #data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #4a90e2;
  margin: 0;
  padding: 0;
}

.canvas-full-table-container #data-table th {
  background: #4a90e2;
  color: white;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #3a7bc8;
  white-space: nowrap;
}

.canvas-full-table-container #data-table td {
  padding: 10px 16px;
  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) {
  background: #f8f9fa;
}

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

/* 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-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;
}

.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: 16px;
  width: 100%;
  overflow-y: visible;
  overflow-x: hidden;
  padding-bottom: 32px;
}

.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, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.grid-layout-container.grid-3x2 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.grid-layout-container.grid-4x2 {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.grid-layout-container.grid-2x3 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.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;
}

.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 {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: #f6f8fa;
  border-bottom: 1px solid #e1e4e8;
  border-radius: 8px 8px 0 0;
  gap: 6px;
}

.chart-title-text {
  font-size: 14px;
  font-weight: 600;
  color: #24292e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.4;
}

.chart-header-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-dataset-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  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-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.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-action-btn:hover {
  background: #e1e4e8;
  color: #24292e;
}

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

.chart-canvas-area {
  flex: 1;
  padding: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 400px;
}

.chart-canvas-area canvas {
  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;
}

/* 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-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-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%;
}

.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: 16px;
  padding: 0;
}

/* 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;
}

/* 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;
  }
}
