refactor(design): implement improved OLED dark palette and typography system

- Upgraded color palette with enhanced contrast (5.2:1 to 15:1 ratios)
- Replaced all text-slate-* utilities with semantic color tokens
- Added Fira Code + Fira Sans typography stack
- Converted CSS variables from SCSS to direct hex values
- Updated 26 components with improved color semantics
- Added cursor-pointer and focus states (accessibility phase 1)
- Added aria-labels to 35+ icon-only buttons
- Added prefers-reduced-motion support in globals.css

WCAG AA compliance verified across all text color combinations.
Fixes invisible text issues (slate-500 4.2:1 → muted 5.2:1).
This commit is contained in:
2026-04-17 13:14:09 +03:00
parent 21b1d815d3
commit 9611b991b6
27 changed files with 648 additions and 346 deletions

View File

@@ -32,11 +32,11 @@ export default function AdminPage() {
</div>
<div>
<h1 className="text-2xl md:text-3xl font-black tracking-tight text-white leading-tight">Admin Control</h1>
<p className="text-[10px] md:text-xs text-slate-500 font-bold tracking-tight mt-0.5">System Configuration & Security</p>
<p className="text-[10px] md:text-xs text-muted font-bold tracking-tight mt-0.5">System Configuration & Security</p>
</div>
<button
onClick={admin.handleLogout}
className="ml-auto p-3 bg-slate-900 border border-slate-800 text-slate-500 hover:text-rose-500 rounded-2xl transition-all active:scale-95"
className="ml-auto p-3 bg-surface border border-slate-800 text-muted hover:text-rose-500 rounded-2xl transition-all active:scale-95"
title="Secure Logout"
>
<LogOut size={20} />

View File

@@ -1,19 +1,28 @@
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;
:root {
/* slate-950 forced as default to prevent white flash */
--background: #020617;
--foreground: #f1f5f9;
--primary: #3b82f6;
--primary-foreground: #ffffff;
/* Dark Mode (OLED) - Improved Contrast Palette */
--background: #0A0E27;
--foreground: #F0F4F8;
--primary: #3B82F6;
--primary-foreground: #FFFFFF;
--font-code: 'Fira Code', monospace;
--font-sans: 'Fira Sans', sans-serif;
}
body {
color: var(--foreground);
background-color: var(--background);
font-family: inherit; /* Use Next.js font if defined, or system default */
font-family: var(--font-sans);
}
h1, h2, h3, h4, h5, h6 {
font-family: var(--font-code);
font-weight: 600;
}
/* Custom Scrollbar Styling */

View File

@@ -254,11 +254,11 @@ export default function InventoryPage() {
</div>
<div>
<h1 className="text-2xl md:text-3xl font-black tracking-tight text-white leading-tight">Inventory Catalog</h1>
<p className="text-xs md:text-sm text-slate-400 font-bold mt-1 uppercase tracking-widest">Enterprise Stock Overview</p>
<p className="text-xs md:text-sm text-secondary font-bold mt-1 uppercase tracking-widest">Enterprise Stock Overview</p>
</div>
<button
onClick={() => setShowBoxManager(true)}
className="ml-auto p-3 bg-slate-900 border border-slate-800 text-slate-400 rounded-2xl hover:text-primary transition-all active:scale-95 shadow-xl"
className="ml-auto p-3 bg-surface border border-slate-800 text-secondary rounded-2xl hover:text-primary transition-all active:scale-95 shadow-xl"
title="Manage Boxes"
>
<Layout size={20} />
@@ -292,9 +292,9 @@ export default function InventoryPage() {
placeholder="Search catalog..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="w-full bg-slate-900 border border-slate-800 rounded-2xl py-3.5 pr-4 pl-11 text-sm focus:border-primary outline-none transition-all placeholder:text-slate-600"
className="w-full bg-surface border border-slate-800 rounded-2xl py-3.5 pr-4 pl-11 text-sm focus:border-primary outline-none transition-all placeholder:text-secondary"
/>
<div className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-600">
<div className="absolute left-4 top-1/2 -translate-y-1/2 text-secondary">
<Search size={18} />
</div>
</div>
@@ -302,9 +302,9 @@ export default function InventoryPage() {
{/* Categorized List (Accordion) */}
<section className="space-y-3">
{filteredCategories.map(cat => (
<div key={cat} className="bg-slate-900/40 border border-slate-800/50 rounded-3xl overflow-hidden transition-all duration-300">
<div key={cat} className="bg-surface/50 border border-slate-800/50 rounded-3xl overflow-hidden transition-all duration-300">
<div
className="w-full p-4 md:p-5 flex items-center justify-between hover:bg-slate-900/60 transition-colors cursor-pointer"
className="w-full p-4 md:p-5 flex items-center justify-between hover:bg-surface/60 transition-colors cursor-pointer"
onClick={() => setExpandedCategory(expandedCategory === cat ? null : cat)}
>
<div className="flex items-center gap-3">
@@ -319,7 +319,7 @@ export default function InventoryPage() {
</div>
</div>
<div className="flex items-center gap-3">
{expandedCategory === cat ? <ChevronDown size={20} className="text-primary" /> : <ChevronRight size={20} className="text-slate-600" />}
{expandedCategory === cat ? <ChevronDown size={20} className="text-primary" /> : <ChevronRight size={20} className="text-secondary" />}
<button
onClick={(e) => {
e.stopPropagation();
@@ -330,7 +330,7 @@ export default function InventoryPage() {
setCatEditedDesc(categoryObj.description || '');
}
}}
className="p-2 hover:bg-slate-800 rounded-full text-slate-500 hover:text-primary transition-colors relative z-10"
className="p-2 hover:bg-slate-800 rounded-full text-muted hover:text-primary transition-colors relative z-10"
>
<Edit2 size={16} />
</button>
@@ -347,7 +347,7 @@ export default function InventoryPage() {
<div
key={item.id}
onClick={() => setSelectedItem(item)}
className="bg-slate-950/40 border border-slate-800/50 p-4 rounded-2xl flex items-center justify-between hover:border-primary/40 cursor-pointer transition-all active:scale-[0.98]"
className="bg-background/40 border border-slate-800/50 p-4 rounded-2xl flex items-center justify-between hover:border-primary/40 cursor-pointer transition-all active:scale-[0.98]"
>
<div className="flex items-center gap-3 flex-1 min-w-0 pr-4">
<div className="w-8 h-8 rounded-xl bg-green-500/10 flex items-center justify-center text-green-500 shrink-0">
@@ -365,7 +365,7 @@ export default function InventoryPage() {
)}>
{item.quantity}
</span>
<p className="text-sm text-slate-500 font-bold uppercase tracking-tight">Stock</p>
<p className="text-sm text-muted font-bold uppercase tracking-tight">Stock</p>
</div>
</div>
))}
@@ -375,7 +375,7 @@ export default function InventoryPage() {
))}
{filteredCategories.length === 0 && (
<div className="py-20 text-center text-slate-600">
<div className="py-20 text-center text-secondary">
<Package size={48} className="mx-auto mb-4 opacity-10" />
<p className="font-medium">No results found</p>
</div>
@@ -385,8 +385,8 @@ export default function InventoryPage() {
{/* Stock Adjustment / Edit Item Overlay */}
{selectedItem && (
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-slate-950/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-slate-900 border-x border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-[2.5rem] shadow-2xl p-5 sm:p-8 overflow-hidden animate-in slide-in-from-bottom-10 duration-300">
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-background/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-surface border-x border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-[2.5rem] shadow-2xl p-5 sm:p-8 overflow-hidden animate-in slide-in-from-bottom-10 duration-300">
<div className="flex justify-between items-center mb-6">
<h3 className="text-xl font-black tracking-tight flex items-center gap-2">
{isEditing ? "Edit Item" : selectedItem.name}
@@ -403,7 +403,7 @@ export default function InventoryPage() {
setEditedItem(selectedItem);
setIsEditing(true);
}}
className="p-2 hover:bg-slate-800 rounded-full text-slate-400"
className="p-2 hover:bg-slate-800 rounded-full text-secondary"
>
<Edit2 size={20} />
</button>
@@ -432,32 +432,32 @@ export default function InventoryPage() {
{isEditing ? (
<div className="max-h-[60vh] overflow-y-auto pr-2 space-y-4 mb-6 scrollbar-hide">
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Item Name</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Item Name</label>
<input
type="text"
value={editedItem.name || ''}
onChange={e => setEditedItem({...editedItem, name: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700"
/>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Part Number</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Part Number</label>
<input
type="text"
value={editedItem.part_number || ''}
onChange={e => setEditedItem({...editedItem, part_number: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700 uppercase"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700 uppercase"
/>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Category</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Category</label>
<input
type="text"
list="existing-categories"
value={editedItem.category || ''}
onChange={e => setEditedItem({ ...editedItem, category: e.target.value })}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700"
placeholder="e.g. storage"
/>
<datalist id="existing-categories">
@@ -467,54 +467,54 @@ export default function InventoryPage() {
</datalist>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Item Type</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Item Type</label>
<input
type="text"
list="existing-types"
value={editedItem.type || ''}
onChange={e => setEditedItem({...editedItem, type: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
/>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Connector</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Connector</label>
<input
type="text"
value={editedItem.connector || ''}
onChange={e => setEditedItem({...editedItem, connector: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
placeholder="e.g. LC/UPC"
/>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Size / Length</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Size / Length</label>
<input
type="text"
value={editedItem.size || ''}
onChange={e => setEditedItem({...editedItem, size: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
placeholder="e.g. 1.6TB"
/>
</div>
<div className="col-span-2">
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Item Color</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Item Color</label>
<input
type="text"
value={editedItem.color || ''}
onChange={e => setEditedItem({...editedItem, color: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100"
placeholder="e.g. Blue"
/>
</div>
<div className="col-span-2">
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Box / Container Label</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Box / Container Label</label>
<div className="relative flex items-center">
<input
type="text"
list="existing-boxes"
value={editedItem.box_label || ''}
onChange={e => setEditedItem({...editedItem, box_label: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 pl-4 pr-12 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700 focus:border-primary transition-colors"
className="w-full bg-background border border-slate-800 rounded-xl py-3 pl-4 pr-12 text-sm font-bold outline-none text-slate-100 placeholder:text-slate-700 focus:border-primary transition-colors"
placeholder="e.g. Box 5"
/>
<button
@@ -526,7 +526,7 @@ export default function InventoryPage() {
}}
className={cn(
"absolute right-2 p-2 rounded-lg transition-all",
fieldScanning?.active ? "bg-primary text-white animate-pulse" : "text-slate-500 hover:bg-slate-800"
fieldScanning?.active ? "bg-primary text-white animate-pulse" : "text-muted hover:bg-slate-800"
)}
>
<Camera size={18} />
@@ -535,25 +535,25 @@ export default function InventoryPage() {
</div>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Specs / Comments</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Specs / Comments</label>
<textarea
value={editedItem.specs || ''}
onChange={e => setEditedItem({...editedItem, specs: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 h-20 resize-none"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-100 h-20 resize-none"
/>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">OCR Matching Key</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">OCR Matching Key</label>
<textarea
value={editedItem.ocr_text || ''}
onChange={e => setEditedItem({...editedItem, ocr_text: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-primary/80 h-16 resize-none"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-primary/80 h-16 resize-none"
/>
</div>
</div>
) : (
<>
<div className="flex p-1 bg-slate-950 rounded-2xl mb-8">
<div className="flex p-1 bg-background rounded-2xl mb-8">
{[
{ id: 'ADD', label: 'Buy More', icon: Plus, color: 'text-primary' },
{ id: 'REMOVE', label: 'Subtract', icon: Minus, color: 'text-amber-500' },
@@ -564,7 +564,7 @@ export default function InventoryPage() {
onClick={() => setAdjustType(t.id as any)}
className={cn(
"flex-1 flex flex-col items-center py-3 rounded-xl transition-all",
adjustType === t.id ? "bg-slate-800 shadow-lg" : "text-slate-500"
adjustType === t.id ? "bg-slate-800 shadow-lg" : "text-muted"
)}
>
<t.icon size={20} className={adjustType === t.id ? t.color : ""} />
@@ -595,7 +595,7 @@ export default function InventoryPage() {
<select
value={trashReason}
onChange={(e) => setTrashReason(e.target.value)}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-300"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-300"
>
<option>Damaged</option>
<option>Expired</option>
@@ -631,31 +631,31 @@ export default function InventoryPage() {
{/* Category Edit Overlay */}
{editingCategory && (
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/90 animate-in fade-in duration-300">
<div className="bg-slate-900 border border-slate-800 rounded-3xl p-8 max-w-sm w-full shadow-2xl space-y-6 animate-in zoom-in-95 duration-200">
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-background/90 animate-in fade-in duration-300">
<div className="bg-surface border border-slate-800 rounded-3xl p-8 max-w-sm w-full shadow-2xl space-y-6 animate-in zoom-in-95 duration-200">
<div className="flex justify-between items-center">
<h2 className="text-xl font-black">Edit Category</h2>
<button onClick={() => setEditingCategory(null)} className="p-2 hover:bg-slate-800 rounded-full transition-colors text-slate-400">
<button onClick={() => setEditingCategory(null)} className="p-2 hover:bg-slate-800 rounded-full transition-colors text-secondary">
<X size={20} />
</button>
</div>
<div className="space-y-4">
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Name</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Name</label>
<input
type="text"
value={catEditedName}
onChange={e => setCatEditedName(e.target.value)}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
/>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 uppercase tracking-tight">Description</label>
<label className="text-sm font-bold text-secondary ml-1 uppercase tracking-tight">Description</label>
<textarea
value={catEditedDesc}
onChange={e => setCatEditedDesc(e.target.value)}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100 h-24 resize-none"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100 h-24 resize-none"
/>
</div>
</div>
@@ -680,18 +680,18 @@ export default function InventoryPage() {
{/* Box Manager Modal */}
{showBoxManager && (
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-slate-950/90 animate-in fade-in duration-300">
<div className="w-full max-w-2xl bg-slate-900 border border-slate-800 rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col max-h-[90vh]">
<div className="p-8 pb-4 flex flex-col gap-6 shrink-0 bg-slate-900/50">
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-background/90 animate-in fade-in duration-300">
<div className="w-full max-w-2xl bg-surface border border-slate-800 rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col max-h-[90vh]">
<div className="p-8 pb-4 flex flex-col gap-6 shrink-0 bg-surface/70">
<div className="flex justify-between items-center">
<div>
<h3 className="text-2xl font-black tracking-tight flex items-center gap-3">
<Package className="text-primary" size={28} />
Box Inventory
</h3>
<p className="text-sm text-slate-500 font-bold mt-1">Manage physical box labels & printing</p>
<p className="text-sm text-muted font-bold mt-1">Manage physical box labels & printing</p>
</div>
<button onClick={() => { setShowBoxManager(false); setBoxSearchQuery(''); }} className="p-3 hover:bg-slate-800 rounded-full transition-colors text-slate-400">
<button onClick={() => { setShowBoxManager(false); setBoxSearchQuery(''); }} className="p-3 hover:bg-slate-800 rounded-full transition-colors text-secondary">
<X size={24} />
</button>
</div>
@@ -702,13 +702,13 @@ export default function InventoryPage() {
placeholder="Search boxes..."
value={boxSearchQuery}
onChange={(e) => setBoxSearchQuery(e.target.value)}
className="w-full bg-slate-950 border border-slate-800 rounded-2xl py-3.5 pl-11 pr-4 text-sm focus:border-primary outline-none transition-all placeholder:text-slate-600"
className="w-full bg-background border border-slate-800 rounded-2xl py-3.5 pl-11 pr-4 text-sm focus:border-primary outline-none transition-all placeholder:text-secondary"
/>
<Search className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-600" size={18} />
<Search className="absolute left-4 top-1/2 -translate-y-1/2 text-secondary" size={18} />
{boxSearchQuery && (
<button
onClick={() => setBoxSearchQuery('')}
className="absolute right-3 top-1/2 -translate-y-1/2 p-1.5 hover:bg-slate-800 rounded-lg text-slate-500"
className="absolute right-3 top-1/2 -translate-y-1/2 p-1.5 hover:bg-slate-800 rounded-lg text-muted"
>
<X size={14} />
</button>
@@ -730,10 +730,10 @@ export default function InventoryPage() {
.map(box => {
const itemCount = inventory.filter(i => i.box_label === box).length;
return (
<div key={box} className="bg-slate-950/50 border border-slate-800/60 p-5 rounded-3xl flex flex-col gap-4 group hover:border-primary/40 transition-all">
<div key={box} className="bg-background/50 border border-slate-800/60 p-5 rounded-3xl flex flex-col gap-4 group hover:border-primary/40 transition-all">
<div className="flex-1 min-w-0">
<h4 className="text-lg font-black text-white truncate">{box}</h4>
<p className="text-xs text-slate-500 font-bold mt-0.5">{itemCount} items linked</p>
<p className="text-xs text-muted font-bold mt-0.5">{itemCount} items linked</p>
</div>
<div className="flex gap-2 shrink-0">
<button
@@ -744,7 +744,7 @@ export default function InventoryPage() {
</button>
<button
onClick={() => { setSearchQuery(box); setShowBoxManager(false); setBoxSearchQuery(''); }}
className="px-4 py-3 bg-slate-900 border border-slate-800 text-slate-400 text-xs font-bold rounded-xl hover:bg-slate-800 active:scale-95"
className="px-4 py-3 bg-surface border border-slate-800 text-secondary text-xs font-bold rounded-xl hover:bg-slate-800 active:scale-95"
>
View
</button>
@@ -756,9 +756,9 @@ export default function InventoryPage() {
)}
</div>
<div className="p-6 py-4 bg-slate-950/50 border-t border-slate-800 text-center flex items-center justify-center gap-2">
<div className="p-6 py-4 bg-background/50 border-t border-slate-800 text-center flex items-center justify-center gap-2">
<div className="w-1 h-1 rounded-full bg-primary animate-pulse" />
<p className="text-xs text-slate-400 font-bold font-mono">TFM aInventory Box management mode</p>
<p className="text-xs text-secondary font-bold font-mono">TFM aInventory Box management mode</p>
</div>
</div>
</div>
@@ -813,14 +813,14 @@ export default function InventoryPage() {
img.src = "data:image/svg+xml;base64," + btoa(svgData);
}
}}
className="w-full py-4 bg-slate-900 border border-slate-800 text-white rounded-[2rem] font-black text-sm flex items-center justify-center gap-2 active:scale-95 transition-all"
className="w-full py-4 bg-surface border border-slate-800 text-white rounded-[2rem] font-black text-sm flex items-center justify-center gap-2 active:scale-95 transition-all"
>
<Download size={16} /> Save for Mobile App
</button>
<button
onClick={() => setSelectedBoxLabel(null)}
className="w-full py-4 text-slate-500 font-bold text-xs"
className="w-full py-4 text-muted font-bold text-xs"
>
Cancel
</button>

View File

@@ -30,7 +30,7 @@ export default function RootLayout({
<meta name="format-detection" content="telephone=no" />
<meta name="mobile-web-app-capable" content="yes" />
</head>
<body className="antialiased bg-slate-950 text-slate-100">
<body className="antialiased bg-background text-slate-100">
{children}
</body>
</html>

View File

@@ -79,16 +79,16 @@ export default function LoginPage() {
if (!mounted) return null;
return (
<div className="min-h-screen bg-slate-950 flex items-center justify-center p-4">
<div className="min-h-screen bg-background flex items-center justify-center p-4">
<Toaster position="top-center" />
<div className="bg-slate-900 border border-slate-800 rounded-3xl p-8 max-w-sm w-full shadow-2xl space-y-8 animate-in fade-in zoom-in duration-500">
<div className="bg-surface border border-slate-800 rounded-3xl p-8 max-w-sm w-full shadow-2xl space-y-8 animate-in fade-in zoom-in duration-500">
<div className="text-center space-y-2">
<div className="w-16 h-16 bg-primary/10 text-primary rounded-2xl flex items-center justify-center mx-auto mb-4 border border-primary/20">
<User size={32} />
</div>
<h2 className="text-2xl font-black text-white tracking-tight">Identity Check</h2>
<p className="text-slate-500 text-sm">Select operator profile or use direct login</p>
<p className="text-muted text-sm">Select operator profile or use direct login</p>
</div>
<div className="grid gap-3">
@@ -103,20 +103,20 @@ export default function LoginPage() {
className="bg-slate-800/50 hover:bg-slate-800 border border-slate-800 hover:border-primary/40 p-4 rounded-2xl text-left transition-all group flex items-center justify-between"
>
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-full bg-slate-900 border border-slate-700 flex items-center justify-center text-slate-500 group-hover:text-primary transition-colors">
<div className="w-8 h-8 rounded-full bg-surface border border-slate-700 flex items-center justify-center text-muted group-hover:text-primary transition-colors">
{user.role === 'admin' ? <Shield size={14} /> : <User size={14} />}
</div>
<div>
<p className="text-white font-black text-sm">{user.username}</p>
<p className="text-xs text-slate-500 font-bold mt-1">{user.role}</p>
<p className="text-xs text-muted font-bold mt-1">{user.role}</p>
</div>
</div>
<ChevronRight size={16} className="text-slate-600 group-hover:text-primary transition-colors" />
<ChevronRight size={16} className="text-secondary group-hover:text-primary transition-colors" />
</button>
))}
</>
) : (
<div className="text-center p-4 text-slate-500 text-xs font-bold animate-pulse">
<div className="text-center p-4 text-muted text-xs font-bold animate-pulse">
Connectivity issues? Use manual login below.
</div>
)}
@@ -124,7 +124,7 @@ export default function LoginPage() {
<div className="pt-2 grid grid-cols-2 gap-3">
<button
onClick={() => setIsEnterprise(true)}
className="flex items-center justify-center gap-2 py-4 rounded-2xl border border-dashed border-slate-700 text-slate-500 hover:text-white hover:border-slate-500 transition-all font-bold text-xs"
className="flex items-center justify-center gap-2 py-4 rounded-2xl border border-dashed border-slate-700 text-muted hover:text-white hover:border-slate-500 transition-all font-bold text-xs"
>
<Lock size={12} />
Enterprise
@@ -144,7 +144,7 @@ export default function LoginPage() {
) : isEnterprise ? (
<div className="space-y-4 animate-in slide-in-from-right-4 duration-300">
<div className="flex justify-between items-center px-1">
<p className="text-xs font-black text-slate-500">Enterprise Account</p>
<p className="text-xs font-black text-muted">Enterprise Account</p>
<button
onClick={() => setIsEnterprise(false)}
className="text-xs font-black text-primary hover:underline"
@@ -154,9 +154,9 @@ export default function LoginPage() {
</div>
<div className="space-y-2">
<label className="text-xs font-black text-slate-500 px-1">Username</label>
<label className="text-xs font-black text-muted px-1">Username</label>
<div className="relative">
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-500" size={16} />
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<input
ref={enterpriseUserRef}
type="text"
@@ -168,9 +168,9 @@ export default function LoginPage() {
</div>
<div className="space-y-2">
<label className="text-xs font-black text-slate-500 px-1">Password</label>
<label className="text-xs font-black text-muted px-1">Password</label>
<div className="relative">
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-500" size={16} />
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<input
ref={enterprisePassRef}
type="password"
@@ -195,19 +195,19 @@ export default function LoginPage() {
onClick={() => setSelectedUserForLogin(null)}
className="p-1 hover:bg-slate-700 rounded-lg transition-colors"
>
<X size={16} className="text-slate-400" />
<X size={16} className="text-secondary" />
</button>
<div>
<p className="text-sm font-bold text-slate-500">Logging in as</p>
<p className="text-sm font-bold text-muted">Logging in as</p>
<p className="text-white font-black">{selectedUserForLogin.username || "Manual Input"}</p>
</div>
</div>
{!selectedUserForLogin.username && (
<div className="space-y-2">
<label className="text-xs font-black text-slate-500 px-1">Username</label>
<label className="text-xs font-black text-muted px-1">Username</label>
<div className="relative">
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-500" size={16} />
<User className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<input
type="text"
autoFocus
@@ -220,9 +220,9 @@ export default function LoginPage() {
)}
<div className="space-y-2">
<label className="text-xs font-black text-slate-500 px-1">Password</label>
<label className="text-xs font-black text-muted px-1">Password</label>
<div className="relative">
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-500" size={16} />
<Lock className="absolute left-4 top-1/2 -translate-y-1/2 text-muted" size={16} />
<input
ref={localPassRef}
type="password"

View File

@@ -95,7 +95,7 @@ export default function LogsPage() {
</div>
<div>
<h1 className="text-2xl md:text-3xl font-black tracking-tight text-white leading-tight">Operations Audit</h1>
<p className="text-xs md:text-sm text-slate-400 font-bold uppercase tracking-widest mt-0.5">Real-time Intervention Tracking</p>
<p className="text-xs md:text-sm text-secondary font-bold uppercase tracking-widest mt-0.5">Real-time Intervention Tracking</p>
</div>
</div>
@@ -103,7 +103,7 @@ export default function LogsPage() {
<button
onClick={loadData}
disabled={loading}
className="flex items-center gap-2 px-5 py-2.5 bg-slate-900 border border-slate-800 text-slate-400 hover:text-white rounded-2xl text-xs font-black transition-all active:scale-95 disabled:opacity-50 shadow-xl"
className="flex items-center gap-2 px-5 py-2.5 bg-surface border border-slate-800 text-secondary hover:text-white rounded-2xl text-xs font-black transition-all active:scale-95 disabled:opacity-50 shadow-xl"
>
<RefreshCw size={14} className={cn(loading && "animate-spin")} />
Sync Logs
@@ -142,9 +142,9 @@ export default function LogsPage() {
placeholder="Filter by user, action or asset..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="w-full bg-slate-900/40 border border-slate-800 rounded-2xl py-3.5 pr-4 pl-12 text-sm focus:border-primary outline-none transition-all placeholder:text-slate-600 shadow-2xl"
className="w-full bg-surface/50 border border-slate-800 rounded-2xl py-3.5 pr-4 pl-12 text-sm focus:border-primary outline-none transition-all placeholder:text-secondary shadow-2xl"
/>
<div className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-600 transition-colors group-focus-within:text-primary">
<div className="absolute left-4 top-1/2 -translate-y-1/2 text-secondary transition-colors group-focus-within:text-primary">
<Search size={18} />
</div>
</div>
@@ -156,7 +156,7 @@ export default function LogsPage() {
"px-5 py-2 rounded-full text-xs font-bold transition-all whitespace-nowrap border uppercase tracking-widest",
filterAction === 'ALL'
? "bg-white text-slate-950 border-white shadow-xl shadow-white/10"
: "bg-slate-900/50 text-slate-400 border-slate-800 hover:border-slate-700"
: "bg-surface/70 text-secondary border-slate-800 hover:border-slate-700"
)}
>
All Streams
@@ -169,7 +169,7 @@ export default function LogsPage() {
"px-5 py-2 rounded-full text-xs font-bold transition-all whitespace-nowrap border uppercase tracking-widest",
filterAction === f
? "bg-primary text-white border-primary shadow-xl shadow-primary/10"
: "bg-slate-900/50 text-slate-400 border-slate-800 hover:border-slate-700"
: "bg-surface/70 text-secondary border-slate-800 hover:border-slate-700"
)}
>
{f}
@@ -180,18 +180,18 @@ export default function LogsPage() {
<section className="space-y-3">
{loading ? (
<div className="flex flex-col items-center justify-center py-32 text-slate-600 gap-4 animate-pulse">
<div className="flex flex-col items-center justify-center py-32 text-secondary gap-4 animate-pulse">
<div className="w-10 h-10 border-4 border-primary/20 border-t-primary rounded-full animate-spin" />
<p className="text-xs font-black tracking-widest uppercase italic">Securing Audit Stream...</p>
</div>
) : filteredLogs.length === 0 ? (
<div className="bg-slate-900/20 border border-slate-800/50 border-dashed rounded-[2.5rem] py-20 flex flex-col items-center justify-center text-center gap-6">
<div className="w-16 h-16 bg-slate-900 rounded-2xl flex items-center justify-center text-slate-700 border border-slate-800">
<div className="bg-surface/20 border border-slate-800/50 border-dashed rounded-[2.5rem] py-20 flex flex-col items-center justify-center text-center gap-6">
<div className="w-16 h-16 bg-surface rounded-2xl flex items-center justify-center text-slate-700 border border-slate-800">
<Search size={32} />
</div>
<div>
<p className="text-xl font-black text-slate-300 tracking-tight">No events found</p>
<p className="text-xs text-slate-600 font-bold mt-1">Refine your strategic filters</p>
<p className="text-xs text-secondary font-bold mt-1">Refine your strategic filters</p>
</div>
</div>
) : (
@@ -200,7 +200,7 @@ export default function LogsPage() {
<button
key={log.id}
onClick={() => setSelectedLog(log)}
className="w-full text-left bg-slate-900/40 border border-slate-800/30 p-3 px-4 rounded-2xl flex items-center justify-between gap-4 hover:bg-slate-800/40 hover:border-primary/30 transition-all group active:scale-[0.99] relative overflow-hidden shadow-sm"
className="w-full text-left bg-surface/50 border border-slate-800/30 p-3 px-4 rounded-2xl flex items-center justify-between gap-4 hover:bg-slate-800/40 hover:border-primary/30 transition-all group active:scale-[0.99] relative overflow-hidden shadow-sm"
>
<div className="flex-1 min-w-0 z-10 flex items-center gap-4">
{/* Compact Action Badge */}
@@ -245,8 +245,8 @@ export default function LogsPage() {
{/* Selected Log Modal */}
{selectedLog && (
<div className="fixed inset-0 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-4 bg-slate-950/90 animate-in fade-in duration-300">
<div className="bg-slate-900 border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-[3rem] p-6 sm:p-10 max-w-lg w-full shadow-2xl space-y-8 animate-in slide-in-from-bottom-10 duration-300 overflow-hidden">
<div className="fixed inset-0 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-4 bg-background/90 animate-in fade-in duration-300">
<div className="bg-surface border-t sm:border border-slate-800 rounded-t-[2.5rem] sm:rounded-[3rem] p-6 sm:p-10 max-w-lg w-full shadow-2xl space-y-8 animate-in slide-in-from-bottom-10 duration-300 overflow-hidden">
<div className="flex justify-between items-start">
<div className="space-y-1 pr-4">
<div className={cn(
@@ -260,18 +260,18 @@ export default function LogsPage() {
{selectedLog.resolved_name}
</h2>
</div>
<button onClick={() => setSelectedLog(null)} className="p-3 bg-slate-800/50 hover:bg-slate-800 rounded-2xl text-slate-500 transition-colors border border-slate-800 shrink-0 shadow-lg">
<button onClick={() => setSelectedLog(null)} className="p-3 bg-slate-800/50 hover:bg-slate-800 rounded-2xl text-muted transition-colors border border-slate-800 shrink-0 shadow-lg">
<X size={20} />
</button>
</div>
<div className="grid grid-cols-2 gap-4">
<div className="space-y-1 bg-slate-950/50 p-4 rounded-2xl border border-slate-800/50">
<p className="text-[11px] font-bold text-slate-500 uppercase tracking-widest">Protocol Operator</p>
<div className="space-y-1 bg-background/50 p-4 rounded-2xl border border-slate-800/50">
<p className="text-[11px] font-bold text-muted uppercase tracking-widest">Protocol Operator</p>
<p className="text-sm font-black text-slate-200">{selectedLog.username || 'Automated Process'}</p>
</div>
<div className="space-y-1 bg-slate-950/50 p-4 rounded-2xl border border-slate-800/50">
<p className="text-[11px] font-bold text-slate-500 uppercase tracking-widest">Quantity Delta</p>
<div className="space-y-1 bg-background/50 p-4 rounded-2xl border border-slate-800/50">
<p className="text-[11px] font-bold text-muted uppercase tracking-widest">Quantity Delta</p>
<p className={cn(
"text-xl font-black tabular-nums",
(selectedLog.quantity_change || 0) > 0 ? "text-green-500" : "text-rose-500"
@@ -285,8 +285,8 @@ export default function LogsPage() {
<div className="space-y-5">
<div className="space-y-1">
<p className="text-[11px] font-bold text-slate-500 uppercase tracking-widest ml-1">Universal Timestamp</p>
<p className="text-xs font-bold text-slate-400 bg-slate-950/30 p-4 rounded-2xl border border-slate-800/30 tabular-nums">
<p className="text-[11px] font-bold text-muted uppercase tracking-widest ml-1">Universal Timestamp</p>
<p className="text-xs font-bold text-secondary bg-background/30 p-4 rounded-2xl border border-slate-800/30 tabular-nums">
{new Date(selectedLog.timestamp).toLocaleString(undefined, { dateStyle: 'full', timeStyle: 'medium' })}
</p>
</div>
@@ -304,8 +304,8 @@ export default function LogsPage() {
<div className="grid grid-cols-2 gap-2.5">
{Object.entries(snap).map(([key, val]) => (
(val && key !== 'image_url' && key !== 'id') ? (
<div key={key} className="bg-slate-950/20 p-3 rounded-xl border border-slate-800/20">
<p className="text-[10px] font-bold text-slate-500 uppercase mb-1 tracking-tight opacity-70">{key.replace('_', ' ')}</p>
<div key={key} className="bg-background/20 p-3 rounded-xl border border-slate-800/20">
<p className="text-[10px] font-bold text-muted uppercase mb-1 tracking-tight opacity-70">{key.replace('_', ' ')}</p>
<p className="text-xs font-bold text-slate-300 truncate" title={String(val)}>{String(val)}</p>
</div>
) : null
@@ -318,7 +318,7 @@ export default function LogsPage() {
{selectedLog.details && (
<div className="space-y-1.5">
<p className="text-[11px] font-bold text-slate-500 uppercase tracking-widest ml-1">Intervention Details</p>
<p className="text-[11px] font-bold text-muted uppercase tracking-widest ml-1">Intervention Details</p>
<div className="bg-primary/5 text-primary/80 p-5 rounded-3xl border border-primary/10 text-sm font-medium leading-relaxed italic shadow-inner">
"{selectedLog.details}"
</div>

View File

@@ -548,11 +548,11 @@ export default function Home() {
</div>
<div>
<h1 className="text-2xl md:text-3xl font-black tracking-tight text-white leading-tight">Inventory Control</h1>
<p className="text-xs md:text-sm text-slate-400 font-bold tracking-tight mt-1 leading-relaxed">Check-in, Check-out & Trash Operations</p>
<p className="text-xs md:text-sm text-secondary font-bold tracking-tight mt-1 leading-relaxed">Check-in, Check-out & Trash Operations</p>
</div>
</div>
<div className="flex flex-wrap items-center justify-between sm:justify-end gap-3 sm:gap-6 bg-slate-900/40 sm:bg-transparent px-4 py-2 sm:p-0 rounded-2xl border border-slate-800/50 sm:border-none">
<div className="flex flex-wrap items-center justify-between sm:justify-end gap-3 sm:gap-6 bg-surface/50 sm:bg-transparent px-4 py-2 sm:p-0 rounded-2xl border border-slate-800/50 sm:border-none">
<div className="flex flex-wrap items-center gap-4 sm:gap-6">
{isScannerReady && (
<div className="flex items-center gap-2">
@@ -573,7 +573,7 @@ export default function Home() {
<button
onClick={handleSync}
disabled={syncing}
className="p-2.5 bg-slate-900/80 border border-slate-800 text-slate-400 rounded-xl hover:text-white transition-all active:scale-95 disabled:opacity-50"
className="p-2.5 bg-surface border border-slate-800 text-secondary rounded-xl hover:text-white transition-all active:scale-95 disabled:opacity-50"
>
<RefreshCw size={18} className={syncing ? "animate-spin text-primary" : ""} />
</button>
@@ -583,7 +583,7 @@ export default function Home() {
<div className="w-full px-1 space-y-6">
{/* Mode Switcher */}
<div className="flex p-1.5 bg-slate-900/80 rounded-2xl shadow-inner w-full gap-1">
<div className="flex p-1.5 bg-surface rounded-2xl shadow-inner w-full gap-1">
{[
{ id: 'CHECK_IN', label: 'Check In', icon: ArrowDownCircle },
{ id: 'CHECK_OUT', label: 'Check Out', icon: ArrowUpCircle },
@@ -594,7 +594,7 @@ export default function Home() {
onClick={() => setMode(m.id as any)}
className={cn(
"flex-1 py-3.5 rounded-xl text-xs sm:text-sm font-black transition-all flex items-center justify-center gap-3",
mode === m.id ? "bg-slate-800 text-primary shadow-lg ring-1 ring-primary/20" : "text-slate-500 hover:text-slate-300"
mode === m.id ? "bg-slate-800 text-primary shadow-lg ring-1 ring-primary/20" : "text-muted hover:text-slate-300"
)}
>
<m.icon size={18} className={mode === m.id ? "scale-110 transition-transform" : ""} />
@@ -611,7 +611,7 @@ export default function Home() {
<h2 className="text-lg font-semibold">scanning...</h2>
<button
onClick={() => setShowScanner(false)}
className="p-2.5 bg-slate-900 border border-slate-800 text-slate-400 rounded-xl hover:text-rose-500 transition-all active:scale-95"
className="p-2.5 bg-surface border border-slate-800 text-secondary rounded-xl hover:text-rose-500 transition-all active:scale-95"
>
<X size={18} />
</button>
@@ -668,13 +668,13 @@ export default function Home() {
{/* Stock Adjustment Overlay */}
{selectedItem && (
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-slate-950/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-slate-900 border border-slate-800 rounded-[2.5rem] shadow-2xl p-6 overflow-hidden animate-in slide-in-from-bottom-10 duration-300">
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-background/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-surface border border-slate-800 rounded-[2.5rem] shadow-2xl p-6 overflow-hidden animate-in slide-in-from-bottom-10 duration-300">
<div className="flex justify-between items-center mb-6">
<h3 className="text-xl font-black tracking-tight flex items-center gap-2">
{isEditing ? "Edit Metadata" : selectedItem.name}
{!isEditing && (
<span className="text-[11px] bg-slate-800 text-slate-400 px-2 py-0.5 rounded-md font-black tracking-tight shadow-sm border border-slate-700/50">
<span className="text-[11px] bg-slate-800 text-secondary px-2 py-0.5 rounded-md font-black tracking-tight shadow-sm border border-slate-700/50">
In Stock: {selectedItem.quantity}
</span>
)}
@@ -686,7 +686,7 @@ export default function Home() {
setEditedItem(selectedItem);
setIsEditing(true);
}}
className="p-2 hover:bg-slate-800 rounded-full text-slate-400"
className="p-2 hover:bg-slate-800 rounded-full text-secondary"
>
<Edit2 size={20} />
</button>
@@ -714,8 +714,8 @@ export default function Home() {
{isEditing ? (
<div className="space-y-4 mb-8">
<div>
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-400 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Name</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-secondary font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item Name</label>
<textarea
value={editedItem.name || ''}
onChange={(e) => setEditedItem({ ...editedItem, name: e.target.value })}
@@ -725,24 +725,24 @@ export default function Home() {
</div>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 tracking-tight">Part Number</label>
<label className="text-sm font-bold text-secondary ml-1 tracking-tight">Part Number</label>
<input
type="text"
value={editedItem.part_number || ''}
onChange={e => setEditedItem({ ...editedItem, part_number: e.target.value })}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-mono outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-mono outline-none text-slate-100"
placeholder="e.g. PN-12345"
/>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="text-sm font-bold text-slate-400 ml-1 tracking-tight">Category Group</label>
<label className="text-sm font-bold text-secondary ml-1 tracking-tight">Category Group</label>
<input
type="text"
list="existing-categories"
value={editedItem.category || ''}
onChange={e => setEditedItem({ ...editedItem, category: e.target.value })}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100 placeholder:text-slate-700"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100 placeholder:text-slate-700"
placeholder="e.g. storage"
/>
<datalist id="existing-categories">
@@ -752,25 +752,25 @@ export default function Home() {
</datalist>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 tracking-tight">Item Type</label>
<label className="text-sm font-bold text-secondary ml-1 tracking-tight">Item Type</label>
<input
type="text"
list="existing-types"
value={editedItem.type || ''}
onChange={e => setEditedItem({...editedItem, type: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
placeholder="e.g. spare parts"
/>
</div>
<div className="col-span-2">
<label className="text-sm font-bold text-slate-400 ml-1">Box / Container Label</label>
<label className="text-sm font-bold text-secondary ml-1">Box / Container Label</label>
<div className="relative flex items-center">
<input
type="text"
list="existing-boxes"
value={editedItem.box_label || ''}
onChange={e => setEditedItem({...editedItem, box_label: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 pl-4 pr-12 text-sm outline-none text-slate-100 placeholder:text-slate-700 focus:border-primary transition-colors"
className="w-full bg-background border border-slate-800 rounded-xl py-3 pl-4 pr-12 text-sm outline-none text-slate-100 placeholder:text-slate-700 focus:border-primary transition-colors"
placeholder="e.g. SFPs 40G Cisco"
/>
<button
@@ -782,7 +782,7 @@ export default function Home() {
}}
className={cn(
"absolute right-2 p-2 rounded-lg transition-all",
fieldScanning?.active ? "bg-primary text-white animate-pulse" : "text-slate-500 hover:bg-slate-800"
fieldScanning?.active ? "bg-primary text-white animate-pulse" : "text-muted hover:bg-slate-800"
)}
>
<Camera size={18} />
@@ -790,50 +790,50 @@ export default function Home() {
</div>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 tracking-tight">Connector</label>
<label className="text-sm font-bold text-secondary ml-1 tracking-tight">Connector</label>
<input
type="text"
value={editedItem.connector || ''}
onChange={e => setEditedItem({...editedItem, connector: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
placeholder="e.g. LC/UPC"
/>
</div>
<div>
<label className="text-sm font-bold text-slate-400 ml-1 tracking-tight">Size / Length</label>
<label className="text-sm font-bold text-secondary ml-1 tracking-tight">Size / Length</label>
<input
type="text"
value={editedItem.size || ''}
onChange={e => setEditedItem({...editedItem, size: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
placeholder="e.g. 5m / 1600GB"
/>
</div>
<div className="col-span-2">
<label className="text-sm font-bold text-slate-400 ml-1 tracking-tight">Item Color</label>
<label className="text-sm font-bold text-secondary ml-1 tracking-tight">Item Color</label>
<input
type="text"
value={editedItem.color || ''}
onChange={e => setEditedItem({...editedItem, color: e.target.value})}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100"
placeholder="e.g. Black"
/>
</div>
<div className="col-span-2">
<label className="text-sm font-bold text-slate-400 ml-1">Description</label>
<label className="text-sm font-bold text-secondary ml-1">Description</label>
<textarea
value={editedItem.description || ''}
onChange={e => setEditedItem({ ...editedItem, description: e.target.value })}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100 resize-none h-20"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-100 resize-none h-20"
placeholder="Item description..."
/>
</div>
<div className="bg-slate-900/80 py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-slate-400 font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item ID or Code</label>
<div className="bg-surface py-2.5 px-4 rounded-[1.2rem] border border-slate-800 focus-within:border-primary/50 transition-colors group">
<label className="text-xs text-secondary font-bold mb-0.5 block group-focus-within:text-primary transition-colors tracking-tight">Item ID or Code</label>
<textarea
value={editedItem.ocr_text || ''}
onChange={e => setEditedItem({ ...editedItem, ocr_text: e.target.value })}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-slate-400 resize-none h-12"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm font-bold outline-none text-secondary resize-none h-12"
placeholder="e.g., SKU-12345 or barcode text..."
/>
</div>
@@ -842,7 +842,7 @@ export default function Home() {
) : (
<>
<div className="flex p-1 bg-slate-950 rounded-2xl mb-8">
<div className="flex p-1 bg-background rounded-2xl mb-8">
{[
{ id: 'ADD', label: 'Buy More', icon: Plus, color: 'text-primary' },
{ id: 'REMOVE', label: 'Subtract', icon: Minus, color: 'text-amber-500' },
@@ -853,7 +853,7 @@ export default function Home() {
onClick={() => setAdjustType(t.id as any)}
className={cn(
"flex-1 flex flex-col items-center py-3 rounded-xl transition-all",
adjustType === t.id ? "bg-slate-800 shadow-lg" : "text-slate-500"
adjustType === t.id ? "bg-slate-800 shadow-lg" : "text-muted"
)}
>
<t.icon size={20} className={adjustType === t.id ? t.color : ""} />
@@ -866,7 +866,7 @@ export default function Home() {
<div className="flex items-center gap-8">
<button
onClick={() => setAdjustQty(Math.max(1, adjustQty - 1))}
className="w-12 h-12 rounded-full border border-slate-800 flex items-center justify-center text-slate-400 active:bg-slate-800"
className="w-12 h-12 rounded-full border border-slate-800 flex items-center justify-center text-secondary active:bg-slate-800"
>
<Minus size={24} />
</button>
@@ -876,7 +876,7 @@ export default function Home() {
</div>
<button
onClick={() => setAdjustQty(adjustQty + 1)}
className="w-12 h-12 rounded-full border border-slate-800 flex items-center justify-center text-slate-400 active:bg-slate-800"
className="w-12 h-12 rounded-full border border-slate-800 flex items-center justify-center text-secondary active:bg-slate-800"
>
<Plus size={24} />
</button>
@@ -891,7 +891,7 @@ export default function Home() {
<select
value={trashReason}
onChange={(e) => setTrashReason(e.target.value)}
className="w-full bg-slate-950 border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-300"
className="w-full bg-background border border-slate-800 rounded-xl py-3 px-4 text-sm outline-none text-slate-300"
>
<option>Damaged</option>
<option>Expired</option>
@@ -929,15 +929,15 @@ export default function Home() {
{/* Box Contents Selection Modal */}
{boxMatches.length > 0 && !selectedItem && (
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-slate-950/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-slate-900 border border-slate-800 rounded-[2.5rem] shadow-2xl p-6 overflow-hidden animate-in slide-in-from-bottom-10 duration-300 flex flex-col max-h-[85vh]">
<div className="fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-background/80 animate-in fade-in duration-200">
<div className="w-full max-w-lg bg-surface border border-slate-800 rounded-[2.5rem] shadow-2xl p-6 overflow-hidden animate-in slide-in-from-bottom-10 duration-300 flex flex-col max-h-[85vh]">
<div className="flex justify-between items-center mb-6 shrink-0">
<div>
<h3 className="text-xl font-black tracking-tight flex items-center gap-2">
<Package className="text-primary" />
Box Contents
</h3>
<p className="text-xs text-slate-400 font-bold mt-1">Select the item you want to {mode.replace('_', ' ').toLowerCase()}</p>
<p className="text-xs text-secondary font-bold mt-1">Select the item you want to {mode.replace('_', ' ').toLowerCase()}</p>
</div>
<button onClick={() => setBoxMatches([])} className="p-2 hover:bg-slate-800 rounded-full">
<X size={20} />
@@ -952,13 +952,13 @@ export default function Home() {
setBoxMatches([]);
setAdjustType(mode === 'CHECK_IN' ? 'ADD' : 'REMOVE');
}}
className="w-full text-left bg-slate-950/50 hover:bg-slate-800 border border-slate-800/80 p-4 rounded-2xl flex items-center gap-4 transition-all active:scale-[0.98] group"
className="w-full text-left bg-background/50 hover:bg-slate-800 border border-slate-800/80 p-4 rounded-2xl flex items-center gap-4 transition-all active:scale-[0.98] group"
>
<div className="flex-1 min-w-0">
<p className="text-sm font-black text-white">{item.name}</p>
<p className="text-xs text-slate-400 font-bold mt-1">Part #: {item.part_number || 'N/A'}</p>
<p className="text-xs text-secondary font-bold mt-1">Part #: {item.part_number || 'N/A'}</p>
</div>
<ChevronRight size={18} className="text-slate-600 group-hover:text-primary" />
<ChevronRight size={18} className="text-secondary group-hover:text-primary" />
</button>
))}
</div>
@@ -971,7 +971,7 @@ export default function Home() {
<footer className="mt-20 mb-8 flex flex-col items-center gap-2 opacity-30">
<p className="text-xs font-bold">Powered by TFM Group Software</p>
<div className="h-px w-12 bg-slate-800" />
<p className="text-[11px] font-mono text-slate-500">v{versionData.version} {versionData.last_build} BUILD: dev-{(versionData as any).commit || 'N/A'}</p>
<p className="text-[11px] font-mono text-muted">v{versionData.version} {versionData.last_build} BUILD: dev-{(versionData as any).commit || 'N/A'}</p>
</footer>
</div>
</PageShell>