+
-
{{ t.text }}
+
+ {{ t.text }}
+
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 6305dae..0a9a1c6 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -1,5 +1,11 @@
import { createApp } from 'vue'
import App from './App.vue'
import { router } from './router'
+import { applyTheme, initialTheme } from './theme'
+import './style.css'
+
+// Apply the saved theme BEFORE mounting so the first paint is already
+// correct (no white flash for dark-mode users).
+applyTheme(initialTheme())
createApp(App).use(router).mount('#app')
\ No newline at end of file
diff --git a/frontend/src/style.css b/frontend/src/style.css
index 0033c2e..a8a3fba 100644
--- a/frontend/src/style.css
+++ b/frontend/src/style.css
@@ -1,14 +1,43 @@
-/* Minimal hand-rolled styling: one shared sheet, no CSS framework. */
+/* Design system: everything keys off [data-theme] variables (see theme.ts).
+ Class names match the existing views, so the views needed minimal markup
+ changes. */
:root {
- --bg: #f4f5f7;
+ --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
+ --mono: ui-monospace, 'JetBrains Mono', Consolas, monospace;
+
+ --bg: #f6f7f9;
--card: #ffffff;
- --border: #d9dce1;
- --text: #1c2430;
- --muted: #61707f;
- --accent: #2563eb;
+ --border: #e4e7ec;
+ --text: #101828;
+ --muted: #667085;
+ --accent: #4f46e5;
+ --accent-soft: #eef2ff;
--danger: #dc2626;
+ --danger-soft: #fef2f2;
--ok: #16a34a;
+ --ok-soft: #dcfce7;
+ --shadow-sm: 0 1px 2px rgb(16 24 40 / 6%);
+ --shadow-md: 0 4px 12px -2px rgb(16 24 40 / 10%);
+ --radius: 10px;
+ --nav-bg: #101828;
+}
+
+[data-theme='dark'] {
+ --bg: #0b1220;
+ --card: #111a2c;
+ --border: #1f2a44;
+ --text: #e6eaf2;
+ --muted: #8b96ab;
+ --accent: #818cf8;
+ --accent-soft: #1e2444;
+ --danger: #f87171;
+ --danger-soft: #2a1618;
+ --ok: #4ade80;
+ --ok-soft: #12281a;
+ --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
+ --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 50%);
+ --nav-bg: #060b16;
}
* {
@@ -17,25 +46,88 @@
body {
margin: 0;
- font-family: 'Segoe UI', system-ui, sans-serif;
+ font-family: var(--font);
+ font-size: 14px;
background: var(--bg);
color: var(--text);
+ -webkit-font-smoothing: antialiased;
+}
+
+/* ---- app shell: sidebar + content ---- */
+.shell {
+ display: flex;
+ min-height: 100vh;
+}
+
+.sidebar {
+ width: 14rem;
+ flex-shrink: 0;
+ background: var(--nav-bg);
+ padding: 1rem 0.75rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.25rem;
+ position: sticky;
+ top: 0;
+ height: 100vh;
+}
+
+.sidebar .brand {
+ color: #fff;
+ font-weight: 700;
+ font-size: 1.05rem;
+ padding: 0.5rem 0.75rem 1rem;
+ letter-spacing: 0.01em;
+}
+
+.sidebar a {
+ display: flex;
+ align-items: center;
+ gap: 0.65rem;
+ color: #9aa5bb;
+ padding: 0.55rem 0.75rem;
+ border-radius: 8px;
+ text-decoration: none;
+ transition:
+ background 0.15s,
+ color 0.15s;
+}
+
+.sidebar a:hover {
+ color: #fff;
+ background: rgb(255 255 255 / 6%);
+}
+
+.sidebar a.router-link-active {
+ color: #fff;
+ background: var(--accent);
+}
+
+.sidebar .bottom {
+ margin-top: auto;
}
main {
- max-width: 64rem;
+ flex: 1;
+ max-width: 70rem;
margin: 0 auto;
- padding: 1.5rem;
+ padding: 1.75rem 2rem 4rem;
+ width: 100%;
}
h1 {
- font-size: 1.4rem;
- margin: 0 0 1rem;
+ font-size: 1.25rem;
+ font-weight: 650;
+ margin: 0 0 1.25rem;
}
h2 {
- font-size: 1.05rem;
- margin: 1.5rem 0 0.75rem;
+ font-size: 0.95rem;
+ font-weight: 600;
+ margin: 1.75rem 0 0.75rem;
+ color: var(--muted);
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
}
a {
@@ -46,21 +138,22 @@ a {
.card {
background: var(--card);
border: 1px solid var(--border);
- border-radius: 8px;
- padding: 1rem;
+ border-radius: var(--radius);
+ box-shadow: var(--shadow-sm);
+ padding: 1rem 1.25rem;
margin-bottom: 1rem;
}
table {
width: 100%;
border-collapse: collapse;
- font-size: 0.9rem;
+ font-size: 0.875rem;
}
th,
td {
text-align: left;
- padding: 0.4rem 0.6rem;
+ padding: 0.55rem 0.6rem;
border-bottom: 1px solid var(--border);
vertical-align: top;
}
@@ -68,17 +161,45 @@ td {
th {
color: var(--muted);
font-weight: 600;
+ font-size: 0.78rem;
+ text-transform: uppercase;
+ letter-spacing: 0.03em;
+}
+
+tbody tr {
+ transition: background 0.15s;
+}
+
+tbody tr:hover {
+ background: var(--accent-soft);
+}
+
+td.mono,
+.mono {
+ font-family: var(--mono);
+ font-size: 0.82rem;
}
input,
select,
textarea {
font: inherit;
- padding: 0.4rem 0.5rem;
+ padding: 0.5rem 0.65rem;
border: 1px solid var(--border);
- border-radius: 6px;
+ border-radius: 8px;
background: var(--card);
color: var(--text);
+ transition:
+ border 0.15s,
+ box-shadow 0.15s;
+}
+
+input:focus-visible,
+select:focus-visible,
+textarea:focus-visible {
+ outline: none;
+ border-color: var(--accent);
+ box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type='text'],
@@ -90,13 +211,41 @@ textarea {
width: 100%;
}
+label {
+ font-size: 0.85rem;
+ color: var(--muted);
+}
+
button {
font: inherit;
- padding: 0.4rem 0.9rem;
+ font-weight: 550;
+ padding: 0.45rem 0.95rem;
+ border-radius: 8px;
border: 1px solid var(--border);
- border-radius: 6px;
background: var(--card);
+ color: var(--text);
cursor: pointer;
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ transition:
+ box-shadow 0.15s,
+ transform 0.15s,
+ background 0.15s,
+ border 0.15s;
+}
+
+button:focus-visible {
+ outline: 2px solid var(--accent);
+ outline-offset: 2px;
+}
+
+button:hover {
+ box-shadow: var(--shadow-sm);
+}
+
+button:active {
+ transform: translateY(1px);
}
button.primary {
@@ -105,15 +254,36 @@ button.primary {
color: #fff;
}
+button.primary:hover {
+ box-shadow: 0 4px 10px -2px var(--accent);
+}
+
button.danger {
color: var(--danger);
border-color: var(--danger);
background: transparent;
}
+button.danger:hover {
+ background: var(--danger-soft);
+}
+
+button.ghost {
+ border-color: transparent;
+ background: transparent;
+ color: #9aa5bb;
+}
+
+button.ghost:hover {
+ color: #fff;
+ box-shadow: none;
+ background: rgb(255 255 255 / 6%);
+}
+
button:disabled {
- opacity: 0.5;
+ opacity: 0.45;
cursor: not-allowed;
+ box-shadow: none;
}
.row {
@@ -133,29 +303,78 @@ button:disabled {
}
.badge {
- display: inline-block;
- padding: 0.05rem 0.5rem;
+ display: inline-flex;
+ align-items: center;
+ gap: 0.3rem;
+ padding: 0.1rem 0.55rem;
border-radius: 999px;
font-size: 0.75rem;
- background: #e8edf3;
- color: var(--muted);
+ background: var(--accent-soft);
+ color: var(--accent);
}
.badge.ok {
- background: #dcfce7;
+ background: var(--ok-soft);
color: var(--ok);
}
+.badge.ok::before {
+ content: '';
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: var(--ok);
+}
+
pre.json {
background: #0f172a;
color: #e2e8f0;
padding: 0.75rem;
- border-radius: 6px;
+ border-radius: 8px;
overflow-x: auto;
- font-size: 0.8rem;
+ font-size: 0.78rem;
+ font-family: var(--mono);
margin: 0.5rem 0;
}
+[data-theme='dark'] pre.json {
+ background: #060b16;
+ border: 1px solid var(--border);
+}
+
+/* skeletons */
+.skeleton {
+ height: 1rem;
+ border-radius: 6px;
+ margin: 0.35rem 0;
+ background: linear-gradient(90deg, var(--border) 25%, var(--accent-soft) 50%, var(--border) 75%);
+ background-size: 200% 100%;
+ animation: shimmer 1.2s infinite;
+}
+
+.skeleton.title {
+ height: 1.6rem;
+ width: 40%;
+}
+
+.skeleton.line {
+ width: 90%;
+}
+
+.skeleton.stat {
+ height: 2.4rem;
+ width: 30%;
+}
+
+@keyframes shimmer {
+ from {
+ background-position: 200% 0;
+ }
+ to {
+ background-position: -200% 0;
+ }
+}
+
/* toasts */
.toasts {
position: fixed;
@@ -168,11 +387,14 @@ pre.json {
}
.toast {
- padding: 0.6rem 1rem;
- border-radius: 6px;
+ padding: 0.65rem 1rem;
+ border-radius: 8px;
color: #fff;
- font-size: 0.9rem;
+ font-size: 0.88rem;
max-width: 26rem;
+ box-shadow: var(--shadow-md);
+ animation: slide-in 0.2s ease-out;
+ cursor: pointer;
}
.toast.error {
@@ -183,11 +405,22 @@ pre.json {
background: var(--ok);
}
+@keyframes slide-in {
+ from {
+ opacity: 0;
+ transform: translateX(1rem);
+ }
+ to {
+ opacity: 1;
+ transform: none;
+ }
+}
+
/* token prompt modal */
.modal-backdrop {
position: fixed;
inset: 0;
- background: rgb(0 0 0 / 45%);
+ background: rgb(0 0 0 / 50%);
display: flex;
align-items: center;
justify-content: center;
@@ -196,33 +429,92 @@ pre.json {
.modal {
background: var(--card);
- border-radius: 10px;
+ border: 1px solid var(--border);
+ border-radius: 14px;
+ box-shadow: var(--shadow-md);
padding: 1.5rem;
width: min(90vw, 26rem);
}
-/* nav */
-.nav {
- background: #0f172a;
+/* timeline (DeviceDetail) */
+.timeline {
+ list-style: none;
+ margin: 0.75rem 0 0;
+ padding: 0;
+}
+
+.timeline li {
+ position: relative;
+ padding: 0 0 1rem 1.4rem;
+ border-left: 2px solid var(--border);
+}
+
+.timeline li:last-child {
+ border-left-color: transparent;
+}
+
+.timeline li::before {
+ content: '';
+ position: absolute;
+ left: -5px;
+ top: 0.3rem;
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: var(--border);
+}
+
+.timeline li.current::before {
+ background: var(--ok);
+ box-shadow: 0 0 0 3px var(--ok-soft);
+}
+
+.timeline li .when {
+ color: var(--muted);
+ font-size: 0.8rem;
+}
+
+/* empty states */
+.empty {
+ text-align: center;
+ padding: 2rem 1rem;
+ color: var(--muted);
display: flex;
- gap: 1rem;
- padding: 0.75rem 1.5rem;
+ flex-direction: column;
align-items: center;
+ gap: 0.75rem;
}
-.nav a {
- color: #cbd5e1;
- padding: 0.25rem 0.5rem;
- border-radius: 6px;
-}
+/* responsive: collapse sidebar into an icon bar on narrow screens */
+@media (max-width: 48rem) {
+ .shell {
+ flex-direction: column;
+ }
-.nav a.router-link-active {
- color: #fff;
- background: #1e293b;
-}
+ .sidebar {
+ width: 100%;
+ height: auto;
+ position: static;
+ flex-direction: row;
+ flex-wrap: wrap;
+ align-items: center;
+ padding: 0.5rem 0.75rem;
+ }
-.nav .brand {
- font-weight: 700;
- color: #fff;
- margin-right: auto;
+ .sidebar .brand {
+ padding: 0.5rem 0.75rem;
+ }
+
+ .sidebar a span {
+ display: none;
+ }
+
+ .sidebar .bottom {
+ margin-top: 0;
+ margin-left: auto;
+ }
+
+ main {
+ padding: 1.25rem 1rem 3rem;
+ }
}
\ No newline at end of file
diff --git a/frontend/src/theme.ts b/frontend/src/theme.ts
new file mode 100644
index 0000000..1c240f9
--- /dev/null
+++ b/frontend/src/theme.ts
@@ -0,0 +1,16 @@
+// Theme state: persisted in localStorage, applied as .
+
+export type Theme = 'light' | 'dark'
+
+const KEY = 'nodeledge-ui-theme'
+
+export function initialTheme(): Theme {
+ const saved = localStorage.getItem(KEY)
+ if (saved === 'light' || saved === 'dark') return saved
+ return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
+}
+
+export function applyTheme(theme: Theme): void {
+ document.documentElement.dataset.theme = theme
+ localStorage.setItem(KEY, theme)
+}
\ No newline at end of file
diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue
index b678fc3..59c9c1c 100644
--- a/frontend/src/views/Dashboard.vue
+++ b/frontend/src/views/Dashboard.vue
@@ -1,5 +1,6 @@