/* ═══════════════════════════════════════════════
   RETAIL DEMAND FORECASTING — STYLESHEET
   Professional Light Theme · Clean & Minimal
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg:           #f9fafb;
  --surface:      #ffffff;
  --surface-alt:  #f3f4f6;
  --border:       #e5e7eb;
  --border-dark:  #d1d5db;

  --blue:         #2563eb;
  --blue-light:   #eff6ff;
  --indigo:       #4f46e5;
  --cyan:         #06b6d4;
  --green:        #10b981;
  --green-light:  #ecfdf5;
  --emerald:      #059669;
  --red:          #ef4444;
  --red-light:    #fef2f2;
  --amber:        #f59e0b;
  --orange:       #f97316;
  --purple:       #a855f7;

  --text:         #111827;
  --text-2:       #374151;
  --text-3:       #6b7280;
  --muted:        #9ca3af;

  --font-head:    'Inter', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'Inter', sans-serif;

  --radius-sm:    6px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 30px rgba(0,0,0,0.1);
}

/* ── RESET ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
canvas { display: block; max-width: 100%; }

/* ── SCROLLBAR ────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 4px; }

/* ── NAVBAR ───────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: var(--shadow-sm);
  height: 56px;
}
.nav-left {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-right {
  display: flex;
  gap: 24px;
  align-items: center;
}
.navbar a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  height: 100%;
}
.navbar a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.nav-link {
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-3);
  transition: all 0.2s;
  border-bottom: 1px solid var(--border) !important;
}
.nav-link:hover {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

/* ── WRAPPER ───────────────────────────────── */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 40px;
}

/* ── HEADER ────────────────────────────────── */
header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}
h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
h1 span { color: var(--blue); }
.subtitle {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 400;
}
.header-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}
.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.badge-cyan   { color: var(--cyan);    border-color: var(--cyan);    background: rgba(6,182,212,0.08); }
.badge-purple { color: var(--purple);  border-color: var(--purple);  background: rgba(168,85,247,0.08); }
.badge-orange { color: var(--orange);  border-color: var(--orange);  background: rgba(249,115,22,0.08); }

/* ── PROJECT SUMMARY ───────────────────────── */
.project-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}
.project-summary h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 12px;
}
.project-summary p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
}

/* ── KPI GRID ──────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  border-top: 3px solid;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-card.cyan { border-top-color: var(--cyan); }
.kpi-card.purple { border-top-color: var(--purple); }
.kpi-card.red { border-top-color: var(--red); }
.kpi-card.green { border-top-color: var(--emerald); }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi-value.cyan { color: var(--cyan); }
.kpi-value.purple { color: var(--purple); }
.kpi-value.red { color: var(--red); }
.kpi-value.green { color: var(--emerald); }
.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

/* ── SECTION HEAD ──────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  white-space: nowrap;
}
.section-head .line { flex: 1; height: 1px; background: var(--border); }
.section-head .tag { font-size: 11px; color: var(--text-3); letter-spacing: 0.05em; }

/* ── INSIGHT GRID ──────────────────────────── */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.insight-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.insight-marker {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.insight-marker.cyan { background: rgba(6,182,212,0.1); }
.insight-marker.red { background: rgba(239,68,68,0.1); }
.insight-marker.green { background: rgba(5,150,105,0.1); }
.insight-marker.purple { background: rgba(168,85,247,0.1); }
.insight-marker svg { width: 18px; height: 18px; }
.insight-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.insight-body { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ── PIPELINE ──────────────────────────────── */
.pipeline-section { margin-bottom: 32px; }
.pipeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}
.pipeline-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.pipeline-dot {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--blue-light);
  border: 1.5px solid var(--blue);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.pipeline-dot svg { width: 20px; height: 20px; stroke: var(--blue); }
.pipeline-step:hover .pipeline-dot { background: var(--blue); }
.pipeline-step:hover .pipeline-dot svg { stroke: #fff; }
.pipeline-label { font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.4; }
.pipeline-arrow {
  width: 36px; height: 1px; background: var(--border-dark);
  flex-shrink: 0; position: relative; margin-bottom: 20px;
}
.pipeline-arrow::after {
  content: '›'; position: absolute; right: -5px; top: -8px;
  color: var(--muted); font-size: 14px;
}

/* ── TECH STACK ────────────────────────────── */
.tech-stack {
  display: flex;
  gap: 12px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.stack-item {
  background: var(--blue-light);
  border: 1px solid var(--blue);
  color: var(--blue);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* ── DATASET STATS ────────────────────────── */
.dataset-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card h3 { font-size: 1.8rem; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.stat-card p { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── CARDS ─────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.card-sub { font-size: 11px; color: var(--text-3); margin-bottom: 16px; letter-spacing: 0.05em; }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── CHART GRIDS ───────────────────────────── */
.chart-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ── MODEL TABLE ───────────────────────────── */
.model-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.model-table th {
  text-align: left; padding: 10px 12px;
  color: var(--text-3); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.model-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.model-name { font-weight: 700; color: var(--text); }
.model-table tr.best { background: var(--green-light); }
.model-table tr.best td { color: var(--emerald); }
.model-table tr.best .model-name { color: var(--emerald); }
.best-badge {
  display: inline-block;
  background: var(--emerald); color: #fff;
  font-size: 9px; padding: 2px 8px; border-radius: 3px;
  margin-left: 8px; font-weight: 600; letter-spacing: 0.05em;
}
.bar-cell { display: flex; align-items: center; gap: 10px; }
.mini-bar-bg { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; min-width: 60px; }
.mini-bar { height: 100%; border-radius: 2px; background: var(--blue); transition: width 0.8s ease; }
.model-table tr.best .mini-bar { background: var(--emerald); }

/* ── PROJECT DETAILS ───────────────────────── */
.project-details { margin-bottom: 32px; }

/* ── SHAP ──────────────────────────────────── */
.shap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px; align-items: start; }
.shap-img-wrap { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.shap-img-wrap img { width: 100%; display: block; }
.shap-list { display: flex; flex-direction: column; gap: 10px; }
.shap-row { display: flex; align-items: center; gap: 12px; }
.shap-rank { font-size: 11px; color: var(--text-3); width: 20px; font-weight: 600; }
.shap-name { font-size: 12px; color: var(--text-2); width: 140px; flex-shrink: 0; }
.shap-bar-bg { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.shap-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--indigo), var(--blue));
  transition: width 1s ease;
}
.shap-val { font-size: 11px; color: var(--text-3); width: 50px; text-align: right; flex-shrink: 0; }

/* ── INVENTORY TABLE ───────────────────────── */
.table-section { margin-bottom: 48px; }
.table-controls { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-btn {
  font-size: 12px; font-weight: 600;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text-3);
  cursor: pointer; transition: all 0.15s;
  letter-spacing: 0.05em; text-decoration: none;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.filter-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.inv-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
#inventoryTable { width: 100%; border-collapse: collapse; font-size: 13px; }
#inventoryTable thead tr { background: var(--surface-alt); border-bottom: 1px solid var(--border); }
#inventoryTable th {
  padding: 12px 16px; text-align: left; font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap; position: sticky; top: 0; background: var(--surface-alt); z-index: 10;
}
#inventoryTable td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-2); }
#inventoryTable tbody tr { transition: background 0.1s; }
#inventoryTable tbody tr:hover { background: var(--surface-alt); }

.risk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; letter-spacing: 0.05em;
}
.risk-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.risk-high { background: var(--red-light); color: var(--red); border: 1px solid var(--red); }
.risk-high::before { background: var(--red); }
.risk-medium { background: rgba(249,115,22,0.1); color: var(--orange); border: 1px solid var(--orange); }
.risk-medium::before { background: var(--orange); }
.risk-low { background: var(--green-light); color: var(--emerald); border: 1px solid var(--emerald); }
.risk-low::before { background: var(--emerald); }

/* ── FOOTER ────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  margin-top: 48px;
  box-shadow: var(--shadow-sm);
}
footer p { margin: 4px 0; }

/* ── ANIMATIONS ────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: fadeUp 0.4s ease both; }
.anim-1 { animation-delay: 0.04s; }
.anim-2 { animation-delay: 0.08s; }
.anim-3 { animation-delay: 0.12s; }
.anim-4 { animation-delay: 0.16s; }
.anim-5 { animation-delay: 0.20s; }
.anim-6 { animation-delay: 0.24s; }

/* ── RESPONSIVE ────────────────────────────── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .insight-grid { grid-template-columns: repeat(2, 1fr); }
  .dataset-stats { grid-template-columns: repeat(2, 1fr); }
  .chart-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .chart-grid-2 { grid-template-columns: 1fr; }
  .shap-grid { grid-template-columns: 1fr; }
  .nav-left { gap: 16px; }
  .nav-right { gap: 12px; }
}
@media (max-width: 640px) {
  .wrapper { padding: 24px 16px; }
  .navbar { padding: 0 16px; flex-direction: column; gap: 12px; height: auto; }
  .nav-left { gap: 12px; width: 100%; flex-wrap: wrap; }
  .nav-right { gap: 8px; width: 100%; }
  .kpi-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .dataset-stats { grid-template-columns: 1fr 1fr; }
  header { flex-direction: column; }
}