Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b4cccba80f | |||
| 319180d3d1 | |||
| 70ccf4a436 | |||
| 76240f1702 | |||
| 417860a1e5 |
9 changed files with 1007 additions and 81 deletions
|
|
@ -6,6 +6,8 @@ One review HTML template for **customer-service** and **access-staff** (they wer
|
|||
|
||||
In the monorepo both servers load `packages/verae-staff-ui/public/review.html`. A cloned package can set `STAFF_UI_HTML` or keep a local `public/index.html` fallback.
|
||||
|
||||
Operator docs (IAM ENROLL/TOTP, edge SUPPORT): [docs/README.md](docs/README.md).
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/verae-staff-ui
|
||||
|
||||
## Install
|
||||
|
|
|
|||
70
docs/PR-staff-role-switcher.md
Normal file
70
docs/PR-staff-role-switcher.md
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# PR: feature/staff-role-switcher (verae-staff-ui)
|
||||
|
||||
**Repo:** `verae-staff-ui`
|
||||
**Branch:** `feature/staff-role-switcher` → `main`
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/verae-staff-ui
|
||||
**Companion PR:** `verae-staff-iam` same branch (`docs/PR-staff-role-switcher.md`)
|
||||
|
||||
Paste this body (or link this file) when opening the Forgejo pull request.
|
||||
|
||||
## Summary
|
||||
|
||||
Shared staff review UI picks up the **2026 brand kit**, a top-right **role interface switcher** (calls IAM `POST /session/role`), hash lookup panel polish, and operator docs that point at **ENROLL**, **TOTP**, and **PKI READY** packs in sibling `verae-staff-iam`.
|
||||
|
||||
## Why
|
||||
|
||||
- CS and access-staff share one review template; multi-role operators need the same Interface chrome as IAM app.html.
|
||||
- Review hosts must stay plum-branded and must not emit customer `xVerae-` token keys.
|
||||
- Operators opening staff-ui need one place to find enroll / 2FA / production PKI refuse docs.
|
||||
|
||||
## What landed (vs `main`)
|
||||
|
||||
### Role switcher
|
||||
- [`public/role-switcher.js`](../public/role-switcher.js) — mounts when capabilities ≥ 2; `GET /me` + `POST /session/role` against IAM origin (`meta[name=staff-iam]` or `iam.<base>`)
|
||||
- Wired from review / load path so department doors inherit chrome
|
||||
|
||||
### Brand + review
|
||||
- `public/brand/tokens.css` + `public/verae-ui-kit.css`
|
||||
- `public/review.html` — 2026 kit, hash lookup panel
|
||||
- `src/load.js` inlines brand kit for hosts that only emit HTML
|
||||
|
||||
### Operator docs
|
||||
- [`docs/README.md`](./README.md) links sibling IAM ENROLL / TOTP / PRODUCTION-PKI-REFUSE and edge SUPPORT
|
||||
|
||||
## Link: ENROLL · TOTP · PKI READY packs
|
||||
|
||||
Paths are monorepo-relative from this package (`../../verae-staff-iam/…`). On Forgejo, open the companion IAM PR or clone `verae-staff-iam` on the same branch.
|
||||
|
||||
| Pack | Sibling path | Role |
|
||||
|------|--------------|------|
|
||||
| **ENROLL** | [`verae-staff-iam/ENROLL.md`](../../verae-staff-iam/ENROLL.md) | Device cert mTLS status + CSR scaffold (default 501) |
|
||||
| **TOTP** | [`verae-staff-iam/TOTP.md`](../../verae-staff-iam/TOTP.md) | Staff authenticator + `STAFF_TOTP_REQUIRED` |
|
||||
| **PROD-CA cutover (READY)** | [`docs/PROD-CA-CUTOVER-RUNBOOK.md`](../../verae-staff-iam/docs/PROD-CA-CUTOVER-RUNBOOK.md) | Production CA mint/renew/revoke cutover (ops) |
|
||||
| **AuthZ enroll (READY)** | [`docs/AUTHZ-ENROLL-DESIGN.md`](../../verae-staff-iam/docs/AUTHZ-ENROLL-DESIGN.md) | Design before real AuthZ mint path |
|
||||
| **CRL/OCSP deploy (READY)** | [`docs/CRL-OCSP-DEPLOY-CHECKLIST.md`](../../verae-staff-iam/docs/CRL-OCSP-DEPLOY-CHECKLIST.md) | Production CRL/OCSP deploy checklist |
|
||||
| Refuse matrix | [`docs/PRODUCTION-PKI-REFUSE.md`](../../verae-staff-iam/docs/PRODUCTION-PKI-REFUSE.md) | Lab 201 vs prod 501; no live mint in IAM |
|
||||
| IAM PR body | [`docs/PR-staff-role-switcher.md`](../../verae-staff-iam/docs/PR-staff-role-switcher.md) | Full IAM change list + invariants |
|
||||
|
||||
Staff-ui does **not** mint certs or run TOTP crypto; it only consumes IAM session/role APIs and documents the operator path.
|
||||
|
||||
## Test plan
|
||||
|
||||
```sh
|
||||
cd verae-staff-ui
|
||||
npm test
|
||||
# expect: 2/2 pass (title fill + plum brand kit inline, no customer token key)
|
||||
```
|
||||
|
||||
Manual: load review HTML with `STAFF_IAM_URL` / `meta staff-iam` pointing at a running IAM on `feature/staff-role-switcher`; multi-role user shows Interface dropdown.
|
||||
|
||||
## Merge notes
|
||||
|
||||
- Merge **with** `verae-staff-iam` `feature/staff-role-switcher` so `/session/role` and catalog exist.
|
||||
- Monorepo hosts that copy `packages/verae-staff-ui/public/review.html` should pick up brand + switcher together.
|
||||
- No production PKI behavior changes in this package.
|
||||
|
||||
## Out of scope
|
||||
|
||||
- IAM server logic (see companion PR)
|
||||
- Edge support APIs (see `zappier-edge` SUPPORT)
|
||||
- Customer portal UI
|
||||
36
docs/README.md
Normal file
36
docs/README.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# verae-staff-ui docs
|
||||
|
||||
Operator pointers for staff review UI (IAM enroll/TOTP and edge support APIs).
|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
# Docs only — clone the staff-ui package (or monorepo sibling tree).
|
||||
git clone ssh://git@git.georgelambert.org:2223/marchon/verae-staff-ui.git
|
||||
cd verae-staff-ui/docs
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```sh
|
||||
# From this package in the monorepo, open sibling operator docs:
|
||||
ls ../../verae-staff-iam/ENROLL.md ../../verae-staff-iam/TOTP.md \
|
||||
../../verae-staff-iam/docs/PRODUCTION-PKI-REFUSE.md ../../zappier-edge/SUPPORT.md
|
||||
```
|
||||
|
||||
Operator references (sibling packages):
|
||||
|
||||
- [Device certificate enrollment (mTLS)](../../verae-staff-iam/ENROLL.md) — `staff-iam` ENROLL; proxy headers, no PKI mint here
|
||||
- [Staff authenticator (TOTP)](../../verae-staff-iam/TOTP.md) — `staff-iam` TOTP setup / `STAFF_TOTP_REQUIRED`
|
||||
- [Production PKI refuse matrix](../../verae-staff-iam/docs/PRODUCTION-PKI-REFUSE.md) — lab-only 201 vs production 501; no live mint
|
||||
- [Staff support APIs](../../zappier-edge/SUPPORT.md) — `zappier-edge` `/admin/api/support/*` for CS diagnosis
|
||||
- [PR body — staff-role-switcher](./PR-staff-role-switcher.md) — branch PR for UI + links to IAM ENROLL/TOTP/PKI READY
|
||||
- PKI READY packs (sibling IAM): [PROD-CA-CUTOVER-RUNBOOK](../../verae-staff-iam/docs/PROD-CA-CUTOVER-RUNBOOK.md), [AUTHZ-ENROLL-DESIGN](../../verae-staff-iam/docs/AUTHZ-ENROLL-DESIGN.md), [CRL-OCSP-DEPLOY-CHECKLIST](../../verae-staff-iam/docs/CRL-OCSP-DEPLOY-CHECKLIST.md)
|
||||
|
||||
## Contributing
|
||||
|
||||
Questions: open an issue at https://git.georgelambert.org/marchon/verae-staff-ui/issues. Pull requests are accepted.
|
||||
|
||||
## License
|
||||
|
||||
UNLICENSED © George Lambert
|
||||
146
public/brand/tokens.css
Normal file
146
public/brand/tokens.css
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
/* GENERATED from BrandingBook.md (brand-tokens v1.0.0). Do not edit — run ./regenerate.sh */
|
||||
:root{
|
||||
--plum:#531B59;
|
||||
--plum-d:#3E1343;
|
||||
--plum-mid:#6C5B81;
|
||||
--plum-200:#D9CCE3;
|
||||
--plum-100:#EBD9EE;
|
||||
--plum-50:#F7EFF8;
|
||||
--violet:#6B3FD6;
|
||||
--print-purple:#4A2E8C;
|
||||
--gold:#C4A85A;
|
||||
--gold-d:#6E5717;
|
||||
--gold-50:#FFF8E6;
|
||||
--cube:#5CE1E6;
|
||||
--cube-navy:#1E3D59;
|
||||
--cube-ink:#174759;
|
||||
--ink:#1D1534;
|
||||
--ink-2:#2C2140;
|
||||
--ink-soft:#3B3250;
|
||||
--muted:#5E5470;
|
||||
--subtle:#6B6478;
|
||||
--faint:#8A8298;
|
||||
--disabled:#9A90A9;
|
||||
--line-strong:#CFC7DA;
|
||||
--line:#E3DEF0;
|
||||
--line-soft:#F0ECF4;
|
||||
--surface-2:#F4F1F8;
|
||||
--surface-3:#FAF8FC;
|
||||
--bg:#FBFAFD;
|
||||
--card:#FFFFFF;
|
||||
--on-primary:#FFFFFF;
|
||||
--canvas:#E9E6EE;
|
||||
--night:#0F0A14;
|
||||
--night-card:#1A1224;
|
||||
--night-line:#3A2A4A;
|
||||
--night-ink:#F4EEF8;
|
||||
--night-muted:#A898B8;
|
||||
--ok:#0E6B3A;
|
||||
--ok-bg:#E3F5EA;
|
||||
--ok-bd:#B9E2C8;
|
||||
--inc:#8A3D00;
|
||||
--inc-bg:#FFE8D3;
|
||||
--inc-bd:#F3C9A3;
|
||||
--pend:#475467;
|
||||
--pend-bg:#EEF0F3;
|
||||
--pend-bd:#D5DAE1;
|
||||
--warn:#7A4F00;
|
||||
--warn-bg:#FFF3D6;
|
||||
--warn-bd:#EDD49A;
|
||||
--err:#B42318;
|
||||
--err-bg:#FDE8E6;
|
||||
--err-bd:#F4BCB6;
|
||||
--info:#3B2A8C;
|
||||
--info-bg:#ECE8FB;
|
||||
--info-bd:#CFC6F3;
|
||||
--off:#334155;
|
||||
--off-bg:#E5EAF1;
|
||||
--off-bd:#C9D2DE;
|
||||
--focus:#6B3FD6;
|
||||
--callout:#E0218A;
|
||||
--font-sans:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
||||
--font-serif:'Fraunces', Georgia, serif;
|
||||
--font-mono:'JetBrains Mono', 'SF Mono', 'Roboto Mono', ui-monospace, monospace;
|
||||
--font-apple:-apple-system, 'SF Pro', 'Inter', sans-serif;
|
||||
--font-android:'Roboto', 'Inter', sans-serif;
|
||||
--font-windows:'Segoe UI Variable', 'Segoe UI', 'Selawik', 'Inter', sans-serif;
|
||||
--font-gnome:'Adwaita Sans', 'Cantarell', 'Inter', sans-serif;
|
||||
--font-icons:'MSR';
|
||||
--fs-display:34px; --lh-display:41px; --fw-display:700; --tr-display:-0.02em;
|
||||
--fs-title-1:28px; --lh-title-1:34px; --fw-title-1:700; --tr-title-1:-0.01em;
|
||||
--fs-title-2:22px; --lh-title-2:28px; --fw-title-2:700; --tr-title-2:0em;
|
||||
--fs-title-3:18px; --lh-title-3:24px; --fw-title-3:600; --tr-title-3:0em;
|
||||
--fs-body-lg:17px; --lh-body-lg:24px; --fw-body-lg:400; --tr-body-lg:0em;
|
||||
--fs-body:15px; --lh-body:22px; --fw-body:400; --tr-body:0em;
|
||||
--fs-body-sm:13px; --lh-body-sm:18px; --fw-body-sm:400; --tr-body-sm:0em;
|
||||
--fs-caption:12px; --lh-caption:16px; --fw-caption:500; --tr-caption:0em;
|
||||
--fs-overline:11px; --lh-overline:14px; --fw-overline:600; --tr-overline:0.06em;
|
||||
--fs-mono:13px; --lh-mono:18px; --fw-mono:500; --tr-mono:-0.01em;
|
||||
--fs-certificate-title:28px; --lh-certificate-title:34px; --fw-certificate-title:600; --tr-certificate-title:-0.01em;
|
||||
--space-0:0px;
|
||||
--space-1:2px;
|
||||
--space-2:4px;
|
||||
--space-3:8px;
|
||||
--space-4:12px;
|
||||
--space-5:16px;
|
||||
--space-6:20px;
|
||||
--space-7:24px;
|
||||
--space-8:32px;
|
||||
--space-9:40px;
|
||||
--space-10:48px;
|
||||
--space-11:64px;
|
||||
--radius-xs:4px;
|
||||
--radius-sm:6px;
|
||||
--radius-md:10px;
|
||||
--radius-lg:12px;
|
||||
--radius-xl:14px;
|
||||
--radius-2xl:18px;
|
||||
--radius-pill:999px;
|
||||
--elev-e0:none;
|
||||
--elev-e1:0 1px 2px rgba(29,21,52,.06), 0 1px 1px rgba(29,21,52,.04);
|
||||
--elev-e2:0 4px 14px rgba(29,21,52,.10), 0 1px 3px rgba(29,21,52,.06);
|
||||
--elev-e3:0 12px 40px rgba(30,10,40,.25), 0 2px 8px rgba(30,10,40,.12);
|
||||
--dur-fast:120ms;
|
||||
--dur-base:200ms;
|
||||
--dur-slow:320ms;
|
||||
--ease-standard:cubic-bezier(0.2, 0, 0, 1);
|
||||
--ease-emphasized:cubic-bezier(0.16, 1, 0.3, 1);
|
||||
--ease-exit:cubic-bezier(0.3, 0, 1, 1);
|
||||
--touch-ios-min:44px;
|
||||
--touch-android-min:48px;
|
||||
--touch-windows-min:40px;
|
||||
--touch-web-min:44px;
|
||||
--touch-glove-min:72px;
|
||||
}
|
||||
[data-theme="dark"]{--plum:#D7B4DE;--plum-d:#EBD9EE;--plum-50:#2A1A30;--plum-100:#3A2342;--on-primary:#1D1534;--ink:#F4EEF8;--muted:#B3A6C2;--line:#3A2A4A;--line-soft:#2A2036;--surface-2:#241A30;--bg:#0F0A14;--card:#1A1224;--ok:#7FD9A5;--ok-bg:#12301F;--inc:#F5B27A;--inc-bg:#33200F;--pend:#BAC4D2;--pend-bg:#1F2531;--warn:#EBC874;--warn-bg:#2D2410;--err:#FF968C;--err-bg:#361615;--info:#BDB1FF;--info-bg:#221D40;--off:#B0BCCD;--off-bg:#1C2330;--focus:#BDB1FF;}
|
||||
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]):not([data-theme="mock"]){--plum:#D7B4DE;--plum-d:#EBD9EE;--plum-50:#2A1A30;--plum-100:#3A2342;--on-primary:#1D1534;--ink:#F4EEF8;--muted:#B3A6C2;--line:#3A2A4A;--line-soft:#2A2036;--surface-2:#241A30;--bg:#0F0A14;--card:#1A1224;--ok:#7FD9A5;--ok-bg:#12301F;--inc:#F5B27A;--inc-bg:#33200F;--pend:#BAC4D2;--pend-bg:#1F2531;--warn:#EBC874;--warn-bg:#2D2410;--err:#FF968C;--err-bg:#361615;--info:#BDB1FF;--info-bg:#221D40;--off:#B0BCCD;--off-bg:#1C2330;--focus:#BDB1FF;}}
|
||||
@media (prefers-reduced-motion: reduce){:root{--dur-fast:0ms;--dur-base:0ms;--dur-slow:0ms}}
|
||||
|
||||
/* Semantic aliases for Verae 2026 app shells (portal, admin, staff, ITAD, Sign, Verify) */
|
||||
:root {
|
||||
--panel: var(--card);
|
||||
--accent: var(--plum);
|
||||
--accent-ink: var(--on-primary);
|
||||
--accent-soft: var(--plum-50);
|
||||
--soft: var(--plum-50);
|
||||
--danger: var(--err);
|
||||
--radius: var(--radius-lg);
|
||||
--shadow: 0 1px 2px rgba(29,21,52,.06), 0 8px 24px rgba(29,21,52,.08);
|
||||
--font-ui: var(--font-sans);
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #0F0A14;
|
||||
--card: #1A1224;
|
||||
--panel: #1A1224;
|
||||
--ink: #F4EEF8;
|
||||
--muted: #B3A6C2;
|
||||
--line: #3A2A4A;
|
||||
--accent: #D7B4DE;
|
||||
--accent-ink: #1D1534;
|
||||
--accent-soft: #2A1A30;
|
||||
--soft: #2A1A30;
|
||||
--danger: #FF968C;
|
||||
--ok: #7FD9A5;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,94 +3,119 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="staff-iam" content="" />
|
||||
<link rel="stylesheet" href="brand/tokens.css" />
|
||||
<link rel="stylesheet" href="verae-ui-kit.css" />
|
||||
<title>{{TITLE}}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%234f46e5'/%3E%3C/svg%3E"/>
|
||||
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='8' fill='%23531B59'/%3E%3Ctext x='16' y='22' text-anchor='middle' font-size='14' font-family='system-ui' font-weight='700' fill='white'%3EV%3C/text%3E%3C/svg%3E"/>
|
||||
<style>
|
||||
:root {
|
||||
--bg:#f4f5fb; --panel:#fff; --ink:#171a26; --muted:#6b7186; --line:#e5e7f0;
|
||||
--accent:#4f46e5; --accent-ink:#fff; --soft:#eef0fe; --danger:#dc2626; --ok:#047857;
|
||||
--radius:12px; --shadow:0 1px 2px rgba(23,26,38,.05), 0 8px 24px rgba(23,26,38,.06);
|
||||
/* Staff CS review — kit shell + plum empty states (no customer token storage) */
|
||||
body.p-web { margin: 0; background: var(--bg); color: var(--ink); }
|
||||
.skip { position: absolute; left: -999px; }
|
||||
.skip:focus { left: 1rem; top: 1rem; z-index: 20; background: #fff; color: var(--plum); padding: 0.5rem 0.9rem; border-radius: 8px; }
|
||||
aside .spacer { flex: 1; }
|
||||
.card { margin-bottom: 1rem; padding: 1.1rem 1.25rem; }
|
||||
.card h3 { margin: 0 0 0.75rem; font-size: 0.95rem; }
|
||||
label {
|
||||
display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
|
||||
text-transform: uppercase; color: var(--muted); margin: 0.7rem 0 0.25rem;
|
||||
}
|
||||
* { box-sizing:border-box; }
|
||||
body { margin:0; font:14px/1.45 -apple-system,"SF Pro Text","Segoe UI",sans-serif; background:var(--bg); color:var(--ink); }
|
||||
.skip { position:absolute; left:-999px; }
|
||||
.skip:focus { left:1rem; top:1rem; z-index:20; background:#fff; color:var(--accent); padding:.5rem .9rem; border-radius:8px; }
|
||||
header.app { background:linear-gradient(160deg,#312e81 0%,#4f46e5 60%,#7c74f0 100%); color:#eef0fe; padding:1.15rem 1.5rem 1.25rem; }
|
||||
.kicker { letter-spacing:.12em; text-transform:uppercase; font:700 10px system-ui; opacity:.75; }
|
||||
header.app h1 { margin:.2rem 0 .25rem; font-size:1.25rem; }
|
||||
header.app p { margin:0; font-size:13px; opacity:.88; max-width:42rem; }
|
||||
main { max-width:1080px; margin:0 auto; padding:1.5rem 1.25rem 3rem; }
|
||||
.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:1.1rem 1.25rem; margin-bottom:1rem; }
|
||||
.card h3 { margin:0 0 .75rem; font-size:.95rem; }
|
||||
label { display:block; font-size:.72rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin:.7rem 0 .25rem; }
|
||||
input { width:100%; max-width:22rem; padding:.5rem .65rem; border:1px solid var(--line); border-radius:8px; font-size:.95rem; }
|
||||
input:focus-visible, button:focus-visible, a:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
|
||||
.row { display:flex; flex-wrap:wrap; gap:.6rem; align-items:end; }
|
||||
.row > div { min-width:10rem; }
|
||||
button, a.btn {
|
||||
border:0; border-radius:8px; padding:.5rem .9rem; font:650 13px system-ui; cursor:pointer;
|
||||
background:var(--accent); color:#fff; text-decoration:none; display:inline-block;
|
||||
input {
|
||||
width: 100%; max-width: 22rem; padding: 0.5rem 0.65rem;
|
||||
border: 1px solid var(--line); border-radius: 8px; font-size: 0.95rem; background: #fff; color: var(--ink);
|
||||
}
|
||||
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
|
||||
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
|
||||
.row > div { min-width: 10rem; }
|
||||
button.btn, a.btn { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
|
||||
.money { font-variant-numeric: tabular-nums; }
|
||||
.muted { color: var(--muted); }
|
||||
.empty { text-align: center; padding: 1.5rem 1rem; color: var(--muted); }
|
||||
.empty svg { display: block; margin: 0 auto 0.6rem; }
|
||||
.empty h3, .empty .who { margin: 0 0 0.25rem; color: var(--ink); font-size: 1rem; font-weight: 750; }
|
||||
.err { color: var(--err, #B42318); }
|
||||
.staff-note {
|
||||
font-size: 0.78rem; color: var(--muted); margin: 0.5rem 0 0;
|
||||
}
|
||||
button.ghost, a.btn.ghost { background:#fff; color:var(--ink); border:1px solid var(--line); }
|
||||
table { border-collapse:collapse; width:100%; }
|
||||
th { text-align:left; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); border-bottom:1px solid var(--line); padding:.45rem .55rem; }
|
||||
td { border-bottom:1px solid var(--line); padding:.5rem .55rem; }
|
||||
.money { font-variant-numeric:tabular-nums; }
|
||||
.muted { color:var(--muted); }
|
||||
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:.8rem; margin-bottom:1rem; }
|
||||
.stat { background:var(--panel); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:.9rem 1.1rem; }
|
||||
.stat .k { font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
|
||||
.stat .v { font-size:1.35rem; font-weight:800; margin-top:.2rem; font-variant-numeric:tabular-nums; }
|
||||
.empty { text-align:center; padding:1.5rem 1rem; color:var(--muted); }
|
||||
.empty svg { display:block; margin:0 auto .6rem; }
|
||||
.err { color:var(--danger); }
|
||||
.who { font-weight:750; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<body class="p-web">
|
||||
<a class="skip" href="#main">Skip to content</a>
|
||||
<header class="app">
|
||||
<div class="kicker">{{KICKER}}</div>
|
||||
<h1>{{TITLE}}</h1>
|
||||
<p>{{LEDE}}</p>
|
||||
</header>
|
||||
<main id="main">
|
||||
<div class="card">
|
||||
<div class="row">
|
||||
<div>
|
||||
<label for="id">Customer</label>
|
||||
<input id="id" list="cust-list" placeholder="Type a name or id" autocomplete="off" />
|
||||
<datalist id="cust-list"></datalist>
|
||||
</div>
|
||||
<button type="button" onclick="review()">Review account</button>
|
||||
<div class="app-shell" id="shell">
|
||||
<aside>
|
||||
<div class="app-brand">
|
||||
<span class="mark">V</span>
|
||||
<div><b>Verae</b><div class="xs muted">Staff</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h3>Apply credit</h3>
|
||||
<div class="row">
|
||||
<div>
|
||||
<label for="dollars">Amount (USD)</label>
|
||||
<input id="dollars" type="number" min="0.01" step="0.01" value="5.00" />
|
||||
<nav class="app-nav">
|
||||
<button type="button" class="active" data-panel="review">Account review</button>
|
||||
<button type="button" data-panel="hash">Hash lookup</button>
|
||||
<button type="button" data-panel="credit">Apply credit</button>
|
||||
</nav>
|
||||
<div class="spacer"></div>
|
||||
<p class="staff-note" style="padding:0 8px 12px">Staff session via IAM cookie. Never stores customer xVerae- keys.</p>
|
||||
</aside>
|
||||
<main id="main">
|
||||
<div class="kicker" style="letter-spacing:.12em;text-transform:uppercase;font:700 10px system-ui;color:var(--muted);margin-bottom:4px">{{KICKER}}</div>
|
||||
<div class="h1">{{TITLE}}</div>
|
||||
<p class="lede">{{LEDE}}</p>
|
||||
|
||||
<div class="card" id="panel-review">
|
||||
<div class="row">
|
||||
<div>
|
||||
<label for="id">Customer (email / name / id)</label>
|
||||
<input id="id" list="cust-list" placeholder="Type a name, email, or id" autocomplete="off" />
|
||||
<datalist id="cust-list"></datalist>
|
||||
</div>
|
||||
<button type="button" class="btn primary" onclick="review()">Review account</button>
|
||||
</div>
|
||||
<div>
|
||||
<label for="reason">Reason</label>
|
||||
<input id="reason" value="goodwill" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="agent">Agent name</label>
|
||||
<input id="agent" value="cs" />
|
||||
</div>
|
||||
<button type="button" onclick="credit()">Apply credit</button>
|
||||
<p class="staff-note">ZP-B2-style support lookup. Staff session via IAM cookie — never stores customer xVerae- keys.</p>
|
||||
</div>
|
||||
<p class="muted" style="margin:.7rem 0 0;font-size:12px">Credits write to account-balance. The customer sees dollars, not cents.</p>
|
||||
</div>
|
||||
<div id="out"></div>
|
||||
</main>
|
||||
|
||||
<div class="card" id="panel-hash" hidden>
|
||||
<h3>Look up by hash</h3>
|
||||
<div class="row">
|
||||
<div style="flex:1;min-width:16rem">
|
||||
<label for="hash">SHA-256</label>
|
||||
<input id="hash" class="mono" style="font-family:var(--font-mono);max-width:none;width:100%" placeholder="64-char hex or sha256:…" spellcheck="false" autocomplete="off" />
|
||||
</div>
|
||||
<button type="button" class="btn primary" onclick="lookupHash()">Look up</button>
|
||||
</div>
|
||||
<p class="staff-note">Calls host <code>/lookup/hash/:sha</code> or admin <code>/admin/api/support/hash/:sha</code> when available. Evidence is receipt/CID only — jobId is not proof.</p>
|
||||
<div id="hash-out"></div>
|
||||
</div>
|
||||
|
||||
<div class="card" id="panel-credit">
|
||||
<h3>Apply credit</h3>
|
||||
<div class="row">
|
||||
<div>
|
||||
<label for="dollars">Amount (USD)</label>
|
||||
<input id="dollars" type="number" min="0.01" step="0.01" value="5.00" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="reason">Reason</label>
|
||||
<input id="reason" value="goodwill" />
|
||||
</div>
|
||||
<div>
|
||||
<label for="agent">Agent name</label>
|
||||
<input id="agent" value="cs" />
|
||||
</div>
|
||||
<button type="button" class="btn primary" onclick="credit()">Apply credit</button>
|
||||
</div>
|
||||
<p class="staff-note">Credits write to account-balance. The customer sees dollars, not cents. Requires cs.credit (or owner).</p>
|
||||
</div>
|
||||
|
||||
<div id="out"></div>
|
||||
</main>
|
||||
</div>
|
||||
<script>
|
||||
const fmt = (c) => (c < 0 ? '-$' : '$') + (Math.abs(c || 0) / 100).toFixed(2);
|
||||
const when = (v) => (v ? new Date(v).toLocaleString() : '—');
|
||||
/* Plum empty-state (brand kit) */
|
||||
const EMPTY_SVG =
|
||||
'<svg width="80" height="64" viewBox="0 0 80 64" fill="none" aria-hidden="true"><rect x="16" y="8" width="48" height="48" rx="8" fill="#F7EFF8"/><rect x="24" y="20" width="32" height="4" rx="2" fill="#531B59" opacity=".35"/><rect x="24" y="30" width="24" height="4" rx="2" fill="#531B59" opacity=".2"/><rect x="24" y="40" width="28" height="4" rx="2" fill="#531B59" opacity=".2"/></svg>';
|
||||
const empty = (title, hint) =>
|
||||
`<div class="empty"><svg width="80" height="64" viewBox="0 0 80 64" fill="none" aria-hidden="true"><rect x="16" y="8" width="48" height="48" rx="8" fill="#eef0fe"/><rect x="24" y="20" width="32" height="4" rx="2" fill="#4f46e5" opacity=".35"/><rect x="24" y="30" width="24" height="4" rx="2" fill="#4f46e5" opacity=".2"/><rect x="24" y="40" width="28" height="4" rx="2" fill="#4f46e5" opacity=".2"/></svg><div class="who">${title}</div><p>${hint}</p></div>`;
|
||||
`<div class="empty">${EMPTY_SVG}<div class="who">${title}</div><p>${hint}</p></div>`;
|
||||
function moneyTable(list, cols, emptyTitle) {
|
||||
if (!list || !list.length) return empty(emptyTitle, 'Nothing recorded for this customer yet.');
|
||||
const head = cols.map((c) => `<th>${c.label}</th>`).join('');
|
||||
|
|
@ -98,16 +123,16 @@
|
|||
const v = c.key === 'cents' ? fmt(r.cents) : c.key === 'at' ? when(r.at) : (r[c.key] ?? '—');
|
||||
return `<td class="${c.key === 'cents' ? 'money' : ''}">${v}</td>`;
|
||||
}).join('') + '</tr>').join('');
|
||||
return `<table><thead><tr>${head}</tr></thead><tbody>${body}</tbody></table>`;
|
||||
return `<table class="t"><thead><tr>${head}</tr></thead><tbody>${body}</tbody></table>`;
|
||||
}
|
||||
function paint(st, id) {
|
||||
const name = st.name || st.customerName || id;
|
||||
document.getElementById('out').innerHTML = `
|
||||
<div class="stat-grid">
|
||||
<div class="stat"><div class="k">Customer</div><div class="v" style="font-size:1.05rem">${name}</div></div>
|
||||
<div class="stat"><div class="k">Prepaid balance</div><div class="v">${fmt(st.prepaidCents)}</div></div>
|
||||
<div class="stat"><div class="k">Credits</div><div class="v">${(st.credits||[]).length}</div></div>
|
||||
<div class="stat"><div class="k">Source</div><div class="v" style="font-size:1rem">${st.source || 'unknown'}</div></div>
|
||||
<div class="kpi-grid" style="grid-template-columns:repeat(auto-fit,minmax(150px,1fr))">
|
||||
<div class="kpi"><div class="k">Customer</div><div class="v" style="font-size:1.05rem">${name}</div></div>
|
||||
<div class="kpi"><div class="k">Prepaid balance</div><div class="v">${fmt(st.prepaidCents)}</div></div>
|
||||
<div class="kpi"><div class="k">Credits</div><div class="v">${(st.credits||[]).length}</div></div>
|
||||
<div class="kpi"><div class="k">Source</div><div class="v" style="font-size:1rem">${st.source || 'unknown'}</div></div>
|
||||
</div>
|
||||
<div class="card"><h3>Credits</h3>${moneyTable(st.credits, [{key:'cents',label:'Amount'},{key:'reason',label:'Reason'},{key:'agent',label:'Agent'},{key:'at',label:'When'}], 'No credits yet')}</div>
|
||||
<div class="card"><h3>Usage</h3>${moneyTable(st.usage, [{key:'endpointId',label:'Endpoint'},{key:'cents',label:'Amount'},{key:'at',label:'When'}], 'No usage yet')}</div>
|
||||
|
|
@ -117,7 +142,7 @@
|
|||
try {
|
||||
const { customers } = await (await fetch('/customers')).json();
|
||||
document.getElementById('cust-list').innerHTML = (customers || [])
|
||||
.map((c) => `<option value="${c.name}">${c.id}</option>`)
|
||||
.map((c) => `<option value="${c.name}">${c.id}${c.email ? ' · ' + c.email : ''}</option>`)
|
||||
.join('');
|
||||
if (customers && customers[0] && !document.getElementById('id').value) {
|
||||
document.getElementById('id').value = customers[0].name;
|
||||
|
|
@ -136,6 +161,61 @@
|
|||
document.getElementById('out').innerHTML = `<div class="card err">${err.message}</div>`;
|
||||
}
|
||||
}
|
||||
function receiptBadge(rec) {
|
||||
const fin = String(rec.finality || rec.status || '').toLowerCase();
|
||||
const block = rec.blockNumber ?? rec.merkle;
|
||||
if (fin === 'final' || fin === 'completed' || (rec.receipt_id && block != null)) {
|
||||
const label = block != null
|
||||
? 'Final: Substrate block #' + (Number(block).toLocaleString ? Number(block).toLocaleString('en-US') : block) + ', finalized'
|
||||
: 'Final';
|
||||
return '<span class="badge b-ok sm" role="status">' + label + '</span>';
|
||||
}
|
||||
if (fin.includes('pend')) return '<span class="badge b-pend sm" role="status">Pending receipt</span>';
|
||||
if (rec.exists === false) return '<span class="badge b-off sm" role="status">No record</span>';
|
||||
return '<span class="badge b-info sm" role="status">' + (rec.status || 'Found') + '</span>';
|
||||
}
|
||||
async function lookupHash() {
|
||||
const raw = document.getElementById('hash').value.trim().toLowerCase().replace(/^sha256:/, '').replace(/\s+/g, '');
|
||||
const box = document.getElementById('hash-out');
|
||||
if (!raw) {
|
||||
box.innerHTML = empty('Enter a hash', '64-character hex SHA-256.');
|
||||
return;
|
||||
}
|
||||
const paths = [
|
||||
'/lookup/hash/' + encodeURIComponent(raw),
|
||||
'/admin/api/support/hash/' + encodeURIComponent(raw),
|
||||
'/support/hash/' + encodeURIComponent(raw),
|
||||
];
|
||||
box.innerHTML = '<p class="muted">Looking up…</p>';
|
||||
let lastErr = 'Hash lookup API not available on this host.';
|
||||
for (const path of paths) {
|
||||
try {
|
||||
const r = await fetch(path, { credentials: 'same-origin' });
|
||||
const st = await r.json().catch(() => ({}));
|
||||
if (r.status === 404 && (st.error === 'Hash not found' || st.exists === false)) {
|
||||
box.innerHTML = empty('No record', 'No receipt for this hash. Confirm the digest.');
|
||||
return;
|
||||
}
|
||||
if (r.status === 404 || r.status === 501) {
|
||||
lastErr = st.error || lastErr;
|
||||
continue;
|
||||
}
|
||||
if (!r.ok) throw new Error(st.error || ('HTTP ' + r.status));
|
||||
const when = st.timestamp ? new Date(st.timestamp).toLocaleString() : '—';
|
||||
box.innerHTML = `
|
||||
<div class="kpi-grid" style="grid-template-columns:repeat(auto-fit,minmax(140px,1fr));margin-top:0.75rem">
|
||||
<div class="kpi"><div class="k">Receipt</div><div class="v" style="font-size:0.95rem">${receiptBadge(st)}</div></div>
|
||||
<div class="kpi"><div class="k">Submitted</div><div class="v" style="font-size:0.95rem">${when}</div></div>
|
||||
<div class="kpi"><div class="k">Source</div><div class="v" style="font-size:0.95rem">${st.source || '—'}</div></div>
|
||||
</div>
|
||||
<p class="staff-note" style="margin-top:0.6rem">CID/receipt: <code>${st.receipt_id || st.certificate || '—'}</code> · jobId is not proof.</p>`;
|
||||
return;
|
||||
} catch (err) {
|
||||
lastErr = err.message || lastErr;
|
||||
}
|
||||
}
|
||||
box.innerHTML = empty('Lookup unavailable', lastErr);
|
||||
}
|
||||
async function credit() {
|
||||
const dollars = Number(document.getElementById('dollars').value);
|
||||
const body = {
|
||||
|
|
@ -152,6 +232,25 @@
|
|||
}
|
||||
await review();
|
||||
}
|
||||
document.querySelectorAll('.app-nav button').forEach((btn) => {
|
||||
btn.addEventListener('click', () => {
|
||||
document.querySelectorAll('.app-nav button').forEach((b) => b.classList.remove('active'));
|
||||
btn.classList.add('active');
|
||||
const panel = btn.dataset.panel;
|
||||
const rev = document.getElementById('panel-review');
|
||||
const hash = document.getElementById('panel-hash');
|
||||
const cred = document.getElementById('panel-credit');
|
||||
rev.hidden = panel === 'hash';
|
||||
hash.hidden = panel !== 'hash';
|
||||
cred.hidden = panel === 'hash';
|
||||
rev.style.outline = panel === 'review' ? '2px solid var(--plum-100)' : '';
|
||||
hash.style.outline = panel === 'hash' ? '2px solid var(--plum-100)' : '';
|
||||
cred.style.outline = panel === 'credit' ? '2px solid var(--plum-100)' : '';
|
||||
const el = document.getElementById(panel === 'credit' ? 'dollars' : panel === 'hash' ? 'hash' : 'id');
|
||||
if (el) el.focus();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="role-switcher.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
148
public/role-switcher.js
Normal file
148
public/role-switcher.js
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
/** Staff role interface switcher — top-right dropdown when user has ≥2 capabilities. */
|
||||
(function () {
|
||||
function iamOrigin() {
|
||||
const meta = document.querySelector('meta[name="staff-iam"]');
|
||||
if (meta && meta.content) return meta.content.replace(/\/$/, '');
|
||||
const host = location.hostname;
|
||||
const base = host.replace(/^[^.]+\./, '');
|
||||
return `${location.protocol}//iam.${base}`;
|
||||
}
|
||||
|
||||
function ensureCss() {
|
||||
if (document.getElementById('staff-role-switcher-css')) return;
|
||||
const s = document.createElement('style');
|
||||
s.id = 'staff-role-switcher-css';
|
||||
s.textContent = `
|
||||
header.app { position:relative; }
|
||||
header.app .staff-chrome {
|
||||
position:absolute; top:1rem; right:1.25rem; display:flex; gap:.5rem; align-items:center; z-index:40;
|
||||
}
|
||||
.app-shell aside .staff-chrome,
|
||||
.app-shell .staff-chrome {
|
||||
position:static; display:flex; gap:.5rem; align-items:center; margin:4px;
|
||||
}
|
||||
.role-switch { position:relative; }
|
||||
.role-switch summary {
|
||||
list-style:none; cursor:pointer; user-select:none;
|
||||
background:rgba(255,255,255,.14); color:#fff; border:1px solid rgba(255,255,255,.28);
|
||||
border-radius:999px; padding:.35rem .85rem; font:650 12px system-ui; min-height:32px;
|
||||
}
|
||||
.app-shell .role-switch summary {
|
||||
background:var(--plum-50,#F7EFF8); color:var(--plum,#531B59);
|
||||
border:1px solid var(--plum-100,#EBD9EE);
|
||||
}
|
||||
.role-switch summary::-webkit-details-marker { display:none; }
|
||||
.role-switch[open] summary { background:rgba(255,255,255,.22); }
|
||||
.app-shell .role-switch[open] summary { background:var(--plum-100,#EBD9EE); }
|
||||
.role-menu {
|
||||
position:absolute; right:0; top:calc(100% + .35rem); min-width:12rem;
|
||||
background:#fff; color:var(--ink,#1D1534); border:1px solid var(--line,#E3DEF0); border-radius:10px;
|
||||
box-shadow:0 1px 2px rgba(29,21,52,.06), 0 8px 24px rgba(29,21,52,.08); padding:.35rem; margin:0;
|
||||
}
|
||||
.role-menu button {
|
||||
display:block; width:100%; text-align:left; border:0; background:transparent;
|
||||
padding:.45rem .65rem; border-radius:8px; font:650 13px system-ui; cursor:pointer; color:var(--ink,#1D1534);
|
||||
}
|
||||
.role-menu button:hover, .role-menu button.on {
|
||||
background:var(--plum-50,#F7EFF8); color:var(--plum,#531B59);
|
||||
}
|
||||
.staff-who { font:650 11px system-ui; color:#e4e7ff; opacity:.9; max-width:10rem; text-align:right; }
|
||||
.app-shell .staff-who { color:var(--muted,#5E5470); text-align:left; }
|
||||
@media (max-width:640px) { .staff-who { display:none; } }
|
||||
`;
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
|
||||
async function api(path, opts) {
|
||||
const r = await fetch(iamOrigin() + path, {
|
||||
credentials: 'include',
|
||||
...opts,
|
||||
headers: { 'content-type': 'application/json', ...(opts && opts.headers) },
|
||||
});
|
||||
const body = await r.json().catch(() => ({}));
|
||||
if (!r.ok) throw new Error(body.reason || body.error || ('HTTP ' + r.status));
|
||||
return body;
|
||||
}
|
||||
|
||||
function mountChrome() {
|
||||
const shellAside = document.querySelector('.app-shell aside');
|
||||
const header = document.querySelector('header.app');
|
||||
const hostParent = shellAside || header;
|
||||
if (!hostParent) return null;
|
||||
let chrome = hostParent.querySelector('.staff-chrome');
|
||||
if (!chrome) {
|
||||
chrome = document.createElement('div');
|
||||
chrome.className = 'staff-chrome';
|
||||
chrome.innerHTML = '<span class="staff-who" hidden></span><div class="role-switch-host"></div>';
|
||||
if (shellAside) {
|
||||
const logout = shellAside.querySelector('#logout, [data-logout]');
|
||||
if (logout) shellAside.insertBefore(chrome, logout);
|
||||
else shellAside.appendChild(chrome);
|
||||
} else {
|
||||
header.appendChild(chrome);
|
||||
}
|
||||
}
|
||||
return chrome;
|
||||
}
|
||||
|
||||
function paint(user) {
|
||||
ensureCss();
|
||||
const chrome = mountChrome();
|
||||
if (!chrome) return;
|
||||
const who = chrome.querySelector('.staff-who');
|
||||
const host = chrome.querySelector('.role-switch-host');
|
||||
if (who) {
|
||||
who.hidden = false;
|
||||
who.textContent = user.name || user.username || '';
|
||||
}
|
||||
const caps = user.capabilities || user.roles || [];
|
||||
const interfaces = (user.interfaces || []).filter((i) => caps.includes(i.id));
|
||||
if (interfaces.length < 2) {
|
||||
host.innerHTML = '';
|
||||
return;
|
||||
}
|
||||
const cur = user.currentRole || interfaces[0].id;
|
||||
const curTitle = (interfaces.find((i) => i.id === cur) || interfaces[0]).title;
|
||||
host.innerHTML = `<details class="role-switch">
|
||||
<summary>Interface: ${curTitle}</summary>
|
||||
<div class="role-menu">
|
||||
${interfaces.map((i) => `<button type="button" data-role="${i.id}" class="${i.id === cur ? 'on' : ''}">${i.title}</button>`).join('')}
|
||||
</div>
|
||||
</details>`;
|
||||
host.querySelectorAll('[data-role]').forEach((btn) => {
|
||||
btn.addEventListener('click', async () => {
|
||||
try {
|
||||
const out = await api('/session/role', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ role: btn.dataset.role }),
|
||||
});
|
||||
const target = out.url;
|
||||
if (target) {
|
||||
const dest = new URL(target, location.href);
|
||||
if (dest.host !== location.host || dest.pathname !== location.pathname) {
|
||||
location.href = dest.href;
|
||||
return;
|
||||
}
|
||||
}
|
||||
paint(out.user || user);
|
||||
} catch (err) {
|
||||
alert(err.message || 'Could not switch role');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function boot() {
|
||||
try {
|
||||
const { user } = await api('/me');
|
||||
if (user) paint(user);
|
||||
} catch {
|
||||
/* not signed in or IAM unreachable — doors handle redirect */
|
||||
}
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
|
||||
else boot();
|
||||
|
||||
window.VeraeStaffRoleSwitcher = { boot, paint, iamOrigin };
|
||||
})();
|
||||
380
public/verae-ui-kit.css
Normal file
380
public/verae-ui-kit.css
Normal file
|
|
@ -0,0 +1,380 @@
|
|||
/* Verae 2026 UI kit — design tokens + BASE_CSS + semantic aliases + app-shell (ZP-09 mobile) */
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0');
|
||||
/* GENERATED from BrandingBook.md (brand-tokens v1.0.0). Do not edit — run ./regenerate.sh */
|
||||
:root{
|
||||
--plum:#531B59;
|
||||
--plum-d:#3E1343;
|
||||
--plum-mid:#6C5B81;
|
||||
--plum-200:#D9CCE3;
|
||||
--plum-100:#EBD9EE;
|
||||
--plum-50:#F7EFF8;
|
||||
--violet:#6B3FD6;
|
||||
--print-purple:#4A2E8C;
|
||||
--gold:#C4A85A;
|
||||
--gold-d:#6E5717;
|
||||
--gold-50:#FFF8E6;
|
||||
--cube:#5CE1E6;
|
||||
--cube-navy:#1E3D59;
|
||||
--cube-ink:#174759;
|
||||
--ink:#1D1534;
|
||||
--ink-2:#2C2140;
|
||||
--ink-soft:#3B3250;
|
||||
--muted:#5E5470;
|
||||
--subtle:#6B6478;
|
||||
--faint:#8A8298;
|
||||
--disabled:#9A90A9;
|
||||
--line-strong:#CFC7DA;
|
||||
--line:#E3DEF0;
|
||||
--line-soft:#F0ECF4;
|
||||
--surface-2:#F4F1F8;
|
||||
--surface-3:#FAF8FC;
|
||||
--bg:#FBFAFD;
|
||||
--card:#FFFFFF;
|
||||
--on-primary:#FFFFFF;
|
||||
--canvas:#E9E6EE;
|
||||
--night:#0F0A14;
|
||||
--night-card:#1A1224;
|
||||
--night-line:#3A2A4A;
|
||||
--night-ink:#F4EEF8;
|
||||
--night-muted:#A898B8;
|
||||
--ok:#0E6B3A;
|
||||
--ok-bg:#E3F5EA;
|
||||
--ok-bd:#B9E2C8;
|
||||
--inc:#8A3D00;
|
||||
--inc-bg:#FFE8D3;
|
||||
--inc-bd:#F3C9A3;
|
||||
--pend:#475467;
|
||||
--pend-bg:#EEF0F3;
|
||||
--pend-bd:#D5DAE1;
|
||||
--warn:#7A4F00;
|
||||
--warn-bg:#FFF3D6;
|
||||
--warn-bd:#EDD49A;
|
||||
--err:#B42318;
|
||||
--err-bg:#FDE8E6;
|
||||
--err-bd:#F4BCB6;
|
||||
--info:#3B2A8C;
|
||||
--info-bg:#ECE8FB;
|
||||
--info-bd:#CFC6F3;
|
||||
--off:#334155;
|
||||
--off-bg:#E5EAF1;
|
||||
--off-bd:#C9D2DE;
|
||||
--focus:#6B3FD6;
|
||||
--callout:#E0218A;
|
||||
--font-sans:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
||||
--font-serif:'Fraunces', Georgia, serif;
|
||||
--font-mono:'JetBrains Mono', 'SF Mono', 'Roboto Mono', ui-monospace, monospace;
|
||||
--font-apple:-apple-system, 'SF Pro', 'Inter', sans-serif;
|
||||
--font-android:'Roboto', 'Inter', sans-serif;
|
||||
--font-windows:'Segoe UI Variable', 'Segoe UI', 'Selawik', 'Inter', sans-serif;
|
||||
--font-gnome:'Adwaita Sans', 'Cantarell', 'Inter', sans-serif;
|
||||
--font-icons:'MSR';
|
||||
--fs-display:34px; --lh-display:41px; --fw-display:700; --tr-display:-0.02em;
|
||||
--fs-title-1:28px; --lh-title-1:34px; --fw-title-1:700; --tr-title-1:-0.01em;
|
||||
--fs-title-2:22px; --lh-title-2:28px; --fw-title-2:700; --tr-title-2:0em;
|
||||
--fs-title-3:18px; --lh-title-3:24px; --fw-title-3:600; --tr-title-3:0em;
|
||||
--fs-body-lg:17px; --lh-body-lg:24px; --fw-body-lg:400; --tr-body-lg:0em;
|
||||
--fs-body:15px; --lh-body:22px; --fw-body:400; --tr-body:0em;
|
||||
--fs-body-sm:13px; --lh-body-sm:18px; --fw-body-sm:400; --tr-body-sm:0em;
|
||||
--fs-caption:12px; --lh-caption:16px; --fw-caption:500; --tr-caption:0em;
|
||||
--fs-overline:11px; --lh-overline:14px; --fw-overline:600; --tr-overline:0.06em;
|
||||
--fs-mono:13px; --lh-mono:18px; --fw-mono:500; --tr-mono:-0.01em;
|
||||
--fs-certificate-title:28px; --lh-certificate-title:34px; --fw-certificate-title:600; --tr-certificate-title:-0.01em;
|
||||
--space-0:0px;
|
||||
--space-1:2px;
|
||||
--space-2:4px;
|
||||
--space-3:8px;
|
||||
--space-4:12px;
|
||||
--space-5:16px;
|
||||
--space-6:20px;
|
||||
--space-7:24px;
|
||||
--space-8:32px;
|
||||
--space-9:40px;
|
||||
--space-10:48px;
|
||||
--space-11:64px;
|
||||
--radius-xs:4px;
|
||||
--radius-sm:6px;
|
||||
--radius-md:10px;
|
||||
--radius-lg:12px;
|
||||
--radius-xl:14px;
|
||||
--radius-2xl:18px;
|
||||
--radius-pill:999px;
|
||||
--elev-e0:none;
|
||||
--elev-e1:0 1px 2px rgba(29,21,52,.06), 0 1px 1px rgba(29,21,52,.04);
|
||||
--elev-e2:0 4px 14px rgba(29,21,52,.10), 0 1px 3px rgba(29,21,52,.06);
|
||||
--elev-e3:0 12px 40px rgba(30,10,40,.25), 0 2px 8px rgba(30,10,40,.12);
|
||||
--dur-fast:120ms;
|
||||
--dur-base:200ms;
|
||||
--dur-slow:320ms;
|
||||
--ease-standard:cubic-bezier(0.2, 0, 0, 1);
|
||||
--ease-emphasized:cubic-bezier(0.16, 1, 0.3, 1);
|
||||
--ease-exit:cubic-bezier(0.3, 0, 1, 1);
|
||||
--touch-ios-min:44px;
|
||||
--touch-android-min:48px;
|
||||
--touch-windows-min:40px;
|
||||
--touch-web-min:44px;
|
||||
--touch-glove-min:72px;
|
||||
}
|
||||
[data-theme="dark"]{--plum:#D7B4DE;--plum-d:#EBD9EE;--plum-50:#2A1A30;--plum-100:#3A2342;--on-primary:#1D1534;--ink:#F4EEF8;--muted:#B3A6C2;--line:#3A2A4A;--line-soft:#2A2036;--surface-2:#241A30;--bg:#0F0A14;--card:#1A1224;--ok:#7FD9A5;--ok-bg:#12301F;--inc:#F5B27A;--inc-bg:#33200F;--pend:#BAC4D2;--pend-bg:#1F2531;--warn:#EBC874;--warn-bg:#2D2410;--err:#FF968C;--err-bg:#361615;--info:#BDB1FF;--info-bg:#221D40;--off:#B0BCCD;--off-bg:#1C2330;--focus:#BDB1FF;}
|
||||
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]):not([data-theme="mock"]){--plum:#D7B4DE;--plum-d:#EBD9EE;--plum-50:#2A1A30;--plum-100:#3A2342;--on-primary:#1D1534;--ink:#F4EEF8;--muted:#B3A6C2;--line:#3A2A4A;--line-soft:#2A2036;--surface-2:#241A30;--bg:#0F0A14;--card:#1A1224;--ok:#7FD9A5;--ok-bg:#12301F;--inc:#F5B27A;--inc-bg:#33200F;--pend:#BAC4D2;--pend-bg:#1F2531;--warn:#EBC874;--warn-bg:#2D2410;--err:#FF968C;--err-bg:#361615;--info:#BDB1FF;--info-bg:#221D40;--off:#B0BCCD;--off-bg:#1C2330;--focus:#BDB1FF;}}
|
||||
@media (prefers-reduced-motion: reduce){:root{--dur-fast:0ms;--dur-base:0ms;--dur-slow:0ms}}
|
||||
|
||||
/* Semantic aliases for Verae 2026 app shells (portal, admin, staff, ITAD, Sign, Verify) */
|
||||
:root {
|
||||
--panel: var(--card);
|
||||
--accent: var(--plum);
|
||||
--accent-ink: var(--on-primary);
|
||||
--accent-soft: var(--plum-50);
|
||||
--soft: var(--plum-50);
|
||||
--danger: var(--err);
|
||||
--radius: var(--radius-lg);
|
||||
--shadow: 0 1px 2px rgba(29,21,52,.06), 0 8px 24px rgba(29,21,52,.08);
|
||||
--font-ui: var(--font-sans);
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #0F0A14;
|
||||
--card: #1A1224;
|
||||
--panel: #1A1224;
|
||||
--ink: #F4EEF8;
|
||||
--muted: #B3A6C2;
|
||||
--line: #3A2A4A;
|
||||
--accent: #D7B4DE;
|
||||
--accent-ink: #1D1534;
|
||||
--accent-soft: #2A1A30;
|
||||
--soft: #2A1A30;
|
||||
--danger: #FF968C;
|
||||
--ok: #7FD9A5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
*{box-sizing:border-box;margin:0;padding:0}
|
||||
html,body{background:var(--bg)}
|
||||
body{font-family:var(--font-sans);color:var(--ink);-webkit-font-smoothing:antialiased}
|
||||
.ms{font-family:'MSR';font-weight:normal;font-style:normal;font-size:20px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;direction:ltr;font-variation-settings:'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24;vertical-align:middle;user-select:none}
|
||||
.ms.f{font-variation-settings:'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24}
|
||||
.mono{font-family:var(--font-mono);font-size:.92em;letter-spacing:-.01em}
|
||||
.muted{color:var(--muted)} .small{font-size:12px} .xs{font-size:11px} .b{font-weight:600} .bb{font-weight:700}
|
||||
.row{display:flex;align-items:center;gap:8px} .col{display:flex;flex-direction:column;gap:8px}
|
||||
.grow{flex:1;min-width:0} .wrap{flex-wrap:wrap} .sp{justify-content:space-between} .ell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.canvas{position:relative;display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(160deg,var(--line-soft),#E2DDE9)}
|
||||
.ribbon{position:absolute;top:10px;left:14px;font:600 11px var(--font-sans);color:var(--muted);letter-spacing:.04em;text-transform:uppercase;display:flex;gap:8px;align-items:center}
|
||||
.ribbon .ex{background:var(--warn-bg);color:var(--warn);border:1px solid #E9CF8F;border-radius:4px;padding:2px 6px}
|
||||
/* callouts (annotated renders only) */
|
||||
.co{position:absolute;display:none;z-index:999;width:22px;height:22px;border-radius:50%;background:var(--callout);color:#fff;font:700 12px/22px var(--font-sans);text-align:center;box-shadow:0 0 0 2px #fff,0 2px 6px rgba(0,0,0,.35);transform:translate(-6px,-9px);pointer-events:none}
|
||||
body.annot .co{display:block}
|
||||
/* badges */
|
||||
.badge{display:inline-flex;align-items:center;gap:5px;border-radius:var(--radius-pill);padding:3px 10px 3px 7px;font-size:12px;font-weight:600;line-height:16px;border:1px solid transparent;white-space:nowrap}
|
||||
.badge .ms{font-size:15px}
|
||||
.badge.sm{font-size:11px;padding:2px 8px 2px 5px}.badge.sm .ms{font-size:13px}
|
||||
.b-ok{background:var(--ok-bg);color:var(--ok);border-color:var(--ok-bd)}.b-warn{background:var(--warn-bg);color:var(--warn);border-color:var(--warn-bd)}
|
||||
.b-inc{background:var(--inc-bg);color:var(--inc);border-color:var(--inc-bd)}.b-pend{background:var(--pend-bg);color:var(--pend);border-color:var(--pend-bd)}
|
||||
.b-err{background:var(--err-bg);color:var(--err);border-color:var(--err-bd)}.b-info{background:var(--info-bg);color:var(--info);border-color:var(--info-bd)}
|
||||
.b-off{background:var(--off-bg);color:var(--off);border-color:var(--off-bd)}
|
||||
.spin{animation:none}
|
||||
.mh{display:inline-flex;align-items:center;gap:4px;font-family:var(--font-mono);font-size:12px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);padding:2px 6px;color:var(--ink-2)}
|
||||
.mh .pfx{color:var(--plum);font-weight:600}
|
||||
.mh .ms{font-size:14px;color:var(--muted)}
|
||||
/* generic controls (platform classes refine) */
|
||||
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;font-weight:600;font-size:14px;border-radius:var(--radius-md);padding:0 16px;height:40px;border:1px solid transparent;white-space:nowrap;cursor:default}
|
||||
.btn .ms{font-size:18px}
|
||||
.btn.primary{background:var(--plum);color:var(--on-primary)}
|
||||
.btn.secondary{background:var(--card);color:var(--plum);border-color:#CDBFD4}
|
||||
.btn.tonal{background:var(--plum-100);color:var(--plum-d)}
|
||||
.btn.text{background:transparent;color:var(--plum);padding:0 8px}
|
||||
.btn.danger{background:#fff;color:var(--err);border-color:var(--err-bd)}
|
||||
.btn.dangerf{background:var(--err);color:#fff}
|
||||
.btn.lg{height:52px;font-size:16px;border-radius:var(--radius-xl)}
|
||||
.btn.xl{height:var(--touch-glove-min);font-size:20px;border-radius:var(--radius-2xl)}
|
||||
.btn.block{display:flex;width:100%}
|
||||
.btn.dis{opacity:.45}
|
||||
.field{display:flex;flex-direction:column;gap:4px}
|
||||
.field label{font-size:12px;font-weight:600;color:var(--muted)}
|
||||
.inp{height:42px;border:1px solid var(--line-strong);border-radius:var(--radius-md);background:#fff;padding:0 12px;display:flex;align-items:center;gap:8px;font-size:14px;color:var(--ink)}
|
||||
.inp.ph{color:var(--faint)}.inp.focus{border:2px solid var(--violet);padding:0 11px}.inp.err{border:2px solid var(--err)}
|
||||
.inp .ms{color:var(--muted);font-size:18px}
|
||||
.help{font-size:12px;color:var(--muted)} .errt{font-size:12px;color:var(--err);display:flex;gap:4px;align-items:center}
|
||||
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-xl)}
|
||||
.pad{padding:14px}.pad2{padding:20px}
|
||||
.banner{display:flex;gap:10px;align-items:flex-start;border-radius:var(--radius-lg);padding:10px 12px;font-size:13px;line-height:1.35}
|
||||
.banner .ms{font-size:20px}
|
||||
.bn-off{background:var(--off-bg);color:var(--off)}.bn-err{background:var(--err-bg);color:var(--err)}.bn-warn{background:var(--warn-bg);color:var(--warn)}.bn-ok{background:var(--ok-bg);color:var(--ok)}.bn-info{background:var(--info-bg);color:var(--info)}
|
||||
.list{background:var(--card);border-radius:var(--radius-lg);overflow:hidden;border:1px solid var(--line)}
|
||||
.li{display:flex;align-items:center;gap:12px;padding:10px 14px;border-bottom:1px solid var(--line-soft);min-height:52px;position:relative}
|
||||
.li:last-child{border-bottom:0}
|
||||
.li .lead{width:36px;height:36px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:var(--plum-50);color:var(--plum);flex:none}
|
||||
.li .t{font-size:15px;font-weight:500}.li .s{font-size:12px;color:var(--muted);margin-top:2px}
|
||||
.li.sel{background:var(--line-soft)}
|
||||
.chev{color:#A39AB0}
|
||||
.sec-h{font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin:14px 4px 6px}
|
||||
.sw{width:44px;height:26px;border-radius:13px;background:var(--line-strong);position:relative;flex:none}.sw::after{content:'';position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.3)}
|
||||
.sw.on{background:var(--plum)}.sw.on::after{left:21px}
|
||||
.chk{width:18px;height:18px;border-radius:4px;border:2px solid var(--disabled);display:inline-flex;align-items:center;justify-content:center;flex:none}.chk.on{background:var(--plum);border-color:var(--plum);color:#fff}.chk.on::after{content:'✓';font-size:12px;font-weight:700}
|
||||
.radio{width:18px;height:18px;border-radius:50%;border:2px solid var(--disabled);flex:none;position:relative}.radio.on{border-color:var(--plum)}.radio.on::after{content:'';position:absolute;inset:3px;border-radius:50%;background:var(--plum)}
|
||||
.seg{display:inline-flex;background:var(--line-soft);border-radius:9px;padding:2px}.seg span{padding:5px 12px;font-size:13px;font-weight:500;border-radius:7px;color:var(--muted)}.seg span.on{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}
|
||||
.chip{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 10px;border-radius:8px;border:1px solid var(--line-strong);font-size:12px;font-weight:500;background:#fff;color:var(--ink)}.chip.on{background:var(--plum-100);border-color:var(--plum-100);color:var(--plum-d)}
|
||||
.chip .ms{font-size:16px}
|
||||
.prog{height:6px;border-radius:3px;background:var(--canvas);overflow:hidden}.prog>i{display:block;height:100%;background:var(--plum)}
|
||||
.tl{display:flex;flex-direction:column;gap:0}
|
||||
.tl .st{display:flex;gap:10px;position:relative;padding-bottom:14px}
|
||||
.tl .st:not(:last-child)::before{content:'';position:absolute;left:11px;top:24px;bottom:0;width:2px;background:#DDD5E6}
|
||||
.tl .st.done:not(:last-child)::before{background:var(--ok)}
|
||||
.tl .dot{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:none;background:var(--pend-bg);color:var(--pend)}
|
||||
.tl .dot .ms{font-size:16px}
|
||||
.tl .done .dot{background:var(--ok-bg);color:var(--ok)}.tl .cur .dot{background:var(--inc-bg);color:var(--inc);box-shadow:0 0 0 3px var(--inc-bg)}
|
||||
.tl .st .tt{font-size:13px;font-weight:600}.tl .st .ts{font-size:12px;color:var(--muted)}
|
||||
.tl .todo .tt{color:var(--subtle);font-weight:500}
|
||||
table.t{width:100%;border-collapse:collapse;font-size:13px}
|
||||
table.t th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:600;padding:8px 10px;border-bottom:1px solid var(--line);background:var(--surface-3)}
|
||||
table.t td{padding:9px 10px;border-bottom:1px solid var(--line-soft);vertical-align:middle}
|
||||
table.t tr.sel td{background:var(--night-ink)}
|
||||
.kv{display:grid;grid-template-columns:140px 1fr;gap:6px 12px;font-size:13px}.kv>div:nth-child(odd){color:var(--muted)}
|
||||
.qr svg{display:block}
|
||||
.avatar{width:32px;height:32px;border-radius:50%;background:var(--plum-100);color:var(--plum-d);display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex:none}
|
||||
.cubeic{width:36px;height:36px;border-radius:9px;background:linear-gradient(140deg,#E6FAFB,#CDEFF1);display:flex;align-items:center;justify-content:center;color:#0E6F76;flex:none}
|
||||
.kbd{font:600 11px var(--font-mono);border:1px solid var(--line-strong);border-bottom-width:2px;border-radius:4px;padding:0 4px;color:var(--muted);background:#fff}
|
||||
.field-in{display:inline-block;min-width:44px;padding:4px 8px;border:1px solid var(--line-strong);border-radius:6px;background:#fff;font-weight:600}
|
||||
.dz{border:2px dashed #B9A6C4;border-radius:14px;background:var(--surface-3);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--plum);text-align:center}
|
||||
.skel{background:linear-gradient(90deg,var(--line-soft),var(--surface-2),var(--line-soft));border-radius:6px;height:12px}
|
||||
.scrim{position:absolute;inset:0;background:rgba(20,10,30,.38)}
|
||||
.shadow{box-shadow:var(--elev-e3)}
|
||||
.hr{height:1px;background:var(--line);margin:8px 0}
|
||||
.notice{font-size:11px;color:var(--muted);line-height:1.35}
|
||||
.stepper{display:flex;gap:6px}.stepper i{flex:1;height:4px;border-radius:2px;background:var(--line)}.stepper i.on{background:var(--plum)}
|
||||
|
||||
/* ---------------- iOS (Apple HIG) */
|
||||
.p-ios .kv,.p-and .kv{grid-template-columns:92px 1fr;font-size:12.5px}
|
||||
.p-ios{font-family:var(--font-sans);font-feature-settings:'ss01','cv11';background:var(--surface-2)}
|
||||
.p-ios .btn{border-radius:12px;height:50px;font-size:17px}
|
||||
.p-ios .btn.sm{height:34px;font-size:15px;border-radius:17px;padding:0 14px}
|
||||
.p-ios .list{border:0;border-radius:12px}
|
||||
.p-ios .li{border-bottom:0;min-height:44px;padding:9px 16px}
|
||||
.p-ios .li:not(:last-child)::after{content:'';position:absolute;left:64px;right:0;bottom:0;height:.5px;background:#C6C6C8}
|
||||
.p-ios .li .lead{width:30px;height:30px;border-radius:7px;background:var(--plum);color:#fff}.p-ios .li .lead .ms{font-size:18px}
|
||||
.p-ios .li .t{font-size:16px;font-weight:400}
|
||||
.p-ios .sec-h{text-transform:uppercase;font-weight:400;color:#6D6D72;font-size:12.5px;margin:18px 16px 6px}
|
||||
.p-ios .inp{border:0;border-radius:10px;height:44px;font-size:16px}
|
||||
.p-ios .sw{width:51px;height:31px;border-radius:16px}.p-ios .sw::after{width:27px;height:27px;top:2px;left:2px}.p-ios .sw.on{background:#34C759}.p-ios .sw.on::after{left:22px}
|
||||
/* ---------------- Android (Material 3) */
|
||||
.p-and{font-family:var(--font-android);background:var(--surface-3)}
|
||||
.p-and .btn{border-radius:20px;height:40px;font-size:14px;font-weight:500;letter-spacing:.01em}
|
||||
.p-and .btn.lg{height:56px;border-radius:28px}.p-and .btn.xl{height:72px;border-radius:24px;font-size:20px}
|
||||
.p-and .list{border:0;border-radius:0;background:transparent}
|
||||
.p-and .li{border-bottom:0;padding:8px 16px;min-height:56px}
|
||||
.p-and .li .lead{border-radius:50%;background:#F2DDF4;color:var(--plum-d);width:40px;height:40px}
|
||||
.p-and .li .t{font-size:16px;font-weight:400}.p-and .li .s{font-size:14px}
|
||||
.p-and .inp{border-radius:4px;height:56px;border:1px solid #7C7381;background:transparent;font-size:16px}
|
||||
.p-and .card{border-radius:12px;border:0;background:var(--plum-50)}
|
||||
.p-and .chip{border-radius:8px;height:32px}
|
||||
.p-and .sec-h{text-transform:none;letter-spacing:0;font-size:14px;color:var(--plum);font-weight:500;margin:16px 16px 4px}
|
||||
/* ---------------- macOS (Apple HIG) */
|
||||
.p-mac{font-family:var(--font-sans);font-size:13px;background:#fff}
|
||||
.p-mac .btn{height:24px;border-radius:6px;font-size:13px;font-weight:500;padding:0 10px;box-shadow:0 .5px 1px rgba(0,0,0,.2)}
|
||||
.p-mac .btn.secondary{border-color:#D6D3DA;color:var(--ink)}
|
||||
.p-mac .btn.lg{height:32px;font-size:14px}
|
||||
.p-mac .inp{height:26px;border-radius:6px;font-size:13px;border-color:#D3CFD8}
|
||||
.p-mac .li{min-height:36px;padding:6px 10px}.p-mac .li .t{font-size:13px}.p-mac .li .lead{width:28px;height:28px}
|
||||
.p-mac table.t th{background:#fff;font-size:11px;text-transform:none;letter-spacing:0;color:var(--subtle);padding:5px 8px}.p-mac table.t td{padding:6px 8px}
|
||||
.p-mac table.t tr:nth-child(even) td{background:var(--surface-3)}.p-mac table.t tr.sel td{background:var(--plum);color:#fff}
|
||||
.p-mac table.t tr.sel td .muted{color:var(--plum-100)}
|
||||
/* ---------------- Windows (Fluent 2) */
|
||||
.p-win{font-family:var(--font-windows);font-size:14px;background:#F3F3F3}
|
||||
.p-win .btn{border-radius:4px;height:32px;font-size:14px;font-weight:400;padding:0 12px;border:1px solid #E5E5E5}
|
||||
.p-win .btn.primary{border-color:var(--plum-d)}
|
||||
.p-win .btn.secondary{color:#1B1B1B;border-color:#D1D1D1;border-bottom-color:#B5B5B5}
|
||||
.p-win .inp{height:32px;border-radius:4px;border-color:#E5E5E5;border-bottom:1px solid #8A8A8A;font-size:14px}
|
||||
.p-win .inp.focus{border:1px solid #E5E5E5;border-bottom:2px solid var(--plum)}
|
||||
.p-win .card{border-radius:8px;border-color:#E5E5E5}
|
||||
.p-win .list{border-radius:8px;border-color:#E5E5E5}
|
||||
.p-win .li .lead{border-radius:4px}
|
||||
.p-win .sw{width:40px;height:20px;border-radius:10px;background:#fff;border:1px solid #8A8A8A}.p-win .sw::after{width:12px;height:12px;top:3px;left:4px;background:#5D5D5D;box-shadow:none}.p-win .sw.on{background:var(--plum);border-color:var(--plum)}.p-win .sw.on::after{left:23px;background:#fff}
|
||||
/* ---------------- GNOME (libadwaita) */
|
||||
.p-gno{font-family:var(--font-gnome);font-size:14px;background:#FAFAFA}
|
||||
.p-gno .btn{border-radius:6px;height:34px;font-size:14px;font-weight:700;padding:0 14px;background:#E8E8E8;color:#2E3436;border:0}
|
||||
.p-gno .btn.primary{background:var(--plum);color:var(--on-primary)}
|
||||
.p-gno .btn.pill{border-radius:999px;height:42px;padding:0 28px}
|
||||
.p-gno .btn.flat{background:transparent}
|
||||
.p-gno .btn.dangerf{background:#C01C28}
|
||||
.p-gno .list{border-radius:12px;border:0;box-shadow:0 0 0 1px rgba(0,0,0,.06),0 1px 3px rgba(0,0,0,.08)}
|
||||
.p-gno .li{min-height:52px;border-bottom:1px solid #EBEBEB}.p-gno .li .t{font-size:14.5px}
|
||||
.p-gno .li .lead{background:transparent;color:#2E3436;width:24px}
|
||||
.p-gno .inp{border:0;background:#EBEBEB;border-radius:6px;height:36px}
|
||||
.p-gno .sw{width:48px;height:26px}.p-gno .sw.on{background:var(--plum)}
|
||||
.p-gno .sec-h{text-transform:none;letter-spacing:0;color:#2E3436;font-size:15px;font-weight:700;margin:18px 2px 8px}
|
||||
.p-gno .card{border:0;border-radius:12px;box-shadow:0 0 0 1px rgba(0,0,0,.06),0 1px 3px rgba(0,0,0,.08)}
|
||||
/* ---------------- Web */
|
||||
.p-web{font-family:var(--font-sans);font-size:14px;background:var(--bg)}
|
||||
.p-web .btn{border-radius:8px;height:38px}
|
||||
.p-web .btn.sm{height:30px;font-size:13px;padding:0 10px}
|
||||
|
||||
.ms{font-family:'Material Symbols Rounded',MSR,sans-serif}
|
||||
body{font-family:Inter,var(--font-sans),system-ui,sans-serif}
|
||||
/* App shell (web products) */
|
||||
.app-shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}
|
||||
.app-shell aside{background:var(--card);border-right:1px solid var(--line);padding:16px 12px;display:flex;flex-direction:column;gap:4px;position:sticky;top:0;height:100vh;z-index:20}
|
||||
.app-shell main{padding:28px 32px 48px;max-width:1100px;min-width:0}
|
||||
.app-brand{display:flex;align-items:center;gap:10px;padding:4px 8px 16px}
|
||||
.app-brand .mark{width:32px;height:32px;border-radius:10px;background:linear-gradient(140deg,var(--plum),var(--violet));color:#fff;display:grid;place-items:center;font-weight:800;font-size:14px}
|
||||
.app-nav button,.app-nav a.nav{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:0;background:transparent;padding:10px 12px;border-radius:10px;color:var(--muted);font:600 14px Inter,system-ui;cursor:pointer;text-decoration:none;min-height:var(--touch-web-min,44px)}
|
||||
.app-nav button:hover,.app-nav a.nav:hover{background:var(--surface-2);color:var(--ink)}
|
||||
.app-nav button.active,.app-nav a.nav.active{background:var(--plum-50);color:var(--plum)}
|
||||
.app-nav .ms{font-size:20px}
|
||||
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:16px 0}
|
||||
.kpi{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-xl);padding:14px 16px}
|
||||
.kpi .k{font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
|
||||
.kpi .v{font-size:26px;font-weight:700;margin-top:4px;font-variant-numeric:tabular-nums}
|
||||
.kpi .s{font-size:12px;color:var(--muted);margin-top:2px}
|
||||
.t{width:100%;border-collapse:collapse}
|
||||
.t th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);border-bottom:1px solid var(--line);padding:8px 10px}
|
||||
.t td{border-bottom:1px solid var(--line-soft);padding:10px;font-size:14px}
|
||||
.t tr:hover td{background:var(--plum-50)}
|
||||
.h1{font-size:24px;font-weight:700;letter-spacing:-.01em}
|
||||
.lede{color:var(--muted);font-size:14px;margin:4px 0 16px}
|
||||
.auth-screen{min-height:100vh;display:grid;place-items:center;background:linear-gradient(160deg,var(--plum-50),var(--canvas));padding:24px}
|
||||
.auth-card{width:min(400px,100%);max-width:100%;background:var(--card);border-radius:16px;padding:28px 24px;box-shadow:var(--elev-e2,0 8px 24px rgba(29,21,52,.08));border:1px solid var(--line)}
|
||||
/* Mobile chrome (ZP-09) — topbar + collapsible drawer; desktop unchanged */
|
||||
.app-topbar{display:none;align-items:center;gap:10px;padding:10px 14px;background:var(--card);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:15;min-height:52px}
|
||||
.app-topbar .topbar-title{font-weight:700;font-size:15px;color:var(--ink);flex:1;min-width:0}
|
||||
.nav-toggle{display:inline-flex;align-items:center;justify-content:center;width:var(--touch-web-min,44px);height:var(--touch-web-min,44px);border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--plum);cursor:pointer;flex:none;padding:0}
|
||||
.nav-toggle .ms{font-size:22px}
|
||||
.nav-toggle:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
|
||||
.nav-scrim{display:none;position:fixed;inset:0;background:rgba(20,10,30,.38);z-index:18;border:0;padding:0;cursor:pointer}
|
||||
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
|
||||
@media(max-width:900px){
|
||||
/* flex column so fixed drawer/scrim do not leave empty grid rows (beats #shell.on) */
|
||||
.app-shell,#shell.on.app-shell{display:flex;flex-direction:column;grid-template-columns:unset}
|
||||
.app-shell>.app-topbar{display:flex;flex:none;order:0}
|
||||
.app-shell>aside{
|
||||
position:fixed;left:0;top:0;bottom:0;width:min(280px,86vw);height:100vh;max-height:100dvh;
|
||||
transform:translateX(-105%);transition:transform var(--dur-base,200ms) var(--ease-standard,cubic-bezier(0.2,0,0,1));
|
||||
box-shadow:var(--elev-e3);border-right:1px solid var(--line);z-index:22;padding-top:12px
|
||||
}
|
||||
.app-shell.nav-open>aside{transform:translateX(0)}
|
||||
.app-shell.nav-open>.nav-scrim{display:block}
|
||||
.app-shell>main{padding:16px 14px 48px;max-width:none;flex:1;order:1;width:100%}
|
||||
.kpi-grid{grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
|
||||
.kpi .v{font-size:22px}
|
||||
.h1{font-size:20px}
|
||||
.btn{min-height:var(--touch-web-min,44px)}
|
||||
.btn.sm{min-height:40px}
|
||||
.auth-screen{padding:16px}
|
||||
.auth-card{width:min(400px,100%);padding:24px 18px}
|
||||
.auth-card input,.auth-card .inp{min-height:44px;font-size:16px}
|
||||
.auth-card .btn.primary,.auth-card button.primary{min-height:var(--touch-web-min,44px)}
|
||||
.kv{grid-template-columns:1fr;gap:4px 0}
|
||||
.qr-box{flex-direction:column}
|
||||
.filterbar{gap:12px}
|
||||
.filterbar input,.filterbar select{min-height:44px;font-size:16px}
|
||||
.row-actions{white-space:normal}
|
||||
.row-actions button{margin:4px 4px 4px 0;min-height:40px}
|
||||
}
|
||||
@media(max-width:560px){
|
||||
.kpi-grid{grid-template-columns:1fr}
|
||||
.kpi{padding:12px 14px}
|
||||
.status-toast,#status{left:12px;right:12px;max-width:none;bottom:12px}
|
||||
}
|
||||
@media(prefers-reduced-motion:reduce){
|
||||
.app-shell>aside{transition:none}
|
||||
}
|
||||
39
src/load.js
39
src/load.js
|
|
@ -3,10 +3,11 @@ import path from 'node:path';
|
|||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
||||
const PUBLIC = path.join(HERE, '..', 'public');
|
||||
|
||||
export function reviewHtmlPath(fallback) {
|
||||
const env = process.env.STAFF_UI_HTML;
|
||||
const shared = path.join(HERE, '..', 'public', 'review.html');
|
||||
const shared = path.join(PUBLIC, 'review.html');
|
||||
const sibling = path.join(HERE, '..', '..', 'verae-staff-ui', 'public', 'review.html');
|
||||
for (const p of [env, shared, sibling, fallback]) {
|
||||
if (p && fs.existsSync(p)) return p;
|
||||
|
|
@ -14,6 +15,33 @@ export function reviewHtmlPath(fallback) {
|
|||
return fallback;
|
||||
}
|
||||
|
||||
function readPublic(name) {
|
||||
const p = path.join(PUBLIC, name);
|
||||
if (fs.existsSync(p)) return fs.readFileSync(p, 'utf8');
|
||||
return '';
|
||||
}
|
||||
|
||||
/** Inline kit + role-switcher so hosts that only emit HTML still look branded. */
|
||||
function inlineAssets(html) {
|
||||
const tokens = readPublic(path.join('brand', 'tokens.css'));
|
||||
const kit = readPublic('verae-ui-kit.css');
|
||||
const switcher = readPublic('role-switcher.js');
|
||||
const css = [tokens, kit].filter(Boolean).join('\n');
|
||||
if (css) {
|
||||
html = html.replace(
|
||||
/<link rel="stylesheet" href="brand\/tokens\.css"\s*\/?>\s*<link rel="stylesheet" href="verae-ui-kit\.css"\s*\/?>/i,
|
||||
`<style id="verae-staff-brand">\n${css}\n</style>`,
|
||||
);
|
||||
}
|
||||
if (switcher) {
|
||||
html = html.replace(
|
||||
/<script src="role-switcher\.js"><\/script>/i,
|
||||
`<script>\n${switcher}\n</script>`,
|
||||
);
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
export function loadReviewHtml(opts, fallback) {
|
||||
const file = reviewHtmlPath(fallback);
|
||||
let html = fs.readFileSync(file, 'utf8');
|
||||
|
|
@ -23,5 +51,12 @@ export function loadReviewHtml(opts, fallback) {
|
|||
'{{LEDE}}': opts.lede || 'Review prepaid balance, credits, usage, and payments in dollars.',
|
||||
};
|
||||
for (const [k, v] of Object.entries(map)) html = html.split(k).join(v);
|
||||
return html;
|
||||
const iam = (process.env.STAFF_IAM_URL || '').replace(/\/$/, '');
|
||||
if (iam) {
|
||||
html = html.replace(
|
||||
/<meta name="staff-iam" content="[^"]*"\s*\/>/,
|
||||
`<meta name="staff-iam" content="${iam}" />`,
|
||||
);
|
||||
}
|
||||
return inlineAssets(html);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,3 +9,13 @@ test('fills title kicker lede', () => {
|
|||
assert.match(html, /After authz/);
|
||||
assert.doesNotMatch(html, /\{\{TITLE\}\}/);
|
||||
});
|
||||
|
||||
test('inlines plum brand kit and keeps staff session note (no customer token key)', () => {
|
||||
const html = loadReviewHtml({ title: 'CS', kicker: 'cs', lede: 'Review.' });
|
||||
assert.match(html, /--plum:\s*#531B59/i);
|
||||
assert.match(html, /app-shell/);
|
||||
assert.match(html, /VeraeStaffRoleSwitcher|role-switch/);
|
||||
assert.match(html, /staff_session|Staff session|never stores customer/i);
|
||||
assert.doesNotMatch(html, /verae\.customer\.token/);
|
||||
assert.doesNotMatch(html, /localStorage\.setItem\([^)]*xVerae/);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue