Build the interface.
The shell before the logic.
In this stage, you build the visual shell of the inventory app: a sidebar, a header, four KPI cards, and a product table. No JavaScript yet — just the layout, the typography, and the new inventory-specific patterns: numeric columns with tabular figures, stock-status badges with three states, and a distinct SKU column. The layout is the same CSS Grid shell as the CRM, adapted for product data.
Short answer: A single HTML file with inline CSS. CSS Grid shell (sidebar + header + main). Dark-theme colors as CSS custom properties. Four KPI cards using Grid. A product table with right-aligned numeric columns (font-variant-numeric: tabular-nums), a monospace SKU column in the accent color, and three stock-status badges (in-stock, low-stock, out-of-stock). Responsive at 900px, 768px, and 500px. All code on this page — copy it, read it, or download the file at the end.
✅ What you'll build
The visual shell — no logic yet.
Sidebar
240px fixed width. Brand, three nav groups (Overview, Activity). Active state on Dashboard.
Header
64px height. Page title, search box, "Add product" button, avatar. Flexbox for alignment.
KPI cards
Total inventory value, products tracked, low stock count, out of stock count. Each with value and delta.
Product table
Six rows. SKU, name, category, price, cost, quantity, status. Numeric columns right-aligned.
Don't skip this stage to get to JavaScript faster. Stage 02 is easier when the layout is done. The new inventory patterns — numeric alignment, stock states, SKU formatting — are layout decisions, not logic decisions. Get them right in the shell, then attach the data.
✅ What's new vs the CRM
Three inventory-specific patterns.
Numeric columns
Price, cost, and quantity are right-aligned. font-variant-numeric: tabular-nums forces digits to equal width. Columns line up like a spreadsheet.
Stock-status badges
Three states: in-stock (green), low-stock (amber), out-of-stock (red). Each is a pill with a colored dot. The color maps to a real business decision.
SKU column
Monospace font, accent color, bold. Visually distinct from the product name so the eye can scan identifiers separately.
Cost vs price
Two numeric columns. Price is prominent, cost is muted. The difference is the margin — a real business concern.
/* Numeric alignment */
.inv-table th.num,
.inv-table td.num { text-align: right; }
.inv-cell-num {
font-variant-numeric: tabular-nums;
}
/* SKU column */
.inv-sku {
font-family: ui-monospace, "SF Mono", Menlo, monospace;
font-size: 0.8125rem;
color: var(--accent);
font-weight: 600;
}
/* Stock states */
.inv-status {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.25rem 0.625rem;
border-radius: 999px;
font-size: 0.75rem;
font-weight: 600;
}
.inv-status::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
}
.inv-status.in-stock {
background: rgba(16, 185, 129, 0.15);
color: var(--success);
}
.inv-status.low-stock {
background: rgba(245, 158, 11, 0.15);
color: var(--warning);
}
.inv-status.out-of-stock {
background: rgba(239, 68, 68, 0.15);
color: var(--danger);
}
Why tabular-nums:
Proportional font (default):
$29.99
$8.00
$156.00
$1.50
The digits have different widths.
The decimal points don't line up.
The eye can't scan for the largest number.
Tabular nums:
$29.99
$ 8.00
$156.00
$ 1.50
Every digit has the same width.
The decimal points align.
The eye can scan vertically.
One CSS line: font-variant-numeric: tabular-nums.
Why the status dot:
The pill has a ::before pseudo-element.
content: "" makes it a box.
width, height, border-radius make it a circle.
background: currentColor inherits the pill's color.
Result: a colored dot that matches the text color.
No extra HTML. No icon font. One pseudo-element.
This is the standard pattern for status indicators.
You'll see it in GitHub, Linear, Vercel, and every
modern dashboard.
Why monospace for SKU:
SKUs are identifiers, not prose.
Monospace signals "read this exactly."
Proportional font would suggest it's a word.
The accent color distinguishes the SKU column
from the name column. The eye can scan SKUs
without reading product names.
This is the same reason code is monospace
in documentation. Same principle, different
data.
Why three stock states:
In stock → green → "sell it, no action needed"
Low stock → amber → "sell it, but reorder soon"
Out of stock → red → "can't sell it, reorder now"
Two states would lose the "low stock" warning.
Four states would be over-engineered.
Three maps to three real business actions.
✅ The layout
Same CSS Grid shell as the CRM.
.inv-shell {
display: grid;
grid-template-columns: 240px 1fr;
grid-template-rows: 64px 1fr;
grid-template-areas:
"sidebar header"
"sidebar main";
min-height: 100vh;
}
.inv-sidebar { grid-area: sidebar; }
.inv-header { grid-area: header; }
.inv-main { grid-area: main; }
/* KPI row */
.inv-kpi-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}
@media (max-width: 900px) {
.inv-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
.inv-shell {
grid-template-columns: 1fr;
grid-template-rows: auto var(--header-height) 1fr;
grid-template-areas:
"header"
"header"
"main";
}
.inv-sidebar { display: none; }
}
@media (max-width: 500px) {
.inv-kpi-grid { grid-template-columns: 1fr; }
.inv-table th:nth-child(3),
.inv-table td:nth-child(3) { display: none; }
}
The breakpoints: Desktop (>900px): ┌─────────┬───────────────────────┐ │ │ header │ │ sidebar ├───────────────────────┤ │ │ KPI KPI KPI KPI │ │ │ ┌─────────────────┐ │ │ │ │ product table │ │ │ │ └─────────────────┘ │ └─────────┴───────────────────────┘ Tablet (768–900px): Sidebar stays. KPI cards collapse to 2 columns. Mobile (500–768px): Sidebar hidden. Header spans full width. KPI cards at 2 columns. Small mobile (<500px): KPI cards stack to 1 column. Category column hidden. The remaining 6 columns (SKU, name, price, cost, qty, status) fit the narrow screen. The rule for hiding columns: Hide the least action-critical first. Category is informative, but not essential for a quick glance. Price, cost, qty, status are all actionable. If you needed even narrower, hide cost next (it's informational for a buyer, not a quick status check).
✅ The full file
The complete Stage 01 code, ready to run.
The complete file is at /apps/inventory/downloads/inventory-stage-01.html. It's the same file the earlier sections described, fully assembled. Open it in a browser to see it render.
Right-click, save link as. Or open in a new tab and use File → Save Page.
Zero dependencies
No Tailwind, no Font Awesome, no external fonts. Everything inline. Works offline.
Semantic HTML
<aside>, <header>, <main>, <table> with <thead> and <tbody>. Not divs.
Accessible by default
Search input has a label. Table has headers. Buttons are real buttons. Nav links have clear text.
Customizable
Change the tokens. Change the layout. It's your inventory shell now.
⚠️ Common mistakes
What to check if the layout doesn't render right.
min-height: 100vh on the shellThe grid collapses to its content height. Fix: min-height: 100vh on .inv-shell.
Missing text-align: right on the .num cells. Fix: add the class to both <th> and <td>.
Missing font-variant-numeric: tabular-nums. Fix: add it to .inv-cell-num.
Missing monospace font. Fix: font-family: ui-monospace, ... on .inv-sku.
Missing content: "" on the ::before. Fix: add it — pseudo-elements don't render without content.
Amber and red can look similar at small sizes. Fix: increase the dot size to 8px, or add an icon.
Media query targets the wrong selector. Fix: @media (max-width: 768px) { .inv-sidebar { display: none; } }.
Different number of cells in header vs body rows. Fix: every <tr> has the same number of <td> or <th>.
❓ Frequently asked
What will I build in Stage 01?
A static inventory dashboard interface. It has a sidebar with navigation, a header with a search box and an "Add product" button, four KPI cards (total inventory value, products tracked, low stock count, out of stock count), and a product table showing six sample products. It's a single HTML file with inline CSS. No JavaScript — that's Stage 02.
What's new compared to the CRM Stage 01?
Three things. (1) Numeric columns — price, cost, and quantity are right-aligned with tabular figures so digits line up. (2) Stock-status badges — three states with distinct colors. (3) The SKU column — a monospace identifier in the accent color. These are the patterns inventory apps need that CRM apps don't. The layout is identical.
Why use tabular-nums for numbers?
Because proportional fonts give each digit a different width. In a table of prices, 1 is narrower than 8, so the columns don't line up. tabular-nums (via font-variant-numeric) forces every digit to the same width. The result is a clean vertical alignment — like a spreadsheet.
Why three stock states instead of two?
Because there's a real difference between 'out of stock' (can't sell it) and 'low stock' (can sell it, but should reorder soon). Three states map to real business decisions: in-stock (normal), low-stock (reorder), out-of-stock (urgent). The colors follow the standard convention: green, amber, red.
Do I need any tools or dependencies?
No. Stage 01 is a single HTML file with inline CSS. It opens in any browser. No npm, no build step, no framework, no server. If you have a text editor and a browser, you have everything you need.
What if I get stuck?
Download the complete file from the link at the end of this page and compare it line-by-line with your version. The file is tested and works. If your version looks different, the difference is in the HTML structure or the CSS rules — the browser DevTools (F12) will show you which CSS is applying.
🔗 Continue learning
Or explore related CSS concepts: