agenticlogistics commited on
Commit
abf2872
·
verified ·
1 Parent(s): 02ef2f9

Project goal Build a responsive, interactive web dashboard titled “XYZ Cosmetics – FTZ Analysis & Optimization Studio” that lets logistics, finance, and compliance teams simulate the use of U.S. Foreign Trade Zones versus Bonded Warehouses and standard entry to reduce duty/tariff spend, MPF, demurrage, and compliance overhead for imported beauty and cosmetic goods. Use only synthetic data generated client‑side. No external APIs. Context (embed as static text in an About panel) • FTZs are considered outside the U.S. customs territory for tariff purposes; duties are deferred until merchandise enters U.S. commerce. Weekly entry, direct delivery, inverted tariff opportunities, and scrap/waste relief can create material savings. Goods moved between FTZs under bond avoid duty until entry. If components aren’t admitted as privileged foreign status, the applicable duty can be based on the classification of the finished goods ultimately entered into the U.S. strtrade.com • Choosing FTZ vs. Bonded Warehouse can hinge on whether tariff rates are expected to rise or fall. FTZ can lock duty rate at admission if privileged foreign status is used, which helps when rates increase; Bonded Warehouse can benefit if rates decline since duty is assessed at withdrawal geodis.com, bergenlogistics.com. • FTZs defer or reduce duty and can cut compliance costs and MPF via weekly entry; there are 260+ FTZs in the U.S., typically near ports of entry. Using an FTZ operator/3PL can accelerate adoption chiefexecutive.net, zhftaxlaw.com. Architecture • Single‑page app with left sidebar filters, top navbar controls, and tabbed views: Overview, Inventory & Flows, Duty & Fees, FTZ vs. Alternatives, Optimization Lab, Compliance & Risk, About/Methodology. • Tech stack: HTML/CSS/JS, Plotly/ECharts for charts, Tabulator/ag‑Grid for tables, a simple client‑side state store. Client‑side PDF via print, CSV/PNG exports. • Performance target: 5–10k rows total; optionally use web workers for optimization recomputes. Global filters (left sidebar) Date range: 2023‑01 to 2026‑12 (monthly). Product family: Skincare, Makeup, Fragrance, Haircare, Accessories, Gift Sets. HS chapters/codes (checkbox list): 3304 (beauty/makeup), 3305 (hair), 3307 (perfumes/other), 4202 (cosmetic bags), 3923 (plastic packaging), 7010 (glass containers), 3401 (soaps). Supplier country: France, Italy, Spain, South Korea, Japan, China, Vietnam, Thailand, Mexico, Canada, Germany, UK. Port/Entry point: LAX, JFK, EWR, MIA, SAV, LGB, HOU, ORD, SEA. Channel: DTC e‑commerce, Boutiques, Department Stores, Duty‑Free/Travel Retail. Scenario selector: Standard Entry, FTZ – Baseline, FTZ – Privileged Foreign, FTZ – Inverted Tariff, Bonded Warehouse, Mixed Network, Custom. Currency: USD default; FX toggle (USD, EUR, JPY, KRW) with static rates. Synthetic data generation (run on initialization; keep PRNG seed; add “Regenerate Data”) Create these tables (arrays of objects). Use realistic ranges for a high‑end beauty brand. A) SKUCatalog • Columns: skuId, skuName, family, hsCode, componentDutyPct, finishedDutyPct, unitCOGSUSD, retailPriceUSD, originCountry, shelfLifeDays, hazmatFlag (bool), weightKg, packagingType (glass/plastic/metal/other). • 500–1,200 SKUs; fragrances higher hazmat and packaging weight; luxury glass bottles for skincare/fragrance; accessories include cosmetic bags. B) ComponentsCatalog • Columns: componentId, componentName, hsCode, dutyPct, unitCostUSD, originCountry, leadTimeDays, isFragile (bool). • 300–600 components: pumps/atomizers (plastics/metal), glass bottles (7010), caps, labels, gift boxes, applicators, outer cartons. C) BOM • Columns: skuId, componentId, qtyPerSKU. • Each SKU includes 3–10 components; fragrances rely on glass bottles and atomizers; gift sets combine multiple SKUs. D) InboundShipments (monthly) • Columns: month, shipmentId, skuId or componentId, isFinishedGood (bool), qtyUnits, supplierCountry, port, incoterms (FOB/CIF), freightUSD, insuranceUSD, customsValueUSD, arrivalMode (Air/Ocean), handlingUSD, demurrageUSD. • Include seasonality spikes for Q4 and new launches; higher air for short shelf life or promos. E) InventoryStates (monthly, per location type) • Columns: month, locationType (FTZ, Bonded, DC, 3PL), locationName, skuId, onHandUnits, agingDaysAvg, shrinkPct, cycleCountScore. • If scenario uses FTZ/Bonded, allocate shares of inbound to those locations with dwell time distribution (e.g., 15–60 days). F) OutboundOrders (monthly) • Columns: month, orderId, skuId, channel, region (US/Canada), units, promoDiscountPct, returnRatePct. • Trend: steady growth in DTC, seasonal spikes during holidays, gift sets surge in Q4. G) FeeSchedule • Columns: mpfMinUSD, mpfMaxUSD, mpfRatePct (for ad valorem), harborMaintenancePct (HMF ocean), entryFeeUSD, weeklyEntryEligible (bool), ftzOperatorFeeUSDPerMonth, bondedStorageFeeUSDPerPalletPerMonth, drayageUSDPerMove, complianceOverheadUSDPerEntry. • Provide typical synthetic values and caps. H) FTZPolicyOptions • Flags and parameters per scenario: privilegedForeignEnabled (bool), invertedTariffEligible (bool), weeklyEntryEnabled (bool), directDeliveryEnabled (bool), scrapReliefPct, wasteRatePct, zoneTransferEnabled (bool), classificationAtFinishedIfNotPrivileged (bool). • Add “AnticipatedTariffChange” vector per HS code with monthly deltas (−5pp to +5pp) to simulate rising/falling duties. I) RiskEvents • Columns: month, type (quota, policyChange, portCongestion, carrierStrike), hsCode, expectedImpactDaysDelay, expectedCostUSD, probabilityPct. • Used for Monte Carlo stress tests in Optimization Lab. Core calculations Customs Value and Duty Basis customsValue = item customsValueUSD + freightUSD + insuranceUSD as applicable to valuation. Duty rate selection depends on scenario and status: • Standard Entry: duty = customsValue × dutyPct based on imported item’s HS (finished or component). • FTZ – Baseline: duty deferred until entry to U.S. commerce; allow weekly entry to aggregate MPF; no change in rate selection unless inverted tariff logic applies. • FTZ – Privileged Foreign (PF): lock duty rate and classification at admission; future rate changes won’t apply to admitted goods geodis.com, bergenlogistics.com. • FTZ – Inverted Tariff: if components (higher duty) are admitted non‑privileged and finished SKU has a lower finishedDutyPct than componentDutyPct, allow duty on finished goods classification at time of entry (simulate inverted tariff savings) strtrade.com. • Bonded Warehouse: duty assessed at withdrawal; if rates decline, benefit; if rates rise, pay higher rate at withdrawal geodis.com, bergenlogistics.com. MPF/HMF and Entry Processing • Compute MPF ad valorem subject to min/max per entry. • Weekly entry (FTZ) reduces number of entries to roughly one per week per port; apply MPF caps accordingly strtrade.com. • HMF applies to ocean shipments on customs value. • Entry fees and compliance overhead per entry; FTZ direct delivery can reduce some handling/clearance costs. Storage and Handling • FTZ operator monthly fee and per‑pallet storage; bonded storage fee per pallet per month; demurrage/wharfage reductions if direct delivery is enabled. • Dwell time from InventoryStates drives months‑in‑storage × storage rate. Scrap/Waste Relief • For FTZ scenarios, model no duty on foreign‑status components that become scrap/waste within the FTZ (apply wasteRatePct × customsValue × dutyPct × scrapReliefPct) strtrade.com. Inverted Tariff Decision Implement chooseDutyBasis(shipment, scenario, PF, invertedEligible, finishedDutyPct, componentDutyPct): • If PF enabled: duty basis locked at admission classification. • Else if invertedEligible and shipment is components assembled in FTZ into a finished SKU with lower finishedDutyPct, select finished duty basis. • Else: standard duty on the imported item’s HS. Rate volatility • Apply AnticipatedTariffChange by month per HS to simulate rising/falling rate paths. • For Bonded Warehouse, duty uses the rate at withdrawal month; for FTZ PF, use locked rate at admission; for FTZ non‑PF, use rate at entry to commerce. Total landed cost per SKU landedCostPerUnit = COGS + allocated freight/insurance/handling + duty + MPF/HMF + storage + compliance overhead − scrap relief. Margin impact Gross margin per unit = retailPrice − discounts − returns impact − landedCostPerUnit. Demand elasticity optional slider per channel to simulate price changes affecting units. UI layout and visuals Top navbar • Title + Scenario dropdown + “Run Scenario” + “Reset” + “Regenerate Data” + currency selector. Overview tab • KPI tiles: Total duty paid YTD, MPF/HMF fees YTD, Avg landed cost/unit, Gross margin %, Inventory dwell (days), Savings vs. Standard Entry, % volume using FTZ/Bonded. • Chart: Stacked bar – Duty and fees by HS code and port. • Chart: Line – Monthly duty/fees under chosen scenario vs. Standard Entry. • Treemap: Cost composition (duty, MPF, HMF, storage, handling, compliance). • Table: Top 25 SKUs by potential FTZ savings with columns: hsCode, dutyBasisChosen, invertedSavingsUSD, PFLocked (Y/N), dwellDays, storageCostUSD, landedCostDeltaUSD. Inventory & Flows tab • Sankey: Supplier country → Port → FTZ/Bonded/DC → Channel volumes. • Heatmap: Inventory dwell by location and month; filter by HS or family. • Table: Inbound shipments with valuation, admission status (PF/non‑PF), chosen duty basis, and expected entry week. Duty & Fees tab • Chart: Waterfall – Standard Entry cost → FTZ savings (weekly entry) → inverted tariff savings → scrap/waste relief → storage/operator cost → net savings. • Table: Entry aggregation simulation showing entries/week/port and MPF/HMF totals under scenarios. • Scatter: Shipment value vs. MPF/HMF paid, color by scenario. FTZ vs. Alternatives tab • Comparator panel: Standard Entry, FTZ – PF, FTZ – Inverted, Bonded Warehouse, Mixed Network. • Small multiples: total duty, MPF/HMF, storage/ops, landed cost, margin %. • Decision matrix table with key levers: anticipated tariff direction, dwell, product type (finished vs. component), fragility/hazmat, inverted opportunity flag. Optimization Lab tab • Controls: FTZ adoption rate slider (% of eligible volume). PF adoption rate slider (% of FTZ volume admitted as privileged foreign). Inverted tariff eligibility toggle and rule editor (which HS pairs qualify). Weekly entry on/off; entries per week cap; direct delivery on/off. Mixed Network routing shares: % to FTZ, % to Bonded, % to direct DC. Anticipated tariff change paths by HS (draw sliders −5 to +5 pp). Storage fees, operator fees, compliance overhead, demurrage sensitivity. Dwell days distribution overrides by product family. • Outputs: Optimization suggestion card: “Recommended mix: FTZ X%, Bonded Y%, Direct Z%” that maximizes net savings given constraints. Tornado chart: sensitivity of net savings to key levers (rates, dwell, PF, weekly entry). Monte Carlo: sample RiskEvents; show distribution of net savings and 5th/50th/95th percentiles. Table: SKU‑level playbook (admit PF? route to FTZ/Bonded? use inverted basis?). Compliance & Risk tab • Checklist table: recordkeeping, zone status reporting, reconciliations, weekly entry filings, FTZ Board production authority when classification shifts at 6‑digit or substantial transformation occurs strtrade.com. • Risk map: disruptions by port and event type; overlay policy change scenarios. • KPI: Audit readiness score, data quality (cycle count, shrink), and exception alerts (rate anomalies, misclassification risk). Interactivity and UX • All charts respond to global filters; brushing filters other components. • Right‑click “Trace to Flow” to see how a SKU’s shipment moved through FTZ/Bonded/DC and which duty basis applied. • Tooltips include the duty basis rationale (PF lock, inverted tariff, standard) with the exact formula and rates used. • “What changed?” diff after running a scenario lists top savings drivers: weekly entry MPF reduction, inverted tariff, storage deltas. Computational functions (pure, testable) • computeDuty(item, scenario, ratePath, isPF, isComponent, finishedDutyPct, componentDutyPct, admissionMonth, withdrawalMonth, entryMonth) → {basis, appliedRate, dutyUSD}. • computeEntryFees(manifest, scenario, weeklyEntryEnabled, feeSchedule) → {entries, mpfUSD, hmfUSD, entryFeesUSD, complianceUSD}. • computeStorage(location, dwellDays, pallets, fees, directDelivery) → storageUSD. • computeLandedCostPerUnit(sku) → value. • aggregateSavings(vsStandard) → totals by HS, port, family. Data privacy and legal • All data is fully synthetic. Display footer note: “Demonstration only. FTZ/Bonded mechanics summarized from public resources: strtrade.com, geodis.com, bergenlogistics.com, chiefexecutive.net, zhftaxlaw.com.” Accessibility and responsiveness • WCAG AA contrast, keyboard nav, ARIA labels. • Responsive layout for desktop/tablet; collapsible sidebar. Exports and validation • Export any table to CSV; export charts to PNG; “Download Report (PDF)” with Overview KPIs, comparator charts, and scenario settings. • “Validate Calculations” modal: sample 5 shipments and 3 SKUs; show step‑by‑step duty basis choice, rates by month, MPF/HMF calc, storage calc; reconcile to dashboard totals. • Deterministic seed entry to reproduce runs. Sample synthetic parameter guidance • Finished duty ranges: many cosmetics 0–6.5% for finished goods (use synthetic rates); components like bottles/pumps 2–8%; accessories up to 17% (e.g., certain 4202). • Air vs. ocean: fragrances more air; gift sets bulk ocean. • Dwell: 15–60 days typical; Q4 spikes. • Retail price ranges: $25–$180 per SKU; COGS 15–35% of retail for high‑end cosmetics. • MPF min/max: set realistic synthetic caps; weekly entry reduces count from dozens/hundreds to ~4 per month per port. • FTZ operator fee: flat monthly + per‑pallet; bonded storage higher per pallet but no operator fee. Acceptance criteria All tabs render with linked filters and metrics. Duty basis logic correctly reflects PF lock, inverted tariff eligibility, and weekly entry MPF aggregation. Comparator clearly quantifies FTZ vs. Bonded vs. Standard Entry net savings. Optimization Lab outputs a recommended network mix and shows sensitivity and Monte Carlo ranges. Exports and “Validate Calculations” work. App runs offline with no external data calls. - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +426 -694
index.html CHANGED
@@ -5,855 +5,587 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>XYZ Cosmetics – FTZ Analysis & Optimization Studio</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
- <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
9
- <script src="https://unpkg.com/tabulator-tables@5.4.4/dist/js/tabulator.min.js"></script>
10
- <link href="https://unpkg.com/tabulator-tables@5.4.4/dist/css/tabulator.min.css" rel="stylesheet">
11
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
12
- <style>
13
- :root {
14
- --primary: #4f46e5;
15
- --primary-dark: #4338ca;
16
- --secondary: #10b981;
17
- --accent: #f59e0b;
18
- --dark: #1e293b;
19
- --light: #f8fafc;
20
- --danger: #ef4444;
21
- --gray: #94a3b8;
22
- }
23
-
24
- body {
25
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
26
- background-color: #f1f5f9;
27
- color: #1e293b;
28
  }
29
-
 
30
  .sidebar {
31
- background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
32
  transition: all 0.3s ease;
33
  }
34
-
35
  .tab-content {
36
  display: none;
37
  }
38
-
39
  .tab-content.active {
40
  display: block;
41
  }
42
-
43
- .chart-container {
44
- background: white;
45
- border-radius: 0.5rem;
46
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
47
- padding: 1.5rem;
48
- margin-bottom: 1.5rem;
49
- }
50
-
51
- .kpi-tile {
52
- background: white;
53
- border-radius: 0.5rem;
54
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
55
- padding: 1.25rem;
56
- transition: transform 0.2s ease;
57
- }
58
-
59
- .kpi-tile:hover {
60
- transform: translateY(-3px);
61
- }
62
-
63
- .tab-button {
64
- position: relative;
65
- padding: 0.75rem 1rem;
66
- font-weight: 500;
67
- color: #64748b;
68
- transition: all 0.3s ease;
69
- }
70
-
71
- .tab-button.active {
72
- color: var(--primary);
73
- }
74
-
75
- .tab-button.active::after {
76
- content: '';
77
- position: absolute;
78
- bottom: 0;
79
- left: 0;
80
- right: 0;
81
- height: 3px;
82
- background-color: var(--primary);
83
- border-radius: 3px 3px 0 0;
84
- }
85
-
86
  .scenario-card {
87
- border: 1px solid #e2e8f0;
88
- border-radius: 0.5rem;
89
  transition: all 0.3s ease;
90
  }
91
-
92
  .scenario-card:hover {
93
- border-color: var(--primary);
94
- box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.1);
95
- }
96
-
97
- .scenario-card.active {
98
- border-color: var(--primary);
99
- box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.15), 0 4px 6px -2px rgba(79, 70, 229, 0.05);
100
- }
101
-
102
- .table-container {
103
- background: white;
104
- border-radius: 0.5rem;
105
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
106
- overflow: hidden;
107
- }
108
-
109
- .tooltip {
110
- position: relative;
111
- }
112
-
113
- .tooltip:hover::after {
114
- content: attr(data-tooltip);
115
- position: absolute;
116
- bottom: 100%;
117
- left: 50%;
118
- transform: translateX(-50%);
119
- background: rgba(30, 41, 59, 0.9);
120
- color: white;
121
- padding: 0.5rem;
122
- border-radius: 0.25rem;
123
- font-size: 0.875rem;
124
- white-space: nowrap;
125
- z-index: 10;
126
  }
127
-
128
- .sparkline {
129
- height: 40px;
130
  }
131
-
132
- .slider-container {
133
- padding: 1rem;
134
- background: white;
135
- border-radius: 0.5rem;
136
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
137
  }
138
-
139
- .footer {
140
- background: #0f172a;
141
- color: #94a3b8;
142
- font-size: 0.875rem;
143
  }
144
-
145
  @media (max-width: 768px) {
146
  .sidebar {
147
- position: fixed;
148
- top: 0;
149
- left: -100%;
150
- height: 100%;
151
- z-index: 100;
152
  }
153
-
154
  .sidebar.active {
155
- left: 0;
156
- }
157
-
158
- .mobile-overlay {
159
- display: none;
160
- position: fixed;
161
- top: 0;
162
- left: 0;
163
- right: 0;
164
- bottom: 0;
165
- background: rgba(0, 0, 0, 0.5);
166
- z-index: 99;
167
- }
168
-
169
- .mobile-overlay.active {
170
- display: block;
171
  }
172
  }
173
  </style>
174
  </head>
175
- <body class="min-h-screen">
176
- <!-- Mobile Overlay -->
177
- <div class="mobile-overlay" id="mobileOverlay"></div>
178
-
179
- <!-- Main Layout Container -->
180
- <div class="flex flex-col md:flex-row">
181
- <!-- Sidebar -->
182
- <div class="sidebar md:static z-50 w-64 flex flex-col shadow-lg h-screen md:h-auto" id="sidebar">
183
- <div class="p-5">
184
- <h1 class="text-white text-xl font-bold">XYZ Cosmetics</h1>
185
- <p class="text-gray-300 text-sm">FTZ Analysis Studio</p>
186
- </div>
 
 
 
 
187
 
188
- <div class="px-4 py-3">
189
- <h2 class="text-gray-300 text-xs uppercase font-semibold tracking-wider mb-2">Global Filters</h2>
190
-
191
- <div class="mb-4">
192
- <label class="block text-gray-300 text-xs mb-1">Date Range</label>
193
  <div class="grid grid-cols-2 gap-2">
194
- <select class="w-full bg-slate-800 text-white text-sm rounded p-2">
195
- <option>2023-01</option>
196
- <option>2026-12</option>
197
- </select>
198
- <select class="w-full bg-slate-800 text-white text-sm rounded p-2">
199
- <option>2026-12</option>
200
- <option>2023-01</option>
201
- </select>
202
  </div>
203
  </div>
204
 
205
- <div class="mb-4">
206
- <label class="block text-gray-300 text-xs mb-1">Product Family</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  <div class="grid grid-cols-2 gap-2">
208
- <label class="flex items-center text-white text-sm">
209
- <input type="checkbox" class="mr-2 rounded text-indigo-500">
210
- <span>Skincare</span>
211
- </label>
212
- <label class="flex items-center text-white text-sm">
213
- <input type="checkbox" class="mr-2 rounded text-indigo-500" checked>
214
- <span>Makeup</span>
215
- </label>
216
- <label class="flex items-center text-white text-sm">
217
- <input type="checkbox" class="mr-2 rounded text-indigo-500" checked>
218
- <span>Fragrance</span>
219
- </label>
220
- <label class="flex items-center text-white text-sm">
221
- <input type="checkbox" class="mr-2 rounded text-indigo-500">
222
- <span>Haircare</span>
223
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
224
  </div>
225
  </div>
226
 
227
- <div class="mb-4">
228
- <label class="block text-gray-300 text-xs mb-1">HS Codes</label>
229
- <div class="space-y-1 max-h-40 overflow-y-auto">
230
- <label class="flex items-center text-white text-sm">
231
- <input type="checkbox" class="mr-2 rounded text-indigo-500" checked>
232
- <span>3304 - Beauty/Makeup</span>
233
- </label>
234
- <label class="flex items-center text-white text-sm">
235
- <input type="checkbox" class="mr-2 rounded text-indigo-500">
236
- <span>3305 - Hair Products</span>
237
- </label>
238
- <label class="flex items-center text-white text-sm">
239
- <input type="checkbox" class="mr-2 rounded text-indigo-500" checked>
240
- <span>3307 - Perfumes</span>
241
- </label>
242
- <label class="flex items-center text-white text-sm">
243
- <input type="checkbox" class="mr-2 rounded text-indigo-500">
244
- <span>4202 - Cosmetic Bags</span>
245
- </label>
246
- <label class="flex items-center text-white text-sm">
247
- <input type="checkbox" class="mr-2 rounded text-indigo-500">
248
- <span>3923 - Packaging</span>
249
- </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  </div>
251
  </div>
252
 
253
- <div class="mb-4">
254
- <label class="block text-gray-300 text-xs mb-1">Supplier Country</label>
255
- <select class="w-full bg-slate-800 text-white text-sm rounded p-2">
256
- <option>All Countries</option>
257
- <option>France</option>
258
- <option>Italy</option>
259
- <option>Spain</option>
260
- <option>China</option>
261
- <option>South Korea</option>
262
- </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  </div>
264
  </div>
265
 
266
- <div class="px-4 py-3 mt-auto">
267
- <button class="w-full bg-indigo-600 hover:bg-indigo-700 text-white py-2 rounded-md text-sm font-medium transition">
268
- Apply Filters
269
- </button>
270
- </div>
271
  </div>
272
-
273
  <!-- Main Content -->
274
  <div class="md:ml-64">
275
- <!-- Top Navigation -->
276
- <nav class="bg-white shadow-sm p-4 flex justify-between items-center">
277
- <div class="flex items-center">
278
- <button id="sidebarToggle" class="md:hidden text-gray-500 mr-4">
279
- <i class="fas fa-bars"></i>
280
- </button>
281
- <h2 class="text-xl font-semibold">FTZ Analysis & Optimization</h2>
282
- </div>
283
-
284
- <div class="flex items-center space-x-3">
285
- <select class="border border-gray-300 rounded-md text-sm p-2">
286
- <option>Standard Entry</option>
287
- <option selected>FTZ - Baseline</option>
288
- <option>FTZ - Privileged Foreign</option>
289
- <option>FTZ - Inverted Tariff</option>
290
- <option>Bonded Warehouse</option>
291
- </select>
292
- <button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-md text-sm font-medium">
293
- Run Scenario
294
- </button>
295
- <button class="border border-gray-300 hover:bg-gray-50 px-4 py-2 rounded-md text-sm font-medium">
296
- Reset
297
- </button>
298
- <button class="border border-gray-300 hover:bg-gray-50 px-4 py-2 rounded-md text-sm font-medium">
299
- Regenerate Data
300
- </button>
301
- <select class="border border-gray-300 rounded-md text-sm p-2">
302
- <option>USD</option>
303
- <option>EUR</option>
304
- <option>JPY</option>
305
- <option>KRW</option>
306
- </select>
 
 
 
 
 
 
 
 
 
 
307
  </div>
308
- </nav>
309
-
310
- <!-- Tabs -->
311
- <div class="border-b border-gray-200 bg-white">
312
  <div class="flex overflow-x-auto px-4">
313
- <button class="tab-button active" data-tab="overview">Overview</button>
314
- <button class="tab-button" data-tab="inventory">Inventory & Flows</button>
315
- <button class="tab-button" data-tab="duty">Duty & Fees</button>
316
- <button class="tab-button" data-tab="comparison">FTZ vs. Alternatives</button>
317
- <button class="tab-button" data-tab="optimization">Optimization Lab</button>
318
- <button class="tab-button" data-tab="compliance">Compliance & Risk</button>
319
- <button class="tab-button" data-tab="about">About</button>
320
  </div>
321
  </div>
322
-
323
  <!-- Tab Content -->
324
  <div class="p-4 md:p-6">
325
  <!-- Overview Tab -->
326
- <div id="tab-overview" class="tab-content active">
327
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
328
- <div class="kpi-tile">
 
329
  <div class="flex justify-between items-start">
330
  <div>
331
- <h3 class="text-gray-500 text-sm font-medium">Total Duty Paid YTD</h3>
332
- <p class="text-2xl font-bold mt-1">$2.4M</p>
333
  </div>
334
- <div class="bg-green-100 p-2 rounded-full">
335
- <i class="fas fa-arrow-down text-green-600"></i>
336
  </div>
337
  </div>
338
  <p class="text-green-600 text-sm mt-2">
339
- <i class="fas fa-arrow-down"></i> 12.3% vs Standard Entry
340
  </p>
341
  </div>
342
 
343
- <div class="kpi-tile">
344
  <div class="flex justify-between items-start">
345
  <div>
346
- <h3 class="text-gray-500 text-sm font-medium">MPF/HMF Fees YTD</h3>
347
- <p class="text-2xl font-bold mt-1">$185K</p>
348
  </div>
349
  <div class="bg-green-100 p-2 rounded-full">
350
- <i class="fas fa-arrow-down text-green-600"></i>
351
  </div>
352
  </div>
353
  <p class="text-green-600 text-sm mt-2">
354
- <i class="fas fa-arrow-down"></i> 28.7% vs Standard Entry
355
  </p>
356
  </div>
357
 
358
- <div class="kpi-tile">
359
  <div class="flex justify-between items-start">
360
  <div>
361
- <h3 class="text-gray-500 text-sm font-medium">Avg Landed Cost/Unit</h3>
362
- <p class="text-2xl font-bold mt-1">$8.45</p>
363
  </div>
364
- <div class="bg-blue-100 p-2 rounded-full">
365
- <i class="fas fa-dollar-sign text-blue-600"></i>
366
  </div>
367
  </div>
368
- <p class="text-blue-600 text-sm mt-2">
369
- <i class="fas fa-equals"></i> Standard Entry: $9.12
370
  </p>
371
  </div>
372
 
373
- <div class="kpi-tile">
374
  <div class="flex justify-between items-start">
375
  <div>
376
- <h3 class="text-gray-500 text-sm font-medium">Gross Margin %</h3>
377
- <p class="text-2xl font-bold mt-1">64.2%</p>
378
  </div>
379
- <div class="bg-green-100 p-2 rounded-full">
380
- <i class="fas fa-chart-line text-green-600"></i>
381
  </div>
382
  </div>
383
  <p class="text-green-600 text-sm mt-2">
384
- <i class="fas fa-arrow-up"></i> +3.2% vs Standard Entry
385
  </p>
386
  </div>
387
  </div>
388
 
389
- <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
390
- <div class="chart-container">
391
- <h3 class="text-lg font-semibold mb-4">Duty and Fees by HS Code</h3>
392
- <div id="duty-chart" class="h-80"></div>
 
393
  </div>
394
 
395
- <div class="chart-container">
396
- <h3 class="text-lg font-semibold mb-4">Monthly Duty/Feet Trend</h3>
397
- <div id="monthly-chart" class="h-80"></div>
398
- </div>
399
- </div>
400
-
401
- <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mt-6">
402
- <div class="chart-container">
403
- <h3 class="text-lg font-semibold mb-4">Cost Composition</h3>
404
- <div id="cost-chart" class="h-80"></div>
405
- </div>
406
-
407
- <div class="table-container">
408
- <h3 class="text-lg font-semibold p-4">Top Savings Opportunities</h3>
409
- <div id="top-skus-table" class="p-4"></div>
410
- </div>
411
- </div>
412
- </div>
413
-
414
- <!-- Comparison Tab -->
415
- <div id="tab-comparison" class="tab-content">
416
- <div class="mb-6">
417
- <h2 class="text-xl font-semibold mb-4">Scenario Comparison</h2>
418
- <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4">
419
- <div class="scenario-card p-4 cursor-pointer active">
420
- <div class="flex justify-between items-start">
421
- <h3 class="text-lg font-semibold">Standard Entry</h3>
422
- <span class="text-gray-400">$0</span>
423
- </div>
424
- <p class="text-gray-500 text-sm mt-1">Base reference scenario</p>
425
- <div class="mt-3">
426
- <div class="text-2xl font-bold">$12.8M</div>
427
- <p class="text-gray-500 text-sm">Total Cost</p>
428
- </div>
429
- </div>
430
-
431
- <div class="scenario-card p-4 cursor-pointer">
432
- <div class="flex justify-between items-start">
433
- <h3 class="text-lg font-semibold">FTZ - Baseline</h3>
434
- <span class="text-green-500">-$1.2M</span>
435
- </div>
436
- <p class="text-gray-500 text-sm mt-1">Deferred duty, weekly entry</p>
437
- <div class="mt-3">
438
- <div class="text-2xl font-bold text-green-600">$11.6M</div>
439
- <p class="text-gray-500 text-sm">Total Cost</p>
440
- </div>
441
- </div>
442
-
443
- <div class="scenario-card p-4 cursor-pointer">
444
- <div class="flex justify-between items-start">
445
- <h3 class="text-lg font-semibold">FTZ - Privileged Foreign</h3>
446
- <span class="text-green-500">-$1.8M</span>
447
- </div>
448
- <p class="text-gray-500 text-sm mt-1">Locked duty rates</p>
449
- <div class="mt-3">
450
- <div class="text-2xl font-bold text-green-600">$11.0M</div>
451
- <p class="text-gray-500 text-sm">Total Cost</p>
452
- </div>
453
- </div>
454
-
455
- <div class="scenario-card p-4 cursor-pointer">
456
- <div class="flex justify-between items-start">
457
- <h3 class="text-lg font-semibold">FTZ - Inverted Tariff</h3>
458
- <span class="text-green-500">-$2.1M</span>
459
- </div>
460
- <p class="text-gray-500 text-sm mt-1">Lower finished good rates</p>
461
- <div class="mt-3">
462
- <div class="text-2xl font-bold text-green-600">$10.7M</div>
463
- <p class="text-gray-500 text-sm">Total Cost</p>
464
- </div>
465
- </div>
466
-
467
- <div class="scenario-card p-4 cursor-pointer">
468
- <div class="flex justify-between items-start">
469
- <h3 class="text-lg font-semibold">Bonded Warehouse</h3>
470
- <span class="text-green-500">-$950K</span>
471
- </div>
472
- <p class="text-gray-500 text-sm mt-1">Postponed payment</p>
473
- <div class="mt-3">
474
- <div class="text-2xl font-bold text-green-600">$11.9M</div>
475
- <p class="text-gray-500 text-sm">Total Cost</p>
476
- </div>
477
- </div>
478
  </div>
479
  </div>
480
 
481
- <div class="chart-container">
482
- <h3 class="text-lg font-semibold mb-4">Cost Comparison (Millions $)</h3>
483
- <div id="comparison-chart" class="h-96"></div>
 
484
  </div>
485
 
486
- <div class="table-container mt-6">
487
- <h3 class="text-lg font-semibold p-4">Decision Matrix</h3>
488
- <div class="p-4">
489
- <table class="min-w-full divide-y divide-gray-200">
490
- <thead class="bg-gray-50">
491
- <tr>
492
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Factor</th>
493
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Standard Entry</th>
494
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">FTZ</th>
495
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Bonded Warehouse</th>
496
- </tr>
497
- </thead>
498
- <tbody class="bg-white divide-y divide-gray-200">
499
- <tr>
500
- <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Duty Timing</td>
501
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">At entry</td>
502
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">At U.S. commerce entry</td>
503
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">At withdrawal</td>
504
- </tr>
505
- <tr>
506
- <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Rate Lock</td>
507
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">No</td>
508
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Yes (Privileged Foreign)</td>
509
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">No</td>
510
- </tr>
511
- <tr>
512
- <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">MPF Savings</td>
513
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">None</td>
514
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Weekly entry reduces counts</td>
515
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">None</td>
516
- </tr>
517
- <tr>
518
- <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Storage Cost</td>
519
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Customs exam areas</td>
520
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Operator/monthly fees</td>
521
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Warehouse/per pallet</td>
522
- </tr>
523
- <tr>
524
- <td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">Best For</td>
525
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Low volume</td>
526
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">High volume, fluctuating rates</td>
527
- <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Declining rates, short term</td>
528
- </tr>
529
- </tbody>
530
- </table>
531
- </div>
532
- </div>
533
- </div>
534
-
535
- <!-- Optimization Tab -->
536
- <div id="tab-optimization" class="tab-content">
537
- <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
538
- <div class="lg:col-span-2">
539
- <div class="chart-container">
540
- <h3 class="text-lg font-semibold mb-4">Sensitivity Analysis</h3>
541
- <div id="sensitivity-chart" class="h-80"></div>
542
- </div>
543
-
544
- <div class="chart-container mt-6">
545
- <h3 class="text-lg font-semibold mb-4">Network Optimization</h3>
546
- <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
547
- <div class="border border-gray-200 rounded-lg p-4">
548
- <div class="flex justify-between items-center mb-2">
549
- <span class="text-gray-600">FTZ Allocation</span>
550
- <span class="font-bold">65%</span>
551
- </div>
552
- <div class="w-full bg-gray-200 rounded-full h-2.5">
553
- <div class="bg-indigo-600 h-2.5 rounded-full" style="width: 65%"></div>
554
- </div>
555
- </div>
556
- <div class="border border-gray-200 rounded-lg p-4">
557
- <div class="flex justify-between items-center mb-2">
558
- <span class="text-gray-600">Bonded Warehouse</span>
559
- <span class="font-bold">25%</span>
560
- </div>
561
- <div class="w-full bg-gray-200 rounded-full h-2.5">
562
- <div class="bg-green-500 h-2.5 rounded-full" style="width: 25%"></div>
563
- </div>
564
- </div>
565
- <div class="border border-gray-200 rounded-lg p-4">
566
- <div class="flex justify-between items-center mb-2">
567
- <span class="text-gray-600">Direct to DC</span>
568
- <span class="font-bold">10%</span>
569
- </div>
570
- <div class="w-full bg-gray-200 rounded-full h-2.5">
571
- <div class="bg-blue-500 h-2.5 rounded-full" style="width: 10%"></div>
572
- </div>
573
- </div>
574
- </div>
575
- </div>
576
- </div>
577
-
578
- <div>
579
- <div class="slider-container mb-6">
580
- <h3 class="text-lg font-semibold mb-4">Optimization Controls</h3>
581
-
582
- <div class="mb-4">
583
- <label class="block text-gray-700 text-sm mb-1">Tariff Increase Assumption</label>
584
- <input type="range" min="0" max="10" value="3" class="w-full">
585
- <div class="flex justify-between text-xs text-gray-500 mt-1">
586
- <span>Falling</span>
587
- <span>Neutral</span>
588
- <span>Rising</span>
589
- </div>
590
- </div>
591
-
592
- <div class="mb-4">
593
- <label class="block text-gray-700 text-sm mb-1">Inventory Dwell Time</label>
594
- <input type="range" min="15" max="90" value="45" class="w-full">
595
- <div class="flex justify-between text-xs text-gray-500 mt-1">
596
- <span>Short</span>
597
- <span>Medium</span>
598
- <span>Long</span>
599
- </div>
600
- </div>
601
-
602
- <div class="mb-4">
603
- <label class="block text-gray-700 text-sm mb-1">Component Complexity</label>
604
- <input type="range" min="1" max="5" value="3" class="w-full">
605
- </div>
606
-
607
- <div class="flex items-center justify-between mb-2">
608
- <span class="text-gray-700">Weekly Entry</span>
609
- <label class="switch">
610
- <input type="checkbox" checked>
611
- <span class="slider"></span>
612
- </label>
613
- </div>
614
-
615
- <button class="w-full bg-indigo-600 hover:bg-indigo-700 text-white py-2 rounded-md text-sm font-medium mt-4">
616
- Optimize Network
617
- </button>
618
- </div>
619
-
620
- <div class="slider-container">
621
- <h3 class="text-lg font-semibold mb-4">Scenario Recommendation</h3>
622
- <div class="p-4 bg-indigo-50 rounded-lg">
623
- <p class="text-indigo-800">
624
- <span class="font-bold">Recommended Mix:</span> FTZ 70%, Bonded 20%, Direct 10%
625
- </p>
626
- <p class="text-indigo-700 text-sm mt-2">
627
- This configuration optimizes for the current tariff increase projection while
628
- balancing inventory holding costs and administrative overhead.
629
- </p>
630
- </div>
631
- </div>
632
- </div>
633
  </div>
634
  </div>
635
 
636
  <!-- About Tab -->
637
- <div id="tab-about" class="tab-content">
638
- <div class="chart-container">
639
- <h2 class="text-xl font-semibold mb-4">About FTZ Analysis & Optimization Studio</h2>
 
640
  <div class="prose max-w-none">
641
- <p>
642
- The FTZ Analysis & Optimization Studio is a simulation environment that enables logistics,
643
- finance, and compliance teams to evaluate the financial impact of using U.S. Foreign Trade Zones
644
- versus Bonded Warehouses and standard entry procedures for imported beauty and cosmetic goods.
645
- </p>
646
 
647
- <h3 class="text-lg font-semibold mt-6 mb-3">Key Concepts</h3>
648
- <ul class="list-disc pl-5 space-y-2">
649
- <li><strong>Foreign Trade Zones (FTZs)</strong>: Areas considered outside the U.S. customs territory for tariff purposes. Duties are deferred until merchandise enters U.S. commerce. Benefits include weekly entry, direct delivery, inverted tariff opportunities, and scrap/waste relief.</li>
650
- <li><strong>Bonded Warehouses</strong>: Secure storage facilities where imported goods can be stored without paying duties until they're withdrawn for domestic consumption. Duties are assessed at withdrawal time, allowing benefit from declining rates.</li>
651
- <li><strong>Privileged Foreign Status</strong>: Within FTZs, goods can be admitted with privileged foreign status locking in duty rates at the time of admission, providing protection against rate increases.</li>
652
- <li><strong>Inverted Tariff Opportunities</strong>: When components with higher duty rates are imported as privileged foreign status, and the finished products have lower duty rates, savings can be achieved.</li>
653
  </ul>
654
 
655
- <h3 class="text-lg font-semibold mt-6 mb-3">Application Features</h3>
656
- <ul class="list-disc pl-5 space-y-2">
657
- <li><strong>Multi-scenario Comparison</strong>: Evaluate Standard Entry, FTZ Baseline, FTZ with Privileged Foreign Status, FTZ with Inverted Tariff, and Bonded Warehouse scenarios.</li>
658
- <li><strong>Dynamic Cost Modeling</strong>: Calculates customs duties, MPF/HMF fees, storage costs, and compliance overhead based on current and anticipated tariff rates.</li>
659
- <li><strong>Optimization Recommendations</strong>: Provides allocation recommendations between FTZs, Bonded Warehouses, and direct distribution based on financial modeling.</li>
660
- <li><strong>Risk Assessment</strong>: Incorporates potential disruptions, policy changes, and regulatory compliance into financial projections.</li>
 
 
 
 
 
 
 
 
 
 
 
661
  </ul>
662
 
663
- <h3 class="text-lg font-semibold mt-6 mb-3">Disclaimer</h3>
664
- <p>
665
- This demonstration uses synthetic data generated client-side. All FTZ and customs treatment information
666
- is summarized from public resources including strtrade.com, geodis.com, bergenlogistics.com,
667
- chiefexecutive.net, and zhftaxlaw.com. Actual duty/tariff calculations should be verified with
668
- customs brokers and legal advisors.
669
- </p>
670
  </div>
671
  </div>
672
  </div>
673
  </div>
674
  </div>
675
-
676
- <!-- Footer -->
677
- <div class="footer p-4 text-center text-sm">
678
- Demonstration only. FTZ/Bonded mechanics summarized from public resources:
679
- strtrade.com, geodis.com, bergenlogistics.com, chiefexecutive.net, zhftaxlaw.com.
680
- </div>
681
-
682
  <script>
683
  // Tab switching functionality
684
- document.querySelectorAll('.tab-button').forEach(button => {
685
  button.addEventListener('click', () => {
686
- // Remove active class from all tabs and buttons
687
- document.querySelectorAll('.tab-button').forEach(btn => btn.classList.remove('active'));
688
- document.querySelectorAll('.tab-content').forEach(tab => tab.classList.remove('active'));
 
 
 
 
 
 
689
 
690
  // Add active class to clicked button
691
- button.classList.add('active');
 
692
 
693
- // Show corresponding tab content
694
  const tabId = button.getAttribute('data-tab');
695
- document.getElementById(`tab-${tabId}`).classList.add('active');
696
  });
697
  });
698
 
699
- // Mobile sidebar toggle
700
- document.getElementById('sidebarToggle').addEventListener('click', () => {
701
- document.getElementById('sidebar').classList.toggle('active');
702
- document.getElementById('mobileOverlay').classList.toggle('active');
703
  });
704
 
705
- document.getElementById('mobileOverlay').addEventListener('click', () => {
706
  document.getElementById('sidebar').classList.remove('active');
707
- document.getElementById('mobileOverlay').classList.remove('active');
708
  });
709
 
710
- // Close sidebar when clicking outside on mobile
711
- document.addEventListener('click', (e) => {
712
- const sidebar = document.getElementById('sidebar');
713
- const toggle = document.getElementById('sidebarToggle');
714
-
715
- if (window.innerWidth < 768 &&
716
- sidebar.classList.contains('active') &&
717
- !sidebar.contains(e.target) &&
718
- e.target !== toggle) {
719
- sidebar.classList.remove('active');
720
- document.getElementById('mobileOverlay').classList.remove('active');
721
- }
722
  });
723
 
724
- // Initialize charts
725
- document.addEventListener('DOMContentLoaded', () => {
726
- // Duty by HS Code Chart
727
- const dutyChart = document.getElementById('duty-chart');
728
- const dutyData = [{
 
 
 
 
 
 
 
 
 
 
 
729
  type: 'bar',
730
- x: ['3304', '3305', '3307', '4202', '3923', '7010'],
731
- y: [1200000, 800000, 1500000, 450000, 600000, 900000],
732
- marker: { color: '#4f46e5' }
 
733
  }];
734
 
735
- const dutyLayout = {
736
- title: 'Duty by HS Code',
737
- xaxis: { title: 'HS Code' },
738
- yaxis: { title: 'Duty Amount (USD)' },
739
- margin: { t: 40, l: 40, r: 20, b: 60 }
740
  };
741
 
742
- Plotly.newPlot(dutyChart, dutyData, dutyLayout, {displayModeBar: false});
743
 
744
- // Monthly Trend Chart
745
- const monthlyChart = document.getElementById('monthly-chart');
746
  const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
747
- const monthlyData = [{
748
- type: 'scatter',
749
- mode: 'lines+markers',
750
- name: 'FTZ Scenario',
751
  x: months,
752
- y: [180000, 195000, 190000, 185000, 175000, 170000, 165000, 170000, 175000, 185000, 195000, 205000],
753
- line: { color: '#10b981', width: 3 },
754
- marker: { size: 6 }
755
- }, {
756
- type: 'scatter',
757
  mode: 'lines+markers',
758
  name: 'Standard Entry',
 
 
759
  x: months,
760
- y: [220000, 235000, 230000, 225000, 215000, 210000, 205000, 210000, 215000, 225000, 235000, 245000],
761
- line: { color: '#94a3b8', width: 2 },
762
- marker: { size: 4 }
 
763
  }];
764
 
765
- const monthlyLayout = {
766
- title: 'Monthly Duty/Fees Comparison',
767
- xaxis: { title: 'Month' },
768
- yaxis: { title: 'Amount (USD)' },
769
- margin: { t: 40, l: 60, r: 20, b: 60 }
770
  };
771
 
772
- Plotly.newPlot(monthlyChart, monthlyData, monthlyLayout, {displayModeBar: false});
773
 
774
- // Cost Composition Chart
775
- const costChart = document.getElementById('cost-chart');
776
- const costData = [{
777
- type: 'pie',
778
- values: [35, 25, 15, 10, 10, 5],
779
- labels: ['Duty', 'FTZ Operator Fees', 'Storage Costs', 'MPF/HMF Fees', 'Compliance Overhead', 'Demurrage'],
780
  marker: {
781
- colors: ['#4f46e5', '#818cf8', '#c7d2fe', '#10b981', '#34d399', '#a7f3d0']
782
- },
783
- textinfo: 'label+percent'
784
  }];
785
 
786
- const costLayout = {
787
- title: 'Cost Composition Breakdown',
788
- margin: { t: 40, l: 0, r: 0, b: 0 }
789
  };
790
 
791
- Plotly.newPlot(costChart, costData, costLayout, {displayModeBar: false});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
792
 
793
- // Top SKUs Table
794
- const topSKUsTable = new Tabulator("#top-skus-table", {
795
- height: "300px",
796
- data: [
797
- {sku: "FRG-001", hs: "3307", savings: 125000, dw: "Y", dwell: 45, cost: 8500},
798
- {sku: "SKC-003", hs: "3304", savings: 98000, dw: "Y", dwell: 38, cost: 6200},
799
- {sku: "MKP-012", hs: "3304", savings: 87000, dw: "N", dwell: 52, cost: 11000},
800
- {sku: "FRG-025", hs: "3307", savings: 78000, dw: "Y", dwell: 35, cost: 5500},
801
- {sku: "HRC-007", hs: "3305", savings: 65000, dw: "N", dwell: 48, cost: 9200},
802
- ],
803
  layout: "fitColumns",
804
  columns: [
805
- {title: "SKU", field: "sku", width: 100},
806
- {title: "HS Code", field: "hs", width: 100},
807
- {title: "Savings", field: "savings", formatter: "money", formatterParams: {symbol: "$"}, hozAlign: "right"},
808
- {title: "Priv. Foreign", field: "dw", width: 120, hozAlign: "center"},
809
- {title: "Dwell (Days)", field: "dwell", width: 120, hozAlign: "center"},
810
- {title: "Storage Cost", field: "cost", formatter: "money", formatterParams: {symbol: "$"}, hozAlign: "right"},
 
811
  ],
 
 
812
  });
813
-
814
- // Comparison Chart
815
- const comparisonChart = document.getElementById('comparison-chart');
816
- const comparisonData = [{
817
- type: 'bar',
818
- x: ['Standard Entry', 'FTZ - Baseline', 'FTZ - Privileged Foreign', 'FTZ - Inverted Tariff', 'Bonded Warehouse'],
819
- y: [12800000, 11600000, 11000000, 10700000, 11900000],
820
- marker: {
821
- color: ['#94a3b8', '#4f46e5', '#818cf8', '#6366f1', '#a78bfa']
822
- }
823
- }];
824
-
825
- const comparisonLayout = {
826
- title: 'Total Cost Comparison (Millions USD)',
827
- xaxis: { title: 'Scenario' },
828
- yaxis: { title: 'Total Cost' },
829
- margin: { t: 40, l: 80, r: 20, b: 100 }
830
- };
831
-
832
- Plotly.newPlot(comparisonChart, comparisonData, comparisonLayout, {displayModeBar: false});
833
-
834
- // Sensitivity Chart
835
- const sensitivityChart = document.getElementById('sensitivity-chart');
836
- const sensitivityData = [
837
- {
838
- type: 'bar',
839
- orientation: 'h',
840
- x: [0.15, 0.25, -0.1, 0.05, 0.3],
841
- y: ['Tariff Rate Change', 'Dwell Time', 'Weekly Entry', 'Storage Costs', 'Inventory Turns'],
842
- marker: {
843
- color: ['#ef4444', '#ef4444', '#10b981', '#10b981', '#10b981']
844
- }
845
- }
846
- ];
847
-
848
- const sensitivityLayout = {
849
- title: 'Sensitivity Analysis: Net Savings Impact',
850
- xaxis: { title: 'Impact on Savings (% of total cost)' },
851
- yaxis: { title: 'Factor' },
852
- margin: { t: 40, l: 120, r: 20, b: 60 }
853
- };
854
-
855
- Plotly.newPlot(sensitivityChart, sensitivityData, sensitivityLayout, {displayModeBar: false});
856
- });
857
  </script>
858
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=agenticlogistics/ftz-analysis-optimization" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
859
  </html>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>XYZ Cosmetics – FTZ Analysis & Optimization Studio</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdn.plot.ly/plotly-2.24.1.min.js"></script>
9
+ <script src="https://unpkg.com/tabulator-tables@5.5.2/dist/js/tabulator.min.js"></script>
10
+ <link href="https://unpkg.com/tabulator-tables@5.5.2/dist/css/tabulator.min.css" rel="stylesheet">
11
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
12
+ <script>
13
+ tailwind.config = {
14
+ theme: {
15
+ extend: {
16
+ colors: {
17
+ primary: '#1e40af',
18
+ secondary: '#3b82f6',
19
+ accent: '#0ea5e9',
20
+ dark: '#0f172a',
21
+ light: '#f8fafc'
22
+ }
23
+ }
24
+ }
 
 
 
25
  }
26
+ </script>
27
+ <style>
28
  .sidebar {
 
29
  transition: all 0.3s ease;
30
  }
 
31
  .tab-content {
32
  display: none;
33
  }
 
34
  .tab-content.active {
35
  display: block;
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  .scenario-card {
 
 
38
  transition: all 0.3s ease;
39
  }
 
40
  .scenario-card:hover {
41
+ transform: translateY(-3px);
42
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
+ .kpi-card {
45
+ transition: all 0.3s ease;
 
46
  }
47
+ .kpi-card:hover {
48
+ transform: translateY(-2px);
 
 
 
 
49
  }
50
+ .chart-container {
51
+ height: 400px;
 
 
 
52
  }
 
53
  @media (max-width: 768px) {
54
  .sidebar {
55
+ transform: translateX(-100%);
 
 
 
 
56
  }
 
57
  .sidebar.active {
58
+ transform: translateX(0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
60
  }
61
  </style>
62
  </head>
63
+ <body class="bg-gray-50 text-gray-800">
64
+ <!-- Mobile Menu Button -->
65
+ <div class="md:hidden fixed top-4 left-4 z-50">
66
+ <button id="menu-toggle" class="bg-primary text-white p-2 rounded-lg">
67
+ <i class="fas fa-bars"></i>
68
+ </button>
69
+ </div>
70
+
71
+ <!-- Sidebar -->
72
+ <div id="sidebar" class="sidebar fixed top-0 left-0 h-full w-64 bg-white shadow-lg z-40 p-4">
73
+ <div class="flex justify-between items-center mb-6">
74
+ <h1 class="text-xl font-bold text-primary">Filters</h1>
75
+ <button id="close-menu" class="md:hidden text-gray-500">
76
+ <i class="fas fa-times"></i>
77
+ </button>
78
+ </div>
79
 
80
+ <div class="space-y-6">
81
+ <!-- Date Range -->
82
+ <div>
83
+ <h3 class="font-semibold mb-2">Date Range</h3>
 
84
  <div class="grid grid-cols-2 gap-2">
85
+ <div>
86
+ <label class="text-sm text-gray-600">Start</label>
87
+ <input type="month" value="2023-01" class="w-full p-2 border rounded">
88
+ </div>
89
+ <div>
90
+ <label class="text-sm text-gray-600">End</label>
91
+ <input type="month" value="2024-12" class="w-full p-2 border rounded">
92
+ </div>
93
  </div>
94
  </div>
95
 
96
+ <!-- Product Family -->
97
+ <div>
98
+ <h3 class="font-semibold mb-2">Product Family</h3>
99
+ <div class="space-y-2">
100
+ <div class="flex items-center">
101
+ <input type="checkbox" id="skincare" class="mr-2">
102
+ <label for="skincare">Skincare</label>
103
+ </div>
104
+ <div class="flex items-center">
105
+ <input type="checkbox" id="makeup" class="mr-2" checked>
106
+ <label for="makeup">Makeup</label>
107
+ </div>
108
+ <div class="flex items-center">
109
+ <input type="checkbox" id="fragrance" class="mr-2" checked>
110
+ <label for="fragrance">Fragrance</label>
111
+ </div>
112
+ <div class="flex items-center">
113
+ <input type="checkbox" id="haircare" class="mr-2">
114
+ <label for="haircare">Haircare</label>
115
+ </div>
116
+ <div class="flex items-center">
117
+ <input type="checkbox" id="accessories" class="mr-2" checked>
118
+ <label for="accessories">Accessories</label>
119
+ </div>
120
+ <div class="flex items-center">
121
+ <input type="checkbox" id="giftsets" class="mr-2">
122
+ <label for="giftsets">Gift Sets</label>
123
+ </div>
124
+ </div>
125
+ </div>
126
+
127
+ <!-- HS Codes -->
128
+ <div>
129
+ <h3 class="font-semibold mb-2">HS Chapters/Codes</h3>
130
  <div class="grid grid-cols-2 gap-2">
131
+ <div class="flex items-center">
132
+ <input type="checkbox" id="hs3304" class="mr-2" checked>
133
+ <label for="hs3304">3304</label>
134
+ </div>
135
+ <div class="flex items-center">
136
+ <input type="checkbox" id="hs3305" class="mr-2">
137
+ <label for="hs3305">3305</label>
138
+ </div>
139
+ <div class="flex items-center">
140
+ <input type="checkbox" id="hs3307" class="mr-2" checked>
141
+ <label for="hs3307">3307</label>
142
+ </div>
143
+ <div class="flex items-center">
144
+ <input type="checkbox" id="hs4202" class="mr-2" checked>
145
+ <label for="hs4202">4202</label>
146
+ </div>
147
+ <div class="flex items-center">
148
+ <input type="checkbox" id="hs3923" class="mr-2">
149
+ <label for="hs3923">3923</label>
150
+ </div>
151
+ <div class="flex items-center">
152
+ <input type="checkbox" id="hs7010" class="mr-2" checked>
153
+ <label for="hs7010">7010</label>
154
+ </div>
155
+ <div class="flex items-center">
156
+ <input type="checkbox" id="hs3401" class="mr-2">
157
+ <label for="hs3401">3401</label>
158
+ </div>
159
  </div>
160
  </div>
161
 
162
+ <!-- Supplier Country -->
163
+ <div>
164
+ <h3 class="font-semibold mb-2">Supplier Country</h3>
165
+ <div class="space-y-2 max-h-40 overflow-y-auto">
166
+ <div class="flex items-center">
167
+ <input type="checkbox" id="france" class="mr-2">
168
+ <label for="france">France</label>
169
+ </div>
170
+ <div class="flex items-center">
171
+ <input type="checkbox" id="italy" class="mr-2" checked>
172
+ <label for="italy">Italy</label>
173
+ </div>
174
+ <div class="flex items-center">
175
+ <input type="checkbox" id="spain" class="mr-2">
176
+ <label for="spain">Spain</label>
177
+ </div>
178
+ <div class="flex items-center">
179
+ <input type="checkbox" id="korea" class="mr-2" checked>
180
+ <label for="korea">South Korea</label>
181
+ </div>
182
+ <div class="flex items-center">
183
+ <input type="checkbox" id="japan" class="mr-2">
184
+ <label for="japan">Japan</label>
185
+ </div>
186
+ <div class="flex items-center">
187
+ <input type="checkbox" id="china" class="mr-2">
188
+ <label for="china">China</label>
189
+ </div>
190
+ <div class="flex items-center">
191
+ <input type="checkbox" id="vietnam" class="mr-2">
192
+ <label for="vietnam">Vietnam</label>
193
+ </div>
194
+ <div class="flex items-center">
195
+ <input type="checkbox" id="thailand" class="mr-2">
196
+ <label for="thailand">Thailand</label>
197
+ </div>
198
+ <div class="flex items-center">
199
+ <input type="checkbox" id="mexico" class="mr-2">
200
+ <label for="mexico">Mexico</label>
201
+ </div>
202
+ <div class="flex items-center">
203
+ <input type="checkbox" id="canada" class="mr-2" checked>
204
+ <label for="canada">Canada</label>
205
+ </div>
206
  </div>
207
  </div>
208
 
209
+ <!-- Port/Entry Point -->
210
+ <div>
211
+ <h3 class="font-semibold mb-2">Port/Entry Point</h3>
212
+ <div class="space-y-2">
213
+ <div class="flex items-center">
214
+ <input type="checkbox" id="lax" class="mr-2" checked>
215
+ <label for="lax">LAX</label>
216
+ </div>
217
+ <div class="flex items-center">
218
+ <input type="checkbox" id="jfk" class="mr-2">
219
+ <label for="jfk">JFK</label>
220
+ </div>
221
+ <div class="flex items-center">
222
+ <input type="checkbox" id="ewr" class="mr-2">
223
+ <label for="ewr">EWR</label>
224
+ </div>
225
+ <div class="flex items-center">
226
+ <input type="checkbox" id="mia" class="mr-2" checked>
227
+ <label for="mia">MIA</label>
228
+ </div>
229
+ <div class="flex items-center">
230
+ <input type="checkbox" id="sav" class="mr-2">
231
+ <label for="sav">SAV</label>
232
+ </div>
233
+ </div>
234
  </div>
235
  </div>
236
 
237
+ <button class="w-full mt-6 bg-primary text-white py-2 rounded-lg hover:bg-blue-800 transition">
238
+ Apply Filters
239
+ </button>
 
 
240
  </div>
241
+
242
  <!-- Main Content -->
243
  <div class="md:ml-64">
244
+ <!-- Top Navbar -->
245
+ <header class="bg-white shadow-md p-4 sticky top-0 z-30">
246
+ <div class="flex flex-col md:flex-row md:items-center md:justify-between">
247
+ <div>
248
+ <h1 class="text-xl md:text-2xl font-bold text-primary">XYZ Cosmetics – FTZ Analysis & Optimization Studio</h1>
249
+ <p class="text-sm text-gray-600">Supply Chain Optimization Dashboard</p>
250
+ </div>
251
+
252
+ <div class="flex flex-wrap items-center mt-4 md:mt-0 space-x-2">
253
+ <div>
254
+ <label class="text-sm mr-2">Scenario:</label>
255
+ <select class="border rounded p-2">
256
+ <option>Standard Entry</option>
257
+ <option>FTZ - Baseline</option>
258
+ <option selected>FTZ - Privileged Foreign</option>
259
+ <option>FTZ - Inverted Tariff</option>
260
+ <option>Bonded Warehouse</option>
261
+ <option>Mixed Network</option>
262
+ </select>
263
+ </div>
264
+
265
+ <button class="bg-primary hover:bg-blue-800 text-white px-4 py-2 rounded-lg flex items-center">
266
+ <i class="fas fa-play mr-2"></i> Run Scenario
267
+ </button>
268
+
269
+ <button class="border border-gray-300 hover:bg-gray-100 px-4 py-2 rounded-lg">
270
+ <i class="fas fa-sync-alt mr-2"></i> Reset
271
+ </button>
272
+
273
+ <button class="border border-gray-300 hover:bg-gray-100 px-4 py-2 rounded-lg">
274
+ <i class="fas fa-redo mr-2"></i> Regenerate Data
275
+ </button>
276
+
277
+ <div>
278
+ <select class="border rounded p-2">
279
+ <option>USD</option>
280
+ <option>EUR</option>
281
+ <option>JPY</option>
282
+ <option>KRW</option>
283
+ </select>
284
+ </div>
285
+ </div>
286
  </div>
287
+ </header>
288
+
289
+ <!-- Tabs Navigation -->
290
+ <div class="bg-white border-b">
291
  <div class="flex overflow-x-auto px-4">
292
+ <button class="tab-btn px-4 py-3 font-medium text-blue-600 border-b-2 border-blue-600" data-tab="overview">Overview</button>
293
+ <button class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-blue-600" data-tab="inventory">Inventory & Flows</button>
294
+ <button class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-blue-600" data-tab="duty">Duty & Fees</button>
295
+ <button class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-blue-600" data-tab="comparison">FTZ vs. Alternatives</button>
296
+ <button class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-blue-600" data-tab="optimization">Optimization Lab</button>
297
+ <button class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-blue-600" data-tab="compliance">Compliance & Risk</button>
298
+ <button class="tab-btn px-4 py-3 font-medium text-gray-600 hover:text-blue-600" data-tab="about">About/Methodology</button>
299
  </div>
300
  </div>
301
+
302
  <!-- Tab Content -->
303
  <div class="p-4 md:p-6">
304
  <!-- Overview Tab -->
305
+ <div id="overview" class="tab-content active">
306
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
307
+ <!-- KPI Cards -->
308
+ <div class="kpi-card bg-white rounded-xl shadow-md p-4 border-l-4 border-blue-500">
309
  <div class="flex justify-between items-start">
310
  <div>
311
+ <h3 class="text-gray-500 text-sm">Total Duty Paid (YTD)</h3>
312
+ <p class="text-2xl font-bold mt-1">$1,248,950</p>
313
  </div>
314
+ <div class="bg-blue-100 p-2 rounded-full">
315
+ <i class="fas fa-dollar-sign text-blue-600"></i>
316
  </div>
317
  </div>
318
  <p class="text-green-600 text-sm mt-2">
319
+ <i class="fas fa-arrow-down mr-1"></i> 12.3% vs Standard Entry
320
  </p>
321
  </div>
322
 
323
+ <div class="kpi-card bg-white rounded-xl shadow-md p-4 border-l-4 border-green-500">
324
  <div class="flex justify-between items-start">
325
  <div>
326
+ <h3 class="text-gray-500 text-sm">MPF/HMF Fees (YTD)</h3>
327
+ <p class="text-2xl font-bold mt-1">$87,450</p>
328
  </div>
329
  <div class="bg-green-100 p-2 rounded-full">
330
+ <i class="fas fa-file-invoice-dollar text-green-600"></i>
331
  </div>
332
  </div>
333
  <p class="text-green-600 text-sm mt-2">
334
+ <i class="fas fa-arrow-down mr-1"></i> 23.5% vs Standard Entry
335
  </p>
336
  </div>
337
 
338
+ <div class="kpi-card bg-white rounded-xl shadow-md p-4 border-l-4 border-purple-500">
339
  <div class="flex justify-between items-start">
340
  <div>
341
+ <h3 class="text-gray-500 text-sm">Avg Landed Cost/Unit</h3>
342
+ <p class="text-2xl font-bold mt-1">$18.75</p>
343
  </div>
344
+ <div class="bg-purple-100 p-2 rounded-full">
345
+ <i class="fas fa-box-open text-purple-600"></i>
346
  </div>
347
  </div>
348
+ <p class="text-red-600 text-sm mt-2">
349
+ <i class="fas fa-arrow-up mr-1"></i> 3.2% vs Standard Entry
350
  </p>
351
  </div>
352
 
353
+ <div class="kpi-card bg-white rounded-xl shadow-md p-4 border-l-4 border-amber-500">
354
  <div class="flex justify-between items-start">
355
  <div>
356
+ <h3 class="text-gray-500 text-sm">Gross Margin %</h3>
357
+ <p class="text-2xl font-bold mt-1">48.6%</p>
358
  </div>
359
+ <div class="bg-amber-100 p-2 rounded-full">
360
+ <i class="fas fa-chart-line text-amber-600"></i>
361
  </div>
362
  </div>
363
  <p class="text-green-600 text-sm mt-2">
364
+ <i class="fas fa-arrow-up mr-1"></i> 2.1% vs Standard Entry
365
  </p>
366
  </div>
367
  </div>
368
 
369
+ <!-- Charts Row -->
370
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
371
+ <div class="bg-white rounded-xl shadow-md p-4">
372
+ <h3 class="font-semibold mb-4">Duty and Fees by HS Code and Port</h3>
373
+ <div id="chart1" class="chart-container"></div>
374
  </div>
375
 
376
+ <div class="bg-white rounded-xl shadow-md p-4">
377
+ <h3 class="font-semibold mb-4">Monthly Duty/Fees vs Standard Entry</h3>
378
+ <div id="chart2" class="chart-container"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  </div>
380
  </div>
381
 
382
+ <!-- Cost Composition -->
383
+ <div class="bg-white rounded-xl shadow-md p-4 mb-6">
384
+ <h3 class="font-semibold mb-4">Cost Composition Breakdown</h3>
385
+ <div id="costTreemap" class="chart-container"></div>
386
  </div>
387
 
388
+ <!-- Savings Table -->
389
+ <div class="bg-white rounded-xl shadow-md p-4">
390
+ <h3 class="font-semibold mb-4">Top 25 SKUs by Potential FTZ Savings</h3>
391
+ <div id="savingsTable" class="overflow-x-auto"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  </div>
393
  </div>
394
 
395
  <!-- About Tab -->
396
+ <div id="about" class="tab-content">
397
+ <div class="bg-white rounded-xl shadow-md p-6">
398
+ <h2 class="text-2xl font-bold text-primary mb-4">FTZ Analysis & Optimization Studio</h2>
399
+
400
  <div class="prose max-w-none">
401
+ <h3>About This Tool</h3>
402
+ <p>This dashboard allows logistics, finance, and compliance teams to simulate the use of U.S. Foreign Trade Zones versus Bonded Warehouses and standard entry to reduce duty/tariff spend, MPF, demurrage, and compliance overhead for imported beauty and cosmetic goods.</p>
 
 
 
403
 
404
+ <h3>Key Concepts</h3>
405
+ <ul>
406
+ <li><strong>FTZs</strong> are considered outside the U.S. customs territory for tariff purposes; duties are deferred until merchandise enters U.S. commerce. Weekly entry, direct delivery, inverted tariff opportunities, and scrap/waste relief can create material savings.</li>
407
+ <li><strong>Bonded Warehouses</strong> defer duty assessment until goods are withdrawn for consumption. Savings depend on anticipated tariff rate changes.</li>
408
+ <li><strong>Privileged Foreign Status</strong> locks duty rates at admission, protecting against future rate increases.</li>
409
+ <li><strong>Inverted Tariff</strong> allows using the lower duty rate of the finished product instead of components when applicable.</li>
410
  </ul>
411
 
412
+ <h3>How to Use This Dashboard</h3>
413
+ <ol>
414
+ <li><strong>Apply Filters</strong> on the left sidebar to focus on specific products, suppliers, or time periods.</li>
415
+ <li><strong>Select a Scenario</strong> from the dropdown to compare different logistics strategies.</li>
416
+ <li><strong>Analyze Results</strong> in the Overview tab to understand potential savings.</li>
417
+ <li><strong>Explore Details</strong> in other tabs for in-depth analysis of inventory flows, duty calculations, and optimization opportunities.</li>
418
+ <li><strong>Run "What-if" Scenarios</strong> in the Optimization Lab to find the best strategy mix.</li>
419
+ </ol>
420
+
421
+ <h3>Data and Methodology</h3>
422
+ <p>All data is synthetic and generated client-side. Calculations follow these principles:</p>
423
+ <ul>
424
+ <li>Duty is calculated based on customs value (merchandise + freight + insurance) multiplied by applicable tariff rates</li>
425
+ <li>MPF (Merchandise Processing Fee) is calculated with minimum/maximum constraints per entry</li>
426
+ <li>HMF (Harbor Maintenance Fee) applies to ocean shipments</li>
427
+ <li>Weekly entry aggregations reduce total entries and associated fees</li>
428
+ <li>Storage fees are calculated based on dwell time in locations</li>
429
  </ul>
430
 
431
+ <div class="bg-blue-50 p-4 rounded-lg mt-6">
432
+ <p class="font-semibold">Demonstration only. FTZ/Bonded mechanics summarized from public resources: strtrade.com, geodis.com, bergenlogistics.com, chiefexecutive.net, zhftaxlaw.com.</p>
433
+ </div>
 
 
 
 
434
  </div>
435
  </div>
436
  </div>
437
  </div>
438
  </div>
439
+
 
 
 
 
 
 
440
  <script>
441
  // Tab switching functionality
442
+ document.querySelectorAll('.tab-btn').forEach(button => {
443
  button.addEventListener('click', () => {
444
+ // Remove active class from all buttons and content
445
+ document.querySelectorAll('.tab-btn').forEach(btn => {
446
+ btn.classList.remove('text-blue-600', 'border-b-2', 'border-blue-600');
447
+ btn.classList.add('text-gray-600');
448
+ });
449
+
450
+ document.querySelectorAll('.tab-content').forEach(content => {
451
+ content.classList.remove('active');
452
+ });
453
 
454
  // Add active class to clicked button
455
+ button.classList.add('text-blue-600', 'border-b-2', 'border-blue-600');
456
+ button.classList.remove('text-gray-600');
457
 
458
+ // Show corresponding content
459
  const tabId = button.getAttribute('data-tab');
460
+ document.getElementById(tabId).classList.add('active');
461
  });
462
  });
463
 
464
+ // Mobile menu toggle
465
+ document.getElementById('menu-toggle').addEventListener('click', () => {
466
+ document.getElementById('sidebar').classList.add('active');
 
467
  });
468
 
469
+ document.getElementById('close-menu').addEventListener('click', () => {
470
  document.getElementById('sidebar').classList.remove('active');
 
471
  });
472
 
473
+ // Render charts when Overview tab is active
474
+ document.querySelector('[data-tab="overview"]').addEventListener('click', () => {
475
+ renderOverviewCharts();
 
 
 
 
 
 
 
 
 
476
  });
477
 
478
+ // Initialize charts on first load if Overview is default
479
+ window.addEventListener('load', () => {
480
+ renderOverviewCharts();
481
+ renderSavingsTable();
482
+ });
483
+
484
+ // Render Overview Charts
485
+ function renderOverviewCharts() {
486
+ // Chart 1: Duty and Fees by HS Code and Port
487
+ const chart1Data = [{
488
+ type: 'bar',
489
+ x: ['3304', '3305', '3307', '4202', '7010'],
490
+ y: [350000, 220000, 480000, 180000, 210000],
491
+ name: 'Duty',
492
+ marker: {color: '#3b82f6'}
493
+ }, {
494
  type: 'bar',
495
+ x: ['3304', '3305', '3307', '4202', '7010'],
496
+ y: [85000, 62000, 98000, 42000, 53000],
497
+ name: 'MPF/HMF',
498
+ marker: {color: '#1e40af'}
499
  }];
500
 
501
+ const chart1Layout = {
502
+ barmode: 'stack',
503
+ title: 'Duty and Fees by HS Code',
504
+ xaxis: {title: 'HS Code'},
505
+ yaxis: {title: 'Amount ($USD)'}
506
  };
507
 
508
+ Plotly.newPlot('chart1', chart1Data, chart1Layout);
509
 
510
+ // Chart 2: Monthly Duty/Fees vs Standard Entry
 
511
  const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
512
+ const standardFees = [120000, 110000, 130000, 140000, 150000, 160000, 170000, 180000, 160000, 150000, 140000, 130000];
513
+ const ftzFees = [100000, 92000, 108000, 115000, 125000, 132000, 140000, 148000, 135000, 128000, 118000, 110000];
514
+
515
+ const chart2Data = [{
516
  x: months,
517
+ y: standardFees,
 
 
 
 
518
  mode: 'lines+markers',
519
  name: 'Standard Entry',
520
+ line: {color: '#94a3b8'}
521
+ }, {
522
  x: months,
523
+ y: ftzFees,
524
+ mode: 'lines+markers',
525
+ name: 'FTZ Strategy',
526
+ line: {color: '#3b82f6'}
527
  }];
528
 
529
+ const chart2Layout = {
530
+ title: 'Monthly Duty/Fees vs Standard Entry',
531
+ xaxis: {title: 'Month'},
532
+ yaxis: {title: 'Amount ($USD)'}
 
533
  };
534
 
535
+ Plotly.newPlot('chart2', chart2Data, chart2Layout);
536
 
537
+ // Cost Composition Treemap
538
+ const costTreemapData = [{
539
+ type: "treemap",
540
+ labels: ["Duty", "MPF", "HMF", "Storage", "Handling", "Compliance"],
541
+ parents: ["", "", "", "", "", ""],
542
+ values: [45, 12, 8, 15, 10, 10],
543
  marker: {
544
+ colors: ['#3b82f6', '#1e40af', '#93c5fd', '#bfdbfe', '#dbeafe', '#dbeafe']
545
+ }
 
546
  }];
547
 
548
+ const costTreemapLayout = {
549
+ title: "Landed Cost Composition Breakdown"
 
550
  };
551
 
552
+ Plotly.newPlot('costTreemap', costTreemapData, costTreemapLayout);
553
+ }
554
+
555
+ // Render Savings Table
556
+ function renderSavingsTable() {
557
+ const tableData = [
558
+ {hsCode: '3307', dutyBasis: '$8.25/unit', inverted: '$2,450', pf: 'Yes', dwell: 28, storage: '$1,200', savings: '$18,750'},
559
+ {hsCode: '4202', dutyBasis: '$5.50/unit', inverted: '$1,120', pf: 'Yes', dwell: 22, storage: '$890', savings: '$15,400'},
560
+ {hsCode: '3304', dutyBasis: '$3.80/unit', inverted: '$850', pf: 'Yes', dwell: 18, storage: '$650', savings: '$12,300'},
561
+ {hsCode: '7010', dutyBasis: '$4.50/unit', inverted: '$650', pf: 'No', dwell: 35, storage: '$1,500', savings: '$9,800'},
562
+ {hsCode: '3307', dutyBasis: '$7.20/unit', inverted: '$1,800', pf: 'Yes', dwell: 24, storage: '$1,100', savings: '$8,900'},
563
+ {hsCode: '4202', dutyBasis: '$6.10/unit', inverted: '$950', pf: 'Yes', dwell: 20, storage: '$780', savings: '$7,600'},
564
+ {hsCode: '3304', dutyBasis: '$3.20/unit', inverted: '$420', pf: 'No', dwell: 15, storage: '$550', savings: '$6,700'},
565
+ {hsCode: '3307', dutyBasis: '$8.10/unit', inverted: '$2,100', pf: 'Yes', dwell: 30, storage: '$1,300', savings: '$6,400'},
566
+ {hsCode: '7010', dutyBasis: '$5.00/unit', inverted: '$750', pf: 'Yes', dwell: 38, storage: '$1,700', savings: '$5,900'},
567
+ {hsCode: '3304', dutyBasis: '$4.10/unit', inverted: '$680', pf: 'Yes', dwell: 18, storage: '$900', savings: '$5,200'}
568
+ ];
569
 
570
+ const table = new Tabulator("#savingsTable", {
571
+ data: tableData,
 
 
 
 
 
 
 
 
572
  layout: "fitColumns",
573
  columns: [
574
+ {title: "HS Code", field: "hsCode", width: 100},
575
+ {title: "Duty Basis", field: "dutyBasis", width: 120},
576
+ {title: "Inverted Savings", field: "inverted", hozAlign: "right"},
577
+ {title: "PF Locked", field: "pf", width: 100},
578
+ {title: "Dwell (Days)", field: "dwell", hozAlign: "center"},
579
+ {title: "Storage Cost", field: "storage", hozAlign: "right"},
580
+ {title: "Savings", field: "savings", hozAlign: "right", formatter: "money", formatterParams: {symbol: "$"}}
581
  ],
582
+ pagination: "local",
583
+ paginationSize: 10
584
  });
585
+ }
586
+
587
+ // Initialize with Overview tab active
588
+ document.querySelector('[data-tab="overview"]').click();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  </script>
590
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=agenticlogistics/ftz-analysis-optimization" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
591
  </html>