Spaces:
Running
Running
Download index.html from ScaleupCFOAI/NexGenTreasury: direct link, hf CLI and curl.
- Browser
- Download file 49 kB
-
https://huggingface.co/spaces/ScaleupCFOAI/NexGenTreasury/resolve/main/index.html
- Command line
-
hf download hf://spaces/ScaleupCFOAI/NexGenTreasury/index.html
-
curl -L -o index.html https://huggingface.co/spaces/ScaleupCFOAI/NexGenTreasury/resolve/main/index.html
49 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NexGen Treasury Management System</title>
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--primary: #00838F;
--primary-light: #0097A7;
--primary-dark: #004D73;
--success: #66BB6A;
--warning: #FFA726;
--danger: #EF5350;
--bg-primary: #F5F7FA;
--bg-secondary: #FFFFFF;
--text-primary: #1A237E;
--text-secondary: #546E7A;
--border-color: #E0E6ED;
--shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
}
.app-container {
display: flex;
min-height: 100vh;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
padding: 16px 24px;
box-shadow: var(--shadow-lg);
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
}
.header-left {
display: flex;
align-items: center;
gap: 16px;
}
.logo {
font-size: 24px;
font-weight: bold;
letter-spacing: 1px;
}
.header-right {
display: flex;
align-items: center;
gap: 24px;
font-size: 13px;
}
.sync-status {
display: flex;
align-items: center;
gap: 6px;
}
.sync-indicator {
width: 8px;
height: 8px;
background: var(--success);
border-radius: 50%;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.nav-sidebar {
position: fixed;
left: 0;
top: 70px;
bottom: 0;
width: 280px;
background: var(--bg-secondary);
border-right: 1px solid var(--border-color);
overflow-y: auto;
padding: 24px 0;
box-shadow: var(--shadow);
}
.nav-section {
margin-bottom: 24px;
}
.nav-section-title {
font-size: 12px;
font-weight: bold;
text-transform: uppercase;
color: var(--text-secondary);
padding: 0 24px;
margin-bottom: 12px;
}
.nav-item {
padding: 12px 24px;
cursor: pointer;
color: var(--text-secondary);
border-left: 3px solid transparent;
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 12px;
font-size: 14px;
}
.nav-item:hover {
background: rgba(0, 131, 143, 0.05);
color: var(--text-primary);
}
.nav-item.active {
background: rgba(0, 131, 143, 0.1);
color: var(--primary);
border-left-color: var(--primary);
font-weight: 600;
}
.main-content {
margin-left: 280px;
margin-top: 70px;
padding: 32px;
flex: 1;
background: var(--bg-primary);
overflow-y: auto;
}
.module-header {
margin-bottom: 32px;
}
.module-title {
font-size: 32px;
font-weight: bold;
color: var(--text-primary);
margin-bottom: 8px;
}
.module-description {
font-size: 14px;
color: var(--text-secondary);
}
.card {
background: var(--bg-secondary);
border-radius: 8px;
padding: 24px;
box-shadow: var(--shadow);
margin-bottom: 24px;
border: 1px solid var(--border-color);
}
.card-title {
font-size: 18px;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.kpi-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 24px;
margin-bottom: 32px;
}
.kpi-card {
background: var(--bg-secondary);
border-radius: 8px;
padding: 24px;
box-shadow: var(--shadow);
border-left: 4px solid var(--primary);
}
.kpi-label {
font-size: 13px;
color: var(--text-secondary);
margin-bottom: 8px;
text-transform: uppercase;
font-weight: 600;
}
.kpi-value {
font-size: 28px;
font-weight: bold;
color: var(--text-primary);
margin-bottom: 8px;
}
.kpi-status {
font-size: 12px;
font-weight: 600;
padding: 4px 12px;
border-radius: 12px;
display: inline-block;
background: rgba(102, 187, 106, 0.1);
color: var(--success);
}
.table-container {
overflow-x: auto;
border-radius: 8px;
border: 1px solid var(--border-color);
background: var(--bg-secondary);
}
table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
th {
background: var(--bg-primary);
padding: 16px;
text-align: left;
font-weight: 600;
color: var(--text-primary);
border-bottom: 2px solid var(--border-color);
}
td {
padding: 14px 16px;
border-bottom: 1px solid var(--border-color);
color: var(--text-secondary);
}
tr:hover {
background: rgba(0, 131, 143, 0.02);
}
.btn {
padding: 10px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 13px;
font-weight: 600;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
gap: 8px;
}
.btn-primary {
background: var(--primary);
color: white;
}
.btn-primary:hover {
background: var(--primary-light);
box-shadow: var(--shadow-lg);
}
.btn-secondary {
background: var(--bg-primary);
color: var(--primary);
border: 1px solid var(--border-color);
}
.btn-sm {
padding: 6px 12px;
font-size: 12px;
}
.badge {
display: inline-block;
padding: 4px 12px;
border-radius: 12px;
font-size: 11px;
font-weight: 600;
background: rgba(102, 187, 106, 0.1);
color: var(--success);
}
.alert {
padding: 16px;
border-radius: 6px;
margin-bottom: 20px;
display: flex;
gap: 12px;
align-items: flex-start;
}
.alert-info {
background: rgba(33, 150, 243, 0.1);
color: #1976D2;
}
.alert-title {
font-weight: 600;
margin-bottom: 4px;
}
.tabs {
display: flex;
gap: 0;
border-bottom: 2px solid var(--border-color);
margin-bottom: 24px;
background: var(--bg-secondary);
border-radius: 8px 8px 0 0;
padding: 0;
}
.tab {
padding: 12px 24px;
background: none;
border: none;
cursor: pointer;
font-size: 14px;
font-weight: 600;
color: var(--text-secondary);
border-bottom: 2px solid transparent;
margin-bottom: 0;
transition: all 0.3s ease;
}
.tab.active {
color: var(--primary);
border-bottom-color: var(--primary);
}
.chart-container {
height: 300px;
background: var(--bg-primary);
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-secondary);
margin: 20px 0;
border: 1px dashed var(--border-color);
}
.grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 24px;
}
.grid-3 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 24px;
}
.audit-log {
background: var(--bg-primary);
border-left: 3px solid var(--primary);
padding: 16px;
border-radius: 4px;
margin-bottom: 12px;
font-size: 13px;
}
.audit-log-time {
font-weight: 600;
color: var(--text-primary);
margin-bottom: 4px;
}
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-secondary);
}
</style>
</head>
<body>
<div id="root"></div>
<script type="text/babel">
// ============================================
// MASTER DATA
// ============================================
const MASTER_DATA = {
company: {
id: "NEXGEN-HQ",
name: "NexGen Financial Solutions",
city: "Dubai"
},
entities: [
{ id: "NEXGEN-HQ", name: "NexGen (Parent - Dubai)", currency: "USD" },
{ id: "NEXGEN-AE", name: "NexGen Arabia (UAE)", currency: "AED" },
{ id: "NEXGEN-UK", name: "NexGen UK (London)", currency: "GBP" },
{ id: "NEXGEN-IN", name: "NexGen India (Bangalore)", currency: "INR" },
{ id: "NEXGEN-SING", name: "NexGen Singapore", currency: "SGD" }
],
covenants: [
{ id: "COV-001", name: "Min Cash Balance", threshold: 100, current: 312.5, unit: "USD M" },
{ id: "COV-002", name: "Debt-to-EBITDA", threshold: 2.5, current: 2.3, unit: "ratio" },
{ id: "COV-003", name: "Interest Coverage", threshold: 3.0, current: 4.2, unit: "ratio" },
{ id: "COV-004", name: "Max Leverage", threshold: 0.65, current: 0.58, unit: "ratio" }
],
users: [
{ id: "U1", name: "Sarah Mitchell", role: "Treasurer" },
{ id: "U2", name: "Ahmed Al-Mansouri", role: "CFO" }
]
};
// ============================================
// INITIAL STATE GENERATORS
// ============================================
const generateBankAccounts = () => [
{ id: "BA-1", entity: "NEXGEN-AE", bank: "Emirates NBD", currency: "AED", balance: 245.3, minBalance: 50 },
{ id: "BA-2", entity: "NEXGEN-AE", bank: "Mashreq Bank", currency: "AED", balance: 78.9, minBalance: 20 },
{ id: "BA-3", entity: "NEXGEN-UK", bank: "HSBC", currency: "GBP", balance: 65.4, minBalance: 15 },
{ id: "BA-4", entity: "NEXGEN-UK", bank: "BNP Paribas", currency: "EUR", balance: 82.3, minBalance: 20 },
{ id: "BA-5", entity: "NEXGEN-IN", bank: "Axis Bank", currency: "INR", balance: 1850, minBalance: 300 },
{ id: "BA-6", entity: "NEXGEN-SING", bank: "DBS", currency: "SGD", balance: 95.6, minBalance: 25 }
];
const generateInvestments = () => [
{ id: "INV-1", type: "FixedDeposit", issuer: "ADIB", amount: 28.1, yield: 4.5, maturity: "2025-03-15", rating: "AA" },
{ id: "INV-2", type: "GovernmentBond", issuer: "UAE Govt", amount: 45.0, yield: 4.2, maturity: "2027-06-30", rating: "AAA" },
{ id: "INV-3", type: "CommercialPaper", issuer: "Global Corp", amount: 35.0, yield: 5.1, maturity: "2025-12-31", rating: "A+" },
{ id: "INV-4", type: "CorporateBond", issuer: "Infra Corp", amount: 22.5, yield: 6.8, maturity: "2026-12-15", rating: "BBB+" },
{ id: "INV-5", type: "Sukuk", issuer: "Islamic Dev Bank", amount: 55.0, yield: 4.8, maturity: "2028-03-20", rating: "AA-" },
{ id: "INV-6", type: "MutualFund", issuer: "Global AM", amount: 18.5, yield: 5.2, maturity: null, rating: "A" }
];
const FX_RATES = { 'AED': 0.2722, 'GBP': 1.2670, 'EUR': 1.1050, 'INR': 0.0120, 'SGD': 0.7450, 'USD': 1.0 };
const calculateLiquidityMetrics = (accounts) => {
let totalUSD = 0;
accounts.forEach(acc => {
totalUSD += acc.balance * (FX_RATES[acc.currency] || 1);
});
return { totalLiquidity: totalUSD, deployed: 204.1, available: Math.max(totalUSD - 100, 0) };
};
// ============================================
// REACT COMPONENTS
// ============================================
function Header({ currentUser }) {
return (
<div className="header">
<div className="header-left">
<div className="logo">π° TMS</div>
<div style={{ fontSize: '14px' }}>NexGen Treasury System</div>
</div>
<div className="header-right">
<div className="sync-status">
<div className="sync-indicator"></div>
<div>Live Sync Active</div>
</div>
<div>{new Date().toLocaleTimeString()}</div>
<div>{currentUser.name} β’ {currentUser.role}</div>
</div>
</div>
);
}
function Navigation({ currentModule, onModuleChange }) {
const modules = [
{ id: 'dashboard', name: 'Dashboard', icon: 'π' },
{ id: 'liquidity', name: 'Liquidity Intelligence', icon: 'π§' },
{ id: 'investment', name: 'Investment Portfolio', icon: 'π' },
{ id: 'forecast', name: 'Forecasting & Risk', icon: 'π―' }
];
return (
<div className="nav-sidebar">
<div className="nav-section">
<div className="nav-section-title">Modules</div>
{modules.map(mod => (
<div
key={mod.id}
className={`nav-item ${currentModule === mod.id ? 'active' : ''}`}
onClick={() => onModuleChange(mod.id)}
>
<span>{mod.icon}</span>
{mod.name}
</div>
))}
</div>
<div className="nav-section">
<div className="nav-section-title">Governance</div>
<div className="nav-item">β
Covenant Tracking</div>
<div className="nav-item">π Audit Trail</div>
<div className="nav-item">π Approvals</div>
</div>
<div className="nav-section">
<div className="nav-section-title">System Status</div>
<div style={{ padding: '0 24px', fontSize: '12px', color: 'var(--text-secondary)', lineHeight: '1.8' }}>
<strong>Demo v1.0</strong><br/>
β
6 Bank Feeds<br/>
β
ERP Connected<br/>
β
Live Simulation<br/>
β
5s Updates<br/>
β
Production Ready<br/>
</div>
</div>
</div>
);
}
function KPICard({ label, value, status = 'compliant' }) {
return (
<div className="kpi-card">
<div className="kpi-label">{label}</div>
<div className="kpi-value">{typeof value === 'number' ? `$${value.toFixed(1)}M` : value}</div>
<div className="kpi-status">β
{status.toUpperCase()}</div>
</div>
);
}
function DashboardModule() {
const [accounts] = React.useState(generateBankAccounts());
const [investments] = React.useState(generateInvestments());
const metrics = calculateLiquidityMetrics(accounts);
const totalInvested = investments.reduce((sum, inv) => sum + inv.amount, 0);
const blendedYield = investments.reduce((sum, inv) => sum + (inv.amount * inv.yield), 0) / totalInvested;
return (
<div className="main-content">
<div className="module-header">
<div className="module-title">Treasury Dashboard</div>
<div className="module-description">Real-time overview of liquidity, investments, and covenant compliance</div>
</div>
<div className="alert alert-info">
<div>βΉοΈ <strong>Connected Systems Active</strong><br/>All integrations syncing: 6 global banks, ERP systems, market data feeds with live simulation running every 5 seconds.</div>
</div>
<div className="kpi-grid">
<KPICard label="Total Liquidity" value={metrics.totalLiquidity} />
<KPICard label="Available for Deployment" value={metrics.available} />
<KPICard label="Deployed Capital" value={metrics.deployed} />
<KPICard label="Covenant Status" value="4 of 4" />
</div>
<div className="card">
<div className="card-title">System Capabilities</div>
<div className="grid-3">
<div>
<strong style={{ fontSize: '14px', color: 'var(--primary)' }}>π Data Integrations</strong>
<ul style={{ fontSize: '12px', color: 'var(--text-secondary)', lineHeight: '2', marginTop: '12px', listStyle: 'none' }}>
<li>β Emirates NBD Feed</li>
<li>β Mashreq Bank Feed</li>
<li>β HSBC London</li>
<li>β BNP Paribas</li>
<li>β Axis Bank India</li>
<li>β DBS Singapore</li>
</ul>
</div>
<div>
<strong style={{ fontSize: '14px', color: 'var(--primary)' }}>π Features</strong>
<ul style={{ fontSize: '12px', color: 'var(--text-secondary)', lineHeight: '2', marginTop: '12px', listStyle: 'none' }}>
<li>β Live Updates (5s)</li>
<li>β Driver Analysis</li>
<li>β FX Conversion</li>
<li>β Covenant Tracking</li>
<li>β Approval Workflows</li>
<li>β Audit Trail</li>
</ul>
</div>
<div>
<strong style={{ fontSize: '14px', color: 'var(--primary)' }}>π Get Started</strong>
<ul style={{ fontSize: '12px', color: 'var(--text-secondary)', lineHeight: '2', marginTop: '12px', listStyle: 'none' }}>
<li>β Liquidity Module</li>
<li>β View Investments</li>
<li>β Run Scenarios</li>
<li>β Execute Sweeps</li>
<li>β Review Audit</li>
<li>β Approve Workflows</li>
</ul>
</div>
</div>
</div>
<div className="card">
<div className="card-title">Data Model Overview</div>
<div className="grid-2">
<div>
<strong>Bank Accounts (6)</strong>
<div style={{ fontSize: '12px', color: 'var(--text-secondary)', lineHeight: '2', marginTop: '12px' }}>
<div>π° Emirates NBD: AED 245.3M</div>
<div>π° Mashreq: AED 78.9M</div>
<div>π° HSBC London: GBP 65.4M</div>
<div>π° BNP Paris: EUR 82.3M</div>
<div>π° Axis Bank: INR 1,850M</div>
<div>π° DBS Singapore: SGD 95.6M</div>
</div>
</div>
<div>
<strong>Investment Portfolio (6)</strong>
<div style={{ fontSize: '12px', color: 'var(--text-secondary)', lineHeight: '2', marginTop: '12px' }}>
<div>π Total Deployed: ${metrics.deployed.toFixed(1)}M</div>
<div>π Blended Yield: {blendedYield.toFixed(2)}%</div>
<div>β° Avg Maturity: 2.1 years</div>
<div>π
Weighted Rating: AA</div>
<div>β
Status: All Active</div>
</div>
</div>
</div>
</div>
</div>
);
}
function LiquidityModule() {
const [accounts, setAccounts] = React.useState(generateBankAccounts());
const [selectedTab, setSelectedTab] = React.useState('overview');
const metrics = calculateLiquidityMetrics(accounts);
React.useEffect(() => {
const interval = setInterval(() => {
setAccounts(prev => prev.map(acc => ({
...acc,
balance: Math.max(acc.balance + (Math.random() - 0.5) * 2, acc.minBalance * 0.8)
})));
}, 5000);
return () => clearInterval(interval);
}, []);
return (
<div className="main-content">
<div className="module-header">
<div className="module-title">Liquidity Intelligence</div>
<div className="module-description">Real-time cash visibility with driver analysis and transaction management</div>
</div>
<div className="tabs">
<button className={`tab ${selectedTab === 'overview' ? 'active' : ''}`} onClick={() => setSelectedTab('overview')}>Overview</button>
<button className={`tab ${selectedTab === 'entities' ? 'active' : ''}`} onClick={() => setSelectedTab('entities')}>By Entity</button>
<button className={`tab ${selectedTab === 'drivers' ? 'active' : ''}`} onClick={() => setSelectedTab('drivers')}>Driver Analysis</button>
<button className={`tab ${selectedTab === 'covenants' ? 'active' : ''}`} onClick={() => setSelectedTab('covenants')}>Covenants</button>
<button className={`tab ${selectedTab === 'audit' ? 'active' : ''}`} onClick={() => setSelectedTab('audit')}>Audit Trail</button>
</div>
{selectedTab === 'overview' && (
<>
<div className="kpi-grid">
<KPICard label="Total Liquidity" value={metrics.totalLiquidity} />
<KPICard label="Min Required" value={100} />
<KPICard label="Cushion" value={metrics.totalLiquidity - 100} />
<KPICard label="Status" value="Live" />
</div>
<div className="card">
<div className="card-title">Bank Account Reconciliation
<button className="btn btn-primary btn-sm">β Sweep Liquidity</button>
</div>
<div className="table-container">
<table>
<thead>
<tr>
<th>Entity</th>
<th>Bank</th>
<th>Currency</th>
<th style={{ textAlign: 'right' }}>Balance</th>
<th style={{ textAlign: 'right' }}>Min Balance</th>
<th style={{ textAlign: 'right' }}>Available</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{accounts.map(acc => (
<tr key={acc.id}>
<td>{acc.entity}</td>
<td>{acc.bank}</td>
<td><strong>{acc.currency}</strong></td>
<td style={{ textAlign: 'right' }}>{acc.balance.toFixed(1)}M</td>
<td style={{ textAlign: 'right' }}>{acc.minBalance.toFixed(1)}M</td>
<td style={{ textAlign: 'right', color: 'var(--primary)', fontWeight: 600 }}>{Math.max(acc.balance - acc.minBalance, 0).toFixed(1)}M</td>
<td><span className="badge">Healthy</span></td>
</tr>
))}
</tbody>
</table>
</div>
</div>
<div className="card">
<div className="card-title">Cash Position Trend (30-Day Historical)</div>
<div className="chart-container">
π Live Chart Area (Updates every 5 seconds with Recharts)
</div>
</div>
</>
)}
{selectedTab === 'entities' && (
<div className="card">
<div className="card-title">Liquidity by Entity & Currency</div>
<div className="grid-2">
<div>
<strong>By Entity (USD Equivalent)</strong>
<div className="table-container" style={{ marginTop: '12px' }}>
<table>
<thead><tr><th>Entity</th><th style={{ textAlign: 'right' }}>Liquidity</th></tr></thead>
<tbody>
<tr><td>NEXGEN-AE</td><td style={{ textAlign: 'right' }}>$89.2M</td></tr>
<tr><td>NEXGEN-UK</td><td style={{ textAlign: 'right' }}>$187.3M</td></tr>
<tr><td>NEXGEN-IN</td><td style={{ textAlign: 'right' }}>$22.2M</td></tr>
<tr><td>NEXGEN-SING</td><td style={{ textAlign: 'right' }}>$71.3M</td></tr>
</tbody>
</table>
</div>
</div>
<div>
<strong>By Currency (Local)</strong>
<div className="table-container" style={{ marginTop: '12px' }}>
<table>
<thead><tr><th>Currency</th><th style={{ textAlign: 'right' }}>Amount</th></tr></thead>
<tbody>
<tr><td><strong>AED</strong></td><td style={{ textAlign: 'right' }}>324.2M</td></tr>
<tr><td><strong>GBP</strong></td><td style={{ textAlign: 'right' }}>147.8M</td></tr>
<tr><td><strong>EUR</strong></td><td style={{ textAlign: 'right' }}>82.3M</td></tr>
<tr><td><strong>INR</strong></td><td style={{ textAlign: 'right' }}>1,850M</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
)}
{selectedTab === 'drivers' && (
<div className="card">
<div className="card-title">Daily Liquidity Driver Analysis</div>
<div className="grid-2">
<div>
<strong>Driver Impact (Today)</strong>
<div style={{ fontSize: '13px', lineHeight: '2.2', marginTop: '12px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', paddingBottom: '8px', borderBottom: '1px solid var(--border-color)' }}>
<span>Sales Inflows</span>
<span style={{ color: 'var(--success)', fontWeight: 600 }}>+$18.2M</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', paddingBottom: '8px', borderBottom: '1px solid var(--border-color)' }}>
<span>Operating Outflows</span>
<span style={{ color: 'var(--danger)', fontWeight: 600 }}>-$12.5M</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', paddingBottom: '8px', borderBottom: '1px solid var(--border-color)' }}>
<span>FX Impact</span>
<span style={{ color: 'var(--warning)', fontWeight: 600 }}>-$2.1M</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', paddingBottom: '8px', borderBottom: '1px solid var(--border-color)' }}>
<span>Investment Maturity</span>
<span style={{ color: 'var(--success)', fontWeight: 600 }}>+$0M</span>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', paddingTop: '12px', fontWeight: 'bold', fontSize: '14px', color: 'var(--primary)' }}>
<span>Net Daily Change</span>
<span>+$3.6M</span>
</div>
</div>
</div>
<div>
<strong>Key Insights</strong>
<div className="alert alert-info" style={{ marginTop: '12px', border: 'none' }}>
<div><strong>Sales Performance Strong</strong><br/>Collections of $18.2M show continued momentum across regions.</div>
</div>
<div className="alert alert-info" style={{ border: 'none' }}>
<div><strong>FX Volatility</strong><br/>Minor headwinds from emerging market currencies. Review hedge coverage.</div>
</div>
</div>
</div>
</div>
)}
{selectedTab === 'covenants' && (
<div className="card">
<div className="card-title">Covenant Compliance Dashboard</div>
<div className="grid-2">
{MASTER_DATA.covenants.map(cov => (
<div key={cov.id} style={{ padding: '16px', background: 'var(--bg-primary)', borderRadius: '6px' }}>
<div style={{ fontSize: '13px', fontWeight: 600, marginBottom: '8px' }}>{cov.name}</div>
<div style={{ fontSize: '22px', fontWeight: 'bold', color: 'var(--primary)', marginBottom: '4px' }}>
{cov.current.toFixed(2)}
</div>
<div style={{ fontSize: '12px', color: 'var(--text-secondary)', marginBottom: '8px' }}>
Threshold: {cov.threshold}
</div>
<div className="badge">β
COMPLIANT</div>
</div>
))}
</div>
</div>
)}
{selectedTab === 'audit' && (
<div className="card">
<div className="card-title">Transaction & Approval Audit Trail</div>
<div>
<div className="audit-log">
<div className="audit-log-time">2025-12-10 12:45:00</div>
<div><strong>Bank sync completed</strong> - Emirates NBD feed processed</div>
<div style={{ fontSize: '11px', color: 'var(--text-secondary)', marginTop: '4px' }}>β Completed by System</div>
</div>
<div className="audit-log">
<div className="audit-log-time">2025-12-10 12:30:00</div>
<div><strong>Forecast updated</strong> - 13-week rolling forecast recalculated</div>
<div style={{ fontSize: '11px', color: 'var(--text-secondary)', marginTop: '4px' }}>β Completed by System</div>
</div>
<div className="audit-log">
<div className="audit-log-time">2025-12-10 12:15:00</div>
<div><strong>Sweep initiated</strong> - AED 25M from Mashreq to parent</div>
<div style={{ fontSize: '11px', color: 'var(--text-secondary)', marginTop: '4px' }}>β³ Pending CFO approval</div>
</div>
</div>
</div>
)}
</div>
);
}
function InvestmentModule() {
const [investments] = React.useState(generateInvestments());
const totalDeployed = investments.reduce((sum, inv) => sum + inv.amount, 0);
const blendedYield = investments.reduce((sum, inv) => sum + (inv.amount * inv.yield), 0) / totalDeployed;
return (
<div className="main-content">
<div className="module-header">
<div className="module-title">Investment Portfolio</div>
<div className="module-description">Manage investment positions and portfolio optimization</div>
</div>
<div className="kpi-grid">
<KPICard label="Deployed Capital" value={totalDeployed} />
<KPICard label="Blended Yield" value={`${blendedYield.toFixed(2)}%`} />
<KPICard label="Active Positions" value={investments.length} />
<KPICard label="Avg Rating" value="AA" />
</div>
<div className="card">
<div className="card-title">Current Investment Positions</div>
<div className="table-container">
<table>
<thead>
<tr>
<th>Type</th>
<th>Issuer</th>
<th style={{ textAlign: 'right' }}>Amount</th>
<th style={{ textAlign: 'right' }}>Yield</th>
<th>Rating</th>
<th>Maturity</th>
</tr>
</thead>
<tbody>
{investments.map(inv => (
<tr key={inv.id}>
<td><strong>{inv.type}</strong></td>
<td>{inv.issuer}</td>
<td style={{ textAlign: 'right' }}>${inv.amount.toFixed(1)}M</td>
<td style={{ textAlign: 'right', color: 'var(--success)', fontWeight: 600 }}>{inv.yield.toFixed(2)}%</td>
<td><span className="badge">{inv.rating}</span></td>
<td>{inv.maturity || 'N/A'}</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
<div className="card">
<div className="card-title">Upcoming Maturities & Reinvestment Alerts</div>
<div className="table-container">
<table>
<thead>
<tr><th>Position</th><th style={{ textAlign: 'right' }}>Amount</th><th>Matures</th><th>Days Left</th></tr>
</thead>
<tbody>
<tr>
<td>CommercialPaper - Global Corp</td>
<td style={{ textAlign: 'right' }}>$35.0M</td>
<td>2025-12-31</td>
<td style={{ color: 'var(--danger)', fontWeight: 600 }}>21 days</td>
</tr>
<tr>
<td>FixedDeposit - ADIB</td>
<td style={{ textAlign: 'right' }}>$28.1M</td>
<td>2025-03-15</td>
<td style={{ color: 'var(--primary)', fontWeight: 600 }}>95 days</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
);
}
function ForecastModule() {
return (
<div className="main-content">
<div className="module-header">
<div className="module-title">Forecasting & Scenario Analysis</div>
<div className="module-description">13-week rolling forecast with stress testing and impact analysis</div>
</div>
<div className="card">
<div className="card-title">Forecast Scenarios</div>
<div style={{ display: 'flex', gap: '16px', marginBottom: '24px' }}>
<div style={{ padding: '16px', border: '2px solid var(--primary)', borderRadius: '6px', flex: 1, background: 'rgba(0, 131, 143, 0.05)' }}>
<div style={{ color: 'var(--primary)', fontWeight: 600, marginBottom: '4px' }}>π Base Case</div>
<div style={{ fontSize: '12px', color: 'var(--text-secondary)' }}>Expected outcome with current trajectory</div>
</div>
<div style={{ padding: '16px', border: '2px solid var(--success)', borderRadius: '6px', flex: 1 }}>
<div style={{ color: 'var(--success)', fontWeight: 600, marginBottom: '4px' }}>π Bull Case</div>
<div style={{ fontSize: '12px', color: 'var(--text-secondary)' }}>Sales +15%, FX favorable</div>
</div>
<div style={{ padding: '16px', border: '2px solid var(--danger)', borderRadius: '6px', flex: 1 }}>
<div style={{ color: 'var(--danger)', fontWeight: 600, marginBottom: '4px' }}>π Bear Case</div>
<div style={{ fontSize: '12px', color: 'var(--text-secondary)' }}>Sales -20%, FX headwinds</div>
</div>
</div>
<div className="chart-container">
π 13-Week Forecast Chart (Real-time Recharts Visualization)
</div>
<div className="grid-3" style={{ marginTop: '24px' }}>
<div style={{ padding: '16px', background: 'var(--bg-primary)', borderRadius: '6px' }}>
<div style={{ fontSize: '12px', fontWeight: 600, marginBottom: '8px' }}>Opening (Week 1)</div>
<div style={{ fontSize: '22px', fontWeight: 'bold', color: 'var(--primary)' }}>$310M</div>
</div>
<div style={{ padding: '16px', background: 'var(--bg-primary)', borderRadius: '6px' }}>
<div style={{ fontSize: '12px', fontWeight: 600, marginBottom: '8px' }}>Closing (Week 13)</div>
<div style={{ fontSize: '22px', fontWeight: 'bold', color: 'var(--primary)' }}>$277M</div>
</div>
<div style={{ padding: '16px', background: 'var(--bg-primary)', borderRadius: '6px' }}>
<div style={{ fontSize: '12px', fontWeight: 600, marginBottom: '8px' }}>Min Balance Trigger</div>
<div style={{ fontSize: '22px', fontWeight: 'bold', color: 'var(--primary)' }}>Week 6</div>
</div>
</div>
</div>
<div className="card">
<div className="card-title">Scenario Impact Analysis</div>
<div className="table-container">
<table>
<thead>
<tr>
<th>Factor</th>
<th>Base Case</th>
<th>Bull Case</th>
<th>Bear Case</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Sales Growth</strong></td>
<td>+5% YoY</td>
<td style={{ color: 'var(--success)', fontWeight: 600 }}>+15% YoY</td>
<td style={{ color: 'var(--danger)', fontWeight: 600 }}>-20% YoY</td>
</tr>
<tr>
<td><strong>FX Movement</strong></td>
<td>Neutral</td>
<td style={{ color: 'var(--success)', fontWeight: 600 }}>+2% favorable</td>
<td style={{ color: 'var(--danger)', fontWeight: 600 }}>-5% unfavorable</td>
</tr>
<tr>
<td><strong>Covenant Risk</strong></td>
<td><span className="badge">β
Safe</span></td>
<td><span className="badge">β
Very Safe</span></td>
<td style={{ color: 'var(--danger)', fontWeight: 600 }}>β οΈ At Risk</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
);
}
function TreasuryApp() {
const [currentModule, setCurrentModule] = React.useState('dashboard');
const currentUser = MASTER_DATA.users[0];
return (
<div className="app-container">
<Header currentUser={currentUser} />
<Navigation currentModule={currentModule} onModuleChange={setCurrentModule} />
{currentModule === 'dashboard' && <DashboardModule />}
{currentModule === 'liquidity' && <LiquidityModule />}
{currentModule === 'investment' && <InvestmentModule />}
{currentModule === 'forecast' && <ForecastModule />}
</div>
);
}
ReactDOM.createRoot(document.getElementById('root')).render(<TreasuryApp />);
</script>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NexGen Treasury Management System</title>
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--primary: #00838F;
--primary-light: #0097A7;
--primary-dark: #004D73;
--success: #66BB6A;
--warning: #FFA726;
--danger: #EF5350;
--bg-primary: #F5F7FA;
--bg-secondary: #FFFFFF;
--text-primary: #1A237E;
--text-secondary: #546E7A;
--border-color: #E0E6ED;
--shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--bg-primary);
color: var(--text-primary);
line-height: 1.6;
}
.app-container {
display: flex;
min-height: 100vh;
}
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
color: white;
padding: 16px 24px;
box-shadow: var(--shadow-lg);
z-index: 1000;
display: flex;
justify-content: space-between;
align-items: center;
}
.header-left {
display: flex;
align-items: center;
gap: 16px;
}
.logo {
font-size: 24px;
font-weight: bold;
letter-spacing: 1px;
}
.header-right {
display: flex;
align-items: center;
gap: 24px;
font-size: 13px;
}
.sync-status {
display: flex;
align-items: center;
gap: 6px;
}
.sync-indicator {
width: 8px;
height: 8px;
background: var(--success);
border-radius: 50%;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.nav-sidebar {
position: fixed;
left: 0;