Esvanth commited on
Commit
c75490d
Β·
1 Parent(s): 5d2d569

Stunning UI redesign + LR speed insight

Browse files
Files changed (1) hide show
  1. app.py +159 -111
app.py CHANGED
@@ -133,185 +133,232 @@ def _layout(h=420):
133
 
134
  st.markdown("""
135
  <style>
136
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
137
 
138
- *, *::before, *::after { font-family: 'Inter', sans-serif !important; box-sizing: border-box; }
139
 
140
- [data-testid="stAppViewContainer"] {
141
- background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 40%, #f0fdf4 100%) !important;
142
- min-height: 100vh;
143
- }
144
- .block-container { padding: 1rem 1.4rem 3rem !important; max-width: 1200px; }
145
- #MainMenu, footer { visibility: hidden; }
146
 
147
  /* ── Tabs ── */
148
  .stTabs [data-baseweb="tab-list"] {
149
- background: #fff; border-radius: 14px; padding: 5px;
150
- box-shadow: 0 2px 16px rgba(0,0,0,.07); border: 1px solid #e8edf5; gap: 3px;
 
151
  }
152
  .stTabs [data-baseweb="tab"] {
153
- border-radius: 10px; font-size: .78rem; font-weight: 600;
154
- padding: 8px 13px; color: #64748b; transition: all .18s ease;
 
155
  }
156
  .stTabs [aria-selected="true"] {
157
- background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%) !important;
158
- color: #fff !important; box-shadow: 0 3px 10px rgba(15,23,42,.25);
159
  }
160
 
161
  /* ── Hero ── */
162
  .hero {
163
- background: linear-gradient(135deg, #0f172a 0%, #162244 50%, #0f1f3d 100%);
164
- border-radius: 18px; padding: 26px 30px 24px; margin-bottom: 18px;
165
  position: relative; overflow: hidden;
 
166
  }
167
  .hero::before {
168
- content: ''; position: absolute; top: -60px; right: -40px;
169
- width: 280px; height: 280px;
170
- background: radial-gradient(circle, rgba(99,102,241,.18) 0%, transparent 68%);
171
- border-radius: 50%;
172
  }
173
  .hero::after {
174
- content: ''; position: absolute; bottom: -60px; left: 30%;
175
- width: 220px; height: 220px;
176
- background: radial-gradient(circle, rgba(16,185,129,.12) 0%, transparent 68%);
177
- border-radius: 50%;
178
- }
179
- .hero-badge {
180
- display: inline-flex; align-items: center; gap: 6px;
181
- background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
182
- color: #94a3b8; font-size: .68rem; font-weight: 700;
183
- padding: 4px 12px; border-radius: 20px; margin-bottom: 14px;
184
- letter-spacing: .06em; text-transform: uppercase;
185
  }
186
  .hero-title {
187
- color: #f1f5f9; font-size: 1.75rem; font-weight: 900;
188
- margin: 0 0 5px; letter-spacing: -.03em; line-height: 1.15;
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
190
- .hero-sub { color: #64748b; font-size: .84rem; margin-bottom: 22px; line-height: 1.5; }
191
- .hero-stats { display: flex; gap: 0; flex-wrap: wrap; }
192
  .hero-stat {
193
- padding: 10px 20px; border-right: 1px solid rgba(255,255,255,.07);
194
- text-align: center;
195
  }
196
- .hero-stat:first-child { padding-left: 0; }
197
  .hero-stat:last-child { border-right: none; }
198
  .hero-stat-num {
199
- color: #fff; font-size: 1.35rem; font-weight: 900;
200
- letter-spacing: -.02em; line-height: 1; display: block;
201
  }
202
  .hero-stat-lbl {
203
- color: #475569; font-size: .65rem; font-weight: 600;
204
- text-transform: uppercase; letter-spacing: .07em; margin-top: 4px; display: block;
205
  }
206
 
207
- /* ── Task intro cards ── */
208
  .task-card {
209
- background: #fff; border-radius: 14px; padding: 18px 20px;
210
- margin-bottom: 16px; border: 1px solid #e8edf5;
211
- box-shadow: 0 2px 14px rgba(0,0,0,.045);
212
- display: flex; gap: 16px; align-items: flex-start;
 
213
  }
 
214
  .task-icon {
215
- width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
216
- display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
 
 
 
 
217
  }
218
- .task-title { font-size: .92rem; font-weight: 700; color: #0f172a; margin-bottom: 5px; }
219
- .task-desc { font-size: .82rem; color: #475569; line-height: 1.65; }
220
 
221
  /* ── Insight ── */
222
  .insight {
223
- background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
224
- border: 1px solid #bbf7d0; border-radius: 12px;
225
- padding: 14px 16px 14px 52px; position: relative;
226
- color: #14532d; font-size: .83rem; line-height: 1.7; margin: 10px 0;
 
227
  }
228
  .insight::before {
229
- content: 'βœ“'; position: absolute; left: 14px; top: 14px;
230
- width: 26px; height: 26px; background: #059669; border-radius: 8px;
231
- color: #fff; font-size: .8rem; font-weight: 800;
 
232
  display: flex; align-items: center; justify-content: center;
 
233
  }
234
 
235
  /* ── Warn ── */
236
  .warn-box {
237
- background: linear-gradient(135deg, #fffbeb, #fef9c3);
238
- border: 1px solid #fde68a; border-radius: 12px;
239
- padding: 14px 16px 14px 52px; position: relative;
240
- color: #78350f; font-size: .83rem; line-height: 1.7; margin: 10px 0;
 
241
  }
242
  .warn-box::before {
243
- content: '!'; position: absolute; left: 14px; top: 14px;
244
- width: 26px; height: 26px; background: #d97706; border-radius: 8px;
245
- color: #fff; font-size: .9rem; font-weight: 900;
 
246
  display: flex; align-items: center; justify-content: center;
 
247
  }
248
 
249
  /* ── Terminal ── */
250
- .term { border-radius: 12px; overflow: hidden; border: 1px solid #1e293b; margin: 8px 0; }
251
- .term-top { background: #1e293b; padding: 8px 14px; display: flex; gap: 6px; align-items: center; }
252
- .dot { width: 10px; height: 10px; border-radius: 50%; }
253
  .term-body {
254
- background: #0f172a; padding: 14px 18px;
255
- font-family: 'Courier New', monospace; font-size: .77rem;
256
- color: #94a3b8; white-space: pre-wrap; line-height: 1.7;
257
- max-height: 280px; overflow-y: auto;
258
  }
259
 
260
- /* ── Legend ── */
261
- .leg { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
262
- .li { display: flex; align-items: center; gap: 5px; font-size: .76rem; color: #475569; font-weight: 500; }
263
- .ld { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
 
 
 
264
 
265
- /* ── Section label ── */
266
  .slabel {
267
- font-size: .7rem; font-weight: 700; color: #94a3b8;
268
- text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
269
  }
270
 
271
- /* ── Divider heading ── */
272
- .sec-head {
273
- font-size: .92rem; font-weight: 700; color: #0f172a;
274
- margin: 18px 0 10px; padding-bottom: 8px;
275
- border-bottom: 2px solid #e8edf5; letter-spacing: -.01em;
276
- }
277
 
278
  /* ── Metrics ── */
279
  div[data-testid="metric-container"] {
280
- background: #fff; border-radius: 12px; padding: 14px 18px;
281
- border: 1px solid #e8edf5; box-shadow: 0 2px 8px rgba(0,0,0,.04);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  }
283
- div[data-testid="metric-container"] label { font-size: .72rem !important; font-weight: 600 !important; color: #64748b !important; }
284
- div[data-testid="metric-container"] [data-testid="stMetricValue"] { font-size: 1.25rem !important; font-weight: 800 !important; color: #0f172a !important; }
285
 
286
  /* ── Sidebar ── */
287
  [data-testid="stSidebar"] {
288
- background: #fff !important; border-right: 1px solid #e8edf5 !important;
 
 
289
  }
290
- .sb-brand {
291
- text-align: center; padding: 4px 0 18px;
292
- border-bottom: 1px solid #f1f5f9; margin-bottom: 18px;
293
- }
294
- .sb-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 6px; }
295
- .sb-name { font-weight: 900; font-size: 1rem; color: #0f172a; }
296
- .sb-sub { font-size: .7rem; color: #94a3b8; margin-top: 2px; font-weight: 500; }
297
- .sb-section { font-size: .68rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 8px; }
298
  .sb-step {
299
  display: flex; align-items: center; gap: 10px;
300
- padding: 8px 10px; border-radius: 10px; margin-bottom: 4px;
301
  background: #f8fafc; border: 1px solid #f1f5f9;
 
302
  }
 
303
  .sb-num {
304
- width: 22px; height: 22px; background: #0f172a; color: #fff;
305
- border-radius: 6px; font-size: .65rem; font-weight: 800;
306
- display: flex; align-items: center; justify-content: center; flex-shrink: 0;
 
 
307
  }
308
- .sb-step-txt { font-size: .8rem; color: #334155; font-weight: 500; }
309
  .sb-status-row {
310
- display: flex; align-items: center; gap: 8px;
311
- padding: 7px 10px; border-radius: 10px; margin-bottom: 4px; font-size: .8rem; font-weight: 600;
312
  }
313
- .sb-done { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
314
  .sb-pending { background: #f8fafc; color: #94a3b8; border: 1px solid #e8edf5; }
 
 
 
 
 
 
 
 
 
315
  </style>
316
  """, unsafe_allow_html=True)
317
 
@@ -1104,11 +1151,12 @@ with T5:
1104
 
1105
  st.markdown("""
1106
  <div class='insight'>
1107
- Linear Regression (RΒ²=0.762) outperformed Random Forest (RΒ²=0.716) β€” the simpler model won.
1108
- The reason: once you give the model last week's same-day sales (<b>lag_7</b>), the pattern
1109
- becomes mostly linear. Random Forest's extra complexity adds nothing. The top three predictors
1110
- were lag_7, lag_14, and is_promo β€” confirming that weekly rhythm and promotions drive
1111
- demand far more than anything else.
 
1112
  </div>""", unsafe_allow_html=True)
1113
 
1114
  # ══════════════════════════════════════════════════════════════════════════════
 
133
 
134
  st.markdown("""
135
  <style>
136
+ @import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700;14..32,800;14..32,900&display=swap');
137
 
138
+ *, *::before, *::after { font-family: 'Inter', -apple-system, sans-serif !important; box-sizing: border-box; }
139
 
140
+ /* ── Base ── */
141
+ [data-testid="stAppViewContainer"] { background: #f0f2f8 !important; }
142
+ .block-container { padding: .8rem 1.6rem 4rem !important; max-width: 1300px !important; }
143
+ #MainMenu, footer, header { visibility: hidden; }
144
+ ::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
 
145
 
146
  /* ── Tabs ── */
147
  .stTabs [data-baseweb="tab-list"] {
148
+ background: #fff; border-radius: 18px; padding: 6px; gap: 4px;
149
+ box-shadow: 0 4px 30px rgba(0,0,0,.07), 0 1px 3px rgba(0,0,0,.04);
150
+ border: 1px solid rgba(226,232,240,.8);
151
  }
152
  .stTabs [data-baseweb="tab"] {
153
+ border-radius: 12px; font-size: .75rem; font-weight: 700;
154
+ padding: 9px 14px; color: #94a3b8; letter-spacing: .01em;
155
+ transition: color .15s ease;
156
  }
157
  .stTabs [aria-selected="true"] {
158
+ background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
159
+ color: #fff !important; box-shadow: 0 4px 14px rgba(30,41,59,.3) !important;
160
  }
161
 
162
  /* ── Hero ── */
163
  .hero {
164
+ background: linear-gradient(140deg, #0a0e1a 0%, #0f1c35 45%, #091428 100%);
165
+ border-radius: 22px; padding: 34px 38px 30px; margin-bottom: 22px;
166
  position: relative; overflow: hidden;
167
+ box-shadow: 0 24px 64px rgba(10,14,26,.45), 0 4px 16px rgba(10,14,26,.2);
168
  }
169
  .hero::before {
170
+ content: ''; position: absolute; top: -100px; right: -80px;
171
+ width: 420px; height: 420px;
172
+ background: radial-gradient(circle, rgba(79,70,229,.22) 0%, transparent 60%);
173
+ border-radius: 50%; pointer-events: none;
174
  }
175
  .hero::after {
176
+ content: ''; position: absolute; bottom: -100px; left: 20%;
177
+ width: 360px; height: 360px;
178
+ background: radial-gradient(circle, rgba(5,150,105,.18) 0%, transparent 60%);
179
+ border-radius: 50%; pointer-events: none;
 
 
 
 
 
 
 
180
  }
181
  .hero-title {
182
+ font-size: 2.2rem; font-weight: 900; letter-spacing: -.05em; line-height: 1.05;
183
+ margin: 0 0 10px;
184
+ background: linear-gradient(135deg, #ffffff 30%, #bfdbfe 70%, #6ee7b7 100%);
185
+ -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
186
+ }
187
+ .hero-sub {
188
+ color: #475569; font-size: .86rem; font-weight: 400;
189
+ margin-bottom: 28px; line-height: 1.65; max-width: 560px;
190
+ }
191
+ .hero-stats {
192
+ display: flex; flex-wrap: wrap; gap: 0;
193
+ background: rgba(255,255,255,.045);
194
+ border: 1px solid rgba(255,255,255,.07);
195
+ border-radius: 16px; padding: 6px; width: fit-content;
196
  }
 
 
197
  .hero-stat {
198
+ padding: 12px 24px; text-align: center;
199
+ border-right: 1px solid rgba(255,255,255,.06);
200
  }
 
201
  .hero-stat:last-child { border-right: none; }
202
  .hero-stat-num {
203
+ display: block; color: #f8fafc; font-size: 1.6rem;
204
+ font-weight: 900; letter-spacing: -.04em; line-height: 1;
205
  }
206
  .hero-stat-lbl {
207
+ display: block; color: #334155; font-size: .6rem; font-weight: 700;
208
+ text-transform: uppercase; letter-spacing: .1em; margin-top: 5px;
209
  }
210
 
211
+ /* ── Task cards ── */
212
  .task-card {
213
+ background: #fff; border-radius: 18px; padding: 20px 22px;
214
+ margin-bottom: 18px; border: 1px solid #e2e8f0;
215
+ box-shadow: 0 4px 24px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.03);
216
+ display: flex; gap: 18px; align-items: flex-start;
217
+ transition: box-shadow .2s ease, transform .2s ease;
218
  }
219
+ .task-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,.1); transform: translateY(-2px); }
220
  .task-icon {
221
+ width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0;
222
+ display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
223
+ }
224
+ .task-title {
225
+ font-size: .96rem; font-weight: 800; color: #0f172a;
226
+ margin-bottom: 6px; line-height: 1.25; letter-spacing: -.02em;
227
  }
228
+ .task-desc { font-size: .81rem; color: #64748b; line-height: 1.7; }
 
229
 
230
  /* ── Insight ── */
231
  .insight {
232
+ background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
233
+ border: 1px solid #86efac; border-radius: 16px;
234
+ padding: 16px 20px 16px 60px; position: relative;
235
+ color: #14532d; font-size: .82rem; line-height: 1.8; margin: 14px 0;
236
+ box-shadow: 0 4px 20px rgba(5,150,105,.1);
237
  }
238
  .insight::before {
239
+ content: 'βœ“'; position: absolute; left: 16px; top: 16px;
240
+ width: 30px; height: 30px;
241
+ background: linear-gradient(135deg, #059669, #34d399);
242
+ border-radius: 10px; color: #fff; font-size: .9rem; font-weight: 900;
243
  display: flex; align-items: center; justify-content: center;
244
+ box-shadow: 0 3px 8px rgba(5,150,105,.35);
245
  }
246
 
247
  /* ── Warn ── */
248
  .warn-box {
249
+ background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
250
+ border: 1px solid #fcd34d; border-radius: 16px;
251
+ padding: 16px 20px 16px 60px; position: relative;
252
+ color: #78350f; font-size: .82rem; line-height: 1.8; margin: 14px 0;
253
+ box-shadow: 0 4px 20px rgba(217,119,6,.1);
254
  }
255
  .warn-box::before {
256
+ content: '!'; position: absolute; left: 16px; top: 16px;
257
+ width: 30px; height: 30px;
258
+ background: linear-gradient(135deg, #d97706, #fbbf24);
259
+ border-radius: 10px; color: #fff; font-size: 1rem; font-weight: 900;
260
  display: flex; align-items: center; justify-content: center;
261
+ box-shadow: 0 3px 8px rgba(217,119,6,.35);
262
  }
263
 
264
  /* ── Terminal ── */
265
+ .term { border-radius: 14px; overflow: hidden; margin: 10px 0; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
266
+ .term-top { background: #1e293b; padding: 9px 16px; display: flex; gap: 7px; align-items: center; }
267
+ .dot { width: 11px; height: 11px; border-radius: 50%; }
268
  .term-body {
269
+ background: #070d19; padding: 16px 20px;
270
+ font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
271
+ font-size: .76rem; color: #7dd3fc;
272
+ white-space: pre-wrap; line-height: 1.8; max-height: 280px; overflow-y: auto;
273
  }
274
 
275
+ /* ── Section heading ── */
276
+ .sec-head {
277
+ font-size: .9rem; font-weight: 800; color: #0f172a;
278
+ letter-spacing: -.02em; margin: 20px 0 12px;
279
+ display: flex; align-items: center; gap: 10px;
280
+ }
281
+ .sec-head::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, #e2e8f0, transparent); border-radius: 2px; }
282
 
283
+ /* ── Slabel ── */
284
  .slabel {
285
+ font-size: .67rem; font-weight: 800; color: #94a3b8;
286
+ text-transform: uppercase; letter-spacing: .11em; margin-bottom: 10px;
287
  }
288
 
289
+ /* ── Legend ── */
290
+ .leg { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
291
+ .li { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: #475569; font-weight: 600; }
292
+ .ld { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
 
 
293
 
294
  /* ── Metrics ── */
295
  div[data-testid="metric-container"] {
296
+ background: #fff; border-radius: 16px; padding: 18px 20px;
297
+ border: 1px solid #e2e8f0; box-shadow: 0 4px 20px rgba(0,0,0,.05);
298
+ transition: transform .18s ease, box-shadow .18s ease;
299
+ }
300
+ div[data-testid="metric-container"]:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(0,0,0,.09); }
301
+ div[data-testid="metric-container"] label { font-size: .68rem !important; font-weight: 800 !important; color: #94a3b8 !important; text-transform: uppercase; letter-spacing: .08em; }
302
+ div[data-testid="metric-container"] [data-testid="stMetricValue"] { font-size: 1.5rem !important; font-weight: 900 !important; color: #0f172a !important; letter-spacing: -.03em; }
303
+
304
+ /* ── Buttons ── */
305
+ .stButton > button {
306
+ border-radius: 12px !important; font-weight: 700 !important;
307
+ font-size: .82rem !important; letter-spacing: .01em !important;
308
+ transition: all .2s ease !important;
309
+ }
310
+ div[data-testid="stButton"] > button[kind="primary"] {
311
+ background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
312
+ border: none !important; color: #fff !important;
313
+ box-shadow: 0 4px 16px rgba(59,130,246,.4) !important;
314
+ padding: 10px 20px !important;
315
+ }
316
+ div[data-testid="stButton"] > button[kind="primary"]:hover {
317
+ box-shadow: 0 8px 28px rgba(59,130,246,.5) !important;
318
+ transform: translateY(-1px) !important;
319
  }
 
 
320
 
321
  /* ── Sidebar ── */
322
  [data-testid="stSidebar"] {
323
+ background: linear-gradient(180deg, #fff 0%, #f8fafc 100%) !important;
324
+ border-right: 1px solid #e2e8f0 !important;
325
+ box-shadow: 3px 0 20px rgba(0,0,0,.04) !important;
326
  }
327
+ .sb-brand { text-align: center; padding: 10px 0 22px; border-bottom: 1px solid #f1f5f9; margin-bottom: 20px; }
328
+ .sb-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
329
+ .sb-name { font-weight: 900; font-size: 1.05rem; color: #0f172a; letter-spacing: -.02em; }
330
+ .sb-sub { font-size: .68rem; color: #94a3b8; margin-top: 3px; font-weight: 500; }
331
+ .sb-section { font-size: .63rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: .11em; margin: 20px 0 8px; }
 
 
 
332
  .sb-step {
333
  display: flex; align-items: center; gap: 10px;
334
+ padding: 10px 12px; border-radius: 12px; margin-bottom: 5px;
335
  background: #f8fafc; border: 1px solid #f1f5f9;
336
+ transition: background .15s;
337
  }
338
+ .sb-step:hover { background: #f1f5f9; }
339
  .sb-num {
340
+ width: 26px; height: 26px; flex-shrink: 0;
341
+ background: linear-gradient(135deg, #1e293b, #334155);
342
+ color: #fff; border-radius: 8px; font-size: .66rem; font-weight: 800;
343
+ display: flex; align-items: center; justify-content: center;
344
+ box-shadow: 0 2px 6px rgba(30,41,59,.25);
345
  }
346
+ .sb-step-txt { font-size: .79rem; color: #334155; font-weight: 500; line-height: 1.3; }
347
  .sb-status-row {
348
+ display: flex; align-items: center; gap: 8px; padding: 9px 12px;
349
+ border-radius: 12px; margin-bottom: 5px; font-size: .79rem; font-weight: 700;
350
  }
351
+ .sb-done { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
352
  .sb-pending { background: #f8fafc; color: #94a3b8; border: 1px solid #e8edf5; }
353
+
354
+ /* ── Dataframe ── */
355
+ .stDataFrame { border-radius: 14px !important; overflow: hidden !important; box-shadow: 0 2px 12px rgba(0,0,0,.04) !important; }
356
+
357
+ /* ── Expander ── */
358
+ summary { border-radius: 10px !important; font-size: .8rem !important; font-weight: 600 !important; }
359
+
360
+ /* ── Slider ── */
361
+ .stSlider [data-testid="stTickBarMin"], .stSlider [data-testid="stTickBarMax"] { font-size: .72rem !important; }
362
  </style>
363
  """, unsafe_allow_html=True)
364
 
 
1151
 
1152
  st.markdown("""
1153
  <div class='insight'>
1154
+ Linear Regression won on <b>both accuracy and speed</b> β€” RΒ²=0.762 vs Random Forest's 0.716,
1155
+ and a fraction of the training time (LR is a single matrix solve; RF trains 200 trees on
1156
+ bootstrap samples). The reason LR wins here: once lag_7 (same weekday last week) is in the
1157
+ features, the demand signal becomes mostly linear. Random Forest's complexity adds noise, not signal.
1158
+ Top predictors: <b>lag_7</b>, <b>lag_14</b>, <b>is_promo</b> β€” weekly rhythm and promotions
1159
+ drive demand more than anything else.
1160
  </div>""", unsafe_allow_html=True)
1161
 
1162
  # ══════════════════════════════════════════════════════════════════════════════