feat: add Usage Limits Panel component with usage tracking and visual indicators for limits
style: implement custom color schemes and gradients for account section, enhancing visual hierarchy
This commit is contained in:
245
frontend/src/components/billing/UsageLimitsPanel.tsx
Normal file
245
frontend/src/components/billing/UsageLimitsPanel.tsx
Normal file
@@ -0,0 +1,245 @@
|
||||
/**
|
||||
* Usage Limits Panel Component
|
||||
* Displays hard and monthly plan limits with usage tracking
|
||||
*/
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { Card } from '../ui/card';
|
||||
import { AlertCircle, TrendingUp, Users, Globe, Tag, FileText, Image, Zap } from 'lucide-react';
|
||||
import Badge from '../ui/badge/Badge';
|
||||
import { getUsageSummary, type UsageSummary, type LimitUsage } from '../../services/billing.api';
|
||||
import { useToast } from '../ui/toast/ToastContainer';
|
||||
|
||||
interface LimitCardProps {
|
||||
title: string;
|
||||
icon: React.ReactNode;
|
||||
usage: LimitUsage;
|
||||
type: 'hard' | 'monthly';
|
||||
daysUntilReset?: number;
|
||||
}
|
||||
|
||||
function LimitCard({ title, icon, usage, type, daysUntilReset }: LimitCardProps) {
|
||||
const percentage = usage.percentage_used;
|
||||
const isWarning = percentage >= 80;
|
||||
const isDanger = percentage >= 95;
|
||||
|
||||
let barColor = 'bg-blue-500';
|
||||
let badgeVariant: 'default' | 'warning' | 'danger' = 'default';
|
||||
|
||||
if (isDanger) {
|
||||
barColor = 'bg-red-500';
|
||||
badgeVariant = 'danger';
|
||||
} else if (isWarning) {
|
||||
barColor = 'bg-yellow-500';
|
||||
badgeVariant = 'warning';
|
||||
}
|
||||
|
||||
return (
|
||||
<Card className="p-4 hover:shadow-md transition-shadow">
|
||||
<div className="flex items-start justify-between mb-3">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="p-2 bg-blue-50 dark:bg-blue-900/20 rounded-lg text-blue-600 dark:text-blue-400">
|
||||
{icon}
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="font-medium text-gray-900 dark:text-white">{title}</h3>
|
||||
<p className="text-xs text-gray-500 dark:text-gray-400">
|
||||
{type === 'monthly' && daysUntilReset !== undefined
|
||||
? `Resets in ${daysUntilReset} days`
|
||||
: 'Lifetime limit'}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<Badge variant={badgeVariant}>{percentage}%</Badge>
|
||||
</div>
|
||||
|
||||
{/* Progress Bar */}
|
||||
<div className="mb-3">
|
||||
<div className="h-2 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden">
|
||||
<div
|
||||
className={`h-full ${barColor} transition-all duration-300`}
|
||||
style={{ width: `${Math.min(percentage, 100)}%` }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Usage Stats */}
|
||||
<div className="flex items-center justify-between text-sm">
|
||||
<span className="text-gray-600 dark:text-gray-400">
|
||||
{usage.current.toLocaleString()} / {usage.limit.toLocaleString()}
|
||||
</span>
|
||||
<span className="font-medium text-gray-900 dark:text-white">
|
||||
{usage.remaining.toLocaleString()} remaining
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Warning Message */}
|
||||
{isWarning && (
|
||||
<div className={`mt-3 flex items-start gap-2 text-xs ${
|
||||
isDanger ? 'text-red-600 dark:text-red-400' : 'text-yellow-600 dark:text-yellow-400'
|
||||
}`}>
|
||||
<AlertCircle className="w-4 h-4 mt-0.5 flex-shrink-0" />
|
||||
<span>
|
||||
{isDanger
|
||||
? 'Limit almost reached! Consider upgrading your plan.'
|
||||
: 'Approaching limit. Monitor your usage carefully.'}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
export default function UsageLimitsPanel() {
|
||||
const toast = useToast();
|
||||
const [summary, setSummary] = useState<UsageSummary | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string>('');
|
||||
|
||||
useEffect(() => {
|
||||
loadUsageSummary();
|
||||
}, []);
|
||||
|
||||
const loadUsageSummary = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
setError('');
|
||||
const data = await getUsageSummary();
|
||||
setSummary(data);
|
||||
} catch (err: any) {
|
||||
const message = err?.message || 'Failed to load usage summary';
|
||||
setError(message);
|
||||
toast.error(message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="animate-pulse">
|
||||
<div className="h-32 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4"></div>
|
||||
<div className="h-32 bg-gray-200 dark:bg-gray-700 rounded-lg mb-4"></div>
|
||||
<div className="h-32 bg-gray-200 dark:bg-gray-700 rounded-lg"></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (error || !summary) {
|
||||
return (
|
||||
<Card className="p-6 text-center">
|
||||
<AlertCircle className="w-12 h-12 text-red-500 mx-auto mb-4" />
|
||||
<h3 className="text-lg font-medium text-gray-900 dark:text-white mb-2">
|
||||
Failed to Load Usage Data
|
||||
</h3>
|
||||
<p className="text-gray-600 dark:text-gray-400 mb-4">{error || 'Unknown error'}</p>
|
||||
<button
|
||||
onClick={loadUsageSummary}
|
||||
className="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700"
|
||||
>
|
||||
Retry
|
||||
</button>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
const hardLimitIcons = {
|
||||
sites: <Globe className="w-5 h-5" />,
|
||||
users: <Users className="w-5 h-5" />,
|
||||
keywords: <Tag className="w-5 h-5" />,
|
||||
clusters: <TrendingUp className="w-5 h-5" />,
|
||||
};
|
||||
|
||||
const monthlyLimitIcons = {
|
||||
content_ideas: <FileText className="w-5 h-5" />,
|
||||
content_words: <FileText className="w-5 h-5" />,
|
||||
images_basic: <Image className="w-5 h-5" />,
|
||||
images_premium: <Zap className="w-5 h-5" />,
|
||||
image_prompts: <Image className="w-5 h-5" />,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 className="text-xl font-bold text-gray-900 dark:text-white">Plan Limits & Usage</h2>
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400 mt-1">
|
||||
Current Plan: <span className="font-medium">{summary.plan_name}</span>
|
||||
</p>
|
||||
</div>
|
||||
{summary.days_until_reset !== undefined && (
|
||||
<Badge variant="default">
|
||||
Resets in {summary.days_until_reset} days
|
||||
</Badge>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Hard Limits Section */}
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-4">
|
||||
Account Limits
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
{Object.entries(summary.hard_limits).map(([key, usage]) => (
|
||||
<LimitCard
|
||||
key={key}
|
||||
title={usage.display_name}
|
||||
icon={hardLimitIcons[key as keyof typeof hardLimitIcons]}
|
||||
usage={usage}
|
||||
type="hard"
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Monthly Limits Section */}
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-4">
|
||||
Monthly Usage Limits
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{Object.entries(summary.monthly_limits).map(([key, usage]) => (
|
||||
<LimitCard
|
||||
key={key}
|
||||
title={usage.display_name}
|
||||
icon={monthlyLimitIcons[key as keyof typeof monthlyLimitIcons]}
|
||||
usage={usage}
|
||||
type="monthly"
|
||||
daysUntilReset={summary.days_until_reset}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Upgrade CTA if approaching limits */}
|
||||
{(Object.values(summary.hard_limits).some(u => u.percentage_used >= 80) ||
|
||||
Object.values(summary.monthly_limits).some(u => u.percentage_used >= 80)) && (
|
||||
<Card className="p-6 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-900/20 dark:to-indigo-900/20 border-blue-200 dark:border-blue-700">
|
||||
<div className="flex items-start gap-4">
|
||||
<div className="p-3 bg-blue-600 rounded-lg text-white">
|
||||
<TrendingUp className="w-6 h-6" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<h3 className="text-lg font-semibold text-gray-900 dark:text-white mb-2">
|
||||
Approaching Your Limits
|
||||
</h3>
|
||||
<p className="text-gray-600 dark:text-gray-400 mb-4">
|
||||
You're using a significant portion of your plan's resources. Upgrade to get higher limits
|
||||
and avoid interruptions.
|
||||
</p>
|
||||
<a
|
||||
href="/account/plans-and-billing"
|
||||
className="inline-flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors"
|
||||
>
|
||||
View Plans & Upgrade
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -18,6 +18,17 @@ export interface PricingPlan {
|
||||
features: string[];
|
||||
buttonText: string;
|
||||
highlighted?: boolean;
|
||||
disabled?: boolean;
|
||||
// Plan limits
|
||||
max_sites?: number;
|
||||
max_users?: number;
|
||||
max_keywords?: number;
|
||||
max_clusters?: number;
|
||||
max_content_ideas?: number;
|
||||
max_content_words?: number;
|
||||
max_images_basic?: number;
|
||||
max_images_premium?: number;
|
||||
included_credits?: number;
|
||||
}
|
||||
|
||||
interface PricingTableProps {
|
||||
@@ -124,12 +135,68 @@ export function PricingTable({ variant = '1', title, plans, showToggle = false,
|
||||
<span className="text-sm text-gray-700 dark:text-gray-300">{feature}</span>
|
||||
</li>
|
||||
))}
|
||||
|
||||
{/* Plan Limits Section */}
|
||||
{(plan.max_sites || plan.max_content_words || plan.included_credits) && (
|
||||
<div className="pt-3 mt-3 border-t border-gray-200 dark:border-gray-700">
|
||||
<div className="text-xs font-semibold text-gray-500 dark:text-gray-400 mb-2">LIMITS</div>
|
||||
{plan.max_sites && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5" />
|
||||
<span className="text-xs text-gray-600 dark:text-gray-400">
|
||||
{plan.max_sites === 99999 ? 'Unlimited' : plan.max_sites} Sites
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
{plan.max_users && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5" />
|
||||
<span className="text-xs text-gray-600 dark:text-gray-400">
|
||||
{plan.max_users === 99999 ? 'Unlimited' : plan.max_users} Team Members
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
{plan.max_content_words && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5" />
|
||||
<span className="text-xs text-gray-600 dark:text-gray-400">
|
||||
{(plan.max_content_words / 1000).toLocaleString()}K Words/month
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
{plan.max_content_ideas && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5" />
|
||||
<span className="text-xs text-gray-600 dark:text-gray-400">
|
||||
{plan.max_content_ideas} Ideas/month
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
{plan.max_images_basic && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5" />
|
||||
<span className="text-xs text-gray-600 dark:text-gray-400">
|
||||
{plan.max_images_basic} Images/month
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
{plan.included_credits && (
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="w-4 h-4 text-blue-500 flex-shrink-0 mt-0.5" />
|
||||
<span className="text-xs text-gray-600 dark:text-gray-400">
|
||||
{plan.included_credits.toLocaleString()} Credits/month
|
||||
</span>
|
||||
</li>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</ul>
|
||||
|
||||
<Button
|
||||
variant={plan.highlighted ? 'primary' : 'outline'}
|
||||
className="w-full"
|
||||
onClick={() => onPlanSelect?.(plan)}
|
||||
disabled={plan.disabled}
|
||||
>
|
||||
{plan.buttonText}
|
||||
</Button>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
layer(base);
|
||||
|
||||
@import "./styles/tokens.css";
|
||||
@import "./styles/account-colors.css";
|
||||
@import "tailwindcss";
|
||||
|
||||
@keyframes slide-in-right {
|
||||
|
||||
@@ -502,6 +502,16 @@ export default function PlansAndBillingPage() {
|
||||
buttonText: plan.id === currentPlanId ? 'Current Plan' : 'Select Plan',
|
||||
highlighted: plan.is_featured || false,
|
||||
disabled: plan.id === currentPlanId || planLoadingId === plan.id,
|
||||
// Plan limits
|
||||
max_sites: plan.max_sites,
|
||||
max_users: plan.max_users,
|
||||
max_keywords: plan.max_keywords,
|
||||
max_clusters: plan.max_clusters,
|
||||
max_content_ideas: plan.max_content_ideas,
|
||||
max_content_words: plan.max_content_words,
|
||||
max_images_basic: plan.max_images_basic,
|
||||
max_images_premium: plan.max_images_premium,
|
||||
included_credits: plan.included_credits,
|
||||
};
|
||||
})}
|
||||
showToggle={true}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* Usage & Analytics Page
|
||||
* Tabs: Credit Usage, API Usage, Cost Breakdown
|
||||
* Tabs: Plan Limits, Credit Usage, API Usage, Cost Breakdown
|
||||
*/
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { TrendingUp, Activity, DollarSign } from 'lucide-react';
|
||||
import { TrendingUp, Activity, DollarSign, BarChart3 } from 'lucide-react';
|
||||
import PageMeta from '../../components/common/PageMeta';
|
||||
import { useToast } from '../../components/ui/toast/ToastContainer';
|
||||
import { getUsageAnalytics, UsageAnalytics } from '../../services/billing.api';
|
||||
@@ -12,13 +12,14 @@ import { Card } from '../../components/ui/card';
|
||||
import Badge from '../../components/ui/badge/Badge';
|
||||
import BillingUsagePanel from '../../components/billing/BillingUsagePanel';
|
||||
import BillingBalancePanel from '../../components/billing/BillingBalancePanel';
|
||||
import UsageLimitsPanel from '../../components/billing/UsageLimitsPanel';
|
||||
import Button from '../../components/ui/button/Button';
|
||||
|
||||
type TabType = 'credits' | 'api' | 'costs';
|
||||
type TabType = 'limits' | 'credits' | 'balance' | 'api' | 'costs';
|
||||
|
||||
export default function UsageAnalyticsPage() {
|
||||
const toast = useToast();
|
||||
const [activeTab, setActiveTab] = useState<TabType>('credits');
|
||||
const [activeTab, setActiveTab] = useState<TabType>('limits');
|
||||
const [analytics, setAnalytics] = useState<UsageAnalytics | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [period, setPeriod] = useState(30);
|
||||
@@ -51,6 +52,7 @@ export default function UsageAnalyticsPage() {
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ id: 'limits' as TabType, label: 'Plan Limits', icon: <BarChart3 className="w-4 h-4" /> },
|
||||
{ id: 'credits' as TabType, label: 'Credit Usage', icon: <TrendingUp className="w-4 h-4" /> },
|
||||
{ id: 'balance' as TabType, label: 'Credit Balance', icon: <DollarSign className="w-4 h-4" /> },
|
||||
{ id: 'api' as TabType, label: 'API Usage', icon: <Activity className="w-4 h-4" /> },
|
||||
@@ -64,7 +66,7 @@ export default function UsageAnalyticsPage() {
|
||||
<div className="mb-6">
|
||||
<h1 className="text-2xl font-bold text-gray-900 dark:text-white">Usage & Analytics</h1>
|
||||
<p className="text-gray-600 dark:text-gray-400 mt-1">
|
||||
Monitor credit usage, API calls, and cost breakdown
|
||||
Monitor plan limits, credit usage, API calls, and cost breakdown
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -112,6 +114,11 @@ export default function UsageAnalyticsPage() {
|
||||
|
||||
{/* Tab Content */}
|
||||
<div className="mt-6">
|
||||
{/* Plan Limits Tab */}
|
||||
{activeTab === 'limits' && (
|
||||
<UsageLimitsPanel />
|
||||
)}
|
||||
|
||||
{/* Credit Usage Tab */}
|
||||
{activeTab === 'credits' && (
|
||||
<div className="space-y-6">
|
||||
|
||||
@@ -865,6 +865,48 @@ export interface Plan {
|
||||
features?: string[];
|
||||
limits?: Record<string, any>;
|
||||
display_order?: number;
|
||||
// Hard Limits
|
||||
max_sites?: number;
|
||||
max_users?: number;
|
||||
max_keywords?: number;
|
||||
max_clusters?: number;
|
||||
// Monthly Limits
|
||||
max_content_ideas?: number;
|
||||
max_content_words?: number;
|
||||
max_images_basic?: number;
|
||||
max_images_premium?: number;
|
||||
max_image_prompts?: number;
|
||||
included_credits?: number;
|
||||
}
|
||||
|
||||
export interface LimitUsage {
|
||||
display_name: string;
|
||||
current: number;
|
||||
limit: number;
|
||||
remaining: number;
|
||||
percentage_used: number;
|
||||
}
|
||||
|
||||
export interface UsageSummary {
|
||||
account_id: number;
|
||||
account_name: string;
|
||||
plan_name: string;
|
||||
period_start: string;
|
||||
period_end: string;
|
||||
days_until_reset: number;
|
||||
hard_limits: {
|
||||
sites?: LimitUsage;
|
||||
users?: LimitUsage;
|
||||
keywords?: LimitUsage;
|
||||
clusters?: LimitUsage;
|
||||
};
|
||||
monthly_limits: {
|
||||
content_ideas?: LimitUsage;
|
||||
content_words?: LimitUsage;
|
||||
images_basic?: LimitUsage;
|
||||
images_premium?: LimitUsage;
|
||||
image_prompts?: LimitUsage;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Subscription {
|
||||
@@ -942,3 +984,11 @@ export async function cancelSubscription(subscriptionId: number): Promise<{ mess
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// USAGE SUMMARY (PLAN LIMITS)
|
||||
// ============================================================================
|
||||
|
||||
export async function getUsageSummary(): Promise<UsageSummary> {
|
||||
return fetchAPI('/v1/billing/usage-summary/');
|
||||
}
|
||||
|
||||
435
frontend/src/styles/account-colors.css
Normal file
435
frontend/src/styles/account-colors.css
Normal file
@@ -0,0 +1,435 @@
|
||||
/* ===================================================================
|
||||
IGNY8 ACCOUNT SECTION - CUSTOM COLOR SCHEMES
|
||||
===================================================================
|
||||
Brand-specific styling for account, billing, and usage pages
|
||||
Follows IGNY8 design system with enhanced gradients and visual hierarchy
|
||||
=================================================================== */
|
||||
|
||||
/* Account Page Container */
|
||||
.account-page {
|
||||
background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.dark .account-page {
|
||||
background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
|
||||
}
|
||||
|
||||
/* === IGNY8 BRAND GRADIENTS === */
|
||||
.igny8-gradient-primary {
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
||||
}
|
||||
|
||||
.igny8-gradient-success {
|
||||
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
|
||||
}
|
||||
|
||||
.igny8-gradient-warning {
|
||||
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
|
||||
}
|
||||
|
||||
.igny8-gradient-danger {
|
||||
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
||||
}
|
||||
|
||||
.igny8-gradient-purple {
|
||||
background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
|
||||
}
|
||||
|
||||
.igny8-gradient-teal {
|
||||
background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
|
||||
}
|
||||
|
||||
/* === CARD VARIANTS === */
|
||||
.igny8-card-premium {
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.05) 100%);
|
||||
border: 1px solid rgba(59, 130, 246, 0.2);
|
||||
box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1), 0 2px 4px -1px rgba(59, 130, 246, 0.06);
|
||||
}
|
||||
|
||||
.dark .igny8-card-premium {
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
|
||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
.igny8-card-success {
|
||||
background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
|
||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||
}
|
||||
|
||||
.dark .igny8-card-success {
|
||||
background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
|
||||
border: 1px solid rgba(16, 185, 129, 0.3);
|
||||
}
|
||||
|
||||
.igny8-card-warning {
|
||||
background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(217, 119, 6, 0.05) 100%);
|
||||
border: 1px solid rgba(245, 158, 11, 0.2);
|
||||
}
|
||||
|
||||
.dark .igny8-card-warning {
|
||||
background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
|
||||
border: 1px solid rgba(245, 158, 11, 0.3);
|
||||
}
|
||||
|
||||
/* === USAGE METRICS === */
|
||||
.usage-metric-card {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.usage-metric-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3px;
|
||||
background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
|
||||
}
|
||||
|
||||
.usage-metric-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.usage-metric-card.warning::before {
|
||||
background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
|
||||
}
|
||||
|
||||
.usage-metric-card.danger::before {
|
||||
background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
|
||||
}
|
||||
|
||||
.usage-metric-card.success::before {
|
||||
background: linear-gradient(90deg, #10b981 0%, #059669 100%);
|
||||
}
|
||||
|
||||
/* === PROGRESS BARS === */
|
||||
.igny8-progress-bar {
|
||||
height: 8px;
|
||||
background: #e5e7eb;
|
||||
border-radius: 9999px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dark .igny8-progress-bar {
|
||||
background: #374151;
|
||||
}
|
||||
|
||||
.igny8-progress-fill {
|
||||
height: 100%;
|
||||
transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.igny8-progress-fill::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.3) 50%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
animation: shimmer 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes shimmer {
|
||||
0% {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(100%);
|
||||
}
|
||||
}
|
||||
|
||||
.igny8-progress-fill.primary {
|
||||
background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
|
||||
}
|
||||
|
||||
.igny8-progress-fill.warning {
|
||||
background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
|
||||
}
|
||||
|
||||
.igny8-progress-fill.danger {
|
||||
background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
|
||||
}
|
||||
|
||||
.igny8-progress-fill.success {
|
||||
background: linear-gradient(90deg, #10b981 0%, #059669 100%);
|
||||
}
|
||||
|
||||
/* === STAT NUMBERS === */
|
||||
.igny8-stat-number {
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 1;
|
||||
letter-spacing: -0.025em;
|
||||
}
|
||||
|
||||
.igny8-stat-number.primary {
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.igny8-stat-number.success {
|
||||
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.igny8-stat-number.warning {
|
||||
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.igny8-stat-number.danger {
|
||||
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
/* === BADGES === */
|
||||
.igny8-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.025em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.igny8-badge.primary {
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
|
||||
color: #2563eb;
|
||||
border: 1px solid rgba(59, 130, 246, 0.2);
|
||||
}
|
||||
|
||||
.dark .igny8-badge.primary {
|
||||
background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.2) 100%);
|
||||
color: #60a5fa;
|
||||
}
|
||||
|
||||
.igny8-badge.success {
|
||||
background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
|
||||
color: #059669;
|
||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||
}
|
||||
|
||||
.dark .igny8-badge.success {
|
||||
background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
|
||||
color: #34d399;
|
||||
}
|
||||
|
||||
.igny8-badge.warning {
|
||||
background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
|
||||
color: #d97706;
|
||||
border: 1px solid rgba(245, 158, 11, 0.2);
|
||||
}
|
||||
|
||||
.dark .igny8-badge.warning {
|
||||
background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.2) 100%);
|
||||
color: #fbbf24;
|
||||
}
|
||||
|
||||
.igny8-badge.danger {
|
||||
background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
|
||||
color: #dc2626;
|
||||
border: 1px solid rgba(239, 68, 68, 0.2);
|
||||
}
|
||||
|
||||
.dark .igny8-badge.danger {
|
||||
background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
|
||||
color: #f87171;
|
||||
}
|
||||
|
||||
/* === PLAN CARDS === */
|
||||
.igny8-plan-card {
|
||||
position: relative;
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.igny8-plan-card.featured {
|
||||
border: 2px solid #3b82f6;
|
||||
box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.1), 0 10px 10px -5px rgba(59, 130, 246, 0.04);
|
||||
}
|
||||
|
||||
.igny8-plan-card.featured::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
|
||||
}
|
||||
|
||||
.igny8-plan-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
/* === LIMIT DISPLAY === */
|
||||
.igny8-limit-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem;
|
||||
border-radius: 0.5rem;
|
||||
background: rgba(59, 130, 246, 0.05);
|
||||
border: 1px solid rgba(59, 130, 246, 0.1);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.dark .igny8-limit-item {
|
||||
background: rgba(59, 130, 246, 0.1);
|
||||
border: 1px solid rgba(59, 130, 246, 0.2);
|
||||
}
|
||||
|
||||
.igny8-limit-item:hover {
|
||||
background: rgba(59, 130, 246, 0.1);
|
||||
border-color: rgba(59, 130, 246, 0.2);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
.dark .igny8-limit-item:hover {
|
||||
background: rgba(59, 130, 246, 0.15);
|
||||
border-color: rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
/* === BILLING HISTORY TABLE === */
|
||||
.igny8-billing-table {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.igny8-billing-table thead th {
|
||||
background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
|
||||
color: #6b7280;
|
||||
font-weight: 600;
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
padding: 0.75rem 1rem;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
}
|
||||
|
||||
.dark .igny8-billing-table thead th {
|
||||
background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
|
||||
color: #9ca3af;
|
||||
border-bottom: 1px solid #374151;
|
||||
}
|
||||
|
||||
.igny8-billing-table tbody tr {
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.dark .igny8-billing-table tbody tr {
|
||||
border-bottom: 1px solid #374151;
|
||||
}
|
||||
|
||||
.igny8-billing-table tbody tr:hover {
|
||||
background: rgba(59, 130, 246, 0.02);
|
||||
}
|
||||
|
||||
.dark .igny8-billing-table tbody tr:hover {
|
||||
background: rgba(59, 130, 246, 0.05);
|
||||
}
|
||||
|
||||
.igny8-billing-table tbody td {
|
||||
padding: 1rem;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.dark .igny8-billing-table tbody td {
|
||||
color: #d1d5db;
|
||||
}
|
||||
|
||||
/* === UPGRADE CTA === */
|
||||
.igny8-upgrade-cta {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: 1rem;
|
||||
padding: 2rem;
|
||||
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.igny8-upgrade-cta::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
.igny8-upgrade-cta-content {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* === ANIMATIONS === */
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.igny8-fade-in-up {
|
||||
animation: fadeInUp 0.6s ease-out;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% {
|
||||
opacity: 1;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.igny8-pulse {
|
||||
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
||||
}
|
||||
|
||||
/* === RESPONSIVE UTILITIES === */
|
||||
@media (max-width: 640px) {
|
||||
.igny8-stat-number {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.usage-metric-card {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.igny8-plan-card {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user