258 lines
5.2 KiB
CSS
258 lines
5.2 KiB
CSS
/* The analytics view. */
|
|
/* Split out of admin.css (#533). Loaded from admin.css in a fixed order —
|
|
later sheets override earlier ones, so the order there is the cascade. */
|
|
|
|
/* ── Analytics View ────────────────────────────────────────── */
|
|
.analytics-view {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.analytics-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.analytics-header h2 {
|
|
font-size: 1.25rem;
|
|
font-weight: 600;
|
|
margin: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.analytics-subtitle {
|
|
font-size: 0.8rem;
|
|
color: var(--admin-text-muted);
|
|
margin: 0.25rem 0 0;
|
|
}
|
|
|
|
.analytics-metrics-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
gap: 1rem;
|
|
}
|
|
|
|
.metric-card {
|
|
background: var(--admin-bg-raised);
|
|
border: 1px solid var(--admin-border);
|
|
border-radius: 12px;
|
|
padding: 1.25rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.25rem;
|
|
}
|
|
|
|
.metric-label {
|
|
font-size: 0.75rem;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
color: var(--admin-text-muted);
|
|
}
|
|
|
|
/* Set like the Overview's stat numbers. `--font-mono` was never defined, so
|
|
these fell through to the browser's bare `monospace`. Tabular figures keep
|
|
the digits aligned without it. */
|
|
.metric-value {
|
|
font-size: 1.8rem;
|
|
font-weight: 500;
|
|
letter-spacing: -0.02em;
|
|
color: var(--admin-text);
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.metric-sub {
|
|
font-size: 0.7rem;
|
|
color: var(--admin-text-muted);
|
|
}
|
|
|
|
.analytics-panel {
|
|
background: var(--admin-bg-raised);
|
|
border: 1px solid var(--admin-border);
|
|
border-radius: 12px;
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.analytics-section-title h3 {
|
|
font-size: 0.95rem;
|
|
font-weight: 600;
|
|
margin: 0 0 1.25rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.analytics-bar-chart {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
gap: 0.75rem;
|
|
height: 180px;
|
|
padding-top: 1.5rem;
|
|
}
|
|
|
|
.bar-col {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
height: 100%;
|
|
}
|
|
|
|
.bar-wrapper {
|
|
flex: 1;
|
|
width: 100%;
|
|
max-width: 32px;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
background: var(--admin-bg-elevated);
|
|
border-radius: 6px;
|
|
}
|
|
|
|
/* --admin-primary never existed, so every bar fell back to a fixed blue;
|
|
the accent is what the top-pages bars below use. */
|
|
.bar-fill {
|
|
width: 100%;
|
|
background: var(--admin-accent);
|
|
border-radius: 6px;
|
|
transition: height 0.3s ease;
|
|
position: relative;
|
|
}
|
|
|
|
/* Above the bar, not inside it: inside, a short bar cut its number in half
|
|
and an empty day had nowhere to put its 0. The chart's padding-top leaves
|
|
room above the tallest bar. */
|
|
.bar-val {
|
|
position: absolute;
|
|
bottom: 100%;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
margin-bottom: 3px;
|
|
font-size: 0.65rem;
|
|
font-weight: 600;
|
|
line-height: 1;
|
|
color: var(--admin-text-secondary);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.bar-label {
|
|
font-size: 0.68rem;
|
|
color: var(--admin-text-muted);
|
|
margin-top: 0.5rem;
|
|
font-variant-numeric: tabular-nums;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.analytics-top-pages {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.top-page-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.page-rank {
|
|
flex-shrink: 0;
|
|
font-size: 0.8rem;
|
|
font-variant-numeric: tabular-nums;
|
|
color: var(--admin-text-muted);
|
|
width: 24px;
|
|
}
|
|
|
|
/* min-width: 0 lets a long path wrap instead of pushing the page sideways. */
|
|
.page-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.35rem;
|
|
}
|
|
|
|
.page-path-line {
|
|
display: flex;
|
|
align-items: baseline;
|
|
justify-content: space-between;
|
|
gap: 0.75rem;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
/* Paths are the one thing here set in monospace, as slugs are elsewhere. */
|
|
.page-path {
|
|
min-width: 0;
|
|
overflow-wrap: anywhere;
|
|
font-family: var(--font-mono, ui-monospace, 'SF Mono', Menlo, monospace);
|
|
color: var(--admin-text);
|
|
}
|
|
|
|
.page-count {
|
|
flex-shrink: 0;
|
|
white-space: nowrap;
|
|
font-size: 0.75rem;
|
|
color: var(--admin-text-muted);
|
|
}
|
|
|
|
.page-progress-bg {
|
|
width: 100%;
|
|
height: 6px;
|
|
background: var(--admin-bg-elevated);
|
|
border-radius: 3px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* The bar itself. Without this the track stayed empty and the view count had
|
|
* no visual weight at all. */
|
|
.page-progress-fill {
|
|
height: 100%;
|
|
min-width: 2px;
|
|
border-radius: 3px;
|
|
background: var(--admin-accent);
|
|
transition: width 0.3s ease;
|
|
}
|
|
|
|
/* Phone width (QA A-18). The page was 513px wide at 390: a long path could
|
|
not wrap (fixed above), and fourteen "09-19" labels broke over two lines
|
|
under bars squeezed by 12px gaps. Panel padding and gaps tighten, and the
|
|
label drops the month, which every bar's title still carries. */
|
|
@media (max-width: 640px) {
|
|
.analytics-panel {
|
|
padding: 1.25rem 1rem;
|
|
}
|
|
|
|
.analytics-bar-chart {
|
|
gap: 0.2rem;
|
|
}
|
|
|
|
.bar-col {
|
|
min-width: 0;
|
|
}
|
|
|
|
.bar-label-month {
|
|
display: none;
|
|
}
|
|
|
|
.top-page-row {
|
|
gap: 0.6rem;
|
|
}
|
|
}
|
|
|
|
.analytics-empty {
|
|
margin: 0;
|
|
padding: 2rem 1rem;
|
|
text-align: center;
|
|
font-size: 0.85rem;
|
|
color: var(--admin-text-muted);
|
|
}
|
|
|
|
.admin-loading-container {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: 320px;
|
|
}
|