/* ==========================================================================
   BRO — AI DATA ANALYST ENTERPRISE DESIGN SYSTEM
   Palette:
   - White / Neutral Light: #FFFFFF, #F8F9FA, #F1F3F5 (Workspace)
   - Black / Dark Neutral: #0B0D0F, #14171A, #1E2227 (Navigation & Structural Headers)
   - Red: #D32F2F, #E53935, #B71C1C (Active Nav, Primary Actions, Alerts)
   - Navy Blue: #0B1522, #142236, #1C2E46 (BRO AI Interface)
   - Dark Maroon: #4A1521, #66182C, #300C14 (BRO Secondary Accent)
   ========================================================================== */

:root {
  --bg-workspace: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-card-alt: #F4F6F8;
  --border-color: #E2E8F0;
  --border-dark: #1E2227;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;

  --nav-bg: #0B0D0F;
  --nav-border: #1E2227;
  --nav-text: #94A3B8;
  --nav-active-text: #FFFFFF;
  --nav-active-bg: #D32F2F;

  --color-red: #D32F2F;
  --color-red-hover: #B71C1C;
  --color-red-light: #FFEBEE;
  
  --bro-navy-dark: #070D15;
  --bro-navy: #0B1522;
  --bro-navy-light: #142236;
  --bro-navy-card: #1A2A42;
  --bro-maroon: #4A1521;
  --bro-maroon-hover: #66182C;
  --bro-maroon-light: #7E1E35;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --radius-sharp: 2px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-workspace);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==================== Top Navigation Bar ==================== */
.top-navbar {
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background-color: rgba(255, 255, 255, 0.22);
}

.brand-suffix {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  font-family: var(--font-sans);
}

.nav-links {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1px;
}

.nav-item {
  color: var(--nav-text);
  background: transparent;
  border: none;
  height: 60px;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-bottom: 3px solid transparent;
  position: relative;
  outline: none;
  user-select: none;
  white-space: nowrap;
}

.nav-item:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.06);
}

/* Large standalone icon — prominent and sharp */
.nav-item .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item .nav-icon svg {
  width: 25px !important;
  height: 25px !important;
  stroke-width: 2.1;
  transition: transform 0.2s ease, filter 0.2s ease, color 0.2s ease;
}

.nav-item:hover .nav-icon {
  color: #FFFFFF;
}

.nav-item:hover .nav-icon svg {
  transform: translateY(-1px) scale(1.08);
}

/* Display name ONLY when clicked / active */
.nav-item .nav-label {
  display: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #FFFFFF;
  line-height: 1;
  transition: all 0.2s ease;
}

/* Active & Clicked State: Big icon turns vibrant red with subtle red glow, active bottom line */
.nav-item:active .nav-icon,
.nav-item.active .nav-icon {
  color: #EF4444;
}

.nav-item:active .nav-icon svg,
.nav-item.active .nav-icon svg {
  color: #EF4444;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.7));
  transform: translateY(-1px) scale(1.05);
}

.nav-item:active {
  transform: scale(0.97);
}

.nav-item.active {
  color: #FFFFFF;
  background-color: rgba(220, 38, 38, 0.12);
  border-bottom: 3px solid var(--color-red);
  padding: 0 16px;
}

/* Label is displayed ONLY when clicked/active */
.nav-item.active .nav-label {
  display: inline-block;
  color: #FFFFFF;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: nav-label-appear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes nav-label-appear {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-clear-dataset {
  background-color: transparent;
  color: #94A3B8;
  border: 1px solid #334155;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-dataset:hover {
  color: #FFFFFF;
  border-color: var(--color-red);
  background-color: rgba(211, 47, 47, 0.1);
}

.btn-ask-bro {
  background-color: var(--bro-navy-light);
  color: #FFFFFF;
  border: 1px solid var(--bro-maroon-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-ask-bro:hover {
  background-color: var(--bro-maroon);
  border-color: var(--color-red);
}

.bro-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--color-red);
  border-radius: 50%;
}

/* ==================== Profile Avatar & Popover Dropdown ==================== */
.nav-profile-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--nav-border);
}

.profile-avatar-btn {
  background: linear-gradient(135deg, #D32F2F 0%, #991B1B 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-avatar-btn:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 12px rgba(211, 47, 47, 0.5);
}

.profile-avatar-initial {
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  font-family: var(--font-sans);
  line-height: 1;
  user-select: none;
}

/* Profile Dropdown Popover */
.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 230px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 8px 0;
  z-index: 1050;
  animation: profile-menu-enter 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes profile-menu-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-dropdown-header {
  padding: 10px 16px 12px;
}

.profile-dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-dropdown-email {
  font-size: 12px;
  color: #64748B;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.profile-dropdown-divider {
  height: 1px;
  background: #F1F5F9;
  margin: 4px 0 6px;
}

.profile-dropdown-actions {
  display: flex;
  flex-direction: column;
  padding: 0 6px;
}

/* ONLY TEXT, NO SQUARE BORDER BUTTONS */
.profile-text-btn {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 8px 12px;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.profile-text-btn:hover {
  color: #0F172A;
  background: #F1F5F9 !important;
}

.profile-text-btn.btn-text-logout {
  color: #DC2626;
}

.profile-text-btn.btn-text-logout:hover {
  color: #991B1B;
  background: #FEF2F2 !important;
}

/* ==================== Main Layout Container ==================== */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 80px 24px;
}

.section-view {
  display: none;
}

.section-view.active {
  display: block;
}

.section-header {
  border-bottom: 2px solid var(--border-dark);
  padding-bottom: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== Strict UI Cards & Panels ==================== */
.enterprise-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sharp);
  padding: 18px;
  margin-bottom: 20px;
}

.enterprise-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== Grid Layouts ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.grid-sidebar-main {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.grid-sidebar-main > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3, .grid-4, .grid-sidebar-main {
    grid-template-columns: 1fr;
  }
}

/* ==================== Metric & KPI Cards ==================== */
.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--border-dark);
  border-radius: var(--radius-sharp);
  padding: 14px 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.kpi-card.highlight {
  border-top-color: var(--color-red);
}

.kpi-card.color-blue {
  border-top-color: #3B82F6;
  background: linear-gradient(180deg, #F0F7FF 0%, #FFFFFF 65%);
}

.kpi-card.color-emerald {
  border-top-color: #10B981;
  background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 65%);
}

.kpi-card.color-amber {
  border-top-color: #F59E0B;
  background: linear-gradient(180deg, #FFFBEB 0%, #FFFFFF 65%);
}

.kpi-card.color-purple {
  border-top-color: #8B5CF6;
  background: linear-gradient(180deg, #FAF5FF 0%, #FFFFFF 65%);
}

.kpi-card.color-rose {
  border-top-color: #EC4899;
  background: linear-gradient(180deg, #FDF2F8 0%, #FFFFFF 65%);
}

.kpi-card.color-cyan {
  border-top-color: #06B6D4;
  background: linear-gradient(180deg, #ECFEFF 0%, #FFFFFF 65%);
}

.kpi-card.color-red {
  border-top-color: #EF4444;
  background: linear-gradient(180deg, #FEF2F2 0%, #FFFFFF 65%);
}

.kpi-label {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
  letter-spacing: -0.5px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-card-colorful {
  border: 1px solid var(--border-color);
  border-top: 3px solid #3B82F6;
  padding: 16px;
  border-radius: var(--radius-sharp);
  background-color: #FFFFFF;
  transition: all 0.2s ease;
}

.chart-card-colorful:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

/* ==================== Buttons & Controls ==================== */
.btn-primary {
  background-color: var(--color-red);
  color: #FFFFFF;
  border: 1px solid var(--color-red-hover);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 9px 18px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-secondary {
  background-color: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background-color: var(--bg-card-alt);
  border-color: #CBD5E1;
}

.btn-dark {
  background-color: var(--border-dark);
  color: #FFFFFF;
  border: 1px solid #0B0D0F;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
}

.btn-dark:hover {
  background-color: #000000;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-next-step {
  margin-top: 24px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 800;
}

/* ==================== PDF Export Button & Spinner ==================== */
.btn-export-pdf {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  border: 1px solid #334155;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 16px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-export-pdf svg {
  color: #EF4444;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.btn-export-pdf:hover {
  background: linear-gradient(135deg, #0F172A 0%, #000000 100%);
  border-color: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

.btn-export-pdf:hover svg {
  transform: translateY(1px);
  color: #F87171;
}

.btn-export-pdf:active {
  transform: translateY(0);
}

.btn-export-pdf:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-card-pdf {
  background: #FFFFFF;
  color: #1E293B;
  border: 1px solid #CBD5E1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-card-pdf svg {
  color: #D32F2F;
  transition: transform 0.2s ease;
}

.btn-card-pdf:hover {
  background: #F8FAFC;
  border-color: #D32F2F;
  color: #D32F2F;
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.12);
}

.btn-card-pdf:hover svg {
  transform: translateY(1px);
}

.btn-card-pdf:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pdf-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: pdf-spin 0.6s linear infinite;
  display: inline-block;
}

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

/* ==================== Form Controls ==================== */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sharp);
  background-color: #FFFFFF;
  color: var(--text-primary);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-dark);
}

/* ==================== Data Preview Table ==================== */
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: auto;
  max-height: 560px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sharp);
  background-color: #FFFFFF;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #94A3B8 #F1F5F9;
}

.table-container::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-container::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 2px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #94A3B8;
  border-radius: 2px;
  border: 2px solid #F1F5F9;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

.enterprise-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  text-align: left;
}

.enterprise-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #F1F5F9;
  color: var(--text-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 9px 14px;
  border-bottom: 2px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  white-space: nowrap;
}

.enterprise-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  background-color: #FFFFFF;
}

.enterprise-table tr:hover td {
  background-color: #F8FAFC;
}

.enterprise-table th:first-child {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 20;
  background-color: #E2E8F0;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.enterprise-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background-color: #FAFAFA;
  font-weight: 600;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.enterprise-table tr:hover td:first-child {
  background-color: #F1F5F9;
}

.badge-type {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-numeric { background-color: #E0F2FE; color: #0369A1; }
.badge-categorical { background-color: #FEF3C7; color: #92400E; }
.badge-datetime { background-color: #EDE9FE; color: #5B21B6; }
.badge-text { background-color: #F1F5F9; color: #475569; }

/* ==================== Home Import Area ==================== */
.upload-dropzone {
  border: 2px dashed #CBD5E1;
  background-color: #FFFFFF;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: var(--radius-sharp);
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--color-red);
  background-color: #FFF5F5;
}

.dropzone-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.dropzone-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.sample-datasets-box {
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.sample-btn-group {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ==================== Cleaning Section Cards ==================== */
.issue-card {
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-red);
  background-color: #FFFFFF;
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.issue-card.severity-medium {
  border-left-color: #F59E0B;
}

.issue-card.severity-low {
  border-left-color: #3B82F6;
}

.issue-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.issue-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-item {
  border-left: 2px solid var(--border-dark);
  padding-left: 12px;
  margin-bottom: 12px;
  position: relative;
}

.history-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  background-color: var(--color-red);
  border-radius: 50%;
}

.history-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.history-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== Insights 4-Part Evidence Cards ==================== */
.insight-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--border-dark);
  border-radius: var(--radius-sharp);
  padding: 16px;
  margin-bottom: 16px;
}

.insight-card.severity-high {
  border-top-color: var(--color-red);
}

.insight-headline {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.insight-part {
  display: flex;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.part-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  width: 140px;
  flex-shrink: 0;
}

.part-text {
  color: var(--text-primary);
  flex-grow: 1;
}

/* ==================== Recommendation Cards ==================== */
.rec-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--border-dark);
  border-radius: var(--radius-sharp);
  padding: 16px;
  margin-bottom: 16px;
}

.rec-card.priority-high {
  border-left-color: var(--color-red);
}

.rec-card.priority-medium {
  border-left-color: #F59E0B;
}

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

.rec-title {
  font-size: 15px;
  font-weight: 750;
  color: var(--text-primary);
}

.rec-priority {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  background-color: var(--border-dark);
  color: #FFFFFF;
}

.rec-priority.high { background-color: var(--color-red); }
.rec-priority.medium { background-color: #D97706; }

.rec-rationale {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.rec-actions-list {
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.rec-actions-list li {
  margin-bottom: 4px;
}

.rec-impact {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

/* ==================== ASK BRO Drawer (Navy Blue & Dark Maroon) ==================== */
.bro-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  display: none;
}

.bro-drawer-backdrop.open {
  display: block;
}

.bro-drawer {
  position: fixed;
  top: 0;
  right: -520px;
  width: 500px;
  max-width: 95vw;
  height: 100vh;
  background-color: var(--bro-navy);
  border-left: 1px solid var(--bro-navy-light);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #FFFFFF;
}

.bro-drawer.open {
  right: 0;
}

.bro-header {
  background-color: var(--bro-navy-dark);
  border-bottom: 1px solid var(--bro-navy-light);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bro-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bro-tag {
  background-color: var(--bro-maroon);
  border: 1px solid var(--bro-maroon-light);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: var(--radius-sharp);
}

.bro-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFFFF;
}

.bro-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-bro-new-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: rgba(211, 47, 47, 0.18);
  border: 1px solid rgba(211, 47, 47, 0.4);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 5px 10px;
  border-radius: var(--radius-sharp, 2px);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-bro-new-chat:hover {
  background-color: var(--bro-maroon);
  border-color: var(--bro-maroon-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.35);
}

.btn-bro-new-chat:active {
  transform: translateY(0);
}

.btn-plus-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  color: #FF6B6B;
}

.btn-bro-new-chat:hover .btn-plus-icon {
  color: #FFFFFF;
}

.btn-new-text {
  font-family: inherit;
}

.btn-bro-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-bro-close:hover {
  color: #FFFFFF;
}

.bro-messages-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: var(--radius-sharp);
  font-size: 13px;
  line-height: 1.5;
}

.chat-bubble.assistant {
  background-color: var(--bro-navy-card);
  border: 1px solid var(--bro-navy-light);
  color: #FFFFFF;
  align-self: flex-start;
}

.chat-bubble.user {
  background-color: var(--bro-maroon);
  border: 1px solid var(--bro-maroon-light);
  color: #FFFFFF;
  align-self: flex-end;
}

.tool-chip {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #CBD5E1;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 2px;
  margin-top: 8px;
}

.bro-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(211, 47, 47, 0.15);
  border: 1px solid rgba(211, 47, 47, 0.4);
  color: #FF6B6B;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 2px;
  margin-right: 6px;
  text-transform: uppercase;
}

.bro-status-pill.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34D399;
}

.ppt-download-card {
  margin-top: 12px;
  background: linear-gradient(135deg, #0A1424 0%, #111D32 100%);
  border: 1px solid #1E2E4A;
  border-left: 3px solid #D32F2F;
  border-radius: 4px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ppt-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ppt-icon-badge {
  background: #D32F2F;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.ppt-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #F8FAFC;
}

.ppt-card-subtitle {
  font-size: 11px;
  color: #94A3B8;
}

.btn-download-ppt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #D32F2F;
  color: #FFFFFF !important;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 3px;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-top: 4px;
  cursor: pointer;
  border: none;
}

.btn-download-ppt:hover {
  background: #B71C1C;
  transform: translateY(-1px);
}

.bro-suggested-wrap {
  padding: 10px 16px;
  background-color: var(--bro-navy-dark);
  border-top: 1px solid var(--bro-navy-light);
}

.suggested-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94A3B8;
  margin-bottom: 6px;
}

.suggested-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggested-chip {
  background-color: var(--bro-navy-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F1F5F9;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggested-chip:hover {
  background-color: var(--bro-maroon);
  border-color: var(--bro-maroon-light);
}

.bro-input-container {
  padding: 14px 16px;
  background-color: var(--bro-navy-dark);
  border-top: 1px solid var(--bro-navy-light);
  display: flex;
  gap: 8px;
}

.bro-input {
  flex-grow: 1;
  background-color: var(--bro-navy);
  border: 1px solid var(--bro-navy-light);
  color: #FFFFFF;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: var(--radius-sharp);
}

.bro-input:focus {
  outline: none;
  border-color: var(--bro-maroon-light);
}

.btn-bro-send {
  background-color: var(--bro-maroon);
  color: #FFFFFF;
  border: 1px solid var(--bro-maroon-light);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
}

.btn-bro-send:hover {
  background-color: var(--bro-maroon-hover);
}

/* ==================== Modal Dialogs ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background-color: #FFFFFF;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sharp);
  width: 440px;
  max-width: 90vw;
  padding: 20px;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-body {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==================== Charts Container ==================== */
.chart-box {
  width: 100%;
  height: 340px;
}

.chart-box-sm {
  width: 100%;
  height: 220px;
}

/* ==================== Add Data Source Trigger & Mini Window Modal ==================== */
.data-source-trigger-box {
  margin: 18px 0;
  padding: 14px 16px;
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-sharp);
  text-align: center;
}

.data-source-trigger-label {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.btn-data-source-trigger {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  color: #FFFFFF;
  border: 1px solid #334155;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.btn-data-source-trigger svg {
  color: #EF4444;
  transition: transform 0.2s ease;
}

.btn-data-source-trigger:hover {
  background: linear-gradient(135deg, #1E293B 0%, #0B0D0F 100%);
  border-color: #EF4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
  transform: translateY(-1px);
}

.btn-data-source-trigger:hover svg {
  transform: scale(1.1);
}

/* Data Source Modal Mini Window */
.data-source-modal {
  background-color: #FFFFFF;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sharp);
  width: 580px;
  max-width: 94vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.data-source-header {
  background-color: #0B0D0F;
  border-bottom: 1px solid #1E2227;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #FFFFFF;
}

.data-source-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-source-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFFFF;
  text-transform: uppercase;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  transition: color 0.15s ease;
}

.btn-modal-close:hover {
  color: #FFFFFF;
}

.data-source-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex-grow: 1;
  background-color: #FFFFFF;
}

.source-category-section {
  margin-bottom: 16px;
}

.source-category-section:last-child {
  margin-bottom: 0;
}

.source-category-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #64748B;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #F1F5F9;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 500px) {
  .source-grid {
    grid-template-columns: 1fr;
  }
}

.source-item-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sharp);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.source-item-btn:hover {
  background-color: #F8FAFC;
  border-color: #3B82F6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.source-item-btn:hover .source-name {
  color: #1D4ED8;
}

.source-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.source-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #1E293B;
  transition: color 0.15s ease;
}

/* Icon Badges */
.icon-green { background-color: #DCFCE7; color: #15803D; }
.icon-emerald { background-color: #D1FAE5; color: #047857; }
.icon-blue { background-color: #DBEAFE; color: #1D4ED8; }
.icon-cyan { background-color: #CFFAFE; color: #0E7490; }
.icon-indigo { background-color: #E0E7FF; color: #4338CA; }
.icon-amber { background-color: #FEF3C7; color: #B45309; }
.icon-orange { background-color: #FFEDD5; color: #C2410C; }
.icon-red { background-color: #FEE2E2; color: #B91C1C; }
.icon-rose { background-color: #FFE4E6; color: #BE123C; }
.icon-purple { background-color: #F3E8FF; color: #7E22CE; }
.icon-pink { background-color: #FCE7F3; color: #BE185D; }
.icon-gray { background-color: #F1F5F9; color: #475569; }

/* ==================== Full Data Workspace ==================== */
.workspace-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.workspace-dataset-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-sans);
  letter-spacing: -0.3px;
}

.source-tag {
  background: #E2E8F0;
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 3px;
}

.workspace-meta-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.meta-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 3px;
}

.meta-chip strong {
  color: var(--text-primary);
}

.btn-transform-data {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 50%, #B91C1C 100%);
  color: #FFFFFF;
  border: 1px solid #F87171;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
  transition: all 0.2s ease;
}

.btn-transform-data:hover {
  background: #B91C1C;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45);
}

/* Toolbar */
.workspace-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sharp);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.workspace-tools-left,
.workspace-tools-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-tool {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-tool:hover:not(:disabled) {
  background: var(--bg-card-alt);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-tool:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-tool.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: #3B82F6;
  color: #1D4ED8;
}

.btn-tool.danger-active {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--color-red);
  color: var(--color-red);
}

/* More Dropdown */
.more-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.more-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  z-index: 500;
  display: none;
  padding: 4px 0;
}

.more-dropdown-menu.open {
  display: block;
}

.dropdown-item {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: #F1F5F9;
  color: var(--color-red);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* Search input wrap */
.workspace-search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 10px;
  gap: 6px;
  min-width: 200px;
}

.workspace-search-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--text-primary);
  width: 100%;
}

.btn-clear-search {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* Active Filter Banner */
.active-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 8px 14px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.active-filter-chip {
  background: #FFFFFF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-remove {
  border: none;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.chip-remove:hover {
  color: #DC2626;
}

/* Row selection bar */
.row-selection-bar {
  background: #0F172A;
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Grid Styles */
.data-grid-scroll-wrap {
  overflow-x: auto;
  max-height: 560px;
}

.col-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.row-selected td {
  background-color: rgba(211, 47, 47, 0.08) !important;
}

/* Modals */
.workspace-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.workspace-modal-backdrop.open {
  display: flex;
}

.workspace-modal-content {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.ws-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ws-modal-close {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

.ws-modal-close:hover {
  color: var(--color-red);
}

.ws-modal-body {
  padding: 18px;
}

.ws-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Sync status badge */
.sync-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.sync-badge.success {
  background: #DCFCE7;
  color: #15803D;
}

.sync-badge.failed {
  background: #FEE2E2;
  color: #B91C1C;
}

/* ==================== Import Hub Tiles ==================== */
.source-format-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  outline: none;
}

.source-format-tile:hover {
  background: #F8FAFC;
  border-color: #3B82F6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.format-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.format-csv { background: #DCFCE7; color: #166534; }
.format-excel { background: #D1FAE5; color: #065F46; }
.format-json { background: #FEF3C7; color: #92400E; }
.format-xml { background: #E0E7FF; color: #3730A3; }
.format-html { background: #CFFAFE; color: #155E75; }
.format-txt { background: #F1F5F9; color: #334155; }

.format-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==================== CodeStudio Analytical IDE ==================== */
.codestudio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.studio-ide-card {
  background: #0D1117;
  border: 1px solid #30363D;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.studio-ide-header {
  background: #161B22;
  border-bottom: 1px solid #30363D;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.studio-ide-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #F0F6FC;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.studio-lang-selector {
  display: flex;
  background: #0D1117;
  border: 1px solid #30363D;
  border-radius: 4px;
  overflow: hidden;
}

.studio-lang-btn {
  border: none;
  background: transparent;
  color: #8B949E;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.studio-lang-btn.active {
  background: var(--color-red);
  color: #FFFFFF;
}

.studio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-select-snippet {
  background: #0D1117;
  border: 1px solid #30363D;
  color: #C9D1D9;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
}

.btn-studio-run {
  background: linear-gradient(135deg, #EF4444 0%, #D32F2F 100%);
  color: #FFFFFF;
  border: 1px solid #F87171;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
  transition: all 0.15s ease;
}

.btn-studio-run:hover {
  background: #B71C1C;
  transform: translateY(-1px);
}

.studio-editor-box {
  position: relative;
  min-height: 220px;
  background: #0D1117;
}

.studio-textarea {
  width: 100%;
  min-height: 220px;
  background: transparent;
  border: none;
  outline: none;
  color: #58A6FF;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 16px;
  resize: vertical;
  tab-size: 4;
}

.studio-output-card {
  background: #0D1117;
  border: 1px solid #30363D;
  border-radius: 6px;
  overflow: hidden;
}

.studio-output-header {
  background: #161B22;
  border-bottom: 1px solid #30363D;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.studio-output-title {
  color: #8B949E;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-timing-badge {
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid #2EA043;
  color: #3FB950;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.studio-output-body {
  padding: 16px;
  color: #C9D1D9;
  font-family: var(--font-mono);
  font-size: 13px;
  max-height: 400px;
  overflow: auto;
}

.studio-output-body pre {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==================== Data Workspace Enterprise Styles ==================== */

/* Full View Expansion for Data Workspace */
.main-container.data-full-view,
body:has(#view-data.active) .main-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 16px 20px 60px 20px !important;
}

#view-data.active {
  width: 100% !important;
  max-width: 100% !important;
}

/* Data Workspace Grid Container: Full View Horizontal & Vertical Slide */
.workspace-grid-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 215px);
  min-height: 540px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #94A3B8 #F1F5F9;
}

.workspace-grid-container::-webkit-scrollbar {
  height: 12px;
  width: 8px;
}

.workspace-grid-container::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 4px;
}

.workspace-grid-container::-webkit-scrollbar-thumb {
  background: #94A3B8;
  border-radius: 4px;
  border: 2px solid #F1F5F9;
}

.workspace-grid-container::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

/* Workspace Table: Full View Slide Width */
.workspace-table {
  width: max-content !important;
  min-width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  text-align: left;
  background-color: #FFFFFF;
}

.workspace-table th,
.workspace-table td {
  padding: 10px 18px;
  border-bottom: 1px solid #E2E8F0;
  border-right: 1px solid #E2E8F0;
  white-space: nowrap;
  font-size: 12.5px;
  box-sizing: border-box;
}

.workspace-table th {
  background: #F8FAFC;
  position: sticky;
  top: 0;
  z-index: 15;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  min-width: 170px;
  max-width: 320px;
}

.workspace-table td {
  color: #334155;
  background-color: #FFFFFF;
  min-width: 170px;
  max-width: 320px;
  text-overflow: ellipsis;
  overflow: hidden;
  font-family: var(--font-sans);
}

.workspace-table tbody tr:hover td {
  background-color: #F8FAFC;
}

/* Sticky Checkbox Selection Column */
.workspace-table th.th-select {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  text-align: center !important;
  position: sticky !important;
  left: 0 !important;
  top: 0 !important;
  z-index: 25 !important;
  background-color: #F1F5F9 !important;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.workspace-table td.td-select {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  text-align: center !important;
  position: sticky !important;
  left: 0 !important;
  z-index: 12 !important;
  background-color: #FFFFFF !important;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.workspace-table tbody tr:hover td.td-select {
  background-color: #F8FAFC !important;
}

/* Inline Filter Row sticky positioning */
.workspace-table thead tr.inline-filter-row th {
  position: sticky !important;
  top: 60px !important;
  z-index: 14 !important;
  background: #F8FAFC !important;
  border-bottom: 2px solid #CBD5E1 !important;
  padding: 6px 8px !important;
}

.workspace-table thead tr.inline-filter-row th.th-select {
  left: 0 !important;
  top: 60px !important;
  z-index: 24 !important;
}

/* Column Header Cell: Column Name on top, Category Underneath */
.col-header-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.col-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.col-name-text {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-category-row {
  display: flex;
  align-items: center;
}

.col-category-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.col-category-tag.categorical,
.col-category-tag.string,
.col-category-tag.text {
  color: #0369A1;
  background: #E0F2FE;
  border: 1px solid #BAE6FD;
}

.col-category-tag.numeric,
.col-category-tag.integer,
.col-category-tag.float {
  color: #15803D;
  background: #DCFCE7;
  border: 1px solid #BBF7D0;
}

.col-category-tag.datetime,
.col-category-tag.date {
  color: #6D28D9;
  background: #EDE9FE;
  border: 1px solid #DDD6FE;
}

.col-category-tag.boolean {
  color: #B45309;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
}

/* Pagination & Status Footer Bar */
.workspace-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-top: none;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  font-size: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

/* 1. Inline Filter Row & Controls */
.filter-row-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-bottom: none;
  padding: 8px 14px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  font-size: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-bar-left, .filter-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-filter-row th {
  background: #F8FAFC !important;
  border-bottom: 2px solid #CBD5E1 !important;
  padding: 6px 8px !important;
  vertical-align: top;
}

.filter-input-combo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 130px;
}

.filter-cond-select {
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid #CBD5E1;
  border-radius: 3px;
  background: #FFFFFF;
  color: #334155;
  outline: none;
}

.filter-cond-input {
  font-size: 11.5px;
  padding: 3px 6px;
  border: 1px solid #CBD5E1;
  border-radius: 3px;
  background: #FFFFFF;
  color: #0F172A;
  outline: none;
  width: 100%;
}

.filter-cond-input:focus, .filter-cond-select:focus {
  border-color: var(--color-red);
  box-shadow: 0 0 0 1px rgba(211, 47, 47, 0.2);
}

/* 2. Column Header (Not clickable for sorting) */
.th-col-header {
  cursor: default !important;
  user-select: text;
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  font-size: 11px;
  font-weight: 800;
}

.sort-indicator.active {
  color: var(--color-red);
}

/* 3. Checkbox column */
.th-select, .td-select {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  text-align: center !important;
  padding: 6px 4px !important;
}

.row-checkbox, #select-all-rows {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-red);
}

tr.row-selected td {
  background-color: rgba(211, 47, 47, 0.08) !important;
}

/* 4. Dropdown Menus (Add, Delete, More) */
.tool-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.tool-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  min-width: 220px;
  max-height: 480px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
  padding: 6px 0;
  animation: wsDropdownFade 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-dropdown-menu.open {
  display: block;
}

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

.tool-dropdown-menu .dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 12.5px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tool-dropdown-menu .dropdown-item:hover {
  background: #F8FAFC;
  color: var(--color-red);
}

.tool-dropdown-menu .dropdown-item svg {
  color: #64748B;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.tool-dropdown-menu .dropdown-item:hover svg {
  color: var(--color-red);
}

.tool-dropdown-menu .dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 5px 0;
}

.tool-dropdown-menu .dropdown-header-title {
  padding: 6px 16px 2px 16px;
  font-size: 10px;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* 5. Conditional Formatting Highlights */
.cf-highlight-green {
  background-color: #DCFCE7 !important;
  color: #166534 !important;
  font-weight: 600;
}

.cf-highlight-red {
  background-color: #FEE2E2 !important;
  color: #991B1B !important;
  font-weight: 600;
}

.cf-highlight-yellow {
  background-color: #FEF3C7 !important;
  color: #92400E !important;
  font-weight: 600;
}

.cf-highlight-blue {
  background-color: #DBEAFE !important;
  color: #1E40AF !important;
  font-weight: 600;
}

.cf-highlight-purple {
  background-color: #F3E8FF !important;
  color: #6B21A8 !important;
  font-weight: 600;
}

/* 6. Frozen Column Sticky Effect */
.col-frozen {
  position: sticky !important;
  left: 36px !important;
  z-index: 10 !important;
  background-color: #FFFFFF !important;
  box-shadow: 2px 0 6px -1px rgba(0, 0, 0, 0.08) !important;
}

th.col-frozen {
  background-color: #F8FAFC !important;
  z-index: 15 !important;
}

/* 7. Search Text Highlight */
mark.search-highlight {
  background: #FEF08A;
  color: #854D0E;
  padding: 1px 3px;
  border-radius: 2px;
  font-weight: 700;
}

/* 8. Toast Notification */
.workspace-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1E293B;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-toast.success {
  border-left: 4px solid #16A34A;
}

.workspace-toast.error {
  border-left: 4px solid var(--color-red);
}

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

/* 9. Model Diagram Visual Canvas */
.model-diagram-canvas {
  background: #F8FAFC;
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
  background-size: 18px 18px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 24px;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  overflow-x: auto;
}

.model-node-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  width: 220px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.model-node-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.model-node-header {
  background: #0F172A;
  color: #FFFFFF;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.model-node-body {
  padding: 10px 12px;
  font-size: 11.5px;
  max-height: 180px;
  overflow-y: auto;
}

.model-node-col {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed #F1F5F9;
}

.model-connector-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #64748B;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}

/* ==========================================================================
   CLEAN TAB WORKSPACE: 4-TOOL HUB & ADVANCED PREPARATION STUDIOS
   ========================================================================== */

/* Sub-Navigation Bar */
.clean-subnav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.clean-subnav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-subnav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-subnav-back:hover {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.clean-subnav-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
}

.clean-subnav-current-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.clean-subnav-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.clean-subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.clean-subnav-tab:hover {
  background: #F1F5F9;
  color: var(--text-primary);
}

.clean-subnav-tab.active {
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 700;
}

.clean-subnav-tab.active svg {
  stroke: #EF4444;
}

/* 4-Tool Hub Container */
.clean-hub-container {
  padding: 10px 0 30px 0;
}

.clean-hub-header {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.clean-hub-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-red);
  background: rgba(211, 47, 47, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.hub-pill-dot {
  width: 6px;
  height: 6px;
  background: var(--color-red);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(211, 47, 47, 0.6);
}

.clean-hub-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.clean-hub-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 860px;
  margin-bottom: 18px;
}

.clean-hub-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid #E2E8F0;
  font-size: 12px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 600;
}

.meta-val {
  color: var(--text-primary);
  font-weight: 700;
  font-family: var(--font-mono);
}

/* 4 Action Cards Grid */
.clean-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
}

.clean-tool-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  outline: none;
}

.clean-tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.09);
  border-color: #94A3B8;
}

.clean-tool-featured {
  border-top: 4px solid var(--color-red);
}

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

.clean-tool-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.clean-tool-card:hover .clean-tool-icon-box {
  transform: scale(1.08);
}

.icon-pipeline {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.icon-query {
  background: #F5F3FF;
  color: #7C3AED;
  border: 1px solid #DDD6FE;
}

.icon-combine {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.icon-autoclean {
  background: #FEF2F2;
  color: var(--color-red);
  border: 1px solid #FECACA;
}

.clean-tool-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

.tag-pipeline { background: #EFF6FF; color: #1D4ED8; }
.tag-query { background: #F5F3FF; color: #6D28D9; }
.tag-combine { background: #FFFBEB; color: #B45309; }
.tag-autoclean { background: #FEF2F2; color: #B91C1C; }

.clean-tool-content {
  flex: 1;
  margin-bottom: 20px;
}

.clean-tool-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.clean-tool-description {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 14px;
}

.clean-tool-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 11.5px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clean-tool-bullets li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.clean-tool-bullets li span {
  color: var(--color-red);
  font-weight: 800;
}

.clean-tool-action {
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
}

.btn-clean-card-launch {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0F172A;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clean-tool-card:hover .btn-clean-card-launch {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.clean-tool-card:hover .btn-clean-card-launch svg {
  transform: translateX(3px);
}

.btn-launch-autoclean {
  background: var(--color-red) !important;
  color: #FFFFFF !important;
  border-color: var(--color-red) !important;
}

.clean-tool-card:hover .btn-launch-autoclean {
  background: #991B1B !important;
}

/* ==================== Data Pipeline Flowchart ==================== */
.pipeline-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  margin-bottom: 18px;
}

.pipeline-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.pipeline-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.pipeline-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #DCFCE7;
  color: #15803D;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #16A34A;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.7);
}

.pipeline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pipeline-studio-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1024px) {
  .pipeline-studio-grid {
    grid-template-columns: 1fr;
  }
}

.pipeline-canvas-container {
  background: #FAFAFA;
  background-image: radial-gradient(#E2E8F0 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.pipeline-canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  font-size: 11.5px;
}

.canvas-zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 12px;
}

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

.legend-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-input { background: #3B82F6; }
.dot-transform { background: #F59E0B; }
.dot-output { background: #10B981; }

.pipeline-dag-canvas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 30px;
  min-height: 380px;
  overflow-x: auto;
}

.pipeline-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.pipeline-connectors {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.pipeline-node {
  width: 200px;
  background: #FFFFFF;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.pipeline-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.pipeline-node.selected {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.node-input { border-top: 4px solid #3B82F6; }
.node-transform { border-top: 4px solid #F59E0B; }
.node-output { border-top: 4px solid #10B981; }

.node-header {
  padding: 6px 10px;
  background: #F8FAFC;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #F1F5F9;
}

.node-type {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.node-count {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: #E2E8F0;
  padding: 1px 5px;
  border-radius: 2px;
}

.node-body {
  padding: 10px;
}

.node-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.node-meta {
  font-size: 10.5px;
  color: var(--text-muted);
}

.node-port {
  width: 10px;
  height: 10px;
  background: #FFFFFF;
  border: 2px solid #64748B;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.port-left { left: -6px; }
.port-right { right: -6px; }

.pipeline-status-panel {
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  padding: 12px 18px;
}

.pipeline-inspector-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.inspector-header h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.column-mapping-list {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 11px;
}

.mapping-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed #E2E8F0;
  font-family: var(--font-mono);
}

/* ==================== Query Table Studio ==================== */
.query-studio-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .query-studio-layout {
    grid-template-columns: 1fr;
  }
}

.schema-col-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 11px;
  font-family: var(--font-mono);
}

.schema-col-item {
  padding: 3px 6px;
  border-radius: 3px;
  color: #334155;
  cursor: pointer;
}

.schema-col-item:hover {
  background: #F1F5F9;
  color: #0F172A;
}

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

.btn-template {
  text-align: left;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-template:hover {
  background: #0F172A;
  color: #FFFFFF;
}

.query-sql-editor {
  width: 100%;
  background: #0F172A;
  color: #38BDF8;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #1E293B;
  outline: none;
  resize: vertical;
}

/* ==================== Auto Combine Studio ==================== */
.combine-mode-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.combine-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.combine-tab.active {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

.combine-tables-grid {
  display: grid;
  grid-template-columns: 1fr 280px 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .combine-tables-grid {
    grid-template-columns: 1fr;
  }
}

.combine-table-card {
  padding: 20px;
}

.combine-table-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  background: #DCFCE7;
  color: #166534;
  border-radius: 3px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.combine-table-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.combine-table-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.table-fields-scroll {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-top: 10px;
  padding: 4px;
  background: #F8FAFC;
}

.field-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  border-bottom: 1px dashed #E2E8F0;
}

.combine-center-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.confidence-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 6px;
}

.confidence-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #16A34A;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

/* ==========================================================================
   DATA PIPELINE: CLEAN WHITE CANVAS WITH BLACK + RED THEME
   ========================================================================== */

/* Transform Data Dropdown in Data Workspace */
.transform-data-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.transform-data-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 260px;
  background: #09090B;
  border: 1px solid #27272A;
  border-top: 3px solid #EF4444;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  z-index: 200;
  overflow: hidden;
  padding: 6px 0;
}

.transform-data-dropdown-menu.show {
  display: block;
}

.transform-menu-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: #F4F4F5;
  transition: all 0.15s ease;
}

.transform-menu-option:hover {
  background: #18181B;
  color: #EF4444;
}

.opt-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #18181B;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EF4444;
  border: 1px solid #27272A;
}

.opt-text {
  display: flex;
  flex-direction: column;
}

.opt-text strong {
  font-size: 12.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.transform-menu-option:hover .opt-text strong {
  color: #EF4444;
}

.opt-text span {
  font-size: 10.5px;
  color: #A1A1AA;
}

/* Full Pipeline Workspace Wrapper */
.pipeline-full-workspace {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  min-height: 620px;
  position: relative;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* Top Toolbar (Black + Red) */
.pipeline-top-toolbar {
  background: #09090B;
  color: #FFFFFF;
  border-bottom: 1px solid #27272A;
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 10;
}

.pipe-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pipe-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipe-logo-dot {
  width: 8px;
  height: 8px;
  background: #EF4444;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.pipe-name-input {
  background: transparent;
  border: 1px solid transparent;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
  width: 240px;
  transition: border-color 0.2s ease;
}

.pipe-name-input:hover, .pipe-name-input:focus {
  border-color: #EF4444;
  background: #18181B;
}

.pipe-status-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  background: #27272A;
  color: #D4D4D8;
}

.pipe-status-pill.draft { background: #27272A; color: #A1A1AA; }
.pipe-status-pill.saved { background: #166534; color: #DCFCE7; }
.pipe-status-pill.running { background: #991B1B; color: #FEE2E2; animation: pillPulse 0.8s infinite alternate; }
.pipe-status-pill.completed { background: #16A34A; color: #FFFFFF; }
.pipe-status-pill.error { background: #DC2626; color: #FFFFFF; }

@keyframes pillPulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.pipe-toolbar-center {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pipe-sep {
  width: 1px;
  height: 18px;
  background: #27272A;
  margin: 0 4px;
}

.btn-pipe-action {
  background: #18181B;
  border: 1px solid #27272A;
  color: #E4E4E7;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-pipe-action:hover:not(:disabled) {
  background: #27272A;
  color: #FFFFFF;
  border-color: #3F3F46;
}

.btn-pipe-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.btn-pipe-schedule {
  background: #18181B;
  border: 1px solid #27272A;
  color: #E4E4E7;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-pipe-schedule:hover {
  background: #27272A;
  color: #FFFFFF;
}

.btn-pipe-save {
  background: #09090B;
  border: 1px solid #EF4444;
  color: #EF4444;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-pipe-save:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.btn-pipe-run {
  background: #EF4444;
  border: 1px solid #DC2626;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  transition: all 0.15s ease;
}

.btn-pipe-run:hover {
  background: #DC2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

.spinner-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #FFFFFF;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Pristine White Canvas */
.pipeline-white-canvas {
  flex: 1;
  position: relative;
  background-color: #FFFFFF;
  background-image: radial-gradient(#E2E8F0 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  overflow: auto;
  user-select: none;
}

.pipeline-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 2500px;
  min-height: 1500px;
  pointer-events: none;
  z-index: 1;
}

.pipe-wire {
  stroke: #EF4444;
  stroke-width: 2.5;
  fill: none;
  filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.35));
}

.pipeline-nodes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 2500px;
  min-height: 1500px;
  z-index: 2;
}

/* Empty State: Add Dataset First */
.pipeline-empty-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.pipeline-empty-prompt.hidden {
  display: none;
}

.pipeline-empty-prompt.visible {
  display: block;
}

.empty-prompt-card {
  background: #09090B;
  color: #FFFFFF;
  border: 1px solid #27272A;
  border-top: 4px solid #EF4444;
  border-radius: 8px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
  max-width: 440px;
}

.empty-icon-box {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px auto;
  background: #18181B;
  color: #EF4444;
  border: 1px solid #27272A;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-prompt-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #FFFFFF;
}

.empty-prompt-card p {
  font-size: 12.5px;
  color: #A1A1AA;
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-empty-add-dataset {
  background: #EF4444;
  color: #FFFFFF;
  border: none;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transition: all 0.2s ease;
}

.btn-empty-add-dataset:hover {
  background: #DC2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.6);
}

/* Black Draggable Node Cards with Red Highlights */
.pipe-node-card {
  position: absolute;
  width: 230px;
  background: #09090B;
  border: 1px solid #27272A;
  border-top: 3px solid #EF4444;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  color: #F4F4F5;
  z-index: 2;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.pipe-node-card:active {
  cursor: grabbing;
}

.pipe-node-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border-color: #52525B;
}

.pipe-node-card.selected {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), 0 12px 28px rgba(0, 0, 0, 0.4);
}

.pipe-node-card.running-pulse {
  border-color: #EF4444;
  animation: nodeRunningPulse 0.7s infinite alternate ease-in-out;
}

@keyframes nodeRunningPulse {
  from {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4), 0 0 15px rgba(239, 68, 68, 0.3);
  }
  to {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.8), 0 0 30px rgba(239, 68, 68, 0.6);
  }
}

.pipe-node-card.completed {
  border-top-color: #10B981;
}

.pipe-node-header {
  padding: 6px 10px;
  background: #18181B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #27272A;
}

.pipe-node-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #EF4444;
  font-family: var(--font-mono);
}

.pipe-node-status-badge {
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 2px;
  background: #27272A;
  color: #A1A1AA;
}

.pipe-node-status-badge.running { background: #991B1B; color: #FEE2E2; }
.pipe-node-status-badge.ok { background: #064E3B; color: #A7F3D0; }

.pipe-node-body {
  padding: 10px;
}

.pipe-node-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.pipe-node-subtitle {
  font-size: 10.5px;
  color: #A1A1AA;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipe-node-meta {
  font-size: 10px;
  color: #71717A;
  font-family: var(--font-mono);
  margin-top: 6px;
}

/* Ports & '+' Button */
.pipe-node-port {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #09090B;
  border: 2px solid #EF4444;
  border-radius: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.port-input {
  left: -6px;
}

.port-output {
  right: -6px;
}

.btn-node-plus {
  position: absolute;
  right: -10px;
  top: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #EF4444;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  border: 2px solid #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.6);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-node-plus:hover {
  transform: scale(1.15);
  background: #DC2626;
}

/* Plus Menu Popover (10 items) */
.pipeline-plus-popover {
  position: absolute;
  z-index: 100;
  background: #09090B;
  border: 1px solid #27272A;
  border-top: 2px solid #EF4444;
  border-radius: 6px;
  width: 240px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  padding: 6px 0;
  color: #FFFFFF;
}

.plus-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #A1A1AA;
  border-bottom: 1px solid #27272A;
}

.btn-close-popover {
  background: transparent;
  border: none;
  color: #A1A1AA;
  font-size: 14px;
  cursor: pointer;
}

.btn-close-popover:hover {
  color: #FFFFFF;
}

.plus-popover-items {
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 0;
}

.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: none;
  text-align: left;
  color: #F4F4F5;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.plus-menu-item:hover {
  background: #18181B;
  color: #EF4444;
}

.plus-menu-item.item-delete:hover {
  color: #EF4444;
  background: #450A0A;
}

.menu-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #18181B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #EF4444;
  border: 1px solid #27272A;
}

.menu-text {
  display: flex;
  flex-direction: column;
}

.menu-title {
  font-size: 12px;
  font-weight: 700;
}

.menu-sub {
  font-size: 10px;
  color: #71717A;
}

.plus-menu-divider {
  height: 1px;
  background: #27272A;
  margin: 4px 0;
}

/* Slide-Over Configuration Drawer */
.pipeline-config-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 340px;
  background: #09090B;
  color: #FFFFFF;
  border-left: 1px solid #27272A;
  border-top: 3px solid #EF4444;
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.4);
  z-index: 90;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.pipeline-config-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 14px 18px;
  background: #18181B;
  border-bottom: 1px solid #27272A;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-badge {
  font-size: 9.5px;
  font-weight: 800;
  color: #EF4444;
  font-family: var(--font-mono);
  letter-spacing: 0.6px;
}

.drawer-header h3 {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 2px;
}

.btn-drawer-close {
  background: transparent;
  border: none;
  color: #A1A1AA;
  font-size: 18px;
  cursor: pointer;
}

.btn-drawer-close:hover {
  color: #FFFFFF;
}

.drawer-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
}

.drawer-body .form-group {
  margin-bottom: 14px;
}

.drawer-body .form-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #D4D4D8;
  margin-bottom: 5px;
}

.drawer-body .form-control {
  background: #18181B;
  border: 1px solid #27272A;
  color: #FFFFFF;
  font-size: 12px;
  border-radius: 4px;
  padding: 7px 10px;
}

.drawer-body .form-control:focus {
  border-color: #EF4444;
}

.drawer-footer {
  padding: 14px 18px;
  background: #18181B;
  border-top: 1px solid #27272A;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.drawer-footer .btn-primary {
  background: #EF4444;
  border-color: #DC2626;
  color: #FFFFFF;
}

/* Overview and Ruleset Drawer Styling */
.overview-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ov-stat-box {
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.ov-num {
  font-size: 20px;
  font-weight: 800;
  color: #EF4444;
  font-family: var(--font-mono);
}

.ov-lbl {
  font-size: 10.5px;
  color: #A1A1AA;
  margin-top: 2px;
}

.ruleset-card {
  background: #18181B;
  border: 1px solid #27272A;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}

.ruleset-header {
  padding: 8px 12px;
  background: #27272A;
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
}

.ruleset-code {
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #38BDF8;
  margin: 0;
  white-space: pre-wrap;
}

/* Slide-Up Final Output Dataset Sheet */
.pipeline-output-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 380px;
  background: #FFFFFF;
  border-top: 3px solid #EF4444;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  z-index: 85;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.pipeline-output-sheet.open {
  transform: translateY(0);
}

.output-sheet-header {
  padding: 12px 20px;
  background: #09090B;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #27272A;
}

.output-sheet-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.output-dot {
  width: 10px;
  height: 10px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.title-text h4 {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
}

.title-text p {
  font-size: 11px;
  color: #A1A1AA;
}

.output-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.output-search {
  background: #18181B;
  border: 1px solid #27272A;
  color: #FFFFFF;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  width: 220px;
}

.output-search:focus {
  border-color: #EF4444;
  outline: none;
}

.btn-activate-output {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF !important;
  border: 1px solid #10B981;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-activate-output:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.55);
  transform: translateY(-1px);
}

.btn-activate-output.is-active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
  border: 1px solid #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
  cursor: default;
  transform: none;
}

.btn-activate-output.is-active:hover {
  background: rgba(16, 185, 129, 0.22) !important;
}

.btn-hist-activate.is-active {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34D399 !important;
  border: 1px solid #10B981 !important;
}

.btn-sheet-toggle {
  background: transparent;
  border: none;
  color: #A1A1AA;
  font-size: 20px;
  cursor: pointer;
}

.btn-sheet-toggle:hover {
  color: #FFFFFF;
}

.output-sheet-body {
  flex: 1;
  padding: 14px 20px;
  overflow: auto;
  background: #FFFFFF;
}

/* Dataset Picker Items in Modal */
.dataset-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dataset-pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  background: #FFFFFF;
  transition: all 0.15s ease;
}

.dataset-pick-item:hover {
  border-color: #EF4444;
  background: #FEF2F2;
}

.dataset-pick-item.selected {
  border-color: #EF4444;
  background: #FEF2F2;
  box-shadow: 0 0 0 1px #EF4444;
}

.pick-item-icon {
  font-size: 22px;
}

.pick-item-info {
  display: flex;
  flex-direction: column;
}

.pick-item-info strong {
  font-size: 13px;
  color: var(--text-primary);
}

.pick-item-info span {
  font-size: 11px;
  color: var(--text-muted);
}

/* Pipeline History Drawer & Cards */
.pipeline-history-drawer {
  width: 480px;
  max-width: 90vw;
}

.history-item-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--bg-card);
  transition: all 0.15s ease;
}

.history-item-card:hover {
  border-color: #EF4444;
}

.hist-status-pill.completed {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

.hist-status-pill.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.dataset-upload-zone:hover {
  border-color: #DC2626 !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.btn-out-tool {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-out-tool.btn-primary {
  background: #EF4444;
  color: #FFFFFF;
  border: 1px solid #EF4444;
}

.btn-out-tool.btn-primary:hover {
  background: #DC2626;
  border-color: #DC2626;
}

.btn-out-tool.btn-secondary {
  background: #27272A;
  color: #E4E4E7;
  border: 1px solid #3F3F46;
}

.btn-out-tool.btn-secondary:hover {
  background: #3F3F46;
  color: #FFFFFF;
  border-color: #EF4444;
}

/* ==========================================================================
   ZOHO-STYLE QUERY TABLE STUDIO (RED & BLACK VISUAL THEME)
   ========================================================================== */
.zoho-query-studio {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 0 32px 0;
}

.zoho-query-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 16px 0;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 16px;
}

.zoho-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zoho-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zoho-query-title-input {
  font-size: 20px;
  font-weight: 700;
  color: #09090B;
  border: none;
  background: transparent;
  outline: none;
  border-bottom: 1.5px dashed transparent;
  padding: 2px 4px;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.zoho-query-title-input:hover,
.zoho-query-title-input:focus {
  border-bottom-color: #EF4444;
  background: rgba(239, 68, 68, 0.03);
}

.zoho-header-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.zoho-btn-icon {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.zoho-btn-icon:hover {
  background: #F1F5F9;
  color: #09090B;
}

.zoho-btn-icon.active {
  color: #EF4444;
}

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

.btn-zoho-header {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  background: #FFFFFF;
  color: #09090B;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-zoho-header:hover {
  border-color: #09090B;
  background: #F8FAFC;
}

.btn-zoho-header.active {
  background: #09090B;
  color: #FFFFFF;
  border-color: #09090B;
}

/* Zoho Editor Card */
.zoho-editor-card {
  background: #FFFFFF;
  border: 1.5px solid #2563EB;
  border-radius: 4px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
  transition: border-color 0.2s ease;
}

.zoho-editor-card:focus-within {
  border-color: #EF4444;
  box-shadow: 0 0 0 1px #EF4444, 0 4px 12px rgba(239, 68, 68, 0.08);
}

.zoho-editor-top-tools {
  position: absolute;
  top: 10px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #E2E8F0;
}

.zoho-tool-icon {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 3px;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.zoho-tool-icon:hover {
  background: #F1F5F9;
  color: #EF4444;
}

.zoho-editor-inner {
  display: flex;
  min-height: 240px;
  font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
  font-size: 13.5px;
  line-height: 23px;
}

.zoho-line-numbers {
  width: 48px;
  background: #F8FAFC;
  color: #94A3B8;
  text-align: right;
  padding: 14px 10px 14px 6px;
  border-right: 1px solid #E2E8F0;
  user-select: none;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 23px;
  white-space: pre;
  overflow: hidden;
}

.zoho-sql-textarea {
  flex: 1;
  border: none;
  outline: none;
  background: #FFFFFF;
  color: #0F172A;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 23px;
  resize: vertical;
  min-height: 240px;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.zoho-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  border-radius: 0 0 4px 4px;
}

.zoho-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-zoho-clear {
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  background: #FFFFFF;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zoho-clear:hover {
  background: #F3F4F6;
  color: #111827;
}

.btn-zoho-execute {
  padding: 7px 22px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid #EF4444;
  border-radius: 4px;
  background: #EF4444;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
  transition: all 0.15s ease;
}

.btn-zoho-execute:hover {
  background: #DC2626;
  border-color: #DC2626;
  transform: translateY(-1px);
}

.btn-zoho-save {
  padding: 7px 18px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #09090B;
  border-radius: 4px;
  background: #09090B;
  color: #FFFFFF;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-zoho-save:hover {
  background: #27272A;
}

.zoho-cursor-pos {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

/* Zoho Tips Card */
.zoho-tips-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.zoho-tips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.zoho-tips-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #09090B;
}

.zoho-tips-title svg {
  color: #F59E0B;
}

.zoho-tips-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748B;
}

.zoho-tips-actions button {
  background: transparent;
  border: none;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.zoho-tips-actions button:hover {
  color: #09090B;
}

.zoho-tips-body {
  margin-top: 10px;
  background: #F8FAFC;
  border-left: 3.5px solid #EF4444;
  border-radius: 4px;
  padding: 14px 18px;
}

.zoho-tips-bullet {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 8px;
  position: relative;
  padding-left: 14px;
}

.zoho-tips-bullet:last-child {
  margin-bottom: 0;
}

.zoho-tips-bullet::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #09090B;
  font-weight: bold;
}

.zoho-tips-bullet strong {
  color: #09090B;
}

/* Results section */
.zoho-results-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.zoho-results-card .btn-activate-output {
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
}

.zoho-results-card .btn-activate-output.is-active {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #047857 !important;
  border: 1px solid #10B981;
}

.zoho-results-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoho-badge-status {
  font-size: 11.5px;
  font-weight: 700;
  background: #09090B;
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.zoho-badge-status.active {
  background: #16A34A;
}

.zoho-results-table-wrap {
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  overflow: auto;
  max-height: 380px;
}

/* Autocomplete Popover */
.zoho-autocomplete-popover {
  position: absolute;
  background: #09090B;
  color: #FFFFFF;
  border: 1px solid #27272A;
  border-radius: 4px;
  z-index: 100;
}

/* ==========================================================================
   REPORTS MODULE STYLING
   Clean white canvas, black text, red accents, sharp borders.
   ========================================================================== */

.reports-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.reports-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* Four Simple Options: Compact, non-card buttons */
.reports-options-bar {
  display: inline-flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  padding: 3px;
  gap: 3px;
}

.report-opt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #0F172A;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.report-opt-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.report-opt-btn.active {
  background: #FFFFFF;
  color: var(--color-red);
  border-color: var(--color-red);
  box-shadow: 0 1px 3px rgba(211, 47, 47, 0.12);
}

.report-opt-btn .opt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

/* Saved Reports Section */
.saved-reports-section {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  padding: 16px 20px;
}

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

.saved-reports-title {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reports-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  background: #F1F5F9;
  color: #475569;
  border-radius: 10px;
}

.reports-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 2px;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.reports-table th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.reports-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
}

.reports-table tr:hover td {
  background: #F8FAFC;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.report-badge.chart {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.report-badge.pivot {
  background: #FDF2F8;
  color: #DB2777;
  border: 1px solid #FBCFE8;
}

.report-badge.summary {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.report-badge.tabular {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

/* Builder Layout */
.builder-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
}

.builder-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.builder-title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
}

.builder-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1024px) {
  .builder-body {
    grid-template-columns: 1fr;
  }
}

.builder-sidebar {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.builder-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  padding-bottom: 8px;
  border-bottom: 1px solid #F1F5F9;
}

.builder-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.builder-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.builder-select,
.builder-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.builder-select:focus,
.builder-input:focus {
  border-color: var(--color-red);
}

.builder-filter-box {
  background: #F8FAFC;
  border: 1px dashed var(--border-color);
  border-radius: 2px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-icon-danger {
  background: transparent;
  border: 1px solid #FECACA;
  color: #DC2626;
  border-radius: 2px;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon-danger:hover {
  background: #DC2626;
  color: #FFFFFF;
}

/* Builder Preview Canvas */
.builder-preview-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  overflow: hidden;
}

.builder-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border-color);
}

.builder-preview-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
}

.builder-preview-content {
  flex: 1;
  padding: 16px;
  position: relative;
  overflow: auto;
}

/* Pivot Grid Styles */
.pivot-matrix-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  background: #FFFFFF;
}

.pivot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.pivot-table th,
.pivot-table td {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  text-align: right;
  white-space: nowrap;
}

.pivot-table th.pivot-row-header,
.pivot-table td.pivot-row-title {
  text-align: left;
  background: #F8FAFC;
  font-weight: 600;
  color: #0F172A;
}

.pivot-table th.pivot-col-header {
  background: #0F172A;
  color: #FFFFFF;
  font-weight: 700;
  text-align: center;
}

.pivot-table th.pivot-sub-col {
  background: #1E293B;
  color: #E2E8F0;
  font-size: 11px;
}

.pivot-table tr.pivot-total-row td {
  background: #FEF2F2;
  font-weight: 700;
  color: var(--color-red);
  border-top: 2px solid var(--color-red);
}

.pivot-table td.pivot-total-col {
  background: #F1F5F9;
  font-weight: 700;
  color: #0F172A;
}

/* Summary Grid & KPI */
.summary-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-kpi-item {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--color-red);
  border-radius: 2px;
  padding: 12px 14px;
}

.summary-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748B;
}

.summary-kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   DASHBOARDS MODULE STYLING
   Moved & upgraded to modern colorful glassmorphism in studio-modules.css
   ========================================================================== */


/* ==========================================================================
   CODE STUDIO MODULE STYLING
   Fictional Python Workspace: Clean white canvas, black text, red accents
   ========================================================================== */

.codestudio-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.studio-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  padding: 10px 16px;
}

.studio-brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-brand-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: 0.2px;
}

.studio-kernel-tag {
  background: #FEF2F2;
  color: var(--color-red);
  border: 1px solid #FECACA;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.studio-mode-pills {
  display: inline-flex;
  background: #F1F5F9;
  border-radius: 2px;
  padding: 3px;
  gap: 2px;
}

.studio-mode-pill {
  padding: 5px 12px;
  border: none;
  background: transparent;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.studio-mode-pill.active {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.studio-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Studio Main Workspace Grid */
.studio-grid-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 1024px) {
  .studio-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Studio Left Sidebar (Library, Columns, Snippets) */
.studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.studio-panel-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.studio-panel-header {
  padding: 8px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.studio-panel-body {
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
}

/* File Tree */
.studio-file-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tree-folder-title {
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  padding: 4px 6px;
  text-transform: uppercase;
}

.tree-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 2px;
  font-size: 12px;
  color: #1E293B;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background 0.1s;
}

.tree-file-item:hover {
  background: #F1F5F9;
}

.tree-file-item.active {
  background: #FEF2F2;
  color: var(--color-red);
  font-weight: 700;
  border-left: 2px solid var(--color-red);
}

/* Columns Selector */
.studio-col-chip-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.studio-col-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 2px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s;
}

.studio-col-item:hover {
  background: #FFFFFF;
  border-color: var(--color-red);
  color: var(--color-red);
}

.col-type-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
  background: #E2E8F0;
  color: #475569;
}

/* Center Editor & Output Area */
.studio-main-flow {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-editor-container {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.studio-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
}

.editor-file-badge {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 6px;
}

.studio-editor-box {
  display: flex;
  position: relative;
  min-height: 320px;
  max-height: 440px;
  background: #FFFFFF;
}

.studio-line-numbers {
  width: 44px;
  padding: 12px 6px;
  background: #F8FAFC;
  border-right: 1px solid var(--border-color);
  color: #94A3B8;
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: right;
  user-select: none;
  line-height: 1.5;
  overflow: hidden;
}

.studio-code-area {
  flex: 1;
  padding: 12px 14px;
  border: none;
  background: #FFFFFF;
  color: #0F172A;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  outline: none;
  white-space: pre;
  overflow: auto;
}

/* Console Logs Area */
.studio-console-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.studio-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border-color);
}

.studio-console-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  letter-spacing: 0.5px;
}

.studio-console-body {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  max-height: 160px;
  overflow-y: auto;
  background: #0F172A;
  color: #E2E8F0;
  white-space: pre-wrap;
}

.studio-console-body.error {
  color: #FCA5A5;
  background: #1E1B1B;
  border-left: 3px solid #DC2626;
}

/* Studio Output Viewer: Data Transformation & ML Model results */
.studio-output-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.studio-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
}

.studio-output-title {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
}

.studio-output-body {
  padding: 16px;
  overflow-x: auto;
}

/* ML Model Scorecard Grid */
.ml-scorecard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ml-metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--color-red);
  border-radius: 2px;
  padding: 10px 12px;
}

.ml-metric-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
}

.ml-metric-value {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* Confusion Matrix Grid */
.cm-table {
  border-collapse: collapse;
  margin-top: 10px;
}

.cm-table th, .cm-table td {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
}

.cm-cell-hit {
  background: #DCFCE7;
  color: #166534;
  font-weight: 700;
}

.cm-cell-miss {
  background: #FEE2E2;
  color: #991B1B;
}

@import url("/static/css/studio-modules.css");
