# Budget top sheet

> The producer's top sheet on paper, and accounts whose lines can follow a rate from Cast & Crew or Locations.

Source: https://kwark.space/designSystem/components/budget-top-sheet

## Usage

### When to use
In Budget: the top sheet a producer or financier reads first, and the accounts under it (Decision 0022). A line may follow a rate source (a confirmed cast fee, a locked location's cost per day), read live and named in words, with *I type the rate* to unlink.

### When not to
- To show fees to roles without Cast & Crew permission. *My own rate* on a cast line never copies the actor's fee into the budget.
- To flag paperwork as out of date. The app never decides a legal date is stale; it shows the age in words.

### Anatomy in use
- **Top sheet**: paper, account rows with a thin bar under the largest share, a 2px rule above subtotals (*Above the line*), a double rule above the total.
- **Accounts**: a disclosure row with line count and total; lines with name, rate (linked rates in a dashed accent pill with a link glyph), quantity and total.
- **Hint**: under a followed line, whose fee or which location.

### Conventions
Amounts in the project currency with its own grouping (Indian grouping 59,45,000 for INR). Totals in tabular mono. Printed sheets carry the house logo and name, the film, sheet name and print date.

### Writing
Hints name the source in plain words: *Rate comes from Cast & Crew: Ira Sen's agreed day rate*, *No location locked for ROOFTOP yet*. Paperwork ages are words in grey: *Checked 12 days ago*.

**Do:** A linked rate pill reading *50,000* with *Rate comes from Cast & Crew: Ira Sen's agreed day rate*.

**Don't:** The producer retyping a fee that already lives in Cast & Crew, so the two drift apart.

## Style

### Anatomy

Top sheet 16px padding, 12px corners, 13px rows with 1px paper lines; subtotal 2px ink rule; total 3px double rule. Line grid `1.4fr 90px 110px 110px`.

### Tokens

| Token | Light | Dark |
|---|---|---|
| `--k-paper` | #fbfbf8 |  |
| `--k-paper-ink` | #1e2326 |  |
| `--k-paper-muted` | #4a5054 |  |
| `--k-paper-line` | #d5d9d4 |  |
| `--k-info` | #255799 | #7db4f0 |
| `--k-accent` | #98633f | #98633f |
| `--k-font-mono` | ui-monospace, 'SF Mono', Menlo, Consolas, monospace |  |

## Code

### React

In the Kwark app: `import BudgetPage from '@/pages/PreProduction/BudgetModule/BudgetPage'`.

```tsx
<BudgetPage />  // shared/budget.ts formatMoney(currency)
```

| Prop | Type | Notes |
|---|---|---|
| `currency` | `string` | project budget currency, e.g. INR |

### HTML and CSS

Works anywhere with `kwark.css`.

```html
<div class="kw-topsheet" aria-label="Top sheet">
  <h4>Top sheet · INR</h4>
  <div class="kw-topsheet__row"><span>Story and rights</span><strong>2,50,000</strong></div>
  <div class="kw-topsheet__row"><span>Cast</span><strong>15,90,000</strong><i style="width:58%"></i></div>
  <div class="kw-topsheet__row kw-topsheet__sub"><span>Above the line</span><strong>18,40,000</strong></div>
  <div class="kw-topsheet__row"><span>Production</span><strong>31,25,000</strong></div>
  <div class="kw-topsheet__row"><span>Post-production</span><strong>9,80,000</strong></div>
  <div class="kw-topsheet__row kw-topsheet__total"><span>Total</span><strong>59,45,000</strong></div>
</div>
<div style="width:100%">
  <button class="kw-account__head" type="button" aria-expanded="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="kw-caret"><path d="m6 9 6 6 6-6"/></svg><span>Cast</span><small>3 lines</small><strong>15,90,000</strong></button>
  <div class="kw-budget-line"><span>Ira Sen as Mira</span><span class="kw-linked"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7"/><path d="M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7"/></svg> 50,000</span><span class="kw-num">× 18 days</span><span class="kw-num">9,00,000</span></div>
  <p class="kw-budget-hint">Rate comes from Cast & Crew: Ira Sen's agreed day rate.</p>
  <div class="kw-budget-line"><span>Day players</span><span class="kw-num">12,000</span><span class="kw-num">× 20 days</span><span class="kw-num">2,40,000</span></div>
</div>
```

## Accessibility

- Linked rates say "linked" in their accessible name and the hint says from where.
- Numbers are right-aligned with tabular figures; the currency is in the heading.

## For agents

### Rules

- **Must** name the source of every linked rate in words.
- **Never** copy a fee into the budget for a role that cannot see fees.
- **Always** format money in the project currency's own grouping.
- **Never** mark a date out of date on the app's own judgement.

### AI readiness test

**Task:** Bring the confirmed cast into the budget.

**Give the agent:** Budget top sheet, Cast board, Decision 0022.

**Constraint:** Only confirmed cast and locked locations.

**A reliable answer:**
- "Bring in N cast and location lines"
- Lines follow live rates
- Hints name the source
- Fees not copied for other roles
