2026-04-25 20:43:37 +12:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { invalidateAll } from '$app/navigation';
|
|
|
|
|
import { api } from '$lib/api';
|
2026-04-25 22:51:36 +12:00
|
|
|
import { clientSession } from '$lib/session';
|
|
|
|
|
import type { Mix, Product, ProductCostBreakdown, RawMaterial } from '$lib/types';
|
2026-04-25 20:43:37 +12:00
|
|
|
|
|
|
|
|
let { data } = $props();
|
|
|
|
|
|
|
|
|
|
let isCreating = $state(false);
|
|
|
|
|
let pendingMaterialId = $state<number | null>(null);
|
|
|
|
|
let successMessage = $state('');
|
|
|
|
|
let errorMessage = $state('');
|
|
|
|
|
|
|
|
|
|
const today = new Date().toISOString().slice(0, 10);
|
|
|
|
|
|
|
|
|
|
function currency(value: number | null | undefined, digits = 2) {
|
|
|
|
|
if (value === null || value === undefined) {
|
|
|
|
|
return 'N/A';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return `$${value.toFixed(digits)}`;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
function formatDate(value: string | null | undefined) {
|
|
|
|
|
if (!value) {
|
|
|
|
|
return 'No date';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new Intl.DateTimeFormat('en-NZ', {
|
|
|
|
|
day: 'numeric',
|
|
|
|
|
month: 'short',
|
|
|
|
|
year: 'numeric'
|
|
|
|
|
}).format(new Date(value));
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 20:43:37 +12:00
|
|
|
function getImpactedMixes(materialId: number): Mix[] {
|
|
|
|
|
return data.mixes.filter((mix: Mix) => mix.ingredients.some((ingredient) => ingredient.raw_material_id === materialId));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getImpactedProducts(materialId: number): Array<Product & { deliveredCost: ProductCostBreakdown | undefined }> {
|
|
|
|
|
const mixIds = new Set(getImpactedMixes(materialId).map((mix) => mix.id));
|
|
|
|
|
|
|
|
|
|
return data.products
|
|
|
|
|
.filter((product: Product) => mixIds.has(product.mix_id ?? -1))
|
|
|
|
|
.map((product: Product) => ({
|
|
|
|
|
...product,
|
|
|
|
|
deliveredCost: data.productCosts.find((row: ProductCostBreakdown) => row.product_id === product.id)
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleCreateMaterial(event: SubmitEvent) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
successMessage = '';
|
|
|
|
|
errorMessage = '';
|
|
|
|
|
isCreating = true;
|
|
|
|
|
|
|
|
|
|
const form = event.currentTarget as HTMLFormElement;
|
|
|
|
|
const formData = new FormData(form);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
await api.createRawMaterial({
|
|
|
|
|
name: String(formData.get('name') ?? '').trim(),
|
|
|
|
|
supplier: String(formData.get('supplier') ?? '').trim() || null,
|
|
|
|
|
unit_of_measure: String(formData.get('unit_of_measure') ?? '').trim(),
|
|
|
|
|
kg_per_unit: Number(formData.get('kg_per_unit')),
|
|
|
|
|
status: String(formData.get('status') ?? 'active'),
|
|
|
|
|
notes: String(formData.get('notes') ?? '').trim() || null,
|
|
|
|
|
initial_price: {
|
|
|
|
|
market_value: Number(formData.get('market_value')),
|
|
|
|
|
waste_percentage: Number(formData.get('waste_percentage')),
|
|
|
|
|
effective_date: String(formData.get('effective_date') ?? today),
|
|
|
|
|
status: 'active',
|
|
|
|
|
notes: String(formData.get('price_notes') ?? '').trim() || null
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
form.reset();
|
|
|
|
|
const effectiveDate = form.elements.namedItem('effective_date');
|
|
|
|
|
if (effectiveDate instanceof HTMLInputElement) {
|
|
|
|
|
effectiveDate.value = today;
|
|
|
|
|
}
|
|
|
|
|
successMessage = 'Raw material created and added to the costing model.';
|
|
|
|
|
await invalidateAll();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
errorMessage = error instanceof Error ? error.message : 'Unable to create raw material';
|
|
|
|
|
} finally {
|
|
|
|
|
isCreating = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleAddPrice(event: SubmitEvent, rawMaterialId: number) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
successMessage = '';
|
|
|
|
|
errorMessage = '';
|
|
|
|
|
pendingMaterialId = rawMaterialId;
|
|
|
|
|
|
|
|
|
|
const form = event.currentTarget as HTMLFormElement;
|
|
|
|
|
const formData = new FormData(form);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
await api.addRawMaterialPrice(rawMaterialId, {
|
|
|
|
|
market_value: Number(formData.get('market_value')),
|
|
|
|
|
waste_percentage: Number(formData.get('waste_percentage')),
|
|
|
|
|
effective_date: String(formData.get('effective_date') ?? today),
|
|
|
|
|
status: 'active',
|
|
|
|
|
notes: String(formData.get('notes') ?? '').trim() || null
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
form.reset();
|
|
|
|
|
const effectiveDate = form.elements.namedItem('effective_date');
|
|
|
|
|
if (effectiveDate instanceof HTMLInputElement) {
|
|
|
|
|
effectiveDate.value = today;
|
|
|
|
|
}
|
|
|
|
|
successMessage = 'Price version saved. Mix and product costs have been refreshed.';
|
|
|
|
|
await invalidateAll();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
errorMessage = error instanceof Error ? error.message : 'Unable to add price version';
|
|
|
|
|
} finally {
|
|
|
|
|
pendingMaterialId = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-25 22:51:36 +12:00
|
|
|
|
|
|
|
|
const totalSpend = $derived(
|
|
|
|
|
data.rawMaterials.reduce(
|
|
|
|
|
(sum: number, material: RawMaterial) => sum + (material.current_price?.market_value ?? 0),
|
|
|
|
|
0
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
const averageWaste = $derived(
|
|
|
|
|
data.rawMaterials.length
|
|
|
|
|
? data.rawMaterials.reduce(
|
|
|
|
|
(sum: number, material: RawMaterial) => sum + (material.current_price?.waste_percentage ?? 0),
|
|
|
|
|
0
|
|
|
|
|
) / data.rawMaterials.length
|
|
|
|
|
: 0
|
|
|
|
|
);
|
|
|
|
|
const latestEffectiveDate = $derived(
|
|
|
|
|
[...data.rawMaterials]
|
|
|
|
|
.map((material: RawMaterial) => material.current_price?.effective_date)
|
|
|
|
|
.filter(Boolean)
|
|
|
|
|
.sort()
|
|
|
|
|
.at(-1) ?? null
|
|
|
|
|
);
|
|
|
|
|
const activeMaterials = $derived(data.rawMaterials.filter((material: RawMaterial) => material.status === 'active'));
|
2026-04-25 20:43:37 +12:00
|
|
|
</script>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
{#if !$clientSession}
|
|
|
|
|
<section class="locked-card">
|
|
|
|
|
<p class="eyebrow">Client Access Required</p>
|
|
|
|
|
<h2>Sign in on the Hunter Premium Produce home page before viewing raw material pricing.</h2>
|
|
|
|
|
<p>This workflow updates source inputs and pushes new values through mix and product calculations.</p>
|
|
|
|
|
<a href="/">Return to sign-in</a>
|
2026-04-25 20:43:37 +12:00
|
|
|
</section>
|
|
|
|
|
{:else}
|
|
|
|
|
{#if successMessage}
|
|
|
|
|
<p class="feedback success">{successMessage}</p>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{#if errorMessage}
|
|
|
|
|
<p class="feedback error">{errorMessage}</p>
|
|
|
|
|
{/if}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<section class="metric-row">
|
|
|
|
|
<article class="metric-card">
|
|
|
|
|
<span>Total Spend Tracked</span>
|
|
|
|
|
<strong>{currency(totalSpend)}</strong>
|
|
|
|
|
<p>Across current market values</p>
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
|
|
<article class="metric-card">
|
|
|
|
|
<span>Average Waste</span>
|
|
|
|
|
<strong>{(averageWaste * 100).toFixed(1)}%</strong>
|
|
|
|
|
<p>Current blended input loss</p>
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
|
|
<article class="metric-card">
|
|
|
|
|
<span>Latest Price Update</span>
|
|
|
|
|
<strong>{formatDate(latestEffectiveDate)}</strong>
|
|
|
|
|
<p>Most recent effective date on file</p>
|
|
|
|
|
</article>
|
|
|
|
|
</section>
|
|
|
|
|
|
2026-04-25 20:43:37 +12:00
|
|
|
<section class="top-grid">
|
2026-04-25 22:51:36 +12:00
|
|
|
<article class="surface-card form-card">
|
|
|
|
|
<div class="section-heading">
|
2026-04-25 20:43:37 +12:00
|
|
|
<div>
|
2026-04-25 22:51:36 +12:00
|
|
|
<p class="eyebrow">Create Input</p>
|
|
|
|
|
<h3>Add a new raw material</h3>
|
2026-04-25 20:43:37 +12:00
|
|
|
</div>
|
2026-04-25 22:51:36 +12:00
|
|
|
<span class="soft-pill">Live costing source</span>
|
2026-04-25 20:43:37 +12:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form class="material-form" onsubmit={handleCreateMaterial}>
|
|
|
|
|
<div class="form-grid">
|
|
|
|
|
<label>
|
|
|
|
|
Name
|
|
|
|
|
<input name="name" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Supplier
|
|
|
|
|
<input name="supplier" />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Unit of measure
|
|
|
|
|
<input name="unit_of_measure" value="tonne" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Kg per unit
|
|
|
|
|
<input name="kg_per_unit" type="number" min="0.0001" step="0.0001" value="1000" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Market value
|
|
|
|
|
<input name="market_value" type="number" min="0.0001" step="0.0001" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Waste percentage
|
|
|
|
|
<input name="waste_percentage" type="number" min="0" max="1" step="0.0001" value="0" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Effective date
|
|
|
|
|
<input name="effective_date" type="date" value={today} required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Status
|
|
|
|
|
<select name="status">
|
|
|
|
|
<option value="active">Active</option>
|
|
|
|
|
<option value="draft">Draft</option>
|
|
|
|
|
<option value="inactive">Inactive</option>
|
|
|
|
|
</select>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<div class="form-grid single">
|
|
|
|
|
<label>
|
|
|
|
|
Material notes
|
|
|
|
|
<textarea name="notes" rows="3"></textarea>
|
|
|
|
|
</label>
|
2026-04-25 20:43:37 +12:00
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<label>
|
|
|
|
|
Price notes
|
|
|
|
|
<textarea name="price_notes" rows="3"></textarea>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
2026-04-25 20:43:37 +12:00
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<button class="primary-button" type="submit" disabled={isCreating}>
|
2026-04-25 20:43:37 +12:00
|
|
|
{isCreating ? 'Creating material...' : 'Create raw material'}
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</article>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<div class="summary-stack">
|
|
|
|
|
<article class="surface-card">
|
|
|
|
|
<div class="section-heading">
|
|
|
|
|
<div>
|
|
|
|
|
<p class="eyebrow">Downstream Snapshot</p>
|
|
|
|
|
<h3>Mixes affected by current inputs</h3>
|
|
|
|
|
</div>
|
2026-04-25 20:43:37 +12:00
|
|
|
</div>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<div class="mini-list">
|
|
|
|
|
{#each data.mixes as mix}
|
|
|
|
|
<article>
|
|
|
|
|
<div>
|
2026-04-25 20:43:37 +12:00
|
|
|
<strong>{mix.name}</strong>
|
2026-04-25 22:51:36 +12:00
|
|
|
<span>{mix.client_name}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<strong>{currency(mix.mix_cost_per_kg, 4)} / kg</strong>
|
|
|
|
|
</article>
|
|
|
|
|
{/each}
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
|
|
|
|
|
<article class="surface-card">
|
|
|
|
|
<div class="section-heading">
|
|
|
|
|
<div>
|
|
|
|
|
<p class="eyebrow">Product Exposure</p>
|
|
|
|
|
<h3>Finished outputs linked to live pricing</h3>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mini-list">
|
|
|
|
|
{#each data.productCosts as row}
|
|
|
|
|
<article>
|
|
|
|
|
<div>
|
2026-04-25 20:43:37 +12:00
|
|
|
<strong>{row.product_name}</strong>
|
2026-04-25 22:51:36 +12:00
|
|
|
<span>{row.warnings.length ? 'Check warnings' : 'Stable pricing'}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<strong>{currency(row.finished_product_delivered)}</strong>
|
|
|
|
|
</article>
|
|
|
|
|
{/each}
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
</div>
|
2026-04-25 20:43:37 +12:00
|
|
|
</section>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<section class="materials-list">
|
2026-04-25 20:43:37 +12:00
|
|
|
{#each data.rawMaterials as material}
|
|
|
|
|
{@const impactedMixes = getImpactedMixes(material.id)}
|
|
|
|
|
{@const impactedProducts = getImpactedProducts(material.id)}
|
|
|
|
|
|
|
|
|
|
<article class="surface-card material-card">
|
2026-04-25 22:51:36 +12:00
|
|
|
<div class="material-header">
|
|
|
|
|
<div class="material-title">
|
|
|
|
|
<span class={`material-icon ${material.status === 'active' ? 'active' : 'muted'}`}>RM</span>
|
|
|
|
|
<div>
|
|
|
|
|
<h3>{material.name}</h3>
|
|
|
|
|
<p>{material.supplier || 'Supplier not set'} · {material.unit_of_measure} · {material.kg_per_unit} kg per unit</p>
|
|
|
|
|
</div>
|
2026-04-25 20:43:37 +12:00
|
|
|
</div>
|
2026-04-25 22:51:36 +12:00
|
|
|
|
|
|
|
|
<span class={`status-pill ${material.status === 'active' ? 'positive' : 'neutral'}`}>{material.status}</span>
|
2026-04-25 20:43:37 +12:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="material-grid">
|
2026-04-25 22:51:36 +12:00
|
|
|
<section class="stats-grid">
|
|
|
|
|
<article>
|
|
|
|
|
<span>Market value</span>
|
2026-04-25 20:43:37 +12:00
|
|
|
<strong>{currency(material.current_price?.market_value)}</strong>
|
2026-04-25 22:51:36 +12:00
|
|
|
</article>
|
|
|
|
|
<article>
|
|
|
|
|
<span>Waste</span>
|
2026-04-25 20:43:37 +12:00
|
|
|
<strong>
|
|
|
|
|
{material.current_price ? `${(material.current_price.waste_percentage * 100).toFixed(1)}%` : 'N/A'}
|
|
|
|
|
</strong>
|
2026-04-25 22:51:36 +12:00
|
|
|
</article>
|
|
|
|
|
<article>
|
2026-04-25 20:43:37 +12:00
|
|
|
<span>Cost per kg</span>
|
|
|
|
|
<strong>{currency(material.current_price?.cost_per_kg, 4)}</strong>
|
2026-04-25 22:51:36 +12:00
|
|
|
</article>
|
|
|
|
|
<article>
|
2026-04-25 20:43:37 +12:00
|
|
|
<span>Effective date</span>
|
2026-04-25 22:51:36 +12:00
|
|
|
<strong>{formatDate(material.current_price?.effective_date)}</strong>
|
|
|
|
|
</article>
|
2026-04-25 20:43:37 +12:00
|
|
|
</section>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<form class="price-card" onsubmit={(event) => handleAddPrice(event, material.id)}>
|
|
|
|
|
<div class="section-heading">
|
|
|
|
|
<div>
|
|
|
|
|
<p class="eyebrow">New Version</p>
|
|
|
|
|
<h4>Record a fresh price</h4>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-25 20:43:37 +12:00
|
|
|
|
|
|
|
|
<div class="form-grid compact">
|
|
|
|
|
<label>
|
|
|
|
|
Market value
|
|
|
|
|
<input name="market_value" type="number" min="0.0001" step="0.0001" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Waste percentage
|
|
|
|
|
<input name="waste_percentage" type="number" min="0" max="1" step="0.0001" value="0" required />
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Effective date
|
|
|
|
|
<input name="effective_date" type="date" value={today} required />
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<label>
|
|
|
|
|
Notes
|
|
|
|
|
<textarea name="notes" rows="2"></textarea>
|
|
|
|
|
</label>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<button class="primary-button" type="submit" disabled={pendingMaterialId === material.id}>
|
2026-04-25 20:43:37 +12:00
|
|
|
{pendingMaterialId === material.id ? 'Saving price...' : 'Save price version'}
|
|
|
|
|
</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="impact-grid">
|
2026-04-25 22:51:36 +12:00
|
|
|
<section class="impact-card">
|
|
|
|
|
<div class="impact-heading">
|
|
|
|
|
<h4>Impacted mixes</h4>
|
|
|
|
|
<span>{impactedMixes.length}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-04-25 20:43:37 +12:00
|
|
|
{#if impactedMixes.length}
|
2026-04-25 22:51:36 +12:00
|
|
|
<div class="impact-list">
|
2026-04-25 20:43:37 +12:00
|
|
|
{#each impactedMixes as mix}
|
2026-04-25 22:51:36 +12:00
|
|
|
<article>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>{mix.name}</strong>
|
|
|
|
|
<span>{mix.client_name}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<strong>{currency(mix.mix_cost_per_kg, 4)} / kg</strong>
|
|
|
|
|
</article>
|
2026-04-25 20:43:37 +12:00
|
|
|
{/each}
|
2026-04-25 22:51:36 +12:00
|
|
|
</div>
|
2026-04-25 20:43:37 +12:00
|
|
|
{:else}
|
2026-04-25 22:51:36 +12:00
|
|
|
<p class="empty">No active mix currently references this material.</p>
|
2026-04-25 20:43:37 +12:00
|
|
|
{/if}
|
|
|
|
|
</section>
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
<section class="impact-card">
|
|
|
|
|
<div class="impact-heading">
|
|
|
|
|
<h4>Impacted products</h4>
|
|
|
|
|
<span>{impactedProducts.length}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-04-25 20:43:37 +12:00
|
|
|
{#if impactedProducts.length}
|
2026-04-25 22:51:36 +12:00
|
|
|
<div class="impact-list">
|
2026-04-25 20:43:37 +12:00
|
|
|
{#each impactedProducts as product}
|
2026-04-25 22:51:36 +12:00
|
|
|
<article>
|
|
|
|
|
<div>
|
|
|
|
|
<strong>{product.name}</strong>
|
|
|
|
|
<span>{product.mix_name}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<strong>{currency(product.deliveredCost?.finished_product_delivered)}</strong>
|
|
|
|
|
</article>
|
2026-04-25 20:43:37 +12:00
|
|
|
{/each}
|
2026-04-25 22:51:36 +12:00
|
|
|
</div>
|
2026-04-25 20:43:37 +12:00
|
|
|
{:else}
|
2026-04-25 22:51:36 +12:00
|
|
|
<p class="empty">No finished product currently depends on this material.</p>
|
2026-04-25 20:43:37 +12:00
|
|
|
{/if}
|
|
|
|
|
</section>
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
|
|
|
|
{/each}
|
|
|
|
|
</section>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
h2,
|
|
|
|
|
h3,
|
2026-04-25 22:51:36 +12:00
|
|
|
h4,
|
2026-04-25 20:43:37 +12:00
|
|
|
p {
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.eyebrow {
|
2026-04-25 22:51:36 +12:00
|
|
|
color: #7f8e85;
|
2026-04-25 20:43:37 +12:00
|
|
|
font-size: 0.78rem;
|
2026-04-25 22:51:36 +12:00
|
|
|
font-weight: 600;
|
|
|
|
|
letter-spacing: 0.08em;
|
2026-04-25 20:43:37 +12:00
|
|
|
text-transform: uppercase;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.locked-card,
|
|
|
|
|
.page-intro,
|
|
|
|
|
.feedback,
|
|
|
|
|
.metric-card,
|
|
|
|
|
.surface-card {
|
|
|
|
|
background: var(--panel);
|
2026-04-25 20:43:37 +12:00
|
|
|
border: 1px solid var(--line);
|
2026-04-25 22:51:36 +12:00
|
|
|
border-radius: 1.35rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
box-shadow: var(--shadow);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.locked-card,
|
|
|
|
|
.page-intro,
|
|
|
|
|
.feedback,
|
|
|
|
|
.metric-row,
|
|
|
|
|
.top-grid,
|
|
|
|
|
.materials-list {
|
|
|
|
|
margin-bottom: 1.25rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.locked-card,
|
|
|
|
|
.page-intro,
|
2026-04-25 20:43:37 +12:00
|
|
|
.surface-card {
|
2026-04-25 22:51:36 +12:00
|
|
|
padding: 1.2rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.locked-card {
|
2026-04-25 20:43:37 +12:00
|
|
|
display: grid;
|
2026-04-25 22:51:36 +12:00
|
|
|
gap: 0.7rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
max-width: 42rem;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.locked-card h2,
|
|
|
|
|
.page-intro h2 {
|
|
|
|
|
margin: 0.35rem 0 0.45rem;
|
|
|
|
|
font-size: clamp(1.7rem, 3vw, 2.25rem);
|
|
|
|
|
font-weight: 700;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.locked-card p:last-of-type,
|
|
|
|
|
.page-intro p:last-child,
|
|
|
|
|
.metric-card p,
|
|
|
|
|
.intro-chip span,
|
|
|
|
|
.mini-list span,
|
|
|
|
|
.material-title p,
|
|
|
|
|
.stats-grid span,
|
|
|
|
|
.impact-list span,
|
|
|
|
|
.empty {
|
2026-04-25 20:43:37 +12:00
|
|
|
color: var(--muted);
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.locked-card a {
|
|
|
|
|
color: var(--green-deep);
|
|
|
|
|
font-weight: 600;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.page-intro {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: end;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
gap: 1rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.intro-chip {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 0.25rem;
|
|
|
|
|
padding: 0.95rem 1rem;
|
|
|
|
|
border: 1px solid var(--line);
|
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
background: var(--panel-soft);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.intro-chip strong {
|
|
|
|
|
font-size: 1rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.feedback {
|
2026-04-25 22:51:36 +12:00
|
|
|
padding: 0.95rem 1rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.feedback.success {
|
2026-04-25 22:51:36 +12:00
|
|
|
color: var(--green-deep);
|
|
|
|
|
border-color: #d8ecdf;
|
|
|
|
|
background: #f6fcf8;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.feedback.error {
|
2026-04-25 22:51:36 +12:00
|
|
|
color: #a03737;
|
|
|
|
|
border-color: #f0d9d9;
|
|
|
|
|
background: #fff8f8;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.metric-row,
|
2026-04-25 20:43:37 +12:00
|
|
|
.top-grid,
|
|
|
|
|
.material-grid,
|
|
|
|
|
.impact-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.metric-row {
|
|
|
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric-card {
|
|
|
|
|
padding: 1.15rem 1.2rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric-card span {
|
|
|
|
|
display: block;
|
|
|
|
|
color: var(--muted);
|
|
|
|
|
font-size: 0.9rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.metric-card strong {
|
|
|
|
|
display: block;
|
|
|
|
|
margin: 0.55rem 0 0.3rem;
|
|
|
|
|
font-size: 1.9rem;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 20:43:37 +12:00
|
|
|
.top-grid {
|
2026-04-25 22:51:36 +12:00
|
|
|
grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.85fr);
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.summary-stack {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.section-heading,
|
|
|
|
|
.material-header,
|
|
|
|
|
.impact-heading,
|
|
|
|
|
.mini-list article,
|
|
|
|
|
.impact-list article {
|
2026-04-25 20:43:37 +12:00
|
|
|
display: flex;
|
2026-04-25 22:51:36 +12:00
|
|
|
align-items: flex-start;
|
2026-04-25 20:43:37 +12:00
|
|
|
justify-content: space-between;
|
2026-04-25 22:51:36 +12:00
|
|
|
gap: 0.75rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.section-heading {
|
2026-04-25 20:43:37 +12:00
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.section-heading h3,
|
|
|
|
|
.material-header h3,
|
|
|
|
|
.impact-heading h4 {
|
|
|
|
|
font-size: 1.12rem;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.soft-pill {
|
|
|
|
|
padding: 0.48rem 0.8rem;
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
color: var(--green-deep);
|
|
|
|
|
background: var(--green-soft);
|
|
|
|
|
font-size: 0.86rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 20:43:37 +12:00
|
|
|
.material-form,
|
2026-04-25 22:51:36 +12:00
|
|
|
.price-card {
|
2026-04-25 20:43:37 +12:00
|
|
|
display: grid;
|
|
|
|
|
gap: 1rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-grid {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
2026-04-25 22:51:36 +12:00
|
|
|
gap: 0.85rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-grid.single {
|
|
|
|
|
grid-template-columns: 1fr;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-grid.compact {
|
|
|
|
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
label {
|
|
|
|
|
display: grid;
|
|
|
|
|
gap: 0.35rem;
|
2026-04-25 22:51:36 +12:00
|
|
|
color: #53645b;
|
|
|
|
|
font-size: 0.9rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
input,
|
|
|
|
|
textarea,
|
|
|
|
|
select {
|
|
|
|
|
width: 100%;
|
2026-04-25 22:51:36 +12:00
|
|
|
padding: 0.9rem 0.95rem;
|
|
|
|
|
border: 1px solid var(--line-strong);
|
|
|
|
|
border-radius: 0.95rem;
|
|
|
|
|
background: var(--panel-soft);
|
|
|
|
|
color: var(--text);
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.primary-button {
|
|
|
|
|
justify-self: start;
|
|
|
|
|
padding: 0.85rem 1rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
border: none;
|
2026-04-25 22:51:36 +12:00
|
|
|
border-radius: 0.9rem;
|
|
|
|
|
color: #fff;
|
|
|
|
|
background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
|
|
|
|
|
box-shadow: 0 8px 20px rgba(34, 169, 94, 0.18);
|
|
|
|
|
font-weight: 600;
|
2026-04-25 20:43:37 +12:00
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.primary-button:disabled {
|
2026-04-25 20:43:37 +12:00
|
|
|
opacity: 0.7;
|
|
|
|
|
cursor: wait;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.mini-list,
|
|
|
|
|
.impact-list,
|
|
|
|
|
.materials-list {
|
2026-04-25 20:43:37 +12:00
|
|
|
display: grid;
|
2026-04-25 22:51:36 +12:00
|
|
|
gap: 0.8rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.mini-list article,
|
|
|
|
|
.impact-list article {
|
|
|
|
|
padding: 0.95rem 1rem;
|
|
|
|
|
border: 1px solid var(--line);
|
2026-04-25 20:43:37 +12:00
|
|
|
border-radius: 1rem;
|
2026-04-25 22:51:36 +12:00
|
|
|
background: var(--panel-soft);
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.material-card {
|
2026-04-25 20:43:37 +12:00
|
|
|
display: grid;
|
2026-04-25 22:51:36 +12:00
|
|
|
gap: 1.1rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.material-title {
|
2026-04-25 20:43:37 +12:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2026-04-25 22:51:36 +12:00
|
|
|
gap: 0.85rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.material-icon {
|
|
|
|
|
width: 2.4rem;
|
|
|
|
|
height: 2.4rem;
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
border-radius: 0.85rem;
|
|
|
|
|
font-size: 0.76rem;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
letter-spacing: 0.05em;
|
|
|
|
|
flex-shrink: 0;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.material-icon.active {
|
|
|
|
|
color: #fff;
|
|
|
|
|
background: linear-gradient(135deg, var(--green) 0%, var(--green-deep) 100%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.material-icon.muted {
|
|
|
|
|
color: #55685f;
|
|
|
|
|
background: #e9efeb;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.status-pill {
|
2026-04-25 22:51:36 +12:00
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
padding: 0.42rem 0.78rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
border-radius: 999px;
|
2026-04-25 22:51:36 +12:00
|
|
|
font-size: 0.84rem;
|
|
|
|
|
font-weight: 600;
|
2026-04-25 20:43:37 +12:00
|
|
|
text-transform: capitalize;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.status-pill.positive {
|
|
|
|
|
color: var(--green-deep);
|
|
|
|
|
background: var(--green-soft);
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.status-pill.neutral {
|
|
|
|
|
color: #5a6c63;
|
|
|
|
|
background: #edf2ef;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.material-grid {
|
|
|
|
|
grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.stats-grid {
|
2026-04-25 20:43:37 +12:00
|
|
|
display: grid;
|
2026-04-25 22:51:36 +12:00
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
|
|
gap: 0.8rem;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.stats-grid article,
|
|
|
|
|
.price-card,
|
|
|
|
|
.impact-card {
|
|
|
|
|
padding: 1rem;
|
|
|
|
|
border: 1px solid var(--line);
|
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
background: var(--panel-soft);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stats-grid strong {
|
|
|
|
|
display: block;
|
|
|
|
|
margin-top: 0.35rem;
|
|
|
|
|
font-size: 1.1rem;
|
|
|
|
|
font-weight: 700;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.impact-grid {
|
|
|
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
.impact-heading {
|
|
|
|
|
margin-bottom: 0.9rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.impact-heading span {
|
|
|
|
|
color: var(--muted);
|
|
|
|
|
font-size: 0.92rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 1180px) {
|
|
|
|
|
.metric-row,
|
2026-04-25 20:43:37 +12:00
|
|
|
.top-grid,
|
|
|
|
|
.material-grid,
|
2026-04-25 22:51:36 +12:00
|
|
|
.impact-grid,
|
|
|
|
|
.stats-grid {
|
2026-04-25 20:43:37 +12:00
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-25 22:51:36 +12:00
|
|
|
@media (max-width: 820px) {
|
|
|
|
|
.page-intro,
|
|
|
|
|
.section-heading,
|
|
|
|
|
.material-header,
|
|
|
|
|
.impact-heading,
|
|
|
|
|
.mini-list article,
|
|
|
|
|
.impact-list article {
|
2026-04-25 20:43:37 +12:00
|
|
|
flex-direction: column;
|
2026-04-25 22:51:36 +12:00
|
|
|
align-items: flex-start;
|
2026-04-25 20:43:37 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.form-grid,
|
|
|
|
|
.form-grid.compact {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|