/* ==========================================================================
   Platform Statistics dashboard (/platform/statistics)
   Global stylesheet — Blazor scoped CSS is not linked in this app, so all
   custom styling for StatisticsDashboard.razor lives here.
   Linked from index.template.html.
   ========================================================================== */

/* Toolbar surface holding the period / mode toggles and refresh action. */
.stats-toolbar {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background-color: var(--mud-palette-surface);
}

/* ---- KPI / stat tiles ---------------------------------------------------- */
.stat-card {
    position: relative;
    height: 100%;
    border-radius: 12px !important;
    border: 1px solid var(--mud-palette-lines-default);
    border-left: 4px solid var(--stat-accent, var(--mud-palette-primary)) !important;
    background-color: var(--mud-palette-surface);
    transition: box-shadow 160ms ease, transform 160ms ease, border-color 160ms ease;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.stat-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    color: var(--stat-accent, var(--mud-palette-primary));
    background-color: color-mix(in srgb, var(--stat-accent, var(--mud-palette-primary)) 14%, transparent);
}

.stat-card__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    line-height: 1.2;
}

.stat-card__value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--mud-palette-text-primary);
    font-variant-numeric: tabular-nums;
}

/* Delta pill — creation counts are always >= 0, so "up" or "flat". */
.stat-delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.stat-delta .mud-icon-root {
    font-size: 0.9rem;
}

.stat-delta--up {
    color: var(--status-success-fg);
    background-color: var(--status-success-bg);
}

.stat-delta--flat {
    color: var(--mud-palette-text-secondary);
    background-color: var(--mud-palette-action-default-hover);
}

.stat-card__meta {
    font-size: 0.72rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.4;
}

/* ---- Chart panel --------------------------------------------------------- */
.stats-chart-panel {
    border-radius: 12px !important;
    border: 1px solid var(--mud-palette-lines-default);
}

.stats-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.stats-meta-chip .mud-icon-root {
    font-size: 1rem;
    color: var(--mud-palette-text-secondary);
}

/* Empty state inside the chart panel. */
.stats-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 360px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

.stats-empty .mud-icon-root {
    font-size: 3rem;
    opacity: 0.5;
}
