💄 add design system and shared UI components
Browse files at this commitd631d8e0f1ba033db756a5117baf49f6663f63caParent: c3fc1e3- feat
- 💄 add design system and shared UI components
5 changed files +1044 -0
- src/components/Feedback.tsx +25 -0
- src/components/Icons.tsx +116 -0
- src/components/Layout.tsx +84 -0
- src/components/ProfileFields.tsx +71 -0
- src/styles.css +748 -0
src/components/Feedback.tsxadded+25 -0
| @@ -0,0 +1,25 @@ | |||
| 1 | +// Small shared feedback pieces: inline error line, loading pulse, empty state. | ||
| 2 | + | ||
| 3 | +import { Show, type JSX } from "solid-js"; | ||
| 4 | + | ||
| 5 | +export function ErrorLine(props: { error: string | null }) { | ||
| 6 | + return ( | ||
| 7 | + <Show when={props.error}> | ||
| 8 | + <p class="error" role="alert"> | ||
| 9 | + {props.error} | ||
| 10 | + </p> | ||
| 11 | + </Show> | ||
| 12 | + ); | ||
| 13 | +} | ||
| 14 | + | ||
| 15 | +export function Loading() { | ||
| 16 | + return ( | ||
| 17 | + <div class="loading" aria-label="loading"> | ||
| 18 | + <span /><span /><span /> | ||
| 19 | + </div> | ||
| 20 | + ); | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +export function Empty(props: { children: JSX.Element }) { | ||
| 24 | + return <p class="empty">{props.children}</p>; | ||
| 25 | +} | ||
src/components/Icons.tsxadded+116 -0
| @@ -0,0 +1,116 @@ | |||
| 1 | +// Inline stroke icons (lucide-style paths), sized by the `.icon` class. | ||
| 2 | +// Decorative only — every icon is aria-hidden; pair with text or a title. | ||
| 3 | + | ||
| 4 | +import type { JSX } from "solid-js"; | ||
| 5 | + | ||
| 6 | +function Svg(props: { children: JSX.Element }) { | ||
| 7 | + return ( | ||
| 8 | + <svg | ||
| 9 | + class="icon" | ||
| 10 | + viewBox="0 0 24 24" | ||
| 11 | + fill="none" | ||
| 12 | + stroke="currentColor" | ||
| 13 | + stroke-width="1.8" | ||
| 14 | + stroke-linecap="round" | ||
| 15 | + stroke-linejoin="round" | ||
| 16 | + aria-hidden="true" | ||
| 17 | + > | ||
| 18 | + {props.children} | ||
| 19 | + </svg> | ||
| 20 | + ); | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +export const IconPlane = () => ( | ||
| 24 | + <Svg> | ||
| 25 | + <path d="m22 2-7 20-4-9-9-4z" /> | ||
| 26 | + <path d="M22 2 11 13" /> | ||
| 27 | + </Svg> | ||
| 28 | +); | ||
| 29 | + | ||
| 30 | +export const IconHome = () => ( | ||
| 31 | + <Svg> | ||
| 32 | + <path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" /> | ||
| 33 | + <path d="M9 22V12h6v10" /> | ||
| 34 | + </Svg> | ||
| 35 | +); | ||
| 36 | + | ||
| 37 | +export const IconNote = () => ( | ||
| 38 | + <Svg> | ||
| 39 | + <path d="M14 3v5h5" /> | ||
| 40 | + <path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /> | ||
| 41 | + <path d="M9 13h6M9 17h4" /> | ||
| 42 | + </Svg> | ||
| 43 | +); | ||
| 44 | + | ||
| 45 | +export const IconCalendar = () => ( | ||
| 46 | + <Svg> | ||
| 47 | + <rect x="3" y="4" width="18" height="17" rx="2" /> | ||
| 48 | + <path d="M16 2v4M8 2v4M3 9.5h18" /> | ||
| 49 | + </Svg> | ||
| 50 | +); | ||
| 51 | + | ||
| 52 | +export const IconBook = () => ( | ||
| 53 | + <Svg> | ||
| 54 | + <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20" /> | ||
| 55 | + <path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z" /> | ||
| 56 | + </Svg> | ||
| 57 | +); | ||
| 58 | + | ||
| 59 | +export const IconClipboard = () => ( | ||
| 60 | + <Svg> | ||
| 61 | + <rect x="8" y="2" width="8" height="4" rx="1" /> | ||
| 62 | + <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" /> | ||
| 63 | + <path d="m9 14 2 2 4-4" /> | ||
| 64 | + </Svg> | ||
| 65 | +); | ||
| 66 | + | ||
| 67 | +export const IconChart = () => ( | ||
| 68 | + <Svg> | ||
| 69 | + <path d="M3 3v16a2 2 0 0 0 2 2h16" /> | ||
| 70 | + <path d="M8 17v-3M13 17V8M18 17v-6" /> | ||
| 71 | + </Svg> | ||
| 72 | +); | ||
| 73 | + | ||
| 74 | +export const IconUsers = () => ( | ||
| 75 | + <Svg> | ||
| 76 | + <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> | ||
| 77 | + <circle cx="9" cy="7" r="4" /> | ||
| 78 | + <path d="M22 21v-2a4 4 0 0 0-3-3.87" /> | ||
| 79 | + <path d="M16 3.13a4 4 0 0 1 0 7.75" /> | ||
| 80 | + </Svg> | ||
| 81 | +); | ||
| 82 | + | ||
| 83 | +export const IconLogout = () => ( | ||
| 84 | + <Svg> | ||
| 85 | + <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /> | ||
| 86 | + <path d="m16 17 5-5-5-5" /> | ||
| 87 | + <path d="M21 12H9" /> | ||
| 88 | + </Svg> | ||
| 89 | +); | ||
| 90 | + | ||
| 91 | +export const IconPlus = () => ( | ||
| 92 | + <Svg> | ||
| 93 | + <path d="M12 5v14M5 12h14" /> | ||
| 94 | + </Svg> | ||
| 95 | +); | ||
| 96 | + | ||
| 97 | +export const IconEdit = () => ( | ||
| 98 | + <Svg> | ||
| 99 | + <path d="M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5z" /> | ||
| 100 | + </Svg> | ||
| 101 | +); | ||
| 102 | + | ||
| 103 | +export const IconTrash = () => ( | ||
| 104 | + <Svg> | ||
| 105 | + <path d="M3 6h18" /> | ||
| 106 | + <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /> | ||
| 107 | + <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /> | ||
| 108 | + </Svg> | ||
| 109 | +); | ||
| 110 | + | ||
| 111 | +export const IconArrow = () => ( | ||
| 112 | + <Svg> | ||
| 113 | + <path d="M5 12h14" /> | ||
| 114 | + <path d="m13 6 6 6-6 6" /> | ||
| 115 | + </Svg> | ||
| 116 | +); | ||
src/components/Layout.tsxadded+84 -0
| @@ -0,0 +1,84 @@ | |||
| 1 | +// App shell: sidebar with navigation, user chip, and logout. Collapses into a | ||
| 2 | +// top bar on narrow screens (pure CSS). Rendered only for authenticated routes. | ||
| 3 | + | ||
| 4 | +import { A, useNavigate } from "@solidjs/router"; | ||
| 5 | +import { Show, type ParentProps } from "solid-js"; | ||
| 6 | +import { useAuth } from "../lib/auth"; | ||
| 7 | +import { | ||
| 8 | + IconBook, | ||
| 9 | + IconCalendar, | ||
| 10 | + IconChart, | ||
| 11 | + IconClipboard, | ||
| 12 | + IconHome, | ||
| 13 | + IconLogout, | ||
| 14 | + IconNote, | ||
| 15 | + IconPlane, | ||
| 16 | + IconUsers, | ||
| 17 | +} from "./Icons"; | ||
| 18 | + | ||
| 19 | +export function Layout(props: ParentProps) { | ||
| 20 | + const { user, logout, can } = useAuth(); | ||
| 21 | + const navigate = useNavigate(); | ||
| 22 | + | ||
| 23 | + const onLogout = async () => { | ||
| 24 | + await logout(); | ||
| 25 | + navigate("/login", { replace: true }); | ||
| 26 | + }; | ||
| 27 | + | ||
| 28 | + return ( | ||
| 29 | + <div class="shell"> | ||
| 30 | + <header class="sidebar"> | ||
| 31 | + <A href="/" class="brand"> | ||
| 32 | + <span class="brand-mark"> | ||
| 33 | + <IconPlane /> | ||
| 34 | + </span> | ||
| 35 | + <span>Hezarfen</span> | ||
| 36 | + </A> | ||
| 37 | + <nav> | ||
| 38 | + <A href="/" end> | ||
| 39 | + <IconHome /> Home | ||
| 40 | + </A> | ||
| 41 | + <A href="/notes"> | ||
| 42 | + <IconNote /> Notes | ||
| 43 | + </A> | ||
| 44 | + <A href="/events"> | ||
| 45 | + <IconCalendar /> Events | ||
| 46 | + </A> | ||
| 47 | + <A href="/courses"> | ||
| 48 | + <IconBook /> Courses | ||
| 49 | + </A> | ||
| 50 | + <A href="/exams"> | ||
| 51 | + <IconClipboard /> Exams | ||
| 52 | + </A> | ||
| 53 | + <A href="/marks"> | ||
| 54 | + <IconChart /> Marks | ||
| 55 | + </A> | ||
| 56 | + <Show when={can("admin")}> | ||
| 57 | + <A href="/users"> | ||
| 58 | + <IconUsers /> Users | ||
| 59 | + </A> | ||
| 60 | + </Show> | ||
| 61 | + </nav> | ||
| 62 | + <div class="sidebar-end"> | ||
| 63 | + <Show when={user()}> | ||
| 64 | + {(current) => ( | ||
| 65 | + <A href="/profile" class="user-chip" title="Profile"> | ||
| 66 | + <span class="avatar"> | ||
| 67 | + {(current().name ?? current().username).slice(0, 1)} | ||
| 68 | + </span> | ||
| 69 | + <span class="user-meta"> | ||
| 70 | + <strong>{current().name ?? current().username}</strong> | ||
| 71 | + <span>{current().role}</span> | ||
| 72 | + </span> | ||
| 73 | + </A> | ||
| 74 | + )} | ||
| 75 | + </Show> | ||
| 76 | + <button class="ghost icon-btn" onClick={onLogout} title="Log out"> | ||
| 77 | + <IconLogout /> | ||
| 78 | + </button> | ||
| 79 | + </div> | ||
| 80 | + </header> | ||
| 81 | + <main>{props.children}</main> | ||
| 82 | + </div> | ||
| 83 | + ); | ||
| 84 | +} | ||
src/components/ProfileFields.tsxadded+71 -0
| @@ -0,0 +1,71 @@ | |||
| 1 | +// The five personal-info inputs plus the FormData → ProfilePatch reader, | ||
| 2 | +// shared by the self-service profile page and the admin per-user editor. | ||
| 3 | +// Submitting sends every field: what an input holds is what the server keeps, | ||
| 4 | +// and an emptied input clears the field (the backend's "" semantics). | ||
| 5 | + | ||
| 6 | +import type { ProfilePatch } from "../lib/api"; | ||
| 7 | +import { today } from "../lib/format"; | ||
| 8 | +import { LIMITS, type User } from "../lib/types"; | ||
| 9 | + | ||
| 10 | +/** Matches the backend rule: optional leading +, separators, 7–15 digits. */ | ||
| 11 | +const PHONE_PATTERN = "\\+?(?:[\\s()-]*\\d){7,15}[\\s()-]*"; | ||
| 12 | + | ||
| 13 | +export function profilePatch(form: HTMLFormElement): ProfilePatch { | ||
| 14 | + const data = new FormData(form); | ||
| 15 | + return { | ||
| 16 | + name: String(data.get("name")), | ||
| 17 | + surname: String(data.get("surname")), | ||
| 18 | + email: String(data.get("email")), | ||
| 19 | + phone: String(data.get("phone")), | ||
| 20 | + birth_date: String(data.get("birth_date")), | ||
| 21 | + }; | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +export function ProfileFields(props: { user: User }) { | ||
| 25 | + return ( | ||
| 26 | + <> | ||
| 27 | + <div class="row"> | ||
| 28 | + <label style={{ flex: 1 }}> | ||
| 29 | + Name | ||
| 30 | + <input name="name" value={props.user.name ?? ""} maxLength={LIMITS.personName} /> | ||
| 31 | + </label> | ||
| 32 | + <label style={{ flex: 1 }}> | ||
| 33 | + Surname | ||
| 34 | + <input name="surname" value={props.user.surname ?? ""} maxLength={LIMITS.personName} /> | ||
| 35 | + </label> | ||
| 36 | + </div> | ||
| 37 | + <label> | ||
| 38 | |||
| 39 | + <input | ||
| 40 | + name="email" | ||
| 41 | + type="email" | ||
| 42 | + value={props.user.email ?? ""} | ||
| 43 | + maxLength={LIMITS.email} | ||
| 44 | + placeholder="name@example.com" | ||
| 45 | + /> | ||
| 46 | + </label> | ||
| 47 | + <div class="row"> | ||
| 48 | + <label style={{ flex: 1 }}> | ||
| 49 | + Phone | ||
| 50 | + <input | ||
| 51 | + name="phone" | ||
| 52 | + type="tel" | ||
| 53 | + value={props.user.phone ?? ""} | ||
| 54 | + pattern={PHONE_PATTERN} | ||
| 55 | + title={`${LIMITS.phoneDigits.min} to ${LIMITS.phoneDigits.max} digits; +, spaces, dashes, and parentheses are allowed`} | ||
| 56 | + placeholder="+90 555 123 45 67" | ||
| 57 | + /> | ||
| 58 | + </label> | ||
| 59 | + <label style={{ flex: 1 }}> | ||
| 60 | + Birth date | ||
| 61 | + <input | ||
| 62 | + name="birth_date" | ||
| 63 | + type="date" | ||
| 64 | + value={props.user.birth_date ?? ""} | ||
| 65 | + max={today()} | ||
| 66 | + /> | ||
| 67 | + </label> | ||
| 68 | + </div> | ||
| 69 | + </> | ||
| 70 | + ); | ||
| 71 | +} | ||
src/styles.cssadded+748 -0
| @@ -0,0 +1,748 @@ | |||
| 1 | +/* Design tokens + the primitives the app uses. Dark by default, light via | ||
| 2 | + prefers-color-scheme. No framework — zero runtime style cost. */ | ||
| 3 | + | ||
| 4 | +:root { | ||
| 5 | + --bg: #0a0d14; | ||
| 6 | + --surface: #111622; | ||
| 7 | + --surface-2: #19202e; | ||
| 8 | + --surface-3: #202a3c; | ||
| 9 | + --border: #232c3d; | ||
| 10 | + --text: #e8ebf2; | ||
| 11 | + --muted: #8b95a8; | ||
| 12 | + --accent: #7c9aff; | ||
| 13 | + --accent-2: #a78bfa; | ||
| 14 | + --accent-strong: #5468f0; | ||
| 15 | + --accent-2-strong: #7c5cf0; | ||
| 16 | + --danger: #f27d7d; | ||
| 17 | + --ok: #4ecf8a; | ||
| 18 | + --warn: #e8b44f; | ||
| 19 | + --radius: 14px; | ||
| 20 | + --radius-sm: 9px; | ||
| 21 | + --shadow: 0 1px 2px rgb(0 0 0 / 0.35); | ||
| 22 | + --shadow-lg: 0 8px 24px -8px rgb(0 0 0 / 0.5); | ||
| 23 | + --ring: color-mix(in srgb, var(--accent) 30%, transparent); | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +@media (prefers-color-scheme: light) { | ||
| 27 | + :root { | ||
| 28 | + --bg: #f4f6fa; | ||
| 29 | + --surface: #ffffff; | ||
| 30 | + --surface-2: #eef1f7; | ||
| 31 | + --surface-3: #e4e8f2; | ||
| 32 | + --border: #dde2ec; | ||
| 33 | + --text: #171c28; | ||
| 34 | + --muted: #5f6879; | ||
| 35 | + --accent: #4a5fd8; | ||
| 36 | + --accent-2: #7c5cd8; | ||
| 37 | + --accent-strong: #4a5fe0; | ||
| 38 | + --accent-2-strong: #7250e0; | ||
| 39 | + --danger: #d64545; | ||
| 40 | + --ok: #1f9d5f; | ||
| 41 | + --warn: #a87716; | ||
| 42 | + --shadow: 0 1px 2px rgb(20 25 40 / 0.06); | ||
| 43 | + --shadow-lg: 0 8px 24px -12px rgb(20 25 40 / 0.18); | ||
| 44 | + } | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +* { | ||
| 48 | + box-sizing: border-box; | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +body { | ||
| 52 | + margin: 0; | ||
| 53 | + background: var(--bg); | ||
| 54 | + color: var(--text); | ||
| 55 | + font: | ||
| 56 | + 15px/1.55 ui-sans-serif, | ||
| 57 | + system-ui, | ||
| 58 | + -apple-system, | ||
| 59 | + "Segoe UI", | ||
| 60 | + Roboto, | ||
| 61 | + "Helvetica Neue", | ||
| 62 | + sans-serif; | ||
| 63 | + -webkit-font-smoothing: antialiased; | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +/* Soft accent glow in the corners; sits behind everything. */ | ||
| 67 | +body::before { | ||
| 68 | + content: ""; | ||
| 69 | + position: fixed; | ||
| 70 | + inset: 0; | ||
| 71 | + z-index: -1; | ||
| 72 | + background: | ||
| 73 | + radial-gradient( | ||
| 74 | + 55rem 38rem at 88% -12%, | ||
| 75 | + color-mix(in srgb, var(--accent) 8%, transparent), | ||
| 76 | + transparent 65% | ||
| 77 | + ), | ||
| 78 | + radial-gradient( | ||
| 79 | + 45rem 32rem at -8% 108%, | ||
| 80 | + color-mix(in srgb, var(--accent-2) 6%, transparent), | ||
| 81 | + transparent 65% | ||
| 82 | + ); | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | +h1 { | ||
| 86 | + font-size: 1.55rem; | ||
| 87 | + letter-spacing: -0.02em; | ||
| 88 | + margin: 0; | ||
| 89 | +} | ||
| 90 | +h2 { | ||
| 91 | + font-size: 1.1rem; | ||
| 92 | + letter-spacing: -0.01em; | ||
| 93 | + margin: 0; | ||
| 94 | +} | ||
| 95 | +h3 { | ||
| 96 | + font-size: 1rem; | ||
| 97 | + margin: 0; | ||
| 98 | +} | ||
| 99 | +p { | ||
| 100 | + margin: 0; | ||
| 101 | +} | ||
| 102 | +a { | ||
| 103 | + color: var(--accent); | ||
| 104 | + text-decoration: none; | ||
| 105 | +} | ||
| 106 | +a:hover { | ||
| 107 | + text-decoration: underline; | ||
| 108 | +} | ||
| 109 | +a:focus-visible { | ||
| 110 | + outline: 2px solid var(--accent); | ||
| 111 | + outline-offset: 2px; | ||
| 112 | + border-radius: 4px; | ||
| 113 | +} | ||
| 114 | + | ||
| 115 | +.icon { | ||
| 116 | + width: 1.15em; | ||
| 117 | + height: 1.15em; | ||
| 118 | + flex-shrink: 0; | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +/* --- app shell ----------------------------------------------------------- */ | ||
| 122 | + | ||
| 123 | +.shell { | ||
| 124 | + display: flex; | ||
| 125 | + min-height: 100dvh; | ||
| 126 | +} | ||
| 127 | + | ||
| 128 | +.sidebar { | ||
| 129 | + position: sticky; | ||
| 130 | + top: 0; | ||
| 131 | + align-self: flex-start; | ||
| 132 | + display: flex; | ||
| 133 | + flex-direction: column; | ||
| 134 | + gap: 1.25rem; | ||
| 135 | + width: 15rem; | ||
| 136 | + height: 100dvh; | ||
| 137 | + padding: 1.1rem 0.8rem; | ||
| 138 | + background: color-mix(in srgb, var(--surface) 72%, transparent); | ||
| 139 | + backdrop-filter: blur(14px); | ||
| 140 | + border-right: 1px solid var(--border); | ||
| 141 | +} | ||
| 142 | + | ||
| 143 | +.brand { | ||
| 144 | + display: flex; | ||
| 145 | + align-items: center; | ||
| 146 | + gap: 0.6rem; | ||
| 147 | + padding: 0.25rem 0.55rem; | ||
| 148 | + font-size: 1.05rem; | ||
| 149 | + font-weight: 700; | ||
| 150 | + letter-spacing: -0.01em; | ||
| 151 | + color: var(--text); | ||
| 152 | +} | ||
| 153 | +.brand:hover { | ||
| 154 | + text-decoration: none; | ||
| 155 | +} | ||
| 156 | +.brand-mark { | ||
| 157 | + display: grid; | ||
| 158 | + place-items: center; | ||
| 159 | + width: 2rem; | ||
| 160 | + height: 2rem; | ||
| 161 | + border-radius: 10px; | ||
| 162 | + color: #fff; | ||
| 163 | + background: linear-gradient(135deg, var(--accent-strong), var(--accent-2-strong)); | ||
| 164 | + box-shadow: var(--shadow); | ||
| 165 | +} | ||
| 166 | +.brand-mark .icon { | ||
| 167 | + width: 1.05rem; | ||
| 168 | + height: 1.05rem; | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +.sidebar nav { | ||
| 172 | + display: flex; | ||
| 173 | + flex-direction: column; | ||
| 174 | + gap: 0.15rem; | ||
| 175 | + flex: 1; | ||
| 176 | +} | ||
| 177 | + | ||
| 178 | +.sidebar nav a, | ||
| 179 | +.user-chip { | ||
| 180 | + display: flex; | ||
| 181 | + align-items: center; | ||
| 182 | + gap: 0.65rem; | ||
| 183 | + padding: 0.5rem 0.65rem; | ||
| 184 | + border-radius: var(--radius-sm); | ||
| 185 | + color: var(--muted); | ||
| 186 | + font-weight: 500; | ||
| 187 | + white-space: nowrap; | ||
| 188 | + transition: | ||
| 189 | + background 120ms, | ||
| 190 | + color 120ms; | ||
| 191 | +} | ||
| 192 | +.sidebar nav a:hover { | ||
| 193 | + color: var(--text); | ||
| 194 | + background: var(--surface-2); | ||
| 195 | + text-decoration: none; | ||
| 196 | +} | ||
| 197 | +.sidebar nav a.active { | ||
| 198 | + color: var(--accent); | ||
| 199 | + background: color-mix(in srgb, var(--accent) 11%, transparent); | ||
| 200 | +} | ||
| 201 | + | ||
| 202 | +.sidebar-end { | ||
| 203 | + display: flex; | ||
| 204 | + align-items: center; | ||
| 205 | + gap: 0.25rem; | ||
| 206 | +} | ||
| 207 | + | ||
| 208 | +.user-chip { | ||
| 209 | + flex: 1; | ||
| 210 | + min-width: 0; | ||
| 211 | + color: var(--text); | ||
| 212 | +} | ||
| 213 | +.user-chip:hover { | ||
| 214 | + background: var(--surface-2); | ||
| 215 | + text-decoration: none; | ||
| 216 | +} | ||
| 217 | +.user-meta { | ||
| 218 | + display: flex; | ||
| 219 | + flex-direction: column; | ||
| 220 | + min-width: 0; | ||
| 221 | + line-height: 1.25; | ||
| 222 | +} | ||
| 223 | +.user-meta strong { | ||
| 224 | + font-size: 0.88rem; | ||
| 225 | + font-weight: 600; | ||
| 226 | + overflow: hidden; | ||
| 227 | + text-overflow: ellipsis; | ||
| 228 | +} | ||
| 229 | +.user-meta span { | ||
| 230 | + font-size: 0.72rem; | ||
| 231 | + color: var(--muted); | ||
| 232 | + text-transform: capitalize; | ||
| 233 | +} | ||
| 234 | + | ||
| 235 | +.avatar { | ||
| 236 | + display: grid; | ||
| 237 | + place-items: center; | ||
| 238 | + width: 2.1rem; | ||
| 239 | + height: 2.1rem; | ||
| 240 | + border-radius: 50%; | ||
| 241 | + flex-shrink: 0; | ||
| 242 | + color: #fff; | ||
| 243 | + font-size: 0.9rem; | ||
| 244 | + font-weight: 700; | ||
| 245 | + text-transform: uppercase; | ||
| 246 | + background: linear-gradient(135deg, var(--accent-strong), var(--accent-2-strong)); | ||
| 247 | +} | ||
| 248 | +.avatar-lg { | ||
| 249 | + width: 3.25rem; | ||
| 250 | + height: 3.25rem; | ||
| 251 | + font-size: 1.35rem; | ||
| 252 | +} | ||
| 253 | + | ||
| 254 | +main { | ||
| 255 | + flex: 1; | ||
| 256 | + width: 100%; | ||
| 257 | + max-width: 66rem; | ||
| 258 | + margin: 0 auto; | ||
| 259 | + padding: 2.2rem 2.2rem 5rem; | ||
| 260 | + min-width: 0; | ||
| 261 | +} | ||
| 262 | + | ||
| 263 | +@media (max-width: 860px) { | ||
| 264 | + .shell { | ||
| 265 | + flex-direction: column; | ||
| 266 | + } | ||
| 267 | + .sidebar { | ||
| 268 | + flex-direction: row; | ||
| 269 | + align-items: center; | ||
| 270 | + gap: 0.6rem; | ||
| 271 | + width: 100%; | ||
| 272 | + height: auto; | ||
| 273 | + padding: 0.5rem 0.75rem; | ||
| 274 | + border-right: none; | ||
| 275 | + border-bottom: 1px solid var(--border); | ||
| 276 | + z-index: 10; | ||
| 277 | + } | ||
| 278 | + .brand span { | ||
| 279 | + display: none; | ||
| 280 | + } | ||
| 281 | + .sidebar nav { | ||
| 282 | + flex-direction: row; | ||
| 283 | + overflow-x: auto; | ||
| 284 | + scrollbar-width: none; | ||
| 285 | + padding: 0.25rem 0; | ||
| 286 | + } | ||
| 287 | + .sidebar nav::-webkit-scrollbar { | ||
| 288 | + display: none; | ||
| 289 | + } | ||
| 290 | + .sidebar nav a { | ||
| 291 | + padding: 0.4rem 0.6rem; | ||
| 292 | + } | ||
| 293 | + .user-meta { | ||
| 294 | + display: none; | ||
| 295 | + } | ||
| 296 | + .user-chip { | ||
| 297 | + flex: none; | ||
| 298 | + padding: 0.25rem; | ||
| 299 | + border-radius: 50%; | ||
| 300 | + } | ||
| 301 | + main { | ||
| 302 | + padding: 1.4rem 1rem 4rem; | ||
| 303 | + } | ||
| 304 | +} | ||
| 305 | + | ||
| 306 | +/* --- page scaffolding ------------------------------------------------------ */ | ||
| 307 | + | ||
| 308 | +.page { | ||
| 309 | + display: flex; | ||
| 310 | + flex-direction: column; | ||
| 311 | + gap: 1.15rem; | ||
| 312 | +} | ||
| 313 | + | ||
| 314 | +.page-head { | ||
| 315 | + display: flex; | ||
| 316 | + align-items: flex-start; | ||
| 317 | + justify-content: space-between; | ||
| 318 | + gap: 1rem; | ||
| 319 | + flex-wrap: wrap; | ||
| 320 | + margin-bottom: 0.35rem; | ||
| 321 | +} | ||
| 322 | +.page-head .sub { | ||
| 323 | + margin-top: 0.3rem; | ||
| 324 | + color: var(--muted); | ||
| 325 | + font-size: 0.92rem; | ||
| 326 | +} | ||
| 327 | + | ||
| 328 | +.stack { | ||
| 329 | + display: flex; | ||
| 330 | + flex-direction: column; | ||
| 331 | + gap: 0.75rem; | ||
| 332 | +} | ||
| 333 | +.stack-lg { | ||
| 334 | + display: flex; | ||
| 335 | + flex-direction: column; | ||
| 336 | + gap: 2.25rem; | ||
| 337 | +} | ||
| 338 | + | ||
| 339 | +.row { | ||
| 340 | + display: flex; | ||
| 341 | + gap: 0.75rem; | ||
| 342 | + align-items: center; | ||
| 343 | + flex-wrap: wrap; | ||
| 344 | +} | ||
| 345 | +.row > h1, | ||
| 346 | +.row > h3 { | ||
| 347 | + flex: 1; | ||
| 348 | +} | ||
| 349 | + | ||
| 350 | +.row-actions { | ||
| 351 | + display: flex; | ||
| 352 | + gap: 0.5rem; | ||
| 353 | + align-items: center; | ||
| 354 | + flex-wrap: wrap; | ||
| 355 | +} | ||
| 356 | + | ||
| 357 | +.grid { | ||
| 358 | + display: grid; | ||
| 359 | + grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); | ||
| 360 | + gap: 0.9rem; | ||
| 361 | +} | ||
| 362 | + | ||
| 363 | +.cols { | ||
| 364 | + display: grid; | ||
| 365 | + grid-template-columns: repeat(2, minmax(0, 1fr)); | ||
| 366 | + gap: 2rem; | ||
| 367 | + align-items: start; | ||
| 368 | +} | ||
| 369 | +@media (max-width: 720px) { | ||
| 370 | + .cols { | ||
| 371 | + grid-template-columns: 1fr; | ||
| 372 | + } | ||
| 373 | +} | ||
| 374 | + | ||
| 375 | +.section-head { | ||
| 376 | + display: flex; | ||
| 377 | + align-items: baseline; | ||
| 378 | + justify-content: space-between; | ||
| 379 | + gap: 1rem; | ||
| 380 | +} | ||
| 381 | +.section-head a { | ||
| 382 | + font-size: 0.85rem; | ||
| 383 | + font-weight: 500; | ||
| 384 | +} | ||
| 385 | + | ||
| 386 | +/* --- cards ------------------------------------------------------------------ */ | ||
| 387 | + | ||
| 388 | +.card { | ||
| 389 | + background: var(--surface); | ||
| 390 | + border: 1px solid var(--border); | ||
| 391 | + border-radius: var(--radius); | ||
| 392 | + padding: 1.1rem 1.2rem; | ||
| 393 | + box-shadow: var(--shadow); | ||
| 394 | +} | ||
| 395 | + | ||
| 396 | +.link-card { | ||
| 397 | + display: block; | ||
| 398 | + color: inherit; | ||
| 399 | + transition: | ||
| 400 | + border-color 140ms, | ||
| 401 | + translate 140ms, | ||
| 402 | + box-shadow 140ms; | ||
| 403 | +} | ||
| 404 | +.link-card:hover { | ||
| 405 | + text-decoration: none; | ||
| 406 | + border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); | ||
| 407 | + translate: 0 -2px; | ||
| 408 | + box-shadow: var(--shadow-lg); | ||
| 409 | +} | ||
| 410 | + | ||
| 411 | +/* --- stat tiles --------------------------------------------------------------- */ | ||
| 412 | + | ||
| 413 | +.stats { | ||
| 414 | + display: grid; | ||
| 415 | + grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); | ||
| 416 | + gap: 0.9rem; | ||
| 417 | +} | ||
| 418 | +.stat { | ||
| 419 | + display: flex; | ||
| 420 | + flex-direction: column; | ||
| 421 | + gap: 0.15rem; | ||
| 422 | +} | ||
| 423 | +.stat-label { | ||
| 424 | + display: flex; | ||
| 425 | + align-items: center; | ||
| 426 | + gap: 0.45rem; | ||
| 427 | + font-size: 0.82rem; | ||
| 428 | + color: var(--muted); | ||
| 429 | +} | ||
| 430 | +.stat-label .icon { | ||
| 431 | + color: var(--accent); | ||
| 432 | +} | ||
| 433 | +.stat-value { | ||
| 434 | + font-size: 1.75rem; | ||
| 435 | + font-weight: 600; | ||
| 436 | + letter-spacing: -0.02em; | ||
| 437 | + line-height: 1.2; | ||
| 438 | +} | ||
| 439 | +.stat-value small { | ||
| 440 | + font-size: 0.95rem; | ||
| 441 | + font-weight: 500; | ||
| 442 | + color: var(--muted); | ||
| 443 | +} | ||
| 444 | + | ||
| 445 | +/* --- forms ---------------------------------------------------------------- */ | ||
| 446 | + | ||
| 447 | +label { | ||
| 448 | + display: flex; | ||
| 449 | + flex-direction: column; | ||
| 450 | + gap: 0.3rem; | ||
| 451 | + font-size: 0.85rem; | ||
| 452 | + font-weight: 500; | ||
| 453 | + color: var(--muted); | ||
| 454 | +} | ||
| 455 | + | ||
| 456 | +input, | ||
| 457 | +textarea, | ||
| 458 | +select { | ||
| 459 | + font: inherit; | ||
| 460 | + color: var(--text); | ||
| 461 | + background: var(--surface-2); | ||
| 462 | + border: 1px solid var(--border); | ||
| 463 | + border-radius: var(--radius-sm); | ||
| 464 | + padding: 0.5rem 0.75rem; | ||
| 465 | + transition: | ||
| 466 | + border-color 120ms, | ||
| 467 | + box-shadow 120ms; | ||
| 468 | +} | ||
| 469 | +input:focus-visible, | ||
| 470 | +textarea:focus-visible, | ||
| 471 | +select:focus-visible { | ||
| 472 | + outline: none; | ||
| 473 | + border-color: var(--accent); | ||
| 474 | + box-shadow: 0 0 0 3px var(--ring); | ||
| 475 | +} | ||
| 476 | +textarea { | ||
| 477 | + resize: vertical; | ||
| 478 | +} | ||
| 479 | +::placeholder { | ||
| 480 | + color: color-mix(in srgb, var(--muted) 75%, transparent); | ||
| 481 | +} | ||
| 482 | + | ||
| 483 | +button { | ||
| 484 | + display: inline-flex; | ||
| 485 | + align-items: center; | ||
| 486 | + justify-content: center; | ||
| 487 | + gap: 0.45rem; | ||
| 488 | + font: inherit; | ||
| 489 | + font-weight: 600; | ||
| 490 | + color: #fff; | ||
| 491 | + background: linear-gradient(135deg, var(--accent-strong), var(--accent-2-strong)); | ||
| 492 | + border: 1px solid transparent; | ||
| 493 | + border-radius: var(--radius-sm); | ||
| 494 | + padding: 0.5rem 0.95rem; | ||
| 495 | + cursor: pointer; | ||
| 496 | + transition: | ||
| 497 | + filter 100ms, | ||
| 498 | + scale 100ms; | ||
| 499 | +} | ||
| 500 | +button:hover:not(:disabled) { | ||
| 501 | + filter: brightness(1.08); | ||
| 502 | +} | ||
| 503 | +button:active:not(:disabled) { | ||
| 504 | + scale: 0.98; | ||
| 505 | +} | ||
| 506 | +button:disabled { | ||
| 507 | + opacity: 0.55; | ||
| 508 | + cursor: default; | ||
| 509 | +} | ||
| 510 | +button:focus-visible { | ||
| 511 | + outline: 2px solid var(--accent); | ||
| 512 | + outline-offset: 2px; | ||
| 513 | +} | ||
| 514 | + | ||
| 515 | +button.ghost { | ||
| 516 | + color: var(--text); | ||
| 517 | + background: transparent; | ||
| 518 | + border-color: var(--border); | ||
| 519 | + font-weight: 500; | ||
| 520 | +} | ||
| 521 | +button.ghost:hover:not(:disabled) { | ||
| 522 | + background: var(--surface-2); | ||
| 523 | + filter: none; | ||
| 524 | +} | ||
| 525 | +button.danger { | ||
| 526 | + color: var(--danger); | ||
| 527 | +} | ||
| 528 | +button.danger:hover:not(:disabled) { | ||
| 529 | + border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); | ||
| 530 | + background: color-mix(in srgb, var(--danger) 9%, transparent); | ||
| 531 | +} | ||
| 532 | + | ||
| 533 | +button.icon-btn { | ||
| 534 | + padding: 0.45rem; | ||
| 535 | + border-radius: var(--radius-sm); | ||
| 536 | +} | ||
| 537 | + | ||
| 538 | +/* --- tables ---------------------------------------------------------------- */ | ||
| 539 | + | ||
| 540 | +.table-wrap { | ||
| 541 | + overflow-x: auto; | ||
| 542 | + background: var(--surface); | ||
| 543 | + border: 1px solid var(--border); | ||
| 544 | + border-radius: var(--radius); | ||
| 545 | + box-shadow: var(--shadow); | ||
| 546 | +} | ||
| 547 | + | ||
| 548 | +table { | ||
| 549 | + width: 100%; | ||
| 550 | + border-collapse: collapse; | ||
| 551 | +} | ||
| 552 | +th, | ||
| 553 | +td { | ||
| 554 | + text-align: left; | ||
| 555 | + padding: 0.6rem 0.9rem; | ||
| 556 | + border-bottom: 1px solid var(--border); | ||
| 557 | +} | ||
| 558 | +th { | ||
| 559 | + font-size: 0.75rem; | ||
| 560 | + text-transform: uppercase; | ||
| 561 | + letter-spacing: 0.07em; | ||
| 562 | + color: var(--muted); | ||
| 563 | + background: color-mix(in srgb, var(--surface-2) 55%, transparent); | ||
| 564 | +} | ||
| 565 | +tbody tr { | ||
| 566 | + transition: background 100ms; | ||
| 567 | +} | ||
| 568 | +tbody tr:hover { | ||
| 569 | + background: color-mix(in srgb, var(--surface-2) 45%, transparent); | ||
| 570 | +} | ||
| 571 | +tr:last-child td { | ||
| 572 | + border-bottom: none; | ||
| 573 | +} | ||
| 574 | +td .mono { | ||
| 575 | + font-size: 0.78rem; | ||
| 576 | +} | ||
| 577 | + | ||
| 578 | +/* --- bits ------------------------------------------------------------------ */ | ||
| 579 | + | ||
| 580 | +.badge { | ||
| 581 | + display: inline-flex; | ||
| 582 | + align-items: center; | ||
| 583 | + padding: 0.12rem 0.6rem; | ||
| 584 | + border-radius: 999px; | ||
| 585 | + font-size: 0.73rem; | ||
| 586 | + font-weight: 600; | ||
| 587 | + color: var(--accent); | ||
| 588 | + background: color-mix(in srgb, var(--accent) 12%, transparent); | ||
| 589 | + border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); | ||
| 590 | + text-transform: uppercase; | ||
| 591 | + letter-spacing: 0.04em; | ||
| 592 | + white-space: nowrap; | ||
| 593 | +} | ||
| 594 | +.badge-present { | ||
| 595 | + color: var(--ok); | ||
| 596 | + background: color-mix(in srgb, var(--ok) 12%, transparent); | ||
| 597 | + border-color: color-mix(in srgb, var(--ok) 25%, transparent); | ||
| 598 | +} | ||
| 599 | +.badge-absent { | ||
| 600 | + color: var(--danger); | ||
| 601 | + background: color-mix(in srgb, var(--danger) 12%, transparent); | ||
| 602 | + border-color: color-mix(in srgb, var(--danger) 25%, transparent); | ||
| 603 | +} | ||
| 604 | +.badge-late { | ||
| 605 | + color: var(--warn); | ||
| 606 | + background: color-mix(in srgb, var(--warn) 12%, transparent); | ||
| 607 | + border-color: color-mix(in srgb, var(--warn) 25%, transparent); | ||
| 608 | +} | ||
| 609 | +.badge-excused { | ||
| 610 | + color: var(--muted); | ||
| 611 | + background: color-mix(in srgb, var(--muted) 12%, transparent); | ||
| 612 | + border-color: color-mix(in srgb, var(--muted) 25%, transparent); | ||
| 613 | +} | ||
| 614 | + | ||
| 615 | +.gap-top { | ||
| 616 | + margin-top: 1.5rem; | ||
| 617 | +} | ||
| 618 | +.push { | ||
| 619 | + margin-left: auto; | ||
| 620 | +} | ||
| 621 | + | ||
| 622 | +.muted { | ||
| 623 | + color: var(--muted); | ||
| 624 | +} | ||
| 625 | +.meta { | ||
| 626 | + color: var(--muted); | ||
| 627 | + font-size: 0.85rem; | ||
| 628 | +} | ||
| 629 | +.mono { | ||
| 630 | + font-family: ui-monospace, "JetBrains Mono", monospace; | ||
| 631 | + font-size: 0.82rem; | ||
| 632 | +} | ||
| 633 | +.prewrap { | ||
| 634 | + white-space: pre-wrap; | ||
| 635 | + overflow-wrap: anywhere; | ||
| 636 | +} | ||
| 637 | +.clamp { | ||
| 638 | + display: -webkit-box; | ||
| 639 | + -webkit-line-clamp: 2; | ||
| 640 | + -webkit-box-orient: vertical; | ||
| 641 | + overflow: hidden; | ||
| 642 | +} | ||
| 643 | + | ||
| 644 | +.mark { | ||
| 645 | + font-size: 2.1rem; | ||
| 646 | + font-weight: 650; | ||
| 647 | + letter-spacing: -0.02em; | ||
| 648 | +} | ||
| 649 | +.mark small { | ||
| 650 | + font-size: 1rem; | ||
| 651 | + font-weight: 500; | ||
| 652 | + color: var(--muted); | ||
| 653 | +} | ||
| 654 | + | ||
| 655 | +.error { | ||
| 656 | + color: var(--danger); | ||
| 657 | + font-size: 0.9rem; | ||
| 658 | +} | ||
| 659 | + | ||
| 660 | +.empty { | ||
| 661 | + color: var(--muted); | ||
| 662 | + padding: 2rem 1rem; | ||
| 663 | + text-align: center; | ||
| 664 | + border: 1px dashed var(--border); | ||
| 665 | + border-radius: var(--radius); | ||
| 666 | +} | ||
| 667 | + | ||
| 668 | +/* --- loading pulse ----------------------------------------------------------- */ | ||
| 669 | + | ||
| 670 | +.loading { | ||
| 671 | + display: flex; | ||
| 672 | + gap: 0.4rem; | ||
| 673 | + justify-content: center; | ||
| 674 | + padding: 2.5rem 0; | ||
| 675 | +} | ||
| 676 | +.loading span { | ||
| 677 | + width: 7px; | ||
| 678 | + height: 7px; | ||
| 679 | + border-radius: 50%; | ||
| 680 | + background: var(--accent); | ||
| 681 | + animation: pulse 900ms ease-in-out infinite; | ||
| 682 | +} | ||
| 683 | +.loading span:nth-child(2) { | ||
| 684 | + animation-delay: 150ms; | ||
| 685 | +} | ||
| 686 | +.loading span:nth-child(3) { | ||
| 687 | + animation-delay: 300ms; | ||
| 688 | +} | ||
| 689 | + | ||
| 690 | +@keyframes pulse { | ||
| 691 | + 0%, | ||
| 692 | + 100% { | ||
| 693 | + opacity: 0.25; | ||
| 694 | + scale: 0.8; | ||
| 695 | + } | ||
| 696 | + 50% { | ||
| 697 | + opacity: 1; | ||
| 698 | + scale: 1; | ||
| 699 | + } | ||
| 700 | +} | ||
| 701 | + | ||
| 702 | +@media (prefers-reduced-motion: reduce) { | ||
| 703 | + .loading span { | ||
| 704 | + animation: none; | ||
| 705 | + } | ||
| 706 | + .link-card, | ||
| 707 | + button { | ||
| 708 | + transition: none; | ||
| 709 | + } | ||
| 710 | +} | ||
| 711 | + | ||
| 712 | +/* --- auth page ----------------------------------------------------------------- */ | ||
| 713 | + | ||
| 714 | +.auth-page { | ||
| 715 | + min-height: 100dvh; | ||
| 716 | + display: grid; | ||
| 717 | + place-items: center; | ||
| 718 | + padding: 1rem; | ||
| 719 | +} | ||
| 720 | + | ||
| 721 | +.auth-card { | ||
| 722 | + width: min(370px, 100%); | ||
| 723 | + display: flex; | ||
| 724 | + flex-direction: column; | ||
| 725 | + gap: 0.9rem; | ||
| 726 | + padding: 2rem 1.75rem; | ||
| 727 | +} | ||
| 728 | +.auth-head { | ||
| 729 | + display: flex; | ||
| 730 | + flex-direction: column; | ||
| 731 | + align-items: center; | ||
| 732 | + gap: 0.65rem; | ||
| 733 | + margin-bottom: 0.5rem; | ||
| 734 | + text-align: center; | ||
| 735 | +} | ||
| 736 | +.auth-head .brand-mark { | ||
| 737 | + width: 2.75rem; | ||
| 738 | + height: 2.75rem; | ||
| 739 | + border-radius: 13px; | ||
| 740 | +} | ||
| 741 | +.auth-head .brand-mark .icon { | ||
| 742 | + width: 1.4rem; | ||
| 743 | + height: 1.4rem; | ||
| 744 | +} | ||
| 745 | +.auth-head p { | ||
| 746 | + color: var(--muted); | ||
| 747 | + font-size: 0.88rem; | ||
| 748 | +} | ||