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
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ProjectFlow Navigator</title>
    <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
    <script src="https://cdn.tailwindcss.com"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: {
                            50: '#f0f9ff',
                            100: '#e0f2fe',
                            200: '#bae6fd',
                            300: '#7dd3fc',
                            400: '#38bdf8',
                            500: '#0ea5e9',
                            600: '#0284c7',
                            700: '#0369a1',
                            800: '#075985',
                            900: '#0c4a6e',
                        },
                        secondary: {
                            50: '#faf6ff',
                            100: '#f3e8ff',
                            200: '#e9d5ff',
                            300: '#d8b4fe',
                            400: '#c084fc',
                            500: '#a855f7',
                            600: '#9333ea',
                            700: '#7e22ce',
                            800: '#6b21a8',
                            900: '#581c87',
                        }
                    }
                }
            }
        }
    </script>
    <script src="https://unpkg.com/feather-icons"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
        
        * {
            font-family: 'Inter', sans-serif;
        }
        
        .sidebar {
            transition: all 0.3s ease;
        }
        
        .dashboard-card {
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        
        .dashboard-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        }
        
        .file-drop-area {
            border: 2px dashed #d1d5db;
            border-radius: 0.5rem;
            transition: all 0.3s ease;
        }
        
        .file-drop-area.active {
            border-color: #0ea5e9;
            background-color: rgba(14, 165, 233, 0.05);
        }
        
        .project-item {
            border-left: 4px solid transparent;
            transition: all 0.2s ease;
        }
        
        .project-item:hover {
            border-left-color: #0ea5e9;
            background-color: #f8fafc;
        }
        
        .status-badge {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 500;
        }
        
        .progress-bar {
            transition: width 0.5s ease-in-out;
        }
    </style>
</head>
<body class="bg-gray-50 flex h-screen">
    <!-- Sidebar -->
    <div class="sidebar w-64 bg-white shadow-md flex flex-col">
        <div class="p-5 border-b border-gray-200">
            <div class="flex items-center space-x-3">
                <div class="w-10 h-10 rounded-lg bg-primary-500 flex items-center justify-center">
                    <i data-feather="trello" class="text-white"></i>
                </div>
                <h1 class="text-xl font-bold text-gray-800">ProjectFlow</h1>
            </div>
        </div>
        
        <div class="flex-1 overflow-y-auto py-4">
            <nav class="px-4 space-y-1">
                <a href="#" class="flex items-center px-4 py-3 text-primary-600 bg-primary-50 rounded-lg">
                    <i data-feather="layout" class="w-5 h-5 mr-3"></i>
                    Dashboard
                </a>
                <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:bg-gray-100 rounded-lg">
                    <i data-feather="folder" class="w-5 h-5 mr-3"></i>
                    Projects
                </a>
                <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:bg-gray-100 rounded-lg">
                    <i data-feather="calendar" class="w-5 h-5 mr-3"></i>
                    Timeline
                </a>
                <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:bg-gray-100 rounded-lg">
                    <i data-feather="bar-chart-2" class="w-5 h-5 mr-3"></i>
                    Reports
                </a>
                <a href="#" class="flex items-center px-4 py-3 text-gray-600 hover:bg-gray-100 rounded-lg">
                    <i data-feather="settings" class="w-5 h-5 mr-3"></i>
                    Settings
                </a>
            </nav>
            
            <div class="mt-8 px-4">
                <h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider px-4 mb-3">Recent Projects</h3>
                <div class="space-y-2">
                    <div class="project-item p-3 bg-gray-50 rounded-lg cursor-pointer">
                        <div class="flex justify-between items-center">
                            <h4 class="text-sm font-medium text-gray-800">SAP Implementation</h4>
                            <span class="status-badge bg-green-100 text-green-800">Completed</span>
                        </div>
                        <p class="text-xs text-gray-500 mt-1">Last updated: 2 days ago</p>
                    </div>
                    <div class="project-item p-3 bg-gray-50 rounded-lg cursor-pointer">
                        <div class="flex justify-between items-center">
                            <h4 class="text-sm font-medium text-gray-800">Warehouse Upgrade</h4>
                            <span class="status-badge bg-yellow-100 text-yellow-800">In Progress</span>
                        </div>
                        <p class="text-xs text-gray-500 mt-1">Last updated: Today</p>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="p-4 border-t border-gray-200">
            <div class="flex items-center space-x-3">
                <div class="w-10 h-10 rounded-full bg-primary-100 flex items-center justify-center">
                    <i data-feather="user" class="text-primary-600"></i>
                </div>
                <div>
                    <p class="text-sm font-medium text-gray-800">John Doe</p>
                    <p class="text-xs text-gray-500">Administrator</p>
                </div>
            </div>
        </div>
    </div>
    
    <!-- Main Content -->
    <div class="flex-1 overflow-y-auto">
        <div class="p-6">
            <!-- Header -->
            <div class="flex justify-between items-center mb-8">
                <div>
                    <h2 class="text-2xl font-bold text-gray-800">Project Dashboard</h2>
                    <p class="text-gray-600">Monitor and manage your SAP projects</p>
                </div>
                <button class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg flex items-center">
                    <i data-feather="plus" class="w-4 h-4 mr-2"></i>
                    New Project
                </button>
            </div>
            
            <!-- Stats Cards -->
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
                <div class="dashboard-card bg-white p-5 rounded-xl shadow-sm border border-gray-100">
                    <div class="flex justify-between items-start">
                        <div>
                            <p class="text-sm text-gray-500">Total Projects</p>
                            <h3 class="text-2xl font-bold text-gray-800 mt-1">24</h3>
                        </div>
                        <div class="p-3 bg-primary-50 rounded-lg">
                            <i data-feather="briefcase" class="w-5 h-5 text-primary-500"></i>
                        </div>
                    </div>
                    <p class="text-xs text-gray-500 mt-3"><span class="text-green-600">+3</span> from last week</p>
                </div>
                
                <div class="dashboard-card bg-white p-5 rounded-xl shadow-sm border border-gray-100">
                    <div class="flex justify-between items-start">
                        <div>
                            <p class="text-sm text-gray-500">In Progress</p>
                            <h3 class="text-2xl font-bold text-gray-800 mt-1">12</h3>
                        </div>
                        <div class="p-3 bg-yellow-50 rounded-lg">
                            <i data-feather="clock" class="w-5 h-5 text-yellow-500"></i>
                        </div>
                    </div>
                    <p class="text-xs text-gray-500 mt-3"><span class="text-green-600">+2</span> from last week</p>
                </div>
                
                <div class="dashboard-card bg-white p-5 rounded-xl shadow-sm border border-gray-100">
                    <div class="flex justify-between items-start">
                        <div>
                            <p class="text-sm text-gray-500">Completed</p>
                            <h3 class="text-2xl font-bold text-gray-800 mt-1">8</h3>
                        </div>
                        <div class="p-3 bg-green-50 rounded-lg">
                            <i data-feather="check-circle" class="w-5 h-5 text-green-500"></i>
                        </div>
                    </div>
                    <p class="text-xs text-gray-500 mt-3"><span class="text-green-600">+1</span> from last week</p>
                </div>
                
                <div class="dashboard-card bg-white p-5 rounded-xl shadow-sm border border-gray-100">
                    <div class="flex justify-between items-start">
                        <div>
                            <p class="text-sm text-gray-500">Overdue</p>
                            <h3 class="text-2xl font-bold text-gray-800 mt-1">4</h3>
                        </div>
                        <div class="p-3 bg-red-50 rounded-lg">
                            <i data-feather="alert-circle" class="w-5 h-5 text-red-500"></i>
                        </div>
                    </div>
                    <p class="text-xs text-gray-500 mt-3"><span class="text-red-600">+1</span> from last week</p>
                </div>
            </div>
            
            <!-- File Upload Section -->
            <div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 mb-8">
                <h3 class="text-lg font-semibold text-gray-800 mb-4">Import SAP MD4C Data</h3>
                <p class="text-gray-600 mb-6">Upload your SAP T code MD4C output (.txt file) to analyze and manage your projects</p>
                
                <div class="file-drop-area p-8 text-center" id="fileDropArea">
                    <i data-feather="upload-cloud" class="w-12 h-12 text-gray-400 mx-auto mb-4"></i>
                    <p class="text-gray-600 mb-2">Drag & drop your file here</p>
                    <p class="text-sm text-gray-500 mb-4">Supported format: .txt (SAP MD4C output)</p>
                    <label for="fileInput" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg cursor-pointer inline-block">
                        Choose File
                    </label>
                    <input type="file" id="fileInput" accept=".txt" class="hidden">
                </div>
                
                <div id="fileInfo" class="hidden mt-4 p-4 bg-gray-50 rounded-lg">
                    <div class="flex justify-between items-center">
                        <div class="flex items-center">
                            <i data-feather="file-text" class="w-5 h-5 text-gray-500 mr-2"></i>
                            <span id="fileName" class="text-sm font-medium text-gray-800">md4c_output.txt</span>
                        </div>
                        <button id="processFile" class="bg-primary-500 hover:bg-primary-600 text-white px-3 py-1 rounded text-sm">
                            Process
                        </button>
                    </div>
                </div>
            </div>
            
            <!-- Projects Overview -->
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                <!-- Recent Projects -->
                <div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6">
                    <h3 class="text-lg font-semibold text-gray-800 mb-4">Recent Projects</h3>
                    
                    <div class="space-y-4">
                        <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                            <div>
                                <h4 class="font-medium text-gray-800">Material Requirements Planning</h4>
                                <div class="flex items-center mt-1">
                                    <div class="w-24 h-2 bg-gray-200 rounded-full">
                                        <div class="progress-bar h-2 bg-green-500 rounded-full" style="width: 75%"></div>
                                    </div>
                                    <span class="text-xs text-gray-600 ml-2">75%</span>
                                </div>
                            </div>
                            <span class="status-badge bg-blue-100 text-blue-800">On Track</span>
                        </div>
                        
                        <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                            <div>
                                <h4 class="font-medium text-gray-800">Inventory Optimization</h4>
                                <div class="flex items-center mt-1">
                                    <div class="w-24 h-2 bg-gray-200 rounded-full">
                                        <div class="progress-bar h-2 bg-yellow-500 rounded-full" style="width: 45%"></div>
                                    </div>
                                    <span class="text-xs text-gray-600 ml-2">45%</span>
                                </div>
                            </div>
                            <span class="status-badge bg-yellow-100 text-yellow-800">Delayed</span>
                        </div>
                        
                        <div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                            <div>
                                <h4 class="font-medium text-gray-800">Production Scheduling</h4>
                                <div class="flex items-center mt-1">
                                    <div class="w-24 h-2 bg-gray-200 rounded-full">
                                        <div class="progress-bar h-2 bg-green-500 rounded-full" style="width: 90%"></div>
                                    </div>
                                    <span class="text-xs text-gray-600 ml-2">90%</span>
                                </div>
                            </div>
                            <span class="status-badge bg-green-100 text-green-800">Completed</span>
                        </div>
                    </div>
                    
                    <a href="#" class="block text-center mt-6 text-primary-600 hover:text-primary-700 text-sm font-medium">
                        View all projects
                    </a>
                </div>
                
                <!-- Project Status Chart -->
                <div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6">
                    <h3 class="text-lg font-semibold text-gray-800 mb-4">Project Status Overview</h3>
                    <div class="h-64">
                        <canvas id="statusChart"></canvas>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Initialize Feather Icons
        feather.replace();
        
        // File upload handling
        const fileDropArea = document.getElementById('fileDropArea');
        const fileInput = document.getElementById('fileInput');
        const fileInfo = document.getElementById('fileInfo');
        const fileName = document.getElementById('fileName');
        const processFile = document.getElementById('processFile');
        
        ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
            fileDropArea.addEventListener(eventName, preventDefaults, false);
        });
        
        function preventDefaults(e) {
            e.preventDefault();
            e.stopPropagation();
        }
        
        ['dragenter', 'dragover'].forEach(eventName => {
            fileDropArea.addEventListener(eventName, highlight, false);
        });
        
        ['dragleave', 'drop'].forEach(eventName => {
            fileDropArea.addEventListener(eventName, unhighlight, false);
        });
        
        function highlight() {
            fileDropArea.classList.add('active');
        }
        
        function unhighlight() {
            fileDropArea.classList.remove('active');
        }
        
        fileDropArea.addEventListener('drop', handleDrop, false);
        
        function handleDrop(e) {
            const dt = e.dataTransfer;
            const files = dt.files;
            handleFiles(files);
        }
        
        fileInput.addEventListener('change', function() {
            handleFiles(this.files);
        });
        
        function handleFiles(files) {
            if (files.length > 0) {
                const file = files[0];
                if (file.type === 'text/plain' || file.name.endsWith('.txt')) {
                    fileName.textContent = file.name;
                    fileInfo.classList.remove('hidden');
                } else {
                    alert('Please upload a valid .txt file from SAP MD4C');
                }
            }
        }
        
        processFile.addEventListener('click', function() {
            alert('Processing SAP MD4C file... This would parse and load project data in a real application.');
            // In a real application, this would parse the file and update the dashboard
        });
        
        // Initialize chart
        document.addEventListener('DOMContentLoaded', function() {
            const ctx = document.getElementById('statusChart').getContext('2d');
            const statusChart = new Chart(ctx, {
                type: 'doughnut',
                data: {
                    labels: ['Completed', 'In Progress', 'Not Started', 'Overdue'],
                    datasets: [{
                        data: [8, 12, 4, 4],
                        backgroundColor: [
                            '#10b981',
                            '#f59e0b',
                            '#3b82f6',
                            '#ef4444'
                        ],
                        borderWidth: 0
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    cutout: '70%',
                    plugins: {
                        legend: {
                            position: 'bottom',
                            labels: {
                                usePointStyle: true,
                                padding: 20
                            }
                        }
                    }
                }
            });
        });
    </script>
</body>
</html>