Spaces:
Runtime error
Runtime error
Commit ·
47b08cd
1
Parent(s): 36a5576
Rebrand: Marketing Mix Intelligence → PRISM Marketing Intelligence; AIRA → NOVA
Browse files- Rename tool title to "PRISM Marketing Intelligence" across all templates,
login page, README, and base layout
- Rename AI agent from AIRA to NOVA (Next-gen Optimization & Value Advisor)
across all screen templates, CSS classes, JS functions and DOM IDs
- Add nova.js (replaces aira.js): toggleNOVA, sendNOVA, generateNOVAResponse
- Rename all .aira-* CSS classes to .nova-* in components.css
- Update alerts.js Ask AIRA button to Ask NOVA / sendNOVA
- Update tests_runner.py to check for PRISM branding
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Files changed (19)
- README.md+11-11
- static/css/components.css+51-51
- static/js/alerts.js+2-2
- static/js/nova.jsAdded+146
- templates/ads.html+13-13
- templates/base.html+29-29
- templates/consumer_promo.html+18-18
- templates/data_mgmt.html+2-2
- templates/diagnostics.html+18-18
- templates/home.html+18-18
- templates/login.html+3-3
- templates/media.html+13-13
- templates/media_effects.html+18-18
- templates/model_results.html+18-18
- templates/sales_insights.html+18-18
- templates/strategy_illustrative.html+13-13
- templates/strategy_scenarios.html+8-8
- templates/trade_promo.html+18-18
- tests_runner.py+1-1
123453 unmodified lines910111213141526 unmodified lines4243444546474841 unmodified lines90919293949596670 unmodified lines767768769770771772773774775776777778779780781292 unmodified lines1074107510761077---title: Marketing Mix Intelligenceemoji: 📊colorFrom: bluecolorTo: green3 unmodified lineslicense: mit---# Marketing Mix Intelligence (MMM) Dashboard## Table of Contents26 unmodified lines## Project OverviewAn end-to-end **Marketing Mix Modelling (MMM)** solution covering Media, Consumer Promo, and Trade Promo analysis with interactive dashboards, modelling capabilities, **AIRA** (AI-powered Insights & Recommendation Agent), and an **Intelligent Alert & Simulation framework**.The system ingests raw, messy data files (simulating real client exports), transforms them through a multi-layer pipeline, and feeds clean, standardized data into 13 analytical dashboards.41 unmodified lines│ ├── charts.js # Chart rendering utilities│ └── theme.js # Theme toggle (dark/light mode)├── templates/│ ├── base.html # Base template with sidebar, AIRA, filters│ ├── data_mgmt.html # Data Harmonization page│ ├── index.html # Executive Summary / Home│ └── media.html # Media Analysis page670 unmodified lines---### AIRA Agent CardsThe UI presents three "AIRA Agent Cards" that orchestrate the pipeline operations in logical groups:| Agent Card | Operations Performed | Description ||------------|---------------------|-------------|| **Data Profiler** | Load Raw → Profile (for all 5 sources) | Loads all raw Excel files and runs comprehensive profiling. Shows column-level statistics, quality scores, and detected issues in a tabular results panel. || **Auto Column Mapper** | Auto-Map → Apply Mapping (for all 5 sources) | Runs three-tier column matching, displays mapping results with confidence badges (green ≥90%, yellow ≥70%, red <70%), then applies confirmed mappings to create Bronze DataFrames. || **Apply All Transforms** | Date Transform → Missing → Outliers → Merge to Gold (for all 5 sources) | Sequentially runs all three Silver transformations across all sources, then merges to Gold. Shows individual transform results with statistics. |Each agent card also has individual transform buttons for running steps one at a time:292 unmodified lines---*Last updated: March 2026*123453 unmodified lines910111213141526 unmodified lines4243444546474841 unmodified lines90919293949596670 unmodified lines767768769770771772773774775776777778779780781292 unmodified lines1074107510761077---title: PRISM Marketing Intelligenceemoji: 📊colorFrom: bluecolorTo: green3 unmodified lineslicense: mit---# PRISM Marketing Intelligence — MMM Dashboard## Table of Contents26 unmodified lines## Project OverviewAn end-to-end **Marketing Mix Modelling (MMM)** solution covering Media, Consumer Promo, and Trade Promo analysis with interactive dashboards, modelling capabilities, **NOVA** (Next-gen Optimization & Value Advisor), and an **Intelligent Alert & Simulation framework**.The system ingests raw, messy data files (simulating real client exports), transforms them through a multi-layer pipeline, and feeds clean, standardized data into 13 analytical dashboards.41 unmodified lines│ ├── charts.js # Chart rendering utilities│ └── theme.js # Theme toggle (dark/light mode)├── templates/│ ├── base.html # Base template with sidebar, NOVA, filters│ ├── data_mgmt.html # Data Harmonization page│ ├── index.html # Executive Summary / Home│ └── media.html # Media Analysis page670 unmodified lines---### NOVA Pipeline AgentsThe UI presents three "NOVA Pipeline Agent" cards that orchestrate the pipeline operations in logical groups:| Agent Card | Operations Performed | Description ||------------|---------------------|-------------|| **Data Profiler (NOVA)** | Load Raw → Profile (for all 5 sources) | Loads all raw Excel files and runs comprehensive profiling. Shows column-level statistics, quality scores, and detected issues in a tabular results panel. || **Auto Column Mapper (NOVA)** | Auto-Map → Apply Mapping (for all 5 sources) | Runs three-tier column matching, displays mapping results with confidence badges (green ≥90%, yellow ≥70%, red <70%), then applies confirmed mappings to create Bronze DataFrames. || **Apply All Transforms (NOVA)** | Date Transform → Missing → Outliers → Merge to Gold (for all 5 sources) | Sequentially runs all three Silver transformations across all sources, then merges to Gold. Shows individual transform results with statistics. |Each agent card also has individual transform buttons for running steps one at a time:292 unmodified lines---*Last updated: May 2026 — PRISM Marketing Intelligence powered by NOVA*
927 unmodified lines9289299309319329339349359369379389399402 unmodified lines9439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210234 unmodified lines1028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061927 unmodified lines.sim-impact-row.positive strong { color: #22c55e; }.sim-impact-row.negative strong { color: #ef4444; }/* ===== AIRA Chat Drawer ===== */.aira-overlay {position: fixed; inset: 0; background: rgba(0,0,0,0.3);z-index: 800; display: none;}.aira-overlay.open { display: block; }.aira-drawer {position: fixed; top: 0; right: -420px; width: 400px; height: 100vh;background: var(--bg-secondary);backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);2 unmodified linesdisplay: flex; flex-direction: column;box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);}.aira-drawer.open { right: 0; }.aira-header {display: flex; align-items: center; justify-content: space-between;padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);background: linear-gradient(135deg, rgba(26,82,118,0.08), rgba(42,157,143,0.05));}.aira-brand { display: flex; align-items: center; gap: 12px; }.aira-logo {width: 36px; height: 36px; border-radius: 50%;background: var(--accent-gold-dim); display: flex;align-items: center; justify-content: center; color: var(--accent-gold);}.aira-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }.aira-subtitle { font-size: 10px; color: var(--text-muted); }.aira-close {background: none; border: none; color: var(--text-secondary);font-size: 18px; cursor: pointer;}.aira-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }.aira-msg { display: flex; }.aira-msg-bot { justify-content: flex-start; }.aira-msg-user { justify-content: flex-end; }.aira-msg-content {max-width: 90%; padding: 10px 14px; border-radius: 12px;font-size: 12px; line-height: 1.6; color: var(--text-primary);}.aira-msg-bot .aira-msg-content {background: var(--bg-card); border: 1px solid var(--border-card);border-bottom-left-radius: 4px;}.aira-msg-user .aira-msg-content {background: var(--accent-gradient); color: #ffffff;border-bottom-right-radius: 4px;}.aira-msg-content ul { margin: 6px 0 0 16px; }.aira-msg-content li { margin-bottom: 3px; }.aira-typing { display: flex; gap: 4px; padding: 4px 0; }.aira-typing span {width: 6px; height: 6px; border-radius: 50%;background: var(--text-muted); animation: airaBounce 1.2s infinite;}.aira-typing span:nth-child(2) { animation-delay: 0.2s; }.aira-typing span:nth-child(3) { animation-delay: 0.4s; }@keyframes airaBounce {0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }40% { opacity: 1; transform: scale(1.2); }}.aira-suggestions { display: flex; gap: 6px; padding: 8px 16px; flex-wrap: wrap; }.aira-suggestion-btn {background: var(--bg-card); border: 1px solid var(--border-card);color: var(--text-secondary); padding: 6px 12px; border-radius: 20px;font-size: 11px; cursor: pointer; font-family: var(--font); transition: all 0.2s;}.aira-suggestion-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }.aira-input-area {display: flex; gap: 8px; padding: 12px 16px;border-top: 1px solid var(--border-subtle);}.aira-input {flex: 1; background: var(--bg-input); border: 1px solid var(--border-card);color: var(--text-primary); padding: 10px 14px; border-radius: var(--radius-sm);font-size: 12px; font-family: var(--font); outline: none;}.aira-input:focus { border-color: var(--accent-gold); }.aira-input::placeholder { color: var(--text-muted); }.aira-send-btn {background: var(--accent-gradient); border: none; color: #ffffff;width: 38px; height: 38px; border-radius: var(--radius-sm);cursor: pointer; display: flex; align-items: center; justify-content: center;transition: all 0.2s;}.aira-send-btn:hover { opacity: 0.85; }/* ===== AIRA Floating Button ===== */.aira-fab {position: fixed; bottom: 24px; right: 24px;background: var(--accent-gradient); color: #ffffff;border: none; border-radius: 50px;4 unmodified linestransition: all 0.3s;letter-spacing: 0.3px;}.aira-fab:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 6px 28px rgba(42,157,143,0.4), 0 12px 40px rgba(26,82,118,0.25); }.aira-fab-label { font-weight: 700; }/* ===== AIRA Insight Cards (per-screen) ===== */.aira-insights {display: flex; gap: 12px; margin-bottom: 20px; overflow-x: auto;padding-bottom: 4px;}.aira-insight-card {background: var(--bg-card); border: 1px solid var(--border-glass, var(--border-card));border-radius: var(--radius-md); padding: 14px 18px;min-width: 280px; max-width: 320px; flex-shrink: 0;transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer;backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);}.aira-insight-card:hover { border-color: rgba(42,157,143,0.25); box-shadow: var(--shadow-glow); transform: translateY(-2px); }.aira-insight-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }.aira-insight-icon {width: 24px; height: 24px; border-radius: 50%;display: flex; align-items: center; justify-content: center;font-size: 12px;}.aira-insight-icon.insight { background: rgba(59,130,246,0.12); color: #3b82f6; }.aira-insight-icon.warning { background: rgba(245,158,11,0.12); color: #f59e0b; }.aira-insight-icon.success { background: rgba(34,197,94,0.12); color: #22c55e; }.aira-insight-label { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }.aira-insight-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }.aira-insight-text strong { color: var(--text-primary); }/* ===== Transform Cards ===== */.transform-grid {927 unmodified lines9289299309319329339349359369379389399402 unmodified lines9439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210234 unmodified lines1028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061927 unmodified lines.sim-impact-row.positive strong { color: #22c55e; }.sim-impact-row.negative strong { color: #ef4444; }/* ===== NOVA Chat Drawer ===== */.nova-overlay {position: fixed; inset: 0; background: rgba(0,0,0,0.3);z-index: 800; display: none;}.nova-overlay.open { display: block; }.nova-drawer {position: fixed; top: 0; right: -420px; width: 400px; height: 100vh;background: var(--bg-secondary);backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);2 unmodified linesdisplay: flex; flex-direction: column;box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);}.nova-drawer.open { right: 0; }.nova-header {display: flex; align-items: center; justify-content: space-between;padding: 16px 20px; border-bottom: 1px solid var(--border-subtle);background: linear-gradient(135deg, rgba(26,82,118,0.08), rgba(42,157,143,0.05));}.nova-brand { display: flex; align-items: center; gap: 12px; }.nova-logo {width: 36px; height: 36px; border-radius: 50%;background: var(--accent-gold-dim); display: flex;align-items: center; justify-content: center; color: var(--accent-gold);}.nova-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }.nova-subtitle { font-size: 10px; color: var(--text-muted); }.nova-close {background: none; border: none; color: var(--text-secondary);font-size: 18px; cursor: pointer;}.nova-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }.nova-msg { display: flex; }.nova-msg-bot { justify-content: flex-start; }.nova-msg-user { justify-content: flex-end; }.nova-msg-content {max-width: 90%; padding: 10px 14px; border-radius: 12px;font-size: 12px; line-height: 1.6; color: var(--text-primary);}.nova-msg-bot .nova-msg-content {background: var(--bg-card); border: 1px solid var(--border-card);border-bottom-left-radius: 4px;}.nova-msg-user .nova-msg-content {background: var(--accent-gradient); color: #ffffff;border-bottom-right-radius: 4px;}.nova-msg-content ul { margin: 6px 0 0 16px; }.nova-msg-content li { margin-bottom: 3px; }.nova-typing { display: flex; gap: 4px; padding: 4px 0; }.nova-typing span {width: 6px; height: 6px; border-radius: 50%;background: var(--text-muted); animation: novaBounce 1.2s infinite;}.nova-typing span:nth-child(2) { animation-delay: 0.2s; }.nova-typing span:nth-child(3) { animation-delay: 0.4s; }@keyframes novaBounce {0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }40% { opacity: 1; transform: scale(1.2); }}.nova-suggestions { display: flex; gap: 6px; padding: 8px 16px; flex-wrap: wrap; }.nova-suggestion-btn {background: var(--bg-card); border: 1px solid var(--border-card);color: var(--text-secondary); padding: 6px 12px; border-radius: 20px;font-size: 11px; cursor: pointer; font-family: var(--font); transition: all 0.2s;}.nova-suggestion-btn:hover { border-color: var(--accent-gold); color: var(--accent-gold); }.nova-input-area {display: flex; gap: 8px; padding: 12px 16px;border-top: 1px solid var(--border-subtle);}.nova-input {flex: 1; background: var(--bg-input); border: 1px solid var(--border-card);color: var(--text-primary); padding: 10px 14px; border-radius: var(--radius-sm);font-size: 12px; font-family: var(--font); outline: none;}.nova-input:focus { border-color: var(--accent-gold); }.nova-input::placeholder { color: var(--text-muted); }.nova-send-btn {background: var(--accent-gradient); border: none; color: #ffffff;width: 38px; height: 38px; border-radius: var(--radius-sm);cursor: pointer; display: flex; align-items: center; justify-content: center;transition: all 0.2s;}.nova-send-btn:hover { opacity: 0.85; }/* ===== NOVA Floating Button ===== */.nova-fab {position: fixed; bottom: 24px; right: 24px;background: var(--accent-gradient); color: #ffffff;border: none; border-radius: 50px;4 unmodified linestransition: all 0.3s;letter-spacing: 0.3px;}.nova-fab:hover { transform: scale(1.05) translateY(-2px); box-shadow: 0 6px 28px rgba(42,157,143,0.4), 0 12px 40px rgba(26,82,118,0.25); }.nova-fab-label { font-weight: 700; }/* ===== NOVA Insight Cards (per-screen) ===== */.nova-insights {display: flex; gap: 12px; margin-bottom: 20px; overflow-x: auto;padding-bottom: 4px;}.nova-insight-card {background: var(--bg-card); border: 1px solid var(--border-glass, var(--border-card));border-radius: var(--radius-md); padding: 14px 18px;min-width: 280px; max-width: 320px; flex-shrink: 0;transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer;backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);}.nova-insight-card:hover { border-color: rgba(42,157,143,0.25); box-shadow: var(--shadow-glow); transform: translateY(-2px); }.nova-insight-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }.nova-insight-icon {width: 24px; height: 24px; border-radius: 50%;display: flex; align-items: center; justify-content: center;font-size: 12px;}.nova-insight-icon.insight { background: rgba(59,130,246,0.12); color: #3b82f6; }.nova-insight-icon.warning { background: rgba(245,158,11,0.12); color: #f59e0b; }.nova-insight-icon.success { background: rgba(34,197,94,0.12); color: #22c55e; }.nova-insight-label { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }.nova-insight-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }.nova-insight-text strong { color: var(--text-primary); }/* ===== Transform Cards ===== */.transform-grid {
65 unmodified lines66676869707172737465 unmodified lines<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/></svg>Simulate</button><button class="alert-action-btn" onclick="sendAIRA('Explain: ${a.headline.replace(/'/g, "")}')" title="Ask AIRA"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>Ask AIRA</button></div></div>`;65 unmodified lines66676869707172737465 unmodified lines<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/></svg>Simulate</button><button class="alert-action-btn" onclick="sendNOVA('Explain: ${a.headline.replace(/'/g, "")}')" title="Ask NOVA"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>Ask NOVA</button></div></div>`;
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146// ===== NOVA — Next-gen Optimization & Value Advisor =====
function toggleNOVA() { const drawer = document.getElementById('novaDrawer'); const overlay = document.getElementById('novaOverlay'); const fab = document.getElementById('novaFab'); const isOpen = drawer.classList.contains('open'); drawer.classList.toggle('open'); overlay.classList.toggle('open'); if (fab) fab.style.display = isOpen ? '' : 'none'; if (!isOpen) { document.getElementById('novaInput').focus(); }}
function sendNOVAFromInput() { const input = document.getElementById('novaInput'); const query = input.value.trim(); if (!query) return; input.value = ''; sendNOVA(query);}
function sendNOVA(query) { // Ensure drawer is open const drawer = document.getElementById('novaDrawer'); if (!drawer.classList.contains('open')) toggleNOVA();
const messages = document.getElementById('novaMessages');
// Add user message messages.innerHTML += `<div class="nova-msg nova-msg-user"><div class="nova-msg-content">${escapeHtml(query)}</div></div>`;
// Hide suggestions after first message document.getElementById('novaSuggestions').style.display = 'none';
// Add loading indicator const loadingId = 'nova-loading-' + Date.now(); messages.innerHTML += `<div class="nova-msg nova-msg-bot" id="${loadingId}"><div class="nova-msg-content"><div class="nova-typing"><span></span><span></span><span></span></div></div></div>`; messages.scrollTop = messages.scrollHeight;
// Generate contextual response setTimeout(() => { const response = generateNOVAResponse(query); const loadingEl = document.getElementById(loadingId); if (loadingEl) { loadingEl.querySelector('.nova-msg-content').innerHTML = response; } messages.scrollTop = messages.scrollHeight; }, 800 + Math.random() * 1200);}
function generateNOVAResponse(query) { const q = query.toLowerCase();
if (q.includes('summarize') || q.includes('summary') || q.includes('performance')) { return `Based on the current data:<br><br> <strong>Overall Performance:</strong><br> - Total Revenue: <strong>$30.2M</strong> (▲ 4.5% vs prior period)<br> - Total Marketing Spend: <strong>$21.3M</strong><br> - Overall ROAS: <strong>1.41x</strong><br><br> <strong>Key Highlights:</strong><br> - Paid Search leads with <strong>3.54x ROAS</strong> - highest efficiency<br> - Social Media showing strong momentum at <strong>2.60x ROAS</strong><br> - TV and Print are below break-even and need attention<br><br> <em>Recommendation:</em> Consider shifting 15-20% of TV budget to Paid Search and Social Media for improved returns.`; }
if (q.includes('underperform') || q.includes('low') || q.includes('drop') || q.includes('decline')) { return `<strong>Underperforming Channels:</strong><br><br> 1. <strong>Print</strong> - ROAS: 0.08x (critically low)<br> • Only generating $0.08 per dollar spent<br> • Very low CTR indicates poor audience engagement<br><br> 2. <strong>TV</strong> - ROAS: 0.28x (below break-even)<br> • Highest spend ($14.5M) but diminishing returns<br> • May be past saturation point<br><br> 3. <strong>Radio</strong> - ROAS: 0.36x<br> • Low conversion rate and limited attribution<br><br> <em>Action:</em> These channels may benefit from budget reduction and reallocation to digital channels with proven higher returns.`; }
if (q.includes('opportunit') || q.includes('growth') || q.includes('scale')) { return `<strong>Top Growth Opportunities:</strong><br><br> 1. <strong>Paid Search Scaling</strong> 🚀<br> • Currently at 3.54x ROAS with only 17.5% of budget<br> • Estimated headroom: +25% spend increase profitable<br><br> 2. <strong>Social Media Expansion</strong> ↗️<br> • 2.60x ROAS with growing audience<br> • Instagram and Facebook showing strong engagement<br><br> 3. <strong>Budget Reallocation</strong> 💰<br> • Moving $2M from TV/Print to Digital could yield est. +$3.5M revenue<br><br> Use the <strong>Simulation panel</strong> to model these scenarios with precise projections.`; }
if (q.includes('simulat') || q.includes('what if') || q.includes('what-if') || q.includes('budget')) { return `I can help you simulate budget scenarios. Here's a quick analysis:<br><br> <strong>If you shift 20% of TV budget to Paid Search:</strong><br> - TV spend: $14.5M → $11.6M (-$2.9M)<br> - Paid Search spend: $7.5M → $10.4M (+$2.9M)<br> - Estimated revenue impact: <strong>+$2.1M</strong><br> - New overall ROAS: <strong>1.48x</strong> (from 1.41x)<br><br> For detailed simulation with more controls, use the <strong>"Simulate"</strong> button on any alert card or open the simulation panel.`; }
if (q.includes('explain') || q.includes('why')) { return `Let me analyze that for you:<br><br> The most likely drivers behind this pattern are:<br><br> 1. <strong>Saturation Effects</strong> - High-spend channels like TV may be past their efficiency peak, where additional spend yields diminishing returns<br><br> 2. <strong>Audience Overlap</strong> - Multiple channels may be reaching the same audience segments, creating redundancy<br><br> 3. <strong>Seasonal Patterns</strong> - Performance naturally fluctuates with consumer behavior cycles<br><br> <em>I recommend running the Diagnostic Analysis for deeper statistical decomposition of these effects.</em>`; }
// Default response return `That's a great question! Based on the current marketing data:<br><br> I'd suggest looking at the <strong>channel-level performance metrics</strong> for specific insights. The key areas to focus on are:<br><br> - Channel ROAS comparison for efficiency<br> - Spend allocation vs. returns<br> - Trend analysis for momentum indicators<br><br> Would you like me to dive deeper into any of these areas? You can also try:<br> - "Which channels are underperforming?"<br> - "What are the top opportunities?"<br> - "Simulate shifting budget from TV to Digital"`;}
function escapeHtml(text) { const div = document.createElement('div'); div.textContent = text; return div.innerHTML;}
// Load alert count for bell badgefunction loadAlertBellCount() { fetch('/alerts/api/alerts/count') .then(r => r.json()) .then(data => { const badge = document.getElementById('alertBellCount'); if (badge) { badge.textContent = data.count; badge.style.display = data.count > 0 ? '' : 'none'; } }) .catch(() => {});}
document.addEventListener('DOMContentLoaded', loadAlertBellCount);123449 unmodified lines545556575859606162636465666768697071727374{% extends "base.html" %}{% block page_title %}Ad-Level Analysis{% endblock %}{% block content %}49 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="adKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('Which ad creatives are showing signs of fatigue?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">AIRA Insight</span></div><div class="aira-insight-text"><strong>Video ads outperform</strong> - Video format shows 2.3x higher engagement rate vs static images. Consider shifting budget allocation.</div></div><div class="aira-insight-card" onclick="sendAIRA('Which ads should be refreshed or paused?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">Fatigue Alert</span></div><div class="aira-insight-text"><strong>CTR drop detected</strong> - 5 ads showing CTR decline >30% after 30+ days active. Consider creative refresh.</div></div></div>123449 unmodified lines545556575859606162636465666768697071727374{% extends "base.html" %}{% block page_title %}Ad-Level Analysis{% endblock %}{% block content %}49 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="adKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('Which ad creatives are showing signs of fatigue?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">NOVA Insight</span></div><div class="nova-insight-text"><strong>Video ads outperform</strong> - Video format shows 2.3x higher engagement rate vs static images. Consider shifting budget allocation.</div></div><div class="nova-insight-card" onclick="sendNOVA('Which ads should be refreshed or paused?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">Fatigue Alert</span></div><div class="nova-insight-text"><strong>CTR drop detected</strong> - 5 ads showing CTR decline >30% after 30+ days active. Consider creative refresh.</div></div></div>
2 unmodified lines34567899 unmodified lines1920212223242562 unmodified lines88899091929394959667 unmodified lines1641651661671681691707 unmodified lines1781791801811821831841851861871881891901911921931941951961971981992002012024 unmodified lines20720820921021121221321421521621721821922022122222322422522622722822928 unmodified lines2582592602612622632642 unmodified lines<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Marketing Mix Intelligence</title><link rel="icon" type="image/png" href="{{ url_for('static', filename='img/logo.png') }}"><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">9 unmodified lines<div class="brand-icon"><img src="{{ url_for('static', filename='img/logo.png') }}" alt="Logo"></div><span>Marketing Mix Intelligence</span></div><div class="sidebar-nav"><div class="sidebar-section-title">Data & Setup</div>62 unmodified lines<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 01-3.46 0"/></svg><span class="alert-bell-count" id="alertBellCount">0</span></button><button class="topbar-btn" onclick="toggleAIRA()" id="airaTopBtn" title="Ask AIRA"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>AIRA</button><button class="topbar-btn" onclick="toggleTheme()" id="themeToggleBtn" title="Toggle light/dark theme"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" id="themeIcon">67 unmodified lines</main><footer class="footer"><span>Marketing Mix Intelligence v2.0 | Powered by AIRA & MMM Analytics</span><span id="lastRefresh">Last updated: -</span></footer></div>7 unmodified lines</div></div><!-- AIRA Chat Drawer --><div class="aira-overlay" id="airaOverlay" onclick="if(event.target===this)toggleAIRA()"></div><div class="aira-drawer" id="airaDrawer"><div class="aira-header"><div class="aira-brand"><div class="aira-logo"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg></div><div><div class="aira-title">AIRA</div><div class="aira-subtitle">AI Insights & Recommendation Agent</div></div></div><button class="aira-close" onclick="toggleAIRA()">✕</button></div><div class="aira-messages" id="airaMessages"><div class="aira-msg aira-msg-bot"><div class="aira-msg-content">Hello! I'm <strong>AIRA</strong>, your AI-powered marketing analytics assistant. I can help you:<ul><li>Analyze channel performance and trends</li><li>Explain anomalies and KPI changes</li>4 unmodified lines</div></div></div><div class="aira-suggestions" id="airaSuggestions"><button class="aira-suggestion-btn" onclick="sendAIRA('Summarize current marketing performance')">Summarize performance</button><button class="aira-suggestion-btn" onclick="sendAIRA('Which channels are underperforming?')">Underperforming channels</button><button class="aira-suggestion-btn" onclick="sendAIRA('What are the top opportunities?')">Top opportunities</button></div><div class="aira-input-area"><input type="text" class="aira-input" id="airaInput" placeholder="Ask AIRA anything about your marketing data..." onkeydown="if(event.key==='Enter')sendAIRAFromInput()"><button class="aira-send-btn" onclick="sendAIRAFromInput()"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg></button></div></div><!-- AIRA Floating Button --><button class="aira-fab" id="airaFab" onclick="toggleAIRA()" title="Ask AIRA"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg><span class="aira-fab-label">AIRA</span></button><!-- SVG Icon Definitions -->28 unmodified lines<script src="{{ url_for('static', filename='js/charts.js') }}"></script><script src="{{ url_for('static', filename='js/multiselect.js') }}"></script><script src="{{ url_for('static', filename='js/filters.js') }}"></script><script src="{{ url_for('static', filename='js/aira.js') }}"></script>{% block scripts %}{% endblock %}</body></html>2 unmodified lines34567899 unmodified lines1920212223242562 unmodified lines88899091929394959667 unmodified lines1641651661671681691707 unmodified lines1781791801811821831841851861871881891901911921931941951961971981992002012024 unmodified lines20720820921021121221321421521621721821922022122222322422522622722822928 unmodified lines2582592602612622632642 unmodified lines<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>PRISM Marketing Intelligence</title><link rel="icon" type="image/png" href="{{ url_for('static', filename='img/logo.png') }}"><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"><link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">9 unmodified lines<div class="brand-icon"><img src="{{ url_for('static', filename='img/logo.png') }}" alt="Logo"></div><span>PRISM Marketing Intelligence</span></div><div class="sidebar-nav"><div class="sidebar-section-title">Data & Setup</div>62 unmodified lines<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 01-3.46 0"/></svg><span class="alert-bell-count" id="alertBellCount">0</span></button><button class="topbar-btn" onclick="toggleNOVA()" id="novaTopBtn" title="Ask NOVA"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>NOVA</button><button class="topbar-btn" onclick="toggleTheme()" id="themeToggleBtn" title="Toggle light/dark theme"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" id="themeIcon">67 unmodified lines</main><footer class="footer"><span>PRISM Marketing Intelligence | Powered by NOVA — Next-gen Optimization & Value Advisor</span><span id="lastRefresh">Last updated: -</span></footer></div>7 unmodified lines</div></div><!-- NOVA Chat Drawer --><div class="nova-overlay" id="novaOverlay" onclick="if(event.target===this)toggleNOVA()"></div><div class="nova-drawer" id="novaDrawer"><div class="nova-header"><div class="nova-brand"><div class="nova-logo"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg></div><div><div class="nova-title">NOVA</div><div class="nova-subtitle">Next-gen Optimization & Value Advisor</div></div></div><button class="nova-close" onclick="toggleNOVA()">✕</button></div><div class="nova-messages" id="novaMessages"><div class="nova-msg nova-msg-bot"><div class="nova-msg-content">Hello! I'm <strong>NOVA</strong>, your AI-powered marketing analytics advisor. I can help you:<ul><li>Analyze channel performance and trends</li><li>Explain anomalies and KPI changes</li>4 unmodified lines</div></div></div><div class="nova-suggestions" id="novaSuggestions"><button class="nova-suggestion-btn" onclick="sendNOVA('Summarize current marketing performance')">Summarize performance</button><button class="nova-suggestion-btn" onclick="sendNOVA('Which channels are underperforming?')">Underperforming channels</button><button class="nova-suggestion-btn" onclick="sendNOVA('What are the top opportunities?')">Top opportunities</button></div><div class="nova-input-area"><input type="text" class="nova-input" id="novaInput" placeholder="Ask NOVA anything about your marketing data..." onkeydown="if(event.key==='Enter')sendNOVAFromInput()"><button class="nova-send-btn" onclick="sendNOVAFromInput()"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg></button></div></div><!-- NOVA Floating Button --><button class="nova-fab" id="novaFab" onclick="toggleNOVA()" title="Ask NOVA"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg><span class="nova-fab-label">NOVA</span></button><!-- SVG Icon Definitions -->28 unmodified lines<script src="{{ url_for('static', filename='js/charts.js') }}"></script><script src="{{ url_for('static', filename='js/multiselect.js') }}"></script><script src="{{ url_for('static', filename='js/filters.js') }}"></script><script src="{{ url_for('static', filename='js/nova.js') }}"></script>{% block scripts %}{% endblock %}</body></html>
123449 unmodified lines54555657585960616263646566676869707172737475767778798081{% extends "base.html" %}{% block page_title %}Consumer Promo Analysis{% endblock %}{% block content %}49 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="cpKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('Which promo types have the highest redemption rates?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">AIRA Insight</span></div><div class="aira-insight-text"><strong>Discount promos lead redemption</strong> - Discount % promos have the highest redemption rate across all brands, while coupon redemption is declining month-over-month.</div></div><div class="aira-insight-card" onclick="sendAIRA('Are there any promo overlap periods that could cause fatigue?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">AIRA Alert</span></div><div class="aira-insight-text"><strong>Promo overlap detected</strong> - Q4 shows 3+ concurrent promos running for the same brand. Consider staggering for better consumer response.</div></div><div class="aira-insight-card" onclick="sendAIRA('How does promo depth correlate with spend and redemption?')"><div class="aira-insight-header"><div class="aira-insight-icon opportunity">🚀</div><span class="aira-insight-label">AIRA Opportunity</span></div><div class="aira-insight-text"><strong>Depth sweet spot</strong> - Promos with 15-25% depth show the best redemption-to-spend ratio. Consider optimizing depth levels.</div></div></div>123449 unmodified lines54555657585960616263646566676869707172737475767778798081{% extends "base.html" %}{% block page_title %}Consumer Promo Analysis{% endblock %}{% block content %}49 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="cpKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('Which promo types have the highest redemption rates?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">NOVA Insight</span></div><div class="nova-insight-text"><strong>Discount promos lead redemption</strong> - Discount % promos have the highest redemption rate across all brands, while coupon redemption is declining month-over-month.</div></div><div class="nova-insight-card" onclick="sendNOVA('Are there any promo overlap periods that could cause fatigue?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">NOVA Alert</span></div><div class="nova-insight-text"><strong>Promo overlap detected</strong> - Q4 shows 3+ concurrent promos running for the same brand. Consider staggering for better consumer response.</div></div><div class="nova-insight-card" onclick="sendNOVA('How does promo depth correlate with spend and redemption?')"><div class="nova-insight-header"><div class="nova-insight-icon opportunity">🚀</div><span class="nova-insight-label">NOVA Opportunity</span></div><div class="nova-insight-text"><strong>Depth sweet spot</strong> - Promos with 15-25% depth show the best redemption-to-spend ratio. Consider optimizing depth levels.</div></div></div>
123478 unmodified lines83848586878889{% extends "base.html" %}{% block page_title %}Data Harmonization{% endblock %}{% block filter_bar %}{% endblock %}78 unmodified lines<div class="source-cards-grid" id="sourceCards"></div><!-- Agent Action Cards --><h3 class="section-title">AIRA Pipeline Agents</h3><div class="agent-cards-row"><div class="agent-card" id="agentProfile" onclick="runAgent('profile')"><div class="agent-icon">🔍</div>123478 unmodified lines83848586878889{% extends "base.html" %}{% block page_title %}Data Harmonization{% endblock %}{% block filter_bar %}{% endblock %}78 unmodified lines<div class="source-cards-grid" id="sourceCards"></div><!-- Agent Action Cards --><h3 class="section-title">NOVA Pipeline Agents</h3><div class="agent-cards-row"><div class="agent-card" id="agentProfile" onclick="runAgent('profile')"><div class="agent-icon">🔍</div>
12345 unmodified lines10111213141516171819202122232425262728293031323334353637{% extends "base.html" %}{% block page_title %}Volume & Revenue Drivers{% endblock %}{% block content %}5 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="diagKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('What are the top drivers of revenue growth in this period?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">AIRA Insight</span></div><div class="aira-insight-text"><strong>Revenue Drivers</strong> — Analyzing which media, promo, and seasonal factors contributed most to revenue this period vs the last.</div></div><div class="aira-insight-card" onclick="sendAIRA('How much of revenue is driven by marketing vs base demand?')"><div class="aira-insight-header"><div class="aira-insight-icon win">🏆</div><span class="aira-insight-label">Base vs Incremental</span></div><div class="aira-insight-text"><strong>Organic vs Paid</strong> — Base demand accounts for ~40% of revenue. Marketing-driven channels collectively lift the remainder through incremental contribution.</div></div><div class="aira-insight-card" onclick="sendAIRA('Which marketing investment is showing the best efficiency trend?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">⚡</div><span class="aira-insight-label">Efficiency Trend</span></div><div class="aira-insight-text"><strong>ROI Trajectory</strong> — Track whether each marketing bucket (Media, Consumer Promo, Trade Promo) is becoming more or less efficient over time.</div></div></div>12345 unmodified lines10111213141516171819202122232425262728293031323334353637{% extends "base.html" %}{% block page_title %}Volume & Revenue Drivers{% endblock %}{% block content %}5 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="diagKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('What are the top drivers of revenue growth in this period?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">NOVA Insight</span></div><div class="nova-insight-text"><strong>Revenue Drivers</strong> — Analyzing which media, promo, and seasonal factors contributed most to revenue this period vs the last.</div></div><div class="nova-insight-card" onclick="sendNOVA('How much of revenue is driven by marketing vs base demand?')"><div class="nova-insight-header"><div class="nova-insight-icon win">🏆</div><span class="nova-insight-label">Base vs Incremental</span></div><div class="nova-insight-text"><strong>Organic vs Paid</strong> — Base demand accounts for ~40% of revenue. Marketing-driven channels collectively lift the remainder through incremental contribution.</div></div><div class="nova-insight-card" onclick="sendNOVA('Which marketing investment is showing the best efficiency trend?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">⚡</div><span class="nova-insight-label">Efficiency Trend</span></div><div class="nova-insight-text"><strong>ROI Trajectory</strong> — Track whether each marketing bucket (Media, Consumer Promo, Trade Promo) is becoming more or less efficient over time.</div></div></div>
12345 unmodified lines10111213141516171819202122232425262728293031323334353637{% extends "base.html" %}{% block page_title %}Executive Summary{% endblock %}{% block content %}5 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="kpiGrid"></div><!-- AIRA Insights --><div class="aira-insights" id="homeInsights"><div class="aira-insight-card" onclick="sendAIRA('How has the category volume changed recently?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">Category Trend</span></div><div class="aira-insight-text"><strong>Category volume shifting</strong> - Analyze how total units sold and product mix have evolved over the selected period.</div></div><div class="aira-insight-card" onclick="sendAIRA('Which products are gaining or losing share?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">Share Movement</span></div><div class="aira-insight-text"><strong>Product share dynamics</strong> - Identify which products are gaining revenue and volume share vs those declining.</div></div><div class="aira-insight-card" onclick="sendAIRA('Summarize overall business health')"><div class="aira-insight-header"><div class="aira-insight-icon success">↗</div><span class="aira-insight-label">Business Health</span></div><div class="aira-insight-text"><strong>Business snapshot</strong> - Revenue, volume, pricing trends and customer acquisition across the category.</div></div></div>12345 unmodified lines10111213141516171819202122232425262728293031323334353637{% extends "base.html" %}{% block page_title %}Executive Summary{% endblock %}{% block content %}5 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="kpiGrid"></div><!-- NOVA Insights --><div class="nova-insights" id="homeInsights"><div class="nova-insight-card" onclick="sendNOVA('How has the category volume changed recently?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">Category Trend</span></div><div class="nova-insight-text"><strong>Category volume shifting</strong> - Analyze how total units sold and product mix have evolved over the selected period.</div></div><div class="nova-insight-card" onclick="sendNOVA('Which products are gaining or losing share?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">Share Movement</span></div><div class="nova-insight-text"><strong>Product share dynamics</strong> - Identify which products are gaining revenue and volume share vs those declining.</div></div><div class="nova-insight-card" onclick="sendNOVA('Summarize overall business health')"><div class="nova-insight-header"><div class="nova-insight-icon success">↗</div><span class="nova-insight-label">Business Health</span></div><div class="nova-insight-text"><strong>Business snapshot</strong> - Revenue, volume, pricing trends and customer acquisition across the category.</div></div></div>
2 unmodified lines3456789178 unmodified lines18818919019119219319421 unmodified lines2162172182192202212222 unmodified lines<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Login — Marketing Mix Intelligence</title><style>*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }178 unmodified lines<line x1="6" y1="20" x2="6" y2="14"/></svg></div><div class="brand-title">Marketing Mix Intelligence</div><div class="brand-sub">Sign in to access the dashboard</div></div>21 unmodified lines</form><div class="login-footer"><span>Marketing Mix Modelling • Powered by AIRA</span></div></div>2 unmodified lines3456789178 unmodified lines18818919019119219319421 unmodified lines2162172182192202212222 unmodified lines<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Login — PRISM Marketing Intelligence</title><style>*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }178 unmodified lines<line x1="6" y1="20" x2="6" y2="14"/></svg></div><div class="brand-title">PRISM Marketing Intelligence</div><div class="brand-sub">Sign in to access the dashboard</div></div>21 unmodified lines</form><div class="login-footer"><span>PRISM Marketing Intelligence • Powered by NOVA</span></div></div>
123447 unmodified lines525354555657585960616263646566676869707172{% extends "base.html" %}{% block page_title %}Media Analysis{% endblock %}{% block content %}47 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="mediaKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('Which media channels have the best cost efficiency?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">AIRA Insight</span></div><div class="aira-insight-text"><strong>Paid Search leads efficiency</strong> - Lowest CPA at $4.11 with highest conversion rate. Digital Display also strong.</div></div><div class="aira-insight-card" onclick="sendAIRA('Are there signs of creative fatigue in any channel?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">Watch Out</span></div><div class="aira-insight-text"><strong>Print CTR declining</strong> - Down to 0.003% average. Consider refreshing creatives or reallocating to digital formats.</div></div></div>123447 unmodified lines525354555657585960616263646566676869707172{% extends "base.html" %}{% block page_title %}Media Analysis{% endblock %}{% block content %}47 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="mediaKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('Which media channels have the best cost efficiency?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">NOVA Insight</span></div><div class="nova-insight-text"><strong>Paid Search leads efficiency</strong> - Lowest CPA at $4.11 with highest conversion rate. Digital Display also strong.</div></div><div class="nova-insight-card" onclick="sendNOVA('Are there signs of creative fatigue in any channel?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">Watch Out</span></div><div class="nova-insight-text"><strong>Print CTR declining</strong> - Down to 0.003% average. Consider refreshing creatives or reallocating to digital formats.</div></div></div>
123468 unmodified lines737475767778798081828384858687888990919293949596979899100{% extends "base.html" %}{% block page_title %}Media Effect Analysis{% endblock %}{% block content %}68 unmodified lines</div></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('Which channels have the strongest long-term brand-building effects?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📈</div><span class="aira-insight-label">AIRA Insight</span></div><div class="aira-insight-text"><strong>Long-term Effects</strong> - Analyzing which channels deliver the strongest carryover and brand-building value beyond immediate returns.</div></div><div class="aira-insight-card" onclick="sendAIRA('Are any channels over-saturated or under-invested?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">Saturation Alert</span></div><div class="aira-insight-text"><strong>Diminishing Returns</strong> - Identifying channels approaching saturation where additional spend yields diminishing returns.</div></div><div class="aira-insight-card" onclick="sendAIRA('Which campaigns need creative refresh due to wear-out?')"><div class="aira-insight-header"><div class="aira-insight-icon alert">🔄</div><span class="aira-insight-label">Wear-out Advisory</span></div><div class="aira-insight-text"><strong>Campaign Refresh</strong> - Campaigns past peak effectiveness that need creative rotation, audience expansion, or budget reallocation.</div></div></div>123468 unmodified lines737475767778798081828384858687888990919293949596979899100{% extends "base.html" %}{% block page_title %}Media Effect Analysis{% endblock %}{% block content %}68 unmodified lines</div></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('Which channels have the strongest long-term brand-building effects?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📈</div><span class="nova-insight-label">NOVA Insight</span></div><div class="nova-insight-text"><strong>Long-term Effects</strong> - Analyzing which channels deliver the strongest carryover and brand-building value beyond immediate returns.</div></div><div class="nova-insight-card" onclick="sendNOVA('Are any channels over-saturated or under-invested?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">Saturation Alert</span></div><div class="nova-insight-text"><strong>Diminishing Returns</strong> - Identifying channels approaching saturation where additional spend yields diminishing returns.</div></div><div class="nova-insight-card" onclick="sendNOVA('Which campaigns need creative refresh due to wear-out?')"><div class="nova-insight-header"><div class="nova-insight-icon alert">🔄</div><span class="nova-insight-label">Wear-out Advisory</span></div><div class="nova-insight-text"><strong>Campaign Refresh</strong> - Campaigns past peak effectiveness that need creative rotation, audience expansion, or budget reallocation.</div></div></div>
123421 unmodified lines26272829303132333435363738394041424344454647484950515253{% extends "base.html" %}{% block page_title %}Model Evaluation{% endblock %}{% block content %}21 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="modelKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('How good is the model fit and what does R-squared mean here?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">Model Fit</span></div><div class="aira-insight-text"><strong>R² > 0.90</strong> — Model explains over 90% of revenue variation. Residuals are well-behaved with no systematic patterns detected.</div></div><div class="aira-insight-card" onclick="sendAIRA('Which channels have the longest adstock carryover effects?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">⏳</div><span class="aira-insight-label">Adstock Insights</span></div><div class="aira-insight-text"><strong>TV has the longest carryover</strong> — Effects persist for 8–10 weeks. Digital Display decays within 2–3 weeks, making short-term impact easier to measure.</div></div><div class="aira-insight-card" onclick="sendAIRA('Are there any model fit concerns I should address?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">Diagnostics</span></div><div class="aira-insight-text"><strong>Residuals are random</strong> — Q-Q plot confirms normal distribution of errors. No heteroskedasticity detected in the residuals over time.</div></div></div>123421 unmodified lines26272829303132333435363738394041424344454647484950515253{% extends "base.html" %}{% block page_title %}Model Evaluation{% endblock %}{% block content %}21 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="modelKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('How good is the model fit and what does R-squared mean here?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">Model Fit</span></div><div class="nova-insight-text"><strong>R² > 0.90</strong> — Model explains over 90% of revenue variation. Residuals are well-behaved with no systematic patterns detected.</div></div><div class="nova-insight-card" onclick="sendNOVA('Which channels have the longest adstock carryover effects?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">⏳</div><span class="nova-insight-label">Adstock Insights</span></div><div class="nova-insight-text"><strong>TV has the longest carryover</strong> — Effects persist for 8–10 weeks. Digital Display decays within 2–3 weeks, making short-term impact easier to measure.</div></div><div class="nova-insight-card" onclick="sendNOVA('Are there any model fit concerns I should address?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">Diagnostics</span></div><div class="nova-insight-text"><strong>Residuals are random</strong> — Q-Q plot confirms normal distribution of errors. No heteroskedasticity detected in the residuals over time.</div></div></div>
12345 unmodified lines10111213141516171819202122232425262728293031323334353637{% extends "base.html" %}{% block page_title %}Marketing Performance{% endblock %}{% block content %}5 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="siKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('Which channel combination delivers the strongest synergy effects?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">🔗</div><span class="aira-insight-label">AIRA Insight</span></div><div class="aira-insight-text"><strong>Channel Synergy</strong> — Identifying which channel combinations amplify each other's effectiveness beyond individual contributions.</div></div><div class="aira-insight-card" onclick="sendAIRA('How do consumer and trade promos compare in ROI vs media?')"><div class="aira-insight-header"><div class="aira-insight-icon win">🏆</div><span class="aira-insight-label">Promo vs Media ROI</span></div><div class="aira-insight-text"><strong>Investment Comparison</strong> — Comparing promotional ROI against media channel returns to optimize the full marketing mix allocation.</div></div><div class="aira-insight-card" onclick="sendAIRA('Which trade promotions have the highest compliance and ROI?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">🛒</div><span class="aira-insight-label">Trade Performance</span></div><div class="aira-insight-text"><strong>Retailer Insights</strong> — Identifying which trade promo types and retailers deliver the best incremental volume lift and compliance.</div></div></div>12345 unmodified lines10111213141516171819202122232425262728293031323334353637{% extends "base.html" %}{% block page_title %}Marketing Performance{% endblock %}{% block content %}5 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="siKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('Which channel combination delivers the strongest synergy effects?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">🔗</div><span class="nova-insight-label">NOVA Insight</span></div><div class="nova-insight-text"><strong>Channel Synergy</strong> — Identifying which channel combinations amplify each other's effectiveness beyond individual contributions.</div></div><div class="nova-insight-card" onclick="sendNOVA('How do consumer and trade promos compare in ROI vs media?')"><div class="nova-insight-header"><div class="nova-insight-icon win">🏆</div><span class="nova-insight-label">Promo vs Media ROI</span></div><div class="nova-insight-text"><strong>Investment Comparison</strong> — Comparing promotional ROI against media channel returns to optimize the full marketing mix allocation.</div></div><div class="nova-insight-card" onclick="sendNOVA('Which trade promotions have the highest compliance and ROI?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">🛒</div><span class="nova-insight-label">Trade Performance</span></div><div class="nova-insight-text"><strong>Retailer Insights</strong> — Identifying which trade promo types and retailers deliver the best incremental volume lift and compliance.</div></div></div>
123454 unmodified lines596061626364656667686970717273747576777879{% extends "base.html" %}{% block page_title %}Illustrative – Marketing Levers{% endblock %}{% block content %}54 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="illKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('What is the optimal price point to maximize profit?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">Price Optimization</span></div><div class="aira-insight-text"><strong>Optimal Pricing</strong> - Find the sweet spot where Revenue × Margin is maximized given current market conditions.</div></div><div class="aira-insight-card" onclick="sendAIRA('What discount depth maximizes incremental volume without destroying margin?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">Discount Trade-off</span></div><div class="aira-insight-text"><strong>Margin Protection</strong> - Understanding the volume lift vs margin erosion trade-off at different discount depths.</div></div></div>123454 unmodified lines596061626364656667686970717273747576777879{% extends "base.html" %}{% block page_title %}Illustrative – Marketing Levers{% endblock %}{% block content %}54 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="illKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('What is the optimal price point to maximize profit?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">Price Optimization</span></div><div class="nova-insight-text"><strong>Optimal Pricing</strong> - Find the sweet spot where Revenue × Margin is maximized given current market conditions.</div></div><div class="nova-insight-card" onclick="sendNOVA('What discount depth maximizes incremental volume without destroying margin?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">Discount Trade-off</span></div><div class="nova-insight-text"><strong>Margin Protection</strong> - Understanding the volume lift vs margin erosion trade-off at different discount depths.</div></div></div>
123425 unmodified lines3031323334353637383940414243{% extends "base.html" %}{% block page_title %}Scenario Manager{% endblock %}{% block content %}25 unmodified lines<!-- KPI Summary --><div class="kpi-grid" id="scenKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('Which scenario delivers the best ROAS?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">Best Scenario</span></div><div class="aira-insight-text"><strong>Scenario Analysis</strong> - Comparing all saved scenarios to identify the most effective budget allocation strategy.</div></div></div>123425 unmodified lines3031323334353637383940414243{% extends "base.html" %}{% block page_title %}Scenario Manager{% endblock %}{% block content %}25 unmodified lines<!-- KPI Summary --><div class="kpi-grid" id="scenKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('Which scenario delivers the best ROAS?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">Best Scenario</span></div><div class="nova-insight-text"><strong>Scenario Analysis</strong> - Comparing all saved scenarios to identify the most effective budget allocation strategy.</div></div></div>
123449 unmodified lines54555657585960616263646566676869707172737475767778798081{% extends "base.html" %}{% block page_title %}Trade Promo Analysis{% endblock %}{% block content %}49 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="tpKpiGrid"></div><!-- AIRA Insights --><div class="aira-insights"><div class="aira-insight-card" onclick="sendAIRA('Which retailers have the highest trade spend and volume?')"><div class="aira-insight-header"><div class="aira-insight-icon insight">📊</div><span class="aira-insight-label">AIRA Insight</span></div><div class="aira-insight-text"><strong>Spend concentration</strong> - Top 2 retailers account for 45% of total trade spend. MegaMart shows highest volume performance relative to spend.</div></div><div class="aira-insight-card" onclick="sendAIRA('How much budget variance are we seeing across retailers?')"><div class="aira-insight-header"><div class="aira-insight-icon warning">⚠</div><span class="aira-insight-label">AIRA Alert</span></div><div class="aira-insight-text"><strong>Budget overrun detected</strong> - Actual trade spend exceeds planned by 8% on average. Two retailers consistently overspend vs plan.</div></div><div class="aira-insight-card" onclick="sendAIRA('What does the P&L Gross-to-Net breakdown look like?')"><div class="aira-insight-header"><div class="aira-insight-icon opportunity">🚀</div><span class="aira-insight-label">AIRA Opportunity</span></div><div class="aira-insight-text"><strong>P&L optimization</strong> - Trade deductions represent a significant % of gross revenue. Off-invoice discounts are the largest deduction category.</div></div></div>123449 unmodified lines54555657585960616263646566676869707172737475767778798081{% extends "base.html" %}{% block page_title %}Trade Promo Analysis{% endblock %}{% block content %}49 unmodified lines<!-- KPI Cards --><div class="kpi-grid" id="tpKpiGrid"></div><!-- NOVA Insights --><div class="nova-insights"><div class="nova-insight-card" onclick="sendNOVA('Which retailers have the highest trade spend and volume?')"><div class="nova-insight-header"><div class="nova-insight-icon insight">📊</div><span class="nova-insight-label">NOVA Insight</span></div><div class="nova-insight-text"><strong>Spend concentration</strong> - Top 2 retailers account for 45% of total trade spend. MegaMart shows highest volume performance relative to spend.</div></div><div class="nova-insight-card" onclick="sendNOVA('How much budget variance are we seeing across retailers?')"><div class="nova-insight-header"><div class="nova-insight-icon warning">⚠</div><span class="nova-insight-label">NOVA Alert</span></div><div class="nova-insight-text"><strong>Budget overrun detected</strong> - Actual trade spend exceeds planned by 8% on average. Two retailers consistently overspend vs plan.</div></div><div class="nova-insight-card" onclick="sendNOVA('What does the P&L Gross-to-Net breakdown look like?')"><div class="nova-insight-header"><div class="nova-insight-icon opportunity">🚀</div><span class="nova-insight-label">NOVA Opportunity</span></div><div class="nova-insight-text"><strong>P&L optimization</strong> - Trade deductions represent a significant % of gross revenue. Off-invoice discounts are the largest deduction category.</div></div></div>
115 unmodified lines116117118119120121122115 unmodified lines("/strategy/scenarios/", "Strategy Scenarios"),]:def html_check(html_str):if 'Marketing Mix Intelligence' not in html_str and 'sidebar' not in html_str.lower():return "HTML missing expected content"return Nonecheck(f"HTML {name}", get, path, False, validators=[html_check])115 unmodified lines116117118119120121122115 unmodified lines("/strategy/scenarios/", "Strategy Scenarios"),]:def html_check(html_str):if 'PRISM Marketing Intelligence' not in html_str and 'sidebar' not in html_str.lower():return "HTML missing expected content"return Nonecheck(f"HTML {name}", get, path, False, validators=[html_check])
README.md+11-11
static/css/components.css+51-51
static/js/alerts.js+2-2
static/js/nova.jsAdded+146
templates/ads.html+13-13
templates/base.html+29-29
templates/consumer_promo.html+18-18
templates/data_mgmt.html+2-2
templates/diagnostics.html+18-18
templates/home.html+18-18
templates/login.html+3-3
templates/media.html+13-13
templates/media_effects.html+18-18
templates/model_results.html+18-18
templates/sales_insights.html+18-18
templates/strategy_illustrative.html+13-13
templates/strategy_scenarios.html+8-8
templates/trade_promo.html+18-18
tests_runner.py+1-1