Skip to content

Latest commit

 

History

History
551 lines (437 loc) · 19.9 KB

DESIGN.md

File metadata and controls

551 lines (437 loc) · 19.9 KB

Expense Pro — Design Specification

Reference: kitani.ai — visual and design-philosophy reference only. Scope studied: public homepage, model catalog, documentation shell, desktop/tablet/mobile layouts, component states, CSS tokens, and responsive breakpoints. Not studied: authenticated console screens, billing flows, or private account pages.


1. Design philosophy and guiding principles

What Kitani actually does

Kitani reads as quiet technical infrastructure, not a marketing landing page.

Observed facts:

  • The page is built on a near-black canvas (#08090a–#000) with a small set of slightly raised dark surfaces (#101114, #181a1e, #191919).
  • Most of the interface is achromatic. Colour appears in small, meaningful places: model logos, a violet chart line, a warm image, semantic badges.
  • Typography carries most of the personality: very large, tightly tracked headings at weight ~510, paired with small muted body copy and mono data.
  • Sections are separated by thin light hairline rules and very generous vertical space, not by cards or decorative backgrounds.
  • Product UI screenshots and real data tables are treated as the hero art.
  • Buttons are almost all pills; most other surfaces use 6–12px radii. Shadows are rare and subtle.
  • Motion is restrained: short colour/background transitions, plus one slow editorial reveal for the hero. Reduced-motion support is explicit.

Interpretation

The design principle is:

Make the product feel inevitable. Remove decoration, let scale and spacing create hierarchy, let real product data provide the visual interest, and use one accent colour only where it explains something.

Guiding principles for Expense Pro

  1. Dark, calm canvas. The app should feel like a precise financial instrument, not a colourful dashboard template.
  2. One idea per section. Each area gets a clear heading, a short explanation, and one primary job.
  3. Typography does the heavy lifting. Use scale, weight, and tracking — not borders, gradients, or shadows — to create hierarchy.
  4. Hairlines, not boxes. Prefer 1px rules and open space over nested cards.
  5. Colour is semantic. Violet for data emphasis, sage for positive, amber for caution, coral for negative. Never use colour as decoration.
  6. Money is data. Amounts, totals, dates, and percentages use a mono font with tabular numerals.
  7. Product evidence over stock imagery. The dashboard itself is the visual centrepiece.
  8. Quiet motion. 120–200ms for interaction feedback; one short entrance reveal; no bounce.

What to deliberately avoid

  • Glassmorphism, frosted cards, and heavy backdrop blurs.
  • Large blue/indigo gradients and bright SaaS-blue primary buttons.
  • Emoji as product iconography.
  • Drop shadows on every card.
  • Rounded-everything layouts.
  • Decorative blobs, waves, or generic stock photography.
  • Multiple competing accent colours.
  • Centered marketing heroes with three equal feature cards.
  • Long, bouncy animations.

2. Colour tokens

These are adapted from Kitani’s observed palette, not copied from its brand assets.

:root {
  /* Canvas and surfaces */
  --canvas: #08090a;
  --surface: #101114;
  --surface-raised: #181a1e;
  --surface-soft: #131519;
  --surface-inset: #0c0d0f;

  /* Lines and borders */
  --line: #25282d;
  --line-strong: #3b3f46;
  --line-soft: rgba(255, 255, 255, 0.06);

  /* Text */
  --text: #f7f8f8;
  --text-secondary: #8a8f98;
  --text-tertiary: #7d828b;
  --text-inverse: #08090a;

  /* Primary action */
  --primary: #e6e6e6;
  --primary-hover: #ffffff;
  --primary-foreground: #08090a;

  /* Data accent */
  --accent: #a47cff;
  --accent-strong: #7960c5;
  --accent-soft: #221e33;

  /* Semantic states */
  --positive: #8bc69a;
  --positive-soft: #1d2c21;
  --warning: #d6b36a;
  --warning-soft: #2b2417;
  --negative: #f17b5c;
  --negative-soft: #2d1b16;
  --info: #6fa8dc;
  --info-soft: #17222d;

  /* Focus */
  --focus: #b9c0cd;
  --focus-offset: 3px;

  /* Chart palette */
  --chart-1: #a47cff;
  --chart-2: #f17b5c;
  --chart-3: #8bc69a;
  --chart-4: #6fa8dc;
  --chart-5: #d6b36a;
  --chart-6: #c9a7eb;
}

Semantic roles

Role Token Use
Page background --canvas Full-page canvas
Panel --surface Cards, tables, form panels
Raised panel --surface-raised Hover rows, active panels
Input --surface-soft Inputs, selects, search
Hairline --line Panel borders, section rules
Primary text --text Headings, key numbers
Secondary text --text-secondary Body copy, labels
Tertiary text --text-tertiary Annotations, metadata
Primary action --primary Main CTA only
Data accent --accent Chart highlight, selected data
Positive --positive Remaining balance, under budget
Warning --warning Near budget, attention
Negative --negative Over budget, destructive emphasis

Colour distribution rule: ~90% neutral, ~7% semantic, ~3% accent. If a screen feels colourful, remove colour before removing content.


3. Typography system

Families

:root {
  --font-display: "Space Grotesk", "Inter", "Noto Sans", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans", system-ui, sans-serif;
  --font-mono: "Noto Sans Mono", "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

Space Grotesk is already installed on this machine. It gives the headings a tighter, more characterful grotesk feel than a default system font. Inter is used when available; Noto Sans is the reliable fallback. No new font dependency is required.

Scale

Role Desktop Tablet Mobile Weight Tracking Line height
Hero display 64px 56px 38px 500 -0.04em 1.04
Page title 48px 44px 34px 500 -0.035em 1.08
Section title 40px 36px 30px 500 -0.03em 1.1
Panel title 22px 21px 20px 500 -0.025em 1.25
Card title 17px 16px 16px 500 -0.015em 1.35
Body 16px 16px 15px 400 -0.005em 1.55
Secondary body 14px 14px 13px 400 0 1.6
Annotation / eyebrow 12px 12px 11px 500 0.08em 1.4
Mono data 14px 14px 13px 400 0 1.5

Rules

  • Headings use --font-display, weight 500–600, never 700+.
  • Body copy uses --font-body, weight 400.
  • Amounts, totals, dates, percentages, IDs, and tabular columns use --font-mono with font-variant-numeric: tabular-nums.
  • Eyebrows are uppercase, 11–12px, letter-spaced, muted. Use sparingly for section numbering and form grouping.
  • Do not use Space Grotesk for long paragraphs.
  • Avoid more than three type sizes in one panel.

Example

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.125rem, 4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

4. Spacing and layout system

Spacing scale

Use a 4px base:

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-28: 112px;
}

Layout

  • Max content width: 1280px.
  • Desktop gutter: 40px; tablet: 28px; mobile: 20px.
  • Section vertical padding: 96–112px desktop, 72px tablet, 56–64px mobile.
  • Section separation: 1px --line-soft rule, not a background change.
  • Editorial intro: grid-template-columns: 1fr 1fr; gap: 64–80px; collapse to one column below 760px.
  • Dashboard grid: grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; stack below 1024px.
  • Metric strip: 3 columns desktop, 2 columns tablet, 1 column mobile.
  • Card padding: 24px desktop, 20px tablet, 18px mobile.
  • Header height: 72px desktop/tablet, 64px mobile.
  • Avoid nested cards more than one level deep.

Example

.shell {
  width: min(1280px, calc(100% - 80px));
  margin-inline: auto;
}

@media (max-width: 760px) {
  .shell {
    width: calc(100% - 40px);
  }
}

.section {
  padding-block: 96px;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 760px) {
  .section {
    padding-block: 64px;
  }
}

5. Component specifications

Header

  • Sticky, 72px high, full width.
  • Background: linear-gradient(rgba(8,9,10,0.82), rgba(8,9,10,0.68)) with backdrop-filter: blur(20px).
  • Bottom border: 1px --line-soft.
  • Brand: simple wordmark “Expense Pro” plus a small geometric ledger mark. No emoji.
  • Navigation: 13px, --text-secondary; hover/active --text.
  • Actions: ghost “Log out” and one light pill CTA when relevant.
  • Mobile: hide nav links below 760px; show a 40×40 menu button; menu opens as a full-width panel with divided rows.

Buttons

Variant Background Text Border Radius Height
Primary --primary --primary-foreground transparent 999px 44px
Secondary --surface-raised --text 1px --line-strong 999px 44px
Ghost transparent --text-secondary none 999px 40px
Destructive --negative-soft --negative 1px rgba(241,123,92,0.3) 999px 40px
  • Hover: primary → --primary-hover; secondary → --surface-soft + --line-strong; ghost → --text.
  • Transition: color 0.18s, background-color 0.18s, border-color 0.18s.
  • Focus-visible: 2px --focus outline, offset 3px.
  • No box shadows on buttons.

Inputs and selects

  • Height: 44px.
  • Background: --surface-soft.
  • Border: 1px --line-strong.
  • Radius: 8px.
  • Text: --text; placeholder: --text-tertiary.
  • Label: 12px, --text-secondary, margin-bottom 8px.
  • Focus: border --text-secondary; outline 2px --focus with offset 2px.
  • Error: border --negative; message 12px --negative; aria-describedby linkage.
  • Never use placeholder text as the only label.

Panels and cards

  • Background: --surface.
  • Border: 1px --line.
  • Radius: 12px.
  • Padding: 24px.
  • No drop shadow. Optional inset top highlight: box-shadow: inset 0 1px rgba(255,255,255,0.03).
  • Hover only for interactive panels: border --line-strong, background --surface-raised.
  • Do not nest more than one panel inside another.

Data lists and tables

  • Row height: 64–72px.
  • Bottom border: 1px --line.
  • Hover: --surface-raised.
  • Primary cell: 14–15px --text.
  • Metadata: 12px --text-tertiary.
  • Amounts: mono, tabular, right-aligned.
  • Destructive action: text button in --negative, revealed or always visible on mobile.
  • On mobile, convert table rows to stacked cards rather than horizontal scrolling.

Tabs and filters

  • Text-only, 12–13px.
  • Inactive: --text-tertiary; hover: --text-secondary.
  • Active: --text with a 1px bottom rule in --primary.
  • No pill backgrounds, no bright fills.
  • Horizontal scroll on mobile with hidden scrollbar and a soft edge fade if needed.

Badges and status chips

  • Height: 22–24px.
  • Radius: 5px.
  • Font: 10–11px, 500, letter-spacing 0.02em.
  • Positive: --positive-soft background, --positive text.
  • Warning: --warning-soft, --warning.
  • Negative: --negative-soft, --negative.
  • Neutral: --surface-raised, --text-secondary.
  • Do not use badges as the only way to communicate status; include text.

Chart

  • Donut or thin-line chart on --surface.
  • Chart colours from --chart-*.
  • No heavy gridlines; if needed, 1px --line at 40% opacity.
  • Legend: 12px, dot + label + mono value.
  • Center label: total in mono, 24–28px.
  • Chart.js animation: 400ms ease-out; disable with prefers-reduced-motion.
  • Provide a visually hidden data table for screen readers.

Forms and feedback

  • Use a single column inside panels.
  • Group label, input, helper/error with 6–8px gaps.
  • Primary submit button full width on mobile.
  • Async state: disable button, show “Saving…” text; do not rely on colour alone.
  • Errors: inline, specific, linked to the field; retain entered values.
  • Success: short inline confirmation, not an alert dialog unless destructive.

Password fields

  • Show/Hide is a text control inside the field, 11px, muted, with an accessible aria-label and aria-pressed; no eye icon or coloured strength meter.
  • The signup requirements checklist is a quiet 11px list with 6px gaps. Unmet items use --text-tertiary and a dot; met items use --text-secondary and a small --positive check mark.
  • Confirm-password mismatch uses the standard --negative inline error style.
  • Never render a password value in an error message or checklist.

6. Borders, shadows, and radii

:root {
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
}
  • Default border: 1px solid --line.
  • Strong border: 1px solid --line-strong.
  • Section rule: 1px solid --line-soft.
  • Shadows: almost none. Use only:
    • box-shadow: inset 0 1px rgba(255,255,255,0.03) for panel edge light.
    • box-shadow: 0 12px 32px rgba(0,0,0,0.35) for the mobile menu or a floating menu.
  • Radii: 6px controls, 8px inputs, 12px panels, 999px buttons.
  • Never use radius larger than 16px on cards.
  • Never stack multiple shadows.

7. Animation and interaction rules

  • Interaction feedback: 120–200ms, ease-out.
  • Panel entrance: 400–600ms, cubic-bezier(0.22, 1, 0.36, 1), translateY 8px + opacity.
  • Stagger lists by 30–50ms; never more than 6 items.
  • Hover: colour and background only; no scale transforms on buttons.
  • Pressed: opacity 0.85 or background shift; no bounce.
  • Chart: 400ms; reduced motion disables.
  • Respect prefers-reduced-motion: reduce by removing transforms and animations.
  • Focus-visible is mandatory on every interactive element.
  • Do not animate layout properties (width, height, top) for interaction feedback.
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

8. Responsive design rules

Breakpoint Behaviour
≥1200px Full 1280px shell, 3-column metrics, 2-column dashboard, 4-column category grid if used
1024–1199px Shell gutters 32px, dashboard still 2 columns but tighter
760–1023px Dashboard stacks to one column; metrics 2 columns; header nav remains
<760px Header nav collapses to menu; shell gutters 20px; all grids one column; type scales down; table rows become cards
<420px Compact padding 16px; hero 34–36px; hide non-essential metadata; stack button groups

Specific rules:

  • Hero display: 64px desktop → 56px tablet → 38px mobile.
  • Section title: 40px → 36px → 30px.
  • Page title: 48px → 44px → 34px.
  • Panels: 24px padding → 20px → 18px.
  • Never allow horizontal page scroll. Use overflow-x: clip on the app shell.
  • Touch targets: minimum 44×44px.
  • Mobile menu: full-width panel below header, rows 48px high, 1px dividers.
  • Charts: minimum height 220px; legend stacks below on mobile.

9. Accessibility requirements

  • Contrast: body text and secondary text must meet WCAG AA (4.5:1) on --canvas and --surface. Primary text is ~18:1; secondary is ~6.1:1; tertiary is ~5:1. Do not go lighter than --text-tertiary for meaningful text.
  • Focus: every interactive element gets a visible 2px --focus ring with 3px offset.
  • Semantics: use header, nav, main, section, footer; use real button, a, input, select, label.
  • Forms: every input has a visible label, not just a placeholder. Errors use aria-describedby and aria-invalid.
  • Live regions: async save/delete status uses aria-live="polite"; errors use role="alert" only for actionable failures.
  • Keyboard: menu, tabs, and dialogs must be fully keyboard operable; Escape closes the mobile menu.
  • Charts: provide a visually hidden table or summary of category totals. Do not rely on colour alone.
  • Motion: respect prefers-reduced-motion.
  • Touch: 44×44px minimum targets.
  • Icons: decorative icons use aria-hidden="true"; meaningful icons have accessible names.
  • No emoji as UI icons.

10. Do's and don'ts

Do

  • Use the near-black canvas and hairline rules.
  • Let one large heading own each section.
  • Use Space Grotesk for display, Inter/Noto Sans for body, mono for money.
  • Use one light pill for the primary action per view.
  • Use violet only for data emphasis; sage/amber/coral only for semantic states.
  • Use real product data as the visual centrepiece.
  • Keep panels flat, bordered, and generously spaced.
  • Use 12px panel radius and 8px input radius.
  • Use 120–200ms interaction transitions.
  • Provide focus rings, labels, and reduced-motion support.

Don't

  • Don't use glassmorphism, backdrop-blur cards, or frosted panels.
  • Don't use large gradients or bright SaaS-blue buttons.
  • Don't use emoji in the UI.
  • Don't use stock photography or decorative blobs.
  • Don't put shadows on every card.
  • Don't use more than one accent colour per screen.
  • Don't use 20px+ radii on cards.
  • Don't center every section; use asymmetric editorial layouts.
  • Don't hide labels behind placeholders.
  • Don't animate layout properties or use bouncy easing.

Translation to Expense Pro

Login (/)

  • Full-height dark canvas.
  • Left column: large “Own your money.” display, short supporting line, small trust/annotation row.
  • Right column: flat --surface auth panel with 1px border and 12px radius.
  • Tabs: “Sign in” / “Create account” as text tabs with bottom rule.
  • Inputs: labeled, 44px, dark inset surface.
  • Primary CTA: light pill, full width.
  • Mobile: single column, form first, display copy above with reduced size.
  • Preserve existing isSignup toggle, handleSubmit, BASE_URL, localStorage token, and navigation.

Dashboard (/dashboard)

  • Sticky 72px header with wordmark, “Dashboard” context, and ghost “Log out”.
  • Page intro: “Your money, clearly.” + short status line.
  • Metric strip: Total spent, Monthly income, Remaining — mono numbers, semantic colour only on the remaining value.
  • Main grid:
    • Left: Spending overview panel with donut chart and legend; Recent expenses list below.
    • Right: Add expense panel; Monthly income panel; Categories panel.
  • All existing actions and endpoints remain unchanged:
    • GET/POST/DELETE /api/expenses
    • GET/PUT /api/user/income
    • localStorage categories and token
  • Replace window.confirm for delete with an inline confirmation state or keep it initially to preserve behaviour; visual restyling does not change data flow.
  • Mobile: header menu, metrics stack, chart first, forms below, rows become cards.

Brand

  • Keep “Expense Pro”.
  • Replace the 💰 emoji with a small geometric ledger mark: three stacked horizontal bars with one offset, rendered as inline SVG.
  • Do not use Kitani’s logo, wordmark, copy, model names, or imagery.

Implementation notes

  • Prefer CSS classes and tokens over the current inline style objects.
  • Keep the existing React components and routes; refactor presentation only.
  • Keep PieChart and Chart.js, but restyle colours, legend, and container.
  • Do not add new runtime dependencies without approval.
  • Verify with Playwright screenshots at 1440×900, 834×1112, and 390×844.
  • Compare against the reference principles, not pixel-for-pixel.

Capture set

Reference screenshots: docs/design/reference/ Implementation screenshots: docs/design/implementation/

Captured viewports: desktop 1440×900, tablet 834×1112, mobile 390×844. Additional application checks: 1200, 1024, 760, and 360 widths with no horizontal overflow.