/**
 * Bulk Mailer Pro - Premium Stylesheet
 * LUXURY PURPLE THEME - Elegant & Creative Design
 */

/* CSS Variables - LUXURY PURPLE */
:root {
    /* Primary Purple Palette */
    --primary: #9333ea;
    --primary-hover: #7c3aed;
    --primary-light: #f3e8ff;
    --primary-dark: #581c87;
    --primary-gradient: linear-gradient(135deg, #9333ea 0%, #c026d3 50%, #a855f7 100%);
    
    /* Luxury Gold Accent */
    --accent: #d4a574;
    --accent-light: #fef7ed;
    --accent-gradient: linear-gradient(135deg, #d4a574 0%, #f4d03f 100%);
    
    /* Success - Emerald */
    --success: #059669;
    --success-light: #d1fae5;
    --success-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    
    /* Warning - Amber */
    --warning: #d97706;
    --warning-light: #fef3c7;
    --warning-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    
    /* Danger - Rose */
    --danger: #e11d48;
    --danger-light: #ffe4e6;
    --danger-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    
    /* Info - Violet */
    --info: #7c3aed;
    --info-light: #ede9fe;
    --info-gradient: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
    
    /* Sidebar - Deep Purple */
    --sidebar-bg: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    --sidebar-hover: rgba(168, 85, 247, 0.15);
    --sidebar-text: #c4b5fd;
    --sidebar-text-active: #ffffff;
    --sidebar-accent: #a855f7;
    
    /* Backgrounds */
    --bg: #faf5ff;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --border: #e9d5ff;
    --border-light: rgba(147, 51, 234, 0.1);
    --text: #1e1b4b;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    
    /* Shadows - Purple Tinted */
    --shadow-sm: 0 1px 2px rgba(147, 51, 234, 0.05);
    --shadow: 0 4px 6px -1px rgba(147, 51, 234, 0.1), 0 2px 4px -1px rgba(147, 51, 234, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(147, 51, 234, 0.15), 0 10px 10px -5px rgba(147, 51, 234, 0.08);
    --shadow-xl: 0 25px 50px -12px rgba(147, 51, 234, 0.25);
    --shadow-glow: 0 0 40px rgba(147, 51, 234, 0.2);
    
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --sidebar-width: 280px;
    --topbar-height: 70px;
    
    --transition-fast: 0.15s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Dark Mode - Deep Purple Night */
[data-theme="dark"] {
    --primary: #a855f7;
    --primary-hover: #9333ea;
    --primary-light: rgba(168, 85, 247, 0.2);
    --primary-dark: #e9d5ff;
    
    --accent: #f4d03f;
    --accent-light: rgba(244, 208, 63, 0.15);
    
    --success-light: rgba(5, 150, 105, 0.2);
    --warning-light: rgba(217, 119, 6, 0.2);
    --danger-light: rgba(225, 29, 72, 0.2);
    --info-light: rgba(124, 58, 237, 0.2);
    
    --sidebar-bg: linear-gradient(180deg, #0c0a1d 0%, #1e1b4b 50%, #2e1065 100%);
    --sidebar-hover: rgba(168, 85, 247, 0.15);
    --sidebar-text: #a78bfa;
    --sidebar-text-active: #f3e8ff;
    
    --bg: #0f0d1a;
    --bg-card: #1a1625;
    --bg-glass: rgba(26, 22, 37, 0.95);
    --border: #3b2d5c;
    --border-light: rgba(168, 85, 247, 0.1);
    --text: #f3e8ff;
    --text-muted: #a78bfa;
    --text-light: #7c3aed;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 60px rgba(168, 85, 247, 0.3);
}

/* Night Mode - Ultra Dark Purple */
[data-theme="night"] {
    --primary: #c084fc;
    --primary-hover: #a855f7;
    --primary-light: rgba(192, 132, 252, 0.15);
    --primary-dark: #f3e8ff;
    
    --accent: #fbbf24;
    --accent-light: rgba(251, 191, 36, 0.1);
    
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #fb7185;
    --danger-light: rgba(251, 113, 133, 0.15);
    --info: #a78bfa;
    --info-light: rgba(167, 139, 250, 0.15);
    
    --sidebar-bg: linear-gradient(180deg, #030105 0%, #0c0a1d 50%, #1e1b4b 100%);
    --sidebar-hover: rgba(192, 132, 252, 0.1);
    --sidebar-text: #7c3aed;
    --sidebar-text-active: #e9d5ff;
    
    --bg: #030105;
    --bg-card: #0c0a1d;
    --bg-glass: rgba(12, 10, 29, 0.98);
    --border: #2e1065;
    --border-light: rgba(192, 132, 252, 0.05);
    --text: #e9d5ff;
    --text-muted: #7c3aed;
    --text-light: #581c87;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.7), 0 2px 4px -1px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 10px 10px -5px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    --shadow-glow: 0 0 80px rgba(192, 132, 252, 0.25);
}

[data-theme="dark"] code,
[data-theme="night"] code {
    background: rgba(147, 51, 234, 0.2);
    color: var(--primary);
}

[data-theme="dark"] .login-page,
[data-theme="night"] .login-page {
    background: linear-gradient(135deg, #030105 0%, #1e1b4b 50%, #4c1d95 100%);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Base */
html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

code {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    color: var(--primary-dark);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* App Layout */
.app {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    margin: 0;
    padding: 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

.sidebar::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='%239C92AC' fill-opacity='0.03'%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");
    pointer-events: none;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    color: white;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.logo svg {
    padding: 10px;
    background: var(--primary-gradient);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.4);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text small {
    font-size: 11px;
    font-weight: 400;
    color: var(--sidebar-text);
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    position: relative;
}

.nav-group {
    margin-bottom: 8px;
}

.nav-label {
    padding: 12px 24px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-light);
    opacity: 0.6;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    margin: 2px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all var(--transition);
    border-radius: var(--radius);
    position: relative;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
    text-decoration: none;
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(192, 38, 211, 0.1) 100%);
    color: var(--sidebar-text-active);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: all var(--transition);
}

.nav-item.active svg,
.nav-item:hover svg {
    opacity: 1;
}

.nav-item.active svg {
    filter: drop-shadow(0 0 8px rgba(147, 51, 234, 0.5));
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    position: relative;
}

.sidebar-footer-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
}

.sidebar-footer-content .avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.sidebar-footer-content .user-details {
    flex: 1;
}

.sidebar-footer-content .user-name {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.sidebar-footer-content .user-role {
    color: var(--sidebar-text);
    font-size: 12px;
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding-left: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    background: var(--bg);
    position: relative;
    box-sizing: border-box;
}

/* Top Bar */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.page-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.page-breadcrumb a {
    color: var(--text-muted);
}

.page-breadcrumb a:hover {
    color: var(--primary);
}

.page-breadcrumb svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.topbar-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
}

.topbar-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    background: var(--bg);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}

.user-menu:hover {
    background: var(--primary-light);
}

.user-menu .avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-menu .user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

/* Content */
.content {
    flex: 1;
    padding: 32px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Page Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content > * {
    animation: fadeInUp 0.4s ease forwards;
}

.content > *:nth-child(1) { animation-delay: 0s; }
.content > *:nth-child(2) { animation-delay: 0.1s; }
.content > *:nth-child(3) { animation-delay: 0.2s; }
.content > *:nth-child(4) { animation-delay: 0.3s; }
.content > *:nth-child(5) { animation-delay: 0.4s; }

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 500px;
    line-height: 1.6;
}

.page-header-actions {
    display: flex;
    gap: 12px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
    transition: all var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 svg {
    color: var(--primary);
}

.card-header .card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.card-body.p-0 {
    padding: 0;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* Card Variants */
.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-gradient {
    background: var(--primary-gradient);
    color: white;
    border: none;
}

.card-gradient .card-header {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.card-gradient h3,
.card-gradient p {
    color: white;
}

.card-hover-lift:hover {
    transform: translateY(-4px);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stats-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stats-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stats-5 {
    grid-template-columns: repeat(5, 1fr);
}

.stats-6 {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1400px) {
    .stats-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    .stats-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .stats-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.blue::before { background: var(--info-gradient); }
.stat-card.green::before { background: var(--success-gradient); }
.stat-card.purple::before { background: var(--primary-gradient); }
.stat-card.orange::before { background: var(--warning-gradient); }
.stat-card.red::before { background: var(--danger-gradient); }
.stat-card.cyan::before { background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon.blue { background: var(--info-gradient); }
.stat-icon.green { background: var(--success-gradient); }
.stat-icon.purple { background: var(--primary-gradient); }
.stat-icon.orange { background: var(--warning-gradient); }
.stat-icon.red { background: var(--danger-gradient); }
.stat-icon.cyan { background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%); }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--text);
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.stat-sub {
    font-size: 12px;
    margin-top: 4px;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    margin-top: 8px;
}

.stat-change.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-change.down {
    background: var(--danger-light);
    color: var(--danger);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid,
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.quick-action-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text);
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    text-decoration: none;
}

.quick-action-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.quick-action-icon.purple { background: var(--primary-gradient); }
.quick-action-icon.blue { background: var(--info-gradient); }
.quick-action-icon.green { background: var(--success-gradient); }
.quick-action-icon.orange { background: var(--warning-gradient); }

.quick-action-title {
    font-weight: 600;
    font-size: 15px;
}

.quick-action-desc {
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 1000px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--bg);
    position: sticky;
    top: 0;
}

.table tbody tr {
    transition: all var(--transition);
}

.table tbody tr:hover {
    background: linear-gradient(90deg, var(--primary-light) 0%, transparent 100%);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table td {
    font-size: 14px;
}

.table .cell-title {
    font-weight: 600;
    color: var(--text);
}

.table .cell-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.table-simple td {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.table-simple tr:last-child td {
    border-bottom: none;
}

/* Data Table with Row Actions */
.table-actions {
    display: flex;
    gap: 4px;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.table tbody tr:hover .table-actions {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(147, 51, 234, 0.5);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
}

.btn-warning {
    background: var(--warning-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
    transform: translateY(0);
}

.btn-ghost:hover::before {
    display: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 28px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group-attached {
    display: flex;
}

.btn-group-attached .btn {
    border-radius: 0;
}

.btn-group-attached .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group-attached .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Loading Button */
.btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50px;
    letter-spacing: 0.3px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: #059669;
}

.badge-warning {
    background: var(--warning-light);
    color: #d97706;
}

.badge-danger {
    background: var(--danger-light);
    color: #dc2626;
}

.badge-info {
    background: var(--info-light);
    color: #2563eb;
}

.badge-secondary {
    background: var(--bg);
    color: var(--text-muted);
}

/* Badge with pulse animation */
.badge-pulse {
    position: relative;
}

.badge-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    animation: pulse 2s ease-out infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Status indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.active::before {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.inactive::before {
    background: var(--text-light);
}

.status-indicator.warning::before {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.status-indicator.error::before {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

/* Progress */
.progress {
    height: 8px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.success { background: var(--success-gradient); }
.progress-bar.warning { background: var(--warning-gradient); }
.progress-bar.danger { background: var(--danger-gradient); }

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-wrapper .progress {
    flex: 1;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    min-width: 45px;
}

.progress-lg {
    height: 24px;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.progress-lg .progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

/* Circular Progress */
.progress-circle {
    position: relative;
    width: 60px;
    height: 60px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle .progress-bg {
    fill: none;
    stroke: var(--bg);
    stroke-width: 4;
}

.progress-circle .progress-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle .progress-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
}

.form-group label .required {
    color: var(--danger);
}

.form-group label .optional {
    color: var(--text-light);
    font-weight: 400;
    font-size: 12px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    transition: all var(--transition);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--text-light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-light);
}

.form-group textarea {
    resize: vertical;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    transition: all var(--transition);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.form-control:hover {
    border-color: var(--text-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-select {
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}

.form-select:hover {
    border-color: var(--text-light);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Input with icon */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper input {
    padding-left: 44px;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.input-icon-wrapper input:focus + .input-icon {
    color: var(--primary);
}

/* Input with addon */
.input-addon-wrapper {
    display: flex;
}

.input-addon {
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
}

.input-addon:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
}

.input-addon:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: none;
}

.input-addon-wrapper input {
    border-radius: 0;
}

.input-addon-wrapper input:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-addon-wrapper input:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    font-size: 14px;
    color: var(--text);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: var(--border);
    border-radius: 26px;
    transition: all var(--transition);
    position: relative;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-gradient);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 4px var(--primary-light);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.alert-info {
    background: linear-gradient(135deg, var(--info-light) 0%, #eff6ff 100%);
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-info::before {
    background: var(--info-gradient);
}

.alert-success {
    background: linear-gradient(135deg, var(--success-light) 0%, #f0fdf4 100%);
    color: #166534;
    border-color: #bbf7d0;
}

.alert-success::before {
    background: var(--success-gradient);
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-light) 0%, #fffbeb 100%);
    color: #92400e;
    border-color: #fde68a;
}

.alert-warning::before {
    background: var(--warning-gradient);
}

.alert-error {
    background: linear-gradient(135deg, var(--danger-light) 0%, #fef2f2 100%);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-error::before {
    background: var(--danger-gradient);
}

.alert-dismissible {
    padding-right: 48px;
}

.alert-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.6;
    transition: all var(--transition);
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.15);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--border) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
}

.empty-state p {
    margin-bottom: 24px;
    font-size: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.empty-state.small {
    padding: 50px 20px;
}

.empty-state.small .empty-state-icon {
    width: 70px;
    height: 70px;
}

.empty-state.small .empty-state-icon svg {
    width: 32px;
    height: 32px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 720px;
}

.modal-xl {
    max-width: 960px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h3 svg {
    color: var(--primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg);
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.modal-footer-left {
    margin-right: auto;
}

.modal-footer-right {
    display: flex;
    gap: 12px;
}

/* Toast */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    max-width: 450px;
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast.success::before { background: var(--success-gradient); }
.toast.error::before { background: var(--danger-gradient); }
.toast.warning::before { background: var(--warning-gradient); }
.toast.info::before { background: var(--info-gradient); }

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon { background: var(--success-light); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-light); color: var(--danger); }
.toast.warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast.info .toast-icon { background: var(--info-light); color: var(--info); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.toast-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg);
    color: var(--text);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress 4s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, transparent 50%);
    animation: loginBgMove 20s linear infinite;
}

@keyframes loginBgMove {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(147, 51, 234, 0.2);
    padding: 48px 40px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: var(--primary-gradient);
    border-radius: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(147, 51, 234, 0.4);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-logo svg {
    color: white;
    width: 44px;
    height: 44px;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.login-header p {
    color: var(--text-muted);
    font-size: 15px;
}

.login-form {
    margin-bottom: 24px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    margin-top: 12px;
    height: 50px;
    font-size: 16px;
}

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-footer code {
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    margin: 0 2px;
}

/* Preview */
.preview-subject {
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.preview-body {
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.info-value {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Sending Progress */
.sending-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.sending-stats strong {
    color: var(--text);
    font-size: 16px;
}

.sending-log {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    border: 1px solid var(--border);
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 6px;
    gap: 12px;
    transition: all var(--transition);
}

.log-entry:hover {
    transform: translateX(4px);
}

.log-entry.success {
    background: linear-gradient(135deg, var(--success-light) 0%, transparent 100%);
    border-left: 3px solid var(--success);
}

.log-entry.error {
    background: linear-gradient(135deg, var(--danger-light) 0%, transparent 100%);
    border-left: 3px solid var(--danger);
}

.log-entry.pending {
    background: linear-gradient(135deg, var(--warning-light) 0%, transparent 100%);
    border-left: 3px solid var(--warning);
}

.log-entry-email {
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.log-entry-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-entry.success .log-entry-status { color: var(--success); }
.log-entry.error .log-entry-status { color: var(--danger); }
.log-entry.pending .log-entry-status { color: var(--warning); }

.log-entry-time {
    color: var(--text-light);
    font-size: 11px;
}

/* Text Utilities */
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-primary { color: var(--primary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

/* Display Utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }

/* Flex Utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.align-start { align-items: flex-start; }
.align-end { align-items: flex-end; }
.align-center { align-items: center; }
.align-stretch { align-items: stretch; }
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-none { flex: none; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* Spacing Utilities */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-4 { margin-left: 16px; }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mr-4 { margin-right: 16px; }
.mr-auto { margin-right: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

.pt-0 { padding-top: 0; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }

.pb-0 { padding-bottom: 0; }
.pb-2 { padding-bottom: 8px; }
.pb-3 { padding-bottom: 12px; }
.pb-4 { padding-bottom: 16px; }

.px-0 { padding-left: 0; padding-right: 0; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

/* Width & Height */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }

/* Border Utilities */
.border { border: 1px solid var(--border); }
.border-0 { border: none; }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Transitions */
.transition { transition: all var(--transition); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

@media (max-width: 1000px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section-title svg {
    color: var(--primary);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-info {
    flex: 1;
}

.settings-item-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.settings-item-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.settings-item-control {
    flex-shrink: 0;
    margin-left: 24px;
}

/* Logs */
.log-level {
    font-weight: 700;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-level.INFO { background: var(--info-light); color: var(--info); }
.log-level.ERROR { background: var(--danger-light); color: var(--danger); }
.log-level.WARNING { background: var(--warning-light); color: var(--warning); }
.log-level.DEBUG { background: var(--bg); color: var(--text-muted); }
.log-level.SUCCESS { background: var(--success-light); color: var(--success); }

.log-message {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.log-context {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', monospace;
    max-height: 100px;
    overflow: auto;
}

/* Quick Send */
.send-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 28px;
}

@media (max-width: 1100px) {
    .send-grid {
        grid-template-columns: 1fr;
    }
}

.result-log {
    max-height: 350px;
    overflow-y: auto;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.result-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: all var(--transition);
}

.result-entry:hover {
    transform: translateX(4px);
}

.result-entry.success {
    border-left: 4px solid var(--success);
}

.result-entry.error {
    border-left: 4px solid var(--danger);
}

.result-entry.pending {
    border-left: 4px solid var(--warning);
}

.result-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-entry.success .result-icon {
    background: var(--success-light);
    color: var(--success);
}

.result-entry.error .result-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-email {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-message {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.result-time {
    font-size: 11px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* Preview */
.preview-subject {
    padding: 16px 20px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    border: 1px solid var(--border);
}

.preview-body {
    padding: 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    min-height: 250px;
    max-height: 500px;
    overflow: auto;
    border: 1px solid var(--border);
    line-height: 1.6;
}

.preview-frame {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.preview-frame-header {
    background: var(--bg);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-frame-dots {
    display: flex;
    gap: 6px;
}

.preview-frame-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

.preview-frame-dots span:nth-child(1) { background: #ef4444; }
.preview-frame-dots span:nth-child(2) { background: #f59e0b; }
.preview-frame-dots span:nth-child(3) { background: #22c55e; }

.preview-frame-content {
    padding: 24px;
    max-height: 400px;
    overflow: auto;
}

/* Spintax Highlight */
.spintax-highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 2px 6px;
    border-radius: 4px;
    color: #92400e;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

/* Template Variables */
.template-vars {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.template-var {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.template-var:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.template-var code {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

/* Campaign Status Timeline */
.campaign-timeline {
    position: relative;
    padding-left: 32px;
}

.campaign-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-dot.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.timeline-dot.completed {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.timeline-dot.error {
    border-color: var(--danger);
    background: var(--danger);
    color: white;
}

.timeline-content {
    padding-left: 8px;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* SMTP Card */
.smtp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.smtp-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.smtp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.smtp-card-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.smtp-card-host {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.smtp-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.smtp-stat {
    text-align: center;
}

.smtp-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.smtp-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 14px;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Charts placeholder */
.chart-container {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius);
    color: var(--text-muted);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-card {
    height: 120px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
        position: fixed;
        z-index: 1000;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
        width: 100%;
    }
    
    .content {
        padding: 20px;
    }
    
    .topbar {
        padding: 0 20px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .page-header-actions {
        width: 100%;
    }
    
    .page-header-actions .btn {
        flex: 1;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    /* Overlay for mobile sidebar */
    .sidebar-overlay.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: all var(--transition);
}

.theme-toggle:hover svg {
    color: var(--primary);
}

.theme-toggle .theme-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Theme Dropdown */
.theme-dropdown {
    position: relative;
}

.theme-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: 100;
}

.theme-dropdown.active .theme-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text);
}

.theme-dropdown-item:first-child {
    border-radius: var(--radius) var(--radius) 0 0;
}

.theme-dropdown-item:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.theme-dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.theme-dropdown-item.active {
    background: var(--primary);
    color: white;
}

.theme-dropdown-item svg {
    width: 18px;
    height: 18px;
}

/* Real-time Monitoring Dashboard */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .monitoring-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .monitoring-grid {
        grid-template-columns: 1fr;
    }
}

.monitor-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.monitor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.monitor-card.speed::before { background: var(--primary-gradient); }
.monitor-card.sent::before { background: var(--success-gradient); }
.monitor-card.failed::before { background: var(--danger-gradient); }
.monitor-card.queue::before { background: var(--warning-gradient); }

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.monitor-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.monitor-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.monitor-card.speed .monitor-icon { background: var(--primary-gradient); }
.monitor-card.sent .monitor-icon { background: var(--success-gradient); }
.monitor-card.failed .monitor-icon { background: var(--danger-gradient); }
.monitor-card.queue .monitor-icon { background: var(--warning-gradient); }

.monitor-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    margin-bottom: 4px;
}

.monitor-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.monitor-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 50px;
}

.monitor-trend.up {
    background: var(--success-light);
    color: var(--success);
}

.monitor-trend.down {
    background: var(--danger-light);
    color: var(--danger);
}

/* Speed Chart */
.speed-chart-container {
    height: 200px;
    position: relative;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.speed-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 4px;
}

.speed-bar {
    flex: 1;
    background: var(--primary-gradient);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
    position: relative;
}

.speed-bar:hover {
    opacity: 0.8;
}

.speed-bar::after {
    content: attr(data-value);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    padding-bottom: 4px;
}

.speed-bar:hover::after {
    opacity: 1;
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: var(--text-light);
}

/* Live Activity Feed */
.live-feed {
    max-height: 400px;
    overflow-y: auto;
}

.live-feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.live-feed-item:hover {
    background: var(--bg);
}

.live-feed-item:last-child {
    border-bottom: none;
}

.live-feed-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.live-feed-item.success .live-feed-icon {
    background: var(--success-light);
    color: var(--success);
}

.live-feed-item.error .live-feed-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.live-feed-item.pending .live-feed-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.live-feed-content {
    flex: 1;
    min-width: 0;
}

.live-feed-email {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-feed-message {
    font-size: 12px;
    color: var(--text-muted);
}

.live-feed-time {
    font-size: 11px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* IMAP Section Styles */
.imap-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.imap-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.imap-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.imap-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.imap-status.connected {
    color: var(--success);
}

.imap-status.disconnected {
    color: var(--danger);
}

.imap-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.imap-status.connected::before {
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

/* Inbox Test Card */
.inbox-test-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.inbox-test-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.inbox-test-card svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.inbox-test-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.inbox-test-card p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Inbox Placement Results */
.inbox-result {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.inbox-result-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inbox-result.inbox .inbox-result-icon {
    background: var(--success-light);
    color: var(--success);
}

.inbox-result.spam .inbox-result-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.inbox-result.promotions .inbox-result-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.inbox-result.not-found .inbox-result-icon {
    background: var(--bg);
    color: var(--text-light);
}

.inbox-result-content {
    flex: 1;
}

.inbox-result-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.inbox-result-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.inbox-result-badge {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inbox-result.inbox .inbox-result-badge {
    background: var(--success-light);
    color: var(--success);
}

.inbox-result.spam .inbox-result-badge {
    background: var(--danger-light);
    color: var(--danger);
}

.inbox-result.promotions .inbox-result-badge {
    background: var(--warning-light);
    color: var(--warning);
}

.inbox-result.not-found .inbox-result-badge {
    background: var(--bg);
    color: var(--text-muted);
}

/* SMTP Tester */
.smtp-tester-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .smtp-tester-grid {
        grid-template-columns: 1fr;
    }
}

.test-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg);
    margin-bottom: 12px;
}

.test-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    transition: all var(--transition);
}

.test-step.active .test-step-number {
    background: var(--primary-gradient);
    color: white;
}

.test-step.completed .test-step-number {
    background: var(--success-gradient);
    color: white;
}

.test-step.error .test-step-number {
    background: var(--danger-gradient);
    color: white;
}

.test-step-content {
    flex: 1;
}

.test-step-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.test-step-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.test-step-status {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.test-step.completed .test-step-status {
    color: var(--success);
}

.test-step.error .test-step-status {
    color: var(--danger);
}

/* Pulsing animation for active elements */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.pulse-indicator {
    position: relative;
}

.pulse-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--success);
    transform: translate(-50%, -50%);
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Spinning animation for loading indicators */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Background task indicator */
.bg-task-indicator {
    position: relative;
}

.bg-task-indicator .task-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--success);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Print Styles */
@media print {
    .sidebar,
    .topbar,
    .btn,
    .pagination {
        display: none !important;
    }
    
    .main {
        margin-left: 0 !important;
    }
    
    .content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
/* ==========================================
   CAMPAIGNS PAGE - ENHANCED STYLES
   ========================================== */

/* Campaign Stats Cards */
.campaign-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .campaign-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .campaign-stats {
        grid-template-columns: 1fr;
    }
}

.campaign-stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.campaign-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.campaign-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.campaign-stat-card:hover::before {
    opacity: 1;
}

.campaign-stat-card.total::before { background: var(--primary-gradient); }
.campaign-stat-card.running::before { background: var(--warning-gradient); }
.campaign-stat-card.completed::before { background: var(--success-gradient); }
.campaign-stat-card.draft::before { background: var(--info-gradient); }

.campaign-stat-card .stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.campaign-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.campaign-stat-card.total .stat-icon { background: var(--primary-gradient); }
.campaign-stat-card.running .stat-icon { background: var(--warning-gradient); }
.campaign-stat-card.completed .stat-icon { background: var(--success-gradient); }
.campaign-stat-card.draft .stat-icon { background: var(--info-gradient); }

.campaign-stat-card .stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.campaign-stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Campaign Cards Grid View */
.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 500px) {
    .campaigns-grid {
        grid-template-columns: 1fr;
    }
}

.campaign-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: var(--primary);
}

.campaign-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.campaign-card.status-draft::before { background: var(--info-gradient); }
.campaign-card.status-running::before { background: var(--warning-gradient); }
.campaign-card.status-paused::before { background: var(--primary-gradient); }
.campaign-card.status-completed::before { background: var(--success-gradient); }
.campaign-card.status-stopped::before { background: var(--danger-gradient); }

.campaign-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.campaign-card-title {
    flex: 1;
}

.campaign-card-title h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.campaign-card-title .campaign-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.campaign-card-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.draft {
    background: var(--info-light);
    color: var(--info);
}

.status-badge.running {
    background: var(--warning-light);
    color: #b45309;
    position: relative;
}

.status-badge.running::before {
    content: '';
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-badge.paused {
    background: var(--primary-light);
    color: var(--primary);
}

.status-badge.completed {
    background: var(--success-light);
    color: #059669;
}

.status-badge.stopped {
    background: var(--danger-light);
    color: #dc2626;
}

.campaign-card-body {
    padding: 20px 24px;
}

.campaign-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.campaign-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.campaign-info-item .info-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.campaign-info-item .info-content {
    flex: 1;
    min-width: 0;
}

.campaign-info-item .info-label {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.campaign-info-item .info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Campaign Progress Section */
.campaign-progress-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.campaign-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.campaign-progress-header .progress-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campaign-progress-header .progress-percent {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.campaign-progress-bar {
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.campaign-progress-bar .progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.campaign-progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: progressShine 2s infinite;
}

.campaign-progress-bar .progress-fill.draft { background: var(--info-gradient); }
.campaign-progress-bar .progress-fill.running { background: var(--warning-gradient); }
.campaign-progress-bar .progress-fill.paused { background: var(--primary-gradient); }
.campaign-progress-bar .progress-fill.completed { background: var(--success-gradient); }
.campaign-progress-bar .progress-fill.stopped { background: var(--danger-gradient); }

/* Campaign Stats Row */
.campaign-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
}

.campaign-stat-item {
    text-align: center;
    flex: 1;
}

.campaign-stat-item .stat-number {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.campaign-stat-item .stat-number.sent { color: var(--success); }
.campaign-stat-item .stat-number.failed { color: var(--danger); }
.campaign-stat-item .stat-number.pending { color: var(--warning); }

.campaign-stat-item .stat-text {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Campaign Card Footer/Actions */
.campaign-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-card) 100%);
}

.campaign-actions {
    display: flex;
    gap: 8px;
}

.campaign-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.campaign-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.campaign-action-btn.start:hover {
    border-color: var(--success);
    background: var(--success-light);
    color: var(--success);
}

.campaign-action-btn.pause:hover {
    border-color: var(--warning);
    background: var(--warning-light);
    color: var(--warning);
}

.campaign-action-btn.delete:hover {
    border-color: var(--danger);
    background: var(--danger-light);
    color: var(--danger);
}

/* View Toggle Buttons */
.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.view-toggle-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius) - 4px);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.view-toggle-btn:hover {
    color: var(--text);
}

.view-toggle-btn.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Campaign Filter Bar */
.campaign-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Search Box */
.campaign-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.campaign-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--bg-card);
    font-size: 13px;
    color: var(--text);
    transition: all var(--transition);
}

.campaign-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.campaign-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* Enhanced Empty State */
.campaigns-empty-state {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border);
    margin: 24px 0;
}

.campaigns-empty-state .empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.3);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.campaigns-empty-state .empty-icon svg {
    width: 56px;
    height: 56px;
    color: white;
}

.campaigns-empty-state h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

.campaigns-empty-state p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 32px;
}

/* Quick Stats Banner */
.quick-stats-banner {
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.quick-stats-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.quick-stats-banner .banner-content {
    position: relative;
    z-index: 1;
}

.quick-stats-banner h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.quick-stats-banner p {
    opacity: 0.9;
    font-size: 14px;
}

.quick-stats-banner .banner-stats {
    display: flex;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.quick-stats-banner .banner-stat-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.quick-stats-banner .banner-stat-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
}

/* Running Campaign Animation */
.campaign-card.status-running {
    animation: runningGlow 2s ease-in-out infinite;
}

@keyframes runningGlow {
    0%, 100% { box-shadow: var(--shadow); }
    50% { box-shadow: var(--shadow), 0 0 20px rgba(245, 158, 11, 0.2); }
}

/* Background Tasks Button Styles */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.badge-count {
    min-width: 16px;
    height: 16px;
    background: var(--warning);
    color: #000;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -2px;
    right: -2px;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
}

.badge-dot[style*="animation"] {
    box-shadow: 0 0 0 0 var(--success);
}

/* Modal Container - shared styles for new modal format */
.modal-container {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-container .modal-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

/* Background Task Card Styles */
.bg-task-section {
    margin-bottom: 16px;
}

.bg-task-section .card {
    border: 1px solid var(--border);
    margin-bottom: 0;
}

.bg-task-progress {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.bg-task-progress .progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Spinning loader for background tasks */
.loading-spinner svg.spin {
    animation: spin 1s linear infinite;
}

/* SMTP Mode Selector Styles */
.smtp-mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .smtp-mode-selector {
        grid-template-columns: 1fr;
    }
}

.smtp-mode-option {
    cursor: pointer;
    margin: 0;
}

.smtp-mode-option input[type="radio"] {
    display: none;
}

.smtp-mode-option .mode-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: all var(--transition);
}

.smtp-mode-option:hover .mode-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.smtp-mode-option.active .mode-card {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.1);
}

.smtp-mode-option .mode-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
    flex-shrink: 0;
}

.smtp-mode-option:hover .mode-icon,
.smtp-mode-option.active .mode-icon {
    background: var(--primary);
    color: white;
}

.smtp-mode-option .mode-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smtp-mode-option .mode-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.smtp-mode-option .mode-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* SMTP Badge in Table */
.smtp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    max-width: 150px;
}

.smtp-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smtp-badge.single {
    background: var(--info-light);
    color: var(--info);
}

.smtp-badge.group {
    background: var(--primary-light);
    color: var(--primary);
}

.smtp-badge.rotation {
    background: var(--success-light);
    color: var(--success);
}

.smtp-badge svg {
    flex-shrink: 0;
}

/* FIX: Ensure modal and overlays don't block page when not active */
.modal:not(.active) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.modal:not(.active) .modal-backdrop {
    display: none !important;
    pointer-events: none !important;
}

.sidebar-overlay:not(.active) {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Ensure form inputs are always interactive */
.form-group input,
.form-group select,
.form-group textarea,
.form-control,
.form-select,
button,
.btn {
    position: relative;
    z-index: 1;
}

/* Ensure modals are properly layered */
.modal.active {
    display: flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.modal.active .modal-backdrop {
    pointer-events: auto !important;
}

.modal.active .modal-content {
    pointer-events: auto !important;
    z-index: 1001 !important;
}

/* ==========================================
   SMTP PAGE - FILTER BAR & ENHANCED STYLES
   ========================================== */

/* SMTP Card Header - Enhanced */
.smtp-card-header {
    flex-wrap: wrap;
}

/* Card Filter Bar - New Component */
.card-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}

.filter-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.filter-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    min-width: 200px;
    max-width: 280px;
}

.search-input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    transition: color var(--transition);
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg-card);
    font-size: 13px;
    color: var(--text);
    transition: all var(--transition);
}

.search-input:hover {
    border-color: var(--text-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-input:focus + svg,
.search-input-wrapper:focus-within svg {
    color: var(--primary);
}

/* Filter Select */
.filter-select-wrapper {
    position: relative;
}

.filter-select {
    padding: 10px 36px 10px 16px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 140px;
}

.filter-select:hover {
    border-color: var(--text-light);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Selected Count Badge */
.selected-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--primary-light);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

/* Progress Cell for Tables */
.progress-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar-mini {
    width: 60px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-mini .progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Table Checkbox Styling */
.table th input[type="checkbox"],
.table td input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Import Progress Section */
.progress-section {
    margin-top: 20px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.import-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Button Group Vertical */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-group-vertical .btn {
    width: 100%;
    justify-content: flex-start;
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Row Actions on Hover */
.table tbody tr .table-actions {
    opacity: 0.5;
    transition: opacity var(--transition);
}

.table tbody tr:hover .table-actions {
    opacity: 1;
}

/* Analytics Modal Content */
#analyticsContent .stats-grid {
    margin-bottom: 24px;
}

#analyticsContent .row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

#analyticsContent .col-md-6 {
    flex: 1;
}

#analyticsContent h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

#analyticsContent p {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

#analyticsContent p strong {
    color: var(--text);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-bar-left,
    .filter-bar-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .search-input-wrapper {
        max-width: none;
        width: 100%;
    }
    
    .filter-select {
        flex: 1;
    }
}

@media (ma
