Repository navigation
Expand file tree
/
Copy pathapp-erp.html
More file actions
555 lines (500 loc) · 34.8 KB
/
Copy pathapp-erp.html
File metadata and controls
555 lines (500 loc) · 34.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Apex Logistics ERP — Powered by Hyperstack</title>
<script src="/vendor/htmx.min.js"></script>
<script src="/htmx-bolt.js"></script>
<script src="/htmx-flash.js"></script>
<script src="/htmx-form.js"></script>
<script src="/htmx-vibe.js"></script>
<script src="/htmx-a11y.js"></script>
<script src="/htmx-virtual.js"></script>
<script src="/htmx-grid.js"></script>
<script src="/htmx-offline.js"></script>
<script src="/htmx-sim.js"></script>
<script src="/htmx-calc.js"></script>
<script src="/htmx-devtools.js"></script>
<link rel="stylesheet" href="/styles.css">
<style>
@layer base {
:root {
--background: 210 40% 98%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;
--primary: 221.2 83.2% 53.3%;
--primary-foreground: 210 40% 98%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
}
}
</style>
</head>
<body hx-state class="h-full bg-slate-50 text-slate-900 flex flex-col font-sans antialiased selection:bg-blue-500/20">
<script type="application/json" hx-state>
{
"currentTab": "dashboard",
"activeRole": "admin",
"sidebarOpen": true,
"theme": "light",
"notifications": [
{ "id": 1, "title": "System Online", "msg": "Hyperstack 11 Engines Initialized", "time": "Just now" }
],
"kpis": {
"revenue": 1284500,
"activeOrders": 1420,
"invoicesCount": 10000,
"syncStatus": "Connected"
}
}
</script>
<!-- Top Global App Bar (Light Theme) -->
<header class="h-14 border-b border-slate-200 bg-white/95 backdrop-blur px-4 flex items-center justify-between z-30 sticky top-0 shadow-xs">
<div class="flex items-center gap-3">
<div class="w-8 h-8 rounded-lg bg-blue-600 text-white font-extrabold flex items-center justify-center text-sm shadow-sm">
▲
</div>
<div class="flex items-center gap-2">
<span class="font-bold text-sm tracking-tight text-slate-900">Apex Logistics ERP</span>
<span class="text-[10px] uppercase font-mono px-2 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200 font-semibold">Hyperstack Flagship</span>
<span class="px-2 py-0.5 rounded bg-emerald-50 text-emerald-700 text-[10px] font-mono border border-emerald-200 font-bold">v1.1.0</span>
</div>
</div>
<!-- Center Offline Indicator Badge -->
<div hx-offline-indicator style="display:none;" class="px-3 py-1 bg-amber-50 border border-amber-200 rounded-full flex items-center gap-2 text-amber-700 text-xs font-medium animate-pulse">
<span class="w-2 h-2 rounded-full bg-amber-500"></span>
<span>Offline Mode (<strong class="hx-offline-queue-count font-bold">0</strong> queued)</span>
</div>
<div class="flex items-center gap-3">
<!-- DevTools Shortcut Trigger -->
<button onclick="window.HxDevTools && window.HxDevTools.toggle()" class="px-2.5 py-1 text-xs bg-slate-100 hover:bg-slate-200 border border-slate-300 rounded-md font-mono flex items-center gap-1 text-slate-700 shadow-xs transition-colors">
<span>🛠️ DevTools</span>
<kbd class="text-[10px] bg-white px-1 rounded text-slate-500 border border-slate-200">Ctrl+Shift+H</kbd>
</button>
<!-- Back to Docs -->
<a href="/docs/components/introduction/" class="px-2.5 py-1 text-xs bg-slate-100 hover:bg-slate-200 border border-slate-300 rounded-md text-slate-700 shadow-xs transition-colors">
← Framework Docs
</a>
</div>
</header>
<!-- Main Workspace Body -->
<div class="flex-1 flex overflow-hidden">
<!-- Left Navigation Sidebar -->
<aside class="w-60 border-r border-slate-200 bg-white p-3 flex flex-col justify-between shadow-xs">
<div class="space-y-1">
<div class="px-3 py-2 text-[11px] font-bold uppercase tracking-wider text-slate-400">Modules</div>
<button hx-action="currentTab = 'dashboard'" @click="currentTab = 'dashboard'"
hx-class="{ 'bg-blue-50 text-blue-700 font-semibold border-l-2 border-blue-600': currentTab === 'dashboard', 'text-slate-600 hover:bg-slate-100 hover:text-slate-900': currentTab !== 'dashboard' }"
class="w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-xs transition-colors text-left cursor-pointer">
<span>📊</span> Dashboard
</button>
<button hx-action="currentTab = 'invoices'" @click="currentTab = 'invoices'"
hx-class="{ 'bg-blue-50 text-blue-700 font-semibold border-l-2 border-blue-600': currentTab === 'invoices', 'text-slate-600 hover:bg-slate-100 hover:text-slate-900': currentTab !== 'invoices' }"
class="w-full flex items-center justify-between px-3 py-2 rounded-lg text-xs transition-colors text-left cursor-pointer">
<div class="flex items-center gap-2.5">
<span>📋</span> Invoices Data Grid
</div>
<span class="text-[10px] font-mono px-1.5 py-0.5 bg-slate-100 border border-slate-200 rounded text-slate-500 font-medium">10k</span>
</button>
<button hx-action="currentTab = 'wizard'" @click="currentTab = 'wizard'"
hx-class="{ 'bg-blue-50 text-blue-700 font-semibold border-l-2 border-blue-600': currentTab === 'wizard', 'text-slate-600 hover:bg-slate-100 hover:text-slate-900': currentTab !== 'wizard' }"
class="w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-xs transition-colors text-left cursor-pointer">
<span>🧙</span> Create Invoice Wizard
</button>
<button hx-action="currentTab = 'offline'" @click="currentTab = 'offline'"
hx-class="{ 'bg-blue-50 text-blue-700 font-semibold border-l-2 border-blue-600': currentTab === 'offline', 'text-slate-600 hover:bg-slate-100 hover:text-slate-900': currentTab !== 'offline' }"
class="w-full flex items-center justify-between px-3 py-2 rounded-lg text-xs transition-colors text-left cursor-pointer">
<div class="flex items-center gap-2.5">
<span>📴</span> Offline & Sync Hub
</div>
<span class="w-2 h-2 rounded-full bg-emerald-500"></span>
</button>
<button hx-action="currentTab = 'fleet-sim'" @click="currentTab = 'fleet-sim'"
hx-class="{ 'bg-blue-50 text-blue-700 font-semibold border-l-2 border-blue-600': currentTab === 'fleet-sim', 'text-slate-600 hover:bg-slate-100 hover:text-slate-900': currentTab !== 'fleet-sim' }"
class="w-full flex items-center justify-between px-3 py-2 rounded-lg text-xs transition-colors text-left cursor-pointer">
<div class="flex items-center gap-2.5">
<span>🚚</span> Fleet Kinetic Sim
</div>
<span class="text-[9px] font-mono px-1.5 py-0.5 rounded bg-cyan-50 text-cyan-700 border border-cyan-200 font-bold">120Hz</span>
</button>
<button hx-action="currentTab = 'rbac'" @click="currentTab = 'rbac'"
hx-class="{ 'bg-blue-50 text-blue-700 font-semibold border-l-2 border-blue-600': currentTab === 'rbac', 'text-slate-600 hover:bg-slate-100 hover:text-slate-900': currentTab !== 'rbac' }"
class="w-full flex items-center justify-between px-3 py-2 rounded-lg text-xs transition-colors text-left cursor-pointer">
<div class="flex items-center gap-2.5">
<span>🛡️</span> RBAC & Approvals
</div>
<span class="text-[9px] font-mono px-1.5 py-0.5 rounded bg-emerald-50 text-emerald-700 border border-emerald-200 font-bold">Bank</span>
</button>
<button hx-action="currentTab = 'settings'" @click="currentTab = 'settings'"
hx-class="{ 'bg-blue-50 text-blue-700 font-semibold border-l-2 border-blue-600': currentTab === 'settings', 'text-slate-600 hover:bg-slate-100 hover:text-slate-900': currentTab !== 'settings' }"
class="w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-xs transition-colors text-left cursor-pointer">
<span>⚙️</span> Workspace Settings
</button>
</div>
<!-- Quick Status Card -->
<div class="p-3 rounded-xl border border-slate-200 bg-slate-50 space-y-1">
<div class="text-[10px] text-slate-500 font-semibold uppercase">Engine Status</div>
<div class="text-xs text-emerald-600 font-bold flex items-center gap-1.5">
<span class="w-2 h-2 rounded-full bg-emerald-500"></span> 11 Engines Active
</div>
<div class="text-[10px] text-slate-500 font-mono">0ms Local Reactivity</div>
</div>
</aside>
<!-- Main Content Work Area -->
<main class="flex-1 overflow-y-auto p-6 space-y-6 bg-slate-50/60">
<!-- SCREEN 1: EXECUTIVE DASHBOARD -->
<div hx-show="currentTab === 'dashboard'" class="space-y-6">
<div>
<h2 class="text-2xl font-bold text-slate-900 tracking-tight">Executive Performance Overview</h2>
<p class="text-xs text-slate-500">Real-time enterprise metrics rendered with zero virtual DOM overhead.</p>
</div>
<!-- Metric KPI Cards -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<div class="p-4 rounded-xl border border-slate-200 bg-white shadow-sm space-y-1">
<div class="text-xs font-semibold text-slate-500">Total Revenue</div>
<div class="text-2xl font-bold text-slate-900 tracking-tight">$1,284,500.00</div>
<div class="text-[11px] text-emerald-600 font-semibold">↑ +14.2% this month</div>
</div>
<div class="p-4 rounded-xl border border-slate-200 bg-white shadow-sm space-y-1">
<div class="text-xs font-semibold text-slate-500">Active Orders</div>
<div class="text-2xl font-bold text-slate-900 tracking-tight">1,420</div>
<div class="text-[11px] text-sky-600 font-semibold">98.4% on schedule</div>
</div>
<div class="p-4 rounded-xl border border-slate-200 bg-white shadow-sm space-y-1">
<div class="text-xs font-semibold text-slate-500">Invoices In Memory</div>
<div class="text-2xl font-bold text-slate-900 tracking-tight">10,000</div>
<div class="text-[11px] text-purple-600 font-semibold">Windowed at 60 FPS</div>
</div>
<div class="p-4 rounded-xl border border-slate-200 bg-white shadow-sm space-y-1">
<div class="text-xs font-semibold text-slate-500">Sync Engine</div>
<div class="text-2xl font-bold text-emerald-600 tracking-tight">Zero-Drop</div>
<div class="text-[11px] text-slate-500 font-medium">IndexedDB active</div>
</div>
</div>
<!-- Recent Activity Feed -->
<div class="p-5 rounded-xl border border-slate-200 bg-white shadow-sm space-y-3">
<div class="flex items-center justify-between border-b border-slate-100 pb-3">
<h3 class="text-sm font-semibold text-slate-900">Live Transaction Stream</h3>
<span class="text-[11px] font-mono text-slate-500">Auto-refresh via SSE</span>
</div>
<div class="divide-y divide-slate-100 text-xs">
<div class="py-2.5 flex items-center justify-between">
<div class="flex items-center gap-3">
<span class="w-6 h-6 rounded-full bg-emerald-50 text-emerald-600 flex items-center justify-center font-bold text-[10px] border border-emerald-200">✓</span>
<div>
<span class="font-medium text-slate-800">INV-100492 approved for payout</span>
<span class="text-slate-500 ml-2">Cyberdyne Systems</span>
</div>
</div>
<span class="font-mono text-emerald-600 font-semibold">$4,850.00</span>
</div>
<div class="py-2.5 flex items-center justify-between">
<div class="flex items-center gap-3">
<span class="w-6 h-6 rounded-full bg-sky-50 text-sky-600 flex items-center justify-center font-bold text-[10px] border border-sky-200">🚚</span>
<div>
<span class="font-medium text-slate-800">Shipment dispatched to Rotterdam warehouse</span>
<span class="text-slate-500 ml-2">Globex Logistics</span>
</div>
</div>
<span class="font-mono text-slate-600">420 containers</span>
</div>
<div class="py-2.5 flex items-center justify-between">
<div class="flex items-center gap-3">
<span class="w-6 h-6 rounded-full bg-purple-50 text-purple-600 flex items-center justify-center font-bold text-[10px] border border-purple-200">✎</span>
<div>
<span class="font-medium text-slate-800">Invoice #100881 modified offline</span>
<span class="text-slate-500 ml-2">Tablet #4</span>
</div>
</div>
<span class="font-mono text-purple-600 font-semibold">$1,200.00</span>
</div>
</div>
</div>
</div>
<!-- SCREEN 2: 10,000-ROW DATA GRID -->
<div hx-show="currentTab === 'invoices'" class="space-y-4" style="display:none;">
<div class="flex items-center justify-between">
<div>
<h2 class="text-2xl font-bold text-slate-900 tracking-tight">Enterprise Invoices Data Grid</h2>
<p class="text-xs text-slate-500">10,000 virtualized records with column resize, drag & drop reorder, inline edit, and CSV export.</p>
</div>
<button hx-action="currentTab = 'wizard'" @click="currentTab = 'wizard'" class="px-3.5 py-1.5 bg-blue-600 hover:bg-blue-700 text-white font-semibold text-xs rounded-lg shadow-sm transition-colors cursor-pointer">
+ New Invoice
</button>
</div>
<!-- The 10,000-Row Grid Primitive -->
<div class="rounded-xl border border-slate-200 bg-white shadow-sm overflow-hidden p-1">
<div hx-grid hx-grid-src="/api/erp-invoices.json?count=10000" hx-grid-row-height="40" class="w-full"></div>
</div>
</div>
<!-- SCREEN 3: CREATE INVOICE WIZARD -->
<div hx-show="currentTab === 'wizard'" class="space-y-6 max-w-3xl" style="display:none;">
<div>
<h2 class="text-2xl font-bold text-slate-900 tracking-tight">Create Invoice Wizard</h2>
<p class="text-xs text-slate-500">Multi-step orchestration (<code class="bg-slate-100 text-slate-700 px-1 py-0.5 rounded text-xs border border-slate-200"><form hx-wizard></code>) with step validation gates and cascading dropdowns.</p>
</div>
<div class="p-6 rounded-xl border border-slate-200 bg-white shadow-sm space-y-6">
<div class="space-y-2 border-b border-slate-100 pb-4">
<div class="flex items-center justify-between">
<span class="text-xs font-semibold text-blue-600 uppercase tracking-wider">Step <span class="hx-wizard-current-step">1</span> of <span class="hx-wizard-total-steps">3</span></span>
<span class="text-xs text-slate-500 font-medium">New Billing Record</span>
</div>
<div class="w-full h-2 bg-slate-100 rounded-full overflow-hidden border border-slate-200">
<div class="hx-wizard-progress-bar h-full bg-blue-600 transition-all duration-300 w-1/3"></div>
</div>
</div>
<form hx-wizard class="space-y-6">
<!-- Step 1: Customer Details -->
<fieldset hx-step="1" class="space-y-4">
<h3 class="text-base font-semibold text-slate-900">1. Client & Billing Entity</h3>
<div class="grid grid-cols-2 gap-4">
<div>
<label class="block text-xs font-medium text-slate-700 mb-1">Company / Customer Name *</label>
<input type="text" name="customer" hx-validate="required|min:3" placeholder="Acme Logistics Inc." class="w-full px-3 py-2 text-xs bg-white border border-slate-300 rounded-md text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500">
<span hx-error-for="customer" class="text-rose-600 text-xs mt-1 block"></span>
</div>
<div>
<label class="block text-xs font-medium text-slate-700 mb-1">Billing Email *</label>
<input type="email" name="email" hx-validate="required|email" placeholder="billing@acme.com" class="w-full px-3 py-2 text-xs bg-white border border-slate-300 rounded-md text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500">
<span hx-error-for="email" class="text-rose-600 text-xs mt-1 block"></span>
</div>
</div>
</fieldset>
<!-- Step 2: Cascading Line Item -->
<fieldset hx-step="2" class="space-y-4" style="display:none;" disabled>
<h3 class="text-base font-semibold text-slate-900">2. Shipping Destination & Cascading Fields</h3>
<div class="grid grid-cols-2 gap-4" hx-depends="country->state">
<div>
<label class="block text-xs font-medium text-slate-700 mb-1">Country *</label>
<select name="country" id="country" hx-validate="required" class="w-full px-3 py-2 text-xs bg-white border border-slate-300 rounded-md text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">Select Country...</option>
<option value="us">United States</option>
<option value="ca">Canada</option>
<option value="uk">United Kingdom</option>
</select>
<span hx-error-for="country" class="text-rose-600 text-xs mt-1 block"></span>
</div>
<div>
<label class="block text-xs font-medium text-slate-700 mb-1">State / Province *</label>
<select name="state" id="state" hx-validate="required" class="w-full px-3 py-2 text-xs bg-white border border-slate-300 rounded-md text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">Select State...</option>
<option value="ca_state">California</option>
<option value="ny_state">New York</option>
<option value="tx_state">Texas</option>
<option value="on_state">Ontario</option>
</select>
<span hx-error-for="state" class="text-rose-600 text-xs mt-1 block"></span>
</div>
</div>
</fieldset>
<!-- Step 3: Confirmation -->
<fieldset hx-step="3" class="space-y-4" style="display:none;" disabled>
<h3 class="text-base font-semibold text-slate-900">3. Final Verification & Submit</h3>
<div class="p-4 rounded-lg bg-slate-50 border border-slate-200 text-xs space-y-1">
<p class="text-slate-900 font-semibold">Ready to record invoice into ERP ledger.</p>
<p class="text-slate-500">All fields validated. Click Finish to save.</p>
</div>
</fieldset>
<!-- Navigation Controls -->
<div class="flex items-center justify-between pt-4 border-t border-slate-100">
<button type="button" hx-wizard-prev class="px-4 py-2 text-xs font-medium bg-white border border-slate-300 rounded-md hover:bg-slate-50 text-slate-700 disabled:opacity-50 shadow-xs cursor-pointer">← Back</button>
<button type="button" hx-wizard-next class="px-4 py-2 text-xs font-bold bg-blue-600 text-white rounded-md hover:bg-blue-700 shadow-xs cursor-pointer">Next →</button>
</div>
</form>
</div>
</div>
<!-- SCREEN 4: OFFLINE & SYNC HUB -->
<div hx-show="currentTab === 'offline'" class="space-y-6 max-w-4xl" style="display:none;">
<div>
<h2 class="text-2xl font-bold text-slate-900 tracking-tight">Offline Resilience & Mutation Sync Hub</h2>
<p class="text-xs text-slate-500">IndexedDB local mutation queue with 409 conflict detection and background replay.</p>
</div>
<div class="p-6 rounded-xl border border-slate-200 bg-white shadow-sm space-y-6">
<div class="flex items-center justify-between border-b border-slate-100 pb-4">
<div class="flex items-center gap-2">
<span class="w-3 h-3 rounded-full bg-emerald-500 animate-pulse"></span>
<span class="text-sm font-semibold text-slate-900">IndexedDB Storage Driver</span>
</div>
<div class="text-xs font-mono text-slate-500">
Queue: <strong class="hx-offline-queue-count text-blue-600 font-bold">0</strong> pending mutations
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
<button onclick="window.HxOffline && window.HxOffline.queueRequest({ id: 'inv_' + Date.now(), url: '/api/erp-invoices.json', method: 'POST', headers: {}, body: JSON.stringify({ customer: 'Stark Industries', amount: 8900 }), timestamp: Date.now(), retries: 0 })" class="p-4 rounded-xl border border-slate-200 bg-slate-50 hover:bg-slate-100 text-left transition-colors shadow-xs cursor-pointer">
<div class="text-sm font-semibold text-slate-900 mb-1">➕ Simulate Offline Invoice Mutation</div>
<p class="text-xs text-slate-500">Queues an invoice creation into IndexedDB.</p>
</button>
<button onclick="window.HxOffline && window.HxOffline.replayQueue()" class="p-4 rounded-xl border border-slate-200 bg-slate-50 hover:bg-slate-100 text-left transition-colors shadow-xs cursor-pointer">
<div class="text-sm font-semibold text-slate-900 mb-1">🔄 Replay Mutation Queue</div>
<p class="text-xs text-slate-500">Processes all queued mutations with HTTP headers.</p>
</button>
</div>
</div>
</div>
<!-- SCREEN 5: WORKSPACE SETTINGS -->
<div hx-show="currentTab === 'settings'" class="space-y-6 max-w-3xl" style="display:none;">
<div>
<h2 class="text-2xl font-bold text-slate-900 tracking-tight">Workspace & ERP Settings</h2>
<p class="text-xs text-slate-500">Reactive settings bound directly to local Bolt signal state.</p>
</div>
<div class="p-6 rounded-xl border border-slate-200 bg-white shadow-sm space-y-4">
<div class="flex items-center justify-between py-2 border-b border-slate-100">
<div>
<div class="text-xs font-semibold text-slate-900">Default Ledger Currency</div>
<div class="text-[11px] text-slate-500">Used for financial summaries and exports</div>
</div>
<select class="px-3 py-1.5 text-xs bg-white border border-slate-300 rounded-md text-slate-900 focus:ring-2 focus:ring-blue-500">
<option value="usd">USD ($)</option>
<option value="eur">EUR (€)</option>
<option value="gbp">GBP (£)</option>
</select>
</div>
<div class="flex items-center justify-between py-2 border-b border-slate-100">
<div>
<div class="text-xs font-semibold text-slate-900">Undo / Redo History Depth</div>
<div class="text-[11px] text-slate-500">Maximum snapshots stored in memory</div>
</div>
<span class="text-xs font-mono text-blue-600 font-bold">50 Steps</span>
</div>
<div class="pt-2 flex justify-end">
<button onclick="alert('Settings saved into local Bolt state!')" class="px-4 py-2 bg-blue-600 text-white font-bold text-xs rounded-md hover:bg-blue-700 shadow-xs transition-colors cursor-pointer">
Save Preferences
</button>
</div>
</div>
</div>
<!-- SCREEN 6: FLEET LOGISTICS KINETIC SIMULATION -->
<div hx-show="currentTab === 'fleet-sim'" class="space-y-6" style="display:none;">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
<div>
<h2 class="text-2xl font-bold text-slate-900 tracking-tight flex items-center gap-2">
<span>🚚</span> Logistics Fleet Kinetic Simulation
</h2>
<p class="text-xs text-slate-500 mt-1">120Hz Decoupled Kinetic Engine • Multi-Agent Autonomous Fleet Routing</p>
</div>
<div class="flex items-center gap-2">
<span class="text-[11px] font-mono bg-cyan-50 text-cyan-700 border border-cyan-200 px-2.5 py-1 rounded-md font-semibold">Engine: htmx-sim.js</span>
<span class="text-[11px] font-mono bg-emerald-50 text-emerald-700 border border-emerald-200 px-2.5 py-1 rounded-md font-semibold">Spatial Partitioning</span>
</div>
</div>
<!-- Simulation Toolbar -->
<div class="p-4 rounded-xl border border-slate-200 bg-white shadow-sm flex flex-wrap items-center justify-between gap-4">
<div class="flex items-center gap-2">
<span class="text-xs text-slate-500 font-semibold mr-1">Fleet Mode:</span>
<button onclick="$sim('#erp-fleet-canvas', 'preset', 'boids')" class="px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-300 text-xs font-mono font-semibold transition-colors cursor-pointer">🦅 Convoy Flocking</button>
<button onclick="$sim('#erp-fleet-canvas', 'preset', 'collision')" class="px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-300 text-xs font-mono font-semibold transition-colors cursor-pointer">📦 Warehouse Elastic Bounds</button>
<button onclick="$sim('#erp-fleet-canvas', 'preset', 'gravity')" class="px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-300 text-xs font-mono font-semibold transition-colors cursor-pointer">🪐 Hub Gravity Wells</button>
<button onclick="$sim('#erp-fleet-canvas', 'preset', 'slime')" class="px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-300 text-xs font-mono font-semibold transition-colors cursor-pointer">🛣️ Route Optimization (Physarum)</button>
</div>
<div class="flex items-center gap-2">
<button onclick="$sim('#erp-fleet-canvas', 'reset')" class="px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-slate-200 text-slate-700 text-xs font-semibold border border-slate-300 transition-colors cursor-pointer">↺ Reset Fleet</button>
<button onclick="$sim('#erp-fleet-canvas', 'burst', 80)" class="px-3 py-1.5 rounded-lg bg-blue-600 hover:bg-blue-700 text-white font-bold text-xs shadow-xs transition-colors cursor-pointer">+ Deploy 80 Trucks</button>
</div>
</div>
<!-- Canvas Frame -->
<div class="rounded-xl border border-slate-200 bg-slate-950 p-2 shadow-lg relative overflow-hidden">
<canvas id="erp-fleet-canvas"
hx-sim="boids"
hx-sim-particles="300"
hx-sim-speed="1.2"
hx-sim-responsive="true"
class="w-full h-[450px] rounded-lg block bg-slate-950"></canvas>
<div class="absolute bottom-5 left-5 pointer-events-none bg-slate-900/90 backdrop-blur border border-slate-700 rounded-lg p-3 text-[11px] font-mono text-slate-300 space-y-1">
<div>💡 Click canvas to create fleet attraction points</div>
<div>⚡ Real-time collision avoidance accumulator running at 120Hz</div>
</div>
</div>
</div>
<!-- SCREEN 7: BANK-GRADE RBAC & APPROVAL ENGINE -->
<div hx-show="currentTab === 'rbac'" class="space-y-6 max-w-4xl" style="display:none;">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
<div>
<h2 class="text-2xl font-bold text-slate-900 tracking-tight flex items-center gap-2">
<span>🛡️</span> Bank-Grade RBAC & Invoice Authorization
</h2>
<p class="text-xs text-slate-500 mt-1">Reactive Access Control Matrix with Declarative Directives (<code class="text-emerald-700 font-mono bg-emerald-50 px-1 py-0.5 rounded border border-emerald-200">hx-role</code>, <code class="text-emerald-700 font-mono bg-emerald-50 px-1 py-0.5 rounded border border-emerald-200">hx-can</code>, <code class="text-emerald-700 font-mono bg-emerald-50 px-1 py-0.5 rounded border border-emerald-200">hx-role.redact</code>)</p>
</div>
<div class="flex items-center gap-2">
<span class="text-[11px] font-mono bg-emerald-50 text-emerald-700 border border-emerald-200 px-2.5 py-1 rounded-md font-semibold">Zero-Eval CSP Level 3</span>
</div>
</div>
<!-- Role Simulator -->
<div class="p-6 rounded-xl border border-slate-200 bg-white shadow-sm space-y-4">
<div class="flex items-center justify-between">
<div class="text-xs font-semibold uppercase tracking-wider text-slate-500">Current Simulation Identity:</div>
<span class="text-xs font-mono font-bold px-2.5 py-1 rounded bg-emerald-50 text-emerald-700 border border-emerald-200 uppercase" hx-text="activeRole">admin</span>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3">
<button hx-action="activeRole = 'admin'; window.Hyperstack && window.Hyperstack.setRole('admin', ['invoice:approve', 'payroll:view', 'ledger:write'])"
@click="activeRole = 'admin'; window.Hyperstack && window.Hyperstack.setRole('admin', ['invoice:approve', 'payroll:view', 'ledger:write'])"
hx-class="{ 'ring-2 ring-emerald-500 bg-emerald-50 text-emerald-800 border-emerald-300 font-semibold': activeRole === 'admin', 'bg-slate-50 text-slate-700 hover:bg-slate-100 border-slate-200': activeRole !== 'admin' }"
class="p-3 rounded-lg border text-left transition-all cursor-pointer">
<div class="font-bold text-xs text-slate-900">👑 Finance Director (Admin)</div>
<div class="text-[10px] text-slate-500 mt-1">Full Payout & Approval</div>
</button>
<button hx-action="activeRole = 'manager'; window.Hyperstack && window.Hyperstack.setRole('manager', ['invoice:approve'])"
@click="activeRole = 'manager'; window.Hyperstack && window.Hyperstack.setRole('manager', ['invoice:approve'])"
hx-class="{ 'ring-2 ring-emerald-500 bg-emerald-50 text-emerald-800 border-emerald-300 font-semibold': activeRole === 'manager', 'bg-slate-50 text-slate-700 hover:bg-slate-100 border-slate-200': activeRole !== 'manager' }"
class="p-3 rounded-lg border text-left transition-all cursor-pointer">
<div class="font-bold text-xs text-slate-900">👔 Logistics Manager</div>
<div class="text-[10px] text-slate-500 mt-1">Can Approve Invoices</div>
</button>
<button hx-action="activeRole = 'clerk'; window.Hyperstack && window.Hyperstack.setRole('clerk', ['invoice:create'])"
@click="activeRole = 'clerk'; window.Hyperstack && window.Hyperstack.setRole('clerk', ['invoice:create'])"
hx-class="{ 'ring-2 ring-emerald-500 bg-emerald-50 text-emerald-800 border-emerald-300 font-semibold': activeRole === 'clerk', 'bg-slate-50 text-slate-700 hover:bg-slate-100 border-slate-200': activeRole !== 'clerk' }"
class="p-3 rounded-lg border text-left transition-all cursor-pointer">
<div class="font-bold text-xs text-slate-900">📝 Billing Clerk</div>
<div class="text-[10px] text-slate-500 mt-1">Create Only (No Approval)</div>
</button>
<button hx-action="activeRole = 'auditor'; window.Hyperstack && window.Hyperstack.setRole('auditor', ['ledger:read'])"
@click="activeRole = 'auditor'; window.Hyperstack && window.Hyperstack.setRole('auditor', ['ledger:read'])"
hx-class="{ 'ring-2 ring-emerald-500 bg-emerald-50 text-emerald-800 border-emerald-300 font-semibold': activeRole === 'auditor', 'bg-slate-50 text-slate-700 hover:bg-slate-100 border-slate-200': activeRole !== 'auditor' }"
class="p-3 rounded-lg border text-left transition-all cursor-pointer">
<div class="font-bold text-xs text-slate-900">🔍 External Auditor</div>
<div class="text-[10px] text-slate-500 mt-1">Read Only (Redacted)</div>
</button>
</div>
</div>
<!-- High Value Approvals Table -->
<div class="p-6 rounded-xl border border-slate-200 bg-white shadow-sm space-y-4">
<h3 class="text-sm font-semibold text-slate-900">Pending High-Value Invoices ($100k+)</h3>
<div class="space-y-3">
<div class="p-4 rounded-lg bg-slate-50 border border-slate-200 flex items-center justify-between gap-4">
<div>
<div class="text-xs font-semibold text-slate-900">INV-89042 • Maersk Line Freight Shipping</div>
<div class="text-[11px] text-slate-500">Total: <strong class="text-slate-900 font-mono font-bold">$480,000.00</strong> • 1,200 TEU Intermodal</div>
</div>
<div class="flex items-center gap-3">
<button hx-can.disable="invoice:approve" onclick="alert('Invoice approved!')" class="px-4 py-2 bg-emerald-600 hover:bg-emerald-700 disabled:opacity-30 disabled:cursor-not-allowed text-white font-semibold text-xs rounded-md shadow-xs transition-colors cursor-pointer">
Approve Payout
</button>
<div hx-role.redact="admin, manager" class="text-xs text-slate-500 italic">
[Sign-off requires Manager or Admin role]
</div>
</div>
</div>
<div class="p-4 rounded-lg bg-slate-50 border border-slate-200 flex items-center justify-between gap-4">
<div>
<div class="text-xs font-semibold text-slate-900">INV-89043 • Hapag-Lloyd Port Terminal Access</div>
<div class="text-[11px] text-slate-500">Total: <strong class="text-slate-900 font-mono font-bold">$125,000.00</strong> • Rotterdam Hub</div>
</div>
<div class="flex items-center gap-3">
<button hx-can.disable="invoice:approve" onclick="alert('Invoice approved!')" class="px-4 py-2 bg-emerald-600 hover:bg-emerald-700 disabled:opacity-30 disabled:cursor-not-allowed text-white font-semibold text-xs rounded-md shadow-xs transition-colors cursor-pointer">
Approve Payout
</button>
<div hx-role.redact="admin, manager" class="text-xs text-slate-500 italic">
[Sign-off requires Manager or Admin role]
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</body>
</html>