librechat-analytics/public/css/style.css
DJP 1673694b11 feat: Add User Lookup tab with search and full user workup
New tab lets you search for any user by name or email, then shows:
- Summary cards (cost, tokens, conversations, visits) for the period
- All their conversations with titles, models, and cost breakdown
- Model usage breakdown with prompt/completion split
- CSV export of the full user report

Two new API endpoints: /api/search-users and /api/user-detail

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 15:09:43 -04:00

560 lines
11 KiB
CSS

:root {
--bg-dark: #000000;
--sidebar-bg: #0a0a0a;
--card-bg: rgba(20, 20, 20, 0.6);
--text-main: #f8fafc;
--text-muted: #94a3b8;
--accent-primary: #FFC407;
--accent-green: #4ade80;
--accent-purple: #c084fc;
--accent-red: #f87171;
--accent-amber: #FFC407;
--border-color: rgba(255, 196, 7, 0.12);
--sidebar-width: 260px;
--glass-blur: blur(12px);
--grad-primary: linear-gradient(135deg, #FFC407 0%, #CC9D06 100%);
--shadow-premium: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Montserrat", system-ui, -apple-system, sans-serif;
}
body {
background-color: var(--bg-dark);
color: var(--text-main);
overflow-x: hidden;
}
#app {
display: flex;
min-height: 100vh;
}
/* Sidebar */
.sidebar {
width: var(--sidebar-width);
background-color: var(--sidebar-bg);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
position: fixed;
height: 100vh;
box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
z-index: 100;
}
.sidebar-header {
padding: 2.5rem 2rem;
display: flex;
align-items: center;
gap: 0.75rem;
}
.logo-icon {
color: var(--accent-primary);
width: 28px;
height: 28px;
filter: drop-shadow(0 0 8px rgba(255, 196, 7, 0.4));
}
.logo-text {
font-size: 1.2rem;
font-weight: 800;
letter-spacing: -0.025em;
background: var(--grad-primary);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
.nav-links {
list-style: none;
padding: 1rem 0.75rem;
flex-grow: 1;
}
.nav-links li {
padding: 0.875rem 1.25rem;
margin-bottom: 0.5rem;
display: flex;
align-items: center;
gap: 1rem;
border-radius: 0.75rem;
cursor: pointer;
color: var(--text-muted);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
font-size: 0.9375rem;
font-weight: 500;
}
.nav-links li:hover {
background: rgba(255, 255, 255, 0.05);
color: var(--text-main);
}
.nav-links li.active {
background: rgba(255, 196, 7, 0.1);
color: var(--accent-primary);
box-shadow: inset 0 0 0 1px rgba(255, 196, 7, 0.2);
}
.sidebar-footer {
padding: 1.5rem;
border-top: 1px solid var(--border-color);
background: rgba(0, 0, 0, 0.1);
font-size: 0.8rem;
color: var(--text-muted);
}
/* Content Area */
.content {
margin-left: var(--sidebar-width);
flex-grow: 1;
padding: 2.5rem 3rem;
background:
radial-gradient(circle at top right, rgba(255, 196, 7, 0.03), transparent 40%),
radial-gradient(circle at bottom left, rgba(255, 196, 7, 0.02), transparent 40%);
}
.top-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
}
.top-bar h1 {
font-size: 1.75rem;
font-weight: 800;
letter-spacing: -0.025em;
}
/* Filter Bar */
.filter-bar {
display: flex;
align-items: center;
gap: 1.5rem;
margin-bottom: 1.5rem;
padding: 1rem 1.5rem;
background: var(--card-bg);
backdrop-filter: var(--glass-blur);
border: 1px solid var(--border-color);
border-radius: 1rem;
flex-wrap: wrap;
}
.period-selector {
display: flex;
gap: 0.25rem;
background: rgba(0, 0, 0, 0.2);
padding: 0.25rem;
border-radius: 0.5rem;
}
.period-btn {
padding: 0.5rem 1rem;
border: none;
background: transparent;
color: var(--text-muted);
border-radius: 0.375rem;
cursor: pointer;
font-size: 0.875rem;
font-weight: 600;
transition: all 0.2s;
}
.period-btn:hover {
color: var(--text-main);
background: rgba(255, 255, 255, 0.05);
}
.period-btn.active {
background: var(--accent-primary);
color: #000000;
}
.date-range-picker {
display: flex;
align-items: center;
gap: 0.5rem;
}
.date-range-picker input[type="date"] {
width: 150px;
padding: 0.5rem 0.75rem;
font-size: 0.875rem;
background: #0f172a;
border: 1px solid var(--border-color);
border-radius: 0.5rem;
color: var(--text-main);
outline: none;
}
.date-range-picker input[type="date"]:focus {
border-color: var(--accent-primary);
}
.date-separator {
color: var(--text-muted);
font-size: 0.875rem;
}
.refresh-info {
margin-left: auto;
font-size: 0.8rem;
color: var(--text-muted);
}
/* Tabs */
.tab-content {
display: none;
}
.tab-content.active {
display: block;
animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
/* Stat Cards */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.stat-card {
background: var(--card-bg);
backdrop-filter: var(--glass-blur);
border: 1px solid var(--border-color);
padding: 1.75rem;
border-radius: 1.25rem;
display: flex;
align-items: center;
gap: 1.25rem;
box-shadow: var(--shadow-premium);
transition: transform 0.3s ease, border-color 0.3s ease;
}
.stat-card:hover {
transform: translateY(-4px);
border-color: rgba(255, 196, 7, 0.3);
}
.stat-icon {
width: 56px;
height: 56px;
border-radius: 1rem;
display: flex;
align-items: center;
justify-content: center;
}
.stat-icon svg {
width: 24px;
height: 24px;
}
.stat-icon.cost { background: rgba(255, 196, 7, 0.1); color: var(--accent-primary); }
.stat-icon.tokens { background: rgba(255, 196, 7, 0.08); color: #FFD54F; }
.stat-icon.users { background: rgba(192, 132, 252, 0.1); color: var(--accent-purple); }
.stat-icon.convos { background: rgba(255, 196, 7, 0.06); color: #FFAB00; }
.stat-icon.visits { background: rgba(74, 222, 128, 0.1); color: var(--accent-green); }
.stat-icon.unique { background: rgba(248, 113, 113, 0.1); color: var(--accent-red); }
.stat-label {
display: block;
font-size: 0.875rem;
color: var(--text-muted);
margin-bottom: 0.25rem;
}
.stat-value {
font-size: 1.5rem;
font-weight: 700;
}
/* Charts */
.charts-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1.5rem;
margin-bottom: 2rem;
}
.chart-wide {
grid-column: span 2;
}
.chart-container {
background: var(--card-bg);
backdrop-filter: var(--glass-blur);
border: 1px solid var(--border-color);
padding: 1.5rem;
border-radius: 1.25rem;
box-shadow: var(--shadow-premium);
position: relative;
}
.chart-container h3 {
margin-bottom: 1rem;
font-size: 1rem;
font-weight: 600;
color: var(--text-muted);
}
.chart-container canvas {
width: 100% !important;
max-height: 350px;
}
/* Tables */
.table-container {
background: var(--card-bg);
backdrop-filter: var(--glass-blur);
border: 1px solid var(--border-color);
border-radius: 1.25rem;
overflow: hidden;
box-shadow: var(--shadow-premium);
margin-bottom: 2rem;
}
.table-header {
padding: 1.5rem 2rem;
border-bottom: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
}
.table-header h3 {
font-size: 1.125rem;
font-weight: 700;
}
table {
width: 100%;
border-collapse: collapse;
}
th {
background: rgba(15, 23, 42, 0.4);
padding: 1rem 1.5rem;
font-weight: 600;
font-size: 0.8125rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--text-muted);
text-align: left;
}
th.text-right, td.text-right {
text-align: right;
}
td {
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--border-color);
font-size: 0.9375rem;
}
tr:hover td {
background: rgba(255, 255, 255, 0.02);
}
.cost-value {
color: var(--accent-primary);
font-weight: 600;
}
.token-value {
color: #FFD54F;
font-weight: 500;
}
/* Export Button */
.btn-export {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: rgba(255, 196, 7, 0.1);
color: var(--accent-primary);
border: 1px solid rgba(255, 196, 7, 0.2);
border-radius: 0.5rem;
font-family: "Montserrat", system-ui, sans-serif;
font-size: 0.8125rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.btn-export:hover {
background: rgba(255, 196, 7, 0.2);
border-color: rgba(255, 196, 7, 0.4);
}
.tab-title-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
/* User Search */
.user-search-bar {
display: flex;
gap: 0.75rem;
align-items: center;
margin-bottom: 1.5rem;
}
.search-input-wrap {
display: flex;
align-items: center;
gap: 0.75rem;
flex: 1;
max-width: 500px;
padding: 0.625rem 1rem;
background: #0f172a;
border: 1px solid var(--border-color);
border-radius: 0.5rem;
color: var(--text-muted);
}
.search-input-wrap input {
flex: 1;
background: none;
border: none;
outline: none;
color: var(--text-main);
font-family: "Montserrat", system-ui, sans-serif;
font-size: 0.9375rem;
}
.search-input-wrap input::placeholder {
color: var(--text-muted);
}
.search-input-wrap:focus-within {
border-color: var(--accent-primary);
}
.search-results {
margin-bottom: 1.5rem;
}
.search-result-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1.25rem;
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 0.5rem;
margin-bottom: 0.5rem;
cursor: pointer;
transition: all 0.2s;
}
.search-result-item:hover {
border-color: var(--accent-primary);
background: rgba(255, 196, 7, 0.05);
}
.search-result-name {
font-weight: 600;
color: var(--accent-primary);
}
.search-result-email {
color: var(--text-muted);
font-size: 0.875rem;
}
/* User Links */
.user-link {
color: var(--accent-primary);
text-decoration: none;
font-weight: 600;
transition: opacity 0.2s;
}
.user-link:hover {
opacity: 0.8;
text-decoration: underline;
}
/* Model Tags */
.model-tags {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
}
.model-tag {
display: inline-block;
padding: 0.15rem 0.5rem;
background: rgba(255, 196, 7, 0.08);
border: 1px solid rgba(255, 196, 7, 0.15);
border-radius: 0.35rem;
font-size: 0.75rem;
color: var(--text-muted);
white-space: nowrap;
}
.btn-filter-user {
background: rgba(248, 113, 113, 0.1);
color: var(--accent-red);
border-color: rgba(248, 113, 113, 0.2);
}
.btn-filter-user:hover {
background: rgba(248, 113, 113, 0.2);
border-color: rgba(248, 113, 113, 0.4);
}
/* Loading */
.loading {
display: flex;
align-items: center;
justify-content: center;
padding: 3rem;
color: var(--text-muted);
}
.spinner {
width: 24px;
height: 24px;
border: 3px solid var(--border-color);
border-top-color: var(--accent-primary);
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin-right: 1rem;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Responsive */
@media (max-width: 1200px) {
.charts-grid { grid-template-columns: 1fr; }
.chart-wide { grid-column: span 1; }
}
@media (max-width: 768px) {
.sidebar { display: none; }
.content { margin-left: 0; padding: 1.5rem; }
.filter-bar { flex-direction: column; align-items: stretch; }
.stats-grid { grid-template-columns: 1fr 1fr; }
}