/* ==========================================================================
   Quantellix E-Commerce Order Fulfillment Portal - Modern Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary-navy: #071426;
  --primary-navy-dark: #040c17;
  --header-bg: #071426;
  --bg-canvas: #edf2f7;
  --bg-card: #ffffff;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-bg: #eff6ff;
  --accent-blue-border: #bfdbfe;
  --accent-blue-text: #1d4ed8;

  --accent-amber: #d97706;
  --accent-amber-bg: #fefce8;
  --accent-amber-border: #fef08a;
  --accent-amber-text: #854d0e;

  --accent-green: #10b981;
  --accent-green-dark: #059669;
  --accent-green-bg: #ecfdf5;
  --accent-green-border: #a7f3d0;
  --accent-green-text: #065f46;

  --accent-purple: #7c3aed;
  --accent-purple-bg: #f5f3ff;
  
  --danger-red: #ef4444;
  --danger-red-hover: #dc2626;

  --border-light: #e2e8f0;
  --border-card: #e5e9f0;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 8px 28px rgba(15, 23, 42, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header Navbar (Matches user reference screenshot)
   ========================================================================== */
.header-navbar {
  background-color: var(--header-bg);
  height: 86px;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  transition: var(--transition);
}

.logo-link:hover {
  opacity: 0.95;
  transform: scale(1.02);
}

.logo-img {
  height: 62px;
  width: auto;
  display: block;
  object-fit: contain;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-credits {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
}

.nav-credits strong {
  color: #ffffff;
  font-weight: 700;
}

.nav-link {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.nav-link:hover {
  color: #38bdf8;
}

/* Person / Profile Dropdown Menu in Navbar */
.user-menu-container {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f233d;
  border: 1.5px solid #1e3a5f;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.btn-user-avatar:hover {
  background: #1e3a5f;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 180px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid #e2e8f0;
  padding: 6px 0;
  z-index: 250;
}

.user-dropdown-menu.show {
  display: block;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dropdown-item.item-danger {
  color: #ef4444;
}

.dropdown-item.item-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 5px 0;
}

/* ==========================================================================
   Main Container
   ========================================================================== */
.main-wrapper {
  flex: 1;
  padding: 36px 24px 60px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.portal-header {
  margin-bottom: 24px;
}

.portal-title {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.portal-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   Announcement / Callout Boxes (Matches reference screenshot)
   ========================================================================== */
.callout-box {
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.callout-box strong {
  font-weight: 700;
}

.callout-blue {
  background-color: var(--accent-blue-bg);
  border: 1px solid var(--accent-blue-border);
  color: var(--accent-blue-text);
}

.callout-amber {
  background-color: var(--accent-amber-bg);
  border: 1px solid var(--accent-amber-border);
  color: var(--accent-amber-text);
}

.callout-amber .callout-head {
  font-weight: 700;
  color: #78350f;
  margin-bottom: 2px;
}

.callout-amber .callout-desc {
  font-size: 13.5px;
  color: #92400e;
}

/* ==========================================================================
   Toolbar Controls
   ========================================================================== */
.controls-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-group-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.toolbar-group-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary-action {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, #1d4ed8, #1d4ed8);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-chatbot-trigger {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-chatbot-trigger:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   Operational Stages Grid (The 3 Stages)
   ========================================================================== */
/* ==========================================================================
   Marketplace Solutions Grid (5-Column Layout Matching Reference Standard)
   ========================================================================== */
.main-wrapper {
  padding: 30px 24px 60px;
  max-width: 1180px;
  margin: 0 auto;
}

.content-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  border: 1px solid #e2e8f0;
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .stages-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .stages-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .stages-grid {
    grid-template-columns: 1fr;
  }
}

.stage-card {
  background: #ffffff;
  border: 1.4px solid #e2e8f0;
  border-radius: 11px;
  padding: 12px 10px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 275px;
}

.stage-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 8px 18px -4px rgba(37, 99, 235, 0.12);
}

.stage-card.selected {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), 0 6px 16px rgba(37, 99, 235, 0.06);
}

/* Checkbox Top-Right */
.card-checkbox-top {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 5;
}

.card-select-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.6px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: #ffffff;
}

.stage-card.selected .card-select-checkbox {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.checkbox-icon {
  font-size: 10px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.stage-card.selected .checkbox-icon {
  opacity: 1;
  transform: scale(1);
}

/* Card Illustration Area */
.card-illustration {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  margin-top: 2px;
  margin-bottom: 8px;
  position: relative;
  overflow: visible;
}

.illustration-svg,
.illustration-img,
.card-illustration img {
  width: 100%;
  height: 100%;
  max-height: 68px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
  display: block;
  margin: 0 auto;
}

.stage-card:hover .illustration-svg,
.stage-card:hover .illustration-img,
.stage-card:hover .card-illustration img {
  transform: scale(1.04);
}

/* Card Content Area */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.solution-code-label {
  font-size: 11.5px;
  font-weight: 800;
  color: #2563eb;
  margin-bottom: 3px;
  display: block;
}

.stage-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.32;
  letter-spacing: -0.01em;
  min-height: 34px;
}

.stage-card-footer {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pricing-badge-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pricing-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 9999px;
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1d4ed8;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.pricing-pill-price {
  font-size: 12px;
  font-weight: 800;
  color: #2563eb;
  margin-top: -2px;
}

.btn-card-view-dashboard {
  width: 100%;
  background: #eef2f6;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  text-decoration: none;
}

.btn-card-view-dashboard:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);
}

.stage-card.selected .btn-card-view-dashboard {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.stage-card.selected .btn-card-view-dashboard:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* ==========================================================================
   Dashboard Stage Drill-Down Modal / Section
   ========================================================================== */
.dashboard-view-panel {
  display: none;
  margin-top: 36px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  padding: 36px;
}

.dashboard-view-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 28px;
}

.panel-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.panel-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.panel-close-btn {
  background: #f1f5f9;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.panel-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Metric KPI Cards */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: var(--transition);
}

.kpi-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.kpi-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

.kpi-tag.tag-success {
  background: #ecfdf5;
  color: #047857;
}

.kpi-tag.tag-info {
  background: #eff6ff;
  color: #1d4ed8;
}

.kpi-tag.tag-warning {
  background: #fefce8;
  color: #a16207;
}

/* Stage Visual Plots & Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.chart-card-full {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.chart-card-half {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.chart-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plot-image-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #edf2f7;
}

.plot-image-container img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 480px;
}

/* Tables for Procurement Allocations & Checks */
.data-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.portal-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.portal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.portal-table tr:hover td {
  background: #f8fafc;
}

.badge-pill-success {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
}

.badge-pill-primary {
  background: #eff6ff;
  color: #1e40af;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
}

/* ==========================================================================
   Slideout / Floating AI Chatbot & Dataset Compiler
   ========================================================================== */
.chatbot-drawer {
  position: fixed;
  top: 0;
  right: -540px;
  width: 520px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-drawer.open {
  right: 0;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  display: block;
  opacity: 1;
}

.drawer-header {
  background: var(--header-bg);
  color: #ffffff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 18px;
}

.drawer-title-text {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.drawer-subtitle-text {
  font-size: 12px;
  color: #94a3b8;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.drawer-close-btn:hover {
  color: #ffffff;
}

/* Upload Dataset Banner inside Drawer */
.drawer-upload-section {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}

.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-blue);
  background: #eff6ff;
}

.drop-zone-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.drop-zone-text {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.drop-zone-sub {
  font-size: 11.5px;
  color: var(--text-light);
  margin-top: 2px;
}

.btn-compile-pipeline {
  width: 100%;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  margin-top: 10px;
}

.btn-compile-pipeline:hover {
  background: linear-gradient(135deg, #047857, #059669);
}

/* Chat Messages Stream */
.drawer-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

.chat-bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.bot {
  background: #ffffff;
  color: #1e293b;
  align-self: flex-start;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: var(--accent-blue);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-stage-result-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
  font-size: 12.5px;
}

.result-card-header {
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.result-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.result-kpi-item {
  background: #f1f5f9;
  padding: 6px 8px;
  border-radius: 6px;
}

.result-kpi-item span {
  display: block;
  font-size: 10.5px;
  color: #64748b;
  text-transform: uppercase;
}

.result-kpi-item strong {
  font-size: 13px;
  color: #0f172a;
}

/* Suggested Question Chips */
.suggested-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
}

.chip-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Chat Input Bar */
.drawer-input-bar {
  padding: 14px 20px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-send-chat {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-send-chat:hover {
  background: var(--accent-blue-hover);
}

/* Floating Trigger Button */
.floating-assistant-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, #071426, #1e293b);
  border: 1.5px solid #38bdf8;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 99;
  transition: var(--transition);
}

.floating-assistant-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  background: linear-gradient(135deg, #0f172a, #2563eb);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .stages-grid {
    grid-template-columns: 1fr;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chatbot-drawer {
    width: 100%;
    right: -100%;
  }
  .dataset-overview-card {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   Upper Dashboard Design System (Matching User Reference Image)
   ========================================================================== */
.dashboard-page-container {
  width: 100%;
}

.dashboard-top-nav {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 22px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.dashboard-tabs-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dash-tab-pill {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.dash-tab-pill.active {
  background-color: #00875a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 135, 90, 0.25);
}

.dash-tab-pill.inactive {
  background-color: #eaedf2;
  color: #1e293b;
}

.dash-tab-pill.inactive:hover {
  background-color: #dfe3ea;
  color: #0f172a;
}

.dashboard-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-close-back {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-close-back:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-dash-action {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-dash-action:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Hero Banner Card */
.hero-banner-card {
  background: radial-gradient(circle at 92% 50%, rgba(37, 99, 235, 0.42) 0%, rgba(29, 78, 216, 0.20) 40%, rgba(14, 26, 62, 0) 75%),
              linear-gradient(135deg, #070e22 0%, #0b1739 50%, #0e1e4a 100%);
  border-radius: 18px;
  padding: 34px 38px;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(7, 22, 56, 0.2);
  margin-bottom: 28px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 58, 102, 0.7);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.hero-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hero-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin: 0 0 10px 0;
  line-height: 1.22;
}

.hero-subtitle {
  font-size: 14.5px;
  color: #94a3b8;
  font-weight: 400;
  line-height: 1.6;
  max-width: 720px;
  margin: 0;
  letter-spacing: 0.01em;
}

.hero-target-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Section Header Titles with Icon */
.section-header-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

/* Dataset Overview Card */
.dataset-overview-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.dataset-col-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
}

.dataset-col-value {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

/* KPI Cards V2 matching reference image */
.metrics-row-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card-v2 {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.kpi-card-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.kpi-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.kpi-icon-box.icon-blue {
  background-color: #eff6ff;
  color: #2563eb;
}

.kpi-icon-box.icon-green {
  background-color: #ecfdf5;
  color: #059669;
}

.kpi-icon-box.icon-purple {
  background-color: #f5f3ff;
  color: #7c3aed;
}

.kpi-icon-box.icon-amber {
  background-color: #fffbeb;
  color: #d97706;
}

.kpi-v2-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
}

.kpi-v2-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-v2-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
  font-weight: 500;
}

.dash-white-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  margin-bottom: 28px;
}

/* Charts Grid and Plot Cards for Dashboards */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card-half {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.chart-card-full {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
}

.chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.plot-image-container {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}

.plot-image-container img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  border-radius: 6px;
}

@media (max-width: 960px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Stages Actions Row — Continue & Chat button under S1 Forecasting Card
   ========================================================================== */
.stages-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 18px;
}

.s1-action-col {
  grid-column: 1;
  display: flex;
  justify-content: flex-start;
}

.btn-continue-chat {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto !important;
  max-width: fit-content;
  background: #10b981 !important;
  background-color: #10b981 !important;
  color: #ffffff !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.2px;
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-continue-chat svg {
  stroke: #ffffff !important;
}

.btn-continue-chat:hover {
  background: #059669 !important;
  background-color: #059669 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

.btn-continue-chat:active {
  transform: translateY(0);
}

@media (max-width: 960px) {
  .stages-actions-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Full Width Dashboard Page Layout (Edge-to-Edge)
   ========================================================================== */
.dashboard-main-wrapper {
  flex: 1;
  padding: 24px 36px 60px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   Dashboard White Navbar (View Dashboards left, Logo center, Mode toggle right)
   ========================================================================== */
.header-navbar.dashboard-navbar {
  background-color: #ffffff !important;
  height: 86px;
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid #e2e8f0;
}

.dashboard-navbar .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* View Dashboards Purple Gradient Button */
.btn-header-dashboards {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.25);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-header-dashboards:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(124, 58, 237, 0.35);
  filter: brightness(1.05);
}

.dashboard-navbar .header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.dashboard-navbar .header-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  background: transparent !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  transition: var(--transition);
}

.dashboard-navbar .header-logo-link:hover {
  opacity: 0.95;
  transform: scale(1.02);
}

.dashboard-navbar .header-logo-img {
  height: 62px;
  width: auto;
  object-fit: contain;
  display: block;
}

.dashboard-navbar .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  background-color: #f1f5f9;
}

/* ==========================================================================
   Left Sliding Dashboards Menu Drawer (Shared across Dashboards)
   ========================================================================== */
.menu-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 999;
}

.menu-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  background-color: #ffffff;
  box-shadow: 6px 0 28px rgba(0, 0, 0, 0.14);
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.menu-drawer.open {
  transform: translateX(0);
}

.menu-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background-color: #ffffff;
}

.menu-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-globe-icon {
  stroke: #2563eb;
}

.menu-title-text {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.menu-drawer-close {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}

.menu-drawer-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.menu-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-drawer-content::-webkit-scrollbar {
  width: 5px;
}

.menu-drawer-content::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}

.menu-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  flex-shrink: 0;
}

.menu-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: all 0.15s ease;
}

.menu-nav-item:hover {
  background-color: #f8fafc;
  color: #0f172a;
}

.menu-nav-item.active {
  background-color: #eef2ff;
  color: #4f46e5;
  font-weight: 600;
}

.menu-divider {
  height: 1px;
  background-color: #f1f5f9;
  margin: 10px 4px;
  border: none;
}

.menu-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 8px 14px;
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  user-select: none;
  letter-spacing: -0.01em;
}

.menu-stage-section {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  padding-bottom: 4px;
}

.menu-stage-title-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.menu-stage-title-link:hover {
  background-color: #f1f5f9;
  color: #2563eb;
}

.menu-target-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px 7px 24px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s ease;
  gap: 10px;
}

.menu-target-link:hover {
  background-color: #f8fafc;
  color: #2563eb;
}

.menu-target-link.active {
  background-color: #eef2ff;
  color: #2563eb;
  font-weight: 600;
}

.menu-target-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.menu-target-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 500;
}

.menu-target-price {
  font-size: 12.5px;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: 0.1px;
  flex-shrink: 0;
  white-space: nowrap;
}

.menu-sub-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 30px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: all 0.15s ease;
}

.menu-sub-link:hover {
  background-color: #f1f5f9;
  color: #2563eb;
}

.menu-sub-link .menu-dot {
  background-color: #10b981;
}

.menu-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
  background-color: #ffffff;
}

.footer-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #2563eb;
}

.sparkle-icon {
  stroke: #2563eb;
  fill: rgba(37, 99, 235, 0.15);
}

.footer-brand-sub {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
  margin-left: 24px;
}

/* Dark mode overrides */
[data-theme="dark"] body {
  background-color: #0b0f19;
  color: #f8fafc;
}

[data-theme="dark"] .header-navbar.dashboard-navbar {
  background-color: #0b0f19 !important;
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .btn-theme-toggle {
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .btn-theme-toggle:hover {
  background-color: #1e293b;
}

[data-theme="dark"] .menu-drawer {
  background-color: #111827;
  border-right-color: #334155;
}

[data-theme="dark"] .menu-drawer-header,
[data-theme="dark"] .menu-drawer-footer {
  background-color: #111827;
  border-color: #1e293b;
}

[data-theme="dark"] .menu-title-text,
[data-theme="dark"] .menu-group-title,
[data-theme="dark"] .menu-stage-label {
  color: #f8fafc;
}

[data-theme="dark"] .menu-nav-item,
[data-theme="dark"] .menu-sub-link {
  color: #94a3b8;
}

[data-theme="dark"] .menu-nav-item:hover,
[data-theme="dark"] .menu-sub-link:hover {
  background-color: #1e293b;
  color: #60a5fa;
}

[data-theme="dark"] .menu-nav-item.active {
  background-color: #1e1b4b;
  color: #818cf8;
}

[data-theme="dark"] .menu-drawer-close {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .menu-divider {
  background-color: #1e293b;
}

[data-theme="dark"] .dataset-overview-card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .data-table-card,
[data-theme="dark"] .audit-check-card {
  background-color: #111827;
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .btn-close-back,
[data-theme="dark"] .btn-dash-action {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .btn-close-back:hover,
[data-theme="dark"] .btn-dash-action:hover {
  background: #334155;
}

/* ==========================================================================
   Demand Sales Forecasting Report Component Styles
   ========================================================================== */

/* Delta Callout Highlights */
.benchmark-delta-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 16px 22px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.delta-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delta-badge {
  background: #15803d;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: -0.01em;
}

.delta-label {
  font-size: 13px;
  color: #166534;
  font-weight: 600;
}

/* Model Showcase Cards */
.model-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.model-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.model-card.champion {
  border: 2px solid #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.12);
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 28%);
}

.model-card.baseline {
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 28%);
}

.model-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.model-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 9999px;
}

.model-tag.champion {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.model-tag.baseline {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.model-name {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.model-type-sub {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 2px;
}

.model-accuracy-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 16px 0 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.model-accuracy-value {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.model-card.champion .model-accuracy-value {
  color: #059669;
}

.model-card.baseline .model-accuracy-value {
  color: #64748b;
}

.model-accuracy-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.model-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric-box {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 12px 14px;
}

.metric-box-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

.metric-box-value {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.metric-box-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.model-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  color: #475569;
}

.model-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-features-list li svg {
  flex-shrink: 0;
}

/* Accuracy by Forecast Horizon Cards */
.horizon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.horizon-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.horizon-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.horizon-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.badge-short {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-mid {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-long {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #e9d5ff;
}

.horizon-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.horizon-usecase {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 16px;
  min-height: 32px;
}

.horizon-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.horizon-acc-val {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
}

.horizon-wmape {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.horizon-bar-bg {
  height: 8px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.horizon-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.fill-short {
  background: linear-gradient(90deg, #10b981, #059669);
  width: 92.4%;
}

.fill-mid {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  width: 88.8%;
}

.fill-long {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
  width: 84.5%;
}

.horizon-stats-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* Forecast Scope Framework Grid (4 Scopes) */
.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.scope-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  transition: all 0.2s ease;
  position: relative;
}

.scope-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #2563eb;
}

.scope-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.scope-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.3;
}

.scope-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 14px;
  min-height: 48px;
  line-height: 1.45;
}

.scope-acc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.scope-acc-num {
  font-size: 15px;
  font-weight: 800;
  color: #059669;
}

/* Accuracy by Segment Section */
.segment-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.segment-tabs-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.segment-tab-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
}

.segment-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.segment-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.segment-tab-pane {
  display: none;
}

.segment-tab-pane.active {
  display: block;
}

.segment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.segment-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  padding: 12px 16px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.segment-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.segment-table tr:hover td {
  background-color: #f8fafc;
}

.table-acc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #059669;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12.5px;
}

.table-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-optimal {
  background: #dcfce7;
  color: #15803d;
}

.status-rebalance {
  background: #fef3c7;
  color: #b45309;
}

.status-promo {
  background: #e0e7ff;
  color: #4338ca;
}

/* 3 Levels of Improvement & Driver Contribution (From Reference Dashboard) */
.improvement-drivers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .improvement-drivers-grid {
    grid-template-columns: 1fr;
  }
}

.levels-card, .drivers-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.levels-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.level-row {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.level-row:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.level-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tag-l1 { background: #dbeafe; color: #1e40af; }
.tag-l2 { background: #e0e7ff; color: #3730a3; }
.tag-l3 { background: #fae8ff; color: #86198f; }

.level-impact-pill {
  font-size: 13px;
  font-weight: 800;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 10px;
  border-radius: 9999px;
}

.level-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
}

.level-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
}

/* Driver Contribution Bars */
.drivers-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.driver-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.driver-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.driver-bar-pct {
  font-weight: 800;
  color: #2563eb;
}

.driver-bar-track {
  height: 9px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
}

.driver-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

/* Executive Recommendations & Business Actions */
.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.rec-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.rec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rec-priority {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.rec-priority.high {
  background: #fee2e2;
  color: #991b1b;
}

.rec-priority.medium {
  background: #fef3c7;
  color: #92400e;
}

.rec-priority.auto {
  background: #dbeafe;
  color: #1e40af;
}

.rec-impact {
  font-size: 13px;
  font-weight: 800;
  color: #15803d;
}

.rec-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.35;
}

.rec-body {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  flex: 1;
}

.rec-action-badge {
  margin-top: 14px;
  font-size: 11.5px;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Dark Mode Overrides for New Components */
[data-theme="dark"] .benchmark-delta-banner {
  background: #064e3b;
  border-color: #047857;
}

[data-theme="dark"] .delta-label {
  color: #a7f3d0;
}

[data-theme="dark"] .model-card,
[data-theme="dark"] .horizon-card,
[data-theme="dark"] .scope-card,
[data-theme="dark"] .segment-container,
[data-theme="dark"] .levels-card,
[data-theme="dark"] .drivers-card,
[data-theme="dark"] .rec-card {
  background: #111827;
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .model-card.champion {
  border-color: #10b981;
  background: linear-gradient(180deg, #064e3b 0%, #111827 28%);
}

[data-theme="dark"] .model-card.baseline {
  border-color: #334155;
  background: linear-gradient(180deg, #1e293b 0%, #111827 28%);
}

[data-theme="dark"] .model-name,
[data-theme="dark"] .horizon-title,
[data-theme="dark"] .scope-name,
[data-theme="dark"] .level-title,
[data-theme="dark"] .rec-title,
[data-theme="dark"] .horizon-acc-val,
[data-theme="dark"] .metric-box-value {
  color: #f8fafc;
}

[data-theme="dark"] .metric-box,
[data-theme="dark"] .level-row,
[data-theme="dark"] .scope-acc-row {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .segment-tab-btn {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .segment-tab-btn.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

[data-theme="dark"] .segment-table th {
  background: #1e293b;
  color: #94a3b8;
  border-bottom-color: #334155;
}

[data-theme="dark"] .segment-table td {
  border-bottom-color: #1e293b;
  color: #cbd5e1;
}

[data-theme="dark"] .segment-table tr:hover td {
  background: #1e293b;
}

[data-theme="dark"] .horizon-bar-bg,
[data-theme="dark"] .driver-bar-track {
  background: #1e293b;
}

[data-theme="dark"] .rec-action-badge {
  background: #1e293b;
  color: #60a5fa;
}



