From 2d168ff9cc740754615a98141a59c2610f72dbf7 Mon Sep 17 00:00:00 2001 From: Kundencenter Date: Mon, 28 Sep 2026 11:09:58 +0200 Subject: [PATCH] Design: modernisiertes Erscheinungsbild (Schatten statt schwerer Rahmen, Inter-Schrift, Tag/Nacht/System-Umschalter) --- apps/web/src/app/(app)/layout.tsx | 4 +- apps/web/src/app/globals.css | 72 +++++++++++++++---------- apps/web/src/app/layout.tsx | 7 ++- apps/web/src/app/login/page.tsx | 3 +- apps/web/src/components/ThemeToggle.tsx | 30 +++++++++++ 5 files changed, 84 insertions(+), 32 deletions(-) create mode 100644 apps/web/src/components/ThemeToggle.tsx diff --git a/apps/web/src/app/(app)/layout.tsx b/apps/web/src/app/(app)/layout.tsx index ad1009a..e2ed8f4 100644 --- a/apps/web/src/app/(app)/layout.tsx +++ b/apps/web/src/app/(app)/layout.tsx @@ -5,6 +5,7 @@ import { usePathname, useRouter } from 'next/navigation'; import { api } from '@/lib/api'; import { useSession } from '@/lib/session'; import { ROLE_LABEL } from '@/components/ui'; +import { ThemeToggle } from '@/components/ThemeToggle'; export default function AppLayout({ children }: { children: ReactNode }) { const { me, loading, can, reload } = useSession(); const r = useRouter(); const path = usePathname(); const [open, setOpen] = useState(false); @@ -39,11 +40,12 @@ export default function AppLayout({ children }: { children: ReactNode }) {
{link('/konto', 'Mein Konto')}
{me.user.name}
{me.staffRole ? ROLE_LABEL[me.staffRole] : 'Kunde'}
+
); return (
-
Kundencenter
+
Kundencenter
{nav}
{children}
); } diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css index 1b95c43..8e9a920 100644 --- a/apps/web/src/app/globals.css +++ b/apps/web/src/app/globals.css @@ -1,56 +1,70 @@ -/* Designsystem v0: ruhige Flächen, viel Weißraum, eine Akzentfarbe. Light/Dark über prefers-color-scheme + data-theme. */ +/* Designsystem v1: klare Flächen, dezente Tiefe (Schatten statt schwerer Rahmen), eine Akzentfarbe. + Hell/Dunkel automatisch über prefers-color-scheme, zusätzlich manuell über [data-theme] umschaltbar (siehe ThemeToggle). */ :root { - --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f0f2f5; --border: #dfe3e8; --text: #16191d; --muted: #5b6470; - --accent: #2456d6; --accent-contrast: #ffffff; --focus: #2456d6; - --ok: #17703a; --ok-bg: #e4f5ea; --info: #1d5fa8; --info-bg: #e3effb; --warn: #8a5a00; --warn-bg: #fdf0d2; --err: #a52a2a; --err-bg: #fbe5e5; --lock: #4b5563; --lock-bg: #e8eaee; - --radius: 12px; --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; - --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; + --bg: #f5f6f9; --surface: #ffffff; --surface-2: #eef0f5; --border: #e3e6ec; --text: #13161c; --muted: #656d7a; + --accent: #4356e8; --accent-contrast: #ffffff; --focus: #4356e8; + --ok: #15803d; --ok-bg: #e7f6ec; --info: #1d5fa8; --info-bg: #e6f1fb; --warn: #92660a; --warn-bg: #fdf3dc; --err: #b3261e; --err-bg: #fbeaea; --lock: #4b5563; --lock-bg: #eceef2; + --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 1px rgba(16, 24, 40, .04); + --shadow-md: 0 8px 20px rgba(16, 24, 40, .07), 0 2px 6px rgba(16, 24, 40, .05); + --radius: 14px; --radius-sm: 10px; --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; + --font: var(--font-inter), system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; } @media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { - --bg: #0f1216; --surface: #171b21; --surface-2: #1f242c; --border: #2b323c; --text: #eceff3; --muted: #9aa5b3; --accent: #7aa2ff; --accent-contrast: #0b1020; --focus: #9db9ff; - --ok: #6fd39a; --ok-bg: #12301f; --info: #8bbcf2; --info-bg: #142a42; --warn: #f0c063; --warn-bg: #3a2c0b; --err: #f29b9b; --err-bg: #3d1717; --lock: #b6bfcb; --lock-bg: #262c35; } } + --bg: #0a0d12; --surface: #12161d; --surface-2: #1a1f28; --border: #262c37; --text: #e8ebf0; --muted: #96a0b0; --accent: #8ea2ff; --accent-contrast: #0a0d12; --focus: #8ea2ff; + --ok: #6fd39a; --ok-bg: #123321; --info: #8bbcf2; --info-bg: #132a44; --warn: #f0c063; --warn-bg: #3a2c0b; --err: #f2a3a3; --err-bg: #3d1a1a; --lock: #b7c0cc; --lock-bg: #242a33; + --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45); --shadow-md: 0 10px 24px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35); +} } :root[data-theme='dark'] { - --bg: #0f1216; --surface: #171b21; --surface-2: #1f242c; --border: #2b323c; --text: #eceff3; --muted: #9aa5b3; --accent: #7aa2ff; --accent-contrast: #0b1020; --focus: #9db9ff; - --ok: #6fd39a; --ok-bg: #12301f; --info: #8bbcf2; --info-bg: #142a42; --warn: #f0c063; --warn-bg: #3a2c0b; --err: #f29b9b; --err-bg: #3d1717; --lock: #b6bfcb; --lock-bg: #262c35; + --bg: #0a0d12; --surface: #12161d; --surface-2: #1a1f28; --border: #262c37; --text: #e8ebf0; --muted: #96a0b0; --accent: #8ea2ff; --accent-contrast: #0a0d12; --focus: #8ea2ff; + --ok: #6fd39a; --ok-bg: #123321; --info: #8bbcf2; --info-bg: #132a44; --warn: #f0c063; --warn-bg: #3a2c0b; --err: #f2a3a3; --err-bg: #3d1a1a; --lock: #b7c0cc; --lock-bg: #242a33; + --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45); --shadow-md: 0 10px 24px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35); } * { box-sizing: border-box; } html { color-scheme: light dark; } body { margin: 0; font: 16px/1.55 var(--font); background: var(--bg); color: var(--text); } -h1 { font-size: 1.6rem; margin: 0 0 var(--s3); letter-spacing: -0.01em; } h2 { font-size: 1.15rem; margin: 0 0 var(--s3); } h3 { font-size: 1rem; margin: 0 0 var(--s2); } +body, .btn, .badge, .card, input, select, a, .alert { transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; } +h1 { font-size: 1.7rem; font-weight: 700; margin: 0 0 var(--s3); letter-spacing: -0.015em; } h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 var(--s3); } h3 { font-size: 1rem; font-weight: 600; margin: 0 0 var(--s2); } a { color: var(--accent); } p { margin: 0 0 var(--s3); } .muted { color: var(--muted); } .small { font-size: .875rem; } -:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; } +:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; } .skip { position: absolute; left: -999px; } .skip:focus { left: var(--s3); top: var(--s3); background: var(--surface); padding: var(--s2) var(--s3); z-index: 10; } .shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; } -.nav { background: var(--surface); border-right: 1px solid var(--border); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: var(--s2); } -.nav .brand { font-weight: 700; font-size: 1.1rem; padding: 0 var(--s3) var(--s3); } -.nav a { display: block; padding: 10px var(--s3); border-radius: 8px; color: var(--text); text-decoration: none; } -.nav a:hover { background: var(--surface-2); } .nav a[aria-current='page'] { background: var(--surface-2); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); } -.nav .group { margin: var(--s3) var(--s3) 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } +.nav { background: var(--surface); border-right: 1px solid var(--border); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: 2px; } +.nav .brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; padding: 0 var(--s3) var(--s4); } +.nav a { display: block; padding: 10px var(--s3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; } +.nav a:hover { background: var(--surface-2); } +.nav a[aria-current='page'] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; } +.nav .group { margin: var(--s3) var(--s3) var(--s1); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); } .nav .spacer { flex: 1; } .main { padding: var(--s5) var(--s4); max-width: 1100px; width: 100%; } .topbar { display: none; } @media (max-width: 800px) { .shell { grid-template-columns: 1fr; } .nav { display: none; } .nav.open { display: flex; position: fixed; inset: 0 30% 0 0; z-index: 5; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); overflow: auto; } - .topbar { display: flex; align-items: center; justify-content: space-between; padding: var(--s3); background: var(--surface); border-bottom: 1px solid var(--border); } + .topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s3); background: var(--surface); border-bottom: 1px solid var(--border); } .main { padding: var(--s4) var(--s3); } } -.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); } +.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); margin-bottom: var(--s4); box-shadow: var(--shadow-sm); } .grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } -.stat { font-size: 2rem; font-weight: 700; line-height: 1.1; } .row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } -.btn { font: inherit; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; min-height: 44px; } -.btn:hover { background: var(--surface-2); } .btn.primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); } .btn.primary:hover { filter: brightness(1.08); } -.btn.danger { color: var(--err); border-color: var(--err); } .btn:disabled { opacity: .55; cursor: not-allowed; } .btn.small { min-height: 36px; padding: 6px 12px; } +.stat { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; } .row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } +.btn { font: inherit; font-weight: 500; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; min-height: 44px; box-shadow: var(--shadow-sm); } +.btn:hover { background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-md); } +.btn:active { transform: translateY(0); } +.btn.primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); font-weight: 600; } +.btn.primary:hover { filter: brightness(1.08); } +.btn.danger { color: var(--err); border-color: var(--err); } .btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; } .btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; } .field { display: grid; gap: 6px; margin-bottom: var(--s3); } .field label { font-weight: 600; font-size: .9rem; } -input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); min-height: 44px; width: 100%; } +input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); min-height: 44px; width: 100%; } +input:focus-visible, select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; } .cols { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } -table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 12px var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; } th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); } -.tablewrap { overflow-x: auto; } -.badge { display: inline-flex; gap: 6px; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; } +table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 12px var(--s3); border-bottom: 1px solid var(--border); vertical-align: top; } th { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); } +tbody tr:hover { background: var(--surface-2); } +.tablewrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); } +.tablewrap table { border: none; } .tablewrap th:first-child, .tablewrap td:first-child { padding-left: var(--s3); } +.badge { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; } .badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.err { background: var(--err-bg); color: var(--err); } .badge.lock { background: var(--lock-bg); color: var(--lock); } -.alert { border-radius: 8px; padding: var(--s3); margin-bottom: var(--s3); border: 1px solid transparent; } .alert.err { background: var(--err-bg); color: var(--err); } .alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.info { background: var(--info-bg); color: var(--info); } +.alert { border-radius: var(--radius-sm); padding: var(--s3); margin-bottom: var(--s3); border: 1px solid transparent; } .alert.err { background: var(--err-bg); color: var(--err); } .alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.info { background: var(--info-bg); color: var(--info); } .empty { text-align: center; padding: var(--s5) var(--s3); color: var(--muted); } .center { min-height: 100vh; display: grid; place-items: center; padding: var(--s3); } .auth { width: 100%; max-width: 420px; } -code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; word-break: break-all; } .codes { columns: 2; background: var(--surface-2); padding: var(--s3); border-radius: 8px; } +code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; word-break: break-all; } .codes { columns: 2; background: var(--surface-2); padding: var(--s3); border-radius: var(--radius-sm); } .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } } diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index a9b6aeb..7cf7f1d 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -1,9 +1,14 @@ import type { Metadata } from 'next'; import type { ReactNode } from 'react'; +import { Inter } from 'next/font/google'; import './globals.css'; import { SessionProvider } from '@/lib/session'; +const inter = Inter({ subsets: ['latin'], variable: '--font-inter', display: 'swap' }); export const metadata: Metadata = { title: { default: 'Kundencenter', template: '%s · Kundencenter' }, robots: { index: false } }; +// Verhindert einen kurzen Blitz der falschen Darstellung: setzt die gespeicherte Wahl (falls vorhanden), bevor die Seite gemalt wird. +const themeInit = "try{var t=localStorage.getItem('kc-theme');if(t==='light'||t==='dark')document.documentElement.setAttribute('data-theme',t);}catch(e){}"; export default function RootLayout({ children }: { children: ReactNode }) { - return Zum Inhalt springen{children}; + return