PD03 commited on
Commit
20a11e3
Β·
verified Β·
1 Parent(s): f0248fd

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +151 -164
src/streamlit_app.py CHANGED
@@ -4,7 +4,7 @@ import plotly.express as px
4
  import plotly.graph_objects as go
5
  from datetime import datetime, timedelta
6
 
7
- # Page config with modern styling
8
  st.set_page_config(
9
  page_title="Supply Chain Intelligence",
10
  page_icon="πŸ”—",
@@ -12,7 +12,7 @@ st.set_page_config(
12
  initial_sidebar_state="expanded"
13
  )
14
 
15
- # Modern CSS styling
16
  st.markdown("""
17
  <style>
18
  /* Import modern font */
@@ -21,152 +21,133 @@ st.markdown("""
21
  /* Global styling */
22
  .stApp {
23
  font-family: 'Inter', sans-serif;
24
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
25
  }
26
 
27
  /* Main container */
28
  .main-container {
29
- background: rgba(255, 255, 255, 0.95);
30
- backdrop-filter: blur(10px);
31
- border-radius: 20px;
32
  padding: 2rem;
33
- margin: 1rem;
34
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
 
35
  }
36
 
37
- /* Modern header */
38
  .modern-header {
39
- background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
40
  color: white;
41
  padding: 2rem;
42
- border-radius: 15px;
43
  margin-bottom: 2rem;
44
- box-shadow: 0 10px 30px rgba(30, 60, 114, 0.3);
45
- position: relative;
46
- overflow: hidden;
47
- }
48
-
49
- .modern-header::before {
50
- content: '';
51
- position: absolute;
52
- top: -50%;
53
- right: -50%;
54
- width: 100%;
55
- height: 200%;
56
- background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
57
- transform: rotate(45deg);
58
  }
59
 
60
  .header-title {
61
- font-size: 2.5rem;
62
- font-weight: 700;
63
  margin-bottom: 0.5rem;
64
- position: relative;
65
- z-index: 1;
66
  }
67
 
68
  .header-subtitle {
69
- font-size: 1.2rem;
70
  font-weight: 400;
71
- color: #ffd700;
72
- position: relative;
73
- z-index: 1;
74
  }
75
 
76
- /* Modern metric cards */
77
  .metric-card {
78
- background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
79
  padding: 1.5rem;
80
- border-radius: 15px;
81
- border: 1px solid rgba(226, 232, 240, 0.8);
82
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
83
- transition: all 0.3s ease;
84
  margin-bottom: 1rem;
 
85
  }
86
 
87
  .metric-card:hover {
88
- transform: translateY(-5px);
89
- box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
90
  }
91
 
92
  .metric-number {
93
  font-size: 2.5rem;
94
  font-weight: 700;
95
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
96
- -webkit-background-clip: text;
97
- -webkit-text-fill-color: transparent;
98
- background-clip: text;
99
  margin-bottom: 0.5rem;
100
  }
101
 
102
  .metric-label {
103
  color: #64748b;
104
- font-size: 0.9rem;
105
  font-weight: 500;
106
  text-transform: uppercase;
107
  letter-spacing: 0.05em;
 
108
  }
109
 
110
  .metric-change {
111
- font-size: 0.85rem;
112
  font-weight: 600;
113
- padding: 0.3rem 0.8rem;
114
- border-radius: 20px;
115
- margin-top: 0.5rem;
116
  display: inline-block;
117
  }
118
 
119
  .metric-positive {
120
- background: rgba(34, 197, 94, 0.1);
121
- color: #22c55e;
122
  }
123
 
124
  .metric-negative {
125
- background: rgba(239, 68, 68, 0.1);
126
- color: #ef4444;
 
 
 
 
 
127
  }
128
 
129
- /* Modern sidebar */
130
  .sidebar-content {
131
- background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
132
- color: white;
133
- border-radius: 15px;
134
  padding: 1.5rem;
135
  margin-bottom: 1rem;
 
 
136
  }
137
 
138
- /* Filter pills */
139
  .filter-container {
140
- background: rgba(255, 255, 255, 0.7);
141
  padding: 1.5rem;
142
- border-radius: 15px;
143
  margin-bottom: 2rem;
144
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
145
- }
146
-
147
- /* Data table styling */
148
- .dataframe {
149
- border-radius: 15px;
150
- overflow: hidden;
151
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
152
  }
153
 
154
  /* Section headers */
155
  .section-header {
156
- font-size: 1.5rem;
157
  font-weight: 600;
158
  color: #1e293b;
159
  margin-bottom: 1.5rem;
160
- padding-bottom: 0.5rem;
161
- border-bottom: 3px solid;
162
- border-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%) 1;
163
  }
164
 
165
  /* Status indicators */
166
  .status-indicator {
167
  display: inline-block;
168
- width: 12px;
169
- height: 12px;
170
  border-radius: 50%;
171
  margin-right: 8px;
172
  }
@@ -175,25 +156,51 @@ st.markdown("""
175
  .status-warning { background-color: #f59e0b; }
176
  .status-critical { background-color: #ef4444; }
177
 
178
- /* Animation for loading */
179
- @keyframes fadeInUp {
180
- from {
181
- opacity: 0;
182
- transform: translateY(30px);
183
- }
184
- to {
185
- opacity: 1;
186
- transform: translateY(0);
187
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  }
189
 
190
- .fade-in {
191
- animation: fadeInUp 0.6s ease-out;
 
192
  }
193
  </style>
194
  """, unsafe_allow_html=True)
195
 
196
- # Sample data functions with enhanced data
197
  @st.cache_data
198
  def get_material_data():
199
  return pd.DataFrame({
@@ -222,48 +229,48 @@ def get_enhanced_metrics():
222
  'on_time_delivery': 94.2
223
  }
224
 
225
- # Header with modern design
226
  st.markdown("""
227
- <div class="modern-header fade-in">
228
- <div class="header-title">πŸ”— Supply Chain Intelligence Hub</div>
229
  <div class="header-subtitle">Real-time Supply Chain Resilience Dashboard β€’ Control Tower Analytics</div>
230
  </div>
231
  """, unsafe_allow_html=True)
232
 
233
- # Modern sidebar
234
  with st.sidebar:
235
  st.markdown("""
236
  <div class="sidebar-content">
237
- <h3 style="margin-top: 0;">πŸŽ›οΈ Navigation Center</h3>
238
- <p style="opacity: 0.8; font-size: 0.9rem;">Select your workspace</p>
239
  </div>
240
  """, unsafe_allow_html=True)
241
 
242
  nav_options = [
243
- "🏠 Dashboard Home",
244
- "πŸ“Š Supply Chain Resilience",
245
- "🎯 Control Tower",
246
- "πŸ“¦ Material Groups",
247
- "🏭 Supplier Analytics",
248
- "πŸ“ˆ Demand Planning",
249
- "πŸ” Insights & Trends",
250
- "⚑ Real-time Alerts",
251
- "πŸ“‹ Reports Center"
252
  ]
253
 
254
  selected_nav = st.selectbox("", nav_options, index=1)
255
 
256
- # Add quick stats in sidebar
257
  st.markdown("---")
258
- st.markdown("**🚨 Quick Alerts**")
259
- st.error("⚠️ 3 critical suppliers need attention")
260
  st.warning("πŸ“‹ 12 SKUs below safety stock")
261
- st.success("βœ… 94% on-time delivery this month")
262
 
263
- # Modern filters section
264
  st.markdown("""
265
- <div class="filter-container fade-in">
266
- <div class="section-header">πŸ”§ Smart Filters & Controls</div>
267
  </div>
268
  """, unsafe_allow_html=True)
269
 
@@ -271,40 +278,35 @@ col1, col2, col3, col4 = st.columns(4)
271
  col5, col6, col7, col8 = st.columns(4)
272
 
273
  with col1:
274
- plant_location = st.selectbox("🏭 Plant Location", ["Chennai Hub", "Mumbai Center", "Delhi North", "Bangalore Tech"], index=0)
275
 
276
  with col2:
277
- material_group = st.selectbox("πŸ“¦ Material Category", ["All Categories", "Critical Components", "Standard Parts"], index=0)
278
 
279
  with col3:
280
- time_period = st.selectbox("πŸ“… Time Horizon", ["Current Quarter", "FY2025", "Last 6 Months"], index=0)
281
 
282
  with col4:
283
- supplier_tier = st.selectbox("🏒 Supplier Tier", ["All Tiers", "Tier 1 Strategic", "Tier 2 Operational"], index=0)
284
 
285
  with col5:
286
- risk_level = st.selectbox("⚠️ Risk Filter", ["All Levels", "High Risk Only", "Medium Risk", "Low Risk"], index=0)
287
 
288
  with col6:
289
- performance = st.selectbox("πŸ“Š Performance", ["All Performance", "Above Target", "Below Target"], index=0)
290
 
291
  with col7:
292
- geography = st.selectbox("🌍 Geography", ["Global View", "Asia Pacific", "Americas", "Europe"], index=0)
293
 
294
  with col8:
295
- update_freq = st.selectbox("πŸ”„ Update Frequency", ["Real-time", "Hourly", "Daily"], index=0)
296
 
297
- # Get enhanced data
298
  material_df = get_material_data()
299
  metrics = get_enhanced_metrics()
300
 
301
- # Main dashboard content
302
- st.markdown("""
303
- <div class="main-container fade-in">
304
- """, unsafe_allow_html=True)
305
-
306
- # Key metrics section with modern cards
307
- st.markdown('<div class="section-header">πŸ“Š Executive Dashboard</div>', unsafe_allow_html=True)
308
 
309
  col1, col2, col3, col4 = st.columns(4)
310
 
@@ -340,85 +342,70 @@ with col4:
340
  <div class="metric-card">
341
  <div class="metric-number">{metrics['active_suppliers']:,}</div>
342
  <div class="metric-label">Active Suppliers</div>
343
- <div class="metric-change metric-positive">β†— +15 new this month</div>
344
  </div>
345
  """, unsafe_allow_html=True)
346
 
347
- # Enhanced data table
348
- st.markdown('<div class="section-header">πŸ“‹ Material Group Performance Matrix</div>', unsafe_allow_html=True)
349
 
350
- # Add status indicators to the dataframe
351
- def add_status_indicators(df):
352
- def get_status_html(risk_level):
353
- if risk_level == 'Low':
354
- return '<span class="status-indicator status-good"></span>Low Risk'
355
- elif risk_level == 'Medium':
356
- return '<span class="status-indicator status-warning"></span>Medium Risk'
357
- else:
358
- return '<span class="status-indicator status-critical"></span>High Risk'
359
-
360
- df['Risk Status'] = df['Risk Level'].apply(get_status_html)
361
- return df
362
 
363
- # Display enhanced table
364
- enhanced_df = add_status_indicators(material_df.copy())
365
- st.markdown(enhanced_df.to_html(escape=False, index=False), unsafe_allow_html=True)
366
-
367
- # Modern charts section
368
- st.markdown('<div class="section-header">πŸ“ˆ Performance Analytics</div>', unsafe_allow_html=True)
369
 
370
  col1, col2 = st.columns(2)
371
 
372
  with col1:
373
- # Modern fulfillment rate chart
374
  fig1 = px.bar(
375
  material_df,
376
  x='Material Group',
377
  y=['Current Rate', 'Target Rate'],
378
- title="Current vs Target Fulfillment Rates",
379
- color_discrete_sequence=['#667eea', '#764ba2']
380
  )
381
 
382
  fig1.update_layout(
383
- plot_bgcolor='rgba(0,0,0,0)',
384
- paper_bgcolor='rgba(0,0,0,0)',
385
  font_family="Inter",
386
- title_font_size=16,
387
  title_font_color="#1e293b",
388
  xaxis_tickangle=-45,
389
  height=400,
390
- margin=dict(t=50, l=50, r=50, b=100)
 
391
  )
392
 
393
  st.plotly_chart(fig1, use_container_width=True)
394
 
395
  with col2:
396
- # Risk distribution pie chart
397
  risk_counts = material_df['Risk Level'].value_counts()
398
 
399
  fig2 = px.pie(
400
  values=risk_counts.values,
401
  names=risk_counts.index,
402
- title="Risk Distribution Across Material Groups",
403
  color_discrete_sequence=['#22c55e', '#f59e0b', '#ef4444']
404
  )
405
 
406
  fig2.update_layout(
407
- plot_bgcolor='rgba(0,0,0,0)',
408
- paper_bgcolor='rgba(0,0,0,0)',
409
  font_family="Inter",
410
- title_font_size=16,
411
  title_font_color="#1e293b",
412
  height=400
413
  )
414
 
415
  st.plotly_chart(fig2, use_container_width=True)
416
 
417
- st.markdown("</div>", unsafe_allow_html=True)
418
-
419
- # Footer with last update info
420
  st.markdown("""
421
- <div style="text-align: center; padding: 2rem; color: #64748b; border-top: 1px solid #e2e8f0; margin-top: 2rem;">
422
- <p>πŸ“Š Dashboard last updated: {timestamp} | πŸ”„ Auto-refresh: Every 15 minutes | 🎯 Data accuracy: 99.7%</p>
423
  </div>
424
  """.format(timestamp=datetime.now().strftime("%B %d, %Y at %I:%M %p")), unsafe_allow_html=True)
 
4
  import plotly.graph_objects as go
5
  from datetime import datetime, timedelta
6
 
7
+ # Page config
8
  st.set_page_config(
9
  page_title="Supply Chain Intelligence",
10
  page_icon="πŸ”—",
 
12
  initial_sidebar_state="expanded"
13
  )
14
 
15
+ # Clean, professional CSS styling
16
  st.markdown("""
17
  <style>
18
  /* Import modern font */
 
21
  /* Global styling */
22
  .stApp {
23
  font-family: 'Inter', sans-serif;
24
+ background-color: #f8fafc;
25
  }
26
 
27
  /* Main container */
28
  .main-container {
29
+ background: white;
30
+ border-radius: 12px;
 
31
  padding: 2rem;
32
+ margin: 1rem 0;
33
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
34
+ border: 1px solid #e2e8f0;
35
  }
36
 
37
+ /* Clean header */
38
  .modern-header {
39
+ background: #1e293b;
40
  color: white;
41
  padding: 2rem;
42
+ border-radius: 12px;
43
  margin-bottom: 2rem;
44
+ border-left: 4px solid #3b82f6;
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
 
47
  .header-title {
48
+ font-size: 2rem;
49
+ font-weight: 600;
50
  margin-bottom: 0.5rem;
51
+ color: white;
 
52
  }
53
 
54
  .header-subtitle {
55
+ font-size: 1rem;
56
  font-weight: 400;
57
+ color: #94a3b8;
 
 
58
  }
59
 
60
+ /* Clean metric cards */
61
  .metric-card {
62
+ background: white;
63
  padding: 1.5rem;
64
+ border-radius: 12px;
65
+ border: 1px solid #e2e8f0;
66
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
 
67
  margin-bottom: 1rem;
68
+ transition: all 0.2s ease;
69
  }
70
 
71
  .metric-card:hover {
72
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
73
+ border-color: #cbd5e1;
74
  }
75
 
76
  .metric-number {
77
  font-size: 2.5rem;
78
  font-weight: 700;
79
+ color: #1e293b;
 
 
 
80
  margin-bottom: 0.5rem;
81
  }
82
 
83
  .metric-label {
84
  color: #64748b;
85
+ font-size: 0.875rem;
86
  font-weight: 500;
87
  text-transform: uppercase;
88
  letter-spacing: 0.05em;
89
+ margin-bottom: 0.5rem;
90
  }
91
 
92
  .metric-change {
93
+ font-size: 0.875rem;
94
  font-weight: 600;
95
+ padding: 0.25rem 0.75rem;
96
+ border-radius: 6px;
 
97
  display: inline-block;
98
  }
99
 
100
  .metric-positive {
101
+ background-color: #dcfce7;
102
+ color: #166534;
103
  }
104
 
105
  .metric-negative {
106
+ background-color: #fef2f2;
107
+ color: #dc2626;
108
+ }
109
+
110
+ .metric-neutral {
111
+ background-color: #f1f5f9;
112
+ color: #475569;
113
  }
114
 
115
+ /* Clean sidebar */
116
  .sidebar-content {
117
+ background: white;
118
+ color: #1e293b;
119
+ border-radius: 12px;
120
  padding: 1.5rem;
121
  margin-bottom: 1rem;
122
+ border: 1px solid #e2e8f0;
123
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
124
  }
125
 
126
+ /* Filter section */
127
  .filter-container {
128
+ background: white;
129
  padding: 1.5rem;
130
+ border-radius: 12px;
131
  margin-bottom: 2rem;
132
+ border: 1px solid #e2e8f0;
133
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
 
 
 
 
 
 
134
  }
135
 
136
  /* Section headers */
137
  .section-header {
138
+ font-size: 1.25rem;
139
  font-weight: 600;
140
  color: #1e293b;
141
  margin-bottom: 1.5rem;
142
+ padding-bottom: 0.75rem;
143
+ border-bottom: 2px solid #e2e8f0;
 
144
  }
145
 
146
  /* Status indicators */
147
  .status-indicator {
148
  display: inline-block;
149
+ width: 8px;
150
+ height: 8px;
151
  border-radius: 50%;
152
  margin-right: 8px;
153
  }
 
156
  .status-warning { background-color: #f59e0b; }
157
  .status-critical { background-color: #ef4444; }
158
 
159
+ /* Clean table styling */
160
+ .dataframe table {
161
+ border-collapse: collapse;
162
+ margin: 0;
163
+ font-size: 0.875rem;
164
+ width: 100%;
165
+ background: white;
166
+ border-radius: 8px;
167
+ overflow: hidden;
168
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
169
+ }
170
+
171
+ .dataframe th {
172
+ background-color: #f8fafc;
173
+ color: #374151;
174
+ font-weight: 600;
175
+ padding: 12px;
176
+ text-align: left;
177
+ border-bottom: 1px solid #e5e7eb;
178
+ }
179
+
180
+ .dataframe td {
181
+ padding: 12px;
182
+ border-bottom: 1px solid #f3f4f6;
183
+ }
184
+
185
+ .dataframe tr:hover {
186
+ background-color: #f9fafb;
187
+ }
188
+
189
+ /* Remove default streamlit styling */
190
+ .stSelectbox > div > div {
191
+ background-color: white;
192
+ border: 1px solid #d1d5db;
193
+ border-radius: 6px;
194
  }
195
 
196
+ .stSelectbox > div > div:focus-within {
197
+ border-color: #3b82f6;
198
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
199
  }
200
  </style>
201
  """, unsafe_allow_html=True)
202
 
203
+ # Sample data functions (same as before)
204
  @st.cache_data
205
  def get_material_data():
206
  return pd.DataFrame({
 
229
  'on_time_delivery': 94.2
230
  }
231
 
232
+ # Clean, professional header
233
  st.markdown("""
234
+ <div class="modern-header">
235
+ <div class="header-title">Supply Chain Intelligence Hub</div>
236
  <div class="header-subtitle">Real-time Supply Chain Resilience Dashboard β€’ Control Tower Analytics</div>
237
  </div>
238
  """, unsafe_allow_html=True)
239
 
240
+ # Professional sidebar
241
  with st.sidebar:
242
  st.markdown("""
243
  <div class="sidebar-content">
244
+ <h3 style="margin-top: 0; color: #1e293b;">Navigation</h3>
245
+ <p style="color: #64748b; font-size: 0.875rem;">Select your workspace</p>
246
  </div>
247
  """, unsafe_allow_html=True)
248
 
249
  nav_options = [
250
+ "Dashboard Home",
251
+ "Supply Chain Resilience",
252
+ "Control Tower",
253
+ "Material Groups",
254
+ "Supplier Analytics",
255
+ "Demand Planning",
256
+ "Insights & Trends",
257
+ "Real-time Alerts",
258
+ "Reports Center"
259
  ]
260
 
261
  selected_nav = st.selectbox("", nav_options, index=1)
262
 
263
+ # Clean alerts section
264
  st.markdown("---")
265
+ st.markdown("**System Status**")
266
+ st.error("⚠️ 3 suppliers need attention")
267
  st.warning("πŸ“‹ 12 SKUs below safety stock")
268
+ st.success("βœ… 94% on-time delivery")
269
 
270
+ # Clean filters section
271
  st.markdown("""
272
+ <div class="filter-container">
273
+ <div class="section-header">Filters & Controls</div>
274
  </div>
275
  """, unsafe_allow_html=True)
276
 
 
278
  col5, col6, col7, col8 = st.columns(4)
279
 
280
  with col1:
281
+ plant_location = st.selectbox("Plant Location", ["Chennai Hub", "Mumbai Center", "Delhi North", "Bangalore Tech"], index=0)
282
 
283
  with col2:
284
+ material_group = st.selectbox("Material Category", ["All Categories", "Critical Components", "Standard Parts"], index=0)
285
 
286
  with col3:
287
+ time_period = st.selectbox("Time Period", ["Current Quarter", "FY2025", "Last 6 Months"], index=0)
288
 
289
  with col4:
290
+ supplier_tier = st.selectbox("Supplier Tier", ["All Tiers", "Tier 1 Strategic", "Tier 2 Operational"], index=0)
291
 
292
  with col5:
293
+ risk_level = st.selectbox("Risk Level", ["All Levels", "High Risk Only", "Medium Risk", "Low Risk"], index=0)
294
 
295
  with col6:
296
+ performance = st.selectbox("Performance", ["All Performance", "Above Target", "Below Target"], index=0)
297
 
298
  with col7:
299
+ geography = st.selectbox("Geography", ["Global View", "Asia Pacific", "Americas", "Europe"], index=0)
300
 
301
  with col8:
302
+ update_freq = st.selectbox("Update Frequency", ["Real-time", "Hourly", "Daily"], index=0)
303
 
304
+ # Get data
305
  material_df = get_material_data()
306
  metrics = get_enhanced_metrics()
307
 
308
+ # Clean metrics section
309
+ st.markdown('<div class="section-header">Key Performance Indicators</div>', unsafe_allow_html=True)
 
 
 
 
 
310
 
311
  col1, col2, col3, col4 = st.columns(4)
312
 
 
342
  <div class="metric-card">
343
  <div class="metric-number">{metrics['active_suppliers']:,}</div>
344
  <div class="metric-label">Active Suppliers</div>
345
+ <div class="metric-change metric-neutral">+15 new</div>
346
  </div>
347
  """, unsafe_allow_html=True)
348
 
349
+ # Clean data table
350
+ st.markdown('<div class="section-header">Material Group Performance</div>', unsafe_allow_html=True)
351
 
352
+ # Display clean table
353
+ st.dataframe(material_df, use_container_width=True, hide_index=True)
 
 
 
 
 
 
 
 
 
 
354
 
355
+ # Professional charts
356
+ st.markdown('<div class="section-header">Performance Analytics</div>', unsafe_allow_html=True)
 
 
 
 
357
 
358
  col1, col2 = st.columns(2)
359
 
360
  with col1:
361
+ # Clean bar chart
362
  fig1 = px.bar(
363
  material_df,
364
  x='Material Group',
365
  y=['Current Rate', 'Target Rate'],
366
+ title="Fulfillment Rates: Current vs Target",
367
+ color_discrete_sequence=['#3b82f6', '#64748b']
368
  )
369
 
370
  fig1.update_layout(
371
+ plot_bgcolor='white',
372
+ paper_bgcolor='white',
373
  font_family="Inter",
374
+ title_font_size=14,
375
  title_font_color="#1e293b",
376
  xaxis_tickangle=-45,
377
  height=400,
378
+ showlegend=True,
379
+ legend=dict(orientation="h", yanchor="bottom", y=1.02, xanchor="right", x=1)
380
  )
381
 
382
  st.plotly_chart(fig1, use_container_width=True)
383
 
384
  with col2:
385
+ # Clean pie chart
386
  risk_counts = material_df['Risk Level'].value_counts()
387
 
388
  fig2 = px.pie(
389
  values=risk_counts.values,
390
  names=risk_counts.index,
391
+ title="Risk Distribution",
392
  color_discrete_sequence=['#22c55e', '#f59e0b', '#ef4444']
393
  )
394
 
395
  fig2.update_layout(
396
+ plot_bgcolor='white',
397
+ paper_bgcolor='white',
398
  font_family="Inter",
399
+ title_font_size=14,
400
  title_font_color="#1e293b",
401
  height=400
402
  )
403
 
404
  st.plotly_chart(fig2, use_container_width=True)
405
 
406
+ # Clean footer
 
 
407
  st.markdown("""
408
+ <div style="text-align: center; padding: 1.5rem; color: #64748b; border-top: 1px solid #e2e8f0; margin-top: 2rem; font-size: 0.875rem;">
409
+ Dashboard last updated: {timestamp} β€’ Auto-refresh: Every 15 minutes β€’ Data accuracy: 99.7%
410
  </div>
411
  """.format(timestamp=datetime.now().strftime("%B %d, %Y at %I:%M %p")), unsafe_allow_html=True)