Add a shop sales dashboard with 30-day charts (#8)

## Summary
- Closes #7
- Portal Retail **Sales** page: 30-day orders/revenue/units/AOV, daily charts, top products
- Home dashboard cards for 30-day shop sales and revenue when `FEATURE_SHOP` is on
- Stacks on #6 (shop catalog). Merge that first, then retarget `master` if needed.

## Test plan
- [ ] Sales page requires login; empty state with no paid orders
- [ ] Paid/fulfilled in the last 30 days counted; draft/open/cancelled/old excluded
- [ ] Top products ranked by units; home dashboard shows 30-day sales count
- [ ] `manage.py test shop core.tests_features`

Reviewed-on: #8
This commit was merged in pull request #8.
This commit is contained in:
2026-09-06 14:00:04 -07:00
parent 80a5f5dadf
commit 23897b8b62
10 changed files with 514 additions and 1 deletions
+57
View File
@@ -264,6 +264,63 @@ body.portal {
line-height: 1.2;
white-space: nowrap;
}
.chart-placeholder.chart-daily {
gap: 3px;
padding: 16px 10px 8px;
overflow-x: auto;
}
.chart-placeholder.chart-daily .chart-bar-col {
flex: 1 0 8px;
min-width: 6px;
}
.chart-placeholder.chart-daily .chart-bar-col .bar {
min-height: 0;
}
.chart-placeholder.chart-daily .chart-bar-col .bar.is-zero {
height: 0 !important;
min-height: 0;
opacity: 0.2;
}
.chart-placeholder.chart-daily .chart-bar-label {
font-size: 10px;
}
.chart-placeholder.chart-revenue .chart-bar-col .bar {
background: var(--monica-primary-light);
}
.hbar-chart {
display: flex;
flex-direction: column;
gap: 12px;
}
.hbar-row {
display: grid;
grid-template-columns: minmax(72px, 160px) 1fr auto;
gap: 12px;
align-items: center;
}
.hbar-label {
font-size: 13px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.hbar-track {
height: 16px;
background: #e8f4f5;
overflow: hidden;
}
.hbar-fill {
height: 100%;
background: var(--monica-primary);
opacity: 0.8;
min-width: 0;
}
.hbar-value {
font-size: 13px;
font-weight: 600;
min-width: 2.5ch;
text-align: right;
}
.consent-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-pane {