sam7sam commited on
Commit
225a864
·
verified ·
1 Parent(s): 46b7201

Add 1 files

Browse files
Files changed (1) hide show
  1. index.html +386 -442
index.html CHANGED
@@ -9,10 +9,63 @@
9
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
10
  <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
11
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  <style>
 
 
 
 
 
13
  .sidebar {
14
  transition: all 0.3s;
 
15
  }
 
16
  @media (max-width: 768px) {
17
  .sidebar {
18
  transform: translateX(-100%);
@@ -21,64 +74,110 @@
21
  transform: translateX(0);
22
  }
23
  }
 
24
  .invoice-preview {
25
  width: 210mm;
26
  min-height: 297mm;
27
  margin: auto;
28
  padding: 20mm;
29
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
30
- background: white;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
32
  </style>
33
  </head>
34
- <body class="bg-gray-50 font-sans">
 
 
 
 
 
 
 
35
  <!-- Mobile Menu Button -->
36
- <button id="mobileMenuButton" class="md:hidden fixed top-4 left-4 z-50 bg-blue-600 text-white p-2 rounded-lg">
37
  <i class="fas fa-bars"></i>
38
  </button>
39
 
40
  <!-- Sidebar -->
41
- <div id="sidebar" class="sidebar fixed top-0 left-0 h-full w-64 bg-blue-800 text-white p-4 shadow-lg z-40">
42
  <div class="flex items-center mb-8">
43
- <div class="bg-white text-blue-800 rounded-lg p-2 mr-3">
44
- <i class="fas fa-chart-line text-2xl"></i>
45
  </div>
46
  <h1 class="text-2xl font-bold">Samfact</h1>
47
  </div>
48
 
49
  <nav>
50
- <ul class="space-y-2">
51
  <li>
52
- <a href="#" id="dashboardLink" class="flex items-center p-3 rounded-lg hover:bg-blue-700 transition">
53
- <i class="fas fa-home mr-3"></i> Tableau de bord
54
  </a>
55
  </li>
56
  <li>
57
- <a href="#" id="projectsLink" class="flex items-center p-3 rounded-lg hover:bg-blue-700 transition">
58
- <i class="fas fa-project-diagram mr-3"></i> Projets
59
  </a>
60
  </li>
61
  <li>
62
- <a href="#" id="clientsLink" class="flex items-center p-3 rounded-lg hover:bg-blue-700 transition">
63
- <i class="fas fa-users mr-3"></i> Clients
64
  </a>
65
  </li>
66
  <li>
67
- <a href="#" id="invoicesLink" class="flex items-center p-3 rounded-lg hover:bg-blue-700 transition">
68
- <i class="fas fa-file-invoice-dollar mr-3"></i> Factures & Devis
69
  </a>
70
  </li>
71
  <li>
72
- <a href="#" id="settingsLink" class="flex items-center p-3 rounded-lg hover:bg-blue-700 transition">
73
- <i class="fas fa-cog mr-3"></i> Paramètres
74
  </a>
75
  </li>
76
  </ul>
77
  </nav>
78
 
79
  <div class="absolute bottom-0 left-0 w-full p-4">
80
- <div class="bg-blue-700 p-3 rounded-lg">
81
- <p class="text-sm">Auto-entrepreneur</p>
82
  <p class="font-semibold">Data Analyse</p>
83
  </div>
84
  </div>
@@ -87,17 +186,17 @@
87
  <!-- Main Content -->
88
  <div class="ml-0 md:ml-64 transition-all duration-300">
89
  <!-- Header -->
90
- <header class="bg-white shadow-sm p-4 flex justify-between items-center">
91
- <h2 id="pageTitle" class="text-xl font-semibold text-gray-800">Tableau de bord</h2>
92
  <div class="flex items-center space-x-4">
93
  <div class="relative">
94
- <button class="bg-blue-600 text-white p-2 rounded-lg hover:bg-blue-700 transition">
95
- <i class="fas fa-bell"></i>
96
  </button>
97
  <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span>
98
  </div>
99
  <div class="flex items-center">
100
- <div class="w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center text-white">
101
  <i class="fas fa-user"></i>
102
  </div>
103
  <span class="ml-2 font-medium hidden md:inline">Sam</span>
@@ -111,35 +210,35 @@
111
  <section id="dashboardSection">
112
  <!-- Stats Cards -->
113
  <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
114
- <div class="bg-white p-4 rounded-lg shadow">
115
- <div class="flex items-center">
116
- <div class="p-3 rounded-lg bg-blue-100 text-blue-600 mr-4">
117
  <i class="fas fa-project-diagram"></i>
118
  </div>
119
  <div>
120
- <p class="text-gray-500">Projets en cours</p>
121
  <h3 id="activeProjectsCount" class="text-2xl font-bold">0</h3>
122
  </div>
123
  </div>
124
  </div>
125
- <div class="bg-white p-4 rounded-lg shadow">
126
- <div class="flex items-center">
127
- <div class="p-3 rounded-lg bg-green-100 text-green-600 mr-4">
128
  <i class="fas fa-calendar-day"></i>
129
  </div>
130
  <div>
131
- <p class="text-gray-500">Jours travaillés</p>
132
  <h3 id="daysWorkedCount" class="text-2xl font-bold">0</h3>
133
  </div>
134
  </div>
135
  </div>
136
- <div class="bg-white p-4 rounded-lg shadow">
137
- <div class="flex items-center">
138
- <div class="p-3 rounded-lg bg-purple-100 text-purple-600 mr-4">
139
  <i class="fas fa-euro-sign"></i>
140
  </div>
141
  <div>
142
- <p class="text-gray-500">Revenus HT</p>
143
  <h3 id="totalRevenue" class="text-2xl font-bold">0€</h3>
144
  </div>
145
  </div>
@@ -147,10 +246,10 @@
147
  </div>
148
 
149
  <!-- Chart -->
150
- <div class="bg-white p-4 rounded-lg shadow mb-6">
151
  <div class="flex justify-between items-center mb-4">
152
- <h3 class="font-semibold text-gray-800">Revenus par mois</h3>
153
- <select id="chartRange" class="border rounded px-3 py-1 text-sm">
154
  <option value="3">3 mois</option>
155
  <option value="6">6 mois</option>
156
  <option value="12">12 mois</option>
@@ -160,26 +259,26 @@
160
  </div>
161
 
162
  <!-- Projects Table -->
163
- <div class="bg-white rounded-lg shadow overflow-hidden">
164
- <div class="flex justify-between items-center p-4 border-b">
165
- <h3 class="font-semibold text-gray-800">Mes projets</h3>
166
- <button id="addProjectBtn" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition flex items-center">
167
  <i class="fas fa-plus mr-2"></i> Nouveau projet
168
  </button>
169
  </div>
170
  <div class="overflow-x-auto">
171
- <table class="min-w-full divide-y divide-gray-200">
172
- <thead class="bg-gray-50">
173
  <tr>
174
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Projet</th>
175
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
176
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Jours</th>
177
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Forfait</th>
178
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total HT</th>
179
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
180
  </tr>
181
  </thead>
182
- <tbody id="projectsTableBody" class="bg-white divide-y divide-gray-200">
183
  <!-- Projects will be added here dynamically -->
184
  </tbody>
185
  </table>
@@ -189,28 +288,28 @@
189
 
190
  <!-- Projects Section -->
191
  <section id="projectsSection" class="hidden">
192
- <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
193
- <div class="flex justify-between items-center p-4 border-b">
194
- <h3 class="font-semibold text-gray-800">Tous les projets</h3>
195
- <button id="addProjectBtn2" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition flex items-center">
196
  <i class="fas fa-plus mr-2"></i> Nouveau projet
197
  </button>
198
  </div>
199
  <div class="overflow-x-auto">
200
- <table class="min-w-full divide-y divide-gray-200">
201
- <thead class="bg-gray-50">
202
  <tr>
203
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Projet</th>
204
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
205
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date début</th>
206
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date fin</th>
207
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Jours</th>
208
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total HT</th>
209
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Statut</th>
210
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
211
  </tr>
212
  </thead>
213
- <tbody id="allProjectsTableBody" class="bg-white divide-y divide-gray-200">
214
  <!-- All projects will be added here dynamically -->
215
  </tbody>
216
  </table>
@@ -220,25 +319,25 @@
220
 
221
  <!-- Clients Section -->
222
  <section id="clientsSection" class="hidden">
223
- <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
224
- <div class="flex justify-between items-center p-4 border-b">
225
- <h3 class="font-semibold text-gray-800">Mes clients</h3>
226
- <button id="addClientBtn" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition flex items-center">
227
  <i class="fas fa-plus mr-2"></i> Nouveau client
228
  </button>
229
  </div>
230
  <div class="overflow-x-auto">
231
- <table class="min-w-full divide-y divide-gray-200">
232
- <thead class="bg-gray-50">
233
  <tr>
234
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th>
235
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th>
236
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Adresse</th>
237
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">SIRET</th>
238
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
239
  </tr>
240
  </thead>
241
- <tbody id="clientsTableBody" class="bg-white divide-y divide-gray-200">
242
  <!-- Clients will be added here dynamically -->
243
  </tbody>
244
  </table>
@@ -249,51 +348,51 @@
249
  <!-- Invoices Section -->
250
  <section id="invoicesSection" class="hidden">
251
  <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
252
- <button id="allInvoicesBtn" class="bg-blue-600 text-white p-4 rounded-lg shadow hover:bg-blue-700 transition">
253
- <p class="text-sm">Toutes</p>
254
  <h3 id="allInvoicesCount" class="text-2xl font-bold">0</h3>
255
  </button>
256
- <button id="draftInvoicesBtn" class="bg-gray-200 text-gray-800 p-4 rounded-lg shadow hover:bg-gray-300 transition">
257
- <p class="text-sm">Brouillons</p>
258
  <h3 id="draftInvoicesCount" class="text-2xl font-bold">0</h3>
259
  </button>
260
- <button id="sentInvoicesBtn" class="bg-yellow-100 text-yellow-800 p-4 rounded-lg shadow hover:bg-yellow-200 transition">
261
- <p class="text-sm">Envoyées</p>
262
  <h3 id="sentInvoicesCount" class="text-2xl font-bold">0</h3>
263
  </button>
264
- <button id="paidInvoicesBtn" class="bg-green-100 text-green-800 p-4 rounded-lg shadow hover:bg-green-200 transition">
265
- <p class="text-sm">Payées</p>
266
  <h3 id="paidInvoicesCount" class="text-2xl font-bold">0</h3>
267
  </button>
268
  </div>
269
 
270
- <div class="bg-white rounded-lg shadow overflow-hidden">
271
- <div class="flex justify-between items-center p-4 border-b">
272
- <h3 class="font-semibold text-gray-800">Factures & Devis</h3>
273
  <div class="flex space-x-2">
274
- <button id="addInvoiceBtn" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition flex items-center">
275
  <i class="fas fa-file-invoice-dollar mr-2"></i> Nouvelle facture
276
  </button>
277
- <button id="addQuoteBtn" class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition flex items-center">
278
  <i class="fas fa-file-signature mr-2"></i> Nouveau devis
279
  </button>
280
  </div>
281
  </div>
282
  <div class="overflow-x-auto">
283
- <table class="min-w-full divide-y divide-gray-200">
284
- <thead class="bg-gray-50">
285
  <tr>
286
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Numéro</th>
287
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Client</th>
288
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
289
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Échéance</th>
290
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total HT</th>
291
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Statut</th>
292
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Type</th>
293
- <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
294
  </tr>
295
  </thead>
296
- <tbody id="invoicesTableBody" class="bg-white divide-y divide-gray-200">
297
  <!-- Invoices will be added here dynamically -->
298
  </tbody>
299
  </table>
@@ -303,64 +402,64 @@
303
 
304
  <!-- Settings Section -->
305
  <section id="settingsSection" class="hidden">
306
- <div class="bg-white rounded-lg shadow overflow-hidden p-6">
307
- <h3 class="font-semibold text-gray-800 text-lg mb-6">Paramètres</h3>
308
 
309
  <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
310
  <!-- Personal Info -->
311
- <div class="border rounded-lg p-4">
312
- <h4 class="font-medium text-gray-700 mb-4">Informations personnelles</h4>
313
  <div class="space-y-4">
314
  <div>
315
- <label class="block text-sm text-gray-500 mb-1">Nom complet</label>
316
- <input type="text" id="userName" class="w-full border rounded px-3 py-2">
317
  </div>
318
  <div>
319
- <label class="block text-sm text-gray-500 mb-1">Email</label>
320
- <input type="email" id="userEmail" class="w-full border rounded px-3 py-2">
321
  </div>
322
  <div>
323
- <label class="block text-sm text-gray-500 mb-1">Adresse</label>
324
- <textarea id="userAddress" class="w-full border rounded px-3 py-2"></textarea>
325
  </div>
326
  <div>
327
- <label class="block text-sm text-gray-500 mb-1">SIRET</label>
328
- <input type="text" id="userSiret" class="w-full border rounded px-3 py-2">
329
  </div>
330
- <button id="savePersonalInfoBtn" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
331
  Enregistrer
332
  </button>
333
  </div>
334
  </div>
335
 
336
  <!-- Business Settings -->
337
- <div class="border rounded-lg p-4">
338
- <h4 class="font-medium text-gray-700 mb-4">Paramètres professionnels</h4>
339
  <div class="space-y-4">
340
  <div>
341
- <label class="block text-sm text-gray-500 mb-1">Forfait journalier par défaut (€)</label>
342
- <input type="number" id="defaultRate" class="w-full border rounded px-3 py-2">
343
  </div>
344
  <div>
345
- <label class="block text-sm text-gray-500 mb-1">Conditions de paiement</label>
346
- <input type="text" id="paymentTerms" class="w-full border rounded px-3 py-2" placeholder="Ex: 30 jours net">
347
  </div>
348
  <div>
349
- <label class="block text-sm text-gray-500 mb-1">Logo</label>
350
  <div class="flex items-center space-x-4">
351
- <div class="w-16 h-16 bg-gray-200 rounded-lg flex items-center justify-center overflow-hidden">
352
  <img id="logoPreview" src="" alt="Logo" class="hidden max-w-full max-h-full">
353
- <i class="fas fa-camera text-gray-400"></i>
354
  </div>
355
  <div>
356
  <input type="file" id="logoUpload" class="hidden" accept="image/*">
357
- <button id="uploadLogoBtn" class="text-sm bg-gray-100 hover:bg-gray-200 px-3 py-1 rounded">
358
  Choisir un logo
359
  </button>
360
  </div>
361
  </div>
362
  </div>
363
- <button id="saveBusinessSettingsBtn" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
364
  Enregistrer
365
  </button>
366
  </div>
@@ -374,10 +473,10 @@
374
  <!-- Modals -->
375
  <!-- Add Project Modal -->
376
  <div id="projectModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
377
- <div class="bg-white rounded-lg shadow-xl w-full max-w-md">
378
- <div class="flex justify-between items-center p-4 border-b">
379
  <h3 class="font-semibold text-lg">Nouveau projet</h3>
380
- <button id="closeProjectModal" class="text-gray-500 hover:text-gray-700">
381
  <i class="fas fa-times"></i>
382
  </button>
383
  </div>
@@ -385,46 +484,46 @@
385
  <form id="projectForm">
386
  <div class="space-y-4">
387
  <div>
388
- <label class="block text-sm text-gray-500 mb-1">Nom du projet*</label>
389
- <input type="text" id="projectName" class="w-full border rounded px-3 py-2" required>
390
  </div>
391
  <div>
392
- <label class="block text-sm text-gray-500 mb-1">Client*</label>
393
- <select id="projectClient" class="w-full border rounded px-3 py-2" required>
394
  <option value="">Sélectionner un client</option>
395
  <!-- Clients will be added here dynamically -->
396
  </select>
397
  </div>
398
  <div class="grid grid-cols-2 gap-4">
399
  <div>
400
- <label class="block text-sm text-gray-500 mb-1">Date de début*</label>
401
- <input type="date" id="projectStartDate" class="w-full border rounded px-3 py-2" required>
402
  </div>
403
  <div>
404
- <label class="block text-sm text-gray-500 mb-1">Date de fin</label>
405
- <input type="date" id="projectEndDate" class="w-full border rounded px-3 py-2">
406
  </div>
407
  </div>
408
  <div class="grid grid-cols-2 gap-4">
409
  <div>
410
- <label class="block text-sm text-gray-500 mb-1">Jours travaillés*</label>
411
- <input type="number" id="projectDays" class="w-full border rounded px-3 py-2" required>
412
  </div>
413
  <div>
414
- <label class="block text-sm text-gray-500 mb-1">Forfait journalier (€)*</label>
415
- <input type="number" id="projectRate" class="w-full border rounded px-3 py-2" required>
416
  </div>
417
  </div>
418
  <div>
419
- <label class="block text-sm text-gray-500 mb-1">Description</label>
420
- <textarea id="projectDescription" class="w-full border rounded px-3 py-2"></textarea>
421
  </div>
422
  </div>
423
  <div class="flex justify-end space-x-2 mt-6">
424
- <button type="button" id="cancelProjectBtn" class="px-4 py-2 border rounded-lg hover:bg-gray-100">
425
  Annuler
426
  </button>
427
- <button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
428
  Enregistrer
429
  </button>
430
  </div>
@@ -435,10 +534,10 @@
435
 
436
  <!-- Add Client Modal -->
437
  <div id="clientModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
438
- <div class="bg-white rounded-lg shadow-xl w-full max-w-md">
439
- <div class="flex justify-between items-center p-4 border-b">
440
  <h3 class="font-semibold text-lg">Nouveau client</h3>
441
- <button id="closeClientModal" class="text-gray-500 hover:text-gray-700">
442
  <i class="fas fa-times"></i>
443
  </button>
444
  </div>
@@ -446,31 +545,31 @@
446
  <form id="clientForm">
447
  <div class="space-y-4">
448
  <div>
449
- <label class="block text-sm text-gray-500 mb-1">Nom*</label>
450
- <input type="text" id="clientName" class="w-full border rounded px-3 py-2" required>
451
  </div>
452
  <div>
453
- <label class="block text-sm text-gray-500 mb-1">Email*</label>
454
- <input type="email" id="clientEmail" class="w-full border rounded px-3 py-2" required>
455
  </div>
456
  <div>
457
- <label class="block text-sm text-gray-500 mb-1">Adresse</label>
458
- <textarea id="clientAddress" class="w-full border rounded px-3 py-2"></textarea>
459
  </div>
460
  <div>
461
- <label class="block text-sm text-gray-500 mb-1">SIRET</label>
462
- <input type="text" id="clientSiret" class="w-full border rounded px-3 py-2">
463
  </div>
464
  <div>
465
- <label class="block text-sm text-gray-500 mb-1">Téléphone</label>
466
- <input type="tel" id="clientPhone" class="w-full border rounded px-3 py-2">
467
  </div>
468
  </div>
469
  <div class="flex justify-end space-x-2 mt-6">
470
- <button type="button" id="cancelClientBtn" class="px-4 py-2 border rounded-lg hover:bg-gray-100">
471
  Annuler
472
  </button>
473
- <button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
474
  Enregistrer
475
  </button>
476
  </div>
@@ -481,10 +580,10 @@
481
 
482
  <!-- Add Invoice/Quote Modal -->
483
  <div id="invoiceModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
484
- <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl">
485
- <div class="flex justify-between items-center p-4 border-b">
486
  <h3 id="invoiceModalTitle" class="font-semibold text-lg">Nouvelle facture</h3>
487
- <button id="closeInvoiceModal" class="text-gray-500 hover:text-gray-700">
488
  <i class="fas fa-times"></i>
489
  </button>
490
  </div>
@@ -496,29 +595,29 @@
496
  <div>
497
  <div class="space-y-4">
498
  <div>
499
- <label class="block text-sm text-gray-500 mb-1">Client*</label>
500
- <select id="invoiceClient" class="w-full border rounded px-3 py-2" required>
501
  <option value="">Sélectionner un client</option>
502
  <!-- Clients will be added here dynamically -->
503
  </select>
504
  </div>
505
  <div class="grid grid-cols-2 gap-4">
506
  <div>
507
- <label class="block text-sm text-gray-500 mb-1">Date*</label>
508
- <input type="date" id="invoiceDate" class="w-full border rounded px-3 py-2" required>
509
  </div>
510
  <div>
511
- <label class="block text-sm text-gray-500 mb-1">Échéance</label>
512
- <input type="date" id="invoiceDueDate" class="w-full border rounded px-3 py-2">
513
  </div>
514
  </div>
515
  <div>
516
- <label class="block text-sm text-gray-500 mb-1">Numéro</label>
517
- <input type="text" id="invoiceNumber" class="w-full border rounded px-3 py-2 bg-gray-100" readonly>
518
  </div>
519
  <div>
520
- <label class="block text-sm text-gray-500 mb-1">Statut</label>
521
- <select id="invoiceStatus" class="w-full border rounded px-3 py-2">
522
  <option value="draft">Brouillon</option>
523
  <option value="sent">Envoyé</option>
524
  <option value="paid">Payé</option>
@@ -529,57 +628,57 @@
529
  <div>
530
  <div class="space-y-4">
531
  <div>
532
- <label class="block text-sm text-gray-500 mb-1">Projet associé</label>
533
- <select id="invoiceProject" class="w-full border rounded px-3 py-2">
534
  <option value="">Aucun projet</option>
535
  <!-- Projects will be added here dynamically -->
536
  </select>
537
  </div>
538
  <div>
539
- <label class="block text-sm text-gray-500 mb-1">Conditions de paiement</label>
540
- <input type="text" id="invoicePaymentTerms" class="w-full border rounded px-3 py-2" placeholder="Ex: 30 jours net">
541
  </div>
542
  <div>
543
- <label class="block text-sm text-gray-500 mb-1">Notes</label>
544
- <textarea id="invoiceNotes" class="w-full border rounded px-3 py-2"></textarea>
545
  </div>
546
  </div>
547
  </div>
548
  </div>
549
 
550
  <div class="mt-6">
551
- <h4 class="font-medium text-gray-700 mb-2">Services</h4>
552
  <div class="overflow-x-auto">
553
- <table class="min-w-full divide-y divide-gray-200">
554
- <thead class="bg-gray-50">
555
  <tr>
556
- <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
557
- <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Jours</th>
558
- <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Forfait</th>
559
- <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total</th>
560
- <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"></th>
561
  </tr>
562
  </thead>
563
- <tbody id="invoiceItemsTable" class="bg-white divide-y divide-gray-200">
564
  <tr>
565
- <td class="px-4 py-2"><input type="text" class="w-full border rounded px-2 py-1 invoice-item-desc" placeholder="Description"></td>
566
- <td class="px-4 py-2"><input type="number" class="w-full border rounded px-2 py-1 invoice-item-days" placeholder="Jours"></td>
567
- <td class="px-4 py-2"><input type="number" class="w-full border rounded px-2 py-1 invoice-item-rate" placeholder="Forfait"></td>
568
- <td class="px-4 py-2"><input type="text" class="w-full border rounded px-2 py-1 invoice-item-total bg-gray-100" placeholder="0.00" readonly></td>
569
  <td class="px-4 py-2"><button type="button" class="text-red-500 hover:text-red-700 remove-item-btn"><i class="fas fa-trash"></i></button></td>
570
  </tr>
571
  </tbody>
572
  <tfoot>
573
  <tr>
574
  <td colspan="5" class="px-4 py-2">
575
- <button type="button" id="addInvoiceItemBtn" class="text-blue-600 hover:text-blue-800 text-sm">
576
  <i class="fas fa-plus mr-1"></i> Ajouter un service
577
  </button>
578
  </td>
579
  </tr>
580
  <tr>
581
  <td colspan="3" class="px-4 py-2 text-right font-medium">Total HT</td>
582
- <td colspan="2" class="px-4 py-2"><input type="text" id="invoiceSubtotal" class="w-full border rounded px-2 py-1 bg-gray-100" value="0.00" readonly></td>
583
  </tr>
584
  </tfoot>
585
  </table>
@@ -587,10 +686,10 @@
587
  </div>
588
 
589
  <div class="flex justify-end space-x-2 mt-6">
590
- <button type="button" id="cancelInvoiceBtn" class="px-4 py-2 border rounded-lg hover:bg-gray-100">
591
  Annuler
592
  </button>
593
- <button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition">
594
  Enregistrer
595
  </button>
596
  </div>
@@ -601,17 +700,17 @@
601
 
602
  <!-- Invoice Preview Modal -->
603
  <div id="invoicePreviewModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden overflow-y-auto">
604
- <div class="bg-white rounded-lg shadow-xl w-full max-w-4xl m-4">
605
- <div class="flex justify-between items-center p-4 border-b">
606
  <h3 id="invoicePreviewTitle" class="font-semibold text-lg">Aperçu</h3>
607
  <div class="flex space-x-2">
608
- <button id="printInvoiceBtn" class="bg-gray-200 hover:bg-gray-300 px-3 py-1 rounded flex items-center">
609
  <i class="fas fa-print mr-2"></i> Imprimer
610
  </button>
611
- <button id="downloadPdfBtn" class="bg-blue-600 text-white px-3 py-1 rounded flex items-center hover:bg-blue-700">
612
  <i class="fas fa-file-pdf mr-2"></i> PDF
613
  </button>
614
- <button id="closeInvoicePreview" class="text-gray-500 hover:text-gray-700">
615
  <i class="fas fa-times"></i>
616
  </button>
617
  </div>
@@ -626,31 +725,31 @@
626
 
627
  <!-- CSV Import Modal -->
628
  <div id="csvImportModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
629
- <div class="bg-white rounded-lg shadow-xl w-full max-w-md">
630
- <div class="flex justify-between items-center p-4 border-b">
631
  <h3 class="font-semibold text-lg">Importer des données</h3>
632
- <button id="closeCsvImportModal" class="text-gray-500 hover:text-gray-700">
633
  <i class="fas fa-times"></i>
634
  </button>
635
  </div>
636
  <div class="p-4">
637
  <div class="mb-4">
638
- <p class="text-sm text-gray-600">Sélectionnez un fichier CSV contenant vos projets existants.</p>
639
- <p class="text-xs text-gray-500 mt-1">Colonnes attendues: Projet, Client, Jours travaillés, Forfait journalier</p>
640
  </div>
641
- <div class="border-2 border-dashed border-gray-300 rounded-lg p-6 text-center">
642
  <input type="file" id="csvFileInput" class="hidden" accept=".csv">
643
  <label for="csvFileInput" class="cursor-pointer">
644
- <i class="fas fa-file-csv text-4xl text-gray-400 mb-2"></i>
645
- <p class="text-sm text-gray-600">Glissez-déposez un fichier ou cliquez pour sélectionner</p>
646
- <p id="csvFileName" class="text-xs text-gray-500 mt-2 hidden"></p>
647
  </label>
648
  </div>
649
  <div class="flex justify-end space-x-2 mt-6">
650
- <button type="button" id="cancelCsvImportBtn" class="px-4 py-2 border rounded-lg hover:bg-gray-100">
651
  Annuler
652
  </button>
653
- <button type="button" id="confirmCsvImportBtn" class="bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition disabled:opacity-50" disabled>
654
  Importer
655
  </button>
656
  </div>
@@ -661,6 +760,28 @@
661
  <script>
662
  // Initialize the application when DOM is loaded
663
  document.addEventListener('DOMContentLoaded', function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
664
  // Mobile menu toggle
665
  const mobileMenuButton = document.getElementById('mobileMenuButton');
666
  const sidebar = document.getElementById('sidebar');
@@ -815,25 +936,25 @@
815
  const row = document.createElement('tr');
816
  row.innerHTML = `
817
  <td class="px-6 py-4 whitespace-nowrap">
818
- <div class="font-medium text-gray-900">${project.name}</div>
819
  </td>
820
  <td class="px-6 py-4 whitespace-nowrap">
821
- <div class="text-gray-900">${client.name || '-'}</div>
822
  </td>
823
  <td class="px-6 py-4 whitespace-nowrap">
824
- <div class="text-gray-900">${project.days}</div>
825
  </td>
826
  <td class="px-6 py-4 whitespace-nowrap">
827
- <div class="text-gray-900">${project.rate.toLocaleString('fr-FR')}€</div>
828
  </td>
829
  <td class="px-6 py-4 whitespace-nowrap">
830
- <div class="text-gray-900 font-medium">${total.toLocaleString('fr-FR')}€</div>
831
  </td>
832
  <td class="px-6 py-4 whitespace-nowrap">
833
- <button class="text-blue-600 hover:text-blue-900 mr-2 edit-project-btn" data-id="${project.id}">
834
  <i class="fas fa-edit"></i>
835
  </button>
836
- <button class="text-red-600 hover:text-red-900 delete-project-btn" data-id="${project.id}">
837
  <i class="fas fa-trash"></i>
838
  </button>
839
  </td>
@@ -856,7 +977,7 @@
856
  });
857
  });
858
  }
859
-
860
  function updateRevenueChart() {
861
  const range = parseInt(document.getElementById('chartRange').value);
862
  const now = new Date();
@@ -884,6 +1005,13 @@
884
  window.revenueChart.destroy();
885
  }
886
 
 
 
 
 
 
 
 
887
  window.revenueChart = new Chart(ctx, {
888
  type: 'bar',
889
  data: {
@@ -891,8 +1019,8 @@
891
  datasets: [{
892
  label: 'Revenus HT (€)',
893
  data: revenueData,
894
- backgroundColor: 'rgba(59, 130, 246, 0.5)',
895
- borderColor: 'rgba(59, 130, 246, 1)',
896
  borderWidth: 1
897
  }]
898
  },
@@ -904,7 +1032,19 @@
904
  ticks: {
905
  callback: function(value) {
906
  return value.toLocaleString('fr-FR') + '€';
907
- }
 
 
 
 
 
 
 
 
 
 
 
 
908
  }
909
  }
910
  },
@@ -915,6 +1055,11 @@
915
  return context.dataset.label + ': ' + context.raw.toLocaleString('fr-FR') + '��';
916
  }
917
  }
 
 
 
 
 
918
  }
919
  }
920
  }
@@ -931,38 +1076,38 @@
931
  appData.projects.forEach(project => {
932
  const client = appData.clients.find(c => c.id === project.clientId) || {};
933
  const total = project.days * project.rate;
934
- const statusClass = project.status === 'active' ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800';
935
  const statusText = project.status === 'active' ? 'Actif' : 'Terminé';
936
 
937
  const row = document.createElement('tr');
938
  row.innerHTML = `
939
  <td class="px-6 py-4 whitespace-nowrap">
940
- <div class="font-medium text-gray-900">${project.name}</div>
941
- <div class="text-sm text-gray-500">${project.description || ''}</div>
942
  </td>
943
  <td class="px-6 py-4 whitespace-nowrap">
944
- <div class="text-gray-900">${client.name || '-'}</div>
945
  </td>
946
  <td class="px-6 py-4 whitespace-nowrap">
947
- <div class="text-gray-900">${project.startDate ? new Date(project.startDate).toLocaleDateString('fr-FR') : '-'}</div>
948
  </td>
949
  <td class="px-6 py-4 whitespace-nowrap">
950
- <div class="text-gray-900">${project.endDate ? new Date(project.endDate).toLocaleDateString('fr-FR') : '-'}</div>
951
  </td>
952
  <td class="px-6 py-4 whitespace-nowrap">
953
- <div class="text-gray-900">${project.days}</div>
954
  </td>
955
  <td class="px-6 py-4 whitespace-nowrap">
956
- <div class="text-gray-900 font-medium">${total.toLocaleString('fr-FR')}€</div>
957
  </td>
958
  <td class="px-6 py-4 whitespace-nowrap">
959
  <span class="px-2 py-1 text-xs rounded-full ${statusClass}">${statusText}</span>
960
  </td>
961
  <td class="px-6 py-4 whitespace-nowrap">
962
- <button class="text-blue-600 hover:text-blue-900 mr-2 edit-project-btn" data-id="${project.id}">
963
  <i class="fas fa-edit"></i>
964
  </button>
965
- <button class="text-red-600 hover:text-red-900 delete-project-btn" data-id="${project.id}">
966
  <i class="fas fa-trash"></i>
967
  </button>
968
  </td>
@@ -1119,22 +1264,22 @@
1119
  const row = document.createElement('tr');
1120
  row.innerHTML = `
1121
  <td class="px-6 py-4 whitespace-nowrap">
1122
- <div class="font-medium text-gray-900">${client.name}</div>
1123
  </td>
1124
  <td class="px-6 py-4 whitespace-nowrap">
1125
- <div class="text-gray-900">${client.email}</div>
1126
  </td>
1127
  <td class="px-6 py-4">
1128
- <div class="text-gray-900">${client.address || '-'}</div>
1129
  </td>
1130
  <td class="px-6 py-4 whitespace-nowrap">
1131
- <div class="text-gray-900">${client.siret || '-'}</div>
1132
  </td>
1133
  <td class="px-6 py-4 whitespace-nowrap">
1134
- <button class="text-blue-600 hover:text-blue-900 mr-2 edit-client-btn" data-id="${client.id}">
1135
  <i class="fas fa-edit"></i>
1136
  </button>
1137
- <button class="text-red-600 hover:text-red-900 delete-client-btn" data-id="${client.id}">
1138
  <i class="fas fa-trash"></i>
1139
  </button>
1140
  </td>
@@ -1282,206 +1427,5 @@
1282
  } else if (filter === 'sent') {
1283
  invoicesToShow = appData.invoices.filter(i => i.status === 'sent');
1284
  } else if (filter === 'paid') {
1285
- invoicesToShow = appData.invoices.filter(i => i.status === 'paid');
1286
- }
1287
-
1288
- // Sort by date (newest first)
1289
- invoicesToShow.sort((a, b) => new Date(b.date) - new Date(a.date));
1290
-
1291
- invoicesToShow.forEach(invoice => {
1292
- const client = appData.clients.find(c => c.id === invoice.clientId) || {};
1293
- const project = invoice.projectId ? appData.projects.find(p => p.id === invoice.projectId) : null;
1294
- const total = invoice.items.reduce((sum, item) => sum + item.total, 0);
1295
-
1296
- let statusClass = '';
1297
- let statusText = '';
1298
-
1299
- if (invoice.status === 'draft') {
1300
- statusClass = 'bg-gray-100 text-gray-800';
1301
- statusText = 'Brouillon';
1302
- } else if (invoice.status === 'sent') {
1303
- statusClass = 'bg-yellow-100 text-yellow-800';
1304
- statusText = 'Envoyé';
1305
- } else if (invoice.status === 'paid') {
1306
- statusClass = 'bg-green-100 text-green-800';
1307
- statusText = 'Payé';
1308
- }
1309
-
1310
- const typeText = invoice.type === 'invoice' ? 'Facture' : 'Devis';
1311
- const typeClass = invoice.type === 'invoice' ? 'bg-blue-100 text-blue-800' : 'bg-green-100 text-green-800';
1312
-
1313
- const row = document.createElement('tr');
1314
- row.innerHTML = `
1315
- <td class="px-6 py-4 whitespace-nowrap">
1316
- <div class="font-medium text-gray-900">${invoice.number}</div>
1317
- </td>
1318
- <td class="px-6 py-4 whitespace-nowrap">
1319
- <div class="text-gray-900">${client.name || '-'}</div>
1320
- </td>
1321
- <td class="px-6 py-4 whitespace-nowrap">
1322
- <div class="text-gray-900">${new Date(invoice.date).toLocaleDateString('fr-FR')}</div>
1323
- </td>
1324
- <td class="px-6 py-4 whitespace-nowrap">
1325
- <div class="text-gray-900">${invoice.dueDate ? new Date(invoice.dueDate).toLocaleDateString('fr-FR') : '-'}</div>
1326
- </td>
1327
- <td class="px-6 py-4 whitespace-nowrap">
1328
- <div class="text-gray-900 font-medium">${total.toLocaleString('fr-FR')}€</div>
1329
- </td>
1330
- <td class="px-6 py-4 whitespace-nowrap">
1331
- <span class="px-2 py-1 text-xs rounded-full ${statusClass}">${statusText}</span>
1332
- </td>
1333
- <td class="px-6 py-4 whitespace-nowrap">
1334
- <span class="px-2 py-1 text-xs rounded-full ${typeClass}">${typeText}</span>
1335
- </td>
1336
- <td class="px-6 py-4 whitespace-nowrap">
1337
- <button class="text-blue-600 hover:text-blue-900 mr-2 edit-invoice-btn" data-id="${invoice.id}">
1338
- <i class="fas fa-edit"></i>
1339
- </button>
1340
- <button class="text-purple-600 hover:text-purple-900 mr-2 preview-invoice-btn" data-id="${invoice.id}">
1341
- <i class="fas fa-eye"></i>
1342
- </button>
1343
- <button class="text-red-600 hover:text-red-900 delete-invoice-btn" data-id="${invoice.id}">
1344
- <i class="fas fa-trash"></i>
1345
- </button>
1346
- </td>
1347
- `;
1348
- tableBody.appendChild(row);
1349
- });
1350
-
1351
- // Add event listeners to buttons
1352
- document.querySelectorAll('.edit-invoice-btn').forEach(btn => {
1353
- btn.addEventListener('click', function() {
1354
- openEditInvoiceModal(parseInt(this.getAttribute('data-id')));
1355
- });
1356
- });
1357
-
1358
- document.querySelectorAll('.preview-invoice-btn').forEach(btn => {
1359
- btn.addEventListener('click', function() {
1360
- previewInvoice(parseInt(this.getAttribute('data-id')));
1361
- });
1362
- });
1363
-
1364
- document.querySelectorAll('.delete-invoice-btn').forEach(btn => {
1365
- btn.addEventListener('click', function() {
1366
- if (confirm('Voulez-vous vraiment supprimer ce document ?')) {
1367
- deleteInvoice(parseInt(this.getAttribute('data-id')));
1368
- }
1369
- });
1370
- });
1371
- }
1372
-
1373
- // Filter buttons
1374
- document.getElementById('allInvoicesBtn').addEventListener('click', function() {
1375
- renderInvoicesTable();
1376
- });
1377
-
1378
- document.getElementById('draftInvoicesBtn').addEventListener('click', function() {
1379
- renderInvoicesTable('draft');
1380
- });
1381
-
1382
- document.getElementById('sentInvoicesBtn').addEventListener('click', function() {
1383
- renderInvoicesTable('sent');
1384
- });
1385
-
1386
- document.getElementById('paidInvoicesBtn').addEventListener('click', function() {
1387
- renderInvoicesTable('paid');
1388
- });
1389
-
1390
- // Invoice modal functions
1391
- const invoiceModal = document.getElementById('invoiceModal');
1392
- const invoiceForm = document.getElementById('invoiceForm');
1393
- const closeInvoiceModal = document.getElementById('closeInvoiceModal');
1394
- const cancelInvoiceBtn = document.getElementById('cancelInvoiceBtn');
1395
-
1396
- // Open modal for new invoice or quote
1397
- document.getElementById('addInvoiceBtn').addEventListener('click', function() {
1398
- openNewInvoiceModal('invoice');
1399
- });
1400
-
1401
- document.getElementById('addQuoteBtn').addEventListener('click', function() {
1402
- openNewInvoiceModal('quote');
1403
- });
1404
-
1405
- function openNewInvoiceModal(type) {
1406
- document.getElementById('invoiceForm').reset();
1407
- document.getElementById('invoiceType').value = type;
1408
- document.getElementById('invoiceModalTitle').textContent = type === 'invoice' ? 'Nouvelle facture' : 'Nouveau devis';
1409
- document.getElementById('invoiceId').value = '';
1410
-
1411
- // Generate invoice/quote number
1412
- const now = new Date();
1413
- const year = now.getFullYear();
1414
-
1415
- if (type === 'invoice') {
1416
- const nextNum = appData.nextInvoiceNumber.toString().padStart(3, '0');
1417
- document.getElementById('invoiceNumber').value = `F${year}-${nextNum}`;
1418
- } else {
1419
- const nextNum = appData.nextQuoteNumber.toString().padStart(3, '0');
1420
- document.getElementById('invoiceNumber').value = `D${year}-${nextNum}`;
1421
- }
1422
-
1423
- // Set default date to today
1424
- document.getElementById('invoiceDate').valueAsDate = now;
1425
-
1426
- // Set default payment terms from settings
1427
- document.getElementById('invoicePaymentTerms').value = appData.settings.paymentTerms || '';
1428
-
1429
- // Populate client dropdown
1430
- const clientSelect = document.getElementById('invoiceClient');
1431
- clientSelect.innerHTML = '<option value="">Sélectionner un client</option>';
1432
-
1433
- appData.clients.forEach(client => {
1434
- const option = document.createElement('option');
1435
- option.value = client.id;
1436
- option.textContent = client.name;
1437
- clientSelect.appendChild(option);
1438
- });
1439
-
1440
- // Populate project dropdown
1441
- const projectSelect = document.getElementById('invoiceProject');
1442
- projectSelect.innerHTML = '<option value="">Aucun projet</option>';
1443
-
1444
- appData.projects.forEach(project => {
1445
- const option = document.createElement('option');
1446
- option.value = project.id;
1447
- option.textContent = project.name;
1448
- projectSelect.appendChild(option);
1449
- });
1450
-
1451
- // Clear items table except first row
1452
- const itemsTable = document.getElementById('invoiceItemsTable');
1453
- while (itemsTable.rows.length > 1) {
1454
- itemsTable.deleteRow(1);
1455
- }
1456
-
1457
- // Reset first row
1458
- const firstRow = itemsTable.rows[0];
1459
- firstRow.cells[0].querySelector('input').value = '';
1460
- firstRow.cells[1].querySelector('input').value = '';
1461
- firstRow.cells[2].querySelector('input').value = appData.settings.defaultRate || '';
1462
- firstRow.cells[3].querySelector('input').value = '0.00';
1463
-
1464
- invoiceModal.classList.remove('hidden');
1465
- }
1466
-
1467
- function openEditInvoiceModal(invoiceId) {
1468
- const invoice = appData.invoices.find(i => i.id === invoiceId);
1469
- if (!invoice) return;
1470
-
1471
- document.getElementById('invoiceModalTitle').textContent = invoice.type === 'invoice' ? 'Modifier facture' : 'Modifier devis';
1472
- document.getElementById('invoiceType').value = invoice.type;
1473
- document.getElementById('invoiceId').value = invoice.id;
1474
-
1475
- // Fill basic info
1476
- document.getElementById('invoiceNumber').value = invoice.number;
1477
- document.getElementById('invoiceDate').value = invoice.date;
1478
- document.getElementById('invoiceDueDate').value = invoice.dueDate || '';
1479
- document.getElementById('invoiceStatus').value = invoice.status;
1480
- document.getElementById('invoicePaymentTerms').value = invoice.paymentTerms || '';
1481
- document.getElementById('invoiceNotes').value = invoice.notes || '';
1482
-
1483
- // Populate client dropdown
1484
- const clientSelect = document.getElementById('invoiceClient');
1485
- clientSelect.innerHTML = '<option value="">Sélectionner un client</option>';
1486
-
1487
  </html>
 
9
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
10
  <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
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
+ darkMode: 'class',
15
+ theme: {
16
+ extend: {
17
+ colors: {
18
+ primary: {
19
+ DEFAULT: '#0A84FF',
20
+ dark: '#0984FF'
21
+ },
22
+ secondary: {
23
+ DEFAULT: '#5E5CE6',
24
+ dark: '#5E5CE6'
25
+ },
26
+ background: {
27
+ DEFAULT: '#FFFFFF',
28
+ dark: '#1C1C1E'
29
+ },
30
+ surface: {
31
+ DEFAULT: '#F2F2F7',
32
+ dark: '#2C2C2E'
33
+ },
34
+ card: {
35
+ DEFAULT: '#FFFFFF',
36
+ dark: '#2C2C2E'
37
+ },
38
+ border: {
39
+ DEFAULT: '#D1D1D6',
40
+ dark: '#38383A'
41
+ },
42
+ text: {
43
+ DEFAULT: '#1C1C1E',
44
+ dark: '#FFFFFF'
45
+ },
46
+ subtitle: {
47
+ DEFAULT: '#636366',
48
+ dark: '#8E8E93'
49
+ }
50
+ },
51
+ fontFamily: {
52
+ sans: ['-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', 'sans-serif']
53
+ }
54
+ }
55
+ }
56
+ }
57
+ </script>
58
  <style>
59
+ body {
60
+ @apply bg-background dark:bg-background-dark text-text dark:text-text-dark font-sans;
61
+ -webkit-font-smoothing: antialiased;
62
+ }
63
+
64
  .sidebar {
65
  transition: all 0.3s;
66
+ @apply bg-surface dark:bg-surface-dark border-r border-border dark:border-border-dark;
67
  }
68
+
69
  @media (max-width: 768px) {
70
  .sidebar {
71
  transform: translateX(-100%);
 
74
  transform: translateX(0);
75
  }
76
  }
77
+
78
  .invoice-preview {
79
  width: 210mm;
80
  min-height: 297mm;
81
  margin: auto;
82
  padding: 20mm;
83
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
84
+ @apply bg-card dark:bg-card-dark;
85
+ }
86
+
87
+ /* iOS-like elements */
88
+ .ios-card {
89
+ @apply rounded-xl shadow-sm overflow-hidden border border-border dark:border-border-dark;
90
+ }
91
+
92
+ .ios-button {
93
+ @apply rounded-full px-4 py-2 text-center font-medium text-white bg-primary dark:bg-primary-dark;
94
+ }
95
+
96
+ .ios-segmented-control {
97
+ @apply inline-flex rounded-full p-1 bg-surface dark:bg-surface-dark;
98
+ }
99
+
100
+ .ios-segmented-control button {
101
+ @apply px-4 py-1 rounded-full text-sm font-medium;
102
+ }
103
+
104
+ .ios-segmented-control button.active {
105
+ @apply bg-primary dark:bg-primary-dark text-white;
106
+ }
107
+
108
+ .ios-table-cell {
109
+ @apply px-4 py-3 border-b border-border dark:border-border-dark;
110
+ }
111
+
112
+ .ios-badge {
113
+ @apply rounded-full px-2 py-0.5 text-xs font-medium;
114
+ }
115
+
116
+ /* Dark mode toggle */
117
+ .dark-mode-toggle {
118
+ @apply w-12 h-6 rounded-full p-1 bg-gray-300 dark:bg-gray-600 flex items-center transition duration-300;
119
+ }
120
+
121
+ .dark-mode-toggle span {
122
+ @apply w-4 h-4 rounded-full bg-white dark:bg-gray-800 shadow-md transform transition duration-300 translate-x-0 dark:translate-x-6;
123
  }
124
  </style>
125
  </head>
126
+ <body class="dark:bg-background-dark">
127
+ <!-- Dark Mode Toggle -->
128
+ <div class="fixed top-4 right-4 z-50">
129
+ <button id="darkModeToggle" class="dark-mode-toggle">
130
+ <span></span>
131
+ </button>
132
+ </div>
133
+
134
  <!-- Mobile Menu Button -->
135
+ <button id="mobileMenuButton" class="md:hidden fixed top-4 left-4 z-40 bg-primary dark:bg-primary-dark text-white p-2 rounded-full">
136
  <i class="fas fa-bars"></i>
137
  </button>
138
 
139
  <!-- Sidebar -->
140
+ <div id="sidebar" class="sidebar fixed top-0 left-0 h-full w-64 p-4 z-30">
141
  <div class="flex items-center mb-8">
142
+ <div class="bg-primary dark:bg-primary-dark text-white rounded-xl p-3 mr-3">
143
+ <i class="fas fa-chart-line text-xl"></i>
144
  </div>
145
  <h1 class="text-2xl font-bold">Samfact</h1>
146
  </div>
147
 
148
  <nav>
149
+ <ul class="space-y-1">
150
  <li>
151
+ <a href="#" id="dashboardLink" class="flex items-center p-3 rounded-lg hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
152
+ <i class="fas fa-home mr-3 text-subtitle dark:text-subtitle-dark"></i> Tableau de bord
153
  </a>
154
  </li>
155
  <li>
156
+ <a href="#" id="projectsLink" class="flex items-center p-3 rounded-lg hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
157
+ <i class="fas fa-project-diagram mr-3 text-subtitle dark:text-subtitle-dark"></i> Projets
158
  </a>
159
  </li>
160
  <li>
161
+ <a href="#" id="clientsLink" class="flex items-center p-3 rounded-lg hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
162
+ <i class="fas fa-users mr-3 text-subtitle dark:text-subtitle-dark"></i> Clients
163
  </a>
164
  </li>
165
  <li>
166
+ <a href="#" id="invoicesLink" class="flex items-center p-3 rounded-lg hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
167
+ <i class="fas fa-file-invoice-dollar mr-3 text-subtitle dark:text-subtitle-dark"></i> Factures & Devis
168
  </a>
169
  </li>
170
  <li>
171
+ <a href="#" id="settingsLink" class="flex items-center p-3 rounded-lg hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
172
+ <i class="fas fa-cog mr-3 text-subtitle dark:text-subtitle-dark"></i> Paramètres
173
  </a>
174
  </li>
175
  </ul>
176
  </nav>
177
 
178
  <div class="absolute bottom-0 left-0 w-full p-4">
179
+ <div class="bg-surface dark:bg-surface-dark p-3 rounded-xl">
180
+ <p class="text-sm text-subtitle dark:text-subtitle-dark">Auto-entrepreneur</p>
181
  <p class="font-semibold">Data Analyse</p>
182
  </div>
183
  </div>
 
186
  <!-- Main Content -->
187
  <div class="ml-0 md:ml-64 transition-all duration-300">
188
  <!-- Header -->
189
+ <header class="bg-card dark:bg-card-dark border-b border-border dark:border-border-dark p-4 flex justify-between items-center">
190
+ <h2 id="pageTitle" class="text-xl font-semibold">Tableau de bord</h2>
191
  <div class="flex items-center space-x-4">
192
  <div class="relative">
193
+ <button class="bg-surface dark:bg-surface-dark p-2 rounded-full hover:bg-surface dark:hover:bg-surface-dark transition">
194
+ <i class="fas fa-bell text-subtitle dark:text-subtitle-dark"></i>
195
  </button>
196
  <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span>
197
  </div>
198
  <div class="flex items-center">
199
+ <div class="w-8 h-8 rounded-full bg-primary dark:bg-primary-dark flex items-center justify-center text-white">
200
  <i class="fas fa-user"></i>
201
  </div>
202
  <span class="ml-2 font-medium hidden md:inline">Sam</span>
 
210
  <section id="dashboardSection">
211
  <!-- Stats Cards -->
212
  <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
213
+ <div class="ios-card">
214
+ <div class="flex items-center p-4">
215
+ <div class="p-3 rounded-lg bg-blue-100 dark:bg-blue-900 text-blue-600 dark:text-blue-400 mr-4">
216
  <i class="fas fa-project-diagram"></i>
217
  </div>
218
  <div>
219
+ <p class="text-subtitle dark:text-subtitle-dark">Projets en cours</p>
220
  <h3 id="activeProjectsCount" class="text-2xl font-bold">0</h3>
221
  </div>
222
  </div>
223
  </div>
224
+ <div class="ios-card">
225
+ <div class="flex items-center p-4">
226
+ <div class="p-3 rounded-lg bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 mr-4">
227
  <i class="fas fa-calendar-day"></i>
228
  </div>
229
  <div>
230
+ <p class="text-subtitle dark:text-subtitle-dark">Jours travaillés</p>
231
  <h3 id="daysWorkedCount" class="text-2xl font-bold">0</h3>
232
  </div>
233
  </div>
234
  </div>
235
+ <div class="ios-card">
236
+ <div class="flex items-center p-4">
237
+ <div class="p-3 rounded-lg bg-purple-100 dark:bg-purple-900 text-purple-600 dark:text-purple-400 mr-4">
238
  <i class="fas fa-euro-sign"></i>
239
  </div>
240
  <div>
241
+ <p class="text-subtitle dark:text-subtitle-dark">Revenus HT</p>
242
  <h3 id="totalRevenue" class="text-2xl font-bold">0€</h3>
243
  </div>
244
  </div>
 
246
  </div>
247
 
248
  <!-- Chart -->
249
+ <div class="ios-card p-4 mb-6">
250
  <div class="flex justify-between items-center mb-4">
251
+ <h3 class="font-semibold">Revenus par mois</h3>
252
+ <select id="chartRange" class="border border-border dark:border-border-dark rounded-full px-3 py-1 text-sm bg-card dark:bg-card-dark">
253
  <option value="3">3 mois</option>
254
  <option value="6">6 mois</option>
255
  <option value="12">12 mois</option>
 
259
  </div>
260
 
261
  <!-- Projects Table -->
262
+ <div class="ios-card overflow-hidden">
263
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
264
+ <h3 class="font-semibold">Mes projets</h3>
265
+ <button id="addProjectBtn" class="ios-button flex items-center">
266
  <i class="fas fa-plus mr-2"></i> Nouveau projet
267
  </button>
268
  </div>
269
  <div class="overflow-x-auto">
270
+ <table class="min-w-full divide-y divide-border dark:divide-border-dark">
271
+ <thead class="bg-surface dark:bg-surface-dark">
272
  <tr>
273
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Projet</th>
274
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Client</th>
275
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Jours</th>
276
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Forfait</th>
277
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Total HT</th>
278
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Actions</th>
279
  </tr>
280
  </thead>
281
+ <tbody id="projectsTableBody" class="divide-y divide-border dark:divide-border-dark">
282
  <!-- Projects will be added here dynamically -->
283
  </tbody>
284
  </table>
 
288
 
289
  <!-- Projects Section -->
290
  <section id="projectsSection" class="hidden">
291
+ <div class="ios-card overflow-hidden mb-6">
292
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
293
+ <h3 class="font-semibold">Tous les projets</h3>
294
+ <button id="addProjectBtn2" class="ios-button flex items-center">
295
  <i class="fas fa-plus mr-2"></i> Nouveau projet
296
  </button>
297
  </div>
298
  <div class="overflow-x-auto">
299
+ <table class="min-w-full divide-y divide-border dark:divide-border-dark">
300
+ <thead class="bg-surface dark:bg-surface-dark">
301
  <tr>
302
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Projet</th>
303
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Client</th>
304
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Date début</th>
305
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Date fin</th>
306
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Jours</th>
307
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Total HT</th>
308
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Statut</th>
309
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Actions</th>
310
  </tr>
311
  </thead>
312
+ <tbody id="allProjectsTableBody" class="divide-y divide-border dark:divide-border-dark">
313
  <!-- All projects will be added here dynamically -->
314
  </tbody>
315
  </table>
 
319
 
320
  <!-- Clients Section -->
321
  <section id="clientsSection" class="hidden">
322
+ <div class="ios-card overflow-hidden mb-6">
323
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
324
+ <h3 class="font-semibold">Mes clients</h3>
325
+ <button id="addClientBtn" class="ios-button flex items-center">
326
  <i class="fas fa-plus mr-2"></i> Nouveau client
327
  </button>
328
  </div>
329
  <div class="overflow-x-auto">
330
+ <table class="min-w-full divide-y divide-border dark:divide-border-dark">
331
+ <thead class="bg-surface dark:bg-surface-dark">
332
  <tr>
333
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Nom</th>
334
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Email</th>
335
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Adresse</th>
336
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">SIRET</th>
337
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Actions</th>
338
  </tr>
339
  </thead>
340
+ <tbody id="clientsTableBody" class="divide-y divide-border dark:divide-border-dark">
341
  <!-- Clients will be added here dynamically -->
342
  </tbody>
343
  </table>
 
348
  <!-- Invoices Section -->
349
  <section id="invoicesSection" class="hidden">
350
  <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
351
+ <button id="allInvoicesBtn" class="ios-card p-4 text-left hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
352
+ <p class="text-sm text-subtitle dark:text-subtitle-dark">Toutes</p>
353
  <h3 id="allInvoicesCount" class="text-2xl font-bold">0</h3>
354
  </button>
355
+ <button id="draftInvoicesBtn" class="ios-card p-4 text-left hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
356
+ <p class="text-sm text-subtitle dark:text-subtitle-dark">Brouillons</p>
357
  <h3 id="draftInvoicesCount" class="text-2xl font-bold">0</h3>
358
  </button>
359
+ <button id="sentInvoicesBtn" class="ios-card p-4 text-left hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
360
+ <p class="text-sm text-subtitle dark:text-subtitle-dark">Envoyées</p>
361
  <h3 id="sentInvoicesCount" class="text-2xl font-bold">0</h3>
362
  </button>
363
+ <button id="paidInvoicesBtn" class="ios-card p-4 text-left hover:bg-surface dark:hover:bg-surface-dark transition active:bg-surface dark:active:bg-surface-dark">
364
+ <p class="text-sm text-subtitle dark:text-subtitle-dark">Payées</p>
365
  <h3 id="paidInvoicesCount" class="text-2xl font-bold">0</h3>
366
  </button>
367
  </div>
368
 
369
+ <div class="ios-card overflow-hidden">
370
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
371
+ <h3 class="font-semibold">Factures & Devis</h3>
372
  <div class="flex space-x-2">
373
+ <button id="addInvoiceBtn" class="ios-button flex items-center">
374
  <i class="fas fa-file-invoice-dollar mr-2"></i> Nouvelle facture
375
  </button>
376
+ <button id="addQuoteBtn" class="bg-secondary dark:bg-secondary-dark text-white px-4 py-2 rounded-full hover:bg-opacity-90 transition flex items-center">
377
  <i class="fas fa-file-signature mr-2"></i> Nouveau devis
378
  </button>
379
  </div>
380
  </div>
381
  <div class="overflow-x-auto">
382
+ <table class="min-w-full divide-y divide-border dark:divide-border-dark">
383
+ <thead class="bg-surface dark:bg-surface-dark">
384
  <tr>
385
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Numéro</th>
386
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Client</th>
387
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Date</th>
388
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Échéance</th>
389
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Total HT</th>
390
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Statut</th>
391
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Type</th>
392
+ <th class="px-6 py-3 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Actions</th>
393
  </tr>
394
  </thead>
395
+ <tbody id="invoicesTableBody" class="divide-y divide-border dark:divide-border-dark">
396
  <!-- Invoices will be added here dynamically -->
397
  </tbody>
398
  </table>
 
402
 
403
  <!-- Settings Section -->
404
  <section id="settingsSection" class="hidden">
405
+ <div class="ios-card overflow-hidden p-6">
406
+ <h3 class="font-semibold text-lg mb-6">Paramètres</h3>
407
 
408
  <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
409
  <!-- Personal Info -->
410
+ <div class="ios-card p-4">
411
+ <h4 class="font-medium mb-4">Informations personnelles</h4>
412
  <div class="space-y-4">
413
  <div>
414
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Nom complet</label>
415
+ <input type="text" id="userName" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
416
  </div>
417
  <div>
418
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Email</label>
419
+ <input type="email" id="userEmail" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
420
  </div>
421
  <div>
422
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Adresse</label>
423
+ <textarea id="userAddress" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark"></textarea>
424
  </div>
425
  <div>
426
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">SIRET</label>
427
+ <input type="text" id="userSiret" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
428
  </div>
429
+ <button id="savePersonalInfoBtn" class="ios-button w-full">
430
  Enregistrer
431
  </button>
432
  </div>
433
  </div>
434
 
435
  <!-- Business Settings -->
436
+ <div class="ios-card p-4">
437
+ <h4 class="font-medium mb-4">Paramètres professionnels</h4>
438
  <div class="space-y-4">
439
  <div>
440
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Forfait journalier par défaut (€)</label>
441
+ <input type="number" id="defaultRate" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
442
  </div>
443
  <div>
444
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Conditions de paiement</label>
445
+ <input type="text" id="paymentTerms" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" placeholder="Ex: 30 jours net">
446
  </div>
447
  <div>
448
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Logo</label>
449
  <div class="flex items-center space-x-4">
450
+ <div class="w-16 h-16 bg-surface dark:bg-surface-dark rounded-lg flex items-center justify-center overflow-hidden">
451
  <img id="logoPreview" src="" alt="Logo" class="hidden max-w-full max-h-full">
452
+ <i class="fas fa-camera text-subtitle dark:text-subtitle-dark"></i>
453
  </div>
454
  <div>
455
  <input type="file" id="logoUpload" class="hidden" accept="image/*">
456
+ <button id="uploadLogoBtn" class="text-sm bg-surface dark:bg-surface-dark hover:bg-opacity-80 px-3 py-1 rounded-lg">
457
  Choisir un logo
458
  </button>
459
  </div>
460
  </div>
461
  </div>
462
+ <button id="saveBusinessSettingsBtn" class="ios-button w-full">
463
  Enregistrer
464
  </button>
465
  </div>
 
473
  <!-- Modals -->
474
  <!-- Add Project Modal -->
475
  <div id="projectModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
476
+ <div class="ios-card w-full max-w-md">
477
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
478
  <h3 class="font-semibold text-lg">Nouveau projet</h3>
479
+ <button id="closeProjectModal" class="text-subtitle dark:text-subtitle-dark hover:text-text dark:hover:text-text-dark">
480
  <i class="fas fa-times"></i>
481
  </button>
482
  </div>
 
484
  <form id="projectForm">
485
  <div class="space-y-4">
486
  <div>
487
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Nom du projet*</label>
488
+ <input type="text" id="projectName" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
489
  </div>
490
  <div>
491
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Client*</label>
492
+ <select id="projectClient" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
493
  <option value="">Sélectionner un client</option>
494
  <!-- Clients will be added here dynamically -->
495
  </select>
496
  </div>
497
  <div class="grid grid-cols-2 gap-4">
498
  <div>
499
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Date de début*</label>
500
+ <input type="date" id="projectStartDate" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
501
  </div>
502
  <div>
503
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Date de fin</label>
504
+ <input type="date" id="projectEndDate" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
505
  </div>
506
  </div>
507
  <div class="grid grid-cols-2 gap-4">
508
  <div>
509
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Jours travaillés*</label>
510
+ <input type="number" id="projectDays" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
511
  </div>
512
  <div>
513
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Forfait journalier (€)*</label>
514
+ <input type="number" id="projectRate" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
515
  </div>
516
  </div>
517
  <div>
518
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Description</label>
519
+ <textarea id="projectDescription" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark"></textarea>
520
  </div>
521
  </div>
522
  <div class="flex justify-end space-x-2 mt-6">
523
+ <button type="button" id="cancelProjectBtn" class="px-4 py-2 border border-border dark:border-border-dark rounded-lg hover:bg-surface dark:hover:bg-surface-dark">
524
  Annuler
525
  </button>
526
+ <button type="submit" class="ios-button">
527
  Enregistrer
528
  </button>
529
  </div>
 
534
 
535
  <!-- Add Client Modal -->
536
  <div id="clientModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
537
+ <div class="ios-card w-full max-w-md">
538
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
539
  <h3 class="font-semibold text-lg">Nouveau client</h3>
540
+ <button id="closeClientModal" class="text-subtitle dark:text-subtitle-dark hover:text-text dark:hover:text-text-dark">
541
  <i class="fas fa-times"></i>
542
  </button>
543
  </div>
 
545
  <form id="clientForm">
546
  <div class="space-y-4">
547
  <div>
548
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Nom*</label>
549
+ <input type="text" id="clientName" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
550
  </div>
551
  <div>
552
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Email*</label>
553
+ <input type="email" id="clientEmail" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
554
  </div>
555
  <div>
556
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Adresse</label>
557
+ <textarea id="clientAddress" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark"></textarea>
558
  </div>
559
  <div>
560
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">SIRET</label>
561
+ <input type="text" id="clientSiret" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
562
  </div>
563
  <div>
564
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Téléphone</label>
565
+ <input type="tel" id="clientPhone" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
566
  </div>
567
  </div>
568
  <div class="flex justify-end space-x-2 mt-6">
569
+ <button type="button" id="cancelClientBtn" class="px-4 py-2 border border-border dark:border-border-dark rounded-lg hover:bg-surface dark:hover:bg-surface-dark">
570
  Annuler
571
  </button>
572
+ <button type="submit" class="ios-button">
573
  Enregistrer
574
  </button>
575
  </div>
 
580
 
581
  <!-- Add Invoice/Quote Modal -->
582
  <div id="invoiceModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
583
+ <div class="ios-card w-full max-w-4xl">
584
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
585
  <h3 id="invoiceModalTitle" class="font-semibold text-lg">Nouvelle facture</h3>
586
+ <button id="closeInvoiceModal" class="text-subtitle dark:text-subtitle-dark hover:text-text dark:hover:text-text-dark">
587
  <i class="fas fa-times"></i>
588
  </button>
589
  </div>
 
595
  <div>
596
  <div class="space-y-4">
597
  <div>
598
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Client*</label>
599
+ <select id="invoiceClient" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
600
  <option value="">Sélectionner un client</option>
601
  <!-- Clients will be added here dynamically -->
602
  </select>
603
  </div>
604
  <div class="grid grid-cols-2 gap-4">
605
  <div>
606
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Date*</label>
607
+ <input type="date" id="invoiceDate" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" required>
608
  </div>
609
  <div>
610
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Échéance</label>
611
+ <input type="date" id="invoiceDueDate" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
612
  </div>
613
  </div>
614
  <div>
615
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Numéro</label>
616
+ <input type="text" id="invoiceNumber" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" readonly>
617
  </div>
618
  <div>
619
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Statut</label>
620
+ <select id="invoiceStatus" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
621
  <option value="draft">Brouillon</option>
622
  <option value="sent">Envoyé</option>
623
  <option value="paid">Payé</option>
 
628
  <div>
629
  <div class="space-y-4">
630
  <div>
631
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Projet associé</label>
632
+ <select id="invoiceProject" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark">
633
  <option value="">Aucun projet</option>
634
  <!-- Projects will be added here dynamically -->
635
  </select>
636
  </div>
637
  <div>
638
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Conditions de paiement</label>
639
+ <input type="text" id="invoicePaymentTerms" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark" placeholder="Ex: 30 jours net">
640
  </div>
641
  <div>
642
+ <label class="block text-sm text-subtitle dark:text-subtitle-dark mb-1">Notes</label>
643
+ <textarea id="invoiceNotes" class="w-full border border-border dark:border-border-dark rounded-lg px-3 py-2 bg-card dark:bg-card-dark"></textarea>
644
  </div>
645
  </div>
646
  </div>
647
  </div>
648
 
649
  <div class="mt-6">
650
+ <h4 class="font-medium mb-2">Services</h4>
651
  <div class="overflow-x-auto">
652
+ <table class="min-w-full divide-y divide-border dark:divide-border-dark">
653
+ <thead class="bg-surface dark:bg-surface-dark">
654
  <tr>
655
+ <th class="px-4 py-2 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Description</th>
656
+ <th class="px-4 py-2 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Jours</th>
657
+ <th class="px-4 py-2 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Forfait</th>
658
+ <th class="px-4 py-2 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider">Total</th>
659
+ <th class="px-4 py-2 text-left text-xs font-medium text-subtitle dark:text-subtitle-dark uppercase tracking-wider"></th>
660
  </tr>
661
  </thead>
662
+ <tbody id="invoiceItemsTable" class="divide-y divide-border dark:divide-border-dark">
663
  <tr>
664
+ <td class="px-4 py-2"><input type="text" class="w-full border border-border dark:border-border-dark rounded-lg px-2 py-1 bg-card dark:bg-card-dark invoice-item-desc" placeholder="Description"></td>
665
+ <td class="px-4 py-2"><input type="number" class="w-full border border-border dark:border-border-dark rounded-lg px-2 py-1 bg-card dark:bg-card-dark invoice-item-days" placeholder="Jours"></td>
666
+ <td class="px-4 py-2"><input type="number" class="w-full border border-border dark:border-border-dark rounded-lg px-2 py-1 bg-card dark:bg-card-dark invoice-item-rate" placeholder="Forfait"></td>
667
+ <td class="px-4 py-2"><input type="text" class="w-full border border-border dark:border-border-dark rounded-lg px-2 py-1 bg-card dark:bg-card-dark invoice-item-total" placeholder="0.00" readonly></td>
668
  <td class="px-4 py-2"><button type="button" class="text-red-500 hover:text-red-700 remove-item-btn"><i class="fas fa-trash"></i></button></td>
669
  </tr>
670
  </tbody>
671
  <tfoot>
672
  <tr>
673
  <td colspan="5" class="px-4 py-2">
674
+ <button type="button" id="addInvoiceItemBtn" class="text-primary dark:text-primary-dark hover:text-opacity-80 text-sm">
675
  <i class="fas fa-plus mr-1"></i> Ajouter un service
676
  </button>
677
  </td>
678
  </tr>
679
  <tr>
680
  <td colspan="3" class="px-4 py-2 text-right font-medium">Total HT</td>
681
+ <td colspan="2" class="px-4 py-2"><input type="text" id="invoiceSubtotal" class="w-full border border-border dark:border-border-dark rounded-lg px-2 py-1 bg-card dark:bg-card-dark" value="0.00" readonly></td>
682
  </tr>
683
  </tfoot>
684
  </table>
 
686
  </div>
687
 
688
  <div class="flex justify-end space-x-2 mt-6">
689
+ <button type="button" id="cancelInvoiceBtn" class="px-4 py-2 border border-border dark:border-border-dark rounded-lg hover:bg-surface dark:hover:bg-surface-dark">
690
  Annuler
691
  </button>
692
+ <button type="submit" class="ios-button">
693
  Enregistrer
694
  </button>
695
  </div>
 
700
 
701
  <!-- Invoice Preview Modal -->
702
  <div id="invoicePreviewModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden overflow-y-auto">
703
+ <div class="ios-card w-full max-w-4xl m-4">
704
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
705
  <h3 id="invoicePreviewTitle" class="font-semibold text-lg">Aperçu</h3>
706
  <div class="flex space-x-2">
707
+ <button id="printInvoiceBtn" class="bg-surface dark:bg-surface-dark hover:bg-opacity-80 px-3 py-1 rounded-lg flex items-center">
708
  <i class="fas fa-print mr-2"></i> Imprimer
709
  </button>
710
+ <button id="downloadPdfBtn" class="ios-button px-3 py-1 flex items-center">
711
  <i class="fas fa-file-pdf mr-2"></i> PDF
712
  </button>
713
+ <button id="closeInvoicePreview" class="text-subtitle dark:text-subtitle-dark hover:text-text dark:hover:text-text-dark">
714
  <i class="fas fa-times"></i>
715
  </button>
716
  </div>
 
725
 
726
  <!-- CSV Import Modal -->
727
  <div id="csvImportModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
728
+ <div class="ios-card w-full max-w-md">
729
+ <div class="flex justify-between items-center p-4 border-b border-border dark:border-border-dark">
730
  <h3 class="font-semibold text-lg">Importer des données</h3>
731
+ <button id="closeCsvImportModal" class="text-subtitle dark:text-subtitle-dark hover:text-text dark:hover:text-text-dark">
732
  <i class="fas fa-times"></i>
733
  </button>
734
  </div>
735
  <div class="p-4">
736
  <div class="mb-4">
737
+ <p class="text-sm text-subtitle dark:text-subtitle-dark">Sélectionnez un fichier CSV contenant vos projets existants.</p>
738
+ <p class="text-xs text-subtitle dark:text-subtitle-dark mt-1">Colonnes attendues: Projet, Client, Jours travaillés, Forfait journalier</p>
739
  </div>
740
+ <div class="border-2 border-dashed border-border dark:border-border-dark rounded-lg p-6 text-center">
741
  <input type="file" id="csvFileInput" class="hidden" accept=".csv">
742
  <label for="csvFileInput" class="cursor-pointer">
743
+ <i class="fas fa-file-csv text-4xl text-subtitle dark:text-subtitle-dark mb-2"></i>
744
+ <p class="text-sm text-subtitle dark:text-subtitle-dark">Glissez-déposez un fichier ou cliquez pour sélectionner</p>
745
+ <p id="csvFileName" class="text-xs text-subtitle dark:text-subtitle-dark mt-2 hidden"></p>
746
  </label>
747
  </div>
748
  <div class="flex justify-end space-x-2 mt-6">
749
+ <button type="button" id="cancelCsvImportBtn" class="px-4 py-2 border border-border dark:border-border-dark rounded-lg hover:bg-surface dark:hover:bg-surface-dark">
750
  Annuler
751
  </button>
752
+ <button type="button" id="confirmCsvImportBtn" class="ios-button disabled:opacity-50" disabled>
753
  Importer
754
  </button>
755
  </div>
 
760
  <script>
761
  // Initialize the application when DOM is loaded
762
  document.addEventListener('DOMContentLoaded', function() {
763
+ // Dark mode toggle
764
+ const darkModeToggle = document.getElementById('darkModeToggle');
765
+ const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
766
+
767
+ // Check localStorage for dark mode preference
768
+ if (localStorage.getItem('darkMode') === 'enabled' ||
769
+ (!localStorage.getItem('darkMode') && prefersDarkScheme.matches)) {
770
+ document.documentElement.classList.add('dark');
771
+ darkModeToggle.classList.add('bg-primary-dark');
772
+ }
773
+
774
+ darkModeToggle.addEventListener('click', function() {
775
+ document.documentElement.classList.toggle('dark');
776
+ if (document.documentElement.classList.contains('dark')) {
777
+ localStorage.setItem('darkMode', 'enabled');
778
+ darkModeToggle.classList.add('bg-primary-dark');
779
+ } else {
780
+ localStorage.setItem('darkMode', 'disabled');
781
+ darkModeToggle.classList.remove('bg-primary-dark');
782
+ }
783
+ });
784
+
785
  // Mobile menu toggle
786
  const mobileMenuButton = document.getElementById('mobileMenuButton');
787
  const sidebar = document.getElementById('sidebar');
 
936
  const row = document.createElement('tr');
937
  row.innerHTML = `
938
  <td class="px-6 py-4 whitespace-nowrap">
939
+ <div class="font-medium">${project.name}</div>
940
  </td>
941
  <td class="px-6 py-4 whitespace-nowrap">
942
+ <div>${client.name || '-'}</div>
943
  </td>
944
  <td class="px-6 py-4 whitespace-nowrap">
945
+ <div>${project.days}</div>
946
  </td>
947
  <td class="px-6 py-4 whitespace-nowrap">
948
+ <div>${project.rate.toLocaleString('fr-FR')}€</div>
949
  </td>
950
  <td class="px-6 py-4 whitespace-nowrap">
951
+ <div class="font-medium">${total.toLocaleString('fr-FR')}€</div>
952
  </td>
953
  <td class="px-6 py-4 whitespace-nowrap">
954
+ <button class="text-primary dark:text-primary-dark hover:text-opacity-80 mr-2 edit-project-btn" data-id="${project.id}">
955
  <i class="fas fa-edit"></i>
956
  </button>
957
+ <button class="text-red-500 hover:text-red-700 delete-project-btn" data-id="${project.id}">
958
  <i class="fas fa-trash"></i>
959
  </button>
960
  </td>
 
977
  });
978
  });
979
  }
980
+
981
  function updateRevenueChart() {
982
  const range = parseInt(document.getElementById('chartRange').value);
983
  const now = new Date();
 
1005
  window.revenueChart.destroy();
1006
  }
1007
 
1008
+ // Set chart colors based on dark mode
1009
+ const isDarkMode = document.documentElement.classList.contains('dark');
1010
+ const bgColor = isDarkMode ? 'rgba(59, 130, 246, 0.5)' : 'rgba(10, 132, 255, 0.5)';
1011
+ const borderColor = isDarkMode ? 'rgba(59, 130, 246, 1)' : 'rgba(10, 132, 255, 1)';
1012
+ const textColor = isDarkMode ? '#FFFFFF' : '#1C1C1E';
1013
+ const gridColor = isDarkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)';
1014
+
1015
  window.revenueChart = new Chart(ctx, {
1016
  type: 'bar',
1017
  data: {
 
1019
  datasets: [{
1020
  label: 'Revenus HT (€)',
1021
  data: revenueData,
1022
+ backgroundColor: bgColor,
1023
+ borderColor: borderColor,
1024
  borderWidth: 1
1025
  }]
1026
  },
 
1032
  ticks: {
1033
  callback: function(value) {
1034
  return value.toLocaleString('fr-FR') + '€';
1035
+ },
1036
+ color: textColor
1037
+ },
1038
+ grid: {
1039
+ color: gridColor
1040
+ }
1041
+ },
1042
+ x: {
1043
+ ticks: {
1044
+ color: textColor
1045
+ },
1046
+ grid: {
1047
+ color: gridColor
1048
  }
1049
  }
1050
  },
 
1055
  return context.dataset.label + ': ' + context.raw.toLocaleString('fr-FR') + '��';
1056
  }
1057
  }
1058
+ },
1059
+ legend: {
1060
+ labels: {
1061
+ color: textColor
1062
+ }
1063
  }
1064
  }
1065
  }
 
1076
  appData.projects.forEach(project => {
1077
  const client = appData.clients.find(c => c.id === project.clientId) || {};
1078
  const total = project.days * project.rate;
1079
+ const statusClass = project.status === 'active' ? 'bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200' : 'bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200';
1080
  const statusText = project.status === 'active' ? 'Actif' : 'Terminé';
1081
 
1082
  const row = document.createElement('tr');
1083
  row.innerHTML = `
1084
  <td class="px-6 py-4 whitespace-nowrap">
1085
+ <div class="font-medium">${project.name}</div>
1086
+ <div class="text-sm text-subtitle dark:text-subtitle-dark">${project.description || ''}</div>
1087
  </td>
1088
  <td class="px-6 py-4 whitespace-nowrap">
1089
+ <div>${client.name || '-'}</div>
1090
  </td>
1091
  <td class="px-6 py-4 whitespace-nowrap">
1092
+ <div>${project.startDate ? new Date(project.startDate).toLocaleDateString('fr-FR') : '-'}</div>
1093
  </td>
1094
  <td class="px-6 py-4 whitespace-nowrap">
1095
+ <div>${project.endDate ? new Date(project.endDate).toLocaleDateString('fr-FR') : '-'}</div>
1096
  </td>
1097
  <td class="px-6 py-4 whitespace-nowrap">
1098
+ <div>${project.days}</div>
1099
  </td>
1100
  <td class="px-6 py-4 whitespace-nowrap">
1101
+ <div class="font-medium">${total.toLocaleString('fr-FR')}€</div>
1102
  </td>
1103
  <td class="px-6 py-4 whitespace-nowrap">
1104
  <span class="px-2 py-1 text-xs rounded-full ${statusClass}">${statusText}</span>
1105
  </td>
1106
  <td class="px-6 py-4 whitespace-nowrap">
1107
+ <button class="text-primary dark:text-primary-dark hover:text-opacity-80 mr-2 edit-project-btn" data-id="${project.id}">
1108
  <i class="fas fa-edit"></i>
1109
  </button>
1110
+ <button class="text-red-500 hover:text-red-700 delete-project-btn" data-id="${project.id}">
1111
  <i class="fas fa-trash"></i>
1112
  </button>
1113
  </td>
 
1264
  const row = document.createElement('tr');
1265
  row.innerHTML = `
1266
  <td class="px-6 py-4 whitespace-nowrap">
1267
+ <div class="font-medium">${client.name}</div>
1268
  </td>
1269
  <td class="px-6 py-4 whitespace-nowrap">
1270
+ <div>${client.email}</div>
1271
  </td>
1272
  <td class="px-6 py-4">
1273
+ <div>${client.address || '-'}</div>
1274
  </td>
1275
  <td class="px-6 py-4 whitespace-nowrap">
1276
+ <div>${client.siret || '-'}</div>
1277
  </td>
1278
  <td class="px-6 py-4 whitespace-nowrap">
1279
+ <button class="text-primary dark:text-primary-dark hover:text-opacity-80 mr-2 edit-client-btn" data-id="${client.id}">
1280
  <i class="fas fa-edit"></i>
1281
  </button>
1282
+ <button class="text-red-500 hover:text-red-700 delete-client-btn" data-id="${client.id}">
1283
  <i class="fas fa-trash"></i>
1284
  </button>
1285
  </td>
 
1427
  } else if (filter === 'sent') {
1428
  invoicesToShow = appData.invoices.filter(i => i.status === 'sent');
1429
  } else if (filter === 'paid') {
1430
+ invoicesToShow
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1431
  </html>