NextMyDay/internal/core/web/static/app.css
Claus Lohmar b8ead2bf2d feat(web): role-gate the nav and show the post-setup passkey banner
The shell now renders the CORE nav entries — Home · Account for everyone,
Users · Modules only for an admin — alongside the registry entries, with the
discovered `home` dashboard collapsed onto the core Home entry (SPEC-010 §3).

A signed-in user with no passkey, who has not opted out and is not on a
loopback origin, now sees a prominent "Add a passkey" banner linking to the
Account page (SPEC-010 §6). This closes the D-041 gap where the wizard's
direct session mint bypasses the TOTP-login nudge, so the admin was never
prompted.

The door computes (admin, banner) in serveGUID — it already holds the
session, identity and user — and attaches it to the request context; the new
web.PageFor copies it onto every authenticated page (RequestContext is
untouched, so identification stays separate from authorisation, D-003).
2026-10-15 07:58:09 +00:00

205 lines
5.5 KiB
CSS

/* MyDay — the core stylesheet (SPEC-009 §4/§7).
Hand-written, no build step, no framework. Same-origin only (CSP style-src
'self' — no inline styles). */
:root {
--bg: #f5f7fa;
--surface: #ffffff;
--ink: #101828;
--ink-soft: #475467;
--line: #dfe3e8;
--brand: #1f4bd8;
--danger: #b42318;
--notice-bg: #ecfdf3;
--notice-ink: #054f31;
--error-bg: #fef3f2;
--radius: 10px;
color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
background: var(--bg);
color: var(--ink);
font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* ── the shell ─────────────────────────────────────────────────────────────── */
.app-header {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem 1.25rem;
padding: 0.75rem 1rem;
background: var(--ink);
color: #fff;
}
.app-header .brand {
font-weight: 700;
letter-spacing: 0.02em;
color: #fff;
text-decoration: none;
}
.app-header nav ul {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
margin: 0;
padding: 0;
list-style: none;
}
.app-header nav a {
display: inline-block;
padding: 0.35rem 0.75rem;
border-radius: 999px;
color: #d0d5dd;
text-decoration: none;
}
.app-header nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.app-header nav a[aria-current="page"] {
background: #fff;
color: var(--ink);
font-weight: 600;
}
main {
max-width: 42rem;
margin: 0 auto;
padding: 1.25rem 1rem 3rem;
}
h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.25rem; }
p { margin: 0.5rem 0; color: var(--ink-soft); }
section {
background: var(--surface);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 1rem;
margin: 1rem 0;
}
section p:first-child { margin-top: 0; }
/* ── forms ─────────────────────────────────────────────────────────────────── */
form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin: 0.5rem 0; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: var(--ink-soft); }
input {
font: inherit;
color: var(--ink);
padding: 0.5rem 0.6rem;
border: 1px solid var(--line);
border-radius: 8px;
background: #fff;
min-width: 12rem;
}
input:focus-visible,
button:focus-visible,
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button {
font: inherit;
font-weight: 600;
padding: 0.55rem 0.9rem;
border: 1px solid var(--brand);
border-radius: 8px;
background: var(--brand);
color: #fff;
cursor: pointer;
}
button[disabled] { opacity: 0.6; cursor: progress; }
button.secondary {
background: #fff;
border-color: var(--line);
color: var(--ink);
}
/* ── banners & status ──────────────────────────────────────────────────────── */
.flash {
max-width: 42rem;
margin: 1rem auto 0;
padding: 0.6rem 0.9rem;
border-radius: 8px;
font-size: 0.95rem;
}
.flash.notice { background: var(--notice-bg); color: var(--notice-ink); }
.flash.error { background: var(--error-bg); color: var(--danger); }
/* The post-setup passkey prompt (SPEC-010 §6): prominent, above the content. */
.banner {
max-width: 42rem;
margin: 1rem auto 0;
padding: 0.75rem 1rem;
border: 1px solid var(--brand);
border-left-width: 4px;
border-radius: 8px;
background: #eef2ff;
color: var(--ink);
font-size: 0.95rem;
}
.banner a { color: var(--brand); font-weight: 600; }
/* A link styled as a button (Add a passkey — SPEC-010 §4). */
a.button {
display: inline-block;
font-weight: 600;
padding: 0.55rem 0.9rem;
border: 1px solid var(--brand);
border-radius: 8px;
background: var(--brand);
color: #fff;
text-decoration: none;
}
a.button:hover { background: #1a3fb8; }
code, .invite {
display: inline-block;
max-width: 100%;
overflow-wrap: anywhere;
padding: 0.2rem 0.4rem;
border: 1px solid var(--line);
border-radius: 6px;
background: #fff;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.85rem;
}
#passkey-status { font-size: 0.95rem; color: var(--ink-soft); }
#passkey-status.error { color: var(--danger); }
/* ── the Modules page ──────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
td form { margin: 0; }
.locked { color: var(--ink-soft); font-size: 0.85rem; }
.restart { color: var(--danger); }
/* ── responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 30rem) {
input { min-width: 100%; }
form { flex-direction: column; align-items: stretch; }
button { width: 100%; }
}