ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
feat(ui): redesign foundation — tokens, self-hosted fonts, primitives, sidebar
Juan Denis326bc896796f
diff --git a/frontend/index.html b/frontend/index.htmlindex 6541565f..4a783ab4 100644--- a/frontend/index.html+++ b/frontend/index.html@@ -9,6 +9,10 @@<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /><meta name="description" content="ServerKit - Server Management Dashboard" /><title>ServerKit</title>+ <!-- Fonts are SELF-HOSTED (see src/styles/base/_fonts.scss → /fonts/*.woff2).+ No Google Fonts / third-party CDN: a self-hosted control panel must not+ leak every user's IP + usage to Google. Falls back to system-ui until+ the woff2 files are present (run frontend/scripts/fetch-fonts.mjs). --><script>// Prevent flash of unstyled content (FOUC) by setting theme + accent before React loads(function() {@@ -19,10 +23,18 @@var m = accent.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if (m) {var r = parseInt(m[1],16), g = parseInt(m[2],16), b = parseInt(m[3],16);- var dk = function(v){ return Math.max(0, Math.round(v*0.88)); };+ var hx = function(v){ return Math.max(0,Math.min(255,v)).toString(16).padStart(2,'0'); };+ var dk = function(v){ return Math.round(v*0.88); };+ var br = function(v){ return Math.round(v + (255-v)*0.30); }; // toward white+ var dm = function(v){ return Math.round(v*0.70); };d.style.setProperty('--accent-primary', accent);- d.style.setProperty('--accent-hover', '#'+dk(r).toString(16).padStart(2,'0')+dk(g).toString(16).padStart(2,'0')+dk(b).toString(16).padStart(2,'0'));- d.style.setProperty('--accent-glow', 'rgba('+r+','+g+','+b+',0.15)');+ d.style.setProperty('--accent', accent);+ d.style.setProperty('--accent-hover', '#'+hx(dk(r))+hx(dk(g))+hx(dk(b)));+ d.style.setProperty('--accent-bright', '#'+hx(br(r))+hx(br(g))+hx(br(b)));+ d.style.setProperty('--accent-dim', '#'+hx(dm(r))+hx(dm(g))+hx(dm(b)));+ d.style.setProperty('--accent-bg', 'rgba('+r+','+g+','+b+',0.13)');+ d.style.setProperty('--accent-bg-soft', 'rgba('+r+','+g+','+b+',0.07)');+ d.style.setProperty('--accent-glow', 'rgba('+r+','+g+','+b+',0.35)');d.style.setProperty('--accent-shadow', 'rgba('+r+','+g+','+b+',0.3)');}}diff --git a/frontend/public/fonts/ibm-plex-mono-400.woff2 b/frontend/public/fonts/ibm-plex-mono-400.woff2new file mode 100644index 00000000..0804aaffBinary files /dev/null and b/frontend/public/fonts/ibm-plex-mono-400.woff2 differdiff --git a/frontend/public/fonts/ibm-plex-mono-500.woff2 b/frontend/public/fonts/ibm-plex-mono-500.woff2new file mode 100644index 00000000..090f82f7Binary files /dev/null and b/frontend/public/fonts/ibm-plex-mono-500.woff2 differdiff --git a/frontend/public/fonts/ibm-plex-mono-600.woff2 b/frontend/public/fonts/ibm-plex-mono-600.woff2new file mode 100644index 00000000..67aeeb01Binary files /dev/null and b/frontend/public/fonts/ibm-plex-mono-600.woff2 differdiff --git a/frontend/public/fonts/ibm-plex-sans-400.woff2 b/frontend/public/fonts/ibm-plex-sans-400.woff2new file mode 100644index 00000000..f0ee65ddBinary files /dev/null and b/frontend/public/fonts/ibm-plex-sans-400.woff2 differdiff --git a/frontend/public/fonts/ibm-plex-sans-500.woff2 b/frontend/public/fonts/ibm-plex-sans-500.woff2new file mode 100644index 00000000..6d5527eeBinary files /dev/null and b/frontend/public/fonts/ibm-plex-sans-500.woff2 differdiff --git a/frontend/public/fonts/ibm-plex-sans-600.woff2 b/frontend/public/fonts/ibm-plex-sans-600.woff2new file mode 100644index 00000000..08c0d5adBinary files /dev/null and b/frontend/public/fonts/ibm-plex-sans-600.woff2 differdiff --git a/frontend/public/fonts/ibm-plex-sans-700.woff2 b/frontend/public/fonts/ibm-plex-sans-700.woff2new file mode 100644index 00000000..953f94faBinary files /dev/null and b/frontend/public/fonts/ibm-plex-sans-700.woff2 differdiff --git a/frontend/scripts/fetch-fonts.mjs b/frontend/scripts/fetch-fonts.mjsnew file mode 100644index 00000000..57eba459--- /dev/null+++ b/frontend/scripts/fetch-fonts.mjs@@ -0,0 +1,63 @@+#!/usr/bin/env node+// ============================================================+// fetch-fonts.mjs — vendor IBM Plex woff2 into frontend/public/fonts/+// ============================================================+// ServerKit self-hosts its fonts for privacy (no Google Fonts CDN — that would+// leak every visitor's IP + usage to a third party). This script downloads the+// OFL-licensed IBM Plex faces once, from the @fontsource jsDelivr mirror, into+// the repo's public/fonts/ folder so they're served from our own origin.+//+// node frontend/scripts/fetch-fonts.mjs+//+// Re-run only when changing weights. Commit the resulting .woff2 files.+// Requires Node 18+ (global fetch). No network at build/runtime — only here.+// ============================================================++import { mkdir, writeFile, access } from 'node:fs/promises';+import { fileURLToPath } from 'node:url';+import { dirname, join } from 'node:path';++const __dirname = dirname(fileURLToPath(import.meta.url));+const OUT = join(__dirname, '..', 'public', 'fonts');+const BASE = 'https://cdn.jsdelivr.net/npm';++// local filename -> @fontsource source path+const FONTS = {+ 'ibm-plex-sans-400.woff2': '@fontsource/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2',+ 'ibm-plex-sans-500.woff2': '@fontsource/ibm-plex-sans/files/ibm-plex-sans-latin-500-normal.woff2',+ 'ibm-plex-sans-600.woff2': '@fontsource/ibm-plex-sans/files/ibm-plex-sans-latin-600-normal.woff2',+ 'ibm-plex-sans-700.woff2': '@fontsource/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2',+ 'ibm-plex-mono-400.woff2': '@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-400-normal.woff2',+ 'ibm-plex-mono-500.woff2': '@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-500-normal.woff2',+ 'ibm-plex-mono-600.woff2': '@fontsource/ibm-plex-mono/files/ibm-plex-mono-latin-600-normal.woff2',+};++async function main() {+ await mkdir(OUT, { recursive: true });+ let ok = 0;+ for (const [name, path] of Object.entries(FONTS)) {+ const dest = join(OUT, name);+ try {+ await access(dest);+ console.log(`✓ ${name} (already present)`);+ ok++;+ continue;+ } catch { /* not present — download */ }++ const url = `${BASE}/${path}`;+ try {+ const res = await fetch(url);+ if (!res.ok) throw new Error(`HTTP ${res.status}`);+ const buf = Buffer.from(await res.arrayBuffer());+ await writeFile(dest, buf);+ console.log(`↓ ${name} (${(buf.length / 1024).toFixed(1)} KB)`);+ ok++;+ } catch (err) {+ console.error(`✗ ${name} — ${err.message}\n ${url}`);+ }+ }+ console.log(`\n${ok}/${Object.keys(FONTS).length} fonts in ${OUT}`);+ if (ok < Object.keys(FONTS).length) process.exitCode = 1;+}++main();diff --git a/frontend/src/components/ServerKitLogo.jsx b/frontend/src/components/ServerKitLogo.jsxindex 7a78cf5f..38809d32 100644--- a/frontend/src/components/ServerKitLogo.jsx+++ b/frontend/src/components/ServerKitLogo.jsx@@ -22,8 +22,8 @@ const ServerKitLogo = ({ width = 64, height = 64, className = '' }) => {><defs><linearGradient id={gradId} x1="0%" y1="0%" x2="100%" y2="100%">- <stop offset="0%" stopColor="var(--accent-primary, #6366f1)" />- <stop offset="100%" stopColor="var(--accent-hover, #4f46e5)" />+ <stop offset="0%" stopColor="var(--accent-primary, #6d7cff)" />+ <stop offset="100%" stopColor="var(--accent-hover, #5a67e8)" /></linearGradient></defs><rect x="150" y="150" width="1748" height="1748" rx="150" fill="white" />diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsxindex 84d2f795..8cd53689 100644--- a/frontend/src/components/Sidebar.jsx+++ b/frontend/src/components/Sidebar.jsx@@ -2,9 +2,8 @@ import React, { useState, useEffect, useRef, useMemo } from 'react';import { NavLink, useNavigate, useLocation } from 'react-router-dom';import { useAuth } from '../contexts/AuthContext';import { useTheme } from '../contexts/ThemeContext';-import { Star, Settings, LogOut, Sun, Moon, Monitor, ChevronRight, ChevronDown, ChevronUp, Layers, Palette, PanelLeft, Check, X } from 'lucide-react';+import { Star, Settings, LogOut, Sun, Moon, Monitor, ChevronRight, ChevronDown, ChevronUp, Layers, Palette, PanelLeft, Check, X, Server } from 'lucide-react';import { api } from '../services/api';-import ServerKitLogo from './ServerKitLogo';import WorkspaceSwitcher from './WorkspaceSwitcher';import { SIDEBAR_CATEGORIES, CATEGORY_LABELS, SIDEBAR_PRESETS, getHiddenItemIds, getVisibleItems } from './sidebarItems';import { useContributions } from '../plugins/contributions';@@ -270,7 +269,7 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {) : (<div className="brand-section"><div className="brand-logo">- <ServerKitLogo width={42} height={42} />+ <Server size={19} strokeWidth={2} aria-hidden="true" /></div><span className="brand-text">ServerKit</span><adiff --git a/frontend/src/components/ds/AreaChart.jsx b/frontend/src/components/ds/AreaChart.jsxnew file mode 100644index 00000000..372eaa71--- /dev/null+++ b/frontend/src/components/ds/AreaChart.jsx@@ -0,0 +1,69 @@+import * as React from 'react';+import { cn } from '@/lib/utils';++// Smooth multi-series area chart with gradient fills. Theme-token colors by+// default so it tracks dark/light + custom accent.+// series: a single number[] or an array of number[] (one per series).+export function AreaChart({+ series = [],+ height = 160,+ colors = ['var(--accent-bright)', 'var(--green)', 'var(--cyan)'],+ grid = true,+ className,+}) {+ const data = series.length && Array.isArray(series[0]) ? series : [series];+ const all = data.flat();+ const uid = React.useId().replace(/:/g, '');+ if (!all.length) return null;++ const w = 100;+ const h = 100;+ const max = Math.max(...all) * 1.15;+ const min = Math.min(...all) * 0.6;+ const span = max - min || 1;+ const toX = (i, len) => (i / (len - 1 || 1)) * w;+ const toY = (v) => h - ((v - min) / span) * h;++ const linePath = (s) => s.map((v, i) => `${i ? 'L' : 'M'}${toX(i, s.length).toFixed(2)} ${toY(v).toFixed(2)}`).join(' ');+ const areaPath = (s) => `${linePath(s)} L ${w} ${h} L 0 ${h} Z`;++ return (+ <svg+ className={cn('sk-area', className)}+ viewBox={`0 0 ${w} ${h}`}+ preserveAspectRatio="none"+ style={{ height }}+ aria-hidden="true"+ >+ <defs>+ {colors.map((c, i) => (+ <linearGradient key={i} id={`sk-area-${uid}-${i}`} x1="0" y1="0" x2="0" y2="1">+ <stop offset="0%" stopColor={c} stopOpacity="0.28" />+ <stop offset="100%" stopColor={c} stopOpacity="0" />+ </linearGradient>+ ))}+ </defs>+ {grid &&+ [0, 25, 50, 75, 100].map((y) => (+ <line key={y} x1="0" y1={y} x2={w} y2={y} stroke="var(--border-soft)" strokeWidth="0.4" vectorEffect="non-scaling-stroke" />+ ))}+ {data.map((s, i) => (+ <path key={`a${i}`} d={areaPath(s)} fill={`url(#sk-area-${uid}-${i % colors.length})`} />+ ))}+ {data.map((s, i) => (+ <path+ key={`l${i}`}+ d={linePath(s)}+ fill="none"+ stroke={colors[i % colors.length]}+ strokeWidth="1.6"+ vectorEffect="non-scaling-stroke"+ strokeLinejoin="round"+ strokeLinecap="round"+ />+ ))}+ </svg>+ );+}++export default AreaChart;diff --git a/frontend/src/components/ds/Drawer.jsx b/frontend/src/components/ds/Drawer.jsxnew file mode 100644index 00000000..5e31c7b4--- /dev/null+++ b/frontend/src/components/ds/Drawer.jsx@@ -0,0 +1,48 @@+import { Sheet, SheetContent, SheetTitle } from '@/components/ui/sheet';+import { cn } from '@/lib/utils';++// Right-side slide-over, built on the existing shadcn Sheet (Radix dialog) so+// focus-trap / escape / overlay behavior is consistent. Renders the redesign's+// drawer-head chrome (icon chip + title + mono subtitle). Use this as the one+// shared drawer pattern instead of the per-feature drawers.+//+// <Drawer open={open} onOpenChange={setOpen} title="wp-config.php"+// subtitle="server filesystem" icon={<FileIcon/>} width={760}>+// …body…+// </Drawer>+export function Drawer({+ open,+ onOpenChange,+ title,+ subtitle,+ icon,+ iconColor,+ width = 720,+ side = 'right',+ headerExtra,+ className,+ children,+}) {+ return (+ <Sheet open={open} onOpenChange={onOpenChange}>+ <SheetContent side={side} className={cn('sk-drawer', className)} style={{ width, maxWidth: '95vw' }}>+ <div className="sk-drawer__head">+ {icon && (+ <span className="sk-drawer__ico" style={iconColor ? { color: iconColor } : undefined}>+ {icon}+ </span>+ )}+ <div style={{ flex: 1, minWidth: 0 }}>+ {/* SheetTitle is required by Radix for a11y; keep it as the visible title. */}+ <SheetTitle className="sk-drawer__title">{title}</SheetTitle>+ {subtitle && <div className="sk-drawer__sub">{subtitle}</div>}+ </div>+ {headerExtra}+ </div>+ <div className="sk-drawer__body">{children}</div>+ </SheetContent>+ </Sheet>+ );+}++export default Drawer;diff --git a/frontend/src/components/ds/EnvTag.jsx b/frontend/src/components/ds/EnvTag.jsxnew file mode 100644index 00000000..1634653f--- /dev/null+++ b/frontend/src/components/ds/EnvTag.jsx@@ -0,0 +1,17 @@+import { cn } from '@/lib/utils';++const ENV_MOD = { PROD: 'prod', PRODUCTION: 'prod', DEV: 'dev', DEVELOPMENT: 'dev', STAGING: 'staging' };++// Environment / category tag, e.g. <EnvTag env="PROD" />. SERVICE / unknown+// values render as the neutral tag style.+export function EnvTag({ env, className, children, ...props }) {+ const label = children ?? env;+ const mod = ENV_MOD[String(env ?? children ?? '').toUpperCase()];+ return (+ <span className={cn('sk-tag', mod && `sk-tag--${mod}`, className)} {...props}>+ {label}+ </span>+ );+}++export default EnvTag;diff --git a/frontend/src/components/ds/Feed.jsx b/frontend/src/components/ds/Feed.jsxnew file mode 100644index 00000000..c484c07d--- /dev/null+++ b/frontend/src/components/ds/Feed.jsx@@ -0,0 +1,24 @@+import { cn } from '@/lib/utils';++// Activity feed list. Compose with <FeedItem>.+export function Feed({ className, children }) {+ return <div className={cn('sk-feed', className)}>{children}</div>;+}++// A single feed row: a tinted icon chip, body content, and an optional time.+// `tone` is a semantic token name (green/cyan/amber/red/violet/accent).+export function FeedItem({ icon, tone, time, className, children }) {+ return (+ <div className={cn('sk-feed__item', className)}>+ <span className="sk-feed__dot" style={tone ? { color: `var(--${tone})` } : undefined}>+ {icon}+ </span>+ <div className="sk-feed__body">+ <div className="sk-feed__txt">{children}</div>+ {time && <div className="sk-feed__time">{time}</div>}+ </div>+ </div>+ );+}++export default Feed;diff --git a/frontend/src/components/ds/Gauge.jsx b/frontend/src/components/ds/Gauge.jsxnew file mode 100644index 00000000..e505270c--- /dev/null+++ b/frontend/src/components/ds/Gauge.jsx@@ -0,0 +1,15 @@+import { cn } from '@/lib/utils';+import { gaugeColor } from './utils';++// Thin inline meter bar. By default the fill is threshold-colored+// (red > 75, amber > 50, else accent); pass `color` to override.+export function Gauge({ value = 0, color, className }) {+ const pct = Math.max(0, Math.min(100, value));+ return (+ <div className={cn('sk-gauge', className)}>+ <span className="sk-gauge__fill" style={{ width: `${pct}%`, background: color || gaugeColor(pct) }} />+ </div>+ );+}++export default Gauge;diff --git a/frontend/src/components/ds/MetricCard.jsx b/frontend/src/components/ds/MetricCard.jsxnew file mode 100644index 00000000..babb0332--- /dev/null+++ b/frontend/src/components/ds/MetricCard.jsx@@ -0,0 +1,37 @@+import { cn } from '@/lib/utils';++// KPI / stat tile: icon chip + big value (+ optional unit) + label, with an+// optional trend delta in the top-right.+// tone: 'accent' | 'green' | 'cyan' | 'amber' | 'red' | 'violet'+// trendDir: 'up' | 'down' | 'flat'+export function MetricCard({+ icon,+ tone = 'accent',+ value,+ unit,+ label,+ trend,+ trendDir = 'flat',+ className,+ children,+ ...props+}) {+ return (+ <div className={cn('sk-kpi', className)} {...props}>+ <div className="sk-kpi__top">+ {icon && <span className={cn('sk-kpi__icon', `sk-kpi__icon--${tone}`)}>{icon}</span>}+ {trend != null && (+ <span className={cn('sk-kpi__trend', `sk-kpi__trend--${trendDir}`)}>{trend}</span>+ )}+ </div>+ <div className="sk-kpi__val">+ {value}+ {unit && <small> {unit}</small>}+ </div>+ {label && <div className="sk-kpi__label">{label}</div>}+ {children}+ </div>+ );+}++export default MetricCard;diff --git a/frontend/src/components/ds/Pill.jsx b/frontend/src/components/ds/Pill.jsxnew file mode 100644index 00000000..d5a3a8cd--- /dev/null+++ b/frontend/src/components/ds/Pill.jsx@@ -0,0 +1,14 @@+import { cn } from '@/lib/utils';++// Status pill: a small dot + label. Replaces ad-hoc per-page status badges.+// kind: 'green' | 'amber' | 'red' | 'cyan' | 'violet' | 'gray'+export function Pill({ kind = 'gray', dot = true, className, children, ...props }) {+ return (+ <span className={cn('sk-pill', `sk-pill--${kind}`, className)} {...props}>+ {dot && <span className="sk-pill__dot" />}+ {children}+ </span>+ );+}++export default Pill;diff --git a/frontend/src/components/ds/ScoreGauge.jsx b/frontend/src/components/ds/ScoreGauge.jsxnew file mode 100644index 00000000..137fe16f--- /dev/null+++ b/frontend/src/components/ds/ScoreGauge.jsx@@ -0,0 +1,33 @@+import { cn } from '@/lib/utils';++// Circular score ring (security posture / sender reputation). Renders a+// background track + a colored arc proportional to value/max.+export function ScoreGauge({ value = 0, max = 100, size = 120, stroke = 10, color = 'var(--green)', label, className }) {+ const pct = Math.max(0, Math.min(1, value / (max || 1)));+ const r = (size - stroke) / 2;+ const circ = 2 * Math.PI * r;+ return (+ <div className={cn('sk-score', className)} style={{ width: size, height: size }}>+ <svg className="sk-score__svg" width={size} height={size}>+ <circle cx={size / 2} cy={size / 2} r={r} fill="none" stroke="var(--surface-3)" strokeWidth={stroke} />+ <circle+ cx={size / 2}+ cy={size / 2}+ r={r}+ fill="none"+ stroke={color}+ strokeWidth={stroke}+ strokeDasharray={circ}+ strokeDashoffset={circ * (1 - pct)}+ strokeLinecap="round"+ />+ </svg>+ <div className="sk-score__center">+ <div className="sk-score__num" style={{ fontSize: size * 0.26 }}>{value}</div>+ {label && <div className="sk-score__label">{label}</div>}+ </div>+ </div>+ );+}++export default ScoreGauge;diff --git a/frontend/src/components/ds/SegControl.jsx b/frontend/src/components/ds/SegControl.jsxnew file mode 100644index 00000000..36a80bc9--- /dev/null+++ b/frontend/src/components/ds/SegControl.jsx@@ -0,0 +1,27 @@+import { cn } from '@/lib/utils';++// Segmented toggle. Replaces native <select> / filter-chip clusters.+// options: array of strings, or { value, label, icon?, count? } objects.+export function SegControl({ options = [], value, onChange, className, ...props }) {+ const items = options.map((o) => (typeof o === 'string' ? { value: o, label: o } : o));+ return (+ <div className={cn('sk-seg', className)} role="tablist" {...props}>+ {items.map((o) => (+ <button+ key={o.value}+ type="button"+ role="tab"+ aria-selected={value === o.value}+ className={cn('sk-seg__btn', value === o.value && 'is-on')}+ onClick={() => onChange?.(o.value)}+ >+ {o.icon}+ {o.label}+ {o.count != null && <span className="sk-seg__count">{o.count}</span>}+ </button>+ ))}+ </div>+ );+}++export default SegControl;diff --git a/frontend/src/components/ds/ServiceTile.jsx b/frontend/src/components/ds/ServiceTile.jsxnew file mode 100644index 00000000..4ccba3fa--- /dev/null+++ b/frontend/src/components/ds/ServiceTile.jsx@@ -0,0 +1,24 @@+import { cn } from '@/lib/utils';+import { svcGrad, initials } from './utils';++// Gradient initial avatar. Defaults to a deterministic gradient + first letter+// derived from `name`; pass `gradient` and/or `label` to override.+export function ServiceTile({ name = '', size = 38, label, gradient, className, style, ...props }) {+ return (+ <span+ className={cn('sk-tile', className)}+ style={{+ width: size,+ height: size,+ fontSize: Math.round(size * 0.4),+ background: gradient || svcGrad(name),+ ...style,+ }}+ {...props}+ >+ {label || initials(name)}+ </span>+ );+}++export default ServiceTile;diff --git a/frontend/src/components/ds/Sparkline.jsx b/frontend/src/components/ds/Sparkline.jsxnew file mode 100644index 00000000..257f35f6--- /dev/null+++ b/frontend/src/components/ds/Sparkline.jsx@@ -0,0 +1,26 @@+import { cn } from '@/lib/utils';++// Tiny inline trend line. `data` is an array of numbers.+export function Sparkline({ data = [], color = 'var(--accent-bright)', width = 120, height = 34, className }) {+ if (!data.length) return null;+ const max = Math.max(...data);+ const min = Math.min(...data);+ const span = max - min || 1;+ const pts = data+ .map((v, i) => `${(i / (data.length - 1 || 1)) * width},${height - ((v - min) / span) * (height - 4) - 2}`)+ .join(' ');+ return (+ <svg className={cn('sk-spark', className)} width={width} height={height} aria-hidden="true">+ <polyline+ points={pts}+ fill="none"+ stroke={color}+ strokeWidth="1.6"+ strokeLinejoin="round"+ strokeLinecap="round"+ />+ </svg>+ );+}++export default Sparkline;diff --git a/frontend/src/components/ds/index.js b/frontend/src/components/ds/index.jsnew file mode 100644index 00000000..c3167369--- /dev/null+++ b/frontend/src/components/ds/index.js@@ -0,0 +1,15 @@+// ServerKit redesign design-system primitives (see docs/REDESIGN_MAP.md §3).+// Shared, reusable building blocks for the new "infra console" look. Styles+// live in styles/components/_design-system.scss (sk-* namespace).+export { Pill } from './Pill';+export { EnvTag } from './EnvTag';+export { SegControl } from './SegControl';+export { MetricCard } from './MetricCard';+export { Gauge } from './Gauge';+export { ServiceTile } from './ServiceTile';+export { Sparkline } from './Sparkline';+export { AreaChart } from './AreaChart';+export { ScoreGauge } from './ScoreGauge';+export { Feed, FeedItem } from './Feed';+export { Drawer } from './Drawer';+export { svcGrad, initials, gaugeColor } from './utils';diff --git a/frontend/src/components/ds/utils.js b/frontend/src/components/ds/utils.jsnew file mode 100644index 00000000..83c2046c--- /dev/null+++ b/frontend/src/components/ds/utils.js@@ -0,0 +1,23 @@+// Helpers for the design-system primitives (see docs/REDESIGN_MAP.md §3).++// Deterministic gradient from a name — used by ServiceTile and elsewhere a+// colored initial avatar is needed. Same name always yields the same hue.+export function svcGrad(name = '') {+ let h = 0;+ for (let i = 0; i < name.length; i++) {+ h = (h * 31 + name.charCodeAt(i)) % 360;+ }+ return `linear-gradient(150deg, hsl(${h} 58% 60%), hsl(${(h + 24) % 360} 55% 46%))`;+}++// First letter (uppercased) for an avatar/tile label.+export function initials(name = '') {+ return (name.trim()[0] || '?').toUpperCase();+}++// Threshold color for a percentage gauge (red > 75, amber > 50, else accent).+export function gaugeColor(pct) {+ if (pct > 75) return 'var(--red)';+ if (pct > 50) return 'var(--amber)';+ return 'var(--accent-bright)';+}diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.jsindex 3886bd10..eaeb4b41 100644--- a/frontend/src/components/sidebarItems.js+++ b/frontend/src/components/sidebarItems.js@@ -88,6 +88,12 @@ export const SIDEBAR_ITEMS = [category: 'infrastructure',icon: '<rect x="2" y="7" width="6" height="6" rx="1"/><rect x="9" y="7" width="6" height="6" rx="1"/><rect x="16" y="7" width="6" height="6" rx="1"/><rect x="2" y="14" width="6" height="6" rx="1"/><rect x="9" y="14" width="6" height="6" rx="1"/>'},+ // NOTE: "Git" appears under Infrastructure too, but it is contributed by the+ // built-in serverkit-git PLUGIN (see plugins/contributions.js), which also+ // registers the /git route. Keeping it plugin-owned means it correctly+ // disappears (no dead link) when the plugin is disabled — so do NOT add a+ // core 'git' item here. Sidebar presets that list 'git' still hide the+ // plugin's nav item via getHiddenItemIds().{id: 'files',label: 'Files',diff --git a/frontend/src/contexts/ThemeContext.jsx b/frontend/src/contexts/ThemeContext.jsxindex bfabada4..40cbad5d 100644--- a/frontend/src/contexts/ThemeContext.jsx+++ b/frontend/src/contexts/ThemeContext.jsx@@ -2,7 +2,7 @@ import React, { createContext, useContext, useState, useEffect, useCallback } frconst ThemeContext = createContext(null);-const DEFAULT_ACCENT = '#6366f1';+const DEFAULT_ACCENT = '#6d7cff';const DEFAULT_WHITE_LABEL = {enabled: false,@@ -22,7 +22,7 @@ function getResolvedTheme(theme) {// Convert hex to { r, g, b }function hexToRgb(hex) {const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);- if (!result) return { r: 99, g: 102, b: 241 };+ if (!result) return { r: 109, g: 124, b: 255 };return {r: parseInt(result[1], 16),g: parseInt(result[2], 16),@@ -30,27 +30,42 @@ function hexToRgb(hex) {};}-// Derive accent color variants from a hex color+const toHex = (v) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, '0');+const rgbToHex = (r, g, b) => `#${toHex(r)}${toHex(g)}${toHex(b)}`;++// Derive the full accent ramp from a single hex. The redesign needs brighter+// (toward white) and dimmer (toward black) stops plus translucent washes so+// the new design-system primitives track a custom/workspace accent.function deriveAccentVariants(hex) {const { r, g, b } = hexToRgb(hex);- // Darken by ~12% for hover- const darken = (v) => Math.max(0, Math.round(v * 0.88));+ const darken = (v) => v * 0.88; // hover+ const dim = (v) => v * 0.70; // --accent-dim+ const bright = (v) => v + (255 - v) * 0.30; // --accent-bright, toward whitereturn {primary: hex,- hover: `#${darken(r).toString(16).padStart(2, '0')}${darken(g).toString(16).padStart(2, '0')}${darken(b).toString(16).padStart(2, '0')}`,- glow: `rgba(${r}, ${g}, ${b}, 0.15)`,+ hover: rgbToHex(darken(r), darken(g), darken(b)),+ bright: rgbToHex(bright(r), bright(g), bright(b)),+ dim: rgbToHex(dim(r), dim(g), dim(b)),+ bg: `rgba(${r}, ${g}, ${b}, 0.13)`,+ bgSoft: `rgba(${r}, ${g}, ${b}, 0.07)`,+ glow: `rgba(${r}, ${g}, ${b}, 0.35)`,shadow: `rgba(${r}, ${g}, ${b}, 0.3)`,};}// Apply accent CSS custom properties to the documentfunction applyAccentToDOM(hex) {- const variants = deriveAccentVariants(hex);+ const v = deriveAccentVariants(hex);const style = document.documentElement.style;- style.setProperty('--accent-primary', variants.primary);- style.setProperty('--accent-hover', variants.hover);- style.setProperty('--accent-glow', variants.glow);- style.setProperty('--accent-shadow', variants.shadow);+ style.setProperty('--accent-primary', v.primary);+ style.setProperty('--accent', v.primary);+ style.setProperty('--accent-hover', v.hover);+ style.setProperty('--accent-bright', v.bright);+ style.setProperty('--accent-dim', v.dim);+ style.setProperty('--accent-bg', v.bg);+ style.setProperty('--accent-bg-soft', v.bgSoft);+ style.setProperty('--accent-glow', v.glow);+ style.setProperty('--accent-shadow', v.shadow);}export function ThemeProvider({ children }) {diff --git a/frontend/src/styles/_theme-variables.scss b/frontend/src/styles/_theme-variables.scssindex 2bc97250..a2bb0a10 100644--- a/frontend/src/styles/_theme-variables.scss+++ b/frontend/src/styles/_theme-variables.scss@@ -3,138 +3,217 @@// ============================================// CSS Custom Properties that enable runtime theme switching.// Must be imported FIRST before _variables.scss+//+// REDESIGN NOTE (see docs/REDESIGN_MAP.md §1.1):+// The new "infra console" palette is applied by REMAPPING existing token+// *values* (so every page reads the new tone through its current+// $bg-*/$text-*/$accent-* names) and by ADDING the prototype's token names+// (--surface*, --text-dim/-faint/-ghost, --accent-bright/-dim/-bg, --green,+// --cyan, --violet, …) so new design-system primitives can use them directly.+// Tokens are NEVER renamed — that would break the whole stylesheet.// ============================================// --------------------------------------------// DARK THEME (Default)// --------------------------------------------:root {- // Background colors- --bg-body: #09090b;- --bg-sidebar: #0f0f11;- --bg-card: #18181b;- --bg-hover: #27272a;- --bg-elevated: #1f1f23;- --bg-secondary: #27272a;- --bg-tertiary: #3f3f46;-- // Border colors- --border-default: #3f3f46;- --border-subtle: #27272a;- --border-active: #52525b;- --border-hover: #52525b;-- // Text colors- --text-primary: #f4f4f5;- --text-secondary: #f1f1ff;- --text-tertiary: #bebed1;-- // Shadows- --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);- --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);- --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);-- // Scrollbar- --scrollbar-track: #18181b;- --scrollbar-thumb: #3f3f46;- --scrollbar-thumb-hover: #52525b;-- // Code / terminal- --bg-code: #1a1a2e;+ // ---- Backgrounds (existing names, remapped values) ----+ --bg-body: #0a0b0e;+ --bg-sidebar: #0d0f15;+ --bg-card: #101218; // = --surface+ --bg-hover: #1a1e27; // = --surface-hover+ --bg-elevated: #161922; // = --surface-2+ --bg-secondary: #161922; // = --surface-2+ --bg-tertiary: #1c2029; // = --surface-3++ // ---- Backgrounds (new prototype names) ----+ --surface: #101218;+ --surface-2: #161922;+ --surface-3: #1c2029;+ --surface-hover: #1a1e27;++ // ---- Borders (existing names, remapped values) ----+ --border-default: #23272f; // = --border+ --border-subtle: #191c23; // = --border-soft+ --border-active: #2c313b; // = --border-strong+ --border-hover: #2c313b;++ // ---- Borders (new prototype names) ----+ --border: #23272f;+ --border-soft: #191c23;+ --border-strong: #2c313b;++ // ---- Text (existing names, remapped to the new 4-tier ramp) ----+ --text-primary: #e9ebf0; // = --text+ --text-secondary: #9aa1af; // = --text-dim+ --text-tertiary: #646b7a; // = --text-faint++ // ---- Text (new prototype names) ----+ --text: #e9ebf0;+ --text-dim: #9aa1af;+ --text-faint: #646b7a;+ --text-ghost: #444b58;++ // ---- Accent (existing names; defaults match the new periwinkle.+ // --accent-primary/-hover/-bright/-dim/-bg* are overridden at runtime+ // by ThemeContext so custom/workspace accents stay consistent) ----+ --accent-primary: #6d7cff;+ --accent-hover: #5a67e8;+ --accent-glow: rgba(109, 124, 255, 0.35);+ --accent-shadow: rgba(109, 124, 255, 0.3);++ // ---- Accent (new prototype names) ----+ --accent: #6d7cff;+ --accent-bright: #8b93ff;+ --accent-dim: #4954cc;+ --accent-bg: rgba(109, 124, 255, 0.13);+ --accent-bg-soft: rgba(109, 124, 255, 0.07);++ // ---- Semantic colors (theme-independent; new prototype palette) ----+ --green: #3ddc97;+ --green-bg: rgba(61, 220, 151, 0.12);+ --amber: #f5b945;+ --amber-bg: rgba(245, 185, 69, 0.12);+ --red: #fb6f6f;+ --red-bg: rgba(251, 111, 111, 0.12);+ --cyan: #49c7f0;+ --cyan-bg: rgba(73, 199, 240, 0.12);+ --violet: #b07bf5;+ --violet-bg: rgba(176, 123, 245, 0.12);++ // ---- Radius scale (new) ----+ --radius: 10px;+ --radius-sm: 7px;+ --radius-lg: 14px;++ // ---- Fonts (new; IBM Plex) ----+ --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;+ --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;++ // ---- Shadows ----+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);+ --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);+ --shadow-lg: 0 20px 48px -12px rgba(0, 0, 0, 0.65);++ // ---- Scrollbar ----+ --scrollbar-track: #101218;+ --scrollbar-thumb: #2a2f3a;+ --scrollbar-thumb-hover: #363c49;++ // ---- Code / terminal ----+ --bg-code: #0d1017;--text-code: #e2e8f0;- // Grid pattern+ // ---- Grid pattern ------grid-color: rgba(255, 255, 255, 0.02);-- // Accent colors (overridden at runtime by ThemeContext)- --accent-primary: #6366f1;- --accent-hover: #4f46e5;- --accent-glow: rgba(99, 102, 241, 0.15);- --accent-shadow: rgba(99, 102, 241, 0.3);}// --------------------------------------------// LIGHT THEME// --------------------------------------------[data-theme="light"] {- // Background colors- --bg-body: #f8fafc;- --bg-sidebar: #f1f5f9;+ // ---- Backgrounds ----+ --bg-body: #f6f7fb;+ --bg-sidebar: #f1f3f9;--bg-card: #ffffff;- --bg-hover: #f1f5f9;+ --bg-hover: #eef1f7;--bg-elevated: #ffffff;- --bg-secondary: #e2e8f0;- --bg-tertiary: #cbd5e1;-- // Border colors- --border-default: #e2e8f0;- --border-subtle: #e2e8f0;- --border-active: #cbd5e1;- --border-hover: #cbd5e1;-- // Text colors- --text-primary: #0f172a;- --text-secondary: #475569;- --text-tertiary: #64748b;-- // Shadows (lighter for light theme)- --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);- --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);- --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);-- // Scrollbar- --scrollbar-track: #f1f5f9;- --scrollbar-thumb: #cbd5e1;- --scrollbar-thumb-hover: #94a3b8;-- // Code / terminal- --bg-code: #f1f5f9;+ --bg-secondary: #f1f3f9;+ --bg-tertiary: #e6e9f2;+ --surface: #ffffff;+ --surface-2: #f6f7fb;+ --surface-3: #eef1f7;+ --surface-hover: #eef1f7;++ // ---- Borders ----+ --border-default: #e2e6ef;+ --border-subtle: #eef1f7;+ --border-active: #cdd3e0;+ --border-hover: #cdd3e0;+ --border: #e2e6ef;+ --border-soft: #eef1f7;+ --border-strong: #cdd3e0;++ // ---- Text ----+ --text-primary: #161a23;+ --text-secondary: #515a6b;+ --text-tertiary: #79818f;+ --text: #161a23;+ --text-dim: #515a6b;+ --text-faint: #79818f;+ --text-ghost: #a6adba;++ // ---- Accent washes (lighter on light surfaces) ----+ --accent-bg: rgba(109, 124, 255, 0.10);+ --accent-bg-soft: rgba(109, 124, 255, 0.05);+ --accent-glow: rgba(109, 124, 255, 0.22);++ // ---- Shadows (lighter for light theme) ----+ --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);+ --shadow-md: 0 6px 16px -6px rgba(16, 24, 40, 0.12);+ --shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, 0.18);++ // ---- Scrollbar ----+ --scrollbar-track: #f1f3f9;+ --scrollbar-thumb: #cdd3e0;+ --scrollbar-thumb-hover: #aab2c2;++ // ---- Code / terminal ----+ --bg-code: #f1f3f9;--text-code: #334155;- // Grid pattern (purple accent for visibility)- --grid-color: rgba(99, 102, 241, 0.06);+ // ---- Grid pattern ----+ --grid-color: rgba(109, 124, 255, 0.06);}// ---------------------------------------------// SYSTEM THEME (follows OS preference)+// SYSTEM THEME (follows OS preference → light overrides only)// --------------------------------------------@media (prefers-color-scheme: light) {[data-theme="system"] {- // Background colors- --bg-body: #f8fafc;- --bg-sidebar: #f1f5f9;+ --bg-body: #f6f7fb;+ --bg-sidebar: #f1f3f9;--bg-card: #ffffff;- --bg-hover: #f1f5f9;+ --bg-hover: #eef1f7;--bg-elevated: #ffffff;- --bg-secondary: #e2e8f0;- --bg-tertiary: #cbd5e1;-- // Border colors- --border-default: #e2e8f0;- --border-subtle: #e2e8f0;- --border-active: #cbd5e1;- --border-hover: #cbd5e1;-- // Text colors- --text-primary: #0f172a;- --text-secondary: #475569;- --text-tertiary: #64748b;-- // Shadows- --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);- --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);- --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);-- // Scrollbar- --scrollbar-track: #f1f5f9;- --scrollbar-thumb: #cbd5e1;- --scrollbar-thumb-hover: #94a3b8;-- // Code / terminal- --bg-code: #f1f5f9;+ --bg-secondary: #f1f3f9;+ --bg-tertiary: #e6e9f2;+ --surface: #ffffff;+ --surface-2: #f6f7fb;+ --surface-3: #eef1f7;+ --surface-hover: #eef1f7;++ --border-default: #e2e6ef;+ --border-subtle: #eef1f7;+ --border-active: #cdd3e0;+ --border-hover: #cdd3e0;+ --border: #e2e6ef;+ --border-soft: #eef1f7;+ --border-strong: #cdd3e0;++ --text-primary: #161a23;+ --text-secondary: #515a6b;+ --text-tertiary: #79818f;+ --text: #161a23;+ --text-dim: #515a6b;+ --text-faint: #79818f;+ --text-ghost: #a6adba;++ --accent-bg: rgba(109, 124, 255, 0.10);+ --accent-bg-soft: rgba(109, 124, 255, 0.05);+ --accent-glow: rgba(109, 124, 255, 0.22);++ --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);+ --shadow-md: 0 6px 16px -6px rgba(16, 24, 40, 0.12);+ --shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, 0.18);++ --scrollbar-track: #f1f3f9;+ --scrollbar-thumb: #cdd3e0;+ --scrollbar-thumb-hover: #aab2c2;++ --bg-code: #f1f3f9;--text-code: #334155;- // Grid pattern (purple accent for visibility)- --grid-color: rgba(99, 102, 241, 0.06);+ --grid-color: rgba(109, 124, 255, 0.06);}}diff --git a/frontend/src/styles/_variables.scss b/frontend/src/styles/_variables.scssindex 98a4f4c5..f0169c7c 100644--- a/frontend/src/styles/_variables.scss+++ b/frontend/src/styles/_variables.scss@@ -5,20 +5,22 @@// Raw values (*-raw) are kept for SCSS compile-time functions like fade().// ============================================-$white: #f4f4f5;-$black: #09090b;+$white: #e9ebf0;+$black: #0a0b0e;// --------------------------------------------// COLORS - Background (theme-sensitive)// ---------------------------------------------// Raw values for SCSS functions (dark theme defaults)-$bg-body-raw: #09090b;-$bg-sidebar-raw: #0f0f11;-$bg-card-raw: #18181b;-$bg-hover-raw: #27272a;-$bg-elevated-raw: #1f1f23;-$bg-secondary-raw: #27272a;-$bg-tertiary-raw: #3f3f46;+// Raw values for SCSS functions (dark theme defaults).+// Remapped to the redesign "infra console" surface ramp — see+// docs/REDESIGN_MAP.md §1.1. var()-backed tokens below carry the runtime value.+$bg-body-raw: #0a0b0e;+$bg-sidebar-raw: #0d0f15;+$bg-card-raw: #101218;+$bg-hover-raw: #1a1e27;+$bg-elevated-raw: #161922;+$bg-secondary-raw: #161922;+$bg-tertiary-raw: #1c2029;// Themed values using CSS custom properties$bg-body: var(--bg-body);@@ -33,10 +35,10 @@ $bg-tertiary: var(--bg-tertiary);// COLORS - Borders (theme-sensitive)// --------------------------------------------// Raw values for SCSS functions-$border-default-raw: #27272a;-$border-subtle-raw: #27272a;-$border-active-raw: #3f3f46;-$border-hover-raw: #3f3f46;+$border-default-raw: #23272f;+$border-subtle-raw: #191c23;+$border-active-raw: #2c313b;+$border-hover-raw: #2c313b;// Themed values using CSS custom properties$border-default: var(--border-default);@@ -54,9 +56,9 @@ $border-hover: var(--border-hover);// legibility (see _theme-variables.scss). Rendered text color always comes// from the var()-backed $text-* tokens below; only low-opacity fills read// from these raws, where the exact base tone is visually negligible.-$text-primary-raw: #f4f4f5;-$text-secondary-raw: #a1a1aa;-$text-tertiary-raw: #71717a;+$text-primary-raw: #e9ebf0;+$text-secondary-raw: #9aa1af;+$text-tertiary-raw: #646b7a;// Themed values using CSS custom properties$text-primary: var(--text-primary);@@ -67,10 +69,10 @@ $text-tertiary: var(--text-tertiary);// COLORS - Accent// --------------------------------------------// Raw values for SCSS compile-time functions (fade, darken, etc.)-$accent-primary-raw: #6366f1;-$accent-hover-raw: #4f46e5;-$accent-glow-raw: rgba(99, 102, 241, 0.15);-$accent-shadow-raw: rgba(99, 102, 241, 0.3);+$accent-primary-raw: #6d7cff;+$accent-hover-raw: #5a67e8;+$accent-glow-raw: rgba(109, 124, 255, 0.35);+$accent-shadow-raw: rgba(109, 124, 255, 0.3);// Themed values using CSS custom properties (runtime-switchable)$accent-primary: var(--accent-primary);@@ -78,25 +80,40 @@ $accent-hover: var(--accent-hover);$accent-glow: var(--accent-glow);$accent-shadow: var(--accent-shadow);+// Brighter/dimmer accent stops (redesign) — var()-backed so they track the+// user's/workspace's runtime accent (set by ThemeContext).+$accent-bright: var(--accent-bright);+$accent-dim: var(--accent-dim);+$accent-bg: var(--accent-bg);+$accent-bg-soft: var(--accent-bg-soft);+// --------------------------------------------// COLORS - Semantic// ---------------------------------------------$success: #10b981;-$success-bg: rgba(16, 185, 129, 0.1);-$success-border: rgba(16, 185, 129, 0.2);+// Redesign "infra console" semantic palette (raw hex so SCSS fade()/darken()+// keep working). The matching --green/--amber/--red/--cyan/--violet CSS vars+// live in _theme-variables.scss for design-system primitives.+$success: #3ddc97;+$success-bg: rgba(61, 220, 151, 0.12);+$success-border: rgba(61, 220, 151, 0.22);++$warning: #f5b945;+$warning-bg: rgba(245, 185, 69, 0.12);+$warning-border: rgba(245, 185, 69, 0.22);-$warning: #f59e0b;-$warning-bg: rgba(245, 158, 11, 0.1);-$warning-border: rgba(245, 158, 11, 0.2);+$danger: #fb6f6f;+$danger-hover: #e95f5f;+$danger-bg: rgba(251, 111, 111, 0.12);+$danger-border: rgba(251, 111, 111, 0.22);-$danger: #ef4444;-$danger-hover: #dc2626;-$danger-bg: rgba(239, 68, 68, 0.1);-$danger-border: rgba(239, 68, 68, 0.2);+$info: #49c7f0;+$info-bg: rgba(73, 199, 240, 0.12);+$info-border: rgba(73, 199, 240, 0.22);-$info: #3b82f6;-$info-bg: rgba(59, 130, 246, 0.1);-$info-border: rgba(59, 130, 246, 0.2);+$cyan: #49c7f0;+$cyan-bg: rgba(73, 199, 240, 0.12);+$violet: #b07bf5;+$violet-bg: rgba(176, 123, 245, 0.12);// --------------------------------------------// COLORS - Brand (Database/Docker icons)@@ -123,8 +140,8 @@ $color-star: #f59e0b;// --------------------------------------------// TYPOGRAPHY// ---------------------------------------------$font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;-$font-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;+$font-main: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;+$font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;$font-size-xs: 10px;$font-size-sm: 12px;@@ -198,7 +215,7 @@ $ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);// --------------------------------------------// LAYOUT// ---------------------------------------------$sidebar-width: 280px;+$sidebar-width: 250px;$header-height: 64px;$mobile-header-height: 56px;$sidebar-header-height: 70px;diff --git a/frontend/src/styles/base/_fonts.scss b/frontend/src/styles/base/_fonts.scssnew file mode 100644index 00000000..ed23869e--- /dev/null+++ b/frontend/src/styles/base/_fonts.scss@@ -0,0 +1,66 @@+// ============================================================+// SELF-HOSTED FONTS — IBM Plex Sans + IBM Plex Mono+// ============================================================+// Privacy: ServerKit is a self-hosted control panel, so we do NOT load fonts+// from Google Fonts (that would send every visitor's IP + page views to a+// third party). The woff2 files are served from our own origin at /fonts/.+//+// The files live in frontend/public/fonts/ — fetch them once with:+// node frontend/scripts/fetch-fonts.mjs+// (they're OFL-licensed, vendored from the @fontsource mirror). Until they+// exist the stack falls back to system-ui, so the app never breaks.+//+// IBM Plex publishes weights in steps of 100; the prototype's 450/550 requests+// round to the nearest available face (400/500) automatically.+// ============================================================++@font-face {+ font-family: 'IBM Plex Sans';+ font-style: normal;+ font-weight: 400;+ font-display: swap;+ src: url('/fonts/ibm-plex-sans-400.woff2') format('woff2');+}+@font-face {+ font-family: 'IBM Plex Sans';+ font-style: normal;+ font-weight: 500;+ font-display: swap;+ src: url('/fonts/ibm-plex-sans-500.woff2') format('woff2');+}+@font-face {+ font-family: 'IBM Plex Sans';+ font-style: normal;+ font-weight: 600;+ font-display: swap;+ src: url('/fonts/ibm-plex-sans-600.woff2') format('woff2');+}+@font-face {+ font-family: 'IBM Plex Sans';+ font-style: normal;+ font-weight: 700;+ font-display: swap;+ src: url('/fonts/ibm-plex-sans-700.woff2') format('woff2');+}++@font-face {+ font-family: 'IBM Plex Mono';+ font-style: normal;+ font-weight: 400;+ font-display: swap;+ src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');+}+@font-face {+ font-family: 'IBM Plex Mono';+ font-style: normal;+ font-weight: 500;+ font-display: swap;+ src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');+}+@font-face {+ font-family: 'IBM Plex Mono';+ font-style: normal;+ font-weight: 600;+ font-display: swap;+ src: url('/fonts/ibm-plex-mono-600.woff2') format('woff2');+}diff --git a/frontend/src/styles/components/_design-system.scss b/frontend/src/styles/components/_design-system.scssnew file mode 100644index 00000000..bb69a951--- /dev/null+++ b/frontend/src/styles/components/_design-system.scss@@ -0,0 +1,252 @@+// ============================================================+// REDESIGN DESIGN-SYSTEM PRIMITIVES (see docs/REDESIGN_MAP.md §3)+// ============================================================+// Shared, reusable building blocks for the new "infra console" look.+// Namespaced with `sk-` so they NEVER collide with the live app's existing+// generic classes (.card/.input/.switch/.tag/.modal/.empty/.row/.col …).+// Consumers use the React components in src/components/ds/*, not raw classes.+// All colors come from the var()-backed tokens in _theme-variables.scss.+// ============================================================++// ---- semantic tone helper map (used by Pill/MetricCard/Gauge tints) ----+$sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');++// ------------------------------------------------------------+// Pill — status badge (dot + label)+// ------------------------------------------------------------+.sk-pill {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 3px 9px;+ border-radius: 6px;+ font-size: 11.5px;+ font-weight: 500;+ font-family: var(--mono);+ letter-spacing: 0.02em;+ white-space: nowrap;++ &__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }++ &--green { background: var(--green-bg); color: var(--green); .sk-pill__dot { background: var(--green); box-shadow: 0 0 6px var(--green); } }+ &--amber { background: var(--amber-bg); color: var(--amber); .sk-pill__dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); } }+ &--red { background: var(--red-bg); color: var(--red); .sk-pill__dot { background: var(--red); } }+ &--cyan { background: var(--cyan-bg); color: var(--cyan); .sk-pill__dot { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); } }+ &--violet{ background: var(--violet-bg);color: var(--violet);.sk-pill__dot { background: var(--violet); box-shadow: 0 0 6px var(--violet); } }+ &--gray { background: var(--surface-3); color: var(--text-faint); .sk-pill__dot { background: var(--text-faint); } }+}++// ------------------------------------------------------------+// EnvTag — environment / category tag (PROD / DEV / STAGING …)+// ------------------------------------------------------------+.sk-tag {+ display: inline-flex;+ align-items: center;+ padding: 2px 7px;+ border-radius: 5px;+ font-family: var(--mono);+ font-size: 10.5px;+ font-weight: 600;+ letter-spacing: 0.06em;+ border: 1px solid var(--border-strong);+ color: var(--text-dim);+ background: var(--surface-2);++ &--prod { color: var(--green); border-color: rgba(61, 220, 151, 0.3); background: var(--green-bg); }+ &--dev { color: var(--cyan); border-color: rgba(73, 199, 240, 0.3); background: var(--cyan-bg); }+ &--staging { color: var(--amber); border-color: rgba(245, 185, 69, 0.3); background: var(--amber-bg); }+}++// ------------------------------------------------------------+// SegControl — segmented toggle (replaces native <select>/filter chips)+// ------------------------------------------------------------+.sk-seg {+ display: inline-flex;+ gap: 2px;+ background: var(--surface-2);+ border: 1px solid var(--border);+ border-radius: 9px;+ padding: 3px;++ &__btn {+ display: inline-flex;+ align-items: center;+ gap: 7px;+ padding: 6px 12px;+ border-radius: 6px;+ font-size: 12.5px;+ color: var(--text-faint);+ font-weight: 500;+ font-family: inherit;+ background: none;+ border: none;+ cursor: pointer;+ transition: 0.14s;++ &:hover { color: var(--text-dim); }+ &.is-on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }++ .sk-seg__count { font-family: var(--mono); font-size: 10.5px; opacity: 0.7; }+ }+}++// ------------------------------------------------------------+// MetricCard / KPI tile+// ------------------------------------------------------------+.sk-kpi {+ background: var(--surface);+ border: 1px solid var(--border-soft);+ border-radius: var(--radius);+ padding: 16px 17px;+ position: relative;+ overflow: hidden;+ transition: border-color 0.15s;++ &:hover { border-color: var(--border-strong); }++ &__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }+ &__icon {+ width: 32px; height: 32px; border-radius: 8px;+ display: grid; place-items: center;+ background: var(--surface-2); color: var(--text-dim);++ &--accent { background: var(--accent-bg); color: var(--accent-bright); }+ &--green { background: var(--green-bg); color: var(--green); }+ &--cyan { background: var(--cyan-bg); color: var(--cyan); }+ &--amber { background: var(--amber-bg); color: var(--amber); }+ &--red { background: var(--red-bg); color: var(--red); }+ &--violet { background: var(--violet-bg); color: var(--violet); }+ }+ &__val {+ font-family: var(--mono); font-size: 27px; font-weight: 600;+ letter-spacing: -0.02em; line-height: 1;+ small { font-size: 14px; color: var(--text-faint); font-weight: 500; }+ }+ &__label { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; }+ // Optional mono detail row beneath the value (e.g. "Total 32 · Cached 4").+ &__sub {+ font-family: var(--mono);+ font-size: 11.5px;+ color: var(--text-faint);+ margin-top: 8px;+ display: flex;+ gap: 14px;+ flex-wrap: wrap;+ }+ &__trend {+ font-family: var(--mono); font-size: 11px;+ display: flex; align-items: center; gap: 4px;+ &--up { color: var(--green); }+ &--down { color: var(--red); }+ &--flat { color: var(--text-faint); }+ }+}++// ------------------------------------------------------------+// Gauge — thin inline meter bar (threshold-colored fill)+// ------------------------------------------------------------+.sk-gauge {+ height: 5px;+ border-radius: 3px;+ background: var(--surface-3);+ overflow: hidden;++ &__fill { display: block; height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }+}++// ------------------------------------------------------------+// ServiceTile — gradient initial avatar+// ------------------------------------------------------------+.sk-tile {+ border-radius: 10px;+ display: grid;+ place-items: center;+ font-family: var(--mono);+ font-weight: 700;+ color: #fff;+ flex-shrink: 0;+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);+}++// ------------------------------------------------------------+// Sparkline / AreaChart — sizing wrappers (geometry is in the SVG)+// ------------------------------------------------------------+.sk-spark { display: block; overflow: visible; }+.sk-area { display: block; width: 100%; }++// ------------------------------------------------------------+// ScoreGauge — SVG ring (security / reputation posture)+// ------------------------------------------------------------+.sk-score {+ position: relative;+ display: inline-grid;+ place-items: center;++ &__svg { transform: rotate(-90deg); }+ &__center { position: absolute; text-align: center; }+ &__num { font-family: var(--mono); font-weight: 600; line-height: 1; }+ &__label { font-size: 11px; color: var(--text-faint); margin-top: 3px; }+}++// ------------------------------------------------------------+// Feed — activity list (colored dot + html text + time)+// ------------------------------------------------------------+.sk-feed {+ &__item {+ display: flex; gap: 13px; padding: 11px 0; position: relative;+ & + .sk-feed__item { border-top: 1px solid var(--border-soft); }+ }+ &__dot {+ width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;+ display: grid; place-items: center; background: var(--surface-2);+ }+ &__body { flex: 1; min-width: 0; }+ &__txt { font-size: 13px; line-height: 1.45; b { font-weight: 600; color: var(--text); } }+ &__time { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }+}++// ------------------------------------------------------------+// DataTable — dense list table. Apply `.sk-dtable` to a <table>.+// (kept as a style class, not a component, so pages stay flexible)+// ------------------------------------------------------------+.sk-dtable {+ width: 100%;+ border-collapse: collapse;+ font-size: 13px;++ thead th {+ text-align: left;+ font-family: var(--mono);+ font-size: 10.5px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--text-faint);+ font-weight: 600;+ padding: 11px 16px;+ border-bottom: 1px solid var(--border);+ }+ tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }+ tbody tr { transition: background 0.12s; }+ tbody tr.is-clickable { cursor: pointer; }+ tbody tr:hover { background: var(--surface-2); }+ tbody tr:last-child td { border-bottom: none; }+ tbody tr.is-selected { background: var(--accent-bg-soft); &:hover { background: var(--accent-bg); } }++ .sk-cell-name { font-weight: 550; display: flex; align-items: center; gap: 11px; }+ .sk-cell-mono { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }+ .sk-cell-sub { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }+}++// ------------------------------------------------------------+// Drawer — right-side slide-over header chrome (panel comes from ui/sheet).+// ------------------------------------------------------------+.sk-drawer {+ &__head {+ display: flex; align-items: center; gap: 12px;+ padding: 15px 18px; border-bottom: 1px solid var(--border-soft); flex-shrink: 0;+ }+ &__ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--text-dim); }+ &__title { font-weight: 600; font-size: 14.5px; }+ &__sub { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 1px; }+ &__body { flex: 1; overflow: auto; min-height: 0; }+}diff --git a/frontend/src/styles/layout/_sidebar.scss b/frontend/src/styles/layout/_sidebar.scssindex 4da84892..a17f7d46 100644--- a/frontend/src/styles/layout/_sidebar.scss+++ b/frontend/src/styles/layout/_sidebar.scss@@ -4,8 +4,10 @@.sidebar {width: $sidebar-width;- background-color: $bg-body; // Seamless look with main content- border-right: 1px solid $border-default;+ // Subtle top→bottom gradient (theme-aware: dark rail in dark mode, light in+ // light mode). Redesign "infra console" look — see docs/REDESIGN_MAP.md §2.+ background: linear-gradient(180deg, var(--bg-sidebar), var(--bg-body));+ border-right: 1px solid $border-subtle;display: flex;flex-direction: column;position: fixed;@@ -165,30 +167,25 @@flex-shrink: 0;}+// Demo logo: a periwinkle gradient tile with a white server glyph..brand-logo {- width: $sidebar-logo-size;- height: $sidebar-logo-size;+ width: 34px;+ height: 34px;+ border-radius: 9px;display: grid;place-items: center;flex-shrink: 0;- position: relative;+ color: #fff;+ background: linear-gradient(160deg, var(--accent-bright), var(--accent));+ box-shadow: 0 4px 14px -2px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);- // Subtle glow behind logo- &::before {- content: '';- position: absolute;- inset: -6px;- background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);- border-radius: 14px;- filter: blur(10px);- opacity: 0.85;- z-index: -1;+ svg {+ stroke: #fff;}img {width: 100%;height: 100%;- filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));}}@@ -316,18 +313,18 @@}}-// Navigation Category Labels+// Navigation Category Labels — mono, uppercase, ghost (redesign).nav-category {- font-size: 0.7rem;- font-weight: $font-weight-semibold;- color: $text-secondary;+ font-family: var(--mono);+ font-size: 0.66rem;+ font-weight: $font-weight-medium;+ color: var(--text-ghost);text-transform: uppercase;- letter-spacing: 0.08em;- margin: 1.5rem 0 0.5rem 0.75rem;- opacity: 0.6;+ letter-spacing: 0.12em;+ margin: 1.5rem 0 0.5rem 0.65rem;&:first-of-type {- margin-top: 0.5rem;+ margin-top: 0.75rem;}}@@ -342,14 +339,14 @@.nav-item {display: flex;align-items: center;- gap: 16px;- padding: 0.5rem 0.75rem;- border-radius: $radius-lg;- color: $text-tertiary;+ gap: 11px;+ padding: 0.5rem 0.625rem;+ border-radius: 8px;+ color: var(--text-dim);text-decoration: none;- font-size: 0.85rem;- font-weight: $font-weight-medium;- transition: all 0.2s ease;+ font-size: 0.84rem;+ font-weight: 450;+ transition: background-color 0.14s ease, color 0.14s ease;margin-bottom: 2px;position: relative;white-space: nowrap;@@ -357,27 +354,39 @@text-overflow: ellipsis;@include focus-ring();- // Pro Hover State+ // Icons sit a notch dimmer than the label, then brighten on hover/active.+ .nav-icon {+ stroke: var(--text-faint);+ transition: stroke 0.14s ease;+ }++ // Hover&:hover {- color: $text-primary;- background-color: rgba(255, 255, 255, 0.03);+ color: var(--text-primary);+ background-color: var(--surface-hover);++ .nav-icon { stroke: var(--text-dim); }}- // Pro Active State+ // Active — gradient wash + left accent bar + brightened icon&.active {- background-color: $accent-glow;- color: $accent-primary;+ background: linear-gradient(90deg, var(--accent-bg), var(--accent-bg-soft));+ color: var(--text-primary);+ font-weight: 500;- // Active Indicator Dot- &::after {+ .nav-icon { stroke: var(--accent-bright); }++ &::before {content: '';position: absolute;- right: 8px;- width: 4px;- height: 4px;- border-radius: 50%;- background-color: $accent-primary;- box-shadow: 0 0 6px $accent-primary;+ left: 0;+ top: 50%;+ transform: translateY(-50%);+ width: 3px;+ height: 18px;+ border-radius: 0 3px 3px 0;+ background: var(--accent);+ box-shadow: 0 0 10px var(--accent-glow);}}}@@ -414,8 +423,8 @@@include focus-ring();&:hover {- background: rgba(255, 255, 255, 0.06);- color: $text-primary;+ background: var(--surface-hover);+ color: var(--text-primary);}svg {@@ -450,7 +459,7 @@.sidebar-footer {padding: 1rem 0;margin-top: auto;- border-top: 1px solid $border-default;+ border-top: 1px solid $border-subtle;flex-shrink: 0;position: relative;}@@ -461,10 +470,10 @@bottom: calc(100% + 4px);left: 0;right: 0;- background: $bg-elevated;- border: 1px solid $border-subtle;- border-radius: $radius-lg;- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);+ background: var(--surface-2);+ border: 1px solid var(--border-strong);+ border-radius: var(--radius-lg);+ box-shadow: var(--shadow-lg);padding: $space-1;z-index: $z-tooltip;animation: contextMenuIn 0.15s ease-out;@@ -486,21 +495,22 @@}.context-menu-label {- font-size: 0.65rem;- font-weight: $font-weight-semibold;- color: $text-secondary;+ font-family: var(--mono);+ font-size: 0.6rem;+ font-weight: $font-weight-medium;+ color: var(--text-ghost);text-transform: uppercase;- letter-spacing: 0.06em;+ letter-spacing: 0.12em;margin-bottom: 6px;- opacity: 0.6;}.theme-switcher {display: flex;gap: 2px;- background: $bg-secondary;- border-radius: $radius-md;- padding: 2px;+ background: var(--surface);+ border: 1px solid var(--border);+ border-radius: 9px;+ padding: 3px;}.theme-btn {@@ -511,20 +521,19 @@padding: 6px 0;border: none;background: transparent;- color: $text-tertiary;- border-radius: $radius-sm;+ color: var(--text-faint);+ border-radius: 6px;cursor: pointer;transition: all 0.15s ease;@include focus-ring();&:hover {- color: $text-primary;+ color: var(--text-primary);}&.active {- background: $accent-glow;- color: $accent-primary;- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);+ background: var(--accent-bg);+ color: var(--accent-bright);}}@@ -539,32 +548,32 @@align-items: center;gap: 4px;padding: 4px 8px;- border: 1px solid $border-subtle;- background: transparent;- color: $text-tertiary;+ border: 1px solid var(--border);+ background: var(--surface-2);+ color: var(--text-faint);font-size: 0.65rem;font-weight: $font-weight-medium;- border-radius: $radius-sm;+ border-radius: 6px;cursor: pointer;transition: all 0.15s ease;@include focus-ring();&:hover {- border-color: $border-active;- color: $text-primary;- background: rgba(255, 255, 255, 0.03);+ border-color: var(--border-strong);+ color: var(--text-primary);+ background: var(--surface-3);}&.active {- border-color: $accent-primary;- color: $accent-primary;- background: $accent-glow;+ border-color: var(--accent-dim);+ color: var(--accent-bright);+ background: var(--accent-bg);}}.context-menu-divider {height: 1px;- background: $border-subtle;+ background: var(--border-soft);margin: $space-1 0;}@@ -586,15 +595,15 @@@include focus-ring();&:hover {- background: rgba(255, 255, 255, 0.04);- color: $text-primary;+ background: var(--surface-3);+ color: var(--text-primary);}&.danger {color: $danger;&:hover {- background: rgba(239, 68, 68, 0.1);+ background: var(--red-bg);color: $danger;}}@@ -624,20 +633,22 @@@include focus-ring();&:hover {- background: $bg-secondary;+ background: var(--surface-2);}}.user-avatar {- width: 28px;- height: 28px;- background: $text-tertiary;- border-radius: 50%;+ width: 32px;+ height: 32px;+ background: linear-gradient(150deg, var(--surface-3), var(--surface-2));+ border: 1px solid var(--border-strong);+ border-radius: 9px;display: grid;place-items: center;- font-size: 0.75rem;+ font-family: var(--mono);+ font-size: 0.78rem;font-weight: $font-weight-semibold;- color: white;+ color: var(--text-primary);}.user-menu-arrow {@@ -663,22 +674,25 @@.user-handle {font-size: 0.8rem;- font-weight: $font-weight-medium;- color: $text-primary;+ font-weight: 550;+ color: var(--text-primary);}.user-status {- font-size: 0.7rem;- color: $success;+ font-family: var(--mono);+ font-size: 0.64rem;+ color: var(--green);display: flex;align-items: center;- gap: 4px;+ gap: 5px;+ margin-top: 1px;&::before {content: '';- width: 6px;- height: 6px;+ width: 5px;+ height: 5px;background: currentColor;border-radius: 50%;+ box-shadow: 0 0 6px currentColor;}}diff --git a/frontend/src/styles/main.scss b/frontend/src/styles/main.scssindex 1f2cabdd..5f019cab 100644--- a/frontend/src/styles/main.scss+++ b/frontend/src/styles/main.scss@@ -15,6 +15,7 @@// --------------------------------------------// 2. BASE STYLES// --------------------------------------------+@import 'base/_fonts'; // self-hosted IBM Plex (no Google CDN)@import 'base/_reset';@import 'base/_typography';@import 'base/_utilities';@@ -63,6 +64,7 @@@import 'components/_logs-drawer';@import 'components/_ai-assistant';@import 'components/_ui';+@import 'components/_design-system'; // redesign shared primitives (sk-* namespace)// --------------------------------------------// 5. PAGE-SPECIFIC STYLES