/**
 * ProjectFlow CRM - Premium SaaS Stylesheet
 * 
 * Design inspired by Stripe, Linear, Notion, Vercel
 * Clean, modern, minimal aesthetic
 */

/* ========================================
   CSS Variables / Theme
   ======================================== */
:root {
    /* Colors - Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --accent-primary: #1a1a2e;
    --accent-secondary: #4f46e5;
    --accent-hover: #4338ca;
    
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;
    
    /* Borders & Shadows */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-hover: #475569;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --text-inverse: #0f172a;
    
    --border-color: #334155;
    --border-light: #1e293b;
    
    --accent-primary: #818cf8;
    --accent-secondary: #6366f1;
    --accent-hover: #818cf8;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ========================================
   Authentication Pages
   ======================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2xl);
    border: 1px solid var(--border-color);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.auth-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.auth-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.demo-credentials {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.demo-credentials strong {
    color: var(--text-secondary);
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.25rem;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

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

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: var(--text-xs);
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: var(--text-base);
}

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

/* ========================================
   Alerts - Modern Professional Design
   ======================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

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

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

.alert-title {
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: 2px;
}

.alert-message {
    font-size: var(--text-sm);
    line-height: 1.5;
    opacity: 0.9;
}

/* Success Alert */
.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}

[data-theme="dark"] .alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: #6ee7b7;
}

.alert-success::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.alert-success svg {
    color: #10b981;
}

/* Error Alert */
.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.03) 100%);
    border-color: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

[data-theme="dark"] .alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: #fca5a5;
}

.alert-error::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.alert-error svg {
    color: #ef4444;
}

/* Warning Alert */
.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%);
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

[data-theme="dark"] .alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: #fcd34d;
}

.alert-warning::before {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.alert-warning svg {
    color: #f59e0b;
}

/* Info Alert */
.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

[data-theme="dark"] .alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: #93c5fd;
}

.alert-info::before {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.alert-info svg {
    color: #3b82f6;
}

/* Alert Close Button */
.alert-close {
    margin-left: auto;
    padding: var(--space-xs);
    font-size: var(--text-lg);
    line-height: 1;
    opacity: 0.5;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

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

[data-theme="dark"] .alert-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Flash Message Animation */
.flash-message {
    position: relative;
    animation: alertSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert with Icon Wrapper */
.alert-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-success .alert-icon-wrap {
    background: rgba(16, 185, 129, 0.15);
}

.alert-error .alert-icon-wrap {
    background: rgba(239, 68, 68, 0.15);
}

.alert-warning .alert-icon-wrap {
    background: rgba(245, 158, 11, 0.15);
}

.alert-info .alert-icon-wrap {
    background: rgba(59, 130, 246, 0.15);
}

/* Compact Alert */
.alert-compact {
    padding: var(--space-sm) var(--space-md);
}

.alert-compact .alert-icon-wrap {
    width: 28px;
    height: 28px;
}

/* Alert with Progress (auto-dismiss) */
.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: alertProgress 5s linear forwards;
}

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

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

/* ========================================
   Dashboard Layout
   ======================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-text {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.625rem var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
}

.nav-link svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 50;
}

.mobile-menu-btn {
    display: none;
    padding: var(--space-sm);
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-left: auto;
}

.theme-toggle {
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="light"] .moon-icon,
[data-theme="dark"] .sun-icon {
    display: none;
}

/* ========================================
   Dark Mode Toggle Compact (Sidebar)
   ======================================== */
.theme-toggle-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.theme-toggle-compact:hover {
    background: var(--bg-secondary);
}

.theme-toggle-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
}

.theme-toggle-left .theme-icon-sun {
    color: #f59e0b;
}

.theme-toggle-left .theme-icon-moon {
    display: none;
    color: #6366f1;
}

.theme-toggle-left .dark-label {
    display: none;
}

[data-theme="dark"] .theme-toggle-left .theme-icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle-left .theme-icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle-left .light-label {
    display: none;
}

[data-theme="dark"] .theme-toggle-left .dark-label {
    display: inline;
}

.toggle-switch-mini {
    width: 36px;
    height: 20px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .toggle-switch-mini {
    background: var(--primary);
}

.toggle-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

[data-theme="dark"] .toggle-switch-thumb {
    left: 18px;
}

.theme-toggle-compact:hover .toggle-switch-mini {
    background: var(--text-tertiary);
}

[data-theme="dark"] .theme-toggle-compact:hover .toggle-switch-mini {
    background: var(--primary-dark, #4338ca);
}

[data-theme="light"] .sun-icon,
[data-theme="dark"] .moon-icon {
    display: block;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: var(--space-xl);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.page-header p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.page-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ========================================
   Stats Cards
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

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

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

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all var(--transition-fast);
}

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

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

.stat-icon.blue {
    background: var(--info-bg);
    color: var(--info);
}

.stat-icon.amber {
    background: var(--warning-bg);
    color: var(--warning);
}

.stat-icon.purple {
    background: #ede9fe;
    color: #8b5cf6;
}

.stat-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ========================================
   Tables
   ======================================== */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-secondary);
}

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

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table td {
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* ========================================
   Status Badge
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: capitalize;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.status-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* Waiting for Client - Orange/Amber */
.status-waiting_for_client,
.status-badge.status-waiting_for_client {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.15));
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-waiting_for_client::before,
.status-badge.status-waiting_for_client::before {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

/* In Progress - Blue */
.status-in_progress,
.status-badge.status-in_progress {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(96, 165, 250, 0.15));
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-in_progress::before,
.status-badge.status-in_progress::before {
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

/* Review - Purple */
.status-review,
.status-badge.status-review {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(167, 139, 250, 0.15));
    color: #6d28d9;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-review::before,
.status-badge.status-review::before {
    background: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* Completed - Green */
.status-completed,
.status-badge.status-completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.15));
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-completed::before,
.status-badge.status-completed::before {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* New - Indigo */
.status-new,
.status-badge.status-new {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(129, 140, 248, 0.15));
    color: #4338ca;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.status-new::before,
.status-badge.status-new::before {
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

/* On Hold - Gray */
.status-on_hold,
.status-badge.status-on_hold {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.15), rgba(156, 163, 175, 0.15));
    color: #374151;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.status-on_hold::before,
.status-badge.status-on_hold::before {
    background: #6b7280;
    box-shadow: 0 0 8px rgba(107, 114, 128, 0.5);
}

/* Cancelled - Red */
.status-cancelled,
.status-badge.status-cancelled {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.15));
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-cancelled::before,
.status-badge.status-cancelled::before {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Pulse animation for active statuses */
@keyframes statusPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(0.9);
    }
}

/* Dark mode adjustments for status badges */
[data-theme="dark"] .status-waiting_for_client,
[data-theme="dark"] .status-badge.status-waiting_for_client {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.2));
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .status-in_progress,
[data-theme="dark"] .status-badge.status-in_progress {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(96, 165, 250, 0.2));
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .status-review,
[data-theme="dark"] .status-badge.status-review {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(167, 139, 250, 0.2));
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] .status-completed,
[data-theme="dark"] .status-badge.status-completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.2));
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .status-new,
[data-theme="dark"] .status-badge.status-new {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(129, 140, 248, 0.2));
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .status-on_hold,
[data-theme="dark"] .status-badge.status-on_hold {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(156, 163, 175, 0.2));
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.4);
}

[data-theme="dark"] .status-cancelled,
[data-theme="dark"] .status-badge.status-cancelled {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(248, 113, 113, 0.2));
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ========================================
   Progress Bar
   ======================================== */
.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary), var(--success));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-text {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* ========================================
   Project Cards
   ======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.project-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--accent-secondary);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.project-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.project-card-email {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.project-card-meta span {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    color: var(--text-tertiary);
}

.empty-state h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-lg);
}

/* ========================================
   Onboarding Link Box
   ======================================== */
.onboarding-link-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.onboarding-link-box input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.5rem 1rem;
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--accent-secondary);
}

.copy-btn.copied {
    background: var(--success);
}

/* ========================================
   File Upload
   ======================================== */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
    border-color: var(--accent-secondary);
    background: rgba(79, 70, 229, 0.05);
}

.file-upload-zone input[type="file"] {
    display: none;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    color: var(--text-tertiary);
}

.file-upload-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.file-upload-text strong {
    color: var(--accent-secondary);
}

.file-upload-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-sm);
}

.file-list {
    margin-top: var(--space-lg);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.file-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

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

.file-item-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.file-item-remove {
    padding: var(--space-sm);
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.file-item-remove:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* ========================================
   Activity Timeline
   ======================================== */
.timeline {
    position: relative;
    padding-left: var(--space-xl);
}

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

.timeline-item {
    position: relative;
    padding-bottom: var(--space-lg);
}

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

.timeline-dot {
    position: absolute;
    left: calc(-1 * var(--space-xl) + 4px);
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-secondary);
    border: 2px solid var(--bg-primary);
}

.timeline-content {
    font-size: var(--text-sm);
}

.timeline-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.timeline-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ========================================
   Search & Filters
   ======================================== */
.search-box {
    position: relative;
    max-width: 320px;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-size: var(--text-sm);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.filter-tabs {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    background: var(--bg-tertiary);
}

.filter-tab.active {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   Client Onboarding Page
   ======================================== */
.client-page {
    min-height: 100vh;
    background: var(--bg-secondary);
    padding: var(--space-xl);
}

.client-container {
    max-width: 720px;
    margin: 0 auto;
}

.client-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.client-header .logo {
    display: inline-flex;
    margin-bottom: var(--space-lg);
}

.client-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.client-header p {
    color: var(--text-secondary);
}

.client-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2xl);
}

.client-success {
    text-align: center;
    padding: var(--space-2xl);
}

.client-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: var(--success-bg);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Detail View
   ======================================== */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
}

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

.detail-section {
    margin-bottom: var(--space-xl);
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.detail-row {
    display: flex;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 140px;
    flex-shrink: 0;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.detail-value {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

.modal-close {
    padding: var(--space-sm);
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .page-content {
        padding: var(--space-md);
    }
    
    .page-header-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: none;
    }
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--text-tertiary); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.hidden { display: none; }

/* ========================================
   Multi-Step Wizard Styles
   ======================================== */

.wizard-container {
    max-width: 700px;
    padding: var(--space-xl) var(--space-md);
}

.wizard-card {
    padding: var(--space-xl);
}

.wizard-progress {
    margin-bottom: var(--space-xl);
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
    position: relative;
}

.progress-step.active {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed {
    background: var(--success);
    color: white;
}

.progress-step.completed span {
    display: none;
}

.progress-step.completed::after {
    content: '✓';
    font-size: 14px;
}

/* Welcome Step */
.step-welcome {
    text-align: center;
    padding: var(--space-xl) 0;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    color: white;
}

.step-welcome h1 {
    font-size: 28px;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.welcome-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.welcome-text {
    color: var(--text-tertiary);
    max-width: 450px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.welcome-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

.welcome-features .feature {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
}

.welcome-features .feature svg {
    color: var(--success);
}

/* Step Content */
.step-content h2 {
    font-size: 24px;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.step-desc {
    color: var(--text-tertiary);
    margin-bottom: var(--space-xl);
}

/* Domain Options */
.domain-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.option-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

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

.option-card.selected {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.05);
}

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

.option-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.option-card.selected .option-icon {
    background: var(--accent-primary);
    color: white;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-content strong {
    font-size: var(--text-base);
    color: var(--text-primary);
}

.option-content span {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-md);
}

.info-box svg {
    flex-shrink: 0;
    color: #3b82f6;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--text-sm);
}

.checkbox-item:hover {
    background: var(--bg-secondary);
}

.checkbox-item input:checked + .checkbox-item,
.checkbox-item:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.05);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

/* File Preview */
.file-preview {
    margin-top: var(--space-sm);
}

.file-preview .file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
}

.file-preview .file-name {
    font-size: var(--text-sm);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview button {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 20px;
    padding: 0 var(--space-xs);
}

.file-preview button:hover {
    color: var(--error);
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.wizard-nav .btn {
    min-width: 120px;
}

/* Client Error State */
.client-error {
    text-align: center;
    padding: var(--space-xl);
}

.client-error .error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--error-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    color: var(--error);
}

.client-error h2 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.client-error p {
    color: var(--text-tertiary);
}

/* Responsive Wizard */
@media (max-width: 640px) {
    .wizard-card {
        padding: var(--space-lg);
    }
    
    .progress-step {
        width: 28px;
        height: 28px;
        font-size: var(--text-xs);
    }
    
    .step-welcome h1 {
        font-size: 22px;
    }
    
    .welcome-icon {
        width: 80px;
        height: 80px;
    }
    
    .welcome-features {
        flex-direction: column;
        align-items: center;
    }
    
    .option-card {
        padding: var(--space-md);
    }
    
    .option-icon {
        width: 44px;
        height: 44px;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .wizard-nav {
        flex-direction: column-reverse;
        gap: var(--space-sm);
    }
    
    .wizard-nav .btn {
        width: 100%;
    }
}

/* Feature Tags */
.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.feature-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 500;
}

/* File Input Styling */
.file-input {
    width: 100%;
    padding: var(--space-sm);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-input:hover {
    border-color: var(--accent-secondary);
    background: var(--bg-tertiary);
}

.file-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Online Status Indicators */
.user-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.online-indicator.online {
    background: var(--success);
}

.online-indicator.offline {
    background: var(--text-tertiary);
}

.online-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.online-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
}

.offline-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ========================================
   Discussion System Styles
   ======================================== */

.discussion-form {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-lg);
}

.discussion-input-wrapper {
    display: flex;
    gap: var(--space-md);
}

.discussion-input-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.discussion-input-box textarea {
    resize: vertical;
    min-height: 60px;
}

.discussion-input-box button {
    align-self: flex-end;
}

.discussion-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.discussion-item {
    display: flex;
    gap: var(--space-md);
}

.discussion-item.reply {
    margin-left: var(--space-xl);
    padding-left: var(--space-md);
    border-left: 2px solid var(--border-color);
}

.discussion-avatar {
    flex-shrink: 0;
}

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

.discussion-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
}

.discussion-author {
    font-weight: 600;
    color: var(--text-primary);
}

.discussion-role {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.discussion-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.discussion-message {
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
}

.discussion-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: var(--text-sm);
    padding: 0;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: var(--text-primary);
}

.btn-link.text-error {
    color: var(--error);
}

.btn-link.text-error:hover {
    color: #dc2626;
}

.reply-form {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.reply-form textarea {
    width: 100%;
    margin-bottom: var(--space-sm);
    resize: vertical;
    min-height: 60px;
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.discussion-replies {
    margin-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.py-lg {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
}

/* Responsive discussions */
@media (max-width: 640px) {
    .discussion-item.reply {
        margin-left: var(--space-md);
    }
    
    .discussion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ========================================
   Mentions & Attachments Styles
   ======================================== */

/* Mention wrapper */
.mention-wrapper {
    position: relative;
    flex: 1;
}

/* Mention dropdown */
.mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    margin-bottom: 4px;
}

.mention-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background 0.15s ease;
}

.mention-item:hover {
    background: var(--bg-secondary);
}

.mention-name {
    font-weight: 500;
    color: var(--text-primary);
}

.mention-role {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: capitalize;
}

/* Highlighted mention in message */
.mention {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-secondary);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* Discussion input actions */
.discussion-input-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Attachment button */
.attachment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.attachment-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* File name display */
.file-name-display {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Discussion attachment display */
.discussion-attachment {
    margin-top: var(--space-sm);
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all 0.2s ease;
}

.attachment-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.attachment-link svg {
    flex-shrink: 0;
}

.attachment-size {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* Reply form with attachment */
.reply-form .discussion-input-actions {
    margin-top: var(--space-sm);
    justify-content: space-between;
}

.reply-form .attachment-btn {
    width: 32px;
    height: 32px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .discussion-input-actions {
        flex-wrap: wrap;
    }
    
    .file-name-display {
        width: 100%;
        order: -1;
        margin-bottom: var(--space-xs);
    }
}

/* ========================================
   Image Preview & Edit Comment Styles
   ======================================== */

/* Image attachment preview */
.attachment-image-link {
    display: inline-block;
    margin-top: var(--space-sm);
}

.attachment-image-preview {
    max-width: 300px;
    max-height: 200px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    object-fit: cover;
}

.attachment-image-preview:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

/* Edit form styles */
.edit-form {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.edit-form textarea {
    width: 100%;
    margin-bottom: var(--space-sm);
    resize: vertical;
    min-height: 80px;
}

.edit-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* Edited indicator */
.discussion-actions .text-xs {
    margin-left: var(--space-xs);
    font-style: italic;
}

/* Lightbox effect for images (optional - click to view full size) */
.attachment-image-link:focus .attachment-image-preview,
.attachment-image-link:active .attachment-image-preview {
    transform: scale(1);
}

/* Reply images smaller */
.discussion-item.reply .attachment-image-preview {
    max-width: 200px;
    max-height: 150px;
}

/* Mobile responsive images */
@media (max-width: 640px) {
    .attachment-image-preview {
        max-width: 100%;
        max-height: 150px;
    }
    
    .discussion-item.reply .attachment-image-preview {
        max-width: 100%;
        max-height: 120px;
    }
}

/* ========================================
   Sidebar User Info at Top
   ======================================== */

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    margin: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-user-info .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-user-info .user-details {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info .user-name {
    display: block;
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info .user-email {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--accent-primary);
    color: white;
    flex-shrink: 0;
}

/* Sidebar Footer - Full Width */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-top: 1px solid var(--border-color);
}

/* Dark Mode Toggle Row */
.theme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.theme-toggle-row:hover {
    background: var(--bg-secondary);
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
}

.theme-toggle-label svg {
    color: var(--text-tertiary);
}

/* Toggle Switch */
.theme-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    position: relative;
    transition: background 0.2s ease;
    border: 1px solid var(--border-color);
}

.theme-switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: var(--radius-full);
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Toggle switch active state (dark mode) */
[data-theme="dark"] .theme-switch {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .theme-switch-slider {
    transform: translateX(20px);
}

/* Full Width Logout Button */
.logout-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    border-radius: 0;
    margin-top: 0;
}

.logout-btn-full:hover {
    background: var(--error-bg);
    color: var(--error);
}

.logout-btn-full svg {
    flex-shrink: 0;
}

/* Show/hide sun/moon icons based on theme */
[data-theme="light"] .theme-toggle-label .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle-label .sun-icon { display: none; }

/* ========================================
   Admin Wizard Styles
   ======================================== */

.admin-wizard-container {
    max-width: 800px;
    margin: 0 auto;
}

.admin-wizard-container .wizard-card {
    padding: var(--space-xl);
}

.progress-label {
    text-align: center;
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Drag and Drop Styles */
.drop-zone {
    transition: all 0.3s ease;
    border: 2px dashed var(--border-color);
}

.drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.08);
    transform: scale(1.01);
}

.drop-zone.drag-over .file-upload-icon {
    color: var(--accent-primary);
    transform: translateY(-5px);
}

.drop-zone.drag-over .file-upload-text {
    color: var(--accent-primary);
}

.file-upload-zone {
    padding: var(--space-xl);
    text-align: center;
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: var(--bg-secondary);
}

.file-upload-zone:hover {
    border-color: var(--accent-secondary);
    background: var(--bg-tertiary);
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.file-upload-text {
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

.file-upload-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* File Preview Enhanced */
.file-preview .file-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-top: var(--space-xs);
    border: 1px solid var(--border-color);
}

.file-preview .file-name {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-preview .file-size {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.file-preview button {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.file-preview button:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

/* Admin Wizard Step Content */
.admin-wizard-container .step-content h2 {
    font-size: 22px;
    margin-bottom: var(--space-xs);
}

.admin-wizard-container .step-desc {
    margin-bottom: var(--space-lg);
}

/* Domain Options in Admin Wizard */
.admin-wizard-container .domain-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.admin-wizard-container .option-card {
    padding: var(--space-md);
}

.admin-wizard-container .option-card .option-content {
    text-align: left;
}

@media (max-width: 600px) {
    .admin-wizard-container .domain-options {
        grid-template-columns: 1fr;
    }
}

/* Resend Onboarding Section */
.resend-onboarding-section {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border-color);
}

.resend-onboarding-section .btn {
    gap: var(--space-xs);
}

.ml-sm {
    margin-left: var(--space-sm);
}

/* ========================================
   Chat System Styles - Modern Design
   ======================================== */

.chat-page {
    padding: 0 !important;
    height: calc(100vh - 60px);
    background: var(--bg-tertiary);
}

.chat-container {
    display: flex;
    height: 100%;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin: var(--space-md);
    height: calc(100% - var(--space-md) * 2);
}

/* Chat Sidebar */
.chat-sidebar {
    width: 340px;
    min-width: 340px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.chat-sidebar-header h2 {
    font-size: 20px;
    margin: 0;
    font-weight: 600;
}

.chat-sidebar-header .btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    backdrop-filter: blur(10px);
}

.chat-sidebar-header .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-search {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
}

.chat-search input {
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg-primary);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.chat-search input:focus {
    outline: none;
    box-shadow: var(--shadow-md), 0 0 0 2px var(--accent-primary);
}

.chat-search input::placeholder {
    color: var(--text-tertiary);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm) 0;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.conversations-empty {
    padding: var(--space-xxl);
    text-align: center;
    color: var(--text-tertiary);
}

.conversations-empty p {
    margin-bottom: var(--space-md);
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    margin: 0 var(--space-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius-lg);
    border: none;
}

.conversation-item:hover {
    background: var(--bg-secondary);
}

.conversation-item.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.conversation-item.active .conversation-time,
.conversation-item.active .conversation-preview,
.conversation-item.active .preview-author {
    color: rgba(255, 255, 255, 0.85);
}

.conversation-item.unread {
    background: rgba(79, 70, 229, 0.05);
}

.conversation-item.unread .conversation-name {
    font-weight: 600;
}

.conversation-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.conversation-avatar.group {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.conversation-avatar.online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 3px solid var(--bg-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.conversation-item.active .conversation-avatar.online::after {
    border-color: var(--accent-primary);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

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

.conversation-name {
    font-weight: 500;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    font-weight: 500;
}

.conversation-preview {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.preview-author {
    color: var(--text-tertiary);
    font-weight: 500;
}

.unread-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.conversation-item.active .unread-badge {
    background: white;
    color: var(--accent-primary);
}

/* Chat Main Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    position: relative;
}

.chat-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    padding: var(--space-xl);
}

.chat-empty-state svg {
    margin-bottom: var(--space-lg);
    opacity: 0.3;
    color: var(--accent-primary);
}

.chat-empty-state h3 {
    margin: 0 0 var(--space-sm);
    color: var(--text-primary);
    font-size: 20px;
}

.chat-empty-state p {
    color: var(--text-tertiary);
    max-width: 300px;
    text-align: center;
    line-height: 1.5;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.chat-header-status {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-status.online {
    color: #10b981;
    font-weight: 500;
}

.chat-header-actions {
    display: flex;
    gap: var(--space-xs);
}

.chat-header-actions .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
}

.chat-header-actions .btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chat-no-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.chat-date-separator {
    text-align: center;
    margin: var(--space-lg) 0;
    position: relative;
}

.chat-date-separator::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--border-color);
}

.chat-date-separator span {
    background: var(--bg-primary);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* Chat Message Bubbles */
.chat-message {
    display: flex;
    gap: var(--space-sm);
    max-width: 75%;
    position: relative;
    animation: messageSlideIn 0.3s ease;
    align-items: flex-start;
    margin-right: auto;
    margin-left: 0;
    /* Ensure consistent left padding for received messages */
    padding-left: 0;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own {
    margin-left: auto;
    margin-right: 0;
    flex-direction: row-reverse;
    padding-left: 0;
    padding-right: 0;
}

.chat-message.consecutive {
    margin-top: 2px;
}

.chat-message.consecutive .msg-avatar {
    visibility: hidden;
}

/* For messages without avatar, add left margin to align with messages that have avatar */
.chat-message:not(.own):not(:has(.msg-avatar)) {
    margin-left: calc(36px + var(--space-sm));
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    margin-top: 2px;
}

/* Placeholder for hidden avatar to maintain spacing */
.msg-avatar-placeholder {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.msg-content {
    background: var(--bg-primary);
    border-radius: 18px;
    border-top-left-radius: 4px;
    padding: var(--space-sm) var(--space-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
    min-width: 60px;
}

.chat-message.own .msg-content {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
    border: none;
}

.chat-message.consecutive .msg-content {
    border-top-left-radius: 18px;
}

.chat-message.own.consecutive .msg-content {
    border-top-right-radius: 18px;
    border-top-left-radius: 18px;
}

.msg-author {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.msg-text {
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: 6px;
    justify-content: flex-end;
}

.msg-time {
    font-size: 10px;
    opacity: 0.6;
    font-weight: 500;
}

.msg-edited {
    font-size: 10px;
    opacity: 0.5;
    font-style: italic;
}

.msg-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -80px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    padding: 4px;
    box-shadow: var(--shadow-md);
}

.chat-message.own .msg-actions {
    right: auto;
    left: -80px;
}

.chat-message:hover .msg-actions {
    opacity: 1;
}

.msg-actions button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-actions button:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* Message Attachments */
.msg-attachment {
    margin-bottom: var(--space-sm);
}

.msg-attachment.msg-image img {
    max-width: 280px;
    max-height: 220px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.msg-attachment.msg-image img:hover {
    transform: scale(1.02);
}

.msg-attachment.msg-file a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    font-size: var(--text-sm);
    transition: background 0.2s;
}

.msg-attachment.msg-file a:hover {
    background: rgba(0, 0, 0, 0.1);
}

.chat-message.own .msg-attachment.msg-file a {
    background: rgba(255, 255, 255, 0.15);
}

.chat-message.own .msg-attachment.msg-file a:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Chat Input */
.chat-input-area {
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-xs) var(--space-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.chat-input-form:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chat-attach-btn,
.chat-emoji-btn {
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all 0.2s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
}

.chat-attach-btn:hover,
.chat-emoji-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

.chat-attachment-preview {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    margin-bottom: var(--space-xs);
}

.chat-attachment-preview .attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-attachment-preview button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

.chat-attachment-preview button:hover {
    color: var(--error);
}

.chat-input-wrapper input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    font-size: 14px;
}

.chat-input-wrapper input:focus {
    outline: none;
}

.chat-input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* New Chat Modal */
.chat-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-lg);
}

.chat-tab {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.chat-tab:hover {
    color: var(--text-primary);
}

.chat-tab.active {
    background: var(--bg-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.user-select-list,
.user-checkbox-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
}

.user-select-list::-webkit-scrollbar,
.user-checkbox-list::-webkit-scrollbar {
    width: 6px;
}

.user-select-list::-webkit-scrollbar-thumb,
.user-checkbox-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.user-select-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

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

.user-select-item:hover {
    background: var(--bg-secondary);
}

.user-avatar-sm {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.user-avatar-sm.online::after {
    content: '';
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
}

.user-select-info {
    flex: 1;
}

.user-select-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.user-select-role {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: capitalize;
}

.online-indicator {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: onlinePulse 2s infinite;
}

.user-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

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

.user-checkbox-item:hover {
    background: var(--bg-secondary);
}

.user-checkbox-item input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.user-checkbox-item span {
    font-weight: 500;
}

/* Chat Sidebar Badge in Navigation */
.nav-badge {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-container {
        margin: 0;
        border-radius: 0;
        height: 100%;
    }
    
    .chat-sidebar {
        width: 100%;
        min-width: 100%;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 10;
        transform: translateX(0);
        transition: transform 0.3s;
    }

    .chat-sidebar.hidden {
        transform: translateX(-100%);
    }

    .chat-message {
        max-width: 88%;
    }
    
    .chat-messages {
        padding: var(--space-md);
    }
    
    .msg-actions {
        position: static;
        transform: none;
        opacity: 1;
        background: transparent;
        box-shadow: none;
        padding: 0;
        margin-top: var(--space-xs);
    }
    
    .chat-message.own .msg-actions {
        left: auto;
    }
}

/* Fix for empty user list in chat modal */
.user-select-list:empty::after,
.user-checkbox-list:empty::after {
    content: 'No other users available';
    display: block;
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-tertiary);
}

/* Ensure modal content scrolls properly */
#new-chat-modal .modal {
    max-height: 80vh;
    overflow-y: auto;
}

#new-chat-modal .modal-body {
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

/* ========================================
   Chat Enhanced Features Styles
   ======================================== */

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xl);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-primary);
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

.typing-text {
    font-weight: 500;
    color: var(--text-tertiary);
}

/* Message Reactions */
.msg-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--space-sm);
}

.reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.reaction:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.reaction.user-reacted {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(139, 92, 246, 0.15));
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.chat-message.own .reaction {
    background: rgba(255, 255, 255, 0.25);
}

.chat-message.own .reaction.user-reacted {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Reaction Picker */
.reaction-picker {
    display: flex;
    gap: 4px;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: pickerPop 0.2s ease;
}

@keyframes pickerPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.reaction-picker span {
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all 0.15s;
}

.reaction-picker span:hover {
    background: var(--bg-secondary);
    transform: scale(1.3);
}

/* Emoji Picker for Input */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: var(--space-md);
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    animation: pickerPop 0.2s ease;
}

.emoji-picker span {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all 0.15s;
}

.emoji-picker span:hover {
    background: var(--bg-secondary);
    transform: scale(1.2);
}

/* Chat Search Bar */
.chat-search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xl);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-search-bar input {
    flex: 1;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    font-size: 14px;
    transition: all 0.2s;
}

.chat-search-bar input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.search-close {
    background: var(--bg-secondary);
    border: none;
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Search Highlight */
.chat-message.search-highlight {
    animation: highlightPulse 2s ease-in-out;
}

.chat-message.search-highlight .msg-content {
    box-shadow: 0 0 0 3px var(--accent-primary), var(--shadow-lg);
}

@keyframes highlightPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Last Seen Status Styles */
.chat-header-status.online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    animation: onlinePulse 2s infinite;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

@keyframes onlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.85); }
}

/* Read Receipt Styles */
.msg-read-receipt {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.msg-read-receipt svg {
    width: 16px;
    height: 16px;
}

.msg-read-receipt.sent { color: rgba(255, 255, 255, 0.5); }
.msg-read-receipt.delivered { color: rgba(255, 255, 255, 0.7); }
.msg-read-receipt.read { color: #34d399; }

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.loading-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin-right: var(--space-sm);
    animation: spin 0.8s linear infinite;
}

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

/* Chat Error State */
.chat-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--error);
    text-align: center;
}

/* ========================================
   Onboarding Link Tracking Styles
   ======================================== */

.link-tracking-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--border-color);
}

.tracking-stat {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.tracking-stat svg {
    flex-shrink: 0;
}

.tracking-stat.tracking-opened svg {
    color: #10b981;
}

.tracking-stat.tracking-not-opened svg {
    color: var(--text-tertiary);
}

.tracking-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tracking-label {
    font-weight: 600;
    font-size: var(--text-sm);
}

.tracking-stat.tracking-opened .tracking-label {
    color: #10b981;
}

.tracking-value {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.tracking-details {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.tracking-detail {
    display: flex;
    gap: var(--space-xs);
    font-size: var(--text-xs);
}

.tracking-detail span:last-child {
    font-weight: 500;
}

/* ========================================
   Staging Section Styles
   ======================================== */

.staging-form .form-group {
    margin-bottom: var(--space-md);
}

.staging-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

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

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.password-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.staging-preview {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ========================================
   Discussion Section - Improved Design
   ======================================== */

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

.discussion-title-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.discussion-title-wrap .card-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.discussion-title-wrap .card-title svg {
    color: var(--accent-primary);
}

.discussion-count {
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
}

.discussion-body {
    padding: var(--space-lg);
}

/* Composer */
.discussion-composer {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-color);
}

.composer-avatar .user-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.composer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.composer-input-wrapper {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.composer-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.composer-input-wrapper textarea {
    width: 100%;
    border: none;
    background: transparent;
    padding: var(--space-md);
    font-size: 14px;
    resize: none;
    min-height: 60px;
    line-height: 1.5;
}

.composer-input-wrapper textarea:focus {
    outline: none;
}

.composer-input-wrapper textarea::placeholder {
    color: var(--text-tertiary);
}

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.composer-left-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.composer-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.composer-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.composer-actions .btn {
    padding: var(--space-sm) var(--space-lg);
}

/* Empty State */
.discussion-empty {
    text-align: center;
    padding: var(--space-xxl);
}

.discussion-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discussion-empty-icon svg {
    color: var(--accent-primary);
}

.discussion-empty h4 {
    margin: 0 0 var(--space-xs);
    font-size: 18px;
    color: var(--text-primary);
}

.discussion-empty p {
    color: var(--text-tertiary);
    margin: 0;
}

/* Discussion List */
.discussion-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Discussion Item */
.discussion-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    transition: background 0.2s ease;
}

.discussion-item:hover {
    background: var(--bg-secondary);
}

.discussion-avatar .user-avatar {
    width: 42px;
    height: 42px;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.discussion-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.discussion-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.discussion-role {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.discussion-dot {
    color: var(--text-tertiary);
    font-size: 10px;
}

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

.edited-badge {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

.discussion-message {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
}

.discussion-message .mention {
    color: var(--accent-primary);
    font-weight: 600;
    background: rgba(79, 70, 229, 0.1);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
}

/* Attachments */
.discussion-attachment {
    margin-top: var(--space-sm);
}

.attachment-image-preview {
    max-width: 300px;
    max-height: 200px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.attachment-image-preview:hover {
    transform: scale(1.02);
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.attachment-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.attachment-link svg {
    color: var(--accent-primary);
}

.attachment-size {
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

/* Discussion Actions */
.discussion-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.discussion-item:hover .discussion-actions {
    opacity: 1;
}

.discussion-actions button,
.discussion-actions .action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.discussion-actions button:hover,
.discussion-actions .action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* Reply Form */
.reply-form {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    gap: var(--space-sm);
}

.reply-form textarea {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    resize: none;
    min-height: 60px;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Replies */
.replies-container {
    margin-top: var(--space-md);
    margin-left: var(--space-xl);
    padding-left: var(--space-lg);
    border-left: 2px solid var(--border-color);
}

.reply-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.reply-item:hover {
    background: var(--bg-secondary);
}

.reply-item .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.file-name-display {
    font-size: var(--text-xs);
    color: var(--accent-primary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 600px) {
    .discussion-composer {
        flex-direction: column;
    }
    
    .composer-avatar {
        display: none;
    }
    
    .composer-actions {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: stretch;
    }
    
    .composer-actions .btn {
        justify-content: center;
    }
    
    .discussion-item {
        padding: var(--space-sm);
    }
    
    .discussion-actions {
        opacity: 1;
    }
    
    .replies-container {
        margin-left: var(--space-md);
        padding-left: var(--space-md);
    }
}

/* ========================================
   Staging Site Sidebar Styles
   ======================================== */

.staging-info {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.staging-link-preview {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent-primary);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: var(--space-sm);
    word-break: break-all;
}

.staging-link-preview:hover {
    text-decoration: underline;
}

.staging-credentials {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border-color);
}

.credential-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
}

.credential-label {
    color: var(--text-tertiary);
    min-width: 40px;
}

.credential-value {
    color: var(--text-primary);
    font-family: monospace;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.btn-icon-sm {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.staging-form-compact .form-group {
    margin-bottom: var(--space-sm);
}

.staging-form-compact label {
    font-size: var(--text-xs);
    margin-bottom: 4px;
}

.staging-form-compact input {
    padding: var(--space-sm);
    font-size: var(--text-sm);
}

.mt-sm {
    margin-top: var(--space-sm);
}

/* ========================================
   Staging Preview Modal
   ======================================== */
.staging-preview-modal {
    max-width: 95vw;
    width: 95vw;
    max-height: 95vh;
    height: 95vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.staging-preview-modal .modal-header {
    padding: var(--space-md) var(--space-lg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.staging-preview-modal .modal-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-base);
    font-weight: 600;
}

.staging-preview-modal .modal-title svg {
    color: var(--primary);
}

.staging-preview-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.staging-preview-body {
    padding: 0;
    flex: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.staging-iframe-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.staging-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Responsive adjustments for staging preview */
@media (max-width: 768px) {
    .staging-preview-modal {
        max-width: 100vw;
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    
    .staging-preview-modal .modal-header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .staging-preview-modal .modal-title {
        font-size: var(--text-sm);
    }
}

/* ========================================
   Collapsible Cards
   ======================================== */
.card-collapsible {
    overflow: hidden;
}

.card-header-collapsible {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

.card-header-collapsible:hover {
    background-color: var(--bg-tertiary);
}

.card-header-collapsible .card-title {
    margin: 0;
}

.collapse-icon {
    transition: transform 0.3s ease;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.card-collapsible.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.card-body-collapsible {
    transition: max-height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

.card-collapsible.collapsed .card-body-collapsible {
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: none;
}

/* ========================================
   Modern Discussion Section (SaaS Style)
   ======================================== */
.discussion-card {
    overflow: visible;
}

.discussion-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-color);
}

.discussion-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.discussion-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.discussion-header-text .card-title {
    margin: 0;
    font-size: var(--text-lg);
}

.discussion-subtitle {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.discussion-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.discussion-badge {
    background: var(--primary);
    color: white;
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    min-width: 28px;
    text-align: center;
}

.discussion-badge-label {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.discussion-body-modern {
    padding: var(--space-lg);
    background: var(--bg-primary);
}

/* Modern Composer */
.discussion-composer-modern {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.discussion-composer-modern:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.composer-avatar-modern {
    flex-shrink: 0;
}

.user-avatar-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.composer-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.composer-input-modern {
    position: relative;
}

.composer-input-modern textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    font-size: var(--text-base);
    line-height: 1.5;
    padding: var(--space-sm) 0;
    min-height: 24px;
    max-height: 200px;
    color: var(--text-primary);
}

.composer-input-modern textarea:focus {
    outline: none;
}

.composer-input-modern textarea::placeholder {
    color: var(--text-tertiary);
}

.composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
}

.composer-toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
    background: none;
    border: none;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-post {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-weight: 500;
}

.btn-post .btn-text {
    display: inline;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.file-preview .remove-file {
    color: var(--error);
    cursor: pointer;
}

/* Divider */
.discussion-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-text {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Empty State */
.discussion-empty-modern {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.empty-illustration {
    margin-bottom: var(--space-lg);
    color: var(--text-tertiary);
    opacity: 0.5;
}

.discussion-empty-modern h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.discussion-empty-modern p {
    color: var(--text-tertiary);
    max-width: 300px;
    margin: 0 auto;
}

/* Comment List */
.discussion-list-modern {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Comment Card */
.comment-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.comment-card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.comment-main {
    display: flex;
    gap: var(--space-md);
}

.comment-avatar .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.user-avatar-admin {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
}

.user-avatar-manager {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-role-badge {
    font-size: var(--text-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.role-admin {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.role-manager {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.comment-meta-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.comment-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.edited-indicator {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
}

/* Action Menu */
.comment-actions-menu,
.reply-actions-menu {
    position: relative;
}

.action-menu-trigger,
.action-menu-trigger-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}

.comment-card:hover .action-menu-trigger,
.reply-card:hover .action-menu-trigger-sm {
    opacity: 1;
}

.action-menu-trigger:hover,
.action-menu-trigger-sm:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.action-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 100;
    display: none;
    overflow: hidden;
}

.action-menu-dropdown.active {
    display: block;
    animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.action-menu-dropdown button {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    text-align: left;
    font-size: var(--text-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.action-menu-dropdown button:hover {
    background: var(--bg-secondary);
}

.action-menu-dropdown button.danger {
    color: var(--error);
}

.action-menu-dropdown button.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Comment Text */
.comment-text,
.reply-text {
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
}

.mention-tag {
    color: var(--primary);
    font-weight: 500;
    background: rgba(var(--primary-rgb), 0.1);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
}

/* Attachments */
.comment-attachment,
.reply-attachment {
    margin-top: var(--space-md);
}

.attachment-image {
    display: block;
    max-width: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.attachment-image img {
    width: 100%;
    height: auto;
    display: block;
}

.attachment-image-sm {
    max-width: 200px;
}

.attachment-file {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    max-width: fit-content;
    transition: all 0.15s ease;
}

.attachment-file:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
}

.file-icon {
    color: var(--primary);
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: var(--text-sm);
    font-weight: 500;
}

.file-size {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.file-download {
    color: var(--text-tertiary);
}

/* Quick Actions */
.comment-quick-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: none;
    border: none;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.quick-action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
}

.replies-count {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* Inline Forms */
.inline-edit-form,
.inline-reply-form {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.inline-edit-form textarea,
.inline-reply-form textarea {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    resize: vertical;
    min-height: 60px;
    background: var(--bg-primary);
}

.inline-edit-form textarea:focus,
.inline-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.inline-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

/* Replies Thread */
.replies-thread {
    margin-top: var(--space-md);
    margin-left: var(--space-xl);
    padding-left: var(--space-md);
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.reply-card {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    transition: background 0.15s ease;
}

.reply-card:hover {
    background: var(--bg-tertiary);
}

.reply-avatar .user-avatar-sm,
.user-avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.reply-body {
    flex: 1;
    min-width: 0;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    flex-wrap: wrap;
}

.reply-author {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.reply-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.reply-text {
    font-size: var(--text-sm);
}

/* Loading States */
.comment-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn-post.loading {
    pointer-events: none;
}

.btn-post.loading .btn-text {
    display: none;
}

.btn-post.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .discussion-header-modern {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .discussion-composer-modern {
        flex-direction: column;
    }
    
    .composer-avatar-modern {
        display: none;
    }
    
    .comment-main {
        flex-direction: column;
    }
    
    .comment-avatar {
        display: none;
    }
    
    .replies-thread {
        margin-left: var(--space-md);
    }
    
    .btn-post .btn-text {
        display: none;
    }
}

/* ========================================
   Inactivity Modal
   ======================================== */
.inactivity-modal {
    max-width: 420px;
    text-align: center;
    padding: var(--space-2xl);
    border-radius: var(--radius-xl);
    animation: inactivityPulse 2s ease-in-out infinite;
}

@keyframes inactivityPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--warning-rgb, 245, 158, 11), 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(var(--warning-rgb, 245, 158, 11), 0); }
}

.inactivity-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.inactivity-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.inactivity-message {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.inactivity-message span {
    font-weight: 700;
    color: #ef4444;
}

.inactivity-submessage {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-xl);
}

.inactivity-modal .btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    width: 100%;
    justify-content: center;
    gap: var(--space-sm);
}

.inactivity-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-lg);
}

/* ========================================
   Admin Notifications Bell
   ======================================== */
.notification-wrapper {
    position: relative;
}

.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-bell:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.notification-bell .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: #ef4444;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.notification-bell.has-unread {
    animation: bellShake 0.5s ease-in-out;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.notification-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.notification-header h4 {
    font-size: var(--text-sm);
    font-weight: 600;
    margin: 0;
}

.notification-header button {
    font-size: var(--text-xs);
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
}

.notification-header button:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 380px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: rgba(var(--primary-rgb), 0.05);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

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

.notification-icon.inactivity {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.notification-icon.alert {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.notification-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

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

.notification-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-text {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 4px;
}

.notification-empty {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-tertiary);
}

.notification-empty svg {
    margin-bottom: var(--space-sm);
    opacity: 0.5;
}

.notification-empty p {
    font-size: var(--text-sm);
}

/* ========================================
   Profile Dropdown
   ======================================== */
.profile-dropdown-wrapper {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-trigger:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.profile-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-chevron {
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.profile-dropdown-wrapper.active .profile-chevron {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.profile-dropdown.active {
    display: block;
    animation: profileDropdownFadeIn 0.2s ease;
}

@keyframes profileDropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-secondary);
}

.profile-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: 600;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.profile-dropdown-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-dropdown-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--text-base);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-email {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-role {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    width: fit-content;
    margin-top: 4px;
}

.profile-dropdown-role.role-admin {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.profile-dropdown-role.role-manager {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.profile-dropdown-menu {
    padding: var(--space-sm);
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all 0.15s ease;
}

.profile-dropdown-item:hover {
    background: var(--bg-secondary);
}

.profile-dropdown-item svg {
    color: var(--text-tertiary);
}

.profile-dropdown-item:hover svg {
    color: var(--primary);
}

/* ========================================
   Premium Onboarding Animations
   ======================================== */

/* Clean White Background */
.client-page {
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    min-height: 100vh;
    padding: var(--space-md);
}

.client-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
    animation: gradientShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Floating Particles Container - Hidden for clean look */
.particles-container {
    display: none;
}

.particle,
.particle-glow {
    display: none;
}

/* Wizard Container Enhancement */
.wizard-container {
    position: relative;
    z-index: 10;
    animation: containerEntrance 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    max-width: 680px;
    margin: 0 auto;
    padding: var(--space-md);
}

@keyframes containerEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium Card Styling */
.wizard-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 40px -12px rgba(99, 102, 241, 0.15);
    position: relative;
    overflow: visible;
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
}

.wizard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Dark theme adjustments */
[data-theme="dark"] .wizard-card {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

/* Enhanced Progress Steps */
.progress-steps {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    position: relative;
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-md);
}

.progress-steps::before {
    display: none;
}

.progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.progress-step.active {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.progress-step.completed {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.progress-step.completed::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}

/* Welcome Step Premium Styling */
.step-welcome {
    text-align: center;
    padding: var(--space-lg) 0;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    color: white;
    position: relative;
    animation: welcomeIconFloat 3s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.welcome-icon::before {
    display: none;
}

.welcome-icon::after {
    display: none;
}

.welcome-icon svg {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
}

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

@keyframes borderRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Typing Animation for Welcome Text */
.welcome-title {
    display: inline-block;
    font-size: 24px !important;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.typing-complete .welcome-title {
    border-right: none;
}

/* Welcome Features Animation */
.welcome-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.welcome-features .feature {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    opacity: 1;
    transform: none;
    transition: all 0.2s ease;
}

.welcome-features .feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.welcome-features .feature svg {
    color: #10b981;
    width: 14px;
    height: 14px;
}

/* Step Content Animations */
.step-content {
    animation: stepFadeIn 0.3s ease forwards;
}

@keyframes stepFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.step-desc {
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
}

[data-theme="dark"] .step-content h2,
[data-theme="dark"] .welcome-title {
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Form Group - No animation delays */
.form-group {
    opacity: 1;
    transform: none;
    margin-bottom: var(--space-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Premium Input Styling */
.wizard-card input,
.wizard-card select,
.wizard-card textarea {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    border: 2px solid var(--border-color);
}

.wizard-card input:focus,
.wizard-card select:focus,
.wizard-card textarea:focus {
    border-color: #6366f1;
    box-shadow: 
        0 0 0 4px rgba(99, 102, 241, 0.15),
        0 10px 30px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

/* Option Cards */
.option-card {
    position: relative;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    background: var(--bg-primary);
}

.option-card:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.02);
}

.option-card.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.option-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-card.selected .option-icon {
    background: #6366f1;
    color: white;
}

/* Wizard Navigation Buttons */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.wizard-nav .btn {
    transition: all 0.2s ease;
    font-weight: 500;
    padding: 10px 20px;
    font-size: var(--text-sm);
}

.wizard-nav .btn-primary {
    background: #6366f1;
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.wizard-nav .btn-primary:hover {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.wizard-nav .btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
}

/* File Upload Zone */
.file-upload-zone {
    position: relative;
    transition: all 0.2s ease;
    border: 2px dashed var(--border-color);
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    text-align: center;
}

.file-upload-zone:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.file-upload-zone:hover .file-upload-icon {
    color: #6366f1;
}

.file-upload-icon {
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    margin: 0 auto var(--space-sm);
    color: var(--text-tertiary);
}

/* Drag Over State */
.file-upload-zone.drag-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

/* File Preview */
.file-preview {
    margin-top: var(--space-sm);
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
}

.file-preview-item img {
    object-fit: cover;
}

.file-preview-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove-file {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.btn-remove-file:hover {
    color: #ef4444;
}

/* ========================================
   Form Section Header
   ======================================== */
.form-section-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.form-section-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.form-section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.form-section-desc {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin: 0;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

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

/* Form Labels with Icons */
.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

.form-group label svg {
    color: var(--text-tertiary);
}

.form-group label .required {
    color: #ef4444;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

/* Option Toggle Card */
.option-toggle-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.option-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.option-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.option-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.option-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.option-toggle input:checked + .option-toggle-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

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

.option-toggle-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.option-toggle-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.option-toggle-content strong {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.option-toggle-content span {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ========================================
   Success Card Styles
   ======================================== */
.success-icon-large {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    color: white;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.link-copy-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: left;
}

.link-copy-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.link-copy-input-group {
    display: flex;
    gap: var(--space-sm);
}

.link-copy-input {
    flex: 1;
    font-size: var(--text-sm);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
}

.link-copy-btn {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md) !important;
}

.send-email-box {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: left;
}

.send-email-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.send-email-content {
    flex: 1;
}

.send-email-content strong {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.send-email-content span {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ========================================
   Profile Page Styles
   ======================================== */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

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

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.profile-sidebar .profile-card {
    text-align: center;
}

.profile-sidebar .profile-card .card-body {
    padding: var(--space-xl);
}

.profile-sidebar .profile-avatar-section {
    margin-bottom: var(--space-md);
}

.profile-sidebar .avatar-circle {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 36px;
    font-weight: 700;
    color: white;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    border: 4px solid white;
}

.profile-sidebar .profile-user-name {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.profile-sidebar .profile-user-email {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin: 0 0 var(--space-md) 0;
    word-break: break-all;
}

.profile-sidebar .profile-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    color: #6366f1;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.profile-sidebar .profile-stats {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.profile-sidebar .profile-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.profile-sidebar .profile-stat-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-sidebar .profile-stat-value {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 var(--space-md) 0;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
}

.info-label {
    color: var(--text-tertiary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Button Large Variant */
.btn-lg {
    padding: 12px 24px !important;
    font-size: var(--text-base) !important;
}

/* Button Small Variant */
.btn-sm {
    padding: 6px 12px !important;
    font-size: var(--text-xs) !important;
}

/* Error Page Animation */
.client-error {
    animation: errorShake 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.client-error .error-icon {
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 30px 10px rgba(239, 68, 68, 0.2); }
}

/* Confetti Animation for Success */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f00;
    animation: confettiFall 3s linear forwards;
    z-index: 1000;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Success Celebration */
.success-celebration {
    animation: celebrationBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebrationBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Loading Spinner Premium */
.wizard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.wizard-loading .dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    animation: loadingBounce 1.4s ease-in-out infinite;
}

.wizard-loading .dot:nth-child(1) { animation-delay: 0s; }
.wizard-loading .dot:nth-child(2) { animation-delay: 0.2s; }
.wizard-loading .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Ripple Effect on Click */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Mobile Responsive Animations */
@media (max-width: 640px) {
    .welcome-icon {
        width: 100px;
        height: 100px;
    }
    
    .progress-step {
        width: 36px;
        height: 36px;
    }
    
    .progress-step.active {
        transform: scale(1.15);
    }
    
    .welcome-features .feature {
        font-size: var(--text-xs);
        padding: var(--space-xs) var(--space-md);
    }
}

/* Smooth Scrollbar */
.wizard-card::-webkit-scrollbar {
    width: 6px;
}

.wizard-card::-webkit-scrollbar-track {
    background: transparent;
}

.wizard-card::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 3px;
}

/* Glassmorphism Info Box */
.info-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-lg);
    animation: infoBoxSlide 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes infoBoxSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Magnetic Hover Effect */
.magnetic-hover {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Text Gradient Animation */
.animated-gradient-text {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 5s ease infinite;
}

@keyframes gradientText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Welcome Stats Section */
.welcome-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin: var(--space-xl) 0;
    padding: var(--space-lg) 0;
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    right: calc(-1 * var(--space-xl));
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--border-color), transparent);
}

.stat-item:last-child::after {
    display: none;
}

.stat-number {
    display: block;
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: var(--space-xs);
}

/* Welcome CTA / Scroll Indicator */
.welcome-cta {
    margin-top: var(--space-xl);
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.scroll-indicator svg {
    animation: bounceDown 2s ease-in-out infinite;
    color: #6366f1;
}

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

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Welcome Title Wrapper */
.welcome-title-wrapper {
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.welcome-title {
    font-size: 32px !important;
    font-weight: 700;
    margin: 0;
    padding-right: 5px;
}

/* Welcome Subtitle Enhanced */
.welcome-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.welcome-text {
    color: var(--text-tertiary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

.welcome-text strong {
    color: #6366f1;
    font-weight: 600;
}

/* Mobile Responsive Stats */
@media (max-width: 640px) {
    .welcome-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }
    
    .stat-item::after {
        display: none;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .welcome-title {
        font-size: 24px !important;
    }
}

/* Progress Step Connector Line Animation */
.progress-steps::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #6366f1);
    transform: translateY(-50%);
    z-index: 0;
    transition: width 0.5s ease;
    border-radius: 2px;
}

/* Hover glow effect on cards */
.wizard-card:hover {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 100px rgba(99, 102, 241, 0.1);
}

/* Smooth Step Transitions */
.wizard-step {
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Premium Label Styling */
.wizard-card label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    display: block;
    transition: color 0.3s ease;
}

.wizard-card .form-group:focus-within label {
    color: #6366f1;
}

/* Form Hint Enhancement */
.form-hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
    display: block;
    opacity: 0.8;
}

/* Checkbox Item Enhanced */
.checkbox-item {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.checkbox-item:hover {
    transform: translateX(5px);
    border-color: rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}

/* File Preview Enhanced */
.file-preview .file-item {
    animation: slideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Pulse animation for required fields */
.wizard-card input:required:invalid:not(:focus),
.wizard-card select:required:invalid:not(:focus),
.wizard-card textarea:required:invalid:not(:focus) {
    animation: subtlePulse 2s ease-in-out infinite;
}

@keyframes subtlePulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1); }
}

/* Success page premium styling */
.client-success {
    animation: successEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successEntrance {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.client-success-icon {
    animation: successIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards;
}

@keyframes successIconPop {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.profile-dropdown-logout {
    color: var(--error);
}

.profile-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.profile-dropdown-logout svg {
    color: var(--error);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-name {
        display: none;
    }
    
    .profile-trigger {
        padding: var(--space-xs);
    }
    
    .profile-chevron {
        display: none;
    }
    
    .profile-dropdown {
        width: 260px;
        right: -10px;
    }
}
