feat: comprehensive UI overhaul + budget allocation redesign

Audit & Quality:
- RTL: replaced 121 LTR-only utilities (text-left, pl-, left-) with logical properties
- A11y: focus traps + ARIA on Modal/SlidePanel/TabbedModal, clickable divs→buttons
- Theming: bg-white→bg-surface (170 instances), text-gray→semantic tokens
- Performance: useMemo on filters, loading="lazy" on 24 images
- CSS: prefers-reduced-motion, removed dead animations

Component Splits:
- PostDetailPanel: 1332→623 lines + 4 sub-components
- ArtefactDetailPanel: 972→590 lines + 1 sub-component

Brand Identity — Rawaj (رواج):
- New name, DM Sans font, deep teal palette (#0d9488)
- Custom SVG logo, forest-tinted dark mode
- All emails branded with app name in subject line

Design Refinement:
- Dashboard: merged posts+deadlines into tabbed ActivityFeed, inline stats
- Quieter: removed card lift, brand glow, gradient text, mesh backgrounds
- CampaignDetail: prominent budget card, compact team avatars, Lucide icons
- Consistent page titles via Header.jsx, standardized section headers
- Finance page fully i18n'd (20+ hardcoded strings replaced)

Budget Allocation Redesign:
- Single source of truth: BudgetEntries (Campaign.budget deprecated)
- Validation at all levels: main→campaign→track, expenses blocked if insufficient
- Budget request workflow with CEO approval via public link
- BudgetRequests table, CRUD routes, public approval page
- Budget mutex for race condition prevention
- Idempotent migration for existing campaign budgets

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
fahed
2026-03-15 15:36:19 +03:00
parent 3c857856c5
commit e1d1c392eb
77 changed files with 4351 additions and 2108 deletions
+90 -123
View File
@@ -1,16 +1,16 @@
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');
@import "tailwindcss";
@theme {
--font-sans: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
--color-sidebar: #0f172a;
--color-sidebar-hover: #1e293b;
--color-sidebar-active: #020617;
--color-brand-primary: #4f46e5;
--color-brand-primary-light: #6366f1;
--font-sans: 'DM Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
--color-sidebar: #0a1f1c;
--color-sidebar-hover: #123b35;
--color-sidebar-active: #061411;
--color-brand-primary: #0d9488;
--color-brand-primary-light: #14b8a6;
--color-brand-secondary: #db2777;
--color-brand-tertiary: #f59e0b;
--color-brand-quaternary: #059669;
--color-brand-quaternary: #0d9488;
--color-surface: #ffffff;
--color-surface-secondary: #f9fafb;
--color-surface-tertiary: #f3f4f6;
@@ -37,40 +37,39 @@
}
/* ═══════════════════════════════════════════════
DARK MODE — Inspired by SpaceTime
Deep layered surfaces, glass edges, ambient glow
DARK MODE — Forest teal tinted surfaces
═══════════════════════════════════════════════ */
.dark {
/* Layered depth: void → surface → surface-2surface-3 */
--color-surface: #15151e;
--color-surface-secondary: #1c1c2a;
--color-surface-tertiary: #24243a;
/* Layered depth: deep forest → surface → elevated */
--color-surface: #0f1a18;
--color-surface-secondary: #162220;
--color-surface-tertiary: #1e2e2b;
--color-border: rgba(255, 255, 255, 0.08);
--color-border-light: rgba(255, 255, 255, 0.04);
/* Text — crisp hierarchy */
--color-text-primary: #eeecf5;
--color-text-secondary: #a8a3c0;
--color-text-tertiary: #706b8a;
/* Text — warm neutrals, teal-tinted */
--color-text-primary: #e8f0ee;
--color-text-secondary: #9db5b0;
--color-text-tertiary: #637e78;
/* Sidebar */
--color-sidebar: #0e0e16;
--color-sidebar-hover: #15151e;
--color-sidebar-active: #0a0a12;
--color-sidebar: #0a1412;
--color-sidebar-hover: #0f1a18;
--color-sidebar-active: #060e0c;
/* Brand — brighter on dark */
--color-brand-primary: #8b5cf6;
--color-brand-primary-light: #a78bfa;
--color-brand-primary: #14b8a6;
--color-brand-primary-light: #2dd4bf;
color-scheme: dark;
background-color: #15151e;
color: #eeecf5;
background-color: #0f1a18;
color: #e8f0ee;
}
/* ─── Ambient background glow ────────────────── */
.dark .bg-mesh {
background-color: #15151e !important;
background-color: #0f1a18 !important;
background-image: none !important;
}
.dark .bg-mesh::before {
@@ -78,9 +77,8 @@
position: fixed;
inset: 0;
background:
radial-gradient(ellipse 70% 50% at 20% 50%, rgba(139, 92, 246, 0.045) 0%, transparent 60%),
radial-gradient(ellipse 50% 40% at 80% 30%, rgba(56, 189, 248, 0.03) 0%, transparent 60%),
radial-gradient(ellipse 60% 40% at 50% 90%, rgba(232, 168, 56, 0.02) 0%, transparent 60%);
radial-gradient(ellipse 70% 50% at 20% 50%, rgba(13, 148, 136, 0.04) 0%, transparent 60%),
radial-gradient(ellipse 50% 40% at 80% 30%, rgba(20, 184, 166, 0.025) 0%, transparent 60%);
pointer-events: none;
z-index: 0;
}
@@ -89,11 +87,11 @@
.dark .bg-white,
.dark .bg-\[\#fff\],
.dark .bg-\[\#ffffff\] {
background-color: #22223a !important;
background-color: #1a2a28 !important;
}
.dark .bg-gray-50 { background-color: #15151e !important; }
.dark .bg-gray-100 { background-color: #1c1c2a !important; }
.dark .bg-gray-200 { background-color: #24243a !important; }
.dark .bg-gray-50 { background-color: #0f1a18 !important; }
.dark .bg-gray-100 { background-color: #162220 !important; }
.dark .bg-gray-200 { background-color: #1e2e2b !important; }
/* ─── Borders ────────────────────────────────── */
.dark .border-gray-100,
@@ -104,12 +102,12 @@
.dark .divide-border-light > :not(:first-child) { border-color: rgba(255, 255, 255, 0.05) !important; }
/* ─── Text ───────────────────────────────────── */
.dark .text-gray-900 { color: #eeecf5 !important; }
.dark .text-gray-800 { color: #d8d5e8 !important; }
.dark .text-gray-700 { color: #c2bedb !important; }
.dark .text-gray-600 { color: #a8a3c0 !important; }
.dark .text-gray-500 { color: #8b85a8 !important; }
.dark .text-gray-400 { color: #706b8a !important; }
.dark .text-gray-900 { color: #e8f0ee !important; }
.dark .text-gray-800 { color: #d0ddd9 !important; }
.dark .text-gray-700 { color: #b5cac5 !important; }
.dark .text-gray-600 { color: #9db5b0 !important; }
.dark .text-gray-500 { color: #7e9a94 !important; }
.dark .text-gray-400 { color: #637e78 !important; }
/* ─── Status badges — translucent glass ──────── */
.dark .bg-emerald-100, .dark .bg-emerald-50 { background-color: rgba(74, 222, 128, 0.12) !important; }
@@ -150,49 +148,49 @@
.dark input:focus,
.dark select:focus,
.dark textarea:focus {
border-color: rgba(139, 92, 246, 0.5);
box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
border-color: rgba(20, 184, 166, 0.5);
box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}
.dark input::placeholder,
.dark textarea::placeholder {
color: #706b8a;
color: #637e78;
}
.dark input:disabled,
.dark select:disabled,
.dark textarea:disabled {
background-color: rgba(255, 255, 255, 0.02) !important;
color: #706b8a !important;
color: #637e78 !important;
opacity: 0.6;
}
/* Dark select arrow */
.dark select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23706b8a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23637e78' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}
/* ─── Cards — glass edges ────────────────────── */
.dark .card-hover {
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.3);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.dark .card-hover:hover {
box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.15), 0 16px 48px -12px rgba(0, 0, 0, 0.5);
box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.12), 0 4px 16px -4px rgba(0, 0, 0, 0.4);
}
.dark .section-card {
background: #1c1c2a;
background: #162220;
border-color: rgba(255, 255, 255, 0.06);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.dark .section-card:hover {
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 32px -8px rgba(0, 0, 0, 0.4);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 4px 16px -4px rgba(0, 0, 0, 0.3);
}
.dark .section-card-header {
background: linear-gradient(180deg, rgba(36, 36, 58, 0.5) 0%, #1c1c2a 100%);
background: rgba(30, 46, 43, 0.3);
}
/* ─── Sidebar ────────────────────────────────── */
.dark .sidebar {
background: linear-gradient(180deg, #0e0e16 0%, #0a0a12 100%);
background: linear-gradient(180deg, #0a1412 0%, #060e0c 100%);
box-shadow: 2px 0 24px rgba(0, 0, 0, 0.5);
}
@@ -216,22 +214,22 @@
.dark .hover\:bg-red-50:hover { background-color: rgba(251, 113, 133, 0.08) !important; }
.dark .hover\:bg-blue-100:hover { background-color: rgba(96, 165, 250, 0.08) !important; }
/* ─── Brand glow ─────────────────────────────── */
/* ─── Brand accent ────────────────────────────── */
.dark .bg-brand-primary {
box-shadow: 0 0 24px -4px rgba(139, 92, 246, 0.35);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.dark .bg-brand-primary:hover {
box-shadow: 0 0 32px -4px rgba(139, 92, 246, 0.45);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
/* ─── White/light text overrides on colored badges ── */
.dark .bg-white\/90 { background-color: rgba(28, 28, 42, 0.9) !important; }
.dark .bg-white\/90 { background-color: rgba(22, 34, 32, 0.9) !important; }
/* ─── Toasts — solid backgrounds, no transparency ── */
.dark .bg-emerald-50.border-emerald-200 { background-color: #132a1e !important; border-color: #1a4a2e !important; }
.dark .bg-red-50.border-red-200 { background-color: #2a1318 !important; border-color: #4a1a22 !important; }
.dark .bg-blue-50.border-blue-200 { background-color: #131d2a !important; border-color: #1a2e4a !important; }
.dark .bg-amber-50.border-amber-200 { background-color: #2a2213 !important; border-color: #4a3a1a !important; }
/* ─── Toasts — solid backgrounds ────────────────── */
.dark .bg-emerald-50.border-emerald-200 { background-color: #0f2a1e !important; border-color: #154a2e !important; }
.dark .bg-red-50.border-red-200 { background-color: #2a1315 !important; border-color: #4a1a20 !important; }
.dark .bg-blue-50.border-blue-200 { background-color: #0f1d2a !important; border-color: #152e4a !important; }
.dark .bg-amber-50.border-amber-200 { background-color: #2a2210 !important; border-color: #4a3a15 !important; }
.dark .text-emerald-800 { color: #6ee7b7 !important; }
.dark .text-red-800 { color: #fca5a5 !important; }
.dark .text-blue-800 { color: #93c5fd !important; }
@@ -239,10 +237,19 @@
/* ─── Selection ──────────────────────────────── */
.dark ::selection {
background: rgba(139, 92, 246, 0.4);
background: rgba(20, 184, 166, 0.4);
color: white;
}
/* Reduced motion — disable animations for accessibility */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 6px;
@@ -315,15 +322,15 @@ textarea {
margin-right: 0;
}
/* Enhanced sidebar with gradient */
/* Enhanced sidebar */
.sidebar {
background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
background: linear-gradient(180deg, #0a1f1c 0%, #061411 100%);
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}
/* Animation keyframes */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
from { opacity: 0; transform: translateY(4px); }
to { opacity: 1; transform: translateY(0); }
}
@@ -347,11 +354,6 @@ textarea {
50% { opacity: 0.7; }
}
@keyframes bounce-subtle {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-4px); }
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
@@ -425,29 +427,24 @@ textarea {
overflow: visible;
}
/* Stagger children */
/* Stagger children — short, max 4 items */
.stagger-children > * {
opacity: 0;
animation: fadeIn 0.3s ease-out forwards;
animation: fadeIn 0.2s ease-out forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 50ms; }
.stagger-children > *:nth-child(3) { animation-delay: 100ms; }
.stagger-children > *:nth-child(4) { animation-delay: 150ms; }
.stagger-children > *:nth-child(5) { animation-delay: 200ms; }
.stagger-children > *:nth-child(6) { animation-delay: 250ms; }
.stagger-children > *:nth-child(7) { animation-delay: 300ms; }
.stagger-children > *:nth-child(8) { animation-delay: 350ms; }
.stagger-children > *:nth-child(2) { animation-delay: 40ms; }
.stagger-children > *:nth-child(3) { animation-delay: 80ms; }
.stagger-children > *:nth-child(n+4) { animation-delay: 120ms; }
/* Card hover effect - smooth and elegant */
/* Card hover effect - refined, no lift */
.card-hover {
position: relative;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.06);
transition: box-shadow 0.2s ease;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.card-hover:hover {
transform: translateY(-3px);
box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.12), 0 6px 16px -8px rgba(0, 0, 0, 0.08);
box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}
/* Stat card accents - subtle colored top borders */
@@ -470,24 +467,12 @@ textarea {
opacity: 1;
}
/* Mesh background - subtle radial gradients */
/* Mesh background — flat, no gradients */
.bg-mesh {
background-color: #f8fafc;
background-image:
radial-gradient(at 20% 20%, rgba(79, 70, 229, 0.04) 0, transparent 50%),
radial-gradient(at 80% 40%, rgba(219, 39, 119, 0.03) 0, transparent 50%),
radial-gradient(at 40% 80%, rgba(5, 150, 105, 0.03) 0, transparent 50%);
}
/* Gradient text */
.text-gradient {
background: linear-gradient(135deg, var(--color-brand-primary) 0%, #7c3aed 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Premium stat card - always-visible gradient top bar */
/* Stat card accent — subtle top border, no gradient */
.stat-card-premium {
position: relative;
overflow: hidden;
@@ -498,20 +483,20 @@ textarea {
top: 0;
left: 0;
right: 0;
height: 3px;
opacity: 1;
height: 2px;
opacity: 0.6;
}
.stat-card-premium.accent-primary::before {
background: linear-gradient(90deg, #4f46e5, #7c3aed);
background: #0d9488;
}
.stat-card-premium.accent-secondary::before {
background: linear-gradient(90deg, #db2777, #ec4899);
background: #db2777;
}
.stat-card-premium.accent-tertiary::before {
background: linear-gradient(90deg, #f59e0b, #fbbf24);
background: #f59e0b;
}
.stat-card-premium.accent-quaternary::before {
background: linear-gradient(90deg, #059669, #34d399);
background: #059669;
}
/* Section card - premium container */
@@ -524,20 +509,19 @@ textarea {
transition: box-shadow 0.3s ease;
}
.section-card:hover {
box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.08);
box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.06);
}
.section-card-header {
padding: 1rem 1.25rem;
border-bottom: 1px solid var(--color-border);
background: linear-gradient(180deg, rgba(249, 250, 251, 0.5) 0%, white 100%);
}
/* Sidebar active glow */
.sidebar-active-glow {
box-shadow: inset 3px 0 0 rgba(129, 140, 248, 0.8);
box-shadow: inset 3px 0 0 rgba(20, 184, 166, 0.8);
}
[dir="rtl"] .sidebar-active-glow {
box-shadow: inset -3px 0 0 rgba(129, 140, 248, 0.8);
box-shadow: inset -3px 0 0 rgba(20, 184, 166, 0.8);
}
/* Refined button styles */
@@ -594,23 +578,6 @@ select:not(:disabled):hover {
grid-template-columns: repeat(7, 1fr);
}
/* Ripple effect on buttons (optional enhancement) */
@keyframes ripple {
0% {
transform: scale(0);
opacity: 0.5;
}
100% {
transform: scale(2.5);
opacity: 0;
}
}
/* Badge pulse animation */
.badge-pulse {
animation: pulse-subtle 2s ease-in-out infinite;
}
/* Smooth height transitions */
.transition-height {
transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);