/* ═══════════════════════════════════════════════════════════
   QazaqBioHub — Global Styles
   Light theme, premium design system
═══════════════════════════════════════════════════════════ */

:root {
  --blue: #2563EB;
  --blue-light: #3b82f6;
  --blue-pale: #eff6ff;
  --blue-dark: #1d4ed8;
  --green: #10b981;
  --green-pale: #ecfdf5;
  --amber: #f59e0b;
  --amber-pale: #fffbeb;
  --purple: #8b5cf6;
  --purple-pale: #f5f3ff;
  --red: #ef4444;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: 'Inter', -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--slate-800);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--slate-100); }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 99px; }

/* ══════════════ NAVIGATION ══════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--slate-200);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: var(--shadow-md); }
.nav-container {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  padding: 0 32px; height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.1rem;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 6px 16px; border-radius: 8px;
  text-decoration: none; font-size: 0.9rem; font-weight: 500;
  color: var(--slate-600); transition: all 0.2s;
}
.nav-link:hover { background: var(--slate-100); color: var(--slate-900); }
.nav-link.active { background: var(--blue-pale); color: var(--blue); }
.nav-cta {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 10px;
  background: var(--blue); color: #fff;
  text-decoration: none; font-size: 0.875rem; font-weight: 600;
  transition: all 0.2s; white-space: nowrap;
}
.nav-cta:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }

/* ══════════════ HERO ══════════════ */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 100px 32px 60px;
  background: linear-gradient(160deg, #f8fafc 0%, #eff6ff 40%, #f0fdf4 100%);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(37,99,235,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37,99,235,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.4;
}
.hero-glow-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.2) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation: glowFloat1 8s ease-in-out infinite;
}
.hero-glow-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 70%);
  bottom: -50px; right: -50px;
  animation: glowFloat2 10s ease-in-out infinite;
}
@keyframes glowFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 30px); }
}
@keyframes glowFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, -20px); }
}
.hero-content {
  max-width: 820px; text-align: center;
  position: relative; z-index: 1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2);
  font-size: 0.825rem; font-weight: 500; color: var(--blue);
  margin-bottom: 24px;
}
.hero-badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--slate-900);
  margin-bottom: 20px;
}
.hero-title-accent {
  background: linear-gradient(135deg, var(--blue) 0%, #06b6d4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.125rem; color: var(--slate-600);
  max-width: 600px; margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-desc strong { color: var(--blue); font-weight: 600; }
.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 40px;
  background: white; border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-stat {
  padding: 20px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hero-stat-val {
  font-family: var(--font-display);
  font-size: 1.8rem; font-weight: 800;
  color: var(--blue); letter-spacing: -0.03em;
}
.hero-stat-label { font-size: 0.8rem; color: var(--slate-500); font-weight: 500; }
.hero-stat-divider { width: 1px; height: 48px; background: var(--slate-200); }
.hero-actions {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  font-weight: 600; font-size: 0.9rem;
  text-decoration: none; transition: all 0.2s; cursor: pointer; border: none;
}
.btn-primary {
  background: var(--blue); color: white;
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37,99,235,0.35); }
.btn-secondary {
  background: white; color: var(--slate-700);
  border: 1.5px solid var(--slate-200);
}
.btn-secondary:hover { background: var(--slate-50); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 12px; }

.hero-scroll-hint {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--slate-400); font-size: 0.8rem;
  animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ══════════════ SECTION COMMONS ══════════════ */
.section-badge {
  display: inline-block;
  padding: 4px 14px; border-radius: 999px;
  background: var(--blue-pale); color: var(--blue);
  font-size: 0.8rem; font-weight: 600;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800; letter-spacing: -0.03em;
  color: var(--slate-900); margin-bottom: 12px;
}
.section-desc { color: var(--slate-500); font-size: 1rem; }

/* ══════════════ FACTORY SECTION ══════════════ */
.factory-section {
  padding: 100px 32px;
  background: var(--white);
  max-width: 1440px; margin: 0 auto;
}
.factory-header { text-align: center; margin-bottom: 40px; }

.branch-selector {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
}
.branch-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 20px; border-radius: 99px;
  border: 1.5px solid var(--slate-200);
  background: white; cursor: pointer;
  font-size: 0.875rem; font-weight: 500; color: var(--slate-600);
  transition: all 0.2s;
}
.branch-btn:hover { border-color: var(--blue); color: var(--blue); }
.branch-btn.active { background: var(--blue); border-color: var(--blue); color: white; }
.branch-btn-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.factory-canvas-wrap {
  position: relative;
  width: 100%; height: 600px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f4e8 50%, #f8f0ff 100%);
  border: 1px solid var(--slate-200);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 40px;
}
#factoryCanvas { width: 100% !important; height: 100% !important; display: block; }

/* Factory Info Panel */
.factory-info-panel {
  position: absolute; top: 20px; right: 20px;
  width: 280px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(20px);
  transition: all 0.3s; pointer-events: none;
  z-index: 10;
}
.factory-info-panel.visible {
  opacity: 1; transform: translateX(0); pointer-events: all;
}
.fip-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-bottom: 1px solid var(--slate-100);
}
.fip-icon { font-size: 1.5rem; }
.fip-title { font-weight: 700; font-size: 0.95rem; color: var(--slate-900); }
.fip-sub { font-size: 0.8rem; color: var(--slate-500); }
.fip-close {
  margin-left: auto; background: none; border: none;
  font-size: 1.2rem; color: var(--slate-400); cursor: pointer;
  line-height: 1; padding: 4px; border-radius: 4px;
  transition: all 0.15s;
}
.fip-close:hover { background: var(--slate-100); color: var(--slate-700); }
.fip-body { padding: 16px; font-size: 0.875rem; color: var(--slate-600); line-height: 1.6; }

/* Factory active indicator */
.factory-active-indicator {
  position: absolute; bottom: 20px; left: 20px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 99px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--slate-200);
  font-size: 0.82rem; font-weight: 600; color: var(--slate-700);
}
.fai-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}
.factory-controls-hint {
  position: absolute; bottom: 20px; right: 20px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(0,0,0,0.7); color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
}

/* ── Branches Grid ── */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.branch-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--slate-200);
  background: white;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.branch-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.branch-trunk::before { background: var(--blue); }
.branch-a::before { background: var(--green); }
.branch-b::before { background: var(--amber); }
.branch-c::before { background: var(--purple); }
.branch-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.branch-trunk:hover { border-color: var(--blue); box-shadow: 0 8px 30px rgba(37,99,235,0.15); }
.branch-a:hover { border-color: var(--green); box-shadow: 0 8px 30px rgba(16,185,129,0.15); }
.branch-b:hover { border-color: var(--amber); box-shadow: 0 8px 30px rgba(245,158,11,0.15); }
.branch-c:hover { border-color: var(--purple); box-shadow: 0 8px 30px rgba(139,92,246,0.15); }

.bc-icon { font-size: 1.75rem; margin-bottom: 12px; }
.bc-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  margin-bottom: 10px;
}
.bc-badge-always { background: #dbeafe; color: #1d4ed8; }
.bc-badge-summer { background: #d1fae5; color: #065f46; }
.bc-badge-winter { background: #fef3c7; color: #92400e; }
.bc-badge-spring { background: #ede9fe; color: #5b21b6; }
.bc-title { font-weight: 700; font-size: 1.05rem; color: var(--slate-900); margin-bottom: 8px; }
.bc-desc { font-size: 0.875rem; color: var(--slate-600); line-height: 1.5; margin-bottom: 16px; }
.bc-metrics { display: flex; gap: 16px; margin-bottom: 14px; }
.bc-metric { display: flex; flex-direction: column; gap: 2px; }
.bc-metric-val { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--slate-900); }
.bc-metric-label { font-size: 0.75rem; color: var(--slate-500); }
.bc-trigger {
  font-size: 0.8rem; color: var(--slate-600);
  padding: 8px 12px; border-radius: 8px;
  background: var(--slate-50); border: 1px solid var(--slate-200);
}

/* ══════════════ DECISION FLOW ══════════════ */
.decision-section {
  padding: 100px 32px;
  background: linear-gradient(180deg, var(--slate-50) 0%, var(--white) 100%);
}
.decision-header { text-align: center; margin-bottom: 56px; max-width: 1440px; margin-left: auto; margin-right: auto; }
.decision-flow {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; flex-wrap: wrap;
  max-width: 1100px; margin: 0 auto 56px;
}
.df-step {
  flex: 1; min-width: 180px; max-width: 220px;
  text-align: center; padding: 24px 16px;
  position: relative;
}
.df-num {
  font-family: var(--font-display);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--slate-400); margin-bottom: 12px;
}
.df-icon { font-size: 2rem; margin-bottom: 12px; }
.df-step h4 { font-weight: 700; color: var(--slate-900); margin-bottom: 8px; }
.df-step p { font-size: 0.875rem; color: var(--slate-600); line-height: 1.5; }
.df-arrow {
  align-self: center; font-size: 1.5rem;
  color: var(--slate-400); margin: 0 8px; flex-shrink: 0;
}

/* AI Rec Box */
.ai-rec-box {
  max-width: 760px; margin: 0 auto;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--blue-pale) 0%, white 100%);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(37,99,235,0.08);
}
.ai-rec-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.ai-rec-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
.ai-rec-label { font-weight: 600; font-size: 0.85rem; color: var(--blue); }
.ai-rec-time { margin-left: auto; font-size: 0.8rem; color: var(--slate-500); font-variant-numeric: tabular-nums; }
.ai-rec-main {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 700;
  color: var(--slate-900); margin-bottom: 16px; line-height: 1.4;
}
.ai-rec-reasons {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.ai-rec-reason {
  padding: 4px 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 500;
  background: white; border: 1px solid var(--slate-200); color: var(--slate-700);
}
.ai-rec-link {
  font-size: 0.9rem; font-weight: 600; color: var(--blue);
  text-decoration: none;
}
.ai-rec-link:hover { text-decoration: underline; }

/* ══════════════ ECONOMICS ══════════════ */
.economics-section {
  padding: 100px 32px;
  max-width: 1440px; margin: 0 auto;
}
.econ-header { text-align: center; margin-bottom: 56px; }
.econ-comparison {
  display: flex; align-items: stretch; justify-content: center;
  gap: 24px; flex-wrap: wrap;
  max-width: 800px; margin: 0 auto;
}
.econ-card {
  flex: 1; min-width: 280px;
  padding: 28px; border-radius: var(--radius-xl);
  border: 1.5px solid var(--slate-200);
}
.econ-bad { background: var(--slate-50); }
.econ-good { background: var(--blue-pale); border-color: rgba(37,99,235,0.25); }
.econ-bad-header, .econ-good-header { margin-bottom: 20px; }
.econ-tag { font-weight: 700; font-size: 0.9rem; }
.econ-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--slate-200);
}
.econ-item:last-child { border-bottom: none; }
.econ-item span { font-size: 0.875rem; color: var(--slate-500); }
.econ-item strong { font-size: 0.9rem; color: var(--slate-900); }
.econ-vs {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 800; color: var(--slate-400);
  flex-shrink: 0;
}

/* ══════════════ CTA ══════════════ */
.cta-section {
  padding: 100px 32px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a5f 100%);
  text-align: center; position: relative; overflow: hidden;
}
.cta-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 300px;
  background: radial-gradient(circle, rgba(37,99,235,0.3) 0%, transparent 70%);
  pointer-events: none;
}
.cta-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.cta-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800; color: white;
  margin-bottom: 16px; letter-spacing: -0.03em;
}
.cta-desc { color: rgba(255,255,255,0.6); margin-bottom: 36px; font-size: 1rem; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.cta-buttons .btn-primary { background: #3b82f6; }
.cta-buttons .btn-secondary { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.2); }
.cta-buttons .btn-secondary:hover { background: rgba(255,255,255,0.2); }

/* ══════════════ FOOTER ══════════════ */
.footer {
  padding: 24px 32px;
  background: var(--slate-900);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-logo { font-family: var(--font-display); font-weight: 700; color: white; }
.footer-logo span { color: rgba(255,255,255,0.4); font-weight: 400; margin-left: 8px; font-size: 0.9rem; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { text-decoration: none; font-size: 0.875rem; color: rgba(255,255,255,0.5); transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-tag { font-size: 0.8rem; color: rgba(255,255,255,0.3); }

/* ══════════════ DASHBOARD PAGE ══════════════ */
.dashboard-page { background: var(--slate-50); }
.dashboard-page .nav { background: rgba(255,255,255,0.92); }

/* Dashboard Layout */
.dash-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr;
  height: 100vh;
  overflow: hidden;
}
.dash-sidebar {
  grid-row: 1 / -1;
  background: white;
  border-right: 1px solid var(--slate-200);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.dash-sidebar-logo {
  padding: 0 20px;
  height: 64px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--slate-200);
  flex-shrink: 0;
}
.dash-sidebar-logo-text {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1rem; color: var(--slate-900);
}
.dash-sidebar-section { padding: 16px 12px 8px; }
.dash-sidebar-section-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--slate-400); text-transform: uppercase;
  padding: 0 8px; margin-bottom: 4px;
}
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  cursor: pointer; transition: all 0.15s;
  font-size: 0.875rem; font-weight: 500; color: var(--slate-600);
  text-decoration: none;
}
.dash-nav-item:hover { background: var(--slate-100); color: var(--slate-900); }
.dash-nav-item.active { background: var(--blue-pale); color: var(--blue); font-weight: 600; }
.dash-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.dash-nav-badge {
  margin-left: auto; padding: 2px 8px;
  border-radius: 99px; font-size: 0.7rem; font-weight: 700;
}
.dash-nav-badge-green { background: #d1fae5; color: #065f46; }
.dash-nav-badge-red { background: #fee2e2; color: #991b1b; }
.dash-nav-badge-amber { background: #fef3c7; color: #92400e; }

/* Dash main area */
.dash-topbar {
  padding: 0 28px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--slate-200);
  background: white;
}
.dash-topbar-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem; color: var(--slate-900);
}
.dash-topbar-status {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 99px;
  background: var(--green-pale); font-size: 0.8rem; font-weight: 600;
  color: #065f46;
}
.dash-topbar-time {
  margin-left: auto; font-size: 0.85rem; color: var(--slate-500);
  font-variant-numeric: tabular-nums;
}
.dash-main {
  overflow-y: auto; padding: 24px 28px;
  display: flex; flex-direction: column; gap: 20px;
}

/* Metric cards row */
.dash-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.dash-metric-card {
  background: white; border: 1px solid var(--slate-200);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.dash-metric-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
}
.dash-metric-card.green::after { background: linear-gradient(90deg, var(--green), #34d399); }
.dash-metric-card.amber::after { background: linear-gradient(90deg, var(--amber), #fcd34d); }
.dash-metric-card.purple::after { background: linear-gradient(90deg, var(--purple), #a78bfa); }
.dash-metric-card.red::after { background: linear-gradient(90deg, var(--red), #f87171); }
.dmc-label { font-size: 0.75rem; font-weight: 600; color: var(--slate-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.dmc-val { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--slate-900); letter-spacing: -0.03em; }
.dmc-change { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 0.8rem; font-weight: 600; }
.dmc-up { color: var(--green); }
.dmc-down { color: var(--red); }
.dmc-sub { font-size: 0.75rem; color: var(--slate-500); margin-top: 2px; }

/* Dash content grid */
.dash-content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}
.dash-panel {
  background: white; border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
}
.dash-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.dash-panel-title {
  font-weight: 700; font-size: 0.95rem; color: var(--slate-900);
}
.dash-panel-tag {
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px; border-radius: 99px;
}
.tag-live { background: var(--green-pale); color: #065f46; }
.tag-alert { background: #fee2e2; color: #991b1b; }
.tag-blue { background: var(--blue-pale); color: var(--blue-dark); }

/* Price ticker */
.price-ticker {
  overflow: hidden; background: var(--slate-50);
  border-radius: 8px; padding: 10px;
}
.price-ticker-inner {
  display: flex; gap: 0;
  animation: tickerScroll 30s linear infinite;
}
.ticker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 20px; white-space: nowrap;
  border-right: 1px solid var(--slate-200);
}
.ticker-name { font-size: 0.8rem; font-weight: 700; color: var(--slate-700); }
.ticker-price { font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ticker-change { font-size: 0.75rem; font-weight: 600; }
.ticker-up { color: var(--green); }
.ticker-down { color: var(--red); }
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Commodity table */
.commodity-table { width: 100%; }
.commodity-table th {
  text-align: left; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--slate-500);
  padding: 8px 12px; border-bottom: 1px solid var(--slate-200);
}
.commodity-table td {
  padding: 12px 12px; font-size: 0.875rem; color: var(--slate-700);
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}
.commodity-table tr:last-child td { border-bottom: none; }
.commodity-table tr:hover td { background: var(--slate-50); }
.ct-name { font-weight: 600; color: var(--slate-900); }
.ct-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.ct-bar-wrap { width: 80px; height: 6px; background: var(--slate-200); border-radius: 99px; overflow: hidden; }
.ct-bar { height: 100%; border-radius: 99px; }

/* AI recommendation panel */
.ai-nav-panel { }
.ai-nav-current {
  padding: 16px;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  border-radius: var(--radius); margin-bottom: 16px;
}
.ai-nav-current-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 8px;
}
.ai-nav-current-rec {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.05rem; color: var(--slate-900);
  margin-bottom: 6px; line-height: 1.3;
}
.ai-nav-current-margin {
  font-size: 0.875rem; color: var(--green); font-weight: 700;
}
.ai-nav-factors { display: flex; flex-direction: column; gap: 8px; }
.ai-factor {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: var(--slate-50); border: 1px solid var(--slate-200);
}
.ai-factor-icon { font-size: 1rem; }
.ai-factor-text { flex: 1; }
.ai-factor-name { font-size: 0.8rem; font-weight: 600; color: var(--slate-800); }
.ai-factor-val { font-size: 0.75rem; color: var(--slate-500); }
.ai-factor-signal { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; }
.signal-buy { background: #d1fae5; color: #065f46; }
.signal-sell { background: #fee2e2; color: #991b1b; }
.signal-hold { background: #fef3c7; color: #92400e; }

/* Contracts list */
.contracts-list { display: flex; flex-direction: column; gap: 10px; }
.contract-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--slate-200); border-radius: var(--radius);
  background: white; transition: all 0.15s;
}
.contract-item:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.contract-flag { font-size: 1.4rem; }
.contract-body { flex: 1; }
.contract-name { font-weight: 600; font-size: 0.875rem; color: var(--slate-900); }
.contract-detail { font-size: 0.78rem; color: var(--slate-500); margin-top: 2px; }
.contract-val { text-align: right; }
.contract-amount { font-weight: 700; font-size: 0.9rem; color: var(--slate-900); font-variant-numeric: tabular-nums; }
.contract-status { font-size: 0.7rem; font-weight: 600; }
.contract-active { color: var(--green); }
.contract-pending { color: var(--amber); }
.contract-review { color: var(--blue); }

/* Logistics mini map */
.logistics-mini {
  position: relative; width: 100%;
  height: 200px; border-radius: var(--radius);
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  overflow: hidden; border: 1px solid var(--slate-200);
}
.logistics-mini canvas { width: 100% !important; height: 100% !important; }

/* Chart area */
.chart-area {
  width: 100%; height: 180px;
  position: relative;
}
.chart-svg { width: 100%; height: 100%; }

/* Alert banner */
.dash-alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--amber);
  background: var(--amber-pale);
  display: flex; align-items: center; gap: 12px;
  font-size: 0.875rem;
}
.dash-alert-icon { font-size: 1.1rem; }
.dash-alert-text { color: var(--slate-700); }
.dash-alert-text strong { color: var(--slate-900); }

/* ══════════════ WORLD MAP PAGE ══════════════ */
.worldmap-page { background: var(--slate-900); }
.worldmap-page .nav {
  background: rgba(15,23,42,0.95);
  border-color: rgba(255,255,255,0.08);
}
.worldmap-page .nav-logo-text { color: white; }
.worldmap-page .nav-link { color: rgba(255,255,255,0.6); }
.worldmap-page .nav-link:hover { background: rgba(255,255,255,0.08); color: white; }
.worldmap-page .nav-link.active { background: rgba(37,99,235,0.2); color: var(--blue-light); }

/* Shared panel styles used by worldmap.html inline styles */
.wm-panel-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}
.wm-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wm-stat-row:last-child { border-bottom: none; }
.wm-stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.5); }
.wm-stat-val {
  font-family: var(--font-display);
  font-size: 0.85rem; font-weight: 700; color: white;
  font-variant-numeric: tabular-nums;
}
.wm-stat-val.green { color: #22c55e; }
.wm-stat-val.amber { color: #fbbf24; }
.wm-stat-val.blue { color: #60a5fa; }

.wm-legend-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wm-legend-item:last-child { border-bottom: none; }
.wm-legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.wm-legend-text { font-size: 0.78rem; color: rgba(255,255,255,0.7); }

/* Leaflet tooltip for ports */
.port-tooltip {
  background: rgba(15,23,42,0.9) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
}
.port-tooltip::before { border-right-color: rgba(15,23,42,0.9) !important; }

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 80px 20px 60px; }
  .hero-stats { flex-direction: column; gap: 0; }
  .hero-stat-divider { width: 100%; height: 1px; }
  .factory-section, .decision-section, .economics-section { padding: 60px 20px; }
  .decision-flow { flex-direction: column; align-items: center; }
  .df-arrow { transform: rotate(90deg); }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .dash-content-grid { grid-template-columns: 1fr; }
  .econ-comparison { flex-direction: column; }
  .econ-vs { text-align: center; }
  .wm-left-panel { display: none; }
  .wm-legend { width: 160px; }
  .wm-filter-bar { right: auto; left: 12px; top: 50px; }
}



