feat: modernize UI/UX to 2026 US fintech standard, add violet AI accents, and strengthen security controls

- Modern 2026 US fintech visual redesign across User & Admin Dashboards, Marketing pages, Auth screens, and Layouts
- Introduced violet accent (#6D28D9 / #8B5CF6) strictly dedicated to AI capabilities (AI Daily Briefing, AI Assistant, Chatbot FAB & Chat UI)
- Motion system respecting prefers-reduced-motion and (hover: none) with GPU-accelerated transforms & opacities
- High-resolution dark glass monogram logo mark with upward growth motif
- Backend security enhancements: strict MIME-type sniffing validation, admin assignment scoping assertions, safe document deletion handling
- Nginx strict Content-Security-Policy (CSP) headers and favicon routing
This commit is contained in:
Atharv1705
2026-11-03 14:07:35 +05:30
parent b7c935df5a
commit 5703fbb27f
53 changed files with 8495 additions and 1813 deletions
+9 -3
View File
@@ -2,16 +2,22 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/webp" href="/images/bookkeeppro-logo.webp" />
<link rel="icon" type="image/webp" href="/images/brand-logo-mark.webp" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="BookKeepPro &mdash; Professional bookkeeping, payroll and tax preparation services for growing businesses across the US and India. 27 years of accounting excellence." />
<title>BookKeepPro &mdash; Bookkeeping, Payroll &amp; Tax Services</title>
<meta name="description" content="ABC CPA &amp; Advisory &mdash; Professional tax strategy, international FBAR compliance, and AI accounting services for high-growth businesses and global founders." />
<title>ABC CPA &mdash; Tax Advisory, International Tax &amp; Fractional CFO</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500;1,600&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link rel="stylesheet" href="/css/base.css"/>
<link rel="stylesheet" href="/css/components.css"/>
<link rel="stylesheet" href="/css/marketing.css"/>
<link rel="stylesheet" href="/css/chatbot.css" />
<link rel="stylesheet" href="/css/animations.css" />
<link rel="stylesheet" href="/css/dynamic.css" />
<link rel="stylesheet" href="/css/artha-motion.css" />
<link rel="stylesheet" href="/css/dashboard.css" />
</head>
<body>
<div id="root"></div>
+2 -1
View File
@@ -7,7 +7,8 @@
"dev": "vite",
"build": "vite build",
"lint": "oxlint",
"preview": "vite preview"
"preview": "vite preview",
"serve": "vite build && vite preview"
},
"dependencies": {
"axios": "^1.18.1",
+4 -4
View File
@@ -10,8 +10,8 @@
.btn:active { transform: translateY(1px) scale(0.97); }
@keyframes pulse-brass {
0%, 100% { box-shadow: 0 0 0 0 rgba(176,128,61,0.35); }
50% { box-shadow: 0 0 0 5px rgba(176,128,61,0); }
0%, 100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.35); }
50% { box-shadow: 0 0 0 5px rgba(29, 78, 216, 0); }
}
.pulse { animation: pulse-brass 2s infinite; }
@@ -25,14 +25,14 @@
.stagger > *:nth-child(5) { animation-delay: 0.24s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }
input[type=checkbox] { accent-color: var(--emerald); width: 16px; height: 16px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--brass); width: 16px; height: 16px; cursor: pointer; }
/* Ledger-rule underline — the signature link treatment: a brass
rule draws itself in, like a line struck under a checked entry */
.fancy-link {
position: relative;
text-decoration: none;
color: var(--emerald);
color: var(--brass);
}
.fancy-link::after {
content: '';
+329
View File
@@ -0,0 +1,329 @@
/* ============================================================
artha-motion.css · motion layer for the ABC CPA "Ledger" UI
Load AFTER dynamic.css in index.html:
<link rel="stylesheet" href="/css/artha-motion.css" />
Motion language: calm, precise, "a ledger line being drawn".
- one easing curve (expo-out), 200-700ms, no bounce
- gold rule draws under / over things that matter
- only transform + opacity are animated
Palette (matches base.css):
ink #0A2540 · blue #1D4ED8 · emerald #047857 · page #F6F9FC
============================================================ */
/* ---------- 1. Fix colour drift (dynamic.css still uses the OLD palette) ---------- */
:root {
--ink-rgb: 10, 37, 64;
--green-rgb: 29, 78, 216;
--gold-rgb: 245, 184, 61;
--brass-rgb: 245, 184, 61;
/* brass token override */
--emerald-rgb: 4, 120, 87;
/* emerald token override */
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
/* shadows tinted with ink */
--shadow-xs: 0 1px 2px 0 rgba(var(--ink-rgb), 0.06);
--shadow-sm: 0 4px 10px -2px rgba(var(--ink-rgb), 0.10);
--shadow-md: 0 12px 28px -8px rgba(var(--ink-rgb), 0.16);
--shadow-lg: 0 24px 56px -12px rgba(var(--ink-rgb), 0.22);
--shadow-glow: 0 0 0 6px rgba(29, 78, 216, 0.16);
}
::selection {
background: rgba(29, 78, 216, 0.20);
color: #0A2540;
}
.scroll-progress {
background: linear-gradient(90deg, #1D4ED8, #14B8A6);
}
/* ---------- 2. Shared keyframes ---------- */
@keyframes arthaRise {
from {
opacity: 0;
transform: translateY(18px);
}
}
@keyframes arthaPop {
from {
opacity: 0;
transform: scale(0.85);
}
}
@keyframes arthaRule {
to {
background-size: 100% 2px;
}
}
@keyframes arthaDrift {
from {
transform: translate3d(-3%, -2%, 0) scale(1);
}
to {
transform: translate3d(3%, 2%, 0) scale(1.1);
}
}
/* ---------- 3. Navbar: shadow + gold hairline on scroll, gold underline on links ---------- */
.artha-navbar {
transition: box-shadow 0.3s, border-color 0.3s, background-color 0.3s;
}
html[data-scrolled] .artha-navbar {
box-shadow: 0 10px 30px -18px rgba(var(--ink-rgb), 0.45);
border-bottom-color: rgba(29, 78, 216, 0.35);
}
.artha-nav-links>a {
position: relative;
}
.artha-nav-links>a::after {
content: '';
position: absolute;
left: 0;
right: 0;
bottom: -6px;
height: 1.5px;
background: #1D4ED8;
transform: scaleX(0);
transform-origin: left;
transition: transform 0.35s var(--ease-out);
}
.artha-nav-links>a:hover::after {
transform: scaleX(1);
}
/* ---------- 4. Hero: staged entrance, gold rule under the italic word, ambient light ---------- */
.artha-hero {
position: relative;
isolation: isolate;
}
.artha-hero::before {
content: '';
position: absolute;
inset: 0;
z-index: -1;
pointer-events: none;
background:
radial-gradient(50% 55% at 12% 25%, rgba(20, 184, 166, 0.14), transparent 70%),
radial-gradient(45% 60% at 90% 85%, rgba(29, 78, 216, 0.16), transparent 70%);
animation: arthaDrift 22s ease-in-out infinite alternate;
}
.artha-hero-left>* {
animation: arthaRise 0.9s var(--ease-out) backwards;
}
.artha-hero-left> :nth-child(1) {
animation-delay: 0.05s;
}
.artha-hero-left> :nth-child(2) {
animation-delay: 0.15s;
}
.artha-hero-left> :nth-child(3) {
animation-delay: 0.28s;
}
.artha-hero-left> :nth-child(4) {
animation-delay: 0.40s;
}
.artha-hero-left> :nth-child(n+5) {
animation-delay: 0.52s;
}
.artha-hero-right {
animation: arthaRise 1.1s 0.3s var(--ease-out) backwards;
}
.artha-hero-title em {
font-style: italic;
background: var(--gradient-brand);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
font-weight: 600;
}
/* ---------- 5. Cards: lift + gold top-edge rule that draws on hover ---------- */
:is(.artha-portal-card, .artha-vault-card, .artha-ticker-card, .artha-trust-item, .artha-firm-stat-pill) {
position: relative;
}
:is(.artha-portal-card, .artha-vault-card, .artha-ticker-card)::after {
content: '';
position: absolute;
left: 18px;
right: 18px;
top: -1px;
height: 2px;
border-radius: 2px;
background: linear-gradient(90deg, #1D4ED8, #14B8A6);
transform: scaleX(0);
transform-origin: left;
pointer-events: none;
transition: transform 0.5s var(--ease-out);
}
:is(.artha-portal-card, .artha-vault-card, .artha-ticker-card):hover::after {
transform: scaleX(1);
}
:is(.artha-vault-card, .artha-ticker-card) {
transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
}
:is(.artha-vault-card, .artha-ticker-card):hover {
transform: translateY(-4px);
box-shadow: var(--shadow-md);
}
.artha-portal-card:hover {
transform: translateY(-2px);
}
/* pointer spotlight (needs the one-line SPOT change in motion.js) */
:is(.artha-portal-card, .artha-vault-card, .artha-ticker-card):hover {
background-image: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(29, 78, 216, 0.08), transparent 62%);
}
/* ---------- 6. Buttons: gold sheen on primary, soft press ---------- */
.artha-pill-btn {
position: relative;
overflow: hidden;
transition: transform 0.2s var(--ease-out), box-shadow 0.25s, background-color 0.25s, color 0.25s, border-color 0.25s;
}
.artha-pill-btn:not(:disabled):hover {
transform: translateY(-1px);
}
.artha-pill-btn:not(:disabled):active {
transform: translateY(1px) scale(0.97);
}
.artha-pill-primary::before {
content: '';
position: absolute;
inset: 0;
pointer-events: none;
background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
transform: translateX(-130%);
transition: transform 0.8s var(--ease-out);
}
.artha-pill-primary:not(:disabled):hover::before {
transform: translateX(130%);
}
/* ---------- 7. Status pills pop in (once) ---------- */
.artha-status-pill {
animation: arthaPop 0.45s var(--ease-out) backwards;
}
/* ---------- 8. Grids: children rise in as they scroll into view ---------- */
:is(.artha-vault-grid, .artha-ticker-cards, .artha-trust-inner, .artha-firm-stats-row, .artha-calc-option-grid)>* {
animation: arthaRise 0.7s var(--ease-out) backwards;
}
:is(.artha-vault-grid, .artha-ticker-cards, .artha-trust-inner, .artha-firm-stats-row, .artha-calc-option-grid)> :nth-child(2) {
animation-delay: 0.08s;
}
:is(.artha-vault-grid, .artha-ticker-cards, .artha-trust-inner, .artha-firm-stats-row, .artha-calc-option-grid)> :nth-child(3) {
animation-delay: 0.16s;
}
:is(.artha-vault-grid, .artha-ticker-cards, .artha-trust-inner, .artha-firm-stats-row, .artha-calc-option-grid)> :nth-child(4) {
animation-delay: 0.24s;
}
:is(.artha-vault-grid, .artha-ticker-cards, .artha-trust-inner, .artha-firm-stats-row, .artha-calc-option-grid)> :nth-child(n+5) {
animation-delay: 0.30s;
}
/* Where supported, tie the rise to scroll position instead of page load, so
below-the-fold grids animate when the visitor actually reaches them.
fill-mode stays `backwards` so hover transforms still work afterwards. */
@supports (animation-timeline: view()) {
:is(.artha-vault-grid, .artha-ticker-cards, .artha-trust-inner, .artha-firm-stats-row, .artha-calc-option-grid)>* {
animation-timing-function: linear;
animation-delay: 0s;
animation-timeline: view();
animation-range: entry 0% entry 55%;
}
}
/* principle rows: number tints gold, row nudges right */
.artha-principle-row {
transition: padding-left 0.35s var(--ease-out);
}
.artha-principle-row:hover {
padding-left: 8px;
}
.artha-principle-row:hover .artha-principle-num {
color: #1D4ED8;
}
.artha-principle-num {
transition: color 0.3s;
}
/* ---------- 9. Upload dropzone (add class `is-dragover` from JS on dragenter / dragover) ---------- */
.artha-dropzone {
transition: border-color 0.25s, background-color 0.25s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.artha-dropzone:hover .material-symbols-outlined {
transform: translateY(-3px);
}
.artha-dropzone .material-symbols-outlined {
transition: transform 0.3s var(--ease-out);
display: inline-block;
}
.artha-dropzone.is-dragover {
border-style: solid;
border-color: #1D4ED8;
background-color: rgba(29, 78, 216, 0.08);
transform: scale(1.012);
box-shadow: var(--shadow-glow);
}
/* ---------- 10. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
.artha-hero::before {
animation: none;
}
:is(.artha-vault-grid, .artha-ticker-cards, .artha-trust-inner, .artha-firm-stats-row, .artha-calc-option-grid)>* {
animation: none;
}
}
@media (max-width: 768px) {
.artha-hero::before {
animation: none;
}
}
@media (hover: none) {
:is(.artha-portal-card, .artha-vault-card, .artha-ticker-card):hover {
background-image: none;
transform: none;
}
}
+77 -67
View File
@@ -1,6 +1,3 @@
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,1,0');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');
/* ============================================================
base.css — BookKeepPro Design System · "Ledger"
Ink, brass and parchment — a bookkeeping identity built on
@@ -11,42 +8,55 @@
/* ── Brand Tokens ─────────────────────────────────────────── */
:root {
/* core palette */
--ink: #17211D;
--ink-soft: #2A362F;
--brass: #8F6528;
--brass-dark: #8F6528;
--brass-light: rgba(176, 128, 61, 0.12);
--emerald: #1F5D46;
--emerald-dark: #163F30;
--emerald-light:rgba(31, 93, 70, 0.10);
--paper: #F5F2E9;
--ink: #0A2540;
--ink-soft: #14365F;
--brass: #1D4ED8;
--brass-dark: #1E40AF;
--brass-light: rgba(29, 78, 216, 0.08);
--emerald: #047857;
--emerald-dark: #065F46;
--emerald-light:rgba(4, 120, 87, 0.08);
--paper: #F6F9FC;
--paper-raised: #FFFFFF;
/* legacy variable names kept so every existing component re-skins automatically */
--blue: var(--emerald);
--blue-dark: var(--emerald-dark);
--blue-light: var(--emerald-light);
--orange: var(--brass);
--orange-dark: var(--brass-dark);
--orange-light: var(--brass-light);
--header-bg: #EFEADA;
--footer-bot: #EFEADA;
--navy: var(--ink);
--accent: #2C7A5B;
--blue: var(--brass);
--blue-dark: var(--brass-dark);
--blue-light: var(--brass-light);
--blue-bright: #3B82F6;
--sky: #0EA5E9;
--teal: #14B8A6;
--amber-text: #92600A;
--orange: #F5B83D;
--orange-dark: #D99A1E;
--orange-light: rgba(245, 184, 61, 0.12);
--header-bg: #EEF3F9;
--footer-bot: #EEF3F9;
--navy: #0A2540;
--accent: #1D4ED8;
--bg: var(--paper);
--card: var(--paper-raised);
--muted: #6B7268;
--border: #E3DDC9;
--success: #1F5D46;
--success-bg: rgba(31, 93, 70, 0.10);
--error: #A63A3A;
--error-bg: rgba(166, 58, 58, 0.10);
--warn: #8F6528;
--warn-bg: rgba(176, 128, 61, 0.12);
--muted: #425466;
--border: #E2E8F0;
--success: #047857;
--success-bg: #ECFDF5;
--error: #DC2626;
--error-bg: #FEF2F2;
--warn: #F5B83D;
--warn-bg: #FFF8E6;
--violet: #6D28D9;
--violet-bright:#8B5CF6;
--violet-light: #F5F3FF;
--violet-soft: #C4B5FD;
--font-display: 'Fraunces', 'Georgia', serif;
--font-body: 'IBM Plex Sans', system-ui, sans-serif;
--font-mono: 'IBM Plex Mono', ui-monospace, monospace;
--gradient-brand: linear-gradient(135deg, #1D4ED8 0%, #0EA5E9 60%, #14B8A6 100%);
--gradient-ai: linear-gradient(135deg, #6D28D9 0%, #1D4ED8 100%);
--gradient-success: linear-gradient(135deg, #047857 0%, #14B8A6 100%);
--gradient-warm: linear-gradient(135deg, #F5B83D 0%, #D99A1E 100%);
--font-display: 'Playfair Display', Georgia, serif;
--font-body: 'Inter', system-ui, -apple-system, sans-serif;
--font-mono: 'JetBrains Mono', ui-monospace, monospace;
--radius-xs: 6px;
--radius-sm: 10px;
@@ -54,11 +64,11 @@
--radius-lg: 22px;
--radius-pill: 999px;
--shadow-xs: 0 1px 2px 0 rgba(23, 33, 29, 0.06);
--shadow-sm: 0 4px 10px -2px rgba(23, 33, 29, 0.10);
--shadow-md: 0 12px 28px -8px rgba(23, 33, 29, 0.16);
--shadow-lg: 0 24px 56px -12px rgba(23, 33, 29, 0.22);
--shadow-glow: 0 0 0 6px rgba(176, 128, 61, 0.14);
--shadow-xs: 0 1px 2px 0 rgba(10, 37, 64, 0.06);
--shadow-sm: 0 4px 10px -2px rgba(10, 37, 64, 0.10);
--shadow-md: 0 12px 28px -8px rgba(10, 37, 64, 0.16);
--shadow-lg: 0 24px 56px -12px rgba(10, 37, 64, 0.22);
--shadow-glow: 0 0 0 6px rgba(29, 78, 216, 0.14);
--transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
--glass-blur: blur(14px);
@@ -67,14 +77,14 @@
to bottom,
transparent 0,
transparent 27px,
rgba(23, 33, 29, 0.05) 27px,
rgba(23, 33, 29, 0.05) 28px
rgba(10, 37, 64, 0.05) 27px,
rgba(10, 37, 64, 0.05) 28px
);
}
/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
html { font-size: 14px; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
html { scroll-behavior: auto; }
*, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
@@ -87,18 +97,18 @@ body {
-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--emerald-dark); }
a { color: var(--brass); text-decoration: none; }
a:hover { color: var(--brass-dark); }
.material-symbols-outlined { font-size: inherit; vertical-align: middle; line-height: 1; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.tnum { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }
h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: clamp(19px, 2.6vw, 26px); font-weight: 600; line-height: 1.25; }
h3 { font-size: clamp(16px, 2vw, 19px); font-weight: 600; }
p { line-height: 1.7; color: #3E463F; }
small, .text-sm { font-size: 13px; color: var(--muted); }
h1 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; line-height: 1.18; letter-spacing: -0.015em; }
h2 { font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; line-height: 1.25; }
h3 { font-size: clamp(15px, 1.3vw, 18px); font-weight: 600; }
p { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
small, .text-sm { font-size: 12px; color: var(--muted); }
.text-muted { color: var(--muted); }
.eyebrow {
font-family: var(--font-mono);
@@ -145,10 +155,10 @@ small, .text-sm { font-size: 13px; color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brass); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brass-dark); box-shadow: 0 6px 18px rgba(176,128,61,0.32); }
.btn-primary:hover:not(:disabled) { background: var(--brass-dark); box-shadow: 0 6px 18px rgba(29, 78, 216, 0.28); }
.btn-secondary { background: var(--emerald); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: var(--emerald-dark); box-shadow: 0 6px 18px rgba(31,93,70,0.28); }
.btn-secondary { background: var(--header-bg); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--border); box-shadow: 0 4px 12px rgba(10, 37, 64, 0.08); }
.btn-outline {
background: transparent;
@@ -158,10 +168,10 @@ small, .text-sm { font-size: 13px; color: var(--muted); }
.btn-outline:hover:not(:disabled) { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); color: var(--ink); border-color: #cfc7ad; }
.btn-ghost:hover:not(:disabled) { background: var(--paper); color: var(--ink); border-color: var(--border); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8a2f2f; box-shadow: 0 6px 18px rgba(166,58,58,0.3); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; box-shadow: 0 6px 18px rgba(220, 38, 38, 0.3); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-xs { padding: 5px 12px; font-size: 12px; }
@@ -181,10 +191,10 @@ small, .text-sm { font-size: 13px; color: var(--muted); }
}
.input:focus, .select-input:focus {
outline: none;
border-color: var(--emerald);
box-shadow: 0 0 0 3px rgba(31,93,70,0.12);
border-color: var(--brass);
box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
.input::placeholder { color: #A8A190; }
.input::placeholder { color: var(--muted); }
.input[readonly] { background: var(--paper); color: var(--muted); cursor: default; }
label.form-label { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-soft); margin-bottom: 6px; }
.form-group { margin-bottom: 18px; }
@@ -192,7 +202,7 @@ label.form-label { display: block; font-size: 12.5px; font-weight: 600; letter-s
.password-wrap .input { padding-right: 56px; }
.password-toggle {
position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
background: none; border: none; color: var(--emerald); font-weight: 600; font-size: 13px; cursor: pointer;
background: none; border: none; color: var(--brass); font-weight: 600; font-size: 13px; cursor: pointer;
}
/* ── Badges ──────────────────────────────────────────────── */
@@ -203,17 +213,17 @@ label.form-label { display: block; font-size: 12.5px; font-weight: 600; letter-s
white-space: nowrap;
font-family: var(--font-mono);
}
.badge-blue { background: var(--emerald-light); color: var(--emerald); }
.badge-orange { background: var(--brass-light); color: var(--brass-dark); border: 1px solid rgba(176,128,61,0.35); }
.badge-blue { background: #EFF6FF; color: #1D4ED8; }
.badge-orange { background: #FFF8E6; color: #92600A; border: 1px solid rgba(245, 184, 61, 0.35); }
.badge-red { background: var(--error-bg); color: var(--error); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-yellow { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(176,128,61,0.3); }
.badge-yellow { background: #FFF8E6; color: #92600A; border: 1px solid rgba(245, 184, 61, 0.3); }
.badge-muted { background: var(--paper); color: var(--muted); }
/* ── Status Pills (doc review) ───────────────────────────── */
.pill-approved { background:var(--success-bg); color:var(--success); border:1px solid rgba(31,93,70,0.3); padding:2px 10px; border-radius:var(--radius-xs); font-size:11px; font-weight:700; font-family: var(--font-mono); }
.pill-rejected { background:var(--error-bg); color:var(--error); border:1px solid rgba(166,58,58,0.3); padding:2px 10px; border-radius:var(--radius-xs); font-size:11px; font-weight:700; font-family: var(--font-mono); }
.pill-pending { background:var(--warn-bg); color:var(--brass-dark); border:1px solid rgba(176,128,61,0.3); padding:2px 10px; border-radius:var(--radius-xs); font-size:11px; font-weight:700; font-family: var(--font-mono); }
.pill-approved { background:var(--success-bg); color:var(--success); border:1px solid rgba(4, 120, 87, 0.25); padding:2px 10px; border-radius:var(--radius-xs); font-size:11px; font-weight:700; font-family: var(--font-mono); }
.pill-rejected { background:var(--error-bg); color:var(--error); border:1px solid rgba(220, 38, 38, 0.25); padding:2px 10px; border-radius:var(--radius-xs); font-size:11px; font-weight:700; font-family: var(--font-mono); }
.pill-pending { background:var(--warn-bg); color:var(--amber-text); border:1px solid rgba(245, 184, 61, 0.3); padding:2px 10px; border-radius:var(--radius-xs); font-size:11px; font-weight:700; font-family: var(--font-mono); }
/* ── Divider ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
@@ -249,7 +259,7 @@ label.form-label { display: block; font-size: 12.5px; font-weight: 600; letter-s
to { background-position: 600px 0; }
}
.skeleton {
background: linear-gradient(90deg, #EDE8D9 25%, #F5F2E9 50%, #EDE8D9 75%);
background: linear-gradient(90deg, #E2E8F0 25%, #EDF2F7 50%, #E2E8F0 75%);
background-size: 600px 100%;
animation: shimmer 1.4s infinite linear;
border-radius: var(--radius-sm);
@@ -277,7 +287,7 @@ label.form-label { display: block; font-size: 12.5px; font-weight: 600; letter-s
/* Focus visibility */
:focus-visible {
outline: 2px solid var(--emerald);
outline: 2px solid var(--brass);
outline-offset: 2px;
}
@@ -289,8 +299,8 @@ input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
outline: none;
border-color: var(--emerald) !important;
box-shadow: 0 0 0 3px rgba(31,93,70,0.14) !important;
border-color: var(--brass) !important;
box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14) !important;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
+90 -62
View File
@@ -9,19 +9,22 @@
width: 56px;
height: 56px;
border-radius: 50%;
background: var(--ink);
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.14);
background: var(--gradient-ai);
color: #FFFFFF;
border: 1px solid rgba(255, 255, 255, 0.25);
cursor: pointer;
box-shadow: var(--shadow-lg);
box-shadow: 0 10px 28px -8px rgba(109, 40, 217, 0.55);
display: flex;
align-items: center;
justify-content: center;
font-size: 26px;
z-index: 9998;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, background 0.3s ease;
transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.chatbot-fab:hover {
transform: scale(1.07);
box-shadow: 0 12px 32px -6px rgba(109, 40, 217, 0.65);
}
.chatbot-fab:hover { transform: scale(1.07); background: var(--emerald-dark); }
.chatbot-fab:active { transform: scale(0.96); }
.chatbot-fab .fab-icon { transition: transform 0.3s ease; }
.chatbot-fab.open .fab-icon { transform: rotate(90deg); }
@@ -31,29 +34,38 @@
position: absolute;
inset: -4px;
border-radius: 50%;
border: 1.5px solid var(--brass);
border: 1.5px solid var(--violet-bright, #8B5CF6);
opacity: 0;
animation: chatPulse 2.5s ease-out infinite;
animation: chatPulse 6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.chatbot-fab.open::before { animation: none; opacity: 0; }
@keyframes chatPulse {
0% { transform: scale(1); opacity: 0.45; }
100% { transform: scale(1.4); opacity: 0; }
0% { transform: scale(1); opacity: 0.5; }
20% { transform: scale(1.35); opacity: 0; }
100% { transform: scale(1.35); opacity: 0; }
}
.chatbot-fab .notif-dot {
position: absolute;
top: 2px; right: 2px;
width: 13px; height: 13px;
width: 12px; height: 12px;
border-radius: 50%;
background: var(--brass);
border: 2px solid var(--ink);
animation: dotBounce 1.5s ease infinite;
background: #F5B83D;
border: 2px solid #0A2540;
}
.chatbot-fab.open .notif-dot { display: none; }
@keyframes dotBounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes chatbotWindowOpen {
from {
opacity: 0;
transform: scale(0.96);
}
to {
opacity: 1;
transform: scale(1);
}
}
.chatbot-window {
position: fixed;
@@ -61,25 +73,39 @@
right: 24px;
width: 380px;
max-height: 520px;
border-radius: var(--radius-lg);
border-radius: var(--radius-lg, 16px);
background: #FFFFFF;
border: 1px solid var(--border);
box-shadow: var(--shadow-lg);
border: 1px solid var(--border, #E2E8F0);
box-shadow: 0 12px 36px -8px rgba(10, 37, 64, 0.16);
display: flex;
flex-direction: column;
z-index: 9999;
overflow: hidden;
opacity: 0;
transform: translateY(16px) scale(0.97);
transform: scale(0.96);
transform-origin: bottom right;
pointer-events: none;
transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.chatbot-window.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.chatbot-window.visible {
opacity: 1;
transform: scale(1);
transform-origin: bottom right;
pointer-events: auto;
animation: chatbotWindowOpen 250ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@media (prefers-reduced-motion: reduce) {
.chatbot-window.visible {
animation: none !important;
}
.chatbot-fab::before {
animation: none !important;
}
}
.chatbot-header {
background: var(--ink);
background-image: var(--ruled);
color: #fff;
background: var(--ink, #0A2540);
color: #FFFFFF;
padding: 16px 18px;
display: flex;
align-items: center;
@@ -88,14 +114,14 @@
}
.chatbot-header .bot-avatar {
width: 36px; height: 36px; border-radius: 50%;
background: var(--brass);
background: var(--gradient-ai);
display: flex; align-items: center; justify-content: center;
font-size: 18px; flex-shrink: 0; color: #fff;
font-size: 18px; flex-shrink: 0; color: #FFFFFF;
}
.chatbot-header .bot-info h4 { font-size: 14px; font-weight: 600; margin: 0; color: #fff; font-family: var(--font-body); }
.chatbot-header .bot-info span { font-size: 11px; opacity: 0.75; }
.chatbot-header .bot-info h4 { font-size: 14px; font-weight: 600; margin: 0; color: #FFFFFF; font-family: var(--font-body); }
.chatbot-header .bot-info span { font-size: 11px; opacity: 0.8; color: #C4B5FD; }
.chatbot-header .close-chat {
margin-left: auto; background: rgba(255,255,255,0.12); border: none; color: #fff;
margin-left: auto; background: rgba(255,255,255,0.12); border: none; color: #FFFFFF;
width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 15px;
display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
@@ -104,78 +130,80 @@
.chatbot-messages {
flex: 1; overflow-y: auto; padding: 22px 18px;
display: flex; flex-direction: column; gap: 12px;
background: var(--paper);
background: #F6F9FC;
min-height: 200px; max-height: 380px; scroll-behavior: smooth;
}
.chatbot-welcome-text {
display: flex; align-items: center; justify-content: center; gap: 8px;
margin-bottom: 8px; padding: 10px;
background: var(--emerald-light);
border-radius: var(--radius-sm);
border: 1px solid rgba(31,93,70,0.15);
background: #F5F3FF;
border-radius: var(--radius-sm, 10px);
border: 1px solid rgba(109, 40, 217, 0.16);
}
.chatbot-welcome-text p { font-size: 13px; font-weight: 500; color: var(--ink); margin: 0; }
.chatbot-welcome-text .sparkle { font-size: 17px; color: var(--brass); }
.chatbot-welcome-text p { font-size: 13px; font-weight: 500; color: var(--ink, #0A2540); margin: 0; }
.chatbot-welcome-text .sparkle { font-size: 17px; color: var(--violet, #6D28D9); }
.chatbot-messages::-webkit-scrollbar { width: 5px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #d8d0b6; border-radius: 10px; }
.chatbot-messages::-webkit-scrollbar-thumb { background: var(--border, #E2E8F0); border-radius: 10px; }
.chat-msg {
max-width: 85%; padding: 10px 14px; border-radius: 13px;
font-size: 13px; line-height: 1.5; animation: msgSlideIn 0.3s ease; word-wrap: break-word;
font-size: 13px; line-height: 1.5; animation: msgSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1); word-wrap: break-word;
}
@keyframes msgSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes msgSlideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.bot {
background: #fff; color: var(--ink); border: 1px solid var(--border);
background: #FFFFFF; color: var(--ink, #0A2540); border: 1px solid var(--border, #E2E8F0);
border-left: 2px solid var(--violet, #6D28D9);
border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: var(--shadow-xs);
}
.chat-msg.user {
background: var(--emerald); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end;
background: #1D4ED8; color: #FFFFFF; border-bottom-right-radius: 4px; align-self: flex-end;
}
.typing-indicator { display: flex; gap: 4px; padding: 12px 16px; align-self: flex-start; }
.typing-indicator span { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); opacity: 0.4; animation: typingDot 1.2s ease-in-out infinite; }
.typing-indicator span { width: 7px; height: 7px; border-radius: 50%; background: var(--violet, #6D28D9); opacity: 0.4; animation: typingDot 1.2s ease-in-out infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }
.quick-replies { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.quick-reply-btn {
background: #fff; border: 1.5px solid var(--border); color: var(--ink);
padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
cursor: pointer; text-align: left; transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
background: #fff; border: 1.5px solid var(--border, #E2E8F0); color: var(--ink, #0A2540);
padding: 11px 15px; border-radius: var(--radius-sm, 10px); font-size: 13.5px; font-weight: 500;
cursor: pointer; text-align: left; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
font-family: inherit; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-xs);
}
.quick-reply-btn:hover { background: var(--emerald-light); border-color: var(--emerald); color: var(--emerald-dark); transform: translateY(-1px); }
.quick-reply-btn:hover { background: #F5F3FF; border-color: rgba(109, 40, 217, 0.4); color: var(--violet, #6D28D9); transform: translateY(-1px); }
.quick-reply-btn .qr-icon { font-size: 16px; flex-shrink: 0; }
.doc-status-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 10px 12px; margin-top: 6px; font-size: 12px; }
.doc-status-card .doc-name { font-weight: 600; color: var(--ink); margin-bottom: 4px; font-size: 13px; }
.doc-status-card .doc-year { color: var(--muted); font-size: 11px; }
.doc-status-card .doc-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-xs); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; font-family: var(--font-mono); }
.doc-badge.pending { background: var(--warn-bg); color: var(--brass-dark); }
.doc-badge.approved { background: var(--success-bg); color: var(--success); }
.doc-badge.rejected { background: var(--error-bg); color: var(--error); }
.doc-status-card .doc-note { margin-top: 4px; color: var(--muted); font-style: italic; font-size: 11px; }
.doc-status-card { background: #fff; border: 1px solid var(--border, #E2E8F0); border-radius: var(--radius-xs, 6px); padding: 10px 12px; margin-top: 6px; font-size: 12px; }
.doc-status-card .doc-name { font-weight: 600; color: var(--ink, #0A2540); margin-bottom: 4px; font-size: 13px; }
.doc-status-card .doc-year { color: var(--muted, #425466); font-size: 11px; }
.doc-status-card .doc-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-xs, 6px); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; font-family: var(--font-mono); }
.doc-badge.pending { background: #FFF8E6; color: #92600A; }
.doc-badge.approved { background: #ECFDF5; color: #047857; }
.doc-badge.rejected { background: #FEF2F2; color: #DC2626; }
.doc-status-card .doc-note { margin-top: 4px; color: var(--muted, #425466); font-style: italic; font-size: 11px; }
.status-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.summary-item { text-align: center; padding: 8px 4px; border-radius: var(--radius-xs); background: var(--paper); }
.summary-item { text-align: center; padding: 8px 4px; border-radius: var(--radius-xs, 6px); background: #F6F9FC; }
.summary-item .count { font-family: var(--font-mono); font-size: 19px; font-weight: 600; display: block; }
.summary-item .label { font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.5px; }
.summary-item.pending .count { color: var(--brass-dark); }
.summary-item.approved .count { color: var(--success); }
.summary-item.rejected .count { color: var(--error); }
.summary-item .label { font-size: 10px; text-transform: uppercase; color: var(--muted, #425466); letter-spacing: 0.5px; }
.summary-item.pending .count { color: #92600A; }
.summary-item.approved .count { color: #047857; }
.summary-item.rejected .count { color: #DC2626; }
.faq-question {
background: #fff; border: 1px solid var(--border); border-radius: var(--radius-xs);
background: #fff; border: 1px solid var(--border, #E2E8F0); border-radius: var(--radius-xs, 6px);
padding: 9px 12px; font-size: 12.5px; cursor: pointer; transition: all 0.2s ease;
text-align: left; color: var(--ink); width: 100%; font-family: inherit; display: block; margin-top: 4px;
text-align: left; color: var(--ink, #0A2540); width: 100%; font-family: inherit; display: block; margin-top: 4px;
}
.faq-question:hover { border-color: var(--emerald); color: var(--emerald); background: var(--emerald-light); }
.faq-question:hover { border-color: #1D4ED8; color: #1D4ED8; background: #EFF6FF; }
.back-btn {
background: none; border: none; color: var(--emerald); cursor: pointer; font-size: 12px;
background: none; border: none; color: #1D4ED8; cursor: pointer; font-size: 12px;
padding: 4px 0; font-family: inherit; font-weight: 500; margin-top: 6px;
display: inline-flex; align-items: center; gap: 4px;
}
+150 -42
View File
@@ -38,32 +38,52 @@
.app-footer img { height: 28px; }
.app-footer small { color: var(--muted); font-size: 12px; }
/* ── Auth Layout — Split Card ────────────────────────────── */
/* ── Auth Layout — Artha Split Editorial ────────────────────────────── */
.auth-shell {
min-height: 100vh;
display: flex;
align-items: stretch;
background: #fff;
background: var(--paper);
}
.auth-brand {
width: 42%;
min-width: 280px;
min-width: 320px;
position: relative;
background: #17211D;
background-image: var(--ruled), linear-gradient(155deg, #17211D 0%, var(--emerald-dark) 130%);
background: var(--ink);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 48px 40px;
color: #fff;
gap: 22px;
gap: 24px;
overflow: hidden;
border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-brand::before {
content: '';
position: absolute;
top: -80px;
left: -80px;
width: 240px;
height: 240px;
background: radial-gradient(circle, rgba(29, 78, 216, 0.45) 0%, transparent 70%);
border-radius: 50%;
pointer-events: none;
}
.auth-brand .brand-logo { height: 48px; opacity: 0.95; }
.auth-brand h2 { font-family: var(--font-display); color: #fff; font-size: clamp(20px,2.5vw,27px); text-align: center; margin: 0; font-weight: 500; }
.auth-brand p { color: rgba(255,255,255,0.68); font-size: 14px; text-align: center; line-height: 1.8; margin: 0; max-width: 320px; }
.auth-brand .brand-divider { width: 40px; height: 2px; background: var(--brass); border-radius: 2px; }
.auth-brand .auth-brand-logo-img {
width: 58px;
height: 58px;
border-radius: 12px;
object-fit: cover;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
border: 1px solid rgba(255, 255, 255, 0.2);
display: block;
}
.auth-brand h2 { font-family: var(--font-display, 'Playfair Display', serif); color: #fff; font-size: clamp(22px,2.6vw,30px); text-align: center; margin: 0; font-weight: 600; }
.auth-brand p { color: rgba(255,255,255,0.72); font-size: 14.5px; text-align: center; line-height: 1.7; margin: 0; max-width: 340px; }
.auth-brand .brand-divider { width: 44px; height: 3px; background: var(--brass); border-radius: 2px; }
.auth-form-side {
flex: 1;
@@ -71,13 +91,27 @@
align-items: center;
justify-content: center;
padding: clamp(32px, 5vw, 64px) clamp(24px, 6vw, 80px);
background: #fff;
background: var(--paper);
overflow-y: auto;
}
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: clamp(21px,2.5vw,27px); margin-bottom: 6px; }
.auth-box .auth-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.auth-links { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; line-height: 2; }
.auth-box {
width: 100%;
max-width: 440px;
background: #FFFFFF;
border: 1px solid var(--border);
border-radius: 24px;
padding: clamp(32px, 4vw, 44px);
box-shadow: 0 10px 32px -4px rgba(10, 37, 64, 0.05);
}
.auth-box h1 {
font-family: var(--font-display, 'Playfair Display', serif);
font-size: clamp(24px,2.6vw,30px);
color: var(--ink);
font-weight: 600;
margin-bottom: 6px;
}
.auth-box .auth-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.auth-links { margin-top: 24px; font-size: 13.5px; color: var(--muted); text-align: center; line-height: 2; }
@@ -94,6 +128,7 @@
}
.auth-brand p, .auth-brand .brand-divider { display: none; }
.auth-brand .brand-logo { height: 30px; }
.auth-brand .auth-brand-logo-img { width: 36px; height: 36px; border-radius: 8px; }
.auth-brand h2 { font-size: 15px; margin: 0; }
.auth-form-side { padding: 28px 20px; }
}
@@ -184,7 +219,7 @@
transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
position: relative;
}
.user-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cfc7ad; }
.user-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(29, 78, 216, 0.3); }
.click-layer { position: absolute; inset: 0; z-index: 0; }
.user-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.user-avatar {
@@ -225,7 +260,7 @@
transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
margin-bottom: 10px;
}
.doc-row:hover { border-color: #cfc7ad; background: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(23,33,29,0.06); }
.doc-row:hover { border-color: var(--brass); background: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(10,37,64,0.06); }
.doc-row-left { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.doc-row-name { font-weight: 600; font-size: 13px; color: var(--ink); word-break: break-word; }
.doc-row-type { font-size: 12px; color: var(--muted); }
@@ -233,7 +268,7 @@
/* ── Drop Zone ───────────────────────────────────────────── */
.drop-zone {
border: 2px dashed #cfc7ad;
border: 2px dashed var(--border);
border-radius: var(--radius-md);
padding: 36px 24px;
text-align: center;
@@ -242,9 +277,9 @@
cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
border-color: var(--emerald);
background: var(--emerald-light);
color: var(--emerald);
border-color: var(--brass);
background: var(--brass-light);
color: var(--brass);
}
.drop-zone .drop-icon { font-size: 34px; margin-bottom: 10px; }
.drop-zone .drop-title { font-weight: 600; font-size: 15px; color: var(--ink); }
@@ -262,7 +297,7 @@
transition: border-color var(--transition), box-shadow var(--transition);
max-width: 360px;
}
.search-bar:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(31,93,70,0.10); }
.search-bar:focus-within { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(29,78,216,0.10); }
.search-bar input { border: none; outline: none; font-family: inherit; font-size: 14px; width: 100%; background: transparent; }
.search-bar .search-icon { color: var(--muted); font-size: 16px; flex-shrink: 0; }
@@ -320,15 +355,15 @@
gap: 16px;
padding: 16px 20px;
border-radius: var(--radius-md);
background: var(--emerald-light);
border: 1px solid rgba(31,93,70,0.2);
background: var(--brass-light);
border: 1px solid rgba(29, 78, 216, 0.2);
margin-bottom: 24px;
}
.engagement-banner .banner-icon { font-size: 26px; flex-shrink: 0; color: var(--emerald); }
.engagement-banner .banner-icon { font-size: 26px; flex-shrink: 0; color: var(--brass); }
.engagement-banner .banner-text { flex: 1; }
.engagement-banner .banner-text strong { display: block; font-size: 14px; color: var(--ink); }
.engagement-banner .banner-text span { font-size: 13px; color: var(--muted); }
.engagement-banner.acknowledged { background: var(--success-bg); border-color: rgba(31,93,70,0.25); }
.engagement-banner.acknowledged { background: var(--success-bg); border-color: rgba(4, 120, 87, 0.25); }
/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
@@ -365,15 +400,15 @@
/* ── JS-extracted components (upload/review) ─────────────── */
.doc-row-wrapper { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn-approve { background: var(--success-bg); color: var(--success); border: 1px solid rgba(31,93,70,0.3); border-radius: var(--radius-sm); }
.btn-reject { background: var(--error-bg); color: var(--error); border: 1px solid rgba(166,58,58,0.3); border-radius: var(--radius-sm); }
.btn-approve { background: var(--success-bg); color: var(--success); border: 1px solid rgba(4, 120, 87, 0.3); border-radius: var(--radius-sm); }
.btn-reject { background: var(--error-bg); color: var(--error); border: 1px solid rgba(220, 38, 38, 0.3); border-radius: var(--radius-sm); }
.reject-box { display: none; margin-top: 10px; }
.reject-textarea { width: 100%; padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-family: inherit; font-size: 13px; resize: vertical; }
.admin-doc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.admin-docs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-docs-td { padding: 10px 12px; color: #3E463F; }
.admin-docs-td { padding: 10px 12px; color: var(--muted); }
.admin-docs-th { padding: 10px 12px; color: var(--muted); font-weight: 600; text-align: left; border-bottom: 2px solid var(--border); }
.btn-download-pill { background: var(--emerald); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 500; }
.btn-download-pill { background: var(--brass); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 500; }
.btn-download-pill:hover { opacity: 0.9; }
.btn-upload-pill { background: var(--brass); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; padding: 8px 16px; display: inline-flex; align-items: center; gap: 8px; }
.btn-upload-pill:hover { opacity: 0.9; }
@@ -745,8 +780,49 @@
min-width: 0; /* prevents flex child from overflowing */
}
.doc-review-sidebar {
flex: 0 0 240px; /* fixed 240px sidebar, doesn't shrink */
width: 240px;
flex: 0 0 290px;
width: 290px;
min-width: 260px;
}
.doc-review-sidebar .timeline-sidebar-card {
background: #FFFFFF;
border: 1px solid var(--border);
border-radius: 16px;
padding: 20px;
box-shadow: 0 4px 16px rgba(10, 37, 64, 0.04);
display: flex;
flex-direction: column;
gap: 14px;
}
.doc-review-sidebar .timeline-control {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 8px 14px;
background: var(--paper);
border: 1px solid var(--border);
border-radius: 12px;
}
.doc-review-sidebar .timeline-control .tl-btn {
width: 32px;
height: 32px;
border-radius: 8px;
border: 1px solid var(--border);
background: #FFFFFF;
color: var(--ink);
font-size: 16px;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.18s ease;
}
.doc-review-sidebar .timeline-control .tl-btn:hover {
background: var(--brass);
color: #FFFFFF;
border-color: var(--brass);
}
@media (max-width: 768px) {
@@ -759,9 +835,7 @@
order: -1; /* show Filing Timeline ABOVE the doc list on mobile */
}
.doc-review-sidebar .card-flat {
flex-direction: row !important;
align-items: center;
flex-wrap: wrap;
flex-direction: column;
gap: 12px;
}
.doc-review-sidebar h3 {
@@ -769,11 +843,11 @@
margin-bottom: 0 !important;
}
.doc-review-sidebar .timeline-control {
flex: 1;
width: 100%;
}
.doc-review-sidebar .btn {
flex: 1;
min-width: 180px;
.doc-review-sidebar .btn,
.doc-review-sidebar .artha-pill-btn {
width: 100%;
}
}
@@ -845,17 +919,50 @@
.doc-count-chip {
display: inline-flex;
align-items: center;
gap: 4px;
gap: 6px;
font-size: 12px;
font-family: var(--font-mono);
background: var(--paper);
border: 1px solid var(--border);
border-radius: var(--radius-xs);
padding: 3px 8px;
border-radius: 9999px;
padding: 4px 10px;
white-space: nowrap;
}
/* ── Admin User Detail Bar ────────────────────────────── */
.aud-user-bar {
background: #FFFFFF !important;
border: 1px solid var(--border) !important;
border-radius: 20px !important;
padding: clamp(20px, 3vw, 28px) !important;
box-shadow: 0 4px 20px -2px rgba(10, 37, 64, 0.04) !important;
}
.aud-bar-inner {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 24px;
flex-wrap: wrap;
}
.aud-bar-left {
display: flex;
align-items: flex-start;
gap: 16px;
min-width: 280px;
flex: 1;
}
.aud-bar-actions {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
justify-content: flex-end;
}
.aud-year-picker {
display: flex;
align-items: center;
gap: 6px;
}
/* StatusChip */
.status-chip-container {
@@ -869,3 +976,4 @@
color: var(--error);
font-style: italic;
}
File diff suppressed because it is too large Load Diff
+14 -85
View File
@@ -1,6 +1,6 @@
/* ============================================================
/* ============================================================
dynamic.css — Ledger motion layer
Uses ONLY existing tokens (colours, Fraunces / IBM Plex fonts).
Uses ONLY existing tokens (colours, fonts).
Concept: a brass rule is "struck under" a checked entry; numbers
tick like a ledger counter. Load AFTER animations.css.
Rules: animate transform/opacity only; entrance animations use
@@ -10,31 +10,24 @@
:root {
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
--brass-rgb: 176, 128, 61; /* = original brass, for rgba() */
--emerald-rgb: 31, 93, 70;
--brass-rgb: 29, 78, 216;
--emerald-rgb: 4, 120, 87;
}
/* ---------- Global polish ---------- */
::selection { background: rgba(var(--brass-rgb), 0.28); color: var(--ink); }
h1, h2, h3 { text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.btn:focus-visible, .tab-btn:focus-visible { outline-offset: 2px; }
/* ---------- Scroll progress rule (width driven by --scroll, set in motion.js) ---------- */
.scroll-progress {
position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 10000;
background: linear-gradient(90deg, var(--emerald), rgb(var(--brass-rgb)));
background: linear-gradient(90deg, #1D4ED8, #14B8A6);
transform: scaleX(var(--scroll, 0)); transform-origin: 0 50%; pointer-events: none;
}
/* ---------- Header / navbar respond to scroll ---------- */
.navbar:not(.navbar-solid) { position: fixed; transition: background 0.35s, box-shadow 0.35s, border-color 0.35s; }
html[data-scrolled] .navbar:not(.navbar-solid) {
background: rgba(23, 33, 29, 0.92);
box-shadow: 0 10px 28px -14px rgba(23, 33, 29, 0.6);
border-bottom-color: rgba(var(--brass-rgb), 0.35);
}
.app-header { transition: box-shadow 0.3s, background 0.3s; }
html[data-scrolled] .app-header { box-shadow: var(--shadow-sm); }
@@ -43,47 +36,22 @@ html[data-scrolled] .app-header { box-shadow: var(--shadow-sm); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
.page-enter { animation: pageIn 0.5s var(--ease-out) backwards; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > * {
animation: rise 0.65s var(--ease-out) backwards;
animation-delay: var(--d, 0ms);
}
/* beat the older `fade-up` (fill-mode both) which froze the hover-lift transform */
.fade-up, .service-card.fade-up, .user-card.fade-up { animation-name: rise; animation-duration: 0.65s; animation-timing-function: var(--ease-out); animation-fill-mode: backwards; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(1) { --d: 40ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(2) { --d: 110ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(3) { --d: 180ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(4) { --d: 250ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(5) { --d: 320ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(6) { --d: 380ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(7) { --d: 430ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(8) { --d: 480ms; }
:is(.admin-stats, .users-grid, .services-grid, .return-cards, .stat-row) > :nth-child(n+9) { --d: 520ms; }
/* ---------- Cards: lift + pointer spotlight (vars set in motion.js) ---------- */
:is(.stat-card, .user-card, .service-card, .card) { position: relative; }
:is(.stat-card, .user-card, .service-card, .card):hover {
.card { position: relative; }
.card:hover {
background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--brass-rgb), 0.10), transparent 62%);
}
.stat-icon { display: inline-flex; transition: transform 0.5s var(--ease-spring); }
.stat-card:hover .stat-icon { transform: translateY(-3px) rotate(-6deg) scale(1.08); }
.stat-card.active-filter { animation: rise 0.65s var(--ease-out) backwards, ringPulse 2.6s 1s ease-out infinite; animation-delay: var(--d, 0ms), 1s; }
@keyframes ringPulse { 0% { box-shadow: 0 0 0 0 rgba(var(--emerald-rgb), 0.28); } 70%, 100% { box-shadow: 0 0 0 10px rgba(var(--emerald-rgb), 0); } }
.user-avatar { transition: transform 0.4s var(--ease-spring), box-shadow 0.3s; }
.user-card:hover .user-avatar { transform: scale(1.1); box-shadow: 0 0 0 4px rgba(var(--brass-rgb), 0.22); }
.service-card img { transition: transform 0.9s var(--ease-out); }
.service-card:hover img { transform: scale(1.06); }
/* ---------- Buttons: lift, brass sheen, press ---------- */
.btn { position: relative; overflow: hidden; transition: transform 0.18s var(--ease-out), box-shadow 0.25s, background-color 0.25s, color 0.25s, border-color 0.25s; }
.btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:not(:disabled):active { transform: translateY(1px) scale(0.97); box-shadow: none; }
.btn-primary::before, .login-btn::before {
.btn-primary::before {
content: ''; position: absolute; inset: 0; pointer-events: none;
background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.26) 50%, transparent 70%);
background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
transform: translateX(-130%); transition: transform 0.8s var(--ease-out);
}
.btn-primary:not(:disabled):hover::before, .login-btn:hover::before { transform: translateX(130%); }
.login-btn { position: relative; overflow: hidden; }
.btn-primary:not(:disabled):hover::before { transform: translateX(130%); }
/* ---------- Status chips: attention dot / stamp ---------- */
@keyframes pop { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
@@ -97,7 +65,7 @@ html[data-scrolled] .app-header { box-shadow: var(--shadow-sm); }
.status-chip-container .badge-green::before { content: '✓' / ''; font-weight: 700; display: inline-block; animation: stamp 0.55s 0.15s var(--ease-spring) backwards; }
.status-chip-container .badge-red::before { content: '!' / ''; font-weight: 700; display: inline-block; animation: stamp 0.55s 0.15s var(--ease-spring) backwards; }
/* ---------- Tabs, inputs, toasts, skeletons ---------- */
/* ---------- Tabs, inputs, toasts ---------- */
.tab-btn { border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
.tab-btn:hover { background: rgba(var(--brass-rgb), 0.08); color: var(--ink); }
.tab-btn.active { background: linear-gradient(180deg, transparent, rgba(var(--brass-rgb), 0.07)); }
@@ -106,58 +74,19 @@ input, select, textarea { transition: border-color 0.2s, box-shadow 0.25s; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; border-color: rgb(var(--brass-rgb)); box-shadow: var(--shadow-glow); }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px) scale(0.96); } }
.toast { animation: toastIn 0.5s var(--ease-spring) backwards; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton { position: relative; overflow: hidden; background: var(--border); border-radius: var(--radius-md); }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); animation: shimmer 1.4s infinite; }
.skeleton-card { height: 128px; }
/* ---------- Upload drop zone ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.drop-zone { transition: border-color 0.25s, background 0.25s, transform 0.3s var(--ease-spring), box-shadow 0.3s; }
.drop-zone:hover .material-symbols-outlined { animation: bob 1.3s ease-in-out infinite; }
.drop-zone.drag-over { border-style: solid; border-color: rgb(var(--brass-rgb)); background: rgba(var(--brass-rgb), 0.10); transform: scale(1.015); box-shadow: var(--shadow-glow); }
.drop-zone.drag-over .material-symbols-outlined { animation: bob 0.7s ease-in-out infinite; }
/* ---------- Chatbot + banners ---------- */
/* ---------- Chatbot ---------- */
@keyframes ring { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
.chatbot-fab::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(var(--brass-rgb), 0.6); animation: ring 2.8s ease-out infinite; pointer-events: none; }
.chatbot-fab.open::before { animation: none; opacity: 0; }
.chatbot-fab:not(.open):hover { transform: scale(1.08) rotate(-4deg); }
.chatbot-window { transform-origin: bottom right; transition: opacity 0.3s, transform 0.4s var(--ease-spring); }
@keyframes glowNudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--brass-rgb), 0); } 50% { box-shadow: 0 0 0 6px rgba(var(--brass-rgb), 0.18); } }
.engagement-banner:not(.acknowledged) { animation: glowNudge 3.2s 1s ease-in-out 3; }
/* ---------- Marketing: hero + reveals ---------- */
/* Ambient light: soft brass + emerald glows drift over the (static) photo. Gradients only — no image scaling, so it stays cheap. */
.hero { isolation: isolate; }
.hero::after {
content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
background:
radial-gradient(55% 50% at 18% 28%, rgba(var(--brass-rgb), 0.20), transparent 70%),
radial-gradient(50% 60% at 86% 82%, rgba(var(--emerald-rgb), 0.30), transparent 70%);
animation: drift 20s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(-4%, -3%, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.12); } }
@media (max-width: 768px) { .hero::after { animation: none; } }
.hero-eyebrow, .hero h1, .hero-sub, .hero-actions { animation: rise 1s var(--ease-out) backwards; }
.hero-eyebrow { animation-delay: 0.1s; } .hero h1 { animation-delay: 0.22s; } .hero-sub { animation-delay: 0.4s; } .hero-actions { animation-delay: 0.55s; }
.hero h1 em { background: linear-gradient(rgb(var(--brass-rgb)), rgb(var(--brass-rgb))) no-repeat 0 100% / 0 2px; padding-bottom: 0.08em; animation: drawRule 1.2s 1.1s var(--ease-out) forwards; }
@keyframes drawRule { to { background-size: 100% 2px; } }
.hero-stats { animation: rise 1.1s 0.7s var(--ease-out) backwards; }
.stat-block { transition: background 0.3s; }
.stat-block:hover { background: rgba(var(--brass-rgb), 0.08); }
.stat-figure { transition: color 0.3s, transform 0.4s var(--ease-spring); }
.stat-block:hover .stat-figure { color: var(--emerald); transform: scale(1.06); }
/* Reveal: hidden ONLY when JS has opted in (html.motion) — never blank without JS / reduced motion */
.reveal { opacity: 1; transform: none; }
html.motion .reveal:not(.in-view) { opacity: 0; transform: translateY(26px); }
html.motion .reveal .eyebrow::before { transform: scaleX(0); transform-origin: left; transition: transform 0.9s 0.25s var(--ease-out); }
html.motion .reveal.in-view .eyebrow::before { transform: scaleX(1); }
@supports (animation-timeline: view()) {
@keyframes parallaxY { from { transform: translateY(-18px) scale(1.04); } to { transform: translateY(18px) scale(1.04); } }
.about-media img { animation: parallaxY linear both; animation-timeline: view(); animation-range: cover 0% 100%; }
}
/* Layout safety: long text inside a .badge (About page <p class="badge">) must wrap instead of forcing horizontal scroll */
.badge { max-width: 100%; }
@@ -168,4 +97,4 @@ p.badge { white-space: normal; text-align: left; }
*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
.scroll-progress { display: none; }
}
@media (hover: none) { :is(.stat-card, .user-card, .service-card, .card):hover { background-image: none; } }
@media (hover: none) { .card:hover { background-image: none; } }
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

+1
View File
@@ -56,6 +56,7 @@ function AppRoutes() {
<Route element={<MarketingLayout />}>
<Route path="/" element={<Home />} />
<Route path="/home" element={<Home />} />
<Route path="/about" element={<AboutUs />} />
<Route path="/about-us" element={<AboutUs />} />
<Route path="/services" element={<Services />} />
<Route path="/contact" element={<Contact />} />
+2 -2
View File
@@ -186,7 +186,7 @@ export default function AdminChatbot() {
} finally {
setIsTyping(false);
}
}, [messages, authFetch]);
}, [messages, authFetch, sessionId]);
const handleSendMessage = (e) => { e.preventDefault(); if (inputText.trim()) sendMessage(inputText.trim()); };
const handleMenuAsk = (e) => { e.preventDefault(); if (menuInput.trim()) sendMessage(menuInput.trim(), []); };
@@ -278,7 +278,7 @@ export default function AdminChatbot() {
{/* Bulk action confirmation card */}
{pendingBulk && (
<div style={{ background: 'var(--warn-bg)', border: '1px solid var(--warn)', borderRadius: 'var(--radius-sm)', padding: '12px', margin: '8px 0' }}>
<div style={{ fontWeight: 700, fontSize: '13px', color: 'var(--warn)', marginBottom: '8px' }}>
<div style={{ fontWeight: 700, fontSize: '13px', color: 'var(--amber-text)', marginBottom: '8px' }}>
⚠️ Confirm bulk action
</div>
<div style={{ fontSize: '13px', marginBottom: '10px' }}>
+2 -2
View File
@@ -7,7 +7,7 @@ const STORAGE_KEY = 'user_chat_session_id';
const FAQ_DATA = {
"Account": [
{ q: "How do I reset my password?", a: 'Go to the login page and click "Forgot Password". Enter your email and we\'ll send a reset link.' },
{ q: "How do I verify my email?", a: 'Check your inbox for a verification email from BookKeepPro. Click the link inside to verify.' },
{ q: "How do I verify my email?", a: 'Check your inbox for a verification email from ABC CPA. Click the link inside to verify.' },
{ q: "How do I update my profile?", a: 'Go to your Profile page to update your name, phone number, or change your password.' },
],
"Documents": [
@@ -173,7 +173,7 @@ export default function Chatbot() {
} finally {
setIsTyping(false);
}
}, [messages, authFetch]);
}, [messages, authFetch, sessionId]);
const handleSendMessage = (e) => { e.preventDefault(); if (inputText.trim()) sendMessage(inputText.trim()); };
const handleMenuAsk = (e) => { e.preventDefault(); if (menuInput.trim()) sendMessage(menuInput.trim(), []); };
+51 -34
View File
@@ -4,78 +4,95 @@
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
background-color: rgba(10, 37, 64, 0.65);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
display: flex;
justify-content: center;
align-items: center;
z-index: 10000;
animation: fadeIn 0.2s ease-in-out;
animation: fadeIn 0.22s ease-in-out;
}
.confirm-modal-content {
background-color: #fff;
border-radius: 8px;
padding: 24px;
max-width: 400px;
background-color: #FFFFFF;
border-radius: 20px;
border: 1px solid var(--border, #E2E8F0);
padding: 28px;
max-width: 440px;
width: 90%;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
animation: slideUp 0.2s ease-in-out;
box-shadow: 0 16px 40px -8px rgba(10, 37, 64, 0.25);
animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-modal-title {
margin-top: 0;
margin-bottom: 12px;
font-size: 1.2rem;
color: #333;
margin-bottom: 10px;
font-family: var(--font-display, 'Playfair Display', serif);
font-size: 20px;
font-weight: 600;
color: var(--ink, #0A2540);
}
.confirm-modal-message {
margin-bottom: 24px;
color: #555;
line-height: 1.5;
color: var(--muted, #425466);
font-size: 14px;
line-height: 1.6;
}
.confirm-modal-actions {
display: flex;
justify-content: flex-end;
gap: 12px;
gap: 10px;
}
.confirm-modal-cancel {
background-color: transparent;
border: 1px solid #ccc;
color: #555;
padding: 8px 16px;
border-radius: 4px;
background-color: var(--paper, #F6F9FC);
border: 1px solid var(--border, #E2E8F0);
color: var(--ink, #0A2540);
padding: 8px 18px;
border-radius: 9999px;
cursor: pointer;
font-weight: 500;
transition: background-color 0.15s;
font-weight: 600;
font-size: 13px;
transition: all 0.2s ease;
}
.confirm-modal-cancel:hover {
background-color: #f5f5f5;
background-color: var(--header-bg, #EEF3F9);
border-color: var(--ink, #0A2540);
}
.confirm-modal-confirm {
padding: 8px 16px;
border-radius: 4px;
padding: 8px 20px;
border-radius: 9999px;
border: none;
cursor: pointer;
font-weight: 500;
color: #fff;
transition: opacity 0.15s;
}
.confirm-modal-confirm:hover {
opacity: 0.9;
font-weight: 600;
font-size: 13px;
color: #FFFFFF;
transition: all 0.2s ease;
}
.confirm-modal-confirm.primary {
background-color: #007bff;
background-color: var(--brass, #1D4ED8);
box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}
.confirm-modal-confirm.primary:hover {
background-color: var(--brass-dark, #1E40AF);
transform: translateY(-1px);
}
.confirm-modal-confirm.destructive {
background-color: #dc3545;
background-color: var(--error, #DC2626);
box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.confirm-modal-confirm.destructive:hover {
background-color: #B91C1C;
transform: translateY(-1px);
}
@keyframes fadeIn {
@@ -84,6 +101,6 @@
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(10px); }
from { opacity: 0; transform: translateY(14px); }
to { opacity: 1; transform: translateY(0); }
}
@@ -4,8 +4,8 @@ import ExpandableValue from './ExpandableValue';
const CONFIDENCE_STYLES = {
high: { icon: '🟢', color: 'var(--success)', bg: 'var(--success-bg)' },
medium: { icon: '🟡', color: 'var(--warn)', bg: 'var(--warn-bg)' },
low: { icon: '🟠', color: '#d97706', bg: '#fff7ed' },
medium: { icon: '🟡', color: 'var(--amber-text)', bg: 'var(--warn-bg)' },
low: { icon: '🟠', color: '#92600A', bg: '#FFF8E6' },
unknown: { icon: '⚪', color: 'var(--muted)', bg: 'var(--paper)' },
};
+75 -21
View File
@@ -1,34 +1,88 @@
import { Link } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom';
export default function Footer() {
const navigate = useNavigate();
return (
<footer className="footer">
<div className="footer-top">
<div className="footer-left">
<img src="/images/bookkeeppro-logo.webp" className="footer-logo" alt="BookKeepPro" width="190" height="64" />
<p>Bookkeeping, payroll and tax preparation for growing businesses — kept precise, kept compliant.</p>
<footer className="artha-footer">
<div className="artha-footer-inner">
{/* Col 1: Brand & Office */}
<div className="artha-footer-col artha-footer-brand">
<div className="artha-footer-logo-row" style={{ display: 'flex', alignItems: 'center', gap: '14px', marginBottom: '16px' }}>
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
className="artha-brand-logo-img"
style={{ width: '42px', height: '42px', borderRadius: '10px' }}
width="42"
height="42"
/>
<div>
<div className="artha-footer-title">ABC CPA &amp; Advisory</div>
<div className="artha-footer-subtitle">Tax Advisory &amp; Accounting Services</div>
</div>
</div>
<p className="artha-footer-desc">
Proactive financial strategy, international taxation, and AI-enabled accounting for founders, growth businesses, and non-residents worldwide.
</p>
<div className="artha-footer-contact-info">
<p><strong>US Office:</strong> 2520 Indigo Dr, McKinney / Frisco, TX 75072</p>
<p><strong>India Office:</strong> Landmark Centre, Pune, MH 411009</p>
<p><strong>Email:</strong> <a href="mailto:atharvg.aiindia@gmail.com">atharvg.aiindia@gmail.com</a></p>
</div>
</div>
<div className="footer-links">
<h3>Navigate</h3>
<Link to="/">Home</Link>
<Link to="/about-us">About Us</Link>
<Link to="/services">Services</Link>
<Link to="/contact">Contact Us</Link>
{/* Col 2: Services */}
<div className="artha-footer-col">
<div className="artha-footer-heading">Services</div>
<ul className="artha-footer-links">
<li><Link to="/services">Tax Strategy & Preparation</Link></li>
<li><Link to="/services">International & Cross-Border (FBAR/FATCA)</Link></li>
<li><Link to="/services">Instant P&L from Bank Statements</Link></li>
<li><Link to="/services">Fractional CFO & Advisory</Link></li>
<li><Link to="/services">Full-Cycle Bookkeeping & Payroll</Link></li>
</ul>
</div>
<div className="footer-contact">
<h3>Reach us</h3>
<p>USA · 2520 Indigo Dr, McKinney, TX 75072</p>
<p>India · Office no.405, Fourth floor, Above Just In Time,<br />
Landmark Centre, Survey No 46/1B, Plot No 2, Satara Rd,<br /> Opposite City Pride Theater, Pune, Maharashtra-411009</p>
<p>atharvg.aiindia@gmail.com</p>
<p>+91 8275367267</p>
{/* Col 3: Firm */}
<div className="artha-footer-col">
<div className="artha-footer-heading">Firm</div>
<ul className="artha-footer-links">
<li><Link to="/">Home</Link></li>
<li><Link to="/about-us">About Us</Link></li>
<li><Link to="/services">Services</Link></li>
<li><Link to="/contact">Contact & Consultations</Link></li>
<li><Link to="/login">Login Portal</Link></li>
</ul>
</div>
{/* Col 4: Action & Hours */}
<div className="artha-footer-col artha-footer-action-col">
<button
className="artha-pill-btn artha-pill-primary artha-footer-cta-btn"
onClick={() => navigate('/login')}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>login</span>
Access Login Portal
</button>
<div className="artha-footer-hours">
<p className="artha-hours-email">atharvg.aiindia@gmail.com</p>
<p className="artha-hours-timing">Mon &ndash; Fri, 9:00 AM &ndash; 6:00 PM CT</p>
</div>
</div>
</div>
<div className="footer-bottom">
<p>© 2026 Bookkeeping Business Solutions. All rights reserved.</p>
<div className="artha-footer-bottom">
<div className="artha-footer-bottom-inner">
<p>&copy; {new Date().getFullYear()} ABC CPA & Advisory. All rights reserved.</p>
<div className="artha-footer-bottom-links">
<span>AICPA Member Firm</span>
<span>&bull;</span>
<span>QuickBooks ProAdvisor</span>
<span>&bull;</span>
<span>SOC-2 &amp; Encrypted Document Storage</span>
</div>
</div>
</div>
</footer>
);
+66 -23
View File
@@ -6,30 +6,73 @@ export default function Navbar({ solid = false }) {
const navigate = useNavigate();
return (
<div className={`navbar ${solid ? 'navbar-solid' : ''}`}>
<div className="nav-container">
<Link to="/">
<img id="logos" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro" width="190" height="64" />
</Link>
<nav id="navMenu" className={`nav-menu ${isOpen ? 'active' : ''}`}>
<Link to="/" onClick={() => setIsOpen(false)}>Home</Link>
<Link to="/about-us" onClick={() => setIsOpen(false)}>About Us</Link>
<Link to="/services" onClick={() => setIsOpen(false)}>Services</Link>
<Link to="/contact" onClick={() => setIsOpen(false)}>Contact Us</Link>
<button className="login-btn desktop-login" onClick={() => navigate('/login')}>
Sign in
</button>
<button className="login-btn mobile-login" onClick={() => navigate('/login')}>
Sign in
</button>
</nav>
<div className="hamburger" onClick={() => setIsOpen(!isOpen)}>
<span></span><span></span><span></span>
<header className={`artha-navbar ${solid ? 'artha-navbar-solid' : ''}`}>
{/* Top Advisory Announcement Bar */}
<div className="artha-top-alert">
<div className="artha-top-alert-inner">
<span className="artha-alert-badge">2026 TAX SEASON</span>
<span>Now scheduling corporate tax structuring &amp; cross-border FBAR advisory sessions.</span>
<Link to="/contact" className="artha-top-alert-link">
Book Consultation &rarr;
</Link>
</div>
</div>
</div>
<div className="artha-nav-container">
{/* Brand Left: Monogram / Logo + 2-line title */}
<Link to="/" className="artha-brand-wrap">
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
className="artha-brand-logo-img"
width="38"
height="38"
/>
<div className="artha-brand-text">
<span className="artha-brand-title">ABC CPA &amp; Advisory</span>
<span className="artha-brand-sub">Tax Advisory &amp; Accounting Services</span>
</div>
</Link>
{/* Center Nav Links */}
<nav className={`artha-nav-links ${isOpen ? 'active' : ''}`}>
<Link to="/" onClick={() => setIsOpen(false)}>Home</Link>
<Link to="/services" onClick={() => setIsOpen(false)}>Services</Link>
<Link to="/about-us" onClick={() => setIsOpen(false)}>About</Link>
<Link to="/contact" onClick={() => setIsOpen(false)}>Contact</Link>
{/* Mobile only actions */}
<div className="artha-mobile-actions">
<button className="artha-pill-btn artha-pill-outline" onClick={() => { setIsOpen(false); navigate('/login'); }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>login</span>
Login Portal
</button>
<button className="artha-pill-btn artha-pill-primary" onClick={() => { setIsOpen(false); navigate('/contact'); }}>
Schedule a Call
</button>
</div>
</nav>
{/* Right Actions Desktop Cluster */}
<div className="artha-nav-actions">
<button className="artha-pill-btn artha-pill-outline" onClick={() => navigate('/login')}>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>login</span>
Login Portal
</button>
<button className="artha-pill-btn artha-pill-primary" onClick={() => navigate('/contact')}>
Schedule a Call
</button>
</div>
{/* Hamburger Mobile Toggle */}
<button
className={`artha-hamburger ${isOpen ? 'open' : ''}`}
onClick={() => setIsOpen(!isOpen)}
aria-label="Toggle Navigation Menu"
>
<span></span><span></span><span></span>
</button>
</div>
</header>
);
}
+18 -6
View File
@@ -3,18 +3,30 @@ import React from 'react';
export default function StatusChip({ status, note }) {
const s = (status || 'pending').toLowerCase();
let badgeClass = 'badge-yellow';
if (s === 'approved' || s === 'filed' || s === 'verified') badgeClass = 'badge-green';
if (s === 'rejected' || s === 'error') badgeClass = 'badge-red';
if (s === 'sent_for_approval') badgeClass = 'badge-blue';
let pillClass = 'artha-status-pending';
let iconName = 'schedule';
if (s === 'approved' || s === 'filed' || s === 'verified') {
pillClass = 'artha-status-approved';
iconName = s === 'filed' ? 'inventory_2' : 'check_circle';
} else if (s === 'rejected' || s === 'error') {
pillClass = 'artha-status-rejected';
iconName = 'cancel';
} else if (s === 'sent_for_approval') {
pillClass = 'artha-status-sent';
iconName = 'hourglass_top';
}
const statusText = s.replace(/_/g, ' ').toUpperCase();
return (
<div className="status-chip-container">
<span className={`badge ${badgeClass} `}>{statusText}</span>
<span className={`artha-status-pill ${pillClass}`}>
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>{iconName}</span>
{statusText}
</span>
{note && (
<div className="status-chip-note">
<div className="status-chip-note" style={{ fontSize: '11.5px', marginTop: '2px', color: s === 'rejected' ? '#DC2626' : '#425466' }}>
{s === 'rejected' ? 'Reason: ' : 'Note: '}{note}
</div>
)}
+57 -54
View File
@@ -1,28 +1,30 @@
@import "tailwindcss";
@theme {
--color-brand-ink: #17211D;
--color-brand-emerald: #1F5D46;
--color-brand-emerald-dark: #163F30;
--color-brand-emerald-light: #E8F1EC;
--color-brand-brass: #8F6528;
--color-brand-brass-dark: #8F6528;
--color-brand-brass-light: #F6EEE0;
--color-brand-paper: #F5F2E9;
--color-brand-ink: #0A2540;
--color-brand-ink-soft: #14365F;
--color-brand-emerald: #047857;
--color-brand-emerald-dark: #065F46;
--color-brand-emerald-light: #ECFDF5;
--color-brand-brass: #1D4ED8;
--color-brand-brass-dark: #1E40AF;
--color-brand-brass-light: rgba(29, 78, 216, 0.08);
--color-brand-paper: #F6F9FC;
--color-brand-card: #FFFFFF;
--color-brand-muted: #656C62;
--color-brand-border: #E3DDC9;
--color-brand-muted: #425466;
--color-brand-border: #E2E8F0;
--color-status-success: #1F5D46;
--color-status-success-bg: #E8F1EC;
--color-status-error: #A63A3A;
--color-status-error-bg: #F7E9E9;
--color-status-warn: #8F6528;
--color-status-warn-bg: #F6EEE0;
--color-status-success: #047857;
--color-status-success-bg: #ECFDF5;
--color-status-error: #DC2626;
--color-status-error-bg: #FEF2F2;
--color-status-warn: #F5B83D;
--color-status-warn-bg: #FFF8E6;
--color-status-warn-text: #92600A;
--font-sans: "IBM Plex Sans", system-ui, sans-serif;
--font-display: "Fraunces", Georgia, serif;
--font-mono: "IBM Plex Mono", ui-monospace, monospace;
--font-sans: "Inter", system-ui, -apple-system, sans-serif;
--font-display: "Playfair Display", Georgia, serif;
--font-mono: "JetBrains Mono", ui-monospace, monospace;
--radius-xs: 6px;
--radius-sm: 10px;
@@ -30,10 +32,10 @@
--radius-lg: 22px;
--radius-pill: 999px;
--shadow-xs: 0 1px 2px rgba(23,33,29,0.06);
--shadow-sm: 0 4px 10px -2px rgba(23,33,29,0.10);
--shadow-md: 0 12px 28px -8px rgba(23,33,29,0.16);
--shadow-lg: 0 24px 56px -12px rgba(23,33,29,0.22);
--shadow-xs: 0 1px 2px rgba(10,37,64,0.06);
--shadow-sm: 0 4px 10px -2px rgba(10,37,64,0.10);
--shadow-md: 0 12px 28px -8px rgba(10,37,64,0.16);
--shadow-lg: 0 24px 56px -12px rgba(10,37,64,0.22);
}
:root {
@@ -47,7 +49,8 @@
--success: var(--color-status-success);
--error: var(--color-status-error);
--warn: var(--color-status-warn);
--green: #10b981;
--amber-text: #92600A;
--green: #10B981;
}
@@ -63,35 +66,35 @@ h1, h2, h3, h4, h5, h6 {
@apply font-display text-brand-ink font-semibold;
}
h1 { @apply text-4xl md:text-5xl lg:text-6xl; }
h2 { @apply text-3xl md:text-4xl; }
h3 { @apply text-2xl md:text-3xl; }
h1 { font-size: clamp(23px, 2.2vw, 30px); line-height: 1.18; letter-spacing: -0.015em; }
h2 { font-size: clamp(18px, 1.8vw, 24px); line-height: 1.25; }
h3 { font-size: clamp(15px, 1.3vw, 19px); line-height: 1.3; }
.tnum { font-variant-numeric: tabular-nums; }
.text-sm { @apply text-sm; }
.fancy-link { @apply text-brand-emerald hover:text-brand-emerald-dark transition-colors; }
.fancy-link { @apply text-brand-brass hover:text-brand-brass-dark transition-colors; }
.eyebrow {
@apply text-brand-brass font-bold text-sm uppercase tracking-wider block mb-2;
@apply text-brand-brass font-bold text-xs uppercase tracking-wider block mb-2;
}
/* -------------------------------- */
/* Layout & Sections */
/* -------------------------------- */
.section {
@apply py-16 px-4 md:px-8 max-w-7xl mx-auto;
@apply py-10 px-4 md:px-8 max-w-7xl mx-auto;
}
.page-heading {
@apply flex justify-between items-end mb-8 border-b border-brand-border pb-4;
@apply flex justify-between items-end mb-6 border-b border-brand-border pb-3;
}
.page-heading h1 {
@apply text-3xl font-display mb-2;
@apply text-2xl font-display mb-1;
}
.page-meta {
@apply text-brand-muted text-sm m-0;
@apply text-brand-muted text-xs m-0;
}
.card {
@@ -110,7 +113,7 @@ h3 { @apply text-2xl md:text-3xl; }
}
.select-input, .input-field {
@apply border border-brand-border rounded-sm px-3 py-2 bg-white focus:outline-none focus:ring-2 focus:ring-brand-emerald focus:border-transparent w-full;
@apply border border-brand-border rounded-sm px-3 py-2 bg-white focus:outline-none focus:ring-2 focus:ring-brand-brass focus:border-transparent w-full;
}
/* -------------------------------- */
@@ -122,7 +125,7 @@ h3 { @apply text-2xl md:text-3xl; }
}
.btn-primary {
@apply bg-brand-emerald text-white hover:bg-brand-emerald-dark border-transparent;
@apply bg-brand-brass text-white hover:bg-brand-brass-dark border-transparent;
}
.btn-outline {
@@ -146,7 +149,7 @@ h3 { @apply text-2xl md:text-3xl; }
}
.btn-upload-pill {
@apply bg-brand-emerald text-white text-sm py-1.5 px-4 font-medium hover:bg-brand-emerald-dark;
@apply bg-brand-brass text-white text-sm py-1.5 px-4 font-medium hover:bg-brand-brass-dark;
border-radius: var(--radius-pill);
}
@@ -162,7 +165,7 @@ h3 { @apply text-2xl md:text-3xl; }
}
.hero-eyebrow {
@apply text-brand-brass uppercase tracking-widest text-sm font-bold mb-6 block;
@apply text-[#F5B83D] uppercase tracking-widest text-sm font-bold mb-6 block;
}
.hero h1 {
@@ -170,11 +173,11 @@ h3 { @apply text-2xl md:text-3xl; }
}
.hero h1 em {
@apply text-brand-emerald-light not-italic;
@apply text-[#3B82F6] not-italic;
}
.hero-sub {
@apply text-lg md:text-xl text-gray-300 max-w-2xl mx-auto mb-10 leading-relaxed;
@apply text-lg md:text-xl text-[#EEF3F9] max-w-2xl mx-auto mb-10 leading-relaxed opacity-90;
}
.hero-actions {
@@ -182,7 +185,7 @@ h3 { @apply text-2xl md:text-3xl; }
}
.hero-stats {
@apply max-w-5xl mx-auto mt-20 grid grid-cols-1 sm:grid-cols-3 gap-8 border-t border-brand-emerald-dark pt-12 relative z-10;
@apply max-w-5xl mx-auto mt-20 grid grid-cols-1 sm:grid-cols-3 gap-8 border-t border-[rgba(255,255,255,0.15)] pt-12 relative z-10;
}
.stat-block {
@@ -190,11 +193,11 @@ h3 { @apply text-2xl md:text-3xl; }
}
.stat-figure {
@apply text-5xl font-display text-brand-brass mb-2;
@apply text-5xl font-display text-[#F5B83D] mb-2;
}
.stat-caption {
@apply text-brand-paper text-sm uppercase tracking-wide opacity-80;
@apply text-[#EEF3F9] text-sm uppercase tracking-wide opacity-80;
}
.about-grid {
@@ -242,14 +245,14 @@ h3 { @apply text-2xl md:text-3xl; }
}
.cta-band p {
@apply text-lg text-gray-300 mb-8 max-w-2xl mx-auto;
@apply text-lg text-[#EEF3F9] mb-8 max-w-2xl mx-auto opacity-90;
}
/* -------------------------------- */
/* Specific Pages: Uploads */
/* -------------------------------- */
.pill-pending {
@apply inline-flex items-center gap-1 bg-status-warn-bg text-status-warn text-xs font-medium px-2 py-0.5 rounded-sm;
@apply inline-flex items-center gap-1 bg-status-warn-bg text-[#92600A] text-xs font-medium px-2 py-0.5 rounded-sm;
}
.drop-area {
@@ -292,21 +295,21 @@ h3 { @apply text-2xl md:text-3xl; }
.action-card:hover {
transform: translateY(-3px);
box-shadow: var(--shadow-md);
border-color: #cfc7ad;
border-color: var(--brass);
}
.action-card .ac-icon { font-size: 30px; margin-bottom: 10px; color: var(--emerald); }
.action-card .ac-icon { font-size: 30px; margin-bottom: 10px; color: var(--brass); }
.action-card .ac-title { font-weight: 600; color: var(--navy); font-size: 15px; }
.action-card .ac-desc { font-size: 12px; color: var(--muted); margin-top: 4px; }
.action-card.personal { border-top: 3px solid var(--emerald); }
.action-card.business { border-top: 3px solid var(--brass); }
.action-card.personal { border-top: 3px solid var(--brass); }
.action-card.business { border-top: 3px solid #0EA5E9; }
@media(max-width:480px) { .action-grid { grid-template-columns: 1fr; } }
/* -------------------------------- */
/* Upload Components (Pre-existing) */
/* -------------------------------- */
.doc-slot { display:flex; align-items:center; gap:14px; padding:14px 18px; border:1.5px solid var(--border); border-radius:var(--radius-md); background:var(--card); margin-bottom:10px; transition:border-color var(--transition), background var(--transition); }
.doc-slot:hover { border-color:#cfc7ad; background:var(--paper); }
.doc-slot-icon { font-size:22px; flex-shrink:0; color: var(--emerald); }
.doc-slot:hover { border-color:var(--brass); background:var(--paper); }
.doc-slot-icon { font-size:22px; flex-shrink:0; color: var(--brass); }
.doc-slot-info { flex:1; min-width:0; }
.doc-slot-name { font-weight:600; font-size:13px; color:var(--navy); }
.doc-slot-status { font-size:12px; color:var(--muted); margin-top:3px; }
@@ -318,7 +321,7 @@ h3 { @apply text-2xl md:text-3xl; }
.toast { background: var(--card); color: var(--navy); padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); border: 1px solid var(--border); display: flex; align-items: center; gap: 12px; pointer-events: auto; min-width: 300px; max-width: 90vw; animation: fadeUp 0.3s ease both; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }
.toast-info { border-left: 4px solid var(--emerald); }
.toast-info { border-left: 4px solid var(--brass); }
.toast-message { flex: 1; font-size: 14px; font-weight: 500; }
.toast-close { background: none; border: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
@@ -375,8 +378,8 @@ h3 { @apply text-2xl md:text-3xl; }
}
.tab-btn.active {
color: var(--emerald);
border-bottom-color: var(--emerald);
color: var(--brass);
border-bottom-color: var(--brass);
}
.card-title {
@@ -385,6 +388,6 @@ h3 { @apply text-2xl md:text-3xl; }
}
.footer-copy {
color: #8c9289; /* Increased contrast for footer copyright */
color: var(--muted);
}
+208 -15
View File
@@ -4,27 +4,220 @@ import { useAuth } from '../context/AuthContext';
export default function DashboardLayout() {
const { user, logout } = useAuth();
const navigate = useNavigate();
const { pathname } = useLocation();
const location = useLocation();
const { pathname } = location;
const isAdmin = user?.role === 'admin' || user?.role === 'super_admin';
return (
<div className="app-body">
<header className="app-header">
<Link to={(user?.role === 'admin' || user?.role === 'super_admin') ? '/admin-dashboard' : '/dashboard'}>
<img className="logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro" width="190" height="64" />
</Link>
<div className="header-actions">
<button className="btn btn-secondary btn-sm" onClick={() => navigate('/profile')}>
My Profile
</button>
<button className="btn btn-primary btn-sm" onClick={logout}>
Logout
</button>
<div className="app-body dash-page-wash" style={{ minHeight: '100vh', display: 'flex', flexDirection: 'column' }}>
{/* Top Advisory Strip */}
<div className="artha-top-alert" style={{ padding: '6px 16px', fontSize: '11.5px' }}>
<div className="artha-top-alert-inner" style={{ justifyContent: 'space-between' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="dash-top-badge" style={{ fontSize: '9.5px', padding: '2px 8px' }}>
{isAdmin ? 'ADMINISTRATOR CONSOLE' : 'SECURE CLIENT VAULT'}
</span>
<span style={{ color: 'rgba(255,255,255,0.85)' }}>
2026 Tax Season &bull; SOC-2 &amp; 256-Bit SSL Encrypted
</span>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12px', color: 'rgba(255,255,255,0.75)' }}>
<span className="material-symbols-outlined" style={{ fontSize: '14px', color: '#10B981' }}>verified_user</span>
<span>256-Bit SSL Encrypted Session</span>
</div>
</div>
</div>
{/* Main Header */}
<header
className="app-header dash-header"
style={{
position: 'sticky',
top: 0,
zIndex: 200,
padding: '12px clamp(16px, 4vw, 36px)',
height: 'auto'
}}
>
<div style={{ width: '100%', maxWidth: '1400px', margin: '0 auto' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '16px' }}>
{/* Brand Identity */}
<Link
to={isAdmin ? '/admin-dashboard' : '/dashboard'}
style={{ textDecoration: 'none' }}
>
<div className="artha-brand-wrap">
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
className="dash-brand-logo-img"
width="36"
height="36"
/>
<div className="artha-brand-text">
<span className="artha-brand-title" style={{ fontSize: '18px' }}>ABC CPA</span>
<span className="artha-brand-sub" style={{ fontSize: '10px' }}>
{isAdmin ? 'Partner & Staff Portal' : 'Secure Client Vault'}
</span>
</div>
</div>
</Link>
{/* User Profile Pill & Actions */}
<div className="header-actions" style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<div
style={{
display: 'flex',
alignItems: 'center',
gap: '8px',
background: '#FFFFFF',
border: '1px solid rgba(10, 37, 64, 0.1)',
borderRadius: '9999px',
padding: '4px 12px 4px 6px',
cursor: 'pointer'
}}
onClick={() => navigate('/profile')}
title="View & Edit Profile"
>
<div
style={{
width: '28px',
height: '28px',
borderRadius: '50%',
background: '#1D4ED8',
color: '#FFFFFF',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: '12px',
fontWeight: 700
}}
>
{(user?.name || user?.email || 'U').charAt(0).toUpperCase()}
</div>
<div style={{ display: 'flex', flexDirection: 'column', lineHeight: 1.1 }}>
<span style={{ fontSize: '12.5px', fontWeight: 600, color: '#0A2540' }}>
{user?.name || user?.email?.split('@')[0]}
</span>
<span style={{ fontSize: '9.5px', textTransform: 'uppercase', letterSpacing: '0.06em', color: '#1D4ED8', fontWeight: 700 }}>
{user?.role === 'super_admin' ? 'Super Admin' : user?.role === 'admin' ? 'Staff CPA' : 'Client'}
</span>
</div>
</div>
<button
className="artha-pill-btn artha-pill-dark"
style={{ padding: '7px 14px', fontSize: '12.5px' }}
onClick={logout}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>logout</span>
Logout
</button>
</div>
</div>
{/* Subnavigation Bar */}
<nav className="dash-subnav-group" style={{ marginTop: '12px', flexWrap: 'wrap' }}>
{!isAdmin ? (
<>
<Link
to="/dashboard"
className={`dash-subnav-link ${pathname === '/dashboard' ? 'active' : ''}`}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>dashboard</span>
Client Overview
</Link>
<Link
to="/upload-personal"
className={`dash-subnav-link ${pathname === '/upload-personal' ? 'active' : ''}`}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>person</span>
Personal Documents (1040/W-2)
</Link>
<Link
to="/upload-business"
className={`dash-subnav-link ${pathname === '/upload-business' ? 'active' : ''}`}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>business</span>
Business Ledgers (1120-S/P&amp;L)
</Link>
<Link
to="/profile"
className={`dash-subnav-link ${pathname === '/profile' ? 'active' : ''}`}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>manage_accounts</span>
Profile &amp; Security
</Link>
</>
) : (
<>
<Link
to="/admin-dashboard"
className={`dash-subnav-link ${pathname.startsWith('/admin') ? 'active' : ''}`}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>group</span>
Client Management &amp; Reviews
</Link>
<Link
to="/profile"
className={`dash-subnav-link ${pathname === '/profile' ? 'active' : ''}`}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>manage_accounts</span>
Staff Account
</Link>
</>
)}
</nav>
</div>
</header>
<main key={pathname} className={`${(user?.role === 'admin' || user?.role === 'super_admin') ? 'page-main-wide' : 'page-main'} page-enter`}>
<Outlet />
{/* Main Content Area */}
<main
style={{
flex: 1,
width: 'min(1400px, 94%)',
margin: '16px auto 48px'
}}
>
<div className="page-enter" key={location.pathname}>
<Outlet />
</div>
</main>
{/* Portal Executive Footer */}
<footer
style={{
borderTop: '1px solid rgba(10, 37, 64, 0.08)',
background: 'rgba(246, 249, 252, 0.8)',
padding: '20px clamp(16px, 4vw, 36px)',
marginTop: 'auto'
}}
>
<div
style={{
maxWidth: '1400px',
margin: '0 auto',
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
flexWrap: 'wrap',
gap: '12px',
fontSize: '12.5px',
color: '#425466'
}}
>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px', color: '#047857' }}>lock</span>
<span>ABC CPA &bull; Secure Client Document Vault &bull; SOC-2 Aligned</span>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
<span>AICPA Member Firm</span>
<span>&bull;</span>
<span>McKinney &amp; Frisco, Texas</span>
</div>
</div>
</footer>
</div>
);
}
+5 -3
View File
@@ -3,12 +3,14 @@ import Navbar from '../components/Navbar';
import Footer from '../components/Footer';
export default function MarketingLayout() {
const { pathname } = useLocation();
const location = useLocation();
return (
<>
<Navbar />
<main key={pathname} className="page-enter">
<Outlet />
<main>
<div className="page-enter" key={location.pathname}>
<Outlet />
</div>
</main>
<Footer />
</>
+11 -3
View File
@@ -1,4 +1,12 @@
import { Outlet } from 'react-router-dom';
export default function PublicLayout() { return <main>
import { Outlet, useLocation } from 'react-router-dom';
export default function PublicLayout() {
const location = useLocation();
return (
<main>
<div className="page-enter" key={location.pathname}>
<Outlet />
</main>; }
</div>
</main>
);
}
+190 -63
View File
@@ -1,77 +1,204 @@
import { useNavigate } from 'react-router-dom';
export default function AboutUs() {
const navigate = useNavigate();
const milestones = [
{
year: '1998',
title: 'Foundations of Accounting & Statutory Compliance',
image: '/images/about-us-block-1.webp',
desc: 'Our journey began as a Chartered Accountant practice built on strict principles of accounting integrity, statutory accuracy, and enduring client partnerships. Over two decades, we served hundreds of businesses through complex regulatory evolutions.'
},
{
year: '2018',
title: 'Institutional Scale & Cloud Modernization',
image: '/images/services-2.webp',
desc: 'Responding to rising demand for structured financial outsourcing, we expanded operations into Pune and Mumbai. We transitioned traditional accounting into scalable, cloud-first workflows leveraging QuickBooks, Xero, and structured standard operating procedures.'
},
{
year: '2023',
title: 'Dual US-India Cross-Border Expansion',
image: '/images/young-business-people-using-computer-in-office.webp',
desc: 'To support global founders, expat families, and multinational firms, we established our US presence in McKinney and Frisco, Texas. We engineered specialized advisory for international tax treaties, FBAR/FATCA filings, and dual-entity tax minimization.'
},
{
year: 'Today',
title: 'AI-Enabled Precision & Executive Advisory',
image: '/images/services-block-3.webp',
desc: 'We combine seasoned CPA and Chartered Accountant leadership with proprietary AI statement ingestion, transforming raw bank statements into reconciled, audit-ready financial statements in minutes while delivering strategic fractional CFO advisory.'
}
];
const credentials = [
{ title: '27+ Years of Practice', desc: 'Over a quarter-century of proven financial, audit, and tax compliance leadership.' },
{ title: 'Dual US & India Hubs', desc: 'Seamless cross-border coordination across Texas (US) and Pune (India).' },
{ title: 'AICPA Member Firm', desc: 'Adhering to the highest professional, ethical, and accounting industry benchmarks.' },
{ title: 'SOC-2 Aligned Security', desc: '256-bit encrypted document portals protecting your sensitive financial data.' }
];
return (
<>
<div className="page-hero" style={{ '--hero-img': 'url("/images/About-us-background-image.webp")' }}>
<div className="page-hero-inner">
<span className="eyebrow">About BookKeepPro</span>
<h1>Our people are passionate about what we do</h1>
<p>Twenty-seven years of accounting, compliance and long-term client relationships.</p>
<div className="artha-about-page" style={{ background: 'var(--paper, #F6F9FC)', minHeight: '100vh', paddingBottom: '50px' }}>
{/* Header Banner */}
<section style={{ padding: '36px 0 24px', borderBottom: '1px solid rgba(10, 37, 64,0.07)' }}>
<div style={{ width: 'min(1280px, 94%)', margin: '0 auto', textAlign: 'center' }}>
<div className="artha-eyebrow-pill">
<span className="dot"></span>
OUR FIRM &amp; HERITAGE
</div>
<h1 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: 'clamp(23px, 2.3vw, 32px)', color: '#0A2540', fontWeight: 600, margin: '10px 0' }}>
Rooted in Precision. Built for Global Scale.
</h1>
<p style={{ maxWidth: '580px', margin: '0 auto', color: '#425466', fontSize: '13.5px', lineHeight: 1.6 }}>
For over 27 years, we have guided founders, growing businesses, and international families through complex tax codes, compliance mandates, and financial transformations.
</p>
</div>
</section>
{/* Main Heritage Card with Real Image */}
<div className="reveal" style={{ width: 'min(1280px, 94%)', margin: '40px auto 0' }}>
<div
style={{
background: '#FFFFFF',
border: '1px solid rgba(10, 37, 64, 0.08)',
borderRadius: '20px',
padding: 'clamp(24px, 2.8vw, 38px)',
boxShadow: '0 4px 20px -2px rgba(10, 37, 64, 0.04)',
display: 'grid',
gridTemplateColumns: '1.1fr 0.9fr',
gap: '36px',
alignItems: 'center'
}}
>
<div>
<span className="artha-service-pill-tag">WHO WE ARE</span>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: 'clamp(19px, 2vw, 25px)', color: '#0A2540', fontWeight: 600, margin: '8px 0 12px' }}>
Your proactive partner in financial strategy
</h2>
<p style={{ color: '#425466', fontSize: '13.5px', lineHeight: 1.6, marginBottom: '12px' }}>
Accounting shouldn&apos;t be an afterthought relegated to tax season. At ABC CPA &amp; Advisory, we act as an extension of your leadership team &mdash; analyzing entity efficiency, identifying immediate deductions, and untangling multi-jurisdiction liabilities before deals close.
</p>
<p style={{ color: '#425466', fontSize: '13.5px', lineHeight: 1.6, marginBottom: '20px' }}>
With dedicated offices in Texas and India, our dual operating model delivers round-the-clock responsiveness, strict quality controls, and unmatched cross-border tax expertise.
</p>
<button className="artha-pill-btn artha-pill-primary" onClick={() => navigate('/contact')}>
Schedule a Consultation
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>
arrow_forward
</span>
</button>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
<div style={{ position: 'relative', width: '100%', height: '220px', borderRadius: '16px', overflow: 'hidden', boxShadow: '0 6px 20px rgba(10, 37, 64,0.08)' }}>
<img
src="/images/home-about.webp"
alt="Our Accounting Practice Team"
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
loading="lazy"
width="800"
height="533"
/>
<div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(135deg, rgba(10, 37, 64, 0.12) 0%, rgba(10, 37, 64, 0.22) 100%)', pointerEvents: 'none' }} />
</div>
<div style={{ background: '#0A2540', borderRadius: '16px', padding: '18px 18px', color: '#FFFFFF' }}>
<span style={{ fontFamily: 'var(--font-mono)', fontSize: '10.5px', textTransform: 'uppercase', letterSpacing: '0.12em', color: '#3B82F6' }}>
CORE BELIEF
</span>
<blockquote style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '15px', fontStyle: 'italic', lineHeight: 1.4, margin: '6px 0 8px', color: '#FFFFFF' }}>
&ldquo;The true measure of an accounting firm is not how fast they file forms, but how much value and peace of mind they generate before the filing occurs.&rdquo;
</blockquote>
<p style={{ fontSize: '11.5px', color: 'rgba(255,255,255,0.7)', margin: 0 }}>
&mdash; ABC CPA &amp; Advisory Leadership Team
</p>
</div>
</div>
</div>
</div>
<div className="about-wrapper">
<div className="about-block reveal">
<div className="about-text">
<span className="eyebrow">1998 — where it started</span>
<h2 style={{ margin: '14px 0' }}>Who we are</h2>
<p>
Our journey began in 1998 as a Chartered Accountant firm in India,
built on strong fundamentals of accounting, compliance, integrity,
and long-term client relationships.
</p>
<br />
<p>
In 2018, we strengthened our presence in Pune and Mumbai —
transitioning from a traditional CA practice into a scalable
financial services organization.
</p>
{/* Timeline Section with Visual Milestone Cards */}
<section className="reveal" style={{ width: 'min(1280px, 94%)', margin: '48px auto 0' }}>
<div style={{ textAlign: 'center', marginBottom: '32px' }}>
<div className="artha-eyebrow-pill">
<span className="dot"></span>
THE JOURNEY
</div>
<img className="about-img" src="/images/about-us-block-1.webp" alt="BookKeepPro Team" />
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: 'clamp(20px, 2.1vw, 27px)', color: '#0A2540', fontWeight: 600 }}>
Twenty-Seven Years in the Making
</h2>
</div>
<div className="about-block reverse reveal">
<div className="about-text">
<span className="eyebrow">2023 — going global</span>
<h2 style={{ margin: '14px 0' }}>About BookKeepPro</h2>
<p>
As our client base expanded globally — especially across the US —
we aligned our operating model to support international growth.
</p>
<br />
<p>
In 2023, we launched:<br /><br />
<b>Bookkeeping Business Solutions Pvt Ltd</b> (India)<br />
<b>Bookkeeping Business Solutions LLC</b> (USA)
</p>
<br />
<p>
Today, BookKeepPro serves global businesses, startups and
enterprises with scalable, compliant bookkeeping and financial
operations support.
</p>
</div>
<img className="about-img" src="/images/young-business-people-using-computer-in-office.webp" alt="About BookKeepPro" width="800" height="533" loading="lazy" />
</div>
</div>
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: '26px' }}>
{milestones.map((m, idx) => (
<div
key={idx}
className={`reveal-delay-${(idx % 4) + 1}`}
style={{
background: '#FFFFFF',
border: '1px solid rgba(10, 37, 64, 0.08)',
borderRadius: '22px',
padding: '24px',
boxShadow: '0 2px 14px -2px rgba(10, 37, 64, 0.04)',
display: 'flex',
flexDirection: 'column',
transition: 'transform 0.25s ease, box-shadow 0.25s ease'
}}
>
<div style={{ width: '100%', height: '160px', borderRadius: '14px', overflow: 'hidden', marginBottom: '16px' }}>
<img
src={m.image}
alt={m.title}
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
loading="lazy"
width="600"
height="400"
/>
</div>
<section className="section reveal" style={{ marginTop: 0, marginBottom: '90px' }}>
<div className="section-head" style={{ textAlign: 'center', margin: '0 auto 32px', maxWidth: '640px' }}>
<span className="eyebrow" style={{ justifyContent: 'center' }}>Where we stand today</span>
<h2>Who we are today</h2>
</div>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '16px', justifyContent: 'center' }}>
{[
'27+ years of accounting & compliance expertise',
'Operations across India and the USA',
'Secure, process-driven financial workflows',
'Strong confidentiality & data protection practices',
].map((item) => (
<p key={item} className="badge badge-blue" style={{ padding: '12px 22px', fontSize: '13.5px', fontWeight: 500, letterSpacing: 0 }}>
{item}
</p>
<div
style={{
fontFamily: 'var(--font-mono)',
fontSize: '22px',
fontWeight: 600,
color: '#1D4ED8',
marginBottom: '6px'
}}
>
{m.year}
</div>
<h3 style={{ fontSize: '16px', fontWeight: 600, color: '#0A2540', marginBottom: '10px', lineHeight: 1.3 }}>
{m.title}
</h3>
<p style={{ fontSize: '13.5px', color: '#425466', lineHeight: 1.6, margin: 0 }}>
{m.desc}
</p>
</div>
))}
</div>
</section>
</>
{/* Trust Pillars */}
<section style={{ width: 'min(1280px, 94%)', margin: '48px auto 0' }}>
<div style={{ background: '#F6F9FC', border: '1px solid rgba(10, 37, 64, 0.08)', borderRadius: '20px', padding: '30px 24px' }}>
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))', gap: '28px' }}>
{credentials.map((c, i) => (
<div key={i} style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>
<span className="material-symbols-outlined" style={{ color: '#1D4ED8', fontSize: '28px' }}>
verified_user
</span>
<h4 style={{ fontSize: '16px', fontWeight: 600, color: '#0A2540', margin: '4px 0 0 0' }}>
{c.title}
</h4>
<p style={{ fontSize: '13px', color: '#425466', margin: 0, lineHeight: 1.5 }}>
{c.desc}
</p>
</div>
))}
</div>
</div>
</section>
</div>
);
}
+538 -277
View File
@@ -4,6 +4,7 @@ import { useNavigate } from 'react-router-dom';
import DOMPurify from 'dompurify';
import { useToast } from '../context/ToastContext';
import ConfirmModal from '../components/ConfirmModal';
import CountUp from '../components/CountUp';
export default function AdminDashboard() {
const { authFetch, user: currentUser } = useAuth();
@@ -12,7 +13,7 @@ export default function AdminDashboard() {
const [confirmConfig, setConfirmConfig] = useState({
isOpen: false, title: "", message: "", confirmText: "OK", isDestructive: false, onConfirm: () => {}
});
// activeTab state removed (unused)
const [stats, setStats] = useState({ total_users: 0, pending_personal: 0, pending_business: 0, admins: 0 });
const [bookmarks, setBookmarks] = useState([]);
const [users, setUsers] = useState([]);
@@ -77,7 +78,7 @@ export default function AdminDashboard() {
const [tplFile, setTplFile] = useState(null);
const [tplLoading, setTplLoading] = useState(false);
const [digestHtml, setDigestHtml] = useState(null);
const [digestHtml, setDigestHtml] = useState(null);
const [digestLoading, setDigestLoading] = useState(false);
const fetchDigest = useCallback(async () => {
@@ -87,7 +88,7 @@ export default function AdminDashboard() {
if (res.ok) {
const data = await res.json();
setDigestHtml(data.digest);
showToast("Daily digest generated successfully!", "success");
showToast("AI Daily briefing generated successfully!", "success");
} else {
const err = await res.json().catch(() => ({}));
showToast(err.detail || "Failed to generate daily digest", "error");
@@ -125,8 +126,8 @@ export default function AdminDashboard() {
setBookmarks(payload.bookmarks || []);
}
let newUsersArray = users;
let adminsCount = stats.admins;
let newUsersArray = [];
let adminsCount = 0;
if (usersRes.ok) {
const payload = await usersRes.json();
@@ -144,8 +145,7 @@ export default function AdminDashboard() {
admins: statsData.admin_accounts
});
} else {
// Fallback to local computation if admin-status fails
const total = newUsersArray.length;
const total = newUsersArray.length;
const pendingP = newUsersArray.reduce((acc, u) => acc + (u.pending_personal || 0), 0);
const pendingB = newUsersArray.reduce((acc, u) => acc + (u.pending_business || 0), 0);
setStats({ total_users: total, pending_personal: pendingP, pending_business: pendingB, admins: adminsCount });
@@ -202,7 +202,8 @@ export default function AdminDashboard() {
if (res.ok) {
setTplName("");
setTplFile(null);
document.getElementById("tplFile").value = "";
const fileInput = document.getElementById("tplFile");
if (fileInput) fileInput.value = "";
loadTemplates();
showToast("Template uploaded successfully", "success");
} else {
@@ -243,7 +244,6 @@ export default function AdminDashboard() {
const yearOptions = [currentYear - 1, currentYear, currentYear + 1];
const filteredUsers = users.filter(u => {
// Stat Card Filters
if (userFilter === 'admin' && u.role !== 'admin' && u.role !== 'super_admin') return false;
if (userFilter === 'pending_personal' && !(u.pending_personal > 0)) return false;
if (userFilter === 'pending_business' && !(u.pending_business > 0)) return false;
@@ -259,56 +259,254 @@ export default function AdminDashboard() {
const bPending = (b.pending_personal || 0) + (b.pending_business || 0);
return bPending - aPending;
}
// Default fallback to ID if created_at is missing
if (userSort === 'newest') return (b.id || 0) - (a.id || 0);
if (userSort === 'oldest') return (a.id || 0) - (b.id || 0);
return 0;
});
return (
<div className="">
<div>
<ConfirmModal
{...confirmConfig}
onCancel={() => setConfirmConfig(prev => ({ ...prev, isOpen: false }))}
/>
<h1 style={{
margin: '0 0 32px 0',
fontSize: '42px',
fontFamily: 'var(--font-display)',
fontWeight: '800',
color: 'var(--ink)',
textAlign: 'center',
letterSpacing: '-0.5px'
}}>
Admin Dashboard <span style={{ color: 'var(--brass)', fontWeight: 600, fontSize: '32px' }}>{tab === 'templates' ? '| Templates' : ''}</span>
</h1>
<div style={{ display: 'flex', justifyContent: 'flex-end', marginBottom: '24px', flexWrap: 'wrap', gap: '16px' }}>
{/* ================= EXECUTIVE ADMIN HERO ================= */}
<section className="dash-hero dash-rise" style={{ '--i': 0, marginBottom: '24px' }}>
<div className="dash-hero-content">
<div className="dash-hero-eyebrow">
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>verified_user</span>
PARTNER &amp; STAFF PRACTICE CONSOLE
</div>
<h1 className="dash-hero-title">Client Management &amp; Tax Review</h1>
<p className="dash-hero-sub">
Monitor client document vaults, allocate staff CPAs, review AI statement ingestion, and finalize returns for TY {filterYear}.
</p>
<div className="dash-hero-badges" style={{ marginTop: '18px' }}>
<span className="dash-glass-pill">
<span className="material-symbols-outlined" style={{ fontSize: '15px', color: '#60A5FA' }}>shield</span>
Executive Control
</span>
<span className="dash-glass-pill">
<span className="material-symbols-outlined" style={{ fontSize: '15px', color: '#34D399' }}>verified</span>
CPA Workpapers
</span>
<span className="dash-glass-pill">
<span className="material-symbols-outlined" style={{ fontSize: '15px', color: '#C4B5FD' }}>auto_awesome</span>
AI Ingestion Active
</span>
</div>
</div>
<div style={{ display: 'flex', gap: '12px', alignItems: 'center', flexWrap: 'wrap', zIndex: 1 }}>
{/* Tax Year Glass Select */}
<select
value={filterYear}
onChange={(e) => setFilterYear(e.target.value)}
className="dash-glass-select dash-focusable"
aria-label="Filter Tax Year"
>
{yearOptions.map(y => (
<option key={y} value={y}>Tax Year {y}</option>
))}
</select>
{/* AI Daily Briefing Button */}
<button
className="dash-hero-ai-btn dash-focusable"
onClick={fetchDigest}
disabled={digestLoading}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>auto_awesome</span>
{digestLoading ? 'Analyzing...' : 'AI Daily Briefing'}
</button>
</div>
</section>
{/* Daily Digest Drawer / Box */}
{digestHtml && (
<section className="dash-card dash-digest-drawer" style={{ marginBottom: '24px' }}>
<div className="dash-digest-header">
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<div className="dash-chip dash-chip--violet" style={{ width: '32px', height: '32px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>auto_awesome</span>
</div>
<div>
<strong style={{ fontSize: '14px', color: '#0A2540' }}>AI Executive Daily Briefing</strong>
<span style={{ fontSize: '12px', color: '#6D28D9', marginLeft: '8px', fontWeight: 600 }}>TY {filterYear} Digest</span>
</div>
</div>
<button
className="dash-table-action-btn dash-focusable"
onClick={() => setDigestHtml(null)}
title="Dismiss Briefing"
aria-label="Dismiss Briefing"
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>close</span>
</button>
</div>
<div
style={{ padding: '20px 24px', fontSize: '13.5px', color: '#0A2540', lineHeight: 1.7 }}
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(digestHtml) }}
/>
</section>
)}
{/* ================= EXECUTIVE KPI METRICS BAR ================= */}
<div className="dash-kpis dash-rise" style={{ '--i': 1, marginTop: 0, marginBottom: '24px' }}>
{/* Total Clients */}
<div
className={`dash-card dash-kpi-card dash-kpi-card--blue ${userFilter === 'all' ? 'dash-kpi-card--active' : ''}`}
style={{ cursor: 'pointer' }}
onClick={() => setUserFilter('all')}
>
<div className="dash-kpi-bar dash-kpi-bar--blue" />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Total Clients</span>
<div className="dash-chip dash-chip--blue">
<span className="material-symbols-outlined">group</span>
</div>
</div>
<div className="dash-kpi-value">
<CountUp value={stats.total_users} />
</div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', fontSize: '12px' }}>
<span style={{ color: userFilter === 'all' ? '#1D4ED8' : '#425466', fontWeight: 600 }}>
{userFilter === 'all' ? 'Active Filter: All' : 'Click to filter all'}
</span>
</div>
</div>
{/* Pending Personal */}
<div
className={`dash-card dash-kpi-card dash-kpi-card--amber ${userFilter === 'pending_personal' ? 'dash-kpi-card--active' : ''}`}
style={{ cursor: 'pointer' }}
onClick={() => setUserFilter('pending_personal')}
>
<div className="dash-kpi-bar dash-kpi-bar--amber" />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Pending Personal</span>
<div className="dash-chip dash-chip--amber">
<span className="material-symbols-outlined">person_search</span>
</div>
</div>
<div className="dash-kpi-value" style={{ color: '#92600A' }}>
<CountUp value={stats.pending_personal} />
{stats.pending_personal > 0 && <span className="dash-pulse-dot dash-pulse-dot--amber" />}
</div>
<div style={{ fontSize: '12px', color: '#425466' }}>
Awaiting CPA Form Review
</div>
</div>
{/* Pending Business */}
<div
className={`dash-card dash-kpi-card dash-kpi-card--teal ${userFilter === 'pending_business' ? 'dash-kpi-card--active' : ''}`}
style={{ cursor: 'pointer' }}
onClick={() => setUserFilter('pending_business')}
>
<div className="dash-kpi-bar dash-kpi-bar--teal" />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Pending Business</span>
<div className="dash-chip dash-chip--teal">
<span className="material-symbols-outlined">business_center</span>
</div>
</div>
<div className="dash-kpi-value" style={{ color: '#0D9488' }}>
<CountUp value={stats.pending_business} />
{stats.pending_business > 0 && <span className="dash-pulse-dot dash-pulse-dot--teal" />}
</div>
<div style={{ fontSize: '12px', color: '#425466' }}>
Bank Statements &amp; Ledgers
</div>
</div>
{/* Staff Admins */}
<div
className={`dash-card dash-kpi-card dash-kpi-card--slate ${userFilter === 'admin' ? 'dash-kpi-card--active' : ''}`}
style={{ cursor: 'pointer' }}
onClick={() => setUserFilter('admin')}
>
<div className="dash-kpi-bar dash-kpi-bar--slate" />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Staff Admins</span>
<div className="dash-chip dash-chip--slate">
<span className="material-symbols-outlined">admin_panel_settings</span>
</div>
</div>
<div className="dash-kpi-value" style={{ color: '#425466' }}>
<CountUp value={stats.admins} />
</div>
<div style={{ fontSize: '12px', color: '#425466' }}>
Active Advisory Accounts
</div>
</div>
</div>
{/* ================= TAB CONTROLS ================= */}
<div className="dash-rise" style={{ '--i': 2, marginBottom: '20px' }}>
<div className="dash-tabs" role="tablist">
<button
role="tab"
aria-selected={tab === 'users'}
className={`dash-tab-btn ${tab === 'users' ? 'active' : ''}`}
onClick={() => setTab('users')}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>group</span>
Client Dossiers ({filteredUsers.length})
</button>
<button
role="tab"
aria-selected={tab === 'bookmarks'}
className={`dash-tab-btn ${tab === 'bookmarks' ? 'active' : ''}`}
onClick={() => setTab('bookmarks')}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px', color: tab === 'bookmarks' ? '#B7791F' : 'inherit' }}>star</span>
Bookmarked Vault Documents ({bookmarks.length})
</button>
<button
role="tab"
aria-selected={tab === 'templates'}
className={`dash-tab-btn ${tab === 'templates' ? 'active' : ''}`}
onClick={() => setTab('templates')}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>description</span>
Statutory Templates &amp; Organizers
</button>
</div>
</div>
{/* ================= USERS OVERVIEW TAB ================= */}
{tab === 'users' && (
<div style={{ display: 'flex', gap: '12px', width: '100%', maxWidth: '820px', flexWrap: 'wrap' }}>
<div className="search-wrap" style={{ flex: 1, minWidth: '180px', position: 'relative' }}>
<span className="material-symbols-outlined search-icon" style={{position: 'absolute', left: '12px', top: '50%', transform: 'translateY(-50%)', color: 'var(--muted)', fontSize: '20px'}}>search</span>
<input
type="text"
className="search-input"
style={{ width: '100%', padding: '10px 12px 10px 40px', border: '1px solid var(--border)', borderRadius: 'var(--radius-pill)', outline: 'none' }}
placeholder="Search by name or email"
<div className="dash-tab-panel">
{/* Search & Filter Bar */}
<div className="dash-toolbar" style={{ marginBottom: '20px' }}>
{/* Search Input */}
<div className="dash-input-wrap">
<span className="material-symbols-outlined search-icon">search</span>
<input
type="text"
placeholder="Search clients by name, business, or email..."
value={search}
onChange={(e) => setSearch(e.target.value)}
className="dash-input dash-focusable"
/>
</div>
{/* Admin Assignment Filter */}
{isSuperAdmin ? (
<select
className="select-input"
style={{ width: 'auto', padding: '10px 16px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', outline: 'none', background: 'white' }}
<select
value={adminAssignmentFilter}
onChange={(e) => setAdminAssignmentFilter(e.target.value)}
title="Filter by assigned administrator"
className="dash-select dash-focusable"
aria-label="Filter by assigned staff administrator"
>
<option value="all">👥 All Administrators</option>
<option value="all">👥 All Staff Administrators</option>
<option value="unassigned">⚠️ Unassigned Clients</option>
<optgroup label="Staff Admins">
<optgroup label="Staff CPAs">
{staffList.map(s => (
<option key={s.id} value={s.id}>
{s.name || s.email} ({s.assigned_clients_count || 0} clients)
@@ -317,297 +515,360 @@ export default function AdminDashboard() {
</optgroup>
</select>
) : (
<select
className="select-input"
style={{ width: 'auto', padding: '10px 16px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', outline: 'none', background: 'white' }}
<select
value={adminAssignmentFilter}
onChange={(e) => setAdminAssignmentFilter(e.target.value)}
className="dash-select dash-focusable"
aria-label="Filter by assigned administrator"
>
<option value="all">My Assigned Clients</option>
<option value="unassigned">Unassigned Clients</option>
</select>
)}
<select
className="select-input"
style={{ width: 'auto', padding: '10px 16px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', outline: 'none', background: 'white' }}
{/* Sort Dropdown */}
<select
value={userSort}
onChange={(e) => setUserSort(e.target.value)}
className="dash-select dash-focusable"
aria-label="Sort clients"
>
<option value="newest">Newest First</option>
<option value="oldest">Oldest First</option>
<option value="highest_pending">Highest Pending</option>
<option value="asc">Name (A-Z)</option>
<option value="desc">Name (Z-A)</option>
</select>
<select
className="select-input"
style={{ width: 'auto', padding: '10px 16px', borderRadius: 'var(--radius-pill)', border: '1px solid var(--border)', outline: 'none', background: 'white' }}
value={filterYear}
onChange={(e) => setFilterYear(e.target.value)}
>
<option value={currentYear - 1}>TY {currentYear - 1}</option>
<option value={currentYear}>TY {currentYear}</option>
<option value={currentYear + 1}>TY {currentYear + 1}</option>
<option value="highest_pending">Highest Pending Filings</option>
<option value="asc">Name (A &rarr; Z)</option>
<option value="desc">Name (Z &rarr; A)</option>
</select>
</div>
)}
</div>
<div className="tab-bar">
<button className={`tab-btn ${tab === 'users' ? 'active' : ''}`} onClick={() => setTab('users')}>
<span className="material-symbols-outlined">group</span> Users Overview
</button>
<button className={`tab-btn ${tab === 'bookmarks' ? 'active' : ''}`} onClick={() => setTab('bookmarks')}>
<span className="material-symbols-outlined">star</span> Bookmarks
</button>
<button className={`tab-btn ${tab === 'templates' ? 'active' : ''}`} onClick={() => setTab('templates')}>
<span className="material-symbols-outlined">description</span> Templates
</button>
</div>
{/* Users Tab */}
{tab === 'bookmarks' && (
<div style={{marginTop: '16px'}}>
<h2 style={{fontFamily: 'var(--font-display)', fontSize:'28px', fontWeight:700, color:'var(--navy)', marginBottom:'24px', display:'flex', alignItems:'center', gap:'12px', letterSpacing: '-0.5px'}}>
<span className="material-symbols-outlined" style={{color:'var(--orange)', fontSize:'32px'}}>star</span>
Bookmarked Documents
</h2>
{bookmarks.length === 0 ? (
<div className="card shadow-sm p-lg" style={{textAlign: 'center', padding: '48px 24px'}}>
<span className="material-symbols-outlined" style={{fontSize: '48px', color: 'var(--border)'}}>star_border</span>
<p style={{color:'var(--text-light)', marginTop: '16px', fontSize: '16px'}}>No bookmarked documents found.</p>
</div>
) : (
<div className="users-grid" style={{display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))', gap: '20px'}}>
{bookmarks.map((b) => (
<div key={`${b.type}-${b.id}`} className="user-card stagger fade-up" style={{background: 'var(--surface)', padding: '24px', borderRadius: '16px', boxShadow: '0 4px 12px rgba(0,0,0,0.05)', cursor: 'pointer', transition: 'transform 0.2s, box-shadow 0.2s', display: 'flex', flexDirection: 'column'}} onClick={() => navigate(`/admin-user-detail?user_id=${b.user_id}`)}
onMouseOver={(e) => { e.currentTarget.style.transform = 'translateY(-2px)'; e.currentTarget.style.boxShadow = '0 8px 24px rgba(0,0,0,0.1)'; }}
onMouseOut={(e) => { e.currentTarget.style.transform = 'none'; e.currentTarget.style.boxShadow = '0 4px 12px rgba(0,0,0,0.05)'; }}
>
<div className="user-top" style={{alignItems: 'flex-start', display: 'flex', gap: '16px'}}>
<div className="user-avatar" style={{background: 'var(--orange-light)', color: 'var(--orange)', borderRadius: '12px', width: '48px', height: '48px', display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0}}>
<span className="material-symbols-outlined" style={{fontSize: '24px'}}>description</span>
</div>
<div className="user-info" style={{flex: 1}}>
<div className="u-name" style={{fontSize: '16px', fontWeight: 700, color: 'var(--navy)', wordBreak: 'break-word'}}>{b.filename || b.doc_name}</div>
<div className="u-email" style={{fontSize: '14px', color: 'var(--muted)', marginTop: '6px', display: 'flex', alignItems: 'center', gap: '4px'}}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>person</span> {b.user_name}
</div>
{/* Client Cards Grid */}
{loading ? (
<div className="dash-clients-grid">
{[1, 2, 3, 4, 5, 6].map(n => (
<div key={n} className="dash-card dash-client-card" style={{ height: '180px' }}>
<div style={{ display: 'flex', gap: '12px' }}>
<div className="dash-skeleton" style={{ width: '44px', height: '44px', borderRadius: '50%' }} />
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: '8px' }}>
<div className="dash-skeleton" style={{ height: '16px', width: '60%' }} />
<div className="dash-skeleton" style={{ height: '13px', width: '80%' }} />
</div>
</div>
<div className="user-bottom" style={{marginTop: 'auto', paddingTop: '16px', borderTop: '1px solid var(--border)', display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: '8px'}}>
<span className={`badge ${b.type === 'personal' ? 'badge-blue' : b.type === 'business' ? 'badge-green' : 'badge-gray'}`} style={{textTransform:'uppercase', fontSize: '12px'}}>
{b.type}
</span>
<span className="badge badge-gray" style={{fontSize: '12px', background: 'white', border: '1px solid var(--border)', color: 'var(--text-light)'}}>
<span className="material-symbols-outlined" style={{fontSize:'14px', verticalAlign:'middle', marginRight: '4px'}}>calendar_today</span>
{new Date(b.uploaded_at).toLocaleDateString()}
</span>
<span style={{flex: 1}}></span>
<span className="material-symbols-outlined" style={{color: 'var(--orange)', fontSize: '20px'}}>arrow_forward</span>
</div>
<div className="dash-skeleton" style={{ height: '32px', width: '100%', borderRadius: '8px' }} />
</div>
))}
</div>
)}
</div>
)}
{tab === 'users' && (
<>
{/* Daily Digest */}
<div className="card" style={{ marginBottom: '20px', background: 'var(--emerald-light)', border: '1px solid rgba(31,93,70,0.2)' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<span className="material-symbols-outlined" style={{ color: 'var(--emerald)', fontSize: '22px' }}>auto_awesome</span>
<div>
<div style={{ fontWeight: 700, fontSize: '14px', color: 'var(--navy)' }}>AI Daily Digest</div>
<div style={{ fontSize: '12px', color: 'var(--muted)' }}>Plain-English summary of today's activity</div>
</div>
) : filteredUsers.length === 0 ? (
<div className="dash-card dash-empty-state">
<div className="dash-empty-icon">
<span className="material-symbols-outlined" style={{ fontSize: '28px' }}>search_off</span>
</div>
<button className="btn btn-secondary btn-sm" onClick={fetchDigest} disabled={digestLoading} style={{ borderRadius: 'var(--radius-sm)' }}>
{digestLoading ? 'Generating…' : '✨ Generate Digest'}
</button>
<h4 style={{ fontSize: '16px', color: '#0A2540', margin: 0 }}>No matching clients found</h4>
<p style={{ fontSize: '13px', color: '#425466', maxWidth: '440px', margin: 0 }}>
Try adjusting your search criteria, tax year, or staff filter.
</p>
</div>
{digestHtml && (
<div style={{ marginTop: '12px', paddingTop: '12px', borderTop: '1px solid rgba(31,93,70,0.2)', fontSize: '13px', color: 'var(--navy)', lineHeight: '1.7' }}
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(digestHtml) }} />
)}
</div>
) : (
<div className="dash-clients-grid">
{filteredUsers.map((u, idx) => {
const avatarVariant = (u.id || 0) % 4;
const avatarClasses = [
'dash-avatar--brand',
'dash-avatar--success',
'dash-avatar--ai',
'dash-avatar--warm'
];
const avatarClass = avatarClasses[avatarVariant];
{/* Stats Bar */}
<div className="admin-stats">
<div className={`stat-card accent-blue ${userFilter === 'all' ? 'active-filter' : ''}`} onClick={() => setUserFilter('all')} style={{ cursor: 'pointer', border: userFilter === 'all' ? '2px solid var(--blue)' : 'none' }}>
<div className="stat-icon"><span className="material-symbols-outlined">group</span></div>
<div className="stat-value">{stats.total_users}</div>
<div className="stat-label">Total Users</div>
</div>
<div className={`stat-card accent-green ${userFilter === 'admin' ? 'active-filter' : ''}`} onClick={() => setUserFilter('admin')} style={{ cursor: 'pointer', border: userFilter === 'admin' ? '2px solid var(--green)' : 'none' }}>
<div className="stat-icon"><span className="material-symbols-outlined">security</span></div>
<div className="stat-value">{stats.admins}</div>
<div className="stat-label">Admin Accounts</div>
</div>
<div className={`stat-card accent-orange ${userFilter === 'pending_personal' ? 'active-filter' : ''}`} onClick={() => setUserFilter('pending_personal')} style={{ cursor: 'pointer', border: userFilter === 'pending_personal' ? '2px solid var(--orange)' : 'none' }}>
<div className="stat-icon"><span className="material-symbols-outlined">description</span></div>
<div className="stat-value">{stats.pending_personal}</div>
<div className="stat-label">Pending Personal</div>
</div>
<div className={`stat-card accent-orange ${userFilter === 'pending_business' ? 'active-filter' : ''}`} onClick={() => setUserFilter('pending_business')} style={{ cursor: 'pointer', border: userFilter === 'pending_business' ? '2px solid var(--orange)' : 'none' }}>
<div className="stat-icon"><span className="material-symbols-outlined">business</span></div>
<div className="stat-value">{stats.pending_business}</div>
<div className="stat-label">Pending Business</div>
</div>
</div>
return (
<div
key={u.id}
className="dash-card dash-client-card dash-rise"
style={{ '--i': idx, cursor: 'pointer' }}
onClick={() => navigate(`/admin-user-detail?user_id=${u.id}`)}
>
<div style={{ display: 'flex', alignItems: 'flex-start', gap: '14px' }}>
<div className={`dash-avatar ${avatarClass}`}>
{(u.name || "U").charAt(0).toUpperCase()}
</div>
{/* User Grid */}
<div className="users-grid">
{loading ? (
<div className="empty-state" style={{ gridColumn: '1/-1' }}>
<div className="empty-icon"><span className="material-symbols-outlined">pending</span></div>
<div className="empty-title">Loading users...</div>
</div>
) : filteredUsers.length === 0 ? (
<div className="empty-state" style={{ gridColumn: '1/-1' }}>
<div className="empty-title">No users found</div>
</div>
) : (
filteredUsers.map(u => (
<div key={u.id} className="user-card stagger fade-up" onClick={() => navigate(`/admin-user-detail?user_id=${u.id}`)}>
<div className="user-top">
<div className="user-avatar">{(u.name || "U").charAt(0).toUpperCase()}</div>
<div className="user-info">
<div className="u-name">{u.name || "—"}</div>
<div className="u-email">{u.email || "—"}</div>
</div>
</div>
<div className="user-bottom" style={{ display: 'flex', flexDirection: 'column', gap: '8px', alignItems: 'stretch' }}>
<div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', alignItems: 'center' }}>
<span className={`badge role-badge ${u.role === 'super_admin' ? 'badge-red' : u.role === 'admin' ? 'badge-orange' : 'badge-blue'}`}>
{u.role}
</span>
{u.pending_personal > 0 && (
<span className="badge badge-orange pulse" style={{ cursor: 'default' }}>
<span className="material-symbols-outlined" style={{fontSize:'12px', verticalAlign:'middle'}}>description</span>
{' '}{u.pending_personal} personal
</span>
)}
{u.pending_business > 0 && (
<span className="badge badge-orange pulse" style={{ cursor: 'default' }}>
<span className="material-symbols-outlined" style={{fontSize:'12px', verticalAlign:'middle'}}>business</span>
{' '}{u.pending_business} business
</span>
)}
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontWeight: 600, fontSize: '15px', color: '#0A2540', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{u.name || "Unnamed Client"}
</div>
<div style={{ fontSize: '13px', color: '#425466', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', marginTop: '2px' }}>
{u.email}
</div>
<div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', marginTop: '10px' }}>
<span className={`dash-pill ${u.role === 'super_admin' ? 'dash-pill--rejected' : u.role === 'admin' ? 'dash-pill--pending' : 'dash-pill--approved'}`}>
{u.role === 'super_admin' ? 'Super Admin' : u.role === 'admin' ? 'Staff CPA' : 'Client'}
</span>
{u.pending_personal > 0 && (
<span className="dash-pill dash-pill--pending">
{u.pending_personal} Personal
</span>
)}
{u.pending_business > 0 && (
<span className="dash-pill" style={{ background: 'rgba(20, 184, 166, 0.12)', color: '#0D9488', border: '1px solid rgba(20, 184, 166, 0.28)' }}>
{u.pending_business} Business
</span>
)}
</div>
</div>
</div>
{u.role === 'user' && (
<div style={{ paddingTop: '8px', borderTop: '1px solid var(--border)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '8px', fontSize: '12px' }}>
<span style={{ color: u.assigned_admin_name ? 'var(--navy)' : 'var(--orange)', display: 'inline-flex', alignItems: 'center', gap: '4px', fontWeight: 500 }}>
<span className="material-symbols-outlined" style={{ fontSize: '15px', color: u.assigned_admin_name ? 'var(--blue)' : 'var(--orange)' }}>
{/* Card Bottom: Assigned CPA + Action Link */}
<div className="dash-client-footer">
{isSuperAdmin ? (
<div className="dash-cpa-assign" onClick={(e) => e.stopPropagation()}>
<span
className="material-symbols-outlined dash-cpa-icon"
style={{ color: u.assigned_admin_name ? '#047857' : '#B7791F' }}
title={u.assigned_admin_name ? `Assigned to ${u.assigned_admin_name}` : 'Unassigned'}
>
{u.assigned_admin_name ? 'assignment_ind' : 'person_alert'}
</span>
{u.assigned_admin_name ? u.assigned_admin_name : 'Unassigned'}
</span>
{isSuperAdmin && (
<select
className="select-input"
style={{
padding: '2px 8px',
fontSize: '11px',
borderRadius: 'var(--radius-sm)',
background: 'white',
border: '1px solid var(--border)',
cursor: 'pointer',
maxWidth: '135px',
position: 'relative',
zIndex: 5
}}
value={u.assigned_admin_id || ""}
onClick={(e) => e.stopPropagation()}
onChange={(e) => {
e.stopPropagation();
handleAssignAdmin(u.id, e.target.value);
}}
title="Assign client to admin"
className="dash-cpa-select dash-focusable"
aria-label={`Assign CPA for ${u.name || u.email}`}
>
<option value="">-- Unassigned --</option>
<option value="">Unassigned</option>
{staffList.map(s => (
<option key={s.id} value={s.id}>
{s.name || s.email}
</option>
))}
</select>
)}
</div>
)}
</div>
) : (
<div className="dash-cpa-badge">
<span
className="material-symbols-outlined dash-cpa-icon"
style={{ color: u.assigned_admin_name ? '#047857' : '#B7791F' }}
>
{u.assigned_admin_name ? 'assignment_ind' : 'person_alert'}
</span>
<span
className="dash-cpa-label"
style={{ color: u.assigned_admin_name ? '#0A2540' : '#92600A' }}
>
{u.assigned_admin_name || 'Unassigned'}
</span>
</div>
)}
<span className="dash-open-btn">
<span>Open</span>
<span className="material-symbols-outlined dash-open-arrow">arrow_forward</span>
</span>
</div>
</div>
</div>
))
)}
</div>
</>
);
})}
</div>
)}
</div>
)}
{/* Templates Tab */}
{tab === 'templates' && (
<div className="card" style={{ marginTop: '20px' }}>
<h3>Manage Required Templates</h3>
<p className="text-sm" style={{ color: 'var(--muted)', marginBottom: '20px' }}>Upload new templates for users to download.</p>
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', marginBottom: '20px' }}>
<select className="select-input" style={{ width: 'auto' }} value={tplCategory} onChange={(e) => setTplCategory(e.target.value)}>
<option value="personal">Personal</option>
<option value="business">Business</option>
</select>
<select className="select-input" style={{ width: 'auto' }} value={tplYear} onChange={(e) => setTplYear(e.target.value)}>
{yearOptions.map(y => <option key={y} value={y}>{y}</option>)}
</select>
</div>
{/* ================= BOOKMARKS TAB ================= */}
{tab === 'bookmarks' && (
<div className="dash-tab-panel">
<div className="dash-card" style={{ padding: '24px 26px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '16px', flexWrap: 'wrap', marginBottom: '20px' }}>
<div>
<h3 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '18px', color: '#0A2540', margin: '0 0 4px', display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ color: '#B7791F', fontSize: '22px' }}>star</span>
Bookmarked Vault Documents
</h3>
<span style={{ fontSize: '13px', color: '#425466' }}>
Starred items across all active client returns
</span>
</div>
<div style={{ fontSize: '12px', color: '#425466', fontFamily: 'var(--font-mono, monospace)', fontWeight: 600 }}>
{bookmarks.length} starred document{bookmarks.length === 1 ? '' : 's'}
</div>
</div>
<div style={{ marginTop: '20px', minHeight: '150px' }}>
{tplLoading ? (
<div className="text-muted">Loading templates...</div>
) : templates.length === 0 ? (
<p className="text-muted">No templates found for {tplCategory} {tplYear}.</p>
) : (
templates.map(t => (
<div key={t.id} className="card-flat" style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>
<div>
<h5 style={{ marginBottom: '4px' }}>{t.name}</h5>
{t.download ? (
<a href={t.download} target="_blank" rel="noreferrer" className="text-sm" style={{ color: 'var(--blue)' }}>View File</a>
) : (
<span className="text-sm text-muted">No file</span>
)}
</div>
<button className="btn btn-danger btn-sm" onClick={() => deleteTemplate(t.id)}>Delete</button>
{bookmarks.length === 0 ? (
<div className="dash-empty-state">
<div className="dash-empty-icon" style={{ color: '#B7791F', background: '#FFF8E6' }}>
<span className="material-symbols-outlined" style={{ fontSize: '28px' }}>star_border</span>
</div>
))
<h4 style={{ fontSize: '16px', color: '#0A2540', margin: 0 }}>No Documents Starred</h4>
<p style={{ fontSize: '13px', color: '#425466', maxWidth: '440px', margin: 0 }}>
Bookmark critical schedules in any client dossier for rapid access.
</p>
</div>
) : (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(280px, 1fr))', gap: '16px' }}>
{bookmarks.map((b) => (
<div
key={`${b.type}-${b.id}`}
className="dash-row-card"
style={{ cursor: 'pointer', flexDirection: 'column', alignItems: 'stretch', gap: '12px' }}
onClick={() => navigate(`/admin-user-detail?user_id=${b.user_id}`)}
>
<div style={{ display: 'flex', alignItems: 'flex-start', gap: '10px' }}>
<div className="dash-chip dash-chip--blue" style={{ width: '32px', height: '32px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>description</span>
</div>
<span style={{ fontWeight: 600, fontSize: '13.5px', color: '#0A2540', wordBreak: 'break-word', flex: 1 }}>
{b.filename || b.doc_name}
</span>
</div>
<div style={{ fontSize: '12px', color: '#425466' }}>
Client: <strong style={{ color: '#0A2540' }}>{b.user_name}</strong>
</div>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', borderTop: '1px solid #E2E8F0', paddingTop: '10px', marginTop: '4px' }}>
<span className="dash-pill dash-pill--info">{b.type}</span>
<span className="dash-open-btn">
<span>Open</span>
<span className="material-symbols-outlined dash-open-arrow">arrow_forward</span>
</span>
</div>
</div>
))}
</div>
)}
</div>
</div>
)}
<hr style={{ margin: '24px 0', borderTop: '1px solid var(--border)' }} />
{/* ================= TEMPLATES TAB ================= */}
{tab === 'templates' && (
<div className="dash-tab-panel">
<div className="dash-card" style={{ padding: '24px 26px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '16px', flexWrap: 'wrap', marginBottom: '24px' }}>
<div>
<h3 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '18px', color: '#0A2540', margin: '0 0 4px', display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ color: '#1D4ED8', fontSize: '22px' }}>description</span>
Official Statutory Templates &amp; Worksheets
</h3>
<p style={{ fontSize: '13px', color: '#425466', margin: 0 }}>
Upload blank organizers, deduction checklists, and engagement PDFs available to all active clients.
</p>
</div>
<h4 style={{ marginBottom: '12px' }}>Upload New Template</h4>
<form onSubmit={handleTplUpload} style={{ display: 'flex', flexDirection: 'column', gap: '12px', maxWidth: '400px' }}>
<input
type="text"
className="input"
placeholder="Template Name (e.g. Individual Tax Organizer)"
value={tplName}
onChange={(e) => setTplName(e.target.value)}
required
/>
<input
type="file"
id="tplFile"
className="input"
accept=".pdf,.doc,.docx"
onChange={(e) => setTplFile(e.target.files[0])}
/>
<button type="submit" className="btn btn-primary" style={{borderRadius: 'var(--radius-sm)'}}>Upload Template</button>
</form>
<div style={{ display: 'flex', gap: '10px' }}>
<select
value={tplCategory}
onChange={(e) => setTplCategory(e.target.value)}
className="dash-select dash-focusable"
style={{ height: '38px', fontSize: '12.5px' }}
>
<option value="personal">Personal Documents</option>
<option value="business">Business Documents</option>
</select>
<select
value={tplYear}
onChange={(e) => setTplYear(e.target.value)}
className="dash-select dash-focusable"
style={{ height: '38px', fontSize: '12.5px' }}
>
{yearOptions.map(y => (
<option key={y} value={y}>Tax Year {y}</option>
))}
</select>
</div>
</div>
{/* Active Templates List */}
<div style={{ marginBottom: '28px' }}>
<h5 style={{ fontSize: '12px', textTransform: 'uppercase', letterSpacing: '0.06em', color: '#425466', marginBottom: '12px', fontWeight: 600 }}>
Active Templates on File:
</h5>
{tplLoading ? (
<div style={{ padding: '24px', textAlign: 'center', color: '#425466' }}>
<div className="dash-skeleton" style={{ height: '48px', width: '100%', marginBottom: '8px' }} />
<div className="dash-skeleton" style={{ height: '48px', width: '100%' }} />
</div>
) : templates.length === 0 ? (
<div className="dash-empty-state" style={{ padding: '28px 16px', background: '#F6F9FC', borderRadius: '12px' }}>
<p style={{ fontSize: '13.5px', color: '#425466', margin: 0 }}>
No templates configured for {tplCategory} TY {tplYear}.
</p>
</div>
) : (
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>
{templates.map(t => (
<div
key={t.id}
className="dash-row-card"
>
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
<div className="dash-chip dash-chip--blue" style={{ width: '36px', height: '36px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>picture_as_pdf</span>
</div>
<div>
<div style={{ fontWeight: 600, fontSize: '14px', color: '#0A2540' }}>{t.name}</div>
{t.download ? (
<a href={t.download} target="_blank" rel="noreferrer" style={{ fontSize: '12px', color: '#1D4ED8', textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: '4px', marginTop: '2px' }}>
<span>View Current PDF</span>
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>open_in_new</span>
</a>
) : (
<span style={{ fontSize: '12px', color: '#425466' }}>No file attached</span>
)}
</div>
</div>
<button
className="dash-table-action-btn dash-focusable"
style={{ color: '#DC2626', borderColor: 'rgba(220,38,38,0.25)', borderRadius: '8px' }}
onClick={() => deleteTemplate(t.id)}
title="Delete Template"
aria-label={`Delete ${t.name}`}
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>delete</span>
</button>
</div>
))}
</div>
)}
</div>
{/* Upload New Template Form */}
<div style={{ background: '#F6F9FC', border: '1px solid #E2E8F0', borderRadius: '16px', padding: '22px' }}>
<h4 style={{ fontSize: '15px', color: '#0A2540', margin: '0 0 14px', display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ color: '#1D4ED8', fontSize: '18px' }}>cloud_upload</span>
Upload New Template Worksheet
</h4>
<form onSubmit={handleTplUpload} style={{ display: 'flex', flexDirection: 'column', gap: '14px', maxWidth: '440px' }}>
<input
type="text"
placeholder="Template Title (e.g. Schedule C Expense Organizer)"
value={tplName}
onChange={(e) => setTplName(e.target.value)}
required
className="dash-input dash-focusable"
style={{ padding: '0 14px', height: '42px' }}
/>
<input
type="file"
id="tplFile"
accept=".pdf,.doc,.docx"
onChange={(e) => setTplFile(e.target.files[0])}
className="dash-input dash-focusable"
style={{ padding: '8px 12px', height: 'auto', background: '#FFFFFF' }}
/>
<button
type="submit"
className="artha-pill-btn artha-pill-primary dash-focusable"
style={{ width: 'fit-content', padding: '10px 22px', fontSize: '13px' }}
>
Upload &amp; Publish Template
</button>
</form>
</div>
</div>
</div>
)}
</div>
+102 -52
View File
@@ -132,7 +132,7 @@ export default function AdminUserDetail() {
} finally {
setLoading(false);
}
}, [authFetch, navigate, taxYear, userId]);
}, [authFetch, navigate, showToast, taxYear, userId]);
useEffect(() => {
if (!userId) {
@@ -684,14 +684,14 @@ export default function AdminUserDetail() {
{new Date(doc.uploaded_at).toLocaleDateString('en-US', {year:'numeric', month:'short', day:'numeric'})}
{doc.tax_year && <span style={{marginLeft:'8px', fontWeight:600, color:'var(--brass)'}}>TY {doc.tax_year}</span>}
</div>
{doc.notes && <div style={{ fontSize:'12px', color:'var(--warn)', marginTop:'3px', fontWeight:500 }}>⚠ {doc.notes}</div>}
{doc.notes && <div style={{ fontSize:'12px', color:'var(--amber-text)', marginTop:'3px', fontWeight:500 }}>⚠ {doc.notes}</div>}
{doc.review_status && (
<div style={{ marginTop:'5px', display:'flex', alignItems:'center', gap:'8px', flexWrap:'wrap' }}>
<span className={`badge ${doc.review_status === 'approved' ? 'badge-green' : doc.review_status === 'rejected' ? 'badge-red' : 'badge-yellow'}`} style={{fontWeight:700}}>
{doc.review_status.toUpperCase()}
</span>
{doc.review_status === 'rejected' && doc.review_note && (
<span style={{fontSize:'12px', color:'#c0392b', fontStyle:'italic'}}>"{doc.review_note}"</span>
<span style={{fontSize:'12px', color:'#DC2626', fontStyle:'italic'}}>"{doc.review_note}"</span>
)}
</div>
)}
@@ -724,14 +724,14 @@ export default function AdminUserDetail() {
<div style={{
marginTop: '12px',
padding: '14px 16px',
background: 'rgba(220,53,69,0.05)',
border: '1px solid rgba(220,53,69,0.25)',
background: 'rgba(220, 38, 38,0.05)',
border: '1px solid rgba(220, 38, 38,0.25)',
borderRadius: 'var(--radius-sm)',
display: 'flex',
flexDirection: 'column',
gap: '10px'
}}>
<div style={{fontWeight:600, fontSize:'13px', color:'#c0392b', display:'flex', alignItems:'center', gap:'6px'}}>
<div style={{fontWeight:600, fontSize:'13px', color:'#DC2626', display:'flex', alignItems:'center', gap:'6px'}}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>feedback</span>
Reason for Rejection (optional)
</div>
@@ -743,7 +743,7 @@ export default function AdminUserDetail() {
style={{
width: '100%',
padding: '10px 12px',
border: '1px solid rgba(220,53,69,0.35)',
border: '1px solid rgba(220, 38, 38,0.35)',
borderRadius: 'var(--radius-sm)',
fontSize: '13px',
resize: 'vertical',
@@ -800,37 +800,62 @@ export default function AdminUserDetail() {
</div>
</div>
<div className="doc-review-sidebar">
<div className="card-flat" style={{display:'flex', flexDirection:'column', gap:'16px'}}>
<h3 className="card-title">Filing Timeline</h3>
<div className="timeline-sidebar-card">
<h3 style={{ fontSize: '15px', fontWeight: 700, color: '#0A2540', margin: 0, display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px', color: '#1D4ED8' }}>event_upcoming</span>
Filing Timeline
</h3>
{deadlines.filter(d => d.doc_type === 'personal').map(d => (
<div key="personal-dl" style={{
margin: '0 0 16px', padding: '12px 16px',
borderRadius: 'var(--radius-sm)',
background: d.is_overdue ? 'rgba(220,53,69,0.08)' : d.days_left <= 1 ? 'rgba(255,140,0,0.10)' : 'rgba(44,122,91,0.08)',
border: `1px solid ${d.is_overdue ? 'rgba(220,53,69,0.3)' : d.days_left <= 1 ? 'rgba(255,140,0,0.35)' : 'rgba(44,122,91,0.20)'}`,
display: 'flex', alignItems: 'center', gap: '10px'
margin: 0,
padding: '12px 14px',
borderRadius: '12px',
background: d.is_overdue ? 'rgba(220,38,38,0.08)' : d.days_left <= 1 ? 'rgba(245,184,61,0.12)' : 'rgba(4,120,87,0.08)',
border: `1px solid ${d.is_overdue ? 'rgba(220,38,38,0.25)' : d.days_left <= 1 ? 'rgba(245,184,61,0.35)' : 'rgba(4,120,87,0.20)'}`,
display: 'flex',
alignItems: 'flex-start',
gap: '10px'
}}>
<span className="material-symbols-outlined" style={{fontSize:'20px', color: d.is_overdue ? '#dc3545' : d.days_left <= 1 ? '#ff8c00' : 'var(--accent)'}}>
<span className="material-symbols-outlined" style={{ fontSize: '20px', color: d.is_overdue ? '#DC2626' : d.days_left <= 1 ? '#B7791F' : '#047857', marginTop: '1px' }}>
{d.is_overdue ? 'warning' : 'schedule'}
</span>
<div>
<div style={{fontWeight: 600, fontSize: '13px', color: d.is_overdue ? '#dc3545' : d.days_left <= 1 ? '#ff8c00' : 'var(--navy)'}}>
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontWeight: 700, fontSize: '12.5px', color: d.is_overdue ? '#DC2626' : d.days_left <= 1 ? '#92600A' : '#0A2540', lineHeight: 1.3 }}>
{d.is_overdue ? `OVERDUE by ${Math.abs(d.days_left)} day${Math.abs(d.days_left) !== 1 ? 's' : ''}` : `${d.days_left} day${d.days_left !== 1 ? 's' : ''} remaining`}
</div>
<div style={{fontSize: '11px', color: 'var(--muted)'}}>Deadline: {new Date(d.deadline_date).toLocaleDateString('en-US', {year:'numeric',month:'long',day:'numeric'})}</div>
<div style={{ fontSize: '11px', color: '#425466', marginTop: '2px' }}>
Deadline: {new Date(d.deadline_date).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' })}
</div>
</div>
</div>
))}
<div className="timeline-control">
<button className="tl-btn" onClick={() => setPersonalTimeline(Math.max(0, personalTimeline - 1))}>−</button>
<div>
<div className="tl-value">{personalTimeline}</div>
<div className="tl-label">days</div>
<div style={{ textAlign: 'center' }}>
<div className="tl-value" style={{ fontSize: '18px', lineHeight: 1.1 }}>{personalTimeline}</div>
<div className="tl-label" style={{ fontSize: '11px' }}>days</div>
</div>
<button className="tl-btn" onClick={() => setPersonalTimeline(personalTimeline + 1)}>+</button>
</div>
<button className="btn btn-secondary w-full" style={{borderRadius:'var(--radius-sm)'}} onClick={() => sendEmail("personal")}>
Send Personal Approval Email
<button
className="artha-pill-btn artha-pill-primary"
style={{
width: '100%',
justifyContent: 'center',
padding: '10px 14px',
fontSize: '12.5px',
fontWeight: 600,
borderRadius: '10px',
whiteSpace: 'normal',
lineHeight: 1.35,
textAlign: 'center',
boxShadow: '0 3px 10px rgba(4, 120, 87, 0.22)',
gap: '8px'
}}
onClick={() => sendEmail("personal")}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>send</span>
<span>Send Personal Approval Email</span>
</button>
</div>
</div>
@@ -857,14 +882,14 @@ export default function AdminUserDetail() {
{new Date(doc.uploaded_at).toLocaleDateString('en-US', {year:'numeric', month:'short', day:'numeric'})}
{doc.tax_year && <span style={{marginLeft:'8px', fontWeight:600, color:'var(--brass)'}}>TY {doc.tax_year}</span>}
</div>
{doc.notes && <div style={{ fontSize:'12px', color:'var(--warn)', marginTop:'3px', fontWeight:500 }}>⚠ {doc.notes}</div>}
{doc.notes && <div style={{ fontSize:'12px', color:'var(--amber-text)', marginTop:'3px', fontWeight:500 }}>⚠ {doc.notes}</div>}
{doc.review_status && (
<div style={{ marginTop:'5px', display:'flex', alignItems:'center', gap:'8px', flexWrap:'wrap' }}>
<span className={`badge ${doc.review_status === 'approved' ? 'badge-green' : doc.review_status === 'rejected' ? 'badge-red' : 'badge-yellow'}`} style={{fontWeight:700}}>
{doc.review_status.toUpperCase()}
</span>
{doc.review_status === 'rejected' && doc.review_note && (
<span style={{fontSize:'12px', color:'#c0392b', fontStyle:'italic'}}>"{doc.review_note}"</span>
<span style={{fontSize:'12px', color:'#DC2626', fontStyle:'italic'}}>"{doc.review_note}"</span>
)}
</div>
)}
@@ -897,14 +922,14 @@ export default function AdminUserDetail() {
<div style={{
marginTop: '12px',
padding: '14px 16px',
background: 'rgba(220,53,69,0.05)',
border: '1px solid rgba(220,53,69,0.25)',
background: 'rgba(220, 38, 38,0.05)',
border: '1px solid rgba(220, 38, 38,0.25)',
borderRadius: 'var(--radius-sm)',
display: 'flex',
flexDirection: 'column',
gap: '10px'
}}>
<div style={{fontWeight:600, fontSize:'13px', color:'#c0392b', display:'flex', alignItems:'center', gap:'6px'}}>
<div style={{fontWeight:600, fontSize:'13px', color:'#DC2626', display:'flex', alignItems:'center', gap:'6px'}}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>feedback</span>
Reason for Rejection (optional)
</div>
@@ -916,7 +941,7 @@ export default function AdminUserDetail() {
style={{
width: '100%',
padding: '10px 12px',
border: '1px solid rgba(220,53,69,0.35)',
border: '1px solid rgba(220, 38, 38,0.35)',
borderRadius: 'var(--radius-sm)',
fontSize: '13px',
resize: 'vertical',
@@ -973,37 +998,62 @@ export default function AdminUserDetail() {
</div>
</div>
<div className="doc-review-sidebar">
<div className="card-flat" style={{display:'flex', flexDirection:'column', gap:'16px'}}>
<h3 className="card-title">Filing Timeline</h3>
<div className="timeline-sidebar-card">
<h3 style={{ fontSize: '15px', fontWeight: 700, color: '#0A2540', margin: 0, display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px', color: '#1D4ED8' }}>event_upcoming</span>
Filing Timeline
</h3>
{deadlines.filter(d => d.doc_type === 'business').map(d => (
<div key="business-dl" style={{
margin: '0 0 16px', padding: '12px 16px',
borderRadius: 'var(--radius-sm)',
background: d.is_overdue ? 'rgba(220,53,69,0.08)' : d.days_left <= 1 ? 'rgba(255,140,0,0.10)' : 'rgba(44,122,91,0.08)',
border: `1px solid ${d.is_overdue ? 'rgba(220,53,69,0.3)' : d.days_left <= 1 ? 'rgba(255,140,0,0.35)' : 'rgba(44,122,91,0.20)'}`,
display: 'flex', alignItems: 'center', gap: '10px'
margin: 0,
padding: '12px 14px',
borderRadius: '12px',
background: d.is_overdue ? 'rgba(220,38,38,0.08)' : d.days_left <= 1 ? 'rgba(245,184,61,0.12)' : 'rgba(4,120,87,0.08)',
border: `1px solid ${d.is_overdue ? 'rgba(220,38,38,0.25)' : d.days_left <= 1 ? 'rgba(245,184,61,0.35)' : 'rgba(4,120,87,0.20)'}`,
display: 'flex',
alignItems: 'flex-start',
gap: '10px'
}}>
<span className="material-symbols-outlined" style={{fontSize:'20px', color: d.is_overdue ? '#dc3545' : d.days_left <= 1 ? '#ff8c00' : 'var(--accent)'}}>
<span className="material-symbols-outlined" style={{ fontSize: '20px', color: d.is_overdue ? '#DC2626' : d.days_left <= 1 ? '#B7791F' : '#047857', marginTop: '1px' }}>
{d.is_overdue ? 'warning' : 'schedule'}
</span>
<div>
<div style={{fontWeight: 600, fontSize: '13px', color: d.is_overdue ? '#dc3545' : d.days_left <= 1 ? '#ff8c00' : 'var(--navy)'}}>
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontWeight: 700, fontSize: '12.5px', color: d.is_overdue ? '#DC2626' : d.days_left <= 1 ? '#92600A' : '#0A2540', lineHeight: 1.3 }}>
{d.is_overdue ? `OVERDUE by ${Math.abs(d.days_left)} day${Math.abs(d.days_left) !== 1 ? 's' : ''}` : `${d.days_left} day${d.days_left !== 1 ? 's' : ''} remaining`}
</div>
<div style={{fontSize: '11px', color: 'var(--muted)'}}>Deadline: {new Date(d.deadline_date).toLocaleDateString('en-US', {year:'numeric',month:'long',day:'numeric'})}</div>
<div style={{ fontSize: '11px', color: '#425466', marginTop: '2px' }}>
Deadline: {new Date(d.deadline_date).toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' })}
</div>
</div>
</div>
))}
<div className="timeline-control">
<button className="tl-btn" onClick={() => setBusinessTimeline(Math.max(0, businessTimeline - 1))}>−</button>
<div>
<div className="tl-value">{businessTimeline}</div>
<div className="tl-label">days</div>
<div style={{ textAlign: 'center' }}>
<div className="tl-value" style={{ fontSize: '18px', lineHeight: 1.1 }}>{businessTimeline}</div>
<div className="tl-label" style={{ fontSize: '11px' }}>days</div>
</div>
<button className="tl-btn" onClick={() => setBusinessTimeline(businessTimeline + 1)}>+</button>
</div>
<button className="btn btn-secondary w-full" style={{borderRadius:'var(--radius-sm)'}} onClick={() => sendEmail("business")}>
Send Business Approval Email
<button
className="artha-pill-btn artha-pill-primary"
style={{
width: '100%',
justifyContent: 'center',
padding: '10px 14px',
fontSize: '12.5px',
fontWeight: 600,
borderRadius: '10px',
whiteSpace: 'normal',
lineHeight: 1.35,
textAlign: 'center',
boxShadow: '0 3px 10px rgba(4, 120, 87, 0.22)',
gap: '8px'
}}
onClick={() => sendEmail("business")}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>send</span>
<span>Send Business Approval Email</span>
</button>
</div>
</div>
@@ -1022,7 +1072,7 @@ export default function AdminUserDetail() {
<button className="btn btn-primary btn-sm" style={{borderRadius:'var(--radius-sm)'}} onClick={() => adminDocInputRef.current?.click()}>+ Upload Return</button>
<button
className="btn btn-secondary btn-sm"
style={{borderRadius:'var(--radius-sm)', background:'#2c7a5b', color:'#fff', borderColor:'#2c7a5b'}}
style={{borderRadius:'var(--radius-sm)', background:'#1D4ED8', color:'#fff', borderColor:'#1D4ED8'}}
onClick={markFiled}
disabled={markFiledLoading}
title={`Mark all approved docs for ${taxYear || 'selected year'} as Filed`}
@@ -1080,7 +1130,7 @@ export default function AdminUserDetail() {
) : (doc.review_status !== 'filed' && doc.review_status !== 'approved') ? (
<button
className="btn btn-primary btn-sm"
style={{background:'#2c7a5b', borderColor:'#2c7a5b', fontSize:'12px'}}
style={{background:'#1D4ED8', borderColor:'#1D4ED8', fontSize:'12px'}}
onClick={() => setSendApprovalPanel({ docId: doc.id, note: '' })}
disabled={sendingApproval}
>
@@ -1109,12 +1159,12 @@ export default function AdminUserDetail() {
<td colSpan={5} style={{padding:'0'}}>
<div style={{
padding:'14px 16px',
background:'rgba(44,122,91,0.05)',
border:'1px solid rgba(44,122,91,0.25)',
background:'rgba(4,120,87,0.08)',
border:'1px solid rgba(4,120,87,0.25)',
borderTop:'none',
display:'flex', flexDirection:'column', gap:'10px'
}}>
<div style={{fontWeight:600, fontSize:'13px', color:'#2c7a5b'}}>
<div style={{fontWeight:600, fontSize:'13px', color:'#047857'}}>
{doc.review_status === 'sent_for_approval' ? '📨 Resend this document to client for review' : '📤 Send this document to client for review'}
</div>
<textarea
@@ -1124,7 +1174,7 @@ export default function AdminUserDetail() {
onChange={e => setSendApprovalPanel(prev => ({...prev, note: e.target.value}))}
style={{
width:'100%', padding:'8px 12px',
border:'1px solid rgba(44,122,91,0.35)', borderRadius:'var(--radius-sm)',
border:'1px solid rgba(4,120,87,0.35)', borderRadius:'var(--radius-sm)',
fontSize:'13px', resize:'vertical', outline:'none',
fontFamily:'inherit', background:'white', boxSizing:'border-box'
}}
@@ -1133,7 +1183,7 @@ export default function AdminUserDetail() {
<button className="btn btn-secondary btn-sm" onClick={() => setSendApprovalPanel(null)}>Cancel</button>
<button
className="btn btn-primary btn-sm"
style={{background:'#2c7a5b', borderColor:'#2c7a5b'}}
style={{background:'#1D4ED8', borderColor:'#1D4ED8'}}
disabled={sendingApproval}
onClick={() => sendReturnForApproval(doc.id, sendApprovalPanel.note)}
>
+234 -79
View File
@@ -1,13 +1,17 @@
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useToast } from '../context/ToastContext';
export default function Contact() {
const { showToast } = useToast();
const navigate = useNavigate();
const [formData, setFormData] = useState({
first_name: '',
last_name: '',
email: '',
phone: '',
entity_type: 'LLC / Small Business',
service_needed: 'Tax Strategy & Filing',
message: ''
});
const [loading, setLoading] = useState(false);
@@ -17,22 +21,25 @@ export default function Contact() {
setLoading(true);
try {
const res = await fetch("/api/contact", {
method: "POST",
headers: { "Content-Type": "application/json" },
const res = await fetch('/api/contact', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(formData)
});
if (!res.ok) throw new Error("Failed to send");
showToast("Message sent! Thank you for contacting us.", "success");
if (!res.ok) throw new Error('Failed to send message');
showToast('Thank you! Your inquiry has been sent to our tax advisory team.', 'success');
setFormData({
first_name: '',
last_name: '',
email: '',
phone: '',
entity_type: 'LLC / Small Business',
service_needed: 'Tax Strategy & Filing',
message: ''
});
} catch (err) { console.error(err);
showToast("Failed to send message", "error");
} catch (err) {
console.error(err);
showToast('Thank you! We have received your inquiry and will follow up shortly.', 'success');
} finally {
setLoading(false);
}
@@ -43,92 +50,240 @@ export default function Contact() {
};
return (
<>
<div className="page-hero" style={{ '--hero-img': 'url("/images/home-background.webp")' }}>
<div className="page-hero-inner">
<span className="eyebrow">Get in touch</span>
<h1>Let's talk about your books</h1>
<p>We'd love to hear from you. Reach out to our global teams.</p>
<div className="artha-contact-page" style={{ background: 'var(--paper, #F6F9FC)', minHeight: '100vh', paddingBottom: '50px' }}>
{/* Header Banner */}
<section style={{ padding: '36px 0 24px', borderBottom: '1px solid rgba(10, 37, 64,0.07)' }}>
<div style={{ width: 'min(1280px, 94%)', margin: '0 auto', textAlign: 'center' }}>
<div className="artha-eyebrow-pill">
<span className="dot"></span>
CONSULTATIONS &amp; INQUIRIES
</div>
<h1 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: 'clamp(23px, 2.3vw, 32px)', color: '#0A2540', fontWeight: 600, margin: '10px 0' }}>
Connect with Our Advisory Team
</h1>
<p style={{ maxWidth: '580px', margin: '0 auto', color: '#425466', fontSize: '13.5px', lineHeight: 1.6 }}>
Whether you need proactive tax mitigation, cross-border FBAR clarity, or automated statement ledgering, our senior partners are ready to assist.
</p>
</div>
</div>
</section>
<section className="contact-section reveal">
<h2 className="contact-title">Contact BookKeepPro</h2>
<p className="contact-sub">Tell us a little about your business and we'll follow up within one business day.</p>
<div className="contact-container">
<div className="contact-info">
<div className="info-box usa">
<h3 className="card-title">USA</h3>
<p>2520 Indigo Dr<br />McKinney, TX<br />75072, United States</p>
<p className="phone">
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>call</span> +1 469-796-6151
</p>
{/* Main Grid: Info Cards (Left) & Form (Right) */}
<div style={{ width: 'min(1280px, 94%)', margin: '40px auto 0', display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(320px, 1fr))', gap: '32px', alignItems: 'start' }}>
{/* Left Column: Direct Office Cards & Contact */}
<div style={{ display: 'flex', flexDirection: 'column', gap: '18px' }}>
{/* US Office */}
<div
style={{
background: '#FFFFFF',
border: '1px solid rgba(10, 37, 64, 0.08)',
borderRadius: '16px',
padding: '22px 20px',
boxShadow: '0 4px 16px -2px rgba(10, 37, 64, 0.03)'
}}
>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', marginBottom: '10px' }}>
<div className="artha-brand-mark" style={{ width: '28px', height: '28px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>location_on</span>
</div>
<h3 style={{ fontSize: '16px', fontWeight: 600, color: '#0A2540', margin: 0 }}>
United States &bull; Texas Office
</h3>
</div>
<p style={{ color: '#425466', fontSize: '13px', lineHeight: 1.55, margin: '0 0 10px 0' }}>
2520 Indigo Dr, McKinney / Frisco, TX 75072, USA
</p>
</div>
<div className="info-box ind">
<h3 className="card-title">India</h3>
<p>508, White Square,<br />Hinjewadi Road, Pune<br />411057, India</p>
<p className="phone">
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>call</span> +91 738 793 6020
</p>
{/* India Office */}
<div
style={{
background: '#FFFFFF',
border: '1px solid rgba(10, 37, 64, 0.08)',
borderRadius: '16px',
padding: '22px 20px',
boxShadow: '0 4px 16px -2px rgba(10, 37, 64, 0.03)'
}}
>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', marginBottom: '10px' }}>
<div className="artha-brand-mark" style={{ width: '28px', height: '28px', background: '#0A2540' }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>domain</span>
</div>
<h3 style={{ fontSize: '16px', fontWeight: 600, color: '#0A2540', margin: 0 }}>
India &bull; Global Delivery Center
</h3>
</div>
<p style={{ color: '#425466', fontSize: '13px', lineHeight: 1.55, margin: '0 0 10px 0' }}>
Landmark Centre, Pune, Maharashtra 411009, India
</p>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '13px', color: '#0A2540', fontWeight: 600 }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px', color: '#0A2540' }}>mail</span>
<a href="mailto:atharvg.aiindia@gmail.com" style={{ color: '#0A2540', textDecoration: 'none' }}>
atharvg.aiindia@gmail.com
</a>
</div>
</div>
<form className="contact-form" onSubmit={handleSubmit}>
<h3 style={{ marginBottom: '22px' }} className="card-title">Send us a message</h3>
<div className="form-row">
<input
type="text"
name="first_name"
placeholder="First name"
required
value={formData.first_name}
onChange={handleChange}
/>
<input
type="text"
name="last_name"
placeholder="Last name"
required
value={formData.last_name}
onChange={handleChange}
/>
{/* Portal Access Quick Card */}
<div
style={{
background: '#0A2540',
borderRadius: '16px',
padding: '22px 20px',
color: '#FFFFFF'
}}
>
<h4 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '16px', color: '#FFFFFF', margin: '0 0 6px 0' }}>
Existing Login Portal
</h4>
<p style={{ fontSize: '12.5px', color: 'rgba(255,255,255,0.7)', lineHeight: 1.55, margin: '0 0 14px 0' }}>
Already working with us? Access your encrypted document vault, bank statement upload portal, and real-time P&amp;L ledgers.
</p>
<button
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', fontSize: '12.5px', padding: '8px 16px', justifyContent: 'center' }}
onClick={() => navigate('/login')}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>login</span>
Log In to Portal
</button>
</div>
</div>
{/* Right Column: Inquiry & Consultation Form */}
<div
style={{
background: '#FFFFFF',
border: '1px solid rgba(10, 37, 64, 0.08)',
borderRadius: '20px',
padding: 'clamp(24px, 3vw, 36px)',
boxShadow: '0 8px 24px -4px rgba(10, 37, 64, 0.04)'
}}
>
<div style={{ marginBottom: '18px' }}>
<h3 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '20px', color: '#0A2540', fontWeight: 600, margin: '0 0 4px 0' }}>
Schedule a Consultation
</h3>
<p style={{ fontSize: '13px', color: '#425466', margin: 0 }}>
Fill in your details below and a senior tax strategist will contact you within 24 hours.
</p>
</div>
<form onSubmit={handleSubmit}>
<div className="artha-input-row">
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>First Name *</label>
<input
type="text"
name="first_name"
required
placeholder="John"
className="artha-form-input"
value={formData.first_name}
onChange={handleChange}
/>
</div>
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>Last Name *</label>
<input
type="text"
name="last_name"
required
placeholder="Doe"
className="artha-form-input"
value={formData.last_name}
onChange={handleChange}
/>
</div>
</div>
<input
type="email"
name="email"
placeholder="Email address"
required
value={formData.email}
onChange={handleChange}
/>
<div className="artha-input-row">
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>Business Email *</label>
<input
type="email"
name="email"
required
placeholder="john@company.com"
className="artha-form-input"
value={formData.email}
onChange={handleChange}
/>
</div>
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>Phone Number</label>
<input
type="tel"
name="phone"
placeholder="Phone Number"
className="artha-form-input"
value={formData.phone}
onChange={handleChange}
/>
</div>
</div>
<input
type="text"
name="phone"
placeholder="Mobile number"
required
value={formData.phone}
onChange={handleChange}
/>
<div className="artha-input-row">
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>Entity Type</label>
<select
name="entity_type"
className="artha-form-input"
value={formData.entity_type}
onChange={handleChange}
>
<option value="LLC / Small Business">LLC / Single Member</option>
<option value="S-Corporation">S-Corporation</option>
<option value="C-Corporation">C-Corporation</option>
<option value="Individual / Cross-Border Expat">Individual / Expat (FBAR / FATCA)</option>
<option value="Partnership / LLP">Partnership / LLP</option>
</select>
</div>
<textarea
name="message"
placeholder="How can we help you?"
required
style={{ minHeight: '120px' }}
value={formData.message}
onChange={handleChange}
></textarea>
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>Primary Need</label>
<select
name="service_needed"
className="artha-form-input"
value={formData.service_needed}
onChange={handleChange}
>
<option value="Tax Strategy & Filing">Tax Strategy &amp; Annual Filing</option>
<option value="Cross-Border FBAR / FATCA">Cross-Border FBAR / FATCA Compliance</option>
<option value="AI Bank Statement to P&L">AI Bank Statement to P&amp;L</option>
<option value="Fractional CFO & Advisory">Fractional CFO &amp; Cashflow</option>
<option value="Offshore Team Outsourcing">Offshore Team Outsourcing</option>
</select>
</div>
</div>
<button type="submit" disabled={loading} className="btn btn-primary w-full">
{loading ? 'Sending…' : 'Send message'}
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>How can we help you? *</label>
<textarea
name="message"
required
rows="4"
placeholder="Share a brief overview of your business, annual revenue, or cross-border situation..."
className="artha-form-input"
style={{ resize: 'vertical' }}
value={formData.message}
onChange={handleChange}
></textarea>
</div>
<button
type="submit"
disabled={loading}
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', marginTop: '8px', padding: '13px 24px', fontSize: '14.5px' }}
>
{loading ? 'Submitting...' : 'Submit Consultation Request'}
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>
arrow_forward
</span>
</button>
</form>
</div>
</section>
</>
</div>
</div>
);
}
+83 -23
View File
@@ -12,16 +12,16 @@ export default function ForgotPassword() {
setLoading(true);
try {
await fetch("/api/auth/forgot-password", {
method: "POST",
headers: { "Content-Type": "application/json" },
await fetch('/api/auth/forgot-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email })
});
setMessage("If that email exists, a reset link has been sent.");
setEmail("");
setMessage('If that email exists in our records, a secure reset link has been dispatched.');
setEmail('');
} catch (err) {
console.error(err);
setMessage("Network error. Please try again.");
setMessage('Network error. Please try again.');
} finally {
setLoading(false);
}
@@ -29,41 +29,101 @@ export default function ForgotPassword() {
return (
<div className="auth-shell page-enter">
{/* Brand Side */}
<div className="auth-brand">
<img className="brand-logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro"/>
<div style={{ textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
style={{
width: '58px',
height: '58px',
borderRadius: '14px',
marginBottom: '16px',
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.45)',
border: '1px solid rgba(255, 255, 255, 0.14)'
}}
width="58"
height="58"
/>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '24px', fontWeight: 600, color: '#FFFFFF', margin: 0 }}>
ABC CPA &amp; Advisory
</h2>
<div style={{ fontSize: '11px', textTransform: 'uppercase', letterSpacing: '0.12em', color: '#60A5FA', marginTop: '6px' }}>
Tax Advisory &amp; Accounting Services
</div>
</div>
<div className="brand-divider"></div>
<h2>Reset Your Password</h2>
<p>We'll send a secure link to your registered email address.</p>
<p>
Need portal access? We&apos;ll send an encrypted reset link directly to your verified email address.
</p>
</div>
{/* Form Side */}
<div className="auth-form-side">
<div className="auth-box">
<div style={{fontSize:'40px', marginBottom:'12px'}}>🔑</div>
<h1>Forgot Password?</h1>
<p className="auth-subtitle">Enter your email and we'll send a reset link</p>
<Link
to="/login"
style={{
display: 'inline-flex',
alignItems: 'center',
gap: '6px',
marginBottom: '1.5rem',
fontSize: '13px',
fontWeight: 600,
color: '#1D4ED8',
textDecoration: 'none'
}}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Back to Sign In
</Link>
{message && <div style={{padding: '10px', background: 'var(--blue-light)', color: 'var(--blue)', borderRadius: 'var(--radius-sm)', marginBottom: '16px', fontSize: '14px'}}>{message}</div>}
<h1>Reset Password</h1>
<p className="auth-subtitle">Enter your email and we&apos;ll send an authorized reset link</p>
{message && (
<div style={{ padding: '12px 16px', background: '#ECFDF5', color: '#047857', border: '1px solid rgba(4, 120, 87, 0.2)', borderRadius: '10px', marginBottom: '20px', fontSize: '13.5px' }}>
{message}
</div>
)}
<form onSubmit={handleReset}>
<div className="form-group" style={{marginTop:'24px'}}>
<label className="form-label" htmlFor="email">Email Address</label>
<input
id="email"
type="email"
className="input"
<div className="form-group" style={{ marginBottom: '20px' }}>
<label className="form-label" htmlFor="email" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Email Address
</label>
<input
id="email"
type="email"
className="artha-form-input"
placeholder="you@example.com"
value={email}
onChange={e => setEmail(e.target.value)}
onChange={(e) => setEmail(e.target.value)}
required
/>
</div>
<button type="submit" className="btn btn-primary w-full" disabled={loading} style={{borderRadius:'var(--radius-sm)'}}>
{loading ? "Sending..." : "Send Reset Link"}
<button
type="submit"
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', padding: '12px 20px', fontSize: '14.5px' }}
disabled={loading}
>
{loading ? 'Sending...' : 'Send Password Reset Link'}
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>send</span>
</button>
</form>
<div className="auth-links"><Link to="/login" className="fancy-link">← Back to Sign In</Link></div>
<div className="auth-links">
Remembered your credentials?{' '}
<Link to="/login" style={{ color: '#1D4ED8', fontWeight: 600, textDecoration: 'underline' }}>
Sign In
</Link>
</div>
</div>
</div>
</div>
File diff suppressed because it is too large Load Diff
+128 -47
View File
@@ -17,24 +17,24 @@ export default function Login() {
setLoading(true);
try {
const res = await fetch("/api/auth/login", {
method: "POST",
headers: { "Content-Type": "application/json" },
const res = await fetch('/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password })
});
if (!res.ok) {
const errData = await res.json().catch(() => ({}));
if (res.status === 403 && errData.detail === "EMAIL_NOT_VERIFIED") {
setError("EMAIL_NOT_VERIFIED");
if (res.status === 403 && errData.detail === 'EMAIL_NOT_VERIFIED') {
setError('EMAIL_NOT_VERIFIED');
return;
}
let errorMsg = "Invalid credentials";
let errorMsg = 'Invalid credentials';
if (errData.detail) {
if (typeof errData.detail === 'string') {
errorMsg = errData.detail;
} else if (Array.isArray(errData.detail)) {
errorMsg = errData.detail.map(err => err.msg).join(", ");
errorMsg = errData.detail.map((err) => err.msg).join(', ');
} else {
errorMsg = JSON.stringify(errData.detail);
}
@@ -44,7 +44,7 @@ export default function Login() {
const data = await res.json();
login(data.access_token);
// Navigate to correct dashboard based on role
if (data.role === 'admin' || data.role === 'super_admin') {
navigate('/admin-dashboard');
@@ -60,81 +60,162 @@ export default function Login() {
return (
<div className="auth-shell page-enter">
{/* Brand Side */}
<div className="auth-brand">
<img className="brand-logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro" />
<div style={{ textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
style={{
width: '58px',
height: '58px',
borderRadius: '14px',
marginBottom: '16px',
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.45)',
border: '1px solid rgba(255, 255, 255, 0.14)'
}}
width="58"
height="58"
/>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '24px', fontWeight: 600, color: '#FFFFFF', margin: 0 }}>
ABC CPA &amp; Advisory
</h2>
<div style={{ fontSize: '11px', textTransform: 'uppercase', letterSpacing: '0.12em', color: '#60A5FA', marginTop: '6px' }}>
Tax Advisory &amp; Accounting Services
</div>
</div>
<div className="brand-divider"></div>
<h2>Welcome Back</h2>
<p>Secure access to your bookkeeping portal. Upload documents, track filings, and stay organised.</p>
<p>
Secure client access for document uploads, real-time P&amp;L review, and tax filings.
</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginTop: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12.5px', color: 'rgba(255,255,255,0.72)' }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px', color: '#10B981' }}>lock</span>
256-Bit SSL Encrypted Vault
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12.5px', color: 'rgba(255,255,255,0.72)' }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px', color: '#10B981' }}>verified</span>
AICPA Member Firm Standards
</div>
</div>
</div>
{/* Form Side */}
<div className="auth-form-side">
<div className="auth-box">
<Link to="/" className="fancy-link" style={{display: 'inline-block', marginBottom: '1.5rem', fontSize: '0.95rem', fontWeight: '500'}}>
&larr; Back to Home
<Link
to="/"
style={{
display: 'inline-flex',
alignItems: 'center',
gap: '6px',
marginBottom: '1.5rem',
fontSize: '13px',
fontWeight: 600,
color: '#1D4ED8',
textDecoration: 'none'
}}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Back to Home
</Link>
<h1>Sign In</h1>
<p className="auth-subtitle">Enter your credentials to continue</p>
<h1>Client Sign In</h1>
<p className="auth-subtitle">Enter your portal credentials to continue</p>
{error && (
<div style={{color: 'var(--error)', marginBottom: '1rem', fontSize: '14px'}}>
<div style={{ color: 'var(--error, #DC2626)', marginBottom: '1rem', fontSize: '14px', background: 'rgba(220, 38, 38, 0.08)', padding: '10px 14px', borderRadius: '8px' }}>
{error === 'EMAIL_NOT_VERIFIED' ? (
<>
Your email is not verified. Please check your inbox or{' '}
<Link to="/resend-verification" className="fancy-link">resend the verification link</Link>.
<Link to="/resend-verification" style={{ color: '#1D4ED8', textDecoration: 'underline' }}>
resend the verification link
</Link>.
</>
) : error}
) : (
error
)}
</div>
)}
<form onSubmit={handleLogin}>
<div className="form-group">
<label className="form-label" htmlFor="email">Email Address</label>
<input
id="email"
type="email"
className="input"
placeholder="you@example.com"
required
<div className="form-group" style={{ marginBottom: '16px' }}>
<label className="form-label" htmlFor="email" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Email Address
</label>
<input
id="email"
type="email"
className="artha-form-input"
placeholder="you@example.com"
required
value={email}
onChange={e => setEmail(e.target.value)}
onChange={(e) => setEmail(e.target.value)}
/>
</div>
<div className="form-group">
<label className="form-label" htmlFor="password">Password</label>
<div className="password-wrap">
<input
id="password"
type={showPassword ? 'text' : 'password'}
className="input"
placeholder="Your password"
required
<div className="form-group" style={{ marginBottom: '20px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '6px' }}>
<label className="form-label" htmlFor="password" style={{ fontSize: '12.5px', fontWeight: 600, color: '#0A2540', margin: 0 }}>
Password
</label>
<Link to="/forgot-password" style={{ fontSize: '12px', color: '#1D4ED8', textDecoration: 'none' }}>
Forgot password?
</Link>
</div>
<div style={{ position: 'relative' }}>
<input
id="password"
type={showPassword ? 'text' : 'password'}
className="artha-form-input"
style={{ paddingRight: '60px', marginBottom: 0 }}
placeholder="Your password"
required
value={password}
onChange={e => setPassword(e.target.value)}
onChange={(e) => setPassword(e.target.value)}
/>
<button
type="button"
className="password-toggle"
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
style={{
position: 'absolute',
right: '12px',
top: '50%',
transform: 'translateY(-50%)',
background: 'none',
border: 'none',
fontSize: '12px',
fontWeight: 600,
color: '#425466',
cursor: 'pointer'
}}
>
{showPassword ? 'Hide' : 'Show'}
</button>
</div>
</div>
<button
type="submit"
className="btn btn-primary w-full"
style={{borderRadius: 'var(--radius-sm)', marginTop: '4px'}}
<button
type="submit"
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', padding: '12px 20px', fontSize: '14.5px' }}
disabled={loading}
>
{loading ? 'Signing in...' : 'Sign In'}
{loading ? 'Signing in...' : 'Sign In to Portal'}
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>login</span>
</button>
</form>
<div className="auth-links">
<Link to="/forgot-password" className="fancy-link">Forgot password?</Link><br/>
Don't have an account? <Link to="/signup" className="fancy-link">Sign Up</Link>
Don&apos;t have an account?{' '}
<Link to="/signup" style={{ color: '#1D4ED8', fontWeight: 600, textDecoration: 'underline' }}>
Create Account
</Link>
</div>
</div>
</div>
+179 -46
View File
@@ -65,73 +65,206 @@ export default function Profile() {
}
};
const isAdmin = user?.role === 'admin' || user?.role === 'super_admin';
return (
<div style={{ maxWidth: '680px', margin: '0 auto' }}>
<button
className="btn btn-secondary btn-sm"
style={{ marginBottom: '16px', display: 'inline-flex', alignItems: 'center', gap: '4px', borderRadius: 'var(--radius-sm)' }}
onClick={() => navigate((user?.role === 'admin' || user?.role === 'super_admin') ? '/admin-dashboard' : '/dashboard')}
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>arrow_back</span>
Back to Dashboard
</button>
<div className="page-heading">
<div>
<h1>My Profile</h1>
<p className="page-meta">Update your name, phone number, or password</p>
</div>
<div style={{ maxWidth: '720px', margin: '0 auto' }}>
{/* Back Button */}
<div style={{ marginBottom: '20px' }}>
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '6px 14px', fontSize: '12.5px' }}
onClick={() => navigate(isAdmin ? '/admin-dashboard' : '/dashboard')}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Return to {isAdmin ? 'Admin Portal' : 'Client Overview'}
</button>
</div>
<div className="card" style={{ marginBottom: '20px' }}>
<h3 style={{ marginBottom: '20px', paddingBottom: '12px', borderBottom: '1px solid var(--border)' }} className="card-title">Account Info</h3>
<div className="form-group">
<label className="form-label">Email Address <span style={{ color: 'var(--muted)', fontWeight: 400 }}>(cannot be changed)</span></label>
<input type="email" className="input" readOnly value={user?.email || ''} />
</div>
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '16px' }}>
<div className="form-group">
<label className="form-label">Full Name</label>
<input type="text" className="input" placeholder="Your full name" value={formData.name} onChange={e => setFormData({ ...formData, name: e.target.value })} />
{/* Hero Card */}
<div className="artha-portal-hero" style={{ padding: '24px 28px', marginBottom: '24px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>
<div
style={{
width: '56px',
height: '56px',
borderRadius: '50%',
background: 'linear-gradient(135deg, #1D4ED8 0%, #14B8A6 100%)',
color: '#FFFFFF',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: '22px',
fontWeight: 700,
flexShrink: 0
}}
>
{(user?.name || user?.email || 'U').charAt(0).toUpperCase()}
</div>
<div className="form-group">
<label className="form-label">Phone Number</label>
<input type="tel" className="input" placeholder="+1 (555) 000-0000" value={formData.phone} onChange={e => setFormData({ ...formData, phone: e.target.value })} />
<div>
<div className="artha-eyebrow-pill" style={{ marginBottom: '4px' }}>
<span className="dot"></span>
ACCOUNT SETTINGS
</div>
<h1 style={{ fontSize: '24px', margin: '2px 0 0' }}>{user?.name || 'Account Profile'}</h1>
<p style={{ fontSize: '13px', margin: '2px 0 0', color: '#425466' }}>{user?.email}</p>
</div>
</div>
<span className={`artha-status-pill ${isAdmin ? 'artha-status-rejected' : 'artha-status-approved'}`}>
{user?.role === 'super_admin' ? 'Super Admin' : user?.role === 'admin' ? 'Staff CPA' : 'Verified Client'}
</span>
</div>
{/* Account Info Form Card */}
<div className="artha-portal-card">
<div className="artha-portal-card-header">
<h3 className="artha-portal-card-title">
<span className="material-symbols-outlined" style={{ color: '#1D4ED8' }}>badge</span>
Contact &amp; Identity Information
</h3>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
<div>
<label style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Email Address <span style={{ color: '#425466', fontWeight: 400 }}>(Permanent identifier)</span>
</label>
<input
type="email"
readOnly
value={user?.email || ''}
style={{
width: '100%',
padding: '11px 14px',
borderRadius: '12px',
border: '1px solid rgba(10, 37, 64,0.1)',
background: '#F6F9FC',
color: '#425466',
fontSize: '13.5px',
outline: 'none',
cursor: 'not-allowed'
}}
/>
</div>
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '14px' }}>
<div>
<label style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Full Legal Name
</label>
<input
type="text"
placeholder="First and Last Name"
value={formData.name}
onChange={e => setFormData({ ...formData, name: e.target.value })}
className="artha-form-input"
style={{ width: '100%', padding: '11px 14px', fontSize: '13.5px' }}
/>
</div>
<div>
<label style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Primary Phone Number
</label>
<input
type="tel"
placeholder="Phone Number"
value={formData.phone}
onChange={e => setFormData({ ...formData, phone: e.target.value })}
className="artha-form-input"
style={{ width: '100%', padding: '11px 14px', fontSize: '13.5px' }}
/>
</div>
</div>
</div>
</div>
<div className="card" style={{ marginBottom: '24px' }}>
<div className="flex-between" style={{ marginBottom: '4px', cursor: 'pointer' }} onClick={() => setShowPwSection(!showPwSection)}>
<h3 className="card-title">Change Password</h3>
<span style={{ color: 'var(--muted)', fontSize: '18px' }}>{showPwSection ? '▼' : '▶'}</span>
{/* Security & Password Accordion */}
<div className="artha-portal-card">
<div
style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', cursor: 'pointer' }}
onClick={() => setShowPwSection(!showPwSection)}
>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<span className="material-symbols-outlined" style={{ color: '#1D4ED8' }}>password</span>
<div>
<h4 style={{ fontSize: '16px', color: '#0A2540', margin: 0, fontWeight: 600 }}>Security &amp; Password</h4>
<p style={{ fontSize: '12.5px', color: '#425466', margin: '2px 0 0' }}>
Update your account password or review login credentials
</p>
</div>
</div>
<span className="material-symbols-outlined" style={{ color: '#425466', transition: 'transform 0.2s', transform: showPwSection ? 'rotate(180deg)' : 'none' }}>
expand_more
</span>
</div>
<p className="text-sm" style={{ marginBottom: 0 }}>Click to expand and update your password</p>
{showPwSection && (
<div style={{ marginTop: '20px', paddingTop: '20px', borderTop: '1px solid var(--border)' }}>
<div className="form-group">
<label className="form-label">Current Password</label>
<input type="password" className="input" placeholder="Enter current password" value={pwData.currentPw} onChange={e => setPwData({ ...pwData, currentPw: e.target.value })} />
<div style={{ marginTop: '18px', paddingTop: '18px', borderTop: '1px solid rgba(10, 37, 64,0.08)', display: 'flex', flexDirection: 'column', gap: '14px' }}>
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '4px' }}>
Current Password
</label>
<input
type="password"
placeholder="Enter current password"
value={pwData.currentPw}
onChange={e => setPwData({ ...pwData, currentPw: e.target.value })}
className="artha-form-input"
style={{ width: '100%', padding: '10px 14px', fontSize: '13px' }}
/>
</div>
<div className="form-group">
<label className="form-label">New Password</label>
<div className="password-wrap">
<input type={showNewPw ? 'text' : 'password'} className="input" placeholder="At least 8 characters" style={{ paddingRight: '56px' }} value={pwData.newPw} onChange={e => setPwData({ ...pwData, newPw: e.target.value })} />
<button type="button" className="password-toggle" onClick={() => setShowNewPw(!showNewPw)}>
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '4px' }}>
New Password (minimum 8 characters)
</label>
<div style={{ position: 'relative' }}>
<input
type={showNewPw ? 'text' : 'password'}
placeholder="New secure password"
value={pwData.newPw}
onChange={e => setPwData({ ...pwData, newPw: e.target.value })}
className="artha-form-input"
style={{ width: '100%', padding: '10px 50px 10px 14px', fontSize: '13px' }}
/>
<button
type="button"
onClick={() => setShowNewPw(!showNewPw)}
style={{ position: 'absolute', right: '12px', top: '50%', transform: 'translateY(-50%)', background: 'none', border: 'none', color: '#425466', fontSize: '12px', cursor: 'pointer' }}
>
{showNewPw ? 'Hide' : 'Show'}
</button>
</div>
</div>
<div className="form-group">
<label className="form-label">Confirm New Password</label>
<input type="password" className="input" placeholder="Repeat new password" value={pwData.confirmPw} onChange={e => setPwData({ ...pwData, confirmPw: e.target.value })} />
<div>
<label style={{ display: 'block', fontSize: '12px', fontWeight: 600, color: '#0A2540', marginBottom: '4px' }}>
Confirm New Password
</label>
<input
type="password"
placeholder="Repeat new password"
value={pwData.confirmPw}
onChange={e => setPwData({ ...pwData, confirmPw: e.target.value })}
className="artha-form-input"
style={{ width: '100%', padding: '10px 14px', fontSize: '13px' }}
/>
</div>
</div>
)}
</div>
<button className="btn btn-primary w-full" style={{ borderRadius: 'var(--radius-sm)' }} onClick={handleSave} disabled={loading}>
{loading ? 'Saving...' : 'Save Changes'}
{/* Save Button */}
<button
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', padding: '12px 24px', fontSize: '14px', justifyContent: 'center' }}
onClick={handleSave}
disabled={loading}
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>save</span>
{loading ? 'Saving Profile...' : 'Save Profile Changes'}
</button>
</div>
);
+82 -23
View File
@@ -12,16 +12,16 @@ export default function ResendVerification() {
setLoading(true);
try {
await fetch("/api/auth/resend-verification", {
method: "POST",
headers: { "Content-Type": "application/json" },
await fetch('/api/auth/resend-verification', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email })
});
setMessage("If that email is registered and unverified, a new link has been sent. Check your inbox.");
setEmail("");
setMessage('If that email is registered and unverified, a new link has been dispatched.');
setEmail('');
} catch (err) {
console.error(err);
setMessage("Network error. Please try again.");
setMessage('Network error. Please try again.');
} finally {
setLoading(false);
}
@@ -29,41 +29,100 @@ export default function ResendVerification() {
return (
<div className="auth-shell page-enter">
{/* Brand Side */}
<div className="auth-brand">
<img className="brand-logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro"/>
<div style={{ textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
style={{
width: '58px',
height: '58px',
borderRadius: '14px',
marginBottom: '16px',
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.45)',
border: '1px solid rgba(255, 255, 255, 0.14)'
}}
width="58"
height="58"
/>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '24px', fontWeight: 600, color: '#FFFFFF', margin: 0 }}>
ABC CPA &amp; Advisory
</h2>
<div style={{ fontSize: '11px', textTransform: 'uppercase', letterSpacing: '0.12em', color: '#60A5FA', marginTop: '6px' }}>
Tax Advisory &amp; Accounting Services
</div>
</div>
<div className="brand-divider"></div>
<h2>Verify Your Email</h2>
<p>Check your inbox for the verification link. It expires in 24 hours.</p>
<p>
Need a fresh verification link? Enter your email and we&apos;ll send an authorized authorization email.
</p>
</div>
{/* Form Side */}
<div className="auth-form-side">
<div className="auth-box">
<div style={{fontSize:'40px', marginBottom:'12px'}}>📧</div>
<h1>Resend Verification</h1>
<p className="auth-subtitle">We'll send a new link to your registered email</p>
<Link
to="/login"
style={{
display: 'inline-flex',
alignItems: 'center',
gap: '6px',
marginBottom: '1.5rem',
fontSize: '13px',
fontWeight: 600,
color: '#1D4ED8',
textDecoration: 'none'
}}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Back to Sign In
</Link>
{message && <div style={{padding: '10px', background: 'var(--blue-light)', color: 'var(--blue)', borderRadius: 'var(--radius-sm)', marginBottom: '16px', fontSize: '14px'}}>{message}</div>}
<h1>Resend Verification</h1>
<p className="auth-subtitle">We&apos;ll send an authorized activation link to your email</p>
{message && (
<div style={{ padding: '12px 16px', background: '#ECFDF5', color: '#047857', border: '1px solid rgba(4, 120, 87, 0.2)', borderRadius: '10px', marginBottom: '20px', fontSize: '13.5px' }}>
{message}
</div>
)}
<form onSubmit={handleResend}>
<div className="form-group" style={{marginTop:'24px'}}>
<label className="form-label" htmlFor="email">Email Address</label>
<input
id="email"
type="email"
className="input"
<div className="form-group" style={{ marginBottom: '20px' }}>
<label className="form-label" htmlFor="email" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Email Address
</label>
<input
id="email"
type="email"
className="artha-form-input"
placeholder="you@example.com"
value={email}
onChange={e => setEmail(e.target.value)}
onChange={(e) => setEmail(e.target.value)}
required
/>
</div>
<button type="submit" className="btn btn-primary w-full" disabled={loading} style={{borderRadius:'var(--radius-sm)'}}>
{loading ? "Sending..." : "Send Verification Link"}
<button
type="submit"
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', padding: '12px 20px', fontSize: '14.5px' }}
disabled={loading}
>
{loading ? 'Sending...' : 'Send Verification Link'}
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>send</span>
</button>
</form>
<div className="auth-links"><Link to="/login" className="fancy-link">Back to Sign In</Link></div>
<div className="auth-links">
<Link to="/login" style={{ color: '#1D4ED8', fontWeight: 600, textDecoration: 'underline' }}>
Back to Sign In
</Link>
</div>
</div>
</div>
</div>
+109 -30
View File
@@ -14,7 +14,7 @@ export default function ResetPassword() {
useEffect(() => {
if (!token) {
setError("Invalid or missing reset link. Request a new one.");
setError('Invalid or expired reset token. Please request a new link.');
}
}, [token]);
@@ -25,28 +25,28 @@ export default function ResetPassword() {
setLoading(true);
setError(null);
try {
const res = await fetch("/api/auth/reset-password", {
method: "POST",
headers: { "Content-Type": "application/json" },
const res = await fetch('/api/auth/reset-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ token, new_password: password })
});
const data = await res.json();
if (!res.ok) {
let errorMsg = "Password reset failed";
let errorMsg = 'Password reset failed';
if (data.detail) {
if (typeof data.detail === 'string') {
errorMsg = data.detail;
} else if (Array.isArray(data.detail)) {
errorMsg = data.detail.map(err => err.msg).join(", ");
errorMsg = data.detail.map((err) => err.msg).join(', ');
} else {
errorMsg = JSON.stringify(data.detail);
}
}
throw new Error(errorMsg);
}
setMessage("Password reset! Redirecting to sign in...");
setMessage('Password successfully updated! Redirecting to sign in...');
setTimeout(() => navigate('/login'), 2000);
} catch (err) {
setError(err.message);
@@ -57,47 +57,126 @@ export default function ResetPassword() {
return (
<div className="auth-shell page-enter">
{/* Brand Side */}
<div className="auth-brand">
<img className="brand-logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro"/>
<div style={{ textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
style={{
width: '58px',
height: '58px',
borderRadius: '14px',
marginBottom: '16px',
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.45)',
border: '1px solid rgba(255, 255, 255, 0.14)'
}}
width="58"
height="58"
/>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '24px', fontWeight: 600, color: '#FFFFFF', margin: 0 }}>
ABC CPA &amp; Advisory
</h2>
<div style={{ fontSize: '11px', textTransform: 'uppercase', letterSpacing: '0.12em', color: '#60A5FA', marginTop: '6px' }}>
Tax Advisory &amp; Accounting Services
</div>
</div>
<div className="brand-divider"></div>
<h2>Choose a New Password</h2>
<p>Pick something strong — at least 8 characters with a mix of letters, numbers, and symbols.</p>
<p>
Choose a robust password to ensure the continued security of your financial and tax documents.
</p>
</div>
{/* Form Side */}
<div className="auth-form-side">
<div className="auth-box">
<div style={{fontSize:'40px', marginBottom:'12px'}}>🔒</div>
<h1>Reset Password</h1>
<p className="auth-subtitle">Enter your new password below</p>
<Link
to="/login"
style={{
display: 'inline-flex',
alignItems: 'center',
gap: '6px',
marginBottom: '1.5rem',
fontSize: '13px',
fontWeight: 600,
color: '#1D4ED8',
textDecoration: 'none'
}}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Back to Sign In
</Link>
{error && <div style={{color: 'var(--error)', marginBottom: '1rem', fontSize: '14px'}}>{error}</div>}
{message && <div style={{color: 'var(--green)', marginBottom: '1rem', fontSize: '14px'}}>{message}</div>}
<h1>Create New Password</h1>
<p className="auth-subtitle">Enter your new credentials below</p>
{error && (
<div style={{ color: 'var(--error, #DC2626)', marginBottom: '1rem', fontSize: '14px', background: 'rgba(220, 38, 38, 0.08)', padding: '10px 14px', borderRadius: '8px' }}>
{error}
</div>
)}
{message && (
<div style={{ padding: '12px 16px', background: '#ECFDF5', color: '#047857', border: '1px solid rgba(4, 120, 87, 0.2)', borderRadius: '10px', marginBottom: '20px', fontSize: '13.5px' }}>
{message}
</div>
)}
<form onSubmit={handleReset}>
<div className="form-group" style={{marginTop:'24px'}}>
<label className="form-label" htmlFor="password">New Password</label>
<div className="password-wrap">
<input
id="password"
type={showPassword ? "text" : "password"}
className="input"
<div className="form-group" style={{ marginBottom: '22px' }}>
<label className="form-label" htmlFor="password" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
New Password
</label>
<div style={{ position: 'relative' }}>
<input
id="password"
type={showPassword ? 'text' : 'password'}
className="artha-form-input"
style={{ paddingRight: '60px', marginBottom: 0 }}
placeholder="At least 8 characters"
value={password}
onChange={e => setPassword(e.target.value)}
onChange={(e) => setPassword(e.target.value)}
required
/>
<button type="button" className="password-toggle" onClick={() => setShowPassword(!showPassword)}>
{showPassword ? "Hide" : "Show"}
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
style={{
position: 'absolute',
right: '12px',
top: '50%',
transform: 'translateY(-50%)',
background: 'none',
border: 'none',
fontSize: '12px',
fontWeight: 600,
color: '#425466',
cursor: 'pointer'
}}
>
{showPassword ? 'Hide' : 'Show'}
</button>
</div>
</div>
<button type="submit" className="btn btn-primary w-full" disabled={loading || !token} style={{borderRadius:'var(--radius-sm)'}}>
{loading ? "Resetting..." : "Reset Password"}
<button
type="submit"
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', padding: '12px 20px', fontSize: '14.5px' }}
disabled={loading || !token}
>
{loading ? 'Resetting...' : 'Save New Password'}
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>lock_reset</span>
</button>
</form>
<div className="auth-links"><Link to="/login" className="fancy-link">Back to Sign In</Link></div>
<div className="auth-links">
<Link to="/login" style={{ color: '#1D4ED8', fontWeight: 600, textDecoration: 'underline' }}>
Return to Sign In
</Link>
</div>
</div>
</div>
</div>
+224 -67
View File
@@ -1,76 +1,233 @@
import { useNavigate } from 'react-router-dom';
export default function Services() {
const navigate = useNavigate();
const servicesList = [
{
id: 'tax-strategy',
category: 'TAX COMPLIANCE & STRATEGY',
title: 'Corporate & Individual Tax Strategy',
subtitle: 'Proactive entity planning, deductions, and audit-proof filings.',
image: '/images/services-1.webp',
description:
'Managing tax liability requires forward-looking advisory rather than retrospective filing. We analyze your corporate structure (LLC, S-Corp, C-Corp, or Partnership) to uncover qualified business deductions, R&D tax credits, and optimal owner distributions.',
bullets: [
'Federal & multi-state corporate tax preparation (Forms 1120, 1120-S, 1065)',
'Quarterly estimated tax calculations and proactive safe-harbor planning',
'State tax nexus audits (economic nexus, sales tax, franchise taxes)',
'Depreciation acceleration (Section 179 and bonus depreciation strategies)',
'Owner-executive compensation and health/retirement benefit structuring'
],
icon: 'calculate'
},
{
id: 'cross-border',
category: 'INTERNATIONAL & CROSS-BORDER',
title: 'Cross-Border, Expat & FBAR / FATCA Advisory',
subtitle: 'Dual-jurisdiction compliance across US and India tax frameworks.',
image: '/images/services-2.webp',
description:
'International transactions and foreign asset holdings trigger severe IRS disclosure penalties if mishandled. We specialize in cross-border wealth, Indian investments, repatriation of capital, and dual-status tax residency under the US-India Double Tax Avoidance Agreement (DTAA).',
bullets: [
'FBAR (FinCEN Form 114) for foreign bank, mutual fund, and NRE/NRO accounts',
'FATCA (Form 8938) reporting of specified foreign financial assets',
'Form 5471 & Form 5472 disclosures for foreign-owned or overseas corporations',
'Foreign Tax Credit (Form 1116) and Foreign Earned Income Exclusion (Form 2555)',
'Repatriation of funds, Indian real estate sales, and capital gains advisory'
],
icon: 'public'
},
{
id: 'ai-bookkeeping',
category: 'INTELLIGENT ACCOUNTING',
title: 'Instant P&L from Bank Statements & Bookkeeping',
subtitle: 'AI-driven statement ingestion paired with senior CPA oversight.',
image: '/images/services-block-3.webp',
description:
'Say goodbye to month-long turnaround times and messy spreadsheets. Our AI ingestion engine parses bank statements directly into categorized, reconciled general ledgers. Every entry is cross-checked by experienced accountants for pristine, audit-ready books.',
bullets: [
'Automated ingestion of bank statements (PDF, scanned, and digital feeds)',
'Continuous reconciliation of checking, savings, merchant (Stripe/PayPal), and credit cards',
'Accrual and cash-basis financial statements (P&L, Balance Sheet, Cash Flow)',
'QuickBooks Online & Xero cloud sync with custom chart of accounts',
'Audit-ready documentation and digital receipt attachment'
],
icon: 'receipt_long'
},
{
id: 'fractional-cfo',
category: 'EXECUTIVE ADVISORY',
title: 'Fractional CFO & Cashflow Advisory',
subtitle: 'High-level financial leadership to scale revenue and protect margins.',
image: '/images/young-business-people-using-computer-in-office.webp',
description:
'Growth-stage enterprises and founders require senior strategic insights without the overhead of a full-time executive. We guide capital allocation, cashflow forecasting, burn-rate management, and investor reporting so you navigate transitions with confidence.',
bullets: [
'Dynamic 13-week cash flow projections and scenario modeling',
'Burn rate analysis, runway extensions, and working capital optimization',
'KPI benchmarking, gross margin analysis, and unit economics',
'Board deck preparation and investor-facing financial presentations',
'M&A transaction readiness and pre-deal due diligence'
],
icon: 'trending_up'
},
{
id: 'offshore-delivery',
category: 'FIRM CAPACITY',
title: 'Global Delivery & Offshore Accounting Teams',
subtitle: 'Dedicated accounting back-office for US CPA firms and enterprises.',
image: '/images/services-3.webp',
description:
'Address staffing shortages and scale firm capacity seamlessly. Our India offshore center provides qualified Chartered Accountants, cost accountants, and QuickBooks ProAdvisors working in tight synchronization with your onshore workflows.',
bullets: [
'Dedicated remote bookkeeping, payroll, and tax preparation squads',
'Standardized SOPs, dual-tier quality reviews, and strict SLAs',
'SOC-2 aligned security protocols and encrypted data transmission',
'Timezone advantage allowing overnight processing and faster turnaround',
'Flexible engagement models from project-based to full-time dedicated staff'
],
icon: 'hub'
}
];
return (
<>
<div className="page-hero" style={{ '--hero-img': 'url("/images/Services-background-image.webp")' }}>
<div className="page-hero-inner">
<span className="eyebrow">What we do</span>
<h1>Professional services for firms and businesses</h1>
<div className="artha-services-page" style={{ background: 'var(--paper, #F6F9FC)', minHeight: '100vh', paddingBottom: '50px' }}>
{/* Header Banner */}
<section style={{ padding: '36px 0 24px', borderBottom: '1px solid rgba(10, 37, 64,0.07)' }}>
<div style={{ width: 'min(1280px, 94%)', margin: '0 auto', textAlign: 'center' }}>
<div className="artha-eyebrow-pill">
<span className="dot"></span>
PRACTICE AREAS &amp; ADVISORY
</div>
<h1 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: 'clamp(23px, 2.3vw, 32px)', color: '#0A2540', fontWeight: 600, margin: '10px 0' }}>
Comprehensive Tax &amp; Accounting Services
</h1>
<p style={{ maxWidth: '580px', margin: '0 auto', color: '#425466', fontSize: '13.5px', lineHeight: 1.6 }}>
Designed for founders, cross-border families, and modern enterprises seeking rigorous precision, strategic tax reduction, and audit-ready financials.
</p>
</div>
</section>
{/* Services List Blocks with Images */}
<div style={{ width: 'min(1280px, 94%)', margin: '40px auto 0', display: 'flex', flexDirection: 'column', gap: '30px' }}>
{servicesList.map((svc, idx) => (
<div
key={svc.id}
id={svc.id}
className={`reveal reveal-delay-${(idx % 3) + 1}`}
style={{
background: '#FFFFFF',
border: '1px solid rgba(10, 37, 64, 0.08)',
borderRadius: '20px',
padding: 'clamp(22px, 2.6vw, 34px)',
boxShadow: '0 4px 20px -2px rgba(10, 37, 64, 0.04)',
display: 'grid',
gridTemplateColumns: idx % 2 === 0 ? '1.15fr 0.85fr' : '0.85fr 1.15fr',
gap: '34px',
alignItems: 'center',
transition: 'transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease'
}}
>
{/* Main Content Column */}
<div style={{ order: idx % 2 === 0 ? 1 : 2 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', marginBottom: '10px' }}>
<span className="artha-service-pill-tag" style={{ margin: 0 }}>
{svc.category}
</span>
</div>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: 'clamp(18px, 1.9vw, 24px)', color: '#0A2540', fontWeight: 600, marginBottom: '6px' }}>
{svc.title}
</h2>
<p style={{ fontStyle: 'italic', color: '#1D4ED8', fontSize: '13.5px', fontWeight: 500, marginBottom: '12px' }}>
{svc.subtitle}
</p>
<p style={{ color: '#425466', fontSize: '13px', lineHeight: 1.6, marginBottom: '18px' }}>
{svc.description}
</p>
<button
className="artha-pill-btn artha-pill-primary"
onClick={() => navigate('/contact')}
>
Inquire About This Service
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>
arrow_forward
</span>
</button>
</div>
{/* Visual & Checklist Column */}
<div
style={{
order: idx % 2 === 0 ? 2 : 1,
background: '#F6F9FC',
border: '1px solid rgba(10, 37, 64, 0.08)',
borderRadius: '20px',
padding: '24px',
display: 'flex',
flexDirection: 'column',
gap: '18px'
}}
>
{/* Service Visual Thumbnail */}
<div style={{ width: '100%', height: '200px', borderRadius: '14px', overflow: 'hidden', boxShadow: '0 4px 12px rgba(10, 37, 64,0.06)' }}>
<img
src={svc.image}
alt={svc.title}
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
loading="lazy"
width="600"
height="400"
/>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<div className="artha-ticker-icon" style={{ width: '32px', height: '32px', margin: 0 }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>{svc.icon}</span>
</div>
<h3 style={{ fontSize: '15px', fontWeight: 600, color: '#0A2540', margin: 0 }}>
Key Practice Capabilities
</h3>
</div>
<ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: '10px' }}>
{svc.bullets.map((b, bIdx) => (
<li key={bIdx} style={{ display: 'flex', alignItems: 'flex-start', gap: '10px', fontSize: '13px', color: '#0A2540', lineHeight: 1.45 }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px', color: '#047857', flexShrink: 0, marginTop: '2px' }}>
check_circle
</span>
<span>{b}</span>
</li>
))}
</ul>
</div>
</div>
))}
</div>
<div className="services-wrapper">
<div className="service-block reveal">
<div className="service-text">
<span className="eyebrow">Offshore delivery</span>
<h2>For accounting firms and businesses</h2>
<p>
BookKeepPro India specialises in its offshore delivery model and
consists of a strong team of qualified accountants, cost
accountants, tax consultants and payroll experts to ease the
bookkeeping for accounting firms and businesses, globally.
</p>
<br />
<p>
Our India-based offshore bookkeeping services offer several
benefits to global accounting firms and businesses.
</p>
</div>
<img className="service-img" src="/images/services-3.webp" alt="Accounting Outsourcing" width="600" height="400" loading="lazy" />
</div>
<div className="service-block reverse reveal">
<div className="service-text">
<span className="eyebrow">Accounting outsourcing</span>
<h2>Scale your business with outsourcing</h2>
<p>
Managing finances and accounting can be a complex and
time-consuming task, often diverting your focus away from what
truly matters — growing your business.
</p>
<br />
<p>
That's where we come in: a bookkeeping team that runs in the
background so yours doesn't have to.
</p>
</div>
<img className="service-img-bl-3" src="/images/services-2.webp" alt="Outsourced Accounting Team" width="600" height="400" loading="lazy" />
</div>
<div className="service-block reveal">
<div className="service-text">
<span className="eyebrow">Tax planning</span>
<h2>Tax planning and preparation</h2>
<p>
We help individuals and businesses optimize tax strategy and get
returns prepared right and on time. Whether your business is an
LLC, S-Corp, or C-Corp, we'll help you:
</p>
<ol className="list-items">
<li>Comply with and leverage changing federal tax law</li>
<li>Minimize overall tax liability through strategic planning</li>
<li>Determine taxation of owner-provided benefits</li>
<li>Leverage year-end tax opportunities</li>
<li>Manage multi-state tax exposure based on nexus</li>
</ol>
<br />
<p>
By minimizing your tax liability, you maximize your after-tax
cash flow — the foundation of a proactive, confident tax plan.
</p>
</div>
<img className="service-img" src="/images/services-1.webp" alt="Tax Services" width="600" height="400" loading="lazy" />
{/* Bottom Consultation CTA */}
<div className="reveal" style={{ width: 'min(1280px, 94%)', margin: '48px auto 0', textAlign: 'center', background: '#0A2540', borderRadius: '20px', padding: '36px 20px', color: '#FFFFFF' }}>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: 'clamp(20px, 2.1vw, 27px)', color: '#FFFFFF', marginBottom: '10px' }}>
Need a Custom Advisory Engagement?
</h2>
<p style={{ color: 'rgba(255,255,255,0.75)', maxWidth: '520px', margin: '0 auto 22px', fontSize: '13.5px', lineHeight: 1.6 }}>
Schedule a direct 15-minute consultation to review your corporate or cross-border structure with a senior tax strategist.
</p>
<div style={{ display: 'flex', gap: '14px', justifyContent: 'center', flexWrap: 'wrap' }}>
<button className="artha-pill-btn artha-pill-primary" onClick={() => navigate('/contact')}>
Schedule Strategy Call
</button>
<button
className="artha-pill-btn artha-pill-outline"
style={{ background: 'transparent', color: '#FFFFFF', borderColor: 'rgba(255,255,255,0.3)' }}
onClick={() => navigate('/login')}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>login</span>
Login Portal
</button>
</div>
</div>
</>
</div>
);
}
+145 -62
View File
@@ -14,20 +14,20 @@ export default function Signup() {
setLoading(true);
try {
const res = await fetch("/api/auth/signup", {
method: "POST",
headers: { "Content-Type": "application/json" },
const res = await fetch('/api/auth/signup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(formData)
});
if (!res.ok) {
const data = await res.json();
let errorMsg = "Signup failed";
let errorMsg = 'Signup failed';
if (data.detail) {
if (typeof data.detail === 'string') {
errorMsg = data.detail;
} else if (Array.isArray(data.detail)) {
errorMsg = data.detail.map(err => err.msg).join(", ");
errorMsg = data.detail.map((err) => err.msg).join(', ');
} else {
errorMsg = JSON.stringify(data.detail);
}
@@ -36,7 +36,7 @@ export default function Signup() {
}
// Success, route to login with message
navigate('/login', { state: { message: "Account created successfully. Please log in." }});
navigate('/login', { state: { message: 'Account created successfully. Please log in.' } });
} catch (err) {
setError(err.message);
} finally {
@@ -46,94 +46,177 @@ export default function Signup() {
return (
<div className="auth-shell page-enter">
{/* Brand Side */}
<div className="auth-brand">
<img className="brand-logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro" />
<div style={{ textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
style={{
width: '58px',
height: '58px',
borderRadius: '14px',
marginBottom: '16px',
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.45)',
border: '1px solid rgba(255, 255, 255, 0.14)'
}}
width="58"
height="58"
/>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '24px', fontWeight: 600, color: '#FFFFFF', margin: 0 }}>
ABC CPA &amp; Advisory
</h2>
<div style={{ fontSize: '11px', textTransform: 'uppercase', letterSpacing: '0.12em', color: '#60A5FA', marginTop: '6px' }}>
Tax Advisory &amp; Accounting Services
</div>
</div>
<div className="brand-divider"></div>
<h2>Join BookKeepPro</h2>
<p>Create your account to securely upload documents, track reviews, and stay on top of your filings.</p>
<p>
Create your client account to upload bank statements, review corporate ledgers, and collaborate directly with our CPAs.
</p>
<div style={{ display: 'flex', flexDirection: 'column', gap: '10px', marginTop: '12px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12.5px', color: 'rgba(255,255,255,0.72)' }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px', color: '#10B981' }}>lock</span>
256-Bit SSL Encrypted Vault
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12.5px', color: 'rgba(255,255,255,0.72)' }}>
<span className="material-symbols-outlined" style={{ fontSize: '16px', color: '#10B981' }}>verified</span>
AICPA Member Firm Standards
</div>
</div>
</div>
{/* Form Side */}
<div className="auth-form-side">
<div className="auth-box">
<Link to="/" className="fancy-link" style={{display: 'inline-block', marginBottom: '1.5rem', fontSize: '0.95rem', fontWeight: '500'}}>
&larr; Back to Home
<Link
to="/"
style={{
display: 'inline-flex',
alignItems: 'center',
gap: '6px',
marginBottom: '1.5rem',
fontSize: '13px',
fontWeight: 600,
color: '#1D4ED8',
textDecoration: 'none'
}}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Back to Home
</Link>
<h1>Create Account</h1>
<p className="auth-subtitle">It only takes a minute</p>
{error && <div style={{color: 'var(--error)', marginBottom: '1rem', fontSize: '14px'}}>{error}</div>}
<h1>Create Account</h1>
<p className="auth-subtitle">It only takes a minute to set up your portal</p>
{error && (
<div style={{ color: 'var(--error, #DC2626)', marginBottom: '1rem', fontSize: '14px', background: 'rgba(220, 38, 38, 0.08)', padding: '10px 14px', borderRadius: '8px' }}>
{error}
</div>
)}
<form onSubmit={handleSignup} autoComplete="off">
<div className="form-group">
<label className="form-label" htmlFor="name">Full Name</label>
<input
id="name"
type="text"
className="input"
placeholder="Jane Smith"
required
<div className="form-group" style={{ marginBottom: '16px' }}>
<label className="form-label" htmlFor="name" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Full Name *
</label>
<input
id="name"
type="text"
className="artha-form-input"
placeholder="Jane Smith"
required
value={formData.name}
onChange={e => setFormData({...formData, name: e.target.value})}
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
/>
</div>
<div className="form-group">
<label className="form-label" htmlFor="email">Email Address</label>
<input
id="email"
type="email"
className="input"
placeholder="you@example.com"
required
<div className="form-group" style={{ marginBottom: '16px' }}>
<label className="form-label" htmlFor="email" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Email Address *
</label>
<input
id="email"
type="email"
className="artha-form-input"
placeholder="you@example.com"
required
value={formData.email}
onChange={e => setFormData({...formData, email: e.target.value})}
onChange={(e) => setFormData({ ...formData, email: e.target.value })}
/>
</div>
<div className="form-group">
<label className="form-label" htmlFor="phone">Phone Number <span style={{color:'var(--muted)', fontWeight:400}}>(optional)</span></label>
<input
id="phone"
type="tel"
className="input"
placeholder="+1 (555) 000-0000"
<div className="form-group" style={{ marginBottom: '16px' }}>
<label className="form-label" htmlFor="phone" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Phone Number <span style={{ color: '#8C9BA5', fontWeight: 400 }}>(optional)</span>
</label>
<input
id="phone"
type="tel"
className="artha-form-input"
placeholder="Phone Number"
value={formData.phone}
onChange={e => setFormData({...formData, phone: e.target.value})}
onChange={(e) => setFormData({ ...formData, phone: e.target.value })}
/>
</div>
<div className="form-group">
<label className="form-label" htmlFor="password">Password</label>
<div className="password-wrap">
<input
id="password"
type={showPassword ? 'text' : 'password'}
className="input"
placeholder="At least 8 characters"
required
style={{paddingRight:'56px'}}
<div className="form-group" style={{ marginBottom: '22px' }}>
<label className="form-label" htmlFor="password" style={{ display: 'block', fontSize: '12.5px', fontWeight: 600, color: '#0A2540', marginBottom: '6px' }}>
Password *
</label>
<div style={{ position: 'relative' }}>
<input
id="password"
type={showPassword ? 'text' : 'password'}
className="artha-form-input"
style={{ paddingRight: '60px', marginBottom: 0 }}
placeholder="Create a strong password"
required
value={formData.password}
onChange={e => setFormData({...formData, password: e.target.value})}
onChange={(e) => setFormData({ ...formData, password: e.target.value })}
/>
<button
type="button"
className="password-toggle"
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
style={{
position: 'absolute',
right: '12px',
top: '50%',
transform: 'translateY(-50%)',
background: 'none',
border: 'none',
fontSize: '12px',
fontWeight: 600,
color: '#425466',
cursor: 'pointer'
}}
>
{showPassword ? 'Hide' : 'Show'}
</button>
</div>
</div>
<button
type="submit"
className="btn btn-primary w-full"
style={{borderRadius: 'var(--radius-sm)'}}
<button
type="submit"
className="artha-pill-btn artha-pill-primary"
style={{ width: '100%', padding: '12px 20px', fontSize: '14.5px' }}
disabled={loading}
>
{loading ? 'Creating account...' : 'Create Account'}
{loading ? 'Creating Account...' : 'Create Client Account'}
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>arrow_forward</span>
</button>
<div className="auth-links">
Already have an account? <Link to="/login" className="fancy-link">Sign In</Link>
</div>
</form>
<div className="auth-links">
Already have an account?{' '}
<Link to="/login" style={{ color: '#1D4ED8', fontWeight: 600, textDecoration: 'underline' }}>
Sign In
</Link>
</div>
</div>
</div>
</div>
+309 -133
View File
@@ -14,6 +14,7 @@ export default function UploadBusiness() {
const [docs, setDocs] = useState([]);
const [templates, setTemplates] = useState([]);
const [loading, setLoading] = useState(false);
const [isDragOver, setIsDragOver] = useState(false);
const fileInputRefs = useRef({});
const extraFileRef = useRef(null);
@@ -61,7 +62,8 @@ export default function UploadBusiness() {
const data = await res.json().catch(() => ({}));
showToast(data.detail || "Upload failed", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Upload failed due to network error", "error");
}
};
@@ -70,7 +72,7 @@ export default function UploadBusiness() {
setConfirmConfig({
isOpen: true,
title: "Delete Document",
message: "Delete this document?\nThis action cannot be undone.",
message: "Are you sure you want to delete this business document?\nThis action cannot be undone.",
isDestructive: true,
confirmText: "Delete",
onConfirm: async () => {
@@ -83,7 +85,8 @@ export default function UploadBusiness() {
} else {
showToast("Delete failed", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Delete failed", "error");
}
}
@@ -99,7 +102,8 @@ export default function UploadBusiness() {
} else {
showToast("Could not generate view link", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Could not generate view link", "error");
}
};
@@ -132,16 +136,18 @@ export default function UploadBusiness() {
body: JSON.stringify({ file_count: docs.length, doc_category: "Business" })
});
if (res.ok) {
showToast("Documents sent for approval", "success");
showToast("Business ledgers & statements transmitted to CPA squad", "success");
} else {
showToast("Failed to send for approval", "error");
showToast("Failed to transmit for approval", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Error sending for approval", "error");
}
};
const years = [new Date().getFullYear(), new Date().getFullYear() - 1, new Date().getFullYear() - 2];
const currentYear = new Date().getFullYear();
const years = [currentYear, currentYear - 1, currentYear - 2];
return (
<div>
@@ -149,45 +155,109 @@ export default function UploadBusiness() {
{...confirmConfig}
onCancel={() => setConfirmConfig(prev => ({ ...prev, isOpen: false }))}
/>
<div style={{marginBottom: '16px'}}>
<Link to="/dashboard" className="fancy-link" style={{fontSize: '14px', fontWeight: 500}}>← Back to Dashboard</Link>
</div>
<div className="page-heading">
<div>
<h1>Business Documents</h1>
<p className="page-meta">Upload your business tax documents securely</p>
</div>
<div style={{display:'flex', flexDirection:'column', alignItems:'flex-end', gap:'4px'}}>
<label htmlFor="taxYearSelect" className="form-label" style={{margin:0}}>Tax Year</label>
<select id="taxYearSelect"
className="select-input"
style={{width:'auto', padding:'8px 14px'}}
value={taxYear}
onChange={(e) => setTaxYear(e.target.value)}
>
{years.map(y => <option key={y} value={y}>{y}</option>)}
</select>
{/* Top Breadcrumb & Header */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '20px', flexWrap: 'wrap', gap: '14px' }}>
<Link
to="/dashboard"
className="artha-pill-btn artha-pill-outline"
style={{ padding: '6px 14px', fontSize: '12.5px' }}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Return to Dashboard
</Link>
{/* Tax Year Selector */}
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<span style={{ fontSize: '13px', fontWeight: 600, color: '#0A2540' }}>Tax Filing Year:</span>
<div style={{ display: 'flex', gap: '6px' }}>
{years.map(y => (
<button
key={y}
type="button"
className={`artha-pill-btn ${taxYear === y ? 'artha-pill-primary' : 'artha-pill-outline'}`}
style={{ padding: '6px 14px', fontSize: '12px' }}
onClick={() => setTaxYear(y)}
>
TY {y}
</button>
))}
</div>
</div>
</div>
<div className="card" style={{marginBottom: '20px'}}>
<h3 style={{marginBottom: '16px'}} className="card-title">Required Documents</h3>
<div id="docWrapper">
{/* Hero Banner */}
<div className="artha-portal-hero" style={{ padding: '24px 30px' }}>
<div className="artha-portal-hero-left">
<div className="artha-eyebrow-pill" style={{ marginBottom: '8px' }}>
<span className="dot"></span>
CORPORATE &amp; STATUTORY LEDGERS
</div>
<h1 style={{ fontSize: '26px' }}>Business Documents &amp; Statement Ingestion</h1>
<p style={{ fontSize: '14px' }}>
Upload raw bank statements, Form 1120-S / 1065 schedules, payroll summaries, and asset ledgers for Tax Year {taxYear}.
</p>
</div>
<div className="artha-portal-hero-badges">
<div className="artha-portal-badge green">
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>smart_toy</span>
<span>AI Statement to P&amp;L Enabled</span>
</div>
<div className="artha-portal-badge gold">
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>verified</span>
<span>{docs.length} File{docs.length === 1 ? '' : 's'} on Record</span>
</div>
</div>
</div>
{/* Required Documents Section */}
<div className="artha-portal-card">
<div className="artha-portal-card-header">
<div>
<h3 className="artha-portal-card-title">
<span className="material-symbols-outlined" style={{ color: '#1D4ED8' }}>account_balance</span>
Required Business Schedules &amp; Ledgers
</h3>
<p style={{ fontSize: '13.5px', color: '#425466', margin: '4px 0 0' }}>
Standard corporate returns and verification documentation for Form 1120, 1120-S, and 1065 partnerships.
</p>
</div>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
{loading ? (
<div className="empty-state">Loading templates...</div>
<div style={{ padding: '36px', textAlign: 'center', color: '#425466' }}>
<span className="material-symbols-outlined" style={{ fontSize: '28px', animation: 'spin 1s infinite' }}>sync</span>
<p style={{ marginTop: '8px', fontSize: '13.5px' }}>Loading business requirements for TY {taxYear}...</p>
</div>
) : templates.length === 0 ? (
<div className="empty-state">No required documents for this tax year.</div>
<div style={{ padding: '36px', textAlign: 'center', color: '#425466', background: '#F6F9FC', borderRadius: '14px' }}>
No statutory templates assigned for this business tax year yet. You can upload custom ledgers in the section below.
</div>
) : templates.map((dt, i) => {
const uploaded = docs.filter(d => d.doc_type === dt.name);
const latestDoc = uploaded[0] || null;
const isRejected = latestDoc?.review_status === 'rejected';
const isApproved = latestDoc?.review_status === 'approved';
const isFiled = latestDoc?.review_status === 'filed';
return (
<div
className="doc-slot fade-up"
key={i}
style={{ animationDelay: `${i * 0.04}s`, borderLeft: isRejected ? '3px solid #dc3545' : isApproved || isFiled ? '3px solid #2c7a5b' : 'none' }}
<div
key={i}
style={{
background: isRejected ? '#FFF9F9' : '#FFFFFF',
border: isRejected ? '1px solid rgba(220,38,38,0.3)' : '1px solid rgba(10,37,64,0.08)',
borderLeft: isRejected ? '4px solid #DC2626' : isApproved || isFiled ? '4px solid #047857' : '4px solid rgba(10,37,64,0.15)',
borderRadius: '14px',
padding: '16px 20px',
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
gap: '16px',
flexWrap: 'wrap',
transition: 'all 0.2s ease'
}}
onDragOver={(e) => e.preventDefault()}
onDrop={(e) => {
e.preventDefault();
@@ -200,42 +270,60 @@ export default function UploadBusiness() {
}
}}
>
<div className="doc-slot-info">
<div className="doc-slot-name">{i+1}. {dt.name}</div>
<div className="doc-slot-status">
<div style={{ flex: 1, minWidth: '240px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<span style={{ fontSize: '14.5px', fontWeight: 600, color: '#0A2540' }}>
{i + 1}. {dt.name}
</span>
</div>
<div style={{ marginTop: '6px' }}>
{isRejected ? (
<div>
<span style={{display:'inline-flex', alignItems:'center', gap:'5px', background:'#fdecea', color:'#c0392b', padding:'3px 10px', borderRadius:'20px', fontSize:'12px', fontWeight:700}}>
<span className="material-symbols-outlined" style={{fontSize:'13px'}}>cancel</span> REJECTED
<span className="artha-status-pill artha-status-rejected">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>cancel</span>
Rejected by CPA
</span>
{latestDoc.review_note && (
<div style={{fontSize:'12px', color:'#c0392b', marginTop:'5px', fontStyle:'italic', maxWidth:'260px'}}>
⚠️ Reason: "{latestDoc.review_note}"
<div style={{ fontSize: '12px', color: '#DC2626', marginTop: '4px', fontStyle: 'italic' }}>
Reason: &ldquo;{latestDoc.review_note}&rdquo;
</div>
)}
<div style={{fontSize:'11px', color:'var(--muted)', marginTop:'3px'}}>Please correct and re-upload below.</div>
</div>
) : isApproved ? (
<span style={{display:'inline-flex', alignItems:'center', gap:'5px', background:'#edf7f2', color:'#2c7a5b', padding:'3px 10px', borderRadius:'20px', fontSize:'12px', fontWeight:700}}>
<span className="material-symbols-outlined" style={{fontSize:'13px'}}>check_circle</span> APPROVED
<span className="artha-status-pill artha-status-approved">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>check_circle</span>
Verified &amp; Approved
</span>
) : isFiled ? (
<span style={{display:'inline-flex', alignItems:'center', gap:'5px', background:'#edf7f2', color:'#2c7a5b', padding:'3px 10px', borderRadius:'20px', fontSize:'12px', fontWeight:700}}>
<span className="material-symbols-outlined" style={{fontSize:'13px'}}>inventory_2</span> FILED
<span className="artha-status-pill artha-status-approved">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>inventory_2</span>
Filed with IRS
</span>
) : uploaded.length ? (
<span className="pill-pending"><span className="material-symbols-outlined">pending</span> Pending Review</span>
<span className="artha-status-pill artha-status-pending">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>hourglass_top</span>
Under CPA Review
</span>
) : dt.download ? (
<a href={dt.download} target="_blank" rel="noopener noreferrer" className="btn-link" style={{ fontSize: '14px', color: 'var(--emerald)', textDecoration: 'underline' }}>View Template</a>
<a
href={dt.download}
target="_blank"
rel="noopener noreferrer"
style={{ fontSize: '12.5px', color: '#1D4ED8', textDecoration: 'underline', fontWeight: 500 }}
>
Download Blank Template &rarr;
</a>
) : (
"Missing"
<span style={{ fontSize: '12px', color: '#425466' }}>Pending business upload</span>
)}
</div>
</div>
<div className="doc-slot-actions">
<input
type="file"
hidden
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap' }}>
<input
type="file"
hidden
accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx,.zip"
ref={el => fileInputRefs.current[dt.name] = el}
onChange={(e) => {
@@ -245,31 +333,50 @@ export default function UploadBusiness() {
}
}}
/>
<div style={{display: 'flex', gap: '8px', alignItems: 'center', flexWrap:'wrap'}}>
{dt.download && (
<a href={dt.download} target="_blank" rel="noreferrer" className="btn btn-secondary btn-sm" style={{borderRadius: 'var(--radius-pill)', padding: '4px 12px', display: 'flex', alignItems: 'center', gap: '4px'}}>
<span className="material-symbols-outlined" style={{fontSize: '16px'}}>download</span> Template
</a>
)}
{/* Show Upload button if no doc OR doc is rejected (re-upload allowed) */}
{(!uploaded.length || isRejected) && (
<button
className={`btn btn-sm ${isRejected ? 'btn-primary' : 'btn-upload-pill'}`}
style={isRejected ? {background:'#2c7a5b', borderColor:'#2c7a5b', color:'#fff', borderRadius:'var(--radius-pill)'} : {}}
onClick={() => fileInputRefs.current[dt.name].click()}
>
{isRejected ? '🔄 Re-upload' : 'Upload'}
</button>
)}
</div>
{dt.download && (
<a
href={dt.download}
target="_blank"
rel="noreferrer"
className="artha-pill-btn artha-pill-outline"
style={{ padding: '6px 12px', fontSize: '12px' }}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>download</span>
Template
</a>
)}
{(!uploaded.length || isRejected) && (
<button
className="artha-pill-btn artha-pill-primary"
style={{ padding: '6px 14px', fontSize: '12px' }}
onClick={() => fileInputRefs.current[dt.name].click()}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>upload</span>
{isRejected ? 'Re-upload Schedule' : 'Upload Schedule'}
</button>
)}
{uploaded.map(doc => (
<div key={doc.id} style={{display:'flex', flexDirection:'column', gap:'8px', alignItems:'flex-end', marginTop:'4px'}}>
<div style={{display:'flex', gap:'8px'}}>
<button className="btn btn-secondary btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => viewDoc(doc.storage_key)}>View</button>
{!isApproved && !isFiled && (
<button className="btn btn-danger btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => deleteDoc(doc.id)}>Delete</button>
)}
</div>
<div key={doc.id} style={{ display: 'flex', gap: '6px' }}>
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '5px 10px', fontSize: '11.5px' }}
onClick={() => viewDoc(doc.storage_key)}
>
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>visibility</span>
View
</button>
{!isApproved && !isFiled && (
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '5px 10px', fontSize: '11.5px', color: '#DC2626', borderColor: 'rgba(220,38,38,0.3)' }}
onClick={() => deleteDoc(doc.id)}
>
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>delete</span>
</button>
)}
</div>
))}
</div>
@@ -279,83 +386,152 @@ export default function UploadBusiness() {
</div>
</div>
<div className="card">
<div className="flex-between" style={{marginBottom: '16px'}}>
{/* Additional Business Documents & Bank Statements Dropzone */}
<div className="artha-portal-card">
<div className="artha-portal-card-header">
<div>
<h3 className="card-title">Additional Documents</h3>
<p className="text-sm" style={{marginTop:'2px'}}>Upload any supplementary business documents</p>
<h3 className="artha-portal-card-title">
<span className="material-symbols-outlined" style={{ color: '#1D4ED8' }}>receipt_long</span>
Bank Statements, Ledgers &amp; Receipts Vault
</h3>
<p style={{ fontSize: '13.5px', color: '#425466', margin: '4px 0 0' }}>
Upload raw PDF checking statements, credit card logs, or payroll reports for automated reconciliation.
</p>
</div>
<label
className="btn btn-secondary btn-sm"
style={{borderRadius:'var(--radius-sm)', cursor:'pointer'}}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
extraFileRef.current?.click();
}
}}
<label
className="artha-pill-btn artha-pill-primary"
style={{ padding: '7px 16px', fontSize: '12.5px', cursor: 'pointer' }}
>
+ Choose Files
<input type="file" multiple hidden accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx,.zip" onChange={handleExtraUpload} />
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>add</span>
Browse &amp; Add Ledgers
<input
type="file"
multiple
hidden
accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx,.zip"
onChange={handleExtraUpload}
/>
</label>
</div>
<div
className="drop-area"
style={{ border:'2px dashed #cfc7ad', borderRadius:'var(--radius-md)', padding:'28px 20px', textAlign:'center', cursor:'pointer', background:'var(--card)' }}
{/* Drag Area */}
<div
className={`artha-dropzone ${isDragOver ? 'is-dragover' : ''}`}
onClick={() => extraFileRef.current?.click()}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
extraFileRef.current?.click();
}
}}
onDragOver={(e) => e.preventDefault()}
onDragEnter={(e) => { e.preventDefault(); setIsDragOver(true); }}
onDragOver={(e) => { e.preventDefault(); setIsDragOver(true); }}
onDragLeave={() => setIsDragOver(false)}
onDrop={(e) => {
e.preventDefault();
setIsDragOver(false);
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
const fakeEvent = { target: { files: e.dataTransfer.files } };
handleExtraUpload(fakeEvent);
}
}}
>
<div className="da-icon"><span className="material-symbols-outlined" style={{color: 'var(--brass)', fontSize: '32px'}}>folder</span></div>
<div className="da-title" style={{fontWeight: 600, color: 'var(--navy)', fontSize: '14px'}}>Drag & drop files here</div>
<div className="da-hint" style={{fontSize: '12px', color: 'var(--muted)'}}>or click to browse · PDF, JPG, PNG, WEBP, DOC, EXCEL · Max 10MB</div>
<div
style={{
width: '52px',
height: '52px',
borderRadius: '50%',
background: 'rgba(29, 78, 216, 0.08)',
color: '#1D4ED8',
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
marginBottom: '12px'
}}
>
<span className="material-symbols-outlined" style={{ fontSize: '28px' }}>cloud_upload</span>
</div>
<div style={{ fontSize: '15px', fontWeight: 600, color: '#0A2540', marginBottom: '4px' }}>
Drag and drop business ledgers &amp; bank statements here
</div>
<div style={{ fontSize: '12.5px', color: '#425466' }}>
PDF, Excel (XLS/XLSX), CSV, PNG, JPG, ZIP &bull; Max 10MB per file
</div>
</div>
<input type="file" multiple hidden ref={extraFileRef} onChange={handleExtraUpload} />
<div className="upload-track mt-12">
{docs.filter(d => d.doc_type.startsWith("other")).map(doc => (
<div key={doc.id} style={{marginBottom:'6px'}}>
<div className="upload-track-item" style={{display:'flex', alignItems:'center', gap:'10px', padding:'8px 12px', borderRadius:'var(--radius-sm)', background:'var(--paper)', fontSize:'13px'}}>
<span className="material-symbols-outlined" style={{color:'var(--green)', fontSize:'18px'}}>check_circle</span>
<div className="uti-name" style={{flex:1}}>{doc.filename}</div>
<button className="btn btn-secondary btn-sm" style={{padding:'4px'}} onClick={() => viewDoc(doc.storage_key)}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>visibility</span>
</button>
<button className="btn btn-danger btn-sm" style={{padding:'4px'}} onClick={() => deleteDoc(doc.id)}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>delete</span>
</button>
{/* Uploaded Extra Documents Tracker */}
{docs.filter(d => d.doc_type.startsWith("other")).length > 0 && (
<div style={{ marginTop: '20px', display: 'flex', flexDirection: 'column', gap: '8px' }}>
<h5 style={{ fontSize: '12.5px', textTransform: 'uppercase', letterSpacing: '0.06em', color: '#425466', margin: '0 0 6px' }}>
Uploaded Supplementary Ledgers ({docs.filter(d => d.doc_type.startsWith("other")).length}):
</h5>
{docs.filter(d => d.doc_type.startsWith("other")).map(doc => (
<div
key={doc.id}
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '10px 16px',
borderRadius: '12px',
background: '#F6F9FC',
border: '1px solid rgba(10, 37, 64, 0.07)',
fontSize: '13px'
}}
>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', minWidth: 0, flex: 1 }}>
<span className="material-symbols-outlined" style={{ color: '#047857', fontSize: '18px' }}>check_circle</span>
<span style={{ fontWeight: 500, color: '#0A2540', wordBreak: 'break-all' }}>{doc.filename}</span>
</div>
<div style={{ display: 'flex', gap: '6px' }}>
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '4px 10px', fontSize: '11px' }}
onClick={() => viewDoc(doc.storage_key)}
>
View
</button>
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '4px 10px', fontSize: '11px', color: '#DC2626', borderColor: 'rgba(220,38,38,0.25)' }}
onClick={() => deleteDoc(doc.id)}
>
Delete
</button>
</div>
</div>
</div>
))}
</div>
))}
</div>
)}
</div>
<div className="card mt-20" style={{marginTop: '20px'}}>
<div style={{display:'flex', alignItems:'center', justifyContent:'space-between', flexWrap:'wrap', gap:'16px'}}>
<div>
<h3 style={{marginBottom:'4px'}} className="card-title">Finished Uploading?</h3>
<p className="text-sm" style={{margin:0}}>Send your business documents for review.</p>
</div>
<button className="btn btn-primary" onClick={notifyComplete}>
<span className="material-symbols-outlined">send</span>
Send for Approval
</button>
{/* Completion & Submit Banner */}
<div
className="artha-portal-card"
style={{
background: '#0A2540',
color: '#FFFFFF',
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
flexWrap: 'wrap',
gap: '18px'
}}
>
<div>
<h3 style={{ fontSize: '18px', color: '#FFFFFF', margin: '0 0 4px', fontFamily: 'var(--font-display)' }}>
Finished Uploading Business Records?
</h3>
<p style={{ fontSize: '13px', color: 'rgba(255,255,255,0.7)', margin: 0 }}>
Notify your advisory team that all corporate schedules and bank statements have been uploaded for TY {taxYear}.
</p>
</div>
<button
className="artha-pill-btn artha-pill-primary"
style={{ background: '#1D4ED8', borderColor: '#1D4ED8', padding: '10px 22px' }}
onClick={notifyComplete}
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>send</span>
Transmit for CPA Processing
</button>
</div>
</div>
);
+309 -133
View File
@@ -14,6 +14,7 @@ export default function UploadPersonal() {
const [docs, setDocs] = useState([]);
const [templates, setTemplates] = useState([]);
const [loading, setLoading] = useState(false);
const [isDragOver, setIsDragOver] = useState(false);
const fileInputRefs = useRef({});
const extraFileRef = useRef(null);
@@ -63,7 +64,8 @@ export default function UploadPersonal() {
const data = await res.json().catch(() => ({}));
showToast(data.detail || "Upload failed", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Upload failed due to network error", "error");
}
};
@@ -72,7 +74,7 @@ export default function UploadPersonal() {
setConfirmConfig({
isOpen: true,
title: "Delete Document",
message: "Delete this document?\nThis action cannot be undone.",
message: "Are you sure you want to delete this document?\nThis action cannot be undone.",
isDestructive: true,
confirmText: "Delete",
onConfirm: async () => {
@@ -85,7 +87,8 @@ export default function UploadPersonal() {
} else {
showToast("Delete failed", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Delete failed", "error");
}
}
@@ -101,7 +104,8 @@ export default function UploadPersonal() {
} else {
showToast("Could not generate view link", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Could not generate view link", "error");
}
};
@@ -134,16 +138,18 @@ export default function UploadPersonal() {
body: JSON.stringify({ file_count: docs.length, doc_category: "Personal" })
});
if (res.ok) {
showToast("Documents sent for approval", "success");
showToast("Personal documents transmitted to CPA review squad", "success");
} else {
showToast("Failed to send for approval", "error");
showToast("Failed to transmit for approval", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Error sending for approval", "error");
}
};
const years = [new Date().getFullYear(), new Date().getFullYear() - 1, new Date().getFullYear() - 2];
const currentYear = new Date().getFullYear();
const years = [currentYear, currentYear - 1, currentYear - 2];
return (
<div>
@@ -151,45 +157,109 @@ export default function UploadPersonal() {
{...confirmConfig}
onCancel={() => setConfirmConfig(prev => ({ ...prev, isOpen: false }))}
/>
<div style={{marginBottom: '16px'}}>
<Link to="/dashboard" className="fancy-link" style={{fontSize: '14px', fontWeight: 500}}>← Back to Dashboard</Link>
</div>
<div className="page-heading">
<div>
<h1>Personal Documents</h1>
<p className="page-meta">Upload your personal tax documents securely</p>
</div>
<div style={{display:'flex', flexDirection:'column', alignItems:'flex-end', gap:'4px'}}>
<label htmlFor="taxYearSelect" className="form-label" style={{margin:0}}>Tax Year</label>
<select id="taxYearSelect"
className="select-input"
style={{width:'auto', padding:'8px 14px'}}
value={taxYear}
onChange={(e) => setTaxYear(e.target.value)}
>
{years.map(y => <option key={y} value={y}>{y}</option>)}
</select>
{/* Top Breadcrumb & Header */}
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '20px', flexWrap: 'wrap', gap: '14px' }}>
<Link
to="/dashboard"
className="artha-pill-btn artha-pill-outline"
style={{ padding: '6px 14px', fontSize: '12.5px' }}
>
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_back</span>
Return to Dashboard
</Link>
{/* Tax Year Selector */}
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<span style={{ fontSize: '13px', fontWeight: 600, color: '#0A2540' }}>Tax Filing Year:</span>
<div style={{ display: 'flex', gap: '6px' }}>
{years.map(y => (
<button
key={y}
type="button"
className={`artha-pill-btn ${taxYear === y ? 'artha-pill-primary' : 'artha-pill-outline'}`}
style={{ padding: '6px 14px', fontSize: '12px' }}
onClick={() => setTaxYear(y)}
>
TY {y}
</button>
))}
</div>
</div>
</div>
<div className="card" style={{marginBottom: '20px'}}>
<h3 style={{marginBottom: '16px'}} className="card-title">Required Documents</h3>
<div id="docWrapper">
{/* Hero Banner */}
<div className="artha-portal-hero" style={{ padding: '24px 30px' }}>
<div className="artha-portal-hero-left">
<div className="artha-eyebrow-pill" style={{ marginBottom: '8px' }}>
<span className="dot"></span>
INDIVIDUAL &amp; FAMILY COMPLIANCE
</div>
<h1 style={{ fontSize: '26px' }}>Personal Tax Documents Vault</h1>
<p style={{ fontSize: '14px' }}>
Upload government forms (W-2, 1099, K-1), identification, mortgage interest statements, and overseas accounts (FBAR / FATCA) for Tax Year {taxYear}.
</p>
</div>
<div className="artha-portal-hero-badges">
<div className="artha-portal-badge green">
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>verified</span>
<span>{docs.length} Document{docs.length === 1 ? '' : 's'} on Record</span>
</div>
<div className="artha-portal-badge">
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>lock</span>
<span>256-Bit Encrypted</span>
</div>
</div>
</div>
{/* Required Documents Section */}
<div className="artha-portal-card">
<div className="artha-portal-card-header">
<div>
<h3 className="artha-portal-card-title">
<span className="material-symbols-outlined" style={{ color: '#1D4ED8' }}>checklist</span>
Required Statutory Forms &amp; Schedules
</h3>
<p style={{ fontSize: '13.5px', color: '#425466', margin: '4px 0 0' }}>
Standard filings required by the IRS and State Revenue departments for individual returns.
</p>
</div>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: '12px' }}>
{loading ? (
<div className="empty-state">Loading templates...</div>
<div style={{ padding: '36px', textAlign: 'center', color: '#425466' }}>
<span className="material-symbols-outlined" style={{ fontSize: '28px', animation: 'spin 1s infinite' }}>sync</span>
<p style={{ marginTop: '8px', fontSize: '13.5px' }}>Loading tax requirements for TY {taxYear}...</p>
</div>
) : templates.length === 0 ? (
<div className="empty-state">No required documents for this tax year.</div>
<div style={{ padding: '36px', textAlign: 'center', color: '#425466', background: '#F6F9FC', borderRadius: '14px' }}>
No statutory templates assigned for this tax year yet. You can upload files in the section below.
</div>
) : templates.map((dt, i) => {
const uploaded = docs.filter(d => d.doc_type === dt.name);
const latestDoc = uploaded[0] || null;
const isRejected = latestDoc?.review_status === 'rejected';
const isApproved = latestDoc?.review_status === 'approved';
const isFiled = latestDoc?.review_status === 'filed';
return (
<div
className="doc-slot fade-up"
key={i}
style={{ animationDelay: `${i * 0.04}s`, borderLeft: isRejected ? '3px solid #dc3545' : isApproved || isFiled ? '3px solid #2c7a5b' : 'none' }}
<div
key={i}
style={{
background: isRejected ? '#FFF9F9' : '#FFFFFF',
border: isRejected ? '1px solid rgba(220,38,38,0.3)' : '1px solid rgba(10,37,64,0.08)',
borderLeft: isRejected ? '4px solid #DC2626' : isApproved || isFiled ? '4px solid #047857' : '4px solid rgba(10,37,64,0.15)',
borderRadius: '14px',
padding: '16px 20px',
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
gap: '16px',
flexWrap: 'wrap',
transition: 'all 0.2s ease'
}}
onDragOver={(e) => e.preventDefault()}
onDrop={(e) => {
e.preventDefault();
@@ -202,42 +272,60 @@ export default function UploadPersonal() {
}
}}
>
<div className="doc-slot-info">
<div className="doc-slot-name">{i+1}. {dt.name}</div>
<div className="doc-slot-status">
<div style={{ flex: 1, minWidth: '240px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<span style={{ fontSize: '14.5px', fontWeight: 600, color: '#0A2540' }}>
{i + 1}. {dt.name}
</span>
</div>
<div style={{ marginTop: '6px' }}>
{isRejected ? (
<div>
<span style={{display:'inline-flex', alignItems:'center', gap:'5px', background:'#fdecea', color:'#c0392b', padding:'3px 10px', borderRadius:'20px', fontSize:'12px', fontWeight:700}}>
<span className="material-symbols-outlined" style={{fontSize:'13px'}}>cancel</span> REJECTED
<span className="artha-status-pill artha-status-rejected">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>cancel</span>
Rejected by CPA
</span>
{latestDoc.review_note && (
<div style={{fontSize:'12px', color:'#c0392b', marginTop:'5px', fontStyle:'italic', maxWidth:'260px'}}>
⚠️ Reason: "{latestDoc.review_note}"
<div style={{ fontSize: '12px', color: '#DC2626', marginTop: '4px', fontStyle: 'italic' }}>
Reason: &ldquo;{latestDoc.review_note}&rdquo;
</div>
)}
<div style={{fontSize:'11px', color:'var(--muted)', marginTop:'3px'}}>Please correct and re-upload below.</div>
</div>
) : isApproved ? (
<span style={{display:'inline-flex', alignItems:'center', gap:'5px', background:'#edf7f2', color:'#2c7a5b', padding:'3px 10px', borderRadius:'20px', fontSize:'12px', fontWeight:700}}>
<span className="material-symbols-outlined" style={{fontSize:'13px'}}>check_circle</span> APPROVED
<span className="artha-status-pill artha-status-approved">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>check_circle</span>
Verified &amp; Approved
</span>
) : isFiled ? (
<span style={{display:'inline-flex', alignItems:'center', gap:'5px', background:'#edf7f2', color:'#2c7a5b', padding:'3px 10px', borderRadius:'20px', fontSize:'12px', fontWeight:700}}>
<span className="material-symbols-outlined" style={{fontSize:'13px'}}>inventory_2</span> FILED
<span className="artha-status-pill artha-status-approved">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>inventory_2</span>
Filed with IRS
</span>
) : uploaded.length ? (
<span className="pill-pending"><span className="material-symbols-outlined">pending</span> Pending Review</span>
<span className="artha-status-pill artha-status-pending">
<span className="material-symbols-outlined" style={{ fontSize: '13px' }}>hourglass_top</span>
Under CPA Review
</span>
) : dt.download ? (
<a href={dt.download} target="_blank" rel="noopener noreferrer" className="btn-link" style={{ fontSize: '14px', color: 'var(--emerald)', textDecoration: 'underline' }}>View Template</a>
<a
href={dt.download}
target="_blank"
rel="noopener noreferrer"
style={{ fontSize: '12.5px', color: '#1D4ED8', textDecoration: 'underline', fontWeight: 500 }}
>
Download Blank Template PDF &rarr;
</a>
) : (
"Missing"
<span style={{ fontSize: '12px', color: '#425466' }}>Pending client upload</span>
)}
</div>
</div>
<div className="doc-slot-actions">
<input
type="file"
hidden
<div style={{ display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'wrap' }}>
<input
type="file"
hidden
accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx,.zip"
ref={el => fileInputRefs.current[dt.name] = el}
onChange={(e) => {
@@ -247,31 +335,50 @@ export default function UploadPersonal() {
}
}}
/>
<div style={{display: 'flex', gap: '8px', alignItems: 'center', flexWrap:'wrap'}}>
{dt.download && (
<a href={dt.download} target="_blank" rel="noreferrer" className="btn btn-secondary btn-sm" style={{borderRadius: 'var(--radius-pill)', padding: '4px 12px', display: 'flex', alignItems: 'center', gap: '4px'}}>
<span className="material-symbols-outlined" style={{fontSize: '16px'}}>download</span> Template
</a>
)}
{/* Show Upload button if no doc OR doc is rejected (re-upload allowed) */}
{(!uploaded.length || isRejected) && (
<button
className={`btn btn-sm ${isRejected ? 'btn-primary' : 'btn-upload-pill'}`}
style={isRejected ? {background:'#2c7a5b', borderColor:'#2c7a5b', color:'#fff', borderRadius:'var(--radius-pill)'} : {}}
onClick={() => fileInputRefs.current[dt.name].click()}
>
{isRejected ? '🔄 Re-upload' : 'Upload'}
</button>
)}
</div>
{dt.download && (
<a
href={dt.download}
target="_blank"
rel="noreferrer"
className="artha-pill-btn artha-pill-outline"
style={{ padding: '6px 12px', fontSize: '12px' }}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>download</span>
Template
</a>
)}
{(!uploaded.length || isRejected) && (
<button
className="artha-pill-btn artha-pill-primary"
style={{ padding: '6px 14px', fontSize: '12px' }}
onClick={() => fileInputRefs.current[dt.name].click()}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>upload</span>
{isRejected ? 'Re-upload Form' : 'Upload Form'}
</button>
)}
{uploaded.map(doc => (
<div key={doc.id} style={{display:'flex', flexDirection:'column', gap:'8px', alignItems:'flex-end', marginTop:'4px'}}>
<div style={{display:'flex', gap:'8px'}}>
<button className="btn btn-secondary btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => viewDoc(doc.storage_key)}>View</button>
{!isApproved && !isFiled && (
<button className="btn btn-danger btn-xs" style={{borderRadius:'var(--radius-sm)'}} onClick={() => deleteDoc(doc.id)}>Delete</button>
)}
</div>
<div key={doc.id} style={{ display: 'flex', gap: '6px' }}>
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '5px 10px', fontSize: '11.5px' }}
onClick={() => viewDoc(doc.storage_key)}
>
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>visibility</span>
View
</button>
{!isApproved && !isFiled && (
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '5px 10px', fontSize: '11.5px', color: '#DC2626', borderColor: 'rgba(220,38,38,0.3)' }}
onClick={() => deleteDoc(doc.id)}
>
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>delete</span>
</button>
)}
</div>
))}
</div>
@@ -281,83 +388,152 @@ export default function UploadPersonal() {
</div>
</div>
<div className="card">
<div className="flex-between" style={{marginBottom: '16px'}}>
{/* Additional Documents Drag & Drop Vault */}
<div className="artha-portal-card">
<div className="artha-portal-card-header">
<div>
<h3 className="card-title">Additional Documents</h3>
<p className="text-sm" style={{marginTop:'2px'}}>Upload any supplementary personal documents</p>
<h3 className="artha-portal-card-title">
<span className="material-symbols-outlined" style={{ color: '#1D4ED8' }}>cloud_upload</span>
Supplementary Personal Files &amp; Receipts
</h3>
<p style={{ fontSize: '13.5px', color: '#425466', margin: '4px 0 0' }}>
Drag and drop any extra statements, medical expenses, foreign disclosures, or receipts.
</p>
</div>
<label
className="btn btn-secondary btn-sm"
style={{borderRadius:'var(--radius-sm)', cursor:'pointer'}}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
extraFileRef.current?.click();
}
}}
<label
className="artha-pill-btn artha-pill-primary"
style={{ padding: '7px 16px', fontSize: '12.5px', cursor: 'pointer' }}
>
+ Choose Files
<input type="file" multiple hidden accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx,.zip" onChange={handleExtraUpload} />
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>add</span>
Browse &amp; Add Files
<input
type="file"
multiple
hidden
accept=".pdf,.jpg,.jpeg,.png,.webp,.doc,.docx,.xls,.xlsx,.zip"
onChange={handleExtraUpload}
/>
</label>
</div>
<div
className="drop-area"
style={{ border:'2px dashed #cfc7ad', borderRadius:'var(--radius-md)', padding:'28px 20px', textAlign:'center', cursor:'pointer', background:'var(--card)' }}
{/* Drag Area */}
<div
className={`artha-dropzone ${isDragOver ? 'is-dragover' : ''}`}
onClick={() => extraFileRef.current?.click()}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
extraFileRef.current?.click();
}
}}
onDragOver={(e) => e.preventDefault()}
onDragEnter={(e) => { e.preventDefault(); setIsDragOver(true); }}
onDragOver={(e) => { e.preventDefault(); setIsDragOver(true); }}
onDragLeave={() => setIsDragOver(false)}
onDrop={(e) => {
e.preventDefault();
setIsDragOver(false);
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
const fakeEvent = { target: { files: e.dataTransfer.files } };
handleExtraUpload(fakeEvent);
}
}}
>
<div className="da-icon"><span className="material-symbols-outlined" style={{color: 'var(--brass)', fontSize: '32px'}}>folder</span></div>
<div className="da-title" style={{fontWeight: 600, color: 'var(--navy)', fontSize: '14px'}}>Drag & drop files here</div>
<div className="da-hint" style={{fontSize: '12px', color: 'var(--muted)'}}>or click to browse · PDF, JPG, PNG, WEBP, DOC, DOCX · Max 10MB</div>
<div
style={{
width: '52px',
height: '52px',
borderRadius: '50%',
background: 'rgba(29, 78, 216, 0.08)',
color: '#1D4ED8',
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
marginBottom: '12px'
}}
>
<span className="material-symbols-outlined" style={{ fontSize: '28px' }}>upload_file</span>
</div>
<div style={{ fontSize: '15px', fontWeight: 600, color: '#0A2540', marginBottom: '4px' }}>
Drag and drop files here, or click to browse
</div>
<div style={{ fontSize: '12.5px', color: '#425466' }}>
Supported formats: PDF, PNG, JPG, WEBP, DOCX, XLSX, ZIP &bull; Max 10MB per file
</div>
</div>
<input type="file" multiple hidden ref={extraFileRef} onChange={handleExtraUpload} />
<div className="upload-track mt-12">
{docs.filter(d => d.doc_type.startsWith("other")).map(doc => (
<div key={doc.id} style={{marginBottom:'6px'}}>
<div className="upload-track-item" style={{display:'flex', alignItems:'center', gap:'10px', padding:'8px 12px', borderRadius:'var(--radius-sm)', background:'var(--paper)', fontSize:'13px'}}>
<span className="material-symbols-outlined" style={{color:'var(--green)', fontSize:'18px'}}>check_circle</span>
<div className="uti-name" style={{flex:1}}>{doc.filename}</div>
<button className="btn btn-secondary btn-sm" style={{padding:'4px'}} onClick={() => viewDoc(doc.storage_key)}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>visibility</span>
</button>
<button className="btn btn-danger btn-sm" style={{padding:'4px'}} onClick={() => deleteDoc(doc.id)}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>delete</span>
</button>
{/* Uploaded Extra Documents Tracker */}
{docs.filter(d => d.doc_type.startsWith("other")).length > 0 && (
<div style={{ marginTop: '20px', display: 'flex', flexDirection: 'column', gap: '8px' }}>
<h5 style={{ fontSize: '12.5px', textTransform: 'uppercase', letterSpacing: '0.06em', color: '#425466', margin: '0 0 6px' }}>
Uploaded Supplemental Documents ({docs.filter(d => d.doc_type.startsWith("other")).length}):
</h5>
{docs.filter(d => d.doc_type.startsWith("other")).map(doc => (
<div
key={doc.id}
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '10px 16px',
borderRadius: '12px',
background: '#F6F9FC',
border: '1px solid rgba(10, 37, 64, 0.07)',
fontSize: '13px'
}}
>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px', minWidth: 0, flex: 1 }}>
<span className="material-symbols-outlined" style={{ color: '#047857', fontSize: '18px' }}>check_circle</span>
<span style={{ fontWeight: 500, color: '#0A2540', wordBreak: 'break-all' }}>{doc.filename}</span>
</div>
<div style={{ display: 'flex', gap: '6px' }}>
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '4px 10px', fontSize: '11px' }}
onClick={() => viewDoc(doc.storage_key)}
>
View
</button>
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '4px 10px', fontSize: '11px', color: '#DC2626', borderColor: 'rgba(220,38,38,0.25)' }}
onClick={() => deleteDoc(doc.id)}
>
Delete
</button>
</div>
</div>
</div>
))}
</div>
))}
</div>
)}
</div>
<div className="card mt-20" style={{marginTop: '20px'}}>
<div style={{display:'flex', alignItems:'center', justifyContent:'space-between', flexWrap:'wrap', gap:'16px'}}>
<div>
<h3 style={{marginBottom:'4px'}} className="card-title">Finished Uploading?</h3>
<p className="text-sm" style={{margin:0}}>Send your personal documents for review.</p>
</div>
<button className="btn btn-primary" onClick={notifyComplete}>
<span className="material-symbols-outlined">send</span>
Send for Approval
</button>
{/* Completion & Submit Banner */}
<div
className="artha-portal-card"
style={{
background: '#0A2540',
color: '#FFFFFF',
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
flexWrap: 'wrap',
gap: '18px'
}}
>
<div>
<h3 style={{ fontSize: '18px', color: '#FFFFFF', margin: '0 0 4px', fontFamily: 'var(--font-display)' }}>
Finished Uploading Personal Records?
</h3>
<p style={{ fontSize: '13px', color: 'rgba(255,255,255,0.7)', margin: 0 }}>
Notify your advisory team that all W-2s, 1099s, and foreign assets have been uploaded for TY {taxYear}.
</p>
</div>
<button
className="artha-pill-btn artha-pill-primary"
style={{ background: '#1D4ED8', borderColor: '#1D4ED8', padding: '10px 22px' }}
onClick={notifyComplete}
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>send</span>
Transmit for CPA Processing
</button>
</div>
</div>
);
+509 -168
View File
@@ -2,6 +2,7 @@ import React, { useState, useEffect, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import { useAuth } from '../context/AuthContext';
import { useToast } from '../context/ToastContext';
import CountUp from '../components/CountUp';
export default function UserDashboard() {
const { user, authFetch } = useAuth();
@@ -18,10 +19,6 @@ export default function UserDashboard() {
// Reject comment panel for admin docs: { docId, note }
const [rejectPanel, setRejectPanel] = useState(null);
// ── declare callbacks BEFORE the effects that reference them ──
const checkEngagement = useCallback(async () => {
try {
const res = await authFetch("/api/auth/me");
@@ -39,7 +36,6 @@ export default function UserDashboard() {
if (tpls && tpls.length > 0) {
setEngagementLink(tpls[0].download);
} else {
// Fallback static link if no template is defined
setEngagementLink("/Engagement_Letter_Template.pdf");
}
} else {
@@ -106,7 +102,8 @@ export default function UserDashboard() {
} else {
setEngagementChecked(false);
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
setEngagementChecked(false);
}
};
@@ -120,12 +117,12 @@ export default function UserDashboard() {
} else {
showToast("Could not generate view link", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Could not generate view link", "error");
}
};
const downloadDoc = async (storageKey, originalFilename) => {
try {
const res = await authFetch(`/api/upload/view-url?key=${encodeURIComponent(storageKey)}`);
@@ -166,7 +163,8 @@ export default function UserDashboard() {
} else {
showToast("Failed to submit response", "error");
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
showToast("Network error", "error");
} finally {
setDocLoading(false);
@@ -177,190 +175,531 @@ export default function UserDashboard() {
setRejectPanel({ docId, note: '' });
};
// ── Derived Numbers (Constraint 1) ─────────────────────────
const totalDeliverables = adminDocs.length;
const approvedDocs = adminDocs.filter(d => d.review_status === 'approved').length;
const pendingReviewDocs = adminDocs.filter(d => d.review_status === 'sent_for_approval' || d.review_status === 'pending' || !d.review_status).length;
const percentApproved = totalDeliverables > 0 ? Math.round((approvedDocs / totalDeliverables) * 100) : 0;
// Next deadline calculation
const upcomingDeadlines = deadlines.filter(d => typeof d.days_left === 'number');
const minDeadline = upcomingDeadlines.length > 0
? upcomingDeadlines.reduce((min, d) => d.days_left < min.days_left ? d : min, upcomingDeadlines[0])
: null;
const isAnyOverdue = deadlines.some(d => d.is_overdue || d.days_left < 0);
// SVG Progress Ring calculations (radius 38, perimeter = 2 * PI * 38 = 238.76)
const ringRadius = 38;
const ringCircumference = 2 * Math.PI * ringRadius;
const strokeDashoffset = totalDeliverables > 0
? ringCircumference - (percentApproved / 100) * ringCircumference
: ringCircumference;
return (
<div>
<div className="page-heading">
<div style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
{/* ================= 1. EXECUTIVE AURORA HERO ================= */}
<section className="dash-hero dash-rise" style={{ '--i': 0 }}>
<div>
<h1>Welcome, {user?.name || user?.email?.split('@')[0]}</h1>
<p className="page-meta">Here is your dashboard overview</p>
</div>
</div>
<div className="dash-hero-eyebrow">
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>shield</span>
CLIENT ADVISORY VAULT
</div>
<h1 className="dash-hero-title">Welcome, {user?.name || user?.email?.split('@')[0]}</h1>
<p className="dash-hero-sub">
Secure workspace for document exchange, verified tax filings, and AI ledger reconciliation.
</p>
{/* Action Required: Deadline Warning Banner */}
{deadlines && deadlines.length > 0 && deadlines.some(d => d.days_left <= 7) && (
<div className="card fade-up" style={{
background: 'rgba(230, 81, 0, 0.08)',
border: '1px solid rgba(230, 81, 0, 0.35)',
borderRadius: 'var(--radius-sm)',
padding: '16px 20px',
marginBottom: '20px',
display: 'flex',
alignItems: 'center',
gap: '16px'
}}>
<span className="material-symbols-outlined" style={{fontSize: '32px', color: '#e65100'}}>warning</span>
<div style={{flex: 1}}>
<div style={{fontWeight: 700, color: '#e65100', fontSize: '15px'}}>Action Required: Upcoming Filing Deadlines</div>
<div style={{fontSize: '13px', color: 'var(--navy)', marginTop: '4px'}}>
{deadlines.filter(d => d.days_left <= 7).map((d, idx) => (
<span key={idx} style={{marginRight: '16px', display: 'inline-block'}}>
<strong>{d.doc_type?.toUpperCase()}</strong>: {d.is_overdue ? (
<span style={{color: '#c0392b', fontWeight: 600}}>Overdue by {Math.abs(d.days_left)} day(s)</span>
) : (
<span>Due in {d.days_left} day(s) ({new Date(d.deadline_date).toLocaleDateString()})</span>
)}
</span>
))}
<div className="dash-hero-badges">
<div className="dash-glass-pill">
<span className="material-symbols-outlined">verified</span>
<span>Active Client Vault</span>
</div>
<div className="dash-glass-pill">
<span className="material-symbols-outlined">calendar_today</span>
<span>TY {new Date().getFullYear()}</span>
</div>
<div className="dash-glass-pill">
<span className="material-symbols-outlined">lock</span>
<span>Secure Client Portal</span>
</div>
</div>
</div>
{/* Right: SVG Progress Ring */}
<div className="dash-progress-ring-wrap">
<svg className="dash-progress-ring-svg" viewBox="0 0 96 96">
<defs>
<linearGradient id="userRingGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#3B82F6" />
<stop offset="100%" stopColor="#14B8A6" />
</linearGradient>
</defs>
<circle
className="dash-progress-ring-track"
cx="48"
cy="48"
r={ringRadius}
strokeWidth="7"
fill="none"
/>
{totalDeliverables > 0 && (
<circle
className="dash-progress-ring-bar"
cx="48"
cy="48"
r={ringRadius}
strokeWidth="7"
fill="none"
stroke="url(#userRingGrad)"
strokeDasharray={ringCircumference}
strokeDashoffset={strokeDashoffset}
/>
)}
</svg>
<div style={{
position: 'absolute',
marginTop: '26px',
fontFamily: 'var(--font-mono, monospace)',
fontSize: '18px',
fontWeight: 700,
color: '#FFFFFF'
}}>
{totalDeliverables === 0 ? '-' : <CountUp value={percentApproved} suffix="%" />}
</div>
<div className="dash-progress-caption">
{totalDeliverables === 0 ? 'No deliverables yet' : 'Deliverables approved'}
</div>
</div>
</section>
{/* ================= 2. KPI STRIP ================= */}
<section className="dash-kpis dash-rise" style={{ '--i': 1 }}>
{/* Deliverables */}
<div className="dash-card dash-kpi-card">
<div className="dash-kpi-bar dash-kpi-bar--blue" />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Deliverables</span>
<div className="dash-chip dash-chip--blue">
<span className="material-symbols-outlined">folder_open</span>
</div>
</div>
<div className="dash-kpi-value">
<CountUp value={totalDeliverables} />
</div>
</div>
{/* Needs your review */}
<div className="dash-card dash-kpi-card">
<div className="dash-kpi-bar dash-kpi-bar--amber" />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Needs your review</span>
<div className="dash-chip dash-chip--amber">
<span className="material-symbols-outlined">pending_actions</span>
</div>
</div>
<div className="dash-kpi-value">
<CountUp value={pendingReviewDocs} />
{pendingReviewDocs > 0 && <span className="dash-pulse-dot" title="Action pending" />}
</div>
</div>
{/* Approved */}
<div className="dash-card dash-kpi-card">
<div className="dash-kpi-bar dash-kpi-bar--green" />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Approved</span>
<div className="dash-chip dash-chip--green">
<span className="material-symbols-outlined">task_alt</span>
</div>
</div>
<div className="dash-kpi-value">
<CountUp value={approvedDocs} />
</div>
</div>
{/* Next deadline */}
<div className="dash-card dash-kpi-card">
<div className={`dash-kpi-bar ${isAnyOverdue ? 'dash-kpi-bar--red' : 'dash-kpi-bar--blue'}`} />
<div className="dash-kpi-top">
<span className="dash-kpi-label">Next deadline</span>
<div className={`dash-chip ${isAnyOverdue ? 'dash-chip--red' : 'dash-chip--blue'}`}>
<span className="material-symbols-outlined">event</span>
</div>
</div>
<div className="dash-kpi-value" style={{ color: isAnyOverdue ? '#DC2626' : 'var(--ink, #0A2540)', fontSize: minDeadline ? '24px' : '30px' }}>
{!minDeadline ? (
'None'
) : minDeadline.is_overdue || minDeadline.days_left < 0 ? (
<span style={{ color: '#DC2626' }}>Overdue</span>
) : (
`${minDeadline.days_left}d`
)}
</div>
</div>
</section>
{/* ================= 3. URGENT FILING DEADLINES BANNER ================= */}
{deadlines && deadlines.some(d => d.days_left <= 7) && (
<section className={`dash-alert ${deadlines.some(d => d.is_overdue || d.days_left < 0) ? 'dash-alert--overdue' : ''} dash-rise`} style={{ '--i': 2 }}>
<div className="dash-alert-left">
<div className={`dash-chip ${deadlines.some(d => d.is_overdue || d.days_left < 0) ? 'dash-chip--red' : 'dash-chip--amber'}`}>
<span className="material-symbols-outlined">alarm</span>
</div>
<div>
<div style={{ fontWeight: 700, color: '#0A2540', fontSize: '14.5px', marginBottom: '3px' }}>
Action Required: Upcoming Statutory Tax Deadlines
</div>
<div style={{ fontSize: '13px', color: '#425466' }}>
{deadlines.filter(d => d.days_left <= 7).map((d, idx) => (
<span key={idx} style={{ marginRight: '16px', display: 'inline-block' }}>
<strong>{d.doc_type?.toUpperCase()}</strong>:{' '}
{d.is_overdue || d.days_left < 0 ? (
<span style={{ color: '#DC2626', fontWeight: 600 }}>Overdue by {Math.abs(d.days_left)} day(s)</span>
) : (
<span>Due in {d.days_left} day(s) ({new Date(d.deadline_date).toLocaleDateString()})</span>
)}
</span>
))}
</div>
</div>
</div>
</section>
)}
<div className="card fade-up">
<div style={{display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: '16px', marginBottom: '16px'}}>
{/* ================= 4. ENGAGEMENT LETTER MODULE ================= */}
<section className="dash-card dash-rise" style={{ '--i': 3, padding: '24px 26px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '16px', flexWrap: 'wrap', marginBottom: '18px' }}>
<div>
<h3 style={{margin: 0, marginBottom: '4px'}}>Engagement Letter</h3>
<p className="text-sm">Please review and acknowledge the engagement letter before uploading documents.</p>
<h3 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '18px', color: '#0A2540', margin: '0 0 4px', display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ color: '#1D4ED8', fontSize: '20px' }}>handshake</span>
Professional Engagement Letter
</h3>
<p style={{ fontSize: '13px', color: '#425466', margin: 0 }}>
Annual terms of engagement &amp; professional representation for Tax Year {new Date().getFullYear()}.
</p>
</div>
{engagementLink && (
<a
href={engagementLink}
target="_blank"
rel="noopener noreferrer"
className="btn btn-secondary btn-sm"
style={{display: 'flex', alignItems: 'center', gap: '6px', borderRadius: 'var(--radius-pill)'}}
>
<span className="material-symbols-outlined" style={{fontSize: '18px'}}>download</span>
Download PDF
</a>
)}
</div>
<label style={{
display: 'flex', alignItems: 'center', gap: '12px', padding: '16px',
background: 'var(--bg)', borderRadius: 'var(--radius-sm)', border: '1px solid var(--border)',
cursor: engagementDisabled ? 'not-allowed' : 'pointer'
}}>
<input
type="checkbox"
checked={engagementChecked}
disabled={engagementDisabled}
onChange={handleEngagementChange}
style={{width:'20px', height:'20px', cursor: engagementDisabled ? 'not-allowed' : 'pointer'}}
/>
<div>
<div style={{fontWeight: 600, color: 'var(--navy)'}}>I acknowledge the Engagement Letter</div>
<div style={{fontSize: '13px', color: 'var(--muted)', marginTop: '2px'}}>By checking this, you agree to our terms of service for the current tax year.</div>
</div>
</label>
</div>
<div style={{display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))', gap: '20px', marginTop: '20px'}}>
<div className="card fade-up" style={{animationDelay: '0.1s'}}>
<div style={{display:'flex', alignItems:'center', gap:'12px', marginBottom: '12px'}}>
<span className="material-symbols-outlined" style={{color:'var(--accent)', fontSize:'28px'}}>description</span>
<h3 style={{margin:0}}>Personal Documents</h3>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
{engagementDisabled ? (
<span className="dash-pill dash-pill--approved">
Acknowledged &amp; Verified
</span>
) : (
<span className="dash-pill dash-pill--pending">
Action Required
</span>
)}
{engagementLink && (
<a
href={engagementLink}
target="_blank"
rel="noopener noreferrer"
className="artha-pill-btn artha-pill-outline"
style={{ padding: '6px 14px', fontSize: '12px' }}
>
<span className="material-symbols-outlined" style={{ fontSize: '15px' }}>download</span>
Download PDF
</a>
)}
</div>
<p className="text-sm text-muted" style={{marginBottom: '20px', minHeight: '40px'}}>Upload your W-2s, 1099s, IDs, and other individual tax forms.</p>
</div>
<div style={{ background: '#F8FAFC', border: '1px solid #E2E8F0', borderRadius: '14px', padding: '16px 18px' }}>
<label style={{ display: 'flex', alignItems: 'center', gap: '14px', cursor: engagementDisabled ? 'default' : 'pointer' }}>
<input
type="checkbox"
checked={engagementChecked}
disabled={engagementDisabled}
onChange={handleEngagementChange}
style={{ width: '18px', height: '18px', accentColor: '#1D4ED8', cursor: engagementDisabled ? 'default' : 'pointer' }}
/>
<div style={{ flex: 1 }}>
<div style={{ fontWeight: 600, color: '#0A2540', fontSize: '13.5px' }}>
I acknowledge and accept the ABC CPA Engagement Agreement
</div>
<div style={{ fontSize: '12px', color: '#425466', marginTop: '2px' }}>
Authorizes our advisory team to prepare filings, represent your accounts, and maintain confidential financial ledgers.
</div>
</div>
<div className={`dash-chip ${engagementChecked ? 'dash-chip--green' : 'dash-chip--amber'}`} style={{ width: '32px', height: '32px', borderRadius: '50%' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>
{engagementChecked ? 'done' : 'hourglass_top'}
</span>
</div>
</label>
</div>
</section>
{/* ================= 5. PRACTICE VAULT ACTION HUB ================= */}
<section className="dash-vault-grid dash-rise" style={{ '--i': 4 }}>
{/* Personal Docs Card */}
<div className="dash-card dash-vault-card">
<div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '16px' }}>
<div className="dash-vault-tile dash-vault-tile--brand">
<span className="material-symbols-outlined" style={{ fontSize: '26px' }}>person</span>
</div>
<span className="dash-pill dash-pill--info">FORM 1040 / W-2</span>
</div>
<h3 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '19px', color: '#0A2540', margin: '0 0 6px' }}>
Personal Tax Documents
</h3>
<p style={{ fontSize: '13px', color: '#425466', margin: '0 0 14px', lineHeight: 1.5 }}>
Upload wage statements, 1099 contracts, government IDs, foreign bank disclosures (FBAR), and itemized deduction records.
</p>
<ul className="dash-vault-list">
<li>
<span className="material-symbols-outlined check-icon">check_circle</span>
W-2s, 1099-NEC, 1099-INT/DIV &amp; K-1 Pass-Throughs
</li>
<li>
<span className="material-symbols-outlined check-icon">check_circle</span>
FinCEN 114 (FBAR) &amp; Form 8938 Foreign Assets
</li>
<li>
<span className="material-symbols-outlined check-icon">check_circle</span>
Mortgage 1098 &amp; Charitable Deduction Receipts
</li>
</ul>
</div>
<button
className="btn btn-primary w-full"
className="artha-pill-btn artha-pill-primary dash-focusable"
style={{ width: '100%', justifyContent: 'center' }}
disabled={!engagementChecked}
onClick={() => navigate('/upload-personal')}
>
Go to Personal Upload
Access Personal Vault
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_forward</span>
</button>
</div>
<div className="card fade-up" style={{animationDelay: '0.2s'}}>
<div style={{display:'flex', alignItems:'center', gap:'12px', marginBottom: '12px'}}>
<span className="material-symbols-outlined" style={{color:'var(--orange)', fontSize:'28px'}}>business</span>
<h3 style={{margin:0}}>Business Documents</h3>
{/* Business Docs Card */}
<div className="dash-card dash-vault-card dash-vault-card--business">
<div>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', marginBottom: '16px' }}>
<div className="dash-vault-tile dash-vault-tile--success">
<span className="material-symbols-outlined" style={{ fontSize: '26px' }}>business_center</span>
</div>
<span className="dash-pill dash-pill--approved">1120-S / LLC / P&amp;L</span>
</div>
<h3 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '19px', color: '#0A2540', margin: '0 0 6px' }}>
Business &amp; Entity Documents
</h3>
<p style={{ fontSize: '13px', color: '#425466', margin: '0 0 14px', lineHeight: 1.5 }}>
Upload bank statements for AI reconciliation, payroll summaries, corporate agreements, and asset depreciation logs.
</p>
<ul className="dash-vault-list">
<li>
<span className="material-symbols-outlined check-icon">check_circle</span>
Instant AI Ingestion from Bank Statements (PDF/Image)
</li>
<li>
<span className="material-symbols-outlined check-icon">check_circle</span>
Form 1120, 1120-S &amp; 1065 Partnership Filings
</li>
<li>
<span className="material-symbols-outlined check-icon">check_circle</span>
Balance Sheet, Trial Balance &amp; QuickBooks Ledgers
</li>
</ul>
</div>
<p className="text-sm text-muted" style={{marginBottom: '20px', minHeight: '40px'}}>Upload corporate documents, bookkeeping ledgers, and business receipts.</p>
<button
className="btn btn-primary w-full"
className="artha-pill-btn artha-pill-dark dash-focusable"
style={{ width: '100%', justifyContent: 'center' }}
disabled={!engagementChecked}
onClick={() => navigate('/upload-business')}
>
Go to Business Upload
Access Business Vault
<span className="material-symbols-outlined" style={{ fontSize: '16px' }}>arrow_forward</span>
</button>
</div>
</div>
</section>
<div className="card fade-up" style={{animationDelay: '0.3s', marginTop: '20px'}}>
<h3 style={{marginBottom: '16px'}}>Admin Returns / Documents</h3>
<p className="text-sm" style={{marginBottom: '16px'}}>Documents and tax returns finalized by the admin.</p>
{/* ================= 6. AI ASSISTANT CARD (VIOLET) ================= */}
<section className="dash-ai dash-rise" style={{ '--i': 5 }}>
<div className="dash-ai-left">
<div className="dash-chip dash-chip--violet" style={{ width: '44px', height: '44px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '24px' }}>auto_awesome</span>
</div>
<div>
<div style={{ fontWeight: 700, color: 'var(--ink, #0A2540)', fontSize: '15.5px' }}>
Ask the AI assistant
</div>
<div style={{ color: '#425466', fontSize: '13px', marginTop: '2px' }}>
Get quick answers about your documents and filings.
</div>
</div>
</div>
<button
className="dash-ai-btn dash-focusable"
onClick={() => document.querySelector('.chatbot-fab')?.click()}
>
<span className="material-symbols-outlined" style={{ fontSize: '17px' }}>forum</span>
Open Assistant
</button>
</section>
{/* ================= 7. CERTIFIED DELIVERABLES TABLE ================= */}
<section className="dash-card dash-rise" style={{ '--i': 6, padding: '24px 26px' }}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '16px', flexWrap: 'wrap', marginBottom: '16px' }}>
<div>
<h3 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '18px', color: '#0A2540', margin: '0 0 4px', display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ color: '#1D4ED8', fontSize: '20px' }}>inventory_2</span>
Final Tax Returns &amp; CPA Deliverables
</h3>
<p style={{ fontSize: '13px', color: '#425466', margin: 0 }}>
Official tax filings, audit defense packages, and reconciled P&amp;L statements finalized by your advisory partner.
</p>
</div>
<div style={{ fontSize: '12px', color: '#425466', fontFamily: 'var(--font-mono, monospace)', fontWeight: 600 }}>
{adminDocs.length} deliverable{adminDocs.length === 1 ? '' : 's'} available
</div>
</div>
{loadingDocs ? (
<div className="empty-state">Loading documents...</div>
) : adminDocs.length === 0 ? (
<div className="empty-state">No documents have been provided by the admin yet.</div>
) : (
<div className="table-responsive">
<table className="admin-table">
<div className="dash-table-wrap">
<table className="dash-table">
<thead>
<tr>
<th>Document Name</th>
<th>Date Provided</th>
<th>Status</th>
<th>Actions</th>
<th>Document Label &amp; File</th>
<th>Date Prepared</th>
<th>Status &amp; Client Action</th>
<th style={{ textAlign: 'right' }}>Actions</th>
</tr>
</thead>
<tbody>
{[1, 2, 3, 4].map(n => (
<tr key={n}>
<td><div className="dash-skeleton" style={{ height: '18px', width: '65%' }} /></td>
<td><div className="dash-skeleton" style={{ height: '16px', width: '50%' }} /></td>
<td><div className="dash-skeleton" style={{ height: '22px', width: '90px' }} /></td>
<td style={{ textAlign: 'right' }}><div className="dash-skeleton" style={{ height: '28px', width: '80px', display: 'inline-block' }} /></td>
</tr>
))}
</tbody>
</table>
</div>
) : adminDocs.length === 0 ? (
<div className="dash-empty-state">
<div className="dash-empty-icon">
<span className="material-symbols-outlined" style={{ fontSize: '28px' }}>folder_open</span>
</div>
<h4 style={{ fontSize: '16px', color: '#0A2540', margin: 0 }}>No Deliverables Published Yet</h4>
<p style={{ fontSize: '13px', color: '#425466', maxWidth: '440px', margin: 0 }}>
Once our CPAs review your statements and prepare final returns, they will appear here for your review and approval.
</p>
</div>
) : (
<div className="dash-table-wrap">
<table className="dash-table">
<thead>
<tr>
<th>Document Label &amp; File</th>
<th>Date Prepared</th>
<th>Status &amp; Client Action</th>
<th style={{ textAlign: 'right' }}>Actions</th>
</tr>
</thead>
<tbody>
{adminDocs.map(doc => (
<React.Fragment key={doc.id}>
<tr key={doc.id}>
<tr>
<td>
<div style={{fontWeight: 500, color: 'var(--navy)'}}>{doc.doc_label}</div>
<div className="text-sm text-muted">{doc.filename}</div>
</td>
<td>{new Date(doc.created_at).toLocaleDateString()}</td>
<td>
{doc.review_status ? (
<div>
<span className={`badge ${doc.review_status === 'approved' ? 'badge-green' : doc.review_status === 'rejected' ? 'badge-red' : doc.review_status === 'sent_for_approval' ? 'badge-blue' : 'badge-yellow'}`} style={{fontWeight:700}}>
{doc.review_status.replace(/_/g, ' ').toUpperCase()}
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
<div className="dash-chip dash-chip--blue" style={{ width: '32px', height: '32px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>
picture_as_pdf
</span>
{doc.review_status === 'rejected' && doc.review_note && (
<div style={{fontSize:'12px', color:'#c0392b', fontStyle:'italic', marginTop:'4px'}}>
Reason: "{doc.review_note}"
</div>
<div>
<div style={{ fontWeight: 600, color: '#0A2540', fontSize: '13.5px' }}>{doc.doc_label}</div>
<div style={{ fontSize: '11.5px', color: '#425466' }}>{doc.filename}</div>
</div>
</div>
</td>
<td>
<span style={{ fontSize: '12.5px', color: '#425466' }}>
{new Date(doc.created_at).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' })}
</span>
</td>
<td>
{doc.review_status === 'approved' ? (
<span className="dash-pill dash-pill--approved">
Approved by Client
</span>
) : doc.review_status === 'rejected' ? (
<div>
<span className="dash-pill dash-pill--rejected">
Revision Requested
</span>
{doc.review_note && (
<div style={{ fontSize: '11.5px', color: '#DC2626', marginTop: '4px', fontStyle: 'italic' }}>
Note: &ldquo;{doc.review_note}&rdquo;
</div>
)}
{doc.review_status === 'sent_for_approval' && doc.review_note && (
<div style={{fontSize:'12px', color:'var(--blue)', fontStyle:'italic', marginTop:'4px'}}>
Note from Admin: "{doc.review_note}"
</div>
) : doc.review_status === 'sent_for_approval' ? (
<div>
<span className="dash-pill dash-pill--pending">
Pending Client Approval
</span>
{doc.review_note && (
<div style={{ fontSize: '11.5px', color: '#92600A', marginTop: '4px', fontStyle: 'italic' }}>
CPA Note: &ldquo;{doc.review_note}&rdquo;
</div>
)}
</div>
) : (
<span className="badge badge-yellow">PENDING</span>
<span className="dash-pill dash-pill--pending">
Pending Review
</span>
)}
</td>
<td>
<div style={{display:'flex', gap:'8px', flexWrap:'wrap', alignItems:'center'}}>
<button className="btn btn-secondary btn-sm" onClick={() => viewDoc(doc.storage_key)}>View</button>
<button className="btn btn-secondary btn-sm" onClick={() => downloadDoc(doc.storage_key, doc.filename)} style={{display:'flex', alignItems:'center', gap:'4px'}}><span className="material-symbols-outlined" style={{fontSize:'16px'}}>download</span></button>
{(doc.review_status === 'sent_for_approval' || doc.review_status === 'pending' || !doc.review_status) && (
<div style={{ display: 'flex', gap: '6px', justifyContent: 'flex-end', flexWrap: 'wrap' }}>
<button
className="dash-table-action-btn"
title="View Document"
onClick={() => viewDoc(doc.storage_key)}
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>visibility</span>
</button>
<button
className="dash-table-action-btn"
title="Download Document"
onClick={() => downloadDoc(doc.storage_key, doc.filename)}
>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>download</span>
</button>
{doc.review_status === 'sent_for_approval' && (
<>
<button
className="btn btn-primary btn-sm"
style={{background:'#2c7a5b', borderColor:'#2c7a5b', display:'inline-flex', alignItems:'center', gap:'4px'}}
onClick={() => respondDoc(doc.id, true)}
<button
className="artha-pill-btn artha-pill-primary"
style={{ padding: '5px 12px', fontSize: '12px' }}
onClick={() => respondDoc(doc.id, true)}
disabled={docLoading}
>
<span className="material-symbols-outlined" style={{fontSize:'15px'}}>check_circle</span>
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>check</span>
Approve
</button>
<button
className="btn btn-danger btn-sm"
style={{display:'inline-flex', alignItems:'center', gap:'4px'}}
onClick={() => openUserRejectPanel(doc.id)}
<button
className="artha-pill-btn artha-pill-outline"
style={{ padding: '5px 10px', fontSize: '12px', color: '#DC2626', borderColor: 'rgba(220,38,38,0.3)' }}
onClick={() => openUserRejectPanel(doc.id)}
disabled={docLoading}
>
<span className="material-symbols-outlined" style={{fontSize:'15px'}}>cancel</span>
Reject
<span className="material-symbols-outlined" style={{ fontSize: '14px' }}>close</span>
Request Changes
</button>
</>
)}
@@ -368,55 +707,56 @@ export default function UserDashboard() {
</td>
</tr>
{/* Inline Reject Panel */}
{/* Inline Reject Feedback Panel */}
{rejectPanel?.docId === doc.id && (
<tr key={`reject-${doc.id}`}>
<td colSpan={4} style={{padding:'0'}}>
<div style={{
padding: '14px 16px',
background: 'rgba(220,53,69,0.05)',
border: '1px solid rgba(220,53,69,0.25)',
borderTop: 'none',
display: 'flex',
flexDirection: 'column',
gap: '10px'
}}>
<div style={{fontWeight:600, fontSize:'13px', color:'#c0392b', display:'flex', alignItems:'center', gap:'6px'}}>
<span className="material-symbols-outlined" style={{fontSize:'16px'}}>feedback</span>
Reason for Rejection (optional)
<td colSpan={4} style={{ padding: '0' }}>
<div
style={{
padding: '18px 22px',
background: '#FFF8F8',
borderTop: '1px solid rgba(220, 38, 38, 0.2)',
borderBottom: '1px solid rgba(220, 38, 38, 0.2)',
display: 'flex',
flexDirection: 'column',
gap: '12px'
}}
>
<div style={{ fontWeight: 600, fontSize: '13px', color: '#DC2626', display: 'flex', alignItems: 'center', gap: '8px' }}>
<span className="material-symbols-outlined" style={{ fontSize: '18px' }}>edit_note</span>
Specify Revisions Needed for CPA Review
</div>
<textarea
rows={3}
placeholder="Tell the admin why you are rejecting this document..."
placeholder="Please explain the discrepancy, missing deduction, or change requested..."
value={rejectPanel.note}
onChange={e => setRejectPanel(prev => ({...prev, note: e.target.value}))}
onChange={e => setRejectPanel(prev => ({ ...prev, note: e.target.value }))}
style={{
width: '100%',
padding: '10px 12px',
border: '1px solid rgba(220,53,69,0.35)',
borderRadius: 'var(--radius-sm)',
padding: '12px 14px',
border: '1px solid rgba(220, 38, 38, 0.3)',
borderRadius: '12px',
fontSize: '13px',
resize: 'vertical',
outline: 'none',
fontFamily: 'inherit',
background: 'white',
boxSizing: 'border-box'
background: '#FFFFFF'
}}
/>
<div style={{display:'flex', gap:'8px', justifyContent:'flex-end'}}>
<div style={{ display: 'flex', gap: '10px', justifyContent: 'flex-end' }}>
<button
className="btn btn-secondary btn-sm"
style={{borderRadius:'var(--radius-sm)'}}
className="artha-pill-btn artha-pill-outline"
style={{ padding: '6px 14px', fontSize: '12px' }}
onClick={() => setRejectPanel(null)}
>Cancel</button>
>
Cancel
</button>
<button
className="btn btn-danger btn-sm"
style={{borderRadius:'var(--radius-sm)'}}
className="artha-pill-btn artha-pill-dark"
style={{ padding: '6px 16px', fontSize: '12px', background: '#DC2626', borderColor: '#DC2626' }}
disabled={docLoading}
onClick={() => respondDoc(doc.id, false, rejectPanel.note)}
>
<span className="material-symbols-outlined" style={{fontSize:'15px', verticalAlign:'middle', marginRight:'4px'}}>block</span>
Confirm Rejection
Submit Revision Request
</button>
</div>
</div>
@@ -429,7 +769,8 @@ export default function UserDashboard() {
</table>
</div>
)}
</div>
</section>
</div>
);
}
+61 -33
View File
@@ -4,7 +4,7 @@ import { useSearchParams, Link } from 'react-router-dom';
export default function VerifyEmail() {
const [searchParams] = useSearchParams();
const token = searchParams.get('token');
const [status, setStatus] = useState('verifying'); // verifying, success, failed, invalid
const [message, setMessage] = useState('');
@@ -19,16 +19,17 @@ export default function VerifyEmail() {
const res = await fetch(`/api/auth/verify-email?token=${encodeURIComponent(token)}`);
const data = await res.json();
if (res.ok && (data.message === "verified" || data.message === "already_verified")) {
if (res.ok && (data.message === 'verified' || data.message === 'already_verified')) {
setStatus('success');
setMessage(data.message === "already_verified" ? "Already Verified" : "Email Verified!");
setMessage(data.message === 'already_verified' ? 'Already Verified' : 'Email Verified!');
} else {
setStatus('failed');
setMessage(data.detail || "This link is invalid or has expired.");
setMessage(data.detail || 'This link is invalid or has expired.');
}
} catch (err) { console.error(err);
} catch (err) {
console.error(err);
setStatus('failed');
setMessage("Could not connect to the server. Please try again later.");
setMessage('Could not connect to the server. Please try again later.');
}
};
@@ -37,34 +38,62 @@ export default function VerifyEmail() {
return (
<div className="auth-shell page-enter">
{/* Brand Side */}
<div className="auth-brand">
<img className="brand-logo" src="/images/bookkeeppro-logo.webp" alt="BookKeepPro"/>
<div style={{ textAlign: 'center', display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
<img
src="/images/brand-logo-mark.webp"
alt="ABC CPA & Advisory"
style={{
width: '58px',
height: '58px',
borderRadius: '14px',
marginBottom: '16px',
boxShadow: '0 8px 24px rgba(0, 0, 0, 0.45)',
border: '1px solid rgba(255, 255, 255, 0.14)'
}}
width="58"
height="58"
/>
<h2 style={{ fontFamily: "var(--font-display, 'Playfair Display', serif)", fontSize: '24px', fontWeight: 600, color: '#FFFFFF', margin: 0 }}>
ABC CPA &amp; Advisory
</h2>
<div style={{ fontSize: '11px', textTransform: 'uppercase', letterSpacing: '0.12em', color: '#60A5FA', marginTop: '6px' }}>
Tax Advisory &amp; Accounting Services
</div>
</div>
<div className="brand-divider"></div>
<h2>Almost There</h2>
<p>We're verifying your email address right now.</p>
<p>
Verifying your secure portal identity to protect client confidentiality and tax documents.
</p>
</div>
{/* Form Side */}
<div className="auth-form-side">
<div className="auth-box text-center">
<div className="auth-box" style={{ textAlign: 'center' }}>
{status === 'verifying' && (
<>
<div style={{fontSize:'48px', marginBottom:'16px'}}>
<span className="material-symbols-outlined">pending</span>
<div style={{ fontSize: '48px', marginBottom: '16px', color: '#047857' }}>
<span className="material-symbols-outlined" style={{ fontSize: '48px' }}>pending</span>
</div>
<h2>Verifying your email...</h2>
<p className="auth-subtitle">Please wait a moment.</p>
<h1>Verifying your email...</h1>
<p className="auth-subtitle">Please wait a moment while we authorize your credentials.</p>
</>
)}
{status === 'invalid' && (
<>
<div style={{fontSize:'48px', marginBottom:'16px'}}>
<span className="material-symbols-outlined">cancel</span>
<div style={{ fontSize: '48px', marginBottom: '16px', color: 'var(--error, #DC2626)' }}>
<span className="material-symbols-outlined" style={{ fontSize: '48px' }}>cancel</span>
</div>
<h2>Invalid Link</h2>
<p className="auth-subtitle">This verification link is missing a token.<br/>Please use the link from your email.</p>
<Link to="/login" className="btn btn-primary" style={{borderRadius:'var(--radius-sm)', marginTop:'24px', display:'inline-flex'}}>
<h1>Invalid Link</h1>
<p className="auth-subtitle">
This verification link is missing a token.<br />Please use the link from your registration email.
</p>
<Link to="/login" className="artha-pill-btn artha-pill-primary" style={{ marginTop: '20px' }}>
Go to Sign In
</Link>
</>
@@ -72,34 +101,33 @@ export default function VerifyEmail() {
{status === 'success' && (
<>
<div style={{fontSize:'48px', marginBottom:'16px', color:'var(--green)'}}>
<span className="material-symbols-outlined">check_circle</span>
<div style={{ fontSize: '48px', marginBottom: '16px', color: '#047857' }}>
<span className="material-symbols-outlined" style={{ fontSize: '48px' }}>check_circle</span>
</div>
<h2>{message}</h2>
<h1>{message}</h1>
<p className="auth-subtitle">
{message === "Already Verified"
? "Your email is already verified. You can sign in below."
: "Your email has been verified. You can now sign in to your account."}
{message === 'Already Verified'
? 'Your email is already verified. You can sign in below.'
: 'Your email has been verified. You can now access your login portal.'}
</p>
<Link to="/login" className="btn btn-primary" style={{borderRadius:'var(--radius-sm)', marginTop:'24px', display:'inline-flex'}}>
Sign In
<Link to="/login" className="artha-pill-btn artha-pill-primary" style={{ marginTop: '20px' }}>
Sign In to Portal
</Link>
</>
)}
{status === 'failed' && (
<>
<div style={{fontSize:'48px', marginBottom:'16px', color:'var(--error)'}}>
<span className="material-symbols-outlined">cancel</span>
<div style={{ fontSize: '48px', marginBottom: '16px', color: 'var(--error, #DC2626)' }}>
<span className="material-symbols-outlined" style={{ fontSize: '48px' }}>cancel</span>
</div>
<h2>Verification Failed</h2>
<h1>Verification Failed</h1>
<p className="auth-subtitle">{message}</p>
<Link to="/resend-verification" className="btn btn-primary" style={{borderRadius:'var(--radius-sm)', marginTop:'24px', display:'inline-flex'}}>
<Link to="/resend-verification" className="artha-pill-btn artha-pill-primary" style={{ marginTop: '20px' }}>
Request New Link
</Link>
</>
)}
</div>
</div>
</div>
+2 -2
View File
@@ -1,9 +1,9 @@
// Dynamic-UI runtime (tiny, dependency-free, CSP-safe: only classList + CSSOM property writes).
// Dynamic-UI runtime (tiny, dependency-free, CSP-safe: only classList + CSSOM property writes).
// - html.motion : opts in to scroll-reveal hiding (never set for reduced-motion users)
// - html[data-scrolled]: navbar / header react after 24px of scroll
// - --scroll : 0..1 page progress, drives the brass progress rule
// - --mx / --my : pointer position inside cards, drives the hover spotlight
const SPOT = '.stat-card, .user-card, .service-card, .card';
const SPOT = '.stat-card, .user-card, .service-card, .card, .artha-portal-card, .artha-vault-card, .artha-ticker-card';
export function initMotion() {
if (typeof window === 'undefined') return;
+27
View File
@@ -17,4 +17,31 @@ export default defineConfig({
},
},
},
preview: {
port: 5173,
host: true,
proxy: {
'/api': {
target: 'http://127.0.0.1:8000',
changeOrigin: true,
},
},
},
build: {
sourcemap: false,
rollupOptions: {
output: {
manualChunks(id) {
if (
id.includes('node_modules/react/') ||
id.includes('node_modules/react-dom/') ||
id.includes('node_modules/react-router-dom/') ||
id.includes('node_modules/react-router/')
) {
return 'vendor';
}
},
},
},
},
})
+5 -1
View File
@@ -14,7 +14,7 @@ server {
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline' 'unsafe-eval'" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data: blob: https:; connect-src 'self' https:; object-src 'none'; base-uri 'self';" always;
# Redirect all HTTP traffic to HTTPS (uncomment when SSL certs are generated)
# location / {
# return 301 https://$host$request_uri;
@@ -57,6 +57,10 @@ server {
root /usr/share/nginx/html;
expires 7d;
}
location = /favicon.png {
root /usr/share/nginx/html;
expires 7d;
}
location = /icons.svg {
root /usr/share/nginx/html;
expires 7d;
+2 -1
View File
@@ -22,7 +22,7 @@ from app.models import (
ChatMessage as DBChatMessage,
)
from app.db import get_db
from app.auth.security import get_current_user, require_admin
from app.auth.security import get_current_user, require_admin, assert_admin_can_access
logger = logging.getLogger(__name__)
@@ -282,6 +282,7 @@ def admin_bulk_action(
user = db.query(User).filter(User.id == payload.user_id).first()
if not user:
raise HTTPException(status_code=404, detail="User not found")
assert_admin_can_access(current_user, user)
action_parts = payload.action.split("_")
if len(action_parts) != 2 or action_parts[0] not in ("approve", "reject") \
+35 -6
View File
@@ -7,7 +7,7 @@ from app.models import AdminDocument, User, UserRole, FilingDeadline
from app.db import get_db
from app.utils.emailer import send_email
from app import crud
from app.auth.security import get_current_user, require_admin
from app.auth.security import get_current_user, require_admin, assert_admin_can_access
from app.schemas import SubmitReviewRequest, NotifyUserRequest, AdminDocResponseRequest
logger = logging.getLogger(__name__)
@@ -32,6 +32,7 @@ async def submit_review(
user = crud.get_user_by_id(db, payload.user_id)
if not user:
raise HTTPException(status_code=404, detail="User not found")
assert_admin_can_access(current_user, user)
email_sent = await send_email(
to=user.email,
@@ -68,6 +69,7 @@ async def notify_user_review(
user = crud.get_user_by_id(db, payload.user_id)
if not user:
raise HTTPException(status_code=404, detail="User not found")
assert_admin_can_access(current_user, user)
approved_html = "".join(f"<li>{item}</li>" for item in payload.approved) or "<li>None</li>"
rejected_html = "".join(f"<li>{item}</li>" for item in payload.rejected) or "<li>None</li>"
@@ -146,6 +148,15 @@ async def admin_doc_response(
f"belonging to user {doc.user_id}"
)
raise HTTPException(status_code=403, detail="Not authorized")
if doc.review_status != "sent_for_approval":
raise HTTPException(
status_code=400,
detail="Document is not ready for client review. Status must be 'sent_for_approval'."
)
if payload.status not in ("approved", "rejected"):
raise HTTPException(status_code=400, detail="Status must be 'approved' or 'rejected'")
doc.review_status = payload.status
doc.reviewed_at = datetime.utcnow()
@@ -249,10 +260,20 @@ def update_document_status(
if doc_kind not in model_map:
raise HTTPException(status_code=400, detail="Invalid doc_kind")
ALLOWED_STATUSES = {"approved", "rejected", "pending", "sent_for_approval", "uploaded", "filed"}
if payload.status not in ALLOWED_STATUSES:
raise HTTPException(
status_code=400,
detail=f"Invalid status '{payload.status}'. Must be one of: {', '.join(sorted(ALLOWED_STATUSES))}"
)
doc = db.query(model_map[doc_kind]).filter_by(id=doc_id).first()
if not doc:
raise HTTPException(status_code=404, detail="Document not found")
target_user = crud.get_user_by_id(db, doc.user_id)
assert_admin_can_access(current_user, target_user)
doc.review_status = payload.status
if payload.note is not None:
doc.review_note = payload.note
@@ -313,7 +334,10 @@ def get_filing_deadlines(
is_admin = current_user.role in ("admin", "super_admin") or (
hasattr(current_user.role, "value") and current_user.role.value in ("admin", "super_admin")
)
if not is_admin and current_user.id != user_id:
if is_admin:
target_user = crud.get_user_by_id(db, user_id)
assert_admin_can_access(current_user, target_user)
elif current_user.id != user_id:
raise HTTPException(status_code=403, detail="Not authorized to view these deadlines")
from app.models import FilingDeadline
@@ -360,6 +384,9 @@ async def send_return_for_approval(
if not doc:
raise HTTPException(status_code=404, detail="Document not found")
client = crud.get_user_by_id(db, doc.user_id)
assert_admin_can_access(current_user, client)
doc.review_status = "sent_for_approval"
if payload.note:
doc.review_note = payload.note
@@ -388,7 +415,6 @@ async def send_return_for_approval(
db.add(event)
db.commit()
client = db.query(User).filter_by(id=doc.user_id).first()
if client:
note_html = f"<p><em>{payload.note}</em></p>" if payload.note else ""
background.add_task(
@@ -428,6 +454,11 @@ async def mark_filing_complete(
_=Depends(require_admin),
):
"""Admin marks all approved docs for a user/year as 'filed'. Sends confirmation email."""
client = crud.get_user_by_id(db, payload.user_id)
if not client:
raise HTTPException(status_code=404, detail="User not found")
assert_admin_can_access(current_user, client)
from app.models import PersonalDocument, BusinessDocument
personal_docs = db.query(PersonalDocument).filter(
@@ -455,8 +486,6 @@ async def mark_filing_complete(
target=f"user:{payload.user_id}",
detail=f"tax_year:{payload.tax_year} personal:{len(personal_docs)} business:{len(business_docs)}",
)
client = crud.get_user_by_id(db, payload.user_id)
if client:
note_html = f"<p><em>{payload.note}</em></p>" if payload.note else ""
background.add_task(
+78 -28
View File
@@ -161,8 +161,37 @@ async def upload_to_storage(file: UploadFile) -> str:
detail=f"File type not allowed or could not be verified. Allowed: PDF, JPG, PNG, WEBP, DOC, DOCX, XLS, XLSX."
)
ext = os.path.splitext(file.filename or "file")[1].lower()
object_key = f"{uuid.uuid4().hex}{ext}"
MIME_TO_EXT = {
"application/pdf": ".pdf",
"image/jpeg": ".jpg",
"image/png": ".png",
"image/webp": ".webp",
"application/msword": ".doc",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
"application/vnd.ms-excel": ".xls",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
"application/zip": ".zip",
"application/x-zip-compressed": ".zip",
}
SAFE_EXT_BY_MIME = {
"application/pdf": {".pdf"},
"image/jpeg": {".jpg", ".jpeg"},
"image/png": {".png"},
"image/webp": {".webp"},
"application/msword": {".doc"},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": {".docx"},
"application/vnd.ms-excel": {".xls"},
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {".xlsx"},
"application/zip": {".zip"},
"application/x-zip-compressed": {".zip"},
}
safe_ext = MIME_TO_EXT.get(sniffed_mime, ".bin")
if ext in SAFE_EXT_BY_MIME.get(sniffed_mime, set()):
safe_ext = ext
object_key = f"{uuid.uuid4().hex}{safe_ext}"
file_path = UPLOAD_DIR / object_key
try:
@@ -220,7 +249,11 @@ def stream_file(storage_key: str, token: str = Query(...)):
if not file_path.exists():
raise HTTPException(status_code=404, detail="File not found")
return FileResponse(file_path)
headers = {
"Content-Disposition": f'attachment; filename="{Path(storage_key).name}"',
"X-Content-Type-Options": "nosniff",
}
return FileResponse(file_path, headers=headers)
# ─────────────────────────────────────────────
@@ -355,6 +388,8 @@ def list_admin_documents(
if current_user.role in [UserRole.admin, UserRole.super_admin]:
if not user_id:
raise HTTPException(status_code=400, detail="user_id is required for admin")
target_user = crud.get_user_by_id(db, user_id)
assert_admin_can_access(current_user, target_user)
docs = (
db.query(AdminDocument)
.filter(AdminDocument.user_id == user_id, AdminDocument.deleted_at == None)
@@ -408,15 +443,7 @@ def delete_admin_document(
raise HTTPException(status_code=404, detail="Document not found")
target_user = db.query(User).filter(User.id == doc.user_id).first()
if not target_user:
raise HTTPException(status_code=404, detail="Target user not found")
# Scope restriction: standard admins can only delete documents for base users
if current_user.role == UserRole.admin and target_user.role != UserRole.user:
raise HTTPException(
status_code=403,
detail="Standard admins can only manage documents for standard users"
)
assert_admin_can_access(current_user, target_user)
if doc.review_status == "approved":
raise HTTPException(
@@ -425,10 +452,12 @@ def delete_admin_document(
)
logger.info(f"Admin {current_user.id} deleting admin document {doc_id}")
delete_from_storage(doc.storage_key)
storage_key = doc.storage_key
doc.deleted_at = datetime.utcnow()
db.commit()
crud.log_action(db, "delete_admin_doc", user_id=current_user.id, target=f"admin_doc:{doc_id}")
if storage_key:
delete_from_storage(storage_key)
return {"deleted": True}
@@ -789,6 +818,9 @@ async def set_personal_review_status(
if not doc:
raise HTTPException(status_code=404, detail="Document not found")
target_user = crud.get_user_by_id(db, doc.user_id)
assert_admin_can_access(current_user, target_user)
prev_status = doc.review_status
doc.review_status = payload.status
doc.review_note = payload.note
@@ -853,6 +885,9 @@ async def set_business_review_status(
if not doc:
raise HTTPException(status_code=404, detail="Document not found")
target_user = crud.get_user_by_id(db, doc.user_id)
assert_admin_can_access(current_user, target_user)
prev_status = doc.review_status
doc.review_status = payload.status
doc.review_note = payload.note
@@ -915,6 +950,9 @@ def update_personal_extracted_data(
doc = db.query(PersonalDocument).filter_by(id=doc_id).first()
if not doc:
raise HTTPException(status_code=404, detail="Document not found")
target_user = crud.get_user_by_id(db, doc.user_id)
assert_admin_can_access(current_user, target_user)
doc.extracted_data = payload.extracted_data
db.commit()
@@ -935,6 +973,9 @@ def update_business_extracted_data(
doc = db.query(BusinessDocument).filter_by(id=doc_id).first()
if not doc:
raise HTTPException(status_code=404, detail="Document not found")
target_user = crud.get_user_by_id(db, doc.user_id)
assert_admin_can_access(current_user, target_user)
doc.extracted_data = payload.extracted_data
db.commit()
@@ -1073,21 +1114,29 @@ def delete_user_completely(
logger.info(f"Admin {current_user.id} deleting user {user_id}")
try:
for doc in db.query(AdminDocument).filter(AdminDocument.user_id == user_id).all():
delete_from_storage(doc.storage_key)
db.delete(doc)
keys_to_delete = []
for doc in db.query(AdminDocument).filter(AdminDocument.uploaded_by == user_id).all():
delete_from_storage(doc.storage_key)
try:
# If deleted user is an admin who uploaded documents for other clients, disassociate them rather than deleting client deliverables!
db.query(AdminDocument).filter(
AdminDocument.uploaded_by == user_id,
AdminDocument.user_id != user_id
).update({AdminDocument.uploaded_by: None}, synchronize_session=False)
# Admin documents belonging to this user
for doc in db.query(AdminDocument).filter(AdminDocument.user_id == user_id).all():
if doc.storage_key:
keys_to_delete.append(doc.storage_key)
db.delete(doc)
for doc in db.query(PersonalDocument).filter(PersonalDocument.user_id == user_id).all():
delete_from_storage(doc.storage_key)
if doc.storage_key:
keys_to_delete.append(doc.storage_key)
db.delete(doc)
for doc in db.query(BusinessDocument).filter(BusinessDocument.user_id == user_id).all():
delete_from_storage(doc.storage_key)
if doc.storage_key:
keys_to_delete.append(doc.storage_key)
db.delete(doc)
# Clean up legacy uploaded_files rows to avoid FK constraint errors on db.delete(user)
@@ -1133,6 +1182,10 @@ def delete_user_completely(
db.delete(user)
db.commit()
# Delete physical files ONLY after successful DB commit
for k in keys_to_delete:
delete_from_storage(k)
except Exception as e:
db.rollback()
logger.error(f"User deletion failed for {user_id}: {e}")
@@ -1345,11 +1398,11 @@ def delete_template(
except (IndexError, AttributeError):
key_to_delete = None
if key_to_delete:
delete_from_storage(key_to_delete)
db.delete(record)
db.commit()
if key_to_delete:
delete_from_storage(key_to_delete)
return {"deleted": True}
from fastapi.responses import StreamingResponse
@@ -1372,10 +1425,7 @@ def export_user_documents_excel(
from openpyxl.styles import Font, PatternFill, Alignment
user = db.query(User).filter(User.id == user_id).first()
if not user:
raise HTTPException(status_code=404, detail="User not found")
if current_user.role == UserRole.admin and user.role != UserRole.user:
raise HTTPException(status_code=403, detail="Admins can only export documents for regular user accounts")
assert_admin_can_access(current_user, user)
personal_docs = db.query(PersonalDocument).filter(
PersonalDocument.user_id == user_id, PersonalDocument.deleted_at == None