git clone https://garage44.eu/jeroen/cartopolis.git.. /crates/atlas/web/src/components/pages/stats/stats.css
/*
* Admin › Stats and a community's numbers (`docs/mockups/stats/`).
*
* The chart colours are the one thing not taken from the theme: three
* categorical slots and a six-step blue ramp, from the dataviz reference
* palette, each stepped for its half and validated against the surface it
* sits on. Text never wears them; a mark beside it carries the identity.
*/
.stats {
--stats-s1: light-dark(#2a78d6, #3987e5);
--stats-s2: light-dark(#eb6834, #d95926);
--stats-s3: light-dark(#1baf7a, #199e70);
--stats-q1: light-dark(#cde2fb, #184f95);
--stats-q2: light-dark(#9ec5f4, #1c5cab);
--stats-q3: light-dark(#6da7ec, #256abf);
--stats-q4: light-dark(#3987e5, #3987e5);
--stats-q5: light-dark(#256abf, #5598e7);
--stats-q6: light-dark(#184f95, #86b6ef);
display: flex;
flex-direction: column;
gap: 14px;
}
.stats-filters {
align-items: center;
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.stats-seg {
background: var(--m-surface-sunken);
border: 1px solid var(--m-border);
border-radius: 10px;
display: inline-flex;
gap: 2px;
padding: 3px;
/* A row wider than a phone scrolls sideways, rather than wrapping a label onto two lines. */
max-width: 100%;
overflow-x: auto;
scrollbar-width: none;
}
.stats-seg button {
background: none;
border: 0;
border-radius: 7px;
color: var(--m-text-dim);
cursor: pointer;
font: inherit;
font-size: 13px;
padding: 5px 11px;
white-space: nowrap;
flex: none;
}
.stats-seg button.is-on {
background: var(--m-surface-raised);
box-shadow: inset 0 0 0 1px var(--m-border-strong);
color: var(--m-text-strong);
}
.stats-faint {
color: var(--m-text-faint);
font-size: 12px;
}
.stats-tiles {
display: grid;
gap: 12px;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stats-tile,
.stats-card {
background: var(--m-surface);
border: 1px solid var(--m-border);
border-radius: var(--m-radius-lg);
min-width: 0;
padding: 12px 14px;
}
.stats-tile-label {
color: var(--m-text-dim);
font-size: 12px;
}
.stats-tile-value {
color: var(--m-text-strong);
font-size: 26px;
font-weight: 600;
letter-spacing: -0.5px;
line-height: 1.2;
}
.stats-tile-note {
color: var(--m-text-dim);
display: flex;
font-size: 12px;
gap: 6px;
white-space: nowrap;
}
.stats-up {
color: var(--m-success);
}
.stats-down {
color: var(--m-danger);
}
.stats-card h3 {
align-items: baseline;
color: var(--m-text-strong);
display: flex;
font-size: 14px;
gap: 8px;
margin: 0 0 8px;
}
.stats-card h3 span {
color: var(--m-text-dim);
font-size: 12px;
font-weight: 400;
margin-left: auto;
}
.stats-card h3.stats-sub {
margin-top: 14px;
}
.stats-row {
display: grid;
gap: 12px;
grid-template-columns: 1fr 1fr;
}
.stats-row.is-three {
grid-template-columns: repeat(3, 1fr);
}
.stats-row.is-wide {
grid-template-columns: 2fr 1fr;
}
@media (width < 900px) {
.stats-row,
.stats-row.is-three,
.stats-row.is-wide {
grid-template-columns: 1fr;
}
}
.stats-legend {
color: var(--m-text-dim);
display: flex;
flex-wrap: wrap;
font-size: 12px;
gap: 14px;
margin-bottom: 6px;
}
.stats-legend span {
align-items: center;
display: flex;
gap: 6px;
}
.stats-legend i {
border-radius: 3px;
display: block;
height: 10px;
width: 10px;
}
.stats-chart {
display: block;
height: auto;
overflow: visible;
width: 100%;
}
.stats-chart text {
fill: var(--m-text-dim);
font: 11px var(--m-font);
}
.stats-chart text.stats-value {
fill: var(--m-text);
font-weight: 600;
}
.stats-grid {
stroke: var(--m-border);
}
.stats-base {
stroke: var(--m-border-strong);
}
.stats-s1 {
background: var(--stats-s1);
fill: var(--stats-s1);
}
.stats-s2 {
background: var(--stats-s2);
fill: var(--stats-s2);
}
.stats-s3 {
background: var(--stats-s3);
fill: var(--stats-s3);
}
.stats-today rect {
opacity: 0.5;
}
.stats-line {
fill: none;
stroke: var(--stats-s1);
stroke-linejoin: round;
stroke-width: 2;
}
.stats-line.is-today {
stroke-dasharray: 3 3;
}
.stats-area {
fill: var(--stats-s1);
opacity: 0.14;
}
.stats-dot {
fill: var(--stats-s1);
stroke: var(--m-surface);
stroke-width: 2;
}
.stats-hit {
fill: transparent;
}
.stats-q0 {
background: var(--m-surface-raised);
fill: var(--m-surface-raised);
}
.stats-q1 { background: var(--stats-q1); fill: var(--stats-q1); }
.stats-q2 { background: var(--stats-q2); fill: var(--stats-q2); }
.stats-q3 { background: var(--stats-q3); fill: var(--stats-q3); }
.stats-q4 { background: var(--stats-q4); fill: var(--stats-q4); }
.stats-q5 { background: var(--stats-q5); fill: var(--stats-q5); }
.stats-q6 { background: var(--stats-q6); fill: var(--stats-q6); }
.stats-squares a:hover rect {
stroke: var(--m-text-strong);
stroke-width: 2;
}
.stats-funnel {
display: flex;
flex-direction: column;
gap: 8px;
}
.stats-funnel-row {
align-items: center;
display: grid;
font-size: 12.5px;
gap: 8px;
grid-template-columns: 9.5em 1fr 4em 3em;
}
.stats-funnel-label {
color: var(--m-text);
}
.stats-funnel-bar i {
background: var(--stats-s1);
border-radius: 3px;
display: block;
height: 12px;
min-width: 3px;
}
.stats-funnel-row b {
color: var(--m-text);
font-variant-numeric: tabular-nums;
text-align: right;
}
.stats-funnel-pct {
color: var(--m-text-dim);
font-variant-numeric: tabular-nums;
text-align: right;
}
.stats-ranked {
display: flex;
flex-direction: column;
gap: 3px;
}
.stats-ranked-head {
color: var(--m-text-faint);
display: flex;
font-size: 11px;
justify-content: space-between;
letter-spacing: 0.5px;
padding: 0 8px 2px;
text-transform: uppercase;
}
.stats-ranked-row {
border-radius: 6px;
color: var(--m-text);
display: flex;
font-size: 12.5px;
justify-content: space-between;
padding: 4px 8px;
position: relative;
}
.stats-ranked-row i {
background: color-mix(in srgb, var(--stats-s1) 22%, transparent);
border-radius: 6px;
inset: 0 auto 0 0;
position: absolute;
}
.stats-ranked-row span {
overflow: hidden;
position: relative;
text-overflow: ellipsis;
white-space: nowrap;
}
.stats-ranked-row span:last-child {
color: var(--m-text-dim);
flex: none;
font-variant-numeric: tabular-nums;
margin-left: 8px;
}
.stats-table,
.stats-cohorts {
border-collapse: collapse;
font-size: 12.5px;
width: 100%;
}
.stats-table th,
.stats-cohorts th {
color: var(--m-text-faint);
font-size: 11px;
font-weight: 400;
letter-spacing: 0.5px;
padding: 4px;
text-align: left;
text-transform: uppercase;
}
.stats-table td {
border-top: 1px solid var(--m-border);
color: var(--m-text);
padding: 6px 4px;
}
.stats-table tr.is-refused td {
background: var(--m-danger-soft);
}
.stats-cohorts td {
border: 2px solid var(--m-surface);
color: var(--m-text);
padding: 4px 6px;
text-align: center;
}
.stats-cohorts td:first-child {
text-align: left;
}
.stats-cohorts td.stats-q5,
.stats-cohorts td.stats-q6 {
color: light-dark(#fff, #0f1416);
}
.stats-mono {
font-family: ui-monospace, monospace;
font-size: 12px;
}
.stats-spark {
display: block;
height: 20px;
width: 86px;
}
.stats-spark .stats-line {
stroke-width: 1.5;
}
.stats-note {
color: var(--m-text-dim);
font-size: 12px;
margin: 10px 0 0;
}
.stats-empty {
color: var(--m-text-dim);
font-size: 13px;
}
/* A community's numbers, as a pane of the chat page. */
.chat-stats {
overflow-y: auto;
padding: 16px 20px 24px;
}
.chat-stats-head {
align-items: baseline;
display: flex;
gap: 10px;
margin-bottom: 12px;
}
.chat-stats-head h2 {
color: var(--m-text-strong);
font-size: 18px;
margin: 0;
}
.chat-stats-head span {
color: var(--m-text-dim);
font-size: 12.5px;
}